/* The Receipts - paper & ink edition.
   A subpoenaed group chat, filed as evidence. No glassy gradients here. */

* { box-sizing: border-box; }

:root {
  --paper: #f2ead9;          /* warm desk paper */
  --card: #fffdf5;           /* fresh sheet */
  --card2: #ece1ca;          /* aged sheet */
  --ink: #241d14;            /* printer ink */
  --ink-soft: #6f6350;
  --line: #d9ccb2;
  --red: #b0262f;            /* stamp pad red */
  --red-deep: #8f1d26;
  --teal: #0e6b62;
  --green: #2f7d4d;
  --mustard: #e3a013;
  --shadow: 4px 4px 0 var(--ink);
  --radius: 2px;
}

html, body { margin: 0; padding: 0; }

[hidden] { display: none !important; }

body {
  font-family: Georgia, "Times New Roman", serif;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% -5%, rgba(176, 38, 47, 0.06), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(14, 107, 98, 0.07), transparent 40%),
    repeating-linear-gradient(0deg, rgba(36, 29, 20, 0.015) 0 1px, transparent 1px 28px);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
}

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; margin: 0 0 0.35em; line-height: 1.2; }
h2 { font-size: 1.25rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
h3 { font-size: 1.05rem; }
p { margin: 0.4em 0; }

code {
  background: rgba(36, 29, 20, 0.06);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.05em 0.35em;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

.muted { color: var(--ink-soft); }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

/* ---------- masthead / brand ---------- */

.brand { display: flex; align-items: baseline; gap: 0.5em; flex-wrap: wrap; }
.brand-center { flex-direction: column; align-items: center; text-align: center; }
.brand-mark {
  font-size: 1.7rem;
  filter: grayscale(0.35) sepia(0.35) contrast(1.1);
}
.brand-name {
  font-size: 1.9rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1;
}
.brand-sub {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--red);
  font-weight: 700;
}
.brand-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 0.15em 0.5em;
}

/* document band like the strip on a paper receipt */
.doc-bar {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-soft);
  border-bottom: 2px double var(--ink);
  background: rgba(227, 160, 19, 0.1);
  padding: 0.4em 1.2rem 0.5em;
  margin: -1.4rem -1.6rem 1.2rem;
}

/* ---------- typography helpers ---------- */

.serial-no {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  color: var(--ink-soft);
  font-weight: 400;
  margin-top: 0.35em;
  border-bottom: 1px dotted var(--line);
  padding-bottom: 0.3em;
}

.stamp-seal {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 999px;
  padding: 0.32em 0.85em;
  display: inline-block;
  transform: rotate(-5deg);
  box-shadow: inset 0 0 0 2px rgba(176, 38, 47, 0);
  white-space: nowrap;
}

/* ---------- buttons: chunky press pads ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  padding: 0.55em 1em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--ink); }

.btn-primary { background: var(--ink); color: var(--card); }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}
.btn-ghost:hover { box-shadow: 2px 2px 0 var(--ink); background: rgba(255, 253, 245, 0.6); }

.link-btn {
  background: none;
  border: none;
  border-bottom: 2px dotted var(--red);
  color: var(--red);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.5em 0.1em;
}
.link-btn:hover { color: var(--red-deep); }

/* ---------- chips & tags (little printed labels) ---------- */

.chips-row { display: flex; flex-wrap: wrap; gap: 0.45em; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  background: var(--card);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  padding: 0.18em 0.6em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
  white-space: nowrap;
}
.chip-green { border-color: var(--green); color: var(--green); background: rgba(47, 125, 77, 0.06); }
.chip-red { border-color: var(--red); color: var(--red); background: rgba(176, 38, 47, 0.06); }

.badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
  border: 1px dotted var(--ink-soft);
  border-radius: 2px;
  padding: 0.12em 0.5em;
  background: rgba(227, 160, 19, 0.14);
}

/* ---------- auth page ---------- */

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.4rem 1rem;
  min-height: 100vh;
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 0;
  box-shadow: var(--shadow);
  padding: 1.4rem 1.6rem 1.5rem;
  position: relative;
}
.auth-card::after {
  content: "";
  position: absolute;
  right: 0.9rem;
  bottom: 0.55rem;
  width: 46px;
  height: 20px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 5px);
  opacity: 0.16;
  pointer-events: none;
}
.auth-card h1 { font-size: 1.7rem; margin-top: 0.9rem; }
.auth-card form { display: flex; flex-direction: column; gap: 0.1rem; margin-top: 0.7rem; }
.auth-card label { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); margin-top: 0.7rem; }

.auth-card input, .text-input {
  width: 100%;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 0.6em 0.8em;
  font-size: 1rem;
  margin-top: 0.3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}
.auth-card input:focus, .text-input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 3px 3px 0 rgba(176, 38, 47, 0.55);
}

.error-box {
  border: 2px solid var(--red);
  background: rgba(176, 38, 47, 0.07);
  color: var(--red-deep);
  padding: 0.5em 0.8em;
  font-size: 0.9rem;
  margin-top: 0.8rem;
  border-radius: var(--radius);
}
.auth-foot {
  font-size: 0.72rem;
  margin-top: 1.7rem;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

.tabs-auth { margin-bottom: 0.2rem; }

/* ---------- app shell ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.4rem;
  background: var(--paper);
  border-bottom: 4px double var(--ink);
}
.topbar-right { display: flex; align-items: center; gap: 0.7rem; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }

/* ---------- panels: filed sheets of paper ---------- */

.panel {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 rgba(36, 29, 20, 0.85);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.3rem;
  position: relative;
}
.panel-row { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.panel-half { flex: 1 1 340px; min-width: 0; }
.panel-full { flex: 1 1 100%; }
.section-title {
  margin: 1.8rem 0 0.8rem;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom: 3px double var(--ink);
  padding-bottom: 0.3rem;
}

/* ---------- upload ---------- */

.dropzone {
  margin: 0.8rem 0;
  border: 3px dashed var(--ink);
  border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, rgba(36, 29, 20, 0.02) 0 10px, transparent 10px 20px);
  padding: 1.7rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dropzone:hover, .dropzone.dragging { border-color: var(--red); background: rgba(176, 38, 47, 0.05); }
.drop-icon { font-size: 1.9rem; filter: grayscale(0.3) sepia(0.3); }
#upload-btn {
  color: var(--red);
  border-bottom: 2px dotted var(--red);
  cursor: pointer;
}
.example-line { font-size: 0.78rem; }
.status { color: var(--red); font-weight: 700; margin-top: 0.5rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; font-size: 0.8rem; }
.privacy-note {
  font-size: 0.82rem;
  margin-top: 0.8rem;
  border: 1px dashed var(--line);
  padding: 0.5em 0.7em;
}

/* ---------- empty & loading ---------- */

.empty {
  border: 2px dashed var(--ink-soft);
  background: var(--card2);
  padding: 1.6rem;
  text-align: center;
  color: var(--ink-soft);
  margin: 0.6rem 0;
  font-style: italic;
}
.loading {
  padding: 3rem;
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
}
.loading::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--line);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.7em;
  vertical-align: -6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.app-body.uploading::after, .app-body.updating::after {
  content: "FILING\u2026";
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--card);
  background: rgba(36, 29, 20, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  inset: 0;
  z-index: 50;
}

/* ---------- chat cards: ticket stubs ---------- */

.chats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.1rem;
}
.chat-card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: relative;
}
/* punched holes down the left edge */
.chat-card::before, .chat-card::after {
  content: "";
  position: absolute;
  left: -7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
}
.chat-card::before { top: 24px; }
.chat-card::after { bottom: 24px; }
.chat-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 0.5rem;
}
.chat-card-head h3 { font-size: 1.15rem; margin: 0; font-weight: 700; }
.chat-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}
.chat-card-actions { display: flex; gap: 0.6rem; margin-top: 0.2rem; }

/* ---------- chat view ---------- */

#chat-view { padding-top: 0.4rem; }
.chat-head h1 {
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1.15;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.5rem;
  margin-bottom: 0.7rem;
}
.update-row { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.7rem; flex-wrap: wrap; }

/* file-folder tabs */
.tabs {
  display: flex;
  gap: 0.35rem;
  margin: 1.1rem 0 1rem;
  border-bottom: 2px solid var(--ink);
  overflow-x: auto;
  align-items: flex-end;
}
.tab-btn {
  background: transparent;
  border: 2px solid transparent;
  border-bottom: none;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.5em 1em;
  cursor: pointer;
  margin-bottom: -2px;
}
.tab-btn.active {
  color: var(--card);
  background: var(--ink);
  border-color: var(--ink);
  margin-bottom: -2px;
}
.tab-panel { padding: 0.4rem 0 1rem; }

/* ---------- headlines: tabloid subheads ---------- */

.headlines {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  list-style: none;
  padding: 0.7rem 0.8rem;
  margin: 0 0 1.2rem;
  border: 2px solid var(--ink);
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
}
.headlines li {
  padding-left: 0.7em;
  border-left: 4px solid var(--red);
  font-size: 1rem;
  color: var(--ink);
}
.headlines li::before { content: "\u25c6 "; color: var(--red); font-size: 0.7em; }

/* ---------- filter chips ---------- */

.filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.chip-btn {
  border: 2px solid var(--ink);
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 0.4em 0.8em;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 2px 2px 0 var(--ink);
}
.chip-btn:hover { transform: translate(-1px, -1px); }
.chip-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.chip-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: var(--card);
  transform: rotate(-1.5deg);
}

/* ---------- receipts: evidence slips ---------- */

.receipt {
  border: 2px solid var(--ink);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 rgba(36, 29, 20, 0.8);
  padding: 0.85rem 1rem;
  margin-bottom: 0.9rem;
  position: relative;
}
/* torn side edge */
.receipt::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 9px;
  width: 8px;
  border-left: 1px dashed var(--ink-soft);
  opacity: 0.35;
}
.receipt-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.receipt-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink);
  border: 2px solid currentColor;
  padding: 0.15em 0.55em;
  transform: rotate(-2deg);
  display: inline-block;
  background: var(--card);
}
.receipt-who { font-size: 0.82rem; color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; }
.receipt blockquote {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 1rem;
  border-left: 3px solid var(--line);
  padding-left: 0.8em;
}
.rec-spicy .receipt-tag { color: var(--red); border-color: var(--red); }
.rec-wholesome .receipt-tag { color: var(--teal); border-color: var(--teal); }
.rec-apology .receipt-tag { color: #8a5a00; border-color: #8a5a00; }
.rec-unhinged .receipt-tag { color: var(--ink); border-color: var(--ink); transform: rotate(-5deg) scale(1.05); }
.rec-read .receipt-tag { color: var(--red); border-color: var(--red); }
.rec-read { background: repeating-linear-gradient(0deg, rgba(176, 38, 47, 0.02) 0 2px, transparent 2px 14px); }
.rec-read blockquote { margin-top: 0.5em; }

/* ---------- breakdown: tiles & charts (ledger ink) ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}
.tile {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 0.7rem 0.9rem;
  position: relative;
  overflow: hidden;
}
.tile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: var(--red);
  opacity: 0.85;
}
.tile-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  letter-spacing: -0.02em;
}
.tile-label {
  font-size: 0.62rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-weight: 700;
}

.hbar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  margin-top: 0.7rem;
  padding: 0.5rem 0.4rem 0;
  border-bottom: 2px solid var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(36, 29, 20, 0.06) 27px 28px);
}
.hbar {
  flex: 1;
  min-width: 4px;
  background: var(--ink);
  border-radius: 1px 1px 0 0;
}
.hour-axis {
  display: flex;
  justify-content: space-between;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.62rem;
  margin-top: 0.3rem;
}

.vbar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  margin-top: 0.7rem;
  padding: 0.5rem 0.4rem 0;
  border-bottom: 2px solid var(--ink);
}
.vbar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.66rem;
  color: var(--ink-soft);
}
.vbar {
  width: 100%;
  max-width: 36px;
  background: repeating-linear-gradient(180deg, var(--teal) 0 4px, transparent 4px 8px);
  border: 1px solid var(--ink);
  border-bottom: none;
}

.spark-row { margin-top: 1.1rem; }
.spark {
  width: 100%;
  height: 90px;
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.chip-cloud { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: baseline; padding-top: 0.3rem; }
.word-chip {
  font-family: Georgia, "Times New Roman", serif;
  border-bottom: 1px solid var(--line);
  padding: 0.05em 0.15em;
  color: var(--ink);
}
.emoji-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0.2em 0.5em;
  font-size: 1.2rem;
}
.emoji-chip small { color: var(--ink-soft); font-size: 0.66rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; }

/* ---------- people ---------- */

.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.person-card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 0.9rem 1rem;
}
.person-head { display: flex; align-items: center; gap: 0.55em; flex-wrap: wrap; border-bottom: 1px dashed var(--line); padding-bottom: 0.5em; }
.person-head h3 { margin: 0; font-size: 1.2rem; }
.person-sub { color: var(--ink-soft); font-size: 0.72rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; }
.dot { width: 13px; height: 13px; border-radius: 50%; display: inline-block; flex: none; border: 1px solid var(--ink); }
.badges { display: flex; flex-wrap: wrap; gap: 0.4em; margin: 0.55rem 0 0.5rem; }

.meter-row { display: flex; align-items: center; gap: 0.55em; margin: 0.35rem 0; font-size: 0.78rem; }
.meter-label { flex: 0 0 96px; color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.64rem; }
.meter { flex: 1; height: 12px; background: repeating-linear-gradient(90deg, rgba(36, 29, 20, 0.12) 0 2px, transparent 2px 6px); border: 1px solid var(--ink); }
.meter-fill { height: 100%; }
.meter-value { flex: 0 0 40px; text-align: right; color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; font-size: 0.72rem; }

.person-stats {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin-top: 0.55rem;
  font-size: 0.88rem;
}
.mini-emojis { font-size: 1.05rem; }

/* ---------- comparisons: head to head ledger ---------- */

.vs { display: flex; flex-direction: column; gap: 0.85rem; }
.vs-row { display: grid; grid-template-columns: 210px 1fr; gap: 0.8rem; align-items: center; }
.vs-label { color: var(--ink-soft); font-size: 0.78rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.vs-bars { display: flex; flex-direction: column; gap: 0.35rem; }
.vs-line { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; }
.vs-name { flex: 0 0 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; }
.vs-track { flex: 1; height: 14px; background: repeating-linear-gradient(90deg, rgba(36, 29, 20, 0.1) 0 2px, transparent 2px 6px); border: 1px solid var(--ink); }
.vs-fill { height: 100%; }
.vs-val { flex: 0 0 72px; text-align: right; color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; font-size: 0.76rem; }

.plain-list { margin: 0.3rem 0; padding-left: 1.2em; font-size: 0.95rem; }
.plain-list li { margin: 0.3rem 0; }

/* ---------- transcript: the typewritten printout ---------- */

.search-row { display: flex; gap: 0.6rem; margin: 0.7rem 0; }
.search-row input {
  flex: 1;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 0.6em 0.9em;
  font-size: 0.95rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}
.search-row input:focus { outline: none; border-color: var(--red); box-shadow: 3px 3px 0 rgba(176, 38, 47, 0.55); }
.search-count { color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.7rem; }

.msg-line {
  border-bottom: 1px dotted var(--line);
  padding: 0.45rem 0.7rem;
}
.msg-head { font-size: 0.68rem; color: var(--ink-soft); display: flex; gap: 0.5em; align-items: center; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; text-transform: uppercase; letter-spacing: 0.04em; }
.msg-body { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; font-size: 0.9rem; }
.sys-line { text-align: center; color: var(--ink-soft); font-size: 0.78rem; font-style: italic; padding: 0.6rem; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); margin: 0.4rem 0; }
.media-tag {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 2px;
  padding: 0 0.35em;
  font-weight: 700;
}

.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.3rem; }
.pager-info { color: var(--ink-soft); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; font-size: 0.78rem; }

/* ---------- privacy ---------- */

.privacy-hero h2 { font-size: 1.3rem; }
.privacy-hero.muted {
  background: rgba(227, 160, 19, 0.08);
  border-style: double;
}
.samples { display: flex; flex-direction: column; gap: 0.7rem; }
.sample {
  border: 1px solid var(--ink);
  background: #fff;
  padding: 0.55rem 0.8rem;
}
.sample-cat {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--red);
  font-weight: 700;
  margin-bottom: 0.3em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}
.sample code { background: none; border: none; color: var(--ink); white-space: pre-wrap; word-break: break-word; font-size: 0.85rem; }

/* ---------- toasts: taped-on notes ---------- */

#toasts {
  position: fixed;
  bottom: 1.2rem;
  right: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 100;
  max-width: min(380px, calc(100vw - 2rem));
}
.toast {
  background: var(--card);
  border: 2px solid var(--ink);
  border-left: 6px solid var(--green);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 0.65em 1em;
  font-size: 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  animation: slidein 0.2s ease;
  word-break: break-word;
  transform: rotate(-0.5deg);
}
.toast-err { border-left-color: var(--red); }
.toast.out { opacity: 0; transform: translateX(10px); transition: all 0.4s ease; }
@keyframes slidein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- paywall: locked chat ---------- */

.locked-panel { position: relative; }
.locked-panel .stamp-seal { position: absolute; top: 1.1rem; right: 1.1rem; transform: rotate(6deg); }

.teaser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.7rem;
  margin: 1rem 0;
}
.teaser-stat {
  border: 2px solid var(--ink);
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
  padding: 0.55rem 0.7rem;
  display: flex;
  flex-direction: column;
}
.teaser-stat b { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace; font-size: 1.4rem; }
.teaser-stat span {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-weight: 700;
}
.teaser-blur {
  filter: blur(7px);
  opacity: 0.55;
  border: 2px dashed var(--line);
  padding: 0.8rem 1rem;
  margin: 0.6rem 0 1rem;
}
.blur-line { height: 12px; background: var(--ink); opacity: 0.25; margin: 0.55rem 0; }
.blur-line:nth-child(2n) { width: 72%; }
.blur-line:nth-child(3n) { width: 88%; }

.pack-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 0.8rem;
  margin: 0.9rem 0;
}
.pack-card {
  border: 2px solid var(--ink);
  background: var(--card);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: inherit;
  text-align: left;
  color: var(--ink);
}
.pack-card:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.pack-card:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--ink); }
.pack-credits {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
}
.pack-price { font-size: 1.6rem; font-weight: 700; color: var(--red); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(36, 29, 20, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 1rem;
}
.modal {
  background: var(--card);
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 1.3rem 1.4rem;
  max-width: 520px;
  width: 100%;
}

@media (max-width: 640px) {
  .vs-row { grid-template-columns: 1fr; }
  .auth-card { padding: 1.2rem 1rem 1.1rem; }
  .auth-card::after { right: 0.6rem; }
  .doc-bar { margin: -1.2rem -1rem 1.1rem; }
  .topbar { padding: 0.55rem 0.8rem; }
  .wrap { padding: 1rem 0.7rem 3rem; }
}
