/* Last Updated: 2026-09-19 22:31:46 */
/* Accessible Doctrine-branded customer interface for Guided and Studio modes. */

:root {
  --bg: #0b1220;
  --surface: #111a2e;
  --surface-2: #16223c;
  --surface-3: #1b2a49;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --dim: #64748b;
  --border: #263652;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #38bdf8;
  --amber: #f59e0b;
  --green: #34d399;
  --red: #fb7185;
  --radius: 14px;
  --shadow: 0 18px 48px rgb(0 0 0 / 24%);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% -20%, #1a3157 0, var(--bg) 38rem); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button, .button {
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--primary);
  color: white;
  padding: .72rem 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
button:hover, .button:hover { background: var(--primary-dark); }
button:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: .45; }
button.quiet { background: transparent; border-color: var(--border); color: var(--text); }
button.quiet:hover { background: var(--surface-3); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}
input, select, textarea {
  width: 100%;
  padding: .72rem .78rem;
  color: var(--text);
  background: #0d1729;
  border: 1px solid var(--border);
  border-radius: 8px;
}
label, legend { font-weight: 650; }
.optional { color: var(--muted); font-size: .82rem; font-weight: 500; }
fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 1rem; }
code { overflow-wrap: anywhere; color: #bfdbfe; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.4rem 0; }

.skip-link { position: fixed; z-index: 100; left: 1rem; top: -4rem; background: white; color: black; padding: .7rem 1rem; }
.skip-link:focus { top: 1rem; }
.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  min-height: 70px;
  padding: .5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: rgb(11 18 32 / 94%);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none; }
.brand img { width: 52px; height: 52px; object-fit: contain; }
.brand span { display: grid; }
.brand strong { letter-spacing: .03em; }
.brand small { color: var(--muted); }
.top-status { display: flex; flex-wrap: wrap; gap: .7rem 1rem; align-items: center; color: var(--muted); font-size: .88rem; }
.status-label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .22rem .6rem;
  color: var(--text);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.status-label::before { content: ""; width: .48rem; height: .48rem; border-radius: 50%; background: var(--muted); }
.status-label[data-status="ready"]::before,
.status-label[data-status="completed"]::before,
.status-label[data-status="ready_for_bpo"]::before,
.status-label[data-status="ready_to_run"]::before { background: var(--green); }
.status-label[data-status="running"]::before,
.status-label[data-status="queued"]::before,
.status-label[data-status="ocr_review"]::before { background: var(--accent); }
.status-label[data-status="failed"]::before,
.status-label[data-status="quality_failed"]::before { background: var(--red); }

.login-shell { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 2rem; }
.login-card { max-width: 610px; background: rgb(17 26 46 / 95%); border: 1px solid var(--border); border-radius: 20px; padding: clamp(1.5rem, 5vw, 3.5rem); box-shadow: var(--shadow); }
.login-card h1 { font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.02; margin: .4rem 0 1.2rem; }
.login-card p { color: var(--muted); line-height: 1.65; }
.stack { display: grid; gap: .72rem; }
.inline-error { padding: .8rem; margin: 1rem 0; border-left: 4px solid var(--red); background: rgb(251 113 133 / 12%); }
.eyebrow { color: var(--amber) !important; font-size: .75rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }

.projects-shell { width: min(1320px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 5rem; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 2rem; padding: 2.5rem 0 3rem; }
.hero h1 { max-width: 900px; font-size: clamp(2.2rem, 5vw, 4.6rem); line-height: .98; margin: .4rem 0 1rem; }
.hero p:not(.eyebrow) { max-width: 760px; color: var(--muted); font-size: 1.1rem; line-height: 1.6; }
.tour, .create-card, .project-card, .empty-state, .next-panel, .instruction-grid > *, .data-list > *,
.upload-card, .progress-panel, .billing-grid > *, .metric-grid > *, .config-grid {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(17 26 46 / 88%);
}
.tour { padding: 1.5rem; margin-bottom: 2rem; }
.tour h2 { margin-top: .2rem; }
.tour-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; list-style: none; padding: 0; }
.tour-grid li { display: grid; gap: .25rem; padding: .8rem; background: var(--surface-2); border-radius: 9px; }
.tour-grid span { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.split-section { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; }
.section-heading h2 { margin-top: 0; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.project-card { padding: 1.2rem; text-decoration: none; color: var(--text); transition: border-color .15s ease, transform .15s ease; }
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.project-card p { color: var(--muted); }
.create-card { padding: 1.25rem; align-self: start; position: sticky; top: 88px; }
.choice { display: flex; gap: .7rem; align-items: start; font-weight: 400; margin: .65rem 0; }
.choice input { width: auto; margin-top: .2rem; }
.choice span { display: grid; color: var(--muted); }
.choice strong { color: var(--text); }
.form-status { min-height: 1.4rem; margin: 0; color: var(--muted); }

.app-shell { display: grid; grid-template-columns: 235px minmax(0, 1fr) 260px; min-height: calc(100vh - 70px); }
.journey-rail, .context-rail { position: sticky; top: 70px; height: calc(100vh - 70px); overflow: auto; background: rgb(13 23 41 / 94%); }
.journey-rail { border-right: 1px solid var(--border); padding: 1rem; }
.context-rail { border-left: 1px solid var(--border); padding: 1.2rem; }
.rail-project h1 { font-size: 1rem; margin: .7rem 0 .2rem; }
.rail-project p { color: var(--muted); font-size: .8rem; }
.journey-rail ol { list-style: none; padding: 0; display: grid; gap: .2rem; }
.journey-rail li a, .rail-secondary a {
  display: flex;
  align-items: center;
  gap: .65rem;
  border-radius: 8px;
  color: var(--muted);
  padding: .56rem;
  text-decoration: none;
  font-size: .86rem;
}
.journey-rail li a span { display: grid; place-items: center; width: 1.45rem; height: 1.45rem; border: 1px solid var(--border); border-radius: 50%; font-size: .7rem; }
.journey-rail a:hover, .journey-rail a[aria-current] { color: var(--text); background: var(--surface-2); }
.journey-rail a[aria-current] { box-shadow: inset 3px 0 var(--amber); }
.rail-secondary { border-top: 1px solid var(--border); padding-top: .7rem; }
.work-canvas { min-width: 0; padding: 0 clamp(1rem, 3vw, 3rem) 5rem; }
.mode-bar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border); color: var(--muted); }
.mode-bar > div { display: flex; align-items: center; gap: .65rem; }
.mode-switch { padding: .18rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.mode-switch button { padding: .42rem .7rem; background: transparent; color: var(--muted); }
.mode-switch button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.mode-switch .help-dot { border-radius: 50%; width: 2rem; padding-inline: 0; }
.surface { max-width: 1120px; margin: 0 auto; }
.surface-header { padding: 2.8rem 0 1.4rem; }
.surface-header h2 { font-size: clamp(1.8rem, 4vw, 3.2rem); margin: .35rem 0 .8rem; line-height: 1.06; }
.surface-header > p:last-child { color: var(--muted); max-width: 800px; line-height: 1.6; }
.instruction-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.2rem; }
.instruction-grid > * { padding: 1rem; }
.instruction-grid h3 { margin-top: 0; }
.instruction-grid li, .instruction-grid p { color: var(--muted); line-height: 1.55; }
.next-panel { padding: 1.2rem; }
.next-panel h3 { margin: .2rem 0; }
.next-panel p:not(.eyebrow) { color: var(--muted); margin-bottom: 1.5rem; }
.upload-card { padding: 1rem; margin: 1rem 0; }
.data-list { display: grid; gap: .7rem; margin-top: 1rem; }
.data-list > * { padding: 1rem; }
.empty-state { padding: 1.4rem; color: var(--muted); }
.empty-state h3 { color: var(--text); margin-top: 0; }
.loading-state { color: var(--muted); }
.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1rem; }
.config-grid label { display: grid; gap: .4rem; }
.config-grid button, .config-grid .form-status, .config-grid .instrumentation,
.config-grid .full-span { grid-column: 1 / -1; }
.friendly-note {
  display: grid;
  gap: .25rem;
  padding: .9rem;
  color: var(--muted);
  background: rgb(56 189 248 / 8%);
  border: 1px solid rgb(56 189 248 / 35%);
  border-radius: 9px;
}
.friendly-note strong { color: var(--text); }
.inline-choice { display: grid; gap: .4rem; max-width: 420px; margin: 1rem 0; color: var(--text); }
.editor-shell { display: grid; gap: 1rem; }
.bpo-guided-editor { display: grid; gap: .8rem; }
.bpo-chapter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.bpo-chapter-card {
  display: grid;
  gap: .6rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(17 26 46 / 88%);
}
.bpo-chapter-card h3 { margin: 0; }
.bpo-chapter-card label { display: grid; gap: .35rem; color: var(--muted); }
.bpo-actions { display: flex; flex-wrap: wrap; gap: .7rem; }
.bpo-studio-editor { display: grid; gap: .7rem; }
.instrumentation { display: flex; gap: 1.5rem; flex-wrap: wrap; padding: .8rem; border: 1px dashed var(--border); border-radius: 8px; }
.progress-panel { margin-top: 1rem; padding: 1rem; }
.ocr-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.ocr-comparison pre {
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  padding: .8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0d1729;
}
.review-layout { display: grid; grid-template-columns: 170px minmax(0, 1fr) 190px; gap: 1rem; }
.reader { max-width: 70ch; min-height: 520px; background: #f8fafc; color: #172033; padding: clamp(1.4rem, 5vw, 3.4rem); border-radius: var(--radius); box-shadow: var(--shadow); }
#chapter-editor {
  min-height: 620px;
  resize: vertical;
  border: 0;
  background: transparent;
  color: #172033;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  line-height: 1.7;
}
#chapter-diff {
  white-space: pre-wrap;
  color: #172033;
  font-size: .8rem;
  line-height: 1.45;
}
.review-tools { display: grid; align-content: start; gap: .6rem; }
.review-tools button { text-align: left; }
.comment-list { display: grid; gap: .45rem; }
.comment-list article { padding: .55rem; border: 1px solid var(--border); border-radius: 8px; }
.comment-list p { margin: 0 0 .45rem; color: var(--muted); }
.metric-grid, .billing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.metric-grid article, .billing-grid article { padding: 1.2rem; }
.metric-grid strong { display: block; font-size: 2rem; color: var(--accent); }
.metric-grid span, .billing-grid p { color: var(--muted); }

body[data-mode="guided"] .studio-only { display: none !important; }
body[data-mode="studio"] .guided-only { display: none !important; }
.help-drawer {
  position: fixed;
  z-index: 60;
  right: 0;
  top: 0;
  width: min(430px, 100%);
  height: 100vh;
  padding: 2rem;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform .2s ease;
  overflow: auto;
}
.help-drawer[aria-hidden="false"] { transform: translateX(0); }
.drawer-close { float: right; background: transparent; color: var(--text); font-size: 1.5rem; }
.toast-region { position: fixed; z-index: 80; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; }
.toast { max-width: 360px; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); box-shadow: var(--shadow); }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .context-rail { display: none; }
  .tour-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .topbar { position: static; align-items: start; }
  .top-status { justify-content: end; }
  .app-shell { display: block; }
  .journey-rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .journey-rail ol { display: flex; overflow-x: auto; }
  .journey-rail li { min-width: 150px; }
  .rail-secondary { display: flex; overflow-x: auto; }
  .work-canvas { padding-inline: 1rem; }
  .mode-bar { flex-wrap: wrap; padding: .7rem 0; }
  .instruction-grid, .config-grid, .split-section, .review-layout, .metric-grid,
  .billing-grid, .bpo-chapter-grid { grid-template-columns: 1fr; }
  .hero { display: block; }
  .hero button { margin-top: 1rem; }
  .tour-grid { grid-template-columns: 1fr; }
  .create-card { position: static; }
  .review-tools { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}


/* ---- User guide (2026-09-04, Ryan msg #77318) ---- */
.guide-link { color: var(--amber); font-weight: 700; text-decoration: none; padding: .35rem .7rem; border: 1px solid var(--border); border-radius: 8px; }
.guide-link:hover { background: var(--surface-3); color: var(--text); }
.learn-more { color: var(--accent); font-size: .88rem; font-weight: 600; text-decoration: none; }
.learn-more:hover { text-decoration: underline; }
.learn-more-line { margin: .6rem 0 0; color: var(--muted); }
.mode-guide-link { margin-left: .6rem; white-space: nowrap; }
.hero-links { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1rem; }
.section-actions { display: flex; gap: .8rem; align-items: center; }
.rail-guide a { color: var(--amber); }
.guide-shell { width: min(1320px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 5rem; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 2rem; align-items: start; }
.guide-toc { position: sticky; top: 88px; max-height: calc(100vh - 100px); overflow: auto; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: .9rem; }
.guide-toc ol { padding-left: 1.2rem; margin: .4rem 0; display: grid; gap: .3rem; }
.guide-toc ol ol { margin: .3rem 0 .2rem; gap: .15rem; font-size: .84rem; }
.guide-toc a { color: var(--text); text-decoration: none; }
.guide-toc a:hover { color: var(--accent); }
.guide-body { background: rgb(17 26 46 / 95%); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.4rem, 4vw, 3rem); line-height: 1.65; }
.guide-body h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; margin: 0 0 .6rem; }
.guide-body h2 { font-size: 1.7rem; margin: 2.6rem 0 .8rem; padding-top: 1.2rem; border-top: 1px solid var(--border); scroll-margin-top: 90px; }
.guide-body h3 { font-size: 1.2rem; margin: 1.8rem 0 .5rem; color: var(--accent); scroll-margin-top: 90px; }
.guide-body h4 { font-size: 1rem; margin: 1.4rem 0 .3rem; color: var(--amber); scroll-margin-top: 90px; }
.guide-body p, .guide-body li { color: var(--text); }
.guide-body em { color: var(--muted); }
.guide-body table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.4rem; font-size: .9rem; display: block; overflow-x: auto; }
.guide-body th, .guide-body td { text-align: left; vertical-align: top; padding: .55rem .7rem; border: 1px solid var(--border); }
.guide-body th { background: var(--surface-2); color: var(--amber); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; }
.guide-body tbody tr:nth-child(even) { background: rgb(22 34 60 / 55%); }
.guide-body code { background: var(--surface-2); padding: .1rem .35rem; border-radius: 5px; font-size: .88em; }
.guide-body hr { margin: 2rem 0; }
.guide-body blockquote { margin: 1rem 0; padding: .6rem 1rem; border-left: 4px solid var(--amber); background: rgb(245 158 11 / 8%); }
@media (max-width: 960px) {
  .guide-shell { grid-template-columns: 1fr; }
  .guide-toc { position: static; max-height: none; }
  .mode-guide-link { white-space: normal; }
}

/* ---------------------------------------------------------------- Guided one-box (2026-09-06) */
.guided-main { max-width: 720px; margin: 0 auto; padding: 1rem 1rem 3rem; display: grid; gap: 1.5rem; }
.guided-hero h1 { font-size: clamp(1.5rem, 5vw, 2.25rem); margin: .25rem 0 .35rem; }
.guided-sub { color: var(--muted, #9fb0c8); margin: 0 0 .75rem; }
.guided-form { display: grid; gap: .75rem; }
.guided-form textarea[data-prompt] { width: 100%; min-height: 8.5rem; resize: vertical; padding: .85rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2, rgb(13 23 41 / 94%)); color: var(--text); font-size: 1.05rem; line-height: 1.45; }
.guided-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.guided-build { font-size: 1.15rem; padding: .8rem 2.2rem; border-radius: 999px; }
.guided-how { color: var(--muted, #9fb0c8); text-decoration: underline; }
.guided-error { color: #ffb4b4; margin: 0; }
.guided-optional summary { cursor: pointer; color: var(--muted, #9fb0c8); }
.guided-files { display: grid; gap: .5rem; padding: .75rem 0 0; }
.guided-file-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .2rem; font-size: .95rem; }
.guided-check { display: flex; gap: .5rem; align-items: center; }
.guided-review { color: var(--muted, #9fb0c8); }
.muted { color: var(--muted, #9fb0c8); }
.small { font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.confirm-sheet { position: fixed; inset: 0; background: rgb(0 0 0 / 55%); display: grid; place-items: end center; z-index: 50; }
.confirm-sheet[hidden] { display: none; }
/* 2026-09-09 laneB7: class rules below set display:grid/flex, which out-specifies the UA `[hidden]{display:none}`
   and defeated guided.js `el.hidden = true` (the chapter-plan card + "Download cover" showed on a Finished project).
   `hidden` must always win. */
[hidden] { display: none !important; }
.confirm-card { width: 100%; max-width: 560px; background: var(--surface-2, #0d1729); border: 1px solid var(--border); border-radius: 18px 18px 0 0; padding: 1.25rem 1.25rem 1.75rem; display: grid; gap: .5rem; }
.confirm-actions, .plan-actions, .download-row, .build-controls { display: flex; gap: .75rem; flex-wrap: wrap; }
.guided-recent-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.guided-brief { border-left: 3px solid var(--amber, #f5b942); margin: 0 0 1rem; padding: .25rem .75rem; color: var(--muted, #9fb0c8); white-space: pre-wrap; }
.build-status-card, .plan-card, .finished-card { border: 1px solid var(--border); border-radius: 14px; padding: 1rem; background: var(--surface-2, rgb(13 23 41 / 94%)); display: grid; gap: .75rem; }
.build-status { font-size: 1.25rem; font-weight: 600; margin: 0; }
.build-checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.build-checklist li::before { content: "○ "; color: var(--muted, #9fb0c8); }
.build-checklist li[data-state="doing"]::before { content: "◔ "; color: var(--amber, #f5b942); }
.build-checklist li[data-state="done"]::before { content: "● "; color: #6fd394; }
.plan-chapters { display: grid; gap: .4rem; padding-left: 1.25rem; }
.plan-change-form { display: grid; gap: .5rem; }
.plan-change-form textarea { width: 100%; padding: .6rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-3, #0b1220); color: var(--text); }
.download-primary { font-size: 1.1rem; padding: .75rem 1.75rem; }
.offer-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.offer-card { display: grid; gap: .2rem; padding: .8rem; border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; background: var(--surface-3, #0b1220); }
.offer-card:hover { border-color: var(--amber, #f5b942); }
.offer-card span { color: var(--muted, #9fb0c8); font-size: .9rem; }
.more-menu { position: relative; }
.more-menu summary { list-style: none; cursor: pointer; padding: .2rem .6rem; border: 1px solid var(--border); border-radius: 8px; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu-panel { position: absolute; right: 0; top: 2.2rem; min-width: 200px; display: grid; gap: .25rem; padding: .5rem; background: var(--surface-2, #0d1729); border: 1px solid var(--border); border-radius: 10px; z-index: 40; }
.more-menu-panel a { color: var(--text); text-decoration: none; padding: .35rem .5rem; border-radius: 6px; }
.more-menu-panel a:hover { background: var(--surface-3, #0b1220); }

/* ---- Interview cards (Lane C partials). Served from app.css because CSP is style-src self and the
   partial-inline <style> is blocked in the browser (chunk-6 finding).
   THIS BLOCK IS THE EFFECTIVE COPY of web/templates/partials/interview_style.html — keep the two byte-identical
   rule-for-rule (tests/test_lane_c_interview_chunk12.py guards it). Lane C chunk 12: chunk 9's auto-grow rules
   only landed in the partial and were CSP-dead on the live site (recap textareas clipped at 390px). ---- */

.interview-card{max-width:40rem;margin:1rem auto 0;padding:1rem 1.1rem;border:1px solid rgba(0,0,0,.12);border-radius:12px;background:rgba(255,255,255,.7);font-size:1rem;line-height:1.45}
.interview-progress{margin:0 0 .4rem;font-size:.85rem;letter-spacing:.02em;text-transform:uppercase;opacity:.65}
.interview-q{margin:0 0 .5rem;font-size:1.2rem;line-height:1.3}
.interview-hint{margin:0 0 .8rem;opacity:.8}
.interview-hint strong{font-weight:600}
.interview-card textarea{width:100%;box-sizing:border-box;font:inherit;padding:.6rem;border:1px solid rgba(0,0,0,.2);border-radius:8px;min-height:5.5rem}
.interview-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.7rem;align-items:center}
.interview-actions button{font:inherit;padding:.6rem 1rem;border-radius:8px;border:1px solid rgba(0,0,0,.2);background:#fff;color:#1a1a1a;cursor:pointer;min-height:44px}
.interview-actions button.primary{background:#1a1a1a;color:#fff;border-color:#1a1a1a}
.interview-actions button.link{border:none;background:none;text-decoration:underline;opacity:.75;padding:.6rem .3rem}
.interview-field{display:block;margin:0 0 .7rem}
.interview-field span{display:block;font-size:.85rem;font-weight:600;margin-bottom:.2rem}
.interview-field textarea{min-height:3.5rem;field-sizing:content;resize:vertical}
.interview-unresolved{margin:.6rem 0 .2rem}
.interview-card ul{margin:0 0 .5rem 1.1rem;padding:0}
.interview-ready{font-size:1.1rem;font-weight:600}
@media (max-width:480px){.interview-card{margin:.75rem 0 0;padding:.85rem;border-radius:10px}.interview-q{font-size:1.1rem}.interview-actions button{flex:1 1 100%}.interview-actions button.link{flex-basis:auto}.interview-field textarea{min-height:5rem}}

/* Lane C chunk 23 (2026-09-09): EFFECTIVE COPY of the <style> block in
   web/templates/partials/interview_contribution.html (Studio 'Who decided what' card, fetched into project.html by
   app.js via innerHTML → its inline <style> is CSP-dead like interview_style.html). Keep byte-identical rule-for-rule;
   tests/test_lane_c_interview_chunk23.py guards EVERY interview_*.html <style> block against this drift. */
.interview-contribution-table{width:100%;border-collapse:collapse;font-size:.9rem}
.interview-contribution-table th,.interview-contribution-table td{text-align:left;vertical-align:top;padding:.4rem .3rem;border-top:1px solid rgba(0,0,0,.08);overflow-wrap:anywhere}
.interview-voice{display:inline-block;padding:.1rem .45rem;border-radius:999px;font-size:.75rem;background:rgba(0,0,0,.08)}
.interview-voice-customer{background:#1a1a1a;color:#fff}
.interview-fallback-notice{margin:.25rem 0 .75rem;padding:.5rem .7rem;border-radius:.5rem;background:rgba(255,190,0,.16);font-size:.9rem}
.interview-contribution .interview-hint{overflow-wrap:anywhere}
@media (max-width:480px){.interview-contribution-table thead{display:none}.interview-contribution-table td{display:block;border-top:none;padding:.15rem .3rem}.interview-contribution-table tr{display:block;border-top:1px solid rgba(0,0,0,.12);padding:.4rem 0}.interview-contribution .interview-q{font-size:1rem;line-height:1.35}}

.guided-interview-pending{opacity:.85}

/* 2026-09-09 Lane B (Ryan P1 21:12 MST): primary "right now" card + status labels + Hide on the Your-books list.
   Appended at the end on purpose — the `[hidden]` rule must stay at L374 (regression guard). */
.guided-primary { margin-top: 1.5rem; display: grid; gap: .4rem; }
.guided-primary h2 { margin: 0; text-transform: uppercase; letter-spacing: .06em; }
.guided-primary-card { display: grid; gap: .3rem; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2, rgb(13 23 41 / 94%)); color: inherit; text-decoration: none; }
.guided-primary-card:hover { border-color: var(--amber, #f5b942); }
.guided-primary-title { font-size: 1.15rem; }
.guided-primary-status { font-weight: 600; }
.guided-primary[data-primary-status="building"] .guided-primary-status { color: var(--amber, #f5b942); }
.guided-primary[data-primary-status="finished"] .guided-primary-status { color: #6fd394; }
.guided-primary[data-primary-status="failed"] .guided-primary-status,
.guided-primary[data-primary-status="stopped"] .guided-primary-status { color: var(--muted, #9fb0c8); }
.guided-recent-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem .75rem; }
.guided-recent-list li a { flex: 1 1 14rem; min-width: 0; }
.book-status { font-size: .8rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted, #9fb0c8); white-space: nowrap; }
.book-status[data-status="building"] { color: var(--amber, #f5b942); border-color: var(--amber, #f5b942); }
.book-status[data-status="finished"] { color: #6fd394; border-color: #6fd394; }
.book-archive { font-size: .8rem; padding: .1rem .6rem; }

/* ---- Lane B 2026-09-09 21:32 MST (Ryan: "more graphics, like a progress bar; more visuals please") ----
   Book progress bar (one segment per chapter), progress ring (SVG attributes — CSP style-src 'self' forbids inline
   styles), cover thumbnails with a placeholder gradient + initials, consistent status chips
   (Building = blue, Finished = green, Didn't finish = amber, Stopped = grey), chapter strip on /p/{id}, and the
   interview stepper class Lane C's partial can adopt. Appended on purpose — `[hidden]` stays at L374. ---- */
:root { --blue: #60a5fa; --chip-building: #60a5fa; --chip-finished: #34d399; --chip-failed: #f59e0b; --chip-stopped: #94a3b8; }

/* status chips — one palette everywhere (primary card, Your-books rows, project page) */
.status-chip, .book-status { font-size: .8rem; padding: .1rem .55rem; border-radius: 999px; border: 1px solid var(--border); color: var(--muted, #9fb0c8); white-space: nowrap; font-weight: 600; letter-spacing: .01em; }
.status-chip[data-status="building"], .book-status[data-status="building"] { color: var(--chip-building); border-color: var(--chip-building); background: rgb(96 165 250 / 12%); }
.status-chip[data-status="finished"], .book-status[data-status="finished"] { color: var(--chip-finished); border-color: var(--chip-finished); background: rgb(52 211 153 / 12%); }
.status-chip[data-status="failed"], .book-status[data-status="failed"] { color: var(--chip-failed); border-color: var(--chip-failed); background: rgb(245 158 11 / 12%); }
.status-chip[data-status="stopped"], .book-status[data-status="stopped"],
.status-chip[data-status="not_started"], .book-status[data-status="not_started"] { color: var(--chip-stopped); border-color: var(--border); background: rgb(148 163 184 / 10%); }
.guided-primary[data-primary-status="building"] .guided-primary-status { color: var(--chip-building); }
.guided-primary[data-primary-status="finished"] .guided-primary-status { color: var(--chip-finished); }
.guided-primary[data-primary-status="failed"] .guided-primary-status { color: var(--chip-failed); }
.guided-primary[data-primary-status="stopped"] .guided-primary-status { color: var(--chip-stopped); }

/* segmented progress bar */
.book-progress { display: grid; gap: .3rem; width: 100%; min-width: 0; }
.book-progress-bar { display: flex; gap: 2px; height: 10px; width: 100%; }
.book-progress.compact .book-progress-bar { height: 6px; gap: 1px; }
.book-progress-seg { flex: 1 1 0; min-width: 2px; border-radius: 3px; background: rgb(148 163 184 / 22%); transition: background .3s ease; }
.book-progress-seg[data-state="done"] { background: var(--chip-finished); }
.book-progress-seg[data-state="writing"] { background: var(--chip-building); animation: seg-pulse 1.6s ease-in-out infinite; }
.book-progress-seg[data-state="queued"] { background: rgb(148 163 184 / 22%); }
@keyframes seg-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .book-progress-seg[data-state="writing"] { animation: none; } }
.book-progress-meta { margin: 0; display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.book-progress-meta strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.book-progress.compact .book-progress-meta { font-size: .8rem; }
.book-progress.compact .book-progress-meta strong { font-size: .85rem; }

/* progress ring (36×36 SVG; circumference normalised to 100 via r=15.915) */
.progress-ring { flex: 0 0 auto; width: 36px; height: 36px; }
.progress-ring-track { stroke: rgb(148 163 184 / 25%); }
.progress-ring-fill { stroke: var(--chip-building); transition: stroke-dasharray .5s ease; }
.progress-ring[data-status="finished"] .progress-ring-fill, .progress-ring[data-status="completed"] .progress-ring-fill { stroke: var(--chip-finished); }
.progress-ring[data-status="failed"] .progress-ring-fill { stroke: var(--chip-failed); }
.progress-ring[data-status="stopped"] .progress-ring-fill { stroke: var(--chip-stopped); }
.progress-ring-text { fill: var(--text); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.guided-primary-card .progress-ring { width: 48px; height: 48px; }

/* cover thumbnail / placeholder */
.book-cover { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 58px; border-radius: 4px 6px 6px 4px; overflow: hidden; box-shadow: inset 3px 0 0 rgb(255 255 255 / 12%), 0 4px 10px rgb(0 0 0 / 35%); background: linear-gradient(160deg, #334155, #0f172a); }
.book-cover.large { width: 64px; height: 92px; }
.book-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-cover-initials { font-weight: 800; font-size: 1rem; letter-spacing: .04em; color: rgb(255 255 255 / 88%); text-shadow: 0 1px 2px rgb(0 0 0 / 45%); }
.book-cover.large .book-cover-initials { font-size: 1.5rem; }
.book-cover[data-hue="0"] { background: linear-gradient(160deg, #1d4ed8, #0f172a); }
.book-cover[data-hue="1"] { background: linear-gradient(160deg, #7c3aed, #1e1b4b); }
.book-cover[data-hue="2"] { background: linear-gradient(160deg, #0f766e, #042f2e); }
.book-cover[data-hue="3"] { background: linear-gradient(160deg, #b45309, #431407); }
.book-cover[data-hue="4"] { background: linear-gradient(160deg, #be123c, #4c0519); }
.book-cover[data-hue="5"] { background: linear-gradient(160deg, #0369a1, #082f49); }
.book-cover[data-hue="6"] { background: linear-gradient(160deg, #4d7c0f, #1a2e05); }
.book-cover[data-hue="7"] { background: linear-gradient(160deg, #6d28d9, #2e1065); }

/* primary card + Your-books rows with visuals */
.guided-primary-card.has-visuals { display: flex; gap: .9rem; align-items: flex-start; }
.guided-primary-body { display: grid; gap: .35rem; flex: 1 1 auto; min-width: 0; }
.guided-primary-body .status-chip { justify-self: start; }
.guided-primary-card.has-visuals .progress-ring { margin-left: auto; }
.guided-recent-list li[data-book] { display: flex; flex-wrap: nowrap; align-items: center; gap: .75rem; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2, rgb(13 23 41 / 94%)); }
.book-row-body { display: grid; gap: .25rem; flex: 1 1 auto; min-width: 0; }
.book-row-body > a { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-row-meta { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: center; }
.guided-recent-list li[data-book] a { flex: initial; }

/* project page: status head + chapter strip (build timeline) */
.build-status-head { display: flex; align-items: flex-start; gap: .75rem; }
.build-status-head .build-status { flex: 1 1 auto; min-width: 0; }
.build-status-head .progress-ring { width: 44px; height: 44px; }
.chapter-strip { display: grid; gap: .5rem; margin-top: 1rem; }
.chapter-strip-title { margin: 0; text-transform: uppercase; letter-spacing: .06em; }
.chapter-strip-list { list-style: none; margin: 0; padding: .25rem 0 .5rem; display: flex; gap: .45rem; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.chapter-tile { flex: 0 0 auto; scroll-snap-align: start; }
.chapter-tile-button { display: grid; gap: .15rem; width: 8.5rem; min-height: 4.4rem; padding: .5rem .6rem; text-align: left; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-3, #0b1220); color: var(--text); font-weight: 500; cursor: pointer; }
.chapter-tile-button:hover { border-color: var(--accent); background: var(--surface-3, #0b1220); }
.chapter-tile-number { font-size: .75rem; font-weight: 800; letter-spacing: .05em; color: var(--muted); }
.chapter-tile-title { font-size: .85rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chapter-tile[data-state="done"] .chapter-tile-button { border-color: var(--chip-finished); box-shadow: inset 0 3px 0 var(--chip-finished); }
.chapter-tile[data-state="done"] .chapter-tile-number { color: var(--chip-finished); }
.chapter-tile[data-state="writing"] .chapter-tile-button { border-color: var(--chip-building); box-shadow: inset 0 3px 0 var(--chip-building), 0 0 0 3px rgb(96 165 250 / 18%); }
.chapter-tile[data-state="writing"] .chapter-tile-number { color: var(--chip-building); }
.chapter-tile[data-state="queued"] .chapter-tile-button { opacity: .7; }
.chapter-tile.is-selected .chapter-tile-button { outline: 2px solid var(--amber); outline-offset: 2px; }
.chapter-strip-legend { margin: 0; display: flex; gap: .9rem; flex-wrap: wrap; }
.chapter-strip-legend span::before { content: ""; display: inline-block; width: .6rem; height: .6rem; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; background: rgb(148 163 184 / 30%); }
.chapter-strip-legend span[data-state="done"]::before { background: var(--chip-finished); }
.chapter-strip-legend span[data-state="writing"]::before { background: var(--chip-building); }
.chapter-strip-caption { margin: 0; padding: .5rem .7rem; border-radius: 8px; background: var(--surface-3, #0b1220); border: 1px solid var(--border); }
@media (max-width: 480px) {
  .chapter-tile-button { width: 7rem; min-height: 4rem; padding: .45rem .5rem; }
  .book-cover.large { width: 52px; height: 76px; }
  .guided-primary-card .progress-ring { width: 40px; height: 40px; }
}

/* interview stepper — segmented "3 of 6". Built by guided.js from the partial's "N of M" text (or data-step /
   data-steps when Lane C adds them); the class is here so the partial needs no CSS of its own. */
.interview-stepper { display: flex; gap: 3px; height: 6px; margin: 0 0 .5rem; width: 100%; list-style: none; padding: 0; }
.interview-stepper span, .interview-stepper li { flex: 1 1 0; border-radius: 3px; background: rgb(0 0 0 / 12%); }
.interview-stepper span[data-state="done"], .interview-stepper li[data-state="done"] { background: #1a1a1a; }
.interview-stepper span[data-state="current"], .interview-stepper li[data-state="current"] { background: var(--chip-building); }
.interview-card .interview-progress { display: grid; gap: .35rem; }

/* 2026-09-09 Lane B-guide: optional "Pause after chapter 1" row + its rollover/tap tooltip. Hover = title attr;
   phones have no hover, so the same sentence lives in a native <details> ⓘ popover (no JS, CSP-clean). */
.guided-check-row { display: flex; gap: .5rem; align-items: flex-start; }
.guided-check-row > .guided-check { flex: 1 1 auto; align-items: flex-start; }
.tip { position: relative; flex: 0 0 auto; }
.tip > summary { list-style: none; cursor: pointer; display: inline-grid; place-items: center; width: 1.75rem; height: 1.75rem;
  border-radius: 50%; border: 1px solid var(--muted, #9fb0c8); color: var(--muted, #9fb0c8); font-size: 1rem; line-height: 1;
  min-width: 44px; min-height: 44px; }
.tip > summary::-webkit-details-marker { display: none; }
.tip[open] > summary { color: var(--accent, #38bdf8); border-color: var(--accent, #38bdf8); }
.tip-pop { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20; width: min(20rem, 85vw); margin: 0; padding: .75rem .9rem;
  border-radius: .6rem; background: var(--surface-2, #16223c); color: var(--text, #e2e8f0); border: 1px solid var(--muted, #9fb0c8);
  box-shadow: 0 8px 24px rgb(0 0 0 / 35%); font-size: .95rem; line-height: 1.4; }
.tip-pop a { color: var(--accent, #38bdf8); }
@media (max-width: 480px) { .tip-pop { position: static; width: auto; margin-top: .5rem; } }

/* ---------------------------------------------------------------- BIB-0015 (2026-09-14) real-time strip + saver card
   Mirrors the Decision Board WORKING / STALLED strip: a pulsing dot + plain sentence + "last activity N s ago". */
.build-activity { display: flex; align-items: center; gap: .55rem; margin: .35rem 0 .6rem; font-size: .9rem; color: var(--muted); }
.build-activity .activity-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.build-activity[data-activity-state="working"] { color: #34d399; }
.build-activity[data-activity-state="working"] .activity-dot { background: #34d399; animation: bib15-pulse 1.4s ease-in-out infinite; }
.build-activity[data-activity-state="waiting"] { color: #38bdf8; }
.build-activity[data-activity-state="waiting"] .activity-dot { background: #38bdf8; animation: bib15-pulse 2.4s ease-in-out infinite; }
.build-activity[data-activity-state="stalled"] { color: #f59e0b; }
.build-activity[data-activity-state="stalled"] .activity-dot { background: #f59e0b; }
.build-activity[data-activity-state="finished"] { color: var(--muted); }
@keyframes bib15-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .build-activity .activity-dot { animation: none !important; } }

.saver-card { margin: 1rem 0; padding: 1rem 1.1rem; border: 1px solid rgb(52 211 153 / 35%); border-radius: 14px; background: rgb(52 211 153 / 7%); }
.saver-card[data-saver-enabled="0"] { border-color: var(--border, #2a3b5c); background: transparent; }
.saver-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .45rem; font-size: 1.05rem; }
.saver-badge { display: inline-block; padding: .12rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: #34d399; color: #062b1d; }
.saver-card[data-saver-enabled="0"] .saver-badge { background: var(--muted); color: #0b1220; }
.saver-text { margin: 0 0 .55rem; line-height: 1.55; }
.saver-points { margin: 0 0 .7rem; padding-left: 1.1rem; line-height: 1.5; }
.saver-points li { margin: .2rem 0; }
.saver-toggle { display: flex; justify-content: flex-start; align-items: center; gap: .55rem; font-size: .9rem; color: var(--muted); cursor: not-allowed; }
.saver-toggle > span { flex: 0 1 auto; margin-left: 0; text-align: left; }
.saver-toggle input[type="checkbox"] { flex: 0 0 auto; width: 24px; height: 24px; min-width: 24px; margin: 0; }
.saver-toggle input[disabled] { opacity: .55; cursor: not-allowed; }
.confirm-saver { margin-top: .35rem; color: #34d399; }
/* BIB-0015: every Guided checkbox stays 24 px beside its label (a global input width rule leaked on phone — seen on
   "I have the right to use these files" in the 2026-09-14 vision pre-flight). */
.guided-check input[type="checkbox"] { flex: 0 0 auto; width: 24px; height: 24px; min-width: 24px; margin: 0; }


/* 2026-09-19 mbo-photo-pile S2 — quiet, dismissible reading-order note */
.order-banner {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--accent, #6b5b4b);
  background: color-mix(in srgb, var(--accent, #6b5b4b) 8%, transparent);
  font-size: 0.95rem;
  line-height: 1.4;
}
.order-banner-dismiss {
  margin-left: 0.5rem;
  font-size: 0.85rem;
}
.page-move-row {
  display: flex;
  gap: 0.5rem;
  margin: 0.35rem 0 0.75rem;
}
.page-move-row button {
  font-size: 0.85rem;
}
