@font-face { font-family: 'Inter'; src: url('../fonts/Inter-Regular.woff2?v=e06f6b1bc5') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-Medium.woff2?v=0ff3e94614') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-SemiBold.woff2?v=5cb7103e4e') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-Bold.woff2?v=fa888127b6') 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: #626D80; --ink-4: #8089A1;
  --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);
  --line-4: #B9C1D1; --bad-line: #EBC4C0; --violet-line: #E0D4FA;
  --top-bg: rgba(255, 255, 255, .92); --bg-0: rgba(245, 246, 248, 0); --bg-2: #F6F7F9;
  --inverse-bg: #0E1630; --inverse-ink: #FFFFFF; --scrim: rgba(14, 22, 48, .42);

  --toast-act: #A9BBFF;
  --scroll-shade: rgba(14, 22, 48, .24);
  --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(--inverse-bg); color: var(--inverse-ink); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
main.skip-target:focus { outline: 2px solid var(--brand, #2563eb); outline-offset: -2px; }
.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; }


.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: var(--banner-h, 0px); height: calc(100vh - var(--banner-h, 0px)); z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; min-height: 58px; box-sizing: border-box; }
.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: 12px; color: var(--ink-3); }




.brand-logo { display: block; height: 28px; max-height: 28px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }

.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: 12px; 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; }

.recent a:not(.all) { display: flex; align-items: baseline; gap: 8px; }
.recent a .rn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.recent a .rt { flex: none; font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.list-c li a .lt { margin-left: auto; flex: none; font-size: 12px; color: var(--ink-3); }
.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: 12px; 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: var(--top-bg); 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: var(--banner-h, 0px); z-index: 20; }
.top .grow { flex: 1; }
.icon-btn.menu-btn { display: none; }
.search { position: relative; flex: 1 1 460px; 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: var(--surface); 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: var(--surface); 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: 12px; 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; }



@media (max-width: 640px) {
  .search-pop { position: fixed; left: 8px; right: 8px; top: calc(var(--top-h) - 4px); max-height: 70vh; }
}
.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: 26px; height: 26px; font-size: 12px; }
.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: 12px; color: var(--ink-3); line-height: 1.2; }
.rolebar { background: var(--violet-bg); color: var(--violet); border-bottom: 1px solid var(--violet-line); padding: 0 20px; height: 45px; font-size: 13px; display: flex; align-items: center; gap: 10px; overflow: hidden; white-space: nowrap; position: sticky; top: calc(var(--top-h) + var(--banner-h, 0px)); 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; }


.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: var(--surface); font-weight: 500; font-size: 13.5px; color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--surface-2); border-color: var(--line-4); 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: var(--bad-line); }
.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: var(--warn); }
.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: var(--surface); 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; }


.dsp { position: relative; }
.dsp-in { cursor: pointer; text-overflow: ellipsis; }
.dsp-in:focus { cursor: text; }
.dsp-pop { position: fixed; z-index: 85; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); padding: 6px; overflow: auto; }
.dsp-hd { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.dsp-opt { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.dsp-opt .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsp-opt .s { margin-left: auto; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.dsp-opt:hover { background: var(--surface-3); }
.dsp-opt.on { background: var(--brand-50); color: var(--brand-ink); }
.dsp-opt[data-cur] .l { font-weight: 600; }
.dsp-opt mark { background: none; color: inherit; font-weight: 700; text-decoration: underline; }
.dsp-more, .dsp-none { padding: 8px 10px; font-size: 12.5px; color: var(--ink-3); }
.dsp-sep { height: 1px; background: var(--line-2); margin: 5px 4px; }
.dsp-st { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.dsp-opt { position: relative; }
.dsp-tick { margin-left: auto; flex: none; align-self: center; width: 16px; height: 16px; border: 1.5px solid var(--line); border-radius: 4px; background: var(--surface); }
.dsp-opt .s + .dsp-tick { margin-left: 8px; }
.dsp-tick:hover { border-color: var(--brand); }
.dsp-tick.on { background: var(--brand); border-color: var(--brand); }
.dsp-tick.on::after { content: ''; display: block; width: 4px; height: 8px; margin: 1px 0 0 4.5px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dsp-opt.all .l { color: var(--brand-ink, var(--brand)); font-weight: 500; }
.dsp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ex-match { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--ink-2); }
.ex-match select { max-width: 150px; }
.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: var(--surface); 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: 12px; background: var(--surface-3); color: var(--ink-3); border-radius: 999px; padding: 0 7px; font-weight: 600; }


.admin-page [aria-label="Roles view"] .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.admin-page [aria-label="Roles view"] .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }

.fr-l { overflow-wrap: anywhere; }



.scrim > .dialog { min-width: 0; }


[data-ssai-check] > .badge:first-child { min-width: 52px; justify-content: center; }


fieldset.field:has(> [data-gm-list]) > legend { font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 0; margin-bottom: 5px; }


.admin-page .tbl td.act > * + * { margin-left: 6px; }




@media (max-width: 640px) {



  .admin-page > .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  .admin-page > .tabs::-webkit-scrollbar { display: block; height: 3px; }
  .admin-page > .tabs > * { flex: 0 0 auto; white-space: nowrap; }

  .admin-page .tbl .nowrap { white-space: nowrap; }
  .admin-page [data-see] .card-h { flex-wrap: wrap; }
  .admin-page [data-see] .card-h .acts { margin-left: 0; width: 100%; }
  .admin-page [data-see] .card-h select { flex: 1; min-width: 0; }



  .admin-page .tbl td > .chips { min-width: 520px; }
}







@media (max-width: 640px) {
  .admin-page :is(#ai-providers, #ai-usage, [data-see-table], #mail-list, [data-groups], #aq-low),
  .admin-page :is(#ai-providers, #ai-usage, [data-see-table], #mail-list, [data-groups], #aq-low) tbody { display: block; }
  .admin-page :is(#ai-providers, #ai-usage, [data-see-table], #mail-list, [data-groups], #aq-low) thead { display: none; }
  .admin-page :is(#ai-providers, #ai-usage, [data-see-table], #mail-list, [data-groups], #aq-low) tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line-2);
  }
  .admin-page :is(#ai-providers, #ai-usage, [data-see-table], #mail-list, [data-groups], #aq-low) tr:last-child { border-bottom: none; }
  .admin-page :is(#ai-providers, #ai-usage, [data-see-table], #mail-list, [data-groups], #aq-low) td {
    border: none; padding: 0; text-align: left; font-size: 13px; background: none;
  }
  .admin-page :is(#ai-providers, #ai-usage, [data-see-table], #mail-list, [data-groups], #aq-low, [data-grid][data-adm] .tbl) :is(td, .cell-main, .cell-sub) { white-space: normal; overflow-wrap: anywhere; }

  .admin-page :is(#ai-providers, #ai-usage, [data-see-table], #mail-list, [data-groups], #aq-low, [data-grid][data-adm] .tbl) .cell-sub.nowrap { white-space: nowrap; overflow-wrap: normal; }
  .admin-page :is(#ai-providers, #ai-usage, [data-see-table], #mail-list, [data-groups], #aq-low) td:first-child { flex: 1 1 100%; min-width: 0; }
  .admin-page :is(#ai-providers, #ai-usage, [data-see-table], #mail-list, [data-groups], #aq-low) td.act { flex: 1 1 100%; width: auto; text-align: left; }
  .admin-page :is(#ai-providers, #ai-usage, [data-see-table], #mail-list, [data-groups], #aq-low) td.act > * { margin: 0 6px 0 0; }
  .admin-page :is(#ai-usage, #mail-list, [data-groups], #ai-providers) td:is(:nth-child(n+2)):not(.act)::before,
  .admin-page [data-grid][data-adm] .tbl td::before { color: var(--ink-3); font-weight: 400; }

  .admin-page .tbl-wrap:has(> :is(#ai-providers, #ai-usage, #mail-list, [data-groups], #aq-low)), .admin-page [data-grid][data-adm] .tbl-wrap { background: none; overflow-x: visible; }

  .admin-page #ai-providers td:nth-child(2)::before { content: "Model "; }
  .admin-page #ai-providers td:nth-child(2) > div { display: inline; }
  .admin-page #ai-providers td:nth-child(3) { flex: 1 1 100%; }
  .admin-page #ai-providers td:nth-child(4)::before { content: "Order "; }

  .admin-page #ai-usage td:nth-child(2)::before { content: "Calls "; }
  .admin-page #ai-usage td:nth-child(3)::before { content: "Errors "; }
  .admin-page #ai-usage td:nth-child(4)::before { content: "Throttled "; }
  .admin-page #ai-usage td:nth-child(5)::before { content: "Tokens in "; }
  .admin-page #ai-usage td:nth-child(6)::before { content: "Tokens out "; }

  .admin-page [data-see-table] td:first-child { color: var(--ink-3); font-size: 12px; }
  .admin-page [data-see-table] td:nth-child(2) { flex: 1 1 auto; font-weight: 600; }
  .admin-page [data-see-table] td:nth-child(3) { color: var(--ink-3); }
  .admin-page [data-see-table] td:nth-child(4), .admin-page [data-see-table] td:nth-child(5) { flex: 1 1 100%; }
  .admin-page [data-see-table] td:nth-child(5):not(:empty)::before { content: "Why: "; color: var(--ink-3); }

  .admin-page #mail-list td:first-child { flex: 1 1 auto; font-weight: 600; }
  .admin-page #mail-list td:nth-child(5) { order: -1; flex: none; margin-left: auto; }
  .admin-page #mail-list td:first-child { order: -2; }
  .admin-page #mail-list td:nth-child(2), .admin-page #mail-list td:nth-child(4) { flex: 1 1 100%; }
  .admin-page #mail-list td:nth-child(3)::before { content: "Kind "; }
  .admin-page #mail-list td:nth-child(6)::before { content: "Attempts "; }
  .admin-page #mail-list td:nth-child(3), .admin-page #mail-list td:nth-child(6) { order: 1; color: var(--ink-2); }
  .admin-page #mail-list td.act { order: 2; }

  .admin-page [data-groups] td:first-child { flex: 1 1 auto; }
  .admin-page [data-groups] td.act { order: -1; flex: none; margin-left: auto; }
  .admin-page [data-groups] td:first-child { order: -2; }
  .admin-page [data-groups] td:nth-child(2)::before { content: "Role "; }
  .admin-page [data-groups] td:nth-child(3) { flex: 1 1 100%; }
  .admin-page [data-groups] td:nth-child(4)::before { content: "People "; }

  .admin-page #aq-low td:nth-child(2), .admin-page #aq-low td:nth-child(3) { flex: 1 1 100%; }
  .admin-page #aq-low td:nth-child(3):not(:empty)::before { content: "Comment: "; color: var(--ink-3); }


  .admin-page [data-grid][data-adm] .tbl, .admin-page [data-grid][data-adm] .tbl :is(thead, tbody) { display: block; }
  .admin-page [data-grid][data-adm] .tbl tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
  .admin-page [data-grid][data-adm] .tbl tbody tr:last-child { border-bottom: none; }
  .admin-page [data-grid][data-adm] .tbl td { border: none; padding: 0; text-align: left; font-size: 13px; min-width: 0; }
  .admin-page [data-grid][data-adm] .tbl thead tr { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; padding: 2px 8px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
  .admin-page [data-grid][data-adm] .tbl thead tr::before { content: "Sort by"; font-size: 12px; color: var(--ink-3); margin-right: 2px; }
  .admin-page [data-grid][data-adm] .tbl thead th { border: none; padding: 0 4px; position: static; }
  .admin-page [data-grid][data-adm] .tbl thead th:last-child:not([aria-sort]) { display: none; }
  .admin-page [data-grid][data-adm] .tbl td { order: 2; color: var(--ink-2); }
  .admin-page [data-grid][data-adm] .tbl td::before { content: none; }
  .admin-page [data-grid][data-adm] .tbl td:empty { display: none; }
  .admin-page [data-grid][data-adm] .tbl td:first-child { order: 0; flex: 1 1 calc(100% - 140px); color: var(--ink); }
  .admin-page [data-grid][data-adm] .tbl td.act { order: 1; flex: none; margin-left: auto; }
  .admin-page [data-grid][data-adm="people"] .tbl tbody tr { padding-left: 14px; }
  .admin-page [data-grid][data-adm="people"] .tbl td:nth-child(2) { flex: 1 1 100%; padding-left: 38px; }
  .admin-page [data-grid][data-adm="people"] .tbl td:nth-child(3), .admin-page [data-grid][data-adm="people"] .tbl td:nth-child(4) { padding-left: 38px; }
  .admin-page [data-grid][data-adm="people"] .tbl td:nth-child(5)::before { content: "Last active "; }
  .admin-page [data-grid][data-adm="usage"] .tbl td:nth-child(2) { flex: 1 1 100%; color: var(--ink-3); }

  .admin-page [data-topics] .tbl td:first-child { white-space: normal; overflow-wrap: anywhere; }
  .admin-page [data-grid][data-adm="usage"] .tbl td:nth-child(3)::before { content: "Questions "; }
  .admin-page [data-grid][data-adm="usage"] .tbl td:nth-child(4)::before { content: "Exports "; }
  .admin-page [data-grid][data-adm="usage"] .tbl td:nth-child(5)::before { content: "Last activity "; }
  .admin-page [data-grid][data-adm="audit"] .tbl td:first-child { flex: none; }
  .admin-page [data-grid][data-adm="audit"] .tbl td:nth-child(2) { order: 1; flex: 1 1 0; min-width: 0; text-align: right; color: var(--ink-3); }
  .admin-page [data-grid][data-adm="audit"] .tbl td:nth-child(3) { flex: 1 1 100%; color: var(--ink); font-weight: 500; }
  .admin-page [data-grid][data-adm="audit"] .tbl td:nth-child(4) { flex: 1 1 100%; }
  .admin-page [data-grid][data-adm="audit"] .tbl td:nth-child(5)::before { content: "Via "; }
}
.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: var(--surface); 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, .chip.ex-chip { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-ink); padding-right: 4px; }
.chip .x { width: 20px; height: 20px; border: none; background: none; border-radius: 50%; display: grid; place-items: center; color: inherit; padding: 0; }
.chip .x:hover { background: var(--brand-100); }
.chip.locked { background: var(--violet-bg); border-color: var(--violet-line); color: var(--violet); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip.tag { height: 24px; padding: 0 9px; font-size: 12px; gap: 4px; }
.chip.tag.filter { padding-right: 9px; }
.chip.tag .x { width: 18px; height: 18px; margin-right: -5px; }
.chip.tag.add { border-style: dashed; color: var(--ink-3, var(--ink-2)); background: none; cursor: pointer; }
.sv-tags { gap: 6px; margin-top: 6px; }
.sv-tagbar { align-items: center; gap: 10px; }
.sv-tagbar > .cell-sub { display: inline-flex; align-items: center; gap: 4px; }


.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;
  background:
    linear-gradient(to right, var(--surface), rgba(0, 0, 0, 0)) 0 0 / 22px 100% no-repeat local,
    linear-gradient(to left, var(--surface), rgba(0, 0, 0, 0)) 100% 0 / 22px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, var(--scroll-shade), rgba(0, 0, 0, 0)) 0 0 / 18px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, var(--scroll-shade), rgba(0, 0, 0, 0)) 100% 0 / 18px 100% no-repeat scroll;
}
.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; }


.empty p { max-width: 62ch; margin-left: auto; margin-right: auto; }
.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); }


.menu { position: fixed; background: var(--surface); 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.off { color: var(--ink-3); cursor: not-allowed; }
.menu button.off:hover { background: none; }
.menu button.off .ic { opacity: .6; }
.menu button[aria-checked="true"] { font-weight: 600; }
.menu button .ic.end { margin-left: auto; color: var(--brand); }

.menu button.mtick-row[aria-checked="true"] { font-weight: 500; }
.menu .mtick { flex: none; width: 16px; height: 16px; border: 1.5px solid var(--line-2, #c4c9d4); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface, #fff); }
.menu .mtick.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.menu .mtick.on .ic { color: #fff; width: 12px; height: 12px; }
.menu .mtick-note { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.menu .sep { height: 1px; background: var(--line-2); margin: 5px 4px; }
.menu .hd { padding: 8px 10px 4px; font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.menu .hd.plain { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--ink-2); }
.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: var(--scrim); z-index: 60; display: grid; place-items: center; padding: 20px; }



.dialog { background: var(--surface); border-radius: 16px; box-shadow: var(--sh-3); width: 100%; max-width: 480px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; }
.dialog.wide { max-width: 720px; }





.dialog:has(.sl-list) { max-width: 1080px; }
.sl-tbl { width: 100%; }
.sl-tbl td { overflow-wrap: break-word; vertical-align: top; }
.sl-tbl td[data-l="Name"] { min-width: 180px; }
.sl-btns { display: flex; flex-wrap: wrap; gap: 4px; min-width: 150px; }
.sl-btns .btn { white-space: nowrap; }
.sl-status { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 220px; }
@media (max-width: 600px) {
  .sl-tbl thead { display: none; }
  .sl-tbl, .sl-tbl tbody, .sl-tbl tr, .sl-tbl td { display: block; width: auto; }
  .sl-tbl tr { border-bottom: 1px solid var(--line-2); padding: 8px 0; }
  .sl-tbl td { border: 0; padding: 2px 0; }
  .sl-tbl td[data-l]::before { content: attr(data-l) ": "; color: var(--ink-3); font-size: 12px; }
  .sl-tbl td[data-l="Name"]::before { content: none; }
  .sl-tbl td.sl-act { padding-top: 6px; }
  .sl-tbl td[data-l="Name"] { min-width: 0; }
  .sl-status { max-width: none; }
}
.dialog.xl { max-width: 1120px; height: calc(100vh - 40px); height: calc(100dvh - 40px); }
.dialog.xl .dialog-b { flex: 1; }
.dialog.xl .dialog-f { border-top: 1px solid var(--line-2); }


.role-ed-note { margin: 0 0 12px; }
.role-ed-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0 22px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); margin-bottom: 14px; }
.role-ed-scope .help { margin-top: -4px; }
.role-ed-warn { color: var(--warn); background: var(--warn-bg); border-radius: var(--r-sm); padding: 8px 10px; margin: 0 0 12px; }
.perm-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; position: sticky; top: -10px; z-index: 2; background: var(--surface); padding: 8px 0; }
.perm-search { position: relative; flex: 0 1 340px; min-width: 200px; }
.perm-search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-4); pointer-events: none; }
.perm-search .input { padding-left: 34px; height: 36px; }
.perm-total { font-size: 13px; color: var(--ink-3); font-weight: 500; }
.perm-tools-sp { flex: 1; }
.perm-none { margin: 4px 0 12px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 14px; align-items: start; }
.perm-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.perm-card-h { display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 11px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
.perm-card.folded .perm-card-h { border-bottom: none; }
.perm-fold { flex: none; width: 24px; height: 24px; margin-top: 2px; display: inline-flex; align-items: center; justify-content: center; border: none; background: none; border-radius: 6px; color: var(--ink-3); cursor: pointer; }
.perm-fold:hover { background: var(--surface-3); }
.perm-fold .ic { transition: transform .15s; }
.perm-fold[aria-expanded="false"] .ic { transform: rotate(-90deg); }
.perm-ic { flex: none; width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand); }
.perm-card-t { flex: 1; min-width: 0; }
.perm-card-t h3 { font-size: 14px; font-weight: 650; margin: 0; line-height: 28px; }
.perm-card-t p { font-size: 12.5px; color: var(--ink-3); margin: 0; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perm-card-h[data-perm-head] { cursor: pointer; user-select: none; }
.perm-card-h[data-perm-head]:hover { background: var(--surface-3); }
.perm-card-b[hidden] { display: none; }
.perm-n { flex: none; font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--surface-3); border-radius: 999px; padding: 2px 8px; margin-top: 4px; white-space: nowrap; }
.perm-all { flex: none; display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-top: 3px; cursor: pointer; white-space: nowrap; }
.perm-card-b { padding: 4px 6px 6px; }
.perm-row { display: flex; align-items: center; gap: 14px; padding: 9px 8px 9px calc(8px + var(--depth, 0) * 22px); border-radius: 8px; cursor: pointer; position: relative; }
.perm-row:hover { background: var(--surface-2); }
.perm-row + .perm-row { border-top: 1px solid var(--line-2); }
.perm-row.child::before { content: ''; position: absolute; left: calc(var(--depth, 1) * 22px - 6px); top: 0; bottom: 50%; width: 9px; border-left: 1.5px solid var(--line-3); border-bottom: 1.5px solid var(--line-3); border-bottom-left-radius: 5px; }
.perm-row[hidden], .perm-card[hidden], .perm-rules[hidden] { display: none; }
.perm-row.ctx { opacity: .6; }
.perm-txt { flex: 1; min-width: 0; }
.perm-l { display: block; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.perm-d { display: block; font-size: 12.5px; color: var(--ink-3); line-height: 1.35; margin-top: 1px; }
.perm-row:has(input:disabled) { cursor: default; }
.perm-row:has(input:disabled) .perm-l { color: var(--ink-3); }
input.perm-sw { appearance: none; -webkit-appearance: none; margin: 0; width: 36px; height: 20px; border-radius: 999px; background: var(--line-3); position: relative; flex: none; cursor: pointer; transition: background .15s; }
input.perm-sw::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform .15s; }
input.perm-sw:checked { background: var(--brand); }
input.perm-sw:checked::after { transform: translateX(16px); }
input.perm-sw:indeterminate { background: var(--brand-100); }
input.perm-sw:indeterminate::after { transform: translateX(8px); }
input.perm-sw:disabled { opacity: .5; cursor: default; }
input.perm-sw:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.perm-rules { padding: 14px 14px 12px; margin-top: 14px; }



.fr-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.fr-head h3, .fr-head h2.sec { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; font-weight: 650; line-height: 28px; }
.fr-head .perm-n { margin-top: 4px; background: var(--brand-50); color: var(--brand-ink); }
.fr-i { display: inline-flex; align-items: center; color: var(--ink-4); cursor: help; border-radius: 50%; }
.fr-i:hover, .fr-i:focus-visible { color: var(--brand); }
.fr-lock { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 12px; border-radius: 10px; background: var(--violet-bg); border: 1px solid var(--violet-line); color: var(--violet); font-size: 13px; line-height: 1.4; }
.fr-lock > span { flex: 1; min-width: 0; }
.fr-lock b { font-weight: 600; }
.plan-lock { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 9px 12px; margin-bottom: 12px; border-radius: 10px; background: var(--violet-bg); border: 1px solid var(--violet-line); color: var(--violet); font-size: 13px; line-height: 1.4; }


.plan-lock > span { flex: 1 1 14em; min-width: 0; }
.plan-lock b { font-weight: 600; }
.plan-lock .muted { color: var(--ink-3, #61707F); white-space: nowrap; }
.btn.plan-locked, .tab.plan-locked { opacity: .78; }
.btn.plan-locked .ic, .tab.plan-locked .ic { color: var(--violet); }
[data-plans-table] td.num, [data-plans-table] th.num { text-align: center; }
[data-plans-table] .pl-cur { background: var(--violet-bg); }
[data-plans-table] .pl-yes .ic { color: var(--ok, #1a7f37); }
.fr-lock .btn { flex: none; }
.fr-pv { border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 10px; padding: 9px 12px 10px; margin-bottom: 12px; }
.fr-pv-h { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.fr-pv-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px 14px; }
.fr-pv-c { display: flex; flex-direction: column; min-width: 0; }
.fr-pv-l { font-size: 11.5px; color: var(--ink-3); }
.fr-pv-v { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.fr-pv-c.masked .fr-pv-v { color: var(--warn); }
.fr-pv-c.hidden .fr-pv-v { color: var(--bad); }
.fr-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.fr-all { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 8px; }
.fr-all-l { font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.fr-set.sm .fr-opt { height: 24px; padding: 0 7px; }
.fr-g > summary .fr-set { flex: none; }
.fr-set .fr-opt[aria-checked="false"]:hover:not(:disabled) { background: var(--surface); }
@media (max-width: 720px) { .fr-tools { flex-wrap: wrap; } .fr-all { margin-left: 0; } }
.fr-groups { display: flex; flex-direction: column; gap: 8px; }
.fr-g { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.fr-g[hidden] { display: none; }
.fr-g > summary { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; list-style: none; background: var(--surface-2); user-select: none; }
.fr-g > summary::-webkit-details-marker { display: none; }
.fr-g > summary:hover { background: var(--surface-3); }
.fr-g[open] > summary { border-bottom: 1px solid var(--line-2); }
.fr-g-ic { flex: none; width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand); }
.fr-g-t { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.fr-g-n { flex: none; font-size: 12px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.fr-g-n:empty { display: none; }
.fr-g-n.on { font-weight: 600; color: var(--brand-ink); background: var(--brand-50); border-radius: 999px; padding: 2px 8px; }
.fr-g .fr-g-chev { flex: none; color: var(--ink-3); transition: transform .15s; }
.fr-g:not([open]) .fr-g-chev { transform: rotate(-90deg); }
.fr-g-b { padding: 2px 6px 4px; }
.fr-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 7px 6px; }
.fr-row + .fr-row { border-top: 1px solid var(--line-2); }
.fr-row[hidden] { display: none; }
.fr-l { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13.5px; color: var(--ink); }
.fr-sel { position: absolute; right: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.fr-seg { flex: none; display: inline-flex; background: var(--surface-3); border-radius: 8px; padding: 2px; gap: 2px; }
.fr-opt { border: none; background: none; height: 26px; padding: 0 9px; border-radius: 6px; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-3); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; transition: background .12s, color .12s; }
.fr-opt .ic { width: 14px; height: 14px; }
.fr-opt:hover:not(:disabled) { color: var(--ink); }
.fr-opt[aria-checked="true"] { box-shadow: var(--sh-1); }
.fr-opt.visible[aria-checked="true"] { background: var(--surface); color: var(--ink); }
.fr-opt.masked[aria-checked="true"] { background: var(--warn-bg); color: var(--warn); }
.fr-opt.hidden[aria-checked="true"] { background: var(--bad-bg); color: var(--bad); }
.fr-opt:disabled { cursor: not-allowed; opacity: .5; }
.fr-save { margin-top: 14px; display: flex; gap: 10px; align-items: center; }
@media (max-width: 560px) { .fr-opt span { display: none; } }
@media (max-width: 760px) { .role-ed-top { grid-template-columns: 1fr; } .perm-card-h { flex-wrap: wrap; } .perm-all span { display: none; } }
.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; }

.updating-note:empty { padding: 0; background: none; box-shadow: none; }



.updating-note { position: fixed; top: calc(var(--top-h) + 10px); left: 50%; transform: translateX(-50%); z-index: 1000; background: var(--inverse-bg); color: var(--inverse-ink); padding: 9px 14px; border-radius: 999px; box-shadow: var(--sh-3); font-size: 13.5px; max-width: calc(100vw - 32px); text-align: center; }
.toast { background: var(--inverse-bg); color: var(--inverse-ink); 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: var(--toast-act); font-weight: 600; padding: 0; white-space: nowrap; }
.tip { position: fixed; z-index: 95; background: var(--inverse-bg); color: var(--inverse-ink); 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: var(--banner-h, 0px); bottom: 0; width: var(--panel-w); max-width: 100vw; background: var(--surface); 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; }


.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; }
.home-intro { margin-bottom: 16px; }
.home-intro h2 { font-size: 18px; margin-bottom: 8px; }
.home-intro ol { list-style: decimal; padding-left: 24px; margin-bottom: 12px; }
.home-intro li + li { margin-top: 4px; }
.home-intro dl, .home-intro .err:not([hidden]) { margin: 10px 0; }
.home-intro a { text-decoration: underline; }



.home-fact { margin: 16px 0 0; }
.home-fact h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-bottom: 4px; }
.home-fact p { color: var(--ink-2); }
.composer { background: var(--surface); 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; margin-left: auto; }
.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: var(--surface); 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; }


.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: var(--surface); 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: var(--surface); 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: var(--violet-line); }
.ans-fb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--ink-3, #667); }
.ans-fb .icon-btn[aria-pressed="true"] { color: var(--accent, #2f6fde); background: var(--accent-soft, rgba(47,111,222,.1)); }
.ans-fb-box { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.ans-fb-ask { flex-basis: 100%; color: var(--ink-2, #445); }
.ans-fb-box textarea { flex: 1; min-height: 52px; max-width: 520px; }
.aq-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 0 16px 12px; }
.aq-tiles .kpi .l { font-size: 12px; color: var(--ink-3, #667); }
.aq-tiles .kpi .v { font-size: 22px; font-weight: 600; }
.ans-acts .btn.on[data-act="save"] { color: var(--brand); border-color: var(--brand); }
.ans-acts .btn.on[data-act="save"] svg { fill: currentColor; }
.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; }
.thinking[data-wait] { flex-wrap: wrap; }
.thinking .wait-slow { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2, #3d4a57); }
[data-metrics-wait] > .wait-slow { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--ink-2, #3d4a57); }
.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, var(--bg-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; }



.chart { width: 100%; position: relative; height: 300px; }
.chart.is-html { height: auto; }
.chart > div { width: 100%; height: 100%; }
.chart svg { display: block; }
.chart text { font-family: var(--sans); }
.chart-wait { height: 100%; min-height: 160px; border-radius: 10px; background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%); background-size: 300% 100%; animation: chart-wait 1.4s linear infinite; }
@keyframes chart-wait { to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .chart-wait { animation: none; } }

.skel { border-radius: 6px; background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%); background-size: 300% 100%; animation: chart-wait 1.4s linear infinite; }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }
.chart-err { display: grid; place-content: center; height: 100%; min-height: 140px; color: var(--ink-3); font-size: 13px; }
.chart-bar { display: flex; align-items: center; gap: 4px; padding: 0 10px 10px; flex-wrap: wrap; }
.viz[data-vizview="table"] .chart-bar { display: none; }
.chart-bar .btn.ghost { color: var(--ink-3); }
.chart-bar .btn.ghost:hover { color: var(--ink); }
.chart-bar .icon-btn { margin-left: auto; }
.spark { display: block; width: 108px; height: 32px; }
.spark svg { width: 108px; height: 32px; }


.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; }


[data-discover-skipped] { margin: 0 0 12px; font-size: 13px; }
[data-discover-skipped] > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; color: var(--brand); font-weight: 500; padding: 4px 0; }
[data-discover-skipped] > summary::-webkit-details-marker { display: none; }
[data-discover-skipped] > summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
[data-discover-skipped][open] > summary::before { transform: rotate(45deg); }
[data-discover-skipped] ul { margin: 6px 0 0; padding-left: 20px; color: var(--ink-2); }
.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); padding-right: 32px; }


.dash-card a.t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.dash-card .prev .prev-skel { flex: 1; height: 100%; border-radius: 4px; }
.dash-card .prev.prev-empty { align-items: center; justify-content: center; font-size: 12.5px; color: var(--ink-3); border: 1px dashed var(--line); border-radius: 4px; }
.dash-card .prev:empty { border: 1px dashed var(--line); border-radius: 4px; }
.dash-card .prev { display: flex; gap: 4px; align-items: flex-end; height: 44px; margin: 10px 0 6px; }
.sv-row { display: flex; align-items: center; gap: 12px; }
.sv-thumb { display: flex; gap: 2px; align-items: flex-end; width: 44px; height: 28px; flex: none; }
.sv-thumb i { flex: 1; background: var(--brand-100); border-radius: 2px 2px 0 0; }



.sv-thumb:empty { display: none; }
.sv-searching { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }



@media (max-width: 600px) {
  .sv-tbl thead { display: none; }
  .sv-tbl, .sv-tbl tbody { display: block; }
  .sv-tbl tr { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line-2); }
  .sv-tbl td { display: block; border: 0; padding: 2px 0; text-align: left; white-space: normal; }
  .sv-tbl td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-3); font-size: 12.5px; }
  .sv-tbl td.num { text-align: left; }
  .sv-tbl td.act { display: flex; gap: 8px; align-items: center; padding-top: 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.s3 { grid-column: span 3; }
.tile.s4 { grid-column: span 4; }
.tile.s6 { grid-column: span 6; }
.tile.s12 { grid-column: span 12; }

.tile.tile-focus { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; transition: outline-color .4s; }
.tile.dragging { opacity: .5; }
.tile.over { outline: 2px solid var(--brand); outline-offset: -1px; }
.tile-h { display: flex; align-items: center; gap: 6px; padding: 12px 8px 0 8px; }
.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; }
.grip { display: grid; place-items: center; width: 22px; height: 26px; border: none; background: none; color: var(--ink-3); cursor: grab; border-radius: 6px; flex: none; }
.grip:hover { background: var(--surface-3); color: var(--ink-2); }
.grip:active { cursor: grabbing; }
.tile-note { display: flex; align-items: center; gap: 6px; padding: 0 14px 12px; font-size: 12px; color: var(--ink-3); }
.tile-note.big { padding: 18px 0 20px; font-size: 13.5px; justify-content: center; text-align: center; }


.tile-note.big > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }




.tile-b .chart[data-kind="kpi"] { height: auto !important; min-height: 56px; }
.dash-filters .reach { font-size: 12px; }


.dash-filters .select { max-width: 240px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }


.dash-filters .dfpick { text-align: left; min-width: 150px; color: var(--ink); cursor: pointer; }
.dash-filters .dfpick.on { border-color: var(--brand); background-color: var(--brand-50); color: var(--brand-ink); font-weight: 500; }
.menu.dfmenu { min-width: 260px; }
.menu.dfmenu .menu-list { max-height: 320px; overflow: auto; }

.dash-filters > .muted, .dash-meta .muted, .dash-filters [data-through] { font-size: 12px; }
.dash-meta { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }


@media (max-width: 640px) { .dash-filters > .grow { display: none; } }


.dash-ask .input { flex: 1; max-width: 560px; }


[data-dsp="at-sadd"] { max-width: 280px; }
[data-dsp="at-sadd"] .dsp-in:placeholder-shown:not(:focus) { border-style: dashed; background: transparent; }
[data-dsp="at-sadd"] .dsp-in::placeholder { color: var(--brand); font-weight: 500; }

@media (max-width: 640px) { .dash-ask { flex-wrap: wrap; } .dash-ask .input { flex: 1 0 100%; max-width: none; } }


fieldset.field:has([data-sc-f], [data-sc-p]) { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
fieldset.field:has([data-sc-f], [data-sc-p]) > legend { font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 0; margin-bottom: 5px; }
fieldset.field:has([data-sc-f], [data-sc-p]) label { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13.5px; }
fieldset.field:has([data-sc-f], [data-sc-p]) small, #sc-h ~ small { font-size: 12.5px; color: var(--ink-3); }
.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;
  position: relative; isolation: isolate; }
.src-ico::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: rgba(6, 10, 20, .34); z-index: -1; }
.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; }


.metric-def { margin: 6px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.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; }


.metrics-intro { margin: -4px 0 14px; padding: 12px 14px; border: 1px solid var(--line-2, var(--line-3)); border-radius: 10px; background: var(--surface); font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.metrics-intro p { margin: 0; }
.metrics-intro p + p { margin-top: 4px; }
.metrics-intro .badge { vertical-align: 1px; }
.metric-used { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line-2, var(--line-3)); }
.metric-used-l { font-size: 12px; font-weight: 600; color: var(--ink-3, var(--ink-2)); margin-right: 2px; }
.metric-used a.chip, .metric-used button.chip { text-decoration: none; cursor: pointer; }
.metric-used .cell-sub { margin: 0; }
.metric-skel { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--line-2, #eceef2) 25%, var(--surface-2, #f6f7f9) 50%, var(--line-2, #eceef2) 75%); background-size: 200% 100%; animation: metric-skel 1.2s ease-in-out infinite; }
.toolbar .metric-skel { display: inline-block; border-radius: 8px; }

.metric-skel-c { padding: 16px; display: flex; flex-direction: column; gap: 8px; min-height: 132px; }
@keyframes metric-skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .metric-skel { animation: none; } }
.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 .m { align-items: center; margin-top: auto; }
.metric-c .m .link-btn { display: inline-flex; align-items: center; gap: 4px; }
.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: 12px; }
.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: 12px; 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 .drop-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .drop .drop-fine { display: none; } .drop .drop-touch { display: inline; } }
.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: var(--surface); 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; }


.search-in:has([data-conn-q]) { position: relative; }
.search-in:has([data-conn-q]) .ic { position: absolute; left: 10px; top: 9px; color: var(--ink-3); }
.search-in [data-conn-q] { width: 100%; padding-left: 34px; }




.ds-grid[data-grid] .tbl td.act { text-align: left; }
.ds-grid[data-grid] .tbl td.strong .cell-sub { font-weight: 400; }
.ds-grid[data-grid] .tbl td.act .icon-btn { vertical-align: middle; margin-left: 4px; }


[data-joins] > .row, [data-rel-admin] > .row, [data-model-panel] > .row { display: flex; gap: 10px; flex-wrap: wrap; }
.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: 12px; 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; }


@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, .tile.s3, .tile.s4 { 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: var(--banner-h, 0px); 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: var(--scrim); 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, .tile.s3, .tile.s4, .tile.s6 { 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, .tile.s3, .tile.s4 { grid-column: span 12; }
  .chat-h, .ctx { padding-left: 14px; padding-right: 14px; }
  .msgs { padding: 16px 12px 8px; }
  .chat-foot { padding: 8px 12px 12px; }



  .chat-foot .hint { display: none; }
  .chat-h { padding-top: 8px; padding-bottom: 8px; row-gap: 6px; }
  .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%; }

  .ins .side-acts > div { flex-wrap: wrap; }
  .ins .body { overflow-wrap: anywhere; }
  .ins .meta .badge { white-space: normal; overflow-wrap: anywhere; max-width: 100%; height: auto; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .page-h .acts { margin-left: 0; width: 100%; }
}





@media (max-width: 640px) {
  .btn.sm { height: 32px; padding: 0 12px; }
  .chip, .ctx .chip { height: 32px; }
  .chip.tag { height: 32px; } .chip.tag .x { width: 28px; height: 28px; }
  .seg button { height: 32px; }
  .select.sm, .input.sm, .ex-search input { height: 32px; }
  .link-btn { min-height: 32px; display: inline-flex; align-items: center; padding: 3px 8px; }
  .chip.filter, .chip.ex-chip { height: 36px; padding-right: 5px; }
  .chip .x { width: 32px; height: 32px; }


  .pill-btn { height: 32px; padding: 0 8px; }
  .composer-row { gap: 5px; }


  .switch input { width: 48px; height: 32px; }
  .switch input::after { width: 26px; height: 26px; top: 3px; left: 3px; }
  .switch input:checked::after { transform: translateX(16px); }
  .tbl th button, .tbl.dense th button { min-height: 32px; min-width: 32px; }



  .tbl td a, .tbl td button.link-btn { display: inline-flex; align-items: center; min-height: 32px; min-width: 32px; margin: -8px 0; }
  .tbl td.num a, .tbl td.num button.link-btn { justify-content: flex-end; }
  .ex-field { padding: 8px; }
  .recent a { padding: 8px 10px; }
  .grip { height: 32px; width: 32px; }






  .tbl th, .tbl td, .tbl .cell-main, .tbl .cell-sub { white-space: nowrap; }


  .crumb a, h2.sec > a, .list-c h3 a, .dash-card a.t, .page-h .acts a, .tbl td.act a.btn {
    min-height: 32px; display: inline-flex; align-items: center;
  }
}

@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: var(--surface); }
}


.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; }


.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:var(--good);flex:none}
.ans .stages li small{margin-left:auto;color:var(--ink-3,#61707F);font-variant-numeric:tabular-nums}


.ans.chat { display: block; height: auto; flex: 1; }
.chat.has-role .ans.chat { height: auto; }


.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; } }


.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: 12px; 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: 12px; 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-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-tools.mcp-pol { max-height: 420px; }
.mcp-tools.mcp-pol li { grid-template-columns: minmax(120px, 190px) 1fr auto; align-items: start; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mcp-pol-ctl { display: flex; gap: 8px; align-items: center; }
.mcp-pa-args { margin-top: 8px; }
.mcp-pa-args th { text-align: left; font-weight: 600; width: 1%; white-space: nowrap; padding-right: 12px; }
.mcp-pa .mcp-raw { font-size: 11.5px; font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.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, .mcp-tools.mcp-pol li { grid-template-columns: 1fr; gap: 2px; } }



.explore { max-width: 1480px; }
.ex-grid { display: grid; grid-template-columns: 286px minmax(0, 1fr); gap: 16px; align-items: start; }
.ex-rail { padding: 14px; position: sticky; top: calc(var(--top-h) + 16px); max-height: calc(100vh - var(--top-h) - 40px); overflow: auto; }
.ex-rail-h { position: sticky; top: -14px; background: var(--surface); padding-bottom: 10px; margin: -2px 0 2px; z-index: 2; }
.ex-search { max-width: none; }
.ex-search input { height: 32px; font-size: 13px; }
.ex-fields { display: flex; flex-direction: column; gap: 12px; }
.ex-grp-h { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); padding: 2px 4px 5px; }
.ex-grp-s { font-size: 12px; color: var(--ink-2); padding: 6px 4px 2px; }
.ex-field { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 1px solid transparent; background: none; border-radius: 8px; padding: 6px 8px; font-size: 13px; color: var(--ink-2); cursor: grab; }
.ex-field:hover { background: var(--surface-3); color: var(--ink); }
.ex-field.on { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-ink); font-weight: 500; }
.ex-field.dragging { opacity: .45; }
.ex-field .l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-field .ic { color: var(--ink-4); flex: none; }
.ex-field.on .ic { color: var(--brand); }
.ex-cert { margin-left: auto; color: var(--good); display: inline-flex; }
.ex-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ex-shelves { display: flex; flex-direction: column; gap: 8px; }
.ex-shelf { display: flex; align-items: flex-start; gap: 12px; border: 1px dashed var(--line-3); border-radius: 12px; padding: 9px 12px; background: var(--surface); min-height: 48px; }
.ex-shelf.over { border-color: var(--brand); border-style: solid; background: var(--brand-50); }
.ex-shelf-l { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); width: 76px; flex: none; padding-top: 7px; }
.ex-shelf-b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; }

.ex-shelf-b .chip[disabled] { opacity: .5; cursor: not-allowed; }

.ex-shelf.idle .ex-shelf-b .chip { color: var(--ink-3); border-style: dashed; background: transparent; }
.ex-shelf.idle .ex-shelf-b .chip .ic { opacity: .6; }

.xc-rows { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow: auto; }
.xc-row { display: flex; align-items: center; gap: 8px; }
.xc-name { flex: 0 0 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xc-name .xc-all { display: block; font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.xc-sws { display: flex; gap: 4px; }
.xc-sw { width: 20px; height: 20px; border-radius: 5px; border: 2px solid transparent; padding: 0; cursor: pointer; }
.xc-sw.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--surface) inset; }
.xc-free { width: 30px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }


@media (max-width: 640px) { .xc-row { flex-wrap: wrap; row-gap: 4px; } .xc-name { flex: 1 0 100%; } .xc-sws { flex-wrap: wrap; } }
.ex-hint { font-size: 12.5px; color: var(--ink-3); padding: 6px 0; }

.ex-hint-tap { display: none; }
@media (hover: none) and (pointer: coarse) { .ex-hint-drag { display: none; } .ex-hint-tap { display: inline; } }
.explore-chart .viz-bar { border-bottom: 1px solid var(--line-2); }
.explore-chart .viz-bar .t { flex: 1; }
.explore-chart.empty-card { padding: 10px; }
.ex-trust { border: none; padding: 0 4px; }


.tile.x-source { box-shadow: inset 0 0 0 1.5px var(--brand); }
.dash-filters .chip.filter { height: 28px; font-size: 12.5px; }
.ex-rail-f { border-top: 1px solid var(--line-2); margin-top: 12px; padding-top: 12px; }
.ex-rail-f .btn { width: 100%; justify-content: center; }
.ex-rail-f .btn + .btn { margin-top: 6px; }




.chip .chip-main { border: none; background: none; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; max-width: 34ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .chip-main:hover { text-decoration: underline; }
.chip-tag { margin-left: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--brand); background: var(--brand-100); border-radius: 4px; padding: 1px 5px; }
.chip.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand-ink); }



.ex-trail { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); padding: 0 4px; }
.ex-trail .ic { color: var(--ink-4); }
.ex-trail [aria-current] { color: var(--ink); font-weight: 600; }



.ex-notes { display: flex; flex-direction: column; gap: 4px; padding: 0 4px; }
.ex-notes > div { display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.ex-notes .ic { color: var(--warn); flex: none; margin-top: 1px; }


.gal-grp + .gal-grp { margin-top: 16px; }
.gal-grp h3 { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 8px; }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; }
.gal-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: auto auto; gap: 2px 10px; align-items: center; text-align: left; border: 1px solid var(--line-3); border-radius: 10px; background: var(--surface); padding: 9px 10px; color: var(--ink-2); }
.gal-card:hover:not([disabled]) { border-color: var(--brand); background: var(--brand-50); color: var(--brand-ink); }
.gal-card.on { border-color: var(--brand); background: var(--brand-50); color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand); }
.gal-card[disabled] { opacity: .55; cursor: not-allowed; }
.gal-thumb { grid-row: 1 / span 2; display: grid; place-items: center; color: var(--brand); }
.gal-card[disabled] .gal-thumb { color: var(--ink-4); }
.gal-n { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.gal-card[disabled] .gal-n { color: var(--ink-2); }
.gal-note { font-size: 11.5px; line-height: 1.35; color: var(--ink-3); }


.cd-eg { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.cd-eg .link-btn { font-size: 12.5px; font-family: var(--mono, ui-monospace, monospace); }

@media (max-width: 1040px) {
  .ex-grid { grid-template-columns: 1fr; }




  .ex-rail { position: static; max-height: 440px; }
  .ex-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 16px; align-items: start; }
  .ex-shelf { flex-direction: column; gap: 6px; }
  .ex-shelf-l { width: auto; padding-top: 0; }
}
@media (max-width: 560px) {
  .gal-grid { grid-template-columns: 1fr; }
  .chip .chip-main { max-width: 22ch; }
}


.ct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.ct-card { padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.ct-h { display: flex; align-items: baseline; gap: 8px; }
.ct-h h2 { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.ct-h code { font-family: var(--mono); font-size: 12px; color: var(--ink-3); margin-left: auto; }
.ct-chart { min-height: 90px; }

.ct-chart [data-kind="kpi"] .tcc-kpi { justify-content: center; align-items: center; }
.ct-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; margin-top: auto; }
.ct-needs { display: flex; gap: 7px; font-size: 12px; color: var(--warn); background: var(--warn-bg); border-radius: 8px; padding: 8px 10px; line-height: 1.45; }
.ct-needs .ic { flex: none; margin-top: 1px; }
.ct-none { display: grid; place-content: center; min-height: 120px; border-radius: 10px; background: var(--surface-2); color: var(--ink-3); font-size: 13px; text-align: center; padding: 14px; }
.ct-acts { display: flex; gap: 8px; }
.ct-example { display: grid; justify-items: center; gap: 6px; min-height: 120px; padding: 10px; border-radius: 10px; background: var(--surface-2); color: var(--ink-3); }
.ct-caption { font-size: 12.5px; text-align: center; line-height: 1.45; }






:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0F18; --surface: #111726; --surface-2: #161E30; --surface-3: #1E2740;
  --ink: #EEF1F8; --ink-2: #C3CAD9; --ink-3: #8D97AC; --ink-4: #7A84A0;
  --line: #273150; --line-2: #1D2538; --line-3: #39425C; --line-4: #4A5573;
  --brand: #6C8BFF; --brand-2: #8AA2FF; --brand-50: #18203A; --brand-100: #222E52; --brand-ink: #B9C8FF;
  --ai-a: #A98CFF; --ai-b: #6C8BFF;
  --good: #4ED1A1; --good-bg: #0F2A22; --warn: #E8B45C; --warn-bg: #2E2413; --bad: #FF8578; --bad-bg: #2E1714;
  --info: #8FA8FF; --info-bg: #182143; --violet: #B79BFF; --violet-bg: #231B3D;
  --bad-line: #4A2420; --violet-line: #3A2E63;
  --c-muted: #39425C; --c-bad: #FF8578; --c-good: #4ED1A1;
  --top-bg: rgba(17, 23, 38, .9); --bg-0: rgba(11, 15, 24, 0); --bg-2: #161E30;
  --inverse-bg: #E8EBF4; --inverse-ink: #0E1630; --scrim: rgba(3, 5, 10, .64);

  --toast-act: #0030DB;
  --scroll-shade: rgba(0, 0, 0, .62);
  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 20px rgba(0, 0, 0, .45);
  --sh-3: 0 20px 56px rgba(0, 0, 0, .6);
}


:root[data-theme="dark"] { --c1: #7FA0FF; --c2: #3FC9C0; --c3: #F0A53C; --c4: #AD8CFF; --c5: #FF7FC7; --c6: #94A3C4; }
:root[data-theme="dark"] .sql { background: #0A0F1C; color: #C6D2EA; }
:root[data-theme="dark"] .mcp-chip { background: #0F2A22; border-color: #1F4A3D; color: #6FD9B4; }
:root[data-theme="dark"] .brand-mark, :root[data-theme="dark"] .ai-mark { color: #0B0F18; }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .send, :root[data-theme="dark"] .avatar:not(.alt) { color: #0B0F18; }
:root[data-theme="dark"] .msg-u { color: #0B0F18; }
:root[data-theme="dark"] .switch input::after { background: #0B0F18; }
:root[data-theme="dark"] input.perm-sw::after { background: #0B0F18; }



.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.qchip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); border-radius: 999px; font: inherit; font-size: 13px; cursor: pointer; }
.qchip:hover { border-color: var(--brand); color: var(--brand); }
.qchip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.qchip .ic { width: 15px; height: 15px; opacity: .75; }


.input.ai-code { font-family: var(--mono); font-size: 18px; letter-spacing: .12em; }



.subbar { display: flex; align-items: center; gap: 10px; padding: 7px 20px; font-size: 13px; border-bottom: 1px solid var(--line); background: var(--warn-bg); color: var(--warn); }
.subbar.bad { background: var(--bad-bg); color: var(--bad); }
.subbar span { flex: 1; min-width: 0; }
.subbar a { color: inherit; font-weight: 600; white-space: nowrap; }
.subbar .icon-btn { color: inherit; flex: none; }



@media (max-width: 640px) {
  .subbar { flex-wrap: wrap; row-gap: 2px; padding: 8px 12px; }
  .subbar span { flex-basis: calc(100% - 70px); }
  .subbar .icon-btn { order: 2; }
  .subbar a { order: 3; flex-basis: 100%; padding-left: 24px; }
}


.dash-shared { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: -6px 0 12px; font-size: 13px; color: var(--ink-3); }
.dash-shared span { flex: 1; min-width: 200px; }


.seatline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 12px; font-size: 13.5px; }




.tbl.matrix th:first-child { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.tbl.matrix td.matrix-cell { text-align: center; font-weight: 600; }
.tbl.matrix td.matrix-cell.on { color: var(--ok, #1a7f4b); }
.tbl.matrix td.matrix-cell.off { color: var(--ink-3); font-weight: 400; }
.tbl.matrix td[data-scope] { white-space: nowrap; }
.matrix-wrap { max-height: 72vh; overflow: auto; }
.tbl.matrix thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.tbl.matrix thead tr.matrix-keys th { top: 34px; }
.tbl.matrix thead th.matrix-corner { left: 0; z-index: 3; vertical-align: bottom; }
.tbl.matrix th.matrix-group { text-align: center; font-size: 12px; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--line); height: 34px; box-sizing: border-box; }
.tbl.matrix th.matrix-key { font-size: 12px; font-weight: 500; line-height: 1.25; min-width: 84px; max-width: 120px; white-space: normal; vertical-align: bottom; text-align: center; }
.tbl.matrix .alt { background: var(--surface-2, #f6f7f9); }
.tbl.matrix thead th.alt { background: var(--surface-2, #f6f7f9); }
.tbl.matrix .gstart { border-left: 2px solid var(--line); }
.tbl.matrix tbody th[scope="row"] { white-space: nowrap; box-shadow: 1px 0 0 var(--line); }


.dash-tabs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 0 0 14px; }
.dash-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; margin-bottom: -1px; color: var(--ink-3); font-weight: 500; }
.dash-tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.dash-tab:hover { color: var(--ink); }
.dash-row { grid-column: span 12; position: relative; min-width: 0; }
.dash-row .dash-rowmore { position: absolute; top: 4px; right: 4px; }
.dash-header { font-size: 17px; font-weight: 600; margin: 8px 0 0; color: var(--ink); }
.dash-divider { border: 0; border-top: 1px solid var(--line-3); margin: 6px 0; }
.dash-note { padding: 14px 16px; overflow-wrap: anywhere; }
.dash-note > * + * { margin-top: 8px; }
.dash-note h2, .dash-note h3, .dash-note h4, .dash-note h5, .dash-note h6 { font-weight: 600; }
.dash-note h2 { font-size: 18px; } .dash-note h3 { font-size: 16px; } .dash-note h4, .dash-note h5, .dash-note h6 { font-size: 14px; }
.dash-note ul { list-style: disc; padding-left: 20px; } .dash-note ol { list-style: decimal; padding-left: 20px; }



.page.dash-theme-light { color-scheme: light; --bg: #F5F6F8; --surface: #FFFFFF; --surface-2: #F8F9FB; --surface-3: #EFF1F5; --ink: #0E1630; --ink-2: #3A435C; --ink-3: #626D80; --ink-4: #8089A1; --line: #E3E6ED; --line-2: #EDEFF3; --line-3: #CFD5E0; --brand: #0030DB; }
.page.dash-theme-dark { color-scheme: dark; --bg: #0B0F18; --surface: #111726; --surface-2: #161E30; --surface-3: #1E2740; --ink: #EEF1F8; --ink-2: #C3CAD9; --ink-3: #8D97AC; --ink-4: #7A84A0; --line: #273150; --line-2: #1D2538; --line-3: #39425C; --brand: #6C8BFF; }
.page.dash-theme-contrast { color-scheme: light; --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #FFFFFF; --surface-3: #F0F0F0; --ink: #000000; --ink-2: #000000; --ink-3: #1A1A1A; --ink-4: #333333; --line: #000000; --line-2: #1A1A1A; --line-3: #000000; --brand: #0000CC; }
.page.dash-theme-brand { --bg: var(--brand-50); --surface: #FFFFFF; --surface-2: var(--brand-50); --surface-3: var(--brand-100); --line: var(--brand-100); --line-2: var(--brand-100); }
.page[class*="dash-theme-"] { background: var(--bg); color: var(--ink); border-radius: var(--r-lg); }



.ai-busy { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 13.5px; line-height: 1.45; text-align: left; }
.ai-busy[hidden] { display: none; }
.ai-busy .ic, .ai-busy svg { flex: none; margin-top: 2px; }
.ai-busy a { color: inherit; text-decoration: underline; }




@media (max-width: 1279px) {
  .tbl[data-apps] td.act { white-space: normal; width: auto; }
  .tbl[data-apps] td.act .btn { margin: 2px 0 2px 4px; }
}

.tbl[data-apps] td.act .btn + .btn { margin-left: 6px; }

.select[data-refresh-every] { display: block; max-width: 280px; margin-bottom: 6px; }

.mcp-card > .card-h h3 { white-space: nowrap; flex: none; }






@media (max-width: 640px) {
  .tbl[data-srctable], .tbl[data-srctable] tbody, .tbl[data-apps], .tbl[data-apps] tbody,
  .ds-grid[data-grid] .tbl, .ds-grid[data-grid] .tbl tbody { display: block; }
  .tbl[data-srctable] thead, .tbl[data-apps] thead { display: none; }
  .tbl[data-srctable] tr, .tbl[data-apps] tr, .ds-grid[data-grid] .tbl tbody tr {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line-2);
  }
  .tbl[data-srctable] tr:last-child, .tbl[data-apps] tr:last-child, .ds-grid[data-grid] .tbl tbody tr:last-child { border-bottom: none; }
  .tbl[data-srctable] td, .tbl[data-apps] td, .ds-grid[data-grid] .tbl td { border: none; padding: 0; text-align: left; font-size: 13px; }
  .tbl[data-srctable] td:first-child, .tbl[data-apps] td:first-child { flex: 1 1 100%; min-width: 0; }
  .tbl[data-srctable] td:first-child .cell-main, .tbl[data-apps] td, .tbl[data-apps] .cell-sub { white-space: normal; }
  .tbl[data-srctable] td:nth-child(3):not(:empty)::before { content: "Checked "; color: var(--ink-3); }
  .tbl[data-srctable] td:nth-child(4):not(:empty)::before { content: "Tables "; color: var(--ink-3); }
  .tbl[data-srctable] td:nth-child(5):not(:empty)::before { content: "Rows "; color: var(--ink-3); }
  .tbl[data-srctable] td:nth-child(6)::before { content: "Datasets "; color: var(--ink-3); }
  .tbl[data-apps] td:nth-child(4) { flex: 1 1 100%; }
  .tbl[data-apps] td.act { flex: 1 1 100%; width: auto; text-align: left; }
  .tbl[data-apps] td.act .btn { margin: 0 6px 0 0; }
  .ds-grid[data-grid] .tbl thead { display: block; }
  .ds-grid[data-grid] .tbl thead tr { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; padding: 2px 8px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); }
  .ds-grid[data-grid] .tbl thead tr::before { content: "Sort by"; font-size: 12px; color: var(--ink-3); margin-right: 2px; }
  .ds-grid[data-grid] .tbl thead th { border: none; padding: 0 4px; position: static; }
  .ds-grid[data-grid] .tbl thead th:last-child:not([aria-sort]) { display: none; }
  .ds-grid[data-grid] .tbl td:first-child { flex: 1 1 calc(100% - 120px); min-width: 0; order: 0; }
  .ds-grid[data-grid] .tbl td:first-child .cell-main, .ds-grid[data-grid] .tbl td:first-child .cell-sub { white-space: normal; overflow-wrap: anywhere; }

  .ds-grid[data-grid] .tbl td.act { order: 1; flex: none; width: 92px; text-align: left; }
  .ds-grid[data-grid] .tbl td:nth-child(2) { order: 2; color: var(--ink-3); }
  .ds-grid[data-grid] .tbl td:nth-child(3), .ds-grid[data-grid] .tbl td:nth-child(4) { order: 3; color: var(--ink-3); }
  .ds-grid[data-grid] .tbl td:nth-child(3)::before { content: "Rows "; }
  .ds-grid[data-grid] .tbl td:nth-child(3):has([data-norows])::before { content: none; }
  .ds-grid[data-grid] .tbl td:nth-child(4)::before { content: "Columns "; }
}


.top-btn { gap: 6px; }
.notif-btn { position: relative; }


.notif-n { position: absolute; top: -3px; right: -5px; box-shadow: 0 0 0 2px var(--surface); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--bad, #d14343); color: #fff; font-size: 10.5px; font-weight: 600; line-height: 16px; text-align: center; }
.tour { position: fixed; inset: 0; z-index: 90; }
.tour-ring { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(10, 14, 24, .45), 0 0 0 2px var(--accent, #4f6bed); pointer-events: none; transition: all .15s ease; }
.tour-pop { position: fixed; width: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-3); padding: 14px 16px; }
.tour-pop small { display: block; color: var(--ink-3); font-size: 12px; }
.tour-pop b { display: block; font-size: 15px; margin: 4px 0; }
.tour-pop p { font-size: 13.5px; color: var(--ink-2, var(--ink)); }
.tour-acts { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.tour-acts .grow { flex: 1; }
.help-card { padding: 18px 20px; margin-bottom: 14px; }
.help-card h2 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }


.help-page { max-width: 960px; }
.help-card ul { list-style: disc; padding-left: 20px; display: grid; gap: 6px; }
.help-card dt { font-weight: 600; margin-top: 10px; }
.help-card dd { margin: 2px 0 0; color: var(--ink-2, var(--ink)); }
@media (max-width: 960px) { .top-lbl { display: none; } }


.role-areas { list-style: none; margin: 6px 0 4px; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; max-width: 640px; }
.ra { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; line-height: 1; padding: 5px 8px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.ra .ra-ic { display: inline-flex; } .ra .ra-ic svg { width: 13px; height: 13px; }
.ra .ra-n { font-weight: 650; font-variant-numeric: tabular-nums; }
.ra.full { background: var(--good-bg); color: var(--good); }
.ra.part { background: var(--warn-bg); color: var(--warn); }
.ra.none { background: transparent; color: var(--ink-3); border-color: var(--line); border-style: dashed; }
.ra.none .ra-l { text-decoration: line-through; text-decoration-color: var(--line); }
.ra.mini { padding: 2px 7px; margin: 0 3px 0 10px; } .ra.mini:first-child { margin-left: 0; }
.role-headline { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.role-more { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; padding: 2px 0; color: var(--info); font: inherit; font-size: 12.5px; cursor: pointer; }
.role-more:hover { text-decoration: underline; }
.role-row.open > td { border-bottom-color: transparent; }
.tbl td.role-use { min-width: 360px; }
.tbl td.role-data { min-width: 170px; max-width: 220px; }
.role-detail-row > td { background: var(--surface-2); padding: 12px 14px 14px; }
.role-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.rd-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.rd-card.full { border-left: 3px solid var(--good); } .rd-card.part { border-left: 3px solid var(--warn); } .rd-card.rd-data { border-left: 3px solid var(--violet); }
.rd-card h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 13px; font-weight: 650; }
.rd-card h4 .ra-n { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.rd-card ul { list-style: none; margin: 0; padding: 0; font-size: 12.5px; line-height: 1.5; }
.rd-card li { display: flex; gap: 6px; align-items: flex-start; } .rd-card li svg { color: var(--good); flex: none; margin-top: 3px; width: 12px; height: 12px; }
.rd-more { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); }
.rd-unused { display: flex; gap: 6px; align-items: center; margin: 10px 2px 0; font-size: 12.5px; color: var(--ink-3); }
.role-legend .ra { font-size: 11px; }
.matrix-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.tbl.matrix-areas th.matrix-area-h { text-align: center; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tbl.matrix-areas th.matrix-area-h svg { display: block; margin: 0 auto 3px; }
.tbl.matrix-areas td.matrix-area { text-align: center; }
.tbl.matrix-areas td.matrix-area .ra { justify-content: center; min-width: 50px; }

.tbl.matrix-areas th.matrix-area-h, .tbl.matrix-areas td.matrix-area { padding-left: 5px; padding-right: 5px; }
.tbl.matrix-areas tbody th .cell-sub { font-weight: 400; }
.role-view-sum { margin: 0 0 14px; } .role-view-sum .role-areas { max-width: none; margin: 8px 0 12px; }

.role-live { border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 12px; padding: 10px 14px 10px; margin: 0 0 14px; }
.role-live-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.role-live-h h3 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 14px; font-weight: 650; line-height: 26px; }
.role-live-head { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.role-live .role-areas { max-width: none; margin: 6px 0 6px; }
.role-live-data { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 4px; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.role-live-data svg { flex: none; margin-top: 2px; color: var(--violet); }
.role-live-data b { font-weight: 600; color: var(--ink); }
.role-live-d { margin-top: 8px; }
.role-live-d[hidden] { display: none; }
.role-view-sw { font-size: 13px; font-weight: 650; margin: 16px 0 8px; color: var(--ink-2); }
.tbl.matrix-areas td[data-scope] { white-space: normal; min-width: 150px; }
.tbl.matrix-areas tbody th[scope="row"] { white-space: normal; min-width: 170px; font-weight: 600; }


[data-fold][data-folded] > :not(.fold-h) { display: none !important; }
[data-fold] .fold-t { all: unset; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: inherit; color: inherit; border-radius: 6px; }
[data-fold] .fold-t:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 2px; }
[data-fold] .fold-t svg { transition: transform .15s ease; transform: rotate(-90deg); }
[data-fold]:not([data-folded]) .fold-t svg { transform: none; }
[data-fold][data-folded] > .fold-h { border-bottom: 0; }
[data-fold][data-folded].pad > .fold-h, [data-fold][data-folded] > .fold-h[style*="margin"] { margin-bottom: 0 !important; }
.fold-grow { margin: 0 !important; flex: 1; }



.ex-more { display: contents; }
.ex-more-t .ic { transition: transform .15s ease; transform: rotate(-90deg); }
.ex-more:not([data-folded]) .ex-more-t .ic { transform: none; }
.ex-shelves:has(.ex-more[data-folded]) [data-more-only] { display: none; }
.fold-m0 { margin: 0 !important; }


.ai-fold-h { flex-wrap: wrap; }
.ai-fold-h .ai-fold-t { margin: 0; }
.ai-sum { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-body { padding: 14px 16px 16px; }
.ai-wait { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.ai-lim { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; align-items: end; }
.ai-price { display: flex; align-items: center; gap: 6px; }


.ai-cards > .card, .ai-cards > p, .ai-cards > .ai-save { max-width: 960px; }

.ai-save { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.ai-price .input { width: 96px; }
.aq-tiles .kpi.aq-stale { border-color: var(--warn, #d97706); }
.aq-tiles .kpi .badge { margin-top: 6px; }


.dsc-sugg { display: flex; gap: 10px; align-items: center; flex-wrap: nowrap; margin: 4px 0 12px; min-height: 34px; }

.dsc-sugg-h { font-size: 12.5px; font-weight: 600; color: var(--ink-3); flex: none; }
.dsc-sugg .chips { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; min-width: 0; flex: 1; padding: 2px 0; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.dsc-sugg .skel-chip { flex: none; }
.dsc-sugg .chip { cursor: pointer; white-space: nowrap; flex: none; height: 30px; }
.dsc-sugg .chip:hover { background: var(--surface-3); }
.dsc-ai { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.dsc-ai > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 13.5px; display: flex; gap: 6px; align-items: center; }
.dsc-ai > div { padding: 0 14px 12px; font-size: 13.5px; color: var(--ink-2); }
.dsc-explain { margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--line-3); background: var(--surface-2); border-radius: 4px; font-size: 13px; }
.ins .meta > span:not(.badge) + span:not(.badge)::before { content: '\00B7'; margin-right: 8px; color: var(--ink-3); }




.is-busy { position: relative; cursor: progress !important; pointer-events: none; color: transparent !important; }
.is-busy > * { visibility: hidden; }
.is-busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid var(--line-3, #D0D5DD); border-top-color: var(--brand, #0030DB); animation: ri-spin .7s linear infinite; visibility: visible; }
.btn.primary.is-busy::after { border-color: rgba(255,255,255,.35); border-top-color: #fff; }



.chat.is-busy { cursor: auto !important; pointer-events: auto; color: inherit !important; }
.chat.is-busy > * { visibility: visible; }
.chat.is-busy::after { content: none; }


.ai-spin { display: inline-block; width: 12px; height: 12px; margin: 0 6px 0 0; vertical-align: -2px; border-radius: 50%; border: 2px solid var(--line-3, #D0D5DD); border-top-color: var(--brand, #0030DB); animation: ri-spin .7s linear infinite; }
@keyframes ri-spin { to { transform: rotate(360deg); } }

.ri-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 1001; overflow: hidden; pointer-events: none; }
.ri-progress::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; background: var(--brand, #0030DB); border-radius: 0 3px 3px 0; animation: ri-bar 1.1s ease-in-out infinite; will-change: transform; }
@keyframes ri-bar { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

.ri-slow { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 1000; background: var(--inverse-bg, #0B1635); color: var(--inverse-ink, #fff); padding: 9px 16px; border-radius: 999px; box-shadow: var(--sh-3); font-size: 13.5px; max-width: calc(100vw - 32px); text-align: center; pointer-events: none; }

.skel { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--line, #E4E7EC) 0%, var(--surface-3, #EEF0F3) 50%, var(--line, #E4E7EC) 100%); background-size: 200% 100%; animation: ri-shimmer 1.3s ease-in-out infinite; }
.skel-chip { display: inline-block; height: 30px; border-radius: 999px; }
.skel-line { height: 12px; margin: 8px 0; }
.skel-card { height: 142px; border-radius: 14px; }
@keyframes ri-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .is-busy::after, .ai-spin, .ri-progress::before, .skel { animation: none; } }
.sq li.sq-skel { cursor: default; min-height: 44px; }
.sq li.sq-skel:hover { border-color: var(--line); box-shadow: none; }
.sq li.sq-skel .skel-line { flex: none; margin: 0; }


#view.ri-keeping { position: relative; }
#view .ri-behind { position: absolute; top: 0; left: 0; right: 0; opacity: 0; pointer-events: none; }
#view .ri-kept { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.tab .count.skel { display: inline-block; min-width: 18px; height: 14px; vertical-align: middle; color: transparent; }

.dsc-src { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px; }
.note-missing { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin: 0 0 12px; color: var(--ink-2, #3d4a57); }



@media print {
  :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #F5F6F8; --surface: #FFFFFF; --surface-2: #F8F9FB; --surface-3: #EFF1F5;
    --ink: #0E1630; --ink-2: #3A435C; --ink-3: #626D80; --ink-4: #8089A1;
    --line: #E3E6ED; --line-2: #EDEFF3; --line-3: #CFD5E0; --line-4: #B9C1D1;
    --brand: #0030DB; --brand-2: #0028B4; --brand-50: #EEF2FF; --brand-100: #DCE4FF; --brand-ink: #001F9C;
    --c1: #0030DB; --c2: #0FA3A3; --c3: #E8930C; --c4: #7A5AF8; --c5: #D6409F; --c6: #5B6B8A;
    --bg-2: #F6F7F9; --top-bg: rgba(255, 255, 255, .92);
  }
  :root[data-theme="dark"] .sql { background: #F8F9FB; color: #0E1630; }
}
