/* ============================================================
 *  BSEBench design system — academic publication × modern web.
 *  Single source of truth across all pages.
 *
 *  Aesthetic direction: contemporary scholarly journal
 *  (think Nature Communications, JMLR, LaTeX hyperref+booktabs).
 *  - Body & display: STIX Two Text (the modern LaTeX math companion)
 *  - Mono:           IBM Plex Mono
 *  - Palette:        white paper, near-black ink, single LaTeX-blue accent
 *  - Components:     numbered figures, equations, booktabs-style rules,
 *                    small-caps section labels, ruled section heads.
 *  - No decorative noise, no rounded corners, no shadows.
 *  ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=STIX+Two+Text:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,700&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

:root {
  /* Paper & ink */
  --paper:         #ffffff;
  --paper-tinted:  #f7f6f1;     /* very faint warm tint for panels */
  --paper-band:    #faf9f5;     /* alternating-row tint */
  --ink:           #14181f;     /* near-black, like 100% K ink */
  --ink-soft:      #3c4654;
  --ink-mute:      #6a7280;
  --ink-faint:     #99a0aa;
  --rule:          #d0d4dc;
  --rule-strong:   #14181f;

  /* Accent — LaTeX hyperref default blue, slightly warmed */
  --accent:        #245aaa;
  --accent-deep:   #143b75;
  --accent-tint:   #eef2fa;

  /* Status colours, restrained */
  --status-ok:     #2e7a3a;
  --status-warn:   #a16207;
  --status-err:    #a83a2c;
  --status-info:   #245aaa;

  /* Spacing */
  --gap-1:  4px;
  --gap-2:  8px;
  --gap-3:  12px;
  --gap-4:  16px;
  --gap-5:  24px;
  --gap-6:  32px;
  --gap-7:  48px;
  --gap-8:  72px;

  /* Type */
  --serif:   "STIX Two Text", "Source Serif Pro", "Iowan Old Style", Georgia, serif;
  --mono:    "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --content-w: 1140px;
}

* { box-sizing: border-box; }

html {
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--serif);
  font-feature-settings: "kern", "liga", "onum";
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
}

::selection { background: var(--accent-tint); color: var(--ink); }

/* ============== TYPOGRAPHY ============== */

h1, h2, h3, h4, h5 {
  font-family: var(--serif);
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.005em;
  line-height: 1.18;
  color: var(--ink);
}

h1 { font-size: 2.6rem; font-weight: 500; letter-spacing: -0.018em; }
h2 { font-size: 1.65rem; font-weight: 500; }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 0.98rem; }

p { margin: 0 0 var(--gap-3); max-width: 72ch; }

em { font-style: italic; }
strong { font-weight: 600; color: var(--ink); }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 2.5px;
}
a:hover { color: var(--accent-deep); text-decoration-thickness: 1px; }

code, pre, kbd, .mono {
  font-family: var(--mono);
  font-size: 0.86em;
  font-weight: 500;
}

code {
  background: var(--paper-tinted);
  padding: 1px 5px;
  border: 1px solid var(--rule);
  color: var(--ink);
}

.small-caps {
  font-variant: small-caps;
  letter-spacing: 0.06em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  display: inline-block;
}

.label-cap {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}

.italic-note { font-style: italic; color: var(--ink-soft); }

/* ============== LAYOUT PRIMITIVES ============== */

main {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 var(--gap-7);
}

.frame { max-width: var(--content-w); margin: 0 auto; padding: 0 var(--gap-7); }

.section {
  padding: var(--gap-8) 0;
  border-bottom: 1px solid var(--rule);
}
.section:last-of-type { border-bottom: none; }

.section-head {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--gap-6);
  margin-bottom: var(--gap-6);
  align-items: baseline;
}
.section-num {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: lining-nums;
}
.section-title {
  font-size: 1.85rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.section-title em { font-style: italic; color: var(--accent); }
.section-subtitle {
  margin-top: var(--gap-2);
  color: var(--ink-soft);
  font-style: italic;
  font-size: 1.02rem;
  max-width: 70ch;
}

/* ============== LEGACY HEADER (kept for backwards compat) ============== */
/* Pages that use buildHeader() get this. Restyled to match the new system. */

body > header {
  background: var(--paper);
  color: var(--ink);
  padding: var(--gap-2) var(--gap-7);
  display: flex;
  align-items: baseline;
  gap: var(--gap-5);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--rule);
  box-shadow: none;
  font-family: var(--serif);
}
body > header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
body > header h1::after {
  content: ".";
  color: var(--accent);
}
body > header .sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-mute);
  opacity: 1;
}
body > header nav {
  display: flex;
  gap: var(--gap-5);
  flex: 1;
  margin-left: var(--gap-4);
}
body > header nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s, border-color 0.15s;
}
body > header nav a:hover {
  background: transparent;
  color: var(--accent);
  border-bottom-color: var(--accent);
}
body > header nav a.active {
  background: transparent;
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
body > header .right {
  font-size: 0.72rem;
  opacity: 1;
  color: var(--ink-mute);
  font-family: var(--mono);
}

/* ============== PANELS ============== */

.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: var(--gap-5) var(--gap-5);
  box-shadow: none;
  margin-bottom: var(--gap-5);
}
.panel h2 {
  margin: 0 0 var(--gap-4);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
  padding-bottom: var(--gap-2);
}
.panel h3 {
  margin: var(--gap-4) 0 var(--gap-2);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
}

.panel-tinted { background: var(--paper-tinted); }

/* ============== FORMS ============== */

.form-group { margin-bottom: var(--gap-4); }
.form-group label {
  display: block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  margin-bottom: var(--gap-1);
}
select, input[type=text], input[type=number], input[type=date], input[type=search], textarea {
  width: 100%;
  padding: var(--gap-2) var(--gap-3);
  border: 1px solid var(--rule);
  border-radius: 0;
  font-size: 0.94rem;
  font-family: var(--serif);
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.15s;
}
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.checklist {
  border: 1px solid var(--rule);
  padding: var(--gap-2);
  max-height: 230px;
  overflow-y: auto;
  font-size: 0.92rem;
  background: var(--paper);
}
.checklist label {
  display: flex;
  align-items: center;
  gap: var(--gap-2);
  padding: 3px 6px;
  cursor: pointer;
  user-select: none;
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--serif);
  font-size: 0.94rem;
  font-weight: 400;
  color: var(--ink);
}
.checklist label:hover { background: var(--paper-tinted); }
.checklist input[type=checkbox] { accent-color: var(--accent); }

input[type=checkbox] { accent-color: var(--accent); }

/* ============== BUTTONS ============== */

button, .btn {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0;
  padding: var(--gap-2) var(--gap-5);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
button:hover, .btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
button.secondary, .btn.secondary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
}
button.secondary:hover, .btn.secondary:hover {
  background: var(--ink);
  color: var(--paper);
}
button.ghost, .btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}
button.ghost:hover, .btn.ghost:hover {
  background: var(--paper-tinted);
  color: var(--accent);
  border-color: var(--accent);
}
button:disabled, .btn:disabled {
  background: var(--ink-faint);
  border-color: var(--ink-faint);
  color: var(--paper);
  cursor: not-allowed;
}

/* ============== STATS GRID ============== */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  margin-bottom: var(--gap-5);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
.stat-card {
  background: var(--paper);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  padding: var(--gap-3) var(--gap-4);
  text-align: left;
}
.stat-card .l {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.stat-card .v {
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1.1;
  margin-top: 2px;
  letter-spacing: -0.02em;
}

/* ============== TABLES (booktabs style) ============== */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-family: var(--serif);
  margin: 0;
}
thead th {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: left;
  padding: var(--gap-2) var(--gap-3);
  background: transparent;
  border-bottom: 2px solid var(--ink);     /* LaTeX \toprule */
  border-top: 2px solid var(--ink);         /* LaTeX \toprule top */
  cursor: default;
  position: static;
}
thead th.r { text-align: right; }
tbody td {
  padding: var(--gap-2) var(--gap-3);
  border-bottom: 1px solid var(--rule);    /* LaTeX \midrule */
  text-align: left;
  font-variant-numeric: tabular-nums;
}
tbody td.r { text-align: right; }
tbody tr:last-child td { border-bottom: 2px solid var(--ink); }  /* LaTeX \bottomrule */
tbody tr {
  background: var(--paper);
  cursor: default;
  transition: background 0.12s;
}
tbody tr:hover { background: var(--paper-tinted); }
tbody tr.clickable { cursor: pointer; }
tbody tr.failed td { color: var(--status-err); }

td.s, th.s { text-align: left; }

.bse-score { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* family stripe on the leftmost cell */
tr.ecm    td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.robust td:first-child { box-shadow: inset 3px 0 0 var(--status-ok); }
tr.ml     td:first-child { box-shadow: inset 3px 0 0 var(--status-err); }

/* ============== PROGRESS BAR ============== */

.bar {
  height: 6px;
  background: var(--paper-tinted);
  border: 1px solid var(--rule);
  border-radius: 0;
  overflow: hidden;
  margin-bottom: var(--gap-1);
}
.bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s linear;
}

/* ============== CAVEATS (Errata style) ============== */

.caveats {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin-top: var(--gap-5);
  padding: var(--gap-4) var(--gap-5);
  background: var(--paper-tinted);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--status-warn);
  border-radius: 0;
  font-family: var(--serif);
  line-height: 1.55;
}
.caveats strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  display: block;
  margin-bottom: var(--gap-2);
}
.caveats ul { margin: 0; padding-left: var(--gap-5); }
.caveats li { margin: var(--gap-1) 0; }

/* ============== TAGS ============== */

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
  vertical-align: baseline;
  border: 1px solid currentColor;
  background: transparent;
}
.tag.official  { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tag.experimental, .tag.exp { color: var(--ink-mute); }
.tag.running   { color: var(--accent); }
.tag.failed    { color: var(--status-err); }
.tag.complete, .tag.ok { color: var(--status-ok); }

/* ============== MATRIX GRID (live page) ============== */

.matrix {
  display: grid;
  gap: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 0;
  overflow-x: auto;
  padding: 0;
}
.matrix .cell {
  background: var(--paper);
  min-width: 92px;
  min-height: 54px;
  padding: var(--gap-2);
  text-align: center;
  font-size: 0.78rem;
  font-family: var(--mono);
  position: relative;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.matrix .cell.header {
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: var(--gap-2);
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 2px solid var(--ink);
}
.matrix .cell.row-header {
  background: var(--paper-tinted);
  color: var(--ink);
  font-weight: 500;
  font-family: var(--serif);
  font-size: 0.85rem;
  text-align: left;
  padding: var(--gap-2) var(--gap-3);
  position: sticky;
  left: 0;
  z-index: 1;
  border-right: 2px solid var(--ink);
}
.matrix .cell.pending {
  background: var(--paper);
  color: var(--ink-faint);
}
.matrix .cell.pending::before { content: "·"; font-size: 1.3rem; }
.matrix .cell.running {
  background: var(--accent-tint);
  color: var(--accent-deep);
  animation: pulse 1.4s ease-in-out infinite;
}
.matrix .cell.ok {
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.matrix .cell.ok:hover { background: var(--accent-tint); }
.matrix .cell.failed {
  background: var(--paper-tinted);
  color: var(--status-err);
  font-weight: 600;
}
.matrix .cell .score {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.matrix .cell .sub {
  font-size: 0.62rem;
  opacity: 0.7;
  letter-spacing: 0.05em;
  margin-top: 2px;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* ============== HEATMAP (leaderboard Wilcoxon) ============== */

.heatmap {
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.74rem;
}
.heatmap td {
  padding: var(--gap-1) var(--gap-2);
  min-width: 56px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--rule);
}
.heatmap th {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: var(--gap-2);
  text-align: center;
  border: 1px solid var(--rule);
}
.heatmap td.sig-a { background: rgba(46, 122, 58, 0.18); color: var(--ink); }
.heatmap td.sig-b { background: rgba(168, 58, 44, 0.18); color: var(--ink); }
.heatmap td.ns    { background: var(--paper-tinted); color: var(--ink-mute); }
.heatmap td.diag  { background: var(--ink); color: var(--paper); }

/* ============== TOOLBARS ============== */

.toolbar {
  display: flex;
  gap: var(--gap-3);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--gap-4);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.toolbar input, .toolbar select { width: auto; min-width: 140px; }
.toolbar label { display: inline-flex; gap: var(--gap-1); align-items: center; }
.toolbar .spacer { flex: 1; }

/* ============== EMPTY / ERROR STATES ============== */

.empty-state {
  text-align: center;
  padding: var(--gap-7) var(--gap-5);
  color: var(--ink-mute);
  font-style: italic;
  font-size: 1rem;
}
.empty-state a { font-weight: 600; }

/* ============== KEYBOARD KEY ============== */

.kbd {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--paper-tinted);
  font-family: var(--mono);
  font-size: 0.78em;
  color: var(--ink);
}

/* ============== LOG TERMINAL ============== */

.log {
  background: var(--ink);
  color: #d4d8e0;
  font-family: var(--mono);
  font-size: 0.76rem;
  padding: var(--gap-3) var(--gap-4);
  border-radius: 0;
  max-height: 280px;
  overflow-y: auto;
  white-space: pre-wrap;
  border: 1px solid var(--ink);
  line-height: 1.5;
}
.log .ok   { color: #94d3a4; }
.log .err  { color: #f0a8a0; }
.log .warn { color: #f2cf8a; }
.log .info { color: #9bb8e6; }

/* ============== EQUATIONS (KaTeX) ============== */

.eqn-block {
  display: grid;
  grid-template-columns: 1fr 64px;
  gap: var(--gap-5);
  align-items: center;
  padding: var(--gap-5) 0 var(--gap-6);
  border-bottom: 1px dotted var(--rule);
}
.eqn-block:last-child { border-bottom: none; }
.eqn-formula { text-align: center; font-size: 1.15em; padding: var(--gap-2) 0; }
.eqn-label {
  font-family: var(--serif);
  font-size: 0.86rem;
  font-style: italic;
  color: var(--ink-mute);
  text-align: right;
  font-variant-numeric: lining-nums;
}
.eqn-caption {
  margin-top: var(--gap-2);
  font-size: 0.95rem;
  color: var(--ink-soft);
  max-width: 76ch;
}
.eqn-where { margin-top: var(--gap-3); font-size: 0.9rem; color: var(--ink-soft); max-width: 76ch; }
.eqn-where ul { list-style: none; padding: 0; margin: var(--gap-2) 0 0; }
.eqn-where li { padding: 2px 0 2px 20px; position: relative; }
.eqn-where li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }

.katex { font-size: 1em !important; color: var(--ink); }
.katex-display { margin: 0 !important; }

/* ============== FIGURES ============== */

.figure {
  border: 1px solid var(--rule);
  border-radius: 0;
  padding: var(--gap-6) var(--gap-5) var(--gap-4);
  background: var(--paper);
  margin: 0;
}
.figure-caption {
  font-size: 0.93rem;
  color: var(--ink-soft);
  margin-top: var(--gap-4);
  padding-top: var(--gap-3);
  border-top: 1px solid var(--rule);
  line-height: 1.55;
}
.figure-caption b {
  font-weight: 600;
  color: var(--ink);
}

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

.provenance, #provenance-mount > * {
  margin-top: var(--gap-8);
  padding: var(--gap-5) 0 var(--gap-6);
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-mute);
  line-height: 1.7;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--gap-5);
}

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

@media (max-width: 900px) {
  html { font-size: 15.5px; }
  main, .frame { padding: 0 var(--gap-5); }
  body > header { padding: var(--gap-2) var(--gap-4); flex-wrap: wrap; gap: var(--gap-3); }
  body > header nav { gap: var(--gap-3); margin-left: 0; flex-wrap: wrap; }
  .section { padding: var(--gap-7) 0; }
  .section-head { grid-template-columns: 52px 1fr; gap: var(--gap-3); }
  .section-num { font-size: 2rem; }
  .section-title { font-size: 1.4rem; }
  .eqn-block { grid-template-columns: 1fr; }
  .eqn-label { text-align: left; margin-top: var(--gap-2); }
}

/* ============================================================
 *  DEFENSE MODE — activated by ?talk=1 (see shared.js).
 *
 *  Goal : make every page legible from the back of a defense room
 *  (typically a 1080p projector seen from 6+ m away). We do this
 *  with pure CSS — no DOM rewrite, no rebuild. The toggle is
 *  injected by shared.js into the footer and stays reachable.
 *  ============================================================ */

html.talk-mode { font-size: 21px; }
html.talk-mode body { line-height: 1.7; }

/* Hide non-essential chrome to keep focus on the demo content.
 * NOTE : we hide .provenance-footer (the actual provenance content rendered
 * by shared.js footerHtml) but NOT #provenance-mount itself, because the
 * talk-mode toggle chip is also mounted inside that container and must
 * remain reachable. */
html.talk-mode .caveats,
html.talk-mode .toolbar,
html.talk-mode .colophon,
html.talk-mode .provenance,
html.talk-mode .provenance-footer {
  display: none;
}

/* Dim secondary CTAs so the audience eye tracks the primary action. */
html.talk-mode .btn.secondary,
html.talk-mode .btn.ghost,
html.talk-mode button.secondary,
html.talk-mode button.ghost {
  opacity: 0.4;
}

/* Talk-mode toggle chip — visible in both modes. Pinned bottom-right
 * via position:fixed so it's always reachable, especially in talk-mode
 * where the rest of the chrome is hidden. */
.talk-mode-toggle {
  position: fixed;
  bottom: var(--gap-3);
  right: var(--gap-3);
  z-index: 200;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: var(--gap-1) var(--gap-3);
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.talk-mode-toggle:hover { opacity: 1; color: var(--accent); }
html.talk-mode .talk-mode-toggle { opacity: 0.7; }

/* Container max-width tweak on big displays so the line-length stays
 * readable when font-size jumps. */
@media (max-width: 1920px) {
  html.talk-mode .frame,
  html.talk-mode main {
    max-width: 1440px;
  }
}
