/* Aegis. Set up the way Caviar is: one charcoal frame (top bar and side menu) with the workspace set into it.
   The frame stays charcoal in both themes; the workspace is warm paper in light and charcoal in dark. One accent (steel blue). */
:root {
  --brand: #111110; --brand-2: #1A1A18; --on-brand: #F0ECE5; --on-brand-mute: #B4AFA5; --on-brand-dim: #8F897F; --frame-line: #2E2D28;
  --canvas: #F6F4EF; --surface: #FFFFFF; --soft: #EFECE5; --soft-2: #E5E1D8; --field: #FFFFFF;
  --ink: #1B1B19; --grey: #55524C; --mute: #6B675F; --line: #E2DED5; --line-2: #CFCABF; --line-3: #8E897F;
  --accent: #1F6FA8; --accent-deep: #18598A; --accent-tint: #E4EFF7; --on-accent: #FFFFFF;
  --good: #2A7651; --good-tint: #E2F0E8; --warn: #8F5A07; --warn-tint: #F8ECD5; --bad: #B33C2B; --bad-tint: #F8E3DF; --ai: #6247A8; --ai-tint: #EEE9F8;
  --photo: #D9D5CC;
  --font: "Poppins", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px;
  --fp: 24px;
  --t-meta: 0.75rem; --t-sec: 0.875rem; --t-body: 1rem; --h3: 1.0625rem; --h2: 1.375rem; --h1: 2rem;
  --r1: 4px; --r2: 6px; --r3: 14px;
  --d1: 100ms; --d2: 150ms; --d3: 200ms; --d4: 300ms; --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --shadow-over: 0 16px 48px rgba(20, 20, 18, 0.07), 0 2px 8px rgba(20, 20, 18, 0.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --canvas: #161614; --surface: #1F1F1D; --soft: #272724; --soft-2: #31312D; --field: #1A1A18;
  --ink: #F0ECE5; --grey: #B4AFA5; --mute: #A39D93; --line: #34332D; --line-2: #4A483F; --line-3: #7D766B;
  --accent: #7CC0E8; --accent-deep: #A6D5F2; --accent-tint: #1F3545; --on-accent: #0F1A22;
  --good: #74B08D; --good-tint: #1E3328; --warn: #D9A04F; --warn-tint: #3A2E18; --bad: #E07A6C; --bad-tint: #3F221E; --ai: #B3A1E6; --ai-tint: #2C2742;
  --photo: #3A3934; --shadow-over: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 48px rgba(0, 0, 0, 0.45); color-scheme: dark; } }
:root[data-theme="dark"] {
  --canvas: #161614; --surface: #1F1F1D; --soft: #272724; --soft-2: #31312D; --field: #1A1A18;
  --ink: #F0ECE5; --grey: #B4AFA5; --mute: #A39D93; --line: #34332D; --line-2: #4A483F; --line-3: #7D766B;
  --accent: #7CC0E8; --accent-deep: #A6D5F2; --accent-tint: #1F3545; --on-accent: #0F1A22;
  --good: #74B08D; --good-tint: #1E3328; --warn: #D9A04F; --warn-tint: #3A2E18; --bad: #E07A6C; --bad-tint: #3F221E; --ai: #B3A1E6; --ai-tint: #2C2742;
  --photo: #3A3934; --shadow-over: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 24px 48px rgba(0, 0, 0, 0.45); color-scheme: dark; }

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
#app { display: flex; flex-direction: column; } #app > .app, #app > .portal, #app > .stage, #app > .signin { flex: 1 1 auto; min-height: 0; height: auto; }
.demo-strip { display: none; flex: none; height: 24px; line-height: 24px; padding: 0 var(--s3); background: var(--brand-2); color: var(--on-brand-mute); font-size: var(--t-meta); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--frame-line); }
body { background: var(--brand); color: var(--ink); font-family: var(--font); font-size: var(--t-body); font-weight: 400; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-weight: 500; line-height: 1.25; margin: 0; text-wrap: balance; }
h1 { font-size: var(--h1); font-weight: 300; letter-spacing: -0.02em; line-height: 1.15; } h2 { font-size: var(--h2); letter-spacing: -0.01em; } h3 { font-size: var(--h3); } h4 { font-size: var(--t-body); }
p { margin: 0; } a { color: var(--accent); } b, strong { font-weight: 500; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r1); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; } .muted { color: var(--grey); } .meta { font-size: var(--t-meta); line-height: 1.5; color: var(--mute); } .sec { font-size: var(--t-sec); }
.prose { max-width: 68ch; } .pre { white-space: pre-wrap; }
.figure { font-size: var(--h1); font-weight: 300; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; } .row.top { align-items: flex-start; } .row.nowrap { flex-wrap: nowrap; } .row.tight { gap: var(--s2); }
.stack { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; } .stack.s2 { gap: var(--s2); } .stack.s3 { gap: var(--s3); } .stack.s6 { gap: var(--s6); }
.grow { flex: 1; min-width: 0; } .right { margin-left: auto; }
.grid { display: grid; gap: var(--s4); } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gauto { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s6); align-items: start; }
.scroll-x { overflow-x: auto; }
.split.r440 { grid-template-columns: minmax(0, 1fr) 440px; }
.btn.fbtn { display: none; } .fmore { display: contents; }

/* Shell */
.app { display: grid; grid-template-rows: 64px 1fr; grid-template-columns: 248px 1fr; height: 100%; width: 100%; background: var(--brand); }
.topbar { grid-column: 1 / -1; background: var(--brand); color: var(--on-brand); display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4) 0 0; min-width: 0; }
.brand { width: 248px; flex: none; display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s3) 0 var(--s6); min-width: 0; color: var(--on-brand); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; }
.brand svg { width: 30px; height: 34px; flex: none; }
.brand .word { font-size: 1.125rem; font-weight: 500; letter-spacing: 0.22em; line-height: 1; }
.brand .by { display: block; font-size: 0.75rem; letter-spacing: 0; color: var(--on-brand-mute); margin-top: 6px; white-space: nowrap; }
.topbar .menu-btn { display: none; } .nav-scrim { display: none; }
.projname { display: flex; gap: var(--s3); align-items: baseline; min-width: 0; overflow: hidden; font-size: var(--t-sec); } .projname small { font-size: var(--t-meta); color: var(--on-brand-mute); flex: none; }
.projname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: var(--s2); margin-left: auto; flex: none; }
.demo-tag { font-size: var(--t-meta); color: var(--on-brand-mute); white-space: nowrap; padding: 0 var(--s2); }
.demo-tag b { color: var(--on-brand); font-weight: 500; }
.syncdot { font-size: var(--t-meta); color: var(--on-brand-dim); white-space: nowrap; padding: 0 var(--s1); }
.nav { background: var(--brand); padding: var(--s4) var(--s3); overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s3) 0 var(--s4); border-radius: var(--r1); color: var(--on-brand-mute); text-decoration: none; font-size: var(--t-sec); position: relative; cursor: pointer; transition: color var(--d2) var(--ease), background var(--d2) var(--ease); }
.nav a:hover { color: var(--on-brand); background: rgba(240, 236, 229, 0.05); }
.nav a[aria-current="page"] { color: var(--on-brand); font-weight: 500; }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; background: #7CC0E8; }
.nav .step { width: 16px; flex: none; font-size: var(--t-meta); color: var(--on-brand-dim); font-variant-numeric: tabular-nums; }
.nav a[aria-current="page"] .step { color: #7CC0E8; }
.nav .count { margin-left: auto; font-size: var(--t-meta); color: var(--on-brand-dim); font-variant-numeric: tabular-nums; }
.nav .count.hot { color: #E8B96A; }
.nav .group { margin: var(--s2) 0 var(--s2) var(--s2); padding-left: var(--s2); border-left: 1px solid var(--frame-line); display: flex; flex-direction: column; gap: 2px; }
.nav .navnote { margin-top: auto; padding: var(--s4) var(--s4) var(--s2); font-size: var(--t-meta); color: var(--on-brand-dim); line-height: 1.5; }
main { overflow: auto; min-width: 0; background: var(--canvas); border-top-left-radius: var(--r3); border-top: 1px solid var(--frame-line); border-left: 1px solid var(--frame-line); position: relative; }
.page { width: 100%; max-width: 1280px; margin-inline: auto; padding: var(--s8) var(--s10) var(--s12); animation: fade var(--d4) var(--ease); }
.page.wide { max-width: none; }
@keyframes fade { from { opacity: 0.4; } to { opacity: 1; } }
.page-head { display: flex; align-items: flex-end; gap: var(--s6); margin-bottom: var(--s6); flex-wrap: wrap; }
.page-head > div:first-child { flex: 1; min-width: 240px; }
.page-head p { color: var(--grey); margin-top: var(--s2); max-width: 70ch; }
.page-head .actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.statusline { display: flex; gap: var(--s2) var(--s4); flex-wrap: wrap; align-items: center; margin-top: var(--s3); color: var(--grey); font-size: var(--t-sec); }

/* Controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4); border-radius: var(--r1); border: 1px solid var(--line-2); background: transparent; color: var(--ink); font-size: var(--t-sec); font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background var(--d2) var(--ease), border-color var(--d2) var(--ease), transform var(--d1) var(--ease); }
.btn:hover { border-color: var(--line-3); background: var(--soft); }
.btn:active { transform: scale(0.985); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: var(--on-accent); }
.btn.ghost { border-color: transparent; } .btn.ghost:hover { background: var(--soft); border-color: transparent; }
.btn.sm { padding: 0 var(--s3); }
.btn.ai { border-color: var(--accent); color: var(--accent); } .btn.ai:hover { background: var(--accent-tint); border-color: var(--accent); }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-disabled="true"] { color: var(--mute); border-color: var(--line); cursor: not-allowed; background: transparent; }
.btn.primary[aria-disabled="true"] { background: var(--soft-2); border-color: var(--soft-2); color: var(--mute); }
.topbar .btn { color: var(--on-brand); border-color: var(--frame-line); } .topbar .btn:hover { background: rgba(240, 236, 229, 0.07); border-color: var(--on-brand-dim); }
.topbar .btn.ghost { border-color: transparent; }
.icon-btn { position: relative; width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: var(--r1); border: 1px solid transparent; background: transparent; color: inherit; cursor: pointer; flex: none; transition: background var(--d2) var(--ease); }
.icon-btn:hover { background: var(--soft); } .topbar .icon-btn:hover, .field-top .icon-btn:hover { background: rgba(240, 236, 229, 0.09); }
.icon-btn[aria-pressed="true"] { background: var(--accent-tint); color: var(--accent); }
.icon-btn[aria-disabled="true"] { color: var(--mute); cursor: not-allowed; }
.icon-btn .tip { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #31312D; color: #F0ECE5; font-size: var(--t-meta); line-height: 1.4; padding: var(--s1) var(--s2); border-radius: var(--r1); white-space: nowrap; pointer-events: none; opacity: 0; z-index: 60; transition: opacity var(--d1) ease-out; }
.icon-btn.tip-left .tip { left: auto; right: 0; transform: none; } .icon-btn.tip-right .tip { left: 0; transform: none; }
.icon-btn:focus-visible .tip { opacity: 1; } @media (hover: hover) { .icon-btn:hover .tip { opacity: 1; } }
kbd { font-family: inherit; font-size: var(--t-meta); border: 1px solid currentColor; border-radius: 3px; padding: 0 4px; opacity: 0.75; margin-left: var(--s2); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; flex: none; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
svg.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.field { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.field label, .lbl { font-size: var(--t-sec); font-weight: 500; }
/* The label sits beside the control: toolbar filters and one-number rows. */
.field.inl { flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s2); } .field.inl > label { flex: none; } .field.inl > .inp, .field.inl > .unit-wrap { flex: 1 1 0; min-width: 0; } .field.inl > .err, .field.inl > .help { flex: 1 1 100%; }
.field.inl.hrow { gap: var(--s3); } .field.inl.hrow > label { flex: 1 1 auto; min-width: 0; font-weight: 400; display: flex; flex-direction: column; gap: 2px; } .field.inl.hrow > label b { font-weight: 500; font-size: var(--t-body); } .field.inl.hrow > .unit-wrap { flex: 0 0 120px; }
.field .opt { color: var(--mute); font-weight: 400; } .field .help { font-size: var(--t-meta); color: var(--mute); line-height: 1.5; } .field .err { font-size: var(--t-meta); color: var(--bad); line-height: 1.5; } .fcard > .err { font-size: var(--t-sec); color: var(--bad); line-height: 1.5; }
.inp { width: 100%; min-height: 44px; padding: 0 var(--s3); border: 1px solid var(--line-3); border-radius: var(--r1); background: var(--field); color: var(--ink); font-size: var(--t-body); transition: border-color var(--d2) var(--ease); }
textarea.inp { padding: var(--s3); line-height: 1.55; resize: vertical; min-height: 96px; }
.inp:hover { border-color: var(--grey); } .inp::placeholder { color: var(--mute); }
.inp:focus-visible { outline-offset: 0; border-color: var(--accent); }
.inp[aria-invalid="true"] { border-color: var(--bad); }
.inp:disabled { background: var(--soft); border-color: var(--line-2); color: var(--mute); }
.inp.sm { font-size: var(--t-sec); }
.unit-wrap { display: flex; align-items: stretch; } .unit-wrap .inp { border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.unit { display: grid; place-items: center; padding: 0 var(--s3); border: 1px solid var(--line-3); border-left: 0; border-radius: 0 var(--r1) var(--r1) 0; background: var(--soft); font-size: var(--t-sec); color: var(--mute); white-space: nowrap; }
.form { display: grid; gap: var(--s4); } .form.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form .full { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: var(--s3); min-height: 44px; cursor: pointer; font-size: var(--t-sec); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s6); overflow-x: auto; scrollbar-width: none; }
.tabs button { min-height: 44px; padding: 0 var(--s4); border: 0; background: none; color: var(--grey); font-size: var(--t-sec); font-weight: 500; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color var(--d2) var(--ease); }
.tabs button:hover { color: var(--ink); } .tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs.cut { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent); }
.row > p.grow { flex: 1 1 260px; }
.tabs .n { margin-left: 6px; font-size: var(--t-meta); color: var(--mute); font-variant-numeric: tabular-nums; }

.pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-meta); font-weight: 500; line-height: 1; padding: 5px 9px; border-radius: 999px; background: var(--soft); color: var(--grey); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill.ok { background: var(--good-tint); color: var(--good); } .pill.warn { background: var(--warn-tint); color: var(--warn); } .pill.bad { background: var(--bad-tint); color: var(--bad); }
.pill.info { background: var(--accent-tint); color: var(--accent); } .pill.ai { background: var(--ai-tint); color: var(--ai); }
.pill.plain::before { display: none; }
.tag { font-size: var(--t-meta); color: var(--mute); white-space: nowrap; }
.ref { display: inline-flex; align-items: center; font-size: var(--t-meta); font-weight: 500; font-variant-numeric: tabular-nums; padding: 2px 7px; border-radius: 3px; background: var(--accent-tint); color: var(--accent); border: 0; cursor: pointer; white-space: nowrap; text-decoration: none; }
.ref:hover { text-decoration: underline; }
.hit { display: inline-grid; place-items: center; width: 44px; height: 44px; cursor: pointer; } .hit input { width: 18px; height: 18px; accent-color: var(--accent); }
.notice { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r2); background: var(--accent-tint); color: var(--ink); font-size: var(--t-sec); border-left: 2px solid var(--accent); }
.notice.warn { background: var(--warn-tint); border-left-color: var(--warn); } .notice.bad { background: var(--bad-tint); border-left-color: var(--bad); } .notice.ok { background: var(--good-tint); border-left-color: var(--good); } .notice.ai { background: var(--ai-tint); border-left-color: var(--ai); }
.notice > .grow { padding-top: 1px; }

.frame { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); min-width: 0; }
.frame.pad { padding: var(--s6) var(--fp); }
.frame-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s3) var(--s3) var(--fp); border-bottom: 1px solid var(--line); min-height: 56px; flex-wrap: wrap; }
.frame-head h3 { flex: 1; min-width: 120px; } .frame-body { padding: var(--s4) var(--fp) var(--s6); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--t-sec); }
.tbl th { text-align: left; font-weight: 500; font-size: var(--t-meta); color: var(--mute); padding: var(--s3) var(--s3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th button { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; display: inline-flex; gap: 4px; align-items: center; min-height: 24px; }
.tbl td { padding: var(--s3) var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th:first-child, .tbl td:first-child { padding-left: var(--fp); } .tbl th:last-child, .tbl td:last-child { padding-right: var(--fp); }
.tbl tr:last-child td { border-bottom: 0; } .tbl .r { text-align: right; }
.tbl tbody tr.click { cursor: pointer; transition: background var(--d2) var(--ease); } .tbl tbody tr.click:hover { background: var(--soft); }
.tbl tr.total td { font-weight: 500; border-top: 1px solid var(--line-2); }
.filters { display: flex; gap: var(--s3); align-items: flex-end; flex-wrap: wrap; padding: var(--s4) var(--fp); border-bottom: 1px solid var(--line); }
.filters .field { width: 170px; } .filters .field.q { flex: 1; min-width: 180px; width: auto; }
.empty { padding: var(--s10) var(--fp); text-align: left; display: flex; flex-direction: column; gap: var(--s3); align-items: flex-start; }
.empty p { color: var(--grey); max-width: 56ch; }
.dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--s2) var(--s4); font-size: var(--t-sec); margin: 0; }
.dl dt { color: var(--mute); } .dl dd { margin: 0; min-width: 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s4) var(--fp); display: flex; flex-direction: column; gap: var(--s1); min-width: 0; text-align: left; color: inherit; }
button.stat { cursor: pointer; font: inherit; } button.stat:hover { border-color: var(--line-3); }
.stat .v { font-size: 1.625rem; font-weight: 300; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat.warn { border-left: 2px solid var(--warn); } .stat.bad { border-left: 2px solid var(--bad); } .stat.ok { border-left: 2px solid var(--good); }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; display: inline-block; }
.list { display: flex; flex-direction: column; }
.list .item { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--fp); border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; color: inherit; min-height: 44px; width: 100%; font-size: var(--t-sec); transition: background var(--d2) var(--ease); }
.list .item:last-child { border-bottom: 0; } .list .item:hover { background: var(--soft); } .list .item small { display: block; color: var(--mute); font-size: var(--t-meta); }
.bar { height: 6px; border-radius: 3px; background: var(--soft-2); overflow: hidden; min-width: 60px; } .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; } .bar.ok i { background: var(--good); } .bar.warn i { background: var(--warn); } .bar.bad i { background: var(--bad); }

/* Overlays */
.scrim { position: fixed; inset: 0; background: rgba(17, 17, 16, 0.5); z-index: 80; display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); place-items: center; padding: var(--s4); overflow: auto; animation: fade var(--d3) var(--ease); }
.modal { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow-over); width: 100%; max-width: 560px; max-height: 100%; display: flex; flex-direction: column; }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s3) var(--s3) var(--fp); border-bottom: 1px solid var(--line); } .modal-head h2 { flex: 1; font-size: var(--h3); }
.modal-body { padding: var(--s6) var(--fp); overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: var(--s4); }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s3) var(--fp); border-top: 1px solid var(--line); flex-wrap: wrap; }
/* A form that reopened with kept words says so, and offers to start again. */
.restored { display: flex; align-items: center; gap: var(--s2); min-width: 0; } .restored .meta { flex: 1; min-width: 0; } .modal-foot .restored { flex: 1 1 0; }
@media (max-width: 560px) { .modal-foot .restored { flex-basis: 100%; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--surface); color: var(--ink); border-left: 1px solid var(--line); box-shadow: var(--shadow-over); z-index: 70; display: flex; flex-direction: column; animation: slide var(--d4) var(--ease); }
.drawer.wide { width: min(720px, 100%); }
@keyframes slide { from { transform: translateX(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.toasts { position: fixed; left: 50%; bottom: var(--s6); transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: var(--s2); width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { background: #272724; color: #F0ECE5; border-radius: var(--r2); padding: var(--s3) var(--s4); font-size: var(--t-sec); box-shadow: var(--shadow-over); border-left: 2px solid #74B08D; animation: slideup var(--d4) var(--ease); }
.toast.error { border-left-color: #E07A6C; } .toast.info { border-left-color: #D9A441; } .toast small { display: block; color: #B4AFA5; }
@keyframes slideup { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.menu-wrap { position: relative; } .menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 250px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r2); box-shadow: var(--shadow-over); z-index: 65; padding: var(--s2); display: flex; flex-direction: column; }
.menu button { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s3); border: 0; background: none; border-radius: var(--r1); cursor: pointer; text-align: left; font-size: var(--t-sec); color: var(--ink); }
.menu button:hover { background: var(--soft); } .menu hr { border: 0; border-top: 1px solid var(--line); margin: var(--s2) 0; width: 100%; } .menu .meta { padding: var(--s2) var(--s3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-tint); color: var(--accent); display: inline-grid; place-items: center; font-size: var(--t-meta); font-weight: 500; flex: none; }
.topbar .avatar { background: #1F3545; color: #A6D5F2; }

/* Photos */
.photo { width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r1); background: var(--photo) center / cover no-repeat; position: relative; overflow: hidden; display: block; border: 0; padding: 0; }
.photo.sm { width: 64px; flex: none; } .photo.md { width: 120px; flex: none; }
.photo .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 6px; font-size: 0.75rem; color: #fff; background: rgba(17, 17, 16, 0.55); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--s2); }

/* Building map */
.bmap { display: grid; gap: 3px; font-size: var(--t-meta); align-items: stretch; }
.bmap .lab { color: var(--mute); display: grid; place-items: center; min-width: 30px; }
.bmap .cell { min-height: 34px; border-radius: 3px; border: 1px solid var(--line-2); background: var(--soft); cursor: pointer; display: grid; place-items: center; color: var(--ink); font-size: 0.75rem; font-variant-numeric: tabular-nums; padding: 0; transition: transform var(--d1) var(--ease); }
@media (hover: hover) { .bmap .cell:hover { transform: scale(1.05); } }
.bmap .cell[aria-pressed="true"] { outline: 2px solid var(--ink); outline-offset: 1px; }
.bmap .c-bad { background: var(--bad-tint); border-color: var(--bad); color: var(--bad); } .bmap .c-warn { background: var(--warn-tint); border-color: var(--warn); color: var(--warn); }
.bmap .c-ok { background: var(--good-tint); border-color: var(--good); color: var(--good); } .bmap .c-info { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }
.bmap .c-low { background: var(--soft-2); border-color: var(--line-3); }
.legend { display: flex; gap: var(--s4); flex-wrap: wrap; font-size: var(--t-meta); color: var(--grey); } .legend span { display: inline-flex; gap: 6px; align-items: center; }

/* Thread */
.thread { display: flex; flex-direction: column; gap: 0; margin: 0; padding: 0; list-style: none; }
.thread li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: var(--s3); position: relative; padding-bottom: var(--s4); }
.thread li::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 1px; background: var(--line-2); } .thread li:last-child::before { display: none; }
.thread .dot { width: 21px; height: 21px; border-radius: 50%; border: 1px solid var(--line-3); background: var(--surface); display: grid; place-items: center; font-size: 0.75rem; color: var(--mute); margin-top: 1px; }
.thread .done .dot { background: var(--good); border-color: var(--good); color: var(--on-accent); } .thread .now .dot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); } .thread .gap .dot { border-style: dashed; }

/* Kanban, crew, calendar */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: var(--s3); overflow-x: auto; padding-bottom: var(--s2); }
/* Three columns fit side by side on a small laptop without the board scrolling. */
.kanban.three { grid-auto-columns: minmax(200px, 1fr); }
.kcol { background: var(--soft); border-radius: var(--r2); padding: var(--s3); display: flex; flex-direction: column; gap: var(--s2); min-height: 200px; }
.kcol h4 { font-size: var(--t-sec); display: flex; justify-content: space-between; padding: 0 var(--s1) var(--s1); }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r1); padding: var(--s3); display: flex; flex-direction: column; gap: var(--s1); font-size: var(--t-sec); cursor: pointer; text-align: left; color: inherit; }
.kcard:hover { border-color: var(--line-3); }
.crew { display: grid; gap: 2px; font-size: var(--t-meta); } .crew .hd { color: var(--mute); padding: var(--s2); } .crew .tr { padding: var(--s2); font-weight: 500; font-size: var(--t-sec); display: flex; flex-direction: column; }
.crew .cellw { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r1); padding: var(--s2); min-height: 62px; display: flex; flex-direction: column; gap: 3px; }
.crew .cellw.over { border-color: var(--bad); background: var(--bad-tint); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border-radius: 3px; background: var(--soft); font-size: 0.75rem; white-space: nowrap; border: 0; cursor: pointer; color: var(--ink); }

/* Chat and AI */
.chat { display: flex; flex-direction: column; gap: var(--s3); } .msg { max-width: 92%; padding: var(--s3) var(--s4); border-radius: var(--r2); font-size: var(--t-sec); line-height: 1.6; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); } .msg.ai { align-self: flex-start; background: var(--soft); }
.aibox { border: 1px solid var(--ai); border-radius: var(--r2); background: var(--surface); } .aibox > header { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
/* A box with a close button keeps its title and the button on the first line on a phone. The Talos tag drops below. */
.aibox > header.hx > h3 { flex: 1 0 auto; }
@media (max-width: 480px) { .aibox > header.hx > .pill { order: 9; } }
.aibox > .body { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); } .aibox > footer { display: flex; gap: var(--s2); padding: var(--s3) var(--s4); border-top: 1px solid var(--line); flex-wrap: wrap; justify-content: flex-end; }

/* Sign-in */
.signin { display: grid; grid-template-columns: minmax(340px, 480px) 1fr; height: 100%; background: var(--brand); color: var(--on-brand); }
.signin .panel { padding: var(--s10) var(--s10) var(--s6); display: flex; flex-direction: column; gap: var(--s6); overflow: auto; }
.signin h1 { color: var(--on-brand); } .signin .muted { color: var(--on-brand-mute); } .signin .meta { color: var(--on-brand-dim); }
.signin .btn { color: var(--on-brand); border-color: var(--on-brand-dim); } .signin .btn:hover { background: rgba(240, 236, 229, 0.09); border-color: var(--on-brand-mute); }
.signin .who { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: var(--s2) var(--s4); border: 1px solid var(--frame-line); border-radius: var(--r2); background: none; color: var(--on-brand); cursor: pointer; text-align: left; width: 100%; transition: background var(--d2) var(--ease), border-color var(--d2) var(--ease); }
.signin .who:hover { background: rgba(240, 236, 229, 0.06); border-color: var(--on-brand-dim); } .signin .who small { display: block; color: var(--on-brand-mute); font-size: var(--t-meta); }
.signin .who .avatar { background: #1F3545; color: #A6D5F2; } .signin .who svg { margin-left: auto; color: var(--on-brand-dim); }
.signin .show { position: relative; overflow: hidden; background: #1A1A18; border-left: 1px solid var(--frame-line); }
.signin .slide { position: absolute; inset: 0; opacity: 0; transition: opacity var(--d4) ease-out; display: grid; place-items: center; } .signin .slide.on { opacity: 1; }
.signin .slide svg { width: 100%; height: 100%; }
.signin .capt { position: absolute; left: var(--s10); bottom: var(--s10); right: var(--s10); color: #F0ECE5; } .signin .capt b { font-size: var(--h2); font-weight: 300; display: block; }

/* Client portal and phone apps */
.field-top > svg { width: 24px; height: 28px; flex: none; }
.portal-top .btn, .stage .side .btn, .field-top .btn { color: var(--on-brand); } .portal-top .btn:hover, .stage .side .btn:hover { background: rgba(240, 236, 229, 0.07); border-color: transparent; }
@media (max-width: 1279px) { .portal-top .demo-tag, .syncdot { display: none; } .demo-strip.r-client, .demo-strip.r-engineer, .demo-strip.r-field, .demo-strip.r-crew, .demo-strip.r-resident { display: block; } }
.portal { height: 100%; overflow: auto; background: var(--canvas); }
.portal-top { background: var(--brand); color: var(--on-brand); display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4) 0 0; min-height: 64px; position: sticky; top: 0; z-index: 30; }
.portal-nav { display: flex; gap: var(--s1); overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; } .portal-nav a { color: var(--on-brand-mute); text-decoration: none; padding: 0 var(--s3); min-height: 44px; display: inline-flex; align-items: center; font-size: var(--t-sec); border-radius: var(--r1); white-space: nowrap; cursor: pointer; }
.portal-nav a:hover { color: var(--on-brand); } .portal-nav a[aria-current="page"] { color: var(--on-brand); font-weight: 500; box-shadow: inset 0 -2px #7CC0E8; }
.stage { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 430px; background: var(--brand); }
.stage .side { color: var(--on-brand); padding: var(--s10); overflow: auto; display: flex; flex-direction: column; gap: var(--s4); } .stage .side .muted { color: var(--on-brand-mute); } .stage .side h1 { color: var(--on-brand); }
.stage .dock { display: grid; place-items: center; padding: var(--s4); min-height: 0; }
.phone { width: 390px; height: min(800px, calc(100vh - 32px)); border-radius: 38px; border: 10px solid #000; box-shadow: 0 0 0 1px #3A3934; background: var(--canvas); overflow: hidden; position: relative; display: flex; flex-direction: column; }
.fapp { height: 100%; display: flex; flex-direction: column; background: var(--canvas); color: var(--ink); min-height: 0; position: relative; }
.field-top { background: var(--brand); color: var(--on-brand); padding: var(--s2) var(--s2) var(--s2) var(--s4); display: flex; align-items: center; gap: var(--s2); min-height: 56px; flex: none; }
.field-top select { background: transparent; color: var(--on-brand); border: 0; font-weight: 500; font-size: var(--t-sec); max-width: 100%; min-height: 44px; flex: 1; min-width: 0; } .field-top select option { color: #111; }
.fbody { flex: 1; overflow: auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); min-height: 0; }
.ftabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-top: 1px solid var(--line); background: var(--surface); flex: none; }
.ftabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; border: 0; background: none; color: var(--mute); font-size: 0.75rem; cursor: pointer; }
.ftabs button[aria-selected="true"] { color: var(--accent); font-weight: 500; }
.fcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.bigbtn { min-height: 56px; font-size: var(--t-body); width: 100%; }
.micbtn { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; margin: 0 auto; transition: transform var(--d1) var(--ease); }
.micbtn { position: relative; } .micbtn svg { width: 30px; height: 30px; } .micbtn.on { background: var(--bad); } .micbtn:active { transform: scale(0.96); }
.micbtn.on::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--bad); animation: ring 1.2s ease-out infinite; }
@keyframes ring { from { transform: scale(0.86); opacity: 0.8; } to { transform: scale(1.12); opacity: 0; } }
.omap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); overflow-x: auto; overflow-y: hidden; }
.omap svg { display: block; width: 100%; min-width: 700px; height: auto; }
.pin { cursor: pointer; } .pin:hover circle.halo { opacity: 0.35; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s2); }
.stepcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s3) var(--s4); text-align: left; cursor: pointer; color: inherit; display: flex; flex-direction: column; gap: 2px; font-size: var(--t-sec); }
.stepcard:hover { border-color: var(--line-3); } .stepcard .n { font-size: var(--t-meta); color: var(--accent); font-weight: 500; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; } .cal .d { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r1); min-height: 84px; padding: var(--s2); font-size: var(--t-meta); display: flex; flex-direction: column; gap: 3px; }
.cal .d.today { border-color: var(--accent); } .cal .d .n { color: var(--mute); } .cal .hd { font-size: var(--t-meta); color: var(--mute); padding: var(--s1) var(--s2); }
.cal .ev { border-radius: 3px; padding: 2px 5px; background: var(--accent-tint); color: var(--accent); border: 0; text-align: left; cursor: pointer; font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal .ev.water { background: var(--warn-tint); color: var(--warn); } .cal .ev.noise { background: var(--bad-tint); color: var(--bad); } .cal .ev.draft { background: transparent; border: 1px dashed currentColor; padding: 1px 4px; }
.search-res { max-height: 52vh; overflow: auto; margin: 0 calc(var(--fp) * -1) calc(var(--s6) * -1); border-top: 1px solid var(--line); }

/* Round two: programme, method statement paper, detail sheets, presentation bar */
.split.l340 { grid-template-columns: 340px minmax(0, 1fr); }
.list div.item { cursor: default; } .list div.item:hover { background: none; }
label.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.gantt { min-width: 760px; }
.g-row { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--s4); align-items: center; width: 100%; padding: var(--s2) var(--fp); border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; color: inherit; cursor: pointer; min-height: 52px; font-size: var(--t-sec); transition: background var(--d2) var(--ease); }
.g-row:last-child { border-bottom: 0; } button.g-row:hover { background: var(--soft); } .g-row.head { cursor: default; min-height: 36px; }
.g-name { min-width: 0; } .g-name b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .g-name .meta { display: block; }
.g-track { position: relative; display: block; height: 28px; }
.g-month { position: absolute; top: 5px; font-size: var(--t-meta); color: var(--mute); padding-left: 5px; border-left: 1px solid var(--line-2); line-height: 1.5; }
.g-tick { position: absolute; top: -12px; bottom: -12px; width: 1px; background: var(--line); }
.g-bar { position: absolute; top: 7px; height: 14px; border-radius: 3px; background: var(--soft-2); overflow: hidden; } .g-bar b { display: block; height: 100%; background: var(--accent); } .g-bar.done b { background: var(--good); } .g-bar.late { box-shadow: inset 0 0 0 2px var(--bad); }
.g-today { position: absolute; top: -12px; bottom: -12px; width: 2px; background: var(--ink); }
.g-key { display: inline-block; width: 14px; height: 8px; border-radius: 2px; background: var(--accent); margin-right: 6px; vertical-align: middle; } .g-key.late { background: none; box-shadow: inset 0 0 0 2px var(--bad); } .g-key.today { width: 2px; height: 14px; background: var(--ink); }
.paper { background: #FFFFFF; color: #1B1B19; border: 1px solid var(--line-2); border-radius: var(--r1); padding: var(--s10); max-height: 74vh; overflow: auto; font-size: var(--t-sec); line-height: 1.6; }
.paper h2 { font-size: var(--h2); margin: var(--s2) 0 var(--s1); color: #111110; } .paper h3 { font-size: var(--t-sec); font-weight: 500; color: #55524C; margin: var(--s8) 0 var(--s2); padding-top: var(--s4); border-top: 1px solid #DEDAD0; }
.paper h4 { font-size: var(--t-body); font-weight: 500; margin: var(--s4) 0 var(--s1); color: #111110; } .paper p { margin: 0 0 var(--s3); max-width: 70ch; } .paper .pmeta { display: block; font-size: var(--t-meta); color: #6B6860; } .paper p.pmeta { margin-top: var(--s8); padding-top: var(--s4); border-top: 1px solid #DEDAD0; }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); }
.dsheet { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); overflow: hidden; padding: 0; text-align: left; color: inherit; cursor: pointer; font-size: var(--t-sec); transition: border-color var(--d2) var(--ease); } .dsheet:hover { border-color: var(--line-3); }
.dart { display: block; background: #FFFFFF; border-bottom: 1px solid var(--line); } .dart svg { display: block; width: 100%; height: auto; } .dart.big { border: 1px solid var(--line); border-radius: var(--r1); overflow: hidden; max-width: 640px; }
.dcap { display: flex; flex-direction: column; gap: 2px; padding: var(--s3) var(--s4); } .dcap b { font-weight: 500; }
.tour { position: fixed; left: 50%; bottom: var(--s4); transform: translateX(-50%); z-index: 66; width: min(780px, calc(100vw - 32px)); display: flex; gap: var(--s4); align-items: center; background: var(--brand); color: var(--on-brand); border: 1px solid var(--frame-line); border-radius: var(--r2); padding: var(--s3) var(--s3) var(--s3) var(--s4); box-shadow: var(--shadow-over); font-size: var(--t-sec); animation: fade var(--d3) ease-out; }
.tour .grow { display: flex; flex-direction: column; gap: 2px; } .tour b { font-weight: 500; font-size: var(--t-body); } .tour .meta, .tour .sec { color: var(--on-brand-mute); }
.tour .btn { color: var(--on-brand); border-color: var(--frame-line); } .tour .btn:hover { background: rgba(240, 236, 229, 0.07); border-color: var(--on-brand-dim); } .tour .btn.primary { border-color: var(--accent); color: var(--on-accent); } .tour .icon-btn { color: var(--on-brand); } .tour .icon-btn:hover { background: rgba(240, 236, 229, 0.09); }
/* Round three: team and messages */
.kcard.ktask { cursor: default; padding: 0; gap: 0; } .kopen { display: flex; flex-direction: column; gap: var(--s1); width: 100%; padding: var(--s3); border: 0; border-radius: var(--r1); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; } .ktask > .btn { align-self: flex-start; margin: 0 var(--s3) var(--s3); }
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; } .seg .btn { min-width: 44px; justify-content: center; } .seg .btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }
.nw { white-space: nowrap; }
.rgrid { display: grid; grid-template-columns: 180px repeat(5, minmax(104px, 1fr)); gap: 2px; min-width: 720px; padding: var(--s3) var(--fp) var(--s4) 0; font-size: var(--t-sec); }
.rhd { color: var(--mute); font-size: var(--t-meta); padding: var(--s2); } .rhd.today { color: var(--ink); font-weight: 500; box-shadow: inset 0 -2px 0 var(--accent); } .rtrade { grid-column: 1 / -1; font-size: var(--t-meta); color: var(--mute); padding: var(--s4) var(--s2) var(--s1) var(--fp); border-bottom: 1px solid var(--line); } .rname { padding: var(--s2) var(--s2) var(--s2) var(--fp); display: flex; align-items: center; font-weight: 500; }
/* The name column stays put while the days scroll sideways on a narrow screen. */
.rname, .rgrid > .rhd:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); } .rgrid > .rhd:first-child { padding-left: var(--fp); }
.rcell { display: flex; flex-direction: column; justify-content: center; gap: 1px; min-height: 48px; padding: var(--s1) var(--s2); background: var(--soft); border: 1px solid transparent; border-radius: var(--r1); text-align: left; color: inherit; cursor: pointer; font-size: var(--t-sec); transition: border-color var(--d2) var(--ease); }
.rcell:hover { border-color: var(--line-3); } .rcell b { font-weight: 500; } .rcell.bad .meta, .rcell.warn .meta { color: inherit; } .rcell.off { background: none; border-color: var(--line); } .rcell.bad { background: var(--bad-tint); border-color: var(--bad); } .rcell.warn { background: var(--warn-tint); border-color: var(--warn); } .rcell .meta { line-height: 1.3; }
.chat2 { display: grid; grid-template-columns: 280px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); overflow: hidden; height: clamp(440px, calc(100vh - 310px), 820px); }
.chlist { border-right: 1px solid var(--line); overflow: auto; padding: var(--s3) var(--s2); display: flex; flex-direction: column; gap: 2px; } .chlist .lbl { padding: var(--s3) var(--s2) var(--s1); }
.chbtn { display: flex; align-items: center; gap: var(--s2); width: 100%; min-height: 48px; padding: var(--s1) var(--s2); border: 0; border-radius: var(--r1); background: none; color: inherit; text-align: left; cursor: pointer; font-size: var(--t-sec); transition: background var(--d2) var(--ease); } .chbtn:hover { background: var(--soft); } .chbtn[aria-current="true"] { background: var(--accent-tint); } .chbtn b { display: block; font-weight: 500; } .chbtn .meta { display: block; }
.unread { flex: none; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: var(--on-accent); font-size: var(--t-meta); font-weight: 500; display: inline-grid; place-items: center; }
.conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; } .conv-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s2) var(--s4); border-bottom: 1px solid var(--line); min-height: 60px; } .conv-title { flex: 1 1 150px; min-width: 0; } .conv-title b { display: block; font-weight: 500; } .conv-title .meta { display: block; } .conv-ai { flex: none; } .conv-back { display: none; }
.conv-body { flex: 1; overflow: auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); min-height: 0; } .conv-foot { border-top: 1px solid var(--line); padding: var(--s3) var(--s4); display: flex; flex-direction: column; gap: var(--s2); } .conv-foot textarea.inp { min-height: 56px; height: 64px; } .csel { width: 170px; }
.ref.quiet { background: none; color: var(--mute); font-weight: 400; text-decoration: underline; text-underline-offset: 2px; padding: 2px 4px; } .ref.quiet:hover { color: var(--ink); }
.m2 { display: flex; gap: var(--s3); align-items: flex-start; } .m2b { min-width: 0; display: flex; flex-direction: column; gap: var(--s1); font-size: var(--t-sec); } .m2b p { margin: 0; line-height: 1.55; max-width: 68ch; overflow-wrap: anywhere; } .m2.mine .avatar { background: var(--soft-2); color: var(--ink); } .mention { font-weight: 500; color: var(--accent); }
.newline { display: flex; align-items: center; gap: var(--s3); color: var(--accent); font-size: var(--t-meta); } .newline::before, .newline::after { content: ""; flex: 1; height: 1px; background: var(--accent); opacity: 0.4; }
.chat2.compact { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; } .chat2.compact .conv-foot .row > .grow { display: none; } .chat2.compact .conv-foot .row > .btn.primary { flex: 1 1 100%; justify-content: center; min-height: 48px; } .chat2.compact .conv-body { max-height: 46vh; } .chat2.compact .chlist { border-right: 0; } .chat2.compact.has .chlist, .chat2.compact:not(.has) .conv { display: none; } .chat2.compact .conv-back { display: inline-flex; } .chat2.compact .csel { width: 140px; }
.tabic { position: relative; display: inline-flex; } .tabic .bdot { top: -7px; right: -16px; }
.drawer .modal-body { flex: 1; }
.bell { position: relative; display: inline-flex; } .bdot { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #E8B96A; color: #111110; font-size: var(--t-meta); font-style: normal; font-weight: 500; display: grid; place-items: center; pointer-events: none; }
.field-top .icon-btn { color: var(--on-brand); } .field-top .icon-btn:hover { background: rgba(240, 236, 229, 0.09); }
@media (max-width: 767px) { .rgrid { grid-template-columns: 124px repeat(5, minmax(96px, 1fr)); min-width: 620px; } .rname, .rtrade, .rgrid > .rhd:first-child { padding-left: var(--s4); } }
/* Below the widest layout the list and the conversation take turns, so each gets the full width. */
@media (max-width: 1279px) { .chat2 { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; } .chat2 .chlist { border-right: 0; } .chat2.has .chlist, .chat2:not(.has) .conv { display: none; } .conv-back { display: inline-flex; } .conv-body { max-height: 54vh; min-height: 200px; } }
@media (max-width: 767px) { .chat2 .conv-foot .row > .grow { display: none; } .chat2 .conv-foot .row > .btn.primary { flex: 1 1 100%; justify-content: center; min-height: 48px; } .conv-body { min-height: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } .spin { animation: none !important; border-right-color: currentColor; opacity: 0.5; } .micbtn.on::after { animation: none !important; opacity: 0.6; } }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s1) var(--s3) var(--s1) var(--s6); border-top: 1px solid var(--line); min-height: 48px; }
.tbl td.go { width: 40px; color: var(--mute); text-align: right; padding-left: 0; } .tbl td.go svg { vertical-align: middle; }
@media (max-width: 1279px) { .split, .split.r440, .split.l340 { grid-template-columns: minmax(0, 1fr); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stage { grid-template-columns: minmax(0, 1fr); } .stage .side { display: none; } }
/* Tablet and below: the rail folds behind the menu button so the workspace keeps the full width. */
@media (max-width: 1023px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 56px 1fr; }
  .topbar { padding-right: var(--s3); gap: var(--s2); } .topbar .menu-btn { display: inline-grid; } .brand { width: auto; padding: 0 var(--s1); } .topbar .brand > span, .topbar .demo-tag, .syncdot { display: none; }
  .projname { flex: 1 1 0; }
  :root { --strip: 25px; } .demo-strip.r-office { display: block; }
  .nav { position: fixed; top: calc(56px + var(--strip, 0px)); left: 0; bottom: 0; width: min(300px, 86vw); z-index: 75; transform: translateX(-102%); visibility: hidden; transition: transform var(--d4) var(--ease), visibility 0s linear var(--d4); border-right: 1px solid var(--frame-line); } .nav.open { transform: none; visibility: visible; transition: transform var(--d4) var(--ease), visibility 0s; }
  .nav-scrim { display: block; position: fixed; inset: calc(56px + var(--strip, 0px)) 0 0 0; z-index: 74; background: rgba(17, 17, 16, 0.45); animation: fade var(--d2) ease-out; }
  main { border-radius: 0; border-left: 0; }
  /* Touch sizes: small chips keep their look and gain a 44px hit area. */
  .brand { min-width: 44px; min-height: 44px; justify-content: center; } .topbar .btn.sm { min-width: 44px; justify-content: center; }
  .ref { position: relative; } .ref::after { content: ""; position: absolute; inset: -11px -3px; }
}
@media (max-width: 767px) {
  .topbar { padding-right: var(--s2); gap: var(--s1); } .demo-tag, .hide-sm { display: none; }
  .projname small { display: none; } .top-actions { gap: 0; } .topbar .btn.sm { padding: 0 var(--s2); }
  .page { padding: var(--s6) var(--s4) var(--s10); } h1 { font-size: 1.625rem; }
  .paper { padding: var(--s6) var(--s4); max-height: none; } .g-row { padding-left: var(--s4); padding-right: var(--s4); grid-template-columns: 200px minmax(0, 1fr); } .tour { flex-direction: column; align-items: stretch; bottom: auto; top: calc(60px + var(--strip, 0px)); } .tour .row { justify-content: flex-end; }
  .g2, .g3, .g4, .form.two { grid-template-columns: minmax(0, 1fr); } .signin { grid-template-columns: 1fr; } .signin .show { display: none; } .signin .panel { padding: var(--s8) var(--s4); }
  .frame-head { padding-left: var(--s4); } .tbl-foot { padding-left: var(--s4); padding-right: var(--s1); } .frame.pad, .frame-body { padding-left: var(--s4); padding-right: var(--s4); } .tbl th:first-child, .tbl td:first-child { padding-left: var(--s4); } .filters { padding: var(--s4); } .filters .field { width: 100%; }
  .list .item { padding-left: var(--s4); padding-right: var(--s4); } .dl { grid-template-columns: 110px minmax(0, 1fr); } .modal-body, .modal-foot { padding-left: var(--s4); padding-right: var(--s4); }
  .stage { display: block; } .stage .dock { padding: 0; height: 100%; display: block; } .phone { width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
  .tbl.cards thead { display: none; } .tbl.cards, .tbl.cards tbody, .tbl.cards tr, .tbl.cards td { display: block; width: 100%; } .tbl.cards tr { border-bottom: 1px solid var(--line); padding: var(--s3) 0; }
  .tbl.cards td { border: 0; padding: 2px var(--s4) !important; text-align: left !important; } .tbl.cards td[data-l]::before { content: attr(data-l) ": "; color: var(--mute); font-size: var(--t-meta); }
  .cal { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cal .hd { display: none; } .cal .ev { min-height: 44px; white-space: normal; } .bmap .cell { min-height: 44px; } .tbl.cards td.go { display: none; }
  .split.r440 { grid-template-columns: minmax(0, 1fr); } .btn.fbtn { display: inline-flex; } .fmore { display: none; } .fmore.open { display: contents; }
  .portal-top { flex-wrap: wrap; padding: 0 var(--s2); min-height: 56px; } .portal-top .brand .by { display: none; } .portal-top .menu-wrap { margin-left: auto; } .portal-nav { order: 5; flex-basis: 100%; padding-bottom: var(--s1); }
}
