/* TruvaLI platform UI. One stylesheet, design tokens on :root, light and dark. No framework, no inline styles (CSP).
   Visual language: light lavender canvas, white cards with soft shadows, violet accent, pill tags, icon rail. */
/* Manrope (SIL OFL 1.1, static/fonts/OFL-Manrope.txt): variable weight 200-800, latin and latin-ext subsets. */
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #f3f5fa; --surface: #ffffff; --surface-2: #f5f7fb; --surface-3: #e9edf5; --text: #071733; --muted: #5f6b83;
  --border: #e3e8f1; --border-strong: #d2d9e6;
  --primary: #1360ef; --primary-hover: #0f52cc; --primary-text: #ffffff; --primary-soft: #e6eefe; --primary-soft-text: #0d4bc0;
  --success: #1f9d6a; --success-soft: #e6f6ef; --warning: #c98a0b; --warning-soft: #fff4dc; --danger: #d9363e; --danger-soft: #fdecec;
  --focus: #1360ef;
  --shadow-sm: 0 1px 2px rgba(7, 23, 51, .04), 0 6px 16px rgba(7, 23, 51, .05);
  --shadow-md: 0 6px 18px rgba(7, 23, 51, .10);
  --shadow-primary: 0 8px 20px rgba(19, 96, 239, .28);
  --radius-sm: 10px; --radius: 14px; --radius-lg: 22px; --space: 16px; --side: 260px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #121a2b; --surface-2: #182236; --surface-3: #202c44; --text: #e8edf7; --muted: #94a0b8;
    --border: #1f2a40; --border-strong: #2c3a55;
    --primary: #5b8cff; --primary-hover: #74a0ff; --primary-text: #061233; --primary-soft: #1a2a4d; --primary-soft-text: #b7ccff;
    --success: #4ade80; --success-soft: #15291f; --warning: #f5b945; --warning-soft: #2e2512; --danger: #f47c80; --danger-soft: #3a1c1e;
    --focus: #74a0ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 16px rgba(0, 0, 0, .25); --shadow-md: 0 12px 32px rgba(0, 0, 0, .45);
    --shadow-primary: 0 8px 20px rgba(154, 132, 255, .25);
  }
    .logo-light { display: none; }
    .logo-dark { display: inline-block; }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #121a2b; --surface-2: #182236; --surface-3: #202c44; --text: #e8edf7; --muted: #94a0b8;
  --border: #1f2a40; --border-strong: #2c3a55;
  --primary: #5b8cff; --primary-hover: #74a0ff; --primary-text: #061233; --primary-soft: #1a2a4d; --primary-soft-text: #b7ccff;
  --success: #4ade80; --success-soft: #15291f; --warning: #f5b945; --warning-soft: #2e2512; --danger: #f47c80; --danger-soft: #3a1c1e;
  --focus: #74a0ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 16px rgba(0, 0, 0, .25); --shadow-md: 0 12px 32px rgba(0, 0, 0, .45);
  --shadow-primary: 0 8px 20px rgba(154, 132, 255, .25);
  .logo-light { display: none; }
  .logo-dark { display: inline-block; }
}

/* --- base ------------------------------------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary-soft-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.015em; margin: 0 0 12px; line-height: 1.25; }
h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 12px; }
p { margin: 0 0 12px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: var(--space); background: var(--surface); padding: 8px; z-index: 10; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }  /* !important: beats input[type] width rules */
.icon { width: 1.1em; height: 1.1em; vertical-align: -0.2em; flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.block { display: block; }
.error { color: var(--danger); }
.grow { flex: 1; min-width: 0; }

/* --- standalone layout (legal pages, onboarding header) ----------------------------------------------------------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; background: var(--surface); }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: var(--muted); font-weight: 600; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 14px; background: linear-gradient(135deg, #3b82f6 0%, #1360ef 100%); color: #fff; font-weight: 800; font-size: 1.1rem; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-primary); text-decoration: none; flex-shrink: 0; }
.logo { display: inline-block; height: 28px; width: auto; vertical-align: middle; }
.logo-dark { display: none; }
.auth-brand .logo { height: 36px; }
.brand .logo { height: 26px; }
.brand-link { display: inline-flex; align-items: center; line-height: 0; }
.brand-mark.small { width: 30px; height: 30px; border-radius: 10px; font-size: .95rem; box-shadow: none; }
.container { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 24px var(--space); }
.container-wide { max-width: 1120px; }
.footer { position: sticky; bottom: 0; z-index: 2; background: var(--bg); padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }  /* always in view on long pages */
.footer-left, .footer-right { display: inline-flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-right { margin-left: auto; }
.footer-note { color: var(--muted); }
.footer a { color: var(--muted); }

/* --- app shell: left sidebar (brand, new conversation, nav, history, account) + page ----------------------------- */
.app { display: flex; min-height: 100vh; flex: 1; }
.side { width: var(--side); flex-shrink: 0; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px; padding: 12px 10px 10px; background: var(--surface); }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 4px 6px; }
.side-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; color: var(--text); text-decoration: none; }
.side-brand:hover { text-decoration: none; color: var(--text); }
.side-toggle, .side-open-btn, .topbar .icon-button { border-color: transparent; background: transparent; }
.side-toggle.icon-button:hover, .side-open-btn.icon-button:hover, .topbar .icon-button:hover { color: var(--text); border-color: transparent; background: var(--surface-2); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--text); font-weight: 500; font-size: 13.5px; text-decoration: none; }
.side-link:hover { background: var(--surface-2); text-decoration: none; }
.side-link.active { background: var(--primary-soft); color: var(--primary-soft-text); }
.side-link .icon { width: 18px; height: 18px; color: var(--muted); vertical-align: 0; flex-shrink: 0; }
.side-link.active .icon { color: inherit; }
.side-link .badge { position: static; margin-left: auto; }
.side-history { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 6px; }
.side-bottom {
  border-top: 1px solid #00000011;
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 5px;
    padding-right: 5px;
  padding-top: 8px; }
.side-account { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; margin: 0; padding: 8px 10px; border: 0; border-radius: 12px; background: transparent; box-shadow: none; text-align: left; color: var(--text); font: inherit; cursor: pointer; }
.side-account:hover, .side-account[aria-expanded="true"] { background: var(--surface-2); }
.side-account .avatar { width: 32px; height: 32px; font-size: .85rem; }
.side-account-text { line-height: 15px; display: grid; min-width: 0; }
.side-account-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-account-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-open-btn, .topbar, .side-backdrop { display: none; }
.side-collapsed .side { display: none; }
.side-collapsed .side-open-btn { display: inline-flex; position: fixed; top: 12px; left: 12px; z-index: 25; background: var(--surface); }
.side-collapsed .app-main { padding-top: 52px; }
.side-collapsed .chat-main { min-height: calc(100vh - 52px); }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 32px 40px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head-main { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.page-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-title-row h1 { margin: 0; }
.page-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 6px; }
.page-meta span { display: inline-flex; align-items: center; gap: 6px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* --- auth pages ---------------------------------------------------------------------------------------------------- */
.auth { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px; background: radial-gradient(800px 420px at 50% -10%, var(--primary-soft) 0%, transparent 65%); }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; margin-bottom: 22px; }
.narrow { width: 100%; max-width: 440px; margin: 0; }
.auth .card { padding: 32px; }
.auth h1 { font-size: 1.5rem; margin-bottom: 6px; }
.auth form > button.primary { width: 100%; justify-content: center; margin-top: 20px; }
.auth p.small { margin-top: 16px; }
.auth .auth-or { text-align: center; margin: 18px 0 12px; color: var(--muted); font-size: 13px; }
.auth .button.social { width: 100%; margin-top: 0; background: var(--surface-3); color: var(--text); }
.auth .button.social + p.small { margin-top: 10px; }

/* --- cards, rows, pills ------------------------------------------------------------------------------------------ */
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 24px; margin-bottom: var(--space); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.card-head .icon { width: 20px; height: 20px; color: var(--primary); vertical-align: 0; }
.card-head .pill { margin-left: 4px; }
.subcard { background: var(--surface-2); border-radius: var(--radius); padding: 18px 20px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.stat-label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.stat-value { display: block; font-weight: 700; font-size: 1.25rem; }
.rows { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border-radius: var(--radius); color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
a.row:hover { text-decoration: none; background: var(--surface-2); transform: translateY(-1px); }
.row .chevron { color: var(--muted); width: 18px; height: 18px; }
.row-title { display: block; font-weight: 600; }
.row-sub { display: block; color: var(--muted); font-size: 13px; }
.card .rows .row { background: var(--surface-2); border-color: transparent; }
.card .rows a.row:hover { background: var(--surface-3); }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--surface-2); border-radius: var(--radius); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-soft-text); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: .95rem; }
.avatar.square { border-radius: 12px; }
.avatar.square .icon { width: 18px; height: 18px; vertical-align: 0; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.3rem; }
.avatar-button { border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: none; font: inherit; font-weight: 700; transition: border-color .15s, transform .1s; }
.avatar-button:hover, .avatar-button[aria-expanded="true"] { border-color: var(--primary); }

/* popover menu (account) */
.menu { position: relative; }
.menu-panel { position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; padding: 8px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); z-index: 20; }
.menu-head { padding: 10px 12px 12px; margin-bottom: 4px; }
.menu-name { display: block; font-weight: 700; }
.menu-email { display: block; color: var(--muted); font-size: 13px; word-break: break-all; }
.menu-item { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; color: var(--text); border: 0; background: none; box-shadow: none; font-weight: 500; text-align: left; margin: 0; }
.menu-item:hover { background: var(--surface-2); text-decoration: none; border-color: transparent; }
.menu-item .icon { width: 18px; height: 18px; color: var(--muted); vertical-align: 0; }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger); }
.menu-sep { height: 6px; }
.menu-panel form { margin: 0; }

/* account page */
.section-title { font-size: .95rem; font-weight: 700; margin: 20px 0 12px; }
.upgrade-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.upgrade { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.upgrade .plan-icon { width: 40px; height: 40px; border-radius: 12px; }
.upgrade .plan-icon .icon { width: 20px; height: 20px; }
.upgrade .button { align-self: stretch; margin-top: 4px; }
.plan-features.compact { border-top: 0; padding-top: 4px; gap: 6px; font-size: 13px; flex: 0; }
input:disabled { color: var(--muted); background: var(--surface-2); cursor: not-allowed; }

/* two-factor set-up */
.setup-steps { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start; }
.setup-steps h2 { margin-top: 0; }
.setup-steps h2 + p { margin-bottom: 10px; }
.setup-steps form { margin-top: 8px; max-width: 320px; }
.qr { display: inline-block; padding: 14px; background: #ffffff; border-radius: 18px; line-height: 0; }
.qr svg { width: 200px; height: 200px; }
.secret-key { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.05rem; letter-spacing: .12em; padding: 10px 14px; background: var(--surface-2); border-radius: 12px; user-select: all; margin: 0 0 20px; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0 0 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.05rem; }
.codes li { padding: 10px 14px; background: var(--surface-2); border-radius: 10px; text-align: center; letter-spacing: .06em; }
.table-form input:not([type="checkbox"]) { width: 160px; }
button.danger-text { color: var(--danger); }
.pill, .tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.pill .icon, .tag .icon { width: 13px; height: 13px; vertical-align: 0; }
.pill.primary { background: var(--primary-soft); color: var(--primary-soft-text); }
.pill.success { background: var(--success-soft); color: var(--success); }
.pill.warning { background: var(--warning-soft); color: var(--warning); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.list { list-style: none; padding: 0; margin: 0 0 12px; }
.list li { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.list li + li { margin-top: 6px; }

/* pill tabs (filters) */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border-radius: 16px; margin-bottom: 16px; }
.tab { padding: 8px 16px; border-radius: 12px; color: var(--muted); font-weight: 600; text-decoration: none; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { background: var(--primary-soft); color: var(--primary-soft-text); }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* --- tables as rounded rows ----------------------------------------------------------------------------------------- */
table { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 13.5px; margin: -8px 0 0; }
th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 6px 14px 0; }
td { text-align: left; padding: 12px 14px; background: var(--surface-2); vertical-align: middle; }
td:first-child { border-radius: 12px 0 0 12px; }
td:last-child { border-radius: 0 12px 12px 0; text-align: right; }
td .pill { margin-left: 6px; }
.table-form { display: inline-flex; gap: 6px; align-items: center; }
select.compact { width: auto; padding: 6px 30px 6px 10px; font-size: 14px; }
button.confirming, .button.confirming { color: var(--danger); font-weight: 700; }
.page-actions .button .pill { margin-left: 2px; }

/* --- forms ---------------------------------------------------------------------------------------------------------- */
label { display: block; margin: 14px 0 6px; font-weight: 600; font-size: 13px; }
label.check { font-weight: 400; display: flex; gap: 10px; align-items: center; }
input:not([type="checkbox"]), select, textarea { width: 100%; padding: 11px 14px; border: 1px solid transparent; border-radius: 12px; background: var(--surface-2); color: var(--text); font: inherit; transition: background .15s, border-color .15s, box-shadow .15s; }
.card input:not([type="checkbox"]), .card select, .card textarea, .composer textarea, .side input { background: var(--surface-3); }
input:not([type="checkbox"]):hover, select:hover { background: var(--surface-3); }
input:focus, select:focus, textarea:focus { outline: none; background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
input[aria-invalid="true"] { background: var(--danger-soft); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; padding: 0; background: none; border: 0; box-shadow: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hint { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 14px 0 6px; }
.label-row label { margin: 0; }
.label-row a { font-size: 13px; font-weight: 600; }
small.error { display: block; margin-top: 6px; font-size: 13px; }
.field { margin-bottom: 18px; }
.field label { margin: 0 0 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-card { max-width: 640px; margin: 0 auto; padding: 32px; }
.slug-preview { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.check-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); margin: 0; font-weight: 400; cursor: pointer; }
.check-card:hover { background: var(--surface-3); }
.check-card input { margin: 4px 0 0; }
.check-card strong { display: block; margin-bottom: 2px; }
form.inline { display: inline; }

/* --- buttons -------------------------------------------------------------------------------------------------------- */
/* Buttons (Emrah, 2026-10-18): one standard size, a fill that always differs from the page and the card, so a
   button reads as a button. Secondary = soft blue; ghost = grey fill; primary = blue; small is the only other size. */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 12px; border: 1px solid transparent; background: var(--primary-soft); color: var(--primary-soft-text); font: inherit; font-weight: 600; line-height: 1.3; cursor: pointer; text-decoration: none; box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; }
button:hover, .button:hover { filter: brightness(.95); text-decoration: none; }
button:active, .button:active { transform: translateY(1px); }
form > button, form > .button { margin-top: 16px; }
.table-form > button, .inline > button, .member-role > select { margin-top: 0; }
button.primary, .button.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
button.primary:hover, .button.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
button.ghost, .button.ghost { border-color: transparent; background: var(--surface-3); color: var(--text); box-shadow: none; }
button.ghost:hover, .button.ghost:hover { background: var(--primary-soft); color: var(--primary-soft-text); }
button.secondary, .button.secondary { background: var(--surface-3); color: var(--text); }
button.small, .button.small { min-height: 32px; padding: 4px 12px; font-size: 13px; border-radius: 10px; }
button.link { border: 0; background: none; padding: 0; margin: 0; color: var(--primary-soft-text); font-weight: 600; box-shadow: none; }
button.link:hover { text-decoration: underline; }
button.link.danger { color: var(--danger); }
.icon-btn { width: 42px; height: 42px; padding: 0; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex-shrink: 0; }
.icon-btn:hover { color: var(--text); }
.icon-btn .icon { width: 18px; height: 18px; vertical-align: 0; }
.icon-button { margin: 0; padding: 9px; border-radius: 12px; line-height: 0; color: var(--muted); box-shadow: none; }
.icon-button:hover { color: var(--danger); background: var(--danger-soft); }
.icon-button .icon { width: 18px; height: 18px; vertical-align: 0; }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 28px; }
.actions.split { justify-content: space-between; }
.actions.center { justify-content: center; }
.actions .group { display: flex; gap: 10px; }
.actions button, .actions .button { margin-top: 0; }
.actions button.primary, .actions .button.primary { min-width: 180px; }

/* --- messages ------------------------------------------------------------------------------------------------------ */
.messages { margin-bottom: 16px; }
.msg { padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; background: var(--surface); }
.msg.error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.msg.success { background: var(--success-soft); border-color: transparent; color: var(--success); }
.msg.warning { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
.msg .icon { margin-right: 4px; }
.summary-icon.warning { background: var(--warning-soft); color: var(--warning); }
.page-actions form { margin: 0; }

/* --- onboarding (templates/onboarding) -------------------------------------------------------------------------------- */
.onboard-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.onboard-top nav { justify-self: end; }
.steps { display: flex; list-style: none; margin: 0; padding: 0; }
.step { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.step + .step::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: var(--border); margin: 0 10px; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--surface-3); }
.step-dot .icon { width: 14px; height: 14px; vertical-align: 0; }
.step.current { color: var(--text); font-weight: 600; }
.step.current .step-dot { border-color: var(--primary); color: var(--primary-soft-text); background: var(--primary-soft); box-shadow: 0 0 0 4px var(--primary-soft); }
.step.done .step-dot { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }

.onboard { padding: 16px 0 48px; }
.onboard-head { text-align: center; max-width: 640px; margin: 24px auto 32px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--primary-soft-text); margin: 0 0 10px; }
.onboard-head h1 { font-size: 2rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 10px; }
.lead { color: var(--muted); font-size: 1.05rem; margin: 0; }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; margin-top: 8px; }
.plan { position: relative; }
.plan-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.plan-card { position: relative; height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 28px 24px 24px; background: var(--surface); border-radius: var(--radius-lg); transition: border-color .15s, box-shadow .15s, transform .15s; }
.plan-input:hover + .plan-card { transform: translateY(-2px); background: var(--surface-2); }
.plan-input:checked + .plan-card { box-shadow: 0 0 0 2px var(--primary); }
.plan-input:focus-visible + .plan-card { outline: 2px solid var(--focus); outline-offset: 3px; }
.plan-badge { position: absolute; top: -13px; left: 24px; background: var(--primary); color: var(--primary-text); font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; letter-spacing: .02em; box-shadow: var(--shadow-primary); }
.plan-icon { width: 46px; height: 46px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary-soft-text); }
.plan-icon .icon { width: 22px; height: 22px; vertical-align: 0; }
.plan-name { font-size: 1.25rem; font-weight: 700; margin: 4px 0 0; display: block; }
.plan-body { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.plan-tagline { color: var(--muted); margin: 0; min-height: 3em; }
.plan-price { font-size: 1.1rem; font-weight: 700; margin: 0; min-height: 2.9em; }
.plan-price small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.plan-features { list-style: none; margin: 4px 0 0; padding: 14px 0 0; display: grid; gap: 10px; font-size: 14px; align-content: start; flex: 1; }
.plan-features li { display: flex; gap: 10px; align-items: flex-start; }
.plan-features .icon { color: var(--success); margin-top: 3px; width: 16px; height: 16px; }
.plan-cta { margin-top: 12px; text-align: center; padding: 10px; border-radius: 12px; font-weight: 700; color: var(--primary-soft-text); background: var(--primary-soft); }
.plan-input:checked + .plan-card .plan-cta { background: var(--primary); color: var(--primary-text); }
.plan-cta .when-selected { display: none; }
.plan-input:checked + .plan-card .when-idle { display: none; }
.plan-input:checked + .plan-card .when-selected { display: inline; }
.plan-form .actions { margin-top: 32px; }
.plan-form .actions button.primary { min-width: 260px; padding: 12px 20px; font-size: 1.05rem; }
.plan-form p.center { margin-top: 12px; }

.invites { margin-top: 8px; }
.invites-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.invites-title { font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.invite-rows { display: grid; gap: 10px; }
.invite-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.invite-row.with-role { grid-template-columns: 1fr 170px auto; }
.invite-row .error { grid-column: 1 / -1; margin-top: -4px; }
.invite-row.has-error input { background: var(--danger-soft); }
.invites [data-add-row] { margin-top: 10px; }
.role-help { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 20px; margin: 20px 0 0; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); font-size: 13px; }
.role-help div { display: flex; gap: 6px; }
.role-help dt { font-weight: 700; min-width: 72px; }
.role-help dd { margin: 0; color: var(--muted); }

.summary { max-width: 560px; margin: 24px auto 0; text-align: center; }
.summary-icon { width: 76px; height: 76px; border-radius: 50%; background: var(--success-soft); color: var(--success); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.summary-icon .icon { width: 38px; height: 38px; vertical-align: 0; }
.summary h1 { font-size: 2rem; margin-bottom: 8px; }
.summary dl { display: grid; grid-template-columns: max-content 1fr; gap: 12px 24px; text-align: left; margin: 28px 0 0; padding: 22px 24px; border-radius: var(--radius-lg); background: var(--surface); }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; }
.summary form.center { margin-top: 16px; }

/* --- responsive ------------------------------------------------------------------------------------------------------ */
@media (max-width: 900px) {
  .plans { grid-template-columns: 1fr; max-width: 480px; margin-left: auto; margin-right: auto; }
  .plan-tagline { min-height: 0; }
  .onboard-top { grid-template-columns: 1fr auto; }
  .onboard-top .steps { grid-column: 1 / -1; justify-content: center; }
  .step-label { display: none; }
  .step.current .step-label { display: inline; }
  .step + .step::before { width: 16px; margin: 0 6px; }
  .onboard-head h1 { font-size: 1.5rem; }
  .field-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .form-card { padding: 20px; }
  .invite-row.with-role { grid-template-columns: 1fr auto; }
  .invite-row.with-role select { grid-column: 1 / 2; }
  .role-help { grid-template-columns: 1fr; }
  .actions.split { flex-direction: column-reverse; align-items: stretch; }
  .actions .group { flex-direction: column; }
  .actions button.primary, .actions .button.primary { width: 100%; }
  .summary dl { grid-template-columns: 1fr; gap: 4px; }
  .summary dt { margin-top: 8px; }
}
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; height: 100dvh; z-index: 30; transform: translateX(-100%); transition: transform .2s ease; }
  .side-collapsed .side { display: flex; }
  .side-open .side { transform: none; box-shadow: var(--shadow-md); }
  .side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(7, 23, 51, .35); }
  .topbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: var(--surface); position: sticky; top: 0; z-index: 10; }
  .topbar-title { font-weight: 700; }
  .side-collapsed .side-open-btn { display: none; }
  .side-collapsed .app-main { padding-top: 0; }
  .upgrade-grid { grid-template-columns: 1fr; }
  .setup-steps { grid-template-columns: 1fr; }
  .codes { grid-template-columns: 1fr; }
  .page { padding: 20px 16px 32px; }
  .app-chat .page { padding: 0; min-height: calc(100dvh - 49px); }
  .app-chat .chat-main, .side-collapsed .chat-main { min-height: calc(100dvh - 49px); padding-bottom: 16px; }
  .page-head { flex-direction: column; }
  .page-actions .button { flex: 1; }
  table { display: block; overflow-x: auto; }
  .auth { padding: 24px 16px; }
}

/* --- chat ------------------------------------------------------------------------------------------------------------ */
.app-chat .page { max-width: none; padding: 0; display: flex; flex-direction: column; min-height: calc(100vh - 44px); }
.app-chat .page > .messages, .app-chat .page > .msg { margin: 12px 20px 0; }
.chat { flex: 1; display: flex; flex-direction: column; }
.chat-list { flex: 1; min-height: 0; list-style: none; margin: 0 -4px; padding: 0 4px; display: block; overflow: auto; }
.chat-list-group { padding: 14px 10px 4px; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.chat-list li + li:not(.chat-list-group) { margin-top: 2px; }
.chat-list li a { display: block; padding: 8px 10px; border-radius: 5px; line-height: 15px; color: var(--text); text-decoration: none; }
.chat-list li a:hover { background: var(--surface-2); text-decoration: none; }
.chat-list li.active a, .chat-list li.active a:hover { background: var(--primary-soft); color: var(--primary-soft-text); }
.chat-list-title { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-meta { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.chat-list-meta .icon { width: 12px; height: 12px; }
.chat-list li.active .chat-list-meta { color: inherit; opacity: .8; }
.chat-list-empty { padding: 12px 10px; }
.chat-main { display: flex; flex-direction: column; min-height: 100vh; width: 100%; max-width: 880px; margin: 0 auto; padding: 24px 32px 20px; }
.chat-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; padding: 0 22px; }
.chat-head h1 { margin-bottom: 4px; }
.chat-head form { margin: 0; }
.chat-title { font-size: 1.15rem; }
.chat-thread { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 0 22px 16px; }
.msg-bubble { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; max-width: 100%; }
.msg-bubble.user { align-items: flex-end; }
.msg-bubble .bubble-body { max-width: 100%; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }
.msg-bubble.user .bubble-body { padding: 10px 16px; border-radius: 20px; background: var(--surface-3); color: var(--text); max-width: min(80%, 640px); }
.msg-bubble.assistant .bubble-body { width: 100%; box-sizing: border-box; padding: 4px 0; background: transparent; }
.msg-bubble.failed .bubble-body { padding: 12px 16px; border-radius: 16px; background: var(--danger-soft); }
.msg-bubble.assistant .bubble-body.job-card, .msg-bubble.assistant .bubble-body.approval-card { padding: 12px 16px; border-radius: 16px; background: var(--surface); }
.msg-actions { display: flex; align-items: center; gap: 2px; min-height: 32px; }
.msg-bubble.user .msg-actions { opacity: 0; transition: opacity .15s; }
.msg-bubble.user:hover .msg-actions, .msg-bubble.user:focus-within .msg-actions { opacity: 1; }
.msg-action { width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: none; }
.msg-action:hover { background: var(--surface-3); color: var(--text); }
.msg-action[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary-soft-text); }
.msg-action[data-act="say"] { display: none; }
html.has-tts .msg-action[data-act="say"] { display: inline-flex; }
.msg-action[data-act="say"][aria-pressed="true"] { animation: say-pulse 1.4s ease-in-out infinite; }
@keyframes say-pulse { 50% { opacity: .55; } }
.msg-action .icon { width: 16px; height: 16px; vertical-align: 0; }
.msg-action .act-icon, .msg-action .act-done { display: inline-flex; line-height: 0; }
.msg-action .act-done { display: none; }
.msg-action.done .act-icon { display: none; }
.msg-action.done .act-done { display: inline-flex; color: var(--success); }
.msg-more { position: relative; }
.msg-more .menu-panel { bottom: auto; top: calc(100% + 6px); left: 0; right: auto; min-width: 250px; }
.msg-more .menu-item[disabled] { opacity: .55; cursor: default; }
.msg-more .menu-item .pill { margin-left: auto; }
.msg-stats { margin-left: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
/* waiting indicator: a spinning ring (SMIL svg, static/img/ring-loader.svg) shown only until the first text arrives */
.msg-bubble.streaming .bubble-body:empty::after { content: ""; display: block; width: 20px; height: 20px; margin: 8px 0 0 2px; background: url("../img/ring-loader.svg") center / contain no-repeat; }
@keyframes blink { 50% { opacity: 0; } }
.avatar.ai { background: linear-gradient(135deg, #3b82f6, #1360ef); color: #fff; width: 32px; height: 32px; font-size: .85rem; }
.bubble-body > :first-child { margin-top: 0; }
.bubble-body > :last-child { margin-bottom: 0; }
.bubble-body pre { margin: 0; background: var(--surface); padding: 12px 14px; border-radius: 0 0 12px 12px; overflow: auto; font-size: 13px; line-height: 1.55; }
.bubble-body code { background: var(--surface-2); padding: 1px 5px; border-radius: 6px; font-size: .92em; }
.bubble-body pre code { background: none; padding: 0; }
.bubble-body table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 10px 0; font-size: 13.5px; background: var(--surface); border-radius: 12px; overflow: hidden; }
.bubble-body th { padding: 9px 12px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--surface-3); text-align: left; vertical-align: bottom; }
.bubble-body td { padding: 9px 12px; background: transparent; border-radius: 0; text-align: left; vertical-align: top; }
.bubble-body td:first-child, .bubble-body td:last-child { border-radius: 0; text-align: left; }
.bubble-body tr:nth-child(even) td { background: var(--surface-2); }
.bubble-body blockquote { margin: 8px 0; padding: 8px 14px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.composer { position: sticky; bottom: 56px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 12px; margin-top: 8px; }
.composer textarea { border: 0; box-shadow: none; padding: 8px 10px; resize: none; min-height: 44px; overflow-y: auto; max-height: 40vh; font: inherit; font-size: 14px; background: transparent; }
.composer textarea:focus { box-shadow: none; outline: none; }
.composer-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 6px; }
.composer-options { display: flex; gap: 8px; flex-wrap: wrap; }
.composer-option { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 0 0 0 10px; border-radius: 10px; background: var(--surface-2); font-weight: 500; color: var(--muted); }
.composer-option select { width: auto; padding: 7px 26px 7px 4px; font-size: 13px; border-color: transparent; background-color: transparent; color: var(--text); }
.composer-option select:hover, .composer-option select:focus { background-color: transparent; border-color: transparent; box-shadow: none; }
.composer-option:hover, .composer-option.attach:hover { background: var(--surface-3); }
.composer-option .icon { width: 16px; height: 16px; vertical-align: 0; flex-shrink: 0; }
.composer button.primary { margin: 0; min-width: 0; }
.composer-send { display: flex; align-items: center; gap: 8px; position: relative; flex-shrink: 0; }
.composer button.icon-only, .composer button.mic { width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 13px; justify-content: center; }
.composer button.icon-only .icon, .composer button.mic .icon { width: 18px; height: 18px; margin: 0; vertical-align: 0; }
/* the mic sits on the composer's white card: grey fill so it reads as a button; red while listening, blue while the pause countdown runs */
.composer button.mic { background: var(--surface-3); color: var(--text); border-color: transparent; box-shadow: none; }
.composer button.mic:hover { background: var(--primary-soft); color: var(--primary-soft-text); }
.composer button.mic.listening { background: var(--danger); color: #fff; animation: mic-pulse 1.6s ease-out infinite; }
.composer button.mic.listening:hover { background: var(--danger); color: #fff; filter: none; }
.composer button.mic.sending { background: var(--primary); color: var(--primary-text); animation: none; }
@keyframes mic-pulse { 0% { box-shadow: 0 0 0 0 rgba(217, 54, 62, .45); } 70% { box-shadow: 0 0 0 12px rgba(217, 54, 62, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 54, 62, 0); } }
.voice-countdown { position: absolute; left: 0; right: 0; bottom: -8px; height: 3px; border-radius: 2px; background: var(--primary); width: 100%; transition: none; }
.composer textarea.listening::placeholder { color: var(--danger); }
@media (max-width: 900px) {
  .chat-main { padding: 20px 16px 16px; }
  .composer-bar { flex-wrap: wrap; gap: 8px; }
  .composer-options { flex: 1; min-width: 0; gap: 6px; }
  .composer-option.attach span { display: none; }
  .composer-send { margin-left: auto; }
  .chat-empty { justify-content: flex-start; padding-top: 24px; padding-bottom: 24px; }
  .chat-empty .composer { margin-top: 14px; }
  .page-actions .button, .page-actions button { white-space: nowrap; }
}

/* tool chips and approval cards */
.approval-card { background: var(--warning-soft) !important; }
.approval-title { margin: 0 0 8px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.approval-args { white-space: pre-wrap; background: var(--surface-2); padding: 10px 12px; border-radius: 12px; font-size: 13px; margin: 0 0 10px; max-height: 240px; overflow: auto; }
.approval-actions { display: flex; gap: 8px; }
.approval-actions button { margin: 0; }

/* approvals */
.decisions { list-style: none; padding: 0; margin: 0 0 10px; font-size: 13px; display: grid; gap: 4px; }
.approval-actions input.note { flex: 1; min-width: 180px; padding: 8px 10px; }
.approval-row { align-items: flex-start; }
.approval-row .approval-args { margin: 8px 0 0; font-size: 12px; max-height: 140px; }
.approval-inline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 0; max-width: 380px; }
.approval-inline input[type="text"] { width: auto; flex: 1; min-width: 160px; padding: 8px 10px; }

/* notifications */
.badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.row.unread { background: var(--primary-soft); }
.msg.toast { position: sticky; top: 8px; z-index: 30; }

/* job cards */
.job-title { margin: 0 0 8px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.progress { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 10px; }
.progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .4s; }
.job-card button { margin: 0; }

/* apps page */
.app-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.app-card code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
select[multiple] { min-height: 80px; }
@media (max-width: 900px) { .app-grid { grid-template-columns: 1fr; } }

/* attachments */
.attachments li { display: flex; align-items: center; gap: 6px; }
.composer-option.attach { cursor: pointer; padding: 7px 10px; max-width: 220px; }
.composer-option.attach span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* conversation options and search */
.chat-search { margin: 0; }
.chat-search input { padding: 7px 12px; border-radius: 10px; font-size: 13px; }
.chat-tools { position: relative; }
.menu-panel.chat-tools-panel { bottom: auto; top: calc(100% + 8px); left: auto; right: 0; min-width: 220px; width: max-content; }
.menu-note { margin: 4px 0; padding: 6px 12px; font-size: 12px; color: var(--muted); max-width: 260px; }
/* modal dialogs */
dialog.modal { border: 0; border-radius: 18px; padding: 22px 24px; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); }
dialog.modal::backdrop { background: rgba(7, 23, 51, .35); }
dialog.modal h2 { font-size: 1.05rem; margin: 0 0 14px; }
dialog.modal p { margin: 0 0 12px; }
dialog.modal form { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-actions button { margin: 0; }
button.danger-btn { background: var(--danger); border-color: var(--danger); color: #fff; }
button.danger-btn:hover { background: #c22f36; border-color: #c22f36; }

/* empty chat (no conversation yet): greeting and composer sit together in the middle, like a fresh assistant screen */
.chat-empty { justify-content: center; padding-bottom: 14vh; }
.chat-empty .chat-head { justify-content: center; text-align: center; margin-bottom: 26px; }
.chat-empty .chat-head h1 { font-size: 1.8rem; margin-bottom: 8px; }
.chat-empty .chat-head p { max-width: 560px; margin: 0 auto; }
.chat-empty .chat-thread { flex: 0 0 auto; padding: 0; }
.chat-empty .composer { position: static; margin: 0 auto; width: 100%; max-width: 720px; }

/* reply timeline: thinking and tool steps, collapsed to one head line */
.timeline { margin: 2px 0 6px; max-width: 100%; }
.timeline-head { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 5px 10px 5px 6px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; box-shadow: none; }
.timeline-head:hover { background: var(--surface-3); color: var(--text); }
.timeline-icons { display: inline-flex; align-items: center; gap: 2px; }
.timeline-mini, .tl-icon { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-3); color: var(--muted); flex-shrink: 0; }
.timeline-mini .icon, .tl-icon .icon { width: 13px; height: 13px; vertical-align: 0; }
.timeline-mini.ok, .timeline-mini.done, .tl-step.ok .tl-icon, .tl-step.done .tl-icon { background: var(--primary-soft); color: var(--primary-soft-text); }
.timeline-mini.error, .tl-step.error .tl-icon { background: var(--danger-soft); color: var(--danger); }
.timeline-mini.waiting, .tl-step.waiting .tl-icon { background: var(--warning-soft); color: var(--warning); }
.timeline-mini.running, .tl-step.running .tl-icon { color: var(--primary); }
.timeline-mini.running .icon, .tl-step.running .tl-icon .icon { animation: pulse 1.2s ease-in-out infinite; }
.timeline-chevron { display: inline-flex; }
.timeline-chevron .icon { width: 16px; height: 16px; vertical-align: 0; transition: transform .2s; }
.timeline-head[aria-expanded="true"] .timeline-chevron .icon { transform: rotate(180deg); }
.timeline.running .timeline-title { background: linear-gradient(90deg, var(--muted) 0%, var(--text) 45%, var(--muted) 90%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.8s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.timeline-list { list-style: none; margin: 6px 0 0; padding: 6px 0 4px 6px; display: grid; gap: 12px; position: relative; }
.timeline-list::before { content: ""; position: absolute; left: 16px; top: 18px; bottom: 14px; width: 2px; border-radius: 2px; background: var(--surface-3); }
.tl-step { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; position: relative; }
.tl-title { font-size: 13px; font-weight: 600; color: var(--text); padding-top: 2px; }
.tl-detail { margin: 6px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; }
.tl-detail.result { background: var(--surface-3); color: var(--text); }
.msg-bubble.assistant.tool-plan .bubble-body { padding: 2px 0 0 4px; }
.stopped-note { margin: 0 0 2px; font-style: italic; }
.composer button[data-stop] { background: var(--text); border-color: var(--text); color: var(--surface); }
.composer button[data-stop]:hover { background: var(--muted); border-color: var(--muted); }
.composer.dragging { outline: 2px dashed var(--primary); outline-offset: -2px; }
.composer-files { list-style: none; margin: 0 0 8px; padding: 0 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 12px; background: var(--surface-2); font-size: 12.5px; max-width: 260px; overflow: hidden; }
.file-chip-link { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.file-chip-link:hover { text-decoration: none; }
.file-icon { width: 36px; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--surface-3); color: var(--muted); }
.file-icon .icon { width: 18px; height: 18px; vertical-align: 0; }
.kind-pdf .file-icon { background: #fde8e8; color: #d9363e; }
.kind-doc .file-icon { background: #e6eefe; color: #1360ef; }
.kind-sheet .file-icon { background: #e4f5ec; color: #1f9d6a; }
.kind-slides .file-icon { background: #fff0dc; color: #d97c0b; }
.kind-text .file-icon { background: var(--surface-3); color: var(--muted); }
.file-thumb-wrap { display: inline-flex; flex-shrink: 0; }
.file-thumb { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; display: block; background: var(--surface-3); }
.file-chip-text { display: grid; min-width: 0; line-height: 1.25; }
.file-chip-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip-size { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-chip-remove { margin: 0; padding: 0; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer; box-shadow: none; flex-shrink: 0; }
.file-chip-remove:hover { background: var(--danger-soft); color: var(--danger); }
.file-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; }
.file-progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.file-chip.uploading .file-icon, .file-chip.uploading .file-thumb { opacity: .55; }
.file-chip.uploading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; pointer-events: none; }
.file-chip.ready .file-progress { opacity: 0; transition: opacity .4s .3s; }
.file-chip.error { background: var(--danger-soft); }
.file-chip.error .file-chip-size { color: var(--danger); }
.attachments { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.attachments .file-chip { background: var(--surface); }
.tl-body .approval-card, .tl-body .job-card { margin-top: 8px; padding: 10px 12px; border-radius: 12px; }
.tl-body .job-card { background: var(--surface); }
.tl-body .approval-args { font-size: 12px; max-height: 160px; overflow: auto; }
/* sources, code copy, scroll-to-bottom */
.sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 2px; }
.sources-label { font-size: 12px; font-weight: 600; color: var(--muted); margin-right: 2px; }
.source-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--text); font-size: 12.5px; text-decoration: none; max-width: 220px; }
.source-chip:hover { background: var(--surface-3); text-decoration: none; }
.source-chip .icon { width: 13px; height: 13px; color: var(--muted); vertical-align: 0; flex-shrink: 0; }
.source-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.to-bottom { position: fixed; right: 32px; bottom: 150px; width: 38px; height: 38px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md); cursor: pointer; z-index: 8; }
.to-bottom .icon { width: 18px; height: 18px; vertical-align: 0; }
@media (max-width: 760px) { .to-bottom { right: 16px; bottom: 130px; } }
/* member and invitation lists, approval presets */
.member-row { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.member-row .avatar { width: 36px; height: 36px; font-size: .9rem; }
.member-row .avatar .icon { width: 16px; height: 16px; vertical-align: 0; }
.member-main { flex: 1; min-width: 0; }
.member-main .row-title { font-size: 14px; }
.member-main .row-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-actions { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.member-role { margin: 0; }
.member-role select.compact { padding: 7px 30px 7px 10px; }
.preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.preset { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); margin: 0; cursor: pointer; font-weight: 400; }
.preset:hover { background: var(--surface-3); }
.preset:has(input:checked) { background: var(--primary-soft); }
.preset input { margin: 4px 0 0; accent-color: var(--primary); flex-shrink: 0; }
.preset-body strong { display: block; margin-bottom: 2px; font-size: 14px; }
.preset-body .row-sub { font-size: 12.5px; }
@media (max-width: 760px) { .preset-grid { grid-template-columns: 1fr; } .member-row { flex-wrap: wrap; } .member-actions { width: 100%; justify-content: flex-end; } }
/* workspace hub */
.ws-mark { width: 46px; height: 46px; border-radius: 14px; font-size: 1.1rem; background: var(--primary-soft); color: var(--primary-soft-text); }
.hub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: var(--space); }
.hub-tile { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--surface); color: inherit; text-decoration: none; transition: background .15s, transform .15s; }
.hub-tile:hover { background: var(--primary-soft); text-decoration: none; transform: translateY(-1px); }
.hub-icon { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--primary); flex-shrink: 0; }
.hub-tile:hover .hub-icon { background: var(--surface); }
.hub-icon .icon { width: 18px; height: 18px; vertical-align: 0; }
.hub-body { flex: 1; min-width: 0; display: grid; }
.hub-title { font-weight: 700; font-size: 14.5px; }
.hub-sub { color: var(--muted); font-size: 12.5px; }
.hub-count { font-weight: 700; color: var(--muted); padding: 2px 10px; border-radius: 999px; background: var(--surface-3); }
.card-head-action { margin-left: auto; }
.card.quiet { background: transparent; padding: 12px 24px; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.split form { margin: 0; }
.danger-text, .danger-text .icon { color: var(--danger); }
@media (max-width: 760px) { .hub { grid-template-columns: 1fr; } }
/* apps page */
.answer-files .file-chip.chat-only { position: relative; }
.answer-files .file-chip-keep { margin: 0; display: flex; align-items: center; }
.answer-files .file-chip-keep .icon-btn { opacity: .7; }
.answer-files .file-chip-keep .icon-btn:hover { opacity: 1; }
.app-row .hub-icon { flex: none; }
.app-row .hub-icon .icon-brand, .app-mark .icon-brand { width: 22px; height: 22px; }
/* documents: the file mark turns into a checkbox on hover, the bar above the list moves the selection */
.lib-pick { position: relative; display: inline-flex; flex: none; cursor: pointer; margin: 0; }
.lib-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.lib-pick .lib-mark { transition: opacity .12s, transform .12s; }
.lib-pick .check-mark { position: absolute; inset: 0; border-radius: 12px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--primary-text); opacity: 0; transform: scale(.85); transition: opacity .12s, transform .12s, background .12s; box-shadow: inset 0 0 0 1.5px rgba(7, 23, 51, .16); }
.lib-pick .check-mark .icon { width: 16px; height: 16px; vertical-align: 0; opacity: 0; transition: opacity .12s; }
.lib-pick:hover .lib-mark, .lib-pick input:checked ~ .lib-mark, .lib-pick input:focus-visible ~ .lib-mark { opacity: 0; transform: scale(.85); }
.lib-pick:hover .check-mark, .lib-pick input:checked ~ .check-mark, .lib-pick input:focus-visible ~ .check-mark { opacity: 1; transform: scale(1); }
.lib-pick input:checked ~ .check-mark { background: var(--primary); box-shadow: none; }
.lib-pick input:checked ~ .check-mark .icon { opacity: 1; }
.lib-row .lib-main { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.lib-row .lib-main:hover { text-decoration: none; }
.lib-row .lib-main .grow { min-width: 0; }
.lib-folder-mark { background: var(--primary-soft); color: var(--primary-soft-text); }
.lib-folder-mark .icon { width: 18px; height: 18px; vertical-align: 0; }
/* article version diff */
.diff { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.55; }
.diff span { display: block; padding: 1px 10px; border-radius: 6px; }
.diff-add { background: var(--success-soft); color: var(--success); }
.diff-del { background: var(--danger-soft); color: var(--danger); text-decoration: line-through; }
.diff-same { color: var(--muted); }
.diff-skip { color: var(--muted); font-style: italic; text-align: center; }
.lib-share-too { margin: 0; font-size: 13px; font-weight: 500; white-space: nowrap; }
.lib-bar select { width: auto; margin: 0; height: 34px; padding: 4px 34px 4px 12px; font-size: 13px; border-radius: 10px; }
.app-row.is-off .row-title, .app-row.is-off .hub-icon { opacity: .55; }
.app-mark { flex: none; width: 44px; height: 44px; }
.app-card .switch { margin-bottom: 20px; }
.app-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.app-head-text { flex: 1; min-width: 0; }
.app-head h2 { margin: 0 0 2px; font-size: 1.05rem; }
.app-card.is-off .app-grid { opacity: .6; }
.app-card .section-title { margin: 0 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.app-col .section-title + .field { margin-top: 0; }
.app-col .field { margin-bottom: 14px; }
.app-col .field label { margin-top: 0; }
.tool-list { display: grid; gap: 8px; margin-bottom: 20px; }
.tool-item { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); display: grid; gap: 2px; }
.tool-name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 600; }
.team-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.team-check { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); font-weight: 500; font-size: 13.5px; cursor: pointer; }
.team-check:has(input:checked) { background: var(--primary-soft); color: var(--primary-soft-text); }
.team-check input { width: 16px; height: 16px; }
.switch { display: inline-flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { width: 40px; height: 22px; border-radius: 999px; background: var(--surface-3); position: relative; transition: background .15s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .5; }
/* --- selects: designed dropdown where the browser allows it (Chrome's customizable select); native elsewhere --- */
@supports (appearance: base-select) {
  select:not([multiple]), select:not([multiple])::picker(select) { appearance: base-select; }
  select:not([multiple]) { display: inline-flex; align-items: center; gap: 8px; }
  select:not([multiple])::picker-icon { color: var(--muted); font-size: 11px; margin-left: auto; transition: transform .15s; }
  select:not([multiple]):open::picker-icon { transform: rotate(180deg); }
  select:not([multiple])::picker(select) { border: 0; border-radius: 14px; padding: 6px; margin-top: 6px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); min-width: anchor-size(width); max-height: 320px; overflow: auto; }
  select:not([multiple]) option { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
  select:not([multiple]) option:hover, select:not([multiple]) option:focus-visible { background: var(--surface-2); outline: none; }
  select:not([multiple]) option:checked { background: var(--primary-soft); color: var(--primary-soft-text); }
  select:not([multiple]) option::checkmark { order: 1; margin-left: auto; color: var(--primary); }
  select:not([multiple]) option:not(:checked)::checkmark { visibility: hidden; }
  select:not([multiple]) selectedcontent { display: inline-flex; align-items: center; }
  .composer-option select:not([multiple])::picker(select) { margin-top: 0; margin-bottom: 8px; min-width: 240px; }
  select:not([multiple]) option[data-sub] { flex-wrap: wrap; row-gap: 0; }
  select:not([multiple]) option[data-sub]::after { content: attr(data-sub); flex-basis: 100%; order: 2; font-size: 12px; font-weight: 400; color: var(--muted); }
  select:not([multiple]) option[data-sub]:checked::after { color: var(--primary-soft-text); opacity: .8; }
}
/* image lightbox */
dialog.lightbox { border: 0; padding: 0; background: transparent; width: fit-content; max-width: min(92vw, 1400px); max-height: 92vh; overflow: auto; border-radius: 14px; }
dialog.lightbox::backdrop { background: rgba(7, 23, 51, .7); }
dialog.lightbox img { display: block; width: auto; max-width: 100%; height: auto; border-radius: 14px; background: var(--surface); }  /* natural size, shrinks to the width cap, scrolls when tall */
.lightbox-close { position: fixed; top: 16px; right: 16px; width: 38px; height: 38px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: none; z-index: 2; }
.lightbox-close .icon { width: 16px; height: 16px; vertical-align: 0; }
.file-thumb { cursor: zoom-in; }
/* code blocks: header with language + copy, highlight.js tokens in the house palette */
.code-block { width: 100%; box-sizing: border-box; margin: 10px 0; border-radius: 12px; overflow: hidden; background: var(--surface); }  /* white on the chat canvas so the block stands out */
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; background: #cbd5e7; font-size: 12px; color: var(--muted); }
.code-lang { font-weight: 600; letter-spacing: .02em; }
.code-tools { display: inline-flex; gap: 2px; }
.code-tool { width: 28px; height: 26px; margin: 0; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; box-shadow: none; cursor: pointer; }
.code-tool:hover { background: rgba(7, 23, 51, .08); color: var(--text); }
.code-tool.done { color: #1f8a5b; }
.code-tool .icon { width: 15px; height: 15px; vertical-align: 0; }
.bubble-body pre code { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--text); background: none; padding: 0; }
.hljs-comment, .hljs-quote { color: #7a8599; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-doctag, .hljs-meta .hljs-keyword { color: #a626a4; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute { color: #1f8a5b; }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-link { color: #b25e09; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #1360ef; }
.hljs-title.class_, .hljs-type, .hljs-built_in { color: #c18401; }
.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-selector-attr, .hljs-selector-id, .hljs-selector-class, .hljs-property { color: #b03a2e; }
.hljs-name, .hljs-tag { color: #1360ef; }
.hljs-punctuation, .hljs-operator { color: var(--muted); }
.hljs-deletion { color: #d9363e; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hljs-keyword, :root:not([data-theme="light"]) .hljs-selector-tag, :root:not([data-theme="light"]) .hljs-literal { color: #d7a4ff; }
  :root:not([data-theme="light"]) .hljs-string, :root:not([data-theme="light"]) .hljs-attribute { color: #7fd4a6; }
  :root:not([data-theme="light"]) .hljs-number, :root:not([data-theme="light"]) .hljs-symbol { color: #f0b86a; }
  :root:not([data-theme="light"]) .hljs-title, :root:not([data-theme="light"]) .hljs-name, :root:not([data-theme="light"]) .hljs-tag { color: #8fb3ff; }
  :root:not([data-theme="light"]) .hljs-title.class_, :root:not([data-theme="light"]) .hljs-type, :root:not([data-theme="light"]) .hljs-built_in { color: #f3d27a; }
  :root:not([data-theme="light"]) .hljs-attr, :root:not([data-theme="light"]) .hljs-variable, :root:not([data-theme="light"]) .hljs-property { color: #ff9d8f; }
}
/* workspace logo + edit dialog */
img.ws-logo { object-fit: cover; background: var(--surface-2); }
.edit-pen { width: 30px; height: 30px; margin: 0; opacity: 0; transition: opacity .15s; }
.page-head-main:hover .edit-pen, .edit-pen:focus-visible { opacity: 1; }
@media (hover: none) { .edit-pen { opacity: 1; } }
dialog.modal label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; }
dialog.modal input[type="text"], dialog.modal input[type="email"], dialog.modal input[type="password"], dialog.modal input:not([type]) { width: 100%; box-sizing: border-box; }
dialog.modal .modal-foot { margin-top: 12px; text-align: center; }
dialog.modal .modal-foot .link { margin: 0; font-size: 13px; }
.logo-field { display: flex; gap: 14px; align-items: flex-start; margin-top: 16px; }
.logo-field .avatar-lg { width: 72px; height: 72px; border-radius: 16px; font-size: 1.6rem; }
.logo-field-body { min-width: 0; flex: 1; }
.logo-field-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.logo-field-actions .button { margin: 0; cursor: pointer; }
dialog.modal .logo-field-actions label.check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.logo-field p { margin: 10px 0 0; line-height: 1.45; }
/* document library */
.min0 { min-width: 0; }
.lib-title { overflow-wrap: anywhere; }
.lib-search { display: grid; gap: 12px; margin-bottom: 18px; }
.lib-search-box { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 14px; background: var(--surface); }
.lib-search-box .icon { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; vertical-align: 0; }
.lib-search-box input { flex: 1; margin: 0; padding: 13px 0; background: transparent; border: 0; box-shadow: none; font-size: 15px; }
.lib-search-box input:hover, .lib-search-box input:focus { outline: none; box-shadow: none; background: transparent; border-color: transparent; }
.lib-search-box:focus-within { box-shadow: 0 0 0 2px var(--primary-soft); }
.lib-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lib-filters select { margin: 0; width: auto; min-width: 150px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); }
.seg-item { padding: 6px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.seg-item:hover { color: var(--text); text-decoration: none; }
.seg-item.active { background: var(--surface); color: var(--text); }
.lib-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.lib-side { display: grid; gap: 2px; position: sticky; top: 16px; }
.lib-folder { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 13.5px; min-width: 0; }
.lib-folder > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-folder .icon { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; vertical-align: 0; }
.lib-folder:hover { background: var(--surface); text-decoration: none; }
.lib-folder.active { background: var(--primary-soft); color: var(--primary-soft-text); }
.lib-folder.active .icon { color: var(--primary); }
.lib-folder .count { font-size: 12px; color: var(--muted); }
.lib-side-title { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 10px 6px; }
.lib-side-title .icon { width: 13px; height: 13px; vertical-align: 0; }
.lib-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 6px; }
.lib-tags .lib-side-title { flex-basis: 100%; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { display: inline-flex; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none; }
.tag:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.tag.active { background: var(--primary-soft); color: var(--primary-soft-text); }
.lib-crumb { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; }
.lib-crumb .icon { width: 16px; height: 16px; color: var(--muted); vertical-align: 0; }
.lib-crumb form { margin: 0 0 0 auto; }
.lib-crumb .ghost { margin: 0; }
.lib-result-line { margin: 0 0 10px; }
.lib-row { align-items: center; }
.lib-mark { padding: 0; background: transparent; }
.lib-mark .file-icon { width: 40px; height: 40px; border-radius: 11px; }
.lib-mark .file-thumb { width: 40px; height: 40px; border-radius: 11px; }
.row-snippet { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.row-sub .icon { width: 12px; height: 12px; vertical-align: -1px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }
.pager .button { margin: 0; }
.lib-preview { padding: 0; overflow: hidden; }
.lib-preview-image { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto; }
.lib-preview-pdf { display: block; width: 100%; height: 78vh; border: 0; background: var(--surface-2); }
.lib-preview-text { padding: 24px; }
.lib-preview-pre { margin: 0; padding: 0 24px 24px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.6; max-height: 70vh; overflow: auto; }
.lib-preview .card-head { padding: 20px 24px 8px; }
.lib-preview .empty, .lib-preview > p { padding: 20px 24px; margin: 0; }
.lib-danger .card-head .icon { color: #d9363e; }
.share-fields { border: 0; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.share-fields legend { font-size: 13px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.share-fields .check { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; }
.share-team select { margin: 0; }
dialog.modal input[type="file"] { width: 100%; box-sizing: border-box; }
@media (max-width: 760px) {
  .lib-layout { grid-template-columns: 1fr; }
  .lib-side { position: static; grid-template-columns: 1fr 1fr; }
  .lib-tags { grid-column: 1 / -1; }
  .lib-preview-pdf { height: 60vh; }
}
/* memory section on the account page */
.memory-toggle { margin: 0; }
.memory-row { padding: 10px 14px; }
.memory-text { display: block; font-size: 14px; }
.memory-row form { margin: 0; }
.memory-rows + .actions { margin-top: 12px; }
.icon-btn.danger-icon { color: #d9363e; }
.icon-btn.danger-icon:hover { background: var(--danger-soft, #fde8e8); color: #b42318; }
.memory-row .icon-btn { width: 32px; height: 32px; border-radius: 9px; background: var(--surface); }
.memory-row .icon-btn .icon { width: 16px; height: 16px; }
.memory-row .icon-btn:hover { background: #fde8e8; }
/* artifacts */
.artifact-cards { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 4px; }
.artifact-card { display: inline-flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; min-width: 240px; max-width: 100%; border-radius: 14px; background: var(--surface); color: inherit; text-decoration: none; transition: background .15s, transform .15s; }
.artifact-card:hover { background: var(--primary-soft); text-decoration: none; transform: translateY(-1px); }
.artifact-card > .icon { width: 16px; height: 16px; color: var(--muted); margin-left: auto; vertical-align: 0; }
.artifact-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.artifact-icon .icon { width: 20px; height: 20px; vertical-align: 0; }
.artifact-icon.lg { width: 46px; height: 46px; border-radius: 14px; }
.artifact-text { display: grid; min-width: 0; line-height: 1.3; }
.artifact-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artifact-sub { font-size: 12px; color: var(--muted); }
.artifact-stage { padding: 0; overflow: hidden; }
.artifact-frame { display: block; width: 100%; height: calc(100vh - 220px); min-height: 420px; border: 0; background: #fff; }
.artifact-doc { padding: 28px 32px; }
.artifact-code { padding: 0; }
.artifact-code pre { border-radius: 0; margin: 0; padding: 20px 24px; max-height: calc(100vh - 220px); }
.kind-web .file-icon { background: #ece6fe; color: #6a3df0; }
.kind-code .file-icon { background: #e4f1f8; color: #0b7285; }
/* artifact side panel in the chat */
.chat { display: flex; flex-direction: row; align-items: stretch; min-height: calc(100vh - 44px); }
.chat .chat-main { flex: 1 1 auto; min-width: 0; }
.artifact-panel { flex: 0 0 min(50%, 820px); position: sticky; top: 0; align-self: flex-start; height: 100vh; display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-md); overflow: hidden; z-index: 3; margin-bottom: -44px; }  /* reaches the bottom edge over the footer strip without stretching the conversation column */
body.panel-open .footer { margin-right: min(50%, 820px); }  /* the footer keeps to the conversation column */
.artifact-panel[hidden] { display: none; }
.chat.panel-open .chat-main { max-width: none; padding-left: 24px; padding-right: 24px; }
.artifact-panel-head { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 14px; min-height: 44px; background: var(--surface-2); flex-wrap: wrap; }
.artifact-panel-head .artifact-icon { width: 28px; height: 28px; border-radius: 8px; }
.artifact-panel-head .artifact-icon .icon { width: 15px; height: 15px; }
.artifact-panel-title { flex: 1 1 160px; }
.artifact-panel-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.artifact-panel-title h2 { margin: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artifact-panel-title .small { white-space: nowrap; }
.artifact-panel-tools { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.artifact-panel-tools .icon-btn.small { width: 30px; height: 30px; border-radius: 8px; background: transparent; margin: 0; }
.artifact-panel-tools .icon-btn.small:hover { background: var(--surface); }
.artifact-panel-tools .icon-btn .icon { width: 16px; height: 16px; }
.artifact-panel-tools .seg { margin-right: 6px; }
.artifact-panel-body { flex: 1; min-height: 0; overflow: auto; background: #fff; }
.artifact-panel-body .artifact-frame { height: 100%; min-height: 0; }
.artifact-panel-body .artifact-doc { padding: 24px 28px; }
.artifact-panel-body .artifact-code pre { max-height: none; }
.artifact-card.active { background: var(--primary-soft); }
@media (max-width: 960px) {
  .artifact-panel { position: fixed; inset: 0 0 44px 0; height: auto; border-radius: 0; z-index: 30; flex-basis: auto; }
}
.artifact-panel-body .code-block, .artifact-panel-body .code-block pre, .artifact-panel-body .artifact-code pre { border-radius: 0; margin: 0; }
/* articles */
.article-body { padding: 28px 36px; }
.article-body .bubble-body { font-size: 15px; line-height: 1.65; }
.article-editor { margin: 0; }
.article-title-input { width: 100%; font-size: 1.35rem; font-weight: 700; padding: 8px 12px; background: var(--surface); }
.article-note { width: 220px; margin: 0; }
.page-actions select { width: auto; margin: 0; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
.editor-pane { margin: 0; padding: 0; min-height: calc(100vh - 220px); display: flex; flex-direction: column; }
.article-textarea { flex: 1; width: 100%; min-height: calc(100vh - 220px); margin: 0; padding: 22px 24px; border: 0; border-radius: var(--radius-lg); background: var(--surface); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.6; resize: vertical; box-shadow: none; }
.article-textarea:focus { box-shadow: none; border: 0; background: var(--surface); }
.preview-pane .card-head { padding: 14px 24px 0; }
.preview-pane .bubble-body { padding: 8px 24px 24px; overflow: auto; }
.menu-form { margin: 0; }
.menu-form .menu-item { width: 100%; }
@media (max-width: 900px) { .editor-grid { grid-template-columns: 1fr; } .editor-pane, .article-textarea { min-height: 50vh; } }
.article-editor .page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.article-editor .page-actions button { margin: 0; white-space: nowrap; }
.editor-pane .article-textarea { background: var(--surface); }
.knowledge-card { padding: 18px 24px; }
.knowledge-card .hint { margin: 6px 0 0; }
.pill .icon { width: 13px; height: 13px; vertical-align: -2px; }
.answer-files { margin: 8px 0 4px; }
/* library: flat folders, breadcrumb with a folder menu */
.lib-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.crumb { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; background: transparent; border: 0; cursor: pointer; margin: 0; box-shadow: none; }
.crumb:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.crumb .icon { width: 15px; height: 15px; vertical-align: 0; }
.crumb-current { color: var(--text); background: var(--surface); }
.crumb-sep .icon { width: 14px; height: 14px; color: var(--muted); vertical-align: -2px; }
.crumb-menu { position: relative; }
.crumb-panel { min-width: 260px; }
.crumb-panel .menu-item.active { background: var(--primary-soft); color: var(--primary-soft-text); }
.crumb-panel .menu-item .grow { flex: 1; min-width: 0; }
.menu-count { margin-left: auto; font-size: 12px; color: var(--muted); }
.lib-tags-inline { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 10px; }
.ocr-box { padding: 14px 24px 18px; }
.ocr-box .icon { width: 14px; height: 14px; vertical-align: -2px; }
.ocr-box .inline-form { display: inline; margin: 0 0 0 10px; }
.ocr-box .inline-form .button { margin: 0; }
.ocr-text summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); }
.ocr-text pre { padding: 12px 0 0; }
/* compact selects in filter rows: same height as the folder crumb and segment buttons */
.lib-filters select, .page-actions select { height: 34px; padding: 4px 34px 4px 12px; font-size: 13px; line-height: 1.2; border-radius: 10px; }
/* share dialog: scope + people */
.share-modal { width: min(520px, calc(100vw - 32px)); }
.share-pending { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.share-pending .inline-form { margin: 0 0 0 auto; }
.share-people { margin-top: 18px; padding-top: 16px; background: linear-gradient(var(--surface-3), var(--surface-3)) top / 100% 1px no-repeat; }
.share-people h3 { display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 0 0 4px; }
.share-people h3 .icon { width: 15px; height: 15px; }
.grant-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 6px; }
.grant-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); }
.grant-row .avatar { width: 28px; height: 28px; font-size: 12px; }
.grant-row form { margin: 0; }
.icon-btn.small-btn { width: 30px; height: 30px; border-radius: 8px; background: var(--surface); }
.grant-form { display: grid; grid-template-columns: 1fr auto auto auto; gap: 6px; align-items: center; margin-top: 8px; }
.grant-form select { margin: 0; height: 34px; padding: 4px 30px 4px 10px; font-size: 13px; }
.grant-form .button { margin: 0; height: 34px; }
.share-waiting { display: flex; align-items: center; gap: 8px; text-decoration: none; margin-bottom: 16px; }
.decide-card .modal-actions { justify-content: flex-start; }
.decision-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
@media (max-width: 560px) { .grant-form { grid-template-columns: 1fr 1fr; } }
.share-transfer { margin-top: 14px; }
.share-transfer summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.share-transfer summary .icon { width: 14px; height: 14px; }
.transfer-form { grid-template-columns: 1fr auto; }
.transfer-panel { min-width: 280px; padding: 12px; }
.transfer-all { display: grid; gap: 8px; margin: 0; }
.transfer-all select { margin: 0; height: 34px; padding: 4px 30px 4px 10px; font-size: 13px; }
.transfer-all p { margin: 0; }
/* classification badges */
.pill.class-confidential { background: #fff0dc; color: #b25e09; }
.pill.class-restricted { background: #fde8e8; color: #b42318; }
.pill.class-public { background: #e4f5ec; color: #1f8a5b; }
.pill.class-confidential .icon, .pill.class-restricted .icon { width: 12px; height: 12px; vertical-align: -1px; }
.classify-form { margin: 0; }
.classify-form select { width: auto; height: 34px; padding: 4px 30px 4px 10px; font-size: 13px; margin: 0; }
.retention-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 0; }
.retention-form label { margin: 0; font-size: 13px; }
.retention-form input[type="date"] { width: auto; height: 34px; padding: 4px 10px; margin: 0; }
.retention-form .button { margin: 0; }
.retention-card .hint { margin: 10px 0 0; }
.lib-danger .msg { margin: 0 0 10px; }
.retention-form .check { flex-basis: 100%; display: flex; align-items: center; gap: 8px; font-weight: 500; }
/* form dialogs: explanations stay short and foldable */
.form-modal { width: min(520px, calc(100vw - 32px)); }
.form-modal .check-card { margin-top: 12px; }
.form-modal .muted.small { line-height: 1.5; }
.modal-help { margin-top: 12px; font-size: 13px; }
.modal-help summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.role-help { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; color: var(--text); }
.form-modal .invites { margin-top: 10px; }
dialog.modal label.check-card { display: flex; align-items: flex-start; gap: 12px; font-weight: 400; margin: 12px 0 0; }
dialog.modal label.check-card strong { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
dialog.modal label.check-card .icon { width: 15px; height: 15px; }
/* tasks */
.task-modal { width: min(600px, calc(100vw - 32px)); }
.task-steps { display: grid; gap: 8px; margin-top: 14px; }
.task-step { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: start; }
.task-step-no { width: 26px; height: 26px; margin-top: 8px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-soft-text); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.task-step textarea { margin: 0; min-height: 56px; resize: vertical; font-size: 13.5px; }
.task-step .icon-btn { margin-top: 6px; }
.task-steps > .button { justify-self: start; margin: 0; }
.task-when { display: flex; gap: 8px; flex-wrap: wrap; }
.task-when select, .task-when input { width: auto; margin: 0; height: 36px; padding: 4px 10px; }
.task-when select { padding-right: 30px; }
.task-when input[type="number"] { width: 80px; }
.task-when input[name="cron"] { width: 160px; font-family: ui-monospace, monospace; }
.task-preview { margin: 6px 0 0; min-height: 18px; }
.task-preview.error { color: #b42318; }
.task-deliver { margin-top: 14px; display: grid; gap: 6px; }
.task-deliver .check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; margin: 0; }
.task-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.task-grid .card { margin: 0 0 var(--space); }
.task-step-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 14px; line-height: 1.5; }
.task-upcoming { margin: 0 0 10px; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.task-empty { text-align: left; }
.task-empty ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; }
.run-row { gap: 12px; }
.run-row .button { margin: 0; }
.confirm-card .hint { margin: 6px 0 12px; }
.page-actions .inline-form { margin: 0; }
@media (max-width: 860px) { .task-grid { grid-template-columns: 1fr; } }
.chat-list-kind { display: inline-flex; vertical-align: -2px; margin-right: 5px; color: var(--primary); }
.chat-list-kind .icon { width: 13px; height: 13px; }
.task-latest .card-head .push { margin-left: auto; }
.task-latest .bubble-body { font-size: 14px; line-height: 1.6; }
.run-list { gap: 4px; }
.run-item > summary { list-style: none; cursor: pointer; }
.run-item > summary::-webkit-details-marker { display: none; }
.run-item > summary > .icon { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; flex: none; }
.run-item[open] > summary > .icon { transform: rotate(180deg); }
.run-body { padding: 10px 14px 14px; }
.run-body .bubble-body { font-size: 14px; line-height: 1.6; }
.run-open { margin: 10px 0 0; }
.run-outputs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.long-note { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; line-height: 1.45; box-sizing: border-box; }
.long-note > .icon { width: 16px; height: 16px; flex: none; color: var(--primary); }
.long-note p { margin: 0; }
.long-note .muted { display: block; font-size: 12px; margin-top: 2px; }
.long-note.over { background: var(--warning-soft); }
.long-note.over > .icon { color: var(--warning); }
.long-note .button { flex: none; }
.carryover { margin: 0 0 18px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13px; }
.carryover p { margin: 0; display: flex; gap: 8px; align-items: baseline; }
.carryover p .icon { width: 14px; height: 14px; flex: none; color: var(--primary); position: relative; top: 2px; }
.carryover details { margin-top: 8px; }
.carryover summary { cursor: pointer; font-weight: 600; }
.carryover .bubble-body { margin-top: 8px; font-size: 13.5px; }
dialog.modal textarea[name=summary] { width: 100%; box-sizing: border-box; margin-top: 4px; font-size: 13px; line-height: 1.5; }
dialog.modal.wide { width: min(640px, calc(100vw - 32px)); }
button:disabled, .button[disabled] { opacity: .5; cursor: not-allowed; }
/* a form on its way: the submit button keeps its label, shows a small ring and cannot be clicked again (forms.js) */
button[aria-busy="true"], .button[aria-busy="true"] { opacity: .75; cursor: progress; position: relative; }
button[aria-busy="true"]::before { content: ""; width: 12px; height: 12px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.continue-points { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 10px; }
.continue-points li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.continue-points .icon { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--primary); }
.continue-status { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 13.5px; color: var(--muted); }
.continue-thoughts { max-height: 160px; overflow: auto; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; }
.continue-note { max-height: 46vh; overflow: auto; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; line-height: 1.55; }
.continue-note h2 { font-size: 14px; margin: 12px 0 4px; }
.continue-ready-hint { margin: 2px 0 8px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.task-cards { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.task-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: 14px; background: var(--surface); max-width: 640px; }
.task-card-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.task-card-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-card-when { font-size: 12.5px; color: var(--muted); }
.task-card-state { display: flex; align-items: center; gap: 8px; flex: none; }
.notif-page .page-actions .button { background: var(--surface); }
.notif-page .page-actions .button .icon { width: 16px; height: 16px; vertical-align: 0; color: var(--muted); }
.notif-group { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 4px 4px; }
.notif-list > .notif-group:first-child { margin-top: 0; }
.row.notif { position: relative; align-items: flex-start; padding: 12px 14px; gap: 12px; transition: background .15s, opacity .18s, transform .18s; }
.row.notif .avatar { width: 34px; height: 34px; }
.row.notif .avatar .icon { width: 17px; height: 17px; }
.row.notif .notif-main { display: flex; flex-direction: column; min-width: 0; color: inherit; text-decoration: none; padding-top: 1px; }
.row.notif .notif-main:hover { text-decoration: none; }
.row.notif .row-title { font-weight: 600; line-height: 1.35; }
.row.notif.unread .row-title { font-weight: 700; }
.row.notif .row-sub { margin-top: 2px; }
.row.notif .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; opacity: 0; margin-top: 13px; }
.row.notif.unread .unread-dot { opacity: 1; }
.notif-actions { display: flex; gap: 4px; flex: none; opacity: 0; transition: opacity .15s; margin-top: 1px; }
.notif-actions .icon-btn.small { width: 32px; height: 32px; border-radius: 9px; }
.row.notif:hover .notif-actions, .row.notif:focus-within .notif-actions { opacity: 1; }
/* the row icon is the checkbox: hover (or a selected row) swaps the icon for the mark */
.notif-pick { position: relative; display: inline-flex; width: 34px; height: 34px; flex: none; cursor: pointer; margin: 0; }
.notif-pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.notif-pick .notif-icon { transition: opacity .12s, transform .12s; }
.notif-pick .check-mark { position: absolute; inset: 0; width: 34px; height: 34px; border-radius: 12px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--primary-text); opacity: 0; transform: scale(.85); transition: opacity .12s, transform .12s, background .12s; box-shadow: inset 0 0 0 1.5px rgba(7, 23, 51, .16); }
.notif-pick .check-mark .icon { width: 16px; height: 16px; vertical-align: 0; opacity: 0; transition: opacity .12s; }
.notif-pick:hover .notif-icon, .notif-pick input:checked ~ .notif-icon, .notif-pick input:focus-visible ~ .notif-icon { opacity: 0; transform: scale(.85); }
.notif-pick:hover .check-mark, .notif-pick input:checked ~ .check-mark, .notif-pick input:focus-visible ~ .check-mark { opacity: 1; transform: scale(1); }
.notif-pick input:checked ~ .check-mark { background: var(--primary); box-shadow: none; }
.notif-pick input:checked ~ .check-mark .icon { opacity: 1; }
.notif-pick input:focus-visible ~ .check-mark { outline: 2px solid var(--primary); outline-offset: 2px; }
.row.notif:has([data-select]:checked) { background: var(--primary-soft); }
.danger-text { color: var(--danger); }
/* custom checkbox: the native input stays for the keyboard and screen readers; the mark is drawn */
.check-box { position: relative; display: inline-flex; width: 18px; height: 18px; flex: none; cursor: pointer; }
.check-box input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.check-box .check-mark { width: 18px; height: 18px; border-radius: 6px; background: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; color: var(--primary-text); transition: background .12s, transform .12s; }
.check-box .check-mark .icon { width: 12px; height: 12px; vertical-align: 0; opacity: 0; transform: scale(.6); transition: opacity .12s, transform .12s; }
.check-box input:checked + .check-mark, .check-box input:indeterminate + .check-mark { background: var(--primary); box-shadow: none; }
.check-box input:indeterminate + .check-mark::after { content: ""; width: 8px; height: 2px; border-radius: 1px; background: var(--primary-text); }
.check-box input:indeterminate + .check-mark .icon { display: none; }
.check-box input:checked + .check-mark .icon { opacity: 1; transform: scale(1); }
.check-box input:focus-visible + .check-mark { outline: 2px solid var(--primary); outline-offset: 2px; }
.check-box input:not(:checked) + .check-mark { box-shadow: inset 0 0 0 1.5px rgba(7, 23, 51, .16); }
.bulk-bar .check-box input:not(:checked) + .check-mark { background: var(--surface); }
.bulk-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 0 0 12px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-soft-text); font-size: 13px; }
.bulk-bar .check-inline { display: inline-flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; font-weight: 600; line-height: 18px; }
.bulk-bar .bulk-count { color: inherit; opacity: .8; line-height: 18px; }
.bulk-bar .button:disabled { opacity: .45; cursor: default; box-shadow: none; }
.bulk-bar .button.small { background: var(--surface); color: var(--text); padding: 7px 12px; }
.bulk-bar .button.small.danger-text { color: var(--danger); }
.bulk-bar .button.small .icon { width: 15px; height: 15px; vertical-align: 0; }
.bulk-bar .ghost.small { color: inherit; }
.bulk-bar .button:disabled { opacity: .45; cursor: default; }
.row.notif.entering { opacity: 0; transform: translateY(-8px); }
.row.notif.leaving { opacity: 0; transform: translateX(16px); }


/* Budgets: today's tokens, task minutes and storage (account page, usage page) */
.meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.meter { background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 8px; }
.meter-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.meter-label { color: var(--muted); }
.meter-text { font-weight: 700; white-space: nowrap; }
.meter-note { color: var(--muted); font-size: 12px; }
.meter-bar { width: 100%; height: 6px; border: 0; border-radius: 999px; background: var(--surface-3); overflow: hidden; -webkit-appearance: none; appearance: none; }
.meter-bar::-webkit-progress-bar { background: var(--surface-3); border-radius: 999px; }
.meter-bar::-webkit-progress-value { background: var(--primary); border-radius: 999px; transition: width .4s; }
.meter-bar::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
.meter.is-full .meter-text { color: var(--danger); }
.meter.is-full .meter-bar::-webkit-progress-value { background: var(--danger); }
.meter.is-full .meter-bar::-moz-progress-bar { background: var(--danger); }
.meters + .hub { margin-top: 16px; margin-bottom: 0; }
.app-grid.single { grid-template-columns: 1fr; }
@media (max-width: 720px) { .meters { grid-template-columns: 1fr; } }

/* Notifications: the Web Push strip above the list */
.push-box { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 12px; border-radius: 14px; background: var(--surface-2); }
.push-box .row-title { display: block; font-weight: 600; }
.push-box .row-sub { display: block; color: var(--muted); font-size: 13px; }
