/* =========================================================
   Erätaidot 101 — styles
   Nordic palette: birch paper, spruce, lingonberry, cloudberry, lake
   ========================================================= */

@font-face { font-family: "Barlow Condensed"; font-weight: 500; font-display: swap; src: url(../fonts/barlow-condensed-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(../fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(../fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(../fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(../fonts/barlow-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(../fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Mono"; font-weight: 400; font-display: swap; src: url(../fonts/dm-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "DM Mono"; font-weight: 500; font-display: swap; src: url(../fonts/dm-mono-latin-500-normal.woff2) format("woff2"); }

:root {
  --paper: #eceee5;
  --paper-2: #e4e3d8;
  --sidebar: #1e3530;
  --sidebar-2: #142722;
  --sidebar-icon: #a7b4ac;
  --brand: #1e3530;
  --green: #2c5a4a;
  --green-2: #3c7d5f;
  --accent: #c2403a;          /* lingonberry */
  --accent-2: #a8332e;
  --accent-soft: #f7dfd8;
  --accent-line: #e8a297;
  --amber: #e2a23b;           /* cloudberry */
  --amber-soft: #fbecd0;
  --lake: #2f6f8f;
  --lake-soft: #dbe9ed;
  --ink: #1a2320;
  --ink-2: #29332f;
  --text-2: #56625c;
  --muted: #86918b;
  --card: #f8f7f2;
  --card-2: #f1f0e8;
  --line: #d9dbd0;
  --line-2: #e6e7de;
  --ok: #3b7d4f;
  --danger: #b8322c;
  --warn: #c3801a;
  --shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 10px 28px -12px rgba(25,40,34,.28), 0 2px 6px -2px rgba(25,40,34,.12);
  --shadow-sm: 0 4px 12px -6px rgba(25,40,34,.25);
  --f-cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "DM Mono", ui-monospace, "SFMono-Regular", monospace;
  --sb-w: 64px;
  --panel-w: 392px;
  --dock-h: 134px;
  --radius: 14px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  transition: background-color .8s var(--ease);
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
a { color: var(--lake); }
[hidden] { display: none !important; }

.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-sm { width: 16px; height: 16px; }
.ic-lg { width: 26px; height: 26px; }

/* ---------- App frame ---------- */
.app { display: grid; grid-template-columns: var(--sb-w) 1fr; height: 100%; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: relative; z-index: 40;
  background: var(--sidebar);
  color: var(--sidebar-icon);
  display: flex; flex-direction: column; align-items: stretch;
  width: var(--sb-w);
  transition: width .35s var(--ease);
  overflow: hidden;
}
.sidebar.is-open { width: 232px; box-shadow: 12px 0 40px -18px rgba(0,0,0,.5); }
.sb-toggle {
  height: 64px; display: grid; place-items: center; color: var(--sidebar-icon);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sb-toggle .ic { width: 18px; height: 18px; transition: transform .35s var(--ease); }
.sidebar.is-open .sb-toggle .ic { transform: rotate(180deg); }
.sb-toggle { width: 100%; justify-items: start; padding-left: 21px; }
.sb-nav { display: flex; flex-direction: column; padding-top: 20px; gap: 6px; flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.sb-item {
  position: relative; display: flex; align-items: center; gap: 16px;
  height: 52px; padding-left: 21px; white-space: nowrap; color: var(--sidebar-icon);
  transition: background .2s, color .2s;
}
.sb-item span { font-family: var(--f-cond); font-weight: 600; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; opacity: 0; transition: opacity .25s; }
.sidebar.is-open .sb-item span { opacity: 1; }
.sb-item:hover { color: #fff; background: rgba(255,255,255,.04); }
.sb-item.is-active { color: #fff; background: var(--sidebar-2); }
.sb-item.is-active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.sb-count {
  position: absolute; left: 36px; top: 9px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--amber); color: var(--ink); font: 600 10px/17px var(--f-mono); text-align: center;
}
.sb-count:empty, .sb-count[data-n="0"] { display: none; }
.sb-deco { margin-top: auto; height: 220px; flex: 0 1 auto; min-height: 0; color: #6f8a7f; pointer-events: none; }
.sb-deco svg { width: var(--sb-w); height: 100%; }

/* ---------- Stage ---------- */
.stage { position: relative; height: 100%; overflow: hidden; min-width: 0; }
.viewport { position: absolute; inset: 0; overflow: hidden; } /* clips the wide aurora, which otherwise scrolls phones sideways */
.scene-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; outline: none; }
.scene-canvas.is-dragging { cursor: grabbing; }
.aurora {
  position: absolute; left: -10%; right: -10%; top: -20%; height: 60%; pointer-events: none; opacity: 0;
  background:
    radial-gradient(60% 40% at 30% 40%, rgba(80,240,170,.35), transparent 70%),
    radial-gradient(50% 35% at 65% 30%, rgba(90,200,255,.22), transparent 70%),
    radial-gradient(40% 30% at 50% 55%, rgba(170,120,255,.16), transparent 70%);
  filter: blur(18px);
  mix-blend-mode: screen;
  transition: opacity 1.4s var(--ease);
  animation: aurora 18s ease-in-out infinite alternate;
}
body.aurora-on .aurora { opacity: .9; }
body.haze .viewport::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 45% 50%, rgba(238,243,246,.22), rgba(238,243,246,.62)); animation: viewIn 1.2s var(--ease); }
@keyframes aurora { 0% { transform: translateX(-4%) skewX(-6deg) scaleY(1); } 50% { transform: translateX(3%) skewX(4deg) scaleY(1.15); } 100% { transform: translateX(6%) skewX(-2deg) scaleY(.95); } }

.vp-hint {
  position: absolute; left: 50%; bottom: calc(var(--dock-h) + 18px); transform: translateX(-50%);
  font: 500 11px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2);
  background: rgba(248,247,242,.8); padding: 6px 12px; border-radius: 99px; pointer-events: none;
  opacity: 0; transition: opacity .6s; white-space: nowrap; margin-left: calc(var(--panel-w) / -2);
}
.vp-hint.is-on { opacity: 1; }

/* ---------- Labels ---------- */
.label-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.label-lines line { stroke: var(--brand); stroke-width: 1.3; }
.label-lines circle.dot { fill: #fff; stroke: var(--brand); stroke-width: 1.6; }
.label-lines circle.halo { fill: none; stroke: #fff; stroke-width: 1; opacity: .8; }
body.night .label-lines line { stroke: #e8eef0; }
body.night .label-lines circle.dot { stroke: #e8eef0; fill: #1e3530; }
.labels { position: absolute; inset: 0; pointer-events: none; }
.lbl {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  background: var(--brand); color: #f1efe6;
  font: 600 13px/1 var(--f-cond); letter-spacing: .1em; text-transform: uppercase;
  padding: 8px 12px 7px; border-radius: 5px; white-space: nowrap;
  box-shadow: 0 6px 16px -6px rgba(0,0,0,.4);
  opacity: 0; transition: opacity .35s var(--ease);
}
.lbl.is-on { opacity: 1; }
.lbl.warn { background: var(--accent); }
.lbl.good { background: var(--green-2); }
.lbl.info { background: var(--lake); }

/* ---------- Topbar ---------- */
.topbar {
  position: absolute; z-index: 20; left: 0; right: 0; top: 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 14px 20px 0 22px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.menu-btn { display: none; width: 40px; height: 40px; border-radius: 10px; place-items: center; background: var(--card); box-shadow: var(--shadow-sm); }
.logo { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--brand); }
.logo-mark { width: 52px; height: 52px; filter: drop-shadow(0 4px 8px rgba(20,40,30,.18)); }
.logo-text { display: flex; flex-direction: column; gap: 2px; }
.logo-title { font: 700 38px/0.95 var(--f-cond); letter-spacing: .03em; text-transform: uppercase; color: var(--brand); transition: color .8s; text-shadow: 0 0 10px var(--paper), 0 0 3px var(--paper), 0 0 18px var(--paper); }
.logo-tag { white-space: nowrap; font: 400 11.5px var(--f-mono); letter-spacing: .26em; text-transform: uppercase; color: var(--text-2); transition: color .8s; text-shadow: 0 0 6px var(--paper), 0 0 2px var(--paper); }
body.night .logo-title { color: #eef1ea; text-shadow: 0 0 12px #13202c, 0 0 3px #13202c; }
body.night .logo-tag { color: #a9bcc4; text-shadow: 0 0 6px #13202c; }

.controls { display: flex; gap: 8px; margin-top: 6px; flex-wrap: nowrap; justify-content: center; }
.pill {
  display: flex; align-items: center; gap: 2px; padding: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
}
.ibtn {
  position: relative; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-2);
  transition: background .2s, color .2s, opacity .2s;
}
.ibtn:hover { background: var(--card-2); }
.ibtn .ic { width: 18px; height: 18px; }
.ibtn-dark { background: var(--ink-2); color: #fff; }
.ibtn-dark:hover { background: var(--ink); }
.ibtn.speed { font: 500 12px var(--f-mono); width: 34px; }
.ibtn:disabled { opacity: .3; cursor: not-allowed; }
.compass-btn .compass-rose { width: 22px; height: 22px; transition: transform .1s linear; }
.seasons .ibtn.is-active { background: var(--brand); color: #fff; }
.seasons .ibtn[data-season="ruska"].is-active { background: #b8562a; }
.seasons .ibtn[data-season="winter"].is-active { background: var(--lake); }
.seasons .ibtn[data-season="kaamos"].is-active { background: #24324a; }
#soundBtn.is-on { color: var(--green-2); }

[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(aria-label); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font: 500 11px var(--f-mono); letter-spacing: .04em; white-space: nowrap;
  padding: 5px 8px; border-radius: 6px; pointer-events: none; z-index: 5;
}

.top-right { display: flex; gap: 10px; align-items: stretch; }
.progress-card {
  display: flex; align-items: center; gap: 12px; padding: 9px 16px 9px 14px; min-width: 214px; max-width: 250px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); color: var(--brand);
}
.pc-body { flex: 1; min-width: 0; }
.pc-label { font: 600 13px var(--f-cond); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.pc-bar { flex: 1; height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; }
.pc-bar i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 4px; transition: width .6s var(--ease); }
.pc-num { font: 500 12px var(--f-mono); color: var(--ink-2); }
.lang {
  display: flex; align-items: center; padding: 4px; gap: 2px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm);
}
.lang button { height: 100%; min-height: 34px; padding: 0 10px; border-radius: 8px; font: 600 13px var(--f-mono); letter-spacing: .06em; color: var(--muted); }
.lang button.is-active { background: var(--brand); color: #fff; }

/* ---------- Panel ---------- */
.panel {
  position: absolute; z-index: 15; right: 20px; top: 92px; bottom: calc(var(--dock-h) + 8px);
  width: var(--panel-w); display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  overflow: hidden;
}
.tabs { display: flex; gap: 4px; padding: 6px 16px 0; border-bottom: 1px solid var(--line-2); }
.tab {
  position: relative; flex: 1; height: 44px; font: 600 14px var(--f-cond); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2);
}
.tab::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); transform: scaleX(0); transition: transform .3s var(--ease); }
.tab.is-active { color: var(--ink); }
.tab.is-active::after { transform: scaleX(1); }
.panel-card { flex: 1; overflow-y: auto; padding: 18px 20px 20px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.panel-card > * { animation: fadeUp .45s var(--ease) both; }
.panel-card.no-anim > * { animation: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.p-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.p-kicker { font: 500 11px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.p-title { margin: 0; font: 700 32px/1 var(--f-cond); letter-spacing: .015em; text-transform: uppercase; color: var(--ink); }
.p-fs { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.p-fs:hover { background: var(--card-2); }
.p-intro { margin: 10px 0 16px; color: var(--text-2); font-size: 15px; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; position: relative; }
.step { position: relative; display: flex; align-items: center; gap: 10px; padding-left: 30px; }
.step::before { /* rail */
  content: ""; position: absolute; left: 9px; top: -8px; bottom: -8px; width: 2px; background: var(--line);
}
.step:first-child::before { top: 50%; }
.step:last-child::before { bottom: 50%; }
.step.is-done::before { background: var(--green-2); }
.step .node {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--line); display: grid; place-items: center; z-index: 1;
}
.step.is-done .node { background: var(--green-2); border-color: var(--green-2); color: #fff; }
.step.is-done .node .ic { width: 12px; height: 12px; stroke-width: 3; }
.step.is-active .node { border-color: var(--accent); }
.step.is-active .node::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.step-btn {
  flex: 1; display: flex; align-items: center; gap: 10px; text-align: left; min-height: 50px;
  padding: 6px 10px 6px 6px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card-2);
  transition: background .2s, border-color .2s, opacity .2s;
}
.step-btn:hover { border-color: var(--line); background: #fff; }
.stage-card.is-active::after { content: ""; position: absolute; left: 12px; bottom: 4px; height: 2px; width: calc(var(--p, 0) * (100% - 24px)); background: var(--accent); opacity: .7; }
.step-btn { position: relative; overflow: hidden; }
.step.is-active .step-btn::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: calc(var(--p, 0) * 100%); background: var(--accent); opacity: .7; }
.step.is-future .step-btn { opacity: .55; }
.step.is-active .step-btn { background: var(--accent-soft); border-color: var(--accent-line); opacity: 1; }
.step-thumb { width: 38px; height: 38px; border-radius: 8px; background: var(--card); border: 1px solid var(--line-2); flex: none; display: grid; place-items: center; overflow: hidden; }
.step-thumb img { width: 100%; height: 100%; object-fit: contain; }
.step-thumb .ic { width: 18px; height: 18px; color: var(--muted); }
.step-name { flex: 1; font: 600 14.5px/1.15 var(--f-cond); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.step-btn .chev { width: 16px; height: 16px; color: var(--ink-2); opacity: 0; }
.step.is-active .step-btn .chev { opacity: 1; }

.callout { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--lake-soft); color: #1f4d63; font-size: 14px; display: flex; gap: 10px; }
.callout .ic { margin-top: 1px; color: var(--lake); }
.callout.warn { background: var(--accent-soft); color: #7a2420; }
.callout.warn .ic { color: var(--accent); }
.callout.amber { background: var(--amber-soft); color: #6e4a0f; }
.callout.amber .ic { color: var(--warn); }
.callout b { font-weight: 600; }

.why p { margin: 0 0 12px; color: var(--ink-2); }
.why h4, .tips h4 { margin: 18px 0 8px; font: 600 13px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tip-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tip-list li { display: flex; gap: 10px; padding: 11px 12px; border-radius: 10px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--ink-2); font-size: 14.5px; }
.tip-list li .ic { color: var(--green-2); margin-top: 1px; }
.tip-list li.warn { background: var(--accent-soft); border-color: #f1c7be; }
.tip-list li.warn .ic { color: var(--accent); }

/* Cards (identify) */
.verdict { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 4px; border-radius: 99px; font: 600 12px var(--f-cond); letter-spacing: .12em; text-transform: uppercase; margin-top: 10px; }
.verdict .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.verdict.deadly { background: var(--danger); color: #fff; }
.verdict.poison { background: var(--accent-soft); color: var(--accent-2); }
.verdict.caution { background: var(--amber-soft); color: #7a510e; }
.verdict.edible { background: #dcebdc; color: #24583a; }
.verdict.rule { background: var(--lake-soft); color: #1f4d63; }
.facts-h { margin: 16px 0 6px; font: 600 12px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.facts { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.facts li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 14.5px; color: var(--ink-2); }
.facts li::before { content: attr(data-n); width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font: 500 11px/20px var(--f-mono); text-align: center; margin-top: 1px; }
.lookalike { margin-top: 14px; padding: 12px 14px; border-radius: 10px; border: 1px dashed var(--line); font-size: 14px; color: var(--text-2); }
.lookalike b { display: block; font: 600 12px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.card-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 18px; }
.card-chip {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; min-height: 46px; text-align: left;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--card-2); transition: background .2s, border-color .2s;
}
.card-chip:hover { background: #fff; border-color: var(--line); }
.card-chip.is-active { background: var(--accent-soft); border-color: var(--accent-line); }
.card-chip img { width: 32px; height: 32px; object-fit: contain; flex: none; }
.card-chip span { min-width: 0; font: 600 13px/1.1 var(--f-cond); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); flex: 1; }
.card-chip .vdot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.vdot.deadly { background: var(--danger); } .vdot.poison { background: #e0705f; } .vdot.caution { background: var(--amber); } .vdot.edible { background: var(--ok); } .vdot.rule { background: var(--lake); }

.disclaimer { margin-top: 18px; font: 400 11.5px/1.5 var(--f-mono); color: var(--muted); letter-spacing: .02em; }

/* ---------- Dock ---------- */
.dock {
  position: absolute; z-index: 18; left: 0; right: 0; bottom: 0; height: var(--dock-h);
  padding: 0 20px 20px 22px; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  background: linear-gradient(to bottom, rgba(236,235,226,0), rgba(236,235,226,.92) 38%, var(--paper) 70%);
  transition: background .8s;
}
body.night .dock { background: linear-gradient(to bottom, rgba(19,32,44,0), rgba(19,32,44,.9) 38%, #13202c 70%); }
.dock-head { position: relative; display: flex; align-items: center; gap: 12px; }
.lesson-picker {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px 0 8px; border-radius: 8px;
  font: 600 13px var(--f-cond); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2);
}
.lesson-picker:hover { background: rgba(0,0,0,.04); }
.lesson-picker { min-width: 0; max-width: 100%; }
#lpText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.quiz-cta { flex: none; white-space: nowrap; }
.share-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; font: 600 13px var(--f-cond); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.share-btn:hover { background: rgba(0,0,0,.04); }
.share-btn .ic { width: 16px; height: 16px; color: var(--green); }
body.night .share-btn { color: #dfe7ea; }
body.night .share-btn .ic { color: #8fd0b0; }
.lesson-picker .ic { width: 18px; height: 18px; color: var(--green); }
.lesson-picker .chev { width: 14px; height: 14px; transition: transform .25s; color: var(--ink-2); }
.lesson-picker[aria-expanded="true"] .chev { transform: rotate(180deg); }
body.night .lesson-picker, body.night .lesson-picker .chev { color: #dfe7ea; }
body.night .lesson-picker .ic { color: #8fd0b0; }
.lesson-menu {
  position: absolute; left: 0; bottom: calc(100% + 8px); width: 340px; max-height: min(70vh, 640px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px;
  animation: fadeUp .25s var(--ease);
}
.lm-group { font: 500 10.5px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; display: flex; align-items: center; gap: 6px; }
.lm-group i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.lm-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; text-align: left; }
.lm-item:hover { background: var(--card-2); }
.lm-item.is-active { background: var(--accent-soft); }
.lm-item img { width: 40px; height: 40px; object-fit: contain; flex: none; border-radius: 8px; background: var(--card-2); }
.lm-item .lm-t { font: 700 15px/1.05 var(--f-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.lm-item .lm-m { font: 400 12px var(--f-body); color: var(--muted); }
.lm-item .lm-badge { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--green-2); color: #fff; }
.lm-item .lm-badge .ic { width: 12px; height: 12px; stroke-width: 3; }
.lm-item .lm-badge.gold { background: var(--amber); color: var(--ink); }

.quiz-cta {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 14px; border-radius: 99px;
  background: var(--amber); color: var(--ink); font: 700 13px var(--f-cond); letter-spacing: .1em; text-transform: uppercase;
  box-shadow: 0 6px 18px -8px rgba(160,100,10,.7); animation: pulse 2.2s ease-in-out infinite;
}
.quiz-cta .ic { width: 16px; height: 16px; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }

.dock-row { display: flex; align-items: stretch; gap: 12px; }
.stages { flex: 1; display: flex; gap: 10px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; padding: 4px 2px; min-width: 0; }
.stages::-webkit-scrollbar { display: none; }
.stage-card {
  position: relative; flex: 1 0 168px; max-width: 220px; height: 70px; display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-align: left; box-shadow: var(--shadow-sm);
  transition: border-color .2s, background .2s, transform .2s;
}
.stage-card:hover { transform: translateY(-2px); }
.stage-card.is-active { border: 2px solid var(--accent); background: #fff; padding: 5px 11px 5px 7px; }
.stage-card img { width: 56px; height: 56px; object-fit: contain; flex: none; }
.stage-card .sc-icon { width: 56px; height: 56px; display: grid; place-items: center; color: var(--muted); flex: none; }
.stage-card .sc-t { min-width: 0; font: 600 14px/1.1 var(--f-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); flex: 1; }
.stage-card.is-future .sc-t { color: var(--muted); }
.stage-card .sc-done { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; background: var(--green-2); color: #fff; display: grid; place-items: center; border: 2px solid var(--paper); }
.stage-card .sc-done .ic { width: 12px; height: 12px; stroke-width: 3; }
.stage-card .sc-verdict { position: absolute; left: 4px; bottom: 4px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.stage-card .sc-verdict .ic { width: 10px; height: 10px; stroke-width: 3.2; }
.sc-verdict.deadly, .sc-verdict.poison { background: var(--danger); }
.sc-verdict.edible { background: var(--ok); }
.sc-verdict.caution { background: var(--amber); }
.sc-verdict.rule { background: var(--lake); }
.stage-card .sc-chev { width: 14px; height: 14px; color: var(--ink-2); opacity: 0; }
.stage-card.is-active .sc-chev { opacity: 1; }
.dock-nav { display: flex; gap: 8px; align-items: center; }
.nbtn { width: 50px; height: 70px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.nbtn:hover { background: #fff; }
.nbtn-dark { background: var(--brand); color: #fff; border-color: var(--brand); }
.nbtn-dark:hover { background: var(--sidebar-2); }
.nbtn .ic { width: 22px; height: 22px; }

/* ---------- Full views ---------- */
.view {
  position: absolute; inset: 0; z-index: 30; background: rgba(236,235,226,.9);
  backdrop-filter: blur(10px) saturate(1.1); -webkit-backdrop-filter: blur(10px) saturate(1.1);
  overflow-y: auto; animation: viewIn .4s var(--ease);
}
body.night .view { background: rgba(236,235,226,.94); }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }
.view-inner { max-width: 1180px; margin: 0 auto; padding: 96px 40px 80px; animation: fadeUp .5s var(--ease); }
.view-close { position: absolute; top: 22px; right: 24px; width: 44px; height: 44px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: grid; place-items: center; z-index: 2; box-shadow: var(--shadow-sm); }
.v-kicker { font: 500 12px var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.v-title { margin: 6px 0 8px; font: 700 54px/0.95 var(--f-cond); text-transform: uppercase; letter-spacing: .01em; color: var(--brand); }
.v-sub { margin: 0 0 30px; max-width: 640px; color: var(--text-2); font-size: 17px; }

.lib-theme { margin-top: 34px; }
.lib-theme-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.lib-theme-h .sw { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
.lib-theme-h .sw .ic { width: 17px; height: 17px; }
.lib-theme-h h3 { margin: 0; font: 700 22px var(--f-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.lib-theme-h span { font: 500 11px var(--f-mono); letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.lib-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 24px; }
.lib-pill { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font: 600 14px var(--f-cond); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); transition: background .2s, color .2s, border-color .2s; }
.lib-pill .ic { color: var(--c, var(--brand)); }
.lib-pill b { font: 500 11px var(--f-mono); color: var(--muted); }
.lib-pill:hover { border-color: var(--ink-2); }
.lib-pill.is-active { background: var(--c, var(--brand)); border-color: var(--c, var(--brand)); color: #fff; }
.lib-pill.is-active .ic, .lib-pill.is-active b { color: #fff; }
.lc-theme { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 6px; font: 500 10.5px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--c); }
.lc-theme .ic { width: 13px; height: 13px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.lib-card {
  position: relative; display: flex; flex-direction: column; text-align: left; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.lib-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.lib-card .lc-img { height: 150px; display: grid; place-items: center; background:
   radial-gradient(circle at 50% 60%, rgba(255,255,255,.7), transparent 65%),
   repeating-radial-gradient(circle at 30% 120%, transparent 0 14px, rgba(160,150,120,.13) 14px 15px), var(--card-2); }
.lib-card .lc-img img { width: 150px; height: 150px; object-fit: contain; }
.lib-card .lc-body { padding: 14px 16px 16px; }
.lib-card .lc-t { font: 700 22px/1 var(--f-cond); text-transform: uppercase; letter-spacing: .03em; color: var(--ink); }
.lib-card .lc-s { margin: 6px 0 10px; color: var(--text-2); font-size: 14px; min-height: 40px; }
.lib-card .lc-m { display: flex; align-items: center; gap: 10px; font: 500 11px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lib-card .lc-bar { flex: 1; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.lib-card .lc-bar i { display: block; height: 100%; background: var(--green-2); }
.lib-card .lc-badge { position: absolute; top: 12px; right: 12px; }
.lib-card .lc-type { position: absolute; top: 12px; left: 12px; font: 500 10px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; padding: 4px 8px; border-radius: 99px; background: rgba(255,255,255,.85); color: var(--text-2); }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; }
.badge-cell { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 18px 12px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.badge-cell svg.emblem { width: 140px; height: 140px; }
.badge-cell.locked svg.emblem { filter: grayscale(1) opacity(.38); }
.badge-cell .bt { font: 700 17px/1.05 var(--f-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.badge-cell .bm { font: 500 11px var(--f-mono); letter-spacing: .08em; color: var(--muted); }
.badge-cell button { margin-top: 4px; font: 600 12px var(--f-cond); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.badge-total { display: flex; align-items: center; gap: 16px; margin: -10px 0 26px; }
.badge-total .bar { width: 260px; height: 8px; border-radius: 5px; background: var(--line); overflow: hidden; }
.badge-total .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--amber), #d9822b); }
.badge-total span { font: 500 13px var(--f-mono); color: var(--text-2); }

.sos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.sos-card { padding: 22px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.sos-card h3 { margin: 0 0 10px; font: 700 22px var(--f-cond); letter-spacing: .05em; text-transform: uppercase; }
.sos-card p, .sos-card li { color: var(--ink-2); font-size: 15px; }
.sos-card ol, .sos-card ul { padding-left: 20px; margin: 8px 0 0; }
.sos-card li { margin-bottom: 6px; }
.sos-hero { grid-column: 1 / -1; display: flex; align-items: center; gap: 26px; background: var(--accent); color: #fff; border: 0; }
.sos-hero .big { font: 700 110px/0.85 var(--f-cond); letter-spacing: -.01em; }
.sos-hero h3 { color: #fff; }
.sos-hero p, .sos-hero li { color: #fde9e5; }
.sos-num { font: 600 26px var(--f-cond); letter-spacing: .03em; color: var(--accent); }
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.yesno div { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.yesno .y { background: #e2efe2; } .yesno .n { background: var(--accent-soft); }
.yesno b { display: block; font: 600 12px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 6px; }
.yesno ul { margin: 0; padding-left: 18px; }

.about { max-width: 760px; }
.about p { font-size: 16px; color: var(--ink-2); }
.about h3 { font: 700 22px var(--f-cond); letter-spacing: .05em; text-transform: uppercase; margin: 28px 0 8px; }
.kbd { display: inline-block; min-width: 26px; padding: 2px 7px; margin-right: 6px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--card); font: 500 12px var(--f-mono); text-align: center; }
.kbd-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }


/* ---------- Intro tour + skill chooser ---------- */
body.intro-on:not(.ui-full) .panel, body.intro-on:not(.ui-full) .dock, body.intro-on:not(.ui-full) .progress-card,
body.intro-on:not(.ui-full):not(.ui-top) .controls, body.intro-on .vp-hint,
body.intro-on:not(.ui-quiz) .quiz-cta { opacity: 0; visibility: hidden; pointer-events: none; }
body.intro-on .quiz-cta, body.intro-on .practice-btn { pointer-events: none; animation: none; } /* illustration only during the tour */
body.intro-on:not(.ui-quiz) .practice-btn { opacity: 0; visibility: hidden; }
body.intro-on .topbar { z-index: 40; }
body.ui-full .topbar, body.ui-top .topbar { z-index: 20; } /* under the spotlight dim */
body.intro-on .lesson-picker, body.intro-on .p-fs, body.intro-on .share-btn { visibility: hidden; }
@media (min-width: 861px) { body.ui-full .sidebar, body.ui-top .sidebar { z-index: 20; } }
.intro { position: absolute; inset: 0; z-index: 26; pointer-events: none; }
.intro-card {
  pointer-events: auto; position: absolute; left: 28px; top: 50%; transform: translateY(-44%);
  width: min(468px, calc(100% - 56px)); max-height: calc(100% - 130px); overflow-y: auto; scrollbar-width: none;
  padding: 30px 32px 24px; border-radius: 22px;
  background: rgba(248,247,242,.94); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255,255,255,.65);
  box-shadow: 0 30px 70px -30px rgba(10,30,25,.5), 0 4px 14px -6px rgba(10,30,25,.2);
  z-index: 2;
}
.intro-card::-webkit-scrollbar { display: none; }
.intro-card > * { animation: fadeUp .55s var(--ease) both; }
.intro-card > :nth-child(2) { animation-delay: .05s; } .intro-card > :nth-child(3) { animation-delay: .1s; }
.intro-card > :nth-child(4) { animation-delay: .15s; } .intro-card > :nth-child(5) { animation-delay: .2s; }
.intro-card > :nth-child(6) { animation-delay: .25s; } .intro-card > :nth-child(7) { animation-delay: .3s; }
.i-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.i-kicker { font: 500 11.5px var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.i-link { display: inline-flex; align-items: center; gap: 4px; font: 600 13px var(--f-cond); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); padding: 6px 2px; }
.i-link:hover { color: var(--ink); }
.i-title { margin: 0 0 12px; font: 700 48px/0.94 var(--f-cond); text-transform: uppercase; letter-spacing: .005em; color: var(--brand); }
.i-body { margin: 0 0 20px; font-size: 16.5px; line-height: 1.5; color: var(--ink-2); }
.i-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 22px; }
.i-stats div { padding: 11px 6px 9px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-2); text-align: center; }
.i-stats b { display: block; font: 700 30px/1 var(--f-cond); color: var(--accent); }
.i-stats span { display: block; margin-top: 3px; font: 500 9.5px/1.3 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.i-spots { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 6px; }
.i-spot { scroll-margin: 8px 0 76px; position: relative; width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; overflow: hidden; text-align: left; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-2); color: var(--ink-2); transition: background .3s, border-color .3s; }
.i-spot:hover { border-color: var(--line); background: #fff; }
.i-spot .ic { color: var(--green-2); }
.i-spot-t { display: flex; flex-direction: column; min-width: 0; }
.i-spot-t b { font-weight: 600; font-size: 15px; }
.i-spot-t small { max-height: 0; overflow: hidden; opacity: 0; font-size: 13px; color: var(--text-2); transition: max-height .35s var(--ease), opacity .35s; }
.i-spot.is-on { background: var(--amber-soft); border-color: var(--amber); }
.i-spot.is-on .ic { color: var(--warn); }
.i-spot.is-on small { max-height: 20px; opacity: 1; }
.i-spot-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--amber); transform: scaleX(0); transform-origin: left; }
.i-spot.is-on .i-spot-bar { animation: spotBar 4.2s linear both; }
@keyframes spotBar { to { transform: scaleX(1); } }
.i-resume { display: inline-flex; align-items: center; gap: 6px; margin: -8px 0 18px; font: 600 14px var(--f-cond); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.i-resume:hover { color: var(--accent-2); }

.spot { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 1; border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 200vmax rgba(14,24,20,.44); transition: left .45s var(--ease), top .45s var(--ease), width .45s var(--ease), height .45s var(--ease); }
body.ui-top .spot { box-shadow: 0 0 0 200vmax rgba(14,24,20,.18); } /* keep the season colours readable */
.spot::after { content: ""; position: absolute; inset: -2px; border-radius: 16px; border: 2.5px solid var(--amber); box-shadow: 0 0 20px rgba(226,162,59,.7); animation: spotPulse 1.6s ease-in-out infinite; }
@keyframes spotPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.spot-tip { position: fixed; left: 0; top: 0; z-index: 3; max-width: 250px; padding: 8px 12px 7px; border-radius: 9px; background: var(--amber); color: var(--ink); font: 700 14px/1.2 var(--f-cond); letter-spacing: .06em; text-transform: uppercase; box-shadow: var(--shadow); pointer-events: none; transition: transform .45s var(--ease); }
.tab.is-spot { background: var(--amber-soft); border-radius: 8px 8px 0 0; color: var(--ink); }
body.ui-full .intro-card, body.ui-top .intro-card { width: min(392px, calc(100% - 56px)); padding: 24px 26px 20px; }
body.ui-full .intro-card { top: 84px; transform: none; max-height: calc(100% - 84px - var(--dock-h) - 14px); }
body.ui-full .i-foot { position: sticky; bottom: -20px; margin: 0 -26px -20px; padding: 14px 26px 20px; background: linear-gradient(to bottom, rgba(248,247,242,0), #f6f5f0 34%); z-index: 1; }
body.ui-full .i-title, body.ui-top .i-title { font-size: 40px; }
body.ui-full .i-body, body.ui-top .i-body { font-size: 15.5px; margin-bottom: 14px; }
.i-badges { display: flex; gap: 4px; margin: -4px 0 14px; }
.i-badges span { flex: 1; animation: badgeIn .9s var(--ease) both; }
.i-badges svg { width: 100%; height: auto; display: block; }
.i-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 12px; padding-top: 2px; }
.i-nav { margin-left: auto; }
.i-nav .btn { white-space: nowrap; padding: 0 16px; }
.i-dots { display: flex; gap: 6px; }
.i-dot { width: 8px; height: 8px; border-radius: 6px; background: var(--line); transition: width .35s var(--ease), background .35s; }
.i-dot.is-on { width: 24px; background: var(--accent); }
.i-nav { display: flex; gap: 8px; align-items: center; }
.i-prev { width: 44px; height: 44px; border-radius: 12px; }
.i-prev .ic { width: 20px; height: 20px; }

.intro.is-choose { pointer-events: auto; overflow-y: auto; background: rgba(236,238,229,.84); backdrop-filter: blur(12px) saturate(1.1); -webkit-backdrop-filter: blur(12px) saturate(1.1); animation: viewIn .5s var(--ease); }
body.night .intro.is-choose { background: rgba(236,238,229,.92); }
body.night.intro-choose .logo-title { color: var(--brand); text-shadow: none; }
body.night.intro-choose .logo-tag { color: var(--text-2); text-shadow: none; }
.intro.is-choose .intro-card { position: relative; left: auto; top: auto; transform: none; width: auto; max-height: none; overflow: visible; max-width: 1180px; margin: 0 auto; padding: 108px 40px 56px; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.intro.is-choose .i-title { font-size: 64px; margin-top: 6px; }
.intro.is-choose .i-body { max-width: 560px; margin-bottom: 24px; }
.i-continue { margin: 0 0 24px; }
.choose-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; margin-bottom: 28px; animation: none !important; }
.choose-tile {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 10px 42px 10px 10px; text-align: left;
  border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; animation: fadeUp .5s var(--ease) both;
}
.choose-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--c); }
.ct-img { width: 94px; height: 94px; flex: none; border-radius: 12px; background: radial-gradient(circle at 50% 60%, #fff, var(--card-2) 72%); display: grid; place-items: center; }
.ct-img img { width: 90px; height: 90px; object-fit: contain; }
.ct-text { display: flex; flex-direction: column; min-width: 0; }
.ct-t { font: 700 21px/1 var(--f-cond); text-transform: uppercase; letter-spacing: .03em; color: var(--ink); margin: 1px 0 5px; }
.ct-s { font-size: 13.5px; color: var(--text-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ct-m { margin-top: 6px; font: 500 10.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.choose-tile .lc-theme { margin-bottom: 4px; }
.ct-go { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--c); transition: transform .25s var(--ease); }
.choose-tile:hover .ct-go { transform: translate(4px, -50%); }
.ct-badge { position: absolute; top: 8px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--amber); color: var(--ink); display: grid; place-items: center; }
.ct-badge .ic { width: 13px; height: 13px; }

@media (max-height: 960px) and (min-width: 861px) { body.ui-full .i-badges { display: none; } }
@media (max-width: 1360px) and (min-width: 861px) { .pr-wrap { top: 132px; } }
@media (max-width: 1360px) and (min-width: 861px) { body.ui-full .intro-card { top: 132px; max-height: calc(100% - 132px - var(--dock-h) - 14px); } }

/* ---------- Hands-on practice ---------- */
.practice-btn { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 13px 0 10px; border-radius: 99px; background: var(--green); color: #fff; font: 700 13px var(--f-cond); letter-spacing: .1em; text-transform: uppercase; box-shadow: var(--shadow-sm); transition: background .2s, transform .2s; }
.practice-btn:hover { background: var(--brand); transform: translateY(-1px); }
.practice-btn .ic { width: 17px; height: 17px; }
.pr-mini { display: inline-flex; gap: 1px; margin-left: 8px; vertical-align: -2px; }
.pr-mini .ic { width: 12px; height: 12px; stroke-width: 2; color: var(--line); }
.pr-mini .ic.on { color: var(--amber); fill: var(--amber); }

body.practice .panel, body.practice .dock, body.practice #playPill, body.practice .progress-card, body.practice .vp-hint,
body.scenario .panel, body.scenario .dock, body.scenario #playPill, body.scenario #seasonPill, body.scenario .progress-card, body.scenario .vp-hint { display: none; }
.pr-wrap { position: absolute; z-index: 16; right: 20px; top: 92px; bottom: 20px; width: var(--panel-w); pointer-events: none; display: flex; align-items: flex-start; }
.pr-card { pointer-events: auto; width: 100%; max-height: 100%; overflow-y: auto; padding: 18px 20px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); scrollbar-width: thin; outline: none; }
.pr-card:focus, .pr-card:focus-visible { outline: none; }
.pr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pr-kicker { font: 500 11px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.pr-x { width: 32px; height: 32px; margin: -4px -6px -4px 0; border-radius: 8px; display: grid; place-items: center; color: var(--text-2); flex: none; }
.pr-x:hover { background: var(--card-2); color: var(--ink); }
.pr-dots { display: flex; gap: 5px; margin-top: 10px; }
.pr-dots i { flex: 1; height: 5px; border-radius: 3px; background: var(--line); }
.pr-dots i.cur { background: var(--ink-2); }
.pr-dots i.ok { background: var(--ok); }
.pr-dots i.bad { background: var(--amber); }
.pr-count { margin: 12px 0 2px; font: 500 11px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pr-title { margin: 0 0 8px; font: 700 29px/1.02 var(--f-cond); letter-spacing: .01em; text-transform: uppercase; color: var(--ink); }
.pr-text { margin: 0 0 8px; color: var(--ink-2); font-size: 15px; }
.pr-help { display: flex; gap: 6px; margin: 0 0 12px; font-size: 13.5px; color: var(--text-2); }
.pr-opts { display: flex; flex-direction: column; gap: 7px; }
.pr-opt { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 8px 12px 8px 10px; text-align: left; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-size: 15px; color: var(--ink-2); user-select: none; -webkit-user-select: none; transition: border-color .2s, background .2s, opacity .2s; }
.pr-opt:hover:not(:disabled) { border-color: var(--ink-2); }
.pr-opt:disabled { cursor: default; }
.pr-mark { width: 22px; height: 22px; flex: none; border-radius: 7px; background: var(--card-2); border: 1px solid var(--line); display: grid; place-items: center; color: #fff; }
.pr-mark .ic { width: 13px; height: 13px; stroke-width: 3; }
.pr-opt.ok { border-color: var(--ok); background: #e5f0e5; }
.pr-opt.ok .pr-mark { background: var(--ok); border-color: var(--ok); }
.pr-opt.bad { border-color: var(--accent); background: var(--accent-soft); animation: prShake .35s; }
.pr-opt.bad .pr-mark { background: var(--accent); border-color: var(--accent); }
@keyframes prShake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 60% { transform: translateX(4px); } }
.pr-opt.is-out { opacity: .5; text-decoration: line-through; animation: none; }
.pr-opt.is-hint { border-color: var(--amber); background: var(--amber-soft); animation: prGlow 1.4s ease-in-out infinite; }
@keyframes prGlow { 0%, 100% { box-shadow: 0 0 0 2px rgba(226,162,59,.25); } 50% { box-shadow: 0 0 0 5px rgba(226,162,59,.5); } }
.pr-pill { flex: none; margin-left: auto; padding: 3px 8px 2px; border-radius: 99px; background: var(--amber); color: var(--ink); font: 700 11.5px var(--f-cond); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.pr-ask { margin: 0 0 8px; font: 700 18px/1.15 var(--f-cond); letter-spacing: .02em; color: var(--ink); }
.pr-spot.is-hint .pr-ring { background: var(--amber); transform: scale(1.25); }
.pr-handle.is-hint { background: var(--amber); box-shadow: 0 0 0 5px rgba(226,162,59,.45); }
.pr-card-opt { cursor: grab; font-family: var(--f-cond); font-weight: 600; font-size: 15px; letter-spacing: .05em; text-transform: uppercase; }
.pr-card-opt:disabled { cursor: default; }
.pr-card-opt.is-lifted { opacity: .35; }
.pr-thumb { width: 40px; height: 40px; flex: none; border-radius: 8px; background: var(--card-2); overflow: hidden; display: grid; place-items: center; }
.pr-thumb img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.pr-ghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; box-shadow: var(--shadow); opacity: .96; margin: 0; }
.viewport.is-drop::after { content: ""; position: absolute; inset: 14px; border: 3px dashed var(--amber); border-radius: 18px; pointer-events: none; z-index: 2; }
.pr-done { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.pr-done li { display: flex; align-items: center; gap: 6px; font: 600 13.5px var(--f-cond); letter-spacing: .05em; text-transform: uppercase; color: var(--ok); }
.pr-done .ic { width: 14px; height: 14px; stroke-width: 3; }
.pr-fb { display: flex; gap: 9px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14.5px; line-height: 1.4; animation: fadeUp .3s var(--ease); }
.pr-fb .ic { width: 18px; height: 18px; margin-top: 1px; flex: none; }
.pr-fb.ok { background: #e2efe2; color: #24583a; }
.pr-fb.bad { background: var(--accent-soft); color: #7a2420; }
.pr-hintbox { margin-top: 12px; }
.pr-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 14px; min-height: 28px; }
.pr-foot:empty { display: none; }
.pr-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font: 600 13px var(--f-cond); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
.pr-link:hover { color: var(--ink); }
.pr-gauge { width: 132px; margin: 4px auto 2px; }
.pr-gauge svg { display: block; width: 100%; }
.pr-gauge .g-rim { fill: #dfe9e6; stroke: var(--brand); stroke-width: 2.5; }
.pr-gauge .g-face { fill: #fbfaf5; }
.pr-gauge .g-tick { stroke: var(--brand); stroke-width: 2; }
.pr-gauge .g-shed { fill: rgba(194,64,58,.12); stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.pr-gauge .g-red { fill: var(--accent); }
.pr-gauge .g-white { fill: #fff; stroke: var(--muted); stroke-width: 1; }
.pr-gauge .g-pin { fill: var(--ink); }
.pr-pips { display: flex; gap: 6px; margin-bottom: 10px; }
.pr-pips i { flex: 1; height: 7px; border-radius: 4px; background: var(--line); transition: background .15s; }
.pr-pips i.on { background: var(--green-2); }
.pr-taps { display: flex; gap: 8px; }
.pr-tap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-height: 86px; padding: 12px 6px; justify-content: center; border-radius: 12px; background: var(--brand); color: #fff; font: 700 15px/1.1 var(--f-cond); letter-spacing: .08em; text-transform: uppercase; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: background .15s, transform .08s; }
.pr-tap:hover:not(:disabled) { background: var(--green); }
.pr-tap:active:not(:disabled) { transform: scale(.96); }
.pr-tap:disabled { opacity: .45; cursor: default; }
.pr-tap .ic { width: 24px; height: 24px; }

.pr-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.pr-veil { position: absolute; inset: 0; background: var(--paper); opacity: 0; pointer-events: none; }
.pr-spot { position: absolute; left: 0; top: 0; width: 52px; height: 52px; margin: -26px 0 0 -26px; display: grid; place-items: center; pointer-events: auto; border-radius: 50%; }
.pr-spot:focus-visible { outline-offset: -2px; }
.pr-ring { position: relative; width: 28px; height: 28px; border-radius: 50%; background: rgba(226,162,59,.28); border: 3px solid var(--amber); box-shadow: 0 2px 10px rgba(0,0,0,.25); display: grid; place-items: center; color: #fff; transition: transform .15s; }
.pr-ring::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--amber); animation: prPing 1.8s ease-out infinite; }
@keyframes prPing { from { transform: scale(1); opacity: .9; } to { transform: scale(2.1); opacity: 0; } }
.pr-spot:hover:not(:disabled) .pr-ring { transform: scale(1.18); background: rgba(226,162,59,.6); }
.pr-ring .ic { display: none; width: 15px; height: 15px; stroke-width: 3.2; }
.pr-spot.ok .pr-ring { background: var(--ok); border-color: #fff; }
.pr-spot.bad .pr-ring { background: var(--accent); border-color: #fff; }
.pr-spot.ok .pr-ring::after, .pr-spot.bad .pr-ring::after { display: none; }
.pr-spot.ok .i-ok, .pr-spot.bad .i-bad { display: block; }
.pr-tag { position: absolute; top: calc(100% - 4px); left: 50%; transform: translateX(-50%); padding: 3px 7px 2px; border-radius: 5px; background: rgba(30,53,48,.92); color: #f1efe6; font: 600 11.5px/1.1 var(--f-cond); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; pointer-events: none; }
.pr-tag[hidden] { display: none; }
.pr-handle { position: absolute; left: 0; top: 0; width: 46px; height: 46px; margin: -23px 0 0 -23px; display: grid; place-items: center; border-radius: 50%; pointer-events: auto; cursor: grab; touch-action: none; background: rgba(255,255,255,.72); border: 2.5px solid var(--amber); color: var(--ink); box-shadow: 0 3px 12px rgba(0,0,0,.28); }
.pr-handle .ic { width: 22px; height: 22px; }
.pr-handle.is-grabbed { cursor: grabbing; background: var(--amber); transform-origin: center; }
.pr-dial { position: absolute; left: 0; top: 0; border-radius: 50%; pointer-events: auto; cursor: grab; touch-action: none; border: 3px dashed rgba(226,162,59,.85); background: radial-gradient(circle, transparent 62%, rgba(226,162,59,.14) 63%); }
.pr-dial.is-grabbed { cursor: grabbing; }
.pr-dial.is-near { border-color: var(--ok); border-style: solid; background: radial-gradient(circle, transparent 62%, rgba(59,125,79,.18) 63%); }
.pr-dial.is-done { pointer-events: none; opacity: .5; }
.pr-dial-rot { position: absolute; inset: 0; pointer-events: none; }
.pr-grip { position: absolute; left: 50%; top: -16px; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%; background: var(--amber); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.pr-dial.is-near .pr-grip { background: var(--ok); }
.pr-pull { position: absolute; left: 0; top: 0; width: 14px; border-radius: 8px; background: rgba(30,53,48,.3); pointer-events: none; }
.pr-pull-fill { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 8px; background: var(--ok); }
.pr-pull-knob { position: absolute; left: 50%; bottom: -24px; width: 48px; height: 48px; margin-left: -24px; border-radius: 50%; display: grid; place-items: center; pointer-events: auto; cursor: grab; touch-action: none; background: var(--amber); color: var(--ink); border: 3px solid #fff; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.pr-pull-knob .ic { transform: rotate(180deg); }

.pr-result { text-align: center; padding: 10px 0 4px; }
.pr-result .pr-title { font-size: 34px; }
.pr-stars { display: flex; justify-content: center; gap: 8px; margin: 18px 0 12px; }
.pr-stars span { color: var(--line); animation: prStar .5s var(--ease) both; }
.pr-stars .ic { width: 50px; height: 50px; stroke-width: 1.4; }
.pr-stars span.on { color: var(--amber); }
.pr-stars span.on .ic { fill: var(--amber); }
@keyframes prStar { from { transform: scale(.3) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.pr-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.pr-actions .btn { justify-content: center; }

/* ---------- Survival scenarios ---------- */
.sc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sc-card .pr-foot { position: sticky; bottom: -18px; z-index: 1; margin: 10px -20px -18px; padding: 12px 20px 16px; background: linear-gradient(to bottom, rgba(248,247,242,0), var(--card) 34%); }
.ch-h { margin: 8px 0 14px; font: 700 26px var(--f-cond); letter-spacing: .03em; text-transform: uppercase; color: var(--brand); }
.sc-card:focus, .sc-card:focus-visible { outline: none; }
.sc-card { scroll-padding-bottom: 84px; } /* focus and scrolling stop above the pinned button */
.sc-hud { display: flex; flex-direction: column; gap: 5px; margin: 10px 0 12px; padding: 9px 12px; background: var(--card-2); border: 1px solid var(--line-2); border-radius: 10px; }
.sc-clock { font: 500 11.5px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); }
.sc-meter { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 13px; }
.sc-meter .ic { color: var(--green-2); }
.sc-mlabel { width: 58px; flex: none; }
.sc-bar { flex: 1; height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.sc-bar b { display: block; height: 100%; border-radius: 4px; background: var(--green-2); transition: width .7s var(--ease), background .4s; }
.sc-val { width: 26px; flex: none; text-align: right; font: 500 12px var(--f-mono); }
.sc-meter em { width: 34px; flex: none; text-align: right; font: 600 12px var(--f-mono); font-style: normal; animation: fadeUp .4s var(--ease); }
.sc-meter em.up { color: var(--ok); } .sc-meter em.down { color: var(--accent); }
.sc-meter.mid .sc-bar b { background: var(--amber); } .sc-meter.mid .ic { color: var(--warn); }
.sc-meter.low .sc-bar b { background: var(--accent); } .sc-meter.low .ic { color: var(--accent); }
.sc-text { margin: 0 0 12px; font-size: 15.5px; line-height: 1.48; color: var(--ink-2); }
.sc-choice { margin: 8px 0 6px; font-weight: 600; font-size: 15px; color: var(--ink); }
.sc-verdict { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 3px 8px; border-radius: 99px; font: 700 13px var(--f-cond); letter-spacing: .08em; text-transform: uppercase; }
.sc-verdict .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.sc-verdict.good { background: #dcebdc; color: #24583a; } .sc-verdict.ok { background: var(--amber-soft); color: #7a510e; } .sc-verdict.bad { background: var(--accent-soft); color: var(--accent-2); }
.sc-num { color: var(--text-2); font: 500 12px var(--f-mono); }
.sc-pack { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 7px; }
.sc-item { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 7px 10px; text-align: left; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-size: 13.5px; line-height: 1.2; color: var(--ink-2); transition: border-color .2s, background .2s, opacity .2s; }
.sc-item:hover:not(:disabled) { border-color: var(--ink-2); }
.sc-item .ic { color: var(--green-2); width: 19px; height: 19px; }
.sc-item.on { border-color: var(--green-2); background: #e5f0e5; font-weight: 600; }
.sc-item:disabled { opacity: .45; cursor: not-allowed; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.sc-end { padding-bottom: 2px; }
.sc-end .pr-stars { margin: 10px 0 6px; }
.sc-kind { text-align: center; font: 500 11px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); }
.sc-end .pr-title { margin-top: 4px; text-align: center; }
.sc-score { display: flex; justify-content: space-between; gap: 10px; font: 500 11.5px var(--f-mono); letter-spacing: .06em; color: var(--text-2); }
.sc-h { margin: 14px 0 6px; font: 600 12px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sc-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sc-log li { display: flex; gap: 8px; font-size: 13.5px; line-height: 1.35; color: var(--ink-2); }
.sc-log .ic { width: 16px; height: 16px; margin-top: 1px; stroke-width: 2.6; }
.sc-log li.good .ic { color: var(--ok); } .sc-log li.ok .ic { color: var(--warn); } .sc-log li.bad .ic { color: var(--accent); }
.sc-link { display: flex; align-items: center; gap: 2px; margin-top: 2px; font: 600 12.5px var(--f-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--lake); text-align: left; }
.sc-link .ic { color: inherit; width: 13px; height: 13px; margin: 0; }
.sc-link:hover { color: var(--ink); }

/* ---------- Quiz modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(20,30,28,.46); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: viewIn .3s var(--ease); }
.modal-card:focus { outline: none; }
.modal-card { position: relative; width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--card); border-radius: 20px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); padding: 28px 30px 26px; animation: fadeUp .4s var(--ease); }
.q-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.q-dots { display: flex; gap: 6px; }
.q-dots i { width: 26px; height: 5px; border-radius: 3px; background: var(--line); }
.q-dots i.cur { background: var(--ink-2); }
.q-dots i.ok { background: var(--ok); }
.q-dots i.bad { background: var(--accent); }
.q-close { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.q-close:hover { background: var(--card-2); }
.q-title { margin: 14px 0 4px; font: 700 15px var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.q-q { margin: 0 0 18px; font: 700 28px/1.08 var(--f-cond); letter-spacing: .01em; color: var(--ink); }
.q-opts { display: flex; flex-direction: column; gap: 10px; }
.q-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 15.5px; color: var(--ink-2); transition: border-color .2s, background .2s; }
.q-opt:hover:not(:disabled) { border-color: var(--ink-2); }
.q-opt .k { width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--card-2); display: grid; place-items: center; font: 500 12px var(--f-mono); color: var(--text-2); }
.q-opt.ok { border-color: var(--ok); background: #e5f0e5; }
.q-opt.ok .k { background: var(--ok); color: #fff; }
.q-opt.bad { border-color: var(--accent); background: var(--accent-soft); }
.q-opt.bad .k { background: var(--accent); color: #fff; }
.q-opt:disabled { cursor: default; }
.q-why { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--card-2); font-size: 14.5px; color: var(--ink-2); animation: fadeUp .35s var(--ease); }
.q-why b { font: 700 15px var(--f-cond); letter-spacing: .08em; text-transform: uppercase; margin-right: 6px; }
.q-why.ok b { color: var(--ok); } .q-why.bad b { color: var(--accent); }
.q-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; font: 700 15px var(--f-cond); letter-spacing: .1em; text-transform: uppercase; }
.btn .ic { width: 18px; height: 18px; }
.btn-dark { background: var(--brand); color: #fff; }
.btn-dark:hover { background: var(--sidebar-2); }
.btn-ghost { border: 1px solid var(--line); background: var(--card); }
.btn-amber { background: var(--amber); color: var(--ink); }
.q-result { text-align: center; padding: 6px 0 4px; }
.q-result svg.emblem { width: 190px; height: 190px; margin: 6px auto 4px; display: block; }
.q-result.win svg.emblem { animation: badgeIn 1s var(--ease) both; }
@keyframes badgeIn { 0% { transform: scale(.3) rotate(-30deg); opacity: 0; } 60% { transform: scale(1.08) rotate(6deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
.q-result.lose svg.emblem { filter: grayscale(1) opacity(.4); }
.q-score { font: 700 46px var(--f-cond); color: var(--ink); }
.q-result p { color: var(--text-2); margin: 4px 0 0; }
.q-result .q-foot { justify-content: center; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }

/* ---------- Loader ---------- */
.loader { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(circle at 50% 45%, #f4f3ec, var(--paper) 60%); transition: opacity .7s var(--ease), visibility .7s; }
.loader.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-mark { width: 84px; height: 84px; }
.loader-mark svg { width: 100%; height: 100%; }
.loader-title { font: 700 30px var(--f-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.loader-bar { width: 150px; height: 4px; border-radius: 3px; background: var(--line); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s; }
.loader-note { font: 500 11px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 80; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font: 500 14px var(--f-body); box-shadow: var(--shadow); animation: fadeUp .3s var(--ease); }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--paper); font-size: 18px; z-index: 200; }

/* ---------- Focus mode (fullscreen button) ---------- */
.app.focus .vp-hint { margin-left: 0; }
.app.focus .panel, .app.focus .dock { opacity: 0; pointer-events: none; transform: translateY(10px); }
.panel, .dock { transition: opacity .35s var(--ease), transform .35s var(--ease); }
.focus-exit { position: absolute; right: 20px; bottom: 20px; z-index: 25; }

/* ---------- Design credit ---------- */
.credit {
  position: absolute; z-index: 32; right: 20px; bottom: 2px;
  font: 500 10px/14px var(--f-mono); letter-spacing: .12em; color: var(--text-2); text-decoration: none; white-space: nowrap;
  background: rgba(248,247,242,.86); padding: 1px 8px; border-radius: 99px;
}
.credit:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  :root { --panel-w: 348px; }
  .logo-title { font-size: 32px; }
  .progress-card { min-width: 180px; }
}
@media (max-width: 1360px) {
  .controls { position: absolute; left: 50%; top: 76px; transform: translateX(-50%); margin: 0; }
  .panel { top: 132px; }
  .stage-card { flex-basis: 150px; }
}
@media (max-width: 860px) {
  :root { --sb-w: 0px; --dock-h: auto; }
  body { overflow: auto; }
  .app { display: block; height: auto; min-height: 100%; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 0; }
  .sidebar.is-open { width: 250px; }
  .sb-item span { opacity: 1; }
  .menu-btn { display: grid; }
  .stage { height: auto; overflow: visible; display: flex; flex-direction: column; }
  .topbar { position: relative; flex-wrap: wrap; padding: 10px 12px 0; gap: 10px; align-items: center; order: 0; }
  .logo-mark { width: 40px; height: 40px; }
  .logo-title { font-size: 26px; }
  .logo-tag { font-size: 9.5px; letter-spacing: .16em; }
  .top-right { margin-left: auto; }
  .progress-card { display: none; }
  .controls { position: static; transform: none; order: 3; width: 100%; justify-content: center; gap: 6px; flex-wrap: wrap; }
  .pill { padding: 3px; }
  .ibtn { width: 32px; height: 32px; }
  .viewport { position: relative; height: 54vh; min-height: 320px; order: 1; }
  .vp-hint { bottom: 12px; margin-left: 0; }
  .dock { position: relative; order: 2; height: auto; padding: 8px 12px 6px; background: none; }
  body.night .dock { background: none; }
  .stage-card { flex: 0 0 150px; height: 62px; }
  .stage-card img, .stage-card .sc-icon { width: 46px; height: 46px; }
  .nbtn { width: 44px; height: 62px; }
  .panel { position: relative; order: 3; inset: auto; width: auto; margin: 6px 12px 24px; max-height: none; }
  .panel-card { overflow: visible; }
  .lesson-menu { width: min(340px, calc(100vw - 24px)); position: fixed; left: 12px; bottom: auto; top: 80px; max-height: 70vh; }
  .view { position: fixed; }
  .view-inner { padding: 70px 16px 60px; }
  .credit { position: static; z-index: 1; order: 4; align-self: flex-end; margin: -12px 12px 14px; padding: 6px 10px; }
  body.practice .credit, body.scenario .credit { display: none; }
  .v-title { font-size: 40px; }
  .sos-hero { flex-direction: column; align-items: flex-start; gap: 6px; }
  .sos-hero .big { font-size: 80px; }
  .modal-card { padding: 22px 18px; }
  .q-q { font-size: 24px; }
  [data-tip]:hover::after { display: none; }
}
@media (max-width: 420px) {
  .logo-tag { display: none; }
  .seasons .ibtn, .pill .ibtn { width: 30px; }
}


@media (max-width: 860px) {
  .intro { position: relative; order: 2; inset: auto; z-index: 5; }
  .intro-card { position: relative; left: auto; top: auto; transform: none; width: auto; max-height: none; margin: 8px 12px 24px; padding: 22px 20px 20px; }
  .i-title { font-size: 34px; }
  .i-body { font-size: 15.5px; }
  .i-stats { grid-template-columns: repeat(2, 1fr); }
  .i-stats b { font-size: 26px; }
  body.intro-on:not(.ui-full):not(.ui-top) .viewport { height: 48vh; min-height: 280px; }
  body.intro-on:not(.ui-full):not(.ui-top) .controls { display: none; }
  .intro.is-choose { position: fixed; inset: 0; z-index: 35; }
  .intro.is-choose .intro-card { margin: 0; padding: 78px 14px 40px; }
  .intro.is-choose .i-title { font-size: 42px; }
  .choose-grid { grid-template-columns: 1fr; }
  .ct-img, .ct-img img { width: 76px; height: 76px; }
  body.intro-on .topbar { background: rgba(236,238,229,.94); padding-bottom: 8px; }
  body.intro-on:not(.ui-full) .dock, body.intro-on:not(.ui-full) .panel { display: none; }
  body.ui-full .stage, body.ui-top .stage { padding-bottom: 50vh; }
  body.ui-full .intro, body.ui-top .intro { position: fixed; inset: 0; z-index: 26; }
  body.ui-full .intro-card, body.ui-top .intro-card { position: fixed; left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; margin: 0; max-height: 45vh; transform: none; padding: 16px 16px 14px; }
  body.ui-full .i-title, body.ui-top .i-title { font-size: 26px; margin-bottom: 6px; }
  body.ui-full .i-body, body.ui-top .i-body { font-size: 14px; margin-bottom: 10px; }
  .spot-tip { display: none; }
  body.practice, body.scenario { overflow: hidden; }
  body.practice .controls, body.scenario .controls { display: none; }
  body.practice .viewport, body.scenario .viewport { height: 46vh; min-height: 220px; }
  .sc-card { max-height: 56vh; }
  .sc-grid { grid-template-columns: 1fr; }
  .sc-card .pr-foot { bottom: -12px; margin: 8px -14px -12px; padding: 10px 14px 12px; }
  .sc-hud { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 8px 0; padding: 7px 10px; }
  .sc-clock { width: 100%; }
  .sc-meter { flex: 1; min-width: 80px; gap: 5px; }
  .sc-mlabel { display: none; }
  .sc-val, .sc-meter em { width: auto; }
  .sc-text { font-size: 14.5px; margin-bottom: 8px; }
  .sc-item { min-height: 42px; padding: 5px 8px; font-size: 13px; }
  .pr-wrap { position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: auto; z-index: 26; padding: 0 8px 8px; }
  .pr-card { max-height: 47vh; padding: 12px 14px; }
  .pr-count { display: none; }
  .pr-title { font-size: 23px; margin-top: 8px; margin-bottom: 4px; }
  .pr-text { font-size: 14px; margin-bottom: 4px; }
  .pr-help { font-size: 13px; margin-bottom: 8px; }
  .pr-stars .ic { width: 42px; height: 42px; }
  .pr-result .pr-title { font-size: 28px; }
  .practice-btn { padding: 0 11px 0 8px; }
  body.ui-full .i-foot { margin: 0 -16px -14px; padding: 10px 16px 14px; bottom: -14px; }
  .share-btn span { display: none; }
  body.ui-full .i-badges { display: none; }
  body.ui-full .i-body { display: none; }
  .i-spots { flex-direction: row; gap: 6px; margin-bottom: 12px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
  .i-spots::-webkit-scrollbar { display: none; }
  .i-spots li { flex: none; }
  .i-spot { width: auto; padding: 8px 12px; }
  .i-spot-t b { white-space: nowrap; font-size: 14px; }
  .i-spot-t small { white-space: nowrap; }
  body.intro-on .logo-title, body.night.intro-on .logo-title { color: var(--brand); text-shadow: none; }
  body.intro-on .logo-tag, body.night.intro-on .logo-tag { color: var(--text-2); text-shadow: none; }
}

/* ---------- Search ---------- */
.search-btn { position: relative; display: grid; place-items: center; width: 44px; min-height: 44px; flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); color: var(--ink-2); transition: background .2s; }
.search-btn:hover { background: #fff; }
body.intro-choose .search-btn { display: none; }
.search-box { display: flex; align-items: center; gap: 10px; max-width: 760px; height: 54px; margin: 0 0 18px; padding: 0 8px 0 16px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); color: var(--text-2); transition: border-color .2s, box-shadow .2s; }
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,53,48,.1); }
.search-input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: 400 17px var(--f-body); color: var(--ink); -webkit-appearance: none; appearance: none; }
.search-input::placeholder { color: var(--muted); }
.search-input::-webkit-search-cancel-button { display: none; }
.search-x { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); }
.search-x:hover { background: var(--card-2); color: var(--ink); }
.sr-count { margin: -6px 0 12px; font: 500 12px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sr-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 28px; }
.sr-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 36px 10px 10px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), border-color .2s; animation: fadeUp .3s var(--ease) both; }
.sr-row:hover { transform: translateY(-2px); border-color: var(--c, var(--line)); }
.sr-img { width: 72px; height: 72px; flex: none; border-radius: 11px; background: radial-gradient(circle at 50% 60%, #fff, var(--card-2) 72%); display: grid; place-items: center; overflow: hidden; }
.sr-img img { width: 68px; height: 68px; object-fit: contain; }
.sr-ic { background: var(--c, var(--brand)); color: #fff; }
.sr-ic .ic { width: 30px; height: 30px; }
.sr-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sr-text .lc-theme { margin-bottom: 2px; }
.sr-t { font: 700 20px/1.02 var(--f-cond); letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.sr-stage { margin-top: 2px; font: 600 13px/1.15 var(--f-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.sr-s { margin-top: 3px; font-size: 13.5px; line-height: 1.34; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sr-go { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--c, var(--ink-2)); }
mark { background: var(--amber-soft); color: inherit; border-radius: 3px; box-shadow: 0 0 0 1px var(--amber-soft); }
.sr-none { max-width: 640px; padding: 22px; margin-bottom: 28px; border-radius: 16px; background: var(--card); border: 1px dashed var(--line); }
.sr-none b { font: 700 22px var(--f-cond); letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.sr-none p { margin: 6px 0 12px; color: var(--text-2); }
.sr-tries { display: flex; flex-wrap: wrap; gap: 8px; }
.lib-hint { display: flex; align-items: center; gap: 10px; max-width: 760px; width: 100%; margin: -4px 0 20px; padding: 11px 14px; text-align: left; border-radius: 12px; background: var(--amber-soft); border: 1px solid #efd9ad; color: #6e4a0f; font-size: 15px; transition: border-color .2s; }
.lib-hint:hover { border-color: var(--amber); }
.lib-hint span { flex: 1; min-width: 0; }
.lib-hint b { font-weight: 600; }

/* ---------- Learning paths ---------- */
.path-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.path-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 18px 20px 16px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.path-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--c); }
.path-card.is-mine { border-color: var(--c); box-shadow: 0 0 0 1px var(--c), var(--shadow-sm); }
.pc-top { position: relative; display: flex; align-items: center; gap: 12px; }
.pc-ic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 13px; background: var(--c); color: #fff; }
.pc-ic .ic { width: 25px; height: 25px; }
.pc-head { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.pc-meta { font: 500 10.5px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pc-title { font: 700 28px/1 var(--f-cond); letter-spacing: .02em; text-transform: uppercase; color: var(--ink); }
.pc-top .ct-badge { top: -4px; right: -6px; }
.pc-sum { font-size: 14.5px; line-height: 1.4; color: var(--text-2); min-height: 40px; }
.pm { position: relative; display: block; height: 118px; margin: 0 -8px; border-radius: 12px; background: repeating-radial-gradient(ellipse at 74% 130%, transparent 0 15px, rgba(150,142,110,.14) 15px 16px), repeating-radial-gradient(ellipse at 12% -40%, transparent 0 13px, rgba(150,142,110,.1) 13px 14px), var(--card-2); }
.pm-line { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pm-base, .pm-done { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.pm-base { stroke: #9b957d; stroke-width: 3; stroke-dasharray: 1 8; }
.pm-done { stroke: var(--c); stroke-width: 3.5; }
.pm-stop { position: absolute; width: 50px; height: 50px; margin: -25px 0 0 -25px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #fff; border: 2px solid #cfcdbc; box-shadow: 0 3px 8px -3px rgba(25,40,34,.35); }
.pm-stop img { width: 46px; height: 46px; object-fit: contain; }
.pm-stop.is-done { border-color: var(--c); border-width: 3px; }
.pm-stop.is-next { border-color: var(--amber); border-width: 3px; box-shadow: 0 0 0 4px rgba(226,162,59,.28); }
.pm-flag { width: 38px; height: 38px; margin: -19px 0 0 -19px; background: var(--brand); border-color: var(--brand); color: #fff; }
.pm-flag .ic { width: 20px; height: 20px; }
.pm-flag.is-done { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pc-count { font: 500 12px var(--f-mono); color: var(--text-2); }
.pc-cta { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font: 700 14.5px/1.1 var(--f-cond); letter-spacing: .08em; text-transform: uppercase; color: var(--c); text-align: right; }

.path-tile .pt-ic { background: var(--c); color: #fff; }
.path-tile .pt-ic .ic { width: 38px; height: 38px; }
.path-tile .ct-img { width: 76px; height: 76px; }
.path-tile .ct-t { margin-top: 0; }

.path-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; max-width: 270px; height: 30px; padding: 0 12px 0 10px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); font: 600 13px var(--f-cond); letter-spacing: .08em; text-transform: uppercase; box-shadow: var(--shadow-sm); transition: background .2s; }
.path-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.path-chip:hover { background: #fff; }
.path-chip.is-next { background: var(--brand); border-color: var(--brand); color: #fff; padding: 0 8px 0 13px; }
.path-chip.is-next:hover { background: var(--sidebar-2); }
body.intro-on .path-chip { visibility: hidden; }

.pv-back { display: inline-flex; align-items: center; gap: 4px; margin: -18px 0 14px -4px; padding: 4px; font: 600 13px var(--f-cond); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
.pv-back:hover { color: var(--ink); }
.pv { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "head side" "trail side"; gap: 0 36px; align-items: start; }
.pv-head { grid-area: head; }
.pv .v-sub { margin-bottom: 24px; }
.trail { grid-area: trail; }
.trail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tr-stop { position: relative; padding-left: 46px; }
.tr-stop::before { content: ""; position: absolute; left: 15px; top: -10px; bottom: -10px; border-left: 3px dotted #bdb8a2; }
.tr-stop:first-child::before { top: 50%; }
.tr-stop:last-child::before { bottom: 50%; }
.tr-stop.is-done::before { border-left: 3px solid var(--c); }
.tr-node { position: absolute; z-index: 1; left: 0; top: 50%; transform: translateY(-50%); width: 33px; height: 33px; display: grid; place-items: center; border-radius: 50%; background: var(--card); border: 2px solid var(--line); font: 500 13px var(--f-mono); color: var(--text-2); }
.tr-node .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.tr-stop.is-done .tr-node { background: var(--c); border-color: var(--c); color: #fff; }
.tr-stop.is-next .tr-node { background: var(--amber); border-color: var(--amber); color: var(--ink); box-shadow: 0 0 0 4px rgba(226,162,59,.28); }
.tr-end .tr-node { background: var(--brand); border-color: var(--brand); color: #fff; }
.tr-card { position: relative; width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px 9px 9px; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), border-color .2s; }
.tr-card:hover { transform: translateX(3px); border-color: var(--c); }
.tr-stop.is-next .tr-card { border-color: var(--amber); background: #fffaf0; }
.tr-end .tr-card { background: var(--card-2); }
.tr-side { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.tr-side .sr-go { position: static; transform: none; }
.tr-next { padding: 3px 8px 2px; border-radius: 99px; background: var(--amber); color: var(--ink); font: 700 11.5px var(--f-cond); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.tr-medal { position: static; }
.pv-side { grid-area: side; position: sticky; top: 24px; display: flex; flex-direction: column; gap: 12px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.pv-emblem svg { display: block; width: 160px; height: 160px; margin: 0 auto; }
.pv-emblem.locked svg { filter: grayscale(1) opacity(.42); }
.pv-prog { display: flex; flex-direction: column; gap: 6px; font: 500 12px var(--f-mono); color: var(--text-2); }
.pv-prog .bar { height: 8px; border-radius: 5px; background: var(--line); overflow: hidden; }
.pv-prog .bar i { display: block; height: 100%; background: var(--c); }
.pv-goal { margin: 0; font-size: 14.5px; color: var(--ink-2); }
.pv-cta { justify-content: center; height: auto; min-height: 46px; padding: 9px 14px; line-height: 1.12; }
.pv-cta span { min-width: 0; }
.pv-links { display: flex; justify-content: space-between; gap: 10px; }

/* ---------- Packing list ---------- */
.pk-grid { display: grid; grid-template-columns: 348px minmax(0, 1fr); gap: 20px; align-items: start; }
.pk-fold { position: sticky; top: 16px; min-width: 0; }
.pk-fold summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; list-style: none; cursor: pointer; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.pk-fold summary::-webkit-details-marker { display: none; }
.pk-fold summary .ic { transition: transform .25s var(--ease); }
.pk-fold[open] summary .ic { transform: rotate(180deg); }
.pk-fold summary span { display: flex; flex-direction: column; min-width: 0; }
.pk-fold summary b { font: 700 18px/1.1 var(--f-cond); letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
.pk-foldt { font-size: 13.5px; color: var(--text-2); }
.pk-fold[open] summary { margin-bottom: 10px; }
.pk-form { display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); }
.pk-label { margin-bottom: 6px; font: 500 11px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-chip { min-height: 34px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font: 600 13.5px var(--f-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); transition: border-color .2s, background .2s; }
.pk-chip:hover { border-color: var(--ink-2); }
.pk-chip.is-on { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.pk-seg { display: grid; gap: 6px; }
.pk-seg.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pk-seg.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pk-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; min-height: 60px; padding: 7px 2px 5px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--ink-2); font: 600 12.5px/1.05 var(--f-cond); letter-spacing: .03em; text-transform: uppercase; text-align: center; transition: background .2s, color .2s, border-color .2s; }
.pk-opt:hover:not(:disabled) { border-color: var(--ink-2); }
.pk-opt.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pk-opt:disabled { opacity: .35; cursor: not-allowed; }
.pk-step { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pk-step .nbtn { width: 46px; height: 46px; }
.pk-step .nbtn:disabled { opacity: .35; cursor: not-allowed; }
.pk-step b { font: 700 24px var(--f-cond); letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.pk-extras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.pk-extra { display: flex; align-items: center; gap: 7px; min-width: 0; min-height: 44px; padding: 5px 9px; text-align: left; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-size: 13.5px; line-height: 1.15; color: var(--ink-2); transition: background .2s, border-color .2s; }
.pk-extra:hover:not(:disabled) { border-color: var(--ink-2); }
.pk-extra:disabled { opacity: .35; cursor: not-allowed; }
.pk-extra .ic { color: var(--green-2); width: 18px; height: 18px; }
.pk-extra.is-on { border-color: var(--green-2); background: #e5f0e5; font-weight: 600; }

.pk-head { position: sticky; top: 8px; z-index: 3; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 12px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.pk-ring { width: 70px; height: 70px; flex: none; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(var(--green-2) calc(var(--p) * 360deg), var(--line) 0); transition: background .3s; }
.pk-ring span { width: 58px; height: 58px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--card); }
.pk-ring img { width: 50px; height: 50px; object-fit: contain; }
.pk-sum { flex: 1; min-width: 220px; }
.pk-trip { font: 500 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.pk-big { font: 700 25px/1.05 var(--f-cond); letter-spacing: .02em; text-transform: uppercase; color: var(--ink); }
.pk-note { font-size: 13px; color: var(--text-2); }
.pk-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.pk-actions .pr-link { min-height: 34px; padding: 4px 10px; }
.pk-actions .pr-link:disabled { opacity: .4; cursor: not-allowed; }
.pk-print { display: none; }
.pk-sec { margin-top: 12px; padding: 13px 16px 6px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); }
.pk-sec header { display: flex; align-items: center; gap: 8px; color: var(--green); }
.pk-sec h3 { margin: 0; font: 700 22px var(--f-cond); letter-spacing: .04em; text-transform: uppercase; color: var(--ink); }
.pk-secsub { font-size: 13px; color: var(--muted); }
.pk-seccount { margin-left: auto; font: 500 12px var(--f-mono); color: var(--text-2); }
.pk-sec ul { list-style: none; margin: 8px 0 0; padding: 0; }
.pk-item { position: relative; padding: 9px 0; border-top: 1px solid var(--line-2); }
.pk-check { position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.pk-check input { position: absolute; left: 0; top: 50%; width: 26px; height: 26px; margin: -13px 0 0; opacity: 0; cursor: pointer; }
.pk-box { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 8px; border: 2px solid #c4c6b8; background: #fff; color: #fff; transition: background .15s, border-color .15s; }
.pk-box .ic { width: 15px; height: 15px; stroke-width: 3.2; opacity: 0; }
.pk-check:hover .pk-box { border-color: var(--ink-2); }
.pk-check input:checked + .pk-box { background: var(--green-2); border-color: var(--green-2); }
.pk-check input:checked + .pk-box .ic { opacity: 1; }
.pk-check input:focus-visible + .pk-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.pk-thumb { width: 50px; height: 50px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: radial-gradient(circle at 50% 60%, #fff, var(--card-2) 72%); color: var(--muted); }
.pk-thumb img { width: 46px; height: 46px; object-fit: contain; }
.pk-body { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.pk-name { font-weight: 600; font-size: 15.5px; line-height: 1.25; color: var(--ink); }
.pk-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pk-tags:empty { display: none; }
.pk-tag { padding: 0 6px; border-radius: 5px; background: var(--card-2); color: var(--text-2); font: 500 10px/17px var(--f-mono); letter-spacing: .05em; text-transform: uppercase; }
.pk-tag.must { background: var(--accent-soft); color: var(--accent-2); }
.pk-tag.qty { background: var(--lake-soft); color: #1f4d63; text-transform: none; }
.pk-why { font-size: 13.5px; line-height: 1.35; color: var(--text-2); }
.pk-item.is-on .pk-name { color: var(--muted); text-decoration: line-through; }
.pk-item.is-on .pk-thumb, .pk-item.is-on .pk-why, .pk-item.is-on .pk-tags { opacity: .5; }
.pk-learn { display: inline-flex; align-items: center; gap: 1px; margin: 3px 0 0 86px; font: 600 12.5px var(--f-cond); letter-spacing: .06em; text-transform: uppercase; color: var(--lake); text-align: left; }
.pk-item.is-task .pk-learn { margin-left: 36px; }
.pk-learn:hover { color: var(--ink); }
.pk-learn .ic { width: 13px; height: 13px; }
.pk-del { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--text-2); }
.pk-del:hover { background: var(--card-2); color: var(--accent); }
.pk-own .pk-item .pk-check { padding-right: 38px; }
.pk-add { display: flex; gap: 8px; padding: 8px 0 10px; border-top: 1px solid var(--line-2); }
.pk-own ul:empty + .pk-add { border-top: 0; }
.pk-add input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font: 400 16px var(--f-body); color: var(--ink); outline: 0; }
.pk-add input:focus { border-color: var(--brand); }
.pk-add .btn { padding: 0 14px; }
.pk-cta { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 16px; padding: 11px 12px; text-align: left; border-radius: 10px; background: var(--amber-soft); border: 1px solid #efd9ad; color: #6e4a0f; font-size: 14px; line-height: 1.3; transition: border-color .2s; }
.pk-cta:hover { border-color: var(--amber); }
.pk-cta span { flex: 1; min-width: 0; }
.pk-cta b { display: block; font-weight: 600; }

@media (min-width: 861px) {
  .pk-fold[open] summary { display: none; }
  .pk-form { max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; }
}
@media (max-width: 1100px) {
  .pk-grid { grid-template-columns: 300px minmax(0, 1fr); }
  .pk-learn { margin-left: 86px; }
  .pv { grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
  .path-grid, .sr-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .search-box { height: 50px; margin-bottom: 14px; }
  .search-btn { width: 42px; min-height: 42px; }
  .dock-head { flex-wrap: wrap; gap: 6px 8px; }
  .path-chip { max-width: 100%; }
  .pv { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; }
  .pv-head, .pv-side, .trail { grid-area: auto; }
  .pv .v-sub { margin-bottom: 14px; }
  .pv-side { position: static; display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 8px 14px; align-items: center; margin-bottom: 18px; padding: 14px; }
  .pv-emblem { grid-row: span 2; }
  .pv-emblem svg { width: 78px; height: 78px; }
  .pv-goal { font-size: 13.5px; line-height: 1.3; }
  .pv-cta, .pv-links { grid-column: 1 / -1; }
  .pv-back { margin-top: -6px; }
  .tr-card .lc-theme { display: none; }
  .tr-next { position: absolute; top: -8px; right: 10px; z-index: 1; }
  .pm { height: 104px; }
  .pm-stop { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
  .pm-stop img { width: 36px; height: 36px; }
  .pm-flag { width: 32px; height: 32px; margin: -16px 0 0 -16px; }
  .pc-title { font-size: 25px; }
  .tr-stop { padding-left: 38px; }
  .tr-stop::before { left: 13px; }
  .tr-node { width: 29px; height: 29px; font-size: 12px; }
  .sr-img { width: 58px; height: 58px; }
  .sr-img img { width: 54px; height: 54px; }
  .sr-t { font-size: 18px; }
  .pk-grid { grid-template-columns: minmax(0, 1fr); }
  .pk-fold { position: static; }
  .pk-head { top: 4px; padding: 10px 12px; }
  .pk-ring { width: 54px; height: 54px; }
  .pk-ring span { width: 44px; height: 44px; }
  .pk-ring img { width: 38px; height: 38px; }
  .pk-sum { min-width: 0; }
  .pk-big { font-size: 21px; }
  .pk-note { display: none; }
  .pk-actions { width: 100%; }
  .pk-actions .pr-link { flex: 1 1 auto; justify-content: center; padding: 4px 6px; font-size: 12.5px; letter-spacing: .06em; }
  .pk-sec { padding: 12px 12px 4px; }
  .pk-secsub { display: none; }
  .pk-thumb { width: 42px; height: 42px; }
  .pk-thumb img { width: 38px; height: 38px; }
  .pk-learn { margin-left: 78px; }
  .pk-item.is-task .pk-learn { margin-left: 36px; }
}
@media (max-width: 480px) {
  .topbar { gap: 8px; flex-wrap: wrap; }
  .logo { gap: 8px; }
  .logo-mark { width: 34px; height: 34px; }
  .logo-title { font-size: 23px; }
  .menu-btn { width: 38px; height: 38px; }
  .search-btn { width: 38px; min-height: 38px; }
  .top-right { gap: 6px; }
  .lang { padding: 3px; }
  .lang button { min-height: 30px; padding: 0 7px; font-size: 12px; }
}
@media (max-width: 372px) { .logo-title { font-size: 20px; } .logo-mark { width: 30px; height: 30px; } }
@media (max-width: 345px) { .logo-text { display: none; } }
@media (max-height: 680px) { .sb-nav { padding-top: 6px; gap: 2px; } .sb-item { height: 46px; } }

@media print {
  html, body { height: auto; overflow: visible; background: #fff; font-size: 11px; }
  .sidebar, .topbar, .viewport, .panel, .dock, .intro, .pr-wrap, .credit, .loader, .toast, .modal, .view-close,
  .v-kicker, .v-title, .v-sub, .pk-fold, .pk-head, .pk-thumb, .pk-why, .pk-learn, .pk-add, .pk-del, .pk-secsub, .pk-seccount, .pk-sec > header .ic, .pk-tag.must { display: none !important; }
  .app, .stage { display: block; height: auto; overflow: visible; }
  .view { position: static; overflow: visible; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; animation: none; }
  .view-inner { max-width: none; padding: 0; animation: none; }
  .pk-grid { display: block; }
  #pkList { column-count: 2; column-gap: 26px; }
  .pk-print { display: flex; flex-direction: column; column-span: all; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid #000; }
  .pk-print b { font: 700 22px var(--f-cond); text-transform: uppercase; }
  .pk-sec { padding: 0; margin: 0 0 10px; background: none; border: 0; box-shadow: none; }
  .pk-sec h3 { font-size: 14px; }
  .pk-sec ul { margin-top: 2px; }
  .pk-own:has(ul:empty) { display: none; }
  .pk-item { padding: 1.5px 0; border: 0; break-inside: avoid; }
  .pk-check { align-items: baseline; gap: 6px; }
  .pk-box { width: 11px; height: 11px; border: 1px solid #000; border-radius: 2px; background: none !important; }
  .pk-box .ic { stroke: #000; width: 9px; height: 9px; }
  .pk-body { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 5px; }
  .pk-name { font-size: 11px; font-weight: 500; }
  .pk-tag { padding: 0; background: none !important; color: #333 !important; line-height: 1.2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
