/* DraftPiece — app styles. Mobile first; desktop gets the left rail at 900px. */
:root {
  --accent: #b3312c; --accent-ink: #fff; --accent-soft: #f7e4e2; --accent-line: #e8b9b5;
  --ink: #241316; --ink-2: #4a3a3c; --muted: #6b6466; --line: #e5e1de; --line-2: #d6d0cc;
  --bg: #f4f3f0; --card: #fff; --rail: #fbfaf8; --grid: #dfe5dc; --grid-line: #cfd8cb;
  --ok: #1f7a3a; --ok-soft: #e4f3e7; --warn: #9a5b00; --warn-soft: #fdf1dc; --bad: #b42318; --bad-soft: #fde8e6;
  --s1: #257de0; --s2: #f2a600;          /* chart series: validated pair (dataviz validator, light surface) */
  --r: 14px; --r-sm: 10px; --shadow: 0 1px 2px rgba(36,19,22,.06), 0 4px 14px rgba(36,19,22,.05);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Barlow Condensed', 'Inter', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, white); outline-offset: 2px; border-radius: 6px; }

/* ---------- buttons, fields, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font-weight: 650; font-size: 14.5px; white-space: nowrap; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: #bdb5b0; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(.95); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.danger { color: var(--bad); border-color: #f0c4bf; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn.icon { padding: 0; width: 44px; }
.btn.sm.icon { width: 36px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.field { display: grid; gap: 6px; margin: 0 0 14px; }
.field > span, .lbl { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.input, select.input, textarea.input { width: 100%; min-height: 46px; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; background: #fff; font-size: 16px; }
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.bad { border-color: var(--bad); background: #fff8f7; }
.hint { font-size: 12.5px; color: var(--muted); }
.ferr { font-size: 12.5px; color: var(--bad); font-weight: 600; min-height: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; font-weight: 700; font-size: 13.5px; white-space: nowrap; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); border-color: #b7dcbf; color: var(--ok); }
.badge.warn { background: var(--warn-soft); border-color: #f1d29a; color: var(--warn); }
.badge.bad { background: var(--bad-soft); border-color: #f2b8b1; color: var(--bad); }
.badge.acc { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.badge.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.switch { position: relative; display: inline-flex; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #cfc9c5; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--accent-line); outline-offset: 2px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card h2, .card h3 { margin: 0 0 4px; }
.note { display: flex; gap: 10px; align-items: flex-start; border: 1px dashed #c9c3bf; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; color: var(--ink-2); background: #faf9f7; }
.note svg { margin-top: 1px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty h3 { color: var(--ink); margin: 8px 0 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }

/* ---------- toast + dialogs ---------- */
#toast { position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 1000; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--bad); }
dialog.modal { border: 0; border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: 0 20px 60px rgba(0,0,0,.3); color: var(--ink); }
dialog.modal::backdrop { background: rgba(20, 12, 13, .45); }
.mhead { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.mhead h3 { margin: 0; font-size: 18px; flex: 1; }
.mbody { padding: 18px; overflow: auto; }
.mfoot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; position: sticky; bottom: 0; background: #fff; }
@media (max-width: 640px) {
  dialog.modal.sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; padding-bottom: var(--safe-b); }
}

/* ---------- auth ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--grid); background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 24px 24px; }
.auth-card { width: min(440px, 100%); background: #fff; border-radius: 20px; padding: 28px 24px; box-shadow: 0 10px 40px rgba(36,19,22,.12); }
.brandmark { width: 56px; height: 56px; border-radius: 14px; background: var(--ink); display: grid; place-items: center; color: #fff; position: relative; }
.brandmark::after { content: ''; position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.brandmark svg { width: 30px; height: 30px; }
.auth h1 { font-family: var(--display); font-size: 34px; letter-spacing: .02em; text-transform: uppercase; margin: 14px 0 2px; line-height: 1; }
.auth .tag { color: var(--muted); margin: 0 0 20px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: #f1eeeb; border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 18px; }
.tabs button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; color: var(--ink-2); }
.tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.linkbtn { background: none; border: 0; color: var(--accent); font-weight: 650; padding: 8px 0; text-decoration: underline; }

/* ---------- shell ---------- */
.shell { min-height: 100dvh; }
.rail { display: none; }
.main { min-width: 0; padding-bottom: calc(74px + var(--safe-b)); }
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255,255,255,.97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + var(--safe-b)); }
.bottomnav a, .bottomnav button { display: grid; justify-items: center; gap: 3px; padding: 6px 2px; border: 0; background: none; color: var(--muted); font-size: 11.5px; font-weight: 650; text-decoration: none; min-height: 52px; border-radius: 12px; }
.bottomnav svg.i { width: 24px; height: 24px; }
.bottomnav .on { color: var(--accent); }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 16px; font-size: 14px; font-weight: 600; }
.banner.info { background: #e8f1fc; color: #1b4f8a; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.success { background: var(--ok-soft); color: var(--ok); }
.banner.maint { background: var(--ink); color: #fff; }
.banner button { margin-left: auto; }
.page { padding: 16px; max-width: 1200px; margin: 0 auto; }
.ptitle { font-family: var(--display); text-transform: uppercase; letter-spacing: .04em; font-size: 28px; margin: 4px 0 2px; line-height: 1.05; }
.psub { color: var(--muted); margin: 0 0 18px; }
.mtop { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--rail); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.mtop .brandmark { width: 38px; height: 38px; border-radius: 11px; }
.mtop .brandmark svg { width: 22px; height: 22px; }
.mtop .brandmark::after { width: 7px; height: 7px; top: 6px; right: 6px; }
.mtop b { font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; font-size: 20px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 14px; border: 1px solid var(--accent-line); flex: none; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 96px minmax(0, 1fr); }
  .rail { display: flex; flex-direction: column; align-items: stretch; gap: 2px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; background: var(--rail); border-right: 1px solid var(--line); padding: 14px 8px; }
  .rail a.brandmark { margin: 0 auto 16px; width: 54px; height: 54px; padding: 0; display: grid; place-items: center; background: var(--ink); color: #fff; border-radius: 14px; }
  .rail a.brandmark:hover { background: var(--ink); }
  .rail > * { flex: none; }
  .rail > .spacer { flex: 1 0 8px; }
  .rail a, .rail button { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; color: var(--ink-2); text-decoration: none; font-size: 12.5px; font-weight: 650; text-align: center; line-height: 1.15; border: 0; background: none; }
  .rail a svg.i, .rail button svg.i { width: 26px; height: 26px; }
  .rail a:hover { background: #f1eeeb; }
  .rail a.on { background: var(--accent-soft); color: var(--accent); }
  .rail .sep { height: 1px; background: var(--line); margin: 6px 10px; }
  .rail .soon { font-size: 9.5px; font-weight: 800; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
  .bottomnav, .mtop { display: none; }
  .main { padding-bottom: 0; }
  .page { padding: 28px 32px; }
  .ptitle { font-size: 34px; }
  #toast { bottom: 28px; }
}

/* ---------- dashboard ---------- */
.hero { display: grid; gap: 14px; margin-bottom: 18px; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 18px; }
.qcard { display: flex; gap: 14px; align-items: center; text-align: left; padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); min-height: 84px; }
.qcard .qi { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.qcard.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.qcard.primary .qi { background: var(--accent); color: #fff; }
.qcard b { display: block; font-size: 16px; }
.qcard span { font-size: 13px; opacity: .75; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.stat b { display: block; font-size: 26px; line-height: 1.1; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat span { font-size: 13px; color: var(--muted); }
.section-h { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 10px; }
.section-h h2 { margin: 0; font-size: 18px; }
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .tools { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tool { position: relative; display: grid; gap: 8px; padding: 16px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-height: 132px; align-content: start; }
.tool:hover { border-color: var(--accent-line); }
.tool .ti { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: #f1eeeb; color: var(--ink); }
.tool.live .ti { background: var(--accent); color: #fff; }
.tool b { font-size: 15.5px; }
.tool span { font-size: 12.5px; color: var(--muted); }
.tool .badge { position: absolute; top: 12px; right: 12px; }
.plist { display: grid; gap: 10px; }
.pitem { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); min-width: 0; }
.pitem .pi { width: 42px; height: 42px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.pitem .pt { min-width: 0; flex: 1; }
.pitem .pt b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem .pt span { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem a.open { text-decoration: none; color: inherit; display: flex; gap: 12px; align-items: center; min-width: 0; flex: 1; }

/* ---------- tool page (builder) ---------- */
.toolpage { display: flex; flex-direction: column; height: 100dvh; }
.tbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--rail); border-bottom: 1px solid var(--line); min-height: 60px; }
.tbar .ttl { display: none; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.tbar .ttl svg { color: var(--accent); }
.tbar .name { min-width: 0; flex: 1; max-width: 360px; min-height: 40px; border: 1px solid transparent; border-radius: 10px; background: #efece8; padding: 0 12px; font-size: 15px; font-weight: 600; }
.tbar .name:focus { outline: none; background: #fff; border-color: var(--accent); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: #b58a00; flex: none; }
.status.saved i { background: var(--ok); }
.status.dirty i { background: var(--accent); }
.status .txt { display: none; }
.tbar .wide { display: none; }
.frame { flex: 1; border: 0; width: 100%; background: var(--grid); min-height: 0; }
.toolpage + .bottomnav { display: none; }
@media (min-width: 640px) { .status .txt { display: inline; } }
@media (min-width: 900px) {
  .tbar { padding: 10px 16px; gap: 10px; }
  .tbar .ttl, .tbar .wide { display: inline-flex; }
  .tbar .narrow { display: none; }
}
@media (max-width: 899px) { .shell.tool-open .bottomnav { display: none; } .shell.tool-open .main { padding-bottom: 0; } .shell.tool-open .mtop { display: none; } }

/* ---------- menus ---------- */
.menu { position: fixed; z-index: 200; min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 36px rgba(0,0,0,.18); padding: 6px; }
.menu button, .menu a { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 44px; padding: 0 12px; border: 0; background: none; border-radius: 10px; text-align: left; font-weight: 600; text-decoration: none; color: var(--ink); font-size: 14.5px; }
.menu button:hover, .menu a:hover { background: #f4f1ee; }
.menu .danger { color: var(--bad); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.more-grid a, .more-grid button { display: grid; justify-items: center; gap: 6px; padding: 14px 6px; border-radius: 14px; background: #f6f4f1; border: 0; color: var(--ink); text-decoration: none; font-size: 12.5px; font-weight: 650; text-align: center; }
.more-grid svg.i { width: 26px; height: 26px; }

/* ---------- soon + printing guide ---------- */
.soon-hero { text-align: center; padding: 36px 18px; }
.soon-hero .ti { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.soon-hero .ti svg { width: 38px; height: 38px; }
.steps { counter-reset: s; display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; position: relative; padding: 12px 14px 12px 54px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.steps li::before { content: counter(s); position: absolute; left: 12px; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }

/* ---------- admin ---------- */
.admin { min-height: 100dvh; background: #f4f5f7; }
.ahead { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(244,245,247,.96); backdrop-filter: blur(8px); border-bottom: 1px solid #e3e5e9; }
.ahead h1 { margin: 0; font-size: 18px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asearch { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid #dfe2e7; background: #fff; font-weight: 600; color: var(--ink-2); }
.asearch kbd { font-family: inherit; font-size: 11.5px; border: 1px solid #dfe2e7; border-radius: 6px; padding: 1px 6px; background: #f7f8fa; display: none; }
.alayout { display: block; }
.anav { display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; scrollbar-width: none; border-bottom: 1px solid #e3e5e9; background: #f4f5f7; position: sticky; top: 61px; z-index: 29; }
.anav::-webkit-scrollbar { display: none; }
.anav a { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 40px; border-radius: 10px; color: #475467; text-decoration: none; font-weight: 650; font-size: 14px; white-space: nowrap; border: 1px solid #e3e5e9; background: #fff; }
.anav a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.anav a svg.i { width: 18px; height: 18px; }
.anav .cnt { background: var(--accent); color: #fff; border-radius: 99px; font-size: 11px; padding: 0 6px; line-height: 18px; }
.abody { padding: 16px 14px 40px; min-width: 0; }
@media (min-width: 1000px) {
  .asearch kbd { display: inline; }
  .ahead { padding: 12px 24px; }
  .ahead h1 { font-size: 20px; }
  .alayout { display: grid; grid-template-columns: 230px minmax(0, 1fr); }
  .anav { flex-direction: column; overflow: visible; border-bottom: 0; border-right: 1px solid #e3e5e9; padding: 18px 12px; position: sticky; top: 65px; height: calc(100dvh - 65px); background: #f4f5f7; gap: 2px; }
  .anav a { border: 0; background: transparent; min-height: 42px; }
  .anav a.on { background: var(--accent-soft); color: var(--accent); }
  .abody { padding: 22px 28px 60px; }
}
.ah2 { font-size: 16px; font-weight: 750; margin: 22px 0 10px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ah2:first-child { margin-top: 0; }
.ah2 small { font-weight: 500; color: var(--muted); font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.kpi { background: #fff; border: 1px solid #e3e5e9; border-radius: 12px; padding: 12px 14px; position: relative; min-width: 0; }
.kpi b { display: block; font-size: 22px; line-height: 1.15; }
.kpi span { font-size: 12.5px; color: var(--muted); }
.kpis.funnel .kpi:not(:last-child)::after { content: '→'; position: absolute; right: -9px; top: 50%; transform: translateY(-50%); color: #98a2b3; font-size: 13px; z-index: 1; background: #f4f5f7; line-height: 1; }
.panel { background: #fff; border: 1px solid #e3e5e9; border-radius: 14px; padding: 14px; min-width: 0; }
.chart { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.line { height: 3px; vertical-align: 3px; }
.tip { position: fixed; z-index: 300; pointer-events: none; background: #fff; color: var(--ink); border: 1px solid #dfe2e7; box-shadow: 0 8px 24px rgba(0,0,0,.15); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; min-width: 140px; opacity: 0; transition: opacity .08s; }
.tip.show { opacity: 1; }
.tip b { display: block; margin-bottom: 4px; }
.tip .r { display: flex; justify-content: space-between; gap: 14px; }
.tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.bars2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .bars2 { grid-template-columns: 1fr 1fr; gap: 20px 36px; } }
.blist h4 { margin: 0 0 6px; font-size: 14.5px; }
.brow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(70px, 1.3fr) 34px; gap: 10px; align-items: center; font-size: 13.5px; padding: 5px 0; border-bottom: 1px dashed #e3e5e9; }
.brow > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow .track { height: 8px; border-radius: 99px; background: #eef0f3; position: relative; }
.brow .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--s1); min-width: 6px; }
.brow b { text-align: right; }
.hd { display: grid; gap: 14px; }
@media (min-width: 900px) { .hd { grid-template-columns: 3fr 2fr; } }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .input { flex: 1 1 220px; min-height: 44px; }
.toolbar select.input { flex: 0 1 180px; }
.tablewrap { background: #fff; border: 1px solid #e3e5e9; border-radius: 14px; overflow: hidden; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: #667085; padding: 10px 12px; background: #f8f9fb; border-bottom: 1px solid #e3e5e9; white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid #eef0f3; vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #fafbfc; }
table.t .who b { display: block; }
table.t .who span { font-size: 12.5px; color: var(--muted); }
table.t input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
@media (max-width: 760px) {
  table.t.cards thead { display: none; }
  table.t.cards, table.t.cards tbody, table.t.cards tr, table.t.cards td { display: block; width: 100%; }
  table.t.cards tr { padding: 10px 12px; border-bottom: 1px solid #eef0f3; position: relative; }
  table.t.cards td { border: 0; padding: 2px 0 2px 32px; }
  table.t.cards td.cb { position: absolute; left: 12px; top: 12px; padding: 0; width: auto; }
  table.t.cards td[data-l]::before { content: attr(data-l) ': '; color: var(--muted); font-size: 12.5px; }
  table.t.cards td.nolbl::before { content: none; }
}
.bulk { position: sticky; bottom: calc(10px + var(--safe-b)); z-index: 20; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: 14px; padding: 10px 12px; margin-top: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.bulk .btn { min-height: 38px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid #e3e5e9; border-radius: 12px; background: #fff; margin-bottom: 10px; cursor: pointer; }
.radio-card input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--ok); flex: none; }
.radio-card.on { border-color: #9bcfa8; background: #f1f9f3; }
.radio-card b { display: block; }
.radio-card span { font-size: 13.5px; color: var(--muted); }
.setrow { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid #e3e5e9; border-radius: 12px; background: #fff; margin-bottom: 10px; }
.setrow .tx { flex: 1; min-width: 0; }
.setrow b { display: block; }
.setrow span { font-size: 13.5px; color: var(--muted); }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; min-width: 0; }
.listrow { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #eef0f3; flex-wrap: wrap; }
.listrow .tx { flex: 1 1 200px; min-width: 0; }
.listrow .tx b { display: block; overflow-wrap: anywhere; }
.listrow .tx span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.logrow { padding: 10px 0; border-bottom: 1px solid #e6e8ec; }
.logrow b { display: block; font-size: 14px; }
.logrow span { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.progress { height: 10px; border-radius: 99px; background: #f0e7d6; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--ok); border-radius: 99px; min-width: 6px; }
.grid2 { display: grid; gap: 14px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid #eef0f3; font-size: 14px; }
.kv:last-child { border-bottom: 0; }
.drawer-list { display: grid; gap: 2px; max-height: 260px; overflow: auto; }
.swatch { width: 44px; height: 44px; border: 1px solid var(--line-2); border-radius: 10px; padding: 3px; background: #fff; }
.report { background: #fff; border: 1px solid #e3e5e9; border-radius: 12px; padding: 14px; margin-bottom: 10px; }
.report p { margin: 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.skel { height: 80px; border-radius: 12px; background: linear-gradient(90deg, #eef0f3, #f7f8fa, #eef0f3); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.searchbox { display: grid; gap: 6px; }
.sres a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.sres a:hover, .sres a:focus { background: #f4f5f7; }
.sres small { color: var(--muted); display: block; }
.wide-only { display: none; }
@media (min-width: 640px) { .wide-only { display: inline; } }
@media (max-width: 899px) { .shell.tool-open .banner:not(.maint) { display: none; } }
