/* PackOut — surveyor's flagging tape on a topo map.
   Ink on paper; one hi-vis flagging color (surveyor pink) does all interactive
   work; green/red/amber are reserved for Verdicts (arrive with ticket #6). */

:root {
  --ink: #26221c;
  --ink-soft: #5c554a;
  --paper: #f4f0e6;
  --paper-raised: #fbf8f1;
  --line: #d8d1c0;
  --flag: #e6007e;          /* surveyor pink — interactive only */
  --flag-ink: #ffffff;
  --display: "Big Shoulders", "Arial Narrow", sans-serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.45;
  min-height: 100dvh;
}

.mono { font-family: var(--mono); font-size: 0.8em; letter-spacing: 0.01em; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

/* ---------- masthead ---------- */

.masthead {
  display: flex; align-items: baseline; gap: 0.75rem;
  padding: 0.9rem 1rem 0.7rem;
  border-bottom: 3px solid var(--ink);
}

.wordmark {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.9rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
}

.masthead-nav {
  display: flex; gap: 1rem; margin-left: auto;
}

.masthead-nav a {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.5rem 0 0.35rem;
  border-bottom: 3px solid transparent;
}

.masthead-nav a:hover { color: var(--flag); }

.masthead-nav a.is-active { color: var(--ink); border-bottom-color: var(--flag); }

main { padding: 1rem; max-width: 44rem; margin-inline: auto; }

h1 {
  font-family: var(--display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 2.2rem;
  letter-spacing: 0.015em;
  line-height: 1;
}

/* ---------- buttons & links ---------- */

.btn {
  display: inline-block;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 1.05rem;
  padding: 0.55rem 1.1rem;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper-raised);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.btn-primary { background: var(--flag); border-color: var(--flag); color: var(--flag-ink); }
.btn-primary:active { translate: 0 1px; }

.btn-quiet {
  font-family: var(--mono); font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 0.1em; background: none; border: none;
  color: var(--ink-soft); text-decoration: underline; cursor: pointer;
  padding: 0.5rem;
}

.crumb {
  font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--ink-soft); text-decoration: none;
  display: inline-block; margin-bottom: 0.75rem;
}

.crumb:hover, .btn-quiet:hover { color: var(--flag); }

/* ---------- dashboard ---------- */

.dashboard-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}

.empty {
  border: 2px dashed var(--line);
  padding: 2rem 1.25rem;
  color: var(--ink-soft);
  display: grid; gap: 0.5rem;
}

.trip-cards { list-style: none; padding: 0; display: grid; gap: 0.75rem; }

.trip-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  display: flex; align-items: stretch;
}

.trip-card-link {
  flex: 1; display: grid; gap: 0.15rem;
  padding: 0.85rem 1rem; text-decoration: none; color: var(--ink);
  border-left: 6px solid var(--flag);
}

.trip-name { font-family: var(--display); font-weight: 900; font-size: 1.5rem; text-transform: uppercase; line-height: 1.05; }
.trip-dest { color: var(--ink-soft); }
.trip-meta { color: var(--ink-soft); }

/* ---------- forms ---------- */

.form-screen form { display: grid; gap: 1rem; margin-top: 1.25rem; }

label { display: grid; gap: 0.3rem; font-weight: 700; }

label small { font-weight: 400; color: var(--ink-soft); }

input, select {
  font: inherit;
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper-raised);
  color: var(--ink);
  min-height: 44px;
}

input:focus-visible, select:focus-visible, .btn:focus-visible, a:focus-visible {
  outline: 3px solid var(--flag);
  outline-offset: 2px;
}

/* ---------- trip view ---------- */

.trip-head { margin-bottom: 1.25rem; display: grid; gap: 0.35rem; }
.trip-sub { color: var(--ink-soft); }

.days { list-style: none; padding: 0; display: grid; gap: 0.75rem; }

.day-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-left: 6px solid var(--line);
  padding: 0.85rem 1rem;
  display: grid; gap: 0.7rem;
  align-content: start;
}

.day-card.accent-fueled { border-left-color: var(--v-fueled); }
.day-card.accent-short { border-left-color: var(--v-short); }
.day-card.accent-heavy { border-left-color: var(--v-heavy); }

.day-head { display: flex; align-items: center; gap: 0.75rem; }

.day-label {
  font-family: var(--display); font-weight: 900; font-size: 1.3rem;
  text-transform: uppercase;
}

.day-date { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-soft); flex: 1; }

.intensity select { min-height: 40px; padding: 0.35rem 0.5rem; }

.targets {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem 1rem;
  border-top: 1px solid var(--line); padding-top: 0.7rem;
}

.targets div { display: flex; justify-content: space-between; gap: 0.5rem; }

.targets dt { text-transform: uppercase; font-size: 0.65rem; letter-spacing: 0.1em; color: var(--ink-soft); }

.targets dd { font-size: 0.78rem; font-weight: 700; text-align: right; white-space: nowrap; }

.targets .floor { display: block; font-weight: 400; color: var(--ink-soft); font-size: 0.85em; }

/* ---------- verdicts ---------- */

:root {
  --v-fueled: #2f6b33;
  --v-short: #b3261e;
  --v-heavy: #9a6a00;
}

.badge {
  font-family: var(--mono); font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  padding: 0.2rem 0.45rem; color: var(--paper-raised);
}

.badge-fueled { background: var(--v-fueled); }
.badge-short { background: var(--v-short); }
.badge-heavy { background: var(--v-heavy); }

.verdict {
  border: 1px solid var(--line); border-left: 8px solid var(--line);
  background: var(--paper-raised);
  padding: 0.65rem 0.9rem; margin-bottom: 1rem;
  display: grid; gap: 0.5rem; justify-items: start;
}

.verdict-fueled { border-left-color: var(--v-fueled); }
.verdict-short { border-left-color: var(--v-short); }
.verdict-heavy { border-left-color: var(--v-heavy); }

.verdict .gap { font-weight: 700; }

.suggs { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.sugg {
  border: 2px solid var(--ink); background: var(--paper-raised);
  font: inherit; font-size: 0.8rem; padding: 0.45rem 0.6rem;
  cursor: pointer; min-height: 40px;
}

.sugg:hover { border-color: var(--flag); }

.sugg .mono { color: var(--ink-soft); font-size: 0.62rem; }

.trip-rollup { font-weight: 700; }

.trip-edit-link {
  font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--flag); text-decoration: none; font-weight: 700;
}

.trip-edit-link:hover { text-decoration: underline; }
.rollup-fueled { color: var(--v-fueled); }
.rollup-short { color: var(--v-short); }

.staple-tag {
  font-family: var(--mono); font-size: 0.58rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--flag); font-weight: 700;
  border: 1px solid currentColor; padding: 0.05rem 0.3rem; margin-left: 0.3rem;
  vertical-align: middle;
}

/* ---------- day meal builder ---------- */

.intensity { display: flex; align-items: center; gap: 0.45rem; }

.intensity-label {
  font-family: var(--mono); font-size: 0.6rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--ink-soft);
}

.macro-table {
  width: 100%; border-collapse: collapse;
  border-top: 1px solid var(--line);
}

.macro-table thead th {
  font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-soft); font-weight: 400;
  text-align: right; padding: 0.5rem 0 0.2rem;
}

.macro-table tbody th {
  font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-soft); font-weight: 400; text-align: left; padding: 0.18rem 0;
}

.macro-table td {
  font-size: 0.8rem; text-align: right; padding: 0.18rem 0 0.18rem 1.25rem;
  white-space: nowrap;
}

.macro-table td:nth-child(2) { font-weight: 700; }

.macro-table td:nth-child(3) { color: var(--ink-soft); }

.day-edit {
  font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.08em; font-weight: 700; color: var(--flag);
  text-decoration: none; justify-self: start; padding: 0.25rem 0;
}

.day-edit:hover { text-decoration: underline; }

.day-totals .totals-legend { flex-direction: row; justify-content: flex-end; }

.day-totals .totals-legend dd {
  font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-soft); font-weight: 400;
}

.day-screen-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.9rem; }
.day-screen-head h1 { font-size: 2rem; }
.day-screen-head .day-date { flex: 1; }

.day-totals { background: var(--paper-raised); border: 1px solid var(--line); padding: 0.7rem 1rem 0.8rem; margin-bottom: 1rem; }

.day-totals div { flex-direction: column; align-items: start; }

.day-totals dd { text-align: left; }

.slot { border-top: 3px solid var(--ink); padding: 0.7rem 0 1rem; }

.slot-head { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }

.slot-head h2 {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: 1.25rem;
}

.slot-target { color: var(--ink-soft); font-size: 0.65rem; }

.entries { list-style: none; padding: 0; margin: 0.35rem 0; display: grid; }

.entry {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.3rem 0; border-bottom: 1px solid var(--line);
}

.entry-name { flex: 1; min-width: 0; }

.entry-kcal { color: var(--ink-soft); font-size: 0.68rem; white-space: nowrap; }

.entry-ctl { display: flex; align-items: center; gap: 0.15rem; }

.entry-ctl button {
  min-width: 38px; min-height: 38px;
  border: 2px solid var(--ink); background: var(--paper-raised);
  font-family: var(--mono); font-size: 0.9rem; cursor: pointer;
}

.entry-ctl .qty { min-width: 1.4rem; text-align: center; font-weight: 700; }

.entry-ctl [data-rm], .snack-head [data-rm-snack] { border-color: var(--line); color: var(--ink-soft); }

.slot-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }

.btn-add {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--flag); text-decoration: none;
  padding: 0.5rem 0; display: inline-block; font-weight: 700;
}

.slot-sub { color: var(--ink-soft); font-size: 0.68rem; }

.snack-bundle { border: 1px solid var(--line); padding: 0.5rem 0.75rem; margin: 0.6rem 0; }

.snack-head { display: flex; align-items: center; gap: 0.6rem; }

.snack-head h3 {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: 1rem;
}

.snack-head .slot-sub { flex: 1; }

.snack-head button {
  min-width: 38px; min-height: 38px; border: 2px solid var(--line);
  background: var(--paper-raised); color: var(--ink-soft); cursor: pointer;
}

#add-snack { margin-top: 0.5rem; }

.copy-day {
  border-top: 3px solid var(--ink); padding: 1rem 0;
  display: flex; align-items: end; gap: 0.75rem;
}

.copy-day label { flex: 1; }

.picker input[type="search"] { width: 100%; margin-bottom: 0.9rem; }

.food-pick {
  all: unset; flex: 1; display: grid; gap: 0.1rem;
  padding: 0.55rem 0.25rem; cursor: pointer; min-height: 44px;
  box-sizing: border-box; width: 100%;
}

.food-pick:focus-visible { outline: 3px solid var(--flag); outline-offset: 2px; }

/* ---------- library ---------- */

.library input[type="search"] { width: 100%; margin-bottom: 0.9rem; }

.food-list { list-style: none; padding: 0; display: grid; }

.food-row {
  display: flex; align-items: center; gap: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.fav {
  background: none; border: none; cursor: pointer;
  font-size: 1.25rem; line-height: 1;
  color: var(--line);
  padding: 0.6rem 0.35rem;
}

.fav.is-fav { color: var(--flag); }

.food-link {
  flex: 1; display: grid; gap: 0.1rem;
  padding: 0.55rem 0.25rem;
  text-decoration: none; color: var(--ink);
  min-height: 44px;
}

.food-name { font-weight: 700; }

.food-macros { color: var(--ink-soft); font-size: 0.68rem; }

.macro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.form-screen form small { color: var(--ink-soft); }

/* ---------- outputs ---------- */

.trip-outputs { display: flex; gap: 0.5rem; margin-bottom: 1.1rem; flex-wrap: wrap; }

.trip-outputs .btn { font-size: 0.85rem; padding: 0.4rem 0.8rem; }

.check-list { list-style: none; padding: 0; display: grid; }

.check-row {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.45rem 0; border-bottom: 1px solid var(--line);
  font-weight: 400; cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 22px; height: 22px; min-height: 22px;
  accent-color: var(--flag); flex-shrink: 0;
}

.check-name { flex: 1; }

.check-name.is-done { text-decoration: line-through; color: var(--ink-soft); }

.check-qty { color: var(--ink-soft); font-size: 0.75rem; }

.pack-day { margin-bottom: 1.2rem; }

.pack-day h2 {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: 1.25rem; border-top: 3px solid var(--ink); padding-top: 0.5rem;
}

.pack-day .day-date { font-size: 0.7rem; margin-left: 0.4rem; }

.empty-line { color: var(--ink-soft); padding: 0.35rem 0; }

.ready-verdict {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: 1.8rem; margin-bottom: 1rem;
}

.ready-block { margin-bottom: 1.1rem; }

.ready-block h2 {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: 1.15rem;
}

.ready-block a, .unpacked a { color: var(--v-short); }

.unpacked { list-style: none; padding: 0.3rem 0 0; font-size: 0.72rem; display: grid; gap: 0.25rem; }

.corrupt-banner {
  border: 2px solid var(--v-short); border-left-width: 8px;
  padding: 0.7rem 0.9rem; margin-bottom: 1rem;
}

.corrupt-banner .btn-quiet { padding: 0; color: var(--v-short); }

/* ---------- backup ---------- */

.backup { border-top: 3px solid var(--ink); margin-top: 1.5rem; padding-top: 0.8rem; }

.backup h2 {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: 1.15rem;
}

.backup p { color: var(--ink-soft); margin: 0.25rem 0 0.7rem; }

.backup-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.btn-file { position: relative; overflow: hidden; }

.btn-file input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0;
}

/* ---------- draft assistant ---------- */

.draft-panel {
  border: 1px solid var(--line); border-left: 8px solid var(--flag);
  background: var(--paper-raised);
  padding: 0.9rem 1rem; margin-bottom: 1rem;
  display: grid; gap: 0.6rem; justify-items: start;
}

.draft-lead { font-weight: 700; }

.draft-note { color: var(--ink-soft); font-size: 0.85rem; }

.draft-all-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  margin: -0.4rem 0 1.1rem;
}

.draft-redo {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}

.draft-redo .btn { font-size: 0.8rem; padding: 0.35rem 0.7rem; }

/* ---------- gear + actions ---------- */

.gear-stats { color: var(--ink-soft); margin-bottom: 0.6rem; }

.gear-actions { margin-bottom: 1rem; align-items: end; }

.gear-import-label { display: grid; gap: 0.3rem; font-weight: 700; font-size: 0.85rem; }

.gear-new { display: grid; gap: 0.75rem; border-top: 3px solid var(--ink); margin-top: 1.25rem; padding-top: 0.8rem; }

.gear-new h2 {
  font-family: var(--display); font-weight: 900; text-transform: uppercase;
  font-size: 1.15rem;
}

.check-row .btn-quiet { text-decoration: none; font-size: 1rem; }

.action-add { display: flex; gap: 0.5rem; margin-top: 0.6rem; }

.action-add input { flex: 1; }

/* ---------- print ---------- */

@media print {
  .masthead, .crumb, .btn, .btn-quiet, .btn-add { display: none !important; }
  body { background: #fff; color: #000; }
  .check-row, .food-row, .entry { border-color: #999; }
  main { max-width: none; padding: 0; }
}

/* ---------- wider screens ---------- */

@media (min-width: 700px) {
  h1 { font-size: 3rem; }
  .targets { grid-template-columns: repeat(4, auto); }
  .targets div { flex-direction: column; }
  .targets dd { text-align: left; }
  .day-totals .totals-legend { grid-column: 1 / -1; }
}

/* Desktop is the primary experience (Lawrence, 2026-07-20): wider canvas,
   two-column day grid, denser reading. */
@media (min-width: 1080px) {
  main { max-width: 64rem; }
  .days { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .trip-cards { grid-template-columns: 1fr 1fr; }
  .macro-table td { font-size: 0.85rem; }
}
