/* Lakehouse Ops — light, cream/white, professional. One scheme only: no dark mode
   (Steven, 30 Sep). Mobile-first at 390px (§10). Every text/background pair is ≥ 4.5:1. */

:root {
  --bg: #f8f6f1;          /* warm cream */
  --card: #ffffff;
  --ink: #1f2429;         /* on bg 14.6:1, on card 16.1:1 */
  --ink-2: #5c6570;       /* on bg 5.5:1, on card 6.0:1 */
  --line: #e3dfd6;
  --accent: #1e5a47;      /* deep pine. white on accent 7.6:1 */
  --accent-ink: #ffffff;
  --water: #245b7a;       /* lake blue, links. on card 7.0:1 */
  --red: #a52a22;         /* on red-bg 6.4:1, on card 7.1:1 */
  --red-bg: #fbe9e7;
  --amber: #7a4b00;       /* on amber-bg 8.0:1 */
  --amber-bg: #fdf0d8;
  --green: #1d5c33;       /* on green-bg 7.5:1 */
  --green-bg: #e3f1e6;
  --radius: 10px;
  --tap: 56px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 -apple-system, "SF Pro Text", "Segoe UI", Inter, system-ui, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px; }
h1 { font-size: 24px; line-height: 1.25; margin: 4px 0 16px; letter-spacing: -0.01em; font-weight: 700; }
h2 { font-size: 18px; margin: 24px 0 10px; font-weight: 700; }
h3 { font-size: 16px; margin: 16px 0 6px; }
p { margin: 0 0 12px; }
a { color: var(--water); }
small, .muted { color: var(--ink-2); }
.muted { font-size: 15px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(31, 36, 41, 0.04);
}
.card.alert { border-color: #e7b3ae; background: var(--red-bg); color: var(--red); }
.card.warn { border-color: #ead9b3; background: var(--amber-bg); color: var(--amber); }
.card.good { border-color: #bcd9c4; background: var(--green-bg); color: var(--green); }
.card.alert a, .card.warn a, .card.good a { color: inherit; }

/* Buttons: ≥ 48px, prefer 56 (§2). One primary per screen. */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); width: 100%; padding: 12px 18px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 600; font-size: 17px; text-decoration: none; cursor: pointer;
  margin: 8px 0;
}
.btn.secondary { background: var(--card); color: var(--accent); }
.btn.danger { background: var(--card); border-color: var(--red); color: var(--red); }
.btn.small { min-height: 44px; font-size: 15px; width: auto; display: inline-flex; padding: 8px 14px; margin: 4px 0; white-space: nowrap; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #8fb7d0; outline-offset: 2px;
}

label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 15px; }
input, select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; font: inherit; color: var(--ink);
  background: var(--card); border: 1px solid #cfcac0; border-radius: 8px;
}
textarea { min-height: 96px; }
input[type="checkbox"] { width: 26px; height: 26px; min-height: 0; vertical-align: middle; margin-right: 10px; accent-color: var(--accent); }
.help { font-size: 14px; color: var(--ink-2); margin-top: 4px; }

.pill {
  display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 12px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; vertical-align: middle;
}
.pill.red { background: var(--red-bg); color: var(--red); }
.pill.amber { background: var(--amber-bg); color: var(--amber); }
.pill.green { background: var(--green-bg); color: var(--green); }
.pill.grey { background: #eeebe4; color: var(--ink-2); }
.pill.blue { background: #e3edf3; color: var(--water); }

.banner { background: var(--red); color: #fff; padding: 12px 16px; font-weight: 600; text-align: center; font-size: 15px; }
.banner a { color: #fff; }
.flash { padding: 12px 14px; border-radius: 8px; font-weight: 600; font-size: 15px; }
.flash.ok { background: var(--green-bg); color: var(--green); }
.flash.err { background: var(--red-bg); color: var(--red); }

.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60px; text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 600;
  border-top: 3px solid transparent; margin-top: -1px;
}
.tabs a.active { color: var(--accent); border-top-color: var(--accent); }
.tabs .ico { display: none; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack > * + * { margin-top: 8px; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.big { font-size: 20px; font-weight: 700; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; }
.tel { font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-2); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Health strip (§6.3): chips with a status dot, no emoji. */
.health { display: flex; flex-wrap: wrap; gap: 6px; }
.health span { padding: 5px 10px 5px 8px; border-radius: 6px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.health span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.health .ok { background: var(--green-bg); color: var(--green); }
.health .bad { background: var(--red-bg); color: var(--red); }
.health .warn { background: var(--amber-bg); color: var(--amber); }

.net { position: fixed; top: 0; left: 0; right: 0; background: var(--amber-bg); color: var(--amber); padding: 8px; text-align: center; font-weight: 600; z-index: 10; font-size: 14px; }

details summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }

/* Long URLs and error text must wrap — no horizontal scroll on a phone (§10). */
.card, .flash, .banner, p, li { overflow-wrap: anywhere; }

/* Checklist (§9.2) */
.items li { display: flex; align-items: flex-start; gap: 8px; }
.item-row { display: flex; gap: 12px; align-items: flex-start; flex: 1; font-weight: 400; margin: 0; cursor: pointer; min-height: 48px; font-size: 16px; }
.item-row input.item { flex: none; margin-top: 3px; }
.item-row b { font-weight: 600; }
.items li.done > .item-row b { text-decoration: line-through; color: var(--ink-2); }
.items li.skipped > .item-row b { color: var(--ink-2); }
.items button.skip { flex: none; min-height: 40px; padding: 6px 10px; font: inherit; font-size: 13px; color: var(--ink-2); background: transparent; border: 1px solid var(--line); border-radius: 8px; }
.phase.locked { opacity: 0.5; }
.phase.locked .items { pointer-events: none; }
.save-status { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.save-status.ok { color: var(--green); }
.save-status.warn { color: var(--amber); }
#missing ul { margin: 0 0 8px; padding-left: 20px; color: var(--red); }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: transform 80ms ease; }
  .btn:active { transform: scale(0.99); }
}
@media (min-width: 720px) { .wrap { padding: 28px 24px; } }

/* Spacing pass (Steven, 30 Sep): more air everywhere, nested boxes never touch edges. */
.wrap { max-width: 640px; padding: 24px 20px; }
h1 { margin-bottom: 20px; }
h2 { margin-top: 32px; margin-bottom: 12px; }
section + section, .card + h2 { margin-top: 28px; }
.card { padding: 20px; margin-bottom: 16px; }
.card .card { margin: 14px 0; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.list li { padding: 16px 0; }
.list.card { padding: 4px 20px; }
.row { gap: 16px; }
.row > form { margin: 0; flex: none; }
.btn.small { margin: 6px 8px 6px 0; }
.pill { margin: 2px 0; }
p + form, p + .row { margin-top: 12px; }
.card.alert .row > div, .card.warn .row > div, .card.good .row > div { padding-right: 8px; }
.tabs a { min-height: 64px; }
@media (min-width: 720px) { .wrap { padding: 36px 28px; } }

/* Tab bar at the top (Steven, 30 Sep). Sticky, scrolls sideways if it must, never wraps. */
body { padding-bottom: 24px; }
.tabs { position: sticky; top: 0; bottom: auto; z-index: 20; border-top: 0; border-bottom: 1px solid var(--line); padding: 0 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start; align-items: stretch; }
.tabs .brand { display: none; align-items: center; font-weight: 800; color: var(--accent); padding: 0 12px 0 8px; letter-spacing: -0.01em; white-space: nowrap; }
.tabs a { flex: 1; min-height: 52px; padding: 0 10px; justify-content: center; font-size: 15px; border-top: 0; border-bottom: 3px solid transparent; margin-top: 0; white-space: nowrap; }
.tabs a.active { border-bottom-color: var(--accent); border-top-color: transparent; }
.net { top: 52px; }
