/* Prep view: one scenario per interview; sections edited in place, autosaved. Mobile-first. */

.prep { flex: 1; overflow-y: auto; padding: 0 0 40px; overscroll-behavior: contain; }
.prep-head {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
  padding: 8px 10px; background: rgb(11 14 18 / 0.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px);
}
.title-input {
  flex: 1 1 100%; min-width: 0; padding-left: 4px; font: 650 1.15rem var(--font-read);
  background: transparent !important; border-color: transparent !important;
}
.title-input:hover, .title-input:focus { border-color: var(--line) !important; }
.prep-head .ghost, .prep-head .primary { padding: 6px 10px; }
.save-state { order: 10; flex-basis: 100%; min-height: 1em; font-size: 0.82rem; color: var(--text-faint); }
.save-state[data-state="ok"] { color: var(--ok); }
.save-state[data-state="error"] { color: var(--danger); }

.prep-nav { display: flex; gap: 6px; padding: 8px 10px 0; overflow-x: auto; scrollbar-width: none; }
.prep-nav a {
  flex-shrink: 0; min-height: 34px; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line);
  color: var(--text-dim); text-decoration: none; font-size: 0.88rem; white-space: nowrap;
}
.prep-nav a:hover { color: var(--text); border-color: var(--line-strong); }

.prep-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px 10px; max-width: 1280px; }
.prep-card {
  min-width: 0; display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 110px;
  padding: 14px 12px; border-radius: var(--radius-l); background: var(--surface); border: 1px solid var(--line);
}
.prep-card h3 { margin: 0; font: 650 1.02rem var(--font-read); }
.hint { margin: 0; color: var(--text-dim); font-size: 0.88rem; }
.hint code { padding: 1px 5px; border-radius: 4px; background: var(--surface-3); color: #fde68a; }
.snippets, .filters { display: flex; flex-wrap: wrap; gap: 6px; }
.card-title-row { display: flex; justify-content: space-between; align-items: center; }

.kind-picker { align-self: flex-start; }
.material-add { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.dropzone {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; text-align: center;
  min-height: 72px; padding: 14px; border-radius: var(--radius-m); border: 1.5px dashed #33404f; background: var(--bg);
  cursor: pointer; transition: border-color var(--fast), background var(--fast);
}
.dropzone:hover, .dropzone.over { border-color: var(--live); background: #0c1a19; }
.dropzone.busy { opacity: 0.6; pointer-events: none; }
.note-form { display: flex; flex-direction: column; gap: 8px; }
.note-form button { align-self: flex-end; }

.doc-list, .history-list { list-style: none; margin: 0; padding: 0; }
.doc { border-bottom: 1px solid var(--line); }
.doc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 0; }
.doc-meta { flex: 1; min-width: 140px; }
.doc-name { font-weight: 600; overflow-wrap: anywhere; }
.kind { flex-shrink: 0; padding: 2px 7px; border-radius: 4px; font: 700 0.64rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; }
.kind.notes { background: var(--live-soft); color: var(--live); }
.kind.cheatsheet { background: #2a1f0b; color: var(--busy); }
.kind.material { background: #1e1b3a; color: var(--violet); }
.doc-editor { display: flex; flex-direction: column; gap: 8px; padding: 0 0 12px; }
.doc-editor .row { display: flex; gap: 8px; }
.empty-row { padding: 12px 0; color: var(--text-dim); }

.history-item { border-bottom: 1px solid var(--line); }
.history-item summary { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; min-height: var(--tap); padding: 8px 0; cursor: pointer; list-style: none; }
.history-q { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item .md { padding: 0 0 12px; font-size: 0.94rem; color: #cfd8e3; }

@media (min-width: 960px) {
  .prep-head { gap: 10px; padding: 12px 22px; }
  .title-input { flex: 0 1 360px; font-size: 1.25rem; }
  .save-state { order: initial; flex-basis: auto; }
  .prep-nav { padding: 10px 22px 0; }
  .prep-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 14px 22px; }
  .prep-card { padding: 16px; scroll-margin-top: 90px; }
  #prep-background, #prep-materials, #prep-history { grid-column: 1 / -1; }
  .material-add { grid-template-columns: 220px minmax(0, 1fr); }
}
