:root {
  /* Warm neutrals */
  --bg: #fbf8f3;          /* cream page */
  --card: #fff;
  --sunken: #f4efe6;      /* wells, segmented controls */
  --ink: #24211c;
  --muted: #6e695f;
  --line: #ece6dc;
  --line-strong: #d6cec0;

  /* Main accent: sunflower. Fill with dark text; amber for text, outlines and focus. */
  --accent: #ffc233;
  --accent-hover: #ffcd52;
  --accent-edge: #f0ac00;
  --on-accent: #2b2100;
  --accent-strong: #946200;
  --accent-soft: #fff4d1;
  --tip-ink: #5c4400;

  /* Coral red: destructive actions only (Delete, remove) */
  --danger: #d9363e;
  --danger-soft: #fdeced;
  --danger-line: #f1b7ba;

  /* Fresh green: moving forward (tailor a CV, passed rounds, offers, saved status) */
  --positive: #17804f;
  --positive-ink: #136b42;
  --positive-soft: #e3f4ea;

  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(60, 40, 0, .05), 0 1px 1px rgba(60, 40, 0, .03);
  --shadow-pop: 0 12px 32px rgba(40, 30, 0, .14), 0 2px 6px rgba(40, 30, 0, .06);
  --top: 64px;
  --gutter: 28px;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14.5px/1.5 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.pad { padding: 24px; }
.pad-s { padding: 6px 4px; }
.err { color: var(--danger); }
.warn { color: var(--tip-ink); background: var(--accent-soft); padding: 8px 12px; border-radius: var(--radius-s); font-size: 13px; }
.ic { display: inline-flex; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top);
  background: rgba(251, 248, 243, .88); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1480px; height: 100%; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 16px; letter-spacing: -.01em; }
.brand-mark { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); box-shadow: inset 0 -3px 0 var(--accent-edge); position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 6px 6px auto; height: 2px; border-radius: 2px; background: var(--on-accent); box-shadow: 0 4px 0 var(--on-accent); opacity: .7; }
.nav { display: flex; gap: 4px; padding: 4px; background: var(--sunken); border-radius: 12px; }
.nav-item {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 0; border-radius: 9px;
  background: none; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
}
.nav-item:hover { color: var(--ink); }
.nav-item.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.nav-item.active .ic { color: var(--accent-strong); }
.nav-count { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.status.ok .status-dot { background: var(--positive); }
.status.busy .status-dot { background: var(--accent); }
.status.err { color: var(--danger); }
.status.err .status-dot { background: var(--danger); }

/* ---------- page frame: rail + content, the same on every page ---------- */
.layout {
  max-width: 1480px; margin: 0 auto; padding: 28px var(--gutter) 64px;
  display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 32px; align-items: start;
}
.rail { position: sticky; top: calc(var(--top) + 28px); max-height: calc(100vh - var(--top) - 56px); overflow-y: auto; padding: 2px; }
.rail-inner { display: flex; flex-direction: column; gap: 14px; }
.rail-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 4px -6px; }
.content { min-width: 0; }
.panel { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.work { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.aside { position: sticky; top: calc(var(--top) + 28px); display: flex; flex-direction: column; gap: 16px; min-width: 0; max-height: calc(100vh - var(--top) - 56px); overflow-y: auto; padding-bottom: 2px; }
.aside .preview { position: static; max-height: none; }
.how { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.how strong { color: var(--ink); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }

.page-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-start; }
.page-head-text { flex: 1; min-width: min(100%, 380px); display: flex; flex-direction: column; gap: 4px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-strong); }
.page-title { font-size: 28px; line-height: 1.15; font-weight: 750; letter-spacing: -.025em; }
.page-sub { color: var(--muted); max-width: 62ch; font-size: 15px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.card.flush { padding: 0; gap: 0; }
.card > .btn, .card > .stack-s > .btn:not(.block) { align-self: flex-start; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-head.pad { padding: 16px 20px 10px; }

.tip { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-s); background: var(--accent-soft); color: var(--tip-ink); font-size: 13.5px; }
.tip .ic { margin-top: 2px; }

.empty { text-align: center; padding: 72px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--card); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty p { color: var(--muted); max-width: 46ch; margin-bottom: 8px; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 4px; }
.inline-empty { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1; padding: 0 16px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.block.left { justify-content: flex-start; }
.btn.block.left span { overflow: hidden; text-overflow: ellipsis; }
.btn.primary { background: var(--accent); border-color: var(--accent-edge); color: var(--on-accent); box-shadow: inset 0 -2px 0 rgba(150, 100, 0, .18); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.positive { background: var(--positive); border-color: var(--positive); color: #fff; }
.btn.positive:hover { filter: brightness(1.1); }
.btn.danger { color: var(--danger); border-color: var(--danger-line); }
.btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn[hidden] { display: none; }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { filter: brightness(1.08); }
button.link {
  display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 13px; font-weight: 600;
  background: none; border: 0; padding: 2px 4px; color: var(--accent-strong); cursor: pointer; text-decoration: none;
}
a.link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--accent-strong); text-decoration: none; }
button.link:hover, a.link:hover { text-decoration: underline; }

.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: none;
  color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; list-style: none;
}
.icon-btn:hover { background: var(--sunken); color: var(--ink); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); border-color: var(--danger-line); }
.row-actions { display: flex; gap: 2px; margin-left: auto; flex-shrink: 0; align-items: center; }
.row-actions.wrap { flex-wrap: wrap; gap: 6px; }

input:not([type]), input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=search], input[type=date], textarea, select {
  width: 100%; font: inherit; color: inherit; padding: 0 12px; height: 40px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; transition: border-color .12s, box-shadow .12s;
}
textarea { padding: 9px 12px; height: auto; min-height: 42px; resize: vertical; overflow: hidden; line-height: 1.5; }
select { padding-right: 32px; appearance: none; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e695f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
input::placeholder, textarea::placeholder { color: #a29b8f; }
input:hover, textarea:hover, select:hover { border-color: #c4baa9; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent-strong); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=checkbox] { accent-color: var(--accent-strong); width: 17px; height: 17px; margin: 1px 0 0; flex-shrink: 0; cursor: pointer; }
input[type=color] { width: 30px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field-hint { font-size: 12.5px; color: var(--muted); }
.inline-field { display: flex; align-items: center; gap: 10px; }
.inline-field .label { white-space: nowrap; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }

.title-input { font-size: 28px !important; font-weight: 750 !important; letter-spacing: -.025em; height: 46px !important; border-color: transparent !important; background: transparent !important; padding: 0 8px !important; margin-left: -9px; }
.title-input:hover { border-color: var(--line-strong) !important; background: #fff !important; }
.title-input:focus { border-color: var(--accent-strong) !important; background: #fff !important; }

/* toggle switch */
.switch { display: inline-flex; flex-shrink: 0; }
.switch input { appearance: none; width: 40px; height: 24px; margin: 0; border-radius: 999px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch input:checked { background: var(--accent-strong); }
.switch input:checked::after { transform: translateX(16px); }

/* segmented control */
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--sunken); border-radius: 11px; }
.seg-item { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.seg-item:hover { color: var(--ink); }
.seg-item.active { background: #fff; color: var(--ink); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.seg.small .seg-item { padding: 4px 10px; font-size: 12.5px; }
.seg-item.active.o-passed { background: var(--positive-soft); color: var(--positive-ink); box-shadow: 0 0 0 1px #bfe3cf; }
.seg-item.active.o-failed { background: var(--danger-soft); color: #b42a31; box-shadow: 0 0 0 1px var(--danger-line); }
.seg-item.active.o-pending { background: var(--accent-soft); color: var(--accent-strong); box-shadow: 0 0 0 1px #f3d98a; }

/* chips */
.chips, .filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600;
  padding: 5px 11px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
}
.chip:hover { border-color: var(--muted); }
.chip.small { padding: 3px 10px; font-size: 12.5px; }
.chip.active { background: var(--accent); border-color: var(--accent-edge); color: var(--on-accent); }
.chip-count { font-size: 11.5px; opacity: .75; }
.chip.closed-on { background: var(--ink); border-color: var(--ink); color: #fff; }

.badge { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--sunken); color: var(--muted); }
.status-applied { background: #e9f0fb; color: #2d5fa8; }
.status-interviewing { background: var(--accent-soft); color: var(--accent-strong); }
.status-offer { background: var(--positive-soft); color: var(--positive-ink); }
.status-accepted { background: var(--positive); color: #fff; }
.status-rejected { background: var(--danger-soft); color: #b42a31; }
.status-withdrawn { background: var(--sunken); color: #8a847a; }

/* dropdown menu */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { background: var(--sunken); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 240px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; visibility: hidden;
}
.menu-pop.placed { visibility: visible; }
.menu-heading { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.menu-item { display: grid; grid-template-columns: 18px 1fr; column-gap: 10px; align-items: center; text-align: left; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.menu-item:hover { background: var(--sunken); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-hint { grid-column: 2; font-size: 12px; color: var(--muted); }

/* ---------- rail pieces ---------- */
.progress-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--sunken); overflow: hidden; }
.progress-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .3s; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; position: relative; }
.steps::before { content: ""; position: absolute; left: 23px; top: 18px; bottom: 18px; width: 2px; background: var(--line); }
.step {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; border-radius: 10px; background: none; font: inherit; color: var(--ink); cursor: pointer;
}
.step:hover { background: var(--sunken); }
.step.active { background: var(--card); box-shadow: var(--shadow), 0 0 0 1px var(--line); font-weight: 650; }
.step-dot {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; background: var(--bg); border: 2px solid var(--line-strong); color: var(--muted);
}
.step.done .step-dot { background: var(--positive); border-color: var(--positive); color: #fff; }
.step.active .step-dot { background: var(--accent); border-color: var(--accent-edge); color: var(--on-accent); }
.step-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-section > summary { width: 100%; border-style: dashed; color: var(--accent-strong); }
.add-section .menu-item { grid-template-columns: 18px 1fr auto; padding: 7px 10px; }
.add-section .menu-hint { grid-column: 3; grid-row: 1; padding-left: 12px; }

.search { position: relative; }
.search .ic { position: absolute; left: 12px; top: 12px; color: var(--muted); }
.search input { padding-left: 36px; }

.list { display: flex; flex-direction: column; gap: 6px; }
.list-item {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; font: inherit; color: inherit;
  padding: 12px; border-radius: 12px; border: 1px solid transparent; background: none; cursor: pointer;
}
.list-item:hover { background: var(--card); border-color: var(--line); }
.list-item.active { background: var(--card); border-color: var(--accent-edge); box-shadow: 0 0 0 3px var(--accent-soft); }
.list-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.list-text strong, .list-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.list-text .list-top strong { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.list-top .badge { margin-top: 1px; }
.list-meta { font-size: 12px; color: var(--muted); }
.list-item.compact { padding: 8px 10px; align-items: center; border-color: var(--line); }
.list-item.compact:hover { border-color: var(--line-strong); }
.list-item.compact .swatch { height: 28px; margin: 0; }
.list-item.compact > .ic { color: var(--muted); }
.swatch { width: 10px; height: 34px; border-radius: 4px; flex-shrink: 0; margin-top: 2px; }
.swatch.big { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; margin: 0; }

/* ---------- profile ---------- */
.links { display: flex; flex-direction: column; gap: 8px; }
.link-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; align-items: center; }

.versions-card { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--sunken); }
.versions-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.versions-top .seg { background: rgba(255, 255, 255, .6); }
.versions-menu { margin-left: auto; }
.versions-menu > summary { height: 34px; font-size: 13px; padding: 0 12px; }
.versions-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.versions-meta .inline-field { flex: 1; min-width: 260px; max-width: 420px; }
.versions-meta input { height: 36px; }

.entries { display: flex; flex-direction: column; gap: 10px; }
.entry { background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.entry.open { border-color: var(--line-strong); box-shadow: var(--shadow-pop); }
.entry-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; min-height: 52px; cursor: pointer; border-radius: 12px; }
.entry-head:hover { background: #fdfbf7; }
.entry-summary { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.caret { color: var(--muted); display: inline-flex; }
.entry-body { padding: 16px 16px 18px; border-top: 1px solid var(--line); }
.add-entry { align-self: flex-start; border-style: dashed; color: var(--accent-strong); }

.step-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 18px; margin-top: 6px; border-top: 1px solid var(--line); }

/* ---------- CVs ---------- */
.pre { white-space: pre-line; }
.progress-top .swatch { width: 14px; height: 14px; border-radius: 50%; margin: 0; }

.rows { list-style: none; margin: 0; padding: 0 8px 8px; }
.row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 10px; }
.row + .row { border-top: 1px solid var(--line); }
.row:hover { background: #fdfbf7; }
.row.off .row-text strong { color: var(--muted); font-weight: 600; }
.row-num { width: 22px; height: 22px; border-radius: 6px; background: var(--sunken); color: var(--muted); font-size: 12px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.row-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row-text > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.content-controls { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.content-controls > .field:last-child { flex: 1; min-width: 200px; }
.pick-tools { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.pick-tools > span { margin-right: auto; }
.checks { display: flex; flex-direction: column; gap: 6px; }
.check-card { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; transition: background .12s, border-color .12s; }
.check-card:hover { border-color: var(--line-strong); }
.check-card.on { background: var(--accent-soft); border-color: #f3d98a; }
.check-text { display: flex; flex-direction: column; min-width: 0; }
.snippet { color: var(--muted); font-size: 13.5px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; padding: 10px 12px; background: var(--sunken); border-radius: var(--radius-s); }

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 12px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font: inherit; color: inherit; cursor: pointer; }
.choice:hover { border-color: var(--line-strong); }
.choice.selected { border-color: var(--accent-strong); background: var(--accent-soft); }
.mini { display: flex; flex-direction: column; gap: 5px; height: 84px; padding: 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); margin-bottom: 4px; }
.mini i { display: block; height: 8px; width: 46%; border-radius: 3px; background: #2b2a28; }
.mini b { display: block; height: 5px; width: 100%; border-radius: 3px; background: #d9d4cb; }
.mini b:nth-of-type(1) { width: 30%; margin-top: 6px; background: var(--mini); }
.mini b:nth-of-type(3) { width: 75%; }
.mini-classic { align-items: center; }
.mini-classic i { width: 40%; }
.mini-classic b:nth-of-type(1) { width: 100%; height: 2px; }
.mini-modern i { background: var(--mini); }
.mini-modern b:nth-of-type(1) { box-shadow: -6px 0 0 -1px var(--mini); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; background: var(--c); box-shadow: 0 0 0 1px rgba(0, 0, 0, .08) inset; }
.swatch-btn.selected { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent-strong); }
.swatch-custom { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 4px; border-radius: 999px; border: 1px solid var(--line-strong); cursor: pointer; color: var(--muted); }

.checklist { margin: 0; padding-left: 20px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }

.preview { position: sticky; top: calc(var(--top) + 20px); display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - var(--top) - 40px); min-width: 0; }
.preview-bar { display: flex; align-items: center; gap: 10px; }
.preview-bar .link { margin-left: auto; }
.preview-scale { overflow-x: hidden; overflow-y: auto; min-height: 0; flex: 0 1 auto; border-radius: var(--radius); border: 1px solid var(--line); background: #efe9df; box-shadow: var(--shadow); }
.preview.large { position: static; max-height: none; }
.preview-frame { width: 860px; height: 1200px; border: 0; transform-origin: 0 0; display: block; }

/* ---------- applications ---------- */
.app-titles { display: flex; flex-direction: column; gap: 2px; }
.company-input { font-size: 17px !important; color: var(--muted); border-color: transparent !important; background: transparent !important; padding: 0 8px !important; margin-left: -9px; height: 34px !important; }
.company-input:hover { border-color: var(--line-strong) !important; background: #fff !important; }
.company-input:focus { border-color: var(--accent-strong) !important; background: #fff !important; color: var(--ink); }
.input-with-btn { display: flex; gap: 8px; align-items: center; }

.track-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.track { list-style: none; margin: 0; padding: 0; display: flex; flex: 1; min-width: 420px; }
.track-li { flex: 1; position: relative; }
.track-li + .track-li::before { content: ""; position: absolute; top: 13px; right: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.track-li.past::before, .track-li.current::before { background: var(--positive); }
.track-step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 0; border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.track-step:hover { color: var(--ink); }
.track-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--line-strong); }
.track-li.past .track-dot { background: var(--positive); border-color: var(--positive); color: #fff; }
.track-li.current .track-dot { background: var(--accent); border-color: var(--accent-edge); box-shadow: 0 0 0 4px var(--accent-soft); }
.track-li.current .track-step { color: var(--ink); }
.track-card.closed .track { opacity: .5; }
.track-closed { display: flex; align-items: center; gap: 6px; }

.cv-link { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--sunken); }
.cv-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cv-pick select { flex: 1; min-width: 200px; height: 34px; font-size: 13.5px; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 2px; background: var(--line); }
.tl-item { position: relative; display: flex; gap: 14px; }
.tl-dot { position: relative; z-index: 1; width: 28px; height: 28px; margin-top: 8px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: #fff; border: 2px solid var(--line-strong); color: #fff; }
.outcome-pending .tl-dot { border-color: var(--accent-edge); background: var(--accent-soft); }
.outcome-passed .tl-dot { background: var(--positive); border-color: var(--positive); }
.outcome-failed .tl-dot { background: var(--danger); border-color: var(--danger); }
.tl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tl-head { display: flex; gap: 8px; align-items: center; }
.round-name { font-weight: 650; }
.tl-fields { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tl-fields .inline-field { color: var(--muted); }
.tl-fields input[type=date] { width: 170px; height: 34px; }

/* ---------- accounts ---------- */
.auth {
  max-width: 1080px; margin: 0 auto; padding: 64px var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 64px; align-items: center;
  min-height: calc(100vh - var(--top));
}
.auth-pitch { display: flex; flex-direction: column; gap: 18px; }
.auth-pitch h1 { font-size: 40px; line-height: 1.1; font-weight: 780; letter-spacing: -.03em; max-width: 14ch; }
.auth-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; color: var(--muted); max-width: 46ch; }
.auth-steps li { display: flex; gap: 12px; align-items: flex-start; }
.auth-steps strong { color: var(--ink); }
.auth-steps .step-dot { background: var(--accent); border-color: var(--accent-edge); color: var(--on-accent); }
.auth-card { padding: 28px; gap: 20px; box-shadow: var(--shadow-pop); }
.auth-head { display: flex; flex-direction: column; gap: 6px; }
.auth-head h2 { font-size: 22px; letter-spacing: -.015em; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form .btn.block { height: 44px; }
.auth-switch { text-align: center; color: var(--muted); font-size: 13.5px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label-row .link { padding: 0; }
.form-error { color: #b42a31; background: var(--danger-soft); border: 1px solid var(--danger-line); padding: 9px 12px; border-radius: var(--radius-s); font-size: 13.5px; }
.form-error[hidden] { display: none; }
.form-note { background: var(--accent-soft); color: var(--tip-ink); padding: 9px 12px; border-radius: var(--radius-s); font-size: 13.5px; }
form.card > .btn { align-self: flex-start; }
.danger-card { border-color: var(--danger-line); }
.danger-card h3 { color: #b42a31; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent-strong); border: 1px solid #f3d98a; font-size: 12px; font-weight: 750;
}
.avatar.large { width: 52px; height: 52px; font-size: 19px; }
.account-menu summary { padding: 0 12px 0 6px; gap: 8px; }
.account-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.account-menu .menu-heading { text-transform: none; letter-spacing: 0; font-weight: 600; }
.account-card { align-items: center; text-align: center; gap: 6px; padding: 20px 16px; }
.account-card strong { font-size: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .work { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; max-height: none; overflow: visible; }
  .preview { position: static; max-height: none; }
}
@media (max-width: 980px) {
  .auth { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 32px; align-items: start; min-height: 0; }
  .auth-pitch h1 { font-size: 30px; max-width: none; }
  :root { --gutter: 18px; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 18px; }
  .rail { position: static; max-height: none; overflow: visible; }
  .steps { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .steps::before { display: none; }
  .step { width: auto; white-space: nowrap; }
  .list { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .list-item { min-width: 240px; background: var(--card); border-color: var(--line); }
  .track { min-width: 0; }
}
@media (max-width: 720px) {
  .topbar-inner { gap: 12px; }
  .brand-name, .nav-label, .status span:last-child, .account-name { display: none; }
  .account-menu summary { padding: 0 6px; }
  .grid, .choices { grid-template-columns: minmax(0, 1fr); }
  .link-row { grid-template-columns: 1fr auto; }
  .link-row input:first-child { grid-column: 1 / -1; }
  .page-title, .title-input { font-size: 23px !important; }
  .track-label { font-size: 11px; }
  .card { padding: 16px; }
}
