/* ZPD+A FileHub — visual wireframe
   Brand: zpdarch.com — Helvetica, black on white, navy #0C3C60 accent, Swiss minimal */

:root {
  --ink: #0e0e0e;
  --ink-2: #4a4a4a;
  --ink-3: #8a8a8a;
  --line: #e6e6e6;
  --line-mid: #d0d0d0;
  --paper: #ffffff;
  --panel: #f7f7f5;
  --navy: #0c3c60;
  --navy-soft: #eef3f7;
  --good: #1a7f37;
  --warn: #9a6700;
  --bad: #b42318;
  --good-bg: #eaf5ee;
  --warn-bg: #f9f2e2;
  --bad-bg: #fbeae7;
  --radius: 2px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  accent-color: var(--navy);
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- type ---------- */

.wordmark { font-weight: 700; font-size: 21px; letter-spacing: -0.01em; color: var(--ink); }
.wordmark a { color: var(--ink); text-decoration: none; }

.kicker {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}

.kicker.dark { color: var(--ink); }

h1.page-title { font-size: 27px; font-weight: 300; letter-spacing: -0.01em; margin: 2px 0 4px; }
.page-sub { color: var(--ink-2); font-size: 13.5px; }

/* ---------- app shell ---------- */

.shell { display: grid; grid-template-columns: 208px 1fr; min-height: 100vh; }

.rail {
  border-right: 1px solid var(--line);
  padding: 26px 0 20px;
  display: flex; flex-direction: column; gap: 0;
  position: sticky; top: 0; height: 100vh;
}

.rail .brand { padding: 0 22px 22px; border-bottom: 1px solid var(--line); }
.rail .brand .kicker { margin-top: 3px; }

.rail nav { padding: 14px 0; flex: 1; }

.rail nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 22px;
  color: var(--ink-2);
  font-size: 13.5px;
  text-decoration: none;
  border-left: 2px solid transparent;
}
.rail nav a svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.5; flex: none; }
.rail nav a:hover { color: var(--ink); }
.rail nav a.active { color: var(--ink); border-left-color: var(--ink); font-weight: 500; }

.rail .rail-foot { padding: 16px 22px 0; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 15px 30px;
  border-bottom: 1px solid var(--line);
}

.topbar .search {
  flex: 1; max-width: 430px;
  display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line-mid);
  padding: 7px 12px;
  color: var(--ink-3);
  border-radius: var(--radius);
  font-size: 13px;
}
.topbar .search svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.6; }

.topbar .spacer { flex: 1; }

.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.03em;
}
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }

.content { padding: 30px; flex: 1; }
.content.narrow { max-width: 1060px; width: 100%; margin: 0 auto; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 13px; font-weight: 500;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: var(--ink); color: #fff;
  cursor: pointer;
  text-decoration: none !important;
}
.btn { transition: background 0.13s, border-color 0.13s, color 0.13s; }
.btn:hover { background: #2b2b2b; }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.secondary:hover { background: var(--panel); }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--line-mid); }
.btn.ghost:hover { color: var(--ink); border-color: var(--ink); background: transparent; }
.btn.small { padding: 6px 11px; font-size: 12px; }
.btn.wide { justify-content: center; width: 100%; padding: 12px 16px; font-size: 13.5px; }
.btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.7; }

.btn-link { background: none; border: none; color: var(--navy); font: inherit; font-size: 12.5px; cursor: pointer; padding: 0; }
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--bad); }

/* ---------- file type chip ---------- */

.ftype {
  width: 34px; height: 40px; flex: none;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 4px;
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.08em;
  position: relative;
  background: #fff;
}
.ftype::before {
  content: ""; position: absolute; top: 0; right: 0;
  width: 9px; height: 9px;
  background: var(--paper);
  border-left: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}
.ftype.small { width: 28px; height: 33px; font-size: 7.5px; }
.ftype.folder { border: 1px solid var(--ink); background: var(--panel); align-items: center; padding-bottom: 0; }
.ftype.folder::before { display: none; }
.ftype.dwg, .ftype.rvt { border-color: var(--navy); color: var(--navy); }
.ftype.dwg::before, .ftype.rvt::before { border-color: var(--navy); }

/* ---------- tables ---------- */

table.grid { width: 100%; border-collapse: collapse; }
table.grid th {
  text-align: left; font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500;
  padding: 0 14px 10px; border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}
table.grid td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid td { transition: background 0.1s; }
table.grid tr:hover td { background: #fbfbfa; }
table.grid td.num, table.grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.grid td:last-child { white-space: nowrap; }
table.grid .filecell { display: flex; align-items: center; gap: 13px; min-width: 0; }
table.grid .filecell .name { font-weight: 500; color: var(--ink); }
table.grid .filecell .meta { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }

/* ---------- status chips ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 500;
  padding: 3px 9px; border-radius: 20px;
  white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.good { color: var(--good); background: var(--good-bg); }
.chip.warn { color: var(--warn); background: var(--warn-bg); }
.chip.bad { color: var(--bad); background: var(--bad-bg); }
.chip.neutral { color: var(--ink-2); background: var(--panel); }
.chip.navy { color: var(--navy); background: var(--navy-soft); }

/* ---------- panels / cards ---------- */

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.panel .panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.panel .panel-head .kicker { color: var(--ink); }
.panel .panel-body { padding: 18px; }

/* ---------- stat tiles ---------- */

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 26px; }
.stat { padding: 18px 20px 16px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat .kicker { margin-bottom: 10px; }
.stat .value { font-size: 30px; font-weight: 300; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.stat .delta.good { color: var(--good); }
.stat .delta.warn { color: var(--warn); }
.stat .delta.bad { color: var(--bad); }

/* ---------- tabs ---------- */

.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs a {
  padding: 0 2px 12px; color: var(--ink-3); font-size: 13.5px; text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.tabs a:hover { color: var(--ink); text-decoration: none; }

/* ---------- files layout ---------- */

.files-layout { display: grid; grid-template-columns: 230px 1fr 300px; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); min-height: 560px; }

.tree { border-right: 1px solid var(--line); padding: 16px 0; }
.tree .kicker { padding: 0 18px 10px; }
.tree ul { list-style: none; }
.tree li a {
  display: flex; align-items: baseline; gap: 8px;
  padding: 7px 18px; color: var(--ink-2); font-size: 13px; text-decoration: none;
}
.tree li a .pnum { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; }
.tree li a:hover { color: var(--ink); }
.tree li a.active { color: var(--ink); font-weight: 500; background: var(--panel); box-shadow: inset 2px 0 0 var(--ink); }
.tree .sub { padding-left: 14px; }
.tree .sub li a { font-size: 12.5px; padding: 5px 18px; }

.filepane { min-width: 0; display: flex; flex-direction: column; }
.filepane .crumbs {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3);
}
.filepane .crumbs b { color: var(--ink); font-weight: 500; }
.filepane .crumbs .sep { color: var(--line-mid); }
.filepane .toolbar { display: flex; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: center; }
.filepane table.grid th:first-child, .filepane table.grid td:first-child { padding-left: 18px; }

.detail { border-left: 1px solid var(--line); padding: 20px; }
.detail .thumb {
  height: 180px; border: 1px solid var(--line);
  background:
    linear-gradient(135deg, transparent 49.6%, var(--line) 49.6%, var(--line) 50.4%, transparent 50.4%),
    linear-gradient(45deg, transparent 49.6%, var(--line) 49.6%, var(--line) 50.4%, transparent 50.4%),
    var(--panel);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.detail dl { display: grid; grid-template-columns: 86px 1fr; row-gap: 7px; font-size: 12.5px; margin: 14px 0 18px; }
.detail dt { color: var(--ink-3); }
.detail dd { color: var(--ink); }

/* ---------- modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(14,14,14,0.32);
  display: none; align-items: flex-start; justify-content: center; padding: 60px 20px;
  z-index: 50;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: #fff; width: 560px; max-width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 18px 60px rgba(0,0,0,0.22);
}
.modal .modal-head { padding: 20px 24px 0; }
.modal .modal-body { padding: 18px 24px 6px; }
.modal .modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 24px 22px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 7px; font-weight: 500; }
.field input[type="text"], .field input[type="email"], .field textarea, .field select {
  width: 100%; font: inherit; font-size: 13.5px;
  padding: 9px 12px; border: 1px solid var(--line-mid); border-radius: var(--radius);
  background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--navy); }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.toggle-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.toggle-row:first-of-type { border-top: none; }
.toggle-row .tlabel { flex: 1; }
.toggle-row .tlabel b { display: block; font-size: 13.5px; font-weight: 500; }
.toggle-row .tlabel span { font-size: 12px; color: var(--ink-3); }
.switch { width: 34px; height: 20px; border-radius: 20px; background: var(--line-mid); position: relative; flex: none; margin-top: 2px; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left 0.12s; }
.switch.on { background: var(--navy); }
.switch.on::after { left: 16px; }

.selected-files { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.selected-files .sf { display: flex; align-items: center; gap: 11px; padding: 9px 13px; border-bottom: 1px solid var(--line); font-size: 13px; }
.selected-files .sf:last-child { border-bottom: none; }
.selected-files .sf .sz { margin-left: auto; color: var(--ink-3); font-size: 12px; }

/* ---------- external pages ---------- */

.ext-wrap { min-height: 100vh; display: flex; flex-direction: column; }
.ext-head { padding: 34px 40px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--ink); }
.ext-head .tagline { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-2); }
.ext-main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 54px 24px 70px; }
.ext-kicker-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ext-title { font-size: 38px; font-weight: 300; letter-spacing: -0.018em; line-height: 1.16; margin-bottom: 12px; }
.ext-meta { color: var(--ink-2); font-size: 13.5px; margin-bottom: 6px; }
.ext-note {
  border-left: 2px solid var(--ink); padding: 4px 0 4px 16px;
  color: var(--ink-2); font-size: 13.5px; margin: 26px 0;
}
.ext-files { border-top: 1px solid var(--ink); margin-top: 30px; }
.ext-file { display: flex; align-items: center; gap: 16px; padding: 15px 2px; border-bottom: 1px solid var(--line); }
.ext-file .name { font-weight: 500; }
.ext-file .meta { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.ext-file .acts { margin-left: auto; display: flex; gap: 8px; flex: none; }
.ext-actions { display: flex; gap: 12px; margin-top: 28px; }
.ext-foot { border-top: 1px solid var(--line); padding: 22px 40px; display: flex; justify-content: space-between; gap: 20px; font-size: 11.5px; color: var(--ink-3); }

.trust-line { display: flex; gap: 22px; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); }
.trust-line span { display: flex; align-items: center; gap: 7px; }
.trust-line svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 1.6; }

/* ---------- auth pages ---------- */

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-visual {
  background:
    linear-gradient(0deg, rgba(12,60,96,0.88), rgba(12,60,96,0.88)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 80px),
    #0c3c60;
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-visual .wordmark { color: #fff; font-size: 24px; }
.auth-visual .big {
  font-size: 33px; font-weight: 300; line-height: 1.32; max-width: 440px; letter-spacing: -0.012em;
}
.auth-visual .tag { font-size: 10.5px; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(255,255,255,0.65); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 360px; }
.auth-card .kicker { margin-bottom: 8px; }
.auth-card h1 { font-size: 24px; font-weight: 400; margin-bottom: 6px; }
.auth-card p { color: var(--ink-2); font-size: 13.5px; margin-bottom: 26px; }
.ms-btn {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  width: 100%; padding: 12px; font: inherit; font-size: 13.5px; font-weight: 500;
  border: 1px solid var(--ink); background: var(--ink); color: #fff; border-radius: var(--radius); cursor: pointer;
}
.ms-btn:hover { background: #2b2b2b; }
.ms-logo { width: 15px; height: 15px; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5px; flex: none; }
.ms-logo i { background: #fff; }
.auth-foot { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); line-height: 1.7; }

/* ---------- OTP ---------- */

.otp-row { display: flex; gap: 9px; margin: 18px 0 8px; }
.otp-row input {
  width: 46px; height: 54px; text-align: center; font: inherit; font-size: 21px;
  border: 1px solid var(--line-mid); border-radius: var(--radius);
}
.otp-row input:focus { outline: none; border-color: var(--navy); }

/* ---------- upload / dropzone ---------- */

.dropzone {
  border: 1.5px dashed var(--line-mid); border-radius: var(--radius);
  padding: 46px 20px; text-align: center; color: var(--ink-2);
  margin: 26px 0 18px; cursor: pointer;
}
.dropzone:hover { border-color: var(--navy); color: var(--navy); }
.dropzone .kicker { margin-top: 8px; }
.upload-row { display: flex; align-items: center; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.upload-row > div:nth-child(2) { flex: 1; min-width: 0; }
.upload-row .bar { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.upload-row .bar i { display: block; height: 100%; background: var(--navy); }
.upload-row .pct { font-size: 12px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; flex: none; white-space: nowrap; }

/* ---------- ask / RAG ---------- */

.ask-box { border: 1px solid var(--ink); border-radius: var(--radius); display: flex; align-items: center; gap: 12px; padding: 4px 6px 4px 18px; margin-bottom: 10px; }
.ask-box input { flex: 1; border: none; font: inherit; font-size: 15px; padding: 12px 0; }
.ask-box input:focus { outline: none; }
.answer { border-left: 2px solid var(--navy); padding: 2px 0 2px 20px; margin: 26px 0; }
.answer p { font-size: 14.5px; line-height: 1.75; color: var(--ink); margin-bottom: 12px; max-width: 680px; }
.answer .cite {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 4px;
  border: 1px solid var(--navy); border-radius: 2px;
  color: var(--navy); font-size: 10.5px; font-weight: 600;
  vertical-align: 2px; margin: 0 2px; cursor: pointer;
}
.source-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.source-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; gap: 12px; align-items: flex-start; }
.source-card .n {
  flex: none; width: 18px; height: 18px; border: 1px solid var(--navy); border-radius: 2px;
  color: var(--navy); font-size: 10.5px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.source-card .name { font-size: 12.5px; font-weight: 500; line-height: 1.4; }
.source-card .path { font-size: 11px; color: var(--ink-3); margin-top: 3px; word-break: break-all; }

/* ---------- chart ---------- */

.chart-wrap { padding: 6px 2px 0; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; border-bottom: 1px solid var(--ink); padding: 0 4px; }
.chart .bar {
  flex: 1; background: var(--navy);
  border-radius: 3px 3px 0 0;
  min-height: 2px; position: relative; cursor: pointer;
}
.chart .bar:hover { background: #1d5a8a; }
.chart .bar .tip {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 11px; padding: 5px 9px; border-radius: 2px; white-space: nowrap; z-index: 5;
}
.chart .bar:hover .tip { display: block; }
.chart .bar .toplabel { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: 10.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chart-x { display: flex; gap: 6px; padding: 7px 4px 0; }
.chart-x span { flex: 1; text-align: center; font-size: 10px; color: var(--ink-3); }

/* ---------- wireframe navigator ---------- */

.wf-nav {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  background: var(--ink); color: #fff; border-radius: 3px;
  font-size: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.wf-nav .wf-head { display: flex; align-items: center; gap: 10px; padding: 9px 13px; cursor: pointer; }
.wf-nav .wf-head .kicker { color: rgba(255,255,255,0.6); }
.wf-nav .wf-list { display: none; border-top: 1px solid rgba(255,255,255,0.16); padding: 6px 0; }
.wf-nav.open .wf-list { display: block; }
.wf-nav .wf-list a { display: block; padding: 7px 14px; color: rgba(255,255,255,0.78); text-decoration: none; }
.wf-nav .wf-list a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.wf-nav .wf-list a.here { color: #fff; font-weight: 600; }

/* ---------- misc ---------- */

.empty-note { border: 1px dashed var(--line-mid); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--ink-3); font-size: 13px; }
.divider-label { display: flex; align-items: center; gap: 14px; margin: 30px 0 16px; }
.divider-label::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: 26px; align-items: start; }
.flag-row td { background: var(--warn-bg) !important; }

/* keep the wireframe pill clear of external-page footers */
.ext-foot { padding-right: 190px; }

/* ---------- functional prototype additions ---------- */

/* file-server origin bar (Files tab) */
.server-bar {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 30px;
  background: var(--navy-soft);
  border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2);
}
.server-bar svg { width: 15px; height: 15px; stroke: var(--navy); fill: none; stroke-width: 1.5; flex: none; }
.server-bar .sb-text { line-height: 1.45; }
.server-bar .sb-text b { color: var(--ink); font-weight: 600; }
.server-bar .sb-tag {
  margin-left: auto; flex: none; white-space: nowrap;
  color: var(--navy); font-size: 11px; letter-spacing: 0.04em;
  border: 1px solid var(--navy-soft); background: #fff;
  border-radius: 20px; padding: 3px 11px;
}

/* UNC host prefix in the breadcrumb */
.filepane .crumbs .crumb-host {
  font-weight: 600; color: var(--navy);
  font-family: "SFMono-Regular", ui-monospace, "Consolas", monospace;
  font-size: 12px;
}

/* live search input in the topbar */
.topbar .search.live { color: var(--ink); }
.topbar .search.live input {
  flex: 1; border: none; font: inherit; font-size: 13px; color: var(--ink);
  background: transparent; padding: 0;
}
.topbar .search.live input:focus { outline: none; }
.topbar .search.live input::placeholder { color: var(--ink-3); }

/* toasts */
.toast-stack {
  position: fixed; left: 20px; bottom: 20px; z-index: 120;
  display: flex; flex-direction: column; gap: 10px; max-width: 380px;
}
.toast {
  background: var(--ink); color: #fff;
  padding: 12px 16px; border-radius: 3px;
  font-size: 12.5px; line-height: 1.55;
  box-shadow: 0 10px 34px rgba(0,0,0,0.32);
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.22s, transform 0.22s;
}
.toast.show { opacity: 1; transform: none; }
.toast .muted { color: rgba(255,255,255,0.65); }
.toast .muted.small, .toast .small { color: rgba(255,255,255,0.65); }
.toast b { font-weight: 600; }
.toast-actions { display: flex; gap: 16px; margin-top: 9px; }
.toast-actions a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* demo email card (OTP delivery stand-in) */
.toast.demo-mail { background: #fff; color: var(--ink); border: 1px solid var(--ink); padding: 0; width: 330px; }
.demo-mail .mail-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-bottom: 1px solid var(--line);
  font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); font-weight: 600;
}
.demo-mail .mail-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--navy); }
.demo-mail .mail-from { padding: 10px 14px 0; font-size: 12px; color: var(--ink-3); }
.demo-mail .mail-body { padding: 2px 14px 10px; font-size: 13px; }
.demo-mail .mail-code {
  display: inline-block; margin-top: 6px;
  font-size: 22px; font-weight: 700; letter-spacing: 0.18em;
  color: var(--navy); text-decoration: none;
  border: 1px dashed var(--line-mid); padding: 4px 12px; border-radius: 2px;
}
.demo-mail .mail-code:hover { border-color: var(--navy); text-decoration: none; }
.demo-mail .mail-note { padding: 8px 14px 11px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3); }

/* user chip + persona menu */
.user-chip.clickable { cursor: pointer; user-select: none; }
.user-chip.clickable:hover span { color: var(--ink); }
.user-chip .caret { opacity: 0.55; }
.user-menu {
  position: fixed; z-index: 110; display: none;
  background: #fff; border: 1px solid var(--ink); border-radius: 3px;
  box-shadow: 0 14px 44px rgba(0,0,0,0.18); width: 270px;
}
.user-menu.open { display: block; }
.user-menu .um-head { padding: 12px 16px 8px; }
.user-menu a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 16px; color: var(--ink); text-decoration: none; font-size: 13px; line-height: 1.35;
}
.user-menu a:hover { background: var(--panel); text-decoration: none; }
.user-menu a.current { background: var(--navy-soft); }
.user-menu .um-check { margin-left: auto; color: var(--navy); font-weight: 700; }
.user-menu .um-foot { border-top: 1px solid var(--line); }
.user-menu .um-foot a { color: var(--ink-2); font-size: 12.5px; }

/* mock Microsoft account picker */
.acct-modal { width: 430px; padding-bottom: 6px; }
.acct-modal .acct-head {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 24px 6px; font-size: 14px;
}
.ms-logo.dark i { background: var(--ink); }
.acct-modal .acct-sub { padding: 0 24px 14px; font-size: 12.5px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.acct-list a {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 24px; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--line); font-size: 13.5px; line-height: 1.4;
}
.acct-list a:hover { background: var(--panel); }
.acct-list a.busy { background: var(--navy-soft); pointer-events: none; }
.acct-list .acct-who { display: flex; flex-direction: column; }
.acct-list .acct-perm { margin-left: auto; text-align: right; flex: none; max-width: 120px; }
.acct-modal .acct-foot { padding: 13px 24px 16px; line-height: 1.6; }

/* selected row + disabled buttons */
table.grid tr.sel td { background: var(--navy-soft) !important; }
.btn.disabled, .btn:disabled { opacity: 0.45; cursor: default; }
.btn.disabled:hover, .btn:disabled:hover { background: var(--ink); }
.btn.secondary.disabled:hover, .btn.secondary:disabled:hover,
.btn.ghost.disabled:hover, .btn.ghost:disabled:hover { background: transparent; }
.modal-err { color: var(--bad); font-size: 12.5px; min-height: 18px; padding: 4px 0 2px; }

/* tree nesting for real folders */
.tree .sub .subsub { padding-left: 13px; }
.tree li a { cursor: pointer; }

/* Ask: suggestions + thinking + source highlight */
.sugg-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 6px; }
.sugg {
  font-size: 12px; color: var(--ink-2);
  border: 1px solid var(--line-mid); border-radius: 20px;
  padding: 5px 12px; text-decoration: none;
}
.sugg:hover { color: var(--navy); border-color: var(--navy); text-decoration: none; }
.answer.thinking { border-left-color: var(--line-mid); color: var(--ink-3); }
.dots { display: inline-flex; gap: 4px; margin-right: 6px; vertical-align: 1px; }
.dots i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--ink-3);
  animation: dotpulse 1.1s infinite ease-in-out;
}
.dots i:nth-child(2) { animation-delay: 0.18s; }
.dots i:nth-child(3) { animation-delay: 0.36s; }
@keyframes dotpulse { 0%, 100% { opacity: 0.25; } 45% { opacity: 1; } }
a.source-card { color: inherit; text-decoration: none; }
a.source-card:hover { border-color: var(--navy); text-decoration: none; }
.source-card.hl { border-color: var(--navy); background: var(--navy-soft); }

/* preview modal sheet */
.preview-modal { width: 640px; }
.preview-sheet {
  border: 1px solid var(--ink); height: 340px;
  display: flex; flex-direction: column; background: #fff;
}
.preview-sheet .ps-head {
  display: flex; justify-content: space-between; padding: 12px 16px;
  border-bottom: 1px solid var(--ink); font-weight: 700; font-size: 13px;
}
.preview-sheet .ps-body { flex: 1; padding: 22px 16px; }
.preview-sheet .ps-title { font-size: 15px; font-weight: 500; margin-bottom: 18px; }
.preview-sheet .ps-lines i {
  display: block; height: 7px; background: var(--panel);
  border: 1px solid var(--line); margin-bottom: 9px; width: 92%;
}
.preview-sheet .ps-foot {
  display: flex; justify-content: space-between; padding: 10px 16px;
  border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3);
}
.preview-sheet.noprev { align-items: center; justify-content: center; text-align: center; color: var(--ink-3); font-size: 13px; }
.preview-sheet.photo {
  background:
    linear-gradient(135deg, transparent 49.7%, var(--line-mid) 49.7%, var(--line-mid) 50.3%, transparent 50.3%),
    linear-gradient(45deg, transparent 49.7%, var(--line-mid) 49.7%, var(--line-mid) 50.3%, transparent 50.3%),
    repeating-linear-gradient(90deg, rgba(0,0,0,0.03) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(0deg, rgba(0,0,0,0.03) 0 1px, transparent 1px 56px),
    #e8e6e1;
  align-items: flex-start; justify-content: flex-end; padding: 18px;
}
.preview-sheet.photo .ph-word { font-weight: 700; font-size: 24px; }
.preview-sheet.photo .ph-name { font-size: 12px; color: var(--ink-2); margin-top: 4px; }

/* OTP error + shake */
.otp-err { color: var(--bad); font-size: 12.5px; min-height: 18px; margin-bottom: 4px; }
.otp-row.shake { animation: otpshake 0.4s; }
@keyframes otpshake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(3px); }
}

/* dropzone drag state */
.dropzone.drag { border-color: var(--navy); color: var(--navy); background: var(--navy-soft); }

/* wireframe pill footer */
.wf-nav .wf-foot { border-top: 1px solid rgba(255,255,255,0.16); padding: 8px 14px 9px; }
.wf-nav .wf-foot .muted-w { display: block; color: rgba(255,255,255,0.45); font-size: 10.5px; margin-bottom: 5px; }
.wf-nav .wf-foot .wf-reset { display: block; padding: 0; color: rgba(255,255,255,0.78); }
.wf-nav .wf-foot .wf-reset:hover { color: #fff; }

/* ---------- UI polish pass ---------- */

::selection { background: var(--navy); color: #fff; }

/* thin, quiet scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-mid) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-mid); border-radius: 8px; border: 3px solid var(--paper); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* keyboard focus (fields keep their border treatment) */
:focus-visible:not(input):not(textarea):not(select) {
  outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 2px;
}

a { text-underline-offset: 2px; }

/* gentle entrance for page content */
@keyframes riseIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.content, .ext-main, .auth-card { animation: riseIn 0.3s ease-out both; }

/* buttons: press feedback, primary hover lift */
.btn { transition: background 0.13s, border-color 0.13s, color 0.13s, box-shadow 0.13s, transform 0.06s; }
.btn:not(.secondary):not(.ghost):not(:disabled):not(.disabled):hover { box-shadow: 0 3px 12px rgba(14,14,14,0.18); }
.btn:not(:disabled):not(.disabled):active { transform: translateY(1px); box-shadow: none; }
.ms-btn { transition: background 0.13s, box-shadow 0.13s, transform 0.06s; }
.ms-btn:hover { box-shadow: 0 4px 16px rgba(14,14,14,0.28); }
.ms-btn:active { transform: translateY(1px); box-shadow: none; }

/* rail: navy active state, soft hovers */
.rail nav a { transition: color 0.12s, background 0.12s, border-color 0.12s; }
.rail nav a:hover { background: var(--panel); }
.rail nav a.active {
  color: var(--navy); border-left-color: var(--navy);
  background: linear-gradient(90deg, var(--navy-soft), transparent 75%);
}
.rail nav a.active svg { stroke: var(--navy); }

/* topbar search: focus ring + shortcut hint */
.topbar .search { background: #fff; transition: border-color 0.13s, box-shadow 0.13s; }
.topbar .search:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px var(--navy-soft); }
.kbd {
  font: 500 10.5px/1 "SFMono-Regular", ui-monospace, Consolas, monospace;
  color: var(--ink-3); background: var(--panel);
  border: 1px solid var(--line-mid); border-bottom-width: 2px; border-radius: 3px;
  padding: 3px 6px; flex: none;
}
.topbar .search:focus-within .kbd { display: none; }

/* tables: clickable rows, crisper selection, sticky headers */
.filepane table.grid tbody tr { cursor: pointer; }
table.grid tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--navy); }
table.grid thead th { position: sticky; top: 0; background: var(--paper); z-index: 2; }
input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; }

/* chips: hairline borders for crispness */
.chip { border: 1px solid transparent; }
.chip.good { border-color: rgba(26,127,55,0.18); }
.chip.warn { border-color: rgba(154,103,0,0.18); }
.chip.bad { border-color: rgba(180,35,24,0.16); }
.chip.neutral { border-color: var(--line); }
.chip.navy { border-color: rgba(12,60,96,0.16); }

/* stat tiles */
.stat { transition: background 0.12s; }
.stat:hover { background: #fbfbfa; }

/* modals: blurred backdrop, navy accent, entrance */
.modal-backdrop { background: rgba(14,14,14,0.38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-backdrop.open .modal { animation: modalIn 0.22s cubic-bezier(0.2, 0.8, 0.25, 1) both; }
.modal { border-top: 2px solid var(--navy); }

/* toasts */
.toast { border-left: 2px solid var(--navy); box-shadow: 0 14px 44px rgba(0,0,0,0.35); }

/* menus */
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.user-menu { overflow: hidden; }
.user-menu.open { animation: menuIn 0.16s ease-out both; }
.user-menu a, .acct-list a { transition: background 0.1s; }

/* tree: indent guides + hovers */
.tree li a { transition: color 0.1s, background 0.1s; }
.tree li a:hover { background: #fbfbfa; }
.tree .sub { padding-left: 0; margin-left: 26px; border-left: 1px solid var(--line); }
.tree .sub li a { padding-left: 12px; }
.tree .sub .subsub { padding-left: 0; margin-left: 11px; border-left: 1px solid var(--line); }
.tree .sub .subsub li a { padding-left: 11px; }

/* detail pane: blueprint-grid preview instead of the X placeholder */
.detail .thumb {
  background:
    repeating-linear-gradient(90deg, rgba(12,60,96,0.09) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(0deg, rgba(12,60,96,0.09) 0 1px, transparent 1px 14px),
    #fdfdfc;
}

/* ask: focus ring, live cites, source-card lift */
.ask-box { transition: box-shadow 0.13s; }
.ask-box:focus-within { box-shadow: 0 0 0 3px var(--navy-soft); }
.answer .cite { transition: background 0.1s, color 0.1s; }
.answer .cite:hover { background: var(--navy); color: #fff; }
.source-card { transition: border-color 0.12s, transform 0.12s, box-shadow 0.12s; }
a.source-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(14,14,14,0.08); }
.sugg { transition: color 0.12s, border-color 0.12s, background 0.12s; }
.sugg:hover { background: var(--navy-soft); }

/* audit chart: bars grow in */
@keyframes barIn { from { transform: scaleY(0); } }
.chart .bar {
  transform-origin: bottom;
  animation: barIn 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 0.024s);
}

/* external pages */
.ext-file { transition: background 0.12s; }
.ext-file:hover { background: #fbfbfa; }
.ext-note {
  background: var(--panel); border-left-color: var(--navy);
  padding: 12px 16px; border-radius: 0 2px 2px 0;
}

/* sign-in visual: accent rule above the statement */
.auth-visual .big::before {
  content: ""; display: block; width: 44px; height: 2px;
  background: rgba(255,255,255,0.85); margin-bottom: 18px;
}

/* external-recipient persona (simulation) */
.avatar.ext { background: #fff; color: var(--ink-2); border: 1px solid var(--line-mid); }
.acct-list .acct-sep { padding: 14px 24px 6px; border-bottom: 1px solid var(--line); background: #fbfbfa; }
.user-menu .um-ext-head { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 12px; }

/* small fixes */
.server-bar .sb-tag { border-color: rgba(12,60,96,0.25); }
.empty-note { background: #fbfbfa; border-radius: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { padding: 30px 26px; gap: 26px; }
  .auth-visual .big { font-size: 24px; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--line); }
  .two-col { grid-template-columns: 1fr; }
  .source-cards { grid-template-columns: 1fr; }
  .files-layout { grid-template-columns: 200px 1fr; }
  .detail { display: none; }
}

@media (max-width: 640px) {
  .ext-head { padding: 22px 20px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .ext-main { padding: 34px 18px 50px; }
  .ext-title { font-size: 28px; }
  .ext-file { flex-wrap: wrap; }
  .ext-file .acts { margin-left: 50px; width: calc(100% - 50px); }
  .ext-actions { flex-direction: column; }
  .ext-actions .btn { justify-content: center; }
  .trust-line { flex-direction: column; gap: 10px; }
  .ext-foot { flex-direction: column; gap: 6px; padding: 18px 20px 64px; }
  .ext-kicker-row { flex-wrap: wrap; }
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; align-items: center; padding: 12px 16px; border-right: none; border-bottom: 1px solid var(--line); }
  .rail .brand { padding: 0 16px 0 0; border-bottom: none; }
  .rail .brand .kicker { display: none; }
  .rail nav { display: flex; padding: 0; overflow-x: auto; }
  .rail nav a { padding: 8px 10px; border-left: none; border-bottom: 2px solid transparent; }
  .rail nav a.active { border-bottom-color: var(--ink); background: none; }
  .rail .rail-foot { display: none; }
  .files-layout { grid-template-columns: 1fr; }
  .tree { border-right: none; border-bottom: 1px solid var(--line); }
  .filepane { overflow-x: auto; }
  .filepane table.grid { min-width: 560px; }
  .server-bar { padding: 9px 18px; align-items: flex-start; }
  .server-bar .sb-tag { display: none; }
  .content { padding: 18px; }
  .otp-row input { width: 40px; height: 48px; }
}
