html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
#paper {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(1200px 700px at 50% 40%, rgba(255, 244, 222, 0.55), transparent 70%),
    radial-gradient(circle at 20% 80%, rgba(160, 120, 70, 0.10), transparent 40%),
    var(--paper);
}
#paper::after {
  content: ""; position: absolute; inset: 0; opacity: 0.22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#world { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; touch-action: none; transition: filter 2.5s ease; cursor: grab; }
#world.placing { cursor: crosshair; }
#world:active { cursor: grabbing; }
#haze {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: 0.6; transition: opacity 2.5s ease;
  background:
    radial-gradient(ellipse 60% 45% at 50% 52%, rgba(196, 176, 150, 0.05), rgba(150, 138, 122, 0.55) 70%, rgba(120, 110, 100, 0.8)),
    linear-gradient(180deg, rgba(140, 130, 118, 0.45), rgba(170, 150, 128, 0.1) 60%, rgba(140, 130, 118, 0.35));
  animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift { from { background-position: 0 0, 0 0; transform: translateX(-1%); } to { transform: translateX(1%); } }
#night { position: fixed; inset: 0; z-index: 2; pointer-events: none; background: #1d2150; mix-blend-mode: multiply; opacity: 0; transition: opacity 4s ease; }
#rain { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
#ripple { position: fixed; left: 50%; top: 55%; width: 10px; height: 10px; z-index: 3; pointer-events: none; border-radius: 50%; border: 3px solid rgba(63, 143, 79, 0.6); transform: translate(-50%, -50%) scale(0); opacity: 0; }
#ripple.go { animation: ripple 2.2s ease-out; }
@keyframes ripple { 0% { transform: translate(-50%, -50%) scale(0); opacity: 0.9; } 100% { transform: translate(-50%, -50%) scale(220); opacity: 0; } }

.loading { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--paper); transition: opacity 0.4s; }
.loading .frame { padding: 24px 36px; text-align: center; }
.loading h2 { margin: 0 0 4px; font-size: 32px; }
.loading p { margin: 0; }
.loading.gone { opacity: 0; pointer-events: none; }

/* ---------------------------------------------------------------- HUD */
#hud { position: fixed; top: 0; left: 0; right: 0; z-index: 10; padding: calc(env(safe-area-inset-top) + 6px) 12px 0; pointer-events: none; }
#hud > * { pointer-events: auto; }
#landbar { position: relative; height: 18px; margin: 0 auto 8px; max-width: 640px; border: 2px solid var(--ink); background: var(--paper-2); clip-path: var(--notch); cursor: help; }
#landbar .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: repeating-linear-gradient(90deg, var(--leaf-2) 0 6px, var(--leaf) 6px 8px); transition: width 0.6s ease; }
#landbar .label { position: relative; display: block; text-align: center; font: 600 11px/14px var(--head); color: var(--ink); text-shadow: 0 0 3px var(--paper-2), 0 0 2px var(--paper-2); }
#hud .row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px; pointer-events: none; }
#hud .row > * { pointer-events: auto; }
.badge { appearance: none; cursor: pointer; border: 2px solid var(--ink); padding: 8px 12px 9px; text-align: left; display: grid; gap: 1px; min-width: 116px; }
.badge:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
#aqiBtn { justify-self: start; border-left: 8px solid var(--aqi-severe); }
#aqiBtn .aqi-num { font-size: 26px; line-height: 1; }
#aqiBtn .aqi-band { font: 600 12px/1.2 var(--head); text-transform: uppercase; letter-spacing: 0.05em; }
#aqiBtn .aqi-delta { font-size: 11px; color: var(--ink-2); }
#aqiBtn.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.05); } }
#seedBtn { justify-self: center; display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; text-align: left; min-width: 150px; }
#seedBtn .seed-icon { grid-row: span 2; width: 22px; height: 26px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 13' shape-rendering='crispEdges'%3E%3Cpath fill='%233d3a6b' d='M4 0h3v1h1v1h1v2h1v5h-1v2H8v1H7v1H4v-1H3v-1H2V9H1V4h1V2h1V1h1z'/%3E%3Cpath fill='%23b5793a' d='M4 1h3v1h1v2h1v5H8v2H7v1H4v-1H3V9H2V4h1V2h1z'/%3E%3Cpath fill='%23e0a65c' d='M4 2h2v1H5v3H4V5H3V4h1z'/%3E%3C/svg%3E") center/contain no-repeat; image-rendering: pixelated; }
#seedBtn.bump .seed-icon { animation: bump 0.35s ease; }
@keyframes bump { 40% { transform: translateY(-4px) scale(1.15); } }
#seedBtn .seed-num { font-size: 24px; line-height: 1; }
#seedBtn .seed-rate { font-size: 11px; color: var(--ink-2); }
#jungleBtn { justify-self: end; text-align: right; }
#jungleBtn .tree-num { font-size: 24px; line-height: 1; }
#jungleBtn .tree-label, #jungleBtn .species-num { font-size: 11px; color: var(--ink-2); }
#eventToast { margin: 8px auto 0; width: max-content; max-width: 92vw; padding: 7px 14px; font: 600 13px var(--head); text-align: center; }

.panel { position: fixed; z-index: 11; top: calc(env(safe-area-inset-top) + 100px); width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 190px); overflow: auto; padding: 16px 18px; font-size: 13px; touch-action: pan-y; user-select: text; }
.panel.left { left: 12px; }
.panel.right { right: 12px; }
.panel.centre { left: 50%; transform: translateX(-50%); }
.panel h3 { margin: 0 0 8px; font-size: 17px; }
.panel h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.panel table { width: 100%; border-collapse: collapse; }
.panel td { padding: 3px 0; border-bottom: 1px dotted var(--ink-soft); }
.panel td:last-child { text-align: right; font-family: var(--head); }
.bandscale { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; margin: 6px 0 2px; }
.bandscale div { height: 22px; font: 600 9px/22px var(--head); color: #fff; text-align: center; overflow: hidden; white-space: nowrap; opacity: 0.55; }
.bandscale div.on { opacity: 1; outline: 2px solid var(--ink); outline-offset: 1px; }
.bar { height: 10px; background: var(--paper-3); position: relative; margin: 2px 0 6px; }
.bar > i { position: absolute; inset: 0 auto 0 0; }
.note { font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.linkish { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: var(--ink); font: inherit; }

/* ---------------------------------------------------------------- bottom controls */
#leftNav { position: fixed; z-index: 10; left: 12px; bottom: calc(env(safe-area-inset-bottom) + 14px); display: flex; gap: 6px; flex-wrap: wrap; max-width: 40vw; }
#leftNav .nav { position: relative; display: inline-flex; align-items: center; gap: 6px; }
#leftNav .dot { position: absolute; top: 2px; right: 2px; width: 9px; height: 9px; background: var(--ember); border: 2px solid var(--paper-2); }
.ic { width: 16px; height: 16px; display: inline-block; image-rendering: pixelated; background: center/contain no-repeat; }
.ic-mandi { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%233d3a6b' d='M0 2h8v1H0zM1 0h6v2H1zM1 3h1v5H1zM6 3h1v5H6zM2 5h4v1H2z'/%3E%3C/svg%3E"); }
.ic-book { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%233d3a6b' d='M0 1h3v1h1v6H3V7H0zM4 2h1V1h3v6H5v1H4z'/%3E%3Cpath fill='%23e8cda8' d='M1 2h2v4H1zM5 2h2v4H5z'/%3E%3C/svg%3E"); }
.ic-star { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%233d3a6b' d='M3 0h2v2h3v2H7v1h1v3H6V7H2v1H0V5h1V4H0V2h3z'/%3E%3C/svg%3E"); }
.ic-gear { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges'%3E%3Cpath fill='%233d3a6b' d='M3 0h2v1h1v1h1v1h1v2H7v1H6v1H5v1H3V7H2V6H1V5H0V3h1V2h1V1h1z'/%3E%3Cpath fill='%23f1dcbc' d='M3 3h2v2H3z'/%3E%3C/svg%3E"); }
#plantBtn { position: fixed; z-index: 10; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 14px); transform: translateX(-50%); font-size: 19px; padding: 14px 30px; }
#plantBtn.glow { animation: glow 1.2s ease-in-out infinite; }
@keyframes glow { 50% { filter: drop-shadow(0 0 10px rgba(201, 138, 26, 0.9)); } }
#zoomCtl { position: fixed; z-index: 10; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 14px); display: grid; justify-items: end; gap: 6px; }
#zoomCtl .zbtns { display: flex; gap: 4px; }
#zoomCtl .zbtns .btn { min-width: 40px; }
#minimap { width: 180px; height: 110px; border: 2px solid var(--ink); background: var(--paper-2); clip-path: var(--notch); cursor: pointer; }
#modeBar { position: fixed; z-index: 12; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 84px); padding: 10px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; font: 600 14px var(--head); max-width: calc(100vw - 24px); }
#modeBar .mix { display: flex; gap: 8px; flex-wrap: wrap; font: 500 12px var(--body); }
#modeBar .mix label { display: grid; gap: 2px; }
#modeBar input[type=range] { width: 90px; accent-color: var(--ink); }

/* ---------------------------------------------------------------- guide */
#guide { position: fixed; z-index: 15; left: 12px; bottom: calc(env(safe-area-inset-bottom) + 76px); display: flex; align-items: flex-end; gap: 4px; max-width: min(520px, calc(100vw - 24px)); pointer-events: none; }
#guide > * { pointer-events: auto; }
#dhanesh { width: 120px; height: 96px; image-rendering: auto; flex: none; }
#guide .speech { padding: 12px 14px 12px; font-size: 14px; line-height: 1.45; position: relative; }
#guide .speech p { margin: 0 0 8px; }
#guide .acts { display: flex; gap: 6px; flex-wrap: wrap; }
#guide.top { bottom: auto; top: calc(env(safe-area-inset-top) + 108px); }

/* ---------------------------------------------------------------- toasts */
#toasts { position: fixed; z-index: 40; top: calc(env(safe-area-inset-top) + 104px); left: 50%; transform: translateX(-50%); display: grid; gap: 6px; justify-items: center; pointer-events: none; width: min(420px, 92vw); }
.toast { padding: 9px 14px; font: 600 14px var(--head); animation: tin 0.3s ease, tout 0.4s ease forwards; animation-delay: 0s, var(--life, 3s); display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.toast.big { font-size: 18px; padding: 14px 20px; }
.toast .ico { width: 24px; height: 24px; }
@keyframes tin { from { transform: translateY(-8px); opacity: 0; } }
@keyframes tout { to { transform: translateY(-8px); opacity: 0; } }

/* ---------------------------------------------------------------- sheet */
.sheet { position: fixed; z-index: 20; left: 50%; bottom: 0; transform: translateX(-50%); width: min(980px, 100vw); max-height: min(78dvh, 640px); overflow: auto; padding: 18px 18px calc(env(safe-area-inset-bottom) + 18px); animation: up 0.25s ease; touch-action: pan-y; }
@keyframes up { from { transform: translate(-50%, 30px); opacity: 0; } }
.sheet header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.sheet h2 { margin: 0; font-size: 22px; }
.close { appearance: none; border: 2px solid var(--ink); background: var(--paper-2); width: 36px; height: 36px; cursor: pointer; font: 700 18px var(--head); clip-path: var(--notch); flex: none; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cat { position: relative; cursor: pointer; padding: 12px 12px 10px; display: grid; gap: 6px; align-content: start; text-align: left; border: 2px solid var(--ink); background: var(--paper-2); clip-path: var(--notch); box-shadow: inset 0 0 0 3px var(--paper-2), inset 0 0 0 4px var(--ink-soft); }
.cat:hover:not(.off) { background: #f7e8cf; }
.cat.sel, .cat.suggest { box-shadow: inset 0 0 0 3px var(--paper-2), inset 0 0 0 5px var(--gold); }
.cat.off { opacity: 0.5; cursor: not-allowed; }
.cat h3 { margin: 0; font-size: 15px; }
.cat .cost { font: 700 18px var(--head); display: flex; align-items: center; gap: 5px; }
.cat .cost::before { content: ""; width: 12px; height: 14px; background: inherit; }
.cat .meta { font-size: 11.5px; color: var(--ink-2); line-height: 1.4; }
.cat .need { font: 600 11px var(--head); color: var(--ember); }
.cat .pool { display: flex; flex-wrap: wrap; gap: 2px; }
.cat .acts { display: flex; gap: 4px; flex-wrap: wrap; }
.odds { display: grid; gap: 2px; font-size: 11px; }
.odds div { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.odds b { font: 600 11px var(--head); min-width: 76px; }
.mini-sprite { display: inline-block; background-repeat: no-repeat; flex: none; }
.mini-sprite.sil { filter: brightness(0) opacity(0.28); }
.tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 2px dotted var(--ink-soft); align-items: center; }
.tools .lbl { font: 600 13px var(--head); margin-right: 4px; }

.starter { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.starter .cat { gap: 4px; }
.starter .art { height: 96px; display: grid; place-items: end center; }
.starter .fact { font-size: 12px; line-height: 1.4; }

/* ---------------------------------------------------------------- modal */
#modalWrap { position: fixed; inset: 0; z-index: 25; display: grid; place-items: center; background: rgba(40, 36, 70, 0.35); padding: 12px; }
#modal { width: min(480px, 100%); max-height: calc(100dvh - 24px); overflow: auto; padding: 18px 20px; position: relative; touch-action: pan-y; user-select: text; }
#modal.wide { width: min(900px, 100%); }
#modal header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
#modal h2 { margin: 0; font-size: 22px; line-height: 1.15; }
#modal .sub { font-size: 13px; color: var(--ink-2); margin-top: 2px; font-style: italic; }

/* tree card */
.card-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0 4px; }
.dex { font: 700 13px var(--head); color: var(--ink-2); }
.rar { font: 600 11px var(--head); padding: 3px 7px; border: 2px solid var(--ink); text-transform: uppercase; letter-spacing: 0.04em; }
.rar.regional { background: var(--gold); color: #fff; border-color: #8a5d10; }
.rar.common { background: #dbe7c4; }
.rar.very-common { background: var(--paper-3); }
.art-box { position: relative; height: 190px; display: grid; place-items: end center; background: radial-gradient(ellipse at 50% 85%, rgba(61, 58, 107, 0.08), transparent 60%); border: 2px dotted var(--ink-soft); margin: 8px 0; overflow: hidden; }
.art-box canvas { image-rendering: auto; }
.art-box img.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art-box .ptoggle { position: absolute; right: 6px; top: 6px; z-index: 2; }
.art-box .credit { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; font-size: 10.5px; background: rgba(241, 220, 188, 0.9); padding: 3px 6px; }
.flavor { font-style: italic; font-size: 14px; line-height: 1.45; margin: 4px 0 10px; }
.yours { border: 2px solid var(--ink); padding: 10px 12px; margin: 10px 0; background: var(--paper); }
.yours h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }
.yours .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: 12.5px; }
.yours .grid b { font-family: var(--head); font-weight: 600; }
.yours input { font: 600 14px var(--head); color: var(--ink); background: var(--paper-2); border: 2px solid var(--ink); padding: 4px 6px; width: 100%; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); margin-top: 12px; }
.tabs button { appearance: none; border: 2px solid var(--ink); border-bottom: 0; background: var(--paper); padding: 6px 10px; font: 600 13px var(--head); cursor: pointer; margin-bottom: -2px; }
.tabs button[aria-selected=true] { background: var(--paper-2); border-bottom: 2px solid var(--paper-2); }
.tabbody { padding: 12px 2px 4px; font-size: 13.5px; line-height: 1.55; }
.tabbody p { margin: 0 0 8px; }
.tabbody ul { margin: 0 0 8px; padding-left: 18px; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; margin: 6px 0 10px; }
.months div { text-align: center; font: 600 10px var(--head); padding: 4px 0; border: 1px solid var(--ink-soft); position: relative; }
.months .fl { background: #f2b6d4; }
.months .fr { box-shadow: inset 0 -6px 0 #e08a1f; }
.months .now { outline: 2px solid var(--ink); }
.legend { font-size: 11px; display: flex; gap: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 4px; vertical-align: -1px; }
.names { width: 100%; border-collapse: collapse; }
.names td { padding: 5px 4px; border-bottom: 1px dotted var(--ink-soft); }
.names td:first-child { font: 600 12px var(--head); color: var(--ink-2); width: 30%; }
.names .script { font-size: 16px; }
.cardfoot { margin-top: 10px; font-size: 11.5px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.navarrows { display: flex; gap: 6px; }

/* reveal */
.reveal { text-align: center; perspective: 800px; }
.reveal .flip { animation: flip 0.7s ease; transform-style: preserve-3d; }
@keyframes flip { 0% { transform: rotateY(90deg) scale(0.9); } 100% { transform: none; } }
.reveal .banner { font: 700 20px var(--head); color: var(--paper-2); background: var(--leaf); padding: 6px 12px; display: inline-block; margin-bottom: 8px; clip-path: var(--notch); }
.reveal .banner.rare { background: var(--gold); }

/* mandi */
.chalk { background: #2f3a33; color: #f3efe3; padding: 12px; border: 6px solid #7a5a36; box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.35); font-family: var(--head); }
.chalk table { width: 100%; border-collapse: collapse; font-size: 13px; }
.chalk th { text-align: left; font-weight: 500; opacity: 0.75; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px; border-bottom: 1px dashed rgba(243, 239, 227, 0.4); }
.chalk td { padding: 5px 4px; border-bottom: 1px dashed rgba(243, 239, 227, 0.18); vertical-align: middle; }
.chalk .item { display: flex; align-items: center; gap: 6px; }
.chalk .up { color: #9be28a; } .chalk .down { color: #ff9b8a; }
.chalk .btn.small { background: #f3efe3; color: #2f3a33; }
.chalk .q { display: flex; gap: 3px; flex-wrap: wrap; }
.chalk svg { display: block; }
.chalk .dim { opacity: 0.45; }
.chalk .gold { color: #ffd76a; }
.orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.order { padding: 12px; font-size: 13px; }
.order h4 { margin: 0; font-size: 15px; }
.order .who { font-size: 12px; color: var(--ink-2); }
.order ul { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.order li { display: flex; align-items: center; gap: 6px; }
.order li.ok { color: var(--leaf); }
.order .pay { font: 700 15px var(--head); }
.icon16 { display: inline-block; width: 20px; height: 20px; background-repeat: no-repeat; flex: none; }
.segs { display: flex; gap: 4px; margin: 10px 0; flex-wrap: wrap; }
.segs button[aria-pressed=true] { background: var(--ink); color: var(--paper-2); }

/* almanac */
.alm { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.alm button { appearance: none; cursor: pointer; border: 2px solid var(--ink); background: var(--paper-2); padding: 6px 6px 8px; display: grid; justify-items: center; gap: 2px; clip-path: var(--notch); text-align: center; font-size: 11px; }
.alm button .n { font: 600 12px var(--head); }
.alm button .h { font-size: 10.5px; color: var(--ink-2); line-height: 1.3; }
.alm .art { height: 74px; display: grid; place-items: end center; }
.alm button.locked { background: var(--paper); cursor: default; }
.ach { display: grid; gap: 8px; }
.ach div { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 2px solid var(--ink); background: var(--paper); }
.ach div.got { background: #e4ecc8; }
.ach .medal { width: 30px; height: 30px; flex: none; display: grid; place-items: center; font: 700 16px var(--head); border: 2px solid var(--ink); background: var(--paper-3); }
.ach div.got .medal { background: var(--gold); color: #fff; }
.ngos { display: grid; gap: 8px; }
.ngos a { display: block; padding: 10px 12px; border: 2px solid var(--ink); background: var(--paper); text-decoration: none; }
.ngos a b { font-family: var(--head); font-size: 15px; }
.ngos a span { display: block; font-size: 12px; color: var(--ink-2); }
.form { display: grid; gap: 10px; }
.form label { display: grid; gap: 4px; font: 600 13px var(--head); }
.form input[type=text] { font: 600 15px var(--head); color: var(--ink); background: var(--paper); border: 2px solid var(--ink); padding: 8px; }
.row-btns { display: flex; gap: 6px; flex-wrap: wrap; }

body.onboarding .onb-hide { display: none !important; }
body.ui-hidden #hud, body.ui-hidden #leftNav, body.ui-hidden #zoomCtl, body.ui-hidden #plantBtn { opacity: 0; pointer-events: none; }

@media (max-width: 680px) {
  #hud { padding-left: 8px; padding-right: 8px; }
  .badge { min-width: 0; padding: 6px 8px 7px; }
  #aqiBtn .aqi-num, #seedBtn .seed-num, #jungleBtn .tree-num { font-size: 19px; }
  #seedBtn { min-width: 0; column-gap: 5px; }
  #seedBtn .seed-icon { width: 16px; height: 20px; }
  #aqiBtn .aqi-band, #jungleBtn .species-num { font-size: 10px; }
  #landbar { height: 16px; margin-bottom: 6px; }
  #landbar .label { font-size: 10px; line-height: 12px; }
  .panel { left: 8px !important; right: 8px !important; width: auto; transform: none !important; top: calc(env(safe-area-inset-top) + 92px); max-height: calc(100dvh - 180px); animation: down 0.22s ease; }
  @keyframes down { from { transform: translateY(-14px); opacity: 0; } }
  #leftNav { bottom: calc(env(safe-area-inset-bottom) + 74px); max-width: none; }
  #leftNav .nav { font-size: 12px; padding: 8px 10px; }
  #leftNav .lbl { display: none; }
  #leftNav .ic { width: 18px; height: 18px; }
  #plantBtn { font-size: 16px; padding: 12px 22px; }
  #zoomCtl { bottom: calc(env(safe-area-inset-bottom) + 74px); }
  #minimap { width: 130px; height: 80px; }
  #guide { bottom: calc(env(safe-area-inset-bottom) + 124px); }
  #dhanesh { width: 84px; height: 68px; }
  #guide .speech { font-size: 13px; padding: 10px 12px; }
  #modeBar { bottom: calc(env(safe-area-inset-bottom) + 124px); }
  #modalWrap { padding: 0; place-items: stretch; }
  #modal, #modal.wide { width: 100%; max-height: 100dvh; height: 100dvh; clip-path: none; border: 0; box-shadow: none; padding: calc(env(safe-area-inset-top) + 14px) 14px calc(env(safe-area-inset-bottom) + 20px); }
  .sheet { max-height: 84dvh; padding: 14px 12px calc(env(safe-area-inset-bottom) + 14px); }
  .cats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cat { padding: 10px; }
  .chalk { padding: 8px; border-width: 4px; }
  .chalk .hide-m { display: none; }
}
