@font-face {
  font-family: Archivo;
  src: url("/fonts/Archivo.ttf") format("truetype");
  font-weight: 400 800;
  font-stretch: 100%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Courier Prime";
  src: url("/fonts/CourierPrime-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Courier Prime";
  src: url("/fonts/CourierPrime-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f3f1ea;
  --ink: #121212;
  --muted: #5d5a52;
  --faint: #b5b2a8;
  --rule: rgba(18, 18, 18, .15);
  --hl: #ff8fd0;
  --sans: Archivo, "Arial Narrow", sans-serif;
  --mono: "Courier Prime", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

button, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
}

button { cursor: pointer; }
button:disabled { cursor: default; color: var(--muted); }

#app { min-height: 100%; }

.mark {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .02em;
}

mark {
  background: var(--hl);
  color: var(--ink);
  padding: 0 3px;
}

/* Landing */

.landing { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  padding: 14px 56px;
  border-bottom: 1.5px solid var(--ink);
}

.landing-body {
  flex: 1;
  padding: 52px 56px 32px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.landing h1 {
  margin: 0;
  font-weight: 800;
  font-size: 72px;
  line-height: 1.14;
  letter-spacing: -.035em;
  max-width: 1100px;
}

.landing-intro {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.query {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1.5px solid var(--ink);
}

.query-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
  padding: 14px 16px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.query-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.query-input::-webkit-search-decoration,
.query-input::-webkit-search-cancel-button,
.query-input::-webkit-search-results-button,
.query-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  display: none;
}

.query .find {
  flex: none;
  padding: 0 22px;
  border-left: 1.5px solid var(--ink);
}

.kicker {
  margin: 0 0 10px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
}

.ticket {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) 220px;
  border: 1.5px solid var(--ink);
}

.field {
  padding: 12px 16px;
  border-right: 1.5px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.field label {
  font-weight: 600;
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--muted);
}

.field input {
  font: 700 22px/1.2 var(--mono);
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 0;
  width: 100%;
  outline: none;
}

.field input::placeholder { color: var(--muted); font-weight: 700; }

.find {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .04em;
}

.find:disabled { background: var(--muted); }

.status {
  margin: 14px 0 0;
  min-height: 1.2em;
  font-size: 14px;
  color: var(--muted);
}

/* Results */

.results {
  height: 100vh;
  display: flex;
  min-height: 0;
}

.rail {
  width: 290px;
  flex: none;
  border-right: 1.5px solid var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.rail .mark {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 20px;
  border-bottom: 1.5px solid var(--ink);
}

.asked {
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1.5px solid var(--ink);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.rail-labels {
  display: flex;
  justify-content: space-between;
  padding: 12px 20px 6px;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--muted);
}

.facet {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 20px;
  border-bottom: 1px solid var(--rule);
}

.facet .name { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.facet .label { font-weight: 600; font-size: 10px; letter-spacing: .1em; color: var(--muted); }
.facet .value { font: 700 18px/1.2 var(--mono); }
.facet .value.empty { color: var(--muted); }
.facet .count { font-weight: 800; font-size: 22px; }

.facet.selected { background: var(--ink); color: var(--paper); }
.facet.selected .label { color: var(--faint); }
.facet.selected .count { color: var(--hl); }
.facet.selected .value.empty { color: var(--faint); }

.rail-spacer { flex: 1; }

.edit {
  padding: 14px 20px;
  border-top: 1.5px solid var(--ink);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  text-align: left;
}

.list {
  flex: 1;
  min-width: 0;
  overflow: auto;
}

.group-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 20px 24px 10px;
}

.group-head h2 {
  margin: 0;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -.02em;
}

.group-head .of { font-weight: 500; font-size: 13px; color: var(--muted); }

.quote {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 24px;
  border-bottom: 1px solid var(--rule);
}

.has-speaker .quote { grid-template-columns: 64px minmax(0, 1fr) 70px; }

.quote .who {
  font-weight: 700;
  font-size: 11px;
  line-height: 1.9;
  letter-spacing: .08em;
}

.quote .said {
  margin: 0;
  font: 400 15px/1.5 var(--mono);
}

.quote .clock {
  font: 700 13px/1.4 var(--mono);
  text-align: right;
}

.quote.selected { background: var(--ink); color: var(--paper); }
.quote.selected mark { color: var(--ink); }

.center { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.ranked-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  border-bottom: 1.5px solid var(--ink);
}
.ranked-bar .asked {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranked-note {
  padding: 16px 24px 0;
  font-size: 13px;
  color: var(--muted);
}

.ranked {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 96px;
  gap: 16px;
  width: 100%;
  text-align: left;
  padding: 18px 24px;
  border-bottom: 1px solid var(--rule);
}

.ranked .num { font-weight: 800; font-size: 28px; line-height: 1; }
.ranked .meta {
  display: flex;
  gap: 12px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
}
.ranked.selected .meta { color: var(--faint); }
.ranked .said { margin: 8px 0 0; font: 400 16px/1.55 var(--mono); }
.episode-line {
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ranked.selected .episode-line { color: var(--faint); }
.row-chips {
  display: flex;
  gap: 6px;
  align-items: baseline;
  margin-top: 8px;
  font-weight: 500;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.row-chip { border: 1px solid rgba(18, 18, 18, .28); padding: 1px 6px; }
.ranked.selected .row-chips,
.quote.selected .row-chips,
.phone-hit.selected .row-chips { color: var(--faint); }
.ranked.selected .row-chip,
.quote.selected .row-chip,
.phone-hit.selected .row-chip { border-color: rgba(243, 241, 234, .35); }
.untagged { margin-top: 8px; font-weight: 500; font-size: 11px; color: var(--muted); }
.ranked.selected .untagged,
.quote.selected .untagged,
.phone-hit.selected .untagged { color: var(--faint); }
.playing { display: none; font: 700 10px var(--sans); letter-spacing: .1em; color: var(--hl); }
.ranked.selected .playing { display: block; }
.quote-body { min-width: 0; }
.phone-hit .row-chips, .phone-hit .untagged { margin-top: 0; }
.ranked .clock { font: 700 14px/1.3 var(--mono); text-align: right; }
.ranked.selected { background: var(--ink); color: var(--paper); }
.ranked.selected mark { color: var(--ink); }

.empty-list {
  padding: 28px 24px;
  font-size: 18px;
}

.state-block {
  max-width: 520px;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.state-block .kicker { margin: 0; font-size: 10px; letter-spacing: .1em; }
.state-block h2 {
  margin: 0;
  font-weight: 800;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: -.03em;
}
.state-block p {
  margin: 0;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}
.state-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.state-actions button {
  height: 40px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  white-space: nowrap;
}
.state-actions .solid { background: var(--ink); color: var(--paper); }
.state-actions .ghost { border: 1.5px solid var(--ink); }
.state-detail {
  margin: 0;
  font: 400 13px/1.45 var(--mono);
  color: var(--muted);
  border: 1px solid rgba(18, 18, 18, .28);
  padding: 8px 10px;
  white-space: pre-wrap;
}
.state-links { display: flex; flex-direction: column; }
.state-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  width: 100%;
  padding: 11px 0;
  border-top: 1px solid var(--rule);
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}
.state-link:last-child { border-bottom: 1px solid var(--rule); }
.state-link b { font-weight: 700; }

.player {
  width: 400px;
  flex: none;
  border-left: 1.5px solid var(--ink);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.stage {
  aspect-ratio: 16 / 9;
  background: repeating-linear-gradient(135deg, #e2dfd5 0 10px, #d8d5ca 10px 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 400 12px var(--mono);
  color: var(--muted);
  position: relative;
}

.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.stage-play { font: 400 12px var(--mono); color: var(--muted); }

.episode {
  padding: 14px 20px;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.episode .title { font-weight: 700; font-size: 15px; }
.episode .filed { font-weight: 500; font-size: 12px; color: var(--muted); }

.transcript {
  flex: 1;
  overflow: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.line { font: 400 14px/1.55 var(--mono); color: var(--muted); }
.line.current { color: var(--ink); }
.line .stamp {
  display: block;
  font: 700 11px var(--sans);
  letter-spacing: .08em;
  margin-bottom: 2px;
}
.line.current .body {
  background: var(--hl);
  box-decoration-break: clone;
  padding: 1px 3px;
}

.transport {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1.5px solid var(--ink);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  text-align: center;
}

.transport.transport-three { grid-template-columns: 1fr 1fr 1.3fr; }

.transport button { padding: 14px 0; }
.transport button + button { border-left: 1.5px solid var(--ink); }

@media (max-width: 860px) {
  .topbar, .landing-body { padding-left: 20px; padding-right: 20px; }
  .landing-body { padding-top: 24px; }
  .landing h1 { font-size: 38px; line-height: 1.18; letter-spacing: -.03em; }
  .query .find { height: 56px; }
  .ticket { grid-template-columns: 1fr 1fr; }
  .field:nth-child(odd) { border-right: 1.5px solid var(--ink); }
  .field:nth-child(5) { grid-column: 1 / -1; border-right: 0; border-top: 1.5px solid var(--ink); }
  .ticket > .find { grid-column: 1 / -1; height: 56px; border-top: 1.5px solid var(--ink); }

  .results { flex-direction: column; height: auto; min-height: 100vh; }
  .rail { width: auto; border-right: 0; }
  .facets { display: flex; overflow-x: auto; }
  .facet { min-width: 148px; border-bottom: 0; border-right: 1px solid var(--rule); }
  .results:not(.browse) .list,
  .browse.has-player .list { padding-bottom: 46vh; }
  .browse.has-value .rail { display: none; }
  .browse:not(.has-value) .browse-center { display: none; }

  .player {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    width: auto;
    max-height: 46vh;
    background: var(--paper);
    border-left: 0;
    border-top: 1.5px solid var(--ink);
    z-index: 2;
  }
  .transcript { display: block; padding: 8px 20px 4px; overflow: hidden; }
  .line { display: none; }
  .line.current { display: block; }

  .ranked-bar { display: none; }
  .phone-back {
    display: block;
    width: 100%;
    text-align: left;
    padding: 20px 20px 12px;
  }
  .phone-back .asked {
    margin: 0;
    padding: 0;
    border: 0;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.3;
    letter-spacing: -.01em;
    white-space: normal;
  }
  .controls { display: none; }
  .phone-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    border-bottom: 1.5px solid var(--ink);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .06em;
  }
  .phone-bar > .slot > button { height: 44px; }
  .filters-btn {
    height: 32px;
    padding: 0 12px;
    border: 1.5px solid var(--ink);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .06em;
  }
  .filters-btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .active-filters { padding: 10px 20px; }
  .active-filters .filter-chip,
  .active-filters .and-word,
  .active-filters .clear-all { display: none; }
  .filter-summary { white-space: normal; }
  .picker { display: none; }
  .sheet {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    max-height: 92vh;
    background: var(--paper);
    border-top: 1.5px solid var(--ink);
    flex-direction: column;
  }
  .sheet-handle { width: 40px; height: 4px; background: var(--ink); margin: 8px auto 0; flex: none; }
  .sheet-head { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 20px; flex: none; }
  .sheet-head h2 { margin: 0; font-weight: 800; font-size: 22px; letter-spacing: -.02em; }
  .sheet-body { overflow: auto; }
  .sheet-row {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    border-top: 1px solid var(--rule);
    font-weight: 500;
    font-size: 14px;
    width: 100%;
    text-align: left;
  }
  .sheet-row .k { width: 96px; flex: none; font-weight: 600; font-size: 10px; letter-spacing: .1em; color: var(--muted); }
  .sheet-row .v { flex: 1; min-width: 0; }
  .sheet-row .v.muted, .sheet-row .muted { color: var(--muted); font-weight: 500; }
  .sheet-row .v:not(.muted) { font-weight: 700; }
  .sheet-x { font-weight: 700; flex: none; }
  .sheet-check { display: flex; align-items: center; gap: 10px; flex: 1; text-align: left; font-weight: 500; font-size: 14px; }
  .sheet-channels { color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap; }
  .sheet-apply {
    margin: 12px 20px 24px;
    height: 52px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .04em;
    flex: none;
  }
  .sheet-back {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .06em;
    border-bottom: 1.5px solid var(--ink);
  }
  .sheet .picker-list { max-height: 50vh; }
  .sheet .box { margin-top: 3px; }

  .state-block { max-width: none; padding: 40px 20px; }
  .state-block .kicker, .state-block .desk-only { display: none; }
  .state-actions { flex-direction: column; }
  .state-actions button { height: 52px; width: 100%; font-size: 14px; }
}

.segment { border-bottom: 1px solid var(--rule); }
.segment:empty { display: none; }
.segment > * { margin: 0 20px; }
.segment > :first-child { margin-top: 12px; }
.segment > :last-child { margin-bottom: 12px; }
.chapter-line { display: flex; flex-direction: column; gap: 1px; margin-bottom: 8px; }
.chapter-title { font-weight: 700; font-size: 13px; }
.chapter-range { font: 400 12px var(--mono); color: var(--muted); }
.chapter-type { font-weight: 600; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.segment > .conditions-quote { margin-top: 8px; font: 400 14px/1.45 var(--mono); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.chip { font: 700 11px/1 var(--mono); padding: 3px 6px; border: 1px solid var(--rule); color: var(--muted); }
.jump { font-weight: 600; font-size: 11px; letter-spacing: .06em; text-decoration: underline; text-underline-offset: 2px; }
.trades { max-height: 190px; overflow: auto; margin-top: 10px; border-top: 1px solid var(--rule); }
.trades-head { font-weight: 600; font-size: 10px; letter-spacing: .1em; color: var(--muted); padding: 8px 0 4px; }
.trade { display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 6px 0; border-top: 1px solid var(--rule); font-size: 12px; }
.trade:first-of-type { border-top: 0; }
.trade-what { font: 700 12px var(--mono); }
.trade-owner { color: var(--muted); font-size: 11px; }
.trade-quote { flex-basis: 100%; font: 400 12px/1.4 var(--mono); color: var(--muted); }

/* Search controls (2f, 2g) */

.list-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.controls { border-bottom: 1px solid var(--rule); }
.control-line {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px 24px 8px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  flex-wrap: wrap;
}
.control-line.filters { padding-top: 4px; padding-bottom: 12px; }
.control-btn { letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.control-btn b { color: var(--ink); font-weight: 700; }
.control-btn.on, .control-btn.open { color: var(--ink); font-weight: 700; }
.control-btn.open { box-shadow: inset 0 -2px 0 var(--ink); }
.check { display: flex; align-items: center; gap: 7px; letter-spacing: .08em; font-weight: 600; font-size: 11px; }
.box { width: 14px; height: 14px; border: 1.5px solid var(--ink); display: inline-block; flex: none; margin-top: 2px; }
.check .box, .sheet-check .box { width: 12px; height: 12px; margin-top: 0; }
.box.on { background: var(--ink); }
.spacer { flex: 1; }
.slot { position: relative; }
.menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 6;
  min-width: 160px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--rule);
}
.menu button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.picker {
  position: absolute;
  right: 24px;
  top: 74px;
  z-index: 6;
  width: 340px;
  max-height: 440px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  display: flex;
  flex-direction: column;
}
.picker-search {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1.5px solid var(--ink);
  font: 400 14px var(--mono);
  color: var(--muted);
}
.picker-search input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  outline: none;
  width: 100%;
}
.picker-list { overflow: auto; }
.picker-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.picker-name { font-weight: 600; font-size: 14px; }
.picker-meaning { display: block; font-weight: 400; font-size: 12px; line-height: 1.4; color: var(--muted); }
.picker-count { font: 400 13px var(--mono); }
.picker-foot {
  padding: 10px 12px;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.picker-empty { padding: 16px 12px; color: var(--muted); font-size: 13px; }

.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--rule);
  font-weight: 500;
  font-size: 13px;
}
.filter-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 26px;
  padding: 0 8px;
  border: 1.5px solid var(--ink);
  white-space: nowrap;
}
.filter-chip .k { font-weight: 600; font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.filter-chip i { color: var(--muted); font-style: italic; }
.and-word { font-weight: 600; font-size: 10px; letter-spacing: .08em; color: var(--muted); }
.clear-all { font-weight: 600; font-size: 11px; letter-spacing: .06em; color: var(--muted); }
.filter-summary { flex-basis: 100%; margin: 0; font-weight: 500; font-size: 13px; color: var(--muted); white-space: nowrap; }
.filter-summary b { color: var(--ink); }
.confidence-note {
  margin: 0;
  padding: 10px 24px;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
}
.confidence-note b { color: var(--ink); }

.phone-back, .phone-bar, .sheet { display: none; }

.phone-hit {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 14px 20px;
  border-bottom: 1px solid var(--rule);
}
.phone-meta { display: flex; justify-content: space-between; gap: 12px; font-weight: 500; font-size: 12px; color: var(--muted); }
.phone-meta b { color: var(--ink); }
.phone-hit .clock { font: 700 13px var(--mono); color: var(--ink); }
.phone-hit .said { margin: 0; font: 400 15px/1.5 var(--mono); }
.phone-hit.selected { background: var(--ink); color: var(--paper); }
.phone-hit.selected .phone-meta { color: var(--faint); }
.phone-hit.selected .phone-meta b, .phone-hit.selected .clock { color: var(--paper); }
.phone-hit.selected mark { color: var(--ink); }

.browse-link {
  margin-left: auto;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .06em;
  white-space: nowrap;
}
.browse-entry { margin-top: auto; padding-top: 28px; }
.browse-entry-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--ink);
}
.browse-entry-head button { font-weight: 700; letter-spacing: .08em; color: var(--ink); white-space: nowrap; }
.browse-picks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.browse-pick {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 16px 12px 0;
  border-right: 1px solid var(--rule);
  text-align: left;
  font-weight: 600;
  font-size: 15px;
}
.browse-pick:last-child { border-right: 0; padding-right: 0; }
.browse-pick .count { font: 400 13px var(--mono); color: var(--muted); }

.browse-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1.5px solid var(--ink);
}
.browse-head .mark { width: auto; padding: 0; border: 0; }
.ask-link { font-weight: 700; font-size: 11px; letter-spacing: .06em; white-space: nowrap; }
.browse-tabs {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px 0;
  border-bottom: 1px solid var(--rule);
}
.browse-tab {
  padding-bottom: 10px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}
.browse-tab.on { font-weight: 700; color: var(--ink); box-shadow: inset 0 -3px 0 var(--ink); }
.browse-search { border-bottom: 1px solid var(--rule); flex: none; }
.browse-search input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 12px 20px;
  font: 400 14px var(--mono);
  color: var(--ink);
}
.browse-search input::placeholder { color: var(--muted); }
.browse-values { flex: 1; overflow: auto; min-height: 0; }
.browse-value {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  text-align: left;
  padding: 12px 20px;
  border-bottom: 1px solid var(--rule);
}
.browse-value .top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.browse-value .name { font-weight: 600; font-size: 15px; }
.browse-value .count { font-weight: 800; font-size: 16px; }
.browse-value .meaning { font-weight: 400; font-size: 12px; line-height: 1.4; color: var(--muted); }
.browse-value.selected { background: var(--ink); color: var(--paper); }
.browse-value.selected .name { font-weight: 700; font-size: 16px; }
.browse-value.selected .count { color: var(--hl); font-size: 18px; }
.browse-value.selected .meaning { color: var(--faint); }
.browse-foot {
  padding: 12px 20px;
  border-top: 1.5px solid var(--ink);
  font-weight: 500;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.browse-note { margin: 0; padding: 16px 20px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.segment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  padding: 20px 24px 14px;
  border-bottom: 1.5px solid var(--ink);
}
.segment-head h2 { margin: 0; font-weight: 800; font-size: 26px; letter-spacing: -.02em; }
.segment-head .of { font-weight: 500; font-size: 13px; color: var(--muted); }
.browse-back {
  flex-basis: 100%;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
}
.segment-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 84px;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px 24px;
  border-bottom: 1px solid var(--rule);
}
.segment-row .clock { font: 700 14px var(--mono); }
.segment-row .title { font-weight: 700; font-size: 16px; }
.segment-row .episode-meta { margin-top: 4px; font-weight: 500; font-size: 12px; color: var(--muted); }
.segment-row .trades {
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
  text-align: right;
  white-space: nowrap;
}
.segment-row.selected { background: var(--ink); color: var(--paper); }
.segment-row.selected .episode-meta,
.segment-row.selected .row-chips,
.segment-row.selected .trade-more,
.segment-row.selected .phone-meta { color: var(--faint); }
.segment-row.selected .row-chip { border-color: rgba(243, 241, 234, .35); }
.segment-row.selected .clock,
.segment-row.selected .phone-meta b { color: var(--paper); }
.more-rows {
  display: block;
  width: 100%;
  padding: 16px 24px;
  text-align: left;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
}

@media (max-width: 860px) {
  /* These sit after the desktop defaults, so the phone display has to be repeated here. */
  .phone-back { display: block; }
  .phone-bar { display: flex; }
  .sheet { display: flex; }
  .filter-summary { white-space: normal; }
  .browse-values { overflow: visible; }
  .browse-value .name { font-weight: 700; font-size: 16px; }
  .segment-head { flex-direction: column; align-items: flex-start; gap: 4px; padding: 20px 20px 14px; }
  .segment-row { display: flex; flex-direction: column; gap: 6px; padding: 14px 20px; }
  .segment-row.selected .phone-meta .clock { color: var(--paper); }
  .browse-entry-head { flex-wrap: wrap; row-gap: 6px; }
  .browse-picks { grid-template-columns: 1fr 1fr; }
  .browse-pick { border-bottom: 1px solid var(--rule); }
  .browse-pick:nth-child(even) { border-right: 0; }
  .browse-pick:nth-child(odd) { border-right: 1px solid var(--rule); }
}

.topbar .logout {
  margin-left: auto;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .06em;
}

.gate { min-height: 100vh; display: flex; flex-direction: column; }

.gate-body {
  flex: 1;
  padding: 52px 56px 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 640px;
}

.gate-form { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }

.gate-field { display: flex; flex-direction: column; gap: 8px; width: 100%; }

.gate-field span {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
}

.gate-code {
  font: 700 22px/1.2 var(--mono);
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 5px solid var(--ink);
  padding: 8px 0;
  width: 100%;
  outline: none;
}

.gate-enter {
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .04em;
  padding: 16px 28px;
}

.gate-notes {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 460px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.disclaimer {
  margin: 8px 0 0;
  max-width: 640px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}

.history { margin-top: 12px; }

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--ink);
}

.history-clear { font-weight: 700; letter-spacing: .06em; color: var(--ink); }

.history-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

.history-q {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-weight: 600;
  font-size: 16px;
}

.history-meta {
  font: 400 12px var(--mono);
  color: var(--muted);
  white-space: nowrap;
}

.history-delete { font-weight: 700; font-size: 11px; letter-spacing: .06em; }

@media (max-width: 860px) {
  .gate-body { padding: 24px 20px; }
  .gate-code { border-bottom-width: 3px; }
  .gate-enter { align-self: stretch; width: 100%; height: 56px; }
  .gate-notes { max-width: none; }
  .history-row { flex-wrap: wrap; row-gap: 4px; }
  .history-q { flex-basis: 100%; }
  .history-meta { white-space: normal; }
  .history-delete { padding: 8px 0; }
}
