@font-face {
  font-family: Manrope;
  src: url("assets/Manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
:root {
  --paper: #f6f2e9; --surface: #fffdf8; --forest: #1f4638; --ink: #202922;
  --muted: #60675f; --clay: #af492e; --sage: #dce5d7; --line: #d5d8cd; --on-accent: #fffdf8;
  --r1: 8px; --r2: 12px; --r3: 16px; --topbar: 61px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #181818; --surface: #272727; --forest: #dce5d7; --ink: #f6f2e9;
    --muted: #b8c1b4; --clay: #ffc1a8; --sage: #334638; --line: #545b51; --on-accent: #181818;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #181818; --surface: #272727; --forest: #dce5d7; --ink: #f6f2e9;
  --muted: #b8c1b4; --clay: #ffc1a8; --sage: #334638; --line: #545b51; --on-accent: #181818;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/24px Manrope, system-ui, sans-serif;
}
:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: var(--r1); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  height: var(--topbar); padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong { display: block; color: var(--forest); font-weight: 700; }
.brand span { display: block; font-size: 14px; line-height: 20px; color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.save-status { font-size: 14px; color: var(--muted); }

/* Layout */
.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - var(--topbar)); }
.sidebar {
  border-right: 1px solid var(--line); background: var(--surface);
  padding: 24px 16px; position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto;
}
.main { padding: 24px 32px 96px; max-width: 880px; width: 100%; min-width: 0; }

/* Metrics */
.metrics { display: grid; gap: 12px; margin-bottom: 24px; }
.metric { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r2); padding: 12px; }
.metric-value { font-size: 24px; line-height: 32px; color: var(--forest); }
.metric-value b { font-weight: 700; }
.metric-label { display: block; font-size: 14px; color: var(--muted); }
.bar { height: 6px; background: var(--line); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--forest); transition: width .2s; }
.fine { font-size: 12px; line-height: 16px; color: var(--muted); margin: 4px 0 0; }

.sidebar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sidebar-head h2 { font-size: 18px; margin: 0; }
.interview-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 6px; }
.interview-list button {
  width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: var(--r1); padding: 8px 10px;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px;
}
.interview-list button:hover { background: var(--paper); }
.interview-list button[aria-current="true"] { background: var(--sage); border-color: var(--line); }
.interview-list .code { font-weight: 600; }
.interview-list .date { font-size: 12px; color: var(--muted); grid-column: 1; }
.tag { font-size: 12px; line-height: 16px; padding: 2px 8px; border-radius: 99px; align-self: center; grid-row: 1 / span 2; grid-column: 2; }
.tag.done { background: var(--forest); color: var(--on-accent); }
.tag.draft { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.empty { color: var(--muted); font-size: 14px; padding: 8px 10px; }

.tools summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.file-btn input { display: none; }

/* Buttons */
.btn {
  font: 600 14px/20px Manrope, system-ui, sans-serif; cursor: pointer;
  padding: 10px 16px; border-radius: var(--r1);
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { border-color: var(--forest); }
.btn.primary { background: var(--forest); color: var(--on-accent); border-color: var(--forest); }
.btn.primary:hover { filter: brightness(1.12); }
.btn.ghost { background: transparent; border-color: var(--line); padding: 6px; color: var(--forest); }
.btn.ghost svg { display: block; }
.btn.danger { color: var(--clay); }
.btn.danger:hover { border-color: var(--clay); }
.btn.small { padding: 6px 10px; font-size: 13px; }

/* Section nav */
.section-nav {
  position: sticky; top: var(--topbar); z-index: 4; background: var(--paper);
  display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 12px; margin-bottom: 8px;
  scrollbar-width: thin;
}
.section-nav a {
  white-space: nowrap; text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
}
.section-nav a.complete { color: var(--forest); background: var(--sage); }
.section-nav a .count { font-weight: 400; margin-left: 4px; }

.notice {
  border-left: 4px solid var(--forest); background: var(--sage);
  padding: 12px 16px; border-radius: 0 var(--r1) var(--r1) 0; font-size: 14px; line-height: 20px; margin-bottom: 24px;
}
.notice.warn { border-left-color: var(--clay); background: var(--surface); }

/* Form */
fieldset.section {
  border: 1px solid var(--line); border-radius: var(--r3); background: var(--surface);
  padding: 24px; margin: 0 0 24px;
}
fieldset.section legend { font-size: 20px; line-height: 28px; font-weight: 700; color: var(--forest); padding: 0 8px; margin-left: -8px; }
.section-intro { color: var(--muted); font-size: 14px; line-height: 20px; margin: 4px 0 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.field { display: grid; gap: 6px; margin-bottom: 20px; }
.grid-2 .field { margin-bottom: 0; }
.field.wide { grid-column: 1 / -1; }
.field > label, .field > .label { font-weight: 600; font-size: 15px; line-height: 22px; }
.req { color: var(--clay); margin-left: 2px; }
.hint { font-size: 13px; line-height: 18px; color: var(--muted); }
input[type="text"], input[type="date"], input[type="number"], select, textarea {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r1); padding: 10px 12px; width: 100%;
}
input[type="text"], input[type="date"], input[type="number"], select { height: 46px; }
textarea { resize: vertical; min-height: 88px; line-height: 22px; }
input:focus, select:focus, textarea:focus { border-color: var(--forest); outline: 2px solid var(--forest); outline-offset: 0; }
.invalid input, .invalid textarea, .invalid select { border-color: var(--clay); }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.option {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px; background: var(--paper); font-size: 14px;
}
.option:has(input:checked) { background: var(--sage); border-color: var(--forest); color: var(--forest); font-weight: 600; }
.option input { accent-color: var(--forest); margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 500; }
.check input { accent-color: var(--forest); width: 18px; height: 18px; margin-top: 3px; flex: none; }

.form-footer { display: flex; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r1);
  font-size: 14px; box-shadow: 0 12px 32px #0003; z-index: 20;
}

/* Responsive */
@media (max-width: 900px) {
  :root { --topbar: 52px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .main { padding: 16px 16px 80px; }
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .brand span { display: none; }
  .brand strong, .save-status { white-space: nowrap; }
  .save-status { font-size: 12px; }
  .brand img { width: 22px; height: 22px; }
  fieldset.section { padding: 16px; }
}

/* Print */
@media print {
  .topbar, .sidebar, .section-nav, .form-footer, .notice, .skip { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; max-width: none; }
  body { background: #fff; color: #000; font-size: 12px; }
  fieldset.section { break-inside: avoid-page; border-color: #ccc; }
  textarea { border: 1px solid #ccc; min-height: 0; }
}

