/*
  Cultured Journal (kitchenlog)
  Visual system for an illustrated culinary lab notebook: flour-dusted cream paper,
  espresso ink, crust terracotta, herb green, and print-ready bench typography.
*/

:root {
  /* Core palette tokens */
  --bg-paper: #f7f1e3;
  --bg-surface: #fbf8f1;
  --bg-parchment: #efe6d2;
  --ink: #261f19;
  --ink-muted: #52463c;
  --ink-faint: #706256;
  --terracotta: #c4512c;
  --terracotta-text: #a63d1b;
  --terracotta-hover: #8a3114;
  --terracotta-soft: rgba(196, 81, 44, 0.12);
  --herb: #4f6d4a;
  --herb-dark: #3b5437;
  --herb-soft: rgba(79, 109, 74, 0.13);
  --rule: #ddd0b7;
  --rule-strong: #c8b698;

  /* Typography tokens */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Courier Prime", ui-monospace, SFMono-Regular, monospace;

  /* Spacing tokens */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  /* Radius tokens */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* Layout tokens */
  --measure: 44rem;
  --container: 64rem;
  --shadow-popover: 0 14px 32px rgba(38, 31, 25, 0.16), 0 2px 6px rgba(38, 31, 25, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-paper);
  color: var(--ink);
  accent-color: var(--terracotta);
  scrollbar-color: var(--rule-strong) var(--bg-paper);
  scrollbar-width: thin;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--ink);
  background-color: var(--bg-paper);
  background-image:
    radial-gradient(rgba(38, 31, 25, 0.035) 1px, transparent 0),
    radial-gradient(rgba(196, 81, 44, 0.025) 1px, transparent 0);
  background-size: 28px 28px, 42px 42px;
  background-position: 0 0, 14px 14px;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background-color: var(--terracotta-text);
  color: var(--bg-surface);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-paper);
}

::-webkit-scrollbar-thumb {
  background: var(--rule-strong);
  border: 2px solid var(--bg-paper);
  border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--ink-faint);
}

:focus-visible {
  outline: 2.5px solid var(--terracotta);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  background: var(--ink);
  color: var(--bg-surface);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-4);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* Header */
.journal-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 241, 227, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.75rem var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.brand-issue {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--herb-dark);
  background: var(--herb-soft);
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.header-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 500;
  padding: 0.4rem 0.15rem;
  border-bottom: 1.5px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.header-nav a:hover {
  color: var(--terracotta-text);
  border-bottom-color: var(--terracotta);
}

/* Buttons */
button {
  font-family: inherit;
  cursor: pointer;
}

.btn-print,
.btn-secondary,
.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 42px;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.btn-print,
.btn-secondary {
  background: var(--bg-surface);
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  white-space: nowrap;
}

.btn-print:hover,
.btn-secondary:hover {
  background: var(--bg-parchment);
  border-color: var(--ink-muted);
}

.btn-primary {
  background: var(--terracotta-text);
  color: var(--bg-surface);
  border: 1px solid var(--terracotta-text);
}

.btn-primary:hover {
  background: var(--terracotta-hover);
  border-color: var(--terracotta-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--ink);
  background: var(--bg-parchment);
}

.btn-small {
  min-height: 36px;
  padding: 0.3rem 0.65rem;
  font-size: 0.84rem;
}

/* Main notebook layout */
.notebook-shell {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-7) var(--space-5) var(--space-8);
}

.journal-article,
.article-hero {
  scroll-margin-top: 5.5rem;
}

.article-hero {
  max-width: 54rem;
  margin: 0 auto var(--space-7);
}

.article-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.25rem, 4.8vw, 3.65rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 var(--space-4);
  color: var(--ink);
}

.article-dek {
  font-size: clamp(1.1rem, 1.8vw, 1.28rem);
  line-height: 1.58;
  color: var(--ink-muted);
  max-width: 46rem;
  margin: 0 0 var(--space-5);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4) var(--space-6);
  margin: 0 0 var(--space-6);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.meta-item dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.meta-item dd {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
}

/* Hero botanical/culinary plate */
.hero-plate {
  margin: 0;
  background: var(--bg-surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.plate-svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.plate-caption {
  margin-top: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px dashed var(--rule);
  font-size: 0.88rem;
  color: var(--ink-muted);
  font-style: italic;
}

/* Essay body */
.essay-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}

.prose-section {
  max-width: var(--measure);
  margin: 0 auto;
  width: 100%;
}

.prose-section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-4);
  color: var(--ink);
}

.prose-section p {
  margin: 0 0 var(--space-4);
}

.prose-section p:last-child {
  margin-bottom: 0;
}

.dropcap::first-letter {
  font-family: var(--font-display);
  font-weight: 600;
  float: left;
  font-size: 3.45rem;
  line-height: 0.84;
  padding: 0.22rem 0.55rem 0 0;
  color: var(--terracotta);
}

.notebook-quote {
  margin: var(--space-6) 0;
  padding: var(--space-5) var(--space-5);
  background: var(--bg-parchment);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}

.notebook-quote p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 var(--space-2);
}

.notebook-quote cite {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

/* Glossary inline trigger */
.glossary-trigger {
  display: inline;
  padding: 0 0.12rem;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--terracotta-text);
  font: inherit;
  font-weight: 600;
  border-bottom: 1.5px dotted var(--terracotta);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.glossary-trigger:hover,
.glossary-trigger[aria-expanded="true"] {
  background: var(--terracotta-soft);
  color: var(--ink);
}

/* Signature Interactive 1: Baker's Percentage Calculator */
.lab-sheet {
  background: var(--bg-surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  scroll-margin-top: 5.5rem;
}

.lab-sheet-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--space-4);
}

.lab-sheet-header h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.5vw, 1.95rem);
  margin: 0 0 var(--space-2);
  line-height: 1.2;
}

.lab-sheet-intro {
  margin: 0;
  color: var(--ink-muted);
  max-width: 40rem;
  font-size: 0.96rem;
}

.lab-sheet-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.preset-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-right: var(--space-1);
}

.preset-btn {
  min-height: 38px;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--rule-strong);
  background: var(--bg-paper);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.preset-btn:hover {
  border-color: var(--terracotta);
}

.preset-btn.is-active {
  background: var(--ink);
  color: var(--bg-surface);
  border-color: var(--ink);
}

.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: var(--space-6);
  align-items: start;
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.control-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.control-head label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}

.number-unit {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.number-unit input {
  width: 5.2rem;
  min-height: 38px;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.control-group input[type="range"] {
  width: 100%;
  height: 28px;
  margin: 0;
  cursor: pointer;
}

.range-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-faint);
}

.notebook-select {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.92rem;
}

.formula-table-wrap {
  overflow-x: auto;
}

.formula-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.formula-table th,
.formula-table td {
  padding: 0.68rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.formula-table thead th {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  border-bottom: 1.5px solid var(--ink);
}

.formula-table .num {
  text-align: right;
  white-space: nowrap;
}

.formula-table .strong {
  font-weight: 700;
  color: var(--ink);
}

.formula-table tfoot th,
.formula-table tfoot td {
  border-top: 1.5px solid var(--ink);
  border-bottom: 0;
  padding-top: 0.85rem;
  font-weight: 700;
}

.calc-readout-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--rule-strong);
}

.readout-metric {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.readout-wide {
  grid-column: 1 / -1;
}

.readout-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.readout-value {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--herb-dark);
}

.copy-status {
  margin: var(--space-2) 0 0;
  min-height: 1.3rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--herb-dark);
}

/* Signature Interactive 2: Fermentation Timeline */
.timeline-section {
  max-width: 54rem;
  margin: 0 auto;
  width: 100%;
  scroll-margin-top: 5.5rem;
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1.5px solid var(--ink);
  margin-bottom: var(--space-5);
}

.timeline-header h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.55rem, 2.6vw, 2.05rem);
  margin: 0 0 var(--space-2);
  line-height: 1.2;
}

.timeline-intro {
  margin: 0;
  color: var(--ink-muted);
  max-width: 34rem;
  font-size: 0.96rem;
}

.timeline-progress-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  min-width: 12rem;
}

.progress-text {
  font-size: 0.88rem;
  color: var(--ink-muted);
}

.progress-text .mono {
  font-weight: 700;
  color: var(--ink);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-parchment);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--herb);
  transition: width 0.25s ease;
}

.active-timer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0.7rem var(--space-4);
  margin-bottom: var(--space-4);
  background: var(--ink);
  color: var(--bg-surface);
  border-radius: var(--radius-sm);
}

.active-timer-banner[hidden] {
  display: none;
}

.banner-left,
.banner-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.banner-clock {
  font-weight: 700;
  font-size: 1.05rem;
}

.active-timer-banner .btn-ghost {
  color: var(--bg-surface);
  border-color: rgba(251, 248, 241, 0.3);
}

.active-timer-banner .btn-ghost:hover {
  background: rgba(251, 248, 241, 0.14);
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.timeline-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.timeline-step.is-running {
  border-color: var(--terracotta);
}

.timeline-step.is-complete {
  background: var(--bg-parchment);
  border-color: var(--herb);
}

.timeline-step.is-complete .step-title {
  text-decoration: line-through;
  color: var(--ink-muted);
}

.step-check-col {
  padding-top: 0.15rem;
}

.step-checkbox {
  width: 22px;
  height: 22px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--herb);
}

.step-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem var(--space-3);
  margin-bottom: var(--space-2);
}

.step-time {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--terracotta-text);
}

.step-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0;
  color: var(--ink);
}

.step-duration {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--herb-dark);
  background: var(--herb-soft);
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
}

.step-desc {
  margin: 0 0 var(--space-3);
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.step-timer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.timer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule-strong);
  background: var(--bg-paper);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.timer-btn:hover {
  border-color: var(--terracotta);
  color: var(--terracotta-text);
}

.timer-btn .icon-pause {
  display: none;
}

.timeline-step.is-running .timer-btn {
  background: var(--terracotta-text);
  border-color: var(--terracotta-text);
  color: var(--bg-surface);
}

.timeline-step.is-running .timer-btn .icon-play {
  display: none;
}

.timeline-step.is-running .timer-btn .icon-pause {
  display: inline;
}

.timer-display {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
  min-width: 4.8rem;
}

.timeline-step.is-finished .timer-display {
  color: var(--herb-dark);
}

.timer-reset {
  min-height: 36px;
  padding: 0.25rem 0.55rem;
  border: 0;
  background: transparent;
  color: var(--ink-faint);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.timer-reset:hover {
  color: var(--ink);
}

/* Field Notes & Glossary Reference */
.field-notes {
  max-width: var(--measure);
  margin: 0 auto;
  width: 100%;
  scroll-margin-top: 5.5rem;
}

.field-notes h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.5vw, 1.95rem);
  margin: 0 0 var(--space-2);
}

.notes-intro {
  margin: 0 0 var(--space-4);
  color: var(--ink-muted);
}

.notes-table-wrap {
  overflow-x: auto;
  background: var(--bg-surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
}

.notes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

.notes-table th,
.notes-table td {
  padding: 0.72rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
}

.notes-table thead th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}

.notes-table tbody tr:last-child td {
  border-bottom: 0;
}

.glossary-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.chips-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.chip-trigger {
  min-height: 38px;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--terracotta);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  font-size: 0.88rem;
}

/* Newsletter */
.newsletter-band {
  margin-top: var(--space-8);
  padding: var(--space-6);
  background: var(--bg-parchment);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
}

.newsletter-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: center;
}

.newsletter-copy h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.55rem;
  margin: 0 0 var(--space-2);
}

.newsletter-copy p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.96rem;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.form-row {
  display: flex;
  gap: var(--space-2);
}

.form-row input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.96rem;
}

.form-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
  cursor: pointer;
}

.form-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--herb);
}

.form-feedback {
  margin: 0;
  min-height: 1.3rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--herb-dark);
}

.form-feedback.is-error {
  color: var(--terracotta-text);
}

/* Footer */
.journal-footer {
  border-top: 1px solid var(--rule-strong);
  background: var(--bg-surface);
  padding: var(--space-6) var(--space-5);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) auto auto;
  gap: var(--space-6);
  align-items: start;
}

.footer-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0 0 var(--space-2);
}

.footer-colophon {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
  max-width: 30rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-links a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--terracotta-text);
  text-decoration: underline;
}

.footer-meta {
  font-size: 0.84rem;
  color: var(--ink-muted);
  text-align: right;
}

.footer-meta p {
  margin: 0 0 0.35rem;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: var(--bg-paper);
}

/* Glossary Popover */
.glossary-popover {
  position: fixed;
  z-index: 80;
  width: min(22rem, calc(100vw - 2rem));
  padding: var(--space-4) var(--space-5);
  background: var(--bg-surface);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
}

.glossary-popover[hidden] {
  display: none;
}

.popover-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.popover-term {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
  margin: 0;
  color: var(--ink);
}

.popover-pronunciation {
  font-size: 0.78rem;
  color: var(--terracotta-text);
}

.popover-close {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  color: var(--ink);
}

.popover-close:hover {
  border-color: var(--ink);
}

.popover-definition {
  margin: 0 0 var(--space-3);
  font-size: 0.93rem;
  line-height: 1.58;
  color: var(--ink);
}

.popover-cue {
  margin: 0;
  padding-top: var(--space-2);
  border-top: 1px dashed var(--rule-strong);
  font-size: 0.78rem;
  color: var(--herb-dark);
}

/* Responsive */
@media (max-width: 860px) {
  .calc-grid,
  .newsletter-inner,
  .footer-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-meta {
    text-align: left;
  }

  .header-nav {
    display: none;
  }
}

@media (max-width: 600px) {
  .header-inner {
    padding: 0.6rem var(--space-4);
    gap: var(--space-2);
  }

  .brand-mark {
    gap: 0.45rem;
  }

  .brand-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }

  .brand-title {
    font-size: 1.02rem;
  }

  .brand-issue {
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
  }

  .btn-print {
    padding: 0.4rem 0.65rem;
    gap: 0.35rem;
    min-height: 38px;
  }

  .btn-print span {
    font-size: 0.82rem;
  }

  .notebook-shell {
    padding: var(--space-5) var(--space-4) var(--space-7);
  }

  .lab-sheet,
  .newsletter-band {
    padding: var(--space-4);
  }

  .preset-label {
    width: 100%;
    margin-right: 0;
  }

  .preset-btn {
    font-size: 0.8rem;
    padding: 0.3rem 0.65rem;
  }

  .timeline-step {
    padding: var(--space-4);
    gap: var(--space-3);
  }

  .step-top {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.25rem var(--space-2);
  }

  .step-time {
    grid-column: 1;
    grid-row: 1;
  }

  .step-duration {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    margin-left: 0;
  }

  .step-title {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .step-timer-row {
    gap: var(--space-2);
  }

  .timer-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.82rem;
  }

  .timer-display {
    min-width: 4.1rem;
    font-size: 0.92rem;
  }

  .timeline-progress-box {
    align-items: flex-start;
    width: 100%;
  }

  .notes-table-wrap {
    padding: var(--space-3);
  }

  .notes-table thead {
    display: none;
  }

  .notes-table,
  .notes-table tbody,
  .notes-table tr,
  .notes-table td {
    display: block;
    width: 100%;
  }

  .notes-table tr {
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--rule-strong);
  }

  .notes-table tr:first-child {
    padding-top: 0;
  }

  .notes-table tr:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .notes-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-3);
    padding: 0.28rem 0;
    border-bottom: 0;
    text-align: right;
  }

  .notes-table td::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-faint);
    text-align: left;
    flex-shrink: 0;
  }

  .form-row {
    flex-direction: column;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print stylesheet */
@media print {
  @page {
    margin: 1.4cm;
  }

  body {
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 10.5pt;
    line-height: 1.5;
  }

  .journal-header,
  .preset-bar,
  .lab-sheet-controls,
  .calc-inputs,
  .step-timer-row,
  .active-timer-banner,
  .timeline-progress-box button,
  .glossary-chips,
  .newsletter-band,
  .glossary-popover,
  .skip-link {
    display: none !important;
  }

  .notebook-shell {
    padding: 0;
    max-width: none;
  }

  .hero-plate,
  .lab-sheet,
  .timeline-step,
  .notes-table-wrap,
  .notebook-quote {
    background: #ffffff !important;
    border-color: #999999 !important;
    break-inside: avoid;
  }

  .calc-grid {
    grid-template-columns: 1fr;
  }

  .glossary-trigger {
    color: #111111;
    border-bottom: none;
  }

  .journal-footer {
    background: #ffffff;
    border-top: 1px solid #999999;
    padding: 0.8cm 0 0;
  }
}
