/* ==========================================================================
   The Live Forge — page styles on top of /assets/site.css.
   The Menagerie's family: cream paper, warm ink line, specimen-card framing
   (thin outer rule, heavier inner rule), Georgia for the book face and the
   condensed grotesque for labels. ONE pillar-box red on the page: the seal
   that renders and plays (the red rule under the heading is the site's).
   Sliders are ink, not red.
   ========================================================================== */

.sheet-wide { max-width: 1180px; }

.forge-live {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

/* ---------- specimen cards ---------- */

.card {
  background: var(--paper-lift);
  border: 1px solid var(--ink);
  padding: 4px;
  margin-bottom: 16px;
}
.card-in {
  border: 2px solid var(--ink);
  padding: 12px 14px 13px;
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.card h2 {
  font-family: var(--headline);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 16px;
  line-height: 1.1;
}
.card-note {
  font-family: var(--book);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 10px;
  line-height: 1.4;
}

/* ---------- the transport ---------- */

.pick-row, .seed-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-bottom: 10px;
}
.pick { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.pick.grow { flex: 1 1 260px; }
.pick.grow select { flex: 1 1 auto; min-width: 0; }
.lbl {
  font-family: var(--headline);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11.5px;
  color: var(--ink-soft);
  flex: none;
}
.pick select, .pick input[type=number] {
  font: 14.5px var(--book);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 5px 8px;
  border-radius: 0;
  max-width: 100%;
}
.pick input[type=number] { width: 120px; font-variant-numeric: tabular-nums; }
.pick select:focus, .pick input:focus, .cabinet-head input:focus { outline: 2px solid var(--red); outline-offset: 1px; }

.ink-btn {
  font-family: var(--headline);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 6px 11px 5px;
  cursor: pointer;
  border-radius: 0;
  -webkit-tap-highlight-color: transparent;
}
.ink-btn:hover { color: var(--red-deep); }
.ink-btn:disabled { color: var(--ink-soft); border-style: dotted; cursor: default; }
.ink-btn.small { font-size: 11px; padding: 4px 9px 3px; }

.play-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 6px 0 12px;
}
.seal-btn {
  flex: none;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.seal-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 50%; }
.seal-btn:disabled { cursor: default; opacity: 0.6; }

/* the red seal: the page's pillar-box red */
.seal {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--red);
  border: 1px solid var(--red-deep);
  box-shadow: inset 0 0 0 2px var(--red), inset 0 0 0 3px rgba(250, 243, 224, 0.85);
  color: var(--paper-lift);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--book);
  font-size: 12px;
  line-height: 1;
}
.seal.big {
  width: 64px;
  height: 64px;
  font-size: 20px;
  box-shadow: inset 0 0 0 3px var(--red), inset 0 0 0 4.5px rgba(250, 243, 224, 0.85);
}
.seal .glyph { margin-left: 3px; }
.seal-btn.busy .seal { animation: seal-breathe 1.1s ease-in-out infinite; }
@keyframes seal-breathe { 50% { transform: scale(0.94); } }

.play-side { min-width: 0; flex: 1 1 auto; }
.now {
  font-family: var(--headline);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.status {
  font-family: var(--book);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-top: 3px;
  min-height: 1.4em;
}
.status.warn { color: var(--red-deep); }
.download {
  display: inline-block;
  margin-top: 5px;
  font-family: var(--headline);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11.5px;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-soft);
}
.download:hover { color: var(--red-deep); border-bottom-color: var(--red-deep); }

canvas#wave {
  display: block;
  width: 100%;
  height: 80px;
  background: var(--paper);
  border: 1px solid var(--ink);
}

/* ---------- knobs (character and anatomy share the row) ---------- */

.knobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2px 26px; }
.krow {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 10px;
  padding: 5px 0 4px;
  border-bottom: 1px dotted rgba(107, 91, 69, 0.45);
}
.krow .kn {
  font-family: var(--headline);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
}
.krow .kv {
  text-align: right;
  font-family: var(--book);
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.krow.off .kn, .krow.off .kv { color: rgba(107, 91, 69, 0.55); }
.krow.touched .kn::after { content: " \2022"; color: var(--red); }   /* the mark on an edited knob */
.krow input[type=range] {
  width: 100%;
  margin: 0;
  accent-color: var(--ink);
  cursor: pointer;
}
.krow input[type=range]:disabled { cursor: default; opacity: 0.5; }

/* the folds: the phrase and the anatomy */
details.fold > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding: 10px 14px;
  border: 2px solid var(--ink);
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary { border-bottom: 0; }
details.fold[open] > .card-in { border-top: 1px dotted var(--ink-soft); }
.sum-title {
  font-family: var(--headline);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 15px;
}
.sum-title::before { content: "\25B8"; display: inline-block; width: 1em; color: var(--ink-soft); }
details.fold[open] .sum-title::before { content: "\25BE"; }
.sum-note { font-family: var(--book); font-style: italic; font-size: 13px; color: var(--ink-soft); }
.sum-live {
  font-family: var(--headline);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11.5px;
  color: var(--ink);
  margin-left: auto;
}
.sum-live:empty { display: none; }
.panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 8px 24px; }
.grp { padding-bottom: 4px; }
.grp h3 {
  font-family: var(--headline);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--ink);
  padding: 8px 0 3px;
  margin-bottom: 2px;
}
.blurb {
  font-family: var(--book);
  font-style: italic;
  font-size: 11.5px;
  color: var(--ink-soft);
  line-height: 1.3;
  margin: 4px 0 0;
}

/* ---------- the phrase panel ---------- */

.motif-row { margin-bottom: 8px; }
.motif-about { margin: 0 0 10px; padding: 8px 10px 6px; border: 1px dotted var(--ink-soft); }
.motif-about .blurb { margin: 0 0 4px; }
.motif-about .source { color: var(--ink-soft); }
.motif-units {
  font-family: var(--book);
  font-size: 12px;
  color: var(--ink);
  margin: 4px 0 6px;
  padding-left: 22px;
  line-height: 1.45;
}
.motif-units li { padding: 1px 0; }
.krow .tone {
  font-family: var(--book);
  font-style: italic;
  font-size: 11.5px;
  color: var(--ink);
  line-height: 1.3;
  margin: 3px 0 0;
  padding-left: 8px;
  border-left: 2px solid var(--ink);
}
.krow .tone[hidden] { display: none; }
.krow.off .blurb { color: rgba(107, 91, 69, 0.55); }
.ramps { margin-top: 6px; }
.ramp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 6px 0 5px;
  border-bottom: 1px dotted rgba(107, 91, 69, 0.45);
}
.ramp-row .kn {
  font-family: var(--headline);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  flex: 0 0 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ramp-end {
  display: inline-grid;
  grid-template-columns: auto minmax(90px, 1fr) 58px;
  align-items: center;
  gap: 8px;
  flex: 1 1 200px;
  min-width: 0;
}
.ramp-end .kv { text-align: right; font-family: var(--book); font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ramp-end input[type=range] { width: 100%; margin: 0; accent-color: var(--ink); cursor: pointer; }
.ramp-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.ramp-add .pick { flex: 1 1 220px; }

/* the unit table under the waveform: the small print of a phrase */
.units { margin-top: 8px; }
.units[hidden] { display: none; }
.units .blurb { margin: 0 0 4px; }
.units table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--book);
  font-size: 11.5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.units th {
  font-family: var(--headline);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10.5px;
  color: var(--ink-soft);
  text-align: left;
  border-bottom: 1px solid var(--ink);
  padding: 2px 8px 2px 0;
}
.units td { padding: 2px 8px 2px 0; border-bottom: 1px dotted rgba(107, 91, 69, 0.45); vertical-align: top; }
.units td:last-child { color: var(--ink-soft); font-style: italic; }
.units-scroll { overflow-x: auto; }

/* ---------- the cabinet ---------- */

.cabinet {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  background: var(--paper-lift);
  border: 1px solid var(--ink);
  padding: 12px 12px 14px;
}
.cabinet-head { display: flex; flex-direction: column; gap: 8px; }
.cabinet h2 {
  font-family: var(--headline);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 16px;
}
.cabinet-head input {
  font: 14px var(--book);
  font-style: italic;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 5px 8px;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}
.cabinet-note {
  font-family: var(--book);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 8px 0 6px;
}
.group { margin-top: 12px; }
.group[hidden] { display: none; }
.group h3 {
  font-family: var(--headline);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12.5px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 3px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.group h3 small { font-family: var(--book); font-style: italic; font-weight: normal; text-transform: none; letter-spacing: 0; font-size: 11.5px; color: var(--ink-soft); }
.animal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  padding: 5px 0 4px;
  border-bottom: 1px dotted rgba(107, 91, 69, 0.5);
}
.animal[hidden] { display: none; }
.animal .sp {
  font-family: var(--headline);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  flex: 0 0 100%;
}
.snd-btn {
  font-family: var(--book);
  font-style: italic;
  font-size: 13px;
  color: var(--ink);
  background: transparent;
  border: 1px dotted var(--ink-soft);
  padding: 2px 7px 1px;
  cursor: pointer;
  border-radius: 0;
  -webkit-tap-highlight-color: transparent;
}
.snd-btn:hover { color: var(--red-deep); border-color: var(--red-deep); }
.snd-btn.on { background: var(--ink); color: var(--paper-lift); border-style: solid; border-color: var(--ink); }
.snd-btn[hidden] { display: none; }
.cabinet-empty {
  font-family: var(--book);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 10px;
}

footer .foot-statement { max-width: 640px; margin: 0 auto 14px; font-style: italic; color: var(--ink); }

/* ---------- narrow screens ---------- */

@media (max-width: 900px) {
  .forge-live { grid-template-columns: 1fr; }
  .cabinet { position: static; max-height: 360px; }
}
@media (max-width: 480px) {
  .card-in { padding: 10px 10px 11px; }
  .krow { grid-template-columns: 92px minmax(0, 1fr) 52px; gap: 8px; }
  .krow .kn { font-size: 11px; letter-spacing: 0.06em; }
  .seal.big { width: 56px; height: 56px; font-size: 18px; }
  .now { font-size: 13.5px; }
  .pick input[type=number] { width: 104px; }
  .ramp-row .kn { flex-basis: 100%; }
}
