/* =========================================================
   ET Pilot Companion — "Flight Deck" design system
   Mobile-first · night-cockpit instrument panel
   ========================================================= */

:root {
  --bg: #060b11;
  --bg-2: #080f16;
  --surface: #0d141e;
  --surface-2: #121a27;
  --surface-3: #0a0f16;
  --line: rgba(148, 178, 200, 0.12);
  --line-2: rgba(148, 178, 200, 0.24);
  --text: #eaf2f7;
  --muted: #8fa3b5;
  --faint: #5f7285;
  --green: #22d96c;
  --green-2: #0aa24f;
  --green-soft: rgba(34, 217, 108, 0.12);
  --gold: #f5c542;
  --gold-soft: rgba(245, 197, 66, 0.12);
  --red: #ff4d5a;
  --red-soft: rgba(255, 77, 90, 0.12);
  --blue: #58a6ff;
  --blue-soft: rgba(88, 166, 255, 0.12);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.5);
  --r: 18px;
  --r-sm: 13px;
  --nav-h: 62px;
  --fab-size: 58px;
  --fab-gap: 18px;
  --topbar-h: 62px;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Sora', 'Inter', system-ui, sans-serif;
  --font-mono: 'Roboto Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --flag-green: #078930;
  --flag-yellow: #fcdd09;
  --flag-red: #da121a;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #eef3f6;
  --bg-2: #e6edf2;
  --surface: #ffffff;
  --surface-2: #f3f7fa;
  --surface-3: #e9eff4;
  --line: rgba(13, 30, 43, 0.1);
  --line-2: rgba(13, 30, 43, 0.2);
  --text: #0d1b26;
  --muted: #55708a;
  --faint: #8496a5;
  --green: #0aa24f;
  --green-2: #06823c;
  --green-soft: rgba(10, 162, 79, 0.1);
  --gold: #b8860b;
  --gold-soft: rgba(184, 134, 11, 0.12);
  --red: #d93a46;
  --red-soft: rgba(217, 58, 70, 0.1);
  --blue: #2f6fd0;
  --blue-soft: rgba(47, 111, 208, 0.1);
  --shadow: 0 12px 32px rgba(20, 40, 60, 0.08);
  --shadow-lg: 0 26px 60px rgba(20, 40, 60, 0.14);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-bottom: calc(var(--nav-h) + var(--fab-size) + 28px);
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1000px 620px at 12% -10%, rgba(34, 217, 108, 0.09), transparent 60%),
    radial-gradient(820px 520px at 92% -6%, rgba(245, 197, 66, 0.06), transparent 62%),
    radial-gradient(1100px 760px at 50% 116%, rgba(34, 217, 108, 0.05), transparent 66%);
  pointer-events: none;
}
[data-theme="light"] body::before { background:
  radial-gradient(1000px 620px at 12% -10%, rgba(10, 162, 79, 0.07), transparent 60%),
  radial-gradient(820px 520px at 92% -6%, rgba(245, 197, 66, 0.07), transparent 62%); }

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(150, 190, 210, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 190, 210, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(circle at 50% 18%, #000 0%, transparent 70%);
  mask-image: radial-gradient(circle at 50% 18%, #000 0%, transparent 70%);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { color: inherit; background: none; border: none; cursor: pointer; padding: 0; }
a { color: var(--green); text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5 { font-family: var(--font-display); margin: 0; line-height: 1.2; }

::selection { background: rgba(34, 217, 108, 0.3); color: var(--text); }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 6px; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 20px; height: 20px; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ico-sm { width: 17px; height: 17px; }
.ico-lg { width: 24px; height: 24px; }

.skip-link {
  position: fixed; top: -60px; left: 14px; z-index: 200;
  background: var(--green); color: #04120b; font-weight: 700;
  padding: 10px 16px; border-radius: 999px; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------------- layout ---------------- */
.app-shell { display: flex; min-height: 100dvh; }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.content {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 16px calc(var(--nav-h) + var(--fab-size) + 40px);
  flex: 1;
}
@media (min-width: 720px) { .content { padding: 24px 24px calc(var(--nav-h) + var(--fab-size) + 44px); } }

/* Only the selected view is visible; the rest stay mounted for instant switching. */
.view { display: none; }
.view.active { display: block; animation: view-in 0.24s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.grid { display: grid; gap: 14px; }
.grid.two-col { grid-template-columns: 1fr; }
@media (min-width: 900px) { .grid.two-col { grid-template-columns: 1fr 1fr; } }
.grid.dashboard-grid { grid-template-columns: 1fr; }
@media (min-width: 1100px) { .grid.dashboard-grid { grid-template-columns: 1.35fr 1fr; } }
.moments-grid { grid-template-columns: 1fr; }
@media (min-width: 980px) { .moments-grid { grid-template-columns: 1.2fr 1fr; } }

.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 6px 0 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; }
.section-head p { margin: 4px 0 0; }

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.topbar-brand { display: none; width: 34px; height: 34px; flex: 0 0 auto; }
.topbar-brand svg { width: 34px; height: 34px; display: block; }
.topbar-titles { min-width: 0; flex: 1; }
.topbar-page-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-subtitle { margin: 1px 0 0; font-size: 0.74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.dual-clock { display: flex; align-items: center; gap: 6px; }
.clock-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 11px; min-width: 0;
}
.clock-chip .clock-label { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); }
.clock-chip .clock-value { font-family: var(--font-mono); font-weight: 700; font-size: 0.86rem; color: var(--green); font-variant-numeric: tabular-nums; }
.clock-chip .clock-sub { font-size: 0.66rem; font-family: var(--font-mono); }
.clock-chip .clock-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.et-chip { border-color: color-mix(in srgb, var(--flag-green) 45%, transparent); }
.utc-chip { background: transparent; border-style: dashed; }

.icon-btn {
  position: relative;
  width: 38px; height: 38px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}
.icon-btn:active { transform: scale(0.92); }
.bell-dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 2px var(--surface);
}
.bell-btn .bell-dot { box-shadow: 0 0 0 2px var(--bg), 0 0 10px var(--red); }
.bell-dot.has { background: var(--red); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 13px; padding: 12px 18px;
  font-weight: 600; font-size: 0.9rem; line-height: 1;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: linear-gradient(135deg, var(--green) 0%, var(--green-2) 100%); color: #04150c; box-shadow: 0 10px 26px rgba(34, 217, 108, 0.28); }
.btn-primary:hover { box-shadow: 0 12px 32px rgba(34, 217, 108, 0.4); }
.btn-secondary { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.btn-secondary:hover { background: var(--surface); border-color: var(--line-2); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.btn-ghost:hover { color: var(--text); background: var(--surface); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: rgba(255, 77, 90, 0.35); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 13px; font-size: 0.8rem; border-radius: 11px; }
.btn-compact { padding: 11px 16px; }

.link-btn { color: var(--green); font-weight: 600; font-size: 0.8rem; padding: 4px 2px; border-bottom: 1px solid transparent; }
.link-btn:hover { border-bottom-color: var(--green); }

/* ---------------- cards ---------------- */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-3) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.005em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------------- badges / chips / misc ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}
.badge.green { background: var(--green-soft); border-color: rgba(34, 217, 108, 0.35); color: var(--green); }
.badge.warn { background: var(--gold-soft); border-color: rgba(245, 197, 66, 0.35); color: var(--gold); }
.badge.red { background: var(--red-soft); border-color: rgba(255, 77, 90, 0.35); color: var(--red); }

.status-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); background: var(--green-soft); border: 1px solid rgba(34, 217, 108, 0.3); padding: 6px 12px; border-radius: 999px; }
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

.muted { color: var(--muted); }
.small-muted { font-size: 0.76rem; color: var(--muted); }
.eyebrow { margin: 0 0 6px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--green); }
.notice { background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: var(--r-sm); padding: 12px 14px; font-size: 0.86rem; color: var(--text); line-height: 1.55; }
.notice.warn { border-left-color: var(--gold); }
.empty-state { padding: 22px 14px; text-align: center; color: var(--faint); font-size: 0.86rem; border: 1px dashed var(--line-2); border-radius: var(--r-sm); background: var(--surface-3); }

.inline-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.form-grid .field-full, .field-full { grid-column: 1 / -1; }
.compact-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.compact-form .field-full, .compact-form .field-full { grid-column: 1 / -1; }
@media (max-width: 640px) { .compact-form { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea, .field input[type="datetime-local"], .field input[type="date"], .field input[type="number"] {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 12px; font-size: 0.92rem; color: var(--text); outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea { resize: vertical; min-height: 64px; font-family: var(--font-ui); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.field select { appearance: none; }
.check-field { display: flex; align-items: center; gap: 9px; font-size: 0.86rem; color: var(--text); }
.check-field input { width: 18px; height: 18px; accent-color: var(--green); }

/* ---------------- chips ---------------- */
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 9px 15px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
  font-size: 0.8rem; font-weight: 600;
  transition: all 0.18s ease;
}
.chip.active, .chip:active { background: var(--green-soft); border-color: rgba(34, 217, 108, 0.5); color: var(--green); }
.comms-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.comms-tabs::-webkit-scrollbar { display: none; }
.comms-panel[hidden] { display: none; }

/* ---------------- lists ---------------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.list-item h4 { font-size: 0.92rem; font-weight: 700; }
.list-item p { margin: 3px 0 0; font-size: 0.8rem; color: var(--muted); line-height: 1.45; }
.list-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.item-actions { display: flex; gap: 6px; flex: 0 0 auto; align-items: center; }
.item-actions button { font-size: 0.74rem; font-weight: 700; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.item-actions button:hover { color: var(--green); border-color: rgba(34,217,108,0.4); }
.item-actions button[data-action="delete-schedule"] { color: var(--red); }
.item-actions button[data-action="delete-schedule"]:hover { border-color: rgba(255,77,90,0.45); }

.totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
@media (max-width: 520px) { .totals { grid-template-columns: repeat(2, 1fr); } }
.total-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; text-align: center; }
.total-box .value { font-family: var(--font-mono); font-weight: 700; font-size: 1.25rem; color: var(--green); font-variant-numeric: tabular-nums; }
.total-box .label { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }

.idea-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 0.86rem; color: var(--text); line-height: 1.5; }
.idea-list li::marker { color: var(--green); }

/* ---------------- forms rows helpers ---------------- */
.form-grid:has(> .field-full) { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .form-grid:has(> .field-full) { grid-template-columns: 1fr; } }
.compact-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.compact-form .field-full, .compact-form .field-full { grid-column: 1 / -1; }
@media (max-width: 640px) { .compact-form { grid-template-columns: 1fr; } }

/* ---------------- sidebar / drawer ---------------- */
.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 70;
  width: min(330px, 88vw);
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  transform: translateX(-102%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0.24, 1);
  visibility: hidden;
}
.sidebar.open { transform: translateX(0); visibility: visible; }
.sidebar-close { position: absolute; top: 14px; right: 14px; }
.sidebar-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(2, 6, 10, 0.6); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.sidebar-scrim.open { opacity: 1; pointer-events: auto; }

.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 16px; }
.brand-mark { width: 46px; height: 46px; flex: 0 0 auto; }
.brand-mark svg { width: 46px; height: 46px; display: block; filter: drop-shadow(0 6px 14px rgba(34, 217, 108, 0.25)); }
.brand-copy { min-width: 0; }
.brand-title { font-family: var(--font-display); font-weight: 800; font-size: 1.02rem; letter-spacing: -0.01em; }
.brand-subtitle { font-size: 0.68rem; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

.nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; }
.nav-group-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); margin: 16px 10px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border-radius: var(--r-sm);
  color: var(--muted); font-size: 0.9rem; font-weight: 600; text-align: left;
  transition: background 0.18s ease, color 0.18s ease;
}
.nav-item .nav-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); transition: all 0.18s ease; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--green-soft); color: var(--green); }
.nav-item.active .nav-icon { background: var(--green); color: #04150c; border-color: transparent; }
.sidebar-footer { padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }

/* ---------------- bottom nav / fab ---------------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: stretch;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  position: relative; min-height: 48px;
}
.bottom-nav-item .nav-ico { display: flex; }
.bottom-nav-item.active { color: var(--green); }
.bottom-nav-item.active::before {
  content: ''; position: absolute; top: 6px; width: 26px; height: 3px; border-radius: 999px;
  background: linear-gradient(90deg, var(--flag-green), var(--flag-yellow) 50%, var(--flag-red));
}
.bottom-nav-more { color: var(--muted); }

.fab-quick-add {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + var(--fab-gap) + env(safe-area-inset-bottom));
  z-index: 45; width: var(--fab-size); height: var(--fab-size); border-radius: 50%;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-2) 100%);
  color: #04150c; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 16px 40px rgba(34, 217, 108, 0.4);
  transition: transform 0.18s ease;
}
.fab-quick-add:active { transform: scale(0.9); }
.fab-quick-add .qa-icon { display: flex; }

/* ---------------- dashboard ---------------- */
.hero-card { position: relative; overflow: hidden; background: linear-gradient(150deg, #0e1c24 0%, #0a141c 55%, #071019 100%); border-color: rgba(34, 217, 108, 0.28); }
.flag-ribbon { position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg, var(--flag-green) 0 33.3%, var(--flag-yellow) 33.3% 66.6%, var(--flag-red) 66.6% 100%); opacity: 0.9; }
.hero-copy { position: relative; z-index: 1; }
.hero-card h2 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.02em; }
.hero-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.hero-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.stat { background: rgba(8, 14, 20, 0.55); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 10px; text-align: center; }
.stat-value { font-family: var(--font-mono); font-weight: 700; font-size: 1.3rem; color: var(--green); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.hero-quick { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 16px; }
.hero-quick-item { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 11px 4px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: 0.68rem; font-weight: 700; transition: all 0.18s ease; }
.hero-quick-item:active { transform: scale(0.95); }
.hero-quick-item:hover { border-color: rgba(34, 217, 108, 0.45); }
.hero-quick-item .hq-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; }

.quick-convert { display: flex; flex-direction: column; gap: 10px; }
.conversion-result { background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--r-sm); padding: 12px; display: flex; flex-direction: column; gap: 7px; font-size: 0.88rem; }
.conversion-result strong { font-family: var(--font-mono); color: var(--gold); font-variant-numeric: tabular-nums; }
.conversion-panel { display: flex; flex-direction: column; gap: 10px; }
.conversion-big { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; text-align: center; }
.conversion-time { font-family: var(--font-mono); font-weight: 700; font-size: 1.9rem; color: var(--green); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* ethiopian calendar */
.eth-calendar-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.eth-date-big { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; color: var(--gold); font-variant-numeric: tabular-nums; }
.eth-clock-big { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; color: var(--green); font-variant-numeric: tabular-nums; margin: 8px 0; }
.eth-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; width: 100%; margin-top: 10px; }
.dow { font-size: 0.6rem; font-weight: 700; color: var(--faint); text-transform: uppercase; text-align: center; padding: 4px 0; }
.day { font-size: 0.74rem; font-weight: 600; text-align: center; padding: 6px 0; border-radius: 8px; color: var(--text); background: var(--surface-2); }
.day.empty { background: transparent; }
.day.today { background: var(--green); color: #04150c; font-weight: 800; }

/* reminders */
.reminder-status { display: flex; flex-direction: column; gap: 8px; }
.reminder-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; font-size: 0.82rem; }

/* ---------------- deadline toast ---------------- */
.deadline-toast { position: fixed; top: 74px; left: 50%; transform: translate(-50%, -140%); z-index: 90; width: min(560px, calc(100vw - 32px)); background: linear-gradient(135deg, #3a1c14, #241210); border: 1px solid rgba(255, 77, 90, 0.5); border-radius: 16px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; box-shadow: var(--shadow-lg); transition: transform 0.35s cubic-bezier(0.32, 0.72, 0.24, 1); font-size: 0.88rem; font-weight: 600; }
.deadline-toast.show { transform: translate(-50%, 0); }
.dt-turnoff { color: var(--red); font-weight: 800; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: none; }

/* ---------------- toast ---------------- */
.toast { position: fixed; bottom: calc(var(--nav-h) + var(--fab-size) + 30px); left: 50%; transform: translate(-50%, 140%); z-index: 120; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); padding: 12px 20px; border-radius: 999px; font-size: 0.84rem; font-weight: 600; box-shadow: var(--shadow-lg); transition: transform 0.35s cubic-bezier(0.32, 0.72, 0.24, 1); max-width: min(92vw, 560px); text-align: center; }
.toast.show { transform: translate(-50%, 0); }

/* ---------------- modals ---------------- */
.modal { position: fixed; inset: 0; z-index: 110; display: flex; align-items: flex-end; justify-content: center; }
.modal[aria-hidden="true"] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 10, 0.68); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal-dialog { position: relative; z-index: 2; background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; width: min(680px, calc(100vw - 24px)); max-height: 88dvh; overflow-y: auto; padding: 18px; animation: modal-in 0.28s cubic-bezier(0.32, 0.72, 0.24, 1); }
@keyframes modal-in { from { transform: translateY(26px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.modal-head h3 { font-size: 1.1rem; font-weight: 700; }
@media (min-width: 720px) { .modal { align-items: center; } }

.quick-add-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 6px; }
@media (min-width: 560px) { .quick-add-grid { grid-template-columns: 1fr 1fr; } }
.quick-add-card { text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px; display: flex; flex-direction: column; gap: 6px; transition: all 0.18s ease; }
.quick-add-card:hover { border-color: rgba(34, 217, 108, 0.5); background: var(--green-soft); }
.quick-add-card strong { font-size: 0.95rem; }
.quick-add-card span { font-size: 0.76rem; color: var(--muted); }
.import-preview { margin-top: 14px; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--r-sm); padding: 12px; font-size: 0.8rem; max-height: 220px; overflow-y: auto; }

/* ---------------- tools hub ---------------- */
.tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }
.tool-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; background: linear-gradient(160deg, var(--surface) 0%, var(--surface-3) 100%); border: 1px solid var(--line); border-radius: var(--r); padding: 15px; transition: all 0.18s ease; }
.tool-tile:active { transform: scale(0.97); }
.tool-tile:hover { border-color: rgba(34, 217, 108, 0.5); }
.tool-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--green-soft); border: 1px solid rgba(34, 217, 108, 0.3); color: var(--green); display: flex; align-items: center; justify-content: center; }
.tool-name { font-weight: 700; font-size: 0.92rem; font-family: var(--font-display); }
.tool-desc { font-size: 0.72rem; color: var(--muted); }

/* ---------------- tracker ---------------- */
.tracker-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 520px) { .tracker-stats { grid-template-columns: repeat(2, 1fr); } }
.mini-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; text-align: center; }
.mini-stat .muted { display: block; font-size: 0.6rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.mini-stat strong { font-family: var(--font-mono); font-size: 1.05rem; color: var(--green); font-variant-numeric: tabular-nums; }
.map-wrap { margin-top: 12px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.track-map { width: 100%; height: 260px; background: #08131b; }
.leaflet-container { background: #08131b; color: var(--text); font-family: var(--font-ui); }
.leaflet-container a { color: var(--green); }
.leaflet-control-attribution { background: transparent !important; color: var(--faint); font-size: 0.6rem; }

/* ---------------- moments ---------------- */
.moments-grid { align-items: start; }
.camera-card { grid-row: span 2; }
@media (max-width: 980px) { .camera-card { grid-row: auto; } }
.camera-wrap { position: relative; border-radius: var(--r-sm); overflow: hidden; background: #050a0f; border: 1px solid var(--line); aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; }
.camera-wrap video { width: 100%; height: 100%; object-fit: cover; }
.camera-wrap.live { border-color: rgba(34, 217, 108, 0.6); box-shadow: 0 0 0 3px var(--green-soft); }
.camera-grid-overlay { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(34,217,108,0) 0 2px, rgba(34,217,108,0.05) 2px 4px); pointer-events: none; }
.camera-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.camera-flash.fire { opacity: 0.85; }
.camera-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 0.8rem; text-align: center; padding: 16px; }
.cam-ph-ico { width: 34px; height: 34px; color: var(--green); }
.camera-controls { display: flex; gap: 8px; margin-top: 12px; }
.cam-capture { flex: 1; position: relative; overflow: hidden; }
.capture-ring { position: absolute; top: -1px; left: -1px; right: -1px; bottom: -1px; border-radius: 50%; border: 2px solid var(--green); border-top-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.cam-flip-btn { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(8, 14, 20, 0.7); border: 1px solid var(--line-2); color: var(--text); display: flex; align-items: center; justify-content: center; }
.camera-fs-wrap { position: fixed; inset: 0; z-index: 130; }
.camera-fs-backdrop { position: absolute; inset: 0; background: #02060a; }
.camera-fs-panel { position: absolute; inset: 0; display: flex; flex-direction: column; background: #02060a; }
.camera-fs-video { flex: 1; width: 100%; object-fit: cover; }
.camera-fs-overlay-rules { position: absolute; top: 70px; left: 0; right: 0; padding: 0 18px; display: flex; justify-content: space-between; font-family: var(--font-mono); color: var(--green); font-size: 0.8rem; }
.camera-fs-actions { display: flex; align-items: center; justify-content: space-between; padding: 18px; background: #02060a; }

.gallery { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.moment-card { position: relative; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.moment-flag { position: absolute; top: 8px; left: 8px; width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--gold); }
.moment-zoom { font-size: 1.2rem; opacity: 0.8; }
.moment-body { position: absolute; inset: auto 0 0 0; padding: 12px; font-size: 0.7rem; color: var(--text); background: linear-gradient(180deg, transparent, rgba(2,6,10,0.85)); }
.moment-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; }
.moment-actions button { width: 30px; height: 30px; border-radius: 50%; background: rgba(8,14,20,0.7); border: 1px solid var(--line-2); color: var(--text); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; }

/* moment viewer */
.modal.moment-viewer { position: fixed; z-index: 130; }
.mv-figure { margin: 0; }
.mv-figure img { width: 100%; max-height: 52dvh; object-fit: contain; background: #02060a; border-radius: 14px; border: 1px solid var(--line); }
.mv-caption { display: flex; flex-direction: column; gap: 2px; padding: 10px 4px; text-align: center; }
.mv-note { margin: 0; font-size: 0.9rem; font-weight: 600; }
.mv-actions { display: flex; gap: 8px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.mv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; background: rgba(8,14,20,0.75); border: 1px solid var(--line-2); color: var(--text); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.mv-prev { left: 12px; }
.mv-next { right: 12px; }
.mv-close { position: absolute; top: 12px; right: 12px; }

/* ---------------- chat ---------------- */
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 46dvh; overflow-y: auto; padding: 4px 2px; }
.chat-msg { max-width: 88%; padding: 11px 14px; border-radius: 16px; font-size: 0.86rem; line-height: 1.5; }
.chat-msg .meta { display: block; font-size: 0.62rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.chat-msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.chat-msg.user { align-self: flex-end; background: linear-gradient(135deg, rgba(34,217,108,0.25), rgba(10,162,79,0.18)); border: 1px solid rgba(34,217,108,0.4); border-bottom-right-radius: 6px; }
.chat-compose { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.chat-compose input { flex: 1; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 12px 16px; outline: none; font-size: 0.9rem; min-width: 0; }
.chat-compose input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.chat-suggestions { display: flex; gap: 7px; overflow-x: auto; padding-top: 10px; scrollbar-width: none; }
.chat-suggestions::-webkit-scrollbar { display: none; }

/* ---------------- readback / briefs ---------------- */
.readback-output { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm); min-height: 110px; padding: 12px; font-size: 0.85rem; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.brief-hl { color: var(--gold); font-weight: 700; background: var(--gold-soft); border-radius: 4px; padding: 0 2px; }

/* ---------------- scanner / misc ---------------- */
.scan-preview { max-height: 180px; overflow: hidden; border-radius: var(--r-sm); border: 1px solid var(--line); }
.scan-preview img { width: 100%; height: 180px; object-fit: cover; }

/* ---------------- camera state ---------------- */
.listening { color: var(--red) !important; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.live { border-color: rgba(34, 217, 108, 0.7) !important; }
.fire { opacity: 0.9 !important; }

/* ---------------- permission list ---------------- */
.permission-list { display: flex; flex-direction: column; gap: 9px; }
.permission-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }
.permission-item strong { font-size: 0.86rem; display: block; }
.perm-state { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.perm-state.ok { color: var(--green); }
.perm-state.info { color: var(--blue); }
.danger-zone { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }

/* ---------------- license gate ---------------- */
.license-gate { position: fixed; inset: 0; z-index: 150; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(3, 7, 11, 0.86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.license-card { width: min(460px, 100%); background: linear-gradient(170deg, #0e1a22, #081019); border: 1px solid rgba(34, 217, 108, 0.35); border-radius: 24px; padding: 22px; box-shadow: var(--shadow-lg); }
.license-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.license-logo { width: 46px; height: 46px; }
.license-kicker { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--green); }
.license-status { font-size: 0.82rem; color: var(--muted); min-height: 20px; }
.license-pay { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; margin: 12px 0; font-size: 0.8rem; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.pay-row { display: flex; justify-content: space-between; padding: 6px 9px; background: var(--bg-2); border-radius: 8px; font-size: 0.78rem; }
.license-label { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
.license-device { display: flex; gap: 8px; }
.license-device input { flex: 1; background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; font-family: var(--font-mono); font-size: 0.82rem; outline: none; }
.license-actions { display: flex; gap: 8px; margin-top: 10px; }
.license-actions .btn { flex: 1; }
.license-msg { font-size: 0.78rem; color: var(--red); min-height: 18px; margin: 8px 0 0; }

.trial-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--green-soft); border: 1px solid rgba(34, 217, 108, 0.35); border-radius: var(--r-sm); padding: 12px 14px; font-size: 0.82rem; margin-bottom: 10px; }
.trial-banner .muted { display: block; font-size: 0.72rem; }

/* ---------------- onboarding ---------------- */
.about-hero { display: flex; flex-direction: column; gap: 14px; }
.about-brand { display: flex; gap: 14px; align-items: center; }
.about-avatar { width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(135deg, var(--green), var(--gold)); color: #04150c; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; }
.about-badges { display: flex; gap: 7px; flex-wrap: wrap; }
.contact-list { display: flex; flex-direction: column; }
.contact-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 0.88rem; }
.contact-item:last-child { border-bottom: none; }
.contact-item span { color: var(--faint); }

/* ---------------- airport suggest ---------------- */
.airport-suggest { position: fixed; z-index: 80; top: 0; left: 0; width: min(330px, calc(100vw - 32px)); max-height: min(340px, 60dvh); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 8px; }
.sug-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; font-size: 0.78rem; }
.sug-list { display: flex; flex-direction: column; }
.sug-item { padding: 9px 10px; border-radius: 10px; font-size: 0.8rem; cursor: pointer; }
.sug-item:hover { background: var(--surface-2); }
.sug-foot { padding: 8px 10px 4px; font-size: 0.68rem; color: var(--faint); }

/* ---------------- quick add modal ---------------- */
.quick-add-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 6px; }
@media (min-width: 560px) { .quick-add-grid { grid-template-columns: 1fr 1fr; } }
.quick-add-card { text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px; display: flex; flex-direction: column; gap: 6px; transition: all 0.18s ease; }
.quick-add-card:hover { border-color: rgba(34, 217, 108, 0.5); background: var(--green-soft); }
.quick-add-card strong { font-size: 0.95rem; }
.quick-add-card span { font-size: 0.76rem; color: var(--muted); }

/* ---------------- tracker airports ---------------- */
.tracker-airports { display: flex; flex-direction: column; gap: 6px; }
.tracker-airport { display: flex; justify-content: space-between; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 0.82rem; }

/* ---------------- responsive ---------------- */
@media (max-width: 680px) {
  .topbar { padding: 8px 10px; }
  .topbar-brand { display: none; }
  .topbar-right .dual-clock { display: none; }
  .topbar-right .icon-btn { width: 36px; height: 36px; }
  .view-subtitle { display: none; }
  .content { padding: 14px 12px calc(var(--nav-h) + var(--fab-size) + 36px); }
  .section-head h2 { font-size: 1.25rem; }
  .hero-card h2 { font-size: 1.3rem; }
  .hero-quick { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .hero-quick-item span { display: none; }
  .hero-quick-item { gap: 0; padding: 9px 2px; }
  .stat-value { font-size: 1.1rem; }
  .deadline-toast { top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
