/* Iceland field tool — high contrast for outdoor daylight, big tap targets. */
:root {
  --bg: #eef2f4;
  --surface: #ffffff;
  --ink: #11181c;
  --muted: #54646d;
  --line: #d3dde2;
  --accent: #0b7285;
  --accent-ink: #ffffff;
  --green: #267a38;
  --amber: #b45309;
  --red: #c92a2a;
  --blue: #1971c2;
  --radius: 14px;
  --pad: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); /* room for toolbar */
}
main { max-width: 680px; margin: 0 auto; padding: 0 12px; display: grid; gap: 14px; }

.site-head { max-width: 680px; margin: 0 auto; padding: 18px 12px 6px; }
.site-head h1 { margin: 0; font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; }
.tagline { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; }

section { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: var(--pad); }
section:empty { display: none; }
h2 { margin: 0 0 10px; font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }

/* ---------- Hero / verdict ---------- */
#hero { padding: 0; overflow: hidden; }
.verdict { padding: 20px var(--pad); color: #fff; }
.verdict.green { background: var(--green); }
.verdict.amber { background: var(--amber); }
.verdict.red   { background: var(--red); }
.verdict.unknown { background: #495057; }
.verdict-label { font-size: 2.1rem; font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
.verdict-sub { margin: 4px 0 0; font-size: 0.9rem; opacity: 0.95; }
.verdict button.why {
  margin-top: 10px; background: rgba(255,255,255,0.18); color: #fff; border: 1.5px solid rgba(255,255,255,0.55);
  border-radius: 999px; padding: 12px 16px; min-height: 44px; font-size: 0.85rem; font-weight: 700;
}
.reasons { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.reasons li { background: rgba(255,255,255,0.14); border-radius: 8px; padding: 7px 10px; font-size: 0.88rem; }
.reasons li::before { content: "▸ "; }

.hero-body { padding: var(--pad); display: grid; gap: 14px; }
.stale-badge {
  background: var(--amber); color: #fff; border-radius: 8px; padding: 8px 12px; font-size: 0.88rem; font-weight: 700;
}
.wx-meta { color: var(--muted); font-size: 0.8rem; }

table.windprofile { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.windprofile th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 4px 6px; }
.windprofile td { padding: 7px 6px; border-top: 1px solid var(--line); font-size: 1rem; }
.windprofile td.num { font-weight: 700; }
.windprofile .arrow { display: inline-block; font-size: 1.1rem; }
.windprofile tr.exceed td { color: var(--red); font-weight: 800; }

.hourstrip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.hourchip {
  scroll-snap-align: start; flex: 0 0 auto; min-width: 64px; text-align: center;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 6px;
}
.hourchip.now { border-color: var(--accent); border-width: 2px; }
.hourchip .h { font-size: 0.75rem; color: var(--muted); }
.hourchip .w { font-weight: 800; font-size: 1rem; }
.hourchip .dot, .daychip .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-top: 3px; }
.dot.green { background: var(--green); } .dot.amber { background: var(--amber); } .dot.red { background: var(--red); }

.strip-label { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.daystrip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.daychip {
  scroll-snap-align: start; flex: 0 0 auto; min-width: 78px; text-align: center;
  border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 6px;
}
.daychip.today { border-color: var(--accent); border-width: 2px; }
.daychip .d { font-size: 0.75rem; color: var(--muted); font-weight: 700; }
.daychip .wx { font-size: 1.2rem; line-height: 1.3; }
.daychip .t { font-size: 0.85rem; font-weight: 700; }
.daychip .g { font-size: 0.82rem; font-weight: 800; }
.daychip .pp { font-size: 0.72rem; color: var(--muted); }

.advisories { display: grid; gap: 6px; }
.advisory { border-left: 4px solid var(--line); padding: 6px 10px; font-size: 0.9rem; background: #f6f9fa; border-radius: 0 8px 8px 0; }
.advisory.amber { border-left-color: var(--amber); }
.advisory.red { border-left-color: var(--red); }

.legality { border-top: 1.5px dashed var(--line); padding-top: 12px; }
.legality p { margin: 0 0 8px; font-size: 0.9rem; font-weight: 700; }
.legality .linkrow { display: flex; flex-wrap: wrap; gap: 8px; }
.legality a {
  background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 700; font-size: 0.85rem;
  border-radius: 999px; padding: 8px 14px;
}

.wx-error { padding: var(--pad); }
.wx-error p { margin: 0 0 10px; }

button { font: inherit; cursor: pointer; }
.btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 12px 16px; font-weight: 800; font-size: 0.95rem;
}
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.danger { background: var(--red); }

/* ---------- Flight log ---------- */
.fl-active { background: #e7f5ee; border: 1.5px solid var(--green); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; font-weight: 700; }
.fl-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
ul.fl-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.fl-list li { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 0.9rem; }
.fl-list .fl-meta { color: var(--muted); font-size: 0.8rem; }
.fl-list button.del { float: right; background: none; border: none; color: var(--red); font-weight: 800; font-size: 0.85rem; padding: 10px; min-height: 44px; }

/* ---------- Checklist ---------- */
.tier { border: 1.5px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; background: var(--surface); }
.tier-head {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  background: none; border: 0; padding: 14px var(--pad); font-weight: 800; font-size: 1rem;
}
.tier-head .prog { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.tier-head .prog.done { color: var(--green); }
.tier-head .chev { transition: transform 0.15s; color: var(--muted); }
.tier.open .chev { transform: rotate(90deg); }
.tier-sub { display: block; font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.tier-body { display: none; border-top: 1.5px solid var(--line); }
.tier.open .tier-body { display: block; }
.group-label { margin: 10px var(--pad) 0; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); }
label.item { display: flex; gap: 12px; padding: 12px var(--pad); border-top: 1px solid #eef2f4; align-items: flex-start; }
label.item:first-child { border-top: 0; }
label.item input { width: 26px; height: 26px; flex: 0 0 26px; accent-color: var(--accent); margin-top: 1px; }
label.item .txt { font-size: 0.95rem; }
label.item.checked .txt { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
label.item small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
label.item.checked small { text-decoration: line-through; }

/* ---------- Rules & emergency cards ---------- */
#rules { border-left: 5px solid var(--amber); }
#emergency { border-left: 5px solid var(--red); }
.rulecard { padding: 10px 0; border-top: 1px solid var(--line); }
.rulecard:first-of-type { border-top: 0; }
.rulecard h3 { margin: 0 0 2px; font-size: 0.95rem; }
.rulecard p { margin: 0; font-size: 0.88rem; color: var(--muted); }
.emergency-112 { display: block; text-decoration: none; background: var(--red); color: #fff; border-radius: 10px; padding: 12px; text-align: center; font-size: 1.1rem; font-weight: 900; margin-bottom: 10px; }

/* ---------- Cheat sheet ---------- */
.cheat { border-radius: 10px; padding: 12px; margin-top: 10px; border: 1.5px solid; }
.cheat h3 { margin: 0 0 6px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.cheat ul { margin: 0; padding-left: 18px; font-size: 0.92rem; }
.cheat li { margin: 3px 0; }
.cheat.no { border-color: var(--red); background: #fdf0f0; color: #7d1a1a; }
.cheat.yes { border-color: var(--green); background: #effaf2; color: #1d5c30; }
.cheat.window { border-color: var(--amber); background: #fdf6e9; color: #7a4e08; }
.cheat.verify { border-color: var(--blue); background: #eef5fc; color: #144e80; }

/* ---------- Quick links ---------- */
.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li { border-top: 1px solid var(--line); }
.linklist li:first-child { border-top: 0; }
.linklist a { display: block; padding: 12px 4px; text-decoration: none; color: var(--ink); font-weight: 700; }
.linklist a small { display: block; color: var(--muted); font-weight: 400; font-size: 0.8rem; }
.linklist a::after { content: " ↗"; color: var(--accent); }
.linklist a[href^="tel"]::after { content: ""; }

/* ---------- Toolbar & toast ---------- */
.toolbar {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; gap: 8px; justify-content: center;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(238,242,244,0.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-top: 1.5px solid var(--line);
}
.toolbar .btn { flex: 1; max-width: 220px; }
.toolbar .btn.narrow { flex: 0 0 auto; min-width: 48px; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(86px + env(safe-area-inset-bottom));
  background: var(--ink); color: #fff; border-radius: 10px; padding: 12px 16px;
  font-weight: 700; font-size: 0.9rem; display: flex; gap: 12px; align-items: center;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25); max-width: 92vw; z-index: 50;
}
.toast button { background: none; border: 0; color: #74c0fc; font-weight: 800; }
.site-foot { padding: 4px 6px 10px; color: var(--muted); font-size: 0.85rem; }
.site-foot .foot-meta { font-size: 0.75rem; }
