/* ================================================================
   Presentable — shared app chrome for the Vibe-a-thon Planning App
   Reuses the design language + tokens from
   01-Projects/presentable/prototypes/lightweight-app.html and
   01-Projects/presentable/theme/paper.css (warm paper / ink /
   persimmon / forest, editorial serif display). Not the strict
   pp- markup contract (this app needs real forms + JS), just the
   same visual language.
   ================================================================ */

:root {
  --paper: #FAF7F2;
  --ink: #1A1815;
  --ink-soft: #5C564C;
  --ink-faint: #8A8375;
  --persimmon: #E05B3D;
  --persimmon-soft: rgba(224, 91, 61, 0.09);
  --persimmon-border: rgba(224, 91, 61, 0.28);
  /* AA-safe darkened persimmon for small text — --persimmon itself reads
     ~3.3-3.7:1 on paper/persimmon-soft, which clears the 3:1 floor for
     large text/non-text UI but fails 4.5:1 for small text. Use this for
     every small-text persimmon role (error banners, issue lists) instead;
     matches the deck theme's own --pd-accent-text token. */
  --persimmon-text: #B4432A; /* 5.20:1 on paper, 4.69:1 on persimmon-soft */
  --forest: #2D5A4A;
  --forest-soft: rgba(45, 90, 74, 0.10);
  --forest-border: rgba(45, 90, 74, 0.25);
  --amber: #8A5426; /* darkened from #B0713A — old value read 3.38:1 on --amber-soft, fails WCAG AA; this is ~4.7:1 (design-polish pass) */
  --amber-soft: #F5EBDF;
  --amber-border: rgba(138, 84, 38, 0.28);
  --slate: #3D5A73;
  --slate-soft: rgba(61, 90, 115, 0.10);
  --slate-border: rgba(61, 90, 115, 0.28);
  /* Low-intensity per-lane tints (design-polish pass #2, fix #1) — same hues
     as the -soft tokens above at roughly a third the alpha, so a lane reads
     as its own housed container without competing with the paper warmth or
     the (much stronger) lane-header tint. */
  --forest-lane: rgba(45, 90, 74, 0.035);
  --persimmon-lane: rgba(224, 91, 61, 0.035);
  --amber-lane: rgba(138, 84, 38, 0.035);
  --slate-lane: rgba(61, 90, 115, 0.035);
  --card: #FFFFFF;
  --line: #EDE7DD;
  --line-soft: #F3EFE7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(26, 24, 21, 0.04), 0 6px 20px -8px rgba(26, 24, 21, 0.08);
  --display: ui-serif, Georgia, "Times New Roman", serif;
  --body: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

body {
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(224, 91, 61, 0.045), transparent 60%),
    radial-gradient(900px 480px at -10% 12%, rgba(45, 90, 74, 0.045), transparent 55%),
    var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 56px;
}
.page--narrow { max-width: 520px; }
.page--board { max-width: 1120px; } /* Kanban board needs more width for 4 comfortable lanes (Phase 2.5) */

/* ————— Masthead ————— */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.masthead .from { font-size: 12.5px; color: var(--ink-faint); }
.masthead .from strong { color: var(--ink-soft); font-weight: 600; }

.eyebrow {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--persimmon);
}

/* ————— Hero ————— */
.hero { margin-bottom: 34px; }
.hero h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(28px, 5.4vw, 40px);
  line-height: 1.14;
  letter-spacing: -0.012em;
  margin: 10px 0 10px;
  text-wrap: balance;
}
.hero p.lede { font-size: 15px; color: var(--ink-soft); max-width: 58ch; }
.hero .chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }

.kind-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  /* AA-safe persimmon-text, not --persimmon — 3.10:1 on persimmon-soft at
     this weight/size fails 4.5:1 for small text (bench fix #1a); same swap
     as .msg.err above (4.70:1 on persimmon-soft). */
  color: var(--persimmon-text); background: var(--persimmon-soft);
  border: 1px solid var(--persimmon-border); border-radius: 999px; padding: 3.5px 11px;
}
.kind-chip::before {
  content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--persimmon);
  transform: rotate(45deg);
}
.live-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--forest);
  background: var(--forest-soft); border: 1px solid var(--forest-border);
  border-radius: 999px; padding: 3px 10px 3px 8px;
}
.live-chip::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--forest);
  animation: breathe 2.6s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

/* ————— Section headers ————— */
section { margin-bottom: 42px; }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.sec-head h2 {
  font-family: var(--display); font-weight: 550; font-size: 21px;
  letter-spacing: -0.008em; white-space: nowrap;
}
.sec-head .rule { flex: 1; height: 1px; background: var(--line); transform: translateY(-4px); }
.sec-head .aside { font-size: 12.5px; color: var(--ink-faint); white-space: nowrap; }

/* ————— Cards ————— */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px 20px;
}

/* ————— Forms ————— */
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 11px; font-weight: 650; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%; font-family: var(--body); font-size: 14px; color: var(--ink);
  background: #FDFCF9; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { resize: vertical; min-height: 76px; font-family: var(--body); }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--forest-border); box-shadow: 0 0 0 3px var(--forest-soft);
}
/* Custom select arrow (Phase 2.5 polish) — the tag picker is chips now, but
   any other real <select> (e.g. the lane filter) keeps its native semantics
   with a themed chevron instead of the browser default. */
.field select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%238A8375' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 11px 7px;
}
.field .hint { font-size: 11.5px; color: var(--ink-faint); margin-top: 5px; }
.row { display: flex; gap: 10px; }
.row .field { flex: 1; }

.btn {
  font-family: var(--body); font-size: 13.5px; font-weight: 650; letter-spacing: 0.02em;
  color: #FDFCFA; background: linear-gradient(180deg, #37695A, var(--forest));
  border: none; border-radius: 8px; padding: 11px 20px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 2px 6px -1px rgba(45, 90, 74, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px -2px rgba(45, 90, 74, 0.5); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-block { width: 100%; }

/* Quiet fade-slide-in when a status message appears (design-polish pass #2,
   fix #5) — a CSS animation rather than a transition, since `display: none`
   can't be transitioned out of; this is the closest thing this app has to
   a toast (see prefers-reduced-motion below for the opt-out). */
@keyframes msgIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg {
  font-size: 12.5px; font-weight: 600; margin-top: 12px; display: none; border-radius: 8px;
  padding: 9px 12px;
}
.msg.show { display: block; animation: msgIn 0.18s ease; }
.msg.ok { color: var(--forest); background: var(--forest-soft); border: 1px solid var(--forest-border); }
.msg.err { color: var(--persimmon-text); background: var(--persimmon-soft); border: 1px solid var(--persimmon-border); }

/* ————— Idea board controls (lane filter, Phase 2.2 → 2.5) ————— */
.board-controls { margin-bottom: 16px; }
.board-controls .field { margin-bottom: 0; }

/* ————— Kanban board (Phase 2.5) ————— */
/* Lanes side-by-side on desktop; horizontally scrolling on narrow/mobile
   (rather than stacked) so drag between lanes stays reachable with a thumb.
   Lanes share the row's height (default flex stretch — do NOT reintroduce
   align-items: flex-start here, that's the "blank void" bug: a 5-card lane
   would tower over an empty one instead of every lane's tinted background
   filling to a shared bottom edge — design-polish pass, fix #1). */
.kanban { display: flex; gap: 16px; }
.lane {
  flex: 1 1 0; min-width: 0; align-self: stretch; display: flex; flex-direction: column;
  background: var(--line-soft); border: 1px solid var(--line); border-radius: var(--radius);
  transition: box-shadow 0.15s ease;
}
/* Housed lanes (design-polish pass #2, fix #1): each lane tints toward its
   own accent instead of one flat neutral background, so cards read as
   sitting inside a lane rather than floating on identical white. Header
   keeps the stronger accent tint; this is deliberately much quieter. */
.lane[data-tag="theme"] { background: var(--forest-lane); }
.lane[data-tag="format"] { background: var(--persimmon-lane); }
.lane[data-tag="logistics"] { background: var(--amber-lane); }
.lane[data-tag="other"] { background: var(--slate-lane); }

/* Drop-target cue while a card is being dragged (design-polish pass #2, fix
   #4) — SortableJS toggles `.dragging` on #kanban and `.drag-over` on
   whichever lane the pointer is currently over (see public/js/board.js). */
.lane.drag-over { box-shadow: inset 0 0 0 2px var(--line); }
.lane[data-tag="theme"].drag-over { box-shadow: inset 0 0 0 2px var(--forest-border); }
.lane[data-tag="format"].drag-over { box-shadow: inset 0 0 0 2px var(--persimmon-border); }
.lane[data-tag="logistics"].drag-over { box-shadow: inset 0 0 0 2px var(--amber-border); }
.lane[data-tag="other"].drag-over { box-shadow: inset 0 0 0 2px var(--slate-border); }
.lane-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; border-bottom: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
}
.lane-count { font-weight: 650; letter-spacing: 0.02em; opacity: 0.75; }
.lane-header-theme { color: var(--forest); background: var(--forest-soft); border-bottom-color: var(--forest-border); }
.lane-header-format { color: var(--persimmon); background: var(--persimmon-soft); border-bottom-color: var(--persimmon-border); }
.lane-header-logistics { color: var(--amber); background: var(--amber-soft); border-bottom-color: var(--amber-border); }
.lane-header-other { color: var(--slate); background: var(--slate-soft); border-bottom-color: var(--slate-border); }

/* The card LIST scrolls internally, independent of sibling lanes — capped
   so one overstuffed lane can't drag the whole row down with it. Radius is
   on the list itself (not `.lane` + overflow:hidden`) so hovering cards can
   cast their shadow past the lane edge instead of getting clipped. */
.lane-list {
  flex: 1; display: flex; flex-direction: column; gap: 12px;
  padding: 12px; min-height: 100px; max-height: 640px; overflow-y: auto;
  border-radius: 0 0 var(--radius) var(--radius);
}
/* An empty lane still reads as a drop zone, not a dead end (design-polish
   pass #2, fix #5) — dashed border already implied that; the copy now says
   so, and the dash brightens a touch while something's actively being
   dragged (`.kanban.dragging`, set in board.js) to invite the drop. */
.lane-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 22px 14px; color: var(--ink-faint); font-size: 12.5px;
  border: 1px dashed var(--line); border-radius: 8px;
  transition: border-color 0.15s ease;
}
.kanban.dragging .lane-empty { border-color: var(--ink-faint); }

/* ————— Idea board ————— */
.idea-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px 18px; position: relative; overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.idea-card:active { cursor: grabbing; }
/* Notion-like lift on hover — reads as clickable (opens the edit panel) and,
   combined with the grip dots, as draggable (design-polish pass, fix #5). */
.idea-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(26, 24, 21, 0.06), 0 16px 32px -12px rgba(26, 24, 21, 0.16);
}
.idea-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--forest);
}
.idea-card[data-tag="format"]::before { background: var(--persimmon); }
.idea-card[data-tag="logistics"]::before { background: var(--amber); }
.idea-card[data-tag="other"]::before { background: var(--slate); }

/* Grip-dots (⋮⋮ = two columns of 3 dots) — always visible, not just on
   hover, so the card reads as draggable on touch too (no cursor there). */
.card-grip {
  position: absolute; top: 8px; right: 10px; font-size: 13px; line-height: 1;
  letter-spacing: -2px; color: var(--ink-faint); opacity: 0.7; user-select: none; pointer-events: none;
}

/* SortableJS drag-state hooks (see public/js/board.js) */
.idea-card-ghost { opacity: 0.4; transition: opacity 0.15s ease, box-shadow 0.15s ease; }
.idea-card-chosen { box-shadow: 0 0 0 3px var(--forest-soft), var(--shadow); transition: opacity 0.15s ease, box-shadow 0.15s ease; }
.idea-card-drag { opacity: 0.92; transform: rotate(1.5deg); cursor: grabbing; }

/* Title gets the card's full width on its own line (design-polish pass #2,
   fix #9) — it used to share a row with the tag chip (title left, chip
   right), which squeezed it to ~110px and wrapped one or two words per
   line. `padding-right` just keeps text clear of the always-visible grip
   dots; the tag now lives down in `.meta` next to author + time. */
.idea-card h3 { font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 1.3; padding-right: 18px; }
.idea-card p.body-text { font-size: 14px; color: var(--ink-soft); line-height: 1.55; margin-top: 6px; white-space: pre-wrap; }
.idea-card .meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 11.5px; color: var(--ink-faint); margin-top: 12px;
}
.idea-card .meta strong { color: var(--ink-soft); font-weight: 600; }

/* Promoted-idea "→ decision" link chip (Phase 3): sits in the card's meta
   row next to author/time, same footprint as .tag-chip but a link, not a
   status label — forest (settled/permanent) rather than the tag's own
   color, so it visually reads as "this idea graduated" at a glance. */
.decision-chip {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.04em; text-decoration: none; color: var(--forest); background: var(--forest-soft);
  border: 1px solid var(--forest-border); border-radius: 999px; padding: 2.5px 9px; white-space: nowrap;
}
.decision-chip:hover { background: var(--forest); color: #FDFCFA; }

/* Promote-to-decision panel affordance (idea edit panel). */
.promote-btn {
  font-family: var(--body); font-size: 12.5px; font-weight: 650; color: var(--forest);
  background: var(--forest-soft); border: 1px solid var(--forest-border); border-radius: 8px;
  padding: 9px 14px; cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.promote-btn:hover { background: var(--forest); color: #FDFCFA; }
.promote-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.promoted-note { font-size: 12.5px; color: var(--ink-soft); }
.promoted-note a { color: var(--forest); font-weight: 650; }

/* ————— Link-style buttons (panel delete, etc.) ————— */
/* Real ≥44px hit area while keeping the visible label compact (design-polish
   pass, fix #4 — was ~15px tall). */
.link-btn {
  font-family: var(--body); font-size: 12px; font-weight: 650; letter-spacing: 0.02em;
  color: var(--ink-faint); background: none; border: none; cursor: pointer;
  padding: 10px 4px; min-height: 44px; display: inline-flex; align-items: center;
  transition: color 0.15s ease;
}
.link-btn:hover { color: var(--ink); }
.link-btn.danger:hover { color: var(--persimmon); }

.tag-chip {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 2.5px 9px; border-radius: 999px; white-space: nowrap;
}
.tag-chip.theme { color: var(--forest); background: var(--forest-soft); border: 1px solid var(--forest-border); }
.tag-chip.format { color: var(--persimmon); background: var(--persimmon-soft); border: 1px solid var(--persimmon-border); }
.tag-chip.logistics { color: var(--amber); background: var(--amber-soft); border: 1px solid var(--amber-border); }
.tag-chip.other { color: var(--slate); background: var(--slate-soft); border: 1px solid var(--slate-border); }

/* ————— Segmented pill-chip tag picker (Phase 2.5) ————— */
/* Accessible radiogroup: a visually-hidden radio per tag + a <label> styled
   as a tappable colored pill. Used in the create form, the edit panel
   (public/js/board.js buildTagPicker), and — with an extra neutral "All"
   pill — the "Show lane" filter row (design-polish pass, fix #7). */
.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.tag-pill {
  display: inline-flex; align-items: center; font-family: var(--body);
  font-size: 12.5px; font-weight: 650; letter-spacing: 0.02em; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tag-pill:hover { border-color: var(--ink-faint); }
.tag-pill-input:focus-visible + .tag-pill { box-shadow: 0 0 0 3px var(--forest-soft); }

/* Unselected pills get their own tinted -soft fill so each reads as "this
   color at rest" instead of a near-invisible line on flat paper (design-
   polish pass, fix #3); selected stays filled solid with white text. */
.tag-pill-theme { border-color: var(--forest-border); color: var(--forest); background: var(--forest-soft); }
.tag-pill-input:checked + .tag-pill-theme { background: var(--forest); border-color: var(--forest); color: #FDFCFA; }

.tag-pill-format { border-color: var(--persimmon-border); color: var(--persimmon); background: var(--persimmon-soft); }
.tag-pill-input:checked + .tag-pill-format { background: var(--persimmon); border-color: var(--persimmon); color: #FDFCFA; }

.tag-pill-logistics { border-color: var(--amber-border); color: var(--amber); background: var(--amber-soft); }
.tag-pill-input:checked + .tag-pill-logistics { background: var(--amber); border-color: var(--amber); color: #FDFCFA; }

.tag-pill-other { border-color: var(--slate-border); color: var(--slate); background: var(--slate-soft); }
.tag-pill-input:checked + .tag-pill-other { background: var(--slate); border-color: var(--slate); color: #FDFCFA; }

.tag-pill-all { border-color: var(--line); color: var(--ink-soft); background: var(--line-soft); }
.tag-pill-input:checked + .tag-pill-all { background: var(--ink); border-color: var(--ink); color: #FDFCFA; }

/* ————— Lane filter (segmented tab row, design-polish pass, fix #7) ————— */
/* Same radiogroup-of-pills component as the tag picker, reused as tabs:
   [ All ] [ Theme ] [ Format ] [ Logistics ] [ Other ] in place of the old
   native <select>. */
.lane-filter { gap: 6px; }

.empty-state {
  text-align: center; padding: 40px 20px; color: var(--ink-faint); font-size: 14px;
  border: 1px dashed var(--line); border-radius: var(--radius);
}

/* ————— Edit panel (right slide-over, design-polish pass, fix #6) ————— */
/* Replaces the old in-place card→form swap: clicking a card's body slides
   this in from the right over a dimming scrim instead of reflowing the
   lane. Desktop: fixed 440px panel. Mobile (<720px): full-screen sheet. */
.panel-scrim {
  position: fixed; inset: 0; background: rgba(26, 24, 21, 0.35);
  opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0s linear 0.2s;
  z-index: 40;
}
.panel-scrim.show { opacity: 1; visibility: visible; transition: opacity 0.2s ease; }

.edit-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 100vw;
  background: var(--paper); border-left: 1px solid var(--line);
  box-shadow: -8px 0 32px -14px rgba(26, 24, 21, 0.3);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.2s ease-out;
  z-index: 41;
}
.edit-panel.open { transform: translateX(0); }

.edit-panel-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px 16px 22px; border-bottom: 1px solid var(--line);
}
.panel-close {
  font-family: var(--body); font-size: 20px; line-height: 1; color: var(--ink-faint);
  background: none; border: none; cursor: pointer;
  padding: 12px; min-width: 44px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.15s ease;
}
.panel-close:hover { color: var(--ink); }

.edit-panel-body { flex: 1; overflow-y: auto; padding: 22px; }
.edit-panel-body .field:last-child { margin-bottom: 0; }
.panel-title-input {
  display: block; width: 100%; font-family: var(--display); font-weight: 600;
  font-size: 18px; color: var(--ink); line-height: 1.3;
  background: none; border: none; border-bottom: 1px solid var(--line);
  padding: 4px 0 10px; margin-bottom: 4px; outline: none;
  transition: border-color 0.15s ease;
}
.panel-title-input:focus { border-bottom-color: var(--forest-border); }
/* Read-only "Added by {author} · edited {time}" line (design-polish pass
   #2, fix #3) — the panel's equivalent of a card's meta footer. */
.panel-meta { font-size: 12px; color: var(--ink-faint); margin-bottom: 18px; }
.panel-body-input {
  width: 100%; min-height: 180px; font-family: var(--body); font-size: 14px; color: var(--ink);
  background: #FDFCF9; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; resize: vertical; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.panel-body-input:focus { border-color: var(--forest-border); box-shadow: 0 0 0 3px var(--forest-soft); }

/* Delete no longer opens a window.prompt — it swaps the footer to an inline
   passcode field (design-polish pass #2, fix #3). Only one of
   .footer-default / .footer-confirm is visible at a time (toggled via the
   `hidden` attribute in board.js), each filling the footer's width. */
.panel-msg { margin: 0 22px; }
.panel-msg.show { margin: 12px 22px 0; }
.edit-panel-footer {
  display: flex; align-items: center; padding: 16px 22px; border-top: 1px solid var(--line);
}
.edit-panel-footer .btn { min-height: 44px; } /* match Close/Delete 44px tap target */
.footer-default, .footer-confirm {
  display: flex; align-items: center; gap: 10px; width: 100%; flex-wrap: wrap;
}
.footer-default { justify-content: space-between; }
.footer-confirm { justify-content: flex-end; }
/* `hidden` toggles which footer row shows (board.js) — same specificity as
   the `display: flex` above, so it needs an explicit, more specific
   override here or the two rows render on top of each other. */
.footer-default[hidden], .footer-confirm[hidden] { display: none; }
.panel-passcode-input {
  flex: 1; min-width: 110px; font-family: var(--body); font-size: 13.5px; color: var(--ink);
  background: #FDFCF9; border: 1px solid var(--persimmon-border); border-radius: 8px;
  padding: 9px 12px; min-height: 44px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.panel-passcode-input:focus { border-color: var(--persimmon); box-shadow: 0 0 0 3px var(--persimmon-soft); }
.btn-danger { background: linear-gradient(180deg, #C24C31, var(--persimmon)); box-shadow: 0 2px 6px -1px rgba(224, 91, 61, 0.45); }
.btn-danger:hover { box-shadow: 0 4px 10px -2px rgba(224, 91, 61, 0.5); }

@media (max-width: 720px) {
  .edit-panel { width: 100%; }
}

/* ————— Deck gallery (deck publishing surface) ————— */
.deck-list { display: flex; flex-direction: column; gap: 12px; }
.deck-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 20px;
}
.deck-card-title { font-family: var(--display); font-weight: 600; font-size: 16px; }
/* --ink-soft, not --ink-faint (6.80:1 on paper vs. 3.52:1) — this meta line
   reads at 12.5px, below the size where --ink-faint clears AA (bench fix
   #1c; scoped to the gallery card, --ink-faint itself is unchanged). */
.deck-card-meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }
.deck-card-actions { display: flex; gap: 8px; flex-shrink: 0; }
/* min-height 44px matches the app's documented tap-target rule (see the
   .link-btn and .edit-panel-footer .btn comments above) — the compact
   padding alone landed at ~35px (bench fix #1b). */
.deck-card-actions .btn {
  padding: 8px 14px; font-size: 12.5px; min-height: 44px;
  display: inline-flex; align-items: center;
}
/* Download link shares the meta line's contrast fix — same --ink-faint at
   12px reads sub-AA here too (bench fix #1c). */
.deck-card-actions .link-btn { color: var(--ink-soft); }
.deck-card-actions .link-btn:hover { color: var(--ink); }
.deck-empty {
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px;
  text-align: center; color: var(--ink-faint); font-size: 13.5px;
}
.deck-starters { border: 0; padding: 0; margin: 0 0 20px; }
.deck-starters legend {
  padding: 0; font-size: 11px; font-weight: 650; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px;
}
.deck-starter-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
.deck-starter-input { position: absolute; opacity: 0; pointer-events: none; }
.deck-starter {
  display: flex; flex-direction: column; gap: 5px; min-height: 108px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #FDFCF9; cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.deck-starter:hover { border-color: var(--forest-border); transform: translateY(-1px); }
.deck-starter-name { font-family: var(--display); font-size: 15px; font-weight: 650; line-height: 1.2; }
.deck-starter-description { font-size: 12px; color: var(--ink-soft); line-height: 1.45; }
.deck-starter-input:focus-visible + .deck-starter { outline: 3px solid var(--forest-soft); outline-offset: 2px; }
.deck-starter-input:checked + .deck-starter { border-color: var(--forest); background: var(--forest-soft); box-shadow: inset 3px 0 0 var(--forest); }
.markup-field textarea {
  min-height: 320px; font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12.5px; line-height: 1.5;
}
.deck-validation-status { min-height: 1.25em; margin: 8px 0 0; font-size: 12.5px; color: var(--ink-faint); }
.deck-validation-status.is-pending { color: var(--ink-soft); }
.deck-validation-status.is-valid { color: var(--forest); font-weight: 650; }
.deck-validation-status.is-error { color: var(--persimmon-text); font-weight: 650; }
/* Detail lists that follow the .msg summary banner (design-polish pass,
   fix #5) — a left border + tint + indent so the actionable detail (which
   tag/class is wrong) visually connects to the banner above it instead of
   reading as an unrelated afterthought in plain ink. #deck-errors carries
   the same AA-safe persimmon as .msg.err; #deck-warnings gets a calmer
   ink-soft treatment (still well above the 4.5:1 small-text floor) so a
   successful-publish-with-warnings state doesn't read as an error. */
.deck-issue-list {
  margin: 10px 0 0; padding: 8px 14px 8px 30px; font-size: 12.5px; line-height: 1.55;
  border-radius: 0 8px 8px 0; border-left: 3px solid transparent;
}
.deck-issue-list li { margin-bottom: 4px; }
.deck-issue-list li:last-child { margin-bottom: 0; }
#deck-errors { color: var(--persimmon-text); background: var(--persimmon-soft); border-left-color: var(--persimmon); }
#deck-warnings { color: var(--ink-soft); background: var(--line-soft); border-left-color: var(--ink-faint); }
.deck-result-card {
  margin-top: 16px; padding: 16px 18px; border-radius: var(--radius);
  border: 1px solid var(--forest-border); background: var(--forest-soft);
}
.deck-result-card a { color: var(--forest); font-weight: 650; }

/* ————— Nav links (hero chips row, Phase 3) ————— */
.nav-link {
  font-size: 12.5px; font-weight: 650; color: var(--ink-soft);
  text-decoration: none; padding: 3px 2px; border-bottom: 1px solid var(--line-soft);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-link:hover { color: var(--persimmon); border-color: var(--persimmon-border); }

/* ————— Decision tracker (Phase 3) ————— */
.page--decisions { max-width: 820px; }

.decision-list { display: flex; flex-direction: column; gap: 12px; }

.decision-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 22px 16px; position: relative; overflow: hidden;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.decision-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(26, 24, 21, 0.06), 0 16px 32px -12px rgba(26, 24, 21, 0.16);
}
.decision-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--amber); }
.decision-card h3 { font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.3; padding-right: 8px; }
.decision-card p.note-text { font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; margin-top: 6px; white-space: pre-wrap; }
.decision-card .meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 11.5px; color: var(--ink-faint); margin-top: 12px;
}
.decision-card .meta strong { color: var(--ink-soft); font-weight: 600; }
/* Quiet "this opens something" cue on open cards — the hover lift alone
   (shared with .idea-card) doesn't say what clicking does, and Lock is a
   higher-stakes action than editing an idea (design-bench fix #2). */
.decision-card .lock-hint {
  margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--persimmon-text); white-space: nowrap;
}
.decision-card:hover .lock-hint { text-decoration: underline; }
.promoted-chip {
  display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em;
  color: var(--slate); background: var(--slate-soft); border: 1px solid var(--slate-border);
  border-radius: 999px; padding: 2.5px 9px; white-space: nowrap;
}

/* Decision-log cards: the permanent record. D-number badge takes the place
   of the open card's colored left rail; not clickable (the row itself
   isn't editable — only "Supersede" is an action). */
.decision-log-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 22px 16px 68px; position: relative;
}
.decision-log-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--forest); }
.d-number {
  position: absolute; left: 22px; top: 18px; font-family: var(--display); font-weight: 700;
  font-size: 1.15rem; color: var(--forest); line-height: 1;
}
.decision-log-card h3 { font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.3; margin-bottom: 4px; }
.decision-log-card .field-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-faint); margin-top: 12px; margin-bottom: 3px;
}
.decision-log-card .field-label:first-of-type { margin-top: 10px; }
.decision-log-card p.what-text, .decision-log-card p.why-text {
  font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; white-space: pre-wrap;
}
.decision-log-card .meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 11.5px; color: var(--ink-faint); margin-top: 14px;
}
.decision-log-card .meta strong { color: var(--ink-soft); font-weight: 600; }
.decision-log-card .log-actions { margin-top: 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.chain-list {
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
/* `hidden` toggles chain visibility (decisions.js) — same specificity clash
   as .footer-default[hidden]/.footer-confirm[hidden] above: the class's own
   `display: flex` needs an explicit, more specific [hidden] override or the
   UA `[hidden] { display: none }` rule loses the tie. */
.chain-list[hidden] { display: none; }
.chain-item { padding-left: 14px; border-left: 2px solid var(--line); opacity: 0.82; }
.chain-item .d-number-inline { font-family: var(--display); font-weight: 700; color: var(--ink-faint); margin-right: 6px; }
.chain-item h4 { font-family: var(--display); font-weight: 600; font-size: 14px; display: inline; }
.chain-item p { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; line-height: 1.5; }
.chain-item .meta { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }

.panel-source { color: var(--slate); }
.footer-actions { display: flex; align-items: center; gap: 8px; }

/* ————— Lock / Supersede modal (Phase 3) ————— */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(26, 24, 21, 0.4);
  opacity: 0; visibility: hidden; transition: opacity 0.2s ease, visibility 0s linear 0.2s;
  z-index: 50;
}
.modal-scrim.show { opacity: 1; visibility: visible; transition: opacity 0.2s ease; }

.modal {
  position: fixed; top: 50%; left: 50%; width: 520px; max-width: 92vw; max-height: 86vh;
  overflow-y: auto; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lift, 0 12px 40px -10px rgba(26, 24, 21, 0.35));
  padding: 24px 26px 22px; z-index: 51;
  opacity: 0; visibility: hidden; transform: translate(-50%, -46%);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}
.modal.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%); transition: opacity 0.2s ease, transform 0.2s ease; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.modal-header h2 { font-family: var(--display); font-weight: 600; font-size: 20px; }
/* A principle statement, not a validation error — neutral ink-on-cream even
   when the form is valid (was styled like .msg.err, which read as "you did
   something wrong" before you'd typed a word; design-bench fix #3). */
.modal-hint {
  font-size: 12.5px; color: var(--ink-soft); background: var(--line-soft);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
  margin: 10px 0 18px;
}
.modal .field textarea { min-height: 90px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 4px; }

@media (max-width: 560px) {
  .modal { width: 100%; max-width: 100vw; max-height: 100vh; height: 100%; top: 0; left: 0; transform: none; border-radius: 0; }
  .modal.open { transform: none; }
}

/* ————— Footer ————— */
footer { margin-top: 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.pub-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px;
  font-size: 12.5px; color: var(--ink-faint);
}
.pub-row .brand { font-family: var(--display); font-weight: 650; font-size: 13.5px; color: var(--ink); }
.pub-row .brand::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px;
  background: var(--persimmon); margin-right: 7px; transform: rotate(45deg) translateY(-1px);
}
.pub-row .sep { color: #D9D2C4; }

@media (max-width: 560px) {
  .page { padding: 28px 18px 44px; }
  .row { flex-direction: column; }
  .masthead { flex-direction: column; gap: 4px; margin-bottom: 26px; }
  .deck-starter-options { grid-template-columns: 1fr; }
  .deck-starter { min-height: 0; }
}

/* Narrower than 4 comfortable lane widths — scroll the board horizontally
   instead of squeezing lanes, so drag targets stay a reasonable size for
   touch (Phase 2.5). */
@media (max-width: 720px) {
  .kanban { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
  .lane { min-width: 250px; }
}
@media (max-width: 560px) {
  .kanban { margin: 0 -18px; padding-left: 18px; padding-right: 18px; }
}

/* paper.css (theme/paper.css) already turns off its own pulses/checkboxes
   under reduced motion — this extends the same courtesy to app.css's board:
   drag lift/ghost/chosen states and the edit panel's slide-in (design-
   polish pass, fix #8), plus the lane drop-zone ring, the empty-lane dash
   brighten, and the message fade-in added in design-polish pass #2. */
@media (prefers-reduced-motion: reduce) {
  .live-chip::before {
    animation: none;
  }
  .idea-card,
  .idea-card-ghost,
  .idea-card-chosen,
  .edit-panel,
  .panel-scrim,
  .btn,
  .tag-pill,
  .link-btn,
  .lane,
  .lane-empty,
  .msg.show,
  .decision-card,
  .modal,
  .modal-scrim,
  .nav-link,
  .deck-starter {
    transition: none;
    animation: none;
  }
}
