/* MMD-DEV design system.

   The interface is Persian and right-to-left. Layout uses LOGICAL properties
   (inline-start/end) rather than left/right so nothing needs mirroring by hand
   - and so the few deliberately left-to-right islands (terminal output,
   addresses, package names) can sit inside an RTL page without fighting it.

   Light and dark are both first-class: every colour is a token, defined once
   for light on :root and overridden wholesale for dark. */

/* Vazirmatn as a VARIABLE font: one 109 KB file covering 100-900, instead of
   three static cuts that only gave 400/500/700. Intermediate weights are what
   make a Persian interface look considered rather than blocky - 550 for
   buttons, 650 for headings, 300 for quiet text. */
@font-face{
  font-family:"Vazirmatn";font-style:normal;font-weight:100 900;
  font-display:swap;
  src:url("/static/vendor/vazirmatn-var.woff2") format("woff2-variations");
  src:url("/static/vendor/vazirmatn-var.woff2") format("woff2") tech(variations);
}
/* MMD-DEV design system.
   Light and dark are both first-class: every colour is a token, defined once
   for light on :root and overridden wholesale for dark. Nothing hard-codes a
   colour outside this block. */
:root{
  --bg:#f6f7f9;        --surface:#ffffff;    --surface-2:#f0f2f5;
  --border:#dfe3e8;    --border-strong:#c6ccd4;
  --ink:#151922;       --ink-2:#4a5261;      --ink-3:#79808d;
  --brand:#2f6df6;     --brand-ink:#ffffff;  --brand-soft:#e8f0fe;
  --ok:#0f9d58;        --ok-soft:#e6f4ec;
  --warn:#b26a00;      --warn-soft:#fdf1dd;
  --bad:#d13438;       --bad-soft:#fdeaea;
  --term-bg:#12141a;
  --shadow:0 1px 2px rgba(16,24,40,.06),0 4px 12px rgba(16,24,40,.06);
  --radius:10px; --radius-lg:14px;
  --header-h:60px;
}
:root[data-theme="dark"]{
  --bg:#0e1116;        --surface:#161a21;    --surface-2:#1d222b;
  --border:#282e39;    --border-strong:#3a424f;
  --ink:#e8ebf0;       --ink-2:#a9b1be;      --ink-3:#79828f;
  --brand:#5b9dff;     --brand-ink:#08121f;  --brand-soft:#16273f;
  --ok:#3ecf8e;        --ok-soft:#10261d;
  --warn:#f0a83c;      --warn-soft:#2a2113;
  --bad:#f2555a;       --bad-soft:#2b1618;
  --term-bg:#0b0d11;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 6px 20px rgba(0,0,0,.3);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#0e1116;      --surface:#161a21;    --surface-2:#1d222b;
    --border:#282e39;  --border-strong:#3a424f;
    --ink:#e8ebf0;     --ink-2:#a9b1be;      --ink-3:#79828f;
    --brand:#5b9dff;   --brand-ink:#08121f;  --brand-soft:#16273f;
    --ok:#3ecf8e;      --ok-soft:#10261d;
    --warn:#f0a83c;    --warn-soft:#2a2113;
    --bad:#f2555a;     --bad-soft:#2b1618;
    --term-bg:#0b0d11;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 6px 20px rgba(0,0,0,.3);
  }
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;background:var(--bg);color:var(--ink);
  /* Persian glyphs carry more vertical detail than Latin, so they want a
     slightly larger size and noticeably more leading to stay legible. */
  font-family:"Vazirmatn",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Tahoma,sans-serif;
  font-size:15.5px;
  line-height:1.85;
  font-weight:400;
  font-variation-settings:"wght" 400;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
  /* Persian numerals and proportional figures render better with these off. */
  font-feature-settings:"ss01","ss02";
}
/* Islands that must stay left-to-right inside an RTL page: terminal output,
   host:port addresses, package names, anything copied into a shell. */
.ltr,.mono,code,pre,input[type="number"],input[type="email"],input[type="password"]{
  direction:ltr;text-align:left;
}
[dir="rtl"] .mono,[dir="rtl"] .ltr{unicode-bidi:isolate}
a{color:var(--brand);text-decoration:none}
a:hover{text-decoration:underline}
h1{font-size:26px;line-height:1.5;margin:0 0 6px;font-weight:700;letter-spacing:0}
h2{font-size:17px;line-height:1.6;margin:0 0 4px;font-weight:650}
h3{font-size:15px;line-height:1.6;margin:0 0 10px;font-weight:650;color:var(--ink-2)}
/* Persian has no capitals, so letter-spacing tricks that work for Latin
   headings only smear it. Weight and size carry the hierarchy instead. */
p{margin:0 0 12px}
.muted{color:var(--ink-2)} .dim{color:var(--ink-3)}
.small{font-size:13.5px;line-height:1.75} .tiny{font-size:12.5px;line-height:1.7}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.94em}
.nowrap{white-space:nowrap}

/* ---- header ---- */
.header{
  position:sticky;top:0;z-index:40;height:var(--header-h);
  background:var(--surface);border-bottom:1px solid var(--border);
  display:flex;align-items:center;gap:18px;padding:0 20px;
}
.brand{display:flex;align-items:center;gap:9px;font-weight:750;font-size:16px;
  white-space:nowrap;flex:0 0 auto}
.brand>span:last-child{direction:ltr;unicode-bidi:isolate}
.brand .logo{
  width:26px;height:26px;border-radius:7px;background:var(--brand);
  color:var(--brand-ink);display:grid;place-items:center;flex:none;
}
/* The nav must be allowed to shrink and scroll rather than squeeze its
   items - a truncated Persian label loses its meaning entirely. */
.nav{display:flex;gap:2px;margin-inline-start:8px;overflow-x:auto;
  scrollbar-width:none;min-width:0;flex:1 1 auto}
.nav::-webkit-scrollbar{display:none}
.nav a{
  display:flex;align-items:center;gap:7px;padding:7px 12px;border-radius:8px;
  color:var(--ink-2);font-size:14.5px;font-weight:500;white-space:nowrap;
  flex:0 0 auto;
}
.nav a:hover{background:var(--surface-2);color:var(--ink);text-decoration:none}
.nav a.active{background:var(--brand-soft);color:var(--brand)}
.spacer{flex:1}
.header-right{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.credit-chip{
  display:flex;align-items:center;gap:7px;padding:6px 11px;border-radius:999px;
  background:var(--surface-2);border:1px solid var(--border);
  font-size:13px;font-weight:650;font-variant-numeric:tabular-nums;
}
.credit-chip.low{background:var(--warn-soft);border-color:var(--warn);color:var(--warn)}

/* ---- layout ---- */
.page{max-width:1080px;margin:0 auto;padding:28px 20px 72px}
.page-head{margin-bottom:22px}
.row{display:flex;gap:14px;flex-wrap:wrap}
.row>*{flex:1 1 190px;min-width:0}
.grid{display:grid;gap:14px}
.between{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}

.card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:20px;box-shadow:var(--shadow);
  margin-bottom:16px;
}
.card.pad0{padding:0;overflow:hidden}
.card-head{padding:16px 20px;border-bottom:1px solid var(--border);
  display:flex;align-items:center;justify-content:space-between;gap:12px}
.card-body{padding:20px}

/* ---- controls ---- */
label{display:block;font-size:13px;font-weight:600;color:var(--ink-2);margin:0 0 6px}
input,select,textarea{
  width:100%;padding:10px 12px;background:var(--surface);color:var(--ink);
  border:1px solid var(--border-strong);border-radius:9px;font:inherit;
}
input:focus,select:focus,textarea:focus{
  outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft);
}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  padding:10px 15px;border-radius:9px;border:1px solid var(--border-strong);
  background:var(--surface);color:var(--ink);font:inherit;font-weight:550;
  cursor:pointer;transition:background .12s,border-color .12s,opacity .12s;
  white-space:nowrap;
}
.btn:hover:not(:disabled){background:var(--surface-2);border-color:var(--ink-3)}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn.primary{background:var(--brand);border-color:var(--brand);color:var(--brand-ink)}
.btn.primary:hover:not(:disabled){filter:brightness(1.08);background:var(--brand)}
.btn.danger{border-color:var(--bad);color:var(--bad);background:transparent}
.btn.danger:hover:not(:disabled){background:var(--bad-soft)}
.btn.ghost{border-color:transparent;background:transparent;color:var(--ink-2)}
.btn.ghost:hover:not(:disabled){background:var(--surface-2);color:var(--ink)}
.btn.sm{padding:6px 10px;font-size:13px;border-radius:8px}
.btn.icon{padding:8px;width:36px;height:36px}
.btn-row{display:flex;gap:10px;flex-wrap:wrap}

/* ---- status ---- */
.pill{
  display:inline-flex;align-items:center;gap:8px;padding:5px 12px;
  border-radius:999px;font-size:13px;font-weight:650;
  background:var(--surface-2);border:1px solid var(--border);
}
.dot{width:8px;height:8px;border-radius:50%;background:var(--ink-3);flex:none}
.dot.on{background:var(--ok);box-shadow:0 0 0 3px var(--ok-soft)}
.dot.busy{background:var(--warn);animation:pulse 1.4s ease-in-out infinite}
.dot.bad{background:var(--bad)}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.35}}

.note{padding:12px 14px;border-radius:10px;font-size:14px;margin:14px 0 0;
  border:1px solid transparent;display:flex;gap:10px;align-items:flex-start}
.note svg{flex:none;margin-top:2px}
.note.ok{background:var(--ok-soft);border-color:var(--ok);color:var(--ok)}
.note.warn{background:var(--warn-soft);border-color:var(--warn);color:var(--warn)}
.note.bad{background:var(--bad-soft);border-color:var(--bad);color:var(--bad)}
.note.info{background:var(--surface-2);border-color:var(--border);color:var(--ink-2)}

.stat{background:var(--surface-2);border:1px solid var(--border);
  border-radius:var(--radius);padding:14px 16px}
.stat .k{font-size:12.5px;font-weight:600;color:var(--ink-3);letter-spacing:0}
.stat .v{font-size:24px;font-weight:700;margin-top:4px;line-height:1.4;
  font-variant-numeric:tabular-nums;letter-spacing:0}
.stat .v small{font-size:13px;font-weight:600;color:var(--ink-3);margin-inline-start:5px}
.bar{height:6px;background:var(--border);border-radius:4px;overflow:hidden;margin-top:9px}
.bar>i{display:block;height:100%;background:var(--brand);border-radius:4px;transition:width .3s}
.bar>i.warn{background:var(--warn)} .bar>i.bad{background:var(--bad)}

/* ---- table ---- */
table{width:100%;border-collapse:collapse;font-size:14px}
th,td{text-align:start;padding:11px 14px;border-bottom:1px solid var(--border)}
th{font-size:12.5px;font-weight:650;color:var(--ink-3);background:var(--surface-2);
  letter-spacing:0}
tbody tr:last-child td{border-bottom:none}
tbody tr:hover{background:var(--surface-2)}
td.num,th.num{text-align:end;font-variant-numeric:tabular-nums;direction:ltr}
.table-wrap{overflow-x:auto}

/* ---- auth pages ---- */
.auth{min-height:100vh;display:grid;place-items:center;padding:24px}
.auth-card{width:100%;max-width:410px}
.auth-card .card{margin:0}
.auth-head{text-align:center;margin-bottom:22px}
.auth-head .logo{width:44px;height:44px;border-radius:12px;background:var(--brand);
  color:var(--brand-ink);display:grid;place-items:center;margin:0 auto 14px}
.field{margin-bottom:15px}
.auth-alt{text-align:center;margin-top:16px;font-size:14px;color:var(--ink-2)}

/* ---- size picker ---- */
.opts{display:grid;grid-template-columns:repeat(auto-fit,minmax(104px,1fr));gap:9px}
.opt{
  padding:13px 10px;border:1.5px solid var(--border-strong);border-radius:11px;
  background:var(--surface);cursor:pointer;text-align:center;transition:all .12s;
}
.opt:hover{border-color:var(--brand)}
.opt.sel{border-color:var(--brand);background:var(--brand-soft);color:var(--brand)}
.opt .big{font-size:19px;font-weight:700;letter-spacing:-.02em}
.opt .sub{font-size:11px;color:var(--ink-3);margin-top:2px}
.opt.sel .sub{color:var(--brand)}

/* ---- terminal ---- */
.term-shell{border:1px solid var(--border);border-radius:var(--radius);
  overflow:hidden;background:var(--term-bg)}
.term-bar{display:flex;align-items:center;gap:8px;padding:8px 12px;
  background:var(--surface-2);border-bottom:1px solid var(--border)}
.term-bar .grow{flex:1}
/* content-box is load-bearing, not a style choice.
   xterm's FitAddon sizes the terminal from getComputedStyle(parent).height and
   subtracts only the padding of xterm's OWN element - never the parent's. Under
   the global border-box, Chrome reports that height as 440px while the content
   box is 420px, so the addon lays out ~12px more terminal than there is room
   for and .term-shell{overflow:hidden} clips it. The visible symptom is the
   bottom line - the prompt - being cut in half.
   With content-box the declared height IS the content height, so what the
   addon measures and what the box can show are the same number. */
#term{box-sizing:content-box;height:420px;padding:10px 12px;background:var(--term-bg)}
.term-shell{display:flex;flex-direction:column}
.term-shell.full{position:fixed;inset:0;z-index:100;border-radius:0;border:none}
.term-shell.full #term{height:auto;flex:1;min-height:0}
/* Fullscreen flexes the border box, so the content box - and therefore what
   the addon measures - stays 20px smaller. Consistent either way. */
/* The controls live INSIDE the shell. When the shell goes full-bleed, anything
   outside it disappears - which is how the exit button once became
   unreachable, leaving no way out but the keyboard. */
.term-controls{display:flex;align-items:center;gap:6px;padding:7px 10px;
  background:var(--surface-2);border-bottom:1px solid var(--border);flex:none}
.term-controls .grow{flex:1}
.term-shell:not(.full) .term-controls{display:none}
.term-hint{position:fixed;inset-block-start:14px;inset-inline-start:50%;
  transform:translateX(50%);z-index:101;padding:10px 18px;border-radius:999px;
  background:var(--surface);border:1px solid var(--brand);color:var(--ink);
  box-shadow:var(--shadow);font-size:14px;font-weight:600;
  animation:slide .2s ease-out}
kbd{display:inline-block;padding:1px 7px;border:1px solid var(--border-strong);
  border-bottom-width:2px;border-radius:5px;background:var(--surface-2);
  font-family:ui-monospace,monospace;font-size:.85em;margin:0 3px}
/* xterm's own scrollbar is a bare native one; match it to the theme. */
.xterm .xterm-viewport{scrollbar-width:thin;scrollbar-color:var(--border-strong) transparent}
.xterm .xterm-viewport::-webkit-scrollbar{width:11px}
.xterm .xterm-viewport::-webkit-scrollbar-track{background:transparent}
.xterm .xterm-viewport::-webkit-scrollbar-thumb{
  background:var(--border-strong);border-radius:6px;
  border:3px solid var(--term-bg);background-clip:padding-box;
}
.xterm .xterm-viewport::-webkit-scrollbar-thumb:hover{background:var(--ink-3);
  border:3px solid var(--term-bg);background-clip:padding-box}

/* ---- misc ---- */
.toast-wrap{position:fixed;inset-inline-start:18px;bottom:18px;z-index:200;
  display:flex;flex-direction:column;gap:9px}
.toast{padding:12px 16px;border-radius:10px;background:var(--surface);
  border:1px solid var(--border);box-shadow:var(--shadow);font-size:14px;
  max-width:380px;animation:slide .18s ease-out}
.toast.bad{border-color:var(--bad);color:var(--bad)}
.toast.ok{border-color:var(--ok);color:var(--ok)}
@keyframes slide{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.empty{text-align:center;padding:44px 20px;color:var(--ink-3)}
.empty svg{opacity:.4;margin-bottom:12px}
.spinner{width:16px;height:16px;border:2px solid var(--border);
  border-top-color:var(--brand);border-radius:50%;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.chart{display:flex;align-items:flex-end;justify-content:flex-start;
  gap:3px;height:130px;padding-top:10px}
/* max-width matters: with only two data points, flex:1 stretched each bar to
   half the card and the chart read as a colour block rather than a chart. */
.chart .col{flex:1 1 0;max-width:26px;background:var(--brand);
  border-radius:3px 3px 0 0;min-height:2px;opacity:.85;transition:opacity .12s}
.chart .col:hover{opacity:1}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
/* Eight nav items plus brand, balance and two buttons do not fit 1280px with
   full Persian labels - the last one clips to a meaningless stub. Drop to
   icons early rather than letting a label truncate. */
@media (max-width:1180px){
  .nav a span{display:none}
  .nav a{padding:8px 10px}
}
@media (max-width:720px){
  .page{padding:20px 14px 60px}
  .credit-chip .lbl{display:none}
  .header{gap:10px;padding:0 12px}
}

/* ---- landing page ---- */
.lp{max-width:1080px;margin:0 auto;padding:0 20px}
.lp-nav{display:flex;align-items:center;gap:14px;padding:18px 0}
.lp-hero{padding:56px 0 40px;text-align:center}
.lp-hero h1{font-size:42px;line-height:1.5;font-weight:800;letter-spacing:0;margin:0 0 16px}
.lp-hero .lead{font-size:18px;line-height:2;color:var(--ink-2);max-width:660px;margin:0 auto 28px}
.lp-badge{display:inline-flex;align-items:center;gap:8px;padding:6px 14px;
  border-radius:999px;background:var(--brand-soft);color:var(--brand);
  font-size:13px;font-weight:650;margin-bottom:18px}
.lp-cta{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}
.lp-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:16px;padding:26px 0}
.lp-feat{background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:22px}
.lp-feat .ic{width:38px;height:38px;border-radius:10px;background:var(--brand-soft);
  color:var(--brand);display:grid;place-items:center;margin-bottom:12px}
.lp-feat h3{font-size:16px;color:var(--ink);margin:0 0 6px}
.lp-feat p{font-size:14px;color:var(--ink-2);margin:0}
.lp-price{background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:26px;text-align:center}
.lp-price .amt{font-size:34px;font-weight:750;letter-spacing:0;line-height:1.4}
.lp-price .per{color:var(--ink-3);font-size:14px}
.lp-foot{padding:36px 0;color:var(--ink-3);font-size:13px;text-align:center;
  border-top:1px solid var(--border);margin-top:36px}
.lp-steps{counter-reset:s;display:grid;gap:14px;padding:8px 0}
.lp-step{display:flex;gap:14px;align-items:flex-start}
.lp-step .n{flex:none;width:30px;height:30px;border-radius:50%;
  background:var(--brand);color:var(--brand-ink);display:grid;place-items:center;
  font-weight:700;font-size:14px}
@media (max-width:720px){.lp-hero h1{font-size:29px}}

/* ---- code editor ---- */
/* CodeMirror sits inside an RTL document but code is always left-to-right;
   without this the gutter jumps sides and lines render mirrored. */
.CodeMirror{
  direction:ltr;text-align:left;height:auto;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:13.5px;line-height:1.6;border-radius:10px;
  border:1px solid var(--border);
}
.CodeMirror-gutters{border-inline-end:1px solid var(--border)}
#cmwrap{direction:ltr}
.cm-s-eclipse.CodeMirror{background:var(--surface)}

/* ---- tabs ---- */
.tabs2{display:flex;gap:4px;border-bottom:1px solid var(--border);margin-bottom:20px}
.tabs2 a{
  display:flex;align-items:center;gap:8px;padding:11px 16px;
  color:var(--ink-2);font-weight:550;font-size:14.5px;
  border-bottom:2px solid transparent;margin-bottom:-1px;white-space:nowrap;
}
.tabs2 a:hover{color:var(--ink);text-decoration:none}
.tabs2 a.active{color:var(--brand);border-bottom-color:var(--brand)}
.tabs2 .badge{font-size:11px;padding:1px 7px;border-radius:999px;
  background:var(--surface-2);border:1px solid var(--border);font-weight:600}
.tabs2 .badge.on{background:var(--ok-soft);border-color:var(--ok);color:var(--ok)}

/* ---- file rows ---- */
tbody tr[data-row] a{color:var(--ink)}
tbody tr[data-row]:hover a{color:var(--brand)}
/* File names are data, not prose. Without isolation the bidi algorithm moves
   a leading dot to the end, so ".cache" reads as "cache." - wrong, and
   confusing next to a real file called "cache." */
tbody tr[data-row] a.ltr{unicode-bidi:isolate;direction:ltr}

/* Marks a form field the server will refuse without. */
.req { color: var(--bad); font-weight: 700; }

/* Two-column "what moves / what never moves" panel on the AI page. */
.copybox{border:1px solid var(--border);border-radius:10px;padding:14px 16px;
  background:var(--surface-2)}
.copybox-h{display:flex;align-items:center;gap:7px;font-weight:700;font-size:13.5px;
  margin-bottom:8px}
.copybox-h svg{width:16px;height:16px;flex:none}
.copybox ul{margin:0;padding-inline-start:20px;color:var(--ink-2);font-size:13.5px;
  line-height:1.9}
.copybox.ok{border-color:var(--ok)} .copybox.ok .copybox-h{color:var(--ok)}
.copybox.bad{border-color:var(--bad)} .copybox.bad .copybox-h{color:var(--bad)}

/* --- support tickets ---------------------------------------------------- */
/* Conversation transcript. `mine` flips the bubble to the reading side, which
   under RTL is the right - so `margin-inline-start:auto` rather than left. */
.chat{display:flex;flex-direction:column;gap:14px;max-height:56vh;overflow-y:auto;
  padding:4px 2px}
.msg{max-width:min(78%,620px)}
.msg.mine{margin-inline-start:auto;text-align:start}
.msg-who{font-size:12px;font-weight:700;color:var(--ink-3);margin-bottom:4px}
.msg .bubble{background:var(--surface-2);border:1px solid var(--border);
  border-radius:12px;padding:11px 14px;font-size:14px;line-height:1.85;
  white-space:pre-wrap;overflow-wrap:anywhere}
.msg.mine .bubble{background:var(--brand-soft);border-color:var(--brand)}
.msg-at{margin-top:4px}

/* Status filter chips on the staff queue. */
.fchips{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.fchip{display:inline-flex;align-items:center;gap:6px;padding:6px 13px;
  border:1px solid var(--border);border-radius:999px;background:var(--surface);
  font-size:13px;color:var(--ink-2)}
.fchip:hover{text-decoration:none;color:var(--ink)}
.fchip.active{border-color:var(--brand);color:var(--brand);background:var(--brand-soft)}

tr.clickable{cursor:pointer}
tr.clickable:hover{background:var(--surface-2)}

/* Unread counter on a nav item. */
.navbadge{display:inline-block;min-width:18px;padding:0 5px;margin-inline-start:6px;
  border-radius:999px;background:var(--bad);color:#fff;font-size:11px;
  font-weight:700;line-height:18px;text-align:center}

/* --- destructive actions ------------------------------------------------ */
/* Visually separated from the rest of the page, because a control that
   destroys a machine should not sit in the same visual weight as one that
   resizes it. */
.danger-zone{border-color:var(--bad)}
.danger-zone h3{color:var(--bad);margin:0}

.danger-wrap{position:fixed;inset:0;z-index:150;display:grid;place-items:center;
  background:rgba(0,0,0,.55);padding:20px;overflow-y:auto}
.danger-card{max-width:560px;width:100%;margin:auto;border-color:var(--bad)}
.danger-title{color:var(--bad);margin-top:0}
.acks{display:flex;flex-direction:column;gap:9px;padding:12px 14px;
  border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}
.ack{display:flex;align-items:flex-start;gap:9px;margin:0;font-size:13.5px;
  font-weight:500;color:var(--ink-2);cursor:pointer;line-height:1.7}
.ack input{margin:3px 0 0;flex:none;width:16px;height:16px;accent-color:var(--bad)}
.ack:hover{color:var(--ink)}

/* --- usage charts -------------------------------------------------------- */
.winpick{display:flex;gap:4px;flex-wrap:wrap}
.winpick button{padding:4px 11px;border:1px solid var(--border);border-radius:999px;
  background:var(--surface);color:var(--ink-2);font-size:12.5px;font-family:inherit;
  cursor:pointer;line-height:1.7}
.winpick button:hover{color:var(--ink);border-color:var(--border-strong)}
.winpick button.active{border-color:var(--brand);color:var(--brand);
  background:var(--brand-soft);font-weight:600}
.chart-legend{display:flex;justify-content:space-between;align-items:baseline;
  gap:10px;margin-top:6px;flex-wrap:wrap}
.chart-legend b{font-size:15px;font-weight:700;color:var(--ink)}
.chart-empty{padding:22px 0;text-align:center}

/* Unread markers on the ticket lists.
   `.badge` previously had a rule ONLY inside .tabs2, so the "new" marker on the
   support list rendered as unstyled inline text - present in the DOM, invisible
   in practice, which is exactly what a customer reported: the nav counter said
   1 and the list looked like nothing had changed. */
.badge{display:inline-block;font-size:11px;font-weight:700;line-height:18px;
  padding:0 8px;border-radius:999px;border:1px solid var(--border);
  background:var(--surface-2);color:var(--ink-3);vertical-align:middle;
  margin-inline-start:7px}
.badge.new{background:var(--bad);border-color:var(--bad);color:#fff}
/* The row itself, so the eye finds it without reading every subject. */
tr.unread td{background:var(--bad-soft)}
tr.unread td:first-child{box-shadow:inset 3px 0 0 var(--bad)}
tr.unread:hover td{background:var(--bad-soft);filter:brightness(.98)}
