:root {
  --bg: #fcf6ea; --paper: #fffdf8; --ink: #2b2a26; --ink2: #5d5a52; --muted: #8b877c;
  --line: #ebe3d2; --line2: #ddd2bc; --sage: #7fae8b; --sage-d: #4f7d5c; --rose: #e29aa8; --butter: #f3dfa2;
  --shadow: 0 1px 2px rgba(60, 50, 30, .06), 0 8px 24px -12px rgba(60, 50, 30, .18);
  --r: 18px; --font: 'DM Sans', system-ui, -apple-system, Segoe UI, sans-serif; --serif: 'Fraunces', Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--sage-d); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .center { text-align: center; justify-content: center; }
[hidden] { display: none !important; }
code { font-size: 12px; background: #f3ecdd; padding: 1px 5px; border-radius: 6px; word-break: break-all; }

/* header */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(14px, 4vw, 40px); background: rgba(252, 246, 234, .86); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; }
body[data-page=map] .top { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font: 600 20px var(--serif); letter-spacing: -.01em; }
nav { display: flex; align-items: center; gap: 10px; }
.navlink { color: var(--ink2); text-decoration: none; font-weight: 500; font-size: 15px; padding: 6px 10px; border-radius: 99px; }
.navlink:hover { background: #f3ecdd; }

/* buttons */
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ink); background: var(--ink); color: #fff;
  padding: 11px 20px; border-radius: 99px; font-weight: 600; cursor: pointer; text-decoration: none; transition: transform .15s, background .15s, box-shadow .15s; white-space: nowrap; }
.pill:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .35); }
.pill:active { transform: none; }
.pill.ghost { background: var(--paper); color: var(--ink); border-color: var(--line2); }
.pill.ghost:hover { border-color: var(--ink); }
.pill.small { padding: 7px 14px; font-size: 14px; }
.pill.wide { width: 100%; }
.pill.done { background: #e4f1e6; border-color: var(--sage); color: var(--sage-d); }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 99px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink2); font-size: 22px; line-height: 1; }
.iconbtn:hover { background: #f1e9d8; color: var(--ink); }
.linkish { background: none; border: 0; color: var(--sage-d); text-decoration: underline; cursor: pointer; padding: 0; }
.center-block { display: block; margin: 10px auto 0; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row-btns.center { justify-content: center; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }

/* hero */
.hero { position: relative; max-width: 1180px; margin: 0 auto; padding: clamp(12px, 3vw, 30px) clamp(14px, 4vw, 40px) 10px; }
.hero-art { position: relative; margin: 0 auto; max-width: 980px; aspect-ratio: 1536 / 700; overflow: hidden;
  -webkit-mask-image: radial-gradient(ellipse 72% 78% at 50% 52%, #000 55%, transparent 100%); mask-image: radial-gradient(ellipse 72% 78% at 50% 52%, #000 55%, transparent 100%); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.hero-copy { text-align: center; max-width: 720px; margin: 14px auto 22px; position: relative; }
.eyebrow { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 700; color: var(--sage-d); }
h1 { font: 600 clamp(34px, 6vw, 58px)/1.05 var(--serif); letter-spacing: -.02em; margin: 0 0 12px; }
h1 em { font-style: italic; color: var(--sage-d); }
.lede { color: var(--ink2); font-size: clamp(16px, 2vw, 18px); margin: 0 auto; max-width: 620px; }
.maker { max-width: 900px; margin: 0 auto; padding: 16px; }
.maker textarea { width: 100%; border: 1px solid var(--line); background: #fffefb; border-radius: 14px; padding: 14px 16px; resize: vertical; min-height: 84px; font-size: 17px; outline: none; transition: border .15s, box-shadow .15s; }
.maker textarea:focus, .field input:focus, .field select:focus, .pf input:focus, #askq:focus, #notes:focus, .searchbox:focus-within { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(127, 174, 139, .2); }
.maker-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 12px; }
.maker-row > .pill.primary { margin-left: auto; }
.field { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field i { font-weight: 400; }
.field.grow { flex: 1 1 200px; }
.field select, .field input { border: 1px solid var(--line2); background: var(--paper); border-radius: 12px; padding: 7px 10px; font-size: 14.5px; color: var(--ink); font-weight: 500; outline: none; min-height: 38px; }
.filebtn { position: relative; cursor: pointer; align-self: flex-end; min-height: 38px; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.chip { border: 1px solid var(--line); background: #f8f1e3; border-radius: 99px; padding: 4px 11px; font-size: 13px; cursor: pointer; color: var(--ink2); }
.chip:hover { border-color: var(--sage); color: var(--ink); background: #eef5ec; }
.ai-note { margin: 12px 2px 0; font-size: 13px; color: var(--muted); }
.keytip { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; padding: 12px 14px; border-radius: 16px; background: #fbf3d9; border: 1px solid #efdfa8; }
.keytip > div { flex: 1 1 260px; min-width: 0; }
.keytip b { display: block; font-size: 14.5px; }
.keytip span { font-size: 13.5px; color: var(--ink2); }
.keytip .kt-ico { font-size: 20px; }
.row-btns.center { justify-content: center; }
.opt-card details { margin-top: 8px; color: var(--ink2); }
.opt-card details summary { cursor: pointer; padding: 2px 0; }
.opt-card details ol { padding-left: 18px; margin: 6px 0; }

/* sections */
.section { max-width: 1180px; margin: 0 auto; padding: 40px clamp(14px, 4vw, 40px) 10px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
h2 { font: 600 clamp(24px, 3vw, 30px)/1.2 var(--serif); margin: 0; letter-spacing: -.01em; }
.mapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mapcard { position: relative; display: flex; flex-direction: column; padding: 16px 18px; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; min-height: 170px; }
.mapcard:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(60, 50, 30, .35); }
.mapcard h3 { margin: 10px 0 4px; font-size: 18px; line-height: 1.25; }
.mapcard p { margin: 0 0 12px; color: var(--ink2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-tracks { display: flex; gap: 4px; }
.mc-tracks span { width: 22px; height: 6px; border-radius: 9px; }
.mc-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.mc-foot .bar { flex: 1; }
.tag { position: absolute; top: 12px; right: 12px; font-size: 11px; font-weight: 700; background: var(--butter); color: #6d5717; padding: 2px 8px; border-radius: 99px; }
.bar { height: 8px; background: #efe6d4; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #9cc7a5, var(--sage)); border-radius: 99px; transition: width .5s cubic-bezier(.3, .8, .3, 1); }
.bar.big { height: 10px; }
.empty { display: flex; align-items: center; gap: 16px; padding: 16px; }
.empty img { width: 110px; }
.how { display: grid; grid-template-columns: minmax(180px, 320px) 1fr; gap: 30px; align-items: center; }
.how ol { padding-left: 20px; margin: 12px 0 0; color: var(--ink2); }
.how li { margin-bottom: 10px; }
.how b { color: var(--ink); }
.foot { max-width: 1180px; margin: 30px auto 0; padding: 26px clamp(14px, 4vw, 40px) 40px; border-top: 1px solid var(--line); text-align: center; font-size: 14px; color: var(--ink2); }
.foot p { margin: 4px 0; }

/* map page */
body[data-page=map] { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body[data-page=map] main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.mapbar { padding: 12px clamp(14px, 3vw, 28px) 10px; border-bottom: 1px solid var(--line); background: var(--bg); }
.mb-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.back { color: var(--ink2); text-decoration: none; font-size: 14px; font-weight: 500; }
.back:hover { color: var(--ink); }
.mtitle { font-size: clamp(24px, 3.4vw, 34px); margin: 6px 0 2px; }
.msum { margin: 0; color: var(--ink2); font-size: 14.5px; max-width: 900px; }
.mb-progress { display: flex; align-items: center; gap: 12px; margin: 10px 0; font-size: 13.5px; color: var(--ink2); }
.mb-progress .bar { flex: 0 1 340px; }
.mb-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: #f1e9d8; border-radius: 99px; padding: 3px; }
.seg button { display: inline-flex; gap: 6px; align-items: center; border: 0; background: transparent; padding: 6px 13px; border-radius: 99px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink2); }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg svg { width: 16px; height: 16px; }
.searchbox { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); background: var(--paper); border-radius: 99px; padding: 0 12px; color: var(--muted); }
.searchbox input { border: 0; outline: 0; background: transparent; padding: 7px 0; width: 150px; font-size: 14px; color: var(--ink); }
.legend { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding: 2px; }
.legend::-webkit-scrollbar { display: none; }
.lchip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border: 1px solid var(--line); background: var(--paper); border-radius: 99px; padding: 4px 11px; font-size: 13px; cursor: pointer; color: var(--ink2); }
.lchip span { width: 9px; height: 9px; border-radius: 99px; background: var(--c); }
.lchip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, var(--paper)); color: var(--ink); font-weight: 600; }
.filtering .lchip:not(.on) { opacity: .55; }
.keys { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.k { display: inline-block; width: 14px; height: 10px; border-radius: 4px; margin-right: -6px; vertical-align: middle; border: 1.5px solid var(--sage); background: var(--paper); }
.k.locked { border-style: dashed; border-color: var(--line2); background: #f4eee2; }
.k.done { background: #d6ead9; }
.k.opt { border-style: dotted; border-color: var(--ink2); }
.mapstage { position: relative; flex: 1; min-height: 0; }

/* graph */
.graph { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  background: radial-gradient(circle at 1px 1px, #e6dcc7 1px, transparent 1.2px) 0 0 / 22px 22px; }
.graph.grabbing { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.world.glide { transition: transform .38s cubic-bezier(.3, .8, .3, 1); }
.edges { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.edges path { fill: none; stroke: #cdbf9f; stroke-width: 2; marker-end: url(#arr); transition: opacity .2s, stroke .2s; }
.edges marker path { fill: #cdbf9f; stroke: none; }
.edges path.done { stroke: #94c29f; }
.edges path.hl { stroke: var(--ink); stroke-width: 2.6; }
.edges path.hl.kid { stroke: var(--sage-d); stroke-dasharray: 6 5; }
.edges path.dim { opacity: .18; }
.stages { position: absolute; left: 0; top: 0; }
.stage { position: absolute; left: 14px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #b3a588; white-space: nowrap; }
.gnode { position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 10px; background: var(--paper); border: 1.5px solid var(--line2);
  border-radius: 16px; box-shadow: var(--shadow); cursor: pointer; transition: opacity .2s, transform .2s, border-color .2s, box-shadow .2s, background .2s; outline: none; }
.gnode::before { content: ''; position: absolute; left: -1.5px; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.gnode:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgba(60, 50, 30, .4); }
.gnode:focus-visible { box-shadow: 0 0 0 3px rgba(127, 174, 139, .45); }
.gnode.ready { border-color: color-mix(in srgb, var(--c) 70%, #fff); }
.gnode.locked { background: #f7f2e7; border-style: dashed; box-shadow: none; }
.gnode.locked .gtitle { color: var(--ink2); }
.gnode.done { background: #edf6ee; border-color: #a9d0b1; }
.gnode.optional { border-style: dotted; }
.gnode.sel { border-color: var(--ink); border-style: solid; box-shadow: 0 0 0 4px rgba(43, 42, 38, .1), 0 14px 30px -14px rgba(60, 50, 30, .45); transform: translateY(-2px); opacity: 1; }
.gnode.anc { border-color: var(--ink2); }
.gnode.dim { opacity: .28; }
.gnode.pop { animation: pop .5s; }
@keyframes pop { 40% { transform: scale(1.08); } }
.tick { flex: none; width: 28px; height: 28px; border-radius: 99px; border: 2px solid var(--c); background: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent; transition: background .15s, color .15s, transform .15s; }
.tick:hover { transform: scale(1.1); color: color-mix(in srgb, var(--c) 80%, #000); }
.tick svg { width: 16px; height: 16px; stroke-width: 3; }
.tick[aria-pressed=true] { background: var(--sage); border-color: var(--sage); color: #fff; }
.locked .tick { border-style: dashed; border-color: #cbbfa6; }
.gbody { min-width: 0; flex: 1; }
.gtitle { font-weight: 650; font-size: 14.5px; line-height: 1.22; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gmeta { display: flex; gap: 5px; align-items: center; margin-top: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.tname { overflow: hidden; text-overflow: ellipsis; }
.tdot { width: 7px; height: 7px; border-radius: 9px; background: var(--c); flex: none; }
.opt { font-size: 10.5px; font-weight: 700; color: #8a6d3b; background: #f7ecd2; padding: 1px 6px; border-radius: 99px; }
.lock { position: absolute; top: 7px; right: 8px; color: #c2b597; display: none; }
.lock svg { width: 13px; height: 13px; }
.gnode.locked .lock { display: block; }
.gctl { position: absolute; right: 14px; bottom: 14px; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.gctl button { width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer; font-size: 20px; color: var(--ink2); }
.gctl button + button { border-top: 1px solid var(--line); }
.gctl button:hover { background: #f5eedf; color: var(--ink); }
.nextup { position: absolute; left: 14px; bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px 12px; max-width: min(560px, calc(100% - 90px)); font-size: 13px; z-index: 2; }
.nextup b { margin-right: 4px; }
.nchip { border: 1px solid var(--line2); background: #fffefb; border-radius: 99px; padding: 4px 10px; font-size: 13px; cursor: pointer; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nchip:hover { border-color: var(--sage); background: #eef5ec; }
body[data-page=map] .mlist:not([hidden]) ~ .nextup { display: none; }

/* list view */
.mlist { position: absolute; inset: 0; overflow-y: auto; padding: 16px clamp(14px, 3vw, 28px) 60px; }
.lstage { max-width: 820px; margin: 0 auto 18px; }
.lstage h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--sage-d); margin: 0 0 8px; display: flex; gap: 10px; align-items: baseline; }
.lstage h3 span { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.litem { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--paper); border: 1.5px solid var(--line); border-left: 4px solid var(--c); border-radius: 14px; margin-bottom: 8px; }
.litem.locked { background: #f7f2e7; border-style: dashed; border-left-style: solid; }
.litem.done { background: #edf6ee; }
.litem .tick { margin-top: 2px; }
.lbody { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.lbody b { font-size: 15.5px; }
.lbody > span { color: var(--ink2); font-size: 14px; }
.lbody em { font-style: normal; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lbody em i { width: 7px; height: 7px; border-radius: 9px; background: var(--c); }

/* drawer */
.drawer { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(460px, 100%); background: var(--paper); border-left: 1px solid var(--line);
  box-shadow: -20px 0 50px -30px rgba(60, 50, 30, .4); transform: translateX(105%); visibility: hidden; transition: transform .32s cubic-bezier(.3, .8, .3, 1), visibility 0s .32s; overflow-y: auto; overscroll-behavior: contain; }
.drawer-open .drawer { transform: none; visibility: visible; transition: transform .32s cubic-bezier(.3, .8, .3, 1); }
.scrim { display: none; }
.dhead { padding: 18px 22px 10px; }
.dtop { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tpill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--c) 22%, #fff); color: color-mix(in srgb, var(--c) 55%, #222); }
.dhead h2 { margin: 8px 0 6px; font-size: 26px; }
.dmeta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--ink2); }
.lvl { display: inline-flex; gap: 3px; align-items: center; }
.lvl i { width: 8px; height: 8px; border-radius: 9px; background: #e7dfcd; }
.lvl i.on { background: var(--sage); }
.st { font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 99px; }
.st.ready { background: #e6f1e8; color: var(--sage-d); } .st.locked { background: #f1ead9; color: #8a7a55; } .st.done { background: var(--sage); color: #fff; }
.ddesc { color: var(--ink2); margin: 10px 0 14px; }
.rel { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; font-size: 13px; }
.rel > span { font-weight: 700; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; width: 100%; }
.rel em { color: var(--ink2); }
.rchip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line2); background: #fffefb; border-radius: 99px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.rchip.done { background: #e9f4eb; border-color: #b9dbc0; color: var(--sage-d); }
.rchip svg { width: 13px; height: 13px; stroke-width: 3; }
.rchip:hover { border-color: var(--ink); }
.tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 2px; padding: 8px 18px 0; background: var(--paper); border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; background: none; padding: 10px 4px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; font-size: 14.5px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.dbody { padding: 16px 22px 40px; }
.dbody > .pill { margin: 10px 0; }
.block { margin-bottom: 18px; }
.block h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--sage-d); }
.block p { margin: 0 0 6px; }
.block.soft { background: #f6f0e2; border-radius: 14px; padding: 12px 14px; }
.block.warn { background: #fbefe9; border-radius: 14px; padding: 12px 14px; }
.block.warn h4 { color: #b06a4f; }
.block ul, .block ol { margin: 0; padding-left: 20px; }
.block li { margin-bottom: 6px; }
.subs { list-style: none; padding: 0 !important; display: grid; gap: 6px; }
.subs li { background: #fbf7ee; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin: 0; }
.subs b { display: block; font-size: 14.5px; }
.subs span { font-size: 13.5px; color: var(--ink2); }
.wiki { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 14px; color: var(--ink2); overflow: hidden; }
.wiki img { float: right; width: 74px; height: 74px; object-fit: cover; border-radius: 10px; margin: 0 0 6px 10px; }
.wiki a { display: inline-flex; gap: 4px; align-items: center; font-weight: 600; font-size: 13.5px; }
.wiki a svg { width: 14px; height: 14px; }
.ask form { display: flex; gap: 6px; }
#askq { flex: 1; min-width: 0; border: 1px solid var(--line2); border-radius: 99px; padding: 7px 14px; outline: none; background: #fffefb; }
.qa { margin-top: 10px; background: #fbf7ee; border-radius: 12px; padding: 10px 12px; font-size: 14.5px; }
.qa b { display: block; margin-bottom: 4px; }
.qa.pending p { color: var(--muted); }
.res { display: grid; gap: 8px; }
.rcard { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 11px 36px 11px 13px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: var(--ink); background: #fffefb; transition: border-color .15s, transform .15s; }
.rcard:hover { border-color: var(--ink); transform: translateY(-1px); }
.rcard > svg { position: absolute; right: 12px; top: 13px; width: 15px; height: 15px; color: var(--muted); }
.rcard b { font-size: 15px; line-height: 1.3; }
.rtype { align-self: flex-start; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 1px 7px; border-radius: 99px; background: #eee6d5; color: var(--ink2); }
.t-video { background: #fbe2e5; color: #a2475a; } .t-course { background: #e3ecf8; color: #3d6595; } .t-docs { background: #e4f1e6; color: var(--sage-d); }
.t-book { background: #f6ebcd; color: #876a1f; } .t-interactive, .t-practice { background: #ece6f7; color: #6a56a1; } .t-tool { background: #e1f2ef; color: #2f7d70; }
.rby { font-size: 12.5px; color: var(--muted); }
.rwhy { font-size: 13.5px; color: var(--ink2); }
.qgroup { margin-top: 12px; }
.rsec { border-radius: 18px; padding: 4px 12px 8px; margin: 0 -4px 14px; }
.rsec.free { background: #f1f7ef; }
.rsec.paid { background: #fbf3e6; }
.rsec h3 { display: flex; align-items: center; gap: 8px; margin: 12px 2px 0; font-size: 14px; color: var(--ink2); font-weight: 600; }
.ctag { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; padding: 3px 10px; border-radius: 99px; }
.ctag.free { background: #cfe5c9; color: #2f5a32; }
.ctag.paid { background: #f2dcb4; color: #7a5317; }
.rsec .block { background: transparent; }
.rsec .block h4 .muted { font-weight: 500; margin-left: 4px; }
.more-load { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink2); margin: 10px 2px 0; }
.more-load .dots { transform: scale(.7); margin: 0; }
.pick { font-size: 11px; color: #3f7a45; font-weight: 600; }
.rhost { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink2); }
.rhost img { width: 14px; height: 14px; border-radius: 3px; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.vcard { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); border-radius: 12px; padding: 6px; background: #fffefb; border: 1px solid var(--line); transition: border-color .15s, transform .15s; }
.vcard:hover { border-color: var(--ink2); transform: translateY(-1px); }
.vcard b { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vthumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #eee6d5; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vthumb i { position: absolute; right: 5px; bottom: 5px; font-style: normal; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0,0,0,.75); padding: 1px 5px; border-radius: 4px; }
.qgroup h5 { margin: 0 0 6px; font-size: 13px; color: var(--ink2); }
.qlinks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.qlinks a { display: flex; flex-direction: column; padding: 8px 11px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); background: #fffefb; font-size: 14px; }
.qlinks a span { font-size: 12px; color: var(--muted); }
.qlinks a:hover { border-color: var(--sage); background: #f2f8f1; }
.qcard { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: #fffefb; }
.qcard summary { cursor: pointer; font-weight: 600; display: flex; gap: 10px; list-style: none; }
.qcard summary::-webkit-details-marker { display: none; }
.qcard summary span { flex: none; width: 22px; height: 22px; border-radius: 99px; background: #eef5ec; color: var(--sage-d); display: grid; place-items: center; font-size: 12px; }
.qcard p { margin: 8px 0 0 32px; color: var(--ink2); }
.qcard[open] { border-color: var(--sage); }
.flash { perspective: 1000px; }
.fcard { position: relative; height: 190px; cursor: pointer; transform-style: preserve-3d; transition: transform .5s; outline: none; }
.fcard.flip { transform: rotateY(180deg); }
.ff, .fb { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 18px; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; font-size: 17px; overflow: auto; }
.ff { background: linear-gradient(140deg, #fff8e8, #f6ecd5); border: 1px solid #ecdcb4; font-weight: 600; font-family: var(--serif); font-size: 19px; }
.fb { background: linear-gradient(140deg, #f0f7ef, #e2efe3); border: 1px solid #c4dfc9; transform: rotateY(180deg); }
.fnav { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 8px; font-size: 14px; color: var(--ink2); }
#notes { width: 100%; border: 1px solid var(--line2); border-radius: 14px; padding: 12px; background: #fffefb; outline: none; resize: vertical; line-height: 1.6; }
.notice { background: #fbefe9; border-radius: 14px; padding: 12px 14px; }
.loading p { color: var(--ink2); }
.skel { height: 14px; border-radius: 8px; margin: 10px 0; background: linear-gradient(90deg, #f1eadb 20%, #f9f4ea 50%, #f1eadb 80%); background-size: 200% 100%; animation: sh 1.2s infinite linear; }
.skel.short { width: 60%; }
@keyframes sh { to { background-position: -200% 0; } }
.dots { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.dots i { width: 9px; height: 9px; border-radius: 9px; background: var(--sage); animation: b 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; background: var(--rose); } .dots i:nth-child(3) { animation-delay: .3s; background: #d9b25c; }
@keyframes b { 50% { transform: translateY(-7px); opacity: .6; } }
.loading .dots { justify-content: flex-start; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(43, 38, 28, .42); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.modal-card { background: var(--paper); border-radius: 22px; padding: 22px; width: min(560px, 100%); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .5); max-height: calc(100dvh - 32px); overflow-y: auto; }
.building { text-align: center; }
.building img { width: 150px; margin: 0 auto 6px; }
.building h2 { margin-bottom: 6px; }
.settings h2 { font-size: 24px; }
.settings h3 { margin: 0 0 8px; font-size: 16px; }
.settings hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.opt-card { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; margin: 10px 0; cursor: pointer; }
.opt-card:has(input[type=radio]:checked) { border-color: var(--sage); background: #f5faf3; }
.opt-card input[type=radio] { margin-top: 5px; accent-color: var(--sage-d); }
.opt-card > div { flex: 1; min-width: 0; }
.opt-card > div > b { display: block; }
.opt-card > div > span { font-size: 14px; color: var(--ink2); }
.opt-card ol { padding-left: 18px; margin: 6px 0; color: var(--ink2); }
.rec { font-style: normal; font-size: 11px; background: var(--butter); color: #6d5717; padding: 1px 7px; border-radius: 99px; margin-left: 4px; vertical-align: 2px; }
.pf { display: grid; gap: 6px; margin-top: 8px; }
.pf input, .settings details input { width: 100%; border: 1px solid var(--line2); border-radius: 10px; padding: 8px 10px; background: #fffefb; outline: none; font-size: 14px; }
.settings details { margin-top: 6px; }
#testres.ok { color: var(--sage-d); font-weight: 700; } #testres.bad { color: #b0533b; }

.toast { position: fixed; z-index: 80; left: 50%; bottom: 22px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 99px; font-size: 14px; transition: .25s; max-width: calc(100% - 30px); text-align: center; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; top: -12px; width: 8px; height: 13px; border-radius: 2px; z-index: 90; animation: fall 2.6s cubic-bezier(.3, .6, .5, 1) forwards; pointer-events: none; }
@keyframes fall { to { top: 105vh; transform: rotate(720deg) translateX(40px); } }

/* responsive */
@media (max-width: 900px) {
  .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(43, 38, 28, .25); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .drawer-open .scrim { opacity: 1; pointer-events: auto; }
}
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .top { padding: 8px 14px; }
  .brand span { font-size: 18px; }
  .navlink { display: none; }
  nav .pill span { display: none; }
  nav .pill { padding: 8px; }
  .hero-art { aspect-ratio: 4 / 3; }
  .hero-art img { object-position: 45% 60%; }
  .hero-copy { margin-top: 6px; }
  .maker { padding: 12px; }
  .maker-row > * { flex: 1 1 calc(50% - 10px); }
  .maker-row .filebtn { flex-basis: 100%; }
  .maker-row > .pill.primary { flex-basis: 100%; margin: 0; padding: 13px; }
  .how { grid-template-columns: 1fr; }
  .how-art { max-width: 220px; margin: 0 auto; }
  .mapbar { padding: 10px 14px 8px; }
  .mb-top .pill span { display: none; }
  .mb-top .pill { padding: 7px 9px; }
  .msum { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; }
  .mb-progress { margin: 8px 0; font-size: 12.5px; }
  .mb-progress .bar { flex-basis: 110px; }
  .searchbox { flex: 1; } .searchbox input { width: 100%; }
  .legend { flex-basis: 100%; }
  .keys { display: none; }
  .drawer { top: auto; height: 88dvh; width: 100%; border-left: 0; border-radius: 22px 22px 0 0; transform: translateY(105%); box-shadow: 0 -20px 50px -20px rgba(60, 50, 30, .4); }
  .drawer::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 9px; background: #e3d9c4; margin: 8px auto 0; }
  .dhead { padding: 10px 18px 8px; }
  .dhead h2 { font-size: 23px; }
  .tabs { padding: 4px 10px 0; }
  .dbody { padding: 14px 18px 40px; }
  .nextup { left: 10px; bottom: 10px; max-width: calc(100% - 80px); padding: 7px 10px; }
  .nchip { max-width: 150px; }
  .gctl { right: 10px; bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
