/* Apache Checkride — estilos. Diseñado para iPad (táctil, orientación libre), móvil y escritorio. */
:root {
  --bg: #f2f4f9; --surface: #ffffff; --surface2: #eef1f8; --border: #dbe1ee;
  --text: #0e1730; --muted: #5a6786; --accent: #1b62e8; --accent-bg: #e4edff;
  --crit: #b86a00; --crit-bg: #fff3dc; --crit-line: #f0a21a;
  --sec: #5a6b94; --sec-bg: #eef1f8;
  --ok: #0f9a58; --ok-bg: #dff6ea; --bad: #d63b3b; --bad-bg: #fde6e6;
  --shadow: 0 1px 2px rgba(15,25,60,.06), 0 6px 20px rgba(15,25,60,.06);
  --radius: 18px; --nav-w: 84px; --fs: 1;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a101d; --surface: #121b2e; --surface2: #18243b; --border: #25324e;
    --text: #e8eefc; --muted: #93a4c4; --accent: #6aaeff; --accent-bg: #16294d;
    --crit: #ffb83d; --crit-bg: #2b2210; --crit-line: #ffb020;
    --sec: #8a9cc6; --sec-bg: #18243b;
    --ok: #3ddc97; --ok-bg: #12301f; --bad: #ff7b7b; --bad-bg: #351618;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a101d; --surface: #121b2e; --surface2: #18243b; --border: #25324e;
  --text: #e8eefc; --muted: #93a4c4; --accent: #6aaeff; --accent-bg: #16294d;
  --crit: #ffb83d; --crit-bg: #2b2210; --crit-line: #ffb020;
  --sec: #8a9cc6; --sec-bg: #18243b;
  --ok: #3ddc97; --ok-bg: #12301f; --bad: #ff7b7b; --bad-bg: #351618;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: calc(100% * var(--fs)); -webkit-text-size-adjust: 100%; }
@media (min-width: 820px) { html { font-size: calc(106.25% * var(--fs)); } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5; overscroll-behavior: none; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
svg.ic { width: 1.4em; height: 1.4em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.nav {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
  padding: calc(14px + env(safe-area-inset-top)) 10px 14px calc(10px + env(safe-area-inset-left));
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; font-weight: 700; letter-spacing: .01em; }
.brand img { width: 40px; height: 40px; border-radius: 11px; flex: none; }
.brand span { display: none; line-height: 1.15; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; }
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 62px; border-radius: 14px; text-decoration: none; color: var(--muted);
  font-size: .68rem; font-weight: 600; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface2); }
.nav a.active { background: var(--accent-bg); color: var(--accent); }
.nav a svg.ic { width: 24px; height: 24px; }
.nav .spacer { flex: 1; }
@media (min-width: 1180px) {
  .app { --nav-w: 244px; }
  .brand span { display: block; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 14px; padding: 0 16px; min-height: 50px; font-size: .95rem; }
}
@media (max-width: 699px) {
  .app { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .nav {
    grid-row: 2; flex-direction: row; justify-content: space-around; gap: 0;
    border-right: 0; border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .brand, .nav .spacer { display: none; }
  .nav a { flex: 1; min-height: 52px; font-size: .62rem; }
  .nav a svg.ic { width: 22px; height: 22px; }
}

.main { min-width: 0; min-height: 0; container-type: inline-size; container-name: main; position: relative; }
.page {
  height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(22px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) 24px;
}
.page.flush { padding: 0; overflow: hidden; }
.wrap { max-width: 1100px; margin: 0 auto; }
@container main (max-width: 600px) { .page { padding: calc(16px + env(safe-area-inset-top)) 16px 28px; } }

.page-title { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.page-sub { color: var(--muted); margin-top: 4px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.grid { display: grid; gap: 16px; }
.grid.cols2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.btn { text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 14px; font-weight: 650;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: #fff; border-color: transparent; }
.btn.crit { background: var(--crit-line); color: #1a1100; border-color: transparent; }
.btn.ok { background: var(--ok); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 38px; padding: 0 12px; font-size: .9rem; border-radius: 11px; }
.btn.block { width: 100%; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; }
.badge.c { background: var(--crit-bg); color: var(--crit); border: 1px solid var(--crit-line); }
.badge.s { background: var(--sec-bg); color: var(--sec); border: 1px solid var(--border); }
.badge .ic { width: 12px; height: 12px; stroke-width: 2.4; }

.seg { display: inline-flex; background: var(--surface2); border: 1px solid var(--border); border-radius: 13px; padding: 3px; gap: 2px; }
.seg button { min-height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 650; font-size: .92rem; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg button.on.c { color: var(--crit); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: .9rem; color: var(--muted); }
.chip.on { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }
.input, select.input {
  min-height: 44px; width: 100%; padding: 0 14px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
textarea.input { padding: 12px 14px; min-height: 96px; resize: vertical; line-height: 1.5; }

.bar { height: 10px; border-radius: 99px; background: var(--surface2); overflow: hidden; border: 1px solid var(--border); }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .4s; }
.bar.c > i { background: linear-gradient(90deg, var(--crit-line), #ffd27a); }
.bar.ok > i { background: var(--ok); }

.check {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface);
  display: grid; place-items: center; flex: none; color: transparent; transition: .15s;
}
.check .ic { width: 18px; height: 18px; stroke-width: 3; }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.check.touch { width: 44px; height: 44px; margin: -7px; background: transparent; border: 0; }
.check.touch::before { content: ""; position: absolute; }

/* ---------- dashboard ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
@container main (max-width: 560px) { .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.ring { position: relative; width: 150px; height: 150px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .bg { stroke: var(--surface2); }
.ring .fg { stroke: var(--accent); transition: stroke-dashoffset .6s; }
.ring .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .lbl b { font-size: 2.2rem; line-height: 1; letter-spacing: -.03em; }
.ring .lbl span { font-size: .75rem; color: var(--muted); font-weight: 600; margin-top: 4px; }
.stat { display: flex; flex-direction: column; gap: 10px; }
.stat h3 { font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.stat .big { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.stat.c { border-left: 5px solid var(--crit-line); }
.numstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.num { background: var(--surface2); border-radius: 14px; padding: 12px 14px; }
.num b { display: block; font-family: var(--mono); font-size: 1.5rem; letter-spacing: -.02em; color: var(--crit); }
.num span { font-size: .78rem; color: var(--muted); font-weight: 600; }
.list-simple { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.list-simple a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface2); text-decoration: none; color: var(--text); font-weight: 600; min-height: 52px; }
.list-simple a:active { transform: scale(.99); }
.list-simple .ic { color: var(--crit); }
h2.sect { font-size: 1.15rem; font-weight: 750; margin: 26px 0 12px; display: flex; align-items: center; gap: 8px; }

/* ---------- estudio: lista + detalle ---------- */
.split { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); height: 100%; }
.pane-list { border-right: 1px solid var(--border); overflow-y: auto; background: var(--bg); -webkit-overflow-scrolling: touch; }
.pane-detail { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.list-head {
  position: sticky; top: 0; z-index: 3; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px);
  padding: calc(16px + env(safe-area-inset-top)) 16px 12px; display: grid; gap: 10px; border-bottom: 1px solid var(--border);
}
.list-head h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.list-head .seg { width: 100%; }
.list-head .seg button { flex: 1; padding: 0 6px; }
.group-title { padding: 18px 18px 6px; font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.topic-row {
  display: flex; align-items: center; gap: 12px; margin: 3px 10px; padding: 11px 12px 11px 14px; border-radius: 14px;
  text-decoration: none; color: var(--text); min-height: 60px; position: relative; border: 1px solid transparent;
}
.topic-row:hover { background: var(--surface); }
.topic-row.sel { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
.topic-row.c::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--crit-line); }
.topic-row.s::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 4px; background: var(--border); }
.topic-row .ico { color: var(--muted); }
.topic-row.c .ico { color: var(--crit); }
.topic-row .t { flex: 1; min-width: 0; }
.topic-row .t b { display: block; font-weight: 650; line-height: 1.25; }
.topic-row .t small { color: var(--muted); font-size: .76rem; }
.topic-row.done .t b { color: var(--muted); }
.topic-row .chev { color: var(--muted); }
.empty { padding: 36px 24px; text-align: center; color: var(--muted); }

.detail { max-width: 860px; margin: 0 auto; padding: calc(26px + env(safe-area-inset-top)) 28px calc(60px + env(safe-area-inset-bottom)); }
@container main (max-width: 699px) {
  .split { grid-template-columns: 1fr; }
  .split.has-detail .pane-list, .split:not(.has-detail) .pane-detail { display: none; }
  .pane-list { border-right: 0; }
  .detail { padding: calc(14px + env(safe-area-inset-top)) 16px calc(40px + env(safe-area-inset-bottom)); }
}
@container main (min-width: 700px) { .backbtn { display: none !important; } }
.detail h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; margin: 8px 0 6px; }
.detail .lead { color: var(--muted); font-size: 1.05rem; }
.detail .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.detail .meta .src { color: var(--muted); font-size: .82rem; }
.studybtn { margin: 18px 0 6px; }
.studybtn .btn { width: 100%; min-height: 54px; font-size: 1.05rem; }
.block { margin-top: 22px; }
.block > h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.essential { background: var(--crit-bg); border: 1px solid var(--crit-line); border-radius: var(--radius); padding: 16px 20px 16px 18px; }
.essential > h2 { color: var(--crit); }
.essential ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.essential li { position: relative; padding-left: 26px; font-size: 1.04rem; line-height: 1.5; }
.essential li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 10px; height: 10px; border-radius: 3px; background: var(--crit-line); transform: rotate(45deg); }
.essential strong { color: var(--text); background: linear-gradient(transparent 62%, color-mix(in srgb, var(--crit-line) 45%, transparent) 62%); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.fact { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.fact small { display: block; color: var(--muted); font-weight: 650; font-size: .76rem; }
.fact b { display: block; font-family: var(--mono); font-size: 1.28rem; letter-spacing: -.02em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.c-topic .fact b { color: var(--crit); }
.fact em { font-style: normal; color: var(--muted); font-size: .76rem; line-height: 1.3; display: block; }
.more ul { margin: 0; padding-left: 1.2em; display: grid; gap: 9px; color: var(--text); }
.more li::marker { color: var(--muted); }
.tipbox { background: var(--accent-bg); border-radius: 14px; padding: 12px 16px; display: flex; gap: 12px; align-items: flex-start; }
.tipbox + .tipbox { margin-top: 8px; }
.tipbox .ic { color: var(--accent); margin-top: 2px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; gap: 8px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-bg); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: .8rem; margin-top: 1px; }
.proc-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 8px; font-weight: 700; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: center; font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.hand { color: var(--crit); font-weight: 700; }
.note { color: var(--muted); font-size: .85rem; margin-top: 8px; }
.pager { display: flex; gap: 10px; margin-top: 30px; }
.pager .btn { flex: 1; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumbs button { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; text-align: left; }
.thumbs img { display: block; width: 100%; height: 100px; object-fit: cover; background: #fff; }
.thumbs span { display: block; padding: 6px 9px; font-size: .74rem; font-weight: 650; line-height: 1.25; }

/* ---------- práctica ---------- */
.mode { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--text); }
.mode .ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); }
.mode .ico .ic { width: 28px; height: 28px; }
.mode h3 { font-size: 1.2rem; }
.setup { display: grid; gap: 16px; max-width: 640px; }
.setup label { font-weight: 700; font-size: .85rem; color: var(--muted); display: block; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.session { max-width: 760px; margin: 0 auto; }
.session-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.session-top .bar { flex: 1; }
.flip { perspective: 1400px; margin: 10px 0 18px; }
.flip-in { position: relative; min-height: min(52vh, 420px); transition: transform .5s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.flip.show .flip-in { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 26px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px; gap: 12px; cursor: pointer;
}
.face.back { transform: rotateY(180deg); background: var(--crit-bg); border-color: var(--crit-line); }
.face .q { font-size: clamp(1.35rem, 3.2vw, 2rem); font-weight: 750; letter-spacing: -.015em; line-height: 1.25; }
.face .a { font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 800; line-height: 1.3; }
.face .hint { color: var(--muted); font-size: .85rem; font-weight: 600; }
.face .topic { position: absolute; top: 16px; left: 18px; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answers .btn { min-height: 58px; font-size: 1.05rem; }
.opt {
  display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; min-height: 60px; padding: 12px 16px;
  background: var(--surface); border: 2px solid var(--border); border-radius: 16px; font-weight: 600; font-size: 1.04rem;
}
.opt .k { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--surface2); display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--muted); }
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.right .k { background: var(--ok); color: #fff; }
.opt.wrong .k { background: var(--bad); color: #fff; }
.opts { display: grid; gap: 10px; margin: 18px 0; }
.q-text { font-size: clamp(1.25rem, 2.8vw, 1.7rem); font-weight: 750; line-height: 1.3; letter-spacing: -.01em; }
.why { margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface2); }
.score { text-align: center; padding: 24px 0; }
.score b { display: block; font-size: 3.6rem; letter-spacing: -.04em; line-height: 1; }
.proc-reveal li.hidden { opacity: .35; filter: blur(5px); user-select: none; }
.proc-list { display: grid; gap: 10px; }
.proc-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); min-height: 64px; }
.proc-item .t { flex: 1; }
.proc-item b { display: block; }
.proc-item small { color: var(--muted); }

/* ---------- referencia, diagramas ---------- */
.ref-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); align-items: start; }
@container main (max-width: 560px) { .ref-grid { grid-template-columns: 1fr; } }
.mini-facts { display: grid; gap: 0; }
.mini-facts div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.mini-facts div:last-child { border-bottom: 0; }
.mini-facts span { color: var(--muted); }
.mini-facts b { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.gallery button { display: block; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.gallery img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #fff; }
.gallery .cap { padding: 10px 12px; }
.gallery .cap b { display: block; font-size: .9rem; line-height: 1.3; }
.gallery .cap small { color: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(5,8,16,.94); display: flex; flex-direction: column; }
.lightbox[hidden] { display: none; }
.lb-bar { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; color: #fff; }
.lb-bar .ttl { flex: 1; min-width: 0; font-weight: 700; line-height: 1.2; }
.lb-bar .ttl small { display: block; font-weight: 500; opacity: .7; }
.lb-bar .btn { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; min-width: 46px; }
.lb-stage { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; display: grid; place-items: center; padding: 8px; }
.lb-stage img { max-width: none; background: #fff; border-radius: 6px; transition: width .15s; }
.lb-tip { color: #cdd6ee; padding: 8px 18px calc(10px + env(safe-area-inset-bottom)); font-size: .88rem; text-align: center; }
.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: #111a2e; color: #fff; padding: 11px 18px; border-radius: 14px; font-weight: 600; z-index: 60; transition: .25s; box-shadow: 0 10px 30px rgba(0,0,0,.35); max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.banner { display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--accent-bg); color: var(--text); align-items: flex-start; }
.banner .ic { color: var(--accent); margin-top: 2px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .nav { display: none; } .app { display: block; height: auto; } .page { overflow: visible; } }
.card > h3.proc-title { justify-content: flex-start; gap: 10px; margin-top: 0; }
.card > h3.proc-title .ic { color: var(--crit); }

/* ---------- modal ---------- */
.modal-ov { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(4,8,18,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .18s; }
.modal-ov.show { opacity: 1; }
.modal { width: min(440px, 100%); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 22px; padding: 24px 22px 18px; box-shadow: 0 24px 70px rgba(0,0,0,.45); transform: translateY(12px) scale(.97); transition: transform .2s cubic-bezier(.2,.9,.3,1.1); }
.modal-ov.show .modal { transform: none; }
.modal h2 { font-size: 1.25rem; letter-spacing: -.01em; margin-bottom: 8px; }
.modal p { color: var(--muted); line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1; min-height: 50px; }
.btn.danger { background: var(--bad); color: #fff; border-color: transparent; }
@media (max-width: 480px) { .modal-ov { place-items: end center; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .modal, .modal-ov { transition: none; } }

/* velocidades en mph (instrumentos del avión) */
strong.mph { display: inline; font-weight: 800; }
.essential strong.mph { background: none; }
.kias { font-weight: 400; opacity: .55; }

/* Vmca = línea roja · Vyse = línea azul: fondo del color de la marca del velocímetro */
.rl { --lc: #c62828; --lc-fg: #fff; }
.bl { --lc: #1f5fd6; --lc-fg: #fff; }
.fact.rl, .fact.bl, .num.rl, .num.bl { background: var(--lc); border-color: var(--lc); }
.fact.rl small, .fact.rl b, .fact.rl em, .fact.bl small, .fact.bl b, .fact.bl em, .num.rl b, .num.rl span, .num.bl b, .num.bl span { color: var(--lc-fg); }
.fact.rl small, .fact.bl small, .fact.rl em, .fact.bl em { opacity: .9; }
.rl .kias, .bl .kias { opacity: .8; }
