/* this person — local stylesheet. No external fonts, no remote assets.
   Severe, monochrome, infrastructural. System monospace throughout. */

:root {
  --paper: #f4f3f0;
  --ink: #0c0c0c;
  --ink-soft: #46463f;
  --ink-faint: #8b8a82;
  --rule: #c6c4bb;
  --field: #ffffff;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas,
    "Liberation Mono", "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a0a0b;
    --ink: #ededea;
    --ink-soft: #a8a8a2;
    --ink-faint: #6c6c66;
    --rule: #2f2f2b;
    --field: #141415;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ol, ul { margin: 0; }
a { color: var(--ink); }
img, canvas, iframe { max-width: 100%; }

/* ─── topbar ────────────────────────────────────────────────────────────────*/

.topbar {
  border-bottom: 1px solid var(--rule);
  padding: 12px 18px;
}

.wordmark {
  text-decoration: none;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-faint);
}

.stage {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 4vh, 44px) 18px 72px;
}

/* ─── actions ───────────────────────────────────────────────────────────────*/

.action {
  appearance: none;
  display: inline-block;
  max-width: 100%;
  font: inherit;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-decoration: none;
  text-transform: lowercase;
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--ink);
  padding: 0.7em 1.2em;
  cursor: pointer;
  overflow-wrap: anywhere;
  white-space: normal;
}

.action:hover,
.action:focus-visible {
  background: var(--ink);
  color: var(--paper);
  outline: none;
}

.action--primary { background: var(--ink); color: var(--paper); }
.action--primary:hover,
.action--primary:focus-visible { background: var(--field); color: var(--ink); }

.action--quiet { border-color: var(--rule); color: var(--ink-soft); }
.action--danger { border-style: dashed; }
.action--large { font-size: 1rem; padding: 0.95em 1.8em; }
.action--link {
  display: inline;
  border: none;
  background: none;
  padding: 0;
  width: auto;
  font-size: inherit;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.action--link:hover,
.action--link:focus-visible { background: none; color: var(--ink-soft); }
.action:disabled { opacity: 0.4; cursor: not-allowed; }
.action:disabled:hover { background: var(--field); color: var(--ink); }
.action--primary:disabled:hover { background: var(--ink); color: var(--paper); }

/* ─── hero (landing) ────────────────────────────────────────────────────────*/

.hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: clamp(20px, 8vh, 96px);
}

.hero__returned {
  border: 1px solid var(--ink);
  padding: 10px 14px;
  font-size: 0.86rem;
}

.hero__title {
  font-size: clamp(2.8rem, 11vw, 5.2rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.hero__core { font-size: clamp(1.1rem, 3.4vw, 1.5rem); line-height: 1.4; }

.hero__secondary {
  letter-spacing: 0.2em;
  font-size: 0.74rem;
  color: var(--ink-faint);
}

.hero__link {
  font-size: 0.8rem;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--ink-faint);
  text-decoration: none;
  align-self: flex-start;
}
.hero__link:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* ─── chamber ───────────────────────────────────────────────────────────────*/

.chamber-panel,
.flow-panel {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.chamber-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  list-style: none;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--rule);
}

.chamber-step {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.chamber-step__n {
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: 1px 5px;
  font-weight: 700;
}

.chamber-step.is-active { color: var(--ink); }
.chamber-step.is-active .chamber-step__n { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.chamber-step.is-done { color: var(--ink-soft); }

.flow-title { font-size: 1.5rem; font-weight: 700; }
.flow-text { font-size: 0.94rem; color: var(--ink-soft); }
.flow-text--small { font-size: 0.8rem; color: var(--ink-faint); }
.flow-working { font-size: 1.05rem; color: var(--ink); }

.flow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  min-width: 0;
}
.flow-actions--stacked { flex-direction: column; align-items: stretch; }

.flow-done-id {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

body.is-reviewing {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

body.is-reviewing .stage {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: none;
  height: auto;
  padding: 16px 18px;
  overflow: hidden;
}

.review-layout {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px 18px;
  overflow: hidden;
}

.review-layout > .chamber-steps {
  grid-column: 1 / -1;
  margin: 0;
}

.review-header {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  align-items: center;
}

.review-header .flow-text {
  max-width: 64ch;
}

.review-column {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding-right: 2px;
}

.review-layout--collecting {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.review-layout--collecting .review-column--secondary { display: none; }

.diagnostics {
  border: 1px solid var(--rule);
  background: var(--field);
}
.diagnostics__summary {
  cursor: pointer;
  padding: 9px 12px;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}
.diagnostics__body {
  border-top: 1px solid var(--rule);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.diagnostics__section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.diagnostics__title {
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.diagnostics .flow-title {
  font-size: 0.9rem;
}
.diagnostics .flow-text,
.diagnostics .flow-text--small,
.diagnostics .fragment__value {
  font-size: 0.78rem;
}

/* ─── method selection ──────────────────────────────────────────────────────*/

.method-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.method {
  appearance: none;
  font: inherit;
  text-align: left;
  background: var(--field);
  border: 1.5px solid var(--ink);
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.method:hover,
.method:focus-visible { background: var(--ink); color: var(--paper); outline: none; }
.method:hover .method__note,
.method:focus-visible .method__note { color: var(--paper); }

.method__label { font-size: 1rem; font-weight: 700; }
.method__note { font-size: 0.8rem; color: var(--ink-faint); }

/* ─── inputs ────────────────────────────────────────────────────────────────*/

.flow-textarea {
  font: inherit;
  font-size: 0.88rem;
  background: var(--field);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 10px 12px;
  resize: vertical;
  min-height: 8em;
}
.flow-textarea--tall { min-height: 16em; }
.flow-textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

.file-label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  border: 1.5px dashed var(--ink);
  padding: 16px;
  background: var(--field);
}
.file-label__text {
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  font-weight: 700;
}
.file-input { font: inherit; font-size: 0.8rem; }

.thumb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.thumb {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border: 1px solid var(--rule);
}

.capture-preview { margin: 4px 0; }
.capture-video {
  width: 100%;
  max-height: 320px;
  background: #000;
  border: 1.5px solid var(--ink);
  display: block;
}

/* ─── fragment review ───────────────────────────────────────────────────────*/

.fragment-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
}

.fragment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.fragment:last-child { border-bottom: none; }
.fragment__check { width: 16px; height: 16px; flex: none; accent-color: var(--ink); }
.fragment__value { flex: 1; font-size: 0.9rem; overflow-wrap: anywhere; }
.fragment__kind {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ─── google data portability candidates ───────────────────────────────────*/

.google-candidate-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  margin: 12px 0;
}
.google-candidate {
  padding: 11px 13px;
  border-bottom: 1px solid var(--rule);
}
.google-candidate:last-child { border-bottom: none; }
.google-candidate__label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.google-candidate__check { width: 16px; height: 16px; flex: none; accent-color: var(--ink); }
.google-candidate__claim { flex: 1; font-size: 0.95rem; overflow-wrap: anywhere; }
.google-candidate .flow-text--small { margin: 5px 0 0 26px; }

/* ─── entry / claim ─────────────────────────────────────────────────────────*/

.entry {
  border: 1px solid var(--rule);
  background: var(--field);
  padding: 16px 18px 18px;
  break-inside: avoid;
  min-width: 0;
}
.entry--preview { border-color: var(--ink); }

.entry__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 9px;
  margin-bottom: 12px;
}
.entry__id { font-weight: 700; letter-spacing: 0.07em; }
.entry__source {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow-wrap: anywhere;
}

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

.entry__snapshot {
  margin: 0 0 13px;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.entry__snapshot-img {
  display: block;
  width: 100%;
  height: auto;
}
.entry__snapshot-caption {
  border-top: 1px solid var(--rule);
  padding: 6px 8px;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}

.claim { border-left: 2px solid var(--rule); padding-left: 11px; }
.claim--contradictory { border-left-color: var(--ink); }
.claim--institutional { border-left-style: dashed; }

.claim__sentence { font-size: 0.98rem; line-height: 1.4; overflow-wrap: anywhere; }
.claim__source {
  font-size: 0.7rem;
  color: var(--ink-faint);
  margin-top: 2px;
}

.entry__claims--editable .claim {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.claim__body { flex: 1; }
.claim__remove {
  appearance: none;
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  background: none;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  cursor: pointer;
  padding: 2px 8px;
  flex: none;
}
.claim__remove:hover { background: var(--ink); color: var(--paper); }

.entry__status {
  margin-top: 12px;
  font-size: 0.74rem;
  border-top: 1px solid var(--rule);
  padding-top: 8px;
}
.entry__summary,
.entry__time {
  margin-top: 10px;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}

/* ─── repository wall ───────────────────────────────────────────────────────*/

.page-wall { padding-bottom: 250px; }

.wall-masthead {
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
  padding: 22px 26px 18px;
}
.wall-masthead__title {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1;
}
.wall-masthead__subtitle {
  letter-spacing: 0.28em;
  font-size: clamp(0.66rem, 1.3vw, 0.9rem);
  color: var(--ink-faint);
  margin-top: 6px;
}
.wall-masthead__line {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 8px;
}
body.is-paused .wall-masthead__line::after {
  content: "  —  paused";
  color: var(--ink-faint);
}

.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
  gap: 16px;
  padding: 24px;
  align-content: start;
}
.wall:empty::after {
  content: "the repository is empty. no one has chosen extraction yet.";
  color: var(--ink-faint);
  font-size: 0.85rem;
  grid-column: 1 / -1;
  padding: 30px 4px;
}

.wall-qr {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: var(--field);
  border: 2px solid var(--ink);
  padding: 15px 15px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 236px;
  z-index: 20;
  max-width: calc(100vw - 44px);
  min-width: 0;
}
.wall-qr__label {
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-align: center;
}
.wall-qr__canvas {
  width: min(196px, 100%);
  height: auto;
  display: block;
}
.wall-qr__url {
  font-size: 0.6rem;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
  text-align: center;
  max-width: 100%;
}
.wall-qr__meta,
.wall-qr__mix {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-align: center;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.kiosk .wall-qr__meta,
.kiosk .wall-qr__mix { display: none; }
.kiosk .topbar { display: none; }
.kiosk { cursor: none; }

/* ─── gallery ───────────────────────────────────────────────────────────────*/

.gallery {
  width: min(640px, 100%);
  margin: 0 auto;
  padding: 36px 20px 72px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.gallery__title { font-size: 1.8rem; font-weight: 700; }
.gallery__lead { font-size: 0.95rem; color: var(--ink-soft); }
.gallery__block {
  border: 1px solid var(--rule);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gallery__heading {
  letter-spacing: 0.16em;
  font-size: 0.8rem;
}
.gallery__text { font-size: 0.86rem; color: var(--ink-soft); }
.gallery__links { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.gallery__qr {
  width: min(240px, 100%);
  height: auto;
  align-self: center;
}
.gallery__url {
  font-size: 0.66rem;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
  text-align: center;
  max-width: 100%;
}

/* ─── admin ─────────────────────────────────────────────────────────────────*/

.admin {
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 36px 20px 72px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.admin__title {
  font-size: 1.6rem;
  font-weight: 700;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 12px;
}
.admin__section {
  display: flex;
  flex-direction: column;
  gap: 11px;
  border: 1px solid var(--rule);
  padding: 18px;
}
.admin__subtitle {
  letter-spacing: 0.16em;
  font-size: 0.8rem;
}
.admin__subtitle--small { font-size: 0.7rem; color: var(--ink-faint); }
.admin__note { font-size: 0.82rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.admin__field { display: flex; flex-direction: column; gap: 5px; }
.admin__label {
  letter-spacing: 0.14em;
  font-size: 0.66rem;
  color: var(--ink-faint);
}
.admin__input {
  font: inherit;
  font-size: 0.9rem;
  background: var(--field);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 9px 11px;
}
.admin__input:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.admin__actions { display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.admin__status { font-size: 0.8rem; min-height: 1.2em; }
.admin__mono { font-size: 0.74rem; overflow-wrap: anywhere; }
.admin__entries { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.admin__entry {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
  min-width: 0;
}
.admin__entry-id { font-weight: 700; }
.admin__entry-source {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}
.admin__entry-claim { color: var(--ink-soft); overflow-wrap: anywhere; }

/* ─── consent modal ─────────────────────────────────────────────────────────*/

.consent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 12, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 80;
}

.consent-dialog {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 24px 26px 22px;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.consent-title {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 12px;
}

.consent-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.92rem;
  line-height: 1.45;
}
.consent-list li { padding-left: 14px; position: relative; }
.consent-list li::before {
  content: "▪";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ink);
}

.consent-list--quiet {
  font-size: 0.82rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}

/* ─── ad slot ───────────────────────────────────────────────────────────────*/

/* Stage used while GPT evaluates the slot, before the live node is adopted
   into the review panel. It stays visible so the request looks like a real
   in-page ad impression instead of hidden inventory. */
.ad-slot-stage {
  display: block;
  max-width: 100%;
  min-width: 0;
}

.ad-slot-frame {
  border: 1.5px solid var(--ink);
  background: var(--field);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 120px;
  overflow: hidden;
  min-width: 0;
}
.ad-slot-frame > div {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

/* Placeholder rendered when GAM is unconfigured, fails, or returns empty fill.
   Echoes the slot's would-be dimensions so the lane is visible at all times. */
.ad-slot-placeholder {
  border: 1.5px dashed var(--rule);
  background: repeating-linear-gradient(
    45deg,
    var(--field),
    var(--field) 8px,
    var(--paper) 8px,
    var(--paper) 16px
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px;
  width: min(100%, var(--ad-slot-width, 300px));
  min-height: min(var(--ad-slot-height, 250px), 70vw);
  max-width: 100%;
  box-sizing: border-box;
}
.ad-slot-placeholder__label {
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}
.ad-slot-placeholder__dim {
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}
.ad-slot-placeholder__note {
  font-size: 0.74rem;
  color: var(--ink-soft);
  text-align: center;
  max-width: 32ch;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* ─── narrow screens ────────────────────────────────────────────────────────*/

@media (max-width: 900px), (orientation: portrait) {
  body.is-reviewing {
    display: block;
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }

  body.is-reviewing .stage {
    width: min(760px, 100%);
    max-width: none;
    min-height: 0;
    padding: 14px 14px 56px;
    overflow: visible;
  }

  .review-layout,
  .review-layout--collecting {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: visible;
  }

  .review-layout > .chamber-steps {
    grid-column: auto;
  }

  .review-header {
    grid-column: auto;
    text-align: left;
    align-items: flex-start;
  }

  .review-column {
    overflow: visible;
    overscroll-behavior: auto;
    padding-right: 0;
  }

  .flow-actions,
  .gallery__links,
  .admin__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .flow-actions .action,
  .gallery__links .action,
  .admin__actions .action {
    width: 100%;
  }

  .flow-actions .action--link {
    width: auto;
    align-self: flex-start;
  }

  .entry__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .entry__source,
  .fragment__kind {
    white-space: normal;
  }

  .google-candidate__label,
  .fragment {
    align-items: flex-start;
  }

  .page-wall { padding-bottom: 16px; }
  .wall { grid-template-columns: 1fr; padding: 14px; }
  .wall-qr {
    position: static;
    width: auto;
    max-width: none;
    margin: 16px;
  }

  .wall-masthead {
    padding: 18px 18px 15px;
  }

  .wall-masthead__subtitle {
    overflow-wrap: anywhere;
  }

  .admin__entry {
    flex-direction: column;
    gap: 2px;
  }

  .consent-dialog { padding: 18px 18px 16px; }
}

.kiosk.page-wall { padding-bottom: 16px; }
.kiosk .wall { grid-template-columns: 1fr; padding: 14px; }
.kiosk .wall-qr {
  position: static;
  width: auto;
  max-width: none;
  margin: 16px;
}
