/* ============================================================
   1BB Content Machine v2 — sidebar architecture, editor shells,
   the rules system, the time ledger, and wireframe mode.
   Loads AFTER shared.css and only adds; it never re-themes.
   ============================================================ */

/* ---------------- app shell ---------------- */
.v2 {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}
@media (max-width: 940px) {
  .v2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

.rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
}
.rail::-webkit-scrollbar {
  width: 7px;
}
.rail::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}
@media (max-width: 940px) {
  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(292px, 86vw);
    z-index: 60;
    transform: translateX(-102%);
    transition: transform 260ms cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
  }
  .rail.is-open {
    transform: translateX(0);
  }
  @media (prefers-reduced-motion: reduce) {
    .rail {
      transition: none;
    }
  }
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--foreground);
  font-size: 19px;
}

/* ---------------- the time-saved header ----------------
   Built only from countable events. The live app refuses to print a number
   it cannot back up, so this one is clickable straight through to its own
   arithmetic — a scoreboard nobody can audit is worth less than no number. */
.saved {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(212, 160, 23, 0.07), transparent);
  display: block;
  width: 100%;
  text-align: left;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.saved:hover .saved-how {
  color: var(--primary);
}
.saved-k {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-foreground);
  font-weight: 600;
  display: block;
  margin-bottom: 3px;
}
.saved-n {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 30px;
  line-height: 1;
  color: var(--primary);
  display: block;
  font-variant-numeric: tabular-nums;
}
.saved-sub {
  font-size: 11.5px;
  color: var(--muted-foreground);
  display: block;
  margin-top: 5px;
  line-height: 1.4;
}
.saved-how {
  color: var(--muted-foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 160ms ease;
}

/* ---------------- rail navigation ---------------- */
/* Only the NAV scrolls. The member footer is pinned outside it, so Settings
   and the account block are reachable at 900px viewport height instead of
   falling off the end of a 1,550px rail. */
.rail-nav {
  padding: 10px 10px 20px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.rail-nav::-webkit-scrollbar {
  width: 7px;
}
.rail-nav::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}
.rail-foot {
  flex: none;
}
.rail-group {
  margin-bottom: 16px;
}
.rail-h {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted-foreground);
  font-weight: 700;
  padding: 8px 8px 6px;
  margin: 0;
}
.nav-i {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background 150ms ease, color 150ms ease;
  position: relative;
}
.nav-i:hover {
  background: rgba(255, 255, 255, 0.035);
  color: var(--foreground);
}
.nav-i[aria-current="page"] {
  background: rgba(212, 160, 23, 0.12);
  color: var(--foreground);
  font-weight: 600;
}
.nav-i[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.nav-i svg {
  width: 16px;
  height: 16px;
  flex: none;
  opacity: 0.9;
}
.nav-i .lbl {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A count on a studio says "the machine already put work in here" — the
   difference between a workbench and an empty tool. */
.nav-n {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(212, 160, 23, 0.16);
  color: var(--primary);
  flex: none;
  font-variant-numeric: tabular-nums;
}
.nav-n.quiet,
.nav-n.tone-quiet {
  background: var(--secondary);
  color: var(--muted-foreground);
}
/* Finished work the machine made, waiting on you — the only actionable one. */
.nav-n.tone-ready {
  background: rgba(212, 160, 23, 0.16);
  color: var(--primary);
}
/* A status, not a deliverable. Nothing to do yet. */
.nav-n.tone-busy {
  background: transparent;
  border: 1px dashed color-mix(in oklch, var(--primary) 40%, var(--border));
  color: var(--muted-foreground);
  font-weight: 600;
}
/* Your own unfinished work, not the machine's output. */
.nav-n.tone-mine {
  background: var(--secondary);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}
.nav-sub {
  padding-left: 14px;
  margin-left: 12px;
  border-left: 1px solid var(--border);
}
.disclose {
  margin-left: auto;
  transition: transform 180ms ease;
  opacity: 0.6;
}
.nav-i[aria-expanded="true"] .disclose {
  transform: rotate(90deg);
}
.rail-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
/* A sub-heading inside a group — the studios sit under Your Content rather
   than claiming a group of their own. */
.rail-h-sub {
  padding-top: 12px;
  opacity: 0.85;
}

/* Admin-only parking bay for Toolbox tools not yet moved across. Visually
   demoted so it can never be mistaken for a member-facing section. */
.rail-admin {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  opacity: 0.62;
}
.rail-admin .rail-h {
  color: var(--muted-foreground);
  letter-spacing: 0.06em;
  text-transform: none;
  font-size: 10.5px;
}
.rail-admin .nav-i {
  font-size: 12.5px;
  min-height: 34px;
}
.rail-admin .nav-i::after {
  content: "soon";
  margin-left: auto;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--muted-foreground);
}

/* ---------------- global assistant launcher ----------------
   Same position and shape as the live app so the prototype matches what
   ships: floating bottom-right, avatar, name, keyboard hint. */
.asst {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 14px 8px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklch, var(--primary) 25%, var(--border));
  background: rgba(20, 20, 25, 0.95);
  backdrop-filter: blur(10px);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, 0.85);
  transition: transform 180ms ease, border-color 180ms ease;
}
/* It has to read as floating ABOVE the page. With a card's border and fill and
   no elevation it landed beside a content card and read as one more card. */
.asst {
  background: #1c1c23;
  box-shadow:
    0 0 0 4px rgba(10, 10, 15, 0.55),
    0 18px 44px -10px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
}
.asst:hover {
  border-color: var(--primary);
}

/* The wireframe control, off the header strip entirely. */
/* Top-right: clear of the sidebar's member footer (bottom-left) and of the
   assistant launcher (bottom-right). It was covering the account block. */
.wire-float {
  position: fixed;
  right: 16px;
  top: 14px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(20, 20, 25, 0.92);
  backdrop-filter: blur(8px);
  color: var(--muted-foreground);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  opacity: 0.72;
  transition: opacity 160ms ease;
}
.wire-float:hover {
  opacity: 1;
}
@media (max-width: 940px) {
  .wire-float {
    right: 10px;
    top: 9px;
    min-height: 40px;
    font-size: 11.5px;
  }
}

/* The time-saved proof, inside the section it measures. */
.saved-inline {
  border: 1px solid color-mix(in oklch, var(--primary) 30%, var(--border));
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  max-width: 340px;
  background: linear-gradient(180deg, rgba(212, 160, 23, 0.08), transparent);
}
.saved-inline .saved-n {
  font-size: 26px;
}
@media (prefers-reduced-motion: no-preference) {
  .asst:hover {
    transform: translateY(-2px);
  }
}
.asst-av {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex: none;
}
.asst-b b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
}
.asst-b small {
  display: block;
  font-size: 10.5px;
  color: var(--muted-foreground);
}
.asst-k {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--muted-foreground);
  background: rgba(10, 10, 15, 0.6);
}
@media (max-width: 700px) {
  .asst {
    right: 14px;
    bottom: 14px;
    padding: 7px 12px 7px 7px;
  }
  .asst-b small,
  .asst-k {
    display: none;
  }
}

/* ---------------- main column ---------------- */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.mtop {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(10px);
  z-index: 30;
}
@media (max-width: 940px) {
  .mtop {
    display: flex;
  }
}
/* ---------------- mobile: each direction keeps its own thesis ----------------
   Behind a hamburger all three read identically, which makes them impossible
   to choose between on a phone — the width the co-founder will actually open
   them at. So the top bar carries the proof, and a strip under it carries
   whatever that direction is arguing. */
.mtop-saved {
  margin-left: auto;
  text-align: right;
  line-height: 1.15;
  white-space: nowrap;
}
.mtop-saved b {
  display: block;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 19px;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.mtop-saved small {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  font-weight: 600;
}
.mstrip {
  display: none;
  gap: 7px;
  overflow-x: auto;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
  position: sticky;
  top: 58px;
  z-index: 29;
  background: rgba(10, 10, 15, 0.94);
  backdrop-filter: blur(10px);
}
.mstrip::-webkit-scrollbar {
  display: none;
}
.mstrip button {
  flex: none;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mstrip button .nav-n {
  font-size: 10px;
  padding: 1px 6px;
}
.mstrip button[aria-current="page"] {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(212, 160, 23, 0.1);
}
@media (max-width: 940px) {
  .mstrip {
    display: flex;
  }
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 55;
}
.scrim[hidden] {
  display: none;
}

.wrap {
  padding: 26px 28px 90px;
  max-width: 1220px;
  width: 100%;
}
/* The rail already takes 264px, so wider cards fill the remaining canvas
   instead of leaving a dead column at the end of every two-piece row. */
.v2 .filmstrip {
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
}
@media (max-width: 700px) {
  .wrap {
    padding: 20px 16px 90px;
  }
}

/* ---------------- editor workspace ---------------- */
.ed {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1000px) {
  .ed {
    grid-template-columns: minmax(0, 1fr);
  }
}
.ed-stage {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.035), transparent 60%),
    var(--card);
  padding: 22px;
  display: grid;
  place-items: center;
  min-height: 340px;
}
.ed-side {
  display: grid;
  gap: 14px;
}
.panel {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 15px;
}
.panel h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-foreground);
  font-weight: 700;
  margin: 0 0 11px;
}
.field {
  margin-bottom: 12px;
}
.field:last-child {
  margin-bottom: 0;
}
.field label {
  display: block;
  font-size: 12.5px;
  color: var(--muted-foreground);
  margin-bottom: 5px;
}
.field input[type="text"],
.field select,
.field textarea {
  width: 100%;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--foreground);
  font: inherit;
  font-size: 13.5px;
  padding: 9px 11px;
  min-height: 40px;
}
/* A stock OS chevron on a fully custom dark surface is the tell that this is
   a form, not a product. Draw our own. */
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%),
    linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% + 1px), calc(100% - 11px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.field textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  outline: none;
}
.swatches {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.sw {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  padding: 0;
}
.sw[aria-pressed="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(212, 160, 23, 0.3);
}

/* ---------------- Library card actions ----------------
   Same stack the live filmstrip uses: approve line, one solid primary, then
   outline pairs, then remove. Quick edit was the piece missing from the mock. */
.c-acts {
  display: grid;
  gap: 6px;
  padding: 0 13px 13px;
  margin-top: auto;
}
.c-actrow {
  display: flex;
  gap: 6px;
}
.c-actrow .btn {
  flex: 1;
  min-width: 0;
}
.c-acts .btn {
  min-height: 32px;
  padding: 0 9px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}
.c-acts .btn svg {
  width: 13px;
  height: 13px;
}
.act-approve {
  border-color: color-mix(in oklch, var(--primary) 45%, transparent);
  background: transparent;
  color: var(--primary);
}
.act-approve[aria-pressed="true"] {
  border-color: color-mix(in oklch, var(--success) 50%, transparent);
  color: var(--success-ink);
  background: rgba(45, 139, 87, 0.1);
}
.act-remove {
  border-color: transparent;
  background: transparent;
  color: var(--muted-foreground);
  flex: 0 0 auto !important;
}
.act-remove:hover {
  color: var(--destructive-ink);
  border-color: color-mix(in oklch, var(--destructive) 40%, transparent);
}
@media (pointer: coarse), (max-width: 700px) {
  .c-acts .btn {
    min-height: 44px;
  }
}

/* ---------------- carousel style picker ----------------
   Each card draws a miniature of the real layout. "Simple message" and
   "Storyteller" tell a member nothing; the shape of the slide tells them
   everything. */
.panel-hint {
  font-size: 12px;
  color: var(--muted-foreground);
  margin: -6px 0 12px;
  line-height: 1.4;
}
.stylegrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.stylecard {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.015);
  padding: 9px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
  display: block;
}
.stylecard:hover {
  border-color: color-mix(in oklch, var(--primary) 45%, var(--border));
  background: rgba(255, 255, 255, 0.04);
}
.stylecard[aria-checked="true"] {
  border-color: var(--primary);
  background: rgba(212, 160, 23, 0.09);
}
.sname {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-top: 7px;
  line-height: 1.25;
}
.sdesc {
  display: block;
  font-size: 10.5px;
  color: var(--muted-foreground);
  line-height: 1.35;
  margin-top: 2px;
}

/* the miniatures */
.mini {
  display: flex;
  flex-direction: column;
  gap: 3px;
  aspect-ratio: 4 / 5;
  width: 100%;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: #17171d;
  padding: 7px 6px;
  overflow: hidden;
  justify-content: center;
}
.mb {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: #4a4f57;
  flex: none;
}
.mb-hl {
  background: var(--primary);
}
.mb-w {
  background: #cfd3d9;
}
.mb-ink {
  background: #6e7480;
  height: 3px;
}
.mb-caps {
  background: #e8e6e3;
  height: 5px;
}
.mb-gold {
  background: var(--primary);
}
.mb-eye {
  background: color-mix(in oklch, var(--primary) 55%, transparent);
  height: 3px;
}
.mb-row {
  background: #3a3f47;
  height: 3px;
}
.mini-cream {
  background: #efe7d6;
  justify-content: center;
  align-items: center;
}
.mini-cream .mb {
  background: #3a352c;
}
.mini-cream .mb-hl {
  background: var(--primary);
}
.mini-paper {
  background: #e8e4db;
  justify-content: center;
}
.mini-dark {
  background: #0f0f14;
  justify-content: center;
}
.mgold {
  display: block;
  height: 7px;
  border-radius: 2px;
  background: var(--primary);
  margin-top: 4px;
}
.mph {
  display: block;
  border-radius: 3px;
  background: linear-gradient(135deg, #3f4650, #2a2f37);
  flex: none;
  width: 100%;
}
.mcap {
  display: block;
  height: 4px;
  border-radius: 2px;
  background: #cfd3d9;
  width: 70%;
  flex: none;
}
.mini-photo {
  background: linear-gradient(135deg, #46505c, #262b33);
  justify-content: flex-end;
  padding: 0;
}
.mlow {
  display: block;
  padding: 6px;
  background: linear-gradient(0deg, rgba(10, 10, 15, 0.9), transparent);
}
.mlow .mb {
  margin-bottom: 3px;
}
.mctr {
  display: block;
  padding: 6px;
  margin: auto 0;
}
.mblk {
  display: block;
  background: #000;
  padding: 6px;
  margin: auto -6px -7px;
  flex: 1;
}
.mblk .mb {
  margin-bottom: 3px;
}
.mini-split {
  flex-direction: row;
  gap: 3px;
  padding: 6px;
}
.mini-split span {
  flex: 1;
  border-radius: 3px;
  background: #3a3f47;
}
.mini-split span:last-child {
  background: color-mix(in oklch, var(--primary) 40%, #3a3f47);
}
.mini-quad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  padding: 6px;
}
.mini-quad i {
  border-radius: 3px;
  background: #3a3f47;
  display: block;
}

/* Speak to Carousel — a way IN to this studio, not a separate destination. */
.speakbtn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin-bottom: 14px;
  padding: 11px 13px;
  border-radius: var(--radius);
  border: 1px dashed color-mix(in oklch, var(--primary) 45%, var(--border));
  background: rgba(212, 160, 23, 0.06);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}
.speakbtn:hover {
  background: rgba(212, 160, 23, 0.12);
  border-color: var(--primary);
}
.speakbtn svg {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex: none;
}
.speakbtn b {
  display: block;
  font-size: 13px;
}
.speakbtn small {
  display: block;
  font-size: 11.5px;
  color: var(--muted-foreground);
  line-height: 1.35;
}

/* carousel slide strip */
.slides {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 4px 0 10px;
  scrollbar-width: thin;
}
.slide {
  flex: none;
  width: 74px;
  aspect-ratio: 4 / 5;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  background: var(--secondary);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding: 0;
  color: inherit;
}
.slide[aria-pressed="true"] {
  border-color: var(--primary);
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slide .num {
  position: absolute;
  left: 4px;
  top: 4px;
  font-size: 9.5px;
  font-weight: 700;
  background: rgba(10, 10, 15, 0.8);
  border-radius: 4px;
  padding: 1px 4px;
  z-index: 2;
}
/* Every slide carries its own line. An empty numbered box reads as "the
   machine didn't finish", which is the last thing this product should say. */
.slide-t {
  position: absolute;
  inset: auto 0 0;
  padding: 16px 5px 5px;
  font-size: 8px;
  line-height: 1.25;
  font-weight: 700;
  text-align: left;
  background: linear-gradient(0deg, rgba(10, 10, 15, 0.94), transparent);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* b-roll timeline */
.tl {
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--background);
  padding: 11px;
}
.tl-track {
  display: flex;
  gap: 3px;
  height: 46px;
  margin-bottom: 8px;
}
.tl-clip {
  flex: 1;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
  background: var(--secondary);
}
.tl-clip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.tl-clip[aria-pressed="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}
.tl-cap {
  height: 24px;
  border-radius: 5px;
  background: rgba(212, 160, 23, 0.16);
  border: 1px dashed color-mix(in oklch, var(--primary) 45%, transparent);
  display: flex;
  align-items: center;
  padding: 0 9px;
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
}
.tl-ruler {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted-foreground);
  margin-top: 7px;
  font-variant-numeric: tabular-nums;
}

/* ---------------- the edit-to-rule loop ----------------
   The single most important element in the redesign. An edit that becomes a
   rule is the only reason adding editors back doesn't cost the member time. */
/* Both steps visible from the start. Step two is the payoff and carries the
   weight; step one is the price you pay to get there. */
.twostep {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}
.twostep .step {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}
.twostep .step-n {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted-foreground);
  flex: none;
}
.twostep .step-n svg {
  width: 14px;
  height: 14px;
}
.twostep .step-b {
  flex: 1;
  min-width: 240px;
}
.twostep .step-b b {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}
.twostep .step-b small {
  color: var(--muted-foreground);
  font-size: 12.5px;
  line-height: 1.45;
  display: block;
}
.step-payoff {
  border-color: color-mix(in oklch, var(--primary) 40%, var(--border)) !important;
  background: linear-gradient(180deg, rgba(212, 160, 23, 0.09), rgba(212, 160, 23, 0.025)) !important;
}
.step-payoff .step-n {
  border-color: var(--primary);
  color: var(--primary);
}
.step-payoff.is-locked {
  opacity: 0.62;
}
.step-payoff.is-locked .btn[disabled] {
  cursor: not-allowed;
  opacity: 0.75;
}
.step.is-done {
  border-color: color-mix(in oklch, var(--success) 42%, var(--border));
}
.step.is-done .step-n {
  border-color: var(--success);
  color: var(--success-ink);
}
.step-ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--success-ink);
  white-space: nowrap;
}
.step-ok svg {
  width: 15px;
  height: 15px;
}

.rulebar {
  margin-top: 14px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in oklch, var(--primary) 38%, var(--border));
  background: linear-gradient(180deg, rgba(212, 160, 23, 0.1), rgba(212, 160, 23, 0.03));
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.rulebar .rb-txt {
  flex: 1;
  min-width: 230px;
}
.rulebar b {
  display: block;
  font-size: 13.5px;
  margin-bottom: 2px;
}
.rulebar small {
  color: var(--muted-foreground);
  font-size: 12.5px;
  line-height: 1.45;
}
.rulebar.is-set {
  border-color: color-mix(in oklch, var(--success) 45%, var(--border));
  background: linear-gradient(180deg, rgba(45, 139, 87, 0.12), rgba(45, 139, 87, 0.03));
}

/* rules list */
.rules {
  display: grid;
  gap: 10px;
}
.rule {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.rule-b {
  flex: 1;
  min-width: 220px;
}
.rule-t {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 3px;
}
.rule-m {
  font-size: 12.5px;
  color: var(--muted-foreground);
  margin: 0;
}
.rule-fired {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* switch */
.sw-toggle {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--secondary);
  position: relative;
  cursor: pointer;
  flex: none;
  padding: 0;
  transition: background 180ms ease, border-color 180ms ease;
}
/* The knob is centred vertically so the control's HEIGHT can grow for touch
   without the knob drifting to the top. */
.sw-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--muted-foreground);
  transform: translateY(-50%);
  transition: transform 180ms ease, background 180ms ease;
}
.sw-toggle[aria-pressed="true"] {
  background: rgba(212, 160, 23, 0.22);
  border-color: var(--primary);
}
.sw-toggle[aria-pressed="true"]::after {
  transform: translateY(-50%) translateX(18px);
  background: var(--primary);
}
@media (prefers-reduced-motion: reduce) {
  .sw-toggle,
  .sw-toggle::after {
    transition: none;
  }
}

/* ---------------- the time ledger ----------------
   An auditable list, not a scoreboard. Every line traces to real pieces. */
.ledger {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
}
.led-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  width: 100%;
  background: none;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease;
}
.led-row:last-of-type {
  border-bottom: 0;
}
.led-row:hover {
  background: rgba(255, 255, 255, 0.024);
}
.led-what {
  min-width: 0;
}
.led-what b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.led-what small {
  color: var(--muted-foreground);
  font-size: 12px;
}
.led-n {
  font-size: 12.5px;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.led-t {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.led-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  border-top: 1px solid var(--border);
  background: rgba(212, 160, 23, 0.05);
  flex-wrap: wrap;
}
.led-total .lt-n {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 30px;
  color: var(--primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.led-note {
  font-size: 12px;
  color: var(--muted-foreground);
  margin: 10px 0 0;
  line-height: 1.5;
}

/* big stat row */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  padding: 16px;
}
.stat .k {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted-foreground);
  font-weight: 700;
  display: block;
  margin-bottom: 7px;
}
.stat .v {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 32px;
  line-height: 1;
  display: block;
  font-variant-numeric: tabular-nums;
}
.stat .v.amber {
  color: var(--primary);
}
.stat .s {
  font-size: 12px;
  color: var(--muted-foreground);
  display: block;
  margin-top: 6px;
  line-height: 1.45;
}

/* ---------------- wireframe mode ----------------
   Flip any mockup to its skeleton. Useful in a review: the wireframe argues
   about structure, the skin argues about feel, and they are different fights. */
[data-wire="on"] {
  --primary: #9aa0aa;
  --card: #17171b;
}
[data-wire="on"] img {
  filter: grayscale(1) contrast(0.55) brightness(0.62);
}
[data-wire="on"] .surface,
[data-wire="on"] .panel,
[data-wire="on"] .stat,
[data-wire="on"] .ledger,
[data-wire="on"] .rule,
[data-wire="on"] .c-card,
[data-wire="on"] .m-card,
[data-wire="on"] .ed-stage {
  background: #131317 !important;
  box-shadow: none !important;
  border-style: dashed !important;
}
[data-wire="on"] .btn-primary {
  background: transparent;
  color: #c9ced6;
  border: 1px dashed #666c76;
}
[data-wire="on"] .nav-i[aria-current="page"] {
  background: #202027;
}
[data-wire="on"] .saved,
[data-wire="on"] .rulebar,
[data-wire="on"] .led-total {
  background: #131317 !important;
  border-style: dashed !important;
}
[data-wire="on"] .wave i,
[data-wire="on"] .tl-cap {
  background: #4a4f57;
  color: #c9ced6;
  border-color: #666c76;
}
/* Region labels only exist in wireframe mode. */
.wirelab {
  display: none;
}
[data-wire="on"] .wirelab {
  display: inline-block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #7d838d;
  border: 1px dashed #4a4f57;
  border-radius: 4px;
  padding: 1px 6px;
  margin-bottom: 8px;
  font-weight: 700;
}

.wire-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted-foreground);
  cursor: pointer;
  user-select: none;
}

/* ============================================================
   TOUCH TARGETS — last block on purpose, same reason as shared.css:
   equal specificity means source order decides, and these must win.
   ============================================================ */
@media (pointer: coarse), (max-width: 700px) {
  .nav-i {
    min-height: 46px;
  }
  .sw-toggle {
    height: 44px;
    width: 46px;
  }
  .sw-toggle::after {
    left: 4px;
  }
  .sw-toggle[aria-pressed="true"]::after {
    transform: translateY(-50%) translateX(20px);
  }
  .wire-toggle {
    min-height: 44px;
  }
  .wire-toggle input {
    width: 22px;
    height: 22px;
  }
  .led-row,
  .saved {
    min-height: 52px;
  }
  .slide {
    width: 84px;
  }
  .sw {
    width: 44px;
    height: 44px;
  }
  .field select,
  .field input,
  .field textarea {
    min-height: 46px;
  }
  .twostep .btn {
    min-height: 46px;
  }
}
