/* Customer chrome. Light and dark, phone, tablet, and Windows.
   Brand text stays readable. Tap targets stay at least 44px.
   Safe areas keep the lockup off the iPhone notch. */

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg, #132b45);
  color: var(--ink, #ffffff);
  font-family: "Segoe UI", sans-serif;
}
body[data-theme="dark"] {
  background: #132b45;
  color: #ffffff;
}

.av-wordmark {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  font-weight: 750;
  font-size: 22px;
  letter-spacing: 0.06em;
  line-height: 1.2;
  color: var(--ink, #ffffff);
}
.gate .av-wordmark { text-align: center; margin: 4px 0 10px; }
.av-brand-lockup { display: none !important; }

.av-sim-note,
.gate-lead {
  margin: 8px 0 0;
  color: var(--muted, #c8c8c8);
  font-size: 14px;
  line-height: 1.45;
  max-width: 62ch;
}

.av-app {
  min-height: 100vh;
  background: var(--bg, #132b45);
  color: var(--ink, #ffffff);
  font-family: "Segoe UI", sans-serif;
}

.av-app .top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px
    max(16px, env(safe-area-inset-left));
  background: var(--header-bg, #0f243c);
  border-bottom: 1px solid var(--line, #2a5578);
}

.av-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px max(16px, env(safe-area-inset-right)) 4px max(16px, env(safe-area-inset-left));
}

.av-sections a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line, #2a5578);
  border-radius: 999px;
  color: var(--ink, #ffffff);
  text-decoration: none;
  background: var(--surface, #183552);
}

.av-main {
  padding: 8px max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.av-main h1 {
  margin: 8px 0;
  font-size: 28px;
  line-height: 1.2;
}

.av-banner,
.edu-card,
.av-tile,
.av-panel {
  background: var(--surface, #183552);
  border: 1px solid var(--line, #2a5578);
  border-radius: 12px;
}

.av-banner { padding: 12px 14px; margin: 8px 0 14px; }

.av-tiles,
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.av-tile { padding: 12px; min-height: 96px; }
.av-tile .sym { font-weight: 700; font-size: 16px; }
.av-tile .sub,
.av-tile .chg { color: var(--muted, #c8c8c8); margin-top: 4px; }
.av-up { color: #00c853; }
.av-down { color: #ffd54f; }

.av-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 12px; }
.av-chips .seg {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line, #2a5578);
  background: transparent;
  color: inherit;
}

.av-table { width: 100%; border-collapse: collapse; }
.av-table th,
.av-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line, #2a5578);
}

.edu-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.edu-card { padding: 14px; }
.edu-card h2 { margin: 0 0 6px; font-size: 16px; }
.edu-card p { margin: 0; color: var(--muted, #c8c8c8); }

.av-indexes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin: 8px 0 14px;
}
.av-indexes div {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2, #1c3d5c);
}

.gate {
  max-width: 440px;
  margin: 0 auto;
  padding: max(32px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom));
}
.gate form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.gate label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.gate input {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line, #2a5578);
  background: var(--input-bg, #0f243c);
  color: var(--ink, #ffffff);
}
.gate button,
.av-app .send {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line, #2a5578);
  background: var(--surface-2, #1c3d5c);
  color: var(--ink, #ffffff);
}
.gate button { cursor: pointer; }
.av-app .send:disabled,
.gate button:disabled { cursor: not-allowed; opacity: 0.72; }
.gate-note { color: var(--quiet, #9a9a9a); font-size: 13px; }

[data-theme="light"] {
  --bg: #ffffff;
  --header-bg: #ffffff;
  --surface: #f5f5f5;
  --surface-2: #ececec;
  --line: #c4c4c4;
  --ink: #000000;
  --muted: #333333;
  --quiet: #555555;
  --input-bg: #ffffff;
}
[data-theme="light"] .av-down { color: #9a6b00; }

@media (max-width: 720px) {
  .av-wordmark { font-size: 18px; letter-spacing: 0.04em; }
  .av-main h1 { font-size: 24px; }
  .av-sections a { flex: 1 1 auto; justify-content: center; }
}

.av-opp-board {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.av-opp-card {
  background: var(--surface, #183552);
  border: 1px solid var(--line, #2a5578);
  border-radius: 12px;
  padding: 12px 14px;
}
.av-opp-card h2 { margin: 0 0 4px; font-size: 18px; }
.av-opp-card p { margin: 4px 0; }
.av-confirm-lights {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
}
.av-confirm-light {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 4px 8px;
  font-weight: 650;
}
.av-confirm-light::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-sizing: border-box;
}
.av-confirm-light.is-on::before { background: #00c853; }
.av-confirm-light.is-off::before {
  border: 2px solid currentColor;
  opacity: 0.55;
}
.av-confirm-sep { color: var(--muted, #c8c8c8); }
.av-confirm-label { font-weight: 650; margin: 0; }
.av-confirm-note { color: var(--muted, #c8c8c8); margin: 4px 0 0; }
