/* Accure design system (accure-0002): the look of every page. Tokens here only; base.css keeps the structure.
   Dark first; group cards are outlined; buttons are filled pills (primary = ink); blue only for links, toggles, focus. */

/* ==== Tokens ======================================================================================================= */

:root {
  /* Type: system UI faces (SF Pro on Apple, Segoe UI on Windows). Scale from OpenAI: 12/16, 13/18, 14/20, 16/24, 18/28. */
  --font: ui-sans-serif, -apple-system, system-ui, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --t-xs: 12px; --t-sm: 13px; --t-md: 14px; --t-lg: 16px; --t-xl: 18px; --t-h1: 26px;
  --fs-row: 14px; --fs-meta: 13px; --fs-small: 12px; --fs-sub: 12px; --fs-head: 15px; --fs-caption: 13px; --ic-row: 16px;
  /* Shape and space (4px grid). */
  --r-xs: 6px; --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --r-xl: 16px; --r-2xl: 20px; --r-full: 999px;
  --radius: var(--r-md); --radius-lg: var(--r-xl); --panel-radius: var(--r-xl);
  --sidebar: 260px; --header: 56px; --content: 920px;
  /* Motion (Framer-like): quick, eased out, transform and opacity only. */
  --ease: cubic-bezier(.22, 1, .36, 1); --fast: .12s; --mid: .18s;

  /* Light: off-white canvas, white raised layers, OpenAI's neutral grays. */
  /* OpenAI's two-tone shell: the page white, the sidebar a step darker; no line between them. */
  --surface-0: #fff;      /* canvas: the page */
  --surface-1: #f3f3f3;   /* fills: inputs, secondary buttons, hover */
  --surface-2: #e8e8e8;   /* stronger fill: the current item, hover on a fill */
  --surface-raised: #fff; /* popovers, dialogs, toasts */
  --side: #f9f9f9; --side-hover: rgb(0 0 0 / .045); --side-on: rgb(0 0 0 / .07);
  --card: #f9f9f9; --card-line: rgb(0 0 0 / .06);
  --composer: #fff; --composer-shadow: 0 0 0 1px rgb(0 0 0 / .06), 0 2px 8px rgb(0 0 0 / .05), 0 4px 40px 8px rgb(0 0 0 / .04);
  --border: rgb(0 0 0 / .1);
  --border-subtle: rgb(0 0 0 / .07);
  --border-strong: rgb(0 0 0 / .18);
  --text-1: #0d0d0d; --text-strong: #0d0d0d; --text-2: #5d5d5d; --text-3: #8f8f8f;
  --ink: #0d0d0d; --on-ink: #fff; --ink-hover: #303030;
  --blue: #2563eb; --blue-text: #1d4ed8; --blue-deep: #1e40af;
  --ok: #157f3b; --ok-bg: rgb(21 127 59 / .1);
  --warn: #a15c00; --warn-bg: rgb(214 140 0 / .13);
  --bad: #c22a1f; --bad-bg: rgb(194 42 31 / .09);
  --info-bg: rgb(37 99 235 / .08);
  --pop-shadow: 0 10px 30px rgb(0 0 0 / .1), 0 1px 3px rgb(0 0 0 / .08);
  --scrim: rgb(0 0 0 / .32);
  color-scheme: light;

  /* Names the module sheets use (accure-0001), mapped onto the tokens above. */
  --canvas: var(--surface-0); --base: var(--surface-raised); --elevated: var(--surface-0); --recessed: var(--surface-1);
  --tint: var(--surface-1); --fill: var(--surface-2); --panel: transparent; --panel-edge: none;
  --line: var(--border); --hairline: var(--border-subtle); --line-strong: var(--border-strong); --grid-line: var(--border-subtle);
  --text: var(--text-1); --strong: var(--text-strong); --subtle: var(--text-2); --placeholder: var(--text-3);
  --success: var(--ok); --success-tint: var(--ok-bg); --good: var(--ok);
  --danger: var(--bad); --danger-tint: var(--bad-bg);
  --warning: var(--warn); --warning-tint: var(--warn-bg);
  --info-tint: var(--info-bg); --banner-info: var(--info-bg);
  --brand: var(--blue); --brand-hover: var(--blue-text); --accent: var(--blue); --brand-mark: var(--blue); --link: var(--blue-text);
  --brand-ink: #fff; --brand-tint: color-mix(in srgb, var(--blue) 10%, transparent); --brand-tint-2: color-mix(in srgb, var(--blue) 20%, transparent);
  --btn: var(--ink); --btn-hover: var(--ink-hover); --btn-edge: var(--ink); --btn-text: var(--on-ink);
  --primary: var(--ink); --on-primary: var(--on-ink); --primary-hover: var(--ink-hover);
  --ring: color-mix(in srgb, var(--blue) 22%, transparent); --focus: var(--blue);
  --shadow: 0 1px 2px rgb(0 0 0 / .06); --lp-shadow: var(--pop-shadow);
}
:root[data-theme="dark"] {
  --surface-0: #212121; --surface-1: #2f2f2f; --surface-2: #3a3a3a; --surface-raised: #353535;
  --side: #181818; --side-hover: rgb(255 255 255 / .05); --side-on: rgb(255 255 255 / .09);
  --card: #262626; --card-line: rgb(255 255 255 / .06);
  --composer: #303030; --composer-shadow: inset 0 0 1px rgb(255 255 255 / .2), 0 8px 32px rgb(0 0 0 / .35);
  --border: rgb(255 255 255 / .12); --border-subtle: rgb(255 255 255 / .07); --border-strong: rgb(255 255 255 / .2);
  --text-1: #ececec; --text-strong: #fff; --text-2: #b4b4b4; --text-3: #8f8f8f;
  --ink: #ececec; --on-ink: #0d0d0d; --ink-hover: #d4d4d4;
  --blue: #4f8dff; --blue-text: #8db4ff;
  --ok: #4ade80; --ok-bg: rgb(74 222 128 / .12); --warn: #fbbf24; --warn-bg: rgb(251 191 36 / .12);
  --bad: #f87171; --bad-bg: rgb(248 113 113 / .12); --info-bg: rgb(79 141 255 / .1);
  --pop-shadow: 0 12px 34px rgb(0 0 0 / .55), 0 0 0 1px rgb(255 255 255 / .06);
  --scrim: rgb(0 0 0 / .6); --brand-ink: #04122e;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --surface-0: #212121; --surface-1: #2f2f2f; --surface-2: #3a3a3a; --surface-raised: #353535;
  --side: #181818; --side-hover: rgb(255 255 255 / .05); --side-on: rgb(255 255 255 / .09);
  --card: #262626; --card-line: rgb(255 255 255 / .06);
  --composer: #303030; --composer-shadow: inset 0 0 1px rgb(255 255 255 / .2), 0 8px 32px rgb(0 0 0 / .35);
  --border: rgb(255 255 255 / .12); --border-subtle: rgb(255 255 255 / .07); --border-strong: rgb(255 255 255 / .2);
  --text-1: #ececec; --text-strong: #fff; --text-2: #b4b4b4; --text-3: #8f8f8f;
  --ink: #ececec; --on-ink: #0d0d0d; --ink-hover: #d4d4d4;
  --blue: #4f8dff; --blue-text: #8db4ff;
  --ok: #4ade80; --ok-bg: rgb(74 222 128 / .12); --warn: #fbbf24; --warn-bg: rgb(251 191 36 / .12);
  --bad: #f87171; --bad-bg: rgb(248 113 113 / .12); --info-bg: rgb(79 141 255 / .1);
  --pop-shadow: 0 12px 34px rgb(0 0 0 / .55), 0 0 0 1px rgb(255 255 255 / .06);
  --scrim: rgb(0 0 0 / .6); --brand-ink: #04122e;
  color-scheme: dark;
} }

/* ==== Base ========================================================================================================= */

body { background: var(--canvas); color: var(--text); font: var(--t-md)/1.45 var(--font); letter-spacing: -.003em; font-feature-settings: normal; }
::selection { background: color-mix(in srgb, var(--blue) 28%, transparent); }
a { color: var(--link); }
h1 { font-size: var(--t-h1); line-height: 1.25; font-weight: 650; letter-spacing: -.022em; color: var(--strong); }
h2 { font-size: var(--t-lg); line-height: 1.4; font-weight: 500; letter-spacing: -.005em; color: var(--strong); }
h3 { font-size: var(--t-md); font-weight: 600; color: var(--strong); }
code { background: var(--tint); border: 0; border-radius: var(--r-xs); }
pre, .output, .secret { background: var(--tint); border: 0; border-radius: var(--r-md); }
hr { border-top-color: var(--line); }
/* Focus: one 2px outline on keyboard focus, never a doubled ring, never inside a field. */
body :is(button, a, summary, .headpill, .headsearch, .orgswitch-btn, [tabindex]):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; box-shadow: none; }
body :is(input, select, textarea):focus-visible { outline: none; }
#view:focus, #view:focus-visible, .pagehead h1:focus-visible { outline: none; }

/* ==== Shell ======================================================================================================== */

/* Header: phones and narrow windows only (sidebar.js hides it on wide screens). */
body.app header.top { background: var(--canvas); border-bottom: 1px solid var(--line); gap: 4px; padding: 0 12px 0 16px; }
body.app .head-left { justify-content: space-between; gap: 8px; border-inline-end-color: var(--line); padding-inline-end: 8px; }
body.app .head-left .brand { padding-inline-start: 4px; }
body.app .head-left .headsearch { width: 32px; height: 32px; padding: 0; justify-content: center; border: 0; border-radius: var(--r-sm); background: none; color: var(--subtle); cursor: pointer; flex: none; }
body.app .head-left .headsearch:hover { background: var(--tint); color: var(--strong); }
body.app .head-left .headsearch .ic { width: 17px; height: 17px; }
body.app .head-left .headsearch :is(span, kbd) { display: none; }
body.app .head-tools:empty { display: none; }
body.app .toplink { height: 34px; padding: 0 12px; border-radius: var(--r-full); color: var(--text); font-weight: 500; font-size: var(--t-sm); }
body.app .toplink:hover, body.app button.toplink[aria-expanded="true"] { background: var(--tint); }
body.app .toplink .ic { color: var(--subtle); }
body.app .toplink kbd { margin-inline-start: 2px; border: 0; background: var(--fill); color: var(--subtle); }
body.app .complete-setup, body.app .complete-setup .ic { color: var(--link); }
/* Rarely used tools are icons with a tooltip; the label stays for screen readers. */
body.app :is(.redo-intro, .support-top) { width: 34px; padding: 0; justify-content: center; }
body.app :is(.redo-intro, .support-top) > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.app .iconbtn { border-radius: var(--r-full); color: var(--subtle); }
body.app .iconbtn:hover, body.app .iconbtn.on, body.app .iconbtn[aria-expanded="true"] { background: var(--tint); color: var(--strong); }
.user-initials { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--fill); color: var(--strong); font-size: 11.5px; font-weight: 600; letter-spacing: 0; flex: none; }
body.app .headpill { height: 32px; border: 0; border-radius: var(--r-full); background: var(--tint); color: var(--text); font-weight: 500; }
body.app .headpill:hover, body.app .headpill[aria-expanded="true"], body.app .headpill.previewing { border: 0; background: var(--fill); }
body.app .previewbar, body.app .impbar { background: var(--tint); }
@container app (max-width: 820px) { body.app .head-left { border-inline-end: 0; } }

/* Sidebar: quiet rounded rows; the current page or area on a soft fill. */
body.app nav.side { background: var(--side); border-inline-end: 0; padding: 10px 10px 12px; font-size: var(--fs-row); }
body.app :is(nav.side, .sidecol) { --tint: var(--side-hover); --fill: var(--side-on); }
body.app nav.side :is(button, .navlink, a.navitem, .navhead) { border-radius: 10px; }
body.app nav.side .ic { color: var(--text-2); }
body.app nav.side :is(button, .navlink, a.navitem):hover { background: var(--tint); }
body.app nav.side .navitem.active { background: var(--fill); box-shadow: none; color: var(--strong); font-weight: 500; }
body.app nav.side .navitem.active .ic { color: var(--strong); }
body.app .orgswitch-btn { height: 38px; border: 0 !important; background: transparent !important; border-radius: var(--r-md); font-weight: 500; }
body.app .orgswitch-btn:hover, body.app .orgswitch-btn[aria-expanded="true"] { background: var(--tint) !important; }
body.app nav.side .orgswitch { margin-bottom: 8px; }

/* Wide shell (sidebar.js, app column over 820px): */
.sidecol { display: contents; }
.side-top, .side-foot { display: none; }
body.wide-shell header.top { display: none; }
body.wide-shell .sidecol { display: flex; flex-direction: column; min-height: 0; height: 100%; background: var(--side); }
body.wide-shell nav.side { flex: 1; min-height: 0; height: auto; border: 0; padding: 2px 10px 10px; }
body.wide-shell .side-top { display: flex; align-items: center; justify-content: space-between; flex: none; height: 56px; padding: 0 8px 0 14px; }
body.wide-shell .side-top .head-left { width: auto; height: auto; padding: 0; margin: 0; border: 0; }
.side-icons { display: flex; align-items: center; }
body.wide-shell .side-icons .usermenu { display: inline-flex; }
body.wide-shell .side-icons :is(.iconbtn, .headsearch) { width: 32px; height: 32px; min-width: 32px; padding: 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--subtle); display: inline-grid; place-items: center; }
body.wide-shell .side-icons :is(.iconbtn, .headsearch):hover, body.wide-shell .side-icons .iconbtn[aria-expanded="true"] { background: var(--tint); color: var(--strong); }
body.wide-shell .side-icons .headsearch :is(span, kbd) { display: none; }
body.wide-shell .side-icons .ic { width: 17px; height: 17px; }
body.wide-shell .side-foot { display: flex; flex-direction: column; flex: none; gap: 2px; padding: 8px 10px 12px; }
body.wide-shell .side-foot :is(.toplink, .complete-setup) { width: 100%; height: 36px; justify-content: flex-start; gap: 10px; padding: 0 10px; border-radius: var(--r-md); }
body.wide-shell .side-foot #ask-ai kbd { margin-inline-start: auto; }
body.wide-shell .side-foot :is(.toplink, .complete-setup) > span { display: inline; } /* the header hid these labels on narrow app widths */
body.wide-shell .side-foot .complete-setup { background: var(--tint); }
body.wide-shell .side-foot #head-tools { display: flex; }
body.wide-shell .side-foot .headpill { width: 100%; justify-content: flex-start; height: 34px; padding: 0 10px; border-radius: var(--r-md); background: none; color: var(--subtle); }
body.wide-shell .side-foot .headpill:hover, body.wide-shell .side-foot .headpill[aria-expanded="true"] { background: var(--tint); color: var(--text); }
body.wide-shell .side-foot .headpill > .ic:last-child { margin-inline-start: auto; }
body.wide-shell .side-foot .usermenu { display: flex; align-items: center; gap: 2px; margin-top: 6px; }
body.wide-shell .side-foot #user-btn { flex: 1; min-width: 0; width: auto; height: 48px; display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 0 10px; border-radius: var(--r-lg); }
body.wide-shell .side-foot #user-btn:hover { background: var(--tint); }
.user-who { display: none; }
body.wide-shell .user-who { display: flex; flex-direction: column; min-width: 0; text-align: start; line-height: 1.3; }
body.wide-shell .user-who :is(b, small) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.wide-shell .user-who b { font-weight: 500; font-size: var(--t-sm); color: var(--strong); }
body.wide-shell .user-who small { font-size: var(--t-xs); color: var(--subtle); }
body.wide-shell .side-foot #redo-intro { flex: none; width: 32px; height: 32px; padding: 0; justify-content: center; color: var(--subtle); }
body.wide-shell .side-foot #redo-intro > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Areas are rows: no sub-lists or chevrons; "More" opens onto its areas. */
body.wide-shell nav.side .navareas > .navgroup:not([data-group="more"]) > .navitems { display: none; }
body.wide-shell nav.side .navareas > .navgroup:not([data-group="more"]) > .navhead .chev { display: none; }
body.wide-shell nav.side .navareas > .navgroup.has-active:not([data-group="more"]) > .navhead { background: var(--fill); color: var(--strong); font-weight: 500; }
body.wide-shell nav.side .navgroup[data-group="more"] .sub > :is(.navrow, a.navitem):not(.navmore) { display: none; }
body.wide-shell nav.side .navgroup[data-group="more"] .navmore { display: none; }
body.wide-shell nav.side .navgroup[data-group="more"] .sub { padding: 0; margin: 0; border: 0; }
body.wide-shell nav.side .navsublabel[data-area] { display: flex !important; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-md); font-size: inherit; color: var(--text); cursor: pointer; }
body.wide-shell nav.side .navsublabel[data-area] .ic { width: 16px; height: 16px; color: var(--subtle); }
body.wide-shell nav.side .navsublabel[data-area]:hover { background: var(--tint); }
body.wide-shell nav.side .navsublabel[data-area].on { background: var(--fill); color: var(--strong); font-weight: 500; }

/* ==== Page ========================================================================================================= */

body.app main#view { max-width: var(--content); padding: 36px 40px 96px; }
.pagehead { margin-bottom: 20px; }
.pagehead h1, #view > h1 { font-size: 28px; line-height: 1.25; font-weight: 500; letter-spacing: -.02em; color: var(--strong); }
.pagehead p, #view > h1 + p { color: var(--subtle); font-size: var(--t-md); }
.pagehead .actions { gap: 8px; }
main#view:has(.crumbs) .pagehead .pp-kicker { display: none; } /* the breadcrumbs already name the area */
.crumbs { font-size: var(--t-sm); }
.back { color: var(--subtle); font-size: var(--t-sm); }
.back:hover { color: var(--text); text-decoration: none; }
.sectionhead h2, .pp-sec h2 { font-size: var(--t-lg); }
/* Tabs: the current area's pages as quiet pills above the page; the breadcrumbs would say the same, so they step aside. */
.areatabs { display: flex; flex: none; gap: 2px; width: calc(100% - 80px); max-width: calc(var(--content) - 80px); margin: 0 auto; padding: 28px 0 0; overflow-x: auto; scrollbar-width: none; }
.areatabs::-webkit-scrollbar { display: none; }
.areatab { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 34px; padding: 0 14px; border-radius: var(--r-full); color: var(--subtle); white-space: nowrap; }
.areatab:first-child { margin-inline-start: -14px; }
.areatab:hover { color: var(--text); background: var(--tint); text-decoration: none; }
.areatab.on { color: var(--strong); background: var(--tint); font-weight: 500; }
/* Visually hidden, not removed: screen readers keep the breadcrumb trail (and its text stays findable). */
body.has-areatabs .crumbs { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.has-areatabs main#view { padding-top: 24px; }

/* ==== Surfaces ===================================================================================================== */

/* Group cards: transparent, a 1px outline on all four sides. */
body.app :is(.card, .tile, .stat, .kit-card, .kit-col, .settings-card, .brief-item, .pagerow, .banner, .pf-card, .ov-rec, .ov-promo, .ov-cols.two),
body.app main#view :is(.card, .tile, .stat) { background-color: var(--card); border: 1px solid var(--card-line); border-radius: 22px; box-shadow: none; }
body.app main#view .card :is(.card, .tile, .stat) { background-color: transparent; border-color: var(--line); }
.card > h2:first-child, .card > .sectionhead:first-child { margin-top: 0; }
/* Figures: one outlined group, cells split by 1px lines (MXO). Cells grow to fill each row, so a row never ends in a gap. */
body.app :is(.stats, .tiles) { display: flex; flex-wrap: wrap; gap: 10px; }
body.app :is(.stats, .tiles):empty { display: none; }
body.app :is(.stats > .stat, .tiles > *), body.app main#view :is(.stats > .stat, .tiles > *) { flex: 1 1 180px; margin: 0; padding: 18px 20px; }
body.app .stats > .stat.wide { flex-basis: 440px; }
body.app main#view .stats > .stat-link:hover { background: var(--tint); }
.stat-head { color: var(--subtle); font-size: var(--t-sm); }
.stat .stat-more { opacity: .4; transition: opacity var(--fast); } .stat:is(:hover, :focus-within) .stat-more { opacity: 1; }
.stat-value, .tile .value { font-size: 26px; font-weight: 500; letter-spacing: -.02em; color: var(--strong); font-variant-numeric: tabular-nums; }
/* Empty states: short and calm; inside a card the card is the frame. */
:is(.empty.quiet, .kit-empty), main :is(.pp-empty, .wk-empty, .pt-empty) { background: transparent; border-color: var(--line); border-radius: 22px; }
/* Empty states: a muted glyph, one short title, one line, one action. No icon tile, no tall box. */
body.app main .empty.quiet { padding: 28px 24px 26px; gap: 4px; }
body.app main .empty.quiet::before, body.app main .empty.quiet > .empty-ic::before, body.app main .empty.quiet > .empty-ic::after { display: none; }
body.app main .empty.quiet > .empty-ic { display: grid; place-items: center; width: auto; height: auto; margin: 0 0 6px; border: 0; background: none; box-shadow: none; color: var(--text-3); }
body.app main .empty.quiet > .empty-ic .ic { position: static; width: 22px; height: 22px; padding: 0; background: none; }
body.app main .empty.quiet b { font-size: var(--t-md); }
body.app main .empty.quiet p { font-size: var(--t-sm); margin-bottom: 12px; }
.kit-empty > .ic:first-child { background: var(--tint); }
/* Notes: a fill, no frame. */
.notice { background: var(--tint); border: 0; border-radius: 12px; padding: 12px 14px; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.good { background: var(--ok-bg); color: var(--ok); }
body .nudge, body .cta { background: var(--tint) !important; border: 0 !important; border-radius: var(--r-xl); }
details.card > summary, .recs > summary { color: var(--strong); }

/* ==== Lists and tables ============================================================================================= */

/* Rows: a title and a short muted line on the left, figures and one control on the right, inset hairlines between. */
.pp-row { padding: 12px 4px; gap: 12px; border-top-color: var(--hairline); }
a.pp-row:hover, button.pp-row:hover { background: var(--tint); border-radius: 12px; }
.pp-rt b { font-size: var(--t-md); }
.pp-rt small { font-size: var(--t-xs); }
/* Row actions (status, links, small buttons) wrap inside the row instead of running past the card on phones. */
.doc-meta { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; max-width: 100%; }
/* Tables: no tinted header row, hairlines between rows, a soft hover. */
table { font-size: var(--t-sm); }
thead th, body.app main#view thead th { background: transparent; color: var(--subtle); font-weight: 500; font-size: var(--t-xs); border-bottom: 1px solid var(--line); }
th, td { border-bottom-color: var(--hairline); }
tbody tr:hover td { background: var(--tint); }
body.app main#view :is(.card, .stat, .tile) > :is(table, .table-wrap) thead th:first-child { border-start-start-radius: 0; }

/* ==== Controls ===================================================================================================== */

/* Buttons: pill shape, a fill, never a border. Primary is ink. */
:is(button.primary, button.secondary, button.danger, button.ghost, button.accent, a.button, a.primary-link, .docs-pill),
:where(#view button:not([class]), dialog button:not([class])) { min-height: 36px; padding: 0 16px; border-radius: var(--r-full); font-weight: 500; transition: background-color var(--fast), color var(--fast); }
body :is(button.primary, a.button.primary, a.primary-link, button.accent, .tx-go),
:root[data-theme] body :is(button.primary, a.button.primary) {
  background: var(--ink) !important; color: var(--on-ink) !important; border: 0 !important; box-shadow: none !important; }
body :is(button.primary, a.button.primary, a.primary-link, button.accent, .tx-go):hover:not(:disabled) { background: var(--ink-hover) !important; }
body :is(button.primary, a.button.primary, .tx-go) kbd { background: color-mix(in srgb, var(--on-ink) 16%, transparent) !important; color: var(--on-ink) !important; border: 0 !important; }
body :is(button.secondary, a.button:not(.primary)):not(:focus-visible), body :where(#view button:not([class]), dialog button:not([class])) { background: var(--tint); box-shadow: none; border: 0; color: var(--text); }
body :is(button.secondary, a.button:not(.primary)):hover, body :where(#view button:not([class]), dialog button:not([class])):hover { background: var(--fill); }
body button.danger { background: var(--bad-bg); color: var(--bad); box-shadow: none; border: 0; }
body button.danger:hover { background: color-mix(in srgb, var(--bad) 18%, transparent); }
body button.ghost { background: transparent; color: var(--subtle); }
body button.ghost:hover { background: var(--tint); color: var(--strong); }
button:disabled { opacity: .5; }
.docs-pill { min-height: 32px; height: 32px; padding: 0 13px; border: 0; background: var(--tint); }
.docs-pill:hover { background: var(--fill); }
.as-send { background: var(--ink) !important; color: var(--on-ink) !important; }
/* Fields: a soft fill and no outline; on focus the field lifts to the page with a stronger edge. */
input:where(:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"])), select, textarea {
  min-height: 36px; background-color: var(--tint); border: 1px solid transparent; border-radius: var(--r-md); box-shadow: none; transition: background-color var(--fast), border-color var(--fast); }
input:where(:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"])):hover, select:hover, textarea:hover { background-color: var(--fill); }
input:where(:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"])):focus, select:focus, textarea:focus {
  background-color: var(--canvas); border-color: var(--border-strong); box-shadow: none; outline: none; }
dialog :is(input:where(:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"])), select, textarea):focus { background-color: var(--base); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--blue); }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
/* Fields inside a composed box (chat input, search boxes) are part of the box. */
body :is(.as-input, .composer, .searchbox, .as-side-search, .orgswitch-search, .pop-search, .lp-search, .pal-search, .ov-searchbox .ov-search):focus-within { border-color: var(--border-strong); box-shadow: none; }
body :is(.as-input, .composer, .searchbox, .as-side-search, .orgswitch-search, .pop-search, .lp-search, .pal-search) :is(textarea, input:not([type="checkbox"], [type="radio"])) {
  background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
body :is(.orgswitch-search, .pop-search) { border: 1px solid transparent; background: var(--tint); border-radius: var(--r-md); }
/* Segmented controls, tabs, switches, pills. */
.segmented { background: var(--tint); border-radius: var(--r-full); padding: 3px; }
.segmented button { border-radius: var(--r-full); font-weight: 500; transition: background-color var(--fast), color var(--fast); }
.segmented button.on, .segmented button[aria-pressed="true"] { background: var(--base); color: var(--strong); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
:root[data-theme="dark"] .segmented button.on { background: var(--fill); box-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segmented button.on { background: var(--fill); box-shadow: none; } }
.tabs { border-bottom-color: var(--line); }
.tabs button.on { border-bottom-color: var(--strong); color: var(--strong); }
.switch input[type="checkbox"]:checked, .pf-switch input:checked + .visually-hidden + .pf-knob { background: var(--blue); }
.badge, .pill, .st { border-radius: var(--r-full); }
.lp-btn { border: 0; background: var(--tint); box-shadow: none; }
.lp-btn:hover, .lp-btn[aria-expanded="true"] { background: var(--fill); border: 0; }

/* ==== Overlays ===================================================================================================== */

.popover, .stat-menu, .orgswitch-pop, .rolepop, #user-pop, .lp-pop { background: var(--base); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--pop-shadow); }
.popover :is(button, a), .stat-menu button { border-radius: 10px; }
.popover :is(button, a):hover, .stat-menu button:hover { background: var(--tint); }
:root[data-theme="dark"] .popover :is(button, a):hover { background: var(--fill); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .popover :is(button, a):hover { background: var(--fill); } }
.popover hr, .popover .pop-head { border-color: var(--line); }
dialog.dialog, dialog.palette { background: var(--base); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--pop-shadow); }
dialog.dialog::backdrop, dialog.palette::backdrop { background: var(--scrim); }
/* Dark dialogs sit on a raised surface: fields and secondary buttons take the next step up so they stay visible. */
:root[data-theme="dark"] dialog { --tint: #424242; --fill: #4a4a4a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) dialog { --tint: #424242; --fill: #4a4a4a; } }
dialog.dialog .dhead { border-bottom: 0; padding: 18px 20px 4px; font-size: var(--t-lg); font-weight: 600; }
dialog.dialog .card.tx .tx-foot { border-radius: 0 0 var(--r-2xl) var(--r-2xl); }
.pal-search { border-bottom-color: var(--line); }
.pal-item { border-radius: 10px; }
.pal-item.on { background: var(--tint); }
:root[data-theme="dark"] .pal-item.on { background: var(--fill); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pal-item.on { background: var(--fill); } }

/* ==== Feedback ===================================================================================================== */

.toast { background: var(--base); border-color: var(--line); border-radius: 16px; box-shadow: var(--pop-shadow); }
.toast .tip-ic { background: var(--tint); color: var(--strong); box-shadow: none; }
/* Intro tour: a neutral ink card in both themes; its white-on-dark animations keep their contrast. */
body .tour-card-pop, body .tour-card-pop::after { background: #1c1c1c; color: #ececec; }
body .tour-card-pop { box-shadow: 0 12px 36px rgb(0 0 0 / .35), 0 0 0 1px rgb(255 255 255 / .08); }
body :is(.tour-next, .tour-later) { border-radius: var(--r-full); }

/* ==== Assistant ==================================================================================================== */

canvas.as-dots { display: none; }
.as-input, .composer { background: var(--tint); border: 1px solid transparent; border-radius: var(--r-2xl); }
.as-msg.me { background: var(--fill); border-radius: 18px; }
.as-msg.ai { background: transparent; border: 0; padding-inline: 0; }
.as-sugg button { border: 1px solid var(--line); background: transparent; border-radius: var(--r-lg); }
.as-sugg button:hover { background: var(--tint); }
.as-ic { border: 0; background: var(--tint); }
body .as-sugg.as-cards .as-ic { background: var(--tint); color: var(--subtle); }
body .as-quick .ic { color: var(--subtle); }
body .as-quick button { background: transparent; border-color: var(--line); }
body .as-quick button:hover { background: var(--tint); border-color: var(--line); }

/* ==== Overview (MXO's home): a left-aligned greeting, the search, shortcuts as quiet pills, then the cards ========== */

body.app .ov { max-width: none; padding: 0; text-align: start; }
body.app .ov-hello, body.app .ov-hello.hairgrid { text-align: start; margin: 0 0 20px; padding: 8px 0 0; }
body.app .ov-hello .ov-kicker { display: none; }
body.app .ov-hello h1 { font-size: 28px; font-weight: 500; letter-spacing: -.02em; margin: 0 0 4px; }
body.app .ov-hello .ov-greet { color: var(--subtle); }
body.app .ov-searchbox { max-width: none; margin: 0 0 12px; }
body.app .ov-searchbox .ov-search, body.app .ov-search { max-width: none; margin: 0; border: 0; border-radius: var(--r-full); background: var(--composer); box-shadow: var(--composer-shadow); height: 52px; padding: 0 18px; }

body.app .ov-search:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; box-shadow: none; }
body.app .ov-search kbd { border: 0; background: var(--fill); }
body.app .ov-ask, body.app .ov-shortcuts { justify-content: flex-start; margin: 0; max-width: none; gap: 6px; font-size: var(--t-sm); }
body.app .ov-ask { margin-bottom: 6px; color: transparent; } /* the " · " between links stays in the markup for screen readers */
body.app .ov-ask a, body.app .ov .ov-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-full); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); font-size: var(--t-sm); font-weight: 500; text-decoration: none; }
body.app .ov-ask a:hover, body.app .ov .ov-chip:hover { background: var(--fill); color: var(--strong); text-decoration: none; }
body.app .ov .ov-sep { display: none; }
body.app .ov .ov-chip-more { color: var(--link); background: none; }
body.app .ov-shortcuts { margin-bottom: 36px; }
body.app .ov-shortcuts:empty { display: none; }
body.app .ov-ask:not(:has(+ .ov-shortcuts)) { margin-bottom: 36px; }
body.app .ov-rec-head { font-size: var(--t-lg); font-weight: 500; }
body.app .ov-cols.two > .ov-col + .ov-col { border-color: var(--line); }
@container content (max-width: 640px) { body.app .ov-shortcuts { flex-direction: row; } body.app .ov .ov-chip { width: auto; min-height: 30px; } }

/* ==== Sign-in: one calm centred column at every width (MXO's auth layout) =========================================== */

body.login-page main.login { grid-template-columns: minmax(0, 1fr); padding: 20px 16px; }
body.login-page .login-art { display: none; }
body.login-page .login-head { width: 100%; max-width: 960px; margin: 0 auto; padding: 4px 0 0; }
body.login-page .login-center { padding: 40px 0 32px; }
body.login-page .login-title { font-size: clamp(28px, 3.2vw, 34px); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; max-width: 20ch; }
body.login-page .login-sub { margin: 10px 0 28px; font-size: 15px; max-width: 40ch; }
body.login-page .login-card { max-width: 380px; padding: 0; background: transparent; border: 0; box-shadow: none; }
body.login-page .login-card input:not([type="checkbox"]) { min-height: 44px; border-radius: 12px; background: var(--tint); border: 1px solid transparent; font-size: 15px; }
body.login-page .login-card input:not([type="checkbox"]):focus { background: var(--canvas); border-color: var(--border-strong); box-shadow: none; }
body.login-page .login-card .otp-slots i { background: var(--tint); border-radius: 12px; }
body.login-page .login-card .otp-slots i.on { box-shadow: 0 0 0 1px var(--border-strong); }
body.login-page .login-btn { min-height: 44px; border-radius: var(--r-full); }
body.login-page .login-btn.main { background: var(--ink); color: var(--on-ink); box-shadow: none; }
body.login-page .login-btn.main:hover { background: var(--ink-hover); }
body.login-page .login-btn.soft { background: var(--tint); color: var(--strong); box-shadow: none; }
body.login-page .login-btn.soft:hover { background: var(--fill); }
body.login-page .login-btn:focus-visible { outline-color: var(--blue); }
body.login-page .login-or::before, body.login-page .login-or::after { background: var(--line); }

/* ==== Calm pass: one place for each thing ========================================================================== */

/* No website footer: its links are in the sidebar, account menu and Help. */
body.app .appfoot { display: none; }
/* Wide (MXO): search and bell on top, a plain list, the account row with the view icon at the foot. */
body.wide-shell nav.side .navfoot, body.wide-shell .side-foot #redo-intro { display: none; }
body.wide-shell #user-pop .mobile-only { display: flex !important; }
.pagehead .docs-label, body.wide-shell .side-foot .headpill:not(.previewing) > :not(.ic:first-child) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.wide-shell nav.side .navareas { margin-top: 2px; } body.wide-shell nav.side a.navitem[data-path="/app/settings"] { margin-top: 10px; }
body.wide-shell nav.side .recents { display: none !important; } /* Recents are on Overview and in search */
body.wide-shell nav.side a.navitem { padding-block: 6px; }
body.wide-shell .side-foot { flex-flow: row wrap; align-items: center; gap: 4px; }
body.wide-shell .side-foot :is(.complete-setup, #ask-ai) { flex-basis: 100%; }
body.wide-shell nav.side { align-self: stretch; }
.navsection { display: none; }
body.wide-shell .navsection { display: block; padding: 12px 10px 4px; color: var(--text-3); font-size: var(--t-xs); }
button.kit-optbtn { width: 36px; padding: 0; justify-content: center; }
/* A crowded header (4+ actions): the secondary ones turn into quiet text buttons so the one primary stands out. */
.pagehead .actions:has(> .primary, > :nth-child(4)) > :is(button, a).secondary:not(:hover) { background: transparent; color: var(--subtle); } /* one obvious action: the others are quiet */
/* Less text, one voice: a page says what it is in one line; every notice is the same quiet strip. */
.pagehead p, #view > h1 + p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; max-width: 72ch; }
:is(.draftnote, .notice) { padding: 9px 14px; border: 0; border-radius: var(--r-lg); font-size: var(--t-sm); line-height: 1.45; }
.draftnote > span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }
.draftnote:is(:hover, :focus-within) > span { -webkit-line-clamp: unset; }
/* Settings hub: one group card of rows (MXO), not a grid of tiles. */
body.app .settings-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2px; padding: 6px; background: var(--card); border: 1px solid var(--card-line); border-radius: 22px; }
body.app .settings-grid > .settings-card { background: transparent; border: 0; border-radius: var(--r-md); padding: 8px 10px; }
body.app .settings-grid > .settings-card:hover { background: var(--tint); }
/* A list on its own gets the group card frame that lists inside cards already have. */
main#view .pp-rows:not(:is(.card, .ov-rec, .ov-col, dialog, section) .pp-rows):has(> .pp-row) { padding: 0 16px; background: var(--card); border: 1px solid var(--card-line); border-radius: 22px; }
main#view .pp-rows > .pp-row:first-child { border-top: 0; }
body.wide-shell .side-foot .complete-setup { background: none; color: var(--text); }
body.wide-shell .side-foot .complete-setup:hover { background: var(--tint); }
body.wide-shell .side-foot .complete-setup .ic { color: var(--blue); }
.draftnote { background: var(--tint); border: 0; border-radius: var(--r-lg); color: var(--subtle); }
.ov-rec-body > div > button.ghost { margin: 4px 0 0 -12px; color: var(--link); }
body.wide-shell .side-foot .usermenu { flex: 1; min-width: 0; margin: 0; }
body.wide-shell .side-foot #head-tools { flex: none; }
body.wide-shell .side-foot .headpill:not(.previewing) { width: 32px; height: 32px; padding: 0; justify-content: center; }
body.wide-shell .side-foot #head-tools:has(.previewing) { flex-basis: 100%; order: -1; }
body.wide-shell .side-foot .headpill.previewing { color: var(--link); background: var(--info-bg); }
nav.side :is(.navhead, a.navitem) > span:not(.navbadge):first-of-type { flex: 1; min-width: 0; }
nav.side .navhead .navbadge { margin-inline: 0 8px; }
body.wide-shell nav.side .navhead .navbadge { margin-inline-end: 0; }
nav.side .navitem .count { background: none; color: var(--subtle); min-width: 0; padding: 0; font-weight: 500; }
body.wide-shell .side-icons .iconbtn .count { top: 6px; inset-inline-end: 6px; min-width: 7px; width: 7px; height: 7px; padding: 0; font-size: 0; background: var(--blue); }
body.wide-shell #launcher-btn { display: none; }
body.wide-shell nav.side { scrollbar-width: thin; scrollbar-color: transparent transparent; }
body.wide-shell nav.side:hover { scrollbar-color: var(--border-strong) transparent; }
@media (max-height: 860px) { body.wide-shell nav.side :is(a.navitem, .navhead) { padding-block: 4px; min-height: 30px; } body.wide-shell .navsection { padding-top: 8px; } }
body.app .ov-count { background: none; color: var(--subtle); padding: 0; min-width: 0; font-weight: 500; }
/* Overview: one row of shortcuts. */
body.app .ov-ask { display: none; }

/* Page head: one title; help is a quiet icon. */
.pp-kicker { display: none !important; }
.pagehead { align-items: flex-start; }
.pagehead p { max-width: 64ch; }
.pagehead .docs-pill { order: 99; width: 34px; min-height: 34px; height: 34px; padding: 0; justify-content: center; border-radius: var(--r-full); background: transparent; color: var(--subtle); }
.pagehead .docs-pill:hover { background: var(--tint); color: var(--strong); }
.pagehead .docs-pill .ic { width: 17px; height: 17px; margin: 0; }

/* AI page fills the window; the rest of its look is in assistant.css. */
body.app.aipage-immersive main#view { padding: 0; max-width: none; }
body.app.aipage-immersive main#view .card.aipage { height: 100dvh; border: 0; border-radius: 0; }
body.app.aipage-immersive .areatabs { display: none; }

/* Phones: help beside the title; the intro replay is in Help. */
body.app #redo-intro { display: none; }
@container app (max-width: 640px) {
  .pagehead { position: relative; }
  .pagehead > .actions:has(> .docs-pill:only-child) { position: absolute; top: -2px; inset-inline: auto -6px; width: auto; margin: 0; }
  .pagehead:has(> .actions > .docs-pill:only-child) h1 { padding-inline-end: 36px; }
}

/* Phone header: the apps grid is in the menu. */
@container app (max-width: 640px) {
  body.app header.top #launcher-btn { display: none; }
  .inbox-item { grid-template-columns: minmax(0, 1fr); } /* the actions go under the text, not beside it */
  body.app main#view .stats > .stat { flex-basis: 140px; padding: 12px 14px; } /* two figures per row */
  body.app main#view > div > .segmented { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  body.app header.top .headpill { width: 34px; padding: 0; justify-content: center; background: none; }
  body.app header.top .headpill > :not(.ic:first-child) { display: none; }
  body.app header.top .iconbtn .count { top: 6px; inset-inline-end: 6px; min-width: 7px; width: 7px; height: 7px; padding: 0; font-size: 0; background: var(--blue); }
}

/* ==== Responsive =================================================================================================== */

/* Profile: the cards shrink to the column on phones (the inherited grid overflowed by ~90px at 500px). */
.pf { grid-template-columns: minmax(0, 1fr); }
.pf-card :is(input, select, textarea) { min-width: 0; max-width: 100%; }
/* Small phones: the header's icons sit a little closer so the row fits without scrolling. */
@container app (max-width: 420px) {
  body.app header.top { gap: 0; padding: 0 6px 0 8px; }
  body.app header.top :is(.iconbtn, .toplink, .headsearch) { width: 32px; min-width: 32px; padding: 0; justify-content: center; }
  body.app header.top .headpill { padding: 0 8px; }
}
@container app (max-width: 640px) {
  body.app header.top { overflow-x: auto; scrollbar-width: none; background: color-mix(in srgb, var(--canvas) 92%, transparent); }
  body.app header.top::-webkit-scrollbar { display: none; }
  body.app .head-left { width: auto; padding-inline-end: 0; flex: none; gap: 2px; } /* never shrinks: the search icon stays beside the logo */
  body.app main#view { padding: 20px 16px 72px; }
  .pagehead h1 { font-size: 22px; }
  .areatabs { width: calc(100% - 32px); padding: 10px 0 0; }
  body.has-areatabs main#view { padding-top: 16px; }
}

/* ==== Motion: menus and dialogs pop in quickly; nothing moves for people who ask for less motion ==================== */

@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduce"]) :is(.popover:not(.hidden), .stat-menu:not(.hidden), dialog[open]) { animation: ax-pop var(--mid) var(--ease); }
  :root:not([data-motion="reduce"]) dialog[open]::backdrop { animation: ax-fade var(--mid) ease-out; }
}
@keyframes ax-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes ax-fade { from { opacity: 0; } }

