/* SKY.TUTI.LT — Endless ATC airport-file library (dark aviation theme).
   Self-contained: same design tokens as css/base.css of the main site. */
:root {
  color-scheme: dark;
  --bg: #0b0e14;
  --bg2: #11151f;
  --panel: #141926;
  --panel2: #1a2032;
  --line: #232b40;
  --line2: #2e3854;
  --txt: #dbe4f3;
  --txt2: #8fa0bd;
  --txt3: #8494b3;
  --acc: #4da3ff;
  --acc2: #7fd4a8;
  --warn: #fbbf24;
  --bad: #ef4444;
  --radius: 10px;
  --shadow: 0 8px 30px rgba(0,0,0,.45);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5;
  background: var(--bg); color: var(--txt);
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font-family: inherit; }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
code { font-family: var(--mono); font-size: .92em; background: var(--panel2);
       border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
pre { font-family: var(--mono); }

/* ── header / footer chrome (mirrors the site's sub-apps) ─────────────── */
header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px clamp(12px, 3vw, 24px);
  background: var(--bg2); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 7px; color: var(--txt);
         font-size: 15px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand b { color: var(--acc); }
.brand .sep { color: var(--line2); }
.brand span:last-child { color: var(--txt2); }
.spacer { flex: 1; }
.hdr-note { color: var(--txt3); font-size: 12px; white-space: nowrap; }
footer {
  margin-top: 34px; padding: 18px clamp(12px, 3vw, 24px) 26px;
  border-top: 1px solid var(--line); background: var(--bg2);
  color: var(--txt3); font-size: 12.5px;
}
footer .nav { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; }
footer .nav a { color: var(--txt2); }

main { max-width: 1060px; margin: 0 auto; padding: 0 clamp(12px, 3vw, 24px) 10px; }
h1 { font-size: clamp(1.45rem, 4.6vw, 2rem); margin: 22px 0 6px; }
.lede { color: var(--txt2); margin: 0 0 18px; max-width: 72ch; }

.banner {
  display: none; margin: 14px 0; padding: 12px 14px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--bad); color: var(--txt);
}
.banner.warn-show { display: block; }

/* ── hero stats ───────────────────────────────────────────────────────── */
.hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
        gap: 10px; margin: 0 0 16px; }
.stat { background: var(--panel); border: 1px solid var(--line);
        border-radius: var(--radius); padding: 10px 12px; }
.stat .k { color: var(--txt3); font-size: 11.5px; text-transform: uppercase;
           letter-spacing: .04em; }
.stat .v { color: var(--acc); font-weight: 700; font-size: 19px;
           font-variant-numeric: tabular-nums; }

/* ── how-to ───────────────────────────────────────────────────────────── */
details.setup { background: var(--panel); border: 1px solid var(--line);
                border-radius: var(--radius); margin: 0 0 16px; }
details.setup summary { cursor: pointer; padding: 10px 14px; color: var(--acc2);
                        font-weight: 600; list-style-position: inside; }
details.setup p { margin: 0; padding: 0 14px 12px; color: var(--txt2); }

/* ── controls ─────────────────────────────────────────────────────────── */
.controls { display: flex; flex-direction: column; gap: 10px; margin: 0 0 12px; }
.rowtop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#q {
  flex: 1 1 240px; max-width: 560px; min-width: 0; padding: 9px 13px; font-size: 15px;
  background: var(--panel); color: var(--txt);
  border: 1px solid var(--line2); border-radius: var(--radius);
}
#q::placeholder { color: var(--txt3); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 5px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--panel); color: var(--txt2);
  border: 1px solid var(--line2);
}
.chip:hover { color: var(--txt); }
.chip.on { background: var(--acc); color: #06121f; border-color: var(--acc); }
#sort {
  padding: 7px 10px; background: var(--panel); color: var(--txt);
  border: 1px solid var(--line2); border-radius: var(--radius); font-size: 13px;
}
.count { color: var(--txt3); font-size: 12.5px; }

/* ── library list ─────────────────────────────────────────────────────── */
.rows { border: 1px solid var(--line); border-radius: var(--radius);
        overflow: hidden; background: var(--panel); }
.row { border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.rhead {
  display: grid; grid-template-columns: 74px 1fr 118px 96px 168px;
  gap: 10px; align-items: center; padding: 9px 12px; cursor: pointer;
}
.rhead:hover { background: var(--panel2); }
.icao {
  font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--acc);
  background: var(--bg2); border: 1px solid var(--line2); border-radius: 7px;
  padding: 4px 0; text-align: center; letter-spacing: .03em;
  max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
/* Round 34: multi-airport area packs and other long codes
   (ENOR_FIR_STAVANGER…) wrap inside the 74px code cell at a smaller
   size instead of painting over the neighbouring name column. */
.icao.long {
  font-size: 10px; letter-spacing: 0; line-height: 1.25; padding: 3px 2px;
  white-space: normal; word-break: break-word;
}
.rname { min-width: 0; }
.rname b { display: block; white-space: nowrap; overflow: hidden;
           text-overflow: ellipsis; font-size: 14px; }
.rname i { font-style: normal; color: var(--txt3); font-size: 11.5px; }
.areatag {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 5px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
  color: var(--warn); border: 1px solid var(--warn); vertical-align: 1px;
}
.rmeta { color: var(--txt2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.rmeta small { color: var(--txt3); }
.btn {
  padding: 5px 11px; border-radius: 7px; font-size: 12.5px; font-weight: 600;
  background: var(--panel2); color: var(--txt); border: 1px solid var(--line2);
  text-decoration: none; cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: var(--acc); color: var(--acc); }

/* expanded detail */
.detail { display: none; padding: 4px 12px 14px; background: var(--bg2);
          border-top: 1px dashed var(--line); }
.row.open .detail { display: block; }
.row.open .rhead { background: var(--panel2); }
.dgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
         gap: 8px; margin: 10px 0 12px; }
.dcell { background: var(--panel); border: 1px solid var(--line);
         border-radius: 8px; padding: 7px 10px; }
.dcell .k { color: var(--txt3); font-size: 11px; text-transform: uppercase;
            letter-spacing: .04em; }
.dcell .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.dcell .v small { color: var(--txt3); font-weight: 400; }
.dsec { color: var(--txt2); font-size: 12px; text-transform: uppercase;
        letter-spacing: .05em; margin: 12px 0 6px; }
table.rwys { width: 100%; border-collapse: collapse; font-size: 13px; }
table.rwys th, table.rwys td { text-align: left; padding: 5px 8px;
                               border-bottom: 1px solid var(--line); }
table.rwys th { color: var(--txt3); font-weight: 600; font-size: 11.5px;
                text-transform: uppercase; letter-spacing: .04em; }
table.rwys td { font-variant-numeric: tabular-nums; }
table.rwys td:first-child { font-family: var(--mono); color: var(--acc2); }
.apthead { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 4px; }
.apthead b { font-family: var(--mono); color: var(--acc); }
.apthead span { color: var(--txt3); font-size: 12px; }
.variants { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }
.vfile {
  display: inline-flex; align-items: center; gap: 7px; padding: 4px 9px;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 7px;
  font-family: var(--mono); font-size: 12px; color: var(--txt2);
}
.vfile.prim { border-color: var(--acc2); }
.vfile b { color: var(--txt); font-weight: 600; }
.preview {
  margin: 8px 0 0; padding: 10px 12px; background: #080b10;
  border: 1px solid var(--line); border-radius: 8px;
  max-height: 340px; overflow: auto; font-size: 12px; line-height: 1.45;
  color: var(--txt2); white-space: pre; tab-size: 4;
}
.preview .ln { color: var(--txt3); user-select: none; margin-right: 10px; }
.more { margin-top: 8px; }
.empty { color: var(--txt3); text-align: center; padding: 26px 10px;
         border: 1px dashed var(--line2); border-radius: var(--radius); }

/* ── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .rhead { grid-template-columns: 64px 1fr auto; }
  .rhead .rmeta.cont, .rhead .hide-m { display: none; }
}
@media (max-width: 560px) {
  .hdr-note { display: none; }
  .rhead { grid-template-columns: 60px 1fr; gap: 8px; }
  .rhead > .rmeta { display: none; }
  .rhead > .rmeta.always { display: block; grid-column: 1 / -1; }
}
