/*
 * d3kOS PWA — App Styles
 * Dark marine theme. Touch-first. AODA AA contrast throughout.
 * Base: 18px min, 48px min touch targets.
 * v0.9.3.1: Full AODA pass — all text ≥ 0.9rem (16.2px min), touch targets ≥ 48px.
 */

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #0a1628;
  --bg-card:     #0f2040;
  --bg-input:    #0c1a30;
  --accent:      #00b4d8;
  --accent-dark: #0090b0;
  --green:       #22c55e;
  --red:         #ef4444;
  --amber:       #f59e0b;
  --text:        #e2e8f0;
  --text-muted:  #94a3b8;
  --border:      #1e3a5f;
  --nav-h:       64px;
  --header-h:    56px;
}

html, body {
  height: 100%;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ── App Shell ─────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ── Header ────────────────────────────────────────────────── */
#app-header {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  z-index: 10;
}

#app-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#header-vessel {
  font-size: 1rem; /* was 0.9rem — AODA: min 18px */
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

#online-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.3s;
}
#online-dot.online  { background: var(--green); }
#online-dot.offline { background: var(--red); }

/* ── Screen Container ──────────────────────────────────────── */
#screen {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: calc(var(--nav-h) + 16px);
}

/* ── Bottom Nav ────────────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--nav-h);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem; /* was 0.72rem — AODA: min 18px */
  font-family: inherit;
  cursor: pointer;
  min-height: 48px;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.nav-btn.active { color: var(--accent); }

.nav-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-badge {
  position: absolute;
  top: 8px;
  right: calc(50% - 18px);
  background: var(--red);
  color: #fff;
  font-size: 0.9rem; /* was 0.65rem — AODA: supplemental count badge min 0.9rem */
  font-weight: 700;
  border-radius: 10px;
  padding: 0 5px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 0.9rem; /* was 0.8rem — AODA */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── Stat Grid ─────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 0.9rem; /* was 0.78rem — AODA */
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.stat-value.warn { color: var(--amber); }
.stat-value.danger { color: var(--red); }
.stat-value.ok { color: var(--green); }

/* ── Alert Items ────────────────────────────────────────────── */
.alert-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.alert-item:last-child { border-bottom: none; }

.alert-type {
  font-size: 0.9rem; /* was 0.78rem — AODA */
  font-weight: 700;
  text-transform: uppercase;
  color: var(--amber);
}

.alert-msg {
  font-size: 1rem; /* was 0.95rem — AODA */
  color: var(--text);
}

.alert-time {
  font-size: 0.9rem; /* was 0.78rem — AODA */
  color: var(--text-muted);
}

/* ── Boatlog Items ──────────────────────────────────────────── */
.log-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.log-item:last-child { border-bottom: none; }

.log-type {
  font-size: 0.9rem; /* was 0.78rem — AODA */
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
}

.log-content {
  font-size: 1rem; /* was 0.95rem — AODA */
  color: var(--text);
}

.log-time {
  font-size: 0.9rem; /* was 0.78rem — AODA */
  color: var(--text-muted);
}

/* ── Vessel List ────────────────────────────────────────────── */
.vessel-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  background: none;
  width: 100%;
  text-align: left;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.vessel-item:last-child { border-bottom: none; }
.vessel-item:active { background: rgba(255,255,255,0.04); }
.vessel-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.vessel-icon {
  width: 48px; /* was 44px — AODA: min 48px touch target */
  height: 48px;
  background: var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vessel-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vessel-info { flex: 1; }
.vessel-name { font-size: 1rem; font-weight: 700; color: var(--text); }
.vessel-meta { font-size: 0.9rem; color: var(--text-muted); margin-top: 2px; } /* was 0.82rem */

.vessel-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.vessel-status.online  { background: var(--green); }
.vessel-status.offline { background: var(--text-muted); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #0a1628; }
.btn-primary:active:not(:disabled) { background: var(--accent-dark); }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-ghost:active:not(:disabled) { background: rgba(0,180,216,0.1); }

.btn-danger { background: var(--red); color: #fff; }
.btn-danger:active:not(:disabled) { background: #c53030; }

/* ── Form Fields ────────────────────────────────────────────── */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 1rem; /* was 0.9rem — AODA */
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus { border-color: var(--accent); }
.field input::placeholder { color: var(--text-muted); opacity: 0.7; }

/* ── Error Banner ───────────────────────────────────────────── */
.error-banner {
  background: rgba(239,68,68,0.15);
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1rem; /* was 0.9rem — AODA */
  color: #fca5a5;
  margin-bottom: 16px;
  display: none;
}
.error-banner.visible { display: block; }

/* ── Login Screen ───────────────────────────────────────────── */
#login-screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 360px;
  margin: 0 auto;
  padding: 32px 0;
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo img {
  border-radius: 16px;
}

.login-logo h2 {
  margin-top: 12px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
}

.login-logo p {
  font-size: 1rem; /* was 0.9rem — AODA */
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Status Badge ───────────────────────────────────────────── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.9rem; /* was 0.8rem — AODA */
  font-weight: 700;
}
.status-badge.online  { background: rgba(34,197,94,0.15); color: var(--green); }
.status-badge.offline { background: rgba(148,163,184,0.15); color: var(--text-muted); }

/* ── Position Map Link ──────────────────────────────────────── */
.position-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 1rem; /* was 0.9rem — AODA */
  text-decoration: none;
  margin-top: 8px;
  min-height: 48px;
}
.position-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Settings Items ─────────────────────────────────────────── */
.settings-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.settings-item:last-child { border-bottom: none; }

.settings-label { font-size: 0.9rem; color: var(--text-muted); } /* was 0.82rem */
.settings-value { font-size: 1rem; color: var(--text); font-weight: 600; } /* was 0.95rem */
.settings-value.mono { font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; } /* was 0.85rem */

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state p { font-size: 1rem; margin-top: 8px; } /* was 0.95rem */

/* ── Loading Spinner ────────────────────────────────────────── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 32px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sync line ──────────────────────────────────────────────── */
.synced-at {
  font-size: 0.9rem; /* was 0.78rem — AODA */
  color: var(--text-muted);
  text-align: right;
  margin-bottom: 4px;
}

/* ── Tier badge ─────────────────────────────────────────────── */
.tier-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9rem; /* was 0.75rem — AODA */
  font-weight: 700;
  background: var(--accent);
  color: #0a1628;
}

/* ── Update banner (DEP6) ───────────────────────────────────── */
.update-banner {
  background: #1a3a1a;
  border: 1px solid #22c55e;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 1rem; /* was 0.9rem — AODA */
  color: #86efac;
  margin-bottom: 12px;
}

/* ── Fix My Pi Screen ───────────────────────────────────────── */
.fmp-disclaimer-title {
  font-size: 1rem; /* was 0.9rem — AODA */
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fmp-disclaimer-list {
  padding-left: 18px;
  font-size: 1rem; /* was 0.9rem — AODA */
  color: var(--text-muted);
}
.fmp-disclaimer-list li { margin-bottom: 4px; }
.fmp-cost-line {
  margin-top: 14px;
  font-size: 1rem; /* was 0.9rem — AODA */
  font-weight: 600;
  color: var(--text);
}
.fmp-result-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 1rem; /* was 0.9rem — AODA */
  font-weight: 700;
}
.fmp-result-badge.ok   { background: rgba(34,197,94,0.15); color: var(--green); }
.fmp-result-badge.fail { background: rgba(239,68,68,0.15);  color: var(--red);   }
.fmp-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  min-height: 48px;
}
.fmp-check-row:last-child { border-bottom: none; }
.fmp-check-icon {
  font-size: 1rem;
  font-weight: 700;
  min-width: 20px;
  padding-top: 2px;
}
.fmp-check-icon.ok   { color: var(--green); }
.fmp-check-icon.fail { color: var(--red);   }
.fmp-check-info { flex: 1; }
.fmp-check-name   { font-size: 1rem; word-break: break-all; } /* was 0.9rem */
.fmp-check-detail { font-size: 0.9rem; color: var(--text-muted); margin-top: 2px; } /* was 0.82rem */
.fmp-action-item {
  font-size: 0.9rem; /* was 0.88rem — AODA */
  color: var(--text-muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.fmp-action-item:last-child { border-bottom: none; }
.fmp-error-item {
  font-size: 0.9rem; /* was 0.88rem — AODA */
  color: var(--red);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

/* ── S5 — Alerts screen ───────────────────────────────────── */
.alert-item-full {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}
.alert-item-full:last-child { border-bottom: none; }
.alert-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.alert-type-badge {
  font-size: 0.9rem; /* was 0.82rem — AODA */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

/* ── S5 — Boatlog screen ──────────────────────────────────── */
.log-item-full {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}
.log-item-full:last-child { border-bottom: none; }
.log-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.log-type-badge {
  font-size: 0.9rem; /* was 0.82rem — AODA */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

/* ── S5 — Engine screen sparklines ───────────────────────── */
.sparkline-section {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.sparkline-section:last-child { border-bottom: none; margin-bottom: 0; }
.sparkline-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.sparkline-label {
  font-size: 1rem; /* was 0.9rem — AODA */
  color: var(--text-muted);
}
.sparkline-last {
  font-size: 1rem;
  font-weight: 700;
}
.sparkline-svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.sparkline-range {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem; /* was 0.78rem — AODA */
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Shared list footnote ─────────────────────────────────── */
.list-footnote {
  font-size: 0.9rem; /* was 0.82rem — AODA */
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  padding: 0 8px;
}
.fmp-error-item:last-child { border-bottom: none; }

/* ── MB4 — Vessel switcher in header ─────────────────────── */
#header-vessel.vessel-switcher {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#header-vessel.vessel-switcher::after {
  content: ' ›';
  opacity: 0.7;
}
#header-vessel.vessel-switcher:hover,
#header-vessel.vessel-switcher:focus {
  color: var(--accent);
  outline: none;
}
#header-vessel.vessel-switcher:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── TS3/TS4 — Locked features upgrade section ───────────── */
.locked-features-section {
  margin-top: 8px;
}
.locked-feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.locked-feature-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}
.locked-feature-name {
  font-size: 1rem;
  font-weight: 700;
}
.locked-badge {
  font-size: 0.9rem; /* was 0.72rem — AODA */
  font-weight: 700;
  letter-spacing: 0.06em;
  background: #1e293b;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}
.locked-feature-desc {
  font-size: 0.9rem; /* was 0.88rem — AODA */
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}
.locked-upgrade-btn {
  display: inline-block;
  text-decoration: none;
  font-size: 1rem; /* was 0.9rem — AODA */
}

/* ── Quick-action row (dashboard) ──────────────────────────────────────────── */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0 4px;
}
.btn-live {
  background: #0e4f3b;
  color: #34d399;
  border: 1px solid #34d399;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 1rem; /* was 0.95rem — AODA */
  padding: 12px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  min-height: 48px;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.btn-live:hover, .btn-live:focus {
  background: #0f5f47;
  outline: 2px solid #34d399;
}
.btn-reports {
  background: #1e293b;
  color: var(--accent);
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 1rem; /* was 0.95rem — AODA */
  padding: 12px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  min-height: 48px;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.btn-reports:hover, .btn-reports:focus {
  background: #243551;
  outline: 2px solid var(--accent);
}

/* ── Screen header (Live + Reports back-button pattern) ─────────────────────── */
.screen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.screen-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.back-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1rem; /* was 0.95rem — AODA */
  cursor: pointer;
  padding: 6px 0;
  min-height: 48px; /* was 44px — AODA: min 48px */
  min-width: 48px;  /* was 44px — AODA: min 48px */
  display: flex;
  align-items: center;
  font-family: inherit;
}
.back-btn:hover, .back-btn:focus {
  text-decoration: underline;
  outline: 2px solid var(--accent);
  border-radius: 4px;
}

/* ── Live screen ─────────────────────────────────────────────────────────────── */
.live-status-bar {
  font-size: 1rem; /* was 0.95rem — AODA */
  color: var(--text-muted);
  background: #1e293b;
  border-radius: 6px;
  padding: 8px 14px;
  margin-bottom: 14px;
  min-height: 48px;
  display: flex;
  align-items: center;
}
.live-status-bar.connected {
  color: #34d399;
  border-left: 3px solid #34d399;
}
.live-status-bar.error {
  color: var(--red);
  border-left: 3px solid var(--red);
}
.live-sensors-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.live-cell {
  background: #1e293b;
  border-radius: 8px;
  padding: 10px 12px;
}
.live-cell-label {
  font-size: 0.9rem; /* was 0.72rem — AODA */
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.live-cell-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.live-camera-panel {
  position: relative;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  aspect-ratio: 16/9;
}
.live-camera-panel video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.cam-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 48px;  /* was 32px — AODA: min 48px */
  height: 48px; /* was 32px — AODA: min 48px */
  font-size: 1rem; /* was 0.85rem — AODA */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.live-cam-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.live-cam-label {
  font-size: 0.9rem; /* was 0.85rem — AODA */
  color: var(--text-muted);
}
.btn-cam-slot {
  font-size: 0.9rem; /* was 0.85rem — AODA */
  padding: 7px 12px;
  background: #1e293b;
  color: var(--text);
  border: 1px solid #334155;
  border-radius: 6px;
  cursor: pointer;
  min-height: 48px; /* was 36px — AODA: min 48px */
  font-family: inherit;
}
.btn-cam-slot:hover, .btn-cam-slot:focus {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Reports screen ──────────────────────────────────────────────────────────── */
.reports-total {
  font-size: 0.9rem; /* was 0.82rem — AODA */
  color: var(--text-muted);
  margin: 12px 0 8px;
}
.report-card {
  background: #1e293b;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.report-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.report-meta {
  font-size: 0.9rem; /* was 0.82rem — AODA */
  color: var(--text-muted);
  margin-bottom: 2px;
  line-height: 1.4;
}
.report-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ── Quick-actions 3-column override ────────────────────────────────────────── */
.quick-actions.three-col {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn-media {
  background: #1e1040;
  color: #a78bfa;
  border: 1px solid #a78bfa;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.9rem; /* was 0.88rem — AODA */
  padding: 12px 6px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.btn-media:hover, .btn-media:focus {
  background: #251550;
  outline: 2px solid #a78bfa;
}

/* ── S6 — Live screen capture / record / media controls ─────────────────────── */
.storage-warning {
  background: rgba(239,68,68,0.12);
  border: 1px solid var(--red);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 1rem; /* was 0.9rem — AODA */
  color: #fca5a5;
  margin-bottom: 10px;
}

.live-notification {
  font-size: 0.9rem; /* was 0.88rem — AODA */
  color: var(--green);
  min-height: 22px;
  margin-bottom: 6px;
  transition: opacity 0.6s;
}

.live-controls-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.btn-capture {
  background: #0f2040;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem; /* was 0.9rem — AODA */
  font-family: inherit;
  cursor: pointer;
  min-height: 48px; /* was 44px — AODA: min 48px */
  flex: 1;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.btn-capture:hover, .btn-capture:focus {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-capture:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-record {
  background: rgba(239,68,68,0.1);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem; /* was 0.9rem — AODA */
  font-family: inherit;
  cursor: pointer;
  min-height: 48px; /* was 44px — AODA: min 48px */
  flex: 1;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.btn-record.recording {
  background: var(--red);
  color: #fff;
  animation: rec-pulse 1.2s ease-in-out infinite;
}
@keyframes rec-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.7; }
}
.btn-record:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-media-lib {
  background: #1a2840;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem; /* was 0.9rem — AODA */
  font-family: inherit;
  cursor: pointer;
  min-height: 48px; /* was 44px — AODA: min 48px */
  flex: 1;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.btn-media-lib:hover, .btn-media-lib:focus { background: #243551; }
.btn-media-lib:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── S6 — Media screen ───────────────────────────────────────────────────────── */
.media-storage-bar {
  font-size: 0.9rem; /* was 0.88rem — AODA */
  color: var(--text-muted);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #0f2040;
  border-radius: 6px;
}
.media-storage-bar.warn   { color: var(--amber); border-left: 3px solid var(--amber); }
.media-storage-bar.danger { color: var(--red);   border-left: 3px solid var(--red);   }

.media-transfer-all {
  margin-bottom: 14px;
  width: 100%;
}

.media-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.media-item:last-child { border-bottom: none; }

.media-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  background: #0f2040;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.media-info {
  flex: 1;
  min-width: 0;
}
.media-filename {
  font-size: 0.9rem; /* was 0.88rem — AODA */
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-meta {
  font-size: 0.9rem; /* was 0.78rem — AODA */
  color: var(--text-muted);
  margin-top: 2px;
}

.media-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.btn-media-action {
  background: #1e293b;
  color: var(--text);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.9rem; /* was 0.8rem — AODA */
  font-family: inherit;
  cursor: pointer;
  min-height: 48px; /* was 36px — AODA: min 48px */
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn-media-action:hover, .btn-media-action:focus {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-media-action.danger { color: var(--red); border-color: var(--red); }
.btn-media-action.danger:hover, .btn-media-action.danger:focus {
  background: rgba(239,68,68,0.1);
}

/* ── Support Screen ─────────────────────────────────────────── */
.support-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  min-height: 140px;
}
.support-textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.support-char-count {
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.support-error {
  color: var(--red);
  font-size: 0.9rem;
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(239,68,68,0.1);
  border-radius: 6px;
}
.support-sent {
  text-align: center;
  padding: 24px 0 8px;
}
.support-sent-icon {
  font-size: 2.5rem;
  color: var(--green);
  margin-bottom: 12px;
}
.support-form {}

/* ── Fleet Screen (v0.9.6) ─────────────────────────────────────────────────── */

/* Shared input style for standalone inputs (not wrapped in .field) */
.input-field {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.4;
  min-height: 48px;
}
.input-field:focus {
  outline: none;
  border-color: var(--accent);
}
.input-field::placeholder { color: var(--text-muted); opacity: 0.7; }

/* Fleet map view toggle bar */
.fleet-toggle-bar {
  display: flex;
  gap: 0;
  margin: 8px 0 12px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.fleet-tab {
  flex: 1;
  padding: 10px 0;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s, color 0.15s;
}
.fleet-tab.active {
  background: var(--accent);
  color: #0a1628;
}

/* Fleet summary strip below map */
.fleet-summary-strip {
  display: flex;
  justify-content: space-around;
  padding: 12px 8px;
  background: var(--bg-card);
  border-radius: 0 0 8px 8px;
  margin-bottom: 12px;
}
.fleet-stat-item { text-align: center; }
.fleet-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  font-family: 'JetBrains Mono', monospace;
}
.fleet-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Leaflet map dark overrides */
.leaflet-container {
  background: #0a1628 !important;
  font-family: Nunito, sans-serif;
}
.leaflet-popup-content-wrapper {
  background: var(--bg-card, #0c1a30);
  color: var(--text, #e2e8f0);
  border: 1px solid var(--border, #1e3a5f);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}
.leaflet-popup-tip { background: var(--bg-card, #0c1a30); }
.leaflet-popup-content { font-size: 14px; margin: 10px 14px; }

/* Vessel list cards */
.fleet-vessel-card { padding: 14px 16px; margin-bottom: 8px; }
.fleet-vessel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.fleet-vessel-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.fleet-vessel-name {
  font-weight: 700;
  font-size: 1rem;
  font-family: 'JetBrains Mono', monospace;
  flex: 1;
}
.fleet-role-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(0, 180, 216, 0.15);
  color: var(--accent);
  border: 1px solid rgba(0, 180, 216, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Fleet Analytics panel ───────────────────────────────────────────────── */
.fleet-analytics-summary {
  display: flex;
  gap: 8px;
  padding: 12px 0 4px;
}
.fleet-analytics-stat {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 8px;
  text-align: center;
}
.fleet-analytics-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1.2;
}
.fleet-analytics-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.fleet-analytics-bw {
  padding: 14px 16px;
  margin-bottom: 8px;
}
/* Per-vessel stats table rows */
.fleet-analytics-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.fleet-analytics-row:last-child { border-bottom: none; }
.fleet-analytics-vessel-name {
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 80px;
  padding-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}
.fleet-analytics-vessel-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
}
.fleet-analytics-mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 4px 8px;
  min-width: 52px;
}
.fleet-analytics-mini-val {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}
.fleet-analytics-mini-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
}
