/* Duet — warm editorial look: paper, ink, one burnt-orange accent, serif headlines. */
:root {
  --bg: #f3efe7; --paper: #fbf9f4; --ink: #1b1916; --ink-2: #3a3632; --muted: #77706a;
  --line: #e2dcd1; --line-2: #cfc7b9; --accent: #c4471d; --accent-soft: #f5e3d8;
  --ok: #2f6b4f; --ok-soft: #e1ede5; --warn: #8a5f10; --warn-soft: #f6ecd6; --bad: #a8321e; --bad-soft: #f5deda;
  --a: #c4471d; --b: #2f5d8a;
  --serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --r: 8px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141311; --paper: #1c1a17; --ink: #efebe4; --ink-2: #d4cec5; --muted: #9c958b; --line: #2e2b27; --line-2: #45403a;
    --accent: #e2683c; --accent-soft: #3a2218; --ok: #6fbf97; --ok-soft: #1c2e25; --warn: #e0b45a; --warn-soft: #33291a; --bad: #ef8a76; --bad-soft: #3a1f1a;
    --a: #e2683c; --b: #7fa8d6;
  }
}
:root[data-theme="dark"] {
  --bg: #141311; --paper: #1c1a17; --ink: #efebe4; --ink-2: #d4cec5; --muted: #9c958b; --line: #2e2b27; --line-2: #45403a;
  --accent: #e2683c; --accent-soft: #3a2218; --ok: #6fbf97; --ok-soft: #1c2e25; --warn: #e0b45a; --warn-soft: #33291a; --bad: #ef8a76; --bad-soft: #3a1f1a;
  --a: #e2683c; --b: #7fa8d6;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
main { max-width: 860px; margin: 0 auto; padding: 32px 16px 96px; }
main.narrow { max-width: 680px; }
h1, h2, .serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
h1 { font-size: 44px; line-height: 1.05; margin: 0 0 8px; }
h2 { font-size: 28px; line-height: 1.15; margin: 0 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; line-height: 1.4; }
p { margin: 0; }
a { color: var(--ink); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: 13.5px; }
.eyebrow { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.stack > * + * { margin-top: 18px; }
.stack-s > * + * { margin-top: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } h1 { font-size: 36px; } h2 { font-size: 24px; } .card { padding: 18px; } }
.brand { font-family: var(--serif); font-size: 26px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand i { color: var(--accent); }

/* buttons & inputs */
button, .btn {
  font: inherit; font-weight: 500; font-size: 14.5px; border: 1px solid var(--line-2); background: var(--paper); color: var(--ink);
  padding: 10px 16px; border-radius: var(--r); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; line-height: 1.3;
  transition: background .12s, border-color .12s, color .12s;
}
button:hover:not(:disabled), .btn:hover { border-color: var(--ink); }
button.primary, .btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--accent); border-color: var(--accent); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover:not(:disabled) { color: var(--ink); border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
button.danger { background: transparent; border-color: transparent; color: var(--bad); }
button.danger:hover:not(:disabled) { border-color: var(--bad); }
button.small, .btn.small { padding: 6px 11px; font-size: 13px; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
input[type=text], input[type=password], input[type=number], textarea, select {
  font: inherit; width: 100%; padding: 11px 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--paper); color: var(--ink);
}
input:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 96px; resize: vertical; }
label.check { display: flex; gap: 8px; align-items: center; cursor: pointer; }
input[type=checkbox] { accent-color: var(--ink); width: 16px; height: 16px; flex: none; }
input[type=range] { accent-color: var(--accent); width: 100%; }
code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; background: var(--bg); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; word-break: break-all; }

/* tags */
.pill { display: inline-block; border-radius: 4px; padding: 2px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .03em; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.pill.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 9px; font-size: 13px; }
.error { color: var(--bad); font-size: 14px; }
.notice { background: var(--warn-soft); border-radius: var(--r); padding: 12px 14px; font-size: 14px; }
.notice.ok { background: var(--ok-soft); }
.notice.bad { background: var(--bad-soft); }
.spinner { width: 15px; height: 15px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ---------- questionnaire ---------- */
.topbar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 680px; margin: 0 auto; padding: 12px 16px 0; }
.progress { height: 2px; background: var(--line); }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.steps { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; padding: 10px 0 0; margin: 0; }
.steps::-webkit-scrollbar { display: none; }
.steps a { flex: none; font-size: 13px; color: var(--muted); text-decoration: none; padding-bottom: 9px; border-bottom: 2px solid transparent; white-space: nowrap; }
.steps a .n { font-variant-numeric: tabular-nums; opacity: .6; margin-right: 4px; }
.steps a.done { color: var(--ink-2); }
.steps a.done .n::after { content: ' ✓'; color: var(--ok); }
.steps a.on { color: var(--ink); border-bottom-color: var(--accent); }
.steps a.locked { pointer-events: none; opacity: .45; }
.fact { border-left: 2px solid var(--accent); padding: 2px 0 2px 14px; margin: 16px 0 4px; color: var(--ink-2); font-size: 14px; }
.fact .eyebrow { color: var(--accent); display: block; margin-bottom: 2px; }
.q { padding: 22px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; }
.q > h3 { font-size: 16.5px; font-weight: 550; margin-bottom: 12px; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.opts button { justify-content: flex-start; text-align: left; padding: 12px 14px; font-weight: 400; gap: 10px; min-height: 46px; }
.opts button::before { content: ''; flex: none; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--paper); }
.opts.multi button::before { border-radius: 4px; }
.opts button.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opts button.on::before { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 3px var(--paper); }
.opts.multi button.on::before { box-shadow: none; background: var(--accent); border-color: var(--accent); }
.imp { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 12px; font-size: 13px; color: var(--muted); }
.imp .seg { display: inline-flex; gap: 2px; flex-wrap: wrap; }
.imp .seg button { border: 0; background: transparent; padding: 3px 8px; font-size: 13px; font-weight: 400; color: var(--muted); border-radius: 4px; }
.imp .seg button:hover:not(:disabled) { color: var(--ink); }
.imp .seg button.on { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line-2); }
.scale7 { display: grid; gap: 6px; max-width: 440px; }
.scale7 button { padding: 10px 0; justify-content: center; font-variant-numeric: tabular-nums; }
.scale7 button.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.scale-ends { display: flex; justify-content: space-between; max-width: 440px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.drop { display: block; border: 1px dashed var(--line-2); border-radius: var(--r); padding: 18px; text-align: center; cursor: pointer; color: var(--muted); }
.drop:hover { border-color: var(--ink); color: var(--ink); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.nav-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.spotify { background: #1db954 !important; border-color: #1db954 !important; color: #fff !important; font-size: 16px; padding: 14px 24px; border-radius: 999px; font-weight: 600; }
.spotify:hover:not(:disabled) { background: #1aa34a !important; border-color: #1aa34a !important; }

/* ---------- reports ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 32px; align-items: center; }
@media (max-width: 620px) { .hero { grid-template-columns: 1fr; gap: 16px; } }
.ring { position: relative; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 56px; letter-spacing: -0.02em; }
.ring .num small { font-size: 20px; color: var(--muted); }
.verdict { font-family: var(--serif); font-size: 34px; line-height: 1.1; }
.bar-row { display: grid; grid-template-columns: minmax(150px, 230px) 1fr 40px; gap: 14px; align-items: center; font-size: 14px; }
.bar-row + .bar-row { margin-top: 12px; }
@media (max-width: 520px) { .bar-row { grid-template-columns: 120px 1fr 34px; gap: 10px; } }
.bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.insights { display: grid; }
.insight { padding: 14px 0; border-top: 1px solid var(--line); }
.insight:first-child { border-top: 0; padding-top: 0; }
.insight p { font-size: 14px; color: var(--muted); margin-top: 2px; }
.insight .tag { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; border-top: 0; }
.table-wrap { overflow-x: auto; }
.trait { display: grid; grid-template-columns: 100px 1fr 100px; gap: 12px; align-items: center; font-size: 13px; }
.trait + .trait { margin-top: 12px; }
.trait .track { position: relative; height: 2px; background: var(--line-2); }
.trait .dot { position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid var(--paper); }
.trait .r { text-align: right; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
ul.plain { list-style: none; padding: 0; margin: 6px 0 0; }
details > summary { cursor: pointer; }

/* ---------- management area ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 28px 18px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { text-decoration: none; color: var(--ink-2); padding: 8px 10px; border-radius: 6px; font-size: 14.5px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side nav a:hover { background: var(--paper); }
.side nav a.on { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.side nav a .count { font-size: 12px; color: var(--muted); font-weight: 400; }
.side .foot { margin-top: auto; font-size: 13px; }
.content { padding: 40px 44px 96px; max-width: 1020px; width: 100%; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stats > div { padding: 16px 18px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); min-width: 0; }
.stats b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats b { display: block; font-family: var(--serif); font-size: 36px; font-weight: 400; line-height: 1.1; }
.list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); }
.list-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 16px 18px; border-top: 1px solid var(--line); align-items: center; }
.list-row:first-child { border-top: 0; }
.score-num { font-family: var(--serif); font-size: 32px; line-height: 1; text-align: right; }
.score-num small { font-size: 14px; color: var(--muted); }
.weight-row { display: grid; grid-template-columns: minmax(160px, 260px) 1fr 110px; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.weight-row:first-child { border-top: 0; }
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side nav { flex-direction: row; overflow-x: auto; width: 100%; scrollbar-width: none; order: 3; }
  .side nav a { white-space: nowrap; }
  .side .foot { margin: 0 0 0 auto; }
  .content { padding: 24px 16px 80px; }
  .weight-row { grid-template-columns: 1fr; gap: 6px; }
}
.opts.compact { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.opts.compact button { min-height: 40px; padding: 9px 12px; font-size: 14px; }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
