/* Luzzu Mobile — The island's signal. */

:root {
  --navy: #0B2545;
  --navy-2: #13315C;
  --foam: #F4F7FA;
  --mist: #D7E3F1;
  --ink: #10233B;
  --coral: #E94F3D;
  --coral-dark: #C43A2B;
  --ok: #1E7F4F;
  --warn: #B26A00;
  --bad: #B3261E;
  --tag-ink: #5B7089;
  --tag-bg: #E6EDF5;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--foam);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  padding-bottom: 84px;
}

h1, h2, h3 { font-weight: 700; color: var(--navy-2); margin: 0 0 8px; }
h1 { font-size: 24px; color: var(--navy); }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 6px 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

a { color: var(--coral-dark); }

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}

.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid var(--mist);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar .luzzu-eye { width: 28px; height: 28px; flex: 0 0 28px; }
.wordmark { font-weight: 700; font-size: 18px; color: var(--navy); }

/* ---------- offline banner ---------- */
.banner-offline {
  background: #FBF0DC;
  color: var(--warn);
  border-bottom: 1px solid #EAD9B8;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
}

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #fff;
  border-top: 1px solid var(--mist);
  display: flex;
  z-index: 5;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--tag-ink);
  font-size: 11px;
  font-weight: 600;
  border-top: 3px solid transparent;
  min-height: 44px;
}
.nav-item svg { width: 24px; height: 24px; }
.nav-item.active {
  color: var(--navy);
  border-top-color: var(--coral);
}

/* ---------- layout ---------- */
main { padding: 16px; max-width: 720px; margin: 0 auto; }

.card {
  position: relative;
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(11, 37, 69, 0.06);
  padding: 16px;
  margin: 0 0 16px;
}

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row-between h2 { margin: 0; }

/* ---------- pills ---------- */
.pill {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 3px 8px;
}
.pill-sample { color: var(--tag-ink); background: var(--tag-bg); }
.pill-live { color: var(--coral-dark); background: #FDEAE7; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 20px 0 12px; }
.hero .luzzu-eye { width: 56px; height: 56px; }
.hero h1 { margin: 10px 0 2px; }
.tagline { color: var(--tag-ink); font-style: italic; margin: 0 0 8px; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.tile {
  position: relative;
  display: block;
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(11, 37, 69, 0.06);
  padding: 14px;
  padding-top: 32px;
  text-decoration: none;
  color: var(--ink);
}
.tile h3 { margin: 0 0 4px; }
.tile p { margin: 2px 0; }
.tile-body { font-size: 15px; }
.tile-big { font-size: 24px; font-weight: 700; color: var(--navy); margin: 2px 0; }
.tile-foot { color: var(--tag-ink); font-size: 13px; margin-top: 6px; }
a.tile:hover, a.tile:focus-visible { border-color: var(--navy-2); }

.donut { width: 96px; height: 96px; display: block; margin: 0 auto 4px; }
.donut-text { font-size: 18px; font-weight: 700; fill: var(--navy); font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
.donut-caption { text-align: center; color: var(--tag-ink); font-size: 13px; }

.honest { color: var(--tag-ink); font-size: 14px; margin: 4px 2px 16px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin: 8px 8px 0 0;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; border: 1px solid var(--navy); }
.btn-primary:not(:disabled):hover { background: var(--navy-2); }
.btn-secondary { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn-danger { background: #fff; color: var(--bad); border: 1px solid var(--bad); }
.linklike {
  background: none;
  border: none;
  color: var(--coral-dark);
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
  padding: 0;
  min-height: 44px;
}

/* ---------- forms ---------- */
.field { display: block; font-weight: 600; font-size: 14px; color: var(--navy-2); margin: 12px 0 4px; }
.field input, .field textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  min-height: 44px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 10px;
}
.field textarea { resize: vertical; }
.field input.mono, .field textarea.mono, input.mono, textarea.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.field input.invalid { border-color: var(--bad); }
.helper { color: var(--tag-ink); font-size: 13px; margin: 4px 0 8px; }
.small-print { color: var(--tag-ink); font-size: 12px; margin: 8px 0; }

details { margin: 10px 0; }
details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--navy-2);
  padding: 8px 0;
  min-height: 28px;
}

.radio-group { margin: 8px 0; }
.radio-row, .scope-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 4px;
  min-height: 44px;
  cursor: pointer;
  border-radius: 8px;
}
.radio-row:hover, .scope-row:hover { background: var(--foam); }
.radio-row input, .scope-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--navy); flex: 0 0 18px; }
.scope-row.disabled { opacity: 0.6; cursor: not-allowed; }
.scope-row code { font-weight: 700; }

/* ---------- lines & messages ---------- */
.ok-line { color: var(--ok); font-weight: 600; }
.inline-bad { color: var(--bad); font-weight: 600; }
.info-line { color: var(--warn); font-weight: 600; }

.err-card {
  background: #FCEBEA;
  border: 1px solid #EFC4C0;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 10px 0;
}
.err-msg { color: var(--bad); font-weight: 600; margin: 0; }
.tech summary { font-size: 13px; color: var(--tag-ink); font-weight: 600; }
.tech p { font-size: 13px; color: var(--tag-ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- meter ---------- */
.meter-track {
  height: 6px;
  background: var(--mist);
  border-radius: 3px;
  margin: 8px 0 6px;
  overflow: hidden;
}
.meter-fill { height: 100%; width: 0; border-radius: 3px; transition: width 0.15s ease; }
.meter-fill.m1 { background: var(--navy); }
.meter-fill.m23 { background: var(--warn); }
.meter-fill.m4 { background: var(--bad); }
.meter-copy { font-size: 14px; margin: 4px 0; }

/* ---------- pipeline ---------- */
.pipe { list-style: none; margin: 16px 0 0; padding: 0; }
.pipe-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0 10px 4px;
}
.pipe-dot {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
.pipe-name { font-weight: 700; color: var(--navy-2); }
.pipe-note {
  margin-left: auto;
  text-align: right;
  font-size: 13px;
  color: var(--ink);
  max-width: 62%;
  white-space: pre-line;
  overflow-wrap: break-word;
}
.pipe-step[data-state="todo"] .pipe-dot { border: 2px solid var(--navy-2); background: transparent; }
.pipe-step[data-state="todo"] .pipe-name { opacity: 0.6; }
.pipe-step[data-state="active"] .pipe-dot { background: var(--coral); animation: pipepulse 1.2s infinite; }
.pipe-step[data-state="done"] .pipe-dot { background: var(--navy); }
.pipe-step[data-state="done"] .pipe-dot::after {
  content: "✓";
  color: #fff;
  font-size: 9px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pipe-step[data-state="error"] .pipe-dot { background: var(--bad); }
.pipe-step[data-state="error"] .pipe-note { color: var(--bad); font-weight: 600; }
.pipe-step:not(:first-child)::before {
  content: "";
  position: absolute;
  left: 9px;
  top: -14px;
  width: 2px;
  height: 28px;
  background: var(--mist);
}
.pipe-step[data-state="done"] + .pipe-step::before { background: var(--navy); }
@keyframes pipepulse {
  0% { box-shadow: 0 0 0 0 rgba(233, 79, 61, 0.3); }
  100% { box-shadow: 0 0 0 6px rgba(233, 79, 61, 0); }
}
.pipe-live { font-size: 13px; color: var(--tag-ink); min-height: 1em; margin: 6px 0 0; }

.checklist { list-style: none; padding: 0; margin: 10px 0 0; }
.checklist li { color: var(--tag-ink); font-size: 14px; padding: 2px 0; }
.checklist li::before { content: "○ "; color: var(--coral-dark); }

.run-summary { font-weight: 600; color: var(--navy-2); }
.sched-line { color: var(--tag-ink); font-size: 14px; }

/* ---------- report strip ---------- */
.stat-row { display: flex; gap: 8px; text-align: center; margin: 8px 0; }
.stat { flex: 1; background: var(--foam); border-radius: 10px; padding: 12px 4px; }
.stat-num { display: block; font-size: 28px; font-weight: 700; color: var(--navy); }
.stat-label { display: block; font-size: 12px; font-weight: 600; color: var(--tag-ink); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-small { color: var(--tag-ink); font-size: 14px; }
.cost-line { font-weight: 600; }
.stop-line { margin-top: 10px; }

.sup-note { color: var(--tag-ink); font-size: 14px; margin: 8px 0; }
.sup-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.sup-table th {
  text-align: left;
  color: var(--tag-ink);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--mist);
  padding: 6px 8px 6px 0;
}
.sup-table td { border-bottom: 1px solid var(--mist); padding: 8px 8px 8px 0; }
.sup-footer { color: var(--tag-ink); font-size: 13px; }

/* ---------- staff ---------- */
.reveal {
  background: var(--foam);
  border: 1px solid var(--mist);
  border-radius: 10px;
  padding: 12px;
  margin: 12px 0;
}
.reveal h3 { color: var(--navy); }
.replay-note { color: var(--warn); font-weight: 600; }
.keyline {
  background: #fff;
  border: 1px solid var(--mist);
  border-radius: 8px;
  padding: 10px;
  overflow-wrap: anywhere;
  word-break: break-all;
  font-size: 13px;
}
.caption { color: var(--tag-ink); font-size: 12px; }
.mint-log { margin-top: 12px; }
.mint-log-row { font-size: 13px; color: var(--tag-ink); padding: 4px 0; border-top: 1px solid var(--mist); }
.mint-log-row code { color: var(--navy-2); }
.keymask { overflow-wrap: anywhere; }

/* ---------- responsive ---------- */
@media (max-width: 420px) {
  .tiles { grid-template-columns: 1fr; }
  .pipe-note { max-width: 55%; }
}
