:root {
  --bg: #f3f5f8; --card: #ffffff; --ink: #14202e; --muted: #5b6878; --line: #dde3ea;
  --accent: #1d5fd1; --accent-ink: #fff; --mono-bg: #f0f3f7;
  --vfr: #1f9d55; --mvfr: #1d5fd1; --ifr: #d23b3b; --lifr: #b0279e; --none: #8a94a3;
  --warn-bg: #fff4d6; --warn-ink: #6b4b00;
}
:root[data-theme="dark"] {
  --bg: #0b1422; --card: #13213a; --ink: #e6edf6; --muted: #9aa8bb; --line: #253652;
  --accent: #5b9bff; --accent-ink: #08111f; --mono-bg: #0d1a2e;
  --warn-bg: #3a2f10; --warn-ink: #f3d98b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1422; --card: #13213a; --ink: #e6edf6; --muted: #9aa8bb; --line: #253652;
    --accent: #5b9bff; --accent-ink: #08111f; --mono-bg: #0d1a2e;
    --warn-bg: #3a2f10; --warn-ink: #f3d98b;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink);
       font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { display: flex; justify-content: space-between; align-items: center;
       padding: 12px 16px; background: #0f1c2e; color: #fff; }
.brand { font-size: 18px; letter-spacing: .3px; } .brand b { color: #7fb2ff; }
.logo { display: inline-block; transform: rotate(-30deg); margin-right: 4px; }
.ghost { background: none; border: 1px solid #ffffff44; color: #fff; border-radius: 8px;
         width: 40px; height: 40px; font-size: 18px; cursor: pointer; }
.banner { background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; padding: 8px 16px; text-align: center; }

.layout { display: grid; gap: 16px; padding: 16px; max-width: 1200px; margin: 0 auto; }
@media (min-width: 900px) { .layout { grid-template-columns: 340px 1fr; align-items: start; }
                            .panel { position: sticky; top: 16px; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
h2 { font-size: 17px; margin: 0 0 12px; } h3 { font-size: 15px; margin: 0 0 10px; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; font-weight: 600; }
select, input { display: block; width: 100%; margin-top: 4px; font: inherit; color: var(--ink);
                background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
                padding: 10px 12px; min-height: 44px; }
input + select { margin-top: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.go { width: 100%; min-height: 48px; border: 0; border-radius: 10px; background: var(--accent);
      color: var(--accent-ink); font: 600 16px system-ui; cursor: pointer; }
.go:disabled { opacity: .6; }
.hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px;
        padding: 6px 12px; font: 600 13px system-ui; cursor: pointer; }

.results { display: grid; gap: 16px; min-width: 0; }
.empty { color: var(--muted); text-align: center; padding: 40px 16px; }
.head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.head h2 { margin: 0; font-size: 20px; } .sub { color: var(--muted); font-size: 14px; }
.badge { display: inline-block; padding: 6px 12px; border-radius: 8px; color: #fff; font: 700 15px system-ui; letter-spacing: .5px; }
.VFR { background: var(--vfr); } .MVFR { background: var(--mvfr); } .IFR { background: var(--ifr); }
.LIFR { background: var(--lifr); } .NONE { background: var(--none); }
.star { background: none; border: 1px solid var(--line); border-radius: 8px; color: var(--ink);
        padding: 6px 10px; cursor: pointer; font: inherit; }

.raw { position: relative; background: var(--mono-bg); border-radius: 8px; padding: 12px 64px 12px 12px;
       font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.copy { position: absolute; top: 8px; right: 8px; border: 1px solid var(--line); background: var(--card);
        color: var(--ink); border-radius: 6px; font-size: 12px; padding: 4px 8px; cursor: pointer; }
.meta { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 9px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { width: 38%; color: var(--muted); font-weight: 600; font-size: 13px; }

.strip { display: flex; gap: 2px; overflow-x: auto; padding-bottom: 4px; }
.hr { flex: 0 0 34px; text-align: center; font-size: 11px; color: var(--muted); }
.hr .bar { height: 26px; border-radius: 4px; margin-bottom: 4px; position: relative; }
.hr .bar.tempo::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7px;
                        border-radius: 0 0 4px 4px; background: var(--w); }
.hr.target .bar { outline: 2px solid var(--ink); outline-offset: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

.period { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.period .when { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.period .badge { font-size: 12px; padding: 3px 8px; }
.period ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.note { background: var(--warn-bg); color: var(--warn-ink); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.err { border-color: var(--ifr); color: var(--ifr); }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 16px 24px; }
