/* ResumeTailor UI (redesign). Tokens mirror the Figma "Tokens" collection.
   No CSS framework: plain CSS so it stays easy to read and change. */
:root {
  --color-bg-canvas: #f8f8fa;
  --color-bg-surface: #ffffff;
  --color-bg-muted: #f4f4f5;
  --color-bg-primary: #4f46e5;
  --color-bg-primary-hover: #4338ca;
  --color-bg-primary-subtle: #eef2ff;
  --color-bg-success-subtle: #f0fdf4;
  --color-bg-warning-subtle: #fffbeb;
  --color-bg-danger-subtle: #fef2f2;
  --color-bg-info-subtle: #eff6ff;
  --color-bg-danger: #dc2626;
  --color-bar-high: #16a34a;
  --color-bar-medium: #d97706;
  --color-bar-low: #dc2626;
  --color-text-default: #09090b;
  --color-text-muted: #636370;
  --color-text-on-primary: #ffffff;
  --color-text-primary: #4338ca;
  --color-text-success: #15803d;
  --color-text-warning: #b45309;
  --color-text-danger: #b91c1c;
  --color-text-info: #1d4ed8;
  --color-border-default: #e4e4e7;
  --color-border-input: #d4d4d8;
  --color-border-primary: #4f46e5;
  --color-border-warning: #f59e0b;
  --color-border-danger: #ef4444;
  --color-border-info: #3b82f6;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px;
  --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(9, 9, 11, .05);
  --shadow-lg: 0 12px 32px rgba(9, 9, 11, .14);
  --sidebar-w: 248px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 20px;
  color: var(--color-text-default); background: var(--color-bg-canvas);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, p { margin: 0; }
a { color: var(--color-text-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
:focus-visible { outline: 2px solid var(--color-border-primary); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--color-text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Typography ─────────────────────────────────────────────── */
.display { font-size: 30px; line-height: 38px; font-weight: 600; letter-spacing: -.5px; }
.h1 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.3px; }
.h2 { font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -.2px; }
.h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
.small { font-size: 13px; line-height: 18px; }
.caption { font-size: 12px; line-height: 16px; font-weight: 500; }
.overline { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--color-text-muted); }
.stat-value { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.medium { font-weight: 500; }
.strong { font-weight: 600; }
.text-success { color: var(--color-text-success); }
.text-warning { color: var(--color-text-warning); }
.text-danger { color: var(--color-text-danger); }

/* ── App shell: sidebar (desktop) / bottom tab bar (mobile) ───── */
.shell { display: flex; min-height: 100vh; }
.sidebar-col { width: var(--sidebar-w); flex: none; background: var(--color-bg-surface); border-right: 1px solid var(--color-border-default); }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: var(--space-6);
  padding: var(--space-6) var(--space-4);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 var(--space-2); font-weight: 600; font-size: 15px; color: var(--color-text-default); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: var(--radius-md); background: var(--color-bg-primary); color: #fff; display: grid; place-items: center; }
.nav { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav-item {
  display: flex; align-items: center; gap: var(--space-3); min-height: 40px; padding: 0 var(--space-3);
  border-radius: var(--radius-md); color: var(--color-text-default); font-weight: 500;
  background: none; border: 0; font: inherit; font-weight: 500; cursor: pointer; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--color-bg-muted); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--color-bg-primary-subtle); color: var(--color-text-primary); }
.nav-item .count { margin-left: auto; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--space-2); border-top: 1px solid var(--color-border-default); padding-top: var(--space-4); }
.user { display: flex; align-items: center; gap: 10px; padding: 0 var(--space-2); min-width: 0; }
.user .email { font-size: 12px; line-height: 16px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 32px; height: 32px; flex: none; border-radius: var(--radius-full); background: var(--color-bg-muted); display: grid; place-items: center; font-size: 12px; font-weight: 600; text-transform: uppercase; }

.main { flex: 1; min-width: 0; padding: var(--space-8) 40px 48px; }
#app > * + * { margin-top: var(--space-6); }
#app > .crumbs + *, #app > #crumbs + * { margin-top: var(--space-3); }
.container { max-width: 1160px; }
.mock-banner { font-size: 12px; text-align: center; padding: 4px; background: var(--color-bg-warning-subtle); color: var(--color-text-warning); border-bottom: 1px solid var(--color-border-default); }

.tabbar { display: none; }
@media (max-width: 860px) {
  .sidebar-col { display: none; }
  .main { padding: var(--space-6) var(--space-4) 96px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(6, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--color-bg-surface); border-top: 1px solid var(--color-border-default);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tab-item { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center; font-size: 11px; font-weight: 500; color: var(--color-text-muted); }
  .tab-item:hover { text-decoration: none; }
  .tab-item[aria-current="page"] { color: var(--color-text-primary); }
  .mobile-top { display: flex !important; }
}
.mobile-top { display: none; align-items: center; justify-content: space-between; margin-bottom: var(--space-6); }

/* ── Page header & breadcrumbs ───────────────────────────────── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
.page-head p { color: var(--color-text-muted); margin-top: 4px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--color-text-muted); }
.crumbs a { color: var(--color-text-muted); }
.crumbs .here { color: var(--color-text-default); font-weight: 500; }

/* ── Surfaces ────────────────────────────────────────────────── */
.card { background: var(--color-bg-surface); border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow-sm); }
.card > * + * { margin-top: var(--space-4); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.card.tight { padding: var(--space-4) var(--space-6); }
.card.primary-soft { background: var(--color-bg-primary-subtle); border-color: var(--color-border-primary); }
.stack > * + * { margin-top: var(--space-4); }
.stack-sm > * + * { margin-top: var(--space-2); }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-6); align-items: start; }
.split > aside { position: sticky; top: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } .split > aside { position: static; } }
.divider { border: 0; border-top: 1px solid var(--color-border-default); margin-left: 0; margin-right: 0; margin-bottom: 0; }
.list > * { padding: var(--space-3) 0; border-top: 1px solid var(--color-border-default); }
.list > *:last-child { padding-bottom: 0; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 40px; padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid transparent;
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  background: var(--color-bg-primary); color: var(--color-text-on-primary); transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--color-bg-primary-hover); }
.btn.secondary { background: var(--color-bg-surface); color: var(--color-text-default); border-color: var(--color-border-input); }
.btn.secondary:hover { background: var(--color-bg-muted); }
.btn.soft { background: var(--color-bg-primary-subtle); color: var(--color-text-primary); }
.btn.soft:hover { background: #e0e7ff; }
.btn.ghost { background: transparent; color: var(--color-text-default); }
.btn.ghost:hover { background: var(--color-bg-muted); }
.btn.destructive { background: var(--color-bg-danger); color: #fff; }
.btn.destructive:hover { background: #b91c1c; }
.btn.sm { min-height: 32px; padding: 0 var(--space-3); font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn[aria-busy="true"]::before { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.link-btn { all: unset; cursor: pointer; color: var(--color-text-primary); font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--color-border-primary); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 860px) { .btn { min-height: 44px; } .btn.sm { min-height: 40px; } }

/* ── Badges & chips ──────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: var(--radius-full); font-size: 11px; font-weight: 500; line-height: 1; white-space: nowrap; vertical-align: middle; background: var(--color-bg-muted); color: var(--color-text-default); }
.badge.primary { background: var(--color-bg-primary-subtle); color: var(--color-text-primary); }
.badge.success { background: var(--color-bg-success-subtle); color: var(--color-text-success); }
.badge.warning { background: var(--color-bg-warning-subtle); color: var(--color-text-warning); }
.badge.danger { background: var(--color-bg-danger-subtle); color: var(--color-text-danger); }
.badge.info { background: var(--color-bg-info-subtle); color: var(--color-text-info); }
.badge.outline { background: transparent; border: 1px solid currentColor; }
.badge.outline.neutral { border-color: var(--color-border-input); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 10px; border-radius: var(--radius-full); background: var(--color-bg-muted); border: 1px solid var(--color-border-default); font-size: 13px; }
.chip button { all: unset; cursor: pointer; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--color-text-muted); }
.chip button:hover { background: var(--color-border-default); color: var(--color-text-default); }
.chip button:focus-visible { outline: 2px solid var(--color-border-primary); }
.chip-add { display: inline-flex; gap: 4px; }
.chips .chip-add input { min-height: 28px !important; height: 28px; width: 150px; padding: 0 10px !important; font-size: 13px; border-radius: var(--radius-full) !important; }
.chip-add .btn { min-height: 28px; height: 28px; padding: 0 10px; border-radius: var(--radius-full); }
.chip-group + .chip-group { margin-top: var(--space-4); }
.chip-group > .label { display: block; margin-bottom: var(--space-2); }

/* ── Form fields ─────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-size: 13px; font-weight: 500; }
.field .help { font-size: 12px; line-height: 16px; color: var(--color-text-muted); font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input:not([type]), select, textarea {
  font: inherit; color: inherit; width: 100%; min-height: 40px; padding: 8px 12px;
  background: var(--color-bg-surface); border: 1px solid var(--color-border-input); border-radius: var(--radius-md);
}
textarea { resize: vertical; line-height: 20px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-border-primary); box-shadow: 0 0 0 3px var(--color-bg-primary-subtle); }
input[aria-invalid="true"] { border-color: var(--color-border-danger); }
input::placeholder, textarea::placeholder { color: #a1a1aa; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; min-height: 24px; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--color-bg-primary); flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-4); }
.form-error { color: var(--color-text-danger); font-size: 13px; display: flex; gap: 6px; align-items: flex-start; }
@media (max-width: 860px) { input, select, textarea { min-height: 44px; font-size: 16px; } }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); border: 1px solid; font-size: 13px; line-height: 18px; }
.alert svg { flex: none; margin-top: 1px; }
.alert .body { flex: 1; }
.alert .body > strong { display: block; font-weight: 600; }
.alert.info { background: var(--color-bg-info-subtle); border-color: var(--color-border-info); color: var(--color-text-info); }
.alert.success { background: var(--color-bg-success-subtle); border-color: #86efac; color: var(--color-text-success); }
.alert.warning { background: var(--color-bg-warning-subtle); border-color: var(--color-border-warning); color: var(--color-text-warning); }
.alert.danger { background: var(--color-bg-danger-subtle); border-color: var(--color-border-danger); color: var(--color-text-danger); }
.alert a { color: inherit; font-weight: 600; text-decoration: underline; }
.note { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; line-height: 16px; color: var(--color-text-muted); }
.note svg { flex: none; margin-top: 0; }

/* ── Stats ───────────────────────────────────────────────────── */
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--color-bg-surface); border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); }
.stat-strip > div { padding: var(--space-4) var(--space-6); }
.stat-strip > div + div { border-left: 1px solid var(--color-border-default); }
.stat-label { font-size: 13px; color: var(--color-text-muted); }
.stat-hint { font-size: 12px; line-height: 16px; color: var(--color-text-muted); margin-top: 2px; }
@media (max-width: 860px) {
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip > div + div { border-left: 0; }
  .stat-strip > div:nth-child(even) { border-left: 1px solid var(--color-border-default); }
  .stat-strip > div:nth-child(n+3) { border-top: 1px solid var(--color-border-default); }
  .stat-strip > div { padding: var(--space-3) var(--space-4); }
  .stat-value { font-size: 24px; line-height: 30px; }
}

/* ── Progress & score bars ───────────────────────────────────── */
.progress { height: 6px; border-radius: var(--radius-full); background: var(--color-bg-muted); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--color-bg-primary); border-radius: inherit; }
.score-row { display: grid; grid-template-columns: 96px 1fr 44px; align-items: center; gap: var(--space-3); font-size: 13px; min-height: 26px; }
.bar { height: 8px; background: var(--color-bg-muted); border-radius: var(--radius-full); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; transition: width .6s ease; }
.bar .hi { background: var(--color-bar-high); } .bar .mid { background: var(--color-bar-medium); } .bar .lo { background: var(--color-bar-low); }
.score-row .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.score-row.na { color: var(--color-text-muted); }
.overall { display: flex; align-items: center; gap: var(--space-3); }
.overall .value { font-size: 40px; line-height: 44px; font-weight: 600; letter-spacing: -1px; }

/* ── Stepper ─────────────────────────────────────────────────── */
.stepper { display: flex; align-items: center; gap: var(--space-3); margin: 0; padding: var(--space-3) var(--space-4); list-style: none; background: var(--color-bg-surface); border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); overflow-x: auto; }
.stepper li { display: flex; align-items: center; gap: var(--space-2); white-space: nowrap; font-size: 13px; color: var(--color-text-muted); }
.stepper li + li::before { content: ''; width: 28px; height: 1px; background: var(--color-border-input); margin-right: var(--space-1); }
.stepper .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; border: 1px solid var(--color-border-input); flex: none; }
.stepper .done { color: var(--color-text-default); }
.stepper .done .dot { border: 0; color: var(--color-bar-high); }
.stepper .active { color: var(--color-text-default); font-weight: 500; }
.stepper .active .dot { background: var(--color-bg-primary); border-color: var(--color-bg-primary); color: #fff; }

/* ── Tabs (segmented) ────────────────────────────────────────── */
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--color-bg-muted); border-radius: var(--radius-md); }
.tabs button { all: unset; cursor: pointer; min-height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-sm); font-weight: 500; font-size: 13px; color: var(--color-text-muted); display: inline-flex; align-items: center; }
.tabs button[aria-selected="true"] { background: var(--color-bg-surface); color: var(--color-text-default); box-shadow: var(--shadow-sm); }
.tabs button:focus-visible { outline: 2px solid var(--color-border-primary); }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 500; color: var(--color-text-muted); padding: 10px var(--space-3); border-bottom: 1px solid var(--color-border-default); white-space: nowrap; }
th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
td { padding: var(--space-3); border-bottom: 1px solid var(--color-border-default); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td select { min-height: 34px; padding: 4px 8px; min-width: 9.5rem; width: auto; font-size: 13px; }
.cell-sub { font-size: 12px; color: var(--color-text-muted); }

/* ── Dialog ──────────────────────────────────────────────────── */
dialog { border: 0; padding: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); color: inherit; background: var(--color-bg-surface); }
dialog::backdrop { background: rgba(9, 9, 11, .45); }
.dlg { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.dlg-foot { display: flex; justify-content: flex-end; gap: var(--space-2); flex-wrap: wrap; }

/* ── Workflow cards (dashboard) ──────────────────────────────── */
.wf { display: flex; flex-direction: column; gap: var(--space-4); }
.wf-head { display: flex; gap: var(--space-3); align-items: center; }
.wf-icon { width: 40px; height: 40px; flex: none; border-radius: var(--radius-md); background: var(--color-bg-primary-subtle); color: var(--color-text-primary); display: grid; place-items: center; }
.wf-foot { margin-top: auto !important; display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.wf .big { display: flex; align-items: baseline; gap: var(--space-2); }
.mini-row { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.mini-row .t { font-weight: 500; }
.mini-row .s { font-size: 12px; line-height: 16px; color: var(--color-text-muted); }

/* ── Profile ─────────────────────────────────────────────────── */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; border: 1.5px dashed var(--color-border-input); border-radius: var(--radius-lg); padding: var(--space-6); cursor: pointer; background: var(--color-bg-canvas); }
.dropzone:hover, .dropzone:focus-within { border-color: var(--color-border-primary); background: var(--color-bg-primary-subtle); }
.dropzone.locked { cursor: default; opacity: .75; }
.dropzone.locked:hover { border-color: var(--color-border-input); background: var(--color-bg-canvas); }
.section-head { display: flex; align-items: center; gap: var(--space-2); }
.item-card { background: var(--color-bg-surface); border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-6); }
.item-card + .item-card { margin-top: var(--space-3); }
.item-card.pending { border-left: 4px solid var(--color-border-warning); background: #fffdf7; }
.item-card .title-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.item-card .meta { font-size: 13px; color: var(--color-text-muted); margin-top: 2px; }
.item-card ul { margin: var(--space-2) 0 0; padding-left: 18px; }
.item-card li + li { margin-top: 2px; }
.item-card .chips { margin-top: var(--space-3); }
.item-card .actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-3); }
.repo-list > label { padding: var(--space-3); border: 1px solid var(--color-border-default); border-radius: var(--radius-md); }
.repo-list > label + label { margin-top: var(--space-2); }

/* ── Requirement lists (check page) ──────────────────────────── */
.req-group + .req-group { margin-top: var(--space-6); }
.req-group h4 { display: flex; align-items: center; gap: var(--space-2); font-size: 14px; font-weight: 600; }
.req-group .lead { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.req-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; }
.req-list li { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border-default); }
.req-list li .r { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; font-weight: 500; }
.req-list li small { display: block; color: var(--color-text-muted); font-size: 12px; line-height: 16px; margin-top: 4px; }
details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: var(--space-2); font-weight: 600; font-size: 15px; min-height: 32px; }
details > summary::-webkit-details-marker { display: none; }
details > summary .chev { transition: transform .15s; }
details[open] > summary .chev { transform: rotate(90deg); }
pre.raw { white-space: pre-wrap; font: inherit; font-size: 13px; background: var(--color-bg-canvas); padding: var(--space-4); border-radius: var(--radius-md); max-height: 360px; overflow: auto; margin: var(--space-3) 0 0; }

/* ── Draft editor ────────────────────────────────────────────── */
.doc { background: var(--color-bg-surface); border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); padding: var(--space-8) 40px; box-shadow: var(--shadow-sm); }
.doc h3 { margin: var(--space-6) 0 var(--space-2); font-size: 11px; letter-spacing: .6px; text-transform: uppercase; font-weight: 600; border-bottom: 1px solid var(--color-border-default); padding-bottom: 6px; }
.doc h3:first-child { margin-top: 0; }
@media (max-width: 860px) { .doc { padding: var(--space-4); } }
.bullet { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); margin-bottom: 4px; border-left: 3px solid transparent; }
.bullet:hover, .bullet:focus-within { background: var(--color-bg-muted); }
.bullet.unsupported { background: var(--color-bg-danger-subtle); border-left-color: var(--color-border-danger); }
.bullet.user { border-left-color: var(--color-border-info); }
.bullet .text { display: flex; gap: var(--space-2); align-items: flex-start; justify-content: space-between; }
.bullet .src { display: block; font-size: 12px; line-height: 16px; color: var(--color-text-muted); margin-top: 2px; }
.bullet .src.bad { color: var(--color-text-danger); display: flex; gap: 4px; }
.bullet .tools { display: none; gap: var(--space-1); margin-top: var(--space-1); }
.bullet:hover .tools, .bullet:focus-within .tools, .bullet.unsupported .tools { display: flex; }
@media (hover: none) { .bullet .tools { display: flex; } }
.bullet textarea { margin: var(--space-1) 0 var(--space-2); }
.timeline { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--color-text-muted); }
.timeline .v { padding: 2px 10px; border-radius: var(--radius-full); background: var(--color-bg-muted); color: var(--color-text-default); font-weight: 500; }
.timeline .v.current { background: var(--color-bg-primary); color: #fff; }

/* ── Misc ────────────────────────────────────────────────────── */
.locked-box { text-align: center; padding: var(--space-4); display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.lock-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--color-bg-muted); display: grid; place-items: center; color: var(--color-text-muted); }
.empty { text-align: center; color: var(--color-text-muted); padding: var(--space-4); font-size: 13px; }
.loading { display: flex; align-items: center; gap: var(--space-2); color: var(--color-text-muted); }
.loading::before { content: ''; width: 16px; height: 16px; border: 2px solid var(--color-border-input); border-right-color: var(--color-bg-primary); border-radius: 50%; animation: spin .7s linear infinite; }
#app[aria-busy="true"]:empty::before { content: 'Loading…'; color: var(--color-text-muted); }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--space-6) var(--space-4); }
.auth-card { width: min(420px, 100%); }
.danger-zone { border-color: var(--color-border-danger); }

.show-sm { display: none; }
@media (max-width: 860px) { .hide-sm { display: none; } .show-sm { display: block; } }

/* AI insights: skills to learn */
.skill-list { list-style: none; padding: 0; margin: 0; }
.skill-row { display: flex; gap: var(--space-4); justify-content: space-between; align-items: flex-start; padding: var(--space-3) 0; border-top: 1px solid var(--color-border-default); }
.skill-list > .skill-row:first-child { border-top: 0; }
.skill-main { min-width: 0; }
.skill-gain { text-align: right; flex-shrink: 0; }
.advice-list { padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.advice-list p { margin: 2px 0 0; }
.about-steps { padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.advice-controls { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.h4 { font-size: 14px; line-height: 20px; font-weight: 600; margin: var(--space-4) 0 var(--space-1); }
#review-body { max-width: 560px; }
table.compact th, table.compact td { padding-left: 6px; padding-right: 6px; white-space: nowrap; }
.src .evidence { font-style: italic; color: var(--color-text-muted); }
