/* The Cozy Town Times — styled after the Paper of Record */

:root {
  --ink: #121212;
  --ink-soft: #363636;
  --gray: #5a5a5a;
  --gray-light: #727272;
  --rule: #dfdfdf;
  --rule-dark: #121212;
  --paper: #ffffff;
  --serif: georgia, "times new roman", times, serif;
  --sans: "Libre Franklin", "Helvetica Neue", helvetica, arial, sans-serif;
  --blackletter: "UnifrakturMaguntia", "Old English Text MT", georgia, serif;
}

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

body {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a.hl:hover { color: var(--gray); }
img, svg { max-width: 100%; display: block; }

/* ------------------------------------------------------------------ */
/* Header                                                              */
/* ------------------------------------------------------------------ */

.site-header { border-bottom: 1px solid var(--rule-dark); }

.topbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--sans);
  font-size: 0.6875rem;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.topbar-left { display: flex; gap: 14px; }
.topbar .today { font-weight: 700; }
.topbar a { color: var(--gray); }
.topbar a:hover { text-decoration: underline; }
.topbar-right { display: flex; gap: 16px; color: var(--gray); }
.tick-up { color: #0a7c3f; }
.tick-down { color: #a52a1d; }
.weather-desc { font-style: italic; }

.forecast-card {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--ink);
  padding: 14px 18px;
  margin: 18px 0 6px;
  background: #f7f7f5;
}
.forecast-now { font-family: var(--serif); font-size: 1.125rem; font-weight: 700; margin-bottom: 4px; }
.forecast-detail { font-family: var(--sans); font-size: 0.8125rem; color: var(--gray); }

.cast-link { font-family: var(--sans); font-size: 0.75rem; font-weight: 600; color: var(--gray); white-space: nowrap; }

.cast-conditions { display: flex; align-items: center; gap: 18px; }
.cast-icon { flex: 0 0 120px; }
.cast-icon svg { width: 120px; height: auto; display: block; border: 1px solid var(--rule); }

/* Weather page: hero + city cards */

.weather-hero {
  display: grid;
  grid-template-columns: 300px 1fr;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
  margin: 18px 0 10px;
  overflow: hidden;
}
.weather-hero:hover { background: #fbfbf9; }
.weather-hero:hover .cast-link { color: var(--ink); }
.weather-hero-art svg { width: 100%; height: 100%; display: block; }
.weather-hero-text { padding: 18px 22px; }
.weather-hero-place {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray);
}
.weather-hero-temp { font-family: var(--serif); font-size: 3rem; font-weight: 700; line-height: 1.1; }
.weather-hero-desc { font-family: var(--serif); font-size: 1.25rem; font-style: italic; margin-bottom: 8px; }
.weather-hero-detail { font-family: var(--sans); font-size: 0.8125rem; color: var(--gray); margin-bottom: 10px; }

.region-label { margin-top: 22px; }
.weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 8px;
}
.weather-card {
  border: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
}
.weather-card:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); }
.weather-card-art svg { width: 100%; height: auto; display: block; }
.weather-card-body { padding: 12px 14px 14px; }
.weather-card-city { font-family: var(--sans); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gray); }
.weather-card-temp { font-family: var(--serif); font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
.weather-card-desc { font-family: var(--serif); font-size: 0.9375rem; font-style: italic; color: var(--ink-soft); margin-bottom: 6px; }
.weather-card-range { font-family: var(--sans); font-size: 0.6875rem; color: var(--gray); }

@media (max-width: 600px) {
  .weather-hero { grid-template-columns: 1fr; }
}

.atlas-results { margin-top: 12px; border-top: 1px solid var(--rule); }
.atlas-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.8125rem;
}

.masthead {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 16px 10px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}
.masthead-side {
  font-family: var(--sans);
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  color: var(--gray);
  text-transform: uppercase;
}
.masthead-side.right { text-align: right; }

.nameplate {
  font-family: var(--blackletter);
  font-weight: 400;
  font-size: clamp(2.4rem, 6.5vw, 4.25rem);
  line-height: 1;
  text-align: center;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.section-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  border-top: 1px solid var(--rule);
}
.section-nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  padding: 8px 0;
}
.section-nav a {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  display: inline-block;
}
.section-nav a:hover, .section-nav a.active { text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ */
/* Front page                                                          */
/* ------------------------------------------------------------------ */

.page { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; }

.front {
  display: grid;
  grid-template-columns: minmax(0, 2.05fr) minmax(0, 1fr);
  gap: 0 24px;
}

.front-main {
  padding-right: 24px;
  border-right: 1px solid var(--rule);
}

.kicker {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 6px;
}
.kicker.inline { display: inline; margin: 0; color: var(--gray); }

.lead-story { padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.lead-headline {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.lead-art figcaption, .story-art figcaption {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 300;
  color: var(--gray-light);
  padding-top: 6px;
  line-height: 1.5;
}
.lead-art { margin-bottom: 12px; }
.lead-art svg { width: 100%; height: auto; }

.summary {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.fp-byline {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 300;
  color: var(--gray-light);
}

.top-stories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 20px;
}
.top-story { padding-right: 24px; border-right: 1px solid var(--rule); }
.top-story:last-child { border-right: none; padding-right: 0; }
.top-story h3 { font-size: 1.0625rem; font-weight: 700; line-height: 1.25; margin-bottom: 8px; }
.top-story .summary { font-size: 0.8125rem; }
.thumb { margin-bottom: 10px; }
.thumb svg { width: 100%; height: auto; }

/* Opinion rail */

.front-opinion { padding-top: 2px; }
.rail-label {
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 700;
  border-bottom: 1px solid var(--rule-dark);
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.opinion-item { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--rule); }
.opinion-author {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray);
  margin-bottom: 4px;
}
.opinion-headline { font-size: 1.125rem; font-weight: 400; font-style: italic; line-height: 1.3; margin-bottom: 6px; }

.rail-box {
  background: #f7f7f5;
  padding: 16px;
  margin-bottom: 16px;
}
.rail-box-label { font-family: var(--sans); font-size: 0.75rem; font-weight: 700; margin-bottom: 8px; }
.rail-box-text { font-size: 0.875rem; line-height: 1.5; color: var(--ink-soft); margin-bottom: 6px; }
.puzzle-box { border-top: 3px solid var(--ink); background: #fdf9ee; }

/* Lower grid */

.front-lower {
  grid-column: 1 / -1;
  margin-top: 32px;
  padding-top: 8px;
}
.lower-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.lower-story { padding-right: 24px; border-right: 1px solid var(--rule); }
.lower-story:last-child, .lower-grid .lower-story:nth-child(4n) { border-right: none; padding-right: 0; }
.lower-story h3 { font-size: 0.9375rem; font-weight: 700; line-height: 1.3; margin-bottom: 6px; }
.lower-story .summary { font-size: 0.8125rem; margin-bottom: 6px; }

/* ------------------------------------------------------------------ */
/* Article page                                                        */
/* ------------------------------------------------------------------ */

.story { max-width: 720px; margin: 12px auto 0; }

.story-section {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 14px;
}
.story-section a:hover { text-decoration: underline; }
.story-section .sep { color: var(--rule); margin: 0 4px; }

.story-headline {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
  font-style: italic;
}
.story-subhead {
  font-size: 1.1875rem;
  line-height: 1.4;
  font-weight: 400;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

.story-art { margin-bottom: 20px; }
.story-art svg { width: 100%; height: auto; }
.story-art .credit { color: #b0b0b0; }

.story-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 28px;
}
.story-byline { font-family: var(--sans); font-size: 0.8125rem; }
.story-byline .author { font-weight: 700; }
.story-date { font-family: var(--sans); font-size: 0.75rem; color: var(--gray-light); margin-top: 3px; }
.share-tools { display: flex; gap: 8px; }
.share-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  cursor: default;
}
.share-btn:hover { background: #f7f7f5; }

.story-body { max-width: 600px; margin: 0 auto; }
.story-body p {
  font-size: 1.1875rem;
  line-height: 1.75;
  margin-bottom: 1.6em;
}
.story-body p.opener::first-letter {
  font-size: 3.2em;
  font-weight: 700;
  float: left;
  line-height: 0.82;
  padding: 4px 8px 0 0;
}

.story-tagline {
  max-width: 600px;
  margin: 0 auto;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 300;
  color: var(--gray-light);
  font-style: italic;
  border-top: 1px solid var(--rule);
  padding-top: 14px;
}

.related { max-width: 1200px; margin: 48px auto 0; }

/* ------------------------------------------------------------------ */
/* Section page                                                        */
/* ------------------------------------------------------------------ */

.section-header { border-bottom: 1px solid var(--rule-dark); padding-bottom: 14px; margin-bottom: 8px; }
.section-header h1 { font-size: 2rem; font-weight: 700; }
.section-tagline { font-size: 0.9375rem; color: var(--gray); margin-top: 4px; font-style: italic; }

.section-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}
.section-item h2 { font-size: 1.375rem; font-weight: 700; line-height: 1.25; margin-bottom: 8px; }
.section-thumb { margin: 0; }

/* ------------------------------------------------------------------ */
/* The Games Page                                                      */
/* ------------------------------------------------------------------ */

:root { --cw-cell: 46px; }

.games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 20px;
}
.game-panel { border: 1px solid var(--rule); border-top: 3px solid var(--ink); padding: 20px 22px; }
.game-title { font-family: var(--serif); font-size: 1.375rem; font-weight: 700; }
.game-sub { font-family: var(--sans); font-size: 0.75rem; color: var(--gray); margin: 4px 0 14px; }
.game-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.game-msg { font-family: var(--sans); font-size: 0.75rem; font-style: italic; color: var(--gray); }

/* crossword */
.cw-layout { display: flex; gap: 22px; flex-wrap: wrap; }
.cw-grid { display: grid; gap: 0; border: 2px solid var(--ink); width: fit-content; height: fit-content; }
.cw-block { width: var(--cw-cell); height: var(--cw-cell); background: var(--ink); }
.cw-cell { position: relative; width: var(--cw-cell); height: var(--cw-cell); border: 1px solid #b8b8b8; }
.cw-cell input {
  width: 100%; height: 100%;
  border: none; outline: none;
  text-align: center;
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  background: transparent;
  padding-top: 6px;
}
.cw-num {
  position: absolute; top: 1px; left: 3px;
  font-family: var(--sans); font-size: 0.5625rem; font-weight: 600;
  pointer-events: none;
}
.cw-cell.cw-active { background: #fdf3d8; }
.cw-cell.cw-wrong { background: #f6dfdb; }
.cw-cell.cw-wrong input { color: #a52a1d; }
.cw-clues { flex: 1; min-width: 200px; font-family: var(--sans); font-size: 0.8125rem; }
.cw-clues h3 { font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--rule); padding-bottom: 4px; margin: 10px 0 6px; }
.cw-clues ol { list-style: none; }
.cw-clues li { padding: 4px 6px; line-height: 1.4; cursor: pointer; }
.cw-clues li:hover { background: #f7f7f5; }
.cw-clues li.cw-clue-on { background: #fdf3d8; }

/* turtle sudoku */
.su-grid {
  display: grid;
  grid-template-columns: repeat(6, 52px);
  border: 2px solid var(--ink);
  width: fit-content;
}
.su-cell {
  width: 52px; height: 52px;
  border: 1px solid #b8b8b8;
  background: var(--paper);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
}
.su-cell:disabled { cursor: default; }
.su-given { box-shadow: inset 0 0 0 2px rgba(18, 18, 18, 0.35); }
.su-box-l { border-left: 2px solid var(--ink); }
.su-box-t { border-top: 2px solid var(--ink); }
.su-wrong { outline: 3px solid #a52a1d; outline-offset: -3px; }
.su-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; font-family: var(--sans); font-size: 0.75rem; }
.su-key { display: inline-flex; align-items: center; gap: 5px; }
.su-chip { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border: 1px solid var(--rule); }

@media (max-width: 980px) {
  .games-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  :root { --cw-cell: 38px; }
  .su-grid { grid-template-columns: repeat(6, 44px); }
  .su-cell { width: 44px; height: 44px; }
}

/* ------------------------------------------------------------------ */
/* What's Happening (calendar)                                         */
/* ------------------------------------------------------------------ */

.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 18px 0 12px;
}
.cal-month { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; }

.cal-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 2px solid var(--ink);
}
.cal-grid th {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 0;
  border-bottom: 2px solid var(--ink);
  background: #f7f7f5;
}
.cal-grid td {
  border: 1px solid var(--rule);
  vertical-align: top;
  height: 92px;
  padding: 4px 6px;
}
.cal-empty { background: #fafaf8; }
.cal-num { font-family: var(--sans); font-size: 0.75rem; font-weight: 600; color: var(--gray); }
.cal-today { background: #fdf3d8; }
.cal-today .cal-num { color: var(--ink); font-weight: 700; }
.cal-chip {
  display: block;
  font-family: var(--sans);
  font-size: 0.6875rem;
  line-height: 1.3;
  margin-top: 4px;
  padding: 2px 5px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-chip:hover { background: #3a3a3a; }
.cal-chip-cont { background: #8a8a8a; }
.cal-chip-cont:hover { background: #6a6a6a; }

.event-list { margin-top: 8px; }
.event-item {
  display: flex;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.event-when { flex: 0 0 64px; text-align: center; }
.event-daynum { display: block; font-family: var(--serif); font-size: 1.75rem; font-weight: 700; line-height: 1; }
.event-time { display: block; font-family: var(--sans); font-size: 0.6875rem; color: var(--gray); margin-top: 3px; }
.event-title { font-family: var(--serif); font-size: 1.0625rem; font-weight: 700; }
.event-place { font-family: var(--sans); font-size: 0.75rem; color: var(--gray); }
.event-blurb { font-size: 0.9375rem; color: var(--ink-soft); margin-top: 3px; }

@media (max-width: 600px) {
  .cal-grid td { height: 64px; padding: 2px 3px; }
  .cal-chip { font-size: 0.5625rem; }
}

/* ------------------------------------------------------------------ */
/* 404 + footer                                                        */
/* ------------------------------------------------------------------ */

.notfound { max-width: 600px; margin: 60px auto; text-align: center; }
.notfound h1 { font-size: 2rem; font-style: italic; margin-bottom: 16px; }

.site-footer {
  border-top: 3px double var(--ink);
  margin-top: 40px;
  padding: 28px 16px 40px;
  text-align: center;
}
.footer-nameplate { font-family: var(--blackletter); font-size: 1.75rem; }
.footer-motto { font-size: 0.8125rem; font-style: italic; color: var(--gray); margin: 6px 0 14px; }
.footer-links {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin-bottom: 16px;
}
.footer-links a { font-family: var(--sans); font-size: 0.6875rem; font-weight: 600; color: var(--gray); }
.footer-links a:hover { text-decoration: underline; }
.footer-fine { font-family: var(--sans); font-size: 0.625rem; color: #b0b0b0; max-width: 620px; margin: 0 auto; line-height: 1.6; }

/* ------------------------------------------------------------------ */
/* Uploaded photos                                                     */
/* ------------------------------------------------------------------ */

.story-photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ------------------------------------------------------------------ */
/* The Newsroom (admin)                                                */
/* ------------------------------------------------------------------ */

.newsroom { max-width: 1100px; margin: 0 auto; }

.newsroom-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.newsroom-actions { display: flex; gap: 8px; }

.import-report {
  font-family: var(--sans);
  font-size: 0.8125rem;
  border: 1px solid var(--rule);
  padding: 14px 16px;
  margin-top: 16px;
}
.import-report p { margin: 4px 0; }
.import-ok { color: #0a7c3f; }
.import-err { color: #a52a1d; }
.import-warn { color: var(--gray); font-style: italic; }
.newsroom-form textarea[name="payload"] { font-family: ui-monospace, Menlo, monospace; font-size: 0.8125rem; }

/* Auth */

.logout-form { display: inline; }
.logout-form button {
  font-family: var(--sans);
  font-size: 0.6875rem;
  color: var(--gray);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.logout-form button:hover { text-decoration: underline; }

.login-card {
  max-width: 420px;
  margin: 48px auto;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
  padding: 28px 28px 20px;
}
.login-title { font-size: 1.5rem; font-style: italic; margin-bottom: 8px; }
.login-sub { font-size: 0.9375rem; line-height: 1.5; color: var(--ink-soft); margin-bottom: 16px; }
.login-error {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: #a52a1d;
  border: 1px solid #a52a1d;
  padding: 8px 12px;
  margin-bottom: 14px;
}
.login-success {
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: #0a7c3f;
  border: 1px solid #0a7c3f;
  padding: 8px 12px;
  margin-bottom: 14px;
}
.gate-staff {
  font-family: var(--sans);
  font-size: 0.6875rem;
  color: var(--gray-light);
  text-align: center;
  margin-top: 18px;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}
.make-public-form { margin-top: 14px; border-top: 1px solid var(--rule); padding-top: 14px; }

.login-form input[type="password"] {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 8px 10px;
  font-size: 1rem;
  border: 1px solid #c9c9c9;
}

.api-token-box {
  font-family: var(--sans);
  font-size: 0.75rem;
  margin-top: 20px;
  border: 1px solid var(--rule);
  padding: 12px 16px;
}
.api-token-box summary { cursor: pointer; font-weight: 700; }
.api-token-box p { margin: 10px 0 4px; color: var(--gray); }
.api-token-box pre {
  background: #f7f7f5;
  padding: 10px 12px;
  overflow-x: auto;
  font-size: 0.6875rem;
  line-height: 1.5;
}

.spec-box {
  font-family: var(--sans);
  font-size: 0.75rem;
  margin-top: 24px;
  border: 1px solid var(--rule);
  padding: 12px 16px;
}
.spec-box summary { cursor: pointer; font-weight: 700; }
.spec-box .hint { display: block; color: var(--gray-light); margin: 10px 0; }
/* The Pantry + recipe cards */

.pantry-shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.pantry-item {
  border: 1px solid var(--rule);
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.pantry-name { font-family: var(--serif); font-weight: 700; font-size: 0.9375rem; }
.pantry-note { font-family: var(--sans); font-size: 0.6875rem; color: var(--gray); margin-top: 2px; }
.pantry-pick { text-align: left; }

/* Test Kitchen: tri-state ingredients + vibe chips */

.tri-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.tri-card { border: 1px solid var(--rule); padding: 10px 12px; }
.tri-card .ref-kind { text-transform: none; letter-spacing: 0; margin-top: 1px; }
.tri-options { display: flex; margin-top: 8px; border: 1px solid #c9c9c9; width: fit-content; }
.tri-options label { margin: 0; font-weight: 400; }
.tri-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tri-options span {
  display: inline-block;
  padding: 4px 10px;
  font-family: var(--sans);
  font-size: 0.6875rem;
  cursor: pointer;
  border-right: 1px solid #c9c9c9;
  color: var(--gray);
}
.tri-options label:last-child span { border-right: none; }
.tri-options input:checked + span { background: var(--ink); color: var(--paper); }
.tri-options input[value="must"]:checked + span { background: #7a4f2a; }

.vibe-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.vibe-chip { margin: 0; font-weight: 400; }
.vibe-chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.vibe-chip span {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid #c9c9c9;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--gray);
  cursor: pointer;
}
.vibe-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.recipe-card {
  max-width: 600px;
  margin: 0 auto 28px;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
  background: #fdfbf5;
  padding: 22px 26px;
}
.recipe-label {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.recipe-meta { font-family: var(--sans); font-size: 0.8125rem; color: var(--gray); margin: 4px 0 14px; }
.recipe-cols { display: grid; grid-template-columns: 1fr 1.4fr; gap: 22px; }
.recipe-card h3 {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
  margin-bottom: 10px;
}
.recipe-card ul, .recipe-card ol { padding-left: 20px; }
.recipe-card li { font-size: 0.9375rem; line-height: 1.55; margin-bottom: 8px; }
.recipe-footnote {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-style: italic;
  color: var(--gray-light);
  border-top: 1px solid var(--rule);
  padding-top: 10px;
  margin-top: 16px;
}
@media (max-width: 600px) {
  .recipe-cols { grid-template-columns: 1fr; }
}

/* Drag-and-drop upload zones */

.dropzone {
  margin-top: 6px;
  border: 2px dashed #c9c9c9;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover { border-color: var(--gray); }
.dropzone.dz-over { border-color: var(--ink); background: #f7f7f5; }
.dropzone.dz-pasted { border-color: #0a7c3f; background: #f2f8f4; }
.dz-text { font-family: var(--sans); font-size: 0.75rem; color: var(--gray); }
.dz-previews { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.dz-previews img { max-height: 90px; width: auto; border: 1px solid var(--rule); }
.dz-previews:empty { display: none; }
.dz-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* Sections management */

.sections-table td { vertical-align: middle; }
.section-edit-form { display: flex; gap: 8px; align-items: center; }
.section-edit-form input[type="text"] {
  padding: 7px 10px;
  font-family: var(--serif);
  font-size: 0.875rem;
  border: 1px solid #c9c9c9;
}
.section-edit-form input[name="name"] { width: 160px; font-weight: 700; }
.section-edit-form input[name="tagline"] { flex: 1; min-width: 200px; color: var(--gray); }
.btn-move { padding: 8px 10px; }
.btn:disabled { opacity: 0.35; cursor: default; }
.btn:disabled:hover { background: var(--paper); color: inherit; }
.btn-danger:disabled:hover { background: var(--paper); color: #a52a1d; }

/* The Library + AI Desk */

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.library-card { border: 1px solid var(--rule); display: flex; flex-direction: column; }
.library-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}
.library-photo-empty {
  display: flex; align-items: center; justify-content: center;
  background: #f2f2f0; color: #b0b0b0;
  font-family: var(--sans); font-size: 0.6875rem;
}
.library-body { padding: 12px 14px 14px; }
.library-name { font-family: var(--serif); font-weight: 700; font-size: 0.9375rem; margin-bottom: 6px; }
.library-desc { font-family: var(--sans); font-size: 0.75rem; color: var(--gray); line-height: 1.5; margin-bottom: 10px; }
.library-actions { display: flex; gap: 6px; }
.library-actions form { display: inline; }

.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.ref-card {
  border: 1px solid var(--rule);
  padding: 8px;
  text-align: center;
  cursor: pointer;
  font-weight: 400;
  display: flex; flex-direction: column; gap: 4px;
}
.ref-card:has(input:checked) { outline: 2px solid var(--ink); }
.ref-card input { margin: 0 auto; }
.ref-card img, .ref-noimg {
  width: 100%; aspect-ratio: 16/10; object-fit: cover;
  background: #f2f2f0; color: #b0b0b0;
  display: flex; align-items: center; justify-content: center;
}
.ref-name { font-family: var(--serif); font-weight: 700; font-size: 0.8125rem; }
.ref-kind { font-family: var(--sans); font-size: 0.625rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-light); }

.spec-box #spec-text {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.6875rem;
  line-height: 1.5;
  border: 1px solid var(--rule);
  background: #f7f7f5;
  color: var(--ink-soft);
  resize: vertical;
}

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: #f2f2f0; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #333; }
.btn-danger { border-color: #a52a1d; color: #a52a1d; }
.btn-danger:hover { background: #a52a1d; color: var(--paper); }

.newsroom-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-family: var(--sans);
}
.newsroom-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray);
  padding: 8px 12px;
  border-bottom: 1px solid var(--rule-dark);
}
.newsroom-table td {
  padding: 12px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.cell-art { width: 88px; }
.cell-art svg, .cell-art .story-photo { width: 72px; aspect-ratio: 16/9; height: auto; }
.cell-headline { font-family: var(--serif); font-size: 0.9375rem; font-weight: 700; line-height: 1.3; }
.cell-meta { font-size: 0.75rem; color: var(--gray); white-space: nowrap; }
.cell-actions { white-space: nowrap; }
.cell-actions form { display: inline-block; margin-left: 6px; }

.badge {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  margin-left: 8px;
  background: var(--ink);
  color: var(--paper);
  vertical-align: middle;
}
.badge-soft { background: #f2f2f0; color: var(--gray); border: 1px solid var(--rule); }

.newsroom-note {
  font-family: var(--sans);
  font-size: 0.6875rem;
  color: var(--gray-light);
  font-style: italic;
  margin-top: 12px;
}

/* Story form */

.newsroom-form { max-width: 760px; }

.story-form fieldset {
  border: 1px solid var(--rule);
  padding: 20px;
  margin-top: 20px;
}
.story-form legend {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 8px;
}
.story-form label {
  display: block;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 14px;
}
.story-form .hint { font-weight: 300; color: var(--gray-light); }
.story-form .req { font-weight: 300; color: #a52a1d; }
.story-form input[type="text"], .story-form select, .story-form textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 8px 10px;
  font-family: var(--serif);
  font-size: 0.9375rem;
  border: 1px solid #c9c9c9;
  background: var(--paper);
  color: var(--ink);
}
.story-form textarea { line-height: 1.6; resize: vertical; }
.story-form input:focus, .story-form select:focus, .story-form textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
}
.story-form input[type="file"] { margin-top: 6px; font-family: var(--sans); font-size: 0.75rem; }
.story-form .check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.story-form .check input { margin: 0; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

.palette-inputs { display: flex; gap: 8px; margin-top: 5px; }
.palette-inputs input[type="color"] {
  width: 52px; height: 34px;
  padding: 2px;
  border: 1px solid #c9c9c9;
  background: var(--paper);
  cursor: pointer;
}

.art-preview { max-width: 380px; margin-bottom: 16px; }
.art-preview svg, .art-preview .story-photo { width: 100%; height: auto; }
.art-preview .hint { font-family: var(--sans); font-size: 0.6875rem; margin-top: 6px; display: block; }

.library-fold {
  border: 1px solid var(--rule);
  margin: 4px 0 14px;
}
.library-fold summary {
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 10px 14px;
  list-style-position: inside;
}
.library-fold summary:hover { background: #f7f7f5; }
.library-fold[open] summary { border-bottom: 1px solid var(--rule); }
.library-fold .fold-meta { font-weight: 300; color: var(--gray-light); margin-left: 6px; }
.library-fold .hint { display: block; padding: 10px 14px 0; }
.library-fold .ref-grid { padding: 12px 14px 14px; margin-top: 0; }

.palette-help { font-family: var(--sans); font-size: 0.75rem; margin-bottom: 14px; }
.palette-help summary { cursor: pointer; font-weight: 600; }
.palette-help ul { list-style: none; margin-top: 8px; }
.palette-help li { display: flex; align-items: center; gap: 4px; padding: 3px 0; }
.palette-help li code { color: var(--gray-light); }
.swatch { width: 16px; height: 16px; display: inline-block; border: 1px solid var(--rule); }

.form-actions { margin-top: 20px; display: flex; gap: 10px; }

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .front { grid-template-columns: 1fr; }
  .front-main { border-right: none; padding-right: 0; }
  .front-opinion { margin-top: 28px; border-top: 3px solid var(--ink); padding-top: 14px; }
  .lower-grid { grid-template-columns: repeat(2, 1fr); }
  .lower-grid .lower-story:nth-child(2n) { border-right: none; padding-right: 0; }
  .masthead { grid-template-columns: 1fr; gap: 4px; }
  .masthead-side { display: none; }
}

@media (max-width: 600px) {
  .top-stories { grid-template-columns: 1fr; }
  .top-story { border-right: none; padding-right: 0; border-bottom: 1px solid var(--rule); padding-bottom: 16px; }
  .top-story:last-child { border-bottom: none; }
  .lower-grid { grid-template-columns: 1fr; }
  .lower-story { border-right: none; padding-right: 0; border-bottom: 1px solid var(--rule); padding-bottom: 16px; }
  .section-item { grid-template-columns: 1fr; }
  .section-thumb { order: -1; }
  .nameplate { white-space: normal; }
}

/* ------------------------------------------------------------------ */
/* Dictation (the mic buttons dictate.js adds to newsroom fields)      */
/* ------------------------------------------------------------------ */

.story-form label.has-mic { position: relative; }
.mic-btn {
  position: absolute;
  top: -5px; right: 0;
  width: 27px; height: 27px;
  padding: 0;
  border: 1px solid #c9c9c9;
  border-radius: 50%;
  background: var(--paper);
  font-size: 13px; line-height: 1;
  cursor: pointer;
}
.mic-btn:hover { background: #f2f2f0; }
.mic-btn.recording {
  background: #a52a1d;
  border-color: #a52a1d;
  animation: mic-pulse 1.2s ease-in-out infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(165, 42, 29, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(165, 42, 29, 0); }
}
