/* Blog Autopilot console. One stylesheet for the app and the sign-in page.
   No inline styles anywhere: the Content-Security-Policy forbids them. */

:root {
  --ink: #14171F;
  --ink-2: #3D4452;
  --muted: #565D6D;
  --label: #5F6675;
  --page: #F4F5F7;
  --card: #FFFFFF;
  --line: #E3E6EC;
  --line-soft: #EEF0F4;
  --line-strong: #D5D9E2;
  --link: #2743C9;
  --link-hover: #1B2F94;
  --refinecv: #E4572E;
  --suite: #0F5E57;
  --copilot: #B8A4F0;
  --opus: #2743C9;
  --sonnet: #AAB6E6;
  --haiku: #6F84D9;
  --neutral: #8D99B8;
  --display: 'Space Grotesk', Inter, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: break-word;
}

[hidden] { display: none !important; }

a { color: var(--link); }
a:hover { color: var(--link-hover); }

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}
h1:focus { outline: none; }
main:focus { outline: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 10;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #FFFFFF;
  font-weight: 600;
}
.skip:focus { top: 12px; color: #FFFFFF; }

/* ---------- top bar ---------- */

.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top-in {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { flex: none; display: block; }
.brand-name { font-family: var(--display); font-weight: 600; font-size: 17px; white-space: nowrap; }

.nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 320px; }
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--ink-2);
  font-weight: 500;
  text-decoration: none;
}
.nav-link:hover { color: var(--ink); background: var(--line-soft); }
.nav-link[aria-current='page'] {
  color: var(--ink);
  background: var(--line-soft);
  box-shadow: inset 0 -2px 0 var(--ink);
}

.account { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.who { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

/* ---------- chips, pills, buttons ---------- */

.chip {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.chip.wrap { white-space: normal; }
.chip-lg { padding: 6px 10px; }
.ok { color: #0E6B3A; background: #E3F4EA; }
.warn { color: #7A4F00; background: #FBF0D9; }
.bad { color: #9B1C1C; background: #FDE8E8; }
.plain { color: var(--ink-2); background: var(--line-soft); }
.p-refinecv { color: #A63A0B; background: #FDEDE6; }
.p-suite { color: #0F5E57; background: #E2F3F0; }
.p-copilot { color: #5B21B6; background: #EFE9FB; }
.p-other { color: var(--ink-2); background: var(--line-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }

.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
}
.pill:hover { background: var(--line-soft); color: var(--ink); }
.pill-on, .pill-on:hover { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover { color: var(--ink); background: var(--line-soft); }
.btn:disabled { color: var(--muted); background: var(--line-soft); cursor: default; }
.btn-main { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.btn-main:hover { background: #2B303B; color: #FFFFFF; }
.btn-main:disabled { background: var(--ink-2); border-color: var(--ink-2); color: #FFFFFF; }
.btn-sm { padding: 0 12px; font-size: 13px; }
.btn-wide { width: 100%; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--link); font-weight: 500; padding: 0 8px; }
.btn-quiet:hover { background: var(--line-soft); color: var(--link-hover); }
.btn-quiet:disabled { background: transparent; color: var(--muted); }

/* ---------- page frame ---------- */

.main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 56px; }
.view { display: flex; flex-direction: column; gap: 22px; }
.state { margin: 48px 0; font-size: 16px; color: var(--ink-2); }
.state h1 { font-size: 22px; }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.page-head.page-head-start { align-items: flex-start; margin-top: 10px; }
.page-head-text { flex: 1 1 420px; min-width: 0; }

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 1.3; }
.lead { margin: 6px 0 0; color: var(--muted); }
.back { display: inline-flex; align-items: center; min-height: 32px; font-weight: 500; }
.back::before { content: '\2190'; margin-right: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- cards and tiles ---------- */

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.pad { padding: 20px 22px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.grow-1 { flex: 1 1 320px; }
.grow-2 { flex: 2 1 340px; }
.grow-3 { flex: 3 1 520px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 14px; }

.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; }
.card-head.center { align-items: center; }
.card-foot { border-top: 1px solid var(--line-soft); margin-top: 16px; padding-top: 14px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.stack > .card-foot { margin-top: 0; }

.tiles { display: flex; flex-wrap: wrap; gap: 16px; }
.tile { flex: 1 1 200px; padding: 18px 20px; }
.label { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--label); font-weight: 600; }
.tile-num { font-family: var(--display); font-size: 40px; font-weight: 600; line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.tile-num-sm { font-size: 36px; }
.tile-note { font-size: 13px; color: var(--muted); margin-top: 6px; }

.note { margin: 10px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.note.flat { margin: 0; }
.body { margin: 10px 0 0; font-size: 14px; line-height: 1.5; }
.empty { margin: 12px 0 0; color: var(--muted); }
.strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.nil { color: var(--label); }

.split { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 10px; }
.split.wrap { flex-wrap: wrap; }
.split.small { color: var(--ink-2); }
.gap-top { margin-top: 8px; }
.gap-top-lg { margin-top: 12px; }

.track { height: 12px; border-radius: 6px; background: var(--line-soft); margin-top: 8px; overflow: hidden; }
.fill { height: 12px; background: var(--opus); }
.fill.fill-soft { background: var(--neutral); }

/* ---------- lists ---------- */

.post-list, .look-list, .legend, .source-list { list-style: none; margin: 0; padding: 0; }

.post-list { margin-top: 8px; }
.post-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.post-row:last-child { border-bottom: 0; padding-bottom: 0; }
.post-when { flex: 0 0 104px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.post-title { flex: 1 1 260px; min-width: 0; font-weight: 500; }
.more { font-weight: 500; }

.look-list { margin-top: 12px; display: flex; flex-direction: column; gap: 14px; line-height: 1.45; }
.look-text { margin-top: 6px; overflow-wrap: anywhere; }

.source-list { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.source-list li { padding: 4px 10px; border-radius: 6px; background: var(--line-soft); color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; background: var(--neutral); }
.sw-refinecv { background: var(--refinecv); }
.sw-suite { background: var(--suite); }
.sw-copilot { background: var(--copilot); }
.sw-opus { background: var(--opus); }
.sw-sonnet { background: var(--sonnet); }
.sw-haiku { background: var(--haiku); }
.hbars + .legend { margin-top: 16px; }

/* ---------- tables ---------- */

.scroll { overflow-x: auto; margin-top: 8px; }
.table-card { padding: 6px 10px 10px; }
.table-card .scroll { margin-top: 0; }
.table-card .empty { margin: 14px 12px; }
table { width: 100%; border-collapse: collapse; }
.min-760 { min-width: 760px; }
.min-1180 { min-width: 1180px; }
th { text-align: left; font-weight: 600; }
thead th {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--label);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td, .row-head {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
  color: var(--ink);
  vertical-align: top;
}
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tfoot td, tfoot th { border-top: 1px solid var(--line); border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.col-post { min-width: 280px; }
.sub { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 400; }

/* ---------- controls ---------- */

.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.control { display: flex; flex-direction: column; gap: 4px; flex: 0 1 200px; min-width: 0; }
.control-grow { flex: 1 1 280px; }
.control label { font-size: 12px; font-weight: 600; color: var(--label); letter-spacing: 0.04em; text-transform: uppercase; }
.field {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
.field::placeholder { color: var(--label); opacity: 1; }
select.field { padding-right: 32px; }

.toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.toggle {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.toggle:hover { background: var(--line-soft); }
.toggle[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

/* ---------- facts and timetable ---------- */

.facts { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 14px 0 0; }
.fact { display: flex; flex-wrap: wrap; gap: 0 6px; }
.fact dt { color: var(--muted); }
.fact dd { margin: 0; }

.timetable { margin: 12px 0 0; display: flex; flex-direction: column; gap: 12px; }
.timetable dt { font-weight: 600; }
.timetable dd { margin: 2px 0 0; color: var(--ink-2); }

.pair { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 12px; }
.pair-num { font-family: var(--display); font-size: 34px; font-weight: 600; line-height: 1.1; }
.pair .tile-note { margin-top: 4px; }

/* ---------- horizontal token bars ---------- */

.hbars { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; font-size: 13px; }
.hbar-row { display: flex; align-items: center; gap: 12px; }
.hbar-label { flex: 0 0 150px; min-width: 0; }
.hbar-track { flex: 1 1 auto; min-width: 0; }
.hbar { height: 16px; border-radius: 4px; background: var(--neutral); }
.hbar.fill-opus { background: var(--opus); }
.hbar.fill-sonnet { background: var(--sonnet); }
.hbar.fill-haiku { background: var(--haiku); }
.hbar-num { flex: 0 0 56px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- SVG charts ---------- */

.chart { display: block; width: 100%; height: auto; margin-top: 12px; font-family: inherit; }
.axis-base { stroke: #C9CED8; stroke-width: 1; }
.axis-grid { stroke: var(--line); stroke-width: 1; }
.ax { font-size: 12px; fill: var(--label); }
.ax-label { font-size: 13px; fill: var(--ink-2); }
.ax-total { font-size: 13px; font-weight: 600; fill: var(--ink); }
.ax-value { font-size: 12px; fill: var(--ink-2); }
.seg { stroke: #FFFFFF; stroke-width: 1.5; fill: var(--neutral); }
.seg.fill-refinecv { fill: var(--refinecv); }
.seg.fill-suite { fill: var(--suite); }
.seg.fill-copilot { fill: var(--copilot); }
.seg-text { font-size: 11px; font-weight: 600; fill: var(--ink); }
.seg-text-suite { fill: #FFFFFF; }
.bar { fill: var(--neutral); }
.line { fill: none; stroke: var(--neutral); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.dot { fill: #5C6988; stroke: #FFFFFF; stroke-width: 1.5; }
.marker { stroke: var(--link); stroke-width: 2; stroke-dasharray: 5 4; }
.marker-text { font-size: 12px; fill: var(--link); }
.marker-strong { font-weight: 600; }

/* ---------- sign-in page ---------- */

.login-page { min-height: 100vh; display: flex; }
.login { width: 100%; max-width: 420px; margin: auto; padding: 32px 16px; display: flex; flex-direction: column; gap: 20px; }
.login .brand { justify-content: center; }
.login-card { padding: 24px; }
.login-card h1 { font-size: 24px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.login-card .control { flex: none; }
.login-card .lead { margin: 6px 0 0; }
.field-code { font-size: 22px; letter-spacing: 0.3em; font-variant-numeric: tabular-nums; text-align: center; }
.login-more { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; }
.login-msg { margin: 14px 0 0; color: #9B1C1C; font-weight: 500; }
.login-msg:empty { display: none; }

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .top-in { padding: 8px 16px; gap: 4px 16px; }
  .nav { flex-basis: 100%; order: 3; margin: 0 -8px; }
  .nav-link { padding: 10px 10px; }
  .account { margin-left: auto; }
  .who { display: none; }
  .main { padding: 20px 16px 40px; }
  h1 { font-size: 25px; }
  .pad { padding: 16px; }
  .tile { padding: 16px; flex-basis: 150px; }
  .tile-num { font-size: 32px; }
  .tile-num-sm { font-size: 30px; }
  .hbar-label { flex-basis: 104px; }
  .post-when { flex-basis: 100%; }
  .control { flex: 1 1 140px; }
  .control-grow { flex-basis: 100%; }
}

@media (prefers-reduced-motion: no-preference) {
  .skip { transition: top 0.12s ease; }
}
