:root {
  --brand: #d97706;
  --brand-ink: #fff;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --column: #eef0f3;
  --border: #e2e5ea;
  --border-strong: #cfd4dc;
  --text: #172033;
  --text-2: #4b5567;
  --muted: #7a8394;
  --nav: #111827;
  --nav-text: #e5e7eb;
  --focus: #2563eb;
  --danger: #dc2626;
  --ok: #16a34a;
  --internal: #7c3aed;
  --internal-bg: #f5f0ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --radius: 8px;

  --st-not_started: #6b7280;
  --st-in_configuration: #2563eb;
  --st-internal_testing: #7c3aed;
  --st-client_testing: #d97706;
  --st-approval: #0d9488;
  --st-closed: #16a34a;

  --pr-low: #6b7280;
  --pr-medium: #2563eb;
  --pr-high: #ea580c;
  --pr-urgent: #dc2626;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1420;
    --surface: #171d2b;
    --surface-2: #1c2333;
    --column: #131a27;
    --border: #273044;
    --border-strong: #354059;
    --text: #e6e9ef;
    --text-2: #b4bccb;
    --muted: #8590a5;
    --nav: #0a0e17;
    --internal-bg: #231a3a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--focus); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.boot { padding: 40px; color: var(--muted); text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* ---------- Buttons & inputs ---------- */
button, .btn {
  font: inherit;
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  height: 34px; padding: 0 14px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap; font-weight: 500;
  text-decoration: none !important;
}
button:hover, .btn:hover { background: var(--surface-2); }
button:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand); filter: brightness(.94); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: var(--ok); filter: brightness(.94); }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 1px;
}
input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 7px 10px; width: 100%;
}
select { padding-right: 28px; height: 34px; }
input[type="checkbox"], input[type="radio"] { width: auto; flex: none; }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; cursor: pointer; }
.check input { margin-top: 3px; width: auto; flex: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- Top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  height: 54px; padding: 0 18px;
  background: var(--nav); color: var(--nav-text);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; color: #fff; margin-right: 18px; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; border-radius: 6px; background: #1f2937; display: grid; place-items: center; }
.brand-mark svg { width: 16px; height: 16px; }
.nav a.navlink {
  color: #cbd2dc; padding: 7px 12px; border-radius: 6px; font-weight: 500;
}
.nav a.navlink:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.nav a.navlink.active { background: rgba(255,255,255,.12); color: #fff; }
.nav .btn-primary { height: 32px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; flex: none;
  background: #64748b;
}
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.user-menu { position: relative; }
.user-menu > button { background: transparent; border: 0; color: var(--nav-text); padding: 0 6px; height: 40px; }
.user-menu > button:hover { background: rgba(255,255,255,.08); }
.menu {
  position: absolute; right: 0; top: 44px; min-width: 220px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; z-index: 30;
}
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu a, .menu button {
  display: flex; width: 100%; justify-content: flex-start;
  border: 0; background: none; height: auto; padding: 8px 10px; border-radius: 6px; color: var(--text); font-weight: 400;
}
.menu a:hover, .menu button:hover { background: var(--surface-2); text-decoration: none; }
@media (max-width: 760px) {
  .nav { padding: 0 10px; gap: 2px; }
  .brand span.brand-name { display: none; }
  .nav a.navlink { padding: 7px 8px; }
  .nav .new-label { display: none; }
}

/* ---------- Page ---------- */
.page { padding: 20px 24px 40px; max-width: 1600px; margin: 0 auto; }
.page.narrow { max-width: 1100px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px 20px; }
.empty { padding: 32px; text-align: center; color: var(--muted); }
@media (max-width: 640px) { .page { padding: 14px 12px 40px; } }

/* ---------- Filters ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input[type="search"] { width: 240px; }
.toolbar select { width: auto; min-width: 140px; }
.toggle {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); cursor: pointer; user-select: none;
}
.toggle.on { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }
@media (max-width: 640px) { .toolbar input[type="search"], .toolbar select { width: 100%; } }

/* ---------- Board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(215px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.column { background: var(--column); border-radius: 10px; display: flex; flex-direction: column; min-height: 200px; max-height: calc(100vh - 190px); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
.column-head .dot { width: 8px; height: 8px; border-radius: 50%; }
.column-head .count { background: var(--surface); border-radius: 10px; padding: 0 8px; font-size: 11px; color: var(--muted); }
.column-body { padding: 4px 8px 10px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.column.drop-target { outline: 2px dashed var(--brand); outline-offset: -2px; }
.drop-line { height: 3px; background: var(--brand); border-radius: 2px; margin: -2px 0; }
.tcard {
  display: block; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 11px;
  box-shadow: var(--shadow); cursor: pointer; text-decoration: none !important;
  border-left: 3px solid var(--pr-medium);
}
.tcard:hover { border-color: var(--border-strong); }
.tcard[draggable="true"] { cursor: grab; }
.tcard.dragging { opacity: .45; }
.tcard .title { font-weight: 500; margin: 4px 0 8px; word-break: break-word; }
.tcard .meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.tcard .key { font-size: 12px; font-weight: 600; color: var(--muted); }
.tcard .company { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tcard.pr-low { border-left-color: var(--pr-low); }
.tcard.pr-high { border-left-color: var(--pr-high); }
.tcard.pr-urgent { border-left-color: var(--pr-urgent); }
.tcard .due.overdue { color: var(--danger); font-weight: 600; }
.client-hint { font-size: 13px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; text-transform: uppercase; letter-spacing: .03em; }
.status-pill { color: #fff; }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.prio::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
.prio-low { color: var(--pr-low); } .prio-medium { color: var(--pr-medium); } .prio-high { color: var(--pr-high); } .prio-urgent { color: var(--pr-urgent); }
.tag { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.internal-tag { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 4px; background: var(--internal-bg); color: var(--internal); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table tr.inactive td { opacity: .55; }

/* ---------- Ticket page ---------- */
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .ticket-layout { grid-template-columns: 1fr; } }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ticket-title { font-size: 22px; font-weight: 650; margin: 0 0 14px; word-break: break-word; }
.ticket-title.editable:hover { background: var(--surface-2); border-radius: 6px; cursor: text; }
.section { margin-bottom: 18px; }
.section-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.richtext { white-space: normal; word-break: break-word; line-height: 1.6; }
.richtext p { margin: 0 0 8px; }
.desc-empty { color: var(--muted); font-style: italic; }

.stepper { display: flex; gap: 4px; margin: 4px 0 20px; flex-wrap: wrap; }
.step {
  flex: 1 1 110px; min-width: 100px; position: relative;
  padding: 8px 10px 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); text-align: center;
  height: auto; justify-content: center; white-space: normal; line-height: 1.2;
}
button.step:hover { border-color: var(--border-strong); }
.step.done { color: var(--text-2); background: var(--surface-2); }
.step.done::before { content: "✓ "; color: var(--ok); }
.step.current { color: #fff; border-color: transparent; }

.attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.att {
  display: flex; gap: 10px; align-items: center; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); min-width: 0; position: relative;
}
.att .thumb { width: 40px; height: 40px; border-radius: 5px; background: var(--surface-2); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--muted); flex: none; overflow: hidden; }
.att .thumb img { width: 100%; height: 100%; object-fit: cover; }
.att .info { min-width: 0; flex: 1; }
.att .name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; color: var(--text); }
.att .del { position: absolute; top: 4px; right: 4px; height: 22px; width: 22px; padding: 0; border: 0; background: transparent; color: var(--muted); display: none; }
.att:hover .del { display: inline-flex; }
.att.internal { border-color: color-mix(in srgb, var(--internal) 40%, var(--border)); background: var(--internal-bg); }

.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: 8px; padding: 14px; text-align: center; color: var(--muted);
  cursor: pointer; font-size: 13px; background: var(--surface);
}
.dropzone.over { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.file-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 4px 3px 9px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.file-chip button { height: 18px; width: 18px; padding: 0; border: 0; background: none; color: var(--muted); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs button { border: 0; background: none; border-radius: 0; border-bottom: 2px solid transparent; height: 36px; color: var(--muted); }
.tabs button.active { color: var(--text); border-bottom-color: var(--brand); }

.timeline { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment .bubble { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.comment.internal .bubble { background: var(--internal-bg); border-color: color-mix(in srgb, var(--internal) 35%, var(--border)); }
.comment.approved .bubble { border-left: 3px solid var(--ok); }
.comment .head { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 4px; flex-wrap: wrap; }
.comment .head b { font-weight: 600; }
.comment .actions { margin-left: auto; display: flex; gap: 2px; }
.comment .actions button { height: 24px; padding: 0 6px; font-size: 12px; border: 0; background: none; color: var(--muted); }
.comment .actions button:hover { color: var(--text); }
.comment .files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.event { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--text-2); padding-left: 6px; }
.event .ev-dot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); font-size: 10px; flex: none; margin: 0 5px; }
.staff-badge { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: color-mix(in srgb, var(--brand) 15%, transparent); color: var(--brand); text-transform: uppercase; letter-spacing: .04em; }

.composer { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 18px; }
.composer.internal { background: var(--internal-bg); border-color: color-mix(in srgb, var(--internal) 40%, var(--border)); }
.composer textarea { min-height: 80px; border-color: var(--border); }
.composer .row { margin-top: 10px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--st-client_testing) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--st-client_testing) 35%, var(--border)); align-items: center; font-size: 13px; }

.side .card { padding: 4px 0; }
.side dl { margin: 0; }
.side .prop { display: grid; grid-template-columns: 96px 1fr; gap: 8px; align-items: center; padding: 8px 16px; }
.side .prop dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.side .prop dd { margin: 0; min-width: 0; }
.side .prop select, .side .prop input { height: 30px; padding: 3px 8px; font-size: 13px; }
.side hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.watchers { display: flex; flex-direction: column; gap: 6px; padding: 8px 16px 12px; }
.watcher { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.watcher .x { margin-left: auto; height: 20px; width: 20px; padding: 0; border: 0; background: none; color: var(--muted); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent), var(--bg); }
.auth-card { width: 100%; max-width: 400px; padding: 30px 30px 24px; }
.auth-card .brand { color: var(--text); margin: 0 0 22px; }
.auth-card .brand-mark { background: var(--nav); }
.auth-card h1 { font-size: 20px; margin-bottom: 6px; }
.auth-card p.lead { color: var(--text-2); margin: 0 0 20px; }
.auth-card .btn-primary { width: 100%; height: 38px; margin-top: 4px; }
.auth-foot { margin-top: 16px; font-size: 13px; text-align: center; }
.form-error { color: var(--danger); font-size: 13px; margin: -4px 0 12px; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 20, 32, .5); display: grid; place-items: start center; padding: 6vh 16px 16px; z-index: 50; overflow-y: auto; }
.modal { width: 100%; max-width: 620px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px 20px 6px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; }
.modal-head .x { margin-left: auto; border: 0; background: none; font-size: 20px; height: 30px; width: 30px; padding: 0; color: var(--muted); }
.watch-picks { display: flex; flex-wrap: wrap; gap: 4px 14px; max-height: 140px; overflow-y: auto; padding: 6px 0; }
.copybox { display: flex; gap: 6px; margin-top: 8px; }
.copybox input { font-size: 12px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: #111827; color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13px; max-width: 360px; animation: slide .18s ease-out; }
.toast.error { background: var(--danger); }
@keyframes slide { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { padding: 10px 14px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--muted); }
.stat .n { font-size: 22px; font-weight: 700; }
.stat .l { font-size: 12px; color: var(--muted); }

/* ---------- Boards menu ---------- */
.project-menu { position: relative; }
.boards-btn { border: 0; background: transparent; color: #cbd2dc; height: 34px; }
.boards-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.boards-btn .caret { font-size: 10px; opacity: .8; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu-group { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px 2px; font-weight: 600; }
.menu a.on { background: var(--surface-2); font-weight: 600; }
.menu a { align-items: center; }

/* ---------- Boards overview ---------- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.project-card {
  display: block; padding: 14px 16px; border-radius: 10px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); text-decoration: none !important;
}
.project-card:hover { border-color: var(--border-strong); }
.project-card .desc { margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Admin: clients & projects ---------- */
.proj-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.proj-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
}
.proj-row.inactive, .card.inactive { opacity: .6; }

/* ---------- Workflow / stage editing ---------- */
.stage-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.stage-row input[type="color"] { width: 36px; height: 32px; padding: 2px; flex: none; }
.stage-row input[type="text"], .stage-row input:not([type="color"]):not([type="checkbox"]) { flex: 1 1 150px; min-width: 110px; height: 32px; }
.stage-row .check { margin: 0; white-space: nowrap; align-items: center; gap: 5px; flex: none; }
.stage-row .check input[type="checkbox"] { margin: 0; width: auto; flex: none; }
.stage-row button { flex: none; }
.stage-preview { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.stage-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500;
  padding: 4px 10px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface);
}
.stage-chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.stage-preview .arrow { color: var(--muted); font-size: 12px; }

/* ---------- Setup wizard ---------- */
.setup-card { max-width: 560px; }
.wizard-steps { display: flex; gap: 6px; margin-bottom: 22px; flex-wrap: wrap; }
.wstep {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted);
  padding: 5px 10px; border-radius: 20px; border: 1px solid var(--border);
}
.wstep .n {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); font-size: 11px; font-weight: 700;
}
.wstep.current { color: var(--text); border-color: var(--brand); }
.wstep.current .n { background: var(--brand); color: #fff; }
.wstep.done .n { background: var(--ok); color: #fff; }
.setup-card .btn-primary { width: auto; height: 36px; margin-top: 0; }
