/* ================================================================
   FounderOS — house style of The Financier Review
   ================================================================ */

:root {
  --bg: #FAF5EA;            --bg-alt: #F2EBDB;        --bg-panel: #FDFAF3;
  --ink: #211B14;           --text: #40372B;          --meta: #7C7160;
  --hairline: #E0D5BE;
  --oxblood: #7B2D26;       --blue: #22406B;
  --highlight: #DCE6F2;     --warn-wash: #F3E2DD;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Newsreader", Georgia, serif;
  --font-ui: "Inter", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* The hidden attribute must always win over id-level display rules
   (e.g. #blocked { display:flex }), so screens toggled via [hidden] stay hidden. */
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font: 400 18px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); }
a { color: var(--oxblood); text-underline-offset: 3px; }
a:hover { color: var(--blue); }
mark { background: var(--highlight); color: inherit; padding: 0 1px; }
::selection { background: var(--highlight); }
table, .stat { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

button { cursor: pointer; }

.smallcaps {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--meta);
}

.rule-double {
  height: 6px;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.rule-thin { border-top: 1px solid var(--hairline); }

/* ================= ACCESS GATE ================= */

#gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(ellipse 90% 60% at 50% 0%, var(--bg-panel), transparent),
    var(--bg);
}

.gate-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  padding: 48px 44px 36px;
  text-align: center;
  box-shadow: 0 1px 0 var(--hairline), 0 12px 40px rgba(33, 27, 20, .06);
}

.gate-eyebrow { display: block; margin-bottom: 18px; }

.gate-wordmark {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin-bottom: 18px;
}
.gate-wordmark span { color: var(--oxblood); font-style: italic; font-weight: 600; }

.gate-card .rule-double { margin: 0 40px 22px; }

.gate-lede {
  font-style: italic;
  font-size: 17px;
  color: var(--text);
  margin-bottom: 30px;
}

#gateForm, #codeForm, #pwForm { display: flex; flex-direction: column; gap: 10px; text-align: left; }
#gateForm label, #codeForm label, #pwForm label { margin-bottom: -2px; }
#confirmWrap { display: flex; flex-direction: column; gap: 10px; }

#accessKey, #code, #password, #confirm {
  font: 500 16px/1 var(--font-mono);
  letter-spacing: .12em;
  padding: 13px 14px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  color: var(--ink);
  outline: none;
}
#accessKey:focus, #code:focus, #password:focus, #confirm:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--highlight); }

#gateForm button, #codeForm button[type="submit"], #pwForm button[type="submit"] {
  margin-top: 8px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--oxblood);
  border: none;
  padding: 14px;
  transition: background .15s ease;
}
#gateForm button:hover, #codeForm button:hover, #pwForm button:hover { background: var(--blue); }
#gateForm button:disabled, #codeForm button:disabled, #pwForm button:disabled { background: var(--hairline); color: var(--meta); cursor: not-allowed; }
#gateForm button:disabled:hover, #codeForm button:disabled:hover, #pwForm button:disabled:hover { background: var(--hairline); }

.gate-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 4px;
  text-align: left;
  font: 400 12.5px/1.5 var(--font-body);
  color: var(--meta);
}
.gate-consent input[type="checkbox"] {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--oxblood);
  cursor: pointer;
}
.gate-consent b { color: var(--text); font-weight: 600; }

.gate-error {
  font-size: 15px;
  font-style: italic;
  background: var(--warn-wash);
  border: 1px solid var(--hairline);
  padding: 10px 12px;
  color: var(--ink);
}

.gate-shake { animation: shake .35s ease; }
@keyframes shake {
  20% { transform: translateX(-6px); } 40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(3px); }
}

.gate-foot { margin-top: 28px; opacity: .8; }

/* ================= MASTHEAD ================= */

#app { max-width: 1140px; margin: 0 auto; padding: 26px 28px 60px; }

.mast-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hairline);
  padding: 7px 2px;
  margin-bottom: 34px;
}
.mast-top a { text-decoration: none; }
.mast-top a:hover { color: var(--oxblood); text-decoration: underline; }
.mast-note { letter-spacing: .22em; }
.mast-right { display: inline-flex; gap: 20px; }

/* ================= ABOUT / COLOPHON ================= */

/* hide the research surfaces while the colophon is open */
#app.viewing-about .search-block,
#app.viewing-about #status,
#app.viewing-about #chooser,
#app.viewing-about #results { display: none !important; }

#about { max-width: 620px; margin: 30px auto 0; }

.back-link {
  background: none;
  border: none;
  color: var(--meta);
  padding: 6px 0;
  cursor: pointer;
}
.back-link:hover { color: var(--oxblood); }

.about-sheet {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  padding: 46px 48px 34px;
  text-align: center;
  margin-top: 12px;
  box-shadow: 0 1px 0 var(--hairline), 0 12px 40px rgba(33, 27, 20, .05);
}
.about-eyebrow { display: block; margin-bottom: 18px; }
.about-word {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin-bottom: 18px;
}
.about-word span { color: var(--oxblood); font-style: italic; font-weight: 600; }
.about-sheet .rule-double { margin: 0 30px 26px; }
.about-body { text-align: left; }
.about-body p { font-size: 17px; margin-bottom: 15px; }
.about-body p:last-child { margin-bottom: 0; }
.about-foot {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  line-height: 1.7;
  opacity: .85;
}

.masthead { text-align: center; }

.wordmark {
  font-size: clamp(56px, 8vw, 92px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.wordmark span { color: var(--oxblood); font-style: italic; font-weight: 600; }

.tagline { display: none; }

/* ================= SEARCH ================= */

.search-block { max-width: 760px; margin: 44px auto 8px; }

#searchForm { display: flex; border: 1px solid var(--ink); background: var(--bg-panel); }
#q {
  flex: 1;
  font: 400 19px/1.4 var(--font-body);
  font-style: italic;
  color: var(--ink);
  padding: 16px 20px;
  background: transparent;
  border: none;
  outline: none;
  min-width: 0;
}
#q::placeholder { color: var(--meta); opacity: .85; }
#searchForm:focus-within { box-shadow: 0 0 0 3px var(--highlight); }

#searchForm button {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--oxblood);
  border: none;
  padding: 0 30px;
  transition: background .15s ease;
}
#searchForm button:hover { background: var(--blue); }

.recents {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
  min-height: 28px;
}
.recents .chip {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  background: var(--bg-alt);
  border: 1px solid var(--hairline);
  padding: 5px 12px;
  border-radius: 999px;
}
.recents .chip:hover { border-color: var(--oxblood); color: var(--oxblood); }
.recents .chip-label { align-self: center; }

/* ================= STATUS ================= */

#status { max-width: 760px; margin: 30px auto; text-align: center; }

.consulting {
  font-style: italic;
  font-size: 19px;
  color: var(--meta);
}
.consulting .dots span { animation: blink 1.4s infinite both; }
.consulting .dots span:nth-child(2) { animation-delay: .2s; }
.consulting .dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .15; } 40% { opacity: 1; } }

.status-warn {
  font-style: italic;
  background: var(--warn-wash);
  border: 1px solid var(--hairline);
  padding: 14px 18px;
}

/* ================= DISAMBIGUATION CHOOSER ================= */

#chooser { max-width: 780px; margin: 40px auto 0; }
#chooser .sec .num { font-style: normal; }

.choices { list-style: none; counter-reset: choice; margin-top: 18px; }

.choices li {
  counter-increment: choice;
  border-bottom: 1px solid var(--hairline);
}
.choices a {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  padding: 15px 6px;
  text-decoration: none;
  color: var(--text);
}
.choices a:hover { background: var(--bg-panel); }
.choices a::before {
  content: counter(choice, upper-roman) ".";
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--meta);
  padding-top: 5px;
  text-align: right;
}
.choices .ctitle {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--oxblood);
  line-height: 1.3;
}
.choices a:hover .ctitle { color: var(--blue); text-decoration: underline; }
.choices .cdesc { font-size: 15.5px; color: var(--meta); margin-top: 2px; }

.choice-escape { margin-top: 22px; font-style: italic; font-size: 16px; }

/* ================= RESULTS ================= */

#results { margin-top: 34px; }

.results-head {
  text-align: center;
  font-style: italic;
  font-size: 17px;
  color: var(--meta);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 10px 0;
  margin-bottom: 0;
}
.results-head b { color: var(--ink); font-weight: 600; }
.results-head .stat { font-size: 15px; }

/* subject › refinement breadcrumb */
.crumb {
  display: block;
  font-family: var(--font-ui);
  font-style: normal;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--meta);
  margin-bottom: 5px;
}
.crumb .subj { color: var(--ink); font-weight: 600; }
.crumb .sep { color: var(--oxblood); margin: 0 7px; }
.crumb .refi { color: var(--oxblood); font-weight: 600; }
.crumb .drop {
  color: var(--meta);
  text-decoration: none;
  margin-left: 7px;
  font-size: 14px;
  line-height: 1;
}
.crumb .drop:hover { color: var(--oxblood); }

/* ================= SECONDARY RESEARCH ================= */

.refine-bar { margin: 0 0 22px; padding: 12px 0 0; text-align: center; }

/* main topics — the facets of a theme, drawn from its article outline */
.main-topics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 38px;
  max-width: 900px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hairline);
}
.mt-label { margin-right: 4px; }
.mt-chip {
  font-family: var(--font-ui);
  font-size: 12.5px;
  color: var(--text);
  text-decoration: none;
  background: var(--bg-alt);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 5px 13px;
  transition: border-color .12s, color .12s;
}
.mt-chip:hover { border-color: var(--oxblood); color: var(--oxblood); }

#refineForm {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
#refineForm label { white-space: nowrap; }

#refineInput {
  font: 400 16px/1.4 var(--font-body);
  font-style: italic;
  color: var(--ink);
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  padding: 9px 13px;
  width: 340px;
  max-width: 60vw;
  outline: none;
}
#refineInput::placeholder { color: var(--meta); opacity: .8; }
#refineInput:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--highlight); }

#refineForm button {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--ink);
  border: none;
  padding: 10px 18px;
  transition: background .15s ease;
}
#refineForm button:hover { background: var(--oxblood); }

/* Reference shelf leads (left); academic literature sits to its right. */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: 0 44px;
}
.papers { border-left: 1px solid var(--hairline); padding-left: 44px; }

.sec {
  font-size: 26px;
  font-weight: 700;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.sec .num { color: var(--oxblood); font-style: italic; font-weight: 600; margin-right: 6px; }

.sec-note { font-style: italic; color: var(--meta); font-size: 16px; margin: 10px 0 6px; }

/* ---- papers ---- */

.sortbar { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.sortbar a { text-decoration: none; color: var(--meta); }
.sortbar a:hover { color: var(--blue); }
.sortbar a.on { color: var(--oxblood); border-bottom: 2px solid var(--oxblood); padding-bottom: 2px; }

.papers-list { list-style: none; counter-reset: paper; }

.paper {
  counter-increment: paper;
  position: relative;
  padding: 20px 0 20px 44px;
  border-bottom: 1px solid var(--hairline);
}
.paper::before {
  content: counter(paper, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--meta);
}

.paper-title {
  font-family: var(--font-display);
  font-size: 19.5px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}
.paper-title:hover { text-decoration: underline; }

.paper-meta { font-size: 15px; color: var(--meta); margin-top: 5px; }
.paper-meta .venue { font-style: italic; }
.paper-meta .stat { font-size: 13.5px; color: var(--text); }

.paper-abstract {
  font-size: 15.5px;
  margin-top: 8px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 4;          /* the literature column is now the narrower one */
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.oa-badge {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--highlight);
  color: var(--blue);
  padding: 2px 7px;
  border-radius: 3px;
  text-decoration: none;
  margin-left: 8px;
  vertical-align: 2px;
}
.oa-badge:hover { background: var(--blue); color: var(--bg); }

/* ---- reference shelf ---- */

.wiki-feature {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  padding: 20px 22px;
  margin: 22px 0 6px;
}
.wiki-feature h3 { font-size: 21px; margin-bottom: 2px; }
.wiki-feature h3 a { text-decoration: none; }
.wiki-feature h3 a:hover { text-decoration: underline; }
.wiki-feature .wf-desc { display: block; margin-bottom: 10px; }
.wiki-feature p.extract { font-size: 16px; }
.wiki-feature p.extract::first-letter {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  float: left;
  line-height: .85;
  padding: 4px 8px 0 0;
  color: var(--oxblood);
}

.wiki-item { padding: 15px 2px; border-bottom: 1px solid var(--hairline); }
.wiki-item .wtitle { font-family: var(--font-display); font-size: 17.5px; font-weight: 600; text-decoration: none; }
.wiki-item .wtitle:hover { text-decoration: underline; }
.wiki-item p { font-size: 15.5px; color: var(--text); margin-top: 3px; }
.wiki-desc {
  display: block;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--meta);
  margin: 2px 0 3px;
}

.subsec { margin: 26px 0 6px; }

.ext-list { list-style: none; }
.ext-list li { padding: 8px 0; border-bottom: 1px solid var(--hairline); overflow: hidden; }
.ext-list a {
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  display: block;
}
.ext-list a:hover { text-decoration: underline; }
.ext-list .host { color: var(--blue); }

.elsewhere { margin-top: 24px; line-height: 2.1; }
.elsewhere a { color: var(--oxblood); }

/* accredited sources */
.accredited { margin-top: 26px; }
.src-group { padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.src-group:last-child { border-bottom: none; }
.src-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--meta);
  margin-bottom: 5px;
}
.src-links { display: flex; flex-wrap: wrap; gap: 6px 0; align-items: baseline; }
.src-links a {
  font-family: var(--font-body);
  font-size: 15.5px;
  color: var(--oxblood);
  text-decoration: none;
  white-space: nowrap;
}
.src-links a:not(:last-child)::after {
  content: "·";
  color: var(--hairline);
  margin: 0 9px;
  text-decoration: none;
}
.src-links a:hover { color: var(--blue); text-decoration: underline; }

/* ---- spider web ---- */

.web { margin-top: 64px; }

.web-wrap {
  display: grid;
  grid-template-columns: minmax(0, 740px) 1fr;
  gap: 20px 48px;
  align-items: center;
  margin-top: 18px;
}

.spider { position: relative; }
#spider { width: 100%; height: auto; display: block; }

#spider .ring, #spider .spoke { stroke: var(--hairline); fill: none; }
#spider .leader { stroke: var(--meta); stroke-dasharray: 2 4; opacity: .55; }
#spider .node { fill: var(--blue); stroke: var(--bg); stroke-width: 2; cursor: pointer; transition: fill .12s; }
#spider .node:hover, #spider .node.hot { fill: var(--oxblood); }
#spider .core { fill: var(--oxblood); }
#spider .nlabel {
  font-family: var(--font-ui);
  font-size: 12.5px;
  letter-spacing: .04em;
  fill: var(--text);
  cursor: pointer;
}
#spider .nlabel:hover, #spider .nlabel.hot { fill: var(--oxblood); text-decoration: underline; }
#spider .clabel {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 17px;
  fill: var(--ink);
}
#spider .rlabel { font-family: var(--font-mono); font-size: 9.5px; fill: var(--meta); opacity: .8; }

.tip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 11px;
  max-width: 220px;
  transform: translate(-50%, calc(-100% - 12px));
  z-index: 5;
}
.tip .stat { color: var(--highlight); }

.weblegend { list-style: none; }
.weblegend li {
  display: grid;
  grid-template-columns: 26px 1fr 52px;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
}
.weblegend .rank { font-family: var(--font-mono); font-size: 12px; color: var(--meta); }
.weblegend .lname { font-size: 16.5px; }
.weblegend li:hover .lname, .weblegend li.hot .lname { color: var(--oxblood); }
.weblegend .bar { height: 3px; background: var(--bg-alt); position: relative; margin-top: 4px; }
.weblegend .bar i { position: absolute; inset: 0 auto 0 0; background: var(--oxblood); }
.weblegend .pct { font-family: var(--font-mono); font-size: 12.5px; text-align: right; color: var(--text); }

/* ================= FOOTER ================= */

.colophon { margin-top: 70px; text-align: center; }
.colophon p { margin-top: 12px; letter-spacing: .18em; }

/* ================= MAINTENANCE / BLOCKADE ================= */

#blocked {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.screen-card {
  max-width: 480px;
  text-align: center;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  padding: 50px 46px 38px;
  box-shadow: 0 12px 40px rgba(33, 27, 20, .06);
}
.screen-word {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 16px 0 20px;
}
.screen-card .rule-double { margin: 0 60px 24px; }
.screen-lede { font-style: italic; font-size: 17px; color: var(--text); margin-bottom: 26px; }
#blockedSignOut { text-decoration: none; }
#blockedSignOut:hover { text-decoration: underline; }

/* ================= ADMINISTRATION PANEL ================= */

#admin, #exec { max-width: 1000px; margin: 0 auto; padding: 26px 28px 70px; }

/* A register of two columns should not be stretched across a desk's width: the eye
   loses the line between the hour and the clearance. */
#execAccessTable { max-width: 620px; }
#execAccessTable th:last-child, #execAccessTable td:last-child { text-align: right; }
.admin-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--hairline);
  padding: 7px 2px;
}
.admin-head a { text-decoration: none; }
.admin-head a:hover { color: var(--oxblood); text-decoration: underline; }
.admin-title {
  font-size: clamp(44px, 7vw, 72px);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  margin: 26px 0 0;
}
#admin .rule-double { max-width: 260px; margin: 16px auto 40px; }

.admin-sec { margin-bottom: 48px; }
.admin-row { display: flex; align-items: center; gap: 16px; margin: 14px 0; }
.admin-note { font-family: var(--font-ui); font-size: 13px; color: var(--meta); }
.admin-note.ok { color: var(--blue); }
.admin-note.warn { color: var(--oxblood); }

.admin-btn {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  transition: background .15s ease, border-color .15s ease;
}
.admin-btn.ghost { background: transparent; color: var(--ink); }
.admin-btn.ghost:hover { border-color: var(--oxblood); color: var(--oxblood); }
.admin-btn.warn { background: var(--oxblood); border-color: var(--oxblood); }
.admin-btn.warn:hover { background: var(--ink); border-color: var(--ink); }
.admin-btn.nuke { background: #5a1410; border-color: #5a1410; }
.admin-btn.nuke:hover { background: #7B2D26; border-color: #7B2D26; }
.admin-btn.nuke.armed { animation: nukepulse 1s infinite; }
@keyframes nukepulse { 0%, 100% { background: #7B2D26; } 50% { background: #5a1410; } }

/* managers */
.admin-row input[type="email"] {
  font: 400 15px/1 var(--font-body);
  padding: 10px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  color: var(--ink);
  outline: none;
  min-width: 260px;
}
.admin-row input[type="email"]:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--highlight); }
.mgr-list { list-style: none; margin-top: 14px; max-width: 520px; }
.mgr-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 2px;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 14px;
}
.mgr-empty { color: var(--meta); font-style: italic; font-family: var(--font-body) !important; }
.mgr-revoke {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--oxblood);
  background: none;
  border: 1px solid var(--hairline);
  padding: 5px 10px;
}
.mgr-revoke:hover { background: var(--oxblood); color: var(--bg); border-color: var(--oxblood); }

.log-scroll { overflow-x: auto; }
.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 6px;
}
.log-table th {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--meta);
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--ink);
  white-space: nowrap;
}
.log-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

.control {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--hairline);
  background: var(--bg-panel);
  margin-bottom: 16px;
}
.control.danger { border-color: #c9a59f; background: var(--warn-wash); }
.control-copy h3 { font-size: 20px; margin-bottom: 5px; }
.control-copy p { font-size: 15px; color: var(--text); }
.control-act { display: flex; flex-direction: column; gap: 10px; }
.control-act input {
  font: 500 14px/1 var(--font-mono);
  letter-spacing: .1em;
  padding: 11px 12px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  color: var(--ink);
  outline: none;
}
.control-act input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--highlight); }
.control-btns { display: flex; gap: 8px; }
.control-btns .admin-btn { flex: 1; }

@media (max-width: 640px) {
  .control { grid-template-columns: 1fr; gap: 16px; }
}

/* ================= RESPONSIVE ================= */

@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr; }
  .papers { border-left: none; padding-left: 0; margin-top: 48px; }
  .web-wrap { grid-template-columns: 1fr; }
  .weblegend { max-width: 560px; }
  #refineInput { width: 100%; max-width: none; }
  #refineForm { display: flex; }
}

@media (max-width: 560px) {
  #app { padding: 18px 16px 40px; }
  .mast-note { display: none; }
  #searchForm button { padding: 0 18px; }
  .paper { padding-left: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* clearance badge & register */
.who-badge { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; }
.log-table tr.revoked { opacity: .5; }
.log-table tr.revoked b { text-decoration: line-through; }
.cr-act {
  font-family: var(--font-ui); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
  background: none; border: 1px solid var(--hairline); color: var(--meta);
  padding: 4px 9px; margin-right: 5px; cursor: pointer;
}
.cr-act:hover { border-color: var(--oxblood); color: var(--oxblood); }
#crTier {
  font: 400 14px var(--font-ui); padding: 10px; background: var(--bg);
  border: 1px solid var(--hairline); color: var(--ink);
}
#crName { font: 400 14px var(--font-body); padding: 10px 12px; background: var(--bg);
  border: 1px solid var(--hairline); color: var(--ink); min-width: 200px; }
.back-code { display: block; margin-top: 14px; text-align: center; text-decoration: none; }
.who { text-align: center; margin-bottom: 4px; color: var(--oxblood); }

#code { letter-spacing: .3em; text-align: center; font-size: 20px; }
.code-hint { font: 400 12px/1.45 var(--font-body); color: var(--meta); margin: -4px 0 2px; }
#crEmail { font: 400 14px var(--font-body); padding: 10px 12px; background: var(--bg);
  border: 1px solid var(--hairline); color: var(--ink); min-width: 220px; }

/* ================= BIBLIOGRAPHY ================= */
#cite { max-width: 1000px; margin: 0 auto; padding: 26px 28px 70px; }
#citeQuery { font: 400 14px var(--font-body); padding: 10px 12px; background: var(--bg);
  border: 1px solid var(--hairline); color: var(--ink); min-width: 330px; }
.cite-title { display: block; width: 100%; font: 600 20px var(--font-display); color: var(--ink);
  background: var(--bg-panel); border: 1px solid var(--hairline); padding: 12px 14px; margin-bottom: 10px; }
#citeText { display: block; width: 100%; font: 400 16px/1.7 var(--font-body); color: var(--ink);
  background: var(--bg-panel); border: 1px solid var(--hairline); padding: 14px; resize: vertical; }
#citeText:focus, .cite-title:focus, #citeQuery:focus { outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--highlight); }
.cite-item { padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.cite-head { display: flex; gap: 10px; align-items: baseline; }
.cite-num { font-family: var(--font-mono); font-size: 13px; color: var(--oxblood); flex: 0 0 auto; }
.cite-note { font-size: 15.5px; }
.cite-acts { margin-top: 7px; }
.cite-editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 14px; margin-top: 12px; padding: 14px; background: var(--bg-panel);
  border: 1px solid var(--hairline); }
.cite-editor label { display: flex; flex-direction: column; gap: 3px; }
.cite-editor input, .cite-editor select { font: 400 14px var(--font-body); padding: 7px 9px;
  background: var(--bg); border: 1px solid var(--hairline); color: var(--ink); }
.cite-proof { background: var(--bg-panel); border: 1px solid var(--hairline); padding: 20px 22px;
  font-size: 16.5px; line-height: 1.75; min-height: 80px; }
mark.cite-mark { background: var(--highlight); color: var(--blue); font-family: var(--font-mono);
  font-size: 13px; padding: 1px 4px; border-radius: 3px; }
.cite-notes, .cite-bib { margin-top: 8px; }
.cite-notes li { font-size: 15px; padding: 6px 0; border-bottom: 1px solid var(--hairline);
  list-style: none; }
.cite-bib li { font-size: 15px; padding: 7px 0 7px 26px; text-indent: -26px;
  border-bottom: 1px solid var(--hairline); list-style: none; }
.ap-drop { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 34px; border: 2px dashed var(--hairline); background: var(--bg-panel);
  cursor: pointer; transition: border-color .15s, background .15s; }
.ap-drop:hover, .ap-drop.over { border-color: var(--oxblood); background: var(--bg-alt); }
.ap-drop-main { font: 400 17px var(--font-body); font-style: italic; color: var(--text); }
.ap-drop-sub { font-family: var(--font-mono); font-size: 11px; color: var(--meta); }
.ap-raw { font-family: var(--font-mono); font-size: 11.5px; color: var(--meta); margin-top: 4px;
  padding-left: 34px; }
.ap-tag { font-family: var(--font-ui); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue); background: var(--highlight); padding: 1px 6px; border-radius: 3px; margin-left: 6px; }
#apBody p { margin-bottom: 10px; }

/* masthead fills the width evenly on a wide screen */
.mast-top { display: flex; align-items: baseline; gap: 18px; }
.mast-zone { display: inline-flex; align-items: baseline; gap: 18px; }
.mast-left { flex: 1 1 0; justify-content: flex-start; }
.mast-centre { flex: 0 1 auto; justify-content: center; }
.mast-right { flex: 1 1 0; justify-content: flex-end; }
.who-badge { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; white-space: nowrap; }
@media (max-width: 820px) {
  .mast-top { flex-wrap: wrap; gap: 8px 14px; }
  .mast-zone { flex: 1 1 100%; justify-content: flex-start; }
  .mast-right { flex-wrap: wrap; }
}

/* the apparatus works visibly */
.ap-progress { margin: 14px 0 4px; }
.ap-bar { height: 3px; background: var(--bg-alt); border: 1px solid var(--hairline); overflow: hidden; }
.ap-bar i { display: block; height: 100%; width: 0%; background: var(--oxblood);
  transition: width .35s ease; }
.ap-bar.indeterminate i { width: 34%; animation: apSlide 1.1s ease-in-out infinite; }
@keyframes apSlide { 0% { margin-left: -34%; } 100% { margin-left: 100%; } }
.ap-bar-label { display: block; margin-top: 6px; font-family: var(--font-ui); font-size: 11.5px;
  letter-spacing: .06em; color: var(--meta); }
.mast-right a { white-space: nowrap; }

/* ================= THE GATE ================= */

#gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  /* The card is centred when there is room and SCROLLS when there is not: on a short
     window the Verify button must never end up beyond reach. */
  overflow-y: auto;
  padding: 32px 20px;
  background: var(--bg);
}
.gate-card { max-width: 430px; margin: auto; }
.gate-who {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--meta);
  margin-bottom: 24px;
}
.gate-btn {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--oxblood);
  border: none;
  padding: 14px 34px;
  cursor: pointer;
  transition: background .15s ease;
}
.gate-btn:hover:not(:disabled) { background: var(--blue); }
.gate-btn:disabled { opacity: .55; cursor: default; }

.gate-alt { font-size: 13px; color: var(--meta); margin-top: 18px; }
.gate-alt a { color: var(--meta); }
.gate-alt a:hover { color: var(--oxblood); }

.gate-sub { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
.gate-note { font-size: 13px; color: var(--meta); margin-bottom: 16px; }
.gate-input {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--bg);
  border: 1px solid var(--hairline);
  padding: 11px 12px;
  margin-bottom: 12px;
  color: var(--ink);
}
.gate-input:focus { outline: none; border-color: var(--oxblood); }

.gate-say { font-size: 13px; margin-top: 18px; min-height: 18px; color: var(--meta); }
.gate-say.bad { color: var(--oxblood); }
.gate-foot { margin-top: 26px; }
.gate-foot a { color: var(--meta); text-decoration: none; }
.gate-foot a:hover { text-decoration: underline; }
.gate-alt a.disabled { pointer-events: none; opacity: .4; }
#gateConsent { margin: 22px 0 26px; }

/* ================= TWO COLUMNS OF EQUAL HEIGHT ================= */

/* The shelf and the web share the left column; the voices hold the right. Both are
   given the SAME height, so the page keeps one baseline however lopsided the sources
   happen to be — and whichever column runs longer scrolls within itself. */
.grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-auto-rows: clamp(460px, 72vh, 880px);
}
.col {
  min-width: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 18px;
}
.col-right {
  border-left: 1px solid var(--hairline);
  padding-left: 40px;
  padding-right: 6px;
}
/* a hairline scrollbar, in the paper's own tones */
.col::-webkit-scrollbar { width: 9px; }
.col::-webkit-scrollbar-track { background: transparent; }
.col::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 0; }
.col::-webkit-scrollbar-thumb:hover { background: var(--meta); }
.col { scrollbar-width: thin; scrollbar-color: var(--hairline) transparent; }

/* the web now lives in a narrow column: the map sits above its legend */
.col .web { margin-top: 42px; }
.col .web-wrap { grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }

/* the literature runs the full width beneath both columns */
.papers {
  border-left: none;
  padding-left: 0;
  margin-top: 58px;
}
.papers .papers-list { columns: 2; column-gap: 52px; }
.papers .paper { break-inside: avoid; }

/* ================= VOICES TO QUOTE ================= */

.voices-list { list-style: none; }

.voice {
  padding: 16px 0 17px;
  border-bottom: 1px solid var(--hairline);
}
.voice:last-child { border-bottom: none; }

.voice-head { display: flex; align-items: baseline; gap: 8px; }
.voice-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}
.voice-weight {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--meta);
  white-space: nowrap;
  margin-left: auto;
}
.voice-note {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text);
  margin-top: 6px;
}
.voice-note a { color: var(--oxblood); text-decoration: none; }
.voice-note a:hover { text-decoration: underline; }

.voice-tools { margin-top: 7px; display: flex; gap: 14px; align-items: center; }
.voice-copy {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: none;
  border: 1px solid var(--hairline);
  color: var(--meta);
  padding: 4px 9px;
}
.voice-copy:hover { border-color: var(--oxblood); color: var(--oxblood); }
.voice-copy.done { border-color: var(--blue); color: var(--blue); }
.voice-oa {
  font-family: var(--font-ui);
  font-size: 9.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--highlight);
  padding: 2px 6px;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .col { overflow-y: visible; padding-right: 0; }
  .col-right { border-left: none; padding-left: 0; margin-top: 44px; }
  .papers .papers-list { columns: 1; }
}

/* ================= THE FRONT PAGE ================= */

/* The inscription: set as a motto is cut, not as a line of prose — small capitals,
   widely spaced, a hairline either side. */
.inscription {
  font-family: var(--font-display);
  font-variant: small-caps;
  font-weight: 500;
  font-size: 15px;
  letter-spacing: .34em;
  text-indent: .34em;                 /* balances the trailing tracking */
  color: var(--ink);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 6px 0 14px;
}
.inscription::before, .inscription::after {
  content: "";
  flex: 0 0 56px;
  border-top: 1px solid var(--hairline);
}
.masthead .wordmark { margin-bottom: 26px; }

/* The desks, in a row. Research in blue, the tool in red, the cleared row in ink. */
.desks {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.desk {
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 12px 30px;
  min-width: 150px;
  text-align: center;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.desk-blue { background: var(--blue); color: var(--bg); border-color: var(--blue); }
.desk-blue:hover, .desk-blue.on { background: var(--bg); color: var(--blue); }
.desk-red  { background: var(--oxblood); color: var(--bg); border-color: var(--oxblood); }
.desk-red:hover, .desk-red.on { background: var(--bg); color: var(--oxblood); }

.cleared {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 22px;
}
.desk-cleared { background: var(--bg); color: var(--ink); border-color: var(--ink); min-width: 0; padding: 9px 22px; font-size: 11px; }
.desk-cleared:hover { background: var(--ink); color: var(--bg); }

.desk-eyebrow { text-align: center; margin: 30px 0 -26px; }

/* the slots under the search: jurisdiction and area */
.slots {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  background: var(--bg-panel);
}
.slots input {
  font: 400 15px/1.3 var(--font-body);
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  background: var(--bg);
  color: var(--ink);
  min-width: 0;
}
.slots input:focus { outline: none; border-color: var(--blue); }
@media (max-width: 700px) { .slots { grid-template-columns: auto minmax(0, 1fr); } }

/* the door's cards */
.door-form { display: flex; flex-direction: column; gap: 6px; text-align: left; margin-top: 4px; }
.door-form label.smallcaps { margin-top: 8px; }
.door-form .gate-btn { margin-top: 16px; align-self: center; }
.door-form .gate-consent { margin-top: 14px; }
.door-form .gate-who { text-align: center; margin: 0 0 10px; }
.door-form .gate-sub { text-align: center; }
.door-form .gate-note { text-align: center; margin-bottom: 8px; }
.door-form .gate-alt { text-align: center; }
#login .screen-word { font-size: 40px; margin: 6px 0 16px; }
#login .screen-word .ox { color: var(--oxblood); font-style: italic; font-weight: 600; }
#login .inscription { margin: 10px 0 2px; font-size: 12.5px; }
#login .inscription::before, #login .inscription::after { flex-basis: 34px; }
#login { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 32px 20px; background: var(--bg); }
.temp-pass {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: .12em;
  background: var(--highlight);
  padding: 3px 8px;
  margin: 0 6px;
  color: var(--ink);
}
.gate-google {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  background: var(--ink);
  border-color: var(--ink);
}
.gate-google:hover { background: var(--blue) !important; }
.gate-google svg { background: #fff; border-radius: 50%; padding: 2px; box-sizing: content-box; }
#cardSignIn .gate-note { text-align: center; margin-bottom: 18px; }
#cardSignIn .gate-google { align-self: center; margin-top: 0; }
#cardLock { align-items: center; }
