/* XIRAIYA — Dev World (the developer village) */
.wd-hero { padding: calc(var(--header-h) + 34px) 0 30px; position: relative; }
.wd-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin: 14px 0 26px; }
.wd-head .lead { max-width: 560px; }

/* map */
.wd-map { position: relative; border-radius: 26px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); background: var(--bg); }
.wd-map-sc { overflow-x: auto; scrollbar-width: none; }
.wd-map-sc::-webkit-scrollbar { display: none; }
.wd-map-in { position: relative; }
.wd-map-in > svg { display: block; width: 100%; height: auto; }
.wd-sun { fill: var(--red); opacity: .9; }
.wd-cloud { fill: var(--surface); opacity: .9; animation: wdCloud 60s linear infinite; }
.wd-cloud.c2 { animation-duration: 80s; animation-delay: -30s; }
.wd-cloud.c3 { animation-duration: 70s; animation-delay: -50s; }
@keyframes wdCloud { from { transform: translateX(-300px); } to { transform: translateX(1300px); } }
.wd-far { fill: var(--peak-far); }
.wd-mid { fill: var(--peak-mid); opacity: .55; }
.wd-ground { fill: var(--surface-2); }
.wd-river { animation: wdRiver 6s ease-in-out infinite alternate; }
@keyframes wdRiver { to { transform: translateX(-10px); } }
.wd-path { stroke: var(--line-2); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 2 18; }
.wd-bridge path { stroke: var(--ink); stroke-width: 3; fill: none; stroke-linecap: round; }
.wd-trees path { fill: var(--cyan); opacity: .75; }
.wd-boat path { fill: var(--ink); }
.wd-boat .sail { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.wd-boat { animation: wdBoat 9s ease-in-out infinite alternate; }
@keyframes wdBoat { to { transform: translateX(120px); } }

.w-wall { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.w-roof, .w-roof2 { fill: var(--ink); }
.w-dark { fill: var(--ink); opacity: .88; }
.w-win { fill: #ffd98a; stroke: var(--ink); stroke-width: 2; }
.w-red { fill: var(--red); }
.w-glyph { font: 700 18px var(--font-mono); fill: #7ee787; }
.w-glyph.small { font-size: 13px; fill: #ffd98a; }
.w-code { font: 700 13px var(--font-mono); fill: var(--ink); }
.w-anvil { fill: var(--ink); }
.w-git circle { fill: var(--surface); stroke: var(--red); stroke-width: 2.5; }
.w-git path { stroke: var(--red); stroke-width: 2.5; }
.torii rect, .torii path { fill: var(--red); }
.bld-shadow { fill: rgba(var(--fx), .12); }
.lantern { animation: wdGlow 2.4s ease-in-out infinite; }
@keyframes wdGlow { 50% { opacity: .55; } }
.smoke circle { fill: var(--ink-3); opacity: .25; animation: wdSmoke 4s ease-out infinite; }
.smoke circle:nth-child(2) { animation-delay: -1.3s; }
.smoke circle:nth-child(3) { animation-delay: -2.6s; }
@keyframes wdSmoke { from { transform: translateY(20px) scale(.4); opacity: 0; } 40% { opacity: .35; } to { transform: translateY(-24px) scale(1.2); opacity: 0; } }
.fire path { fill: #f59e0b; transform-origin: 630px 378px; animation: wdFire .5s ease-in-out infinite alternate; }
@keyframes wdFire { to { transform: scaleY(.82) skewX(4deg); fill: #ef4444; } }
.sparks circle { fill: #fbbf24; animation: wdSpark 1.2s ease-out infinite; }
.sparks circle:nth-child(2) { animation-delay: -.4s; }
.sparks circle:nth-child(3) { animation-delay: -.8s; }
@keyframes wdSpark { from { transform: translate(0, 0); opacity: 1; } to { transform: translate(8px, -22px); opacity: 0; } }

.bld { cursor: pointer; outline: none; transition: transform .45s var(--ease-spring); transform-box: fill-box; transform-origin: 50% 100%; }
.bld:hover, .bld:focus-visible { transform: translateY(-8px); }
.bld .plaque { opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .4s var(--ease-out); }
.bld .plaque rect { fill: var(--ink); }
.bld .plaque text { fill: var(--bg); font: 700 14px var(--font-body); }
.bld:hover .plaque, .bld:focus-visible .plaque { opacity: 1; transform: none; }
.bld:focus-visible .w-wall { stroke: var(--red); stroke-width: 3; }
.wd-map.hint .bld .plaque { opacity: 1; transform: none; }

.wd-toad { position: absolute; left: 47.5%; bottom: 13.5%; width: 8.5%; min-width: 48px; transform: translateX(-50%); }
.wd-toad svg { width: 100%; height: auto; }
.wd-maphint { position: absolute; left: 16px; bottom: 14px; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; background: rgba(var(--bg-rgb), .85); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); backdrop-filter: blur(6px); }

.wd-dock { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.wd-dock a { display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; transition: transform .35s var(--ease-spring), border-color .25s; }
.wd-dock a:hover { transform: translateY(-3px); border-color: var(--red); }
.wd-dock b { font: 700 12px var(--font-mono); color: var(--red); }
.wd-dock small { color: var(--ink-3); font-weight: 400; font-size: 12.5px; }

.wd-sec { scroll-margin-top: calc(var(--header-h) + 10px); }
.wd-sec .section-head .lead { margin-top: 12px; max-width: 680px; }
.wd-sec .lead code { font: 500 .88em var(--font-mono); padding: 2px 7px; border-radius: 6px; background: var(--surface-2); }

/* terminal */
.term { border-radius: 20px; overflow: hidden; background: #0f0d0b; border: 1px solid rgba(255,255,255,.08); box-shadow: var(--shadow-lg); font: 400 14px/1.65 var(--font-mono); }
.term-bar { display: flex; align-items: center; gap: 7px; height: 42px; padding: 0 12px 0 16px; background: #1a1714; border-bottom: 1px solid rgba(255,255,255,.06); color: #9d917d; font-size: 12.5px; }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ef5a3c; }
.term-bar i:nth-child(2) { background: #f5b53d; }
.term-bar i:nth-child(3) { background: #7cb342; margin-right: 10px; }
.term-x { margin-left: auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #9d917d; }
.term-x:hover { background: rgba(255,255,255,.06); color: #efe4cc; }
.term-body { height: 380px; overflow-y: auto; padding: 16px 18px 4px; color: #e8dfcd; scrollbar-width: thin; }
.term-body .ln { white-space: pre-wrap; word-break: break-word; }
.term-body .cmd { color: #efe4cc; }
.term-body .cmd b { color: #7ee787; font-weight: 500; }
.term-body .cmd em { color: #79c0ff; font-style: normal; }
.t-dim { color: #8b8070; }
.t-red { color: #ff7b72; }
.t-grn { color: #7ee787; }
.t-yel { color: #f2cc60; }
.t-blu { color: #79c0ff; }
.t-mag { color: #d2a8ff; }
.t-hd { color: #f06a52; font-weight: 700; }
.term-body .k { color: #79c0ff; } .term-body .s { color: #a5d6a7; } .term-body .n { color: #f2cc60; } .term-body .b { color: #d2a8ff; }
.term-body a { color: #79c0ff; text-decoration: underline; text-underline-offset: 3px; }
.term-in { display: flex; align-items: center; gap: 10px; padding: 8px 18px 16px; }
.term-ps { color: #efe4cc; white-space: nowrap; }
.term-ps b { color: #7ee787; font-weight: 500; }
.term-ps em { color: #79c0ff; font-style: normal; }
.term-in input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: #fff; font: inherit; caret-color: #f06a52; }
.term-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 14px; border-top: 1px solid rgba(255,255,255,.06); }
.term-chips button { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); color: #bfb29a; font: 500 12px var(--font-mono); transition: .2s; }
.term-chips button:hover { border-color: #f06a52; color: #fff; }
.t-rain { position: fixed; inset: 0; z-index: 150; pointer-events: none; }

/* playground */
.pg { border-radius: 20px; overflow: hidden; background: #0f0d0b; border: 1px solid rgba(255,255,255,.08); box-shadow: var(--shadow-lg); }
.pg-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: #1a1714; border-bottom: 1px solid rgba(255,255,255,.06); color: #bfb29a; font-size: 13px; }
.pg-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #0f0d0b; }
.pg-tabs button { height: 30px; padding: 0 14px; border-radius: 8px; font: 600 12.5px var(--font-mono); color: #9d917d; transition: .2s; }
.pg-tabs button[aria-selected="true"] { background: #2b2620; color: #fff; }
.pg-tabs button[data-lang="html"][aria-selected="true"] { box-shadow: inset 0 -2px 0 #f06a52; }
.pg-tabs button[data-lang="css"][aria-selected="true"] { box-shadow: inset 0 -2px 0 #79c0ff; }
.pg-tabs button[data-lang="js"][aria-selected="true"] { box-shadow: inset 0 -2px 0 #f2cc60; }
.pg-preset { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pg-preset select { height: 32px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12); background: #0f0d0b; color: #efe4cc; padding: 0 8px; font: 500 12.5px var(--font-body); }
.pg-auto { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.pg-auto input { accent-color: #d23c26; }
.pg-ib { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,.12); color: #bfb29a; }
.pg-ib:hover { color: #fff; border-color: #f06a52; }
.pg-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: 520px; }
.pg-ed { position: relative; display: flex; border-right: 1px solid rgba(255,255,255,.06); min-width: 0; }
.pg-gut { flex: none; white-space: pre; width: 46px; padding: 14px 10px 14px 0; text-align: right; color: #8b8070; font: 400 13px/1.7 var(--font-mono); overflow: hidden; user-select: none; background: #12100d; }
.pg-ed textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; padding: 14px 16px; background: #0f0d0b; color: #efe4cc; font: 400 13px/1.7 var(--font-mono); tab-size: 2; white-space: pre; overflow: auto; caret-color: #f06a52; }
.pg-ed textarea::selection { background: rgba(240, 106, 82, .35); }
.pg-out { display: grid; grid-template-rows: 1fr 150px; min-width: 0; }
.pg-view { background: #fff; position: relative; }
.pg-view iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.pg-con { display: flex; flex-direction: column; min-height: 0; border-top: 1px solid rgba(255,255,255,.06); background: #12100d; }
.pg-con-h { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px; font: 600 11.5px var(--font-mono); color: #8b8070; text-transform: uppercase; letter-spacing: .08em; }
.pg-con-h button { color: #bfb29a; font: 500 12px var(--font-body); text-transform: none; letter-spacing: 0; }
.pg-log { flex: 1; overflow-y: auto; padding: 0 12px 10px; font: 400 12.5px/1.6 var(--font-mono); color: #e8dfcd; }
.pg-log div { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.04); white-space: pre-wrap; word-break: break-word; }
.pg-log .err { color: #ff7b72; }
.pg-log .warn { color: #f2cc60; }
.pg-log .dim { color: #8b8070; }

/* toolbox */
.tbx { display: grid; grid-template-columns: 230px minmax(0, 1fr); overflow: hidden; padding: 0; min-height: 520px; }
.tbx-nav { display: grid; align-content: start; gap: 4px; padding: 14px; border-right: 1px solid var(--line); background: var(--surface-2); }
.tbx-nav button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; text-align: left; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .2s, color .2s; }
.tbx-nav button:hover { color: var(--ink); background: rgba(var(--fx), .05); }
.tbx-nav button[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.tbx-nav .ic { font-size: 17px; flex: none; }
.tbx-panel { padding: 22px 24px 26px; min-width: 0; }
.tbx-panel h3 { margin-bottom: 4px; }
.tbx-panel > p { color: var(--ink-3); font-size: 14px; margin-bottom: 16px; }
.tl-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.tl-area, .tl-in { width: 100%; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg); color: var(--ink); font: 400 13.5px/1.6 var(--font-mono); padding: 12px 14px; outline: 0; transition: border-color .2s, box-shadow .2s; }
.tl-area { min-height: 150px; resize: vertical; }
.tl-in { height: 42px; padding: 0 14px; }
.tl-area:focus, .tl-in:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(196, 50, 29, .12); }
.tl-out { position: relative; margin-top: 10px; padding: 14px 16px; border-radius: 12px; background: #17130f; color: #e6ddd0; font: 400 13px/1.65 var(--font-mono); white-space: pre-wrap; word-break: break-all; min-height: 52px; max-height: 320px; overflow: auto; }
.tl-out .k { color: #79c0ff; } .tl-out .s { color: #a5d6a7; } .tl-out .n { color: #f2cc60; } .tl-out .b { color: #d2a8ff; }
.tl-out mark { background: rgba(240, 106, 82, .35); color: #fff; border-radius: 3px; padding: 0 1px; }
.tl-msg { font-size: 13px; margin-top: 8px; color: var(--ink-3); }
.tl-msg.ok { color: var(--lime); }
.tl-msg.bad { color: var(--red); }
.tl-btn { height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13.5px; font-weight: 600; color: var(--ink-2); transition: .2s; }
.tl-btn:hover { border-color: var(--ink); color: var(--ink); }
.tl-btn.pri { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tl-btn.pri:hover { background: var(--red); border-color: var(--red); color: var(--on-red); }
.tl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tl-kv { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.tl-kv small { font: 600 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.tl-kv b { font: 500 14px var(--font-mono); word-break: break-all; }
.tl-kv button { justify-self: start; font-size: 12px; font-weight: 600; color: var(--red); }
.shades { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 12px; }
.shades button { aspect-ratio: 1; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .2s var(--ease-spring); }
.shades button:hover { transform: scale(1.12); }
.pw-meter { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 10px; }
.pw-meter i { display: block; height: 100%; border-radius: 99px; transition: width .4s var(--ease-out), background .4s; }
.tl-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; }
.tl-chk input { accent-color: var(--red); }
.tl-range { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; font-size: 13.5px; }
.tl-range input { flex: 1; accent-color: var(--red); }

/* api */
.api { border-radius: 20px; overflow: hidden; background: #0f0d0b; border: 1px solid rgba(255,255,255,.08); box-shadow: var(--shadow-lg); padding: 14px; color: #e8dfcd; }
.api-req { display: flex; gap: 8px; align-items: stretch; }
.api-req select { height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: #1a1714; color: #7ee787; font: 700 13.5px var(--font-mono); }
.api-url { flex: 1; min-width: 0; display: flex; align-items: center; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: #1a1714; font: 400 13.5px var(--font-mono); }
.api-url span { color: #8b8070; white-space: nowrap; }
.api-url input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: #fff; font: inherit; }
.api-req .btn { height: 44px; }
.api-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.api-quick button { height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); font: 500 12px var(--font-mono); color: #bfb29a; transition: .2s; }
.api-quick button:hover { border-color: #f06a52; color: #fff; }
.api-quick b { margin-right: 6px; }
.m-GET { color: #7ee787; } .m-POST { color: #f2cc60; } .m-PATCH { color: #79c0ff; } .m-DELETE { color: #ff7b72; }
.api-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; }
.api-col { display: flex; flex-direction: column; min-width: 0; }
.api-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; font: 600 11.5px var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: #8b8070; }
.api-h small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.api textarea { min-height: 150px; resize: vertical; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); background: #1a1714; color: #efe4cc; font: 400 13px/1.6 var(--font-mono); outline: 0; margin-bottom: 12px; }
.api textarea:disabled { opacity: .45; }
.api-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 9px; background: #1a1714; }
.api-tabs button { height: 26px; padding: 0 10px; border-radius: 7px; font: 600 11.5px var(--font-mono); color: #8b8070; text-transform: none; letter-spacing: 0; }
.api-tabs button[aria-pressed="true"] { background: #2b2620; color: #fff; }
.api-code, .api-res { margin: 0; padding: 14px 16px; border-radius: 12px; background: #1a1714; border: 1px solid rgba(255,255,255,.06); font: 400 12.5px/1.65 var(--font-mono); color: #e8dfcd; white-space: pre-wrap; word-break: break-word; overflow: auto; }
.api-code { flex: 1; min-height: 120px; }
.api-res { flex: 1; min-height: 330px; max-height: 420px; }
.api-res .k { color: #79c0ff; } .api-res .s { color: #a5d6a7; } .api-res .n { color: #f2cc60; } .api-res .b { color: #d2a8ff; } .api-res .c { color: #6b604f; }
.api-status { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; min-height: 44px; padding: 10px 14px; border-radius: 12px; background: #1a1714; font: 500 13px var(--font-mono); color: #8b8070; margin-bottom: 8px; }
.api-status b { padding: 3px 10px; border-radius: 999px; }
.st-2 { background: rgba(126, 231, 135, .14); color: #7ee787; }
.st-4 { background: rgba(242, 204, 96, .14); color: #f2cc60; }
.st-5 { background: rgba(255, 123, 114, .14); color: #ff7b72; }
.api-copy { display: inline-flex; align-items: center; gap: 6px; color: #bfb29a; font: 500 12px var(--font-body); text-transform: none; letter-spacing: 0; }
.api-copy:hover { color: #fff; }
.api .spin { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: wdSpin .7s linear infinite; vertical-align: -2px; }
@keyframes wdSpin { to { transform: rotate(1turn); } }

/* git */
.git-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.git { padding: 0; overflow: hidden; }
.git-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.git-br { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font: 600 12.5px var(--font-mono); }
.git-log { position: relative; padding: 10px 0 14px; }
.git-log svg.gg { position: absolute; left: 0; top: 0; overflow: visible; }
.gc { position: relative; display: grid; grid-template-columns: var(--gw, 110px) minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 58px; padding: 6px 18px 6px 0; opacity: 0; transform: translateX(-10px); transition: opacity .5s var(--ease-out), transform .6s var(--ease-out); }
.gc.in { opacity: 1; transform: none; }
.gc:hover { background: rgba(var(--fx), .035); }
.gc p { font-size: 14.5px; line-height: 1.45; }
.gc p code { font: 600 12.5px var(--font-mono); color: var(--red); margin-right: 4px; }
.gc .gm { display: grid; justify-items: end; gap: 3px; font: 500 11.5px var(--font-mono); color: var(--ink-3); white-space: nowrap; }
.gc .tag { padding: 1px 8px; border-radius: 999px; background: var(--red); color: var(--on-red); font-weight: 700; }
.gc .tag.cy { background: var(--cyan); color: #fff; }
.gg .lane { fill: none; stroke-width: 3; stroke-linecap: round; }
.gg .dot { stroke-width: 3; }
.gg .dot.head { stroke-width: 4; }
.git-side { display: grid; gap: 16px; }
.heat { padding: 18px; }
.heat-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; font-size: 14px; color: var(--ink-2); }
.heat-h b { font: 800 26px var(--font-display); color: var(--ink); }
.heat-scroll { overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.heat-grid { display: grid; grid-template-rows: repeat(7, 10px); grid-auto-flow: column; grid-auto-columns: 10px; gap: 3px; width: max-content; }
.heat-grid i, .heat-leg i { width: 10px; height: 10px; border-radius: 3px; background: rgba(var(--fx), .07); transition: transform .15s; }
.heat-grid i:hover { transform: scale(1.5); outline: 1px solid var(--ink); }
.heat .l1 { background: rgba(196, 50, 29, .25); }
.heat .l2 { background: rgba(196, 50, 29, .45); }
.heat .l3 { background: rgba(196, 50, 29, .7); }
.heat .l4 { background: var(--red); }
.heat-f { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }
.heat-leg { display: inline-flex; align-items: center; gap: 3px; }
.heat-leg i { display: inline-block; }
.langs { padding: 18px; }
.lang-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; margin: 12px 0 14px; background: var(--line); }
.lang-bar i { display: block; height: 100%; width: 0; transition: width 1.2s var(--ease-out); }
.lang-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.lang-list li { display: flex; align-items: center; gap: 8px; }
.lang-list i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lang-list span { margin-left: auto; font: 500 12px var(--font-mono); color: var(--ink-3); }
.wd-cta { display: flex; align-items: center; gap: 16px; padding: 18px; }
.wd-cta p { color: var(--ink-2); font-size: 14px; margin: 4px 0 12px; }
.wd-slug { width: 110px; flex: none; }
.wd-slug svg { width: 100%; height: auto; }

@media (max-width: 1100px) {
  .wd-dock { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .git-wrap { grid-template-columns: minmax(0, 1fr); }
  .api-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .wd-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .pg-main { grid-template-columns: minmax(0, 1fr); height: auto; }
  .pg-ed { height: 320px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.06); }
  .pg-out { grid-template-rows: 340px 140px; }
  .tbx { grid-template-columns: minmax(0, 1fr); }
  .tbx-nav { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .tbx-nav button { flex: none; }
}
@media (max-width: 680px) {
  .wd-map { border-radius: 18px; margin: 0 -6px; }
  .wd-map-in { width: 860px; }
  .wd-dock { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .wd-dock a:last-child { grid-column: 1 / -1; }
  .term-body { height: 340px; font-size: 13px; }
  .term { font-size: 13px; }
  .term-ps b, .term-ps em { display: none; }
  .pg-preset span, .pg-auto { display: none; }
  .tbx-panel { padding: 18px 16px 20px; }
  .tl-grid { grid-template-columns: minmax(0, 1fr); }
  .api-req { flex-wrap: wrap; }
  .api-url { order: 3; flex-basis: 100%; }
  .api-url span { display: none; }
  .api-req .btn { margin-left: auto; }
  .gc { grid-template-columns: var(--gw, 80px) minmax(0, 1fr); }
  .gc .gm { grid-column: 2; justify-items: start; grid-auto-flow: column; gap: 8px; }
  .lang-list { grid-template-columns: minmax(0, 1fr); }
  .wd-cta { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .wd-cloud, .wd-boat, .wd-river, .lantern, .smoke circle, .fire path, .sparks circle { animation: none; }
  .gc { opacity: 1; transform: none; }
}

/* ===== v2 ===== */
@keyframes wdCloud2 { from { transform: translateX(-300px); } to { transform: translateX(1700px); } }
.wd-cloud { animation-name: wdCloud2; }
.wd-toad { left: 38.4%; width: 6.6%; }
.wd-stars circle { fill: #fff6dc; opacity: 0; }
.wd-moonshade { fill: var(--hero-top); opacity: 0; transition: opacity .6s; }
.wd-fireflies circle { fill: #ffe38a; opacity: 0; }
.w-arch path { fill: var(--ink); opacity: .85; }
.w-bars rect { fill: #7ee787; }
.w-keys rect { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.w-keys rect + rect { fill: var(--ink); stroke: none; }
.flag2 { animation: wdFlag 1.6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: left center; }
@keyframes wdFlag { to { transform: skewY(-6deg) scaleX(.9); } }
html[data-mode="ink"] .wd-sun { fill: #efe4cc; opacity: 1; filter: drop-shadow(0 0 18px rgba(239, 228, 204, .45)); }
html[data-mode="ink"] .wd-moonshade { opacity: 1; }
html[data-mode="ink"] .wd-stars circle { animation: wdTw 3s ease-in-out infinite; }
@keyframes wdTw { 0%, 100% { opacity: .15; } 50% { opacity: .95; } }
html[data-mode="ink"] .wd-fireflies circle { animation: wdFly 5s ease-in-out infinite; }
@keyframes wdFly { 0% { opacity: 0; transform: translate(0, 0); } 30% { opacity: .9; } 60% { opacity: .5; transform: translate(14px, -12px); } 100% { opacity: 0; transform: translate(-6px, -24px); } }
html[data-mode="ink"] .w-win { fill: #ffcf6b; filter: drop-shadow(0 0 8px rgba(255, 207, 107, .8)); }
html[data-mode="ink"] .wd-cloud { opacity: .12; }
html[data-mode="ink"] .w-wall { fill: #2a241e; }
.wd-dock { grid-template-columns: repeat(7, minmax(0, 1fr)); }

/* passport */
.passport { position: fixed; right: 18px; bottom: 18px; z-index: 60; }
.pp-pill { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px 0 6px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); transition: transform .3s var(--ease-spring); }
.pp-pill:hover { transform: translateY(-2px); }
.pp-pill b { font-family: var(--font-mono); }
.pp-seal { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--red); color: var(--on-red); font: 700 16px var(--font-jp); transform: rotate(-6deg); }
.pp-pill.bump { animation: ppBump .7s var(--ease-spring); }
@keyframes ppBump { 40% { transform: scale(1.15) rotate(-3deg); } }
.pp-card { position: absolute; right: 0; bottom: 56px; width: 300px; padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-lg); transform-origin: bottom right; transform: scale(.9) translateY(10px); opacity: 0; pointer-events: none; transition: transform .4s var(--ease-out), opacity .25s; }
.passport.open .pp-card { transform: none; opacity: 1; pointer-events: auto; }
.pp-h b { display: block; font-family: var(--font-display); font-size: 17px; }
.pp-h small { color: var(--ink-3); font-size: 12.5px; }
.pp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0 8px; }
.pp-st { display: grid; justify-items: center; gap: 4px; font-size: 10.5px; color: var(--ink-3); text-align: center; line-height: 1.2; }
.pp-st i { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; border: 1.5px dashed var(--line-2); font: 700 22px var(--font-jp); font-style: normal; color: var(--line-2); transition: .4s; }
.pp-st.on i { border: 2px solid var(--red); background: rgba(196, 50, 29, .08); color: var(--red); transform: rotate(-8deg); animation: ppStamp .5s var(--ease-spring); }
.pp-st.on { color: var(--ink); font-weight: 600; }
@keyframes ppStamp { from { transform: scale(1.8) rotate(-20deg); opacity: 0; } }
.pp-f { font-size: 12.5px; color: var(--ink-2); }

/* terminal ghost */
.term-field { position: relative; flex: 1; min-width: 0; display: flex; }
.term-field input { position: relative; z-index: 1; }
.term-ghost { position: absolute; left: 0; top: 0; bottom: 0; display: flex; align-items: center; white-space: pre; color: #5d5446; pointer-events: none; font: inherit; }
.term-body canvas { display: block; margin: 8px 0; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: #0b0a08; max-width: 100%; }
.t-bar { display: inline-block; height: 9px; border-radius: 2px; background: #7ee787; vertical-align: middle; }

/* playground highlighting */
.pg-box { position: relative; flex: 1; min-width: 0; }
.pg-box textarea, .pg-hl { position: absolute; inset: 0; margin: 0; padding: 14px 16px; font: 400 13px/1.7 var(--font-mono); tab-size: 2; white-space: pre; overflow: auto; border: 0; }
.pg-box textarea { width: 100%; height: 100%; color: transparent; background: transparent; caret-color: #f06a52; z-index: 1; -webkit-text-fill-color: transparent; }
.pg-hl { color: #efe4cc; background: #0f0d0b; pointer-events: none; overflow: hidden; }
.pg-hl .t { color: #f28b6c; } .pg-hl .a { color: #d2a8ff; } .pg-hl .s { color: #a5d6a7; } .pg-hl .c { color: #6b604f; font-style: italic; } .pg-hl .k { color: #79c0ff; } .pg-hl .n { color: #f2cc60; } .pg-hl .p { color: #ff9e64; } .pg-hl .f { color: #7ee787; }

/* toolbox search */
.tbx-side { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface-2); min-height: 0; }
.tbx-side .tbx-nav { border: 0; background: none; padding-top: 6px; max-height: 620px; overflow-y: auto; }
.tbx-search { display: flex; align-items: center; gap: 8px; margin: 14px 14px 0; padding: 0 12px; height: 40px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink-3); }
.tbx-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--ink); font: 400 14px var(--font-body); }
.tbx-nav button[hidden] { display: none; }
.tl-prev { height: 170px; border-radius: 14px; border: 1px solid var(--line); margin: 10px 0; }
.sh-stage { display: grid; place-items: center; height: 200px; border-radius: 14px; background: var(--bg-2); margin: 10px 0; }
.sh-card { width: 150px; height: 100px; border-radius: 16px; background: var(--surface); }
.tl-sl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.tl-sl label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tl-sl input[type=range] { flex: 1; accent-color: var(--red); }
.tl-sl output { min-width: 34px; font: 500 12px var(--font-mono); color: var(--ink-3); text-align: right; }
.md-out { padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); max-height: 320px; overflow: auto; font-size: 14.5px; }
.md-out h1, .md-out h2, .md-out h3 { font-family: var(--font-display); margin: 8px 0; }
.md-out code { font: .9em var(--font-mono); padding: 1px 5px; border-radius: 4px; background: var(--surface-2); }
.md-out blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--red); color: var(--ink-2); }
.md-out a { color: var(--red); text-decoration: underline; }
.diff { margin-top: 10px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); font: 400 13px/1.6 var(--font-mono); max-height: 320px; overflow-y: auto; }
.diff div { padding: 1px 12px; white-space: pre-wrap; word-break: break-word; }
.diff .add { background: rgba(77, 116, 36, .14); color: var(--lime); }
.diff .del { background: rgba(196, 50, 29, .12); color: var(--red); text-decoration: line-through; text-decoration-color: rgba(196, 50, 29, .4); }
.diff .same { color: var(--ink-3); }
.cron-h { font-family: var(--font-display); font-size: 20px; margin: 10px 0; }

/* api extras */
.api-opts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 14px; font: 500 12px var(--font-mono); color: #8b8070; }
.api-auth { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); cursor: pointer; color: #bfb29a; }
.api-auth input { accent-color: #d23c26; }
.api-hist-l { margin-left: 8px; text-transform: uppercase; letter-spacing: .08em; }
.api-hist { display: flex; gap: 6px; flex-wrap: wrap; }
.api-hist button { padding: 4px 8px; border-radius: 7px; background: #1a1714; border: 1px solid rgba(255,255,255,.06); color: #bfb29a; font: 500 11.5px var(--font-mono); }
.api-hist button:hover { border-color: #f06a52; }
.api-hist i { font-style: normal; margin-left: 6px; }

/* arena */
.ar { border-radius: 20px; overflow: hidden; background: #0f0d0b; border: 1px solid rgba(255,255,255,.08); box-shadow: var(--shadow-lg); color: #e8dfcd; }
.ar-tabs { display: flex; gap: 2px; padding: 8px; background: #1a1714; border-bottom: 1px solid rgba(255,255,255,.06); }
.ar-tabs button { height: 34px; padding: 0 16px; border-radius: 9px; font: 600 13px var(--font-body); color: #9d917d; }
.ar-tabs button[aria-selected="true"] { background: #2b2620; color: #fff; }
.ar-pane { display: none; }
.ar-pane.on { display: block; }
.ar-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 13px; color: #bfb29a; }
.ar-ctl label { display: flex; align-items: center; gap: 8px; }
.ar-ctl select { height: 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,.12); background: #1a1714; color: #efe4cc; padding: 0 8px; font: 500 13px var(--font-body); }
.ar-rng input { width: 110px; accent-color: #d23c26; }
.ar-rng b { min-width: 26px; font: 500 12px var(--font-mono); color: #efe4cc; }
.ar-b { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid rgba(255,255,255,.12); color: #bfb29a; font: 600 12.5px var(--font-body); transition: .2s; }
.ar-b:hover { color: #fff; border-color: #f06a52; }
.ar-b[aria-pressed="true"] { background: #2b2620; color: #fff; border-color: #f06a52; }
.ar-ctl .btn { margin-left: auto; }
.ar-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #1a1714; gap: 2px; }
.ar-seg button { height: 28px; padding: 0 10px; border-radius: 7px; font: 600 12px var(--font-body); color: #9d917d; }
.ar-seg button[aria-pressed="true"] { background: #2b2620; color: #fff; }
.ar-note { color: #9d917d; }
.ar-stage { height: 360px; padding: 16px 16px 0; }
.ar-stage.grid { padding: 12px; height: auto; }
.ar-stage canvas { display: block; width: 100%; border-radius: 10px; touch-action: none; cursor: crosshair; }
.bars { height: 100%; display: flex; align-items: flex-end; gap: 2px; }
.bars i { flex: 1; min-width: 1px; border-radius: 3px 3px 0 0; background: linear-gradient(#6fb3a8, #2c6f65); transition: height .08s linear; }
.bars i.c { background: #f2cc60; }
.bars i.w { background: #f06a52; }
.bars i.d { background: linear-gradient(#a9e4b0, #4d7424); }
.ar-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: center; padding: 12px 16px 14px; font-size: 13px; color: #9d917d; border-top: 1px solid rgba(255,255,255,.06); }
.ar-stats b { color: #efe4cc; font: 600 14px var(--font-mono); margin-left: 6px; }
.ar-bigo { margin-left: auto; font: 500 12px var(--font-mono); color: #bfb29a; }
.race { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px; }
.rc { padding: 10px 12px 12px; border-radius: 12px; background: #1a1714; border: 1px solid rgba(255,255,255,.06); }
.rc-h { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.rc-h em { font: 500 11.5px var(--font-mono); font-style: normal; color: #8b8070; }
.rc-h em.win { color: #7ee787; }
.rc .bars { height: 110px; gap: 1px; }
.rc .bars i { border-radius: 1px 1px 0 0; }
.rc-place { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #2b2620; color: #efe4cc; font: 700 11px var(--font-mono); margin-right: 6px; }
.rc.p1 { border-color: #f2cc60; box-shadow: 0 0 0 1px #f2cc60, 0 10px 30px -10px rgba(242,204,96,.5); }
.rc.p1 .rc-place { background: #f2cc60; color: #1a1714; }

/* typing dojo */
.ty-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.ty { position: relative; border-radius: 20px; overflow: hidden; background: #0f0d0b; border: 1px solid rgba(255,255,255,.08); box-shadow: var(--shadow-lg); color: #e8dfcd; }
.ty-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; background: #1a1714; border-bottom: 1px solid rgba(255,255,255,.06); }
.ty-langs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: #0f0d0b; }
.ty-langs button { height: 30px; padding: 0 12px; border-radius: 8px; font: 600 12.5px var(--font-mono); color: #9d917d; }
.ty-langs button[aria-pressed="true"] { background: #2b2620; color: #fff; }
.ty-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding: 12px 18px; font-size: 13px; color: #9d917d; position: relative; }
.ty-stats b { color: #efe4cc; font: 700 20px var(--font-mono); margin-left: 6px; }
.ty-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.05); }
.ty-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #d23c26, #f2cc60); transition: width .15s; }
.ty-code { position: relative; padding: 22px 24px 26px; min-height: 250px; font: 400 16px/1.8 var(--font-mono); white-space: pre-wrap; word-break: break-word; cursor: text; outline: none; }
.ty-code .ch { color: #5d5446; position: relative; }
.ty-code .ch.ok { color: #efe4cc; }
.ty-code .ch.bad { color: #ff7b72; background: rgba(255, 123, 114, .15); border-radius: 2px; }
.ty-code .ch.nl::after { content: "\21B5"; color: #3d352c; font-size: .8em; }
.ty-code .ch.cur::before { content: ""; position: absolute; left: -1px; top: 12%; bottom: 12%; width: 2px; background: #f06a52; animation: tyBlink 1s steps(1) infinite; }
.ty-code:not(.focus) .ch.cur::before { opacity: .35; animation: none; }
@keyframes tyBlink { 50% { opacity: 0; } }
.ty-code .hint { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15, 13, 11, .72); backdrop-filter: blur(3px); color: #efe4cc; font: 600 15px var(--font-body); border-radius: 0 0 20px 20px; transition: opacity .3s; }
.ty-code.act .hint { opacity: 0; pointer-events: none; }
.ty-in { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ty-res { position: absolute; inset: 52px 0 0; display: grid; place-items: center; background: rgba(15, 13, 11, .9); backdrop-filter: blur(6px); padding: 20px; animation: tyIn .5s var(--ease-out); }
@keyframes tyIn { from { opacity: 0; transform: scale(.97); } }
.ty-card { text-align: center; max-width: 520px; }
.ty-card .rank { display: inline-block; padding: 6px 16px; border-radius: 999px; background: #d23c26; color: #fff; font: 700 13px var(--font-body); letter-spacing: .08em; text-transform: uppercase; }
.ty-card h3 { font: 800 64px/1 var(--font-display); margin: 14px 0 4px; color: #fff; }
.ty-card h3 small { font-size: 20px; color: #9d917d; margin-left: 6px; }
.ty-card .row { display: flex; justify-content: center; gap: 24px; margin: 14px 0 18px; font-size: 13px; color: #9d917d; }
.ty-card .row b { display: block; font: 700 20px var(--font-mono); color: #efe4cc; }
.ty-card svg { width: 100%; height: 60px; margin-bottom: 14px; }
.ty-card .pb { color: #f2cc60; font-weight: 700; margin-bottom: 10px; }
.ty-board { padding: 18px; }
.ty-board ol { margin: 10px 0 16px; padding-left: 20px; font-size: 14px; display: grid; gap: 6px; }
.ty-board ol li span { color: var(--ink-3); font-size: 12.5px; margin-left: 6px; }
.ty-board .empty { color: var(--ink-3); list-style: none; margin-left: -20px; }
.ty-ranks { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.ty-ranks p { font: 700 11.5px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 2px; }
.ty-ranks span { display: flex; justify-content: space-between; }
.ty-ranks b { font-family: var(--font-mono); color: var(--ink-3); font-weight: 500; }

@media (max-width: 1100px) {
  .wd-dock { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ty-wrap { grid-template-columns: minmax(0, 1fr); }
  .race { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .tbx-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .tbx-side .tbx-nav { max-height: none; }
}
@media (max-width: 680px) {
  .wd-map-in { width: 1120px; }
  .wd-dock { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

  .passport { right: 12px; bottom: 84px; }
  .pp-pill { height: 42px; padding: 0 12px 0 4px; gap: 6px; }
  .pp-pill > span:last-child { font-size: 0; }
  .pp-pill b { font-size: 12.5px; }
  .pp-card { bottom: 50px; }
  .pp-card { width: min(300px, calc(100vw - 24px)); }
  .ar-stage { height: 260px; }
  .ar-ctl .btn { margin-left: 0; }
  .ar-bigo { margin-left: 0; width: 100%; }
  .race { grid-template-columns: minmax(0, 1fr); }
  .ty-code { font-size: 14px; padding: 16px; }
  .ty-card h3 { font-size: 48px; }
  .tl-sl { grid-template-columns: minmax(0, 1fr); }
}

/* =====================================================================
   Polish pass: fluid type, consistent control sizes, hover/press states,
   phone tap targets. Selectors are prefixed with `main` where they need to
   win over the shared phone.css (which loads after this file).
   ===================================================================== */
.wd-head .lead { max-width: 52ch; }
.wd-sec .h2 { font-size: clamp(30px, 4.3vw, 62px); }
.wd-sec .section-head .lead { max-width: 60ch; font-size: clamp(16px, 1.25vw + 10px, 19px); }
.tbx-panel h3 { font-size: clamp(18px, 1.2vw + 12px, 22px); }
.tbx-panel > .tl-p > p { color: var(--ink-3); font-size: clamp(13.5px, .3vw + 12.5px, 15px); line-height: 1.55; max-width: 64ch; margin-bottom: 14px; }

/* one control height for the dark consoles, scaled a touch with the viewport */
.wd-sec { --ctl: clamp(34px, 1.2vw + 26px, 38px); }
.ar-b, .ar-ctl select, .pg-preset select, .ar-tabs button { height: var(--ctl); }
.pg-ib { width: var(--ctl); height: var(--ctl); }
.tl-btn { height: var(--ctl); display: inline-flex; align-items: center; gap: 6px; }

/* smooth, quiet interaction states */
.term-chips button, .pg-tabs button, .pg-ib, .api-quick button, .api-tabs button, .api-hist button, .api-copy,
.ar-tabs button, .ar-seg button, .ar-b, .ty-langs button, .tl-btn, .tl-kv button, .tbx-nav button, #pgClr, .term-x, .wd-dock a, .pp-pill {
  transition: color .2s, background-color .2s, border-color .2s, box-shadow .2s, transform .18s var(--ease-out);
}
.term-chips button:active, .pg-tabs button:active, .pg-ib:active, .api-quick button:active, .api-tabs button:active, .api-hist button:active,
.ar-tabs button:active, .ar-seg button:active, .ar-b:active, .ty-langs button:active, .tl-btn:active, .tl-kv button:active, .tbx-nav button:active, .term-x:active { transform: scale(.96); }
.wd-dock a:active { transform: translateY(-1px) scale(.99); }
.pg-tabs button:hover, .ar-tabs button:hover, .ar-seg button:hover, .ty-langs button:hover, .api-tabs button:hover { color: #efe4cc; }
.pg-tabs button[aria-selected="true"]:hover, .ar-tabs button[aria-selected="true"]:hover { color: #fff; }
.term-chips button:hover, .api-quick button:hover { background: rgba(255, 255, 255, .04); }
.api-hist button:hover { color: #fff; }
.tl-kv button:hover { text-decoration: underline; text-underline-offset: 3px; }
#pgClr:hover { color: #fff; }
.wd-dock a { box-shadow: var(--shadow-sm); }
.wd-dock a:hover { box-shadow: var(--shadow); }
.wd-dock a:focus-visible, .tbx-nav button:focus-visible, .tl-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.dark-scope button:focus-visible, .dark-scope select:focus-visible { outline: 2px solid #f06a52; outline-offset: 2px; }

/* gradient type toggle inside the (light) toolbox */
.tl-seg { background: var(--bg-2); border: 1px solid var(--line); }
.tl-seg button { color: var(--ink-3); text-transform: capitalize; }
.tl-seg button:hover { color: var(--ink); }
.tl-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* toolbox search: empty state */
.tbx-none { padding: 10px 12px; font-size: 13px; color: var(--ink-3); }
.tbx-none[hidden] { display: none; }
.api-hist .c { color: #8b8070; }

/* git graph labels stay readable where they cross a lane */
.gg text { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }

/* pathfinding canvas sits centred in its stage */
.ar-stage canvas { margin-inline: auto; }
.term-body canvas { touch-action: none; }

/* typing dojo: the "click here" veil goes as soon as the field has focus */
.ty-code.focus .hint { opacity: 0; pointer-events: none; }
.ty-res { inset: 0; z-index: 2; }

/* heat map tooltip line never jumps the layout */
#heatTip { min-height: 1.4em; }

@media (max-width: 680px) {
  .term-ps b, .term-ps .term-host { display: none; }
  .term-ps em { display: inline; }
  .wd-sec .section-head .lead { font-size: 16px; }
  .api-status { font-size: 12px; gap: 6px 12px; }
  .ar-stats { gap: 6px 16px; }
  .ty-stats { gap: 6px 16px; padding: 12px 16px; }
  .ty-stats b { font-size: 18px; }
  .tl-range { min-width: 0; flex-basis: 100%; }
  .git-log .gc { gap: 10px; }
}

/* phones and other touch screens: 44px targets, 16px inputs (no iOS zoom) */
@media (max-width: 760px), (pointer: coarse) {
  main .term-chips button, main .pg-tabs button, main .api-quick button, main .api-tabs button, main .ar-tabs button,
  main .ar-b, main .ar-seg button, main .ty-langs button, main .tl-btn, main .tl-chk, main .api-auth, main .api-hist button,
  main .tbx-nav button, main .pg-preset select, main .ar-ctl select, main .api-req select, main .wd-sec .btn-sm { min-height: 44px; }
  main .pg-ib, main .term-x { width: 44px; height: 44px; }
  main .tl-kv button { min-height: 44px; margin: -10px 0 -12px; padding: 0 2px; }
  main .ar-rng input { height: 44px; }
  main .term-in input, main .api-url input, main .tl-in, main .tl-area, main .tbx-search input, main .api textarea { font-size: 16px; }
  main .tl-in { height: 46px; }
  main .tbx-search { height: 46px; }
  main .api-url, main .api-req select, main .api-req .btn { height: 48px; }
  .pp-pill { min-height: 44px; }
}
