/* Part two of the look: sign-in, wizard, coach, parts, meter. Same tokens as app.css. */

/* A link that looks like a button (the top bar's Help, which opens the playbook in a new tab). */
a.btn { text-decoration: none; }

/* ---- sign-in ----------------------------------------------------------------------------- */
.auth { display: grid; place-items: center; padding: 28px; overflow: auto; }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 30px 30px 26px; display: grid; gap: 14px; }
.auth-card h1 { font: 600 28px var(--serif); }
.auth-card p { margin: 0; }
.form-error { color: var(--danger); min-height: 1.2em; font-size: 13px; }
.btn.wide { width: 100%; justify-content: center; height: 38px; }
.field input[type=password], .field input[type=text] { width: 100%; }

/* ---- pills, notes, small things ---------------------------------------------------------- */
.pill.work { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-size: 11.5px; height: 20px; padding: 0 8px; margin-left: 8px; cursor: default; vertical-align: middle; }
button.pill.work { cursor: pointer; margin: 6px 0 0; }
.note.warn { color: var(--warn); }
.note.ok { color: var(--ok); }
.pad { padding: 10px 12px; }
.linkbtn { border: 0; background: transparent; color: var(--accent); padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.dotl { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--ok); }
.dotl.off { background: var(--faint); }
.working { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 10px 0; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.statebtn { border: 0; background: transparent; padding: 0; font: inherit; cursor: default; }
.statebtn:not(:disabled) { cursor: pointer; text-decoration: underline; }
.pill.hint { cursor: pointer; }

/* ---- the outline's parts ----------------------------------------------------------------- */
.rail-part { display: flex; align-items: center; margin: 12px 0 2px; border-radius: 8px; }
.part-main { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; padding: 6px 9px; font: 600 11.5px var(--sans); letter-spacing: .7px; text-transform: uppercase; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-part:hover { background: rgba(120, 110, 80, .10); }
.rail-part:hover .ch-tools, .rail-part:focus-within .ch-tools { display: flex; }
.rail-actions { flex-wrap: wrap; }
.rail-actions .btn { flex: 1 1 30%; padding: 0 8px; justify-content: center; }

/* ---- chips, choices, the wizard ---------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 14px; color: var(--muted); }
.chips button:hover { border-color: var(--faint); }
.chips button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.wiz { max-width: 720px; margin: 0 auto; display: grid; gap: 18px; }
.wiz h1 { font: 600 32px/1.15 var(--serif); letter-spacing: -.3px; }
.wiz .lead { margin: -8px 0 0; color: var(--muted); font-size: 15px; }
.dots { display: flex; gap: 8px; }
.dots .dot { width: 28px; height: 4px; border-radius: 2px; background: var(--line); }
.dots .dot.on { background: var(--accent); }
.dots .dot.done { background: var(--accent-soft); }
/* the new book's draft (wizard.js): its indicator and Start over; the shelf's Unfinished new books */
.wz-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 26px; }
.wz-top .spacer { flex: 1; }
.wz-saved { font-size: 12.5px; color: var(--faint); }
.wz-saved.st-saving { color: var(--muted); }
.wz-saved.st-saved { color: var(--ok); }
.wz-saved.st-error { color: var(--danger); font-weight: 600; }
.unfinished { margin: 0 0 26px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: inset 5px 0 0 var(--accent); }
.unfinished h2 { font: 600 20px/1.2 var(--serif); }
.unfinished > p { margin: 4px 0 12px; color: var(--muted); font-size: 13.5px; }
.unf-list { display: grid; gap: 10px; }
.unf { display: flex; align-items: center; gap: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.unf:first-child { padding-top: 0; border-top: 0; }
.unf-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.unf-label { font: 600 17px/1.3 var(--serif); overflow-wrap: anywhere; }
.unf-idea { color: var(--muted); overflow-wrap: anywhere; }
.unf-meta { color: var(--faint); font-size: 12.5px; }
.unf-acts { display: flex; gap: 8px; flex: none; }
.wiz textarea, .wiz input[type=text], .wiz input:not([type]) { width: 100%; }
.wiz .field textarea { font: 17px/1.6 var(--serif); min-height: 130px; }
.wiz-nav { display: flex; align-items: center; gap: 10px; padding-top: 6px; }
.choices { display: grid; gap: 14px; }
.choice { display: grid; grid-template-columns: 52px 1fr; gap: 2px 14px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 18px 20px; transition: border-color .12s, box-shadow .12s; }
.choice:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.choice .choice-ic { grid-row: 1 / 3; width: 52px; height: 52px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.choice b { font: 600 19px var(--serif); align-self: end; }
.choice span:last-child { color: var(--muted); }
.coach-card { background: var(--rail); }
.coach-card h3 { font: 600 16px var(--sans); margin-bottom: 4px; }
.readback { margin: 10px 0 6px; }
.qs { display: grid; gap: 8px; margin: 8px 0; }
.q { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; background: var(--surface); }
.coach-prose { white-space: pre-wrap; margin: 10px 0; font: 15px/1.6 var(--serif); }
.meta-line { color: var(--faint); font-size: 12px; margin-top: 8px; }
.ol { display: grid; gap: 8px; }
.ol-row { display: grid; grid-template-columns: 78px 1fr auto auto auto; gap: 6px; align-items: center; }
.ol-row.part .ol-title { font-weight: 600; }
.ol-row .pill { justify-content: center; }
.ol-row.part .pill { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.ol-title { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; min-width: 0; }
.ol-sum { grid-column: 2 / -1; color: var(--muted); font-size: 12.5px; margin-top: -2px; }
.ol-add { display: flex; gap: 8px; }

/* ---- the coach --------------------------------------------------------------------------- */
.coach { display: grid; gap: 12px; align-content: start; }
.strip { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--muted); }
.strip .grow { flex: 1; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.act { display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 9px 10px; font-size: 13px; line-height: 1.25; }
.act:hover:not(:disabled) { border-color: var(--accent); }
.act.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.act.primary { grid-column: 1 / -1; justify-content: center; padding: 12px; font-size: 14.5px; font-weight: 600; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.act.primary:hover:not(:disabled) { filter: brightness(1.08); border-color: var(--accent); }
.act.primary.on { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.move { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; flex-wrap: wrap; }
.move .why { font: 14.5px/1.5 var(--serif); flex: 1; min-width: 12em; }
.prose-lite.raw { font: 12.5px/1.5 var(--mono); opacity: .8; max-height: 260px; overflow: auto; }
.act:disabled { opacity: .45; cursor: default; }
.act-card textarea { width: 100%; margin: 8px 0; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; resize: vertical; }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin: 8px 0 6px; }
.tier { display: grid; gap: 2px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 8px 10px; }
.tier b { font-size: 13px; }
.tier span { font-size: 11.5px; color: var(--muted); }
.tier:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.tier:disabled { opacity: .5; cursor: not-allowed; }
.thread { display: grid; gap: 10px; }
.msg { border-radius: 12px; padding: 10px 12px; }
.msg.author { background: var(--accent-soft); justify-self: end; max-width: 92%; white-space: pre-wrap; }
.msg.coach { border: 1px solid var(--line); background: var(--bg); }
.verdict { margin: 0 0 8px; font: 600 15px/1.45 var(--serif); }
.sec { margin: 8px 0; }
.sec ul, .msg ul, .msg ol { margin: 4px 0 4px 18px; padding: 0; }
.sec.skeptic { border-left: 3px solid var(--warn); padding-left: 10px; }
.ccard { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin: 8px 0; background: var(--surface); display: grid; gap: 6px; justify-items: start; }
.ccard blockquote { margin: 0; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); font: italic 14px/1.5 var(--serif); }
.issue-t { font-weight: 600; font-size: 13.5px; }
.issue-t .pill { margin-left: 8px; height: 18px; font-size: 11px; }
.quest { color: var(--accent); font-size: 13.5px; }
.draft { white-space: pre-wrap; font: 15px/1.6 var(--serif); border-left: 3px solid var(--accent); padding-left: 12px; margin: 4px 0 8px; max-height: 340px; overflow: auto; }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.prose-lite { white-space: pre-wrap; font: 14.5px/1.6 var(--serif); }
.ol-mini { display: grid; gap: 4px; margin-bottom: 8px; }
.ol-m { display: grid; gap: 1px; }
.ol-m.part b { text-transform: uppercase; letter-spacing: .5px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.ol-m span { color: var(--muted); font-size: 12.5px; }
.clear { text-align: center; padding-top: 4px; }

/* ---- the local model, compare and judge (2026-12-01) -------------------------------------- */
.panel.coach-wide { width: 600px; }
.mp-head { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.model-pick { display: grid; gap: 2px; margin-top: 8px; }
.model-pick .tiers { margin: 4px 0 2px; }
#local-model-pick { display: grid; gap: 6px; margin-top: 4px; }
#local-model-pick ul { margin: 0; }
.cmp-box { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px; display: grid; gap: 6px; justify-items: start; }
.cmp-box > *, .judge-box > * { justify-self: stretch; }
.cmp-box > #cmp-open { justify-self: start; }
.cmp-sides { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 8px; align-items: center; }
.cmp-sides label { font-weight: 600; font-size: 13px; }
.cmp-sides select { min-width: 0; width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 5px 8px; }
.cmp-q { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.cmp-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 8px; }
.cmp-side { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); min-width: 0; }
.cmp-side.off { display: none; }
.cmp-h { font-size: 13px; margin-bottom: 6px; color: var(--muted); }
.cmp-h b { color: var(--accent); }
.cmp-tabs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: 100%; margin-bottom: 8px; }
.cmp-tabs button { height: auto; min-height: 34px; padding: 4px 8px; white-space: normal; overflow-wrap: anywhere; }
.msg.cmp > .row-btns, .judge-box { margin-top: 8px; }
.judge-box { display: grid; gap: 6px; }
.msg.judge { border-color: var(--accent); }
.jg ul { margin-top: 2px; }
.jwhy { margin: 0 0 6px; font: 14.5px/1.5 var(--serif); }
.msg.judge .verdict { margin-bottom: 4px; }
.reveal { font-size: 13px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 8px; }

/* ---- meter ------------------------------------------------------------------------------- */
.meter-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.meter-top > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; }
.meter-top b { font: 600 22px var(--serif); }
.meter-top span { color: var(--muted); font-size: 12.5px; }
.probes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.probe { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.tablewrap { overflow: auto; max-height: 280px; border: 1px solid var(--line); border-radius: 10px; }
.tbl { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.tbl th, .tbl td { padding: 6px 9px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.tbl td.muted { white-space: normal; min-width: 180px; }
.tbl th { position: sticky; top: 0; background: var(--surface); }

/* ---- divide ------------------------------------------------------------------------------ */
.split { display: grid; gap: 10px; max-height: 56vh; overflow: auto; }
.piece { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; display: grid; gap: 6px; }
.piece-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.piece .ex { font-size: 12.5px; }
/* ---- the panel's tabs, and the Published chip in the top bar ------------------------------- */
.panel .tabs { flex-wrap: wrap; min-width: 0; gap: 2px; } /* never wider than the panel */
.panel .tab { padding: 6px 7px; }
.pub-chip { cursor: default; align-self: center; margin-right: 4px; }
.pub-chip.del { cursor: help; }

.history-prev { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow: auto; max-height: 340px; white-space: pre-wrap; font: 13.5px/1.6 var(--serif); background: var(--bg); }

/* ---- phones: 360 to 430 px wide, and any window up to 760 ---------------------------------
   One column. Every control is at least 44 px; inputs are 16 px, so the phone does not zoom into
   them. The phone's own navigation (the top bar, the tab bar, the coach sheet, the keyboard) is in
   phone.css and phone.js; the plan walk's own rules are at the end of plan.css. Keep 760 in step
   with PHONE_MQ in app.js. */
.phone-only { display: none !important; }
@media (max-width: 760px) {
  .phone-only { display: inline-flex !important; }
  #app { height: 100vh; height: 100dvh; }

  /* touch targets and input sizes */
  .btn, .btn.small { height: auto; min-height: 44px; white-space: normal; text-align: center; }
  .btn.small { padding: 0 12px; font-size: 13.5px; }
  .btn.icon, .btn.icon.small { width: 44px; height: 44px; min-height: 44px; padding: 0; }
  .seg button, .tab, .chips button, button.pill, .brand, .tier, .act, .ch-main, .part-main, .cmp-row, .history-list button, .df-fold, .statebtn:not(:disabled), .toast button { min-height: 44px; }
  .seg button, .toast button { min-width: 44px; }
  .linkbtn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; text-align: left; }
  .tog { min-height: 44px; align-items: center; }
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea:not(#editor) { font-size: 16px !important; }
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select { min-height: 44px; }
  #editor { font-size: max(16px, var(--fs)); padding: 18px 16px 40vh; }
  .prose, .mode-read .prose { padding: 18px 16px 40vh; }

  /* the top bar: the mark only, no crumb (the outline and the toolbar name the book and chapter) */
  .topbar { gap: 2px; padding: 0 4px; }
  .topbar .crumb, .topbar .pub-chip { display: none !important; }
  .brand { width: 44px; justify-content: center; padding: 0; }
  .brand .brand-name { display: none; }

  /* sign-in */
  .auth { padding: 16px 12px; place-items: start center; }
  .auth-card { padding: 22px 18px 20px; }
  .btn.wide { min-height: 48px; }

  /* the shelf and the wizard */
  .library { padding: 18px 14px 32px; }
  .lib-head { flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
  .lib-head h1 { font-size: 28px; }
  .shelf { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .book { min-height: 0; padding: 16px 16px 14px 22px; }
  .book.new { min-height: 88px; }
  .lib-foot { gap: 4px 12px; }
  .lib-foot code { overflow-wrap: anywhere; word-break: break-all; min-width: 0; }
  .lib-foot .spacer { flex-basis: 100%; height: 0; }
  .wiz { gap: 14px; }
  .wiz h1 { font-size: 26px; }
  .wiz-nav { flex-wrap: wrap; }
  .choice { grid-template-columns: 44px minmax(0, 1fr); gap: 2px 12px; padding: 14px; }
  .choice .choice-ic { width: 44px; height: 44px; }
  .choice b { font-size: 17px; }
  .ol-row { grid-template-columns: 62px minmax(0, 1fr) auto auto auto; gap: 4px; }
  .ol-add .btn { flex: 1; justify-content: center; }
  .q { flex-wrap: wrap; }

  /* the workspace, its tabs, the write toolbar, the coach sheet and compare: phone.css (2026-12-01) */
  .ws { grid-template-columns: minmax(0, 1fr); }
  .ch-n { width: 22px; }
  .blank { padding: 24px 16px; }
  .strip { flex-wrap: wrap; gap: 4px 12px; }

  /* dialogs: the width of the screen, scrolling inside */
  .backdrop { padding: 8px; }
  .modal, .modal.wide { width: 100%; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .modal header { padding: 14px 16px 4px; }
  .modal .body { padding: 6px 16px; }
  .modal footer { flex-wrap: wrap; padding: 10px 16px 14px; }
  .modal footer .btn { flex: 1 1 auto; justify-content: center; }
  .history-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .history-list { max-height: 26vh; }
  .history-prev { max-height: 40vh; }
  .probes { grid-template-columns: minmax(0, 1fr); }
  .split { max-height: none; }
  .modal .seg { display: flex; flex-wrap: wrap; }
  .modal .seg button { flex: 1 1 auto; }

  #toasts { left: 8px; right: 8px; bottom: 8px; }
  .toast { max-width: none; }
}
