/* ==========================================================================
   SRAG — insurance knowledge intelligence
   An editorial, quiet-luxury interface. No external fonts, no CDNs.
   ========================================================================== */

:root {
  --ink: #101c2c;
  --ink-soft: #1b2b3d;
  --ink-mute: #334456;
  --paper: #f4f0e6;
  --paper-deep: #eee8db;
  --paper-light: #fbf8f1;
  --card: #fffdf8;
  --card-glass: rgba(255, 253, 248, .78);
  --line: #e1d7c5;
  --line-soft: #ece5d7;
  --gold: #87632f;
  --gold-bright: #c6a166;
  --gold-pale: #f0e4cd;
  --jade: #1d6a58;
  --jade-soft: #e1ede8;
  --copper: #a85a44;
  --copper-soft: #f5e5df;
  --muted: #526058;
  --muted-soft: #626e65;
  --white: #fffdf8;
  --danger: #a14c3e;
  --shadow-sm: 0 1px 2px rgba(16, 28, 44, .04), 0 10px 24px -20px rgba(16, 28, 44, .28);
  --shadow-md: 0 2px 4px rgba(16, 28, 44, .03), 0 24px 60px -36px rgba(16, 28, 44, .35);
  --shadow-lg: 0 40px 100px -48px rgba(8, 15, 24, .55);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sidebar-w: 254px;
  --topbar-h: 68px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

[data-theme="dark"] {
  --ink: #f2ecdf;
  --ink-soft: #d7d0c2;
  --ink-mute: #aeb5b0;
  --paper: #0a1220;
  --paper-deep: #0c1726;
  --paper-light: #101c2b;
  --card: #121f2f;
  --card-glass: rgba(18, 31, 47, .82);
  --line: #273649;
  --line-soft: #1d2b3c;
  --gold: #c8a46b;
  --gold-bright: #ddbd88;
  --gold-pale: #342b1d;
  --jade: #6dbb9f;
  --jade-soft: #132d28;
  --copper: #d28b73;
  --copper-soft: #34211d;
  --muted: #b9c4bf;
  --muted-soft: #a4b1aa;
  --white: #f7f1e5;
  --danger: #d88370;
  --shadow-sm: 0 10px 30px -24px rgba(0, 0, 0, .7);
  --shadow-md: 0 30px 80px -48px rgba(0, 0, 0, .9);
  --shadow-lg: 0 50px 120px -50px rgba(0, 0, 0, .9);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: auto;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 78% -5%, rgba(196, 164, 108, .13), transparent 60%),
    radial-gradient(ellipse 45% 45% at 8% 96%, rgba(38, 83, 74, .08), transparent 58%),
    repeating-linear-gradient(0deg, rgba(86, 72, 48, .018) 0, rgba(86, 72, 48, .018) 1px, transparent 1px, transparent 4px);
}
[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse 55% 40% at 80% -8%, rgba(196, 164, 108, .10), transparent 60%),
    radial-gradient(ellipse 45% 45% at 5% 96%, rgba(61, 123, 107, .10), transparent 58%);
}
::selection { background: var(--gold-pale); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
img, svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 28%, transparent); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--gold) 52%, transparent); border: 2px solid transparent; background-clip: content-box; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Layout ------------------------------------------------------------------ */
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh;
}

/* Sidebar ----------------------------------------------------------------- */
.sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 24px 15px 18px;
  color: #e9e2d3;
  background:
    radial-gradient(ellipse 130% 55% at 0% 0%, rgba(181, 138, 75, .13), transparent 58%),
    linear-gradient(168deg, #0b1826 0%, #0e1b2b 46%, #0a1521 100%);
  border-right: 1px solid rgba(198, 161, 102, .16);
  overflow: hidden;
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(198, 161, 102, .6), rgba(198, 161, 102, 0) 28%) 0 0 / 1px 100% no-repeat,
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .014) 0, rgba(255, 255, 255, .014) 1px, transparent 1px, transparent 6px);
  opacity: .8;
}
.sidebar > * { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; }
.brand-mark {
  position: relative;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid rgba(198, 161, 102, .62);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(198, 161, 102, .18), rgba(198, 161, 102, .02));
  box-shadow: inset 0 0 0 3px rgba(8, 16, 25, .45);
  transform: rotate(45deg);
}
.brand-mark::after {
  content: ""; position: absolute; inset: 5px; border: 1px solid rgba(198, 161, 102, .22); border-radius: 6px;
}
.brand-mark span {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1;
  color: #dfc18d;
  transform: rotate(-45deg);
  font-weight: 600;
}
.brand-copy { min-width: 0; }
.brand-name { font-family: Georgia, var(--serif); font-size: 18px; letter-spacing: .22em; color: #f5efe2; line-height: 1.2; }
.brand-sub { font-size: 14px; letter-spacing: .18em; color: rgba(233, 226, 211, 0.75); margin-top: 4px; }

.new-chat-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 11px 12px;
  color: #f3ecdd;
  background: rgba(255, 253, 248, .055);
  border: 1px solid rgba(198, 161, 102, .30);
  border-radius: 12px;
  font-size: 14px;
  letter-spacing: .02em;
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.new-chat-btn:hover { background: rgba(198, 161, 102, .13); border-color: rgba(198, 161, 102, .55); transform: translateY(-1px); }
.new-chat-btn .plus {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(198, 161, 102, .18);
  color: #dfc18d; font-size: 15px; line-height: 1;
}
.new-chat-btn kbd {
  margin-left: auto; font-family: var(--sans); font-size: 14px; color: rgba(233, 226, 211, 0.75);
  border: 1px solid rgba(233, 226, 211, .13); border-radius: 5px; padding: 2px 5px; letter-spacing: .06em;
}

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 22px; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  min-height: 40px; padding: 9px 11px;
  border-radius: 10px;
  color: rgba(233, 226, 211, 0.75);
  font-size: 14px;
  letter-spacing: .02em;
  transition: color .22s var(--ease), background .22s var(--ease);
}
.nav-item::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 2px; height: 0;
  background: #cfad72; border-radius: 2px; transform: translateY(-50%);
  transition: height .28s var(--ease);
}
.nav-item:hover { color: #f5efe2; background: rgba(255, 253, 248, .045); }
.nav-item.active { color: #fffaf0; background: linear-gradient(90deg, rgba(198, 161, 102, .16), rgba(198, 161, 102, .035)); }
.nav-item.active::before { height: 18px; }
.nav-icon { width: 19px; height: 19px; flex: 0 0 19px; opacity: .8; }
.nav-icon svg { width: 19px; height: 19px; }
.nav-item.active .nav-icon { opacity: 1; color: #d9ba83; }
.nav-pip { width: 4px; height: 4px; border-radius: 50%; background: #cfad72; margin-left: auto; box-shadow: 0 0 0 3px rgba(207, 173, 114, .1); }
.sidebar-divider { height: 1px; background: rgba(233, 226, 211, .09); margin: 25px 8px 19px; }
.sidebar-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 9px;
  font-size: 14px; letter-spacing: .18em; text-transform: uppercase; color: rgba(233, 226, 211, 0.75);
}
.recent-chats { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; flex: 1; padding: 0 3px; }
.recent-chats::-webkit-scrollbar { width: 4px; }
.recent-chat {
  display: block; padding: 9px 10px; border-radius: 9px;
  color: rgba(233, 226, 211, 0.75);
  font-size: 14px; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.recent-chat:hover { background: rgba(255, 253, 248, .05); color: #f5efe2; }
.recent-chat.active { background: rgba(198, 161, 102, .12); color: #f7f0e2; }
.recent-chat .rc-time { display: block; font-size: 14px; color: rgba(233, 226, 211, 0.75); margin-top: 2px; letter-spacing: .04em; }
.recent-empty { padding: 10px; font-size: 14px; color: rgba(233, 226, 211, 0.75); }

.sidebar-footer { flex: 0 0 auto; padding-top: 16px; }
.runtime-card {
  padding: 12px 12px 10px;
  margin: 0 2px 12px;
  border: 1px solid rgba(198, 161, 102, .18);
  border-radius: 12px;
  background: rgba(255, 253, 248, .035);
}
.runtime-top { display: flex; align-items: center; gap: 7px; font-size: 14px; letter-spacing: .03em; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #79b89b; box-shadow: 0 0 0 3px rgba(121, 184, 155, .10); flex: 0 0 6px; }
.runtime-label { color: rgba(233, 226, 211, 0.78); }
.runtime-mode { margin-left: auto; color: #d9ba83; font-size: 14px; letter-spacing: .02em; }
.runtime-meter { height: 2px; background: rgba(233, 226, 211, .09); margin: 9px 0 7px; overflow: hidden; border-radius: 4px; }
.runtime-meter span { display: block; width: 86%; height: 100%; background: linear-gradient(90deg, #a8793e, #d9ba83); }
.runtime-note { font-size: 14px; color: rgba(233, 226, 211, 0.75); letter-spacing: .04em; }
.nav-item-small { min-height: 34px; padding: 7px 11px; font-size: 14px; }
.profile {
  display: flex; align-items: center; gap: 9px;
  margin-top: 9px; padding: 12px 9px 2px;
  border-top: 1px solid rgba(233, 226, 211, .08);
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(198, 161, 102, .30), rgba(198, 161, 102, .08));
  border: 1px solid rgba(198, 161, 102, .34);
  font-family: var(--serif); color: #e6cfa7; font-size: 14px;
}
.profile-copy { min-width: 0; flex: 1; }
.profile-name { font-size: 14px; color: #f0e9dc; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-role { font-size: 14px; color: rgba(233, 226, 211, 0.75); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile { cursor: pointer; border-radius: 9px; transition: background .2s var(--ease); }
.profile:hover { background: rgba(255, 253, 248, .045); }
.role-chevron { width: 14px; height: 14px; color: rgba(233, 226, 211, 0.75); flex: 0 0 14px; }
.role-chevron svg { width: 14px; height: 14px; }
.profile .icon-btn.tiny { margin-left: 1px; }
.icon-btn {
  width: 34px; height: 34px; border: 1px solid transparent; border-radius: 9px;
  display: inline-grid; place-items: center;
  background: transparent; color: var(--muted);
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); border-color: var(--line-soft); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.tiny { width: 25px; height: 25px; color: rgba(233, 226, 211, 0.75); }
.icon-btn.tiny svg { width: 13px; height: 13px; }
.icon-btn.tiny:hover { color: #e9e2d3; background: rgba(255, 253, 248, .06); }
.sidebar-scrim { display: none; }

/* Main / topbar ----------------------------------------------------------- */
.main { min-width: 0; display: flex; flex-direction: column; height: 100vh; }
.topbar {
  position: relative; z-index: 20;
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 34px;
  background: color-mix(in srgb, var(--paper) 74%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px);
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.mobile-menu { display: none; }
.breadcrumb { display: flex; align-items: center; gap: 9px; font-size: 14px; letter-spacing: .05em; color: var(--muted); }
.crumb-root { font-family: Georgia, var(--serif); letter-spacing: .15em; color: var(--gold); font-size: 14px; }
.crumb-sep { color: var(--line); }
.crumb-current { color: var(--ink-soft); }
.topbar-center { flex: 1; display: flex; justify-content: center; }
.omni-search {
  display: flex; align-items: center; gap: 9px;
  width: min(390px, 100%);
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--card) 58%, transparent);
  color: var(--muted-soft);
  font-size: 14px; letter-spacing: .02em;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.omni-search:hover { border-color: var(--gold); background: var(--card); box-shadow: var(--shadow-sm); }
.omni-search svg { width: 14px; height: 14px; }
.omni-search kbd {
  margin-left: auto; font-family: var(--sans); font-size: 14px; color: var(--muted-soft);
  border: 1px solid var(--line); padding: 2px 5px; border-radius: 4px; letter-spacing: .06em;
}
.topbar-right { display: flex; align-items: center; gap: 4px; min-width: 170px; margin-inline-start:auto; justify-content: flex-end; }
.topbar-badge {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 9px; margin-right: 4px;
  border: 1px solid color-mix(in srgb, var(--jade) 22%, var(--line));
  border-radius: 99px;
  color: var(--jade); background: color-mix(in srgb, var(--jade) 5%, transparent);
  font-size: 14px; letter-spacing: .05em;
}
.topbar-badge .status-dot { background: var(--jade); box-shadow: 0 0 0 3px color-mix(in srgb, var(--jade) 10%, transparent); }

.view {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 34px 40px 60px;
  scroll-behavior: smooth;
}
.view-inner { max-width: 1460px; margin: 0 auto; animation: fadeUp .55s var(--ease) both; }
.view.route-chat { overflow: hidden; padding: 0; }

/* Shared type ------------------------------------------------------------- */
.eyebrow {
  display: flex; align-items: center; gap: 9px;
  color: var(--gold);
  font-size: 14px; letter-spacing: .22em; text-transform: uppercase;
  font-family: Georgia, var(--sans);
}
.eyebrow::before { content: ""; width: 19px; height: 1px; background: var(--gold); opacity: .65; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.page-head-copy { min-width: 0; }
.page-head h1 {
  margin: 10px 0 7px;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 3.1vw, 42px); line-height: 1.16; letter-spacing: -.025em;
  color: var(--ink);
}
.page-head h1 em { font-style: normal; color: var(--gold); }
.page-lede { max-width: 660px; color: var(--muted); font-size: 14px; line-height: 1.8; letter-spacing: .01em; }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 15px; }
.section-title h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 20px; letter-spacing: -.01em; }
.section-title .en { color: var(--muted-soft); font-family: Georgia, serif; font-size: 14px; letter-spacing: .16em; text-transform: uppercase; }
.section-title .spacer { flex: 1; }
.section-link { color: var(--gold); font-size: 14px; letter-spacing: .03em; display: inline-flex; gap: 5px; align-items: center; }
.section-link:hover { color: var(--ink); }
.section-link svg { width: 13px; height: 13px; }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 9px;
  font-size: 14px; letter-spacing: .02em;
  transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease);
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { color: #fbf6eb; background: var(--ink); border-color: var(--ink); box-shadow: 0 8px 22px -14px rgba(16, 28, 44, .7); }
.btn-primary:hover { background: #1a2c40; border-color: #1a2c40; box-shadow: 0 12px 26px -14px rgba(16, 28, 44, .8); }
[data-theme="dark"] .btn-primary { color: #0e1a27; background: #e7d8bd; border-color: #e7d8bd; }
[data-theme="dark"] .btn-primary:hover { background: #f2e6d1; border-color: #f2e6d1; }
.btn-gold { color: #2a1f11; background: linear-gradient(145deg, #d9ba83, #b98e4f); border-color: #c6a166; box-shadow: 0 8px 24px -16px rgba(173, 133, 73, .9); }
.btn-gold:hover { background: linear-gradient(145deg, #e3c895, #c39a5b); }
.btn-ghost { color: var(--ink-soft); background: transparent; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: color-mix(in srgb, var(--gold) 5%, transparent); }
.btn-quiet { color: var(--muted); background: transparent; border-color: transparent; }
.btn-quiet:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 32%, var(--line)); background: transparent; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.btn-sm { height: 31px; padding: 0 11px; font-size: 14px; border-radius: 7px; }
.btn-wide { width: 100%; }
.btn:disabled { opacity: .55; transform: none; }

/* Cards / chips ----------------------------------------------------------- */
.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  background: transparent;
  font-size: 14px; letter-spacing: .03em;
  transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
}
.chip:hover { border-color: var(--gold); color: var(--gold); }
.chip.active { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); background: color-mix(in srgb, var(--gold) 10%, transparent); color: var(--gold); }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 4px;
  white-space: nowrap;
  font-size: 14px; line-height: 1.6; letter-spacing: .04em;
  color: var(--muted);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.tag-gold { color: var(--gold); background: color-mix(in srgb, var(--gold) 7%, transparent); border-color: color-mix(in srgb, var(--gold) 22%, var(--line)); }
.tag-jade { color: var(--jade); background: color-mix(in srgb, var(--jade) 7%, transparent); border-color: color-mix(in srgb, var(--jade) 20%, var(--line)); }
.tag-copper { color: var(--copper); background: color-mix(in srgb, var(--copper) 7%, transparent); border-color: color-mix(in srgb, var(--copper) 20%, var(--line)); }
.tag-muted { color: var(--muted-soft); }

/* Dashboard --------------------------------------------------------------- */
.dash-greeting { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.dash-greeting h1 {
  margin: 7px 0 7px;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 3.2vw, 44px); line-height: 1.14; letter-spacing: -.03em;
}
.dash-greeting h1 span { color: var(--gold); }
.dash-greeting .page-lede { font-size: 14px; }
.date-stamp { text-align: right; color: var(--muted-soft); font-size: 14px; letter-spacing: .1em; line-height: 1.8; white-space: nowrap; }
.date-stamp strong { display: block; font-family: Georgia, serif; font-weight: 400; font-size: 14px; letter-spacing: .16em; color: var(--ink-soft); }

.hero-search {
  position: relative;
  overflow: hidden;
  padding: 30px 34px 27px;
  margin-bottom: 18px;
  background:
    radial-gradient(ellipse 45% 120% at 95% 30%, rgba(173, 133, 73, .12), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--card) 94%, #f4ead7), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.hero-search::before,
.hero-search::after {
  content: ""; position: absolute; border: 1px solid color-mix(in srgb, var(--gold) 15%, transparent);
  border-radius: 50%; pointer-events: none;
}
.hero-search::before { width: 340px; height: 340px; right: -130px; top: -170px; }
.hero-search::after { width: 460px; height: 460px; right: -190px; top: -230px; border-style: dashed; opacity: .65; }
.hero-kicker { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; color: var(--gold); font-family: Georgia, serif; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; }
.hero-kicker::before { content: ""; width: 20px; height: 1px; background: var(--gold); }
.hero-search h2 {
  position: relative; z-index: 1;
  margin: 12px 0 5px;
  font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 2.5vw, 36px); letter-spacing: -.025em;
}
.hero-search h2 em { font-style: normal; color: var(--gold); }
.hero-search p { position: relative; z-index: 1; margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.hero-input-row { position: relative; z-index: 1; display: flex; gap: 8px; max-width: 850px; }
.hero-input-wrap { flex: 1; position: relative; }
.hero-input-wrap > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--gold); }
.hero-input {
  width: 100%; height: 52px;
  padding: 0 46px 0 44px;
  border: 1px solid color-mix(in srgb, var(--gold) 28%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper-light) 76%, transparent);
  color: var(--ink);
  font-size: 14px; letter-spacing: .01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.hero-input::placeholder { color: var(--muted-soft); }
.hero-input:focus { outline: none; border-color: var(--gold); background: var(--paper-light); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 10%, transparent); }
.hero-kbd { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-soft); font-size: 14px; border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; }
.hero-submit { height: 52px; padding: 0 20px; border-radius: 12px; }
.quick-asks { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.quick-asks .qa-label { font-size: 14px; letter-spacing: .12em; color: var(--muted-soft); text-transform: uppercase; margin-right: 2px; }
.quick-ask { font-size: 14px; color: var(--ink-mute); border: 1px solid var(--line); border-radius: 99px; padding: 5px 10px; background: color-mix(in srgb, var(--card) 62%, transparent); transition: all .2s var(--ease); }
.quick-ask:hover { color: var(--gold); border-color: var(--gold); background: var(--card); }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric {
  position: relative; overflow: hidden;
  padding: 18px 19px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  animation: fadeUp .55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}
.metric::after { content: ""; position: absolute; left: 19px; top: 0; width: 22px; height: 2px; background: var(--gold); opacity: .55; }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 14px; letter-spacing: .05em; }
.metric-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 7%, transparent); color: var(--gold); }
.metric-icon svg { width: 14px; height: 14px; }
.metric-value { margin-top: 8px; font-family: Georgia, var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; letter-spacing: -.02em; }
.metric-value small { font-family: var(--sans); font-size: 14px; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.metric-foot { margin-top: 7px; color: var(--muted-soft); font-size: 14px; letter-spacing: .02em; display: flex; align-items: center; gap: 5px; }
.metric-foot .up { color: var(--jade); }
.metric-foot .gold { color: var(--gold); }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.52fr) minmax(300px, .78fr); gap: 14px; margin-bottom: 14px; }
.dash-grid-even { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 14px; }
.panel { padding: 22px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.panel-title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 18px; letter-spacing: -.01em; }
.panel-sub { margin: 3px 0 0; color: var(--muted); font-size: 14px; letter-spacing: .02em; }
.panel-count { font-family: Georgia, serif; font-size: 14px; color: var(--muted-soft); }

.category-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; }
.category-row { padding: 8px 0 7px; border-bottom: 1px solid var(--line-soft); }
.category-row:last-child, .category-row:nth-last-child(2):nth-child(odd) { border-bottom: none; }
.category-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.category-name { font-size: 14px; color: var(--ink-soft); }
.category-count { font-family: Georgia, serif; font-size: 14px; color: var(--muted-soft); }
.category-bar { height: 3px; margin-top: 7px; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 5px; overflow: hidden; }
.category-bar span { display: block; height: 100%; width: var(--w, 10%); background: linear-gradient(90deg, var(--gold), color-mix(in srgb, var(--gold) 45%, var(--jade))); border-radius: 5px; opacity: .72; transition: width .8s var(--ease); }

.pulse-card {
  position: relative; overflow: hidden;
  padding: 22px;
  color: #eee7d8;
  background:
    radial-gradient(ellipse 80% 70% at 100% 0%, rgba(198, 161, 102, .24), transparent 60%),
    linear-gradient(150deg, #132335, #0e1b2a 65%, #0b1723);
  border: 1px solid rgba(198, 161, 102, .23);
  border-radius: var(--radius-md);
}
.pulse-card::before { content: ""; position: absolute; width: 220px; height: 220px; border: 1px solid rgba(198, 161, 102, .13); border-radius: 50%; right: -92px; bottom: -100px; }
[data-theme="dark"] .pulse-card { background: radial-gradient(ellipse 80% 70% at 100% 0%, rgba(198, 161, 102, .16), transparent 60%), linear-gradient(150deg, #172839, #101b28); }
.pulse-head { display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 1; }
.pulse-head .en { font-family: Georgia, serif; font-size: 14px; letter-spacing: .18em; color: rgba(233, 226, 211, 0.75); text-transform: uppercase; }
.pulse-head h3 { margin: 6px 0 0; font-family: var(--serif); font-weight: 500; font-size: 18px; color: #f3ecde; }
.pulse-gauge { position: relative; width: 126px; height: 126px; margin: 22px auto 15px; display: grid; place-items: center; }
.pulse-gauge .ring { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(#cfad72 0 var(--score), rgba(255, 255, 255, .08) var(--score) 100%); mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); }
.pulse-gauge .ring-inner { position: absolute; inset: 13px; border-radius: 50%; border: 1px solid rgba(233, 226, 211, .09); }
.pulse-score { position: relative; z-index: 1; text-align: center; }
.pulse-score strong { display: block; font-family: Georgia, serif; font-weight: 400; font-size: 38px; line-height: 1; color: #f3ecde; }
.pulse-score span { display: block; font-size: 14px; letter-spacing: .12em; color: rgba(233, 226, 211, 0.75); margin-top: 6px; }
.pulse-stats { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 -4px; border-top: 1px solid rgba(233, 226, 211, .1); }
.pulse-stat { padding: 12px 4px 0; }
.pulse-stat strong { display: block; font-family: Georgia, serif; font-weight: 400; font-size: 16px; color: #e6cfa7; }
.pulse-stat span { font-size: 14px; color: rgba(233, 226, 211, 0.75); letter-spacing: .04em; }
.pulse-foot { position: relative; z-index: 1; margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(233, 226, 211, .1); font-size: 14px; color: rgba(233, 226, 211, 0.75); display: flex; align-items: center; gap: 7px; }

.doc-list { display: flex; flex-direction: column; }
.doc-list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .2s var(--ease), padding-left .2s var(--ease);
}
.doc-list-row:last-child { border-bottom: none; }
.doc-list-row:hover { background: color-mix(in srgb, var(--gold) 4%, transparent); padding-left: 7px; }
.file-badge {
  width: 34px; height: 39px; flex: 0 0 34px;
  display: grid; place-items: center; position: relative;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: Georgia, serif; font-size: 14px; letter-spacing: .04em;
  color: var(--muted);
  background: var(--paper-light);
}
.file-badge::after { content: ""; position: absolute; top: -1px; right: -1px; width: 8px; height: 8px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); border-radius: 0 5px 0 3px; }
.file-badge.pdf { color: #a14c3e; background: #fbf0eb; border-color: #ecd3c8; }
.file-badge.docx { color: #365f92; background: #eef3fa; border-color: #d6e1f0; }
.file-badge.xlsx { color: #1f6b52; background: #edf6f1; border-color: #cfe5d9; }
.file-badge.pptx { color: #9c5c2b; background: #fbf1e9; border-color: #efd8c4; }
.file-badge.md { color: #6d5b3e; background: #f8f4ea; border-color: #e6dcc8; }
[data-theme="dark"] .file-badge.pdf { background: #2b1a17; border-color: #4a2a23; color: #d98e78; }
[data-theme="dark"] .file-badge.docx { background: #162232; border-color: #293d55; color: #8fb4dd; }
[data-theme="dark"] .file-badge.xlsx { background: #13251f; border-color: #274538; color: #8ac7aa; }
[data-theme="dark"] .file-badge.pptx { background: #2a1e16; border-color: #4b3425; color: #d6a077; }
[data-theme="dark"] .file-badge.md { background: #242016; border-color: #403722; color: #c8b58b; }
.doc-main { min-width: 0; flex: 1; }
.doc-title { font-size: 14px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { display: flex; align-items: center; gap: 7px; margin-top: 3px; color: var(--muted-soft); font-size: 14px; letter-spacing: .02em; }
.doc-meta .dot { width: 2px; height: 2px; border-radius: 50%; background: var(--muted-soft); }
.doc-status { font-size: 14px; padding: 2px 7px; border-radius: 99px; white-space: nowrap; }
.status-ok { color: var(--jade); background: color-mix(in srgb, var(--jade) 8%, transparent); }
.status-warn { color: var(--copper); background: color-mix(in srgb, var(--copper) 8%, transparent); }
.status-muted { color: var(--muted); background: color-mix(in srgb, var(--muted) 7%, transparent); }

.recent-chat-list { display: flex; flex-direction: column; gap: 3px; }
.recent-chat-item { display: block; padding: 10px 3px; border-bottom: 1px solid var(--line-soft); transition: padding-left .2s var(--ease); }
.recent-chat-item:last-child { border-bottom: none; }
.recent-chat-item:hover { padding-left: 7px; }
.recent-chat-q { font-size: 14px; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.recent-chat-meta { margin-top: 3px; color: var(--muted-soft); font-size: 14px; display: flex; gap: 7px; }
.attention-list { display: flex; flex-direction: column; gap: 8px; }
.attention-item { display: flex; gap: 9px; padding: 9px 10px; border: 1px dashed var(--line); border-radius: 9px; background: color-mix(in srgb, var(--copper) 3%, transparent); }
.attention-icon { color: var(--copper); flex: 0 0 auto; margin-top: 1px; }
.attention-icon svg { width: 13px; height: 13px; }
.attention-main { min-width: 0; }
.attention-title { font-size: 14px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attention-note { font-size: 14px; color: var(--muted-soft); margin-top: 2px; }

/* Chat -------------------------------------------------------------------- */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 376px; height: calc(100vh - var(--topbar-h)); min-height: 0; }
.chat-main { min-width: 0; display: flex; flex-direction: column; min-height: 0; position: relative; }
.chat-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 17px 30px; border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--paper) 70%, transparent);
  backdrop-filter: blur(12px);
}
.chat-head-left { display: flex; align-items: center; gap: 11px; min-width: 0; }
.chat-title-wrap { min-width: 0; }
.chat-title { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-sub { color: var(--muted-soft); font-size: 14px; letter-spacing: .04em; margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chat-head-actions { display: flex; align-items: center; gap: 5px; }
.mode-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 99px;
  color: var(--muted); font-size: 14px; letter-spacing: .03em;
  background: color-mix(in srgb, var(--card) 50%, transparent);
}
.mode-pill .status-dot { width: 5px; height: 5px; }
.mode-pill.llm { color: var(--jade); border-color: color-mix(in srgb, var(--jade) 25%, var(--line)); }
.mode-pill.local { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 25%, var(--line)); }

.chat-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 30px 36px 26px; }
.thread-inner { max-width: 790px; margin: 0 auto; }
.chat-empty { min-height: 100%; display: flex; flex-direction: column; justify-content: center; max-width: 790px; margin: 0 auto; padding: 10px 0 30px; }
.chat-empty .eyebrow { color: var(--gold); }
.chat-empty h1 {
  margin: 16px 0 12px;
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(33px, 4vw, 52px); line-height: 1.16; letter-spacing: -.035em;
}
.chat-empty h1 em { font-style: normal; color: var(--gold); }
.chat-empty > p { max-width: 530px; color: var(--muted); font-size: 14px; line-height: 1.9; margin: 0; }
.suggest-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 28px; }
.suggest-card {
  position: relative; text-align: left;
  padding: 15px 15px 14px;
  border: 1px solid var(--line); border-radius: 13px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
}
.suggest-card:hover { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); transform: translateY(-2px); background: var(--card); box-shadow: var(--shadow-sm); }
.suggest-tag { display: flex; align-items: center; gap: 6px; color: var(--gold); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.suggest-tag::before { content: ""; width: 11px; height: 1px; background: var(--gold); }
.suggest-text { margin-top: 7px; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.suggest-arrow { position: absolute; right: 12px; bottom: 11px; color: var(--line); transition: color .2s var(--ease), transform .2s var(--ease); }
.suggest-arrow svg { width: 13px; height: 13px; }
.suggest-card:hover .suggest-arrow { color: var(--gold); transform: translateX(2px); }
.chat-empty-foot { display: flex; align-items: center; gap: 8px; margin-top: 22px; color: var(--muted-soft); font-size: 14px; letter-spacing: .04em; }
.chat-empty-foot .status-dot { background: var(--gold); }

.message { margin-bottom: 27px; animation: fadeUp .45s var(--ease) both; }
.msg-user { display: flex; justify-content: flex-end; }
.msg-user .bubble {
  max-width: 78%;
  padding: 11px 16px;
  color: #f7f0e2;
  background: linear-gradient(145deg, #182a3d, #101c2c);
  border: 1px solid rgba(198, 161, 102, .18);
  border-radius: 16px 16px 4px 16px;
  font-size: 14px; line-height: 1.75;
  box-shadow: 0 12px 28px -22px rgba(16, 28, 44, .8);
}
[data-theme="dark"] .msg-user .bubble { background: linear-gradient(145deg, #21354a, #172838); color: #f4ecdc; }
.msg-assistant { display: flex; gap: 12px; }
.assistant-avatar {
  flex: 0 0 27px; width: 27px; height: 27px; margin-top: 1px;
  display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--gold) 30%, var(--line));
  border-radius: 7px;
  font-family: var(--serif); font-size: 14px; color: var(--gold);
  background: color-mix(in srgb, var(--gold) 7%, transparent);
  transform: rotate(45deg);
}
.assistant-avatar span { transform: rotate(-45deg); }
.assistant-body { min-width: 0; flex: 1; }
.assistant-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; color: var(--muted-soft); font-size: 14px; letter-spacing: .05em; }
.assistant-meta strong { color: var(--ink-soft); font-weight: 500; letter-spacing: .06em; font-family: Georgia, serif; font-size: 14px; }
.assistant-meta .dot { width: 2px; height: 2px; border-radius: 50%; background: var(--muted-soft); }
.assistant-meta .ai-badge { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-family: Georgia, serif; }

.prose { color: var(--ink-soft); font-size: 14px; line-height: 1.95; letter-spacing: .005em; }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose p { margin: 0 0 10px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  margin: 18px 0 8px; font-family: var(--serif); font-weight: 500; color: var(--ink); letter-spacing: -.01em;
}
.prose h1 { font-size: 22px; } .prose h2 { font-size: 19px; } .prose h3 { font-size: 16px; } .prose h4 { font-size: 14px; }
.prose ul, .prose ol { margin: 2px 0 12px; padding-left: 19px; }
.prose li { margin: 5px 0; padding-left: 2px; }
.prose li::marker { color: var(--gold); }
.prose blockquote { margin: 12px 0; padding: 9px 13px; border-left: 2px solid var(--gold); background: color-mix(in srgb, var(--gold) 4%, transparent); color: var(--muted); font-size: 14px; border-radius: 0 6px 6px 0; }
.prose code { font-family: var(--mono); font-size: .87em; background: color-mix(in srgb, var(--ink) 6%, transparent); padding: 1px 4px; border-radius: 3px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.prose th { background: color-mix(in srgb, var(--ink) 3%, transparent); color: var(--ink); font-weight: 500; }
.cite {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 15px; height: 15px; padding: 0 3px;
  border: 1px solid color-mix(in srgb, var(--gold) 42%, var(--line));
  border-radius: 4px;
  color: var(--gold); background: color-mix(in srgb, var(--gold) 6%, transparent);
  font-family: Georgia, serif; font-size: 14px; line-height: 1;
  vertical-align: super; margin: 0 1px;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.cite:hover, .cite.active { background: var(--gold); color: #21180b; border-color: var(--gold); }
.stream-cursor { display: inline-block; width: 6px; height: 14px; margin-left: 2px; background: var(--gold); vertical-align: -2px; animation: blink 1s steps(1) infinite; }
.notice-line { display: flex; gap: 7px; align-items: flex-start; margin: 9px 0 0; padding: 8px 10px; border: 1px dashed color-mix(in srgb, var(--copper) 32%, var(--line)); border-radius: 7px; color: var(--copper); font-size: 14px; line-height: 1.7; background: color-mix(in srgb, var(--copper) 4%, transparent); }
.notice-line svg { width: 12px; height: 12px; flex: 0 0 12px; margin-top: 2px; }
.answer-foot { display: flex; align-items: center; gap: 8px; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.answer-foot .tiny-note { color: var(--muted-soft); font-size: 14px; letter-spacing: .03em; margin-right: auto; }
.feedback-btn { width: 25px; height: 25px; border-radius: 6px; display: grid; place-items: center; border: 1px solid transparent; color: var(--muted-soft); background: transparent; }
.feedback-btn:hover { border-color: var(--line); color: var(--ink); }
.feedback-btn.active { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 30%, var(--line)); background: color-mix(in srgb, var(--gold) 6%, transparent); }
.feedback-btn svg { width: 12px; height: 12px; }
.followups { margin-top: 14px; }
.followup-label { font-size: 14px; letter-spacing: .12em; color: var(--muted-soft); text-transform: uppercase; margin-bottom: 7px; }
.followup-list { display: flex; flex-wrap: wrap; gap: 6px; }
.followup { text-align: left; color: var(--ink-mute); font-size: 14px; border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 55%, transparent); border-radius: 99px; padding: 5px 10px; transition: all .2s var(--ease); }
.followup:hover { border-color: var(--gold); color: var(--gold); background: var(--card); }

.composer-wrap { flex: 0 0 auto; padding: 8px 30px 20px; background: linear-gradient(to top, var(--paper) 55%, color-mix(in srgb, var(--paper) 10%, transparent)); }
.composer { max-width: 790px; margin: 0 auto; border: 1px solid color-mix(in srgb, var(--gold) 24%, var(--line)); border-radius: 15px; background: var(--card); box-shadow: 0 18px 48px -38px rgba(16, 28, 44, .7); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.composer:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 8%, transparent), 0 22px 50px -38px rgba(16, 28, 44, .7); }
.composer textarea { display: block; width: 100%; min-height: 48px; max-height: 150px; resize: none; border: 0; outline: 0; padding: 13px 15px 3px; background: transparent; color: var(--ink); font-size: 14px; line-height: 1.65; }
.composer textarea::placeholder { color: var(--muted-soft); }
.composer-bar { display: flex; align-items: center; gap: 8px; padding: 7px 9px 9px 12px; }
.composer-hint { color: var(--muted-soft); font-size: 14px; letter-spacing: .03em; display: flex; align-items: center; gap: 5px; }
.composer-hint svg { width: 11px; height: 11px; }
.composer-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.composer-select { height: 27px; padding: 0 7px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 14px; outline: none; }
.composer-select:focus { border-color: var(--gold); }
.send-btn { width: 33px; height: 33px; border: 0; border-radius: 8px; display: grid; place-items: center; background: var(--ink); color: #fbf6eb; transition: background .2s var(--ease), transform .2s var(--ease); }
.send-btn:hover { background: var(--gold); color: #21180b; transform: translateY(-1px); }
.send-btn:disabled { opacity: .4; transform: none; }
.send-btn svg { width: 15px; height: 15px; }
.send-btn.stop { background: transparent; color: var(--copper); border: 1px solid color-mix(in srgb, var(--copper) 35%, var(--line)); }
.send-btn.stop:hover { background: color-mix(in srgb, var(--copper) 8%, transparent); color: var(--copper); }

.evidence-panel {
  min-width: 0; min-height: 0; overflow-y: auto;
  border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-deep) 55%, var(--paper));
  padding: 23px 21px 30px;
}
.evidence-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.evidence-head .en { font-family: Georgia, serif; font-size: 14px; letter-spacing: .2em; color: var(--gold); text-transform: uppercase; }
.evidence-head h3 { margin: 6px 0 0; font-family: var(--serif); font-weight: 500; font-size: 19px; }
.evidence-count { font-family: Georgia, serif; font-size: 14px; color: var(--muted-soft); border: 1px solid var(--line); border-radius: 99px; padding: 3px 8px; }
.confidence-card { margin-top: 17px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--card) 55%, transparent); display: flex; align-items: center; gap: 12px; }
.confidence-ring { position: relative; width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--jade) 0 var(--conf), color-mix(in srgb, var(--ink) 7%, transparent) var(--conf) 100%); }
.confidence-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--card); }
.confidence-ring span { position: relative; z-index: 1; font-family: Georgia, serif; font-size: 14px; color: var(--jade); }
.confidence-copy { min-width: 0; }
.confidence-copy strong { display: block; font-size: 14px; color: var(--ink-soft); font-weight: 500; }
.confidence-copy span { display: block; font-size: 14px; color: var(--muted-soft); margin-top: 2px; line-height: 1.5; }
.evidence-tabs { display: flex; gap: 2px; margin: 18px 0 11px; border-bottom: 1px solid var(--line); }
.evidence-tab { position: relative; padding: 7px 9px 8px; border: 0; background: transparent; color: var(--muted-soft); font-size: 14px; letter-spacing: .03em; }
.evidence-tab.active { color: var(--ink); }
.evidence-tab.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; background: var(--gold); }
.source-list { display: flex; flex-direction: column; gap: 8px; }
.source-card {
  text-align: left; width: 100%;
  padding: 12px 12px 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: color-mix(in srgb, var(--card) 72%, transparent);
  transition: border-color .2s var(--ease), transform .2s var(--ease), background .2s var(--ease);
}
.source-card:hover, .source-card.active { border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); background: var(--card); transform: translateY(-1px); }
.source-top { display: flex; align-items: flex-start; gap: 8px; }
.source-num { flex: 0 0 19px; width: 19px; height: 19px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--gold) 36%, var(--line)); border-radius: 4px; color: var(--gold); font-family: Georgia, serif; font-size: 14px; }
.source-title { min-width: 0; flex: 1; font-size: 14px; line-height: 1.5; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.source-arrow { color: var(--line); margin-top: 1px; }
.source-arrow svg { width: 11px; height: 11px; }
.source-card:hover .source-arrow { color: var(--gold); }
.source-meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin: 7px 0 6px 27px; }
.source-snippet { margin-left: 27px; color: var(--muted); font-size: 14px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.source-score { margin: 8px 0 0 27px; display: flex; align-items: center; gap: 6px; color: var(--muted-soft); font-size: 14px; }
.source-score .bar { flex: 1; height: 2px; background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 4px; overflow: hidden; }
.source-score .bar span { display: block; width: var(--w); height: 100%; background: var(--gold); opacity: .65; }
.evidence-empty { margin-top: 26px; padding: 24px 15px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; color: var(--muted-soft); }
.evidence-empty svg { width: 24px; height: 24px; margin: 0 auto 8px; color: var(--gold); opacity: .6; }
.evidence-empty p { margin: 0; font-size: 14px; line-height: 1.7; }
.evidence-note { margin-top: 18px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted-soft); font-size: 14px; line-height: 1.8; }
.evidence-note strong { color: var(--muted); font-weight: 500; }
.evidence-tools { display: flex; gap: 6px; margin-top: 12px; }
.evidence-tools .btn { flex: 1; height: 30px; font-size: 14px; }
.mobile-evidence-btn { display: none; }

/* Library ----------------------------------------------------------------- */
.library-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.mini-stat { padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.mini-stat span { display: block; color: var(--muted); font-size: 14px; letter-spacing: .05em; }
.mini-stat strong { display: block; margin-top: 3px; font-family: Georgia, serif; font-weight: 400; font-size: 22px; }
.mini-stat strong small { font-family: var(--sans); font-size: 14px; color: var(--muted-soft); margin-left: 2px; }
.filter-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.search-field { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search-field svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--muted-soft); }
.search-field input { width: 100%; height: 35px; padding: 0 12px 0 33px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 14px; outline: 0; }
.search-field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 8%, transparent); }
.filter-select { height: 35px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--muted); font-size: 14px; outline: 0; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 13px) 15px, calc(100% - 9px) 15px; background-size: 4px 4px, 4px 4px; background-repeat: no-repeat; }
.filter-select:focus { border-color: var(--gold); }
.table-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.doc-table { width: 100%; border-collapse: collapse; }
.doc-table th { text-align: left; padding: 12px 15px; color: var(--muted-soft); font-size: 14px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 2%, transparent); white-space: nowrap; }
.doc-table td { padding: 12px 15px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.doc-table tbody tr { cursor: pointer; transition: background .18s var(--ease); }
.doc-table tbody tr:hover { background: color-mix(in srgb, var(--gold) 4%, transparent); }
.doc-table tbody tr:last-child td { border-bottom: 0; }
.td-file { display: flex; align-items: center; gap: 10px; min-width: 260px; }
.td-title { min-width: 0; }
.td-title strong { display: block; font-size: 14px; font-weight: 500; color: var(--ink-soft); max-width: 400px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-title span { display: block; font-size: 14px; color: var(--muted-soft); margin-top: 2px; max-width: 390px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-muted { color: var(--muted); font-size: 14px; white-space: nowrap; }
.td-meta { display: flex; flex-direction: column; gap: 2px; }
.td-meta span:first-child { font-size: 14px; color: var(--ink-mute); }
.td-meta span:last-child { font-size: 14px; color: var(--muted-soft); }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; opacity: .35; transition: opacity .18s var(--ease); }
tr:hover .row-actions { opacity: 1; }
.table-empty { padding: 62px 20px; text-align: center; color: var(--muted); }
.table-empty svg { width: 32px; height: 32px; margin: 0 auto 10px; color: var(--gold); opacity: .5; }
.table-empty h3 { margin: 0 0 5px; font-family: var(--serif); font-weight: 500; font-size: 18px; color: var(--ink); }
.table-empty p { margin: 0; font-size: 14px; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px 0; color: var(--muted-soft); font-size: 14px; }
.pagination .pages { display: flex; gap: 4px; }
.page-btn { min-width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--muted); font-size: 14px; }
.page-btn.active { background: var(--ink); border-color: var(--ink); color: var(--paper-light); }

/* Search ------------------------------------------------------------------ */
.search-hero {
  position: relative; overflow: hidden;
  padding: 33px 35px 30px;
  margin-bottom: 20px;
  color: #f2ecdf;
  background:
    radial-gradient(ellipse 60% 100% at 95% 10%, rgba(198, 161, 102, .20), transparent 55%),
    linear-gradient(145deg, #122234, #0d1a29 70%);
  border: 1px solid rgba(198, 161, 102, .23);
  border-radius: var(--radius-lg);
}
.search-hero::before { content: ""; position: absolute; width: 420px; height: 420px; right: -150px; top: -210px; border: 1px solid rgba(233, 226, 211, .08); border-radius: 50%; }
.search-hero::after { content: ""; position: absolute; width: 290px; height: 290px; right: -70px; top: -150px; border: 1px dashed rgba(198, 161, 102, .18); border-radius: 50%; }
.search-hero .eyebrow { color: #d1b47e; }
.search-hero h1 { position: relative; z-index: 1; margin: 11px 0 7px; font-family: var(--serif); font-weight: 500; font-size: clamp(27px, 2.8vw, 38px); letter-spacing: -.025em; }
.search-hero p { position: relative; z-index: 1; margin: 0 0 18px; color: rgba(233, 226, 211, 0.75); font-size: 14px; }
.search-big { position: relative; z-index: 1; display: flex; gap: 8px; max-width: 800px; }
.search-big-wrap { flex: 1; position: relative; }
.search-big-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #cfad72; }
.search-big input { width: 100%; height: 48px; padding: 0 13px 0 40px; border: 1px solid rgba(233, 226, 211, .16); border-radius: 10px; background: rgba(255, 253, 248, .06); color: #f7f0e2; font-size: 14px; outline: 0; }
.search-big input::placeholder { color: rgba(233, 226, 211, 0.75); }
.search-big input:focus { border-color: #cfad72; background: rgba(255, 253, 248, .08); }
.search-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 22px; align-items: start; }
.facet-box { position: sticky; top: 10px; }
.facet-title { font-size: 14px; letter-spacing: .15em; text-transform: uppercase; color: var(--muted-soft); margin-bottom: 8px; }
.facet-list { display: flex; flex-direction: column; gap: 1px; }
.facet { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px; border-radius: 6px; color: var(--muted); font-size: 14px; text-align: left; background: transparent; border: 0; }
.facet:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); color: var(--ink); }
.facet.active { color: var(--gold); background: color-mix(in srgb, var(--gold) 7%, transparent); }
.facet span { font-family: Georgia, serif; font-size: 14px; color: var(--muted-soft); }
.search-info { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; color: var(--muted-soft); font-size: 14px; }
.result-card { display: block; width: 100%; text-align: left; padding: 17px 18px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.result-card:hover { border-color: color-mix(in srgb, var(--gold) 48%, var(--line)); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.result-top { display: flex; align-items: flex-start; gap: 8px; }
.result-title { flex: 1; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.result-score { color: var(--gold); font-family: Georgia, serif; font-size: 14px; }
.result-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 7px 0 6px; }
.result-snippet { color: var(--muted); font-size: 14px; line-height: 1.8; }
.result-snippet mark { background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--ink); padding: 0 1px; border-radius: 2px; }
.result-foot { display: flex; align-items: center; gap: 8px; margin-top: 9px; color: var(--muted-soft); font-size: 14px; }
.mini-bar { width: 44px; height: 2px; background: color-mix(in srgb, var(--ink) 7%, transparent); border-radius: 2px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--gold); }
.search-empty { padding: 55px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; background: color-mix(in srgb, var(--card) 55%, transparent); }
.search-empty svg { width: 30px; height: 30px; margin: 0 auto 10px; color: var(--gold); opacity: .5; }
.search-empty h3 { margin: 0 0 4px; font-family: var(--serif); font-weight: 500; font-size: 19px; color: var(--ink); }
.search-empty p { margin: 0; font-size: 14px; }
.search-suggestions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }

/* Insights ---------------------------------------------------------------- */
.insight-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.insight-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, .75fr); gap: 14px; margin-bottom: 14px; }
.chart-card { padding: 21px 22px 16px; }
.chart-legend { display: flex; align-items: center; gap: 14px; color: var(--muted-soft); font-size: 14px; }
.legend-dot { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot::before { content: ""; width: 13px; height: 2px; background: var(--gold); border-radius: 2px; }
.legend-dot.soft::before { background: color-mix(in srgb, var(--jade) 60%, var(--line)); }
.trend-chart { position: relative; height: 220px; margin-top: 14px; }
.trend-chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid-line { stroke: var(--line-soft); stroke-width: 1; stroke-dasharray: 2 5; }
.chart-label { fill: var(--muted-soft); font-family: var(--sans); font-size: 14px; letter-spacing: .03em; }
.chart-area { fill: url(#areaFill); }
.chart-line { fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chart-dot { fill: var(--card); stroke: var(--gold); stroke-width: 1.4; }
.chart-value { fill: var(--muted); font-family: Georgia, serif; font-size: 14px; }
.insight-side { display: flex; flex-direction: column; gap: 14px; }
.rank-list { display: flex; flex-direction: column; }
.rank-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.rank-item:last-child { border-bottom: 0; }
.rank-num { flex: 0 0 17px; font-family: Georgia, serif; font-size: 14px; color: var(--gold); opacity: .7; }
.rank-main { min-width: 0; flex: 1; }
.rank-q { font-size: 14px; color: var(--ink-soft); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rank-count { flex: 0 0 auto; font-family: Georgia, serif; font-size: 14px; color: var(--muted-soft); }
.gap-card { padding: 18px; border: 1px dashed color-mix(in srgb, var(--copper) 34%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--copper) 3%, transparent); }
.gap-card h4 { margin: 0 0 6px; font-family: var(--serif); font-weight: 500; font-size: 14px; color: var(--copper); display: flex; align-items: center; gap: 6px; }
.gap-card h4 svg { width: 13px; height: 13px; }
.gap-card p { margin: 0 0 9px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.gap-item { display: flex; align-items: center; gap: 7px; padding: 6px 0; border-top: 1px solid color-mix(in srgb, var(--copper) 14%, transparent); font-size: 14px; color: var(--ink-mute); }
.gap-item span { flex: 1; }
.coverage-bars { display: flex; flex-direction: column; gap: 9px; }
.coverage-row { display: grid; grid-template-columns: 72px 1fr 36px; align-items: center; gap: 9px; }
.coverage-row span:first-child { font-size: 14px; color: var(--muted); }
.coverage-row span:last-child { font-family: Georgia, serif; font-size: 14px; color: var(--muted-soft); text-align: right; }
.coverage-track { height: 4px; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 3px; overflow: hidden; }
.coverage-track span { display: block; height: 100%; background: linear-gradient(90deg, var(--jade), color-mix(in srgb, var(--jade) 35%, var(--gold))); border-radius: 3px; opacity: .8; }
.insight-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.insight-bottom .pulse-score strong { color: var(--ink); }
.insight-bottom .pulse-score span { color: var(--muted-soft); }

/* Settings ---------------------------------------------------------------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 14px; align-items: start; }
.settings-card { padding: 22px; }
.settings-card h3 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 18px; }
.settings-card .desc { margin: 4px 0 17px; color: var(--muted); font-size: 14px; line-height: 1.75; }
.form-row { display: grid; gap: 5px; margin-bottom: 13px; }
.form-row label { color: var(--muted); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; }
.form-input { height: 36px; width: 100%; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper-light); color: var(--ink); font-size: 14px; outline: 0; transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.form-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 8%, transparent); }
.form-hint { color: var(--muted-soft); font-size: 14px; line-height: 1.6; }
.form-actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.preset-row { display: flex; gap: 5px; flex-wrap: wrap; margin: -3px 0 14px; }
.preset-chip { font-size: 14px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 3px 8px; background: transparent; }
.preset-chip:hover { border-color: var(--gold); color: var(--gold); }
.connection-card { display: flex; gap: 11px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: color-mix(in srgb, var(--jade) 3%, transparent); margin-bottom: 15px; }
.connection-card.offline { background: color-mix(in srgb, var(--gold) 3%, transparent); }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--jade); margin-top: 4px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--jade) 9%, transparent); flex: 0 0 8px; }
.connection-card.offline .connection-dot { background: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 9%, transparent); }
.connection-copy strong { display: block; font-size: 14px; font-weight: 500; }
.connection-copy span { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; line-height: 1.6; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.switch-row:last-child { border-bottom: 0; }
.switch-copy strong { display: block; font-size: 14px; font-weight: 500; }
.switch-copy span { display: block; font-size: 14px; color: var(--muted-soft); margin-top: 2px; line-height: 1.5; }
.switch { position: relative; width: 33px; height: 19px; flex: 0 0 33px; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: color-mix(in srgb, var(--ink) 12%, transparent); transition: background .2s var(--ease); }
.switch span::after { content: ""; position: absolute; width: 13px; height: 13px; top: 3px; left: 3px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--jade); }
.switch input:checked + span::after { transform: translateX(14px); }
.data-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.data-row:last-child { border-bottom: 0; }
.data-row span:first-child { color: var(--muted); }
.data-row span:last-child { color: var(--ink-mute); font-family: var(--mono); font-size: 14px; text-align: right; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-side { display: flex; flex-direction: column; gap: 14px; }
.privacy-points { display: flex; flex-direction: column; gap: 9px; }
.privacy-point { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--muted); line-height: 1.7; }
.privacy-point svg { width: 13px; height: 13px; flex: 0 0 13px; color: var(--jade); margin-top: 2px; }
.audit-table { width: 100%; border-collapse: collapse; }
.audit-table th { text-align: left; color: var(--muted-soft); font-size: 14px; letter-spacing: .1em; text-transform: uppercase; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.audit-table td { padding: 8px; border-bottom: 1px solid var(--line-soft); font-size: 14px; color: var(--muted); }
.audit-table td:first-child { color: var(--ink-mute); font-family: var(--mono); font-size: 14px; white-space: nowrap; }

/* Drawers / modals / overlays -------------------------------------------- */
.side-drawer-backdrop, .modal-backdrop, .command-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 15, 24, .45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn .25s var(--ease) both;
}
.side-drawer {
  position: fixed; z-index: 101; right: 0; top: 0; bottom: 0;
  width: min(600px, 92vw);
  background: var(--paper); border-left: 1px solid var(--line);
  box-shadow: -30px 0 80px -50px rgba(8, 15, 24, .6);
  display: flex; flex-direction: column;
  animation: slideIn .35s var(--ease) both;
}
.drawer-head { flex: 0 0 auto; padding: 22px 24px 17px; border-bottom: 1px solid var(--line); }
.drawer-head-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-kicker { color: var(--gold); font-family: Georgia, serif; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; }
.drawer-head h2 { margin: 7px 0 5px; font-family: var(--serif); font-weight: 500; font-size: 23px; line-height: 1.35; letter-spacing: -.02em; }
.drawer-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; color: var(--muted-soft); font-size: 14px; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px 40px; }
.drawer-summary { color: var(--muted); font-size: 14px; line-height: 1.9; padding: 13px 14px; border-left: 2px solid var(--gold); background: color-mix(in srgb, var(--gold) 4%, transparent); margin-bottom: 17px; }
.drawer-section-title { display: flex; align-items: center; justify-content: space-between; margin: 21px 0 9px; color: var(--muted); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.drawer-section-title span:last-child { font-family: Georgia, serif; font-size: 14px; color: var(--muted-soft); }
.drawer-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.doc-chunk { padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.doc-chunk:last-child { border-bottom: 0; }
.chunk-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; color: var(--muted-soft); font-size: 14px; }
.chunk-meta .chunk-heading { color: var(--gold); font-size: 14px; }
.doc-chunk p { margin: 0; color: var(--ink-mute); font-size: 14px; line-height: 1.85; white-space: pre-wrap; }
.tag-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 9px; }
.drawer-empty { padding: 30px 15px; text-align: center; color: var(--muted); font-size: 14px; }

.upload-modal { position: fixed; z-index: 101; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(680px, 93vw); max-height: 88vh; overflow-y: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); animation: modalIn .3s var(--ease) both; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.modal-head h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 23px; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.modal-body { padding: 18px 24px 24px; }
.dropzone { position: relative; border: 1.5px dashed color-mix(in srgb, var(--gold) 35%, var(--line)); border-radius: 13px; padding: 34px 20px; text-align: center; background: color-mix(in srgb, var(--gold) 3%, transparent); transition: border-color .2s var(--ease), background .2s var(--ease); }
.dropzone.dragover { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.dropzone svg { width: 28px; height: 28px; margin: 0 auto 9px; color: var(--gold); opacity: .8; }
.dropzone h3 { margin: 0 0 5px; font-family: var(--serif); font-weight: 500; font-size: 18px; }
.dropzone p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.format-chips { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; margin-top: 12px; }
.format-chip { font-family: Georgia, serif; font-size: 14px; letter-spacing: .05em; color: var(--muted-soft); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; }
.upload-list { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.upload-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.upload-item .u-name { flex: 1; font-size: 14px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-item .u-status { font-size: 14px; color: var(--muted-soft); }
.upload-item .u-status.ok { color: var(--jade); }
.upload-item .u-status.err { color: var(--danger); }
.upload-note { display: flex; gap: 7px; align-items: flex-start; margin-top: 14px; padding: 9px 11px; border-radius: 8px; background: color-mix(in srgb, var(--jade) 5%, transparent); color: var(--muted); font-size: 14px; line-height: 1.7; }
.upload-note svg { width: 13px; height: 13px; color: var(--jade); flex: 0 0 13px; margin-top: 1px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.role-modal { position: fixed; z-index: 101; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(760px, 94vw); max-height: 88vh; overflow-y: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); animation: modalIn .3s var(--ease) both; }
.role-groups { display: flex; flex-direction: column; gap: 15px; }
.role-group-title { color: var(--muted-soft); font-size: 14px; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 6px; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 7px; }
.role-card { text-align: left; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--card) 62%, transparent); transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease); }
.role-card:hover { border-color: var(--gold); background: var(--card); transform: translateY(-1px); }
.role-card.active { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.role-card-head { display: flex; align-items: center; gap: 7px; }
.role-card-name { font-family: var(--serif); font-size: 14px; color: var(--ink); }
.role-card-check { margin-left: auto; color: var(--gold); opacity: 0; }
.role-card.active .role-card-check { opacity: 1; }
.role-card-check svg { width: 13px; height: 13px; }
.role-card-scope { margin-top: 3px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.role-card-dept { margin-top: 2px; color: var(--muted-soft); font-size: 14px; }
@media (max-width: 620px) { .role-grid { grid-template-columns: 1fr; } }

/* Command palette --------------------------------------------------------- */
.command-panel { position: fixed; z-index: 121; top: 12vh; left: 50%; transform: translateX(-50%); width: min(630px, 92vw); background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: commandIn .25s var(--ease) both; }
.command-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.command-input-wrap svg { width: 17px; height: 17px; color: var(--gold); }
.command-input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 14px; color: var(--ink); }
.command-input::placeholder { color: var(--muted-soft); }
.command-esc { font-size: 14px; color: var(--muted-soft); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; }
.command-results { max-height: 390px; overflow-y: auto; padding: 7px; }
.command-group { padding: 8px 9px 4px; color: var(--muted-soft); font-size: 14px; letter-spacing: .14em; text-transform: uppercase; }
.command-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-mute); font-size: 14px; }
.command-item:hover, .command-item.active { background: color-mix(in srgb, var(--gold) 7%, transparent); color: var(--ink); }
.command-item .ci-icon { width: 25px; height: 25px; border-radius: 6px; display: grid; place-items: center; background: color-mix(in srgb, var(--ink) 4%, transparent); color: var(--muted); }
.command-item .ci-icon svg { width: 13px; height: 13px; }
.command-item .ci-copy { flex: 1; min-width: 0; }
.command-item .ci-copy span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.command-item .ci-copy small { display: block; color: var(--muted-soft); font-size: 14px; margin-top: 1px; }
.command-item .ci-arrow { color: var(--line); }
.command-item .ci-arrow svg { width: 12px; height: 12px; }
.command-foot { display: flex; align-items: center; gap: 10px; padding: 7px 14px; border-top: 1px solid var(--line); color: var(--muted-soft); font-size: 14px; }
.command-foot kbd { border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px; font-family: var(--sans); font-size: 14px; }
.command-empty { padding: 35px 15px; text-align: center; color: var(--muted-soft); font-size: 14px; }

/* Toasts ------------------------------------------------------------------ */
.toast-stack { position: fixed; z-index: 200; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 7px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 8px; max-width: 360px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); box-shadow: var(--shadow-md); color: var(--ink-soft); font-size: 14px; line-height: 1.6; animation: toastIn .3s var(--ease) both; pointer-events: auto; }
.toast svg { width: 13px; height: 13px; flex: 0 0 13px; margin-top: 1px; color: var(--jade); }
.toast.err svg { color: var(--danger); }
.toast.gold svg { color: var(--gold); }
.toast.leaving { animation: toastOut .25s var(--ease) both; }

/* Skeleton / empty / error ------------------------------------------------ */
.skeleton { position: relative; overflow: hidden; background: color-mix(in srgb, var(--ink) 4%, transparent); border-radius: 7px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card) 50%, transparent), transparent); animation: shimmer 1.4s infinite; }
.sk-line { height: 10px; margin-bottom: 7px; }
.sk-line.short { width: 55%; }
.sk-block { height: 90px; margin-bottom: 10px; }
.error-panel { padding: 40px 20px; text-align: center; border: 1px dashed color-mix(in srgb, var(--danger) 35%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--danger) 3%, transparent); }
.error-panel h3 { margin: 0 0 5px; font-family: var(--serif); font-weight: 500; font-size: 20px; color: var(--danger); }
.error-panel p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }

/* Animations -------------------------------------------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(30px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, -47%) scale(.985); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes commandIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(5px); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* Readability pass -------------------------------------------------------- */
/* The interface is used for long policy reading, not a visual prototype.
   Raise the floor for every label, button, tag and metadata line. */
:root {
  --sidebar-w: 268px;
  --muted: #59625b;
  --muted-soft: #707970;
}
[data-theme="dark"] {
  --muted: #b9c3bd;
  --muted-soft: #96a29c;
}
body { font-size: 15px; }
.eyebrow { font-size: 14px; letter-spacing: .15em; }
.page-lede { font-size: 14px; line-height: 1.85; }
.section-title h2 { font-size: 21px; }
.section-title .en { font-size: 14px; }
.section-link { font-size: 14px; }
.date-stamp { font-size: 14px; }
.date-stamp strong { font-size: 14px; }

.brand-name { font-size: 20px; }
.brand-sub { font-size: 14px; color: rgba(233, 226, 211, 0.75); }
.brand-mark { width: 44px; height: 44px; }
.new-chat-btn { font-size: 14px; min-height: 44px; }
.new-chat-btn kbd { font-size: 14px; color: rgba(233, 226, 211, 0.75); }
.nav-item { font-size: 14px; min-height: 44px; }
.nav-icon, .nav-icon svg { width: 20px; height: 20px; }
.sidebar-section-head { font-size: 14px; color: rgba(233, 226, 211, 0.75); letter-spacing: .12em; }
.recent-chat { font-size: 14px; color: rgba(233, 226, 211, 0.78); padding: 10px; }
.recent-chat .rc-time { font-size: 14px; color: rgba(233, 226, 211, 0.75); }
.recent-empty { font-size: 14px; color: rgba(233, 226, 211, 0.75); }
.runtime-label { font-size: 14px; color: rgba(233, 226, 211, 0.88); }
.runtime-mode { font-size: 14px; }
.runtime-note { font-size: 14px; color: rgba(233, 226, 211, 0.75); }
.profile-name { font-size: 14px; }
.profile-role { font-size: 14px; color: rgba(233, 226, 211, 0.75); }
.role-chevron { color: rgba(233, 226, 211, 0.75); }

.breadcrumb { font-size: 14px; }
.crumb-root { font-size: 14px; }
.omni-search { font-size: 14px; min-height: 38px; }
.omni-search kbd { font-size: 14px; }
.topbar-badge { font-size: 14px; padding: 6px 10px; }

.btn { font-size: 14px; height: 40px; letter-spacing: .01em; }
.btn-sm { font-size: 14px; height: 34px; }
.btn-gold, .btn-primary { font-weight: 500; }
.chip { font-size: 14px; height: 31px; padding: 0 11px; }
.tag { font-size: 14px; padding: 3px 8px; }
.mode-pill { font-size: 14px; padding: 5px 9px; }

.metric-top { font-size: 14px; }
.metric-value { font-size: 32px; }
.metric-foot { font-size: 14px; color: var(--muted); }
.metric-icon svg { width: 16px; height: 16px; }
.hero-kicker { font-size: 14px; }
.hero-search p { font-size: 14px; }
.hero-input { font-size: 15px; }
.hero-kbd { font-size: 14px; }
.quick-ask { font-size: 14px; padding: 6px 11px; }
.quick-asks .qa-label { font-size: 14px; color: var(--muted); }
.qa-label { color: var(--muted); }

.panel-title { font-size: 19px; }
.panel-sub { font-size: 14px; line-height: 1.7; }
.panel-count { font-size: 14px; }
.category-name { font-size: 14px; }
.category-count { font-size: 14px; color: var(--muted); }
.attention-title { font-size: 14px; }
.attention-note { font-size: 14px; color: var(--muted); }
.doc-title { font-size: 14px; }
.doc-meta { font-size: 14px; color: var(--muted); }
.doc-status { font-size: 14px; padding: 3px 8px; }
.recent-chat-q { font-size: 14px; }
.recent-chat-meta { font-size: 14px; }

.pulse-head .en { font-size: 14px; }
.pulse-stat span { font-size: 14px; }
.pulse-foot { font-size: 14px; }

.chat-title { font-size: 19px; }
.chat-sub { font-size: 14px; color: var(--muted); }
.assistant-meta { font-size: 14px; color: var(--muted); }
.assistant-meta strong { font-size: 14px; }
.msg-user .bubble { font-size: 14px; }
.prose { font-size: 14.5px; line-height: 1.95; }
.prose h1 { font-size: 24px; }
.prose h2 { font-size: 21px; }
.prose h3 { font-size: 18px; }
.prose blockquote { font-size: 14px; }
.prose table { font-size: 14px; }
.cite { min-width: 17px; height: 17px; font-size: 14px; }
.notice-line { font-size: 14px; }
.answer-foot .tiny-note { font-size: 14px; }
.followup { font-size: 14px; padding: 7px 12px; }
.followup-label { font-size: 14px; }
.composer textarea { font-size: 14.5px; min-height: 54px; }
.composer-hint { font-size: 14px; color: var(--muted); }
.composer-select { font-size: 14px; height: 31px; }
.send-btn { width: 37px; height: 37px; }
.evidence-head .en { font-size: 14px; }
.evidence-head h3 { font-size: 20px; }
.evidence-count { font-size: 14px; }
.confidence-copy strong { font-size: 14px; }
.confidence-copy span { font-size: 14px; }
.evidence-tab { font-size: 14px; }
.source-title { font-size: 14px; }
.source-snippet { font-size: 14px; }
.source-score { font-size: 14px; }
.evidence-note { font-size: 14px; }
.evidence-empty p { font-size: 14px; }
.evidence-tools .btn { font-size: 14px; height: 34px; }

.mini-stat span { font-size: 14px; }
.mini-stat strong { font-size: 26px; }
.filter-select { font-size: 14px; height: 38px; }
.search-field input { font-size: 14px; height: 38px; }
.doc-table th { font-size: 14px; }
.doc-table td { padding: 14px 15px; }
.td-title strong { font-size: 14px; }
.td-title span { font-size: 14px; }
.td-muted { font-size: 14px; }
.td-meta span:first-child { font-size: 14px; }
.td-meta span:last-child { font-size: 14px; }
.pagination { font-size: 14px; }
.page-btn { font-size: 14px; min-width: 30px; height: 30px; }

.search-hero p { font-size: 14px; }
.search-big input { font-size: 15px; height: 50px; }
.search-info { font-size: 14px; }
.facet { font-size: 14px; padding: 9px 8px; }
.facet-title { font-size: 14px; }
.result-title { font-size: 14px; }
.result-snippet { font-size: 14px; }
.result-meta { font-size: 14px; }
.result-foot { font-size: 14px; }
.result-score { font-size: 14px; }

.rank-q { font-size: 14px; }
.rank-count { font-size: 14px; }
.rank-num { font-size: 14px; }
.gap-card h4 { font-size: 15px; }
.gap-card p { font-size: 14px; }
.gap-item { font-size: 14px; }
.coverage-row span:first-child { font-size: 14px; }
.coverage-row span:last-child { font-size: 14px; }
.chart-label { font-size: 14px; }
.chart-value { font-size: 14px; }
.chart-legend { font-size: 14px; }

.settings-card h3 { font-size: 19px; }
.settings-card .desc { font-size: 14px; }
.form-row label { font-size: 14px; }
.form-input { font-size: 14px; height: 40px; }
.form-hint { font-size: 14px; color: var(--muted); }
.connection-copy strong { font-size: 14px; }
.connection-copy span { font-size: 14px; }
.data-row { font-size: 14px; padding: 10px 0; }
.data-row span:last-child { font-size: 14px; }
.switch-copy strong { font-size: 14px; }
.switch-copy span { font-size: 14px; }
.privacy-point { font-size: 14px; }
.preset-chip { font-size: 14px; padding: 4px 9px; }
.audit-table th { font-size: 14px; }
.audit-table td { font-size: 14px; }
.audit-table td:first-child { font-size: 14px; }

.modal-head p, .drawer-meta { font-size: 14px; }
.dropzone p { font-size: 14px; }
.upload-item .u-name { font-size: 14px; }
.upload-item .u-status { font-size: 14px; }
.upload-note { font-size: 14px; }
.format-chip { font-size: 14px; }
.role-group-title { font-size: 14px; }
.role-card-name { font-size: 15px; }
.role-card-scope { font-size: 14px; }
.role-card-dept { font-size: 14px; }
.command-input { font-size: 15px; }
.command-item { font-size: 14px; }
.command-item .ci-copy small { font-size: 14px; }
.command-group { font-size: 14px; }
.command-foot { font-size: 14px; }
.toast { font-size: 14px; }
.drawer-summary { font-size: 14px; }
.doc-chunk p { font-size: 14px; }
.chunk-meta { font-size: 14px; }

/* Readability floor: no operational label below 14px ---------------------- */
.eyebrow, .hero-kicker, .pulse-head .en, .evidence-head .en,
.section-title .en, .facet-title, .role-group-title, .command-group { font-size: 14px; }
.brand-sub, .profile-role, .runtime-label, .runtime-mode, .runtime-note,
.recent-chat .rc-time, .recent-empty, .date-stamp { font-size: 14px; }
.tag, .mode-pill, .doc-status, .chip, .quick-ask, .qa-label,
.section-link, .panel-sub, .metric-top, .metric-foot, .category-name,
.category-count, .doc-meta, .doc-title, .recent-chat-q, .recent-chat-meta,
.attention-title, .attention-note, .pulse-stat span, .pulse-foot,
.assistant-meta, .source-snippet, .source-score, .evidence-note,
.evidence-tab, .followup-label, .followup, .composer-hint, .composer-select,
.mini-stat span, .search-info, .result-foot, .result-snippet, .rank-q,
.rank-count, .gap-card p, .gap-item, .coverage-row span, .form-row label,
.form-hint, .connection-copy strong, .connection-copy span, .data-row,
.switch-copy strong, .switch-copy span, .privacy-point, .preset-chip,
.audit-table th, .audit-table td, .dropzone p, .upload-item .u-name,
.upload-item .u-status, .upload-note, .role-card-scope, .role-card-dept,
.command-item .ci-copy small, .toast, .drawer-summary, .drawer-meta,
.doc-chunk p, .chunk-meta { font-size: 14px; }
.metric-foot, .category-count, .doc-meta, .pulse-stat span, .source-score,
.result-foot, .coverage-row span:last-child, .data-row span:last-child,
.chunk-meta { font-size: 14px; }
.source-title, .result-title, .doc-title, .recent-chat-q { font-size: 14px; }
.prose { font-size: 15px; }
.composer textarea { font-size: 15px; }
.btn { font-size: 14px; }
.btn-sm { font-size: 14px; }
.form-input, .search-field input, .filter-select, .search-big input { font-size: 14px; }
.cite { min-width: 19px; height: 19px; font-size: 14px; }
.sidebar .nav-item { font-size: 14.5px; }
.sidebar-section-head { font-size: 14px; }
.topbar-badge { font-size: 14px; }
.command-foot, .command-esc { font-size: 14px; }
.format-chip { font-size: 14px; }
.chart-label, .chart-value { font-size: 14px; }
.audit-table td:first-child { font-size: 14px; }
.new-chat-btn kbd, .omni-search kbd, .hero-kbd { font-size: 14px; }
.crumb-root, .sidebar-section-head, .qa-label { font-size: 14px; }
.metric-value small { font-size: 14px; }
.pulse-score span { font-size: 14px; }
.pagination { font-size: 14px; }
.file-badge { font-size: 14px; width: 42px; height: 44px; flex-basis: 42px; }
.audit-table td, .audit-table th, .audit-table td:first-child, .search-empty p,
.result-score, .source-score { font-size: 14px; }
.quick-asks .qa-label, .chat-sub, .evidence-count { font-size: 14px; }
.mini-stat strong small, .td-title span, .td-meta span:first-child, .td-meta span:last-child,
.td-muted, .doc-table th { font-size: 14px; }
.suggest-text { font-size: 14px; }
.chart-legend, .coverage-row span:first-child, .insight-bottom .pulse-score span { font-size: 14px; }
.suggest-tag, .chat-empty-foot, .source-num, .drawer-kicker,
.drawer-section-title, .drawer-empty, .command-empty, .error-panel p,
.result-meta, .page-btn, .facet span, .command-esc, .upload-item .u-status { font-size: 14px; }
.source-num { width: 22px; height: 22px; flex-basis: 22px; }
.result-meta { line-height: 1.6; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1240px) {
  :root { --sidebar-w: 232px; }
  .view { padding: 30px 30px 50px; }
  .dash-grid { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr); }
  .category-list { grid-template-columns: 1fr; }
  .category-row:nth-last-child(2) { border-bottom: 1px solid var(--line-soft); }
  .chat-layout { grid-template-columns: minmax(0, 1fr) 342px; }
  .evidence-panel { padding: 20px 17px 26px; }
}
@media (max-width: 1080px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .dash-grid, .dash-grid-even, .insight-grid { grid-template-columns: 1fr; }
  .pulse-card { display: grid; grid-template-columns: 1fr 126px 1fr; align-items: center; gap: 12px; }
  .pulse-gauge { margin: 0 auto; }
  .pulse-stats { border-top: 0; border-left: 1px solid rgba(233, 226, 211, .1); padding-left: 12px; margin: 0; }
  .pulse-foot { grid-column: 1 / -1; margin-top: 4px; }
  .settings-grid { grid-template-columns: 1fr; }
  .library-stats, .insight-metrics { grid-template-columns: repeat(2, 1fr); }
  .chat-layout { grid-template-columns: minmax(0, 1fr) 310px; }
  .topbar-center { display: none; }
  .topbar-left { min-width: 0; flex: 1; }
  .topbar-right { min-width: 0; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 78px; }
  .sidebar { padding: 20px 10px 16px; align-items: center; }
  .brand { padding: 0 0 22px; }
  .brand-copy, .new-chat-btn span:not(.plus), .new-chat-btn kbd, .nav-label, .nav-pip, .sidebar-divider, .sidebar-section-head, .recent-chats, .runtime-card, .profile-copy, .profile .icon-btn { display: none; }
  .new-chat-btn { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .new-chat-btn .plus { width: 24px; height: 24px; }
  .nav { width: 100%; align-items: center; }
  .nav-item { width: 44px; height: 42px; padding: 0; justify-content: center; }
  .nav-item::before { left: -10px; }
  .nav-icon { width: 20px; height: 20px; }
  .sidebar-footer { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
  .profile { border-top: 0; padding: 8px 0 0; }
  .avatar { width: 34px; height: 34px; }
  .view { padding: 25px 22px 45px; }
  .topbar { padding: 0 22px; }
  .mobile-menu { display: inline-grid; }
  .chat-layout { grid-template-columns: minmax(0, 1fr); }
  .evidence-panel { display: none; }
  .mobile-evidence-btn { display: inline-grid; }
  .chat-head { padding: 14px 20px; }
  .chat-thread { padding: 24px 20px 20px; }
  .composer-wrap { padding: 6px 20px 15px; }
  .chat-empty h1 { font-size: 38px; }
  .search-layout { grid-template-columns: 1fr; }
  .facet-box { position: static; }
  .facet-list { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .facet { border: 1px solid var(--line); padding: 4px 8px; }
  .dash-greeting { display: block; }
  .date-stamp { text-align: left; margin-top: 12px; }
  .page-head { display: block; }
  .page-actions { justify-content: flex-start; margin-top: 16px; }
  .hero-search { padding: 25px 22px 22px; }
  .hero-input-row { flex-direction: column; }
  .hero-submit { height: 44px; }
  .hero-input { height: 48px; }
  .suggest-grid { grid-template-columns: 1fr; }
  .doc-table th:nth-child(3), .doc-table td:nth-child(3), .doc-table th:nth-child(4), .doc-table td:nth-child(4) { display: none; }
  .td-title strong, .td-title span { max-width: 240px; }
  .insight-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  :root { --topbar-h: 60px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 256px; align-items: stretch; padding: 22px 15px 16px; transform: translateX(-100%); transition: transform .3s var(--ease); }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open .brand-copy, .sidebar.open .new-chat-btn span:not(.plus), .sidebar.open .new-chat-btn kbd, .sidebar.open .nav-label, .sidebar.open .nav-pip, .sidebar.open .sidebar-divider, .sidebar.open .sidebar-section-head, .sidebar.open .recent-chats, .sidebar.open .runtime-card, .sidebar.open .profile-copy, .sidebar.open .profile .icon-btn { display: flex; }
  .sidebar.open .brand { justify-content: flex-start; }
  .sidebar.open .new-chat-btn { width: 100%; justify-content: flex-start; padding: 11px 12px; }
  .sidebar.open .new-chat-btn kbd { margin-left: auto; }
  .sidebar.open .nav { align-items: stretch; }
  .sidebar.open .nav-item { width: 100%; justify-content: flex-start; padding: 9px 11px; }
  .sidebar.open .recent-chats { display: flex; }
  .sidebar.open .sidebar-footer { align-items: stretch; }
  .sidebar.open .profile { padding: 12px 9px 2px; }
  .sidebar.open .profile .icon-btn { display: inline-grid; }
  .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(8, 15, 24, .45); opacity: 0; pointer-events: none; transition: opacity .25s var(--ease); }
  .sidebar-scrim.show { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 14px; }
  .topbar-badge { display: none; }
  .topbar-right { gap: 0; }
  .breadcrumb { font-size: 14px; }
  .view { padding: 20px 15px 40px; }
  .view.route-chat { padding: 0; }
  .metrics, .library-stats, .insight-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .metric { padding: 14px 14px 12px; }
  .metric-value { font-size: 25px; }
  .hero-search h2 { font-size: 27px; }
  .pulse-card { display: block; }
  .pulse-gauge { margin: 18px auto 12px; }
  .pulse-stats { border-left: 0; border-top: 1px solid rgba(233, 226, 211, .1); padding-left: 0; }
  .category-list { grid-template-columns: 1fr; }
  .chat-head { padding: 11px 14px; }
  .chat-sub { display: none; }
  .chat-thread { padding: 18px 14px 12px; }
  .composer-wrap { padding: 5px 10px 10px; }
  .composer textarea { font-size: 14px; }
  .composer-hint { display: none; }
  .chat-empty { justify-content: flex-start; padding-top: 18px; }
  .chat-empty h1 { font-size: 32px; }
  .chat-empty > p { font-size: 14px; }
  .suggest-grid { margin-top: 18px; }
  .suggest-card { padding: 12px 13px; }
  .msg-user .bubble { max-width: 90%; font-size: 14px; }
  .assistant-avatar { flex-basis: 23px; width: 23px; height: 23px; font-size: 14px; }
  .prose { font-size: 14px; }
  .source-card { padding: 10px; }
  .search-hero { padding: 24px 18px 20px; }
  .search-big { flex-direction: column; }
  .search-big .btn { height: 42px; }
  .page-head h1 { font-size: 30px; }
  .doc-table th:nth-child(5), .doc-table td:nth-child(5) { display: none; }
  .td-file { min-width: 0; }
  .td-title strong { max-width: 180px; }
  .td-title span { display: none; }
  .doc-table th, .doc-table td { padding: 10px 9px; }
  .filter-bar .filter-select { flex: 1; min-width: 100px; }
  .settings-card { padding: 18px; }
  .command-panel { top: 8vh; }
  .side-drawer { width: 100vw; }
  .drawer-head { padding: 18px 17px 14px; }
  .drawer-body { padding: 16px 17px 30px; }
}
@media (max-width: 430px) {
  .metrics, .library-stats, .insight-metrics { grid-template-columns: 1fr; }
  .metric { display: flex; align-items: center; gap: 12px; }
  .metric-top { flex: 1; }
  .metric-value { margin: 0; font-size: 26px; }
  .metric-foot { display: none; }
  .topbar-right .icon-btn:last-child { display: none; }
  .page-actions .btn span:not(.icon) { display: none; }
  .page-actions .btn { width: 36px; padding: 0; }
}

@media (max-width: 720px) {
  .breadcrumb, .crumb-current, .crumb-sep { font-size: 14px; }
  .hero-kbd { display: none; }
  .chat-empty > p { font-size: 14px; line-height: 1.8; }
  .chat-sub { font-size: 14px; }
  .source-snippet, .source-score, .evidence-note { font-size: 14px; }
}
@media (max-width: 430px) {
  .page-actions .btn span:not(.icon) { display: inline; }
  .page-actions .btn { width: auto; padding: 0 12px; }
  .metric-foot { display: flex; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Identity and workspace controls */
.auth-pending .app-shell { visibility: hidden; }
.auth-screen { position:fixed; inset:0; z-index:300; display:grid; place-items:center; padding:24px; background:var(--paper); overflow:auto; }
.account-card { width:min(440px,100%); padding:36px; border:1px solid var(--line); border-radius:18px; background:var(--card); box-shadow:var(--shadow-md); }
.account-card h2 { margin:16px 0; }
.account-card p,.account-modal p { line-height:1.8; color:var(--muted); }
.account-card label,.workspace-form label { display:flex; flex-direction:column; gap:8px; margin:16px 0; font-size:14px; }
.account-card input,.workspace-form input,.workspace-form select,.member-row select { width:100%; border:1px solid var(--line); border-radius:8px; padding:11px; background:var(--card); color:var(--ink); font:inherit; }
.account-card .btn { width:100%; }
.form-error { color:var(--danger)!important; min-height:20px; }
.account-modal { max-width:620px; }
.account-section { border-top:1px solid var(--line); margin-top:22px; padding-top:18px; }
.guide-copy { margin:22px 0; font-size:15px; line-height:2!important; }
.member-row { display:flex; align-items:center; gap:10px; margin:12px 0; }
.member-row span { flex:1; overflow-wrap:anywhere; }
.member-row select { width:145px; }
@media(max-width:700px) { .topbar-center,.topbar-badge { display:none; } .topbar-right { gap:4px; } .topbar-right .btn { padding:0 8px; } .account-card { padding:24px; } }
/* Interactive onboarding spotlight: four shields leave the actual control usable. */
.tour-root { position:fixed; inset:0; z-index:1200; pointer-events:none; isolation:isolate; }
.tour-shade { position:fixed; background:rgba(7,17,28,.76); pointer-events:auto; backdrop-filter:blur(2px); }
.tour-spotlight { position:fixed; border:2px solid #ebbe72; border-radius:12px; box-shadow:0 0 0 5px rgba(235,190,114,.15),0 0 36px rgba(235,190,114,.3); pointer-events:none; animation:tourGlow 2s ease-in-out infinite; }
.tour-target-badge { position:absolute; left:-15px; top:-15px; width:32px; height:32px; border:2px solid #ffdf9f; border-radius:50%; background:#ad8549; color:white; display:grid; place-items:center; box-shadow:0 4px 16px #0005; }
.tour-target-badge svg { width:17px; height:17px; }
.tour-card { position:fixed; pointer-events:auto; box-sizing:border-box; padding:22px; max-height:calc(100dvh - 24px); overflow:auto; border:1px solid #dcc392; border-radius:18px; background:#fffdf8; color:#172c3a; box-shadow:0 20px 70px #0006; font-family:inherit; outline:none; animation:tourCardIn .2s ease-out; }
.tour-card::before { content:""; position:absolute; width:12px; height:12px; background:#fffdf8; border:1px solid #dcc392; transform:rotate(45deg); }
.tour-card[data-side=left]::before { right:-7px; top:28px; border-left:0; border-bottom:0; }
.tour-card[data-side=right]::before { left:-7px; top:28px; border-right:0; border-top:0; }
.tour-card[data-side=bottom]::before { right:28px; top:-7px; border-right:0; border-bottom:0; }
.tour-card[data-side=top]::before { right:28px; bottom:-7px; border-left:0; border-top:0; }
.tour-card[data-side=floating]::before { display:none; }
.tour-card-top,.tour-heading,.tour-actions,.tour-actions>div { display:flex; align-items:center; gap:8px; }
.tour-card-top,.tour-actions { justify-content:space-between; }
.tour-kicker { font-size:14px; color:#916b32; font-weight:700; letter-spacing:.1em; }
.tour-close { border:0; padding:2px; background:transparent; color:#6d746f; cursor:pointer; }
.tour-close svg { width:18px; height:18px; }
.tour-heading { gap:12px; margin:18px 0 12px; }
.tour-step-icon { display:grid; place-items:center; background:#f0e4cd; color:#8e652c; width:44px; height:44px; border-radius:12px; flex-shrink:0; }
.tour-step-icon svg { width:24px; height:24px; }
.tour-chapter { font-size:14px; color:#8b7757; margin-bottom:4px; letter-spacing:.12em; }
.tour-card h2 { margin:0; color:#172c3a; font-size:20px; font-weight:700; line-height:1.4; }
.tour-card p { margin:10px 0; font-size:14px; line-height:1.85; color:#5c686e; }
.tour-click-hint { display:flex; align-items:center; gap:7px; padding:10px; margin:14px 0; background:#eef4ec; color:#38644f; border-radius:8px; font-size:14px; }
.tour-click-hint svg { width:18px; height:18px; }
.tour-progress { display:flex; gap:5px; margin:20px 0; }
.tour-progress span { flex:1; height:4px; border-radius:4px; background:#e9e4d9; }
.tour-progress .current { background:#bd914b; box-shadow:0 0 0 2px #bd914b22; }
.tour-progress .done { background:#28725e; }
.tour-later { font:inherit; font-size:14px; color:#7a827c; border:0; background:transparent; cursor:pointer; padding:0; }
.tour-actions .btn { font-size:14px; }
.tour-card .tour-footnote { font-size:14px; color:#92958c; margin:16px 0 0; text-align:center; }
.tour-loading .tour-card,.tour-loading .tour-spotlight { visibility:hidden; }
@keyframes tourGlow { 50% { box-shadow:0 0 0 7px rgba(235,190,114,.08),0 0 48px rgba(235,190,114,.4); } }
@keyframes tourCardIn { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }
@media(prefers-reduced-motion:reduce) { .tour-spotlight,.tour-card { animation:none; } }
@media(max-width:600px) { .tour-card { padding:16px; } .tour-heading { margin-top:12px; } .tour-card h2 { font-size:18px; } .tour-card p { font-size:14px; } .tour-progress { margin:12px 0; } }
.startup-state { min-height:65vh; display:grid; place-items:center; padding:40px 20px; }
.startup-card { width:min(520px,100%); background:var(--card); padding:32px; border:1px solid var(--line); border-radius:16px; }
.startup-card svg { width:32px; height:32px; color:var(--gold); margin-bottom:18px; }
.startup-card h2 { font-size:22px; margin-bottom:12px; }
.startup-card p { color:var(--muted); line-height:1.9; margin-bottom:18px; }
.startup-card code { display:block; overflow-wrap:anywhere; color:var(--danger); padding:10px; background:var(--paper); margin-bottom:18px; font-size:14px; }
.tour-active .upload-modal { left:calc((100vw - 400px) / 2); width:min(620px, calc(100vw - 440px)); }
@media(min-width:761px) { .tour-card { overflow:visible; } }
@media(max-width:760px) { .tour-active .upload-modal { left:50%; top:12px; transform:translateX(-50%); width:calc(100vw - 24px); max-height:calc(100dvh - 340px); animation:none; } }
/* Keep onboarding and account labels equally readable. */
.tour-kicker, .tour-chapter, .tour-later, .tour-footnote, .tour-click-hint,
.account-card .eyebrow, .account-card label, .workspace-form label,
.form-error, .startup-card code { font-size: 14px; }
.account-card p, .account-modal p, .tour-card p, .startup-card p { font-size: 14px; }
.tour-actions .btn { font-size: 14px; }
.tour-card .tour-footnote { font-size: 14px; }
.member-row span, .member-row select { font-size: 14px; }
.topbar .btn, .topbar .tag, .topbar-badge { font-size: 14px; }
.workspace-form form { display:flow-root; }

/* Comfortable reading: 16px body copy, 14px minimum supporting text. */
body { font-size:16px; line-height:1.8; }
input::placeholder, textarea::placeholder { color:var(--muted-soft); opacity:1; }
.btn { min-height:42px; height:auto; padding-top:8px; padding-bottom:8px; font-size:16px; line-height:1.5; }
.btn-sm { min-height:36px; font-size:14px; }
.tag,.chip,.mode-pill,.doc-status { height:auto; min-height:28px; line-height:1.5; }
.page-lede,.dash-greeting .page-lede,.hero-search p,.panel-sub,
.chat-empty>p,.result-snippet,.drawer-summary,.doc-chunk p,
.account-card p,.account-modal p,.startup-card p,.settings-card .desc { font-size:16px; line-height:1.85; }
.prose,.msg-user .bubble { font-size:17px; line-height:1.9; }
.prose blockquote,.prose table,.source-title,.source-snippet,.doc-title,
.td-title strong,.result-title,.recent-chat-q,.suggest-text { font-size:16px; line-height:1.75; }
.composer textarea,.hero-input,.form-input,.search-field input,.search-big input,
.filter-select,.workspace-form input,.workspace-form select,.account-card input { font-size:16px; line-height:1.6; }
.account-card { width:min(480px,100%); }
.account-card label,.workspace-form label { font-size:16px; font-weight:500; }
.account-card h2 { font-size:26px; line-height:1.5; }
.account-card input { min-height:48px; }
.account-card .btn { min-height:48px; }
.form-error { min-height:24px; }
.member-row { flex-wrap:wrap; }
.member-row span,.member-row select { font-size:16px; }
.doc-table th,.doc-table td,.audit-table th,.audit-table td { line-height:1.7; }
.doc-meta,.result-meta,.assistant-meta { flex-wrap:wrap; row-gap:5px; }
.composer-hint { line-height:1.6; }
.cite { min-width:24px; height:24px; line-height:24px; font-size:14px; }
.tour-card { padding:24px; }
.tour-card p { font-size:16px; line-height:1.8; color:#45545d; }
.tour-kicker,.tour-chapter { color:#785b30; letter-spacing:.03em; }
.tour-later,.tour-card .tour-footnote { color:#5c685f; font-size:14px; }
.tour-actions { align-items:flex-start; flex-wrap:wrap; row-gap:12px; }
.tour-actions .btn { min-height:40px; font-size:14px; }
.tour-click-hint { line-height:1.7; }
.tour-card h2 { font-size:22px; }
.tour-card .tour-progress { margin:16px 0; }
@media(max-width:1100px) { .topbar-center { display:none; } }
@media(max-width:720px) {
 .topbar .btn { font-size:14px; min-height:38px; }
 .topbar-right .btn { padding-left:8px; padding-right:8px; }
 .tour-card { padding:18px; }
 .tour-card p { font-size:16px; }
 .tour-heading { margin-top:12px; }
 .tour-card .tour-footnote { margin-top:12px; }
 .composer-bar { flex-wrap:wrap; }
 .form-row { grid-template-columns:1fr; }
 .account-card { padding:24px; }
}

/* Project spaces and public document collection. */
.project-space-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:12px 0; }
.project-space-card { padding:14px; background:var(--card); border:1px solid var(--line); border-radius:12px; text-align:left; cursor:pointer; color:var(--ink); min-width:0; }
.project-space-card strong { display:block; font-size:18px; margin-bottom:5px; }
.project-space-card span { display:block; font-size:14px; color:var(--muted); overflow-wrap:anywhere; }
.project-space-card.selected { border-color:var(--gold); background:var(--gold-pale); }
.account-section details { margin:16px 0; }
.account-section summary { cursor:pointer; font-size:16px; padding:8px 0; }
.checkbox-label { display:flex !important; flex-direction:row !important; align-items:center; justify-content:flex-start; gap:10px; }
.checkbox-label input { width:20px !important; min-height:20px !important; flex:0 0 20px; }
#collectionStatus { overflow-wrap:anywhere; line-height:1.8; }
.account-modal h2,.account-card h2 { font-family:var(--sans); font-weight:650; }
.source-origin { align-items:start; gap:16px; }
.source-origin a { max-width:72%; overflow-wrap:anywhere; color:var(--jade); }
@media(max-width:600px) { .project-space-grid { grid-template-columns:1fr; } .project-space-card { padding:12px 14px; } .page-actions { flex-wrap:wrap; } }

/* In-app file preview: reading and downloading are separate actions. */
.document-preview { position:fixed; inset:4vh max(20px,4vw); z-index:101; display:flex; flex-direction:column; min-width:0; background:var(--paper); border:1px solid var(--line); border-radius:18px; box-shadow:var(--shadow-lg); overflow:hidden; }
.preview-head { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:20px 24px 12px; }
.preview-head>div { min-width:0; }
.preview-head h2 { margin:0; font:650 22px/1.5 var(--sans); overflow-wrap:anywhere; }
.preview-head p { margin:6px 0 0; font-size:14px; color:var(--muted); }
.preview-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:12px 24px; border-bottom:1px solid var(--line); }
.preview-pagination,.preview-file-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.preview-pagination label { display:flex; align-items:center; gap:6px; }
.preview-pagination input { width:70px; min-height:38px; font:inherit; border:1px solid var(--line); border-radius:7px; background:var(--card); color:var(--ink); padding:6px; }
.preview-pagination span { font-size:14px; overflow-wrap:anywhere; }
.preview-content { min-height:0; flex:1; overflow:auto; padding:24px; overscroll-behavior:contain; }
.preview-pdf img { display:block; margin:0 auto; width:100%; max-width:none; height:auto; background:white; box-shadow:var(--shadow-sm); }
#previewZoom[hidden] { display:none; }
.preview-prose { max-width:960px; margin:auto; background:var(--card); padding:28px; border-radius:10px; }
.preview-prose table { display:block; max-width:100%; overflow-x:auto; }
.preview-plain { font:16px/1.9 var(--sans); white-space:pre-wrap; overflow-wrap:anywhere; margin:0 auto; max-width:960px; background:var(--card); padding:28px; border-radius:10px; }
.preview-warning { color:var(--copper); }
@media(max-width:600px) { .document-preview { inset:10px; border-radius:12px; } .preview-head { padding:16px 16px 8px; } .preview-head h2 { font-size:18px; } .preview-toolbar { padding:10px 16px; } .preview-content { padding:12px; } .preview-prose,.preview-plain { padding:16px; } }

/* Browser capture: source-bound bookmark and local snapshot import. */
.capture-actions { display:flex; flex-wrap:wrap; gap:10px; }
.browser-capture-helper { font-size:16px; }
.capture-source-label { display:flex; flex-direction:column; gap:8px; margin:18px 0; }
.capture-source-label input,.capture-source-label select { width:100%; font:inherit; color:var(--ink); background:var(--card); border:1px solid var(--line); border-radius:8px; padding:12px; }
.capture-steps { padding-left:24px; margin:20px 0; }
.capture-steps>li { padding-left:6px; margin-bottom:24px; }
.capture-steps strong { color:var(--ink); }
.capture-steps p { margin:8px 0; }
.capture-scope,#browserImportStatus { overflow-wrap:anywhere; }
#captureBookmark[aria-disabled=true] { opacity:.6; cursor:not-allowed; }
#captureOpenSource[hidden] { display:none; }
#browserCaptureFile { max-width:100%; }
@media(max-width:600px) { .capture-steps { padding-left:18px; } .capture-actions>.btn { width:100%; justify-content:center; } }

.topbar-badge[hidden] { display:none; }
.workspace-badge-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.topbar-badge.has-workspace-switch { position:relative; display:flex; min-width:0; max-width:300px; min-height:40px; }
.topbar-badge.has-workspace-switch:hover, .topbar-badge:focus-within { border-color:var(--jade); }
.topbar-badge:focus-within { outline:2px solid var(--jade); outline-offset:2px; }
.workspace-switch-arrow { padding-left:2px; }
#quickWorkspace { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; font:inherit; }
@media(max-width:720px) {
  .topbar { gap:8px; }
  .topbar-right { flex:1; min-width:0; }
  .topbar-right .btn, .topbar-right .icon-btn { flex-shrink:0; }
  .topbar-badge.has-workspace-switch { max-width:160px; margin-right:0; padding:4px 7px; gap:4px; letter-spacing:0; }
}
@media(max-width:430px) {
  .topbar-left .breadcrumb { display:none; }
  .topbar { padding-inline:8px; gap:4px; }
  .topbar-badge.has-workspace-switch { max-width:132px; }
}
