/* The 2026-10-08 refresh. Loaded after every other sheet, so it has the last
   word on colour, type and spacing. The idea: a quiet night-time tool. Fewer
   boxes, fewer outlines, more space, and the numbers doing the talking.
   Page sheets still own their layouts; this one owns how things look. */

:root {
  /* Deeper night, cleaner surfaces. Same three accents with the same jobs:
     lantern = the main action, water = on/selected, sage = progress. */
  --dusk: #18212C;
  --slate: #212C39;
  --chalk: #ECE8DA;
  --lantern: #F0BD5E;
  --water: #8CC3D1;
  --sage: #B3CE8F;
  --raised: #283545;
  --ink3: #2D3B4C;
  --field: #141C26;
  --muted: color-mix(in srgb, var(--chalk) 68%, var(--slate));
  --line: color-mix(in srgb, var(--chalk) 11%, var(--slate));
  --line-strong: color-mix(in srgb, var(--chalk) 30%, var(--slate));
  --on-wash: color-mix(in srgb, var(--water) 14%, var(--slate));
  --on-dim: color-mix(in srgb, var(--water) 45%, var(--slate));
  --tile: var(--slate);
  --r-sm: 6px;
  --r-md: 12px;
  --shadow: none;
}

body { font-size: 14px; background: var(--dusk); }
body::before { display: none; }
::selection { background: color-mix(in srgb, var(--water) 35%, transparent); }

/* Type: the sign-painted serif only for page titles and the brand. Section
   titles are plain bold sans — a tool, not a storybook. */
h1, .dispatch-copy h1 { font-size: 34px; letter-spacing: -.01em; }
@media (min-width: 1200px) { h1, .dispatch-copy h1 { font-size: 38px; } }
h2, .ticket-stub span {
  font-family: var(--prose) !important; font-weight: 700 !important;
  font-size: 18px; letter-spacing: 0;
}
.goal-title h2 { font-family: var(--display) !important; font-weight: 400 !important; font-size: 30px; }
.page-intro, .inventory-intro, .tower-ledger-head, .quest-hero {
  border-bottom: 0; padding-top: 28px; padding-bottom: 20px;
}
.page-intro p, .inventory-intro p, .quest-hero p, .tower-ledger-copy p { margin-top: 6px; color: var(--muted); }

/* Header: slimmer, tabs are words with an underline, not buttons. */
.masthead {
  height: 60px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--dusk) 92%, transparent);
  backdrop-filter: blur(8px);
}
.brand { min-width: 0; gap: 10px; }
.brand-logo { width: 30px; height: 30px; }
.brand strong { font-size: 19px; }
.brand small { display: none; }
.tabs { gap: 2px; margin-left: auto; }
.tab-sep { opacity: .6; height: 16px; }
.tab {
  position: relative; padding: 8px 10px; border: 0; border-radius: var(--r-sm);
  background: transparent; box-shadow: none; font-weight: 700; font-size: 13.5px; color: var(--muted);
}
.tab:hover { background: transparent; color: var(--text); }
.tab.active { background: transparent; border: 0; box-shadow: none; color: var(--text); }
.tab.active::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -11px;
  height: 2px; border-radius: 2px; background: var(--water);
}

/* "Example farm" note: one slim line, aligned with the page. */
.example-farm {
  width: min(1120px, 92vw); margin: 16px auto 0; padding: 8px 8px 8px 14px;
  border: 0; border-radius: var(--r-md); background: var(--on-wash);
}
.example-farm p { font-size: 13px; }

/* Surfaces: one fill, a hairline, rounded. No lips, no shadows, no stacked outlines. */
.dispatch-ticket, .route-card, .gather-panel, .tower-cost-card,
.make-buy, .workbench, .tree-card, .source-list,
.perk-group, .infra-card, .meal-card, .data-card,
.goal-controls, .mine-row, .quest-line, .inventory-panel,
.account-import-copy, .account-empty, .places-card, .places-controls,
.trip-row, .tower-floor, .tower-toolbar, .tower-summary, .tower-next-stamp, .quest-filters {
  background: var(--slate); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: none;
}
.dispatch-ticket { border-top: 1px solid var(--line); }
.make-buy, .workbench, .tree-card { padding: 20px 24px; }
.make-buy h2, .workbench h2, .tree-card h2 { font-size: 17px; }

/* Rows inside a surface are separated by hairlines, not boxed one by one. */
.decision-list { border-top: 0; }
.decision-row {
  background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 10px 0;
}
.decision-row:last-child { border-bottom: 0; }
td, th { border-color: var(--line); }
th { color: var(--muted); font-weight: 700; font-size: 12px; }
tbody tr:hover td { background: color-mix(in srgb, var(--chalk) 3%, transparent); }

/* Controls. Words in the prose face; only numbers are monospaced. */
select, input[type=search], #search, #homeSearch, .places-mode { font-family: var(--prose) !important; }
.tower-summary { margin-bottom: 20px; }
:is(input, select, textarea):not([type=checkbox]):not([type=radio]):not([type=file]) {
  background-color: var(--field); border-color: var(--line-strong); border-radius: var(--r-sm);
}
:is(input, select, textarea):not([type=checkbox]):not([type=radio]):focus { border-color: var(--water); }
.quiet-button, .places-chip, .places-mode, .quest-filters button, .presets button {
  background: transparent; border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--text); font-size: 12.5px;
}
.quiet-button:hover, .places-chip:hover, .places-mode:hover, .quest-filters button:hover {
  background: var(--ink3); border-color: var(--line-strong);
}
.places-chip.active, .places-mode.active, .quest-filters button.active, .tab.active #perkCount {
  background: var(--on-wash); border-color: var(--water); color: var(--text); box-shadow: none;
}
#homeGoal button[type=submit], .primary-action, .primary-link {
  border-radius: var(--r-sm); box-shadow: none; border-color: var(--lantern);
}

/* Labels the box already explains are kept for screen readers only. */
.field > span, .places-field > span, .trip-field > span, .trip-filter > span,
.quest-search > span, .inventory-search > span {
  position: absolute !important; width: 1px; height: 1px; margin: 0; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ticket-stub { border: 0; padding-bottom: 0; }

/* Calculate: a title, then one bar — item × how many. */
#planner .goal-board { display: block; padding: 28px 0 8px; border-bottom: 0; }
#planner .goal-copy h1 { margin: 0 0 14px; }
#planner .goal-controls {
  max-width: none; padding: 8px; gap: 8px; align-items: center;
  grid-template-columns: minmax(0, 1fr) 200px;
}
#planner .goal-controls input { border: 0; background: var(--field); font-size: 16px; padding: 14px 16px; }
#planner .quantity-field { position: relative; }
#planner .quantity-field::before {
  content: "×"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font: 500 16px var(--data); pointer-events: none; z-index: 1;
}
#planner .quantity-field input { padding-left: 34px; }
.resource-trail:empty { display: none; }
.goal-header { padding: 24px 0 20px; }

/* Ingredient table: the dropdown alone says what was picked. */
.route-select { min-width: 140px; margin-right: 0; }
.workbench-actions { flex-wrap: wrap; justify-content: flex-end; }
.decision-row { grid-template-columns: 34px minmax(0, 1fr) 220px; }
.decision-row select { width: 100%; }

/* Places: rows are a quiet list; the "Open" word becomes a chevron. */
.places-card { margin-bottom: 0; }
.places-card > summary:hover { background: color-mix(in srgb, var(--chalk) 3%, transparent); }
.places-headline strong { font-family: var(--prose); font-weight: 700; font-size: 15px; }
.places-cue::after {
  content: ""; display: block; width: 8px; height: 8px; margin-right: 6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg); transition: transform .15s;
}
.places-card[open] > summary .places-cue::after { content: ""; transform: rotate(45deg); }

/* Quests: one line of totals instead of four cards. */
.quest-summary { display: block; }
.quest-stats { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.quest-stats b { color: var(--text); }
.quest-line { margin-bottom: 8px; }
.quest-line-tag { border-radius: 999px; }

/* Setup: perk groups read as lists. */
.perk-group h3, .infra-card h3, .meal-card h3 { font-size: 16px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); color: var(--muted); }

/* Corner quest panels: same surface as everything else. */
.quest-tracker { background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }

@media (max-width: 820px) {
  .places-pour { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .places-pour .places-field { width: auto; min-width: 0; }
  .places-pour .places-field :is(input, select) { width: 100%; }
  .places-pour .grow { grid-column: 1 / -1; }
  #planner .goal-controls { grid-template-columns: minmax(0, 1fr) 140px; }
  .decision-row { grid-template-columns: 34px minmax(0, 1fr); }
  .decision-row select { grid-column: 2; }
  .tab.active::after { bottom: -2px; }
  .masthead { height: auto; }
}

/* Setup: a small picture on every perk; four-tier perks pick their tier. */
.perk-head { display: flex; align-items: center; gap: 10px; }
.item-art.perk-art { width: 32px; height: 32px; flex: none; border-radius: var(--r-sm); background: var(--field); }
.item-art.perk-art img { width: 28px; height: 28px; object-fit: contain; }
.perk-row.tiered { cursor: default; }
.tier-pick { display: inline-flex; margin-top: 10px; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.tier-btn {
  min-width: 40px; min-height: 30px; padding: 0 10px; border: 0; border-right: 1px solid var(--line);
  background: transparent; color: var(--muted); font: 700 12px var(--prose); cursor: pointer;
}
.tier-btn:last-child { border-right: 0; }
.tier-btn:hover { color: var(--text); background: var(--ink3); }
.tier-btn.on { background: var(--on-wash); color: var(--text); box-shadow: inset 0 -2px var(--water); }

/* Effectiveness, typed where the Cider cost is - Calculate and Trips. */
.eff-inline { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.eff-inline input { width: 64px; padding: 4px 6px !important; font: 500 12px var(--data); text-align: right; }
.trip-eff { grid-column: 1 / -1; margin: 6px 0 0; }
.trip-meals { margin-bottom: 12px; }

/* Account: one line once a farm is loaded. */
.account-loaded { margin-top: 16px; padding: 14px 16px; border-radius: var(--r-md); background: var(--slate); border: 1px solid var(--line); }
.account-loaded p { margin: 0; display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.account-loaded strong { color: var(--text); }
.account-loaded span { color: var(--muted); font-size: 13px; }

/* Account guide: the site list folds away; the steps carry the page. */
.sync-guide-head p { max-width: 70ch; }
.sync-steps code { white-space: nowrap; }
.sync-permissions { margin-top: 24px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--slate); }
.sync-permissions > summary { cursor: pointer; color: var(--water); font-weight: 700; font-size: 13px; }
.sync-permissions[open] > summary { margin-bottom: 10px; }
.sync-download { margin: 4px 0 12px !important; }
.sync-download .primary-link { display: inline-flex; align-items: center; padding: 10px 16px; text-decoration: none; }
.account-import-copy h2 { font-size: 17px !important; }

/* Calculate: where an item comes from when nothing can be costed. */
.where-from { display: grid; gap: 3px; }
.where-from span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.where-from span::before { content: "· "; color: var(--line-strong); }
.where-from b { font-size: 12px; color: var(--text); margin-top: 6px; }
.path-choices.compact { flex-wrap: wrap; align-items: center; }
.path-sep { align-self: center; margin: 0 2px 0 8px; color: var(--muted); font-size: 11px; }
.goal-meal { margin-top: 6px; }
