/* Dana, Persian numerals. Bundled, never fetched: a font that loads from
   somebody else's CDN is a font that does not load at all on a blocked network,
   and the interface it was meant for is the one that breaks. */
@font-face { font-family: Dana; src: url('/fonts/DanaFaNum-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: Dana; src: url('/fonts/DanaFaNum-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: Dana; src: url('/fonts/DanaFaNum-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #12100f;
  --surface: #1b1817;
  --surface-2: #232020;
  --line: #322d2c;
  --ink: #f2ede9;
  --ink-dim: #a49b96;
  --ink-faint: #6f6662;
  --accent: #f4d35e;
  --accent-ink: #2a2206;
  --brand: #8d1f31;
  --ok: #7fc08a;
  --warn: #e8b54a;
  --alert: #e2725b;
  --info: #7aa7d8;
  --radius: 10px;
  --gap: 14px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="light"] {
  --bg: #f6f2ec;
  --surface: #fffdfa;
  --surface-2: #f0eae2;
  --line: #ded5ca;
  --ink: #241f1c;
  --ink-dim: #61574f;
  --ink-faint: #8d8179;
  --accent: #b4881a;
  --accent-ink: #fffdf5;
  --brand: #8d1f31;
}

* { box-sizing: border-box; }

/* The `hidden` attribute only works because the browser's own stylesheet says
   display:none, and ANY rule here that sets display beats it. That is not a
   nuisance, it is a whole class of bug: the sign-in overlay is position:fixed
   with display:grid, so a page that had logged in perfectly well still showed
   the login form on top of it — which reads, correctly, as "I cannot log in".
   Every element that hides itself needs this one line to mean what it says. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Dana, system-ui, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.4; }

/* ───────────────────────────── buttons ───────────────────────────── */

.btn {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s, opacity .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-faint); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.btn-ghost { background: transparent; }
.btn-small { padding: 4px 10px; font-size: 13px; }
.btn-icon { padding: 6px 10px; background: transparent; }
.btn-danger { color: var(--alert); }

/* ───────────────────────────── form fields ───────────────────────── */

/* Every text-like field, however it was written.
 *
 * The previous version listed types — input[type="text"], and so on — which
 * misses the most common way to write one: an <input> with no type at all is a
 * text input, and matched none of them. Those fields rendered as the browser's
 * raw default sitting next to styled ones. Listing what is NOT a text field is
 * shorter and cannot be defeated by leaving an attribute out. */
/* The terminal is excluded. xterm keeps an invisible textarea to capture
   keystrokes, positioned against the cursor; giving it padding and a background
   moves it, and a broad rule would have. It is not one of our fields. */
input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="file"]):not([type="range"]):not([type="color"]),
.input, .select, select, textarea:not(.xterm-helper-textarea) {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  transition: border-color .15s, background .15s, box-shadow .15s;
  resize: vertical;
}

input::placeholder, textarea::placeholder { color: var(--ink-faint); }

input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):hover:not(:disabled),
select:hover:not(:disabled), textarea:not(.xterm-helper-textarea):hover:not(:disabled) {
  border-color: var(--ink-faint);
}

/* A visible focus ring rather than the browser's, which disappears against a
   dark field. :focus-visible so a click does not draw one but the keyboard does
   — a form you can only navigate by mouse is not a form everyone can use. */
input:focus, select:focus, textarea:not(.xterm-helper-textarea):focus { outline: none; border-color: var(--accent); }
input:focus-visible, select:focus-visible, textarea:not(.xterm-helper-textarea):focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent);
}
/* A button is not a field and must keep its own focus ring. */
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input:disabled, select:disabled, textarea:disabled {
  opacity: .5; cursor: not-allowed; background: var(--surface);
}

/* Marked wrong only once it has been touched and left. Turning a field red
   while somebody is still halfway through typing into it is not help. */
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea,
input.is-invalid, select.is-invalid, textarea.is-invalid {
  border-color: var(--alert);
  background: color-mix(in srgb, var(--alert) 7%, var(--surface-2));
}
.field.is-invalid input:focus-visible, input.is-invalid:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--alert) 30%, transparent);
}

/* The native arrow sits on the wrong side in a right-to-left field and is
   styled by the operating system rather than by us. */
select, .select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-dim) 50%),
                    linear-gradient(135deg, var(--ink-dim) 50%, transparent 50%);
  background-position: calc(14px) calc(50% - 2px), calc(19px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-start: 34px;
  cursor: pointer;
}
[dir="ltr"] select, [dir="ltr"] .select {
  background-position: calc(100% - 19px) calc(50% - 2px), calc(100% - 14px) calc(50% - 2px);
  padding-inline-start: 13px; padding-inline-end: 34px;
}

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 5px; font-size: 13px; color: var(--ink-dim); font-weight: 500; }
.field-row { display: flex; gap: var(--gap); flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 150px; }

/* Says what is wrong under the field it is wrong in, rather than in a corner
   of the screen away from the thing to fix. */
.field-error {
  display: none; margin-top: 5px; font-size: 12px; color: var(--alert);
}
.field.is-invalid .field-error { display: block; }

.field-hint { margin-top: 5px; font-size: 12px; color: var(--ink-faint); }
.required-mark { color: var(--alert); margin-inline-start: 3px; }

/* ────────────────────────── sign in screen ───────────────────────── */

.gate { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.gate-card { width: min(380px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.gate-title { font-size: 26px; margin-bottom: 4px; }
.gate-blurb { margin: 0 0 20px; color: var(--ink-dim); font-size: 14px; }
.gate-error { margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; background: color-mix(in srgb, var(--alert) 18%, transparent); color: var(--alert); font-size: 13px; }
.gate-card .btn { width: 100%; }

/* ──────────────────────────── the frame ──────────────────────────── */

.app { display: flex; flex-direction: column; height: 100%; }

.topbar {
  display: flex; align-items: center; gap: var(--gap);
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.brand-mark { font-size: 20px; }
.topbar-stats { display: flex; gap: 16px; margin-inline-start: auto; color: var(--ink-dim); font-size: 13px; flex-wrap: wrap; }
.stat { white-space: nowrap; }
.stat b { color: var(--ink); font-weight: 700; }
.topbar-actions { display: flex; gap: 8px; }
.is-paused .topbar { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); }

.body { display: flex; flex: 1; min-height: 0; }

/* ──────────────────────────── the roster ─────────────────────────── */

.roster {
  width: 290px; flex-shrink: 0;
  border-inline-start: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column; min-height: 0;
}
.roster-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.roster-head h2 { font-size: 15px; }
.agent-list { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }

.agent-card {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s;
}
.agent-card:hover { border-color: var(--ink-faint); }
.agent-card.is-selected { outline: 2px solid var(--accent); outline-offset: -1px; }
.agent-card.is-god { background: color-mix(in srgb, var(--brand) 20%, var(--surface-2)); }

.agent-top { display: flex; align-items: center; gap: 8px; }
.agent-avatar {
  width: 28px; height: 28px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 8px; font-weight: 700; font-size: 13px;
  background: var(--accent); color: var(--accent-ink);
}
.agent-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-boss { font-size: 11px; padding: 1px 6px; border-radius: 5px; background: var(--brand); color: #fff; }
/* The badge keeps its width; the name is the thing that may be shortened. */
.agent-badge { margin-inline-start: auto; flex-shrink: 0; font-size: 12px; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.agent-action { margin-top: 5px; font-size: 12px; color: var(--ink-dim); min-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-meta { margin-top: 4px; display: flex; gap: 10px; font-size: 11px; color: var(--ink-faint); }

.st-idle    { background: color-mix(in srgb, var(--ink-faint) 30%, transparent); color: var(--ink-dim); }
.st-working { background: color-mix(in srgb, var(--info) 25%, transparent); color: var(--info); }
.st-blocked { background: color-mix(in srgb, var(--alert) 25%, transparent); color: var(--alert); }
.st-compacting { background: color-mix(in srgb, #b191d6 25%, transparent); color: #b191d6; }
.st-looping { background: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--warn); }
.st-gone    { background: transparent; color: var(--ink-faint); border: 1px solid var(--line); }
.st-paused  { background: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--warn); }

.agent-card.is-working { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 40%, transparent); }
.agent-card.is-blocked { box-shadow: inset 0 0 0 1px var(--alert); }

.unread-dot { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; text-align: center; }

/* ───────────────────────────── main area ─────────────────────────── */

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.tabs { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--surface); overflow-x: auto; }
.tab {
  padding: 11px 14px; border: 0; background: transparent; cursor: pointer;
  color: var(--ink-dim); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
.tab-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-inline-start: 4px; border-radius: 9px; background: var(--surface-2); font-size: 11px; }
.tab-badge-alert { background: var(--alert); color: #fff; }

.panel { display: none; flex: 1; min-height: 0; overflow-y: auto; padding: 18px; }
.panel.is-active { display: block; }
.panel[data-panel="terminal"].is-active { display: flex; flex-direction: column; overflow: hidden; padding: 12px; }

.section-title { font-size: 14px; color: var(--ink-dim); margin-bottom: 8px; }

/* میز کار */
.dispatch { max-width: 760px; margin-bottom: 26px; }
.dispatch-label { display: block; margin-bottom: 6px; font-weight: 700; }
.dispatch-row { display: flex; gap: 10px; margin-top: 10px; }
.dispatch-row .select { flex: 1; }
.board-wrap { max-width: 760px; }
.board {
  margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); white-space: pre-wrap; word-break: break-word;
  font-family: inherit; font-size: 14px; min-height: 80px; color: var(--ink-dim);
}

/* ترمینال */
.term-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; flex-wrap: wrap; }
.term-who { font-weight: 700; }
.term-tools { display: flex; gap: 6px; margin-inline-start: auto; }
/* The terminal grid is always left to right. Its contents are a program's
   output, not the interface's text, and mirroring it garbles every box drawing
   the CLI paints. */
.term { flex: 1; min-height: 240px; direction: ltr; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0d0c0b; }
.term .xterm { padding: 8px; height: 100%; }
.term-compose { display: flex; gap: 10px; margin-top: 10px; align-items: flex-end; }
.term-compose textarea { flex: 1; }
.queue-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; max-height: 150px; overflow-y: auto; }
.queue-item { display: flex; gap: 10px; align-items: center; padding: 7px 11px; border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; background: var(--surface); }
.queue-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-dim); }
.queue-why { color: var(--warn); font-size: 12px; white-space: nowrap; }

/* کارها */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: var(--gap); align-items: start; }
.column { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 120px; }
.column h3 { font-size: 13px; color: var(--ink-dim); margin-bottom: 10px; }
.task {
  padding: 9px 11px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2);
}
.task-id { font-family: var(--mono); font-size: 11px; color: var(--ink-faint); }
.task-title { font-weight: 500; margin: 2px 0 6px; }
.task-foot { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-dim); flex-wrap: wrap; }
.task-move { margin-inline-start: auto; }

/* از من بپرس */
.ask-list, .mail-list, .activity-list, .mem-results { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.ask-card { padding: 14px; border: 1px solid var(--warn); border-radius: var(--radius); background: var(--surface); }
.ask-q { font-weight: 500; margin-bottom: 10px; white-space: pre-wrap; }
.ask-from { font-size: 12px; color: var(--ink-dim); margin-bottom: 6px; }
.ask-actions { display: flex; gap: 8px; margin-top: 10px; }

/* پیام‌ها */
.mail-card { padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.mail-head { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-dim); flex-wrap: wrap; }
.mail-act { padding: 1px 7px; border-radius: 5px; font-size: 11px; background: var(--surface-2); }
.act-request { background: color-mix(in srgb, var(--info) 30%, transparent); }
.act-query   { background: color-mix(in srgb, #b191d6 30%, transparent); }
.act-propose { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.act-done    { background: color-mix(in srgb, var(--ok) 30%, transparent); }
.mail-subject { margin-top: 5px; }
.mail-human { border-color: var(--alert); }

/* حافظه */
.search-row { display: flex; gap: 10px; max-width: 620px; margin-bottom: 16px; }
.mem-card { padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.mem-who { font-size: 12px; color: var(--ink-dim); }
.mem-snippet { margin-top: 5px; font-size: 14px; }
.mem-snippet mark { background: color-mix(in srgb, var(--accent) 45%, transparent); color: inherit; border-radius: 3px; }

/* فعالیت */
.event { display: flex; gap: 10px; align-items: baseline; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.event-time { color: var(--ink-faint); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.event-kind { color: var(--ink-dim); min-width: 84px; font-size: 12px; }
.event-text { flex: 1; overflow-wrap: anywhere; }

.empty { color: var(--ink-faint); padding: 26px 0; text-align: center; }

/* dialogs and toast */
.dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 22px; width: min(480px, 92vw); }
.dialog::backdrop { background: rgba(0, 0, 0, .55); }
.dialog-title { font-size: 18px; margin-bottom: 16px; }
.dialog-note { font-size: 12px; color: var(--ink-dim); margin: 0 0 14px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-start; padding: 0; margin: 0; }

.toast {
  position: fixed; inset-block-end: 20px; inset-inline-start: 20px;
  padding: 11px 16px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  max-width: min(420px, 90vw); z-index: 50;
}
.toast.is-error { border-color: var(--alert); color: var(--alert); }

@media (max-width: 860px) {
  .body { flex-direction: column; }
  .roster { width: auto; max-height: 40vh; border-inline-start: 0; border-bottom: 1px solid var(--line); }
  .kanban { grid-template-columns: 1fr; }
  .topbar-stats { order: 3; width: 100%; margin-inline-start: 0; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* خودکار */
.trigger-list { display: flex; flex-direction: column; gap: 8px; max-width: 860px; margin-bottom: 14px; }
.trigger-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.trigger-name { font-weight: 500; }
.trigger-when { font-size: 12px; color: var(--ink-dim); }
.trigger-mode { font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); }
.trigger-off { opacity: .55; }
.trigger-actions { margin-inline-start: auto; display: flex; gap: 6px; }
.trigger-form { display: flex; gap: 8px; max-width: 860px; flex-wrap: wrap; align-items: center; }
.trigger-form .input, .trigger-form .select { flex: 1; min-width: 150px; }
.trigger-num { max-width: 110px; flex: 0 0 auto; }
.hint { font-size: 13px; color: var(--ink-dim); max-width: 700px; margin: 0 0 10px; }
.secret-note {
  padding: 11px 14px; margin-bottom: 12px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  font-size: 13px; word-break: break-all;
}
.secret-note code { font-family: var(--mono); font-size: 12px; }
.brake-flag { font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--warn); color: #241f1c; }
.brake-stopped { background: var(--alert); color: #fff; }

/* the agent control bar and its sub-views */
.agent-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 8px; }
.agent-bar-actions { display: flex; gap: 6px; margin-inline-start: auto; flex-wrap: wrap; }
.agent-bar-meta { font-size: 12px; color: var(--ink-dim); padding-bottom: 8px; display: flex; gap: 14px; flex-wrap: wrap; }
.agent-bar-meta b { color: var(--ink); font-weight: 500; }

.subtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.subtab { padding: 7px 13px; border: 0; background: transparent; color: var(--ink-dim); cursor: pointer; border-bottom: 2px solid transparent; }
.subtab:hover { color: var(--ink); }
.subtab.is-active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 500; }

.sub-view { flex: 1; min-height: 0; overflow-y: auto; }
.sub-actions { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }

.inbox-msg { padding: 11px 13px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.inbox-msg.is-done { opacity: .6; }
.inbox-head { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-dim); flex-wrap: wrap; }
.inbox-body { margin-top: 6px; white-space: pre-wrap; word-break: break-word; font-size: 14px; }

.git-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.git-branch { font-weight: 700; }
.git-count { font-size: 12px; color: var(--ink-dim); }
.git-group { margin-bottom: 14px; }
.git-group h4 { margin: 0 0 6px; font-size: 13px; color: var(--ink-dim); font-weight: 500; }
.git-file { display: flex; gap: 9px; align-items: center; padding: 4px 0; font-size: 13px; }
.git-code { font-family: var(--mono); font-size: 11px; width: 16px; color: var(--ink-faint); flex-shrink: 0; }
.git-path { direction: ltr; text-align: left; overflow-wrap: anywhere; }
.git-commit { display: flex; gap: 10px; padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--line); cursor: pointer; }
.git-commit:hover { background: var(--surface-2); }
.git-hash { font-family: var(--mono); font-size: 12px; color: var(--accent); flex-shrink: 0; }
.git-when { color: var(--ink-faint); font-size: 12px; margin-inline-start: auto; flex-shrink: 0; }
.git-diff {
  direction: ltr; text-align: left; font-family: var(--mono); font-size: 12px;
  white-space: pre; overflow-x: auto; padding: 12px; margin-top: 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  max-height: 460px; overflow-y: auto;
}

/* offices and people */
.ws-switch {
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); max-width: 190px; font-weight: 700;
}
.member-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.member-email { direction: ltr; }
.member-role { font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); }
.member-role.is-owner { background: var(--brand); color: #fff; }
.invite-link { direction: ltr; font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.isolation-note {
  margin-top: 28px; padding: 14px 16px; max-width: 760px;
  border: 1px solid var(--warn); border-radius: var(--radius);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  font-size: 13px; line-height: 1.8;
}

/* subscription and capacity */
.plan-now { padding: 16px 18px; border: 1px solid var(--accent); border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 9%, transparent); max-width: 760px; margin-bottom: 18px; }
.plan-now.is-expired { border-color: var(--alert); background: color-mix(in srgb, var(--alert) 10%, transparent); }
.plan-name { font-size: 19px; font-weight: 700; }
.plan-until { color: var(--ink-dim); font-size: 13px; margin-top: 3px; }
.meters { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 14px; }
.meter { min-width: 140px; }
.meter-label { font-size: 12px; color: var(--ink-dim); }
.meter-value { font-size: 17px; font-weight: 700; }
.meter-bar { height: 5px; border-radius: 3px; background: var(--surface-2); margin-top: 5px; overflow: hidden; }
.meter-fill { height: 100%; background: var(--accent); }
.meter-fill.is-full { background: var(--alert); }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); max-width: 760px; }
.plan-card { padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.plan-card.is-current { outline: 2px solid var(--accent); outline-offset: -1px; }
.plan-card h4 { margin: 0 0 6px; font-size: 16px; }
.plan-price { font-size: 13px; color: var(--ink-dim); margin-bottom: 9px; }
.plan-card ul { margin: 0; padding-inline-start: 18px; font-size: 13px; color: var(--ink-dim); }
.cap-line { display: flex; gap: 14px; flex-wrap: wrap; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; max-width: 760px; }
.cap-line b { color: var(--ink); }
.cap-full { border-color: var(--alert); }
