/* Osa Optimizer — application styles, aligned with the Osa platform:
   UC3 (Unified Commerce): Public Sans, ink #212B36 / #637381, primary #7635DC, 16px cards with one soft
     shadow, a white 280px sidebar with uppercase group headers, green (#00AB55) active items and dot
     bullets on sub-items, 4px buttons; dark sidebar #1A202E / #96A2B4.
   Zero: the product lockup — the osa mark (#8F45D8) followed by the product name in heavy capitals.
   Chart series keep the validated data-viz palette. */
@font-face {
  font-family: "Public Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(public-sans-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 {
  color-scheme: light;
  --page: #f9fafb;
  --surface-1: #ffffff;
  --surface-2: #f4f6f8;
  --sidebar: #ffffff;
  --sidebar-ink: #637381;
  --sidebar-ink-strong: #212b36;
  --sidebar-border: #f2f4f9;
  --sidebar-hover: #fafafa;
  --sidebar-bullet: #919eab;
  --sidebar-current: #000000;
  --nav-active: #00ab55;
  --nav-active-bg: rgba(0, 171, 85, 0.08);
  --brand-mark: #8f45d8;
  --brand-word: #1d1d1b;
  --text-primary: #212b36;
  --text-secondary: #637381;
  --text-muted: #919eab;
  --grid: #dfe3e8;
  --axis: #c4cdd5;
  --border: rgba(145, 158, 171, 0.24);
  --border-strong: rgba(145, 158, 171, 0.32);
  --hover: rgba(145, 158, 171, 0.08);
  --accent: #7635dc;
  --accent-hover: #5c26b8;
  --accent-text: #7635dc;
  --accent-ink: #ffffff;
  --accent-soft: rgba(118, 53, 220, 0.08);
  --good: #00ab55; --good-text: #007b55; --good-soft: rgba(0, 171, 85, 0.16);
  --warning: #ffc107; --warning-text: #b78103; --warning-soft: rgba(255, 193, 7, 0.16);
  --serious: #ff6c40;
  --critical: #ff4842; --critical-text: #b72136; --critical-soft: rgba(255, 72, 66, 0.16);
  --scrim: rgba(22, 28, 36, 0.48);
  --shadow: 0 8px 16px 0 rgba(145, 158, 171, 0.16);
  --shadow-pop: 0 0 2px 0 rgba(145, 158, 171, 0.24), -20px 20px 40px -4px rgba(145, 158, 171, 0.24);
  --shadow-primary: 0 8px 16px 0 rgba(118, 53, 220, 0.24);
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --radius: 16px;
  --radius-sm: 8px;
  --radius-btn: 4px;
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #161c24; --surface-1: #212b36; --surface-2: #28323e; --sidebar: #1a202e;
    --sidebar-ink: #96a2b4; --sidebar-ink-strong: #ffffff; --sidebar-border: #2f3a44; --sidebar-hover: rgba(150, 162, 180, 0.08);
  --sidebar-bullet: #637381; --sidebar-current: #ffffff; --nav-active: #5be584; --nav-active-bg: rgba(0, 171, 85, 0.16);
  --brand-mark: #a874e6; --brand-word: #ffffff;
    --text-primary: #ffffff; --text-secondary: #919eab; --text-muted: #637381; --grid: #333d48; --axis: #454f5b;
    --border: rgba(145, 158, 171, 0.24); --border-strong: rgba(145, 158, 171, 0.32); --hover: rgba(145, 158, 171, 0.08);
    --accent-text: #b985f4; --accent-soft: rgba(118, 53, 220, 0.16);
    --good-text: #5be584; --warning-text: #ffe16a; --critical-text: #ffa48d;
    --shadow: 0 0 2px 0 rgba(0, 0, 0, 0.2), 0 12px 24px -4px rgba(0, 0, 0, 0.12);
    --shadow-pop: 0 0 2px 0 rgba(0, 0, 0, 0.24), -20px 20px 40px -4px rgba(0, 0, 0, 0.24);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
    --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #161c24; --surface-1: #212b36; --surface-2: #28323e; --sidebar: #1a202e;
  --sidebar-ink: #96a2b4; --sidebar-ink-strong: #ffffff; --sidebar-border: #2f3a44; --sidebar-hover: rgba(150, 162, 180, 0.08);
  --sidebar-bullet: #637381; --sidebar-current: #ffffff; --nav-active: #5be584; --nav-active-bg: rgba(0, 171, 85, 0.16);
  --brand-mark: #a874e6; --brand-word: #ffffff;
  --text-primary: #ffffff; --text-secondary: #919eab; --text-muted: #637381; --grid: #333d48; --axis: #454f5b;
  --border: rgba(145, 158, 171, 0.24); --border-strong: rgba(145, 158, 171, 0.32); --hover: rgba(145, 158, 171, 0.08);
  --accent-text: #b985f4; --accent-soft: rgba(118, 53, 220, 0.16);
  --good-text: #5be584; --warning-text: #ffe16a; --critical-text: #ffa48d;
  --shadow: 0 0 2px 0 rgba(0, 0, 0, 0.2), 0 12px 24px -4px rgba(0, 0, 0, 0.12);
  --shadow-pop: 0 0 2px 0 rgba(0, 0, 0, 0.24), -20px 20px 40px -4px rgba(0, 0, 0, 0.24);
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
#app { min-height: 100vh; }
body { margin: 0; background: var(--page); color: var(--text-primary); font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; font-weight: 700; margin: 0; }
h2 { font-size: 16px; font-weight: 700; margin: 0; }
h3 { font-size: 13px; font-weight: 700; margin: 18px 0 8px; color: var(--text-secondary); }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.hint { font-size: 12px; color: var(--text-secondary); margin: 2px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- buttons & form controls ---------- */
.btn { font: inherit; font-size: 13.5px; font-weight: 700; color: var(--text-primary); background: transparent;
  border: 1px solid var(--border-strong); border-radius: var(--radius-btn); padding: 6px 14px; cursor: pointer; display: inline-flex;
  align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; transition: background-color .2s, box-shadow .2s; }
.btn:hover { background: var(--hover); border-color: var(--text-primary); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-primary); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: none; }
.btn.danger { color: var(--critical); }
.btn.danger:hover { border-color: var(--critical); background: var(--critical-soft); }
.btn.primary.danger { background: var(--critical); border-color: var(--critical); color: #fff; box-shadow: none; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.small { padding: 3px 10px; font-size: 12.5px; border-radius: var(--radius-btn); }
.btn svg { width: 15px; height: 15px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.btn.small svg { width: 13px; height: 13px; }
.btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
input, select, textarea { font: inherit; font-size: 14px; font-weight: 400; color: var(--text-primary); background: var(--surface-1);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 12px; min-width: 0;
  transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--text-primary); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { font-family: var(--mono); font-size: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-primary); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.error-text { color: var(--critical); font-size: 13px; min-height: 18px; }

/* ---------- login (UC3 layout) ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface-1); }
.login-top { display: flex; align-items: center; padding: 10px 34px; border-bottom: 1px dotted var(--border-strong); min-height: 54px; }
.login-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px 16px; }
.login-card { width: 100%; max-width: 525px; }
.login-card h2 { font-size: 26px; font-weight: 500; color: var(--text-primary); }
.login-sub { margin: 10px 0 0; font-size: 15px; color: var(--text-secondary); }
.login-card form { display: grid; gap: 20px; margin-top: 36px; }
.login-card label.field { font-size: 14px; font-weight: 400; color: var(--text-secondary); }
.login-card .req { font-style: normal; color: var(--critical); }
.login-card input { height: 56px; padding: 0 14px; font-size: 15px; border-radius: 4px; }
.login-btn { justify-content: center; height: 45px; border-radius: 7.5px; border: 0; background: var(--text-primary); color: var(--surface-1);
  font-size: 14.4px; font-weight: 700; text-transform: capitalize; }
.login-btn:hover { background: color-mix(in srgb, var(--text-primary) 85%, var(--surface-1)); border: 0; }
.login-foot { margin: 22px 0 0; padding-top: 18px; border-top: 1px dotted var(--border-strong); text-align: center; font-size: 14px;
  color: var(--text-secondary); }
.login-bottom { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 16px 24px; font-size: 14px;
  border-top: 1px dotted var(--border-strong); color: var(--text-secondary); }
.login-bottom a { color: var(--text-primary); }
@media (max-width: 640px) { .login-top { padding: 10px 16px; } .login-card h2 { font-size: 22px; } }
/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100%; }
/* sidebar: UC3 — white panel, dotted edge, uppercase group headers, 8px rounded items, green active state */
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); display: flex; flex-direction: column; position: sticky; top: 0;
  height: 100vh; padding: 20px 0 16px; z-index: 30; border-right: 1px dotted var(--sidebar-border);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #b4bcc3 transparent; }
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb { background: #b4bcc3; border-radius: 10px; }
.sidebar > .lockup-link { display: block; padding: 4px 26px 18px; text-decoration: none; }
/* product lockup (Zero): osa mark + product name in heavy capitals, bottom-aligned */
.lockup { display: inline-flex; align-items: flex-end; gap: 6px; color: var(--brand-word); text-decoration: none; line-height: 1; }
.lockup:hover { text-decoration: none; }
.lockup svg { height: 30px; width: auto; display: block; flex: none; }
.lockup b { font-weight: 800; font-size: 19px; letter-spacing: .01em; text-transform: uppercase; margin-bottom: -1px; }
.lockup.large svg { height: 38px; } .lockup.large b { font-size: 24px; }
.nav-group { margin-top: 18px; }
.nav-group > span { display: block; margin: 12px 0 4px 33px; font-size: 12px; font-weight: 700; line-height: 1.5; text-transform: uppercase;
  letter-spacing: .5px; color: var(--sidebar-ink-strong); }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 9px 9px 9px 18px; margin: 4px 13px 0;
  border-radius: 8px; color: var(--sidebar-ink); font-size: 14px; font-weight: 400; text-decoration: none; }
.nav a > span { flex: 1; min-width: 0; color: var(--sidebar-ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a:hover { background: var(--sidebar-hover); text-decoration: none; }
.nav a.active { background: var(--nav-active-bg); color: var(--nav-active); font-weight: 600; }
.nav a.active > span { color: var(--nav-active); }
.nav svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-module-name { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 9px 9px 9px 18px; margin: 4px 13px 0;
  border-radius: 8px; font-size: 14px; color: var(--sidebar-ink); }
.nav-module-name span, .nav-module-name { color: var(--sidebar-ink-strong); }
.nav-module-name svg { color: var(--sidebar-ink); }
.nav-module.open .nav-module-name { background: var(--nav-active-bg); color: var(--nav-active); font-weight: 600; }
.nav-module.open .nav-module-name svg { color: var(--nav-active); }
/* sub-items: dot bullets; the current one bold with a larger green dot */
.nav-sub { margin: 2px 0 4px; }
.nav-sub a { min-height: 36px; padding: 6px 9px 6px 52px; margin-top: 0; font-size: 14px; color: var(--sidebar-ink-strong); }
.nav-sub a::before { content: ""; position: absolute; left: 33px; top: 50%; width: 4px; height: 4px; border-radius: 50%;
  background: var(--sidebar-bullet); transform: translateY(-50%); transition: transform .2s; }
.nav-sub a.active { background: none; color: var(--sidebar-current); font-weight: 700; }
.nav-sub a.active::before { background: var(--nav-active); transform: translateY(-50%) scale(2); }
.nav-sub a.planned:not(.active) { color: var(--text-muted); }
.sidebar-foot { margin-top: auto; font-size: 11px; color: var(--text-muted); padding: 16px 33px 0; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--page) 82%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 20; }
.topbar .title { flex: 1; min-width: 0; }
.topbar .title h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title .crumb { font-size: 12px; color: var(--text-muted); }
.domain-switch { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.domain-switch select { min-width: 190px; font-weight: 600; }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px;
  cursor: pointer; color: var(--text-primary); font: inherit; }
.user-btn:hover { background: var(--hover); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid;
  place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.menu { position: absolute; right: 16px; top: 58px; background: var(--surface-1); border-radius: 12px;
  box-shadow: var(--shadow-pop); min-width: 240px; padding: 6px; z-index: 40; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px dashed var(--border); margin-bottom: 6px; }
.menu .who b { display: block; }
.menu button { width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 14px;
  color: var(--text-primary); cursor: pointer; }
.menu button:hover { background: var(--hover); }
.hamburger { display: none; }
.content { padding: 16px 24px 32px; max-width: 1400px; width: 100%; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 280px; max-width: 86vw; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-pop); }
  .hamburger { display: inline-flex; }
  .topbar { padding: 0 12px; }
  .domain-switch span, .topbar .title .crumb { display: none; }
  .domain-switch select { min-width: 0; max-width: 150px; }
  .user-btn .user-name { display: none; }
  .content { padding: 16px; }
}

/* ---------- page furniture ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; }
.card { background: var(--surface-1); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px; margin-bottom: 24px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 24px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 12px 0; color: var(--text-secondary); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text-primary); text-decoration: none; }
.tabs a.active { color: var(--text-primary); border-bottom-color: var(--text-primary); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; line-height: 20px; padding: 1px 8px;
  border-radius: 6px; background: rgba(145, 158, 171, 0.16); color: var(--text-secondary); white-space: nowrap; }
.pill.ok { background: var(--good-soft); color: var(--good-text); }
.pill.error { background: var(--critical-soft); color: var(--critical-text); }
.pill.warning { background: var(--warning-soft); color: var(--warning-text); }
.pill.running { background: var(--accent-soft); color: var(--accent-text); }
.method { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); }
.copy-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.copy-row code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--surface-2);
  border-radius: var(--radius-sm); padding: 6px 10px; }
pre.code { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px; overflow: auto; max-height: 360px; margin: 0; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.notice { background: var(--accent-soft); color: var(--text-primary); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13.5px; }
.notice.warn { background: var(--warning-soft); }
.empty { color: var(--text-muted); padding: 28px 0; text-align: center; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--text-secondary); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- filters / tiles / charts (dashboard) ---------- */
.filter-bar { position: sticky; top: 64px; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 24px; padding: 10px 12px; background: var(--surface-1); border-radius: var(--radius); box-shadow: var(--shadow); }
.fchip { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 999px; font-size: 13.5px; color: var(--text-primary);
  background: var(--surface-1); transition: border-color .15s, background .15s; max-width: 100%; }
.fchip:hover { border-color: var(--text-secondary); }
.fchip:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.fchip svg { width: 16px; height: 16px; flex: none; stroke: var(--text-secondary); fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.fchip .k { display: none; color: var(--text-secondary); font-size: 12.5px; }
.fchip.on .k { display: inline; }
.fchip .v { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.fchip .caret { width: 7px; height: 7px; margin: -3px 0 0 2px; border: solid var(--text-secondary); border-width: 0 1.6px 1.6px 0;
  transform: rotate(45deg); flex: none; }
/* the native select covers the chip: whole-chip target, native list and keyboard */
.fchip select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; appearance: none; }
.fchip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.fchip.on svg, .fchip.on .k { stroke: var(--accent-text); color: var(--accent-text); }
.fchip.on .caret { border-color: var(--accent-text); }
.fdate { display: none; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); }
.filter-bar.show-custom .fdate { display: inline-flex; }
.fdate input { height: 36px; padding: 0 10px; border-radius: 999px; font-size: 13.5px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-2); height: 36px; }
.seg label { position: relative; display: inline-flex; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--text-secondary); transition: background .15s, color .15s; }
.seg input:checked + span { background: var(--surface-1); color: var(--text-primary); box-shadow: 0 1px 3px rgba(145, 158, 171, 0.32); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.fsep { width: 1px; height: 24px; background: var(--border-strong); margin: 0 4px; }
.filter-bar .clear { margin-left: auto; color: var(--text-secondary); }
.filter-bar .clear[hidden] { display: none; }
@media (max-width: 760px) {
  .filter-bar { position: static; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 8px; }
  .filter-bar > * { flex: none; }
  .fsep { display: none; }
}
.loading { opacity: .5; transition: opacity .15s; }
/* ---------- overview & modules ---------- */
.center { text-align: center; }
.tricost { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 24px;
  padding: 18px 22px; border-radius: var(--radius); background: var(--accent-soft); }
.tricost > div:first-child { flex: 1 1 360px; }
.tricost b { font-size: 16px; }
.tricost p { margin: 4px 0 0; color: var(--text-secondary); font-size: 13.5px; max-width: 640px; }
.tricost-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.tricost-steps span { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 8px 12px;
  border-radius: var(--radius-sm); background: var(--surface-1); font-weight: 700; font-size: 13.5px; }
.tricost-steps i { grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal;
  font-size: 12px; background: var(--accent); color: var(--accent-ink); }
.tricost-steps small { font-weight: 400; font-size: 11.5px; color: var(--text-secondary); }
.pillar-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 24px; }
.pillar-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: var(--radius); background: var(--surface-1);
  box-shadow: var(--shadow); border-top: 3px solid var(--accent); min-width: 0; }
.pillar-card.inventory { border-top-color: var(--series-3); }
.pillar-card.transport { border-top-color: var(--series-1); }
.pillar-card.labor .module-icon { background: var(--accent-soft); color: var(--accent-text); }
.pillar-card.inventory .module-icon { background: color-mix(in srgb, var(--series-3) 14%, transparent); color: var(--series-3); }
.pillar-card.transport .module-icon { background: color-mix(in srgb, var(--series-1) 14%, transparent); color: var(--series-1); }
.pillar-top { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); font: inherit; color: inherit; cursor: pointer; }
.pillar-top svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; margin-top: 1px; }
.pillar-top b { display: block; font-size: 13.5px; }
.pillar-top small { color: var(--text-secondary); font-size: 12px; }
.pillar-top.critical svg { color: var(--critical); } .pillar-top.warning svg { color: var(--warning-text); }
.pillar-top.info svg { color: var(--text-secondary); } .pillar-top.ok { cursor: default; } .pillar-top.ok svg { color: var(--good); }
.pillar-top:not(.ok):hover { border-color: var(--accent); }
.pillar-caps { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.cap-dot { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); text-decoration: none; }
.cap-dot:hover { color: var(--accent-text); text-decoration: none; }
.cap-dot i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--text-muted); flex: none; }
.cap-dot.st-live { color: var(--text-primary); } .cap-dot.st-live i { background: var(--good); border-color: var(--good); }
.cap-dot.st-preview i { background: linear-gradient(90deg, var(--good) 50%, transparent 50%); border-color: var(--good); }
.pillar-tag { align-self: flex-start; font-size: 11px; margin-bottom: 2px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); }
.overview-lower { margin-bottom: 8px; }
.cost-list { list-style: none; margin: 0 0 12px; padding: 0; }
.cost-list li + li { border-top: 1px solid var(--border); }
.cost-list a { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; padding: 10px 0; color: inherit; text-decoration: none; }
.cost-list a:hover b { color: var(--accent-text); }
.cost-list .cap-code { grid-row: span 2; align-self: start; }
.cost-list small { color: var(--text-secondary); font-size: 12.5px; }
.cap-code { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700;
  background: var(--surface-2); color: var(--text-secondary); white-space: nowrap; flex: none; }
.cap-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.cap-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong);
  color: inherit; text-decoration: none; font-size: 13px; }
.cap-chip.st-preview { border-style: solid; }
.cap-chip:hover { border-color: var(--accent); text-decoration: none; }
.cap-chip em { font-style: normal; font-size: 11px; color: var(--text-muted); }
.abc { display: grid; gap: 14px; align-content: start; }
.abc-row { display: flex; gap: 12px; align-items: center; }
.abc-cls { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-weight: 800; flex: none; color: #fff; }
.abc-cls.A { background: var(--series-1); } .abc-cls.B { background: var(--series-3); } .abc-cls.C { background: var(--series-4); }
.abc-cls.small { width: 22px; height: 22px; border-radius: 6px; font-size: 12px; }
.abc-bars { flex: 1; display: grid; gap: 6px; min-width: 0; }
.abc-bar { display: grid; grid-template-columns: 74px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; }
.abc-bar span { color: var(--text-secondary); }
.abc-bar b { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpis.dense { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.grid-velocity { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 24px; }
.grid-dock { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .grid-velocity, .grid-dock { grid-template-columns: 1fr; } }
.flow { display: flex; align-items: stretch; gap: 8px; margin-bottom: 28px; padding: 16px 20px; border-radius: var(--radius);
  background: var(--accent-soft); }
.flow-step { flex: 1; display: flex; gap: 12px; min-width: 0; }
.flow-step b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-text); }
.flow-name { font-weight: 700; font-size: 15px; }
.flow-step .hint { margin: 2px 0 0; }
.flow-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: var(--accent); color: var(--accent-ink); }
.flow-arrow { display: grid; place-items: center; color: var(--accent-text); }
.flow-arrow svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }
@media (max-width: 760px) { .flow { flex-direction: column; } .flow-arrow { transform: rotate(90deg); } }
.area { margin-bottom: 28px; }
.area-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 12px; }
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.module-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: var(--radius); background: var(--surface-1);
  box-shadow: var(--shadow); color: inherit; text-decoration: none; border: 1px solid transparent; transition: border-color .15s, transform .15s; }
.module-card:hover { text-decoration: none; border-color: var(--accent); }
.module-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.module-card.is-planned { background: color-mix(in srgb, var(--surface-1) 70%, var(--page)); box-shadow: none; border-color: var(--border); }
.module-card.is-planned:hover { border-color: var(--accent); }
.module-head { display: flex; gap: 12px; align-items: flex-start; }
.module-head > div { flex: 1; min-width: 0; }
.module-head h3 { font-size: 16px; margin: 0 0 2px; }
.module-head .hint { margin: 0; }
.module-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.module-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.module-card.is-planned .module-icon { background: var(--surface-2); color: var(--text-secondary); }
.module-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 6px; }
.module-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.module-stat span { font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module-stat b { font-size: 18px; font-variant-numeric: tabular-nums; }
.will-show { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 6px; }
.metric-list { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--text-secondary); display: grid; gap: 3px; }
.module-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.systems { display: flex; flex-wrap: wrap; gap: 6px; }
.system { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); }
.system i { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--text-muted); }
.system.on { color: var(--text-primary); }
.system.on i { background: var(--good); border-color: var(--good); }
.module-open { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--accent-text); flex: none; }
.module-open svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
@media (max-width: 520px) { .module-grid { grid-template-columns: 1fr; } }
.challenge { display: flex; gap: 16px; align-items: center; }
.challenge p { margin: 0; font-size: 15px; }
.placeholder-row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi.placeholder { box-shadow: none; border: 1px dashed var(--border-strong); background: transparent; }
.kpi.placeholder .label { white-space: normal; }
.kpi.placeholder .value { color: var(--text-muted); }
.system-list { list-style: none; margin: 0; padding: 0; }
.system-list li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; }
.system-list li + li { border-top: 1px solid var(--border); }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 14px; }
.danger-zone { border: 1px solid var(--critical-soft); }
.danger-zone h2 { color: var(--critical-text); margin-bottom: 4px; }
.danger-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 0; }
.danger-row + .danger-row { border-top: 1px solid var(--border); }
.danger-row .btn { flex: none; min-width: 150px; justify-content: center; }
@media (max-width: 640px) { .danger-row { flex-direction: column; align-items: stretch; } }
.fresh-list li.none { color: var(--text-muted); }
.fresh-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.fresh-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; font-size: 13.5px; }
.fresh-list li + li { border-top: 1px solid var(--border); }
.fresh-list b { font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tile { background: var(--surface-1); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.tile .label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.tile .value { font-size: 28px; font-weight: 700; margin-top: 6px; line-height: 1.3; }
.tile .note { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.tiles.compact .value { font-size: 20px; }
.tiles.compact .tile { padding: 16px 20px; }
/* live floor banner */
.live { background: linear-gradient(135deg, #7635dc 0%, #5c26b8 100%); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-primary);
  padding: 20px 24px; margin-bottom: 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: center; }
.live-head { display: flex; gap: 14px; align-items: center; min-width: 0; }
.live-head h2 { color: #fff; font-size: 18px; }
.live-head p { margin: 2px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, 0.78); }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.4); flex: none; }
.pulse.on { background: #5be584; box-shadow: 0 0 0 0 rgba(91, 229, 132, 0.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(91, 229, 132, 0); } 100% { box-shadow: 0 0 0 0 rgba(91, 229, 132, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse.on { animation: none; } }
.live-stats { display: flex; gap: 8px; }
.live-stat { background: rgba(255, 255, 255, 0.12); border-radius: 12px; padding: 10px 16px; min-width: 112px; }
.live-stat span { display: block; font-size: 12px; color: rgba(255, 255, 255, 0.78); }
.live-stat b { font-size: 24px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.live-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.live-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; background: rgba(255, 255, 255, 0.12);
  border-radius: 999px; padding: 4px 12px 4px 8px; color: rgba(255, 255, 255, 0.86); }
.live-chip i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.live-chip b { color: #fff; font-weight: 600; }
@media (max-width: 760px) { .live { grid-template-columns: 1fr; padding: 16px; } .live-stats { flex-wrap: wrap; } .live-stat { flex: 1; min-width: 96px; } }

/* key figures */
.kpi-block { margin-bottom: 24px; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { font-size: 16px; }
.section-head .hint { margin: 0; }
.kpis { display: grid; gap: 16px; }
.hero-row { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 16px; }
.second-row { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kpi { background: var(--surface-1); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0;
  display: flex; flex-direction: column; gap: 4px; }
.kpi.hero { padding: 20px 22px; }
.kpi-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kpi .label { font-size: 13px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .value { font-size: 22px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.kpi.hero .value { font-size: 32px; }
.kpi .value.good { color: var(--good-text); }
.kpi .value.bad { color: var(--critical-text); }
.kpi .note { font-size: 12px; color: var(--text-muted); }
.kpi-viz { min-height: 10px; margin: 2px 0; }
.kpi.hero .kpi-viz { min-height: 40px; display: flex; align-items: center; }
.kpi-viz .spark { display: block; width: 100%; cursor: crosshair; }
.spark .crosshair { stroke: var(--axis); stroke-width: 1; }
.delta { font-size: 12px; font-weight: 700; border-radius: 6px; padding: 1px 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.good { color: var(--good-text); background: var(--good-soft); }
.delta.bad { color: var(--critical-text); background: var(--critical-soft); }
.delta.flat, .delta.none { color: var(--text-secondary); background: rgba(145, 158, 171, 0.16); }
.delta.none { font-weight: 600; }
.meter { position: relative; width: 100%; height: 8px; border-radius: 4px; background: rgba(145, 158, 171, 0.2); }
.meter .fill { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent); }
.meter .fill.good { background: var(--good); }
.meter .fill.bad { background: var(--critical); }
.meter .target { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text-primary); border-radius: 1px; }

/* needs attention */
.card-head h2 .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 4px; border-radius: 11px;
  font-size: 12px; vertical-align: 2px; color: #fff; background: var(--text-muted); }
.card-head h2 .count:empty { display: none; }
.card-head h2 .count.critical { background: var(--critical); }
.card-head h2 .count.warning { background: var(--warning); color: #212b36; }
.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alert { width: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; text-align: left;
  font: inherit; color: inherit; background: var(--surface-2); border: 0; border-radius: 12px; padding: 12px 14px; }
button.alert { cursor: pointer; }
button.alert:hover { background: var(--hover); box-shadow: inset 0 0 0 1px var(--border-strong); }
.alert-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.alert-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.alert.critical .alert-icon { background: var(--critical-soft); color: var(--critical-text); }
.alert.warning .alert-icon { background: var(--warning-soft); color: var(--warning-text); }
.alert.info .alert-icon { background: var(--accent-soft); color: var(--accent-text); }
.alert-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alert-text b { font-size: 14px; font-weight: 600; }
.alert-text small { font-size: 12.5px; color: var(--text-secondary); overflow-wrap: anywhere; }
.sev { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.sev.critical { color: var(--critical-text); }
.sev.warning { color: var(--warning-text); }
.sev.info { color: var(--accent-text); }
.chev svg { width: 16px; height: 16px; stroke: var(--text-muted); fill: none; stroke-width: 2; display: block; }
@media (max-width: 520px) { .alert .sev { display: none; } .alert { grid-template-columns: auto minmax(0, 1fr) auto; } }
.all-clear { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.all-clear svg { width: 36px; height: 36px; flex: none; stroke: var(--good); fill: var(--good-soft); stroke-width: 1.8; stroke-linecap: round; }
.all-clear p { margin: 2px 0 0; }

/* team performance */
.bands { display: grid; gap: 10px; margin-bottom: 20px; }
.band { display: grid; grid-template-columns: 112px minmax(0, 1fr) 32px; gap: 12px; align-items: center; font-size: 13px; }
.band-label { color: var(--text-secondary); }
.band b { text-align: right; font-variant-numeric: tabular-nums; }
.band-bar { height: 10px; border-radius: 5px; background: rgba(145, 158, 171, 0.16); overflow: hidden; }
.band-bar i { display: block; height: 100%; border-radius: 5px; min-width: 0; }
.band-bar i.bad { background: var(--critical); }
.band-bar i.warn { background: var(--warning); }
.band-bar i.good { background: var(--good); }
.leaders { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; }
.leaders h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 0 0 6px; }
.person { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; font: inherit; font-size: 13.5px; color: inherit;
  background: none; border: 0; border-bottom: 1px dashed var(--border); padding: 8px 2px; cursor: pointer; text-align: left; }
.person:hover { background: var(--hover); }
.person .who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .who i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.person .num { font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .leaders { grid-template-columns: 1fr; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 6px; font-size: 12px; color: var(--text-secondary); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.chart { width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart text { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .value-label { fill: var(--text-secondary); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .ref { stroke: var(--text-muted); stroke-width: 1; }
.chart .mark { transition: opacity .1s; }
.chart .mark:hover, .chart .mark:focus { opacity: .8; outline: none; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px dashed var(--border); white-space: nowrap; vertical-align: middle; }
th { font-weight: 600; color: var(--text-secondary); font-size: 13px; user-select: none; background: var(--surface-2); border-bottom: 0; }
th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
th:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
th.sortable { cursor: pointer; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 220px; }
th[aria-sort="ascending"]::after { content: " ↑"; }
th[aria-sort="descending"]::after { content: " ↓"; }
tbody tr:hover { background: var(--hover); }
tr.clickable { cursor: pointer; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.below { color: var(--critical-text); }
.below::before { content: "▼ "; font-size: 9px; }
.at-std { color: var(--good-text); }
.at-std::before { content: "▲ "; font-size: 9px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
td.actions { white-space: normal; min-width: 200px; }

/* ---------- overlays ---------- */
.tooltip { position: fixed; z-index: 60; pointer-events: none; background: var(--surface-1); color: var(--text-primary);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12px; box-shadow: var(--shadow-pop); min-width: 140px; }
.tooltip .t-title { color: var(--text-secondary); margin-bottom: 4px; }
.tooltip .t-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tooltip .t-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tooltip .t-row .k { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.tooltip .t-row .k i { width: 12px; height: 2px; display: inline-block; }
.tooltip .t-row.on .k { color: var(--text-primary); }
.drawer { position: fixed; inset: 0 0 0 auto; width: min(720px, 100vw); background: var(--page);
  box-shadow: var(--shadow-pop); overflow-y: auto; z-index: 50; padding: 24px 20px; }
.modal-back { position: fixed; inset: 0; background: var(--scrim); z-index: 55; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface-1); border-radius: var(--radius); box-shadow: var(--shadow-pop); width: min(640px, 100%); max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; }
.modal header { padding: 24px 24px 0; }
.modal header h2 { font-size: 18px; }
.modal .body { padding: 20px 24px; overflow-y: auto; }
.modal footer { padding: 16px 24px 24px; display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: fixed; bottom: 24px; right: 24px; z-index: 70; background: var(--text-primary); color: var(--surface-1);
  padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-pop); max-width: 420px; }
.toast.error { background: var(--critical); color: #fff; }

/* ---------- slotting ---------- */
.slot-hero { display: grid; grid-template-columns: minmax(260px, 1.1fr) 2fr; gap: 24px; margin-bottom: 24px; padding: 22px 24px;
  border-radius: var(--radius); background: var(--surface-1); box-shadow: var(--shadow); align-items: start; scroll-margin-top: 16px; }
.slot-hero-main p { margin: 8px 0 0; font-size: 13.5px; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.slot-big { font-size: 40px; font-weight: 800; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.slot-big small { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-top: 2px; }
.scenarios { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.scenario { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.scenario.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.scenario small { color: var(--text-secondary); font-size: 12px; min-height: 32px; }
.scenario dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 8px 0 0; font-size: 12.5px; }
.scenario dt { color: var(--text-secondary); } .scenario dd { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .slot-hero { grid-template-columns: 1fr; } }
.pairbars { display: grid; gap: 12px; }
.legend-row { display: flex; gap: 16px; font-size: 12px; color: var(--text-secondary); }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-row i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.pairbar { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: center; font-size: 12.5px; }
.pb-label { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.pb-bars { display: grid; gap: 4px; }
.pb-row { display: grid; grid-template-columns: 1fr 40px; gap: 8px; align-items: center; }
.pb-row b { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.factors { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.factor { display: flex; gap: 12px; align-items: flex-start; }
.factor b { display: block; } .factor small { color: var(--text-secondary); font-size: 12px; }
.factor ul { margin: 6px 0 4px; padding-left: 16px; font-size: 12.5px; display: grid; gap: 2px; }
.factor .module-icon { width: 34px; height: 34px; border-radius: 10px; }
.factor .module-icon svg { width: 18px; height: 18px; }
.tag-rising { color: var(--series-2); font-weight: 700; font-size: 12px; }
details.how summary { cursor: pointer; list-style: revert; }
details.how[open] summary { margin-bottom: 12px; }
/* map */
.map-toolbar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.seg { display: inline-flex; gap: 4px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 12px; }
.map-legend > i { width: 18px; height: 12px; border-radius: 3px; display: inline-block; }
.map-key { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; color: var(--text-secondary); }
.map-key i { width: 14px; height: 12px; border-radius: 3px; display: inline-block; background: var(--surface-2); }
.map-key svg, .map-cell svg { width: 11px; height: 11px; stroke: var(--text-primary); fill: none; stroke-width: 2.2; }
.k-frozen { box-shadow: inset 0 0 0 2px var(--series-1); } .k-chilled { box-shadow: inset 0 0 0 2px var(--series-3); }
.k-excluded, .map-cell.excluded { background-image: repeating-linear-gradient(45deg, transparent 0 3px, var(--border-strong) 3px 4px) !important; }
.grid-map { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.map-detail { position: sticky; top: 16px; }
@media (max-width: 1100px) { .grid-map { grid-template-columns: 1fr; } .map-detail { position: static; } }
.map-scroll { overflow-x: auto; padding-bottom: 4px; }
.map-grid { display: grid; gap: 3px; min-width: max-content; font-size: 11px; }
.map-corner, .map-bay, .map-aisle { color: var(--text-secondary); font-variant-numeric: tabular-nums; display: grid; place-items: center; }
.map-aisle { justify-items: start; font-weight: 600; }
.map-cell { height: 26px; min-width: 22px; border: 0; border-radius: 4px; padding: 0; cursor: pointer; display: grid; place-items: center; }
.map-cell.empty { background: transparent; border: 1px dashed var(--border); cursor: default; }
.map-cell.t-frozen { box-shadow: inset 0 0 0 2px var(--series-1); } .map-cell.t-chilled { box-shadow: inset 0 0 0 2px var(--series-3); }
.map-cell:hover, .map-cell:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 1px; }
.map-cell.sel { outline: 2px solid var(--accent); outline-offset: 1px; }
.map-front { margin-top: 6px; }
.mini-moves { margin: 0; padding-left: 16px; font-size: 12.5px; display: grid; gap: 4px; }
/* moves */
.move-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.move-head-act { display: flex; gap: 8px; flex-wrap: wrap; }
.move-list { display: grid; gap: 12px; margin-bottom: 24px; }
.move { display: grid; grid-template-columns: minmax(240px, 1fr) 1.4fr auto; gap: 20px; padding: 16px 20px; background: var(--surface-1);
  border-radius: var(--radius); box-shadow: var(--shadow); align-items: start; }
@media (max-width: 900px) { .move { grid-template-columns: 1fr; gap: 12px; } }
.move-what { display: grid; gap: 6px; min-width: 0; }
.move-sku { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.move-path { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.move-path svg { width: 14px; height: 14px; stroke: var(--text-secondary); fill: none; stroke-width: 2; }
.move-path code.to { color: var(--good-text); }
.move-why p { margin: 0 0 8px; font-size: 13.5px; }
.move-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.move-act { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 900px) { .move-act { flex-direction: row; } }
.checks { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; font-size: 12px; color: var(--text-secondary); }
.checks li { display: flex; gap: 6px; align-items: center; }
.checks svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }
.checks li.ok svg { color: var(--good); } .checks li.bad { color: var(--critical-text); } .checks li.na svg { color: var(--text-muted); }
.form-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.map-detail th, .map-detail td { padding: 8px 6px; }
.map-detail .card-head { margin-bottom: 10px; }

/* ---------- 4PL ---------- */
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type=search] { flex: 1; min-width: 200px; max-width: 360px; }
.tabs a .count { margin-left: 6px; font-size: 11.5px; font-weight: 700; padding: 0 6px; border-radius: 10px; background: var(--surface-2); color: var(--text-secondary); }
.tabs a.active .count { background: var(--text-primary); color: var(--surface-1); }
td .sub, .sub { display: block; font-size: 12px; color: var(--text-secondary); font-weight: 400; white-space: normal; }
a.strong, .strong { font-weight: 700; }
.row-actions.start { justify-content: flex-start; margin-top: 12px; }
.dots { display: inline-flex; gap: 3px; } .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); display: inline-block; }
.dots i.on { background: var(--good); }
.pipeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.pipe { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); color: var(--text-primary); }
.pipe:hover { border-color: var(--text-primary); text-decoration: none; }
.pipe b { font-size: 22px; font-variant-numeric: tabular-nums; } .pipe span { font-size: 12.5px; color: var(--text-secondary); }
.pipe.pending_review { border-left: 4px solid var(--warning); } .pipe.approved { border-left: 4px solid var(--good); }
.pipe.rejected, .pipe.suspended { border-left: 4px solid var(--critical); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .ck { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text-muted); }
.checklist .ck svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.checklist li.done .ck { background: var(--good-soft); color: var(--good-text); }
.checklist b { display: block; font-size: 13.5px; } .checklist small { color: var(--text-secondary); font-size: 12px; }
.checklist li:not(.done) b { color: var(--text-secondary); }
.kv { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 6px 16px; margin: 0; font-size: 13.5px; }
.kv dt { color: var(--text-secondary); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; }
.timeline li { padding-left: 14px; border-left: 2px solid var(--border-strong); }
.timeline b { text-transform: capitalize; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.stack { display: grid; gap: 10px; }
.stepper { list-style: none; display: flex; gap: 16px; margin: 0 0 18px; padding: 0; font-size: 13px; color: var(--text-secondary); flex-wrap: wrap; }
.stepper li { display: inline-flex; align-items: center; gap: 6px; }
.stepper i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: 12px; }
.stepper li.on { color: var(--text-primary); font-weight: 700; } .stepper li.on i { background: var(--accent); color: var(--accent-ink); }
.stepper li.done i { background: var(--good-soft); color: var(--good-text); }
.modal footer .row-actions { display: inline-flex; gap: 8px; }
.bulk { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 32px; margin-bottom: 8px; font-size: 13px; }
.mapping { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 12px; }
.table-wrap.compact th, .table-wrap.compact td { padding: 6px 8px; font-size: 12px; }
.kind-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.kind { text-align: left; font: inherit; color: var(--text-primary); background: var(--surface-1); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; cursor: pointer; }
.kind:hover:not(:disabled) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.kind:disabled { cursor: default; opacity: .7; }
.kind small { color: var(--text-secondary); font-size: 12.5px; }
.integ .last { margin-top: 12px; }
pre.code.tall { max-height: 60vh; }
details summary { cursor: pointer; font-size: 13px; color: var(--accent-text); }
.stack > .btn { justify-self: start; }

/* cost per order */
.delta.warn { color: var(--warning-text); background: var(--warning-soft); }
.good-text { color: var(--good-text); }
.bad-text { color: var(--critical-text); }
.cost-kpi { border-left: 4px solid var(--text-primary); }
.cost-kpi.labor { border-left-color: var(--series-7); }
.cost-kpi.inventory { border-left-color: var(--series-3); }
.cost-kpi.transport { border-left-color: var(--series-4); }
.cost-kpi .delta { display: inline-block; margin-top: 4px; }
.grid-cost { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; margin: 16px 0 24px; align-items: start; }
.cost-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 4px; }
.cost-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cost-legend .sw { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--series-1); }
.cost-legend .sw.base { border-top: 2px dashed var(--axis); }
.cost-legend .sw.target { border-top: 2px dashed var(--good); }
.line-chart .grid { stroke: var(--grid); stroke-width: 1; }
.line-chart .base { stroke: var(--axis); stroke-width: 1.5; stroke-dasharray: 5 4; }
.line-chart .target { stroke: var(--good); stroke-width: 1.5; stroke-dasharray: 6 4; }
.line-chart .series { fill: none; stroke: var(--series-1); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .end { fill: var(--series-1); stroke: var(--surface-1); stroke-width: 2; }
.line-chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.line-chart { cursor: crosshair; }
.cost-sum { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--text-secondary); margin-top: 8px; }
.cost-sum b { color: var(--text-primary); }
.cost-sum b.good-text { color: var(--good-text); } .cost-sum b.bad-text { color: var(--critical-text); }
td.t-good { color: var(--good-text); } td.t-warn { color: var(--warning-text); } td.t-bad { color: var(--critical-text); font-weight: 700; }
.cost-notes { margin: 0 0 24px; padding-left: 18px; font-size: 12.5px; }
.cost-notes li + li { margin-top: 4px; }
.cost-planned { font-size: 13px; color: var(--text-secondary); margin: 16px 0 6px; }
.filter-bar > .hint { margin-left: 4px; }
@media (max-width: 1000px) { .grid-cost { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Ask Optimizer (chat) ---------- */
.chat { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.chat-side { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 18px; max-height: calc(100vh - 120px); overflow-y: auto; }
.chat-new { justify-content: center; }
.chat-group h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.chat-item { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13.5px; }
.chat-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item small { color: var(--text-muted); white-space: nowrap; }
.chat-item:hover { background: var(--hover); }
.chat-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.chat-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; min-height: calc(100vh - 140px); }
.chat-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.chat-head h2 { font-size: 20px; margin: 0; }
.chat-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.chat-thread { display: flex; flex-direction: column; gap: 18px; flex: 1; }
.chat-msg.user { align-self: flex-end; max-width: min(720px, 85%); }
.chat-msg.user .bubble { background: var(--accent-soft); color: var(--text-primary); border-radius: var(--radius) var(--radius) 4px var(--radius);
  padding: 10px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg.assistant { background: var(--surface-1); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 22px; min-width: 0; }
.chat-msg.view { margin-top: 0; }
.chat-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.answer { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol { margin: 0 0 10px; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 2px 0; }
.md h3, .md h4 { color: var(--text-primary); margin: 14px 0 6px; font-size: 15px; }
.md code, .chat-tools code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--surface-2);
  padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote, .chat-question { margin: 0; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.chat-question div { white-space: pre-wrap; }
.chat-table { max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.chat-table th, .chat-table td { padding: 8px 12px; }
.chat-table th { position: sticky; top: 0; border-radius: 0; }
.chat-chart { margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.chat-chart figcaption { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13.5px; }
.chat-chart .chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chat-chart [hidden] { display: none; }
.chat-chart .chat-table { margin-top: 10px; }
.chat-tools { font-size: 12.5px; color: var(--text-secondary); }
.chat-tools summary { cursor: pointer; }
.chat-tools ol { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.chat-tools li code { display: inline-block; margin-left: 6px; max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
.chat-working { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); }
.chat-working small { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: chat-dot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dots i { animation: none; opacity: .7; } }
.chat-error { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--critical-soft); color: var(--critical-text); }
.chat-error svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; }
.chat-welcome { padding: 28px 4px 8px; }
.chat-welcome h2 { font-size: 22px; margin: 0 0 4px; }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chat-suggest .btn { font-weight: 500; text-align: left; }
.chat-composer { position: sticky; bottom: 0; background: var(--page); padding: 8px 0 4px; display: flex; flex-direction: column; gap: 6px; }
.chat-input { display: flex; align-items: flex-end; gap: 8px; background: var(--surface-1); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.chat-input:focus-within { border-color: var(--accent); }
.chat-input textarea { flex: 1; font-family: var(--font); border: 0; box-shadow: none; resize: none; padding: 7px 4px; max-height: 220px; background: transparent; }
.chat-input textarea:focus { box-shadow: none; }
.icon-btn { padding: 6px 8px; }
.icon-btn svg { width: 18px; height: 18px; }
.chat-docs { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-msg.user .chat-docs { margin-top: 8px; }
.chat-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 6px 3px 8px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface-1); font-size: 12.5px; color: var(--text-primary); }
.chat-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.chat-chip small { color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.chat-chip svg { width: 13px; height: 13px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; }
.chat-chip button { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--text-muted); display: inline-flex; }
.chat-chip.reading { opacity: .75; }
.chat-chip.error { border-color: var(--critical-text); color: var(--critical-text); }
.chat-chip.error small { color: var(--critical-text); }
@media (max-width: 900px) {
  .chat { grid-template-columns: 1fr; }
  .chat-side { position: static; max-height: none; order: 2; }
  .chat-msg.user { max-width: 100%; }
  .chat-msg.assistant { padding: 14px 16px; }
}
.power-btn { padding: 6px 10px; font-size: 12.5px; color: var(--text-secondary); }
.power-btn[aria-pressed="true"] { color: var(--accent-text); }
.chat-model { margin: 0; font-size: 12px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.chat-model svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.chat-ctx { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 6px; padding: 5px 10px;
  border-radius: var(--radius-sm); font-size: 13px; }
.chat-ctx:hover { background: var(--hover); }
.chat-ctx a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-primary); }
.chat-ctx a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-ctx svg { width: 13px; height: 13px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; }
.chat-ctx small { color: var(--text-muted); white-space: nowrap; }
.icon-x { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--text-muted); display: inline-flex; }
.icon-x:hover { color: var(--critical-text); }
.chat-group .btn.small { margin-top: 6px; }
