@font-face { font-family: 'Inter'; src: url('../fonts/Inter-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #F5F6F8; --surface: #FFFFFF; --surface-2: #F8F9FB; --surface-3: #EFF1F5;
  --ink: #0E1630; --ink-2: #3A435C; --ink-3: #667085; --ink-4: #98A0B3;
  --line: #E3E6ED; --line-2: #EDEFF3; --line-3: #CFD5E0;
  --brand: #0030DB; --brand-2: #0028B4; --brand-50: #EEF2FF; --brand-100: #DCE4FF; --brand-ink: #001F9C;
  --ai-a: #7A5AF8; --ai-b: #0030DB;
  --good: #087A55; --good-bg: #E3F5ED; --warn: #9A5B00; --warn-bg: #FCF0D8; --bad: #BF2A1F; --bad-bg: #FCEAE8; --info: #2447C8; --info-bg: #EAF0FF; --violet: #6038C9; --violet-bg: #F0EAFD;
  --c1: #0030DB; --c2: #0FA3A3; --c3: #E8930C; --c4: #7A5AF8; --c5: #D6409F; --c6: #5B6B8A; --c-muted: #C5CDDE; --c-bad: #D4483B; --c-good: #17A673;
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-xl: 20px;
  --sh-1: 0 1px 2px rgba(14, 22, 48, .06);
  --sh-2: 0 1px 2px rgba(14, 22, 48, .05), 0 6px 20px rgba(14, 22, 48, .07);
  --sh-3: 0 20px 56px rgba(14, 22, 48, .22);
  --side-w: 264px; --top-h: 56px; --panel-w: 460px;
  --sans: 'Inter', 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
table { border-collapse: collapse; width: 100%; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1:focus-visible, h2:focus-visible, main:focus-visible, .msgs:focus-visible, .composer textarea:focus-visible { outline: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 15px; height: 15px; }
.ic.lg { width: 22px; height: 22px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--ai-a), var(--ai-b)); display: grid; place-items: center; color: #fff; }
.brand-mark .ic { width: 17px; height: 17px; stroke-width: 2; }
.brand b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; }
.brand small { display: block; font-size: 11.5px; color: var(--ink-3); }
.side-new { margin: 4px 12px 10px; }
.side nav { padding: 0 8px; }
.nav-a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: 13.5px; }
.nav-a:hover { background: var(--surface-3); text-decoration: none; color: var(--ink); }
.nav-a[aria-current="page"] { background: var(--brand-50); color: var(--brand-ink); }
.nav-a[aria-current="page"] .ic { color: var(--brand); }
.side-sec { margin: 14px 18px 6px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.recent { flex: 1; overflow-y: auto; padding: 0 8px 8px; min-height: 0; }
.recent a { display: block; padding: 6px 10px; border-radius: 7px; color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent a:hover { background: var(--surface-3); text-decoration: none; }
.recent a[aria-current="page"] { background: var(--surface-3); color: var(--ink); font-weight: 500; }
.recent .none { padding: 6px 10px; font-size: 12.5px; color: var(--ink-3); }
.recent a.all { color: var(--brand); font-weight: 500; }
.side-foot { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.side-foot b { font-size: 13px; font-weight: 600; display: block; }
.side-foot small { font-size: 11.5px; color: var(--ink-3); }
.ws-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--ink-2); flex: none; }

.main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.top { height: var(--top-h); background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 20px; position: sticky; top: 0; z-index: 20; }
.top .grow { flex: 1; }
.icon-btn.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 460px; }
.search input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px 0 36px; background: var(--surface-2); font-size: 13.5px; }
.search input::placeholder { color: var(--ink-3); }
.search input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.search > .ic { position: absolute; left: 11px; top: 9px; color: var(--ink-3); pointer-events: none; }
.search-pop { position: absolute; left: 0; right: 0; top: 42px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); padding: 6px; max-height: 420px; overflow: auto; z-index: 40; }
.search-pop .grp { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.search-pop a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-size: 13.5px; }
.search-pop a small { color: var(--ink-3); margin-left: auto; font-size: 12px; white-space: nowrap; }
.search-pop a:hover, .search-pop a.on { background: var(--brand-50); text-decoration: none; }
.search-pop .none { padding: 14px 10px; color: var(--ink-3); font-size: 13px; }
.user-btn { display: flex; align-items: center; gap: 9px; border: 1px solid transparent; background: none; padding: 4px 8px 4px 4px; border-radius: 10px; text-align: left; }
.user-btn:hover { background: var(--surface-3); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 12px; flex: none; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatar.alt { background: var(--surface-3); color: var(--ink-2); }
.user-btn b { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
.user-btn small { display: block; font-size: 11.5px; color: var(--ink-3); line-height: 1.2; }
.rolebar { background: var(--violet-bg); color: var(--violet); border-bottom: 1px solid #E0D4FA; padding: 0 20px; height: 45px; font-size: 13px; display: flex; align-items: center; gap: 10px; overflow: hidden; white-space: nowrap; position: sticky; top: var(--top-h); z-index: 19; }
.rolebar span { overflow: hidden; text-overflow: ellipsis; }
.rolebar b { font-weight: 600; }
#view { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 28px 56px; }
.page-h { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-h h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.page-h .sub { color: var(--ink-3); font-size: 13.5px; margin-top: 3px; }
.page-h .acts { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumb a { color: var(--ink-3); }
h2.sec { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 28px 0 10px; }
h2.sec:first-child { margin-top: 0; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-3); background: #fff; font-weight: 500; font-size: 13.5px; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: #B9C1D1; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn.danger { color: var(--bad); border-color: #EBC4C0; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid transparent; background: none; color: var(--ink-3); flex: none; }
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn.on { color: #D99A06; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > label, .field > .lbl { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field .help { font-size: 12.5px; color: var(--ink-3); }
.field .err { font-size: 12.5px; color: var(--bad); }
.input, .select, textarea.input { height: 36px; border: 1px solid var(--line-3); border-radius: 9px; padding: 0 11px; background: #fff; width: 100%; font-size: 13.5px; }
textarea.input { height: auto; padding: 9px 11px; resize: vertical; min-height: 72px; }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.select.sm, .input.sm { height: 30px; font-size: 13px; border-radius: 8px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 13.5px; padding: 5px 0; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.switch:last-child { border-bottom: none; }
.switch b { display: block; font-weight: 500; font-size: 13.5px; }
.switch small { color: var(--ink-3); font-size: 12.5px; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line-3); position: relative; flex: none; cursor: pointer; transition: background .15s; }
.switch input::after { content: ''; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .15s; }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(16px); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { border: none; background: none; height: 26px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); display: inline-flex; align-items: center; gap: 5px; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: var(--sh-1); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: none; background: none; padding: 9px 12px; font-size: 13.5px; font-weight: 500; color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); text-decoration: none; }
.tab[aria-selected="true"], .tab[aria-current="page"] { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tab .count { font-size: 11.5px; background: var(--surface-3); color: var(--ink-3); border-radius: 999px; padding: 0 7px; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.violet { background: var(--violet-bg); color: var(--violet); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-3); background: #fff; font-size: 13px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
button.chip:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-50); }
.chip.filter { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-ink); padding-right: 4px; }
.chip.filter .x { width: 20px; height: 20px; border: none; background: none; border-radius: 50%; display: grid; place-items: center; color: inherit; padding: 0; }
.chip.filter .x:hover { background: var(--brand-100); }
.chip.locked { background: var(--violet-bg); border-color: #E0D4FA; color: var(--violet); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- cards, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card.pad { padding: 18px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.card-h h2, .card-h h3 { font-size: 14px; font-weight: 600; }
.card-h .acts { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tbl-wrap { overflow-x: auto; position: relative; }
.tbl th, .tbl td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; vertical-align: middle; }
.tbl th { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.act { text-align: right; white-space: nowrap; width: 1%; }
.tbl .strong { font-weight: 600; }
.tbl tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line); }
.tbl th button { border: none; background: none; font: inherit; color: inherit; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
.tbl th button:hover { color: var(--ink); }
.tbl.dense th, .tbl.dense td { padding: 7px 12px; font-size: 13px; }
.tbl.nowrap td { white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.cell-main { font-weight: 500; color: var(--ink); }
.cell-sub { font-size: 12.5px; color: var(--ink-3); }
.pager { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink-3); }
.pager .grow { flex: 1; }
.empty { text-align: center; padding: 44px 20px; color: var(--ink-3); }
.empty .ic { width: 28px; height: 28px; color: var(--ink-4); margin-bottom: 10px; }
.empty b { display: block; color: var(--ink); font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.empty p { font-size: 13.5px; margin-bottom: 14px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; }
.toolbar .grow { flex: 1; }
.toolbar .search-in { position: relative; flex: 1; max-width: 320px; min-width: 180px; }
.toolbar .search-in .input { width: 100%; padding-left: 34px; }
.toolbar .search-in .ic { position: absolute; left: 10px; top: 9px; color: var(--ink-3); }

/* ---------- overlays ---------- */
.menu { position: fixed; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); padding: 6px; min-width: 200px; max-width: 320px; z-index: 80; max-height: 70vh; overflow: auto; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; border: none; background: none; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--ink); }
.menu button:hover, .menu a:hover, .menu button:focus-visible { background: var(--surface-3); text-decoration: none; }
.menu button.danger { color: var(--bad); }
.menu button[aria-checked="true"] { font-weight: 600; }
.menu button .ic.end { margin-left: auto; color: var(--brand); }
.menu .sep { height: 1px; background: var(--line-2); margin: 5px 4px; }
.menu .hd { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 5px; }
.menu .who b { display: block; font-size: 13.5px; }
.menu .who small { color: var(--ink-3); font-size: 12.5px; }
.menu .menu-search { padding: 4px 4px 6px; }
.scrim { position: fixed; inset: 0; background: rgba(14, 22, 48, .42); z-index: 60; display: grid; place-items: center; padding: 20px; }
.dialog { background: #fff; border-radius: 16px; box-shadow: var(--sh-3); width: 100%; max-width: 480px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.dialog.wide { max-width: 720px; }
.dialog-h { padding: 18px 20px 6px; display: flex; align-items: flex-start; gap: 10px; }
.dialog-h h2 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; flex: 1; }
.dialog-b { padding: 10px 20px 4px; overflow: auto; }
.dialog-b > p { color: var(--ink-2); margin-bottom: 14px; }
.dialog-f { padding: 14px 20px 18px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast { background: var(--ink); color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: var(--sh-3); font-size: 13.5px; display: flex; gap: 12px; align-items: center; max-width: 380px; }
.toast button, .toast a { background: none; border: none; color: #A9BBFF; font-weight: 600; padding: 0; white-space: nowrap; }
.tip { position: fixed; z-index: 95; background: var(--ink); color: #fff; font-size: 12.5px; padding: 7px 10px; border-radius: 8px; pointer-events: none; max-width: 260px; box-shadow: var(--sh-2); line-height: 1.4; }
.tip b { font-weight: 600; }
.panel { position: fixed; right: 0; top: 0; bottom: 0; width: var(--panel-w); max-width: 100vw; background: #fff; border-left: 1px solid var(--line); box-shadow: var(--sh-3); z-index: 50; display: flex; flex-direction: column; }
.panel-h { padding: 16px 18px 0; display: flex; gap: 10px; align-items: flex-start; }
.panel-h h2 { font-size: 16px; font-weight: 600; flex: 1; letter-spacing: -.01em; }
.panel-h .sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.panel .tabs { margin: 10px 18px 0; }
.panel-b { padding: 16px 18px 24px; overflow: auto; flex: 1; }
.panel-b h3 { font-size: 13px; font-weight: 600; margin: 18px 0 8px; }
.panel-b h3:first-child { margin-top: 0; }

/* ---------- ask home ---------- */
.home { width: 100%; max-width: 860px; margin: 0 auto; padding: 7vh 24px 56px; }
.home-h { text-align: center; margin-bottom: 22px; }
.home-h h1 { font-size: 32px; font-weight: 600; letter-spacing: -.03em; line-height: 1.15; }
.home-h p { color: var(--ink-3); font-size: 14.5px; margin-top: 8px; }
.composer { background: #fff; border: 1px solid var(--line-3); border-radius: var(--r-xl); box-shadow: var(--sh-2); padding: 12px 12px 10px 16px; transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-100), var(--sh-2); }
.composer textarea { width: 100%; border: none; resize: none; font-size: 15.5px; line-height: 1.5; padding: 6px 0 4px; background: none; min-height: 30px; max-height: 180px; display: block; }
.composer textarea::placeholder { color: var(--ink-3); }
.composer-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.composer-row .grow { flex: 1; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font-size: 13px; font-weight: 500; color: var(--ink-2); max-width: 100%; }
.pill-btn:hover { border-color: var(--line-3); background: var(--surface-3); color: var(--ink); }
.pill-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send { width: 34px; height: 34px; border-radius: 10px; border: none; background: var(--brand); color: #fff; display: grid; place-items: center; }
.send:hover { background: var(--brand-2); }
.send[disabled] { background: var(--line-3); cursor: not-allowed; }
.sq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.sq li { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 8px 10px 14px; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.sq li:hover { border-color: var(--brand); box-shadow: var(--sh-1); }
.sq li > .ic { color: var(--brand); }
.sq li span { flex: 1; font-size: 13.5px; color: var(--ink); }
.sq li .icon-btn { color: var(--ink-3); }
.sq li:hover .icon-btn { color: var(--brand); }
.home h2.sec { margin-top: 34px; display: flex; align-items: center; }
.home h2.sec a { margin-left: auto; font-size: 13px; font-weight: 500; }
.attn { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.attn-c { padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.attn-c .badge { align-self: flex-start; }
.attn-c .v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.attn-c .t { font-size: 13.5px; font-weight: 500; color: var(--ink); flex: 1; }
.attn-c .btn { align-self: flex-start; margin-top: 6px; }
.lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.list-c h3 { font-size: 13px; font-weight: 600; padding: 12px 14px 4px; display: flex; align-items: center; }
.list-c h3 a { margin-left: auto; font-size: 12.5px; font-weight: 500; }
.list-c ul { padding: 2px 6px 8px; }
.list-c li a { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; color: var(--ink-2); font-size: 13.5px; }
.list-c li a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-c li a:hover { background: var(--surface-3); text-decoration: none; color: var(--ink); }
.list-c li a .ic { color: var(--ink-4); }
.list-c .none { padding: 6px 14px 14px; color: var(--ink-3); font-size: 13px; }

/* ---------- conversation ---------- */
.chat { flex: none; display: flex; flex-direction: column; min-height: 0; height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); }
.chat.has-role { height: calc(100vh - var(--top-h) - 45px); height: calc(100dvh - var(--top-h) - 45px); }
.chat.not-owner .ans [data-act="share"] { display: none; }
.chat-h { padding: 12px 24px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chat-h h1 { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; margin-right: 6px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-h .acts { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.ctx { padding: 8px 24px; background: var(--surface-2); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.ctx .lbl { color: var(--ink-3); }
.ctx .chip { height: 26px; font-size: 12.5px; }
.msgs { flex: 1; overflow-y: auto; padding: 24px 24px 12px; scroll-behavior: smooth; }
.msgs-in { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.msg-u { align-self: flex-end; max-width: 78%; background: var(--brand); color: #fff; padding: 10px 14px; border-radius: 16px 16px 4px 16px; font-size: 14.5px; }
.msg-a { display: flex; gap: 12px; align-items: flex-start; }
.ai-mark { width: 28px; height: 28px; border-radius: 9px; background: linear-gradient(135deg, var(--ai-a), var(--ai-b)); display: grid; place-items: center; color: #fff; flex: none; margin-top: 2px; }
.ai-mark .ic { width: 15px; height: 15px; stroke-width: 2; }
.ans { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); padding: 18px 20px 14px; }
.ans-title { font-size: 18px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; margin-bottom: 6px; }
.ans p { color: var(--ink-2); font-size: 14.5px; margin: 6px 0; max-width: 72ch; }
.ans p b, .ans li b { color: var(--ink); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.kpi { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); min-width: 0; }
.kpi .l { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.kpi .v { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.kpi .v.bad { color: var(--bad); } .kpi .v.good { color: var(--good); }
.delta { font-weight: 600; font-size: 12.5px; }
.delta.up-good, .delta.down-good { color: var(--good); } .delta.up-bad, .delta.down-bad { color: var(--bad); } .delta.flat { color: var(--ink-3); }
.viz { border: 1px solid var(--line); border-radius: 12px; margin: 14px 0; overflow: hidden; }
.viz-bar { display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 14px; border-bottom: 1px solid var(--line-2); background: var(--surface-2); flex-wrap: wrap; }
.viz-bar .t { font-size: 13px; font-weight: 600; min-width: 120px; }
.viz-bar .t + .badge { margin-right: auto; }
.viz-bar .t:last-child, .viz-bar .t:not(:has(+ .badge)) { flex: 1; }
.viz-body { padding: 14px; }
.viz-body.flush { padding: 0; }
.viz-note { font-size: 12.5px; color: var(--ink-3); padding: 0 14px 12px; }
.findings { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.findings li { display: flex; gap: 9px; font-size: 14px; color: var(--ink-2); align-items: flex-start; }
.findings li::before { content: ''; width: 7px; height: 7px; border-radius: 50%; margin-top: 7px; flex: none; background: var(--ink-4); }
.findings li.bad::before { background: var(--c-bad); } .findings li.good::before { background: var(--c-good); } .findings li.warn::before { background: var(--c3); }
.trust { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-3); margin-top: 14px; }
.trust .grow { flex: 1; }
.trust .links { display: flex; gap: 2px; flex-wrap: wrap; }
.link-btn { border: none; background: none; color: var(--brand); font-weight: 500; font-size: 12.5px; padding: 3px 7px; border-radius: 6px; }
.link-btn:hover { background: var(--brand-50); }
.ans-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.ans-acts .sp { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.ans-acts .btn.ai { color: var(--violet); border-color: #DDD0FA; }
.ans-acts .btn.ai:hover { background: var(--violet-bg); }
.apps { display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }
.apps a { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.follow { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.follow .l { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 8px; }
.thinking { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13.5px; padding: 4px 0; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ai-a); animation: dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 70%, 100% { opacity: .3; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }
.chat-foot { padding: 10px 24px 14px; background: linear-gradient(to bottom, rgba(245, 246, 248, 0), var(--bg) 30%); }
.chat-foot .in { max-width: 860px; margin: 0 auto; }
.chat-foot .composer { border-radius: 16px; padding: 8px 8px 8px 14px; }
.chat-foot .hint { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 7px; }
.state { border: 1px dashed var(--line-3); border-radius: 12px; padding: 16px; background: var(--surface-2); display: flex; gap: 12px; align-items: flex-start; margin: 8px 0; }
.state .ic { color: var(--ink-3); margin-top: 2px; }
.state b { display: block; font-size: 14px; }
.state p { margin: 2px 0 10px; font-size: 13.5px; }
.whatif { margin: 14px 0; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; }
.whatif .ctl { display: flex; flex-direction: column; gap: 14px; }
.range label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.range label output { font-variant-numeric: tabular-nums; color: var(--brand-ink); font-weight: 600; }
.range input[type=range] { width: 100%; accent-color: var(--brand); }
.whatif .res { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.whatif .res .big { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.whatif .res dl { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; font-size: 13px; margin-top: 10px; }
.whatif .res dt { color: var(--ink-3); } .whatif .res dd { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

/* ---------- charts ---------- */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { font-family: var(--sans); fill: var(--ink-3); font-size: 11.5px; }
.chart .mark { transition: opacity .12s; }
.chart .mark[role="button"] { cursor: pointer; }
.chart .mark:hover, .chart .mark:focus-visible { opacity: .82; }
.hbar { display: flex; flex-direction: column; gap: 8px; }
.hbar-r { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; border: none; background: none; padding: 2px 4px; border-radius: 6px; text-align: left; width: 100%; color: var(--ink); }
.hbar-r.can { grid-template-columns: minmax(96px, 34%) minmax(0, 1fr) auto 22px; cursor: pointer; }
.hbar-r.can:hover { background: var(--surface-2); }
.hbar-go { width: 22px; height: 22px; border: none; background: none; border-radius: 6px; color: var(--ink-4); display: grid; place-items: center; padding: 0; }
.hbar-r.can:hover .hbar-go, .hbar-go:focus-visible { color: var(--brand); }
.hbar-r .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.hbar-r .trk { height: 14px; background: var(--surface-3); border-radius: 4px; position: relative; overflow: hidden; }
.hbar-r .trk.two { height: 20px; background: none; display: flex; flex-direction: column; gap: 2px; }
.hbar-r .fill { display: block; height: 100%; border-radius: 4px; background: var(--c1); min-width: 2px; }
.hbar-r .trk.two .fill { height: 9px; }
.hbar-r .fill.muted { background: var(--c-muted); } .hbar-r .fill.bad { background: var(--c-bad); } .hbar-r .fill.good { background: var(--c-good); } .hbar-r .fill.alt { background: var(--c2); }
.hbar-r .fill.neg { margin-left: auto; }
.hbar-r .v { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; min-width: var(--vw, 0); text-align: right; }
.hbar-r .ic { color: var(--ink-4); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.spark { display: block; width: 100%; height: 36px; }

/* ---------- discover, dashboards, data, metrics ---------- */
.ins { display: flex; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.ins:last-child { border-bottom: none; }
.ins .sev { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.ins .sev.bad { background: var(--bad-bg); color: var(--bad); } .ins .sev.warn { background: var(--warn-bg); color: var(--warn); } .ins .sev.good { background: var(--good-bg); color: var(--good); } .ins .sev.info { background: var(--info-bg); color: var(--info); }
.ins .body { flex: 1; min-width: 0; }
.ins h3 { font-size: 14.5px; font-weight: 600; }
.ins p { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
.ins .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--ink-3); align-items: center; }
.ins .val { font-size: 17px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; text-align: right; }
.ins .side-acts { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.dash-card { padding: 16px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.dash-card a.t { font-size: 15px; font-weight: 600; color: var(--ink); }
.dash-card .prev { display: flex; gap: 4px; align-items: flex-end; height: 44px; margin: 10px 0 6px; }
.dash-card .prev i { flex: 1; background: var(--brand-100); border-radius: 3px 3px 0 0; }
.dash-card .icon-btn { position: absolute; right: 8px; top: 8px; }
.tiles { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.tile { grid-column: span 6; display: flex; flex-direction: column; min-width: 0; }
.tile.k { grid-column: span 3; }
.tile.w { grid-column: span 12; }
.tile-h { display: flex; align-items: center; gap: 8px; padding: 12px 8px 0 14px; }
.tile-h h3 { font-size: 13px; font-weight: 600; color: var(--ink-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-b { padding: 8px 14px 14px; flex: 1; }
.tile.k .v { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile.k .d { font-size: 12.5px; color: var(--ink-3); }
.tile .sum p { font-size: 13.5px; color: var(--ink-2); margin-bottom: 8px; }
.src-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; flex: none; }
.cell-flex { display: flex; align-items: center; gap: 10px; }
.explorer { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.tree { padding: 8px; position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 40px); overflow: auto; }
.tree .src { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 8px 8px 4px; }
.tree a { display: block; padding: 6px 8px 6px 14px; border-radius: 7px; font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree a:hover { background: var(--surface-3); text-decoration: none; }
.tree a[aria-current="page"] { background: var(--brand-50); color: var(--brand-ink); font-weight: 500; }
.tree-select { display: none; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.formula { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; color: var(--brand-ink); overflow-wrap: anywhere; }
.metric-c { padding: 16px; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.metric-c .t { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.metric-c .t b { font-size: 14.5px; font-weight: 600; }
.metric-c .t .link-btn:hover { color: var(--brand); background: none; text-decoration: underline; }
.metric-c .m { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px 14px; flex-wrap: wrap; }
.metric-c .cur { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.sql { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; background: #0F172A; color: #D6DEEB; border-radius: 10px; padding: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.sql .kw { color: #82AAFF; } .sql .st { color: #C3E88D; } .sql .fn { color: #F78C6C; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); } .kv dd { text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.lineage { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; font-size: 12.5px; }
.lineage .node { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; background: var(--surface-2); }
.lineage .node small { display: block; color: var(--ink-3); font-size: 11px; }
.lineage .arr { align-self: center; color: var(--ink-4); }
.steps { counter-reset: s; display: flex; flex-direction: column; gap: 8px; }
.steps li { counter-increment: s; display: flex; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.steps li::before { content: counter(s); width: 20px; height: 20px; border-radius: 50%; background: var(--brand-50); color: var(--brand-ink); font-size: 11.5px; font-weight: 600; display: grid; place-items: center; flex: none; margin-top: 1px; }
.drop { border: 1.5px dashed var(--line-3); border-radius: 14px; padding: 28px 18px; text-align: center; background: var(--surface-2); transition: border-color .12s, background .12s; }
.drop.over { border-color: var(--brand); background: var(--brand-50); }
.drop .ic { width: 26px; height: 26px; color: var(--ink-3); }
.drop b { display: block; margin: 8px 0 2px; }
.drop p { color: var(--ink-3); font-size: 13px; margin-bottom: 12px; }
.conn-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.conn { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: #fff; font-size: 13.5px; font-weight: 500; text-align: left; }
.conn:hover { border-color: var(--brand); background: var(--brand-50); }
.conn-h { font-size: 12px; font-weight: 600; color: var(--ink-3); margin: 4px 0 7px; }
.done-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; gap: 12px; align-items: center; }
.done-card > .ok { width: 34px; height: 34px; border-radius: 50%; background: var(--good-bg); color: var(--good); display: grid; place-items: center; flex: none; }
.usage-bars { display: flex; align-items: flex-end; gap: 6px; height: 200px; }
.usage-bars div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-3); height: 100%; }
.usage-bars i { width: 100%; background: var(--c1); border-radius: 4px 4px 0 0; min-height: 2px; display: block; }

/* ---------- responsive ---------- */
@media (min-width: 1800px) {
  .page { max-width: 1400px; }
  .home { max-width: 920px; }
  .msgs-in, .chat-foot .in { max-width: 920px; }
}
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile.k { grid-column: span 6; }
  .explorer { grid-template-columns: minmax(0, 1fr); }
  .tree { display: none; }
  .tree-select { display: block; margin-bottom: 12px; }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: min(var(--side-w), 86vw); transform: translateX(-102%); transition: transform .18s ease; box-shadow: var(--sh-3); z-index: 70; }
  .side.open { transform: none; }
  .side-scrim { position: fixed; inset: 0; background: rgba(14, 22, 48, .42); z-index: 65; }
  .icon-btn.menu-btn { display: inline-grid; }
  .top { padding: 0 12px; }
  .top .grow { display: none; }
  .search { max-width: none; }
  .user-btn .who-txt { display: none; }
  .g3, .lists, .attn { grid-template-columns: minmax(0, 1fr); }
  .tile { grid-column: span 12; }
  .whatif { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .page { padding: 20px 16px 48px; }
  .home { padding: 28px 16px 48px; }
  .home-h h1 { font-size: 26px; }
  .g2, .g4, .sq { grid-template-columns: minmax(0, 1fr); }
  .tile.k { grid-column: span 12; }
  .chat-h, .ctx { padding-left: 14px; padding-right: 14px; }
  .msgs { padding: 16px 12px 8px; }
  .chat-foot { padding: 8px 12px 12px; }
  .ans { padding: 14px 14px 12px; }
  .msg-a { gap: 0; } .msg-a > .ai-mark { display: none; }
  .msg-u { max-width: 90%; }
  .ans-title { font-size: 16.5px; }
  .panel { width: 100vw; border-left: none; }
  .ins { flex-wrap: wrap; } .ins .side-acts { flex-direction: row; flex-wrap: wrap; width: 100%; justify-content: flex-start; align-items: center; }
  .ins .val { white-space: normal; text-align: left; width: 100%; }
  .hbar-r { grid-template-columns: minmax(84px, 40%) minmax(0, 1fr) auto; gap: 8px; font-size: 12.5px; }
  .hbar-r.can { grid-template-columns: minmax(84px, 38%) minmax(0, 1fr) auto 20px; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .page-h .acts { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .side, .top, .chat-foot, .ans-acts, .follow, .panel, .toasts { display: none !important; }
  .app { display: block; } body { background: #fff; }
}

/* Ask AI conversational replies */
.ans.chat { padding: 12px 16px 10px; }
.chat-reply p { color: var(--ink); font-size: 14.5px; margin: 4px 0 8px; max-width: 72ch; line-height: 1.55; }
.chat-reply ul { list-style: disc; margin: 4px 0 8px 20px; padding: 0; color: var(--ink); font-size: 14.5px; max-width: 72ch; }
.chat-reply li { margin: 3px 0; line-height: 1.5; }
.chat-reply b { font-weight: 600; }
.ans.chat .follow { margin-top: 6px; }
.interp { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12.5px; margin: 0 0 6px; }

/* Ask AI: live stages while an answer is being prepared */
.ans .thinking .t-el{margin-left:auto;font-variant-numeric:tabular-nums;color:var(--ink-3,#61707F);font-size:12px}
.ans .stages{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:4px}
.ans .stages li{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--ink-2,#475569)}
.ans .stages li .ic{color:#047857;flex:none}
.ans .stages li small{margin-left:auto;color:var(--ink-3,#61707F);font-variant-numeric:tabular-nums}

/* hotfix 2026-10-05: an answer card with class .chat must not inherit the chat window's full-height flex layout */
.ans.chat { display: block; height: auto; flex: 1; }
.chat.has-role .ans.chat { height: auto; }

/* live narration while Ask AI works */
.live-feed { display: grid; gap: 6px; }
.live-feed .lf-line { margin: 0; color: var(--ink-2, #475569); font-size: 14px; line-height: 1.5; max-width: 72ch; animation: lfIn .25s ease-out; }
.live-feed .lf-now { margin: 2px 0 0; display: flex; align-items: center; gap: 10px; color: var(--ink, #0f172a); font-size: 14px; }
.live-feed .lf-now .t-el { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-3, #61707F); font-size: 12px; }
@keyframes lfIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .live-feed .lf-line { animation: none; } }

/* uploaded file overview */
.ov-top { margin-bottom: 16px; }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.ov-grid.small { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ov-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; min-width: 0; }
.ov-card header { display: flex; flex-direction: column; gap: 2px; }
.ov-card header h3 { margin: 0; font-size: 16px; }
.ov-card header .muted { font-size: 12.5px; }
.ov-ks { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ov-k { background: var(--bg-2, #f6f7f9); border-radius: 10px; padding: 8px 10px; }
.ov-k .l { font-size: 11.5px; color: var(--ink-3, #61707F); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-k .v { font-size: 17px; font-weight: 600; color: var(--ink, #0f172a); font-variant-numeric: tabular-nums; }
.ov-k .d { font-size: 11px; color: var(--ink-3, #61707F); }
.ov-viz { border-top: 1px solid var(--line, #e5e7eb); padding-top: 8px; min-width: 0; }
.ov-vt { font-size: 12.5px; font-weight: 600; color: var(--ink-2, #475569); margin-bottom: 6px; }
.ov-card footer { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.ov-h { margin: 22px 0 10px; font-size: 15px; }
@media (max-width: 560px) { .ov-grid, .ov-grid.small { grid-template-columns: 1fr; } }

/* MCP connectors */
.mcp-using { margin: 0 0 8px; }
.mcp-chip { height: 24px; font-size: 12px; padding: 0 9px; background: #E7F5F1; border-color: #BFE3D8; color: #0E7C66; }
.mcp-tools { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow: auto; }
.mcp-tools li { display: grid; grid-template-columns: minmax(120px, 190px) 1fr; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.mcp-tools li .mono { color: var(--ink); overflow-wrap: anywhere; }
.mcp-sugg { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.mcp-sugg > div { flex: 1; }
@media (max-width: 640px) { .mcp-tools li { grid-template-columns: 1fr; gap: 2px; } }
