/* Heights Takeoff — styles. Mobile-first, high-contrast, big touch targets. */
:root {
  --navy: #0f1f3d;
  --navy-2: #1a2f5c;
  --orange: #f97316;
  --orange-dark: #c2570b;
  --bg: #f4f5f7;
  --card: #ffffff;
  --ink: #16213a;
  --muted: #5b6478;
  --line: #dfe3ec;
  --green: #15803d;
  --green-bg: #e7f6ec;
  --red: #b91c1c;
  --red-bg: #fdecec;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
  padding-bottom: 90px; /* room for sticky action bar */
}

/* ---------- header / nav ---------- */
.app-header {
  background: var(--navy);
  color: #fff;
  padding: 12px 16px 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; }
.brand-mark {
  display: inline-block; background: var(--orange); color: #fff;
  width: 1.7em; height: 1.7em; line-height: 1.7em; text-align: center;
  border-radius: 8px; margin-right: 6px; font-weight: 900;
}
.brand-sub { color: #9fb2d8; font-weight: 600; }
.app-nav {
  display: flex; gap: 2px; overflow-x: auto; margin-top: 10px;
  -webkit-overflow-scrolling: touch;
}
.nav-link {
  color: #c6d2ea; text-decoration: none; padding: 10px 12px;
  font-size: .92rem; white-space: nowrap; border-radius: 8px 8px 0 0;
}
.nav-link.active { background: var(--bg); color: var(--navy); font-weight: 700; }

.net-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  margin-left: 8px; vertical-align: baseline;
}
.net-dot.online { background: #22c55e; }
.net-dot.offline { background: var(--orange); }

/* ---------- layout ---------- */
main { max-width: 760px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
h1 { font-size: 1.4rem; margin: .2em 0 .6em; }
h2 { font-size: 1.1rem; margin: 1.2em 0 .5em; }
.muted { color: var(--muted); font-size: .92rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* ---------- buttons / inputs ---------- */
.btn {
  display: inline-block; border: none; border-radius: 10px;
  padding: 14px 20px; font-size: 1.05rem; font-weight: 700;
  background: var(--navy); color: #fff; cursor: pointer;
  text-decoration: none; text-align: center;
  min-height: 52px; touch-action: manipulation;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--orange); }
.btn-primary:active { background: var(--orange-dark); }
.btn-ghost { background: #e8ebf2; color: var(--navy); }
.btn-danger { background: var(--red); }
.btn-small { padding: 10px 14px; font-size: .92rem; min-height: 44px; }
.btn-block { display: block; width: 100%; margin: 8px 0; }

label.field { display: block; margin: 10px 0; font-weight: 600; }
input[type="text"], input[type="number"], input[type="password"],
select, textarea {
  width: 100%; padding: 13px; font-size: 1.05rem;
  border: 1.5px solid var(--line); border-radius: 10px; margin-top: 6px;
  background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--orange); border-color: var(--orange);
}

/* ---------- lists / tables ---------- */
.item-row {
  display: flex; gap: 10px; align-items: center; padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}
.item-row:last-child { border-bottom: none; }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 700; }
.item-sub { color: var(--muted); font-size: .88rem; }

table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th, table.data td {
  text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line);
}
table.data th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- walk mode ---------- */
.rec-bar {
  position: sticky; top: 0; z-index: 40;
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 12px;
}
.rec-dot {
  display: inline-block; width: 14px; height: 14px; border-radius: 50%;
  background: #666; margin-right: 8px; vertical-align: middle;
}
.rec-dot.on { background: #ff3b30; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.rec-meta { font-variant-numeric: tabular-nums; font-weight: 700; }

.btn-record {
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--red); border: 6px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.35);
  color: #fff; font-weight: 800; font-size: 1rem; cursor: pointer;
  touch-action: manipulation;
}
.btn-record.recording { background: #333; }
.btn-record:active { transform: scale(.96); }

.preview {
  width: 100%; max-height: 240px; border-radius: var(--radius);
  background: #000; margin: 10px 0;
}

.walk-item { padding: 12px 4px; border-bottom: 1px solid var(--line); }
.walk-item.confirmed { background: var(--green-bg); border-radius: 8px; padding-left: 10px; padding-right: 10px; }
.walk-item-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.walk-qty { font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.walk-controls { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.stepper { display: flex; align-items: center; gap: 0; }
.stepper button {
  width: 52px; height: 52px; font-size: 1.5rem; font-weight: 800;
  border: 1.5px solid var(--line); background: #fff; cursor: pointer;
  touch-action: manipulation;
}
.stepper button:first-child { border-radius: 10px 0 0 10px; }
.stepper button:last-child { border-radius: 0 10px 10px 0; }
.stepper .step-val {
  min-width: 72px; height: 52px; line-height: 52px; text-align: center;
  border-top: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line);
  font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums;
}
.btn-confirm {
  flex: 1; min-height: 52px; border-radius: 10px; border: 2px solid var(--green);
  background: #fff; color: var(--green); font-weight: 800; font-size: 1rem;
  cursor: pointer; touch-action: manipulation;
}
.btn-confirm.on { background: var(--green); color: #fff; }
.walk-note { margin-top: 8px; }

/* ---------- variance ---------- */
.pill {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: .82rem; font-weight: 700;
}
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.warn { background: #fef3c7; color: #92400e; }
.pill.bad { background: var(--red-bg); color: var(--red); }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 16px; right: 16px; bottom: 24px;
  background: var(--navy); color: #fff; padding: 14px 18px;
  border-radius: 12px; font-weight: 600; text-align: center;
  opacity: 0; transform: translateY(12px); transition: all .25s;
  pointer-events: none; z-index: 100;
}
#toast.show { opacity: 1; transform: none; }

/* ---------- sticky action bar ---------- */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #fff; border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; z-index: 60;
}
.action-bar .btn { flex: 1; margin: 0; }

/* ---------- landing hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff; border-radius: 16px; padding: 28px 22px; margin-bottom: 14px;
}
.hero h1 { margin: 0 0 8px; font-size: 1.7rem; }
.hero p { color: #b9c6e4; margin: 0 0 18px; }

.test-pass { color: var(--green); font-weight: 700; }
.test-fail { color: var(--red); font-weight: 700; }
pre.order {
  background: #0d1526; color: #d7e0f4; padding: 16px; border-radius: 10px;
  white-space: pre-wrap; font-size: .92rem; overflow-x: auto;
}
video.playback, audio.playback { width: 100%; margin-top: 8px; }
details.walk-detail { margin-top: 10px; }
details.walk-detail summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
