:root{
  --bg:#fbf6ec; --card:#fffdf8; --ink:#2b2420; --soft:#5b4f45; --line:#e7dccb;
  --accent:#b85c1e; --red:#c62f2a; --blue:#1f5fbf; --clue:#eef5ee; --note:#fff3d6;
  --radius:18px; font-size:clamp(17px, 1.05vw + 12px, 24px);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--ink);
  font-family:"Pretendard","Apple SD Gothic Neo","Noto Sans KR","Malgun Gothic",system-ui,sans-serif;
  line-height:1.75;word-break:keep-all;overflow-wrap:break-word}
a{color:var(--blue)}
a:focus-visible,summary:focus-visible{outline:3px solid var(--accent);outline-offset:3px;border-radius:6px}
.skip{position:absolute;left:-999px}.skip:focus{left:1rem;top:1rem;background:#fff;padding:.5rem 1rem;z-index:9}
.wrap{max-width:62rem;margin:0 auto;padding:1.2rem clamp(1rem,3vw,2.5rem) 3rem}
header.top{display:flex;gap:1rem;align-items:center;justify-content:space-between;flex-wrap:wrap;font-size:.85rem;color:var(--soft)}
header.top a{text-decoration:none;font-weight:700}
h1{font-size:clamp(1.7rem,2.6vw + 1rem,2.9rem);line-height:1.3;margin:.6rem 0 .3rem}
h2{font-size:1.35rem;line-height:1.4;margin:0}
h3{font-size:1rem;margin:1rem 0 .3rem}
.lead{font-size:1.08rem;color:var(--soft);margin:.2rem 0 1rem}
.tag{display:inline-block;background:#f1e3cc;color:#6a4a22;border-radius:999px;padding:.1rem .8rem;font-size:.8rem;font-weight:700}
.hero{border-radius:var(--radius);width:100%;height:auto;max-height:52vh;display:block;aspect-ratio:16/9;object-fit:cover;background:#efe4d1}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:1.2rem 1.4rem;margin:1.2rem 0;box-shadow:0 2px 0 #eadfcd}
.station-head{display:flex;gap:.9rem;align-items:center;flex-wrap:wrap;margin-bottom:.6rem}
.num{flex:0 0 auto;width:2.6rem;height:2.6rem;border-radius:50%;background:var(--accent);color:#fff;display:grid;place-items:center;font-weight:800}
.pg{margin-left:auto;background:#fff;border:2px solid var(--accent);color:var(--accent);border-radius:10px;padding:.05rem .7rem;font-weight:800;font-size:.85rem}
.q{margin:.2rem 0 .6rem;padding-left:1.3rem}
.q li{margin:.25rem 0;font-weight:600}
.bg{background:#fff;border-left:5px solid #e0b98a;padding:.5rem .9rem;margin:.6rem 0;border-radius:0 10px 10px 0}
.box{border-radius:12px;padding:.6rem .9rem;margin:.6rem 0}
.box h3{margin:0 0 .2rem;font-size:.9rem}
.clues{background:var(--clue)} .clues ul{margin:0;padding-left:1.2rem}
.note{background:var(--note)}
.fig{margin:.6rem 0}
.fig img{width:100%;height:auto;border-radius:14px;display:block;aspect-ratio:4/3;object-fit:cover}
.map-card svg.map{width:100%;height:auto;display:block;border-radius:12px;border:1px solid var(--line)}
.t-red{font-size:15px;font-weight:700;fill:var(--red);paint-order:stroke;stroke:#fff;stroke-width:4px}
.t-blue{font-size:17px;font-weight:800;fill:var(--blue);paint-order:stroke;stroke:#fff;stroke-width:4px}
.t-q{font-size:22px;font-weight:900;fill:var(--blue)}
.legend{display:flex;gap:1.2rem;flex-wrap:wrap;font-size:.9rem;margin:.5rem 0 0;padding:0;list-style:none}
.legend span{display:inline-block;width:2.4rem;height:0;vertical-align:middle;margin-right:.4rem}
.l-red{border-top:4px solid var(--red)} .l-blue{border-top:4px dashed var(--blue)}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(15rem,1fr));gap:1rem;margin:1rem 0}
.item-card{display:block;background:var(--card);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;text-decoration:none;color:inherit}
.item-card img{width:100%;aspect-ratio:4/3;object-fit:cover;display:block}
.item-card div{padding:.7rem 1rem 1rem}
.item-card strong{font-size:1.2rem;display:block}
.item-card:hover,.item-card:focus-visible{border-color:var(--accent)}
table{border-collapse:collapse;width:100%;font-size:.88rem}
th,td{border:1px solid var(--line);padding:.35rem .5rem;text-align:left;vertical-align:top}
th{background:#f6ecdc}
.hands4{display:grid;grid-template-columns:repeat(4,1fr);gap:.4rem;margin:.5rem 0;font-size:.85rem;text-align:center}
.hands4 div{border:2px dashed #d7c3a3;border-radius:10px;padding:.5rem .3rem;background:#fff}
.src ol{padding-left:1.4rem;font-size:.82rem} .src li{margin:.2rem 0}
.src a{word-break:break-all}
.ref{font-size:.75em;vertical-align:super;text-decoration:none;font-weight:700;margin-left:.1em}
nav.toc ol{columns:2;font-size:.9rem;padding-left:1.4rem}
footer{font-size:.8rem;color:var(--soft);margin-top:2rem;border-top:1px solid var(--line);padding-top:1rem}
details summary{cursor:pointer;font-weight:700}
@media (min-width:900px){
  .card.has-img{display:grid;grid-template-columns:1fr 38%;gap:1.2rem}
  .card.has-img .fig{grid-column:2;grid-row:1 / span 6;margin:0}
  .card.has-img > :not(.fig){grid-column:1}
}
@media (max-width:760px){ .mapbox{overflow-x:auto} .map-card svg.map{min-width:720px} }
@media (max-width:600px){ nav.toc ol{columns:1} .hands4{grid-template-columns:1fr 1fr} .pg{margin-left:0} }
@media print{
  :root{font-size:11.5pt}
  body{background:#fff}
  .wrap{max-width:none;padding:0}
  header.top a.nav, .skip, nav.toc{display:none}
  .card,.item-card{box-shadow:none;break-inside:avoid;border-color:#bbb}
  .map-card{break-inside:avoid}
  .hero{max-height:6cm}
  .card.has-img{display:grid;grid-template-columns:1fr 30%;gap:.8rem}
  .card.has-img .fig{grid-column:2;grid-row:1 / span 6}
  .card.has-img > :not(.fig){grid-column:1}
  a{color:#000;text-decoration:none}
  .src a::after{content:""}
  .num{background:#fff;color:#000;border:2px solid #000}
  @page{size:A4;margin:14mm}
}

/* ===== v2 ===== */
html.big{font-size:clamp(21px,1.35vw + 14px,32px)}
.stationbar{position:sticky;top:0;z-index:20;background:#fffaf0ee;backdrop-filter:blur(4px);border-bottom:1px solid var(--line);margin:0 calc(-1*clamp(1rem,3vw,2.5rem)) .8rem;padding:.45rem clamp(1rem,3vw,2.5rem) .35rem}
.sb-row{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap}
.sb-row a.home{font-weight:800;text-decoration:none;white-space:nowrap}
.sb-row select{font:inherit;font-size:.85rem;padding:.35rem .5rem;border-radius:10px;border:2px solid var(--line);background:#fff;max-width:16rem;flex:1 1 10rem}
.btn{font:inherit;font-size:.85rem;font-weight:800;border:2px solid var(--accent);background:#fff;color:var(--accent);border-radius:12px;padding:.35rem .8rem;cursor:pointer;min-height:44px}
.btn[aria-pressed="true"],.btn.primary{background:var(--accent);color:#fff}
.btn:disabled{opacity:.35;cursor:default}
.pos{font-weight:800;font-size:.9rem;white-space:nowrap}
.progress{height:8px;background:#efe2cc;border-radius:99px;margin-top:.35rem;overflow:hidden}
.progress span{display:block;height:100%;width:0;background:var(--accent);transition:width .25s}
.bottombar{position:sticky;bottom:0;z-index:20;display:flex;justify-content:space-between;align-items:center;gap:.6rem;background:#fffaf0ee;border-top:1px solid var(--line);margin:1.5rem calc(-1*clamp(1rem,3vw,2.5rem)) 0;padding:.5rem clamp(1rem,3vw,2.5rem)}
.bottombar .btn{font-size:1rem;padding:.5rem 1.2rem;min-width:7rem}
html.one section.station:not(.current){display:none}
html.one section.station.current{min-height:60vh}
.station h2{outline:none}
.part{font-size:.78rem;font-weight:800;color:#8a5a2b;letter-spacing:.02em}
.bigq{font-size:1.3rem;font-weight:800;line-height:1.45;margin:.3rem 0 .6rem;color:#3a2a1c}
.chip{display:inline-block;background:#e8f0fb;color:#1d4e94;border-radius:10px;padding:.15rem .7rem;font-size:.8rem;font-weight:700;margin:.1rem 0 .5rem}
.steps{list-style:none;margin:.4rem 0;padding:0;display:grid;gap:.55rem}
.steps > li{border-radius:12px;padding:.55rem .9rem;background:#fff;border:1px solid var(--line)}
.steps > li > b{display:inline-block;min-width:6.5em;color:var(--accent)}
.steps li.s-clue{background:var(--clue)}
.steps li.s-org{background:var(--note)}
.clue-list{margin:.3rem 0 0;padding-left:1.1rem}
.clue-list li{margin:.3rem 0}
.clue-list .how{display:block;font-size:.85rem;color:var(--soft)}
.clue-list .off{display:block;font-size:.82rem;color:#6b4b1a}
.code{font-family:ui-monospace,Menlo,Consolas,monospace;background:#fff;border:1px solid #d9cdb8;border-radius:6px;padding:0 .3em}
.roles{font-size:.88rem;color:var(--soft);margin:.5rem 0}
details.help{border:2px dashed #c9b28d;border-radius:12px;padding:.45rem .8rem;margin:.5rem 0;background:#fffdf6}
details.help ul{margin:.3rem 0 0;padding-left:1.1rem}
.deeper{font-size:.88rem;margin:.4rem 0}
.out{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;border-top:1px dashed var(--line);padding-top:.5rem;margin-top:.6rem;font-size:.88rem}
.out strong{color:#2f6b3a}
.out label{display:inline-flex;gap:.35rem;align-items:center;cursor:pointer}
.out input,.checks input{width:1.3rem;height:1.3rem;accent-color:#2f6b3a}
.write-lines{display:none}
.flow{display:grid;grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));gap:.7rem;margin:.6rem 0}
.flow > div{background:#fff;border:1px solid var(--line);border-radius:12px;padding:.6rem .8rem}
.flow h3{margin:0 0 .2rem;font-size:.95rem}
.flow ol{margin:0;padding-left:1.2rem;font-size:.85rem}
.checks{list-style:none;padding:0;margin:.4rem 0}
.checks li{display:flex;gap:.6rem;align-items:flex-start;padding:.45rem 0;border-bottom:1px dashed var(--line)}
.checks small{color:var(--soft);display:block}
.no-js-only{display:block} html.js .no-js-only{display:none}
@media (max-width:600px){ .sb-row select{max-width:none;order:5;flex-basis:100%} .bigq{font-size:1.15rem} }
@media print{
  .stationbar,.bottombar,details.help,.no-print,.out label,.progress{display:none!important}
  html.one section.station{display:block!important}
  section.station{break-inside:auto;border:1px solid #999}
  .steps > li{break-inside:avoid;border-color:#bbb;background:#fff!important}
  .write-lines{display:block;margin-top:.3rem}
  .write-lines span{display:block;border-bottom:1px solid #999;height:1.6em}
  .chip{border:1px solid #888;background:#fff;color:#000}
  .bigq{font-size:1.1rem}
  section.station h2{break-after:avoid}
}
.steps li,.clue-list li,.src li,td{overflow-wrap:anywhere;min-width:0}
.steps,.clue-list{max-width:100%}
section.station{scroll-margin-top:var(--sbh,96px)}
@media (max-width:820px){
 .sb-row{gap:.3rem}
 .sb-row .btn{padding:.25rem .55rem;font-size:.92rem;min-height:40px}
 #jump{order:9;flex:1 1 100%}
 .bottombar .pos{font-size:.9rem}
}
@media print{.fig img,img.hero{max-height:6.5cm;width:auto;max-width:100%;margin:0 auto;display:block}.map-card svg{max-height:8cm}}
