﻿/* ============================================================
   PilotBriefing ??Professional Aviation Briefing UI
   ============================================================ */

:root {
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Courier New", monospace;

  /* Navy palette */
  --navy-900: #07192e;
  --navy-800: #0c2340;
  --navy-700: #0f3460;
  --navy-600: #0f4c81;
  --navy-500: #1a6fab;

  /* Sky accents */
  --sky-400: #38bdf8;
  --sky-300: #7dd3fc;

  /* Amber */
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --amber-100: #fef3c7;

  /* Status */
  --green-500: #22c55e;
  --green-100: #dcfce7;
  --red-500: #ef4444;
  --red-100: #fee2e2;
  --orange-500: #f97316;
  --orange-100: #ffedd5;

  /* Neutrals */
  --bg: #0a1628;
  --surface: #111f35;
  --border: rgba(255,255,255,0.09);
  --text: #e8f0f9;
  --muted: #7da4c4;
  --subtle: #4d7a9e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overscroll-behavior-y: none; /* 紐⑤컮???밴꺼???덈줈怨좎묠 諛⑹? */
}

/* ?? NAV ???????????????????????????????????????????????????? */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(7, 25, 46, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(56, 189, 248, 0.12);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}
.nav-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--sky-400);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 4px;
  padding: 2px 6px;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-utc {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--sky-300);
}
.nav-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 6px var(--green-500);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.nav-status {
  font-size: 13px;
  font-weight: 600;
  color: var(--green-500);
  letter-spacing: 0.08em;
}

/* ?? HERO ??????????????????????????????????????????????????? */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(15, 76, 129, 0.35) 0%, transparent 70%),
    linear-gradient(180deg, var(--navy-900) 0%, #0a1628 100%);
  padding: 80px 24px 60px;
}
/* ?? PAGE LAYOUT ???????????????????????????????????????????? */
.page-layout {
  display: flex;
  align-items: flex-start;
  gap: 0;
  min-height: calc(100vh - 56px);
  margin-right: 280px; /* room for fixed sidebar */
}
.page-main {
  flex: 1 1 0;
  min-width: 0;
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
}

.hero-inner {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

/* ?? DATABASE SIDEBAR ??????????????????????????????????????? */
.db-stats-grid {
  display: contents; /* desktop: treat children as direct sidebar children */
}
.db-sidebar {
  position: fixed;
  right: 0;
  top: 56px;
  width: 280px;
  height: calc(100vh - 56px);
  background: var(--navy-900);
  border-left: 1px solid rgba(255,255,255,0.08);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  scrollbar-width: none;
  z-index: 90;
}
.db-sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sky-400);
  margin-bottom: 4px;
}
.db-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 10px 14px;
}
.db-stat-icon {
  flex: 0 0 auto;
  color: var(--sky-400);
  opacity: 0.8;
  display: flex;
  align-items: center;
}
.db-stat-info { flex: 1; min-width: 0; }
.db-stat-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
}
.db-stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}
.db-sev-section { padding: 4px 0 0; }
.db-sev-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.db-sev-bars { display: flex; flex-direction: column; gap: 5px; }
.db-sev-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.db-sev-name {
  width: 60px;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}
.db-sev-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
}
.db-sev-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.db-sev-count {
  width: 36px;
  text-align: right;
  color: rgba(255,255,255,0.4);
  font-family: var(--font-mono);
  font-size: 13px;
  flex: 0 0 auto;
}
.db-sev-skeleton {
  height: 60px;
  background: rgba(255,255,255,0.05);
  border-radius: 6px;
}
.db-sources-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 10px 14px;
}
.db-sources-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.db-sources-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.db-source-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--sky-300);
  background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.2);
  border-radius: 5px;
  padding: 3px 8px;
  white-space: nowrap;
}
.db-sidebar-footer {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: rgba(255,255,255,0.3);
  padding-top: 4px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.db-live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 6px var(--green-500);
  flex: 0 0 auto;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.hero-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--sky-400);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero-title {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.hero-sub {
  font-size: 16px;
  color: rgba(255,255,255,0.55);
  line-height: 1.65;
  max-width: 480px;
  margin: 0 auto 36px;
}

/* ?? SEARCH BOX ????????????????????????????????????????????? */
.search-box {
  display: flex;
  gap: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 8px;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}
.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
}
.search-icon {
  flex: 0 0 auto;
  color: var(--sky-400);
  opacity: 0.7;
}
.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.06em;
  outline: none;
}
.search-input::placeholder { color: rgba(255,255,255,0.25); font-weight: 400; }
.search-btn {
  flex: 0 0 auto;
  background: var(--sky-400);
  color: var(--navy-900);
  border: none;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  padding: 0 28px;
  height: 48px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.02em;
}
.search-btn:hover { background: var(--sky-300); }
.search-btn:active { transform: scale(0.97); }
.search-btn:disabled { opacity: 0.5; cursor: wait; }

.status-msg {
  font-size: 15px;
  color: var(--amber-400);
  min-height: 20px;
  margin-bottom: 8px;
}

.survey-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
}
.survey-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--sky-400);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(4px);
}
.survey-link:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--sky-300);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.survey-link:active {
  transform: translateY(0);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.hero-tags span {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 4px 12px;
  letter-spacing: 0.04em;
}

/* ?? NAV NEW SEARCH BUTTON ?????????????????????????????????? */
.nav-new-search {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  font-weight: 600;
  padding: 5px 13px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  font-family: var(--font-sans);
}
.nav-new-search:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* ?? CONTAINER ?????????????????????????????????????????????? */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}
.results-wrap { flex: 1; min-height: calc(100vh - 56px); }
.no-threat-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  gap: 16px;
  min-height: 40vh;
}
.no-threat-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.no-threat-sub {
  font-size: 17px;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.6;
}
.hidden { display: none !important; }

/* ?? CONTEXT PANEL ?????????????????????????????????????????? */
.ctx-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 16px 16px;
  margin-bottom: 28px;
  box-shadow: 0 4px 24px rgba(15, 76, 129, 0.08);
  overflow: visible;
}
.ctx-header {
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-600) 100%);
  padding: 20px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 56px;
  z-index: 80;
  border-radius: 0;
  margin-top: 16px;
}
.ctx-header-row1 {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.ctx-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ctx-risk-badge {
  position: static;
}
.ctx-header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ctx-header-brand-name {
  font-size: 22px;
  font-weight: 700;
  color: rgba(255,255,255,0.95);
  letter-spacing: 0.01em;
}
.ctx-header-brand-badge {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--sky-400);
  background: rgba(56,189,248,0.12);
  border: 1px solid rgba(56,189,248,0.25);
  border-radius: 4px;
  padding: 3px 9px;
}
.ctx-header-center {
  text-align: center;
}
.ctx-flight-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.ctx-flight {
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.04em;
}
.ctx-flight-sep {
  font-size: 24px;
  color: rgba(255,255,255,0.3);
}
.ctx-route-inline {
  font-size: 20px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em;
}
.ctx-aircraft-inline {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--sky-300);
}
.ctx-time-inline { display: none; }
.ctx-time-paren {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--sky-400);
  margin-left: 3px;
  opacity: 0.85;
}
.ctx-icao-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 18px;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.05em;
}
.ctx-icao-seg { white-space: nowrap; }
.ctx-icao-search {
  color: inherit;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.ctx-icao-search:hover { opacity: 1; }
.ctx-search-icon { font-style: normal; margin-left: 3px; }
.ctx-icao-arrow {
  color: var(--sky-400);
  font-size: 20px;
  flex-shrink: 0;
}
.ctx-threat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  justify-content: center;
}
.ctx-threat-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  background: rgba(245,158,11,0.15);
  color: var(--amber-400);
  border: 1px solid rgba(245,158,11,0.3);
  white-space: nowrap;
}
.ctx-wx-brief {
  margin-top: 8px;
  font-size: 15px;
  color: var(--sky-300);
  word-break: break-word;
  overflow-wrap: break-word;
  background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.18);
  border-radius: 6px;
  padding: 6px 12px;
  text-align: center;
  letter-spacing: 0.01em;
}
.ctx-route { display: none; }
.ctx-aircraft { display: none; }
.risk-badge {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 6px 14px;
  border-radius: 8px;
  text-transform: uppercase;
}
.risk-badge.low    { background: var(--green-100); color: #15803d; }
.risk-badge.medium { background: var(--amber-100); color: #92400e; }
.risk-badge.high   { background: var(--orange-100); color: #9a3412; }
.risk-badge.critical { background: var(--red-100); color: #991b1b; }

.ctx-body {
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ctx-chip-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  letter-spacing: 0.04em;
}
.ctx-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  min-width: 0;
  overflow: hidden;
}
.ctx-block-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--subtle);
  text-transform: uppercase;
  margin-bottom: 8px;
}
/* ?? risk breakdown ?? */
.risk-breakdown-list { display: flex; flex-direction: column; gap: 5px; }
.risk-breakdown-item { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.risk-breakdown-tag { width: 110px; flex-shrink: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.risk-breakdown-bar-wrap { flex: 1; background: var(--border); border-radius: 4px; height: 5px; overflow: hidden; }
.risk-breakdown-bar { display: block; height: 100%; background: var(--amber, #e8a020); border-radius: 4px; transition: width 0.4s ease; }
.risk-breakdown-score { width: 28px; text-align: right; color: var(--subtle); font-variant-numeric: tabular-nums; }
.ctx-weather-text {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: break-word;
  max-width: 100%;
  margin: 0;
  display: block;
}
.ctx-msg {
  grid-column: 1 / -1;
  font-size: 15px;
  color: var(--amber-500);
  background: var(--amber-100);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
}
.ctx-links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ctx-link {
  font-size: 14px;
  color: var(--navy-600);
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  transition: background 0.15s;
}
.ctx-link:hover { background: rgba(255,255,255,0.08); }

/* ?? THREATS SECTION ???????????????????????????????????????? */
.threats-section {}
.threats-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.threats-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.threats-count {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
}

/* ?? THREAT CARD ???????????????????????????????????????????? */
.threat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(15, 76, 129, 0.06);
  transition: box-shadow 0.2s;
}
.threat-card:hover { box-shadow: 0 4px 20px rgba(15, 76, 129, 0.12); }

.threat-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.threat-num {
  flex: 0 0 32px;
  width: 32px; height: 32px;
  background: var(--navy-800);
  color: var(--sky-400);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.threat-title-wrap { flex: 1; min-width: 0; }
.threat-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.threat-desc {
  font-size: 16px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.45;
}
.threat-event-count {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}

/* ?? EVENT ITEM (inside threat) ????????????????????????????? */
.event-item {
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.event-item:last-child { border-bottom: none; }
details[open].event-item {
  border-left-color: var(--sky-400);
  background: rgba(56,189,248,0.05);
}

.event-summary {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px 12px 12px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.12s;
}
.event-summary:hover { background: rgba(255,255,255,0.04); }
details[open] > .event-summary {
  background: rgba(56,189,248,0.06);
}

/* Score box — large number on left */
.score-box {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.score-high { background: rgba(34,197,94,0.15); color: #22c55e; }
.score-med  { background: rgba(234,179,8,0.15);  color: #eab308; }
.score-low  { background: rgba(239,68,68,0.13);  color: #ef4444; }

/* Summary body */
.event-summary-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.event-summary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Aircraft family chip */
.ac-family-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.3);
  white-space: nowrap;
}

/* Inline fuel advisory in collapsed card */
.fuel-advisory-inline {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  background: rgba(245,158,11,0.08);
  border-left: 2px solid rgba(245,158,11,0.5);
  padding: 5px 10px;
  border-radius: 0 4px 4px 0;
  margin-top: 2px;
}
.fuel-adv-icon { font-size: 12px; flex-shrink: 0; line-height: 1.5; }
.fuel-adv-text {
  font-size: 12px;
  color: #d97706;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Baseline comparison note */
.baseline-note {
  margin: 18px 0 4px;
  padding: 10px 16px;
  background: rgba(56,189,248,0.06);
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--sky-400, #38bdf8);
  font-style: italic;
  text-align: center;
  letter-spacing: 0.01em;
}
.event-chevron {
  flex: 0 0 16px;
  color: var(--subtle);
  font-size: 14px;
  transition: transform 0.2s;
}
details[open] .event-chevron { transform: rotate(90deg); }
details summary::-webkit-details-marker { display: none; }
details summary::marker { content: ""; }

.event-one-line {
  flex: 1;
  font-size: 16px;
  color: var(--text);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-match {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.event-match.match-high { color: var(--red-500); }
.event-match.match-med  { color: var(--amber-500); }

.sev-dot {
  flex: 0 0 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sev-dot.low      { background: var(--green-500); }
.sev-dot.medium   { background: var(--amber-500); }
.sev-dot.high     { background: var(--orange-500); }
.sev-dot.critical { background: var(--red-500); }

/* ?? EVENT DETAIL ??????????????????????????????????????????? */
.event-detail {
  border-top: 1px solid rgba(56,189,248,0.15);
  background: rgba(255,255,255,0.03);
  padding: 20px 20px 20px 56px;
}
.event-detail-title {
  font-size: 18px;
  font-weight: 700;
  color: #e8f0f9;
  margin-bottom: 12px;
  line-height: 1.35;
}
.event-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.event-meta-chip {
  font-size: 13px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
}
.event-summary-text {
  font-size: 17px;
  color: rgba(232,240,249,0.8);
  line-height: 1.65;
  margin-bottom: 16px;
}
.event-section-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy-600);
  margin-bottom: 8px;
}
.event-list {
  margin: 0 0 14px 18px;
  padding: 0;
}
.event-summary-list {
  list-style: none;
  margin-left: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.event-summary-list li {
  position: relative;
  padding-left: 14px;
  font-size: 15px;
  color: rgba(232,240,249,0.82);
  line-height: 1.55;
}
.event-summary-list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--sky-400);
  font-weight: 700;
}
.event-list li {
  font-size: 16px;
  color: rgba(232,240,249,0.75);
  line-height: 1.55;
  margin-bottom: 3px;
}
.briefing-kw-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.briefing-kw {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(56,189,248,0.12);
  color: var(--sky-300);
  border: 1px solid rgba(56,189,248,0.25);
  white-space: nowrap;
}

.briefing-kw.phase-kw {
  background: rgba(34, 197, 94, 0.1);
  color: var(--green-500);
  border-color: rgba(34, 197, 94, 0.25);
}

.pending-ai-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--amber-400);
  background: rgba(245, 158, 11, 0.1);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  font-style: italic;
}

.event-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtle);
  margin: 16px 0 8px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 4px;
}

.lesson-label { color: var(--sky-300); }
.rec-label { color: var(--green-500); opacity: 0.8; }

.bullet-list {
  list-style: none;
  margin: 0 0 16px 0;
}
.bullet-list li {
  position: relative;
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255,255,255,0.85);
  margin-bottom: 6px;
}
.bullet-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--sky-400);
  font-weight: 900;
}

.lesson-list li { color: #fff; font-weight: 500; }
.lesson-list li::before { color: var(--sky-300); }

.rec-action-box {
  background: rgba(34, 197, 94, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-left: 4px solid var(--green-500);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 15px;
  line-height: 1.5;
  color: #e2f2e9;
  margin-bottom: 16px;
}

.subtle-text {
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
}

.fuel-advisory-box {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.12);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.fuel-adv-line {
  font-size: 14px;
  line-height: 1.6;
  color: var(--amber-100);
  margin-bottom: 4px;
}
.fuel-adv-line:last-child { margin-bottom: 0; }

.event-footer {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  display: flex;
  justify-content: space-between;
}
.event-briefing {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 12px;
}
.event-briefing-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--sky-400);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.event-briefing-text {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.5;
}

/* ?? FOOTER ????????????????????????????????????????????????? */
.footer {
  background: var(--navy-900);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 20px 24px;
  margin-top: auto;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-inner span {
  font-size: 14px;
  color: rgba(255,255,255,0.3);
}

/* ?? NOTAM ?꾪삊 ?뱀뀡 ???????????????????????????????????????? */
.notam-section { margin-bottom: 32px; }

.notam-placeholder-text {
  font-size: 13px;
  color: var(--subtle);
  font-style: italic;
  padding: 10px 0;
}

.notam-clear-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-size: 14px;
  color: var(--muted);
}

.notam-mini-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notam-mini-card {
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border-left: 3px solid transparent;
}
.notam-mini-card.notam-critical { border-left-color: var(--red-500); background: rgba(239,68,68,0.04); }
.notam-mini-card.notam-high     { border-left-color: var(--orange-500); }
.notam-mini-card.notam-medium   { border-left-color: var(--amber-500); }
.notam-mini-card.notam-low      { border-left-color: var(--green-500); }

.notam-mini-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notam-mini-icon {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}
.notam-mini-icon.sev-critical { background: rgba(239,68,68,0.15); color: #ef4444; }
.notam-mini-icon.sev-high     { background: rgba(249,115,22,0.15); color: #f97316; }
.notam-mini-icon.sev-medium   { background: rgba(234,179,8,0.15);  color: #eab308; }
.notam-mini-icon.sev-low      { background: rgba(34,197,94,0.12);  color: #22c55e; }

.notam-mini-main { flex: 1; min-width: 0; }
.notam-mini-headline {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notam-mini-id {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--subtle);
}
.notam-mini-score {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--sky-400);
}

.notam-block-critical {
  border-color: rgba(239, 68, 68, 0.3) !important;
  background: rgba(239, 68, 68, 0.02) !important;
}

.notam-footer-note {
  font-size: 11px;
  color: var(--subtle);
  text-align: center;
  margin-top: 4px;
  font-style: italic;
}

.notam-card-main { flex: 1; min-width: 0; }
.notam-card-headline {
  font-size: 15px; font-weight: 600;
  color: rgba(255,255,255,0.92);
  margin-bottom: 4px;
}
.notam-card-meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: rgba(255,255,255,0.35);
  font-family: 'JetBrains Mono', monospace;
}
.notam-id { color: rgba(56,189,248,0.6); }

.notam-score-badge {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 800;
}
.notam-score-val {
  font-size: 14px;
}
.notam-score-badge.notam-score-critical { color: var(--red-500); }
.notam-score-badge.notam-score-high     { color: var(--orange-500); }
.notam-score-badge.notam-score-medium   { color: var(--amber-500); }
.notam-score-badge.notam-score-low      { color: var(--green-500); }

.notam-raw-wrap { margin-top: 10px; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 8px; }
.notam-raw-toggle {
  font-size: 13px; color: rgba(255,255,255,0.3);
  cursor: pointer; list-style: none; user-select: none;
}
.notam-raw-toggle:hover { color: rgba(255,255,255,0.5); }
.notam-raw {
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; line-height: 1.6;
  color: rgba(255,255,255,0.4);
  white-space: pre-wrap; word-break: break-all;
  background: rgba(0,0,0,0.2); border-radius: 6px; padding: 10px;
}

/* ?? RESPONSIVE ????????????????????????????????????????????? */

/* ?? ?쒕툝由?(??00px) ??????????????????????????????????????? */
@media (max-width: 900px) {
  .page-layout { display: block; margin-right: 0; }
  .page-main { display: block; min-height: 0; }
  .results-wrap { display: block; min-height: 0; }
  .db-sidebar {
    position: static;
    width: 100%; height: auto;
    border-left: none; border-top: 1px solid rgba(255,255,255,0.08);
    padding: 16px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }
  .db-sidebar-title { width: 100%; margin-bottom: 0; }
  .db-stats-grid { display: contents; } /* tablet: treat as direct flex children */
  .db-stat-card { flex: 1 1 140px; }
  .db-sources-card { flex: 1 1 100%; }
  .db-sev-section { flex: 1 1 100%; }
  .db-sidebar-footer { flex: 1 1 100%; }
  .ctx-header { padding: 16px 20px 18px; margin-top: 12px; gap: 10px; }
  .ctx-flight-row { justify-content: center; }
}

/* ?? 紐⑤컮??(??40px) ??????????????????????????????????????? */
@media (max-width: 640px) {
  .results-wrap { min-height: 0; }

  /* Nav */
  .nav-inner { padding: 0 14px; }
  .nav-utc { display: none; }
  .nav-badge { display: none; }
  .nav-title { font-size: 15px; }

  /* Hero */
  .hero { padding: 72px 16px 40px; }
  .hero-inner { text-align: left; }
  .hero-title { font-size: clamp(28px, 8vw, 40px); }
  .hero-sub { font-size: 14px; margin-bottom: 24px; text-align: left; }
  .hero-eyebrow { margin-bottom: 12px; }
  .hero-tags { justify-content: center; }

  /* Search */
  .search-box { flex-direction: column; gap: 0; padding: 6px 6px 6px 6px; }
  .search-input-wrap { padding: 10px 12px; min-height: 52px; }
  .search-input { font-size: 20px; }
  .search-btn { width: 100%; height: 52px; border-radius: 10px; margin-top: 8px; }

  /* Container */
  .container { padding: 12px 12px 40px; }

  /* ctx-header: 2-row layout */
  .ctx-header { padding: 16px 14px 14px; margin-top: 8px; gap: 8px; }
  .ctx-header-center { width: 100%; display: flex; flex-direction: column; align-items: center; }
  .ctx-flight-row { width: 100%; justify-content: center; }
  .ctx-icao-row { width: 100%; justify-content: center; }
  .ctx-header-brand-name { font-size: 17px; }
  .ctx-header-brand-badge { font-size: 13px; padding: 2px 7px; }

  /* Flight info row: wrap to 2 lines */
  .ctx-flight { font-size: 28px; }
  .ctx-flight-sep { font-size: 20px; }
  .ctx-route-inline { font-size: 16px; }
  .ctx-time-paren { font-size: 14px; }

  /* Risk badge */
  .risk-badge { font-size: 13px; padding: 4px 10px; }

  /* ctx-body */
  .ctx-body { padding: 14px; grid-template-columns: 1fr; gap: 10px; }
  .ctx-block-label { font-size: 12px; }
  .ctx-weather-text { font-size: 13px; }

  /* DB Sidebar on mobile: full vertical layout */
  .db-sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 16px;
    gap: 12px;
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-x: hidden;
  }
  .db-sidebar-title { display: flex; }
  .db-sources-card { display: block; }
  .db-sev-section { display: block; }
  .db-sidebar-footer { display: flex; }
  /* stat cards: 2-column grid */
  .db-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .db-stats-grid .db-stat-card { flex: unset; }
  .db-stat-value { font-size: 16px; }
  .db-stat-label { font-size: 10px; }
  .db-stat-icon svg { width: 16px; height: 16px; }

  /* Threat cards */
  .threats-section { margin-top: 0; }
  .threats-title { font-size: 18px; }
  .threat-card-header { padding: 12px 14px; gap: 10px; flex-wrap: wrap; }
  .threat-title { font-size: 16px; }
  .threat-desc { font-size: 14px; }
  .threat-num { width: 28px; height: 28px; font-size: 14px; }

  /* Event rows */
  .event-summary { padding: 10px 12px 10px 10px; gap: 10px; }
  .score-box { width: 42px; height: 42px; font-size: 18px; border-radius: 6px; }
  .event-one-line { font-size: 13px; white-space: normal; }
  .fuel-adv-text { font-size: 11px; }
  .baseline-note { font-size: 11.5px; }

  /* Event detail */
  .event-detail { padding: 14px 14px 14px 44px; }
  .event-detail-title { font-size: 16px; }
  .event-summary-text { font-size: 15px; }
  .event-briefing { padding: 12px; }
  .event-briefing-text { font-size: 15px; }

  /* Footer */
  .footer { padding: 14px 16px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ?? ?뚰삎 ??(??80px) ?????????????????????????????????????? */
@media (max-width: 380px) {
  .ctx-flight { font-size: 24px; }
  .ctx-route-inline { font-size: 14px; }
  .ctx-flight-sep { font-size: 16px; }
  .nav-status { display: none; }
  .nav-new-search { font-size: 13px; padding: 4px 10px; }
}
