:root {
  --bg: #0e1420;
  --panel: #172234;
  --panel-2: #1e2c42;
  --line: #2a3a54;
  --text: #e6edf6;
  --muted: #93a4bd;
  --accent: #4ea1ff;
  --ok: #3ecf8e;
  --warn: #ffb020;
  --err: #ff5c5c;
  --chip: #23344e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px;
  background: rgba(14,20,32,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.brand h1 { font-size: 18px; margin: 0; }
.brand .sub { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.refresh {
  background: var(--chip); color: var(--text); border: 1px solid var(--line);
  width: 40px; height: 40px; border-radius: 10px; font-size: 20px; cursor: pointer;
}
.refresh:active { transform: scale(.95); }
.refresh.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.banner { margin: 12px 16px 0; padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.banner.err { background: rgba(255,92,92,.12); border: 1px solid var(--err); color: #ffd4d4; }
.banner.warn { background: rgba(255,176,32,.12); border: 1px solid var(--warn); color: #ffe6bd; }
.hidden { display: none; }

.meta {
  margin: 12px 16px; padding: 14px 16px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px;
  display: flex; flex-wrap: wrap; gap: 10px 22px;
}
.meta .item { display: flex; flex-direction: column; }
.meta .k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.meta .v { font-size: 15px; font-weight: 600; }
.meta .v.big { color: var(--accent); }

.content { padding: 4px 16px 40px; max-width: 900px; margin: 0 auto; }
.loading { color: var(--muted); padding: 30px 0; text-align: center; }

.aero {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  margin: 14px 0; overflow: hidden;
}
.aero > summary {
  list-style: none; cursor: pointer; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
}
.aero > summary::-webkit-details-marker { display: none; }
.aero .code {
  font-weight: 800; font-size: 17px; letter-spacing: .03em;
  background: var(--chip); padding: 4px 10px; border-radius: 8px; color: var(--accent);
}
.aero .name { font-weight: 600; }
.aero .count { margin-left: auto; font-size: 13px; color: var(--muted); }
.aero .count b { color: var(--text); }
.aero[open] > summary { border-bottom: 1px solid var(--line); }

.cat { padding: 6px 16px 10px; }
.cat h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 14px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 4px;
}
.notam {
  background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 10px 12px; margin: 8px 0;
}
.notam .head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 6px; }
.notam .ref { font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--accent); }
.notam .tag { font-size: 11px; padding: 2px 7px; border-radius: 20px; background: var(--chip); color: var(--muted); }
.notam .valid { font-size: 12px; color: var(--muted); margin-left: auto; }
.notam .text { white-space: pre-wrap; word-break: break-word; font-size: 14px; }
.notam .text.en { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.empty { color: var(--muted); font-style: italic; padding: 4px 0 10px; }

.close-card {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin: 12px 0 4px; padding: 9px;
  background: var(--chip); color: var(--muted); border: 1px solid var(--line);
  border-radius: 8px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.close-card:hover { color: var(--text); border-color: var(--accent); }
.close-card:active { transform: scale(.99); }

/* Écran de blocage (données non fiables) */
.block-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 12, 20, .74); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.block-overlay.hidden { display: none; }
.block-card {
  background: var(--panel); border: 2px solid var(--err); border-radius: 16px;
  max-width: 460px; width: 100%; padding: 26px 22px; text-align: center;
  box-shadow: 0 12px 44px rgba(0, 0, 0, .45);
}
.block-icon { font-size: 42px; line-height: 1; }
.block-card h2 { color: var(--err); margin: 10px 0 8px; font-size: 20px; }
.block-card p { color: var(--text); font-size: 14px; margin: 0 0 18px; }
.block-btn {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  padding: 12px 20px; border-radius: 10px; font-weight: 600; font-size: 14px;
}
.block-btn:hover { filter: brightness(1.08); }
.block-retry {
  display: block; width: 100%; margin-top: 12px; background: var(--chip); color: var(--text);
  border: 1px solid var(--line); padding: 11px; border-radius: 10px; cursor: pointer; font-size: 14px;
}
.block-retry:hover { border-color: var(--accent); }
.block-reveal {
  display: block; width: 100%; margin-top: 10px; background: transparent; color: var(--muted);
  border: 0; font-size: 12px; cursor: pointer; text-decoration: underline; line-height: 1.4;
}

.foot { color: var(--muted); font-size: 12px; padding: 10px 16px 30px; max-width: 900px; margin: 0 auto; }
.foot a { color: var(--accent); }

@media (max-width: 520px) {
  .meta { gap: 10px 16px; }
  .notam .valid { margin-left: 0; width: 100%; }
}
