:root {
  --bg: #eef4f7;
  --panel: #ffffff;
  --panel-alt: #f8fbfc;
  --ink: #11212b;
  --muted: #556773;
  --brand: #13364a;
  --brand-soft: #dfeef6;
  --danger-soft: #fceaea;
  --danger: #8b1e24;
  --border: #d8e3e9;
  --shadow: 0 14px 32px rgba(13, 32, 43, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(19, 54, 74, 0.1), transparent 30%),
    linear-gradient(180deg, #f6fbfd 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
}

.app-shell {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.hero {
  background: linear-gradient(135deg, #13364a 0%, #224f64 100%);
  color: white;
  border-radius: 24px;
  padding: 24px 20px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  opacity: 0.82;
}

.hero h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.05;
}

.subhead {
  margin: 10px 0 0;
  max-width: 44rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.98rem;
  line-height: 1.45;
}

.install-note {
  margin-top: 14px;
  background: var(--brand-soft);
  border: 1px solid #c7ddea;
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--brand);
}

.note-hint {
  background: #f4f7f9;
  border-color: var(--border);
}

.brief-list {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

.brief-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.brief-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.brief-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}

.brief-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.brief-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  background: var(--brand);
  color: white;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.brief-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.brief-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.atis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.atis-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  background: #e7eef2;
  color: var(--brand);
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.atis-fetch {
  border: 0;
  cursor: pointer;
}

.atis-fetch:disabled {
  opacity: 0.7;
  cursor: wait;
}

.atis-panel {
  margin-top: 12px;
  background: #f7fafb;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
}

.atis-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.atis-panel-head strong {
  color: var(--brand);
}

.atis-status {
  color: var(--muted);
  font-size: 0.78rem;
}

.atis-results {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.atis-airport {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
}

.atis-airport-head {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 8px;
}

.atis-line + .atis-line {
  margin-top: 8px;
}

.atis-line.primary {
  background: #edf3f8;
  border-radius: 12px;
  padding: 8px;
}

.atis-line-label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.atis-line-text,
.atis-empty {
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.4;
}

.saved-badge {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.quick-note {
  margin-top: 14px;
  background: #f7fafb;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
}

.quick-note label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 8px;
}

.quick-note textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid #cbd8df;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
  background: white;
}

.quick-note textarea:focus {
  outline: 2px solid rgba(19, 54, 74, 0.18);
  border-color: var(--brand);
}

.quick-note-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.note-button {
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.note-button.primary {
  background: var(--brand);
  color: white;
}

.note-button.secondary {
  background: #e7eef2;
  color: var(--brand);
}

.note-status {
  color: var(--muted);
  font-size: 0.8rem;
}

.trip-meta {
  margin-top: 12px;
  background: #edf3f8;
  color: #18384a;
  border-radius: 14px;
  padding: 10px 12px;
  line-height: 1.45;
}

.trip-meta strong {
  color: #143a52;
}

.stat {
  background: var(--panel-alt);
  border-radius: 14px;
  padding: 10px 12px;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1rem;
  font-weight: 700;
}

.threats {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--danger-soft);
  border-radius: 16px;
}

.threats strong {
  color: var(--danger);
  display: block;
  margin-bottom: 8px;
}

.threats ul {
  margin: 0;
  padding-left: 18px;
  color: #5d1f24;
}

.threats li + li {
  margin-top: 6px;
}

.step-climbs {
  background: #edf3f8;
  color: #18384a;
}

.step-climbs strong {
  color: #18384a;
}

.dispatcher-notes {
  background: #f4f7f9;
}

.dispatcher-notes strong {
  color: #143a52;
}

.dispatcher-notes ul {
  color: #143a52;
}

.etops-notes {
  background: #edf3f8;
}

.etops-notes strong,
.etops-airports,
.etops-notes ul {
  color: #18384a;
}

.etops-airports {
  font-weight: 700;
  margin-bottom: 8px;
}

.loading,
.empty {
  text-align: center;
  color: var(--muted);
  padding: 26px 12px;
}

@media (max-width: 640px) {
  .app-shell {
    padding: 16px 14px 30px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .brief-grid {
    grid-template-columns: 1fr 1fr;
  }
}
