/* Flight tools page. Builds on ../dpe/styles.css, cfi.css, syllabus.css, workbook.css and quiz.css. */

.tl-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tl-tabs button { appearance: none; padding: .55rem 1.1rem; border-radius: 999px; border: 1px solid var(--panel-border); background: var(--input-bg); color: var(--fg); font: inherit; font-size: .92rem; cursor: pointer; }
.tl-tabs button:hover { background: var(--btn-hover); }
.tl-tabs button[aria-selected="true"] { background: var(--btn-active); border-color: var(--btn-active); font-weight: 700; }
.tl-fine { color: var(--muted); font-size: .78rem; line-height: 1.45; margin: 1.2rem 0 0; }

.tl-panel { border: 1px solid var(--panel-border); background: var(--panel-bg); border-radius: 12px; padding: 1rem 1.15rem 1.15rem; margin-bottom: 1rem; }
.tl-panel h2, .tl-panel h3 { margin: 0 0 .6rem; font-size: 1.02rem; }
.tl-hint { color: var(--muted); font-size: .8rem; line-height: 1.45; margin: .4rem 0 0; }

.tl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: .6rem .8rem; align-items: start; }
.tl-f label { display: block; font-size: .75rem; color: var(--muted); margin-bottom: .2rem; }
.tl-f input, .tl-f select, .tl-f textarea { width: 100%; padding: .5rem .6rem; border: 1px solid var(--input-border); border-radius: 8px; background: var(--input-bg); color: var(--fg); font: inherit; color-scheme: dark; }
.tl-f input:focus, .tl-f select:focus, .tl-f textarea:focus { outline: 2px solid #7fb2ea; outline-offset: 1px; }
.tl-f.wide { grid-column: 1 / -1; }
.tl-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .7rem; align-items: center; }
.tl-row .btn-secondary { text-decoration: none; }

.tl-out { margin-top: .8rem; padding: .7rem .85rem; border-radius: 10px; background: rgba(47,111,189,.12); border: 1px solid rgba(127,178,234,.5); min-height: 2.6rem; line-height: 1.55; font-variant-numeric: tabular-nums; }
.tl-out:empty::before { content: "Results appear here."; color: var(--muted); }
.tl-out b { font-size: 1.12rem; }
.tl-out .bad { color: var(--danger); }
.tl-out .dim { color: var(--muted); font-size: .85rem; }
.tl-out .rowline { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.08); padding: .15rem 0; }
.tl-out .rowline:first-child { border-top: 0; }

/* ---- E6B grid of calculators ---- */
.tl-calcs { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.tl-calcs .tl-panel { margin: 0; }

/* ---- weather ---- */
.wx-card { border: 1px solid var(--panel-border); background: var(--panel-bg); border-radius: 12px; padding: .9rem 1.1rem; margin-bottom: .8rem; }
.wx-head { display: flex; gap: .6rem 1rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .4rem; }
.wx-head .id { font-size: 1.15rem; font-weight: 800; letter-spacing: .04em; }
.wx-head .when { color: var(--muted); font-size: .82rem; }
.wx-cat { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 800; letter-spacing: .05em; border: 1px solid; }
.wx-cat.VFR { color: #57d38c; border-color: #57d38c; background: rgba(87,211,140,.14); }
.wx-cat.MVFR { color: #7fb8ff; border-color: #7fb8ff; background: rgba(90,169,255,.16); }
.wx-cat.IFR { color: #ff8a8a; border-color: #ff8a8a; background: rgba(255,107,107,.16); }
.wx-cat.LIFR { color: #e49bff; border-color: #e49bff; background: rgba(215,123,255,.16); }
.wx-sec { font-size: .7rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: .8rem 0 .25rem; font-weight: 700; }
.wx-raw { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; line-height: 1.5; padding: .55rem .7rem; border-radius: 8px; background: rgba(0,0,0,.35); word-break: break-word; user-select: all; }
.wx-lines { margin: .4rem 0 0; padding-left: 1.15rem; line-height: 1.55; }
.wx-lines li { margin: .1rem 0; }
.wx-none { color: var(--muted); font-size: .9rem; }
.wx-warn { color: var(--amber); font-size: .85rem; margin: .35rem 0 0; }
.wx-raw .wx-rawline { padding: .15rem .5rem; margin: .15rem 0; border-left: 4px solid transparent; border-radius: 4px; }
.wx-raw .wx-rawline.VFR { color: #57d38c; border-left-color: #57d38c; background: rgba(87,211,140,.12); }
.wx-raw .wx-rawline.MVFR { color: #7fb8ff; border-left-color: #7fb8ff; background: rgba(90,169,255,.14); }
.wx-raw .wx-rawline.IFR { color: #ff8a8a; border-left-color: #ff8a8a; background: rgba(255,107,107,.14); }
.wx-raw .wx-rawline.LIFR { color: #e49bff; border-left-color: #e49bff; background: rgba(215,123,255,.14); }
.wx-period.VFR { border-left-color: #57d38c; } .wx-period.MVFR { border-left-color: #7fb8ff; } .wx-period.IFR { border-left-color: #ff8a8a; } .wx-period.LIFR { border-left-color: #e49bff; }
.wx-period { border-left: 3px solid var(--panel-border); padding: .2rem 0 .2rem .8rem; margin: .55rem 0; }
.wx-period .lab { font-weight: 700; display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap; }
.wx-unk { color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.wx-src { color: var(--muted); font-size: .78rem; margin: .2rem 0 .8rem; }

@media (max-width: 520px) {
  .tl-calcs { grid-template-columns: 1fr; }
  .tl-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- E6B step-by-step flow ---- */
.tl-stepnav { display: flex; gap: .35rem; flex-wrap: wrap; margin: 0 0 1rem; align-items: center; }
.tl-stepnav button { appearance: none; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--panel-border); background: var(--input-bg); color: var(--fg); font: inherit; font-size: .8rem; cursor: pointer; }
.tl-stepnav button:hover { background: var(--btn-hover); }
.tl-stepnav .tl-startover { margin-left: auto; border-style: dashed; }
.tl-flow { display: grid; gap: 1rem; margin-bottom: .5rem; }
.tl-flow .tl-panel { margin: 0; }
.tl-step { scroll-margin-top: .8rem; }
.tl-step h3 { display: flex; align-items: center; gap: .6rem; }
.tl-num { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--btn-active); color: #fff; font-size: .85rem; font-weight: 800; }
.tl-intro { margin: 0 0 .7rem; }
.tl-inline { display: flex; gap: .35rem; }
.tl-inline input { min-width: 0; }
.tl-inline select { width: auto; flex: 0 0 auto; }
.tl-carry { font-size: .72rem; color: var(--muted); margin-top: .2rem; min-height: 1em; line-height: 1.35; }
.tl-carry button { appearance: none; border: 0; background: none; color: var(--link, #7fb2ea); text-decoration: underline; cursor: pointer; font: inherit; padding: 0 .15rem; }
.tl-row .btn-secondary[aria-pressed="true"] { background: var(--btn-active); border-color: var(--btn-active); color: #fff; }
.tl-more-h { margin: 1.6rem 0 .7rem; font-size: 1.05rem; }
.tl-grid .tl-span2 { grid-column: span 2; }

/* keep the input boxes in a row level: every label reserves two lines, notes under a box never push it */
.tl-flow .tl-f { display: flex; flex-direction: column; }
.tl-flow .tl-f > label { min-height: 2.1rem; line-height: 1.05rem; display: flex; align-items: flex-end; }
.tl-f input:disabled.tl-calc-out, .tl-f select:disabled.tl-calc-out { opacity: 1; -webkit-text-fill-color: var(--fg); font-weight: 700; background: rgba(47,111,189,.14); border-color: var(--btn-active); }
.tl-f input:disabled.tl-calc-out::placeholder { -webkit-text-fill-color: var(--muted); font-weight: 400; }

/* ---- wind gauges ---- */
.tl-wind + .tl-wind { margin-top: .9rem; padding-top: .7rem; border-top: 1px solid rgba(255,255,255,.12); }
.tl-wind-tag { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: .3rem; }
.tl-gauge { margin: .35rem 0 .15rem; padding-bottom: 1.1rem; }
.tl-gauge-head { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; margin-bottom: .3rem; }
.tl-gauge-head span { flex: 1 1 auto; }
.tl-gauge-head b { font-size: 1.05rem; }
.tl-lv { font-style: normal; font-size: .72rem; font-weight: 800; letter-spacing: .05em; padding: .05rem .55rem; border-radius: 999px; color: #14171a; }
.tl-gauge-bar { position: relative; display: flex; height: 14px; border-radius: 7px; overflow: visible; }
.tl-gauge-bar i { display: block; height: 100%; }
.tl-gauge-bar i:first-of-type { border-radius: 7px 0 0 7px; }
.tl-gauge-bar i:last-of-type { border-radius: 0 7px 7px 0; }
.lv-g { background: #3fae6a; } .lv-y { background: #e5c446; } .lv-o { background: #f08c2e; } .lv-r { background: #e0473f; }
.tl-gauge-mark { position: absolute; top: -5px; width: 4px; height: 24px; margin-left: -2px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 2px #14171a; }
.tl-gauge-scale { position: relative; height: 0; }
.tl-gauge-scale span { position: absolute; top: .25rem; transform: translateX(-50%); font-size: .68rem; color: var(--muted); }
.tl-gauge-scale span:first-child { transform: none; }
.tl-gauge-scale span:last-child { transform: translateX(-100%); }
.tl-gauge-head .tl-xw-arrow { flex: 0 0 auto; font-size: 1rem; font-weight: 800; letter-spacing: .02em; padding: .05rem .6rem; border-radius: 8px; border: 1px solid var(--panel-border); background: var(--input-bg); }
.tl-out .rowline.tl-total { border-top: 2px solid rgba(127,178,234,.6); margin-top: .2rem; padding-top: .35rem; font-size: 1.05rem; }
.tl-out .rowline.neg b { color: var(--danger); }

/* ---- E6B practice ---- */
.pr-top { display: flex; gap: .6rem 1rem; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.pr-topics { display: flex; gap: .35rem; flex-wrap: wrap; }
.pr-topics button, .pr-modes button { appearance: none; padding: .4rem .85rem; border-radius: 999px; border: 1px solid var(--panel-border); background: var(--input-bg); color: var(--fg); font: inherit; font-size: .85rem; cursor: pointer; }
.pr-topics button:hover, .pr-modes button:hover { background: var(--btn-hover); }
.pr-topics button[aria-selected="true"], .pr-modes button[aria-pressed="true"] { background: var(--btn-active); border-color: var(--btn-active); color: #fff; font-weight: 700; }
.pr-modes { display: flex; gap: .35rem; margin-bottom: .8rem; }
.pr-score { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pr-lbl { font-size: .78rem; color: var(--muted); }
.pr-kindbar select { padding: .4rem .6rem; border: 1px solid var(--input-border); border-radius: 8px; background: var(--input-bg); color: var(--fg); font: inherit; color-scheme: dark; }
.pr-card { margin-bottom: 1rem; }
.pr-q { font-size: 1.08rem; line-height: 1.5; margin: 0 0 .8rem; }
.pr-tag { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: .3rem; }
.pr-intro { color: var(--muted); line-height: 1.55; margin: 0 0 .8rem; }
.pr-answers { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); max-width: 640px; }
.pr-primary { background: var(--btn-active) !important; border-color: var(--btn-active) !important; color: #fff !important; }
.tl-row .btn-secondary[aria-pressed="true"] { background: var(--btn-active); border-color: var(--btn-active); color: #fff; }
.pr-fb { margin-top: .8rem; padding: .6rem .8rem; border-radius: 10px; line-height: 1.5; }
.pr-fb:empty { display: none; }
.pr-fb.good { background: rgba(63,174,106,.16); border: 1px solid rgba(63,174,106,.6); }
.pr-fb.bad { background: rgba(240,140,46,.14); border: 1px solid rgba(240,140,46,.6); }
.pr-fb.warn, .pr-fb.info { background: rgba(47,111,189,.12); border: 1px solid rgba(127,178,234,.5); }
.pr-fb .dim { color: var(--muted); font-size: .85rem; }
.pr-how { margin-top: 1rem; border-top: 1px solid var(--panel-border); padding-top: .9rem; }
.pr-tut { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem 1.4rem; align-items: start; }
.pr-steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: grid; gap: .45rem; }
.pr-step { counter-increment: st; position: relative; padding: .55rem .7rem .55rem 2.3rem; border: 1px solid var(--panel-border); border-radius: 10px; line-height: 1.45; cursor: pointer; font-size: .92rem; opacity: .6; }
.pr-step::before { content: counter(st); position: absolute; left: .55rem; top: .55rem; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--panel-border); color: var(--fg); font-size: .75rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.pr-step.done { opacity: .85; }
.pr-step.on { opacity: 1; border-color: var(--btn-active); background: rgba(47,111,189,.12); }
.pr-step.on::before { background: var(--btn-active); color: #fff; }
.pr-tut-diag { position: sticky; top: .6rem; }
.pr-diag svg { width: 100%; height: auto; display: block; }
.pr-disc .pr-ring { fill: var(--input-bg); stroke: var(--panel-border); stroke-width: 1.5; }
.pr-disc .pr-inner { fill: rgba(47,111,189,.10); }
.pr-disc .pr-gap { fill: var(--panel-bg); stroke: var(--panel-border); stroke-width: 1; }
.pr-tick { stroke: var(--muted); stroke-width: 1; }
.pr-num { fill: var(--fg); font-size: 11px; font-weight: 600; }
.pr-bold { font-weight: 800; }
.pr-cap { fill: var(--muted); font-size: 9.5px; letter-spacing: .03em; }
.pr-index { fill: #e0473f; stroke: #fff; stroke-width: .8; }
.pr-mk { stroke-width: 3; stroke-linecap: round; }
.pr-m1 { stroke: #4a9df8; fill: #4a9df8; } .pr-m2 { stroke: #f08c2e; fill: #f08c2e; } .pr-m3 { stroke: #3fae6a; fill: #3fae6a; }
.pr-dot { fill-opacity: .35; stroke-width: 2; }
.pr-lab { font-size: 12px; font-weight: 800; paint-order: stroke; stroke: var(--panel-bg); stroke-width: 3px; stroke-linejoin: round; }
.pr-tm1 { fill: #4a9df8; stroke: var(--panel-bg); } .pr-tm2 { fill: #f08c2e; stroke: var(--panel-bg); } .pr-tm3 { fill: #3fae6a; stroke: var(--panel-bg); }
.pr-win .pr-ring { fill: var(--input-bg); stroke: var(--panel-border); }
.pr-hi { fill-opacity: .22; stroke-width: 2; }
.pr-win .pr-lab { font-size: 14px; }
.pr-calc { border: 1px solid var(--panel-border); border-radius: 12px; padding: .9rem 1rem; background: var(--input-bg); font-variant-numeric: tabular-nums; }
.pr-calc-line { font-size: 1.05rem; padding: .35rem .5rem; border-radius: 8px; }
.pr-calc-line.on { background: rgba(47,111,189,.2); font-weight: 700; }
.pr-calc-line.off { opacity: .35; }
@media (max-width: 720px) { .pr-tut { grid-template-columns: 1fr; } .pr-tut-diag { position: static; } }
.pr-capline { color: var(--muted); font-size: .78rem; text-align: center; margin: .3rem 0 0; }
.pr-m4 { stroke: #c77dff; fill: #c77dff; } .pr-tm4 { fill: #c77dff; stroke: var(--panel-bg); }
.pr-wind .pr-ring { fill: var(--input-bg); }
.pr-center { stroke: var(--muted); stroke-width: 1.5; }
.pr-arc { stroke: #4a9df8; stroke-width: 3; }
.pr-track { stroke: #c77dff; stroke-width: 2.5; stroke-dasharray: 5 3; }
.pr-wind-vec { stroke: #f08c2e; stroke-width: 2; }
.pr-gdot { fill: var(--fg); stroke: var(--fg); }
.pr-gdot.pr-m3 { fill: #3fae6a; stroke: #3fae6a; }
