/* game.css — HUD, panels and screens for the 3D mission. Navy glass over the 3D world. */
:root {
  --navy-950: #0B0E2C; --navy-900: #0F1338; --navy-800: #151B48; --navy-700: #1E2452; --navy-600: #2A3168;
  --purple: #4B2BB8; --violet: #6B4FD8; --violet-2: #8C74F2; --lav: #BFB3F2; --lav-2: #E6E0FF; --white: #FFFFFF;
  --gold: #E8B54A; --gold-2: #F6D27A; --mint: #7FE0B0; --rose: #F49AA8; --cyan: #7FEBFF;
  --text: #F6F4FF; --muted: #B9B2DE; --dim: #8A84B8;
  --glass: rgba(18, 22, 62, .74); --glass-2: rgba(14, 17, 50, .9); --line: rgba(191, 179, 242, .22); --line-2: rgba(191, 179, 242, .4);
  --r: 18px; --r-lg: 24px; --shadow: 0 18px 50px -18px rgba(8, 8, 40, .7), 0 2px 0 rgba(255, 255, 255, .04) inset;
  --f-head: "Mitr", "IBM Plex Sans Thai", "Noto Sans Thai", Tahoma, sans-serif;
  --f-body: "IBM Plex Sans Thai", "Noto Sans Thai", Tahoma, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
}
html { font-size: 16px; }
html.big-text { font-size: 18.5px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #CFC5F0; color: var(--text); font-family: var(--f-body); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; border-radius: 10px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { display: inline-flex; line-height: 0; }
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 600; margin: 0; letter-spacing: .01em; }
p { margin: 0; line-height: 1.65; }

#world { position: fixed; inset: 0; background: linear-gradient(#2A2F7A, #8C7BDA 55%, #D3CAF4); }
.world-canvas { display: block; width: 100%; height: 100%; }

/* ---------- glass + buttons ---------- */
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .06); font-family: var(--f-head); font-weight: 500; font-size: .98rem; transition: transform .15s, background .15s, box-shadow .15s, opacity .15s; }
.btn:hover { background: rgba(255, 255, 255, .12); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-primary { border: 0; background: linear-gradient(135deg, #8C74F2, #5B3BD6 60%, #4B2BB8); box-shadow: 0 10px 26px -10px rgba(107, 79, 216, .9), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-primary:hover { background: linear-gradient(135deg, #9B86F6, #6647E0 60%, #5434C6); }
.btn-gold { border: 0; color: #2A1E05; background: linear-gradient(135deg, #F8DB8A, #E8B54A); box-shadow: 0 10px 26px -12px rgba(232, 181, 74, .9), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .88rem; }
.btn-icon { width: 44px; padding: 0; }
.btn-danger { border-color: rgba(244, 154, 168, .6); color: #FFD3DA; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); font-size: .88rem; }
.chip[aria-pressed="true"] { background: rgba(140, 116, 242, .35); border-color: var(--violet-2); }
.chip.gold { border-color: rgba(232, 181, 74, .6); color: var(--gold-2); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; background: rgba(191, 179, 242, .16); color: var(--lav-2); }
.tag.gold { background: rgba(232, 181, 74, .18); color: var(--gold-2); }
.tag.mint { background: rgba(127, 224, 176, .16); color: var(--mint); }
.kbd { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 8px; background: #fff; color: var(--navy-700); font-family: var(--f-head); font-weight: 600; font-size: .85rem; box-shadow: 0 2px 0 #BFB3F2; }
textarea, input[type=text] { width: 100%; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(6, 8, 30, .45); padding: 12px 14px; line-height: 1.6; resize: vertical; }
textarea:focus, input[type=text]:focus { outline: none; border-color: var(--violet-2); box-shadow: 0 0 0 3px rgba(140, 116, 242, .3); }
::placeholder { color: var(--dim); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
#hud > .dialogue.off, #hud > .zone-banner.off { pointer-events: none; }
#hud.hidden, .hidden { display: none !important; }
.profile { position: absolute; left: 16px; top: calc(16px + var(--safe-t)); display: flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 999px; }
.profile .portrait { width: 52px; height: 52px; }
.portrait { display: inline-block; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 35%, #EDE8FF, #BFB3F2); box-shadow: 0 0 0 2px var(--violet-2), 0 0 0 4px rgba(232, 181, 74, .55); flex: none; }
.portrait svg { width: 100%; height: 100%; display: block; }
.profile .who { display: grid; gap: 4px; min-width: 150px; }
.profile .name { font-family: var(--f-head); font-weight: 600; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.lv { font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: linear-gradient(135deg, #F8DB8A, #E8B54A); color: #2A1E05; font-family: var(--f-head); font-weight: 600; }
.xpbar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.xpbar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, #8C74F2, #F6D27A); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.xptext { font-size: .74rem; color: var(--muted); }

.edp { position: absolute; left: 50%; top: calc(16px + var(--safe-t)); transform: translateX(-50%); padding: 6px; border-radius: 999px; }
.edp ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.edp button { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px 0 6px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font-family: var(--f-head); font-size: .86rem; }
.edp .n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .08); font-size: .78rem; }
.edp .locked .n { color: var(--dim); }
.edp .active button { background: linear-gradient(135deg, #8C74F2, #5B3BD6); color: #fff; box-shadow: 0 6px 18px -6px rgba(140, 116, 242, .9); }
.edp .active .n { background: #fff; color: var(--purple); }
.edp .done .n { background: var(--mint); color: #0E3B29; }
.edp .done button { color: var(--mint); }
.edp .label-th { color: inherit; opacity: .85; font-family: var(--f-body); font-size: .76rem; }

.hud-buttons { position: absolute; right: 16px; top: calc(16px + var(--safe-t)); display: flex; gap: 8px; padding: 6px; border-radius: 999px; }
.hbtn { position: relative; display: grid; justify-items: center; gap: 1px; width: 58px; padding: 6px 0 4px; border: 0; border-radius: 16px; background: transparent; color: var(--lav-2); font-size: .68rem; font-family: var(--f-head); }
.hbtn:hover { background: rgba(255, 255, 255, .1); }
.hbtn .count { position: absolute; top: 2px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--gold); color: #2A1E05; font-size: .68rem; display: grid; place-items: center; }

.tracker { position: absolute; right: 16px; top: calc(96px + var(--safe-t)); width: 300px; padding: 14px 16px 12px; }
.tracker .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tracker .kicker { font-size: .72rem; color: var(--gold-2); font-family: var(--f-head); letter-spacing: .04em; }
.tracker h2 { font-size: 1.1rem; margin-top: 2px; }
.tracker .toggle { border: 0; background: rgba(255, 255, 255, .08); width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; }
.tracker ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.tracker.collapsed ol, .tracker.collapsed .tracker-foot { display: none; }
.obj { width: 100%; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 8px 8px; border-radius: 12px; border: 1px solid transparent; background: rgba(255, 255, 255, .04); text-align: left; font-size: .88rem; }
.obj:hover { border-color: var(--line-2); }
.obj .box { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--lav); display: grid; place-items: center; }
.obj.done .box { background: var(--mint); border-color: var(--mint); color: #0E3B29; }
.obj.done .lbl { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(185, 178, 222, .5); }
.obj.current { border-color: rgba(232, 181, 74, .55); background: rgba(232, 181, 74, .08); }
.obj.locked { opacity: .55; }
.obj .cnt { font-family: var(--f-head); font-size: .8rem; color: var(--gold-2); }
.obj .bar { grid-column: 2 / 4; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.obj .bar i { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .5s; }
.tracker-foot { margin-top: 10px; font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }

.minimap { position: absolute; left: 16px; bottom: calc(16px + var(--safe-b)); width: 184px; padding: 8px; border-radius: 24px; cursor: pointer; border: 1px solid var(--line); }
.minimap canvas { display: block; width: 168px; height: 168px; border-radius: 18px; }
.minimap .zone { margin: 6px 4px 0; font-size: .78rem; font-family: var(--f-head); display: flex; justify-content: space-between; color: var(--lav-2); }

.dialogue { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); width: min(660px, calc(100% - 470px)); min-height: 96px; padding: 14px 18px 14px 92px; border-radius: var(--r-lg); background: var(--glass-2); transition: opacity .25s, transform .25s; }
.dialogue.off { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
.dialogue .nova-face { position: absolute; left: 12px; top: -18px; width: 70px; height: 70px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); }
.nova-face { display: inline-block; flex: none; }
.nova-face svg { width: 100%; height: 100%; display: block; }
.dialogue .who { font-family: var(--f-head); color: var(--gold-2); font-size: .85rem; display: flex; align-items: center; gap: 8px; }
.dialogue .txt { font-size: 1.02rem; margin-top: 2px; min-height: 1.6em; }
.dialogue .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
.dialogue .acts:empty { display: none; }
.dialogue .x { position: absolute; right: 8px; top: 8px; border: 0; background: transparent; color: var(--muted); width: 32px; height: 32px; border-radius: 10px; }
.prompt { position: absolute; left: 50%; bottom: calc(132px + var(--safe-b)); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px 0 8px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .94); color: var(--navy-700); font-family: var(--f-head); font-weight: 500; box-shadow: 0 12px 28px -10px rgba(10, 10, 50, .6); animation: bob 1.8s ease-in-out infinite; }
.prompt.lift { bottom: calc(18px + var(--safe-b)); }
.prompt .kbd { background: var(--violet); color: #fff; box-shadow: 0 2px 0 var(--purple); }
@keyframes bob { 50% { transform: translate(-50%, -4px); } }

.br { position: absolute; right: 16px; bottom: calc(16px + var(--safe-b)); display: grid; justify-items: end; gap: 10px; }
.view-ctrls { display: flex; gap: 6px; padding: 5px; border-radius: 999px; }
.view-ctrls button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .08); display: grid; place-items: center; }
.view-ctrls button:hover { background: rgba(255, 255, 255, .16); }
.ask-nova { display: inline-flex; align-items: center; gap: 10px; height: 60px; padding: 0 22px 0 8px; border-radius: 999px; border: 0; background: linear-gradient(135deg, #8C74F2, #5B3BD6 55%, #4B2BB8); font-family: var(--f-head); font-weight: 500; font-size: 1.02rem; box-shadow: 0 14px 30px -12px rgba(91, 59, 214, .95), inset 0 1px 0 rgba(255, 255, 255, .3); }
.ask-nova .nova-face { width: 46px; height: 46px; background: rgba(255, 255, 255, .15); border-radius: 50%; padding: 3px; }
.ask-nova .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold-2); box-shadow: 0 0 0 4px rgba(246, 210, 122, .25); }

.zone-banner { position: absolute; left: 50%; top: calc(76px + var(--safe-t)); transform: translateX(-50%); padding: 8px 18px; border-radius: 999px; font-family: var(--f-head); font-size: .95rem; display: flex; gap: 8px; align-items: center; transition: opacity .4s, transform .4s; }
.zone-banner.off { opacity: 0; transform: translate(-50%, -8px); pointer-events: none; }
.tip { position: fixed; z-index: 40; pointer-events: none; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .95); color: var(--navy-700); font-family: var(--f-head); font-size: .85rem; box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .5); transform: translate(14px, -36px); white-space: nowrap; }
#toasts { position: fixed; left: 50%; top: calc(124px + var(--safe-t)); transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: rgba(255, 255, 255, .96); color: var(--navy-700); font-family: var(--f-head); font-weight: 500; font-size: .92rem; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .5); animation: tin .35s cubic-bezier(.2, .9, .3, 1.3); }
.toast .ic { color: var(--violet); }
.toast.gold { background: linear-gradient(135deg, #FFF3CF, #F6D27A); }
.toast.gold .ic { color: #8A5A00; }
.toast.mint .ic { color: #1E9E6A; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .4s; }
@keyframes tin { from { opacity: 0; transform: translateY(10px) scale(.95); } }

/* ---------- panels ---------- */
#panels { position: fixed; inset: 0; z-index: 55; pointer-events: none; }
.scrim { position: absolute; inset: 0; background: rgba(10, 12, 40, .5); backdrop-filter: blur(3px); pointer-events: auto; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.panel { position: absolute; pointer-events: auto; display: flex; flex-direction: column; background: var(--glass-2); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: 0 30px 80px -24px rgba(5, 5, 30, .8); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); overflow: hidden; animation: pin .3s cubic-bezier(.2, .9, .3, 1); }
@keyframes pin { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.panel--side { top: calc(16px + var(--safe-t)); right: 16px; bottom: calc(16px + var(--safe-b)); width: min(450px, calc(100% - 32px)); }
.panel--center { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(780px, calc(100% - 32px)); max-height: calc(100% - 40px); animation: pinc .3s cubic-bezier(.2, .9, .3, 1); }
.panel--wide { width: min(1040px, calc(100% - 32px)); }
.panel--narrow { width: min(460px, calc(100% - 32px)); }
@keyframes pinc { from { opacity: 0; transform: translate(-50%, -46%) scale(.985); } }
.panel-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.panel-head .titles { flex: 1; min-width: 0; }
.panel-head .kicker { font-family: var(--f-head); font-size: .75rem; color: var(--gold-2); letter-spacing: .04em; }
.panel-head h2 { font-size: 1.3rem; margin-top: 2px; }
.panel-close { border: 0; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; flex: none; }
.panel-close:hover { background: rgba(255, 255, 255, .16); }
.panel-body { padding: 16px 20px; overflow: auto; display: grid; gap: 14px; align-content: start; flex: 1; }
.panel-foot { padding: 12px 20px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
.panel-foot .grow { flex: 1; }
.card { border: 1px solid var(--line); background: rgba(255, 255, 255, .04); border-radius: 16px; padding: 14px 16px; }
.card h3 { font-size: 1rem; margin-bottom: 4px; }
.label { font-family: var(--f-head); font-size: .82rem; color: var(--lav); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.nova-q { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: start; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(140, 116, 242, .22), rgba(75, 43, 184, .12)); border: 1px solid rgba(140, 116, 242, .45); }
.nova-q .nova-face { width: 48px; height: 48px; }
.nova-q .who { font-family: var(--f-head); font-size: .8rem; color: var(--gold-2); }
.hint-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.count-ok { color: var(--mint); }

/* clue */
.clue-hero { display: flex; gap: 10px; flex-wrap: wrap; }
.seen { font-size: 1.02rem; }

/* witness */
.w-head { display: flex; gap: 14px; align-items: center; }
.w-head .portrait { width: 64px; height: 64px; }
.transcript { display: grid; gap: 10px; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 18px; line-height: 1.6; }
.bubble.me { justify-self: end; background: linear-gradient(135deg, #8C74F2, #5B3BD6); border-bottom-right-radius: 6px; }
.bubble.them { justify-self: start; background: rgba(255, 255, 255, .92); color: var(--navy-700); border-bottom-left-radius: 6px; }
.bubble.nova { justify-self: start; background: rgba(127, 235, 255, .12); border: 1px solid rgba(127, 235, 255, .35); border-bottom-left-radius: 6px; }
.qlist { display: grid; gap: 8px; }
.qbtn { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); }
.qbtn:hover { background: rgba(255, 255, 255, .1); }
.qbtn.asked { opacity: .6; }
.qbtn .ic { color: var(--gold-2); }

/* notebook */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.slot { display: grid; gap: 6px; align-content: start; min-height: 128px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); text-align: left; }
.slot.found { border-color: rgba(232, 181, 74, .45); background: linear-gradient(160deg, rgba(232, 181, 74, .12), rgba(255, 255, 255, .03)); }
.slot.sel { box-shadow: 0 0 0 2px var(--gold); }
.slot .emb { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: var(--gold-2); }
.slot.empty .emb { color: var(--dim); }
.slot b { font-family: var(--f-head); font-weight: 500; font-size: .95rem; }
.slot .small { color: var(--muted); }
.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .06); width: max-content; }
.tabs button { border: 0; background: transparent; height: 36px; padding: 0 16px; border-radius: 999px; font-family: var(--f-head); font-size: .9rem; color: var(--muted); }
.tabs button[aria-selected="true"] { background: #fff; color: var(--navy-700); }

/* map */
.map-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.map-svg { width: 100%; aspect-ratio: 1; border-radius: 20px; background: radial-gradient(circle at 50% 50%, #2A2F7A, #141A44 70%); border: 1px solid var(--line); }
.map-svg .hot { cursor: pointer; }
.map-svg .hot:hover rect, .map-svg .hot:hover circle { stroke: var(--gold-2); stroke-width: 3; }
.loc { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); }
.loc .emb { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .08); }
.loc.here { border-color: rgba(127, 224, 176, .6); }
.loc.locked { opacity: .7; }
.loc b { font-family: var(--f-head); font-weight: 500; }

/* badges */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.badge { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); }
.badge .medal { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: var(--dim); }
.badge.got .medal { background: radial-gradient(circle at 35% 30%, #FFF1C2, #E8B54A 60%, #B7832A); color: #3B2600; box-shadow: 0 8px 20px -8px rgba(232, 181, 74, .9); }
.badge b { font-family: var(--f-head); font-weight: 500; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--f-head); font-size: 1.5rem; color: var(--gold-2); }
.stat span { font-size: .8rem; color: var(--muted); }

/* settings */
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.switch { position: relative; width: 52px; height: 30px; border-radius: 99px; border: 0; background: rgba(255, 255, 255, .18); flex: none; }
.switch::after { content: ""; position: absolute; left: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--violet-2); }
.switch[aria-checked="true"]::after { transform: translateX(22px); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 999px; font-size: .85rem; color: var(--muted); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--navy-700); font-family: var(--f-head); }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; font-size: .88rem; }

/* coach chat */
.chat { display: grid; gap: 10px; }
.starters { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { min-height: 48px; max-height: 120px; resize: none; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .25; } }

/* board */
.steps { display: flex; gap: 6px; }
.steps span { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .05); font-family: var(--f-head); font-size: .84rem; color: var(--muted); }
.steps span b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 255, 255, .1); font-size: .78rem; }
.steps span.on { background: rgba(140, 116, 242, .3); color: #fff; }
.steps span.on b { background: #fff; color: var(--purple); }
.steps span.ok b { background: var(--mint); color: #0E3B29; }
.cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.col { min-height: 92px; padding: 10px; border-radius: 14px; border: 1px dashed var(--line-2); background: rgba(255, 255, 255, .03); display: grid; gap: 6px; align-content: start; }
.col h4 { font-size: .85rem; color: var(--lav); }
.col .mini { font-size: .78rem; padding: 4px 8px; border-radius: 8px; background: rgba(232, 181, 74, .18); color: var(--gold-2); }
.ccard { display: grid; gap: 10px; padding: 14px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); }
.ccard.done { border-color: rgba(127, 224, 176, .5); }
.ccard .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ccard b { font-family: var(--f-head); font-weight: 500; }
.catbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.catbtns button { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); font-size: .88rem; }
.catbtns button:hover:not([disabled]) { background: rgba(140, 116, 242, .3); }
.catbtns button.picked-right { background: var(--mint); border-color: var(--mint); color: #0E3B29; }
.catbtns button.picked-wrong { border-color: var(--rose); color: #FFD3DA; }
.fb { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 10px 12px; border-radius: 12px; font-size: .9rem; line-height: 1.55; }
.fb.right { background: rgba(127, 224, 176, .14); color: #CFF6E3; }
.fb.hint { background: rgba(232, 181, 74, .14); color: #FBE7B5; }
.fb.reveal { background: rgba(191, 179, 242, .14); }
.prio { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.prio button { display: grid; gap: 6px; text-align: left; padding: 14px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); }
.prio button[aria-pressed="true"] { border-color: var(--gold); background: rgba(232, 181, 74, .12); }
.prio b { font-family: var(--f-head); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.listin { display: grid; gap: 8px; }
.listin .row { display: flex; gap: 8px; }
.listin .row input { flex: 1; }
.check { display: grid; gap: 6px; }
.check div { display: flex; gap: 8px; align-items: center; font-size: .88rem; color: var(--muted); }
.check div.ok { color: var(--mint); }
.check .ic { flex: none; }
.statement-preview { padding: 14px 16px; border-radius: 16px; background: #fff; color: var(--navy-700); line-height: 1.75; }
.statement-preview b { font-family: var(--f-head); font-weight: 500; color: var(--purple); }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; z-index: 50; display: flex; }
.title-screen { align-items: flex-end; padding: 40px clamp(20px, 6vw, 80px) calc(48px + var(--safe-b)); background: linear-gradient(90deg, rgba(11, 14, 44, .88), rgba(11, 14, 44, .35) 55%, transparent), linear-gradient(0deg, rgba(11, 14, 44, .7), transparent 50%); }
.title-card { max-width: 560px; display: grid; gap: 18px; }
.title-card .brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-head); color: var(--lav); font-size: .9rem; }
.title-card .brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(232, 181, 74, .25); }
.title-card h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.12; }
.title-card h1 em { font-style: normal; background: linear-gradient(90deg, #F8DB8A, #E8B54A); -webkit-background-clip: text; background-clip: text; color: transparent; }
.title-card .lede { color: var(--lav-2); font-size: 1.05rem; }
.title-card .acts { display: flex; gap: 10px; flex-wrap: wrap; }
.title-card .btn { min-height: 52px; padding: 0 26px; font-size: 1.05rem; }
.title-edp { display: flex; gap: 6px; flex-wrap: wrap; }
.title-edp span { padding: 4px 10px; border-radius: 999px; font-size: .8rem; border: 1px solid var(--line-2); color: var(--muted); }
.title-edp span.on { background: var(--violet); border-color: var(--violet); color: #fff; }
.saved-note { font-size: .85rem; color: var(--muted); }

.creator { justify-content: flex-end; pointer-events: none; }
.creator .panel { pointer-events: auto; position: relative; margin: 16px; width: min(460px, calc(100% - 32px)); max-height: calc(100% - 32px); align-self: center; }
.creator .preview2d { display: none; }
.opt-group { display: grid; gap: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 38px; height: 38px; border-radius: 50%; border: 3px solid transparent; box-shadow: 0 0 0 1px var(--line-2); }
.sw[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 3px var(--violet-2); }
.name-row { display: flex; gap: 8px; }
.err { color: #FFC2CC; font-size: .85rem; }

.complete .hero { display: grid; place-items: center; gap: 8px; text-align: center; padding: 8px 0 4px; }
.complete .seal { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #FFF1C2, #E8B54A 60%, #B7832A); color: #3B2600; box-shadow: 0 16px 40px -12px rgba(232, 181, 74, .9); animation: pop .6s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* list mode (no 3D) */
.listmode { position: fixed; inset: 0; overflow: auto; padding: 110px 16px 140px; background: radial-gradient(circle at 30% 0%, #3A2E8F, #141A44 60%); }
.listmode .wrap { max-width: 980px; margin: 0 auto; display: grid; gap: 14px; }
.listmode .note { padding: 12px 16px; border-radius: 14px; background: rgba(232, 181, 74, .14); color: #FBE7B5; font-size: .9rem; }
.zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.zcard { padding: 16px; border-radius: 20px; display: grid; gap: 10px; align-content: start; }
.zcard h3 { font-size: 1.05rem; }
.zcard .items { display: grid; gap: 6px; }
.zitem { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); }
.zitem.found { border-color: rgba(127, 224, 176, .5); }
.zitem .ic { color: var(--gold-2); }

.loading { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #2A2F7A, #0F1338); transition: opacity .5s; }
.loading.off { opacity: 0; pointer-events: none; }
.loading .in { display: grid; justify-items: center; gap: 14px; font-family: var(--f-head); color: var(--lav-2); }
.loading .nova-face { width: 84px; height: 84px; animation: hover 2s ease-in-out infinite; }
.loading .bar { width: 220px; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.loading .bar i { display: block; height: 100%; width: 30%; background: linear-gradient(90deg, #8C74F2, #F6D27A); border-radius: 99px; animation: load 1.2s ease-in-out infinite; }
@keyframes hover { 50% { transform: translateY(-8px); } }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .edp .label-th { display: none; }
  .dialogue { width: min(620px, calc(100% - 300px)); }
}
@media (max-width: 900px) {
  .edp .label-en { display: none; }
  .edp button { padding: 0 6px; }
  .edp li.active .label-en { display: inline; }
  .tracker { width: 260px; }
  .dialogue { left: 16px; right: 16px; width: auto; transform: none; bottom: calc(96px + var(--safe-b)); }
  .dialogue.off { transform: translateY(12px); }
  .minimap { width: 120px; padding: 6px; border-radius: 18px; }
  .minimap canvas { width: 108px; height: 108px; border-radius: 14px; }
  .minimap .zone { display: none; }
  .prompt { bottom: calc(210px + var(--safe-b)); }
  .prompt.lift { bottom: calc(96px + var(--safe-b)); }
}
@media (max-width: 760px) {
  .profile { padding: 4px 12px 4px 4px; gap: 8px; }
  .profile .portrait { width: 40px; height: 40px; }
  .profile .who { min-width: 96px; }
  .profile .xptext { display: none; }
  .edp { top: auto; bottom: calc(16px + var(--safe-b)); left: 148px; right: 92px; transform: none; overflow-x: auto; scrollbar-width: none; }
  .hud-buttons { gap: 2px; padding: 4px; }
  .hbtn { width: 46px; font-size: 0; gap: 0; padding: 8px 0; }
  .tracker { top: calc(76px + var(--safe-t)); right: 8px; width: min(280px, calc(100% - 16px)); }
  .ask-nova { height: 52px; padding: 0 8px; }
  .ask-nova .lbl, .ask-nova .dot { display: none; }
  .view-ctrls { display: none; }
  .br { bottom: calc(12px + var(--safe-b)); right: 12px; }
  .dialogue { padding-left: 74px; bottom: calc(80px + var(--safe-b)); }
  .dialogue .nova-face { width: 56px; height: 56px; }
  .minimap { bottom: calc(12px + var(--safe-b)); left: 12px; }
  .zone-banner { top: calc(122px + var(--safe-t)); }
  #toasts { top: calc(70px + var(--safe-t)); }
  .panel--side { top: auto; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); width: auto; max-height: 76vh; }
  .panel--center { width: calc(100% - 16px); max-height: calc(100% - 16px); }
  .map-grid { grid-template-columns: 1fr; }
  .cols { grid-template-columns: repeat(2, 1fr); }
  .prio { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .creator { align-items: flex-end; }
  .creator .panel { max-height: 62vh; margin: 8px; width: calc(100% - 16px); }
  .title-screen { background: linear-gradient(0deg, rgba(11, 14, 44, .92), rgba(11, 14, 44, .5) 60%, rgba(11, 14, 44, .2)); }
}
.no3d .creator { justify-content: center; align-items: center; }
.no3d .creator .preview2d { display: grid; place-items: center; }
.no3d .creator .preview2d .portrait { width: 120px; height: 120px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation: none !important; transition: none !important; }
.no3d .minimap, .no3d .view-ctrls, .no3d .prompt { display: none !important; }
@media (min-width: 901px) { .no3d .dialogue { width: min(660px, calc(100% - 300px)); } }
.big .nova-face, .nova-face.big { width: 56px; height: 56px; }
.profile { border: 1px solid var(--line); color: inherit; text-align: left; }

/* ======================= Room 02 · IMAGINE ======================= */
.fade { position: fixed; inset: 0; z-index: 75; background: radial-gradient(circle at 50% 45%, #2A2F7A, #0F1338); opacity: 0; pointer-events: none; transition: opacity .42s; }
.fade.on { opacity: 1; pointer-events: auto; }
.tag.proto { background: rgba(127, 235, 255, .14); color: #BFF3FF; }
.proto-note { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 12px; background: rgba(127, 235, 255, .1); border: 1px solid rgba(127, 235, 255, .3); font-size: .82rem; color: #CFF6FF; }
.edp .open button { color: var(--gold-2); }
.edp .open .n { background: rgba(232, 181, 74, .25); color: var(--gold-2); }
.obj .sub { display: block; font-size: .74rem; color: var(--muted); }
.tproblem { display: grid; gap: 2px; width: 100%; margin-top: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(232, 181, 74, .35); background: rgba(232, 181, 74, .08); text-align: left; }
.tproblem .k { font-family: var(--f-head); font-size: .72rem; color: var(--gold-2); }
.tproblem .t { font-size: .84rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tproblem .more { font-size: .74rem; color: var(--lav); text-decoration: underline; }
.tracker.collapsed .tproblem { display: none; }
.rail { position: absolute; left: 16px; top: calc(96px + var(--safe-t)); display: grid; gap: 4px; padding: 6px; border-radius: 22px; }
.rbtn { display: grid; justify-items: center; gap: 2px; width: 74px; padding: 9px 4px 7px; border: 0; border-radius: 16px; background: transparent; color: var(--lav-2); font-family: var(--f-head); font-size: .7rem; line-height: 1.2; text-align: center; }
.rbtn:hover { background: rgba(255, 255, 255, .1); }
.rbtn .ic { color: var(--gold-2); }
.panel--dock { top: calc(16px + var(--safe-t)); right: 16px; bottom: calc(16px + var(--safe-b)); width: min(640px, calc(100% - 32px)); }
.panel--dock.panel--wide { width: min(860px, calc(100% - 140px)); }
.station-info { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.station-info .letter, .letter-sm { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: var(--navy-700); font-family: var(--f-head); font-weight: 700; flex: none; }
.letter-sm { width: 32px; height: 32px; font-size: .9rem; }
.row2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row2.between { justify-content: space-between; }
.row2 > select, .row2 > input { flex: 1; min-width: 160px; }
select { min-height: 42px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(6, 8, 30, .55); padding: 0 12px; }
select option { background: #151B48; }
.idea-form { display: grid; gap: 8px; }
.empty { display: grid; justify-items: center; gap: 6px; padding: 24px; border-radius: 16px; border: 1px dashed var(--line-2); color: var(--muted); text-align: center; }
.ideas { display: grid; gap: 10px; }
.gcols { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; align-items: start; }
.gcol { display: grid; gap: 8px; padding: 10px; border-radius: 16px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); }
.gcol h4 { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.gcol h4 i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.icard { position: relative; display: grid; gap: 6px; padding: 12px 12px 10px 16px; border-radius: 14px; background: rgba(255, 255, 255, .95); color: var(--navy-700); box-shadow: 0 8px 20px -14px rgba(0, 0, 0, .6); }
.icard::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 5px; border-radius: 0 4px 4px 0; background: var(--gc, #8C74F2); }
.icard.starred { box-shadow: 0 0 0 3px var(--gold), 0 10px 24px -12px rgba(232, 181, 74, .7); }
.icard .top { display: flex; flex-wrap: wrap; gap: 4px; }
.icard .tag { background: rgba(107, 79, 216, .12); color: var(--purple); }
.icard .tag.gold { background: rgba(232, 181, 74, .22); color: #7A5200; }
.icard .tag.mint { background: rgba(63, 191, 134, .16); color: #0F6B45; }
.icard .muted { color: #5E5A85; }
.icard .gold-t { color: #8A5A00; }
.itext { font-size: .98rem; font-weight: 500; line-height: 1.55; }
.icard .acts { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 2px; }
.icard .btn { min-height: 32px; padding: 0 10px; font-size: .8rem; color: var(--navy-700); border-color: rgba(30, 36, 82, .2); background: rgba(30, 36, 82, .04); }
.icard textarea, .icard input, .icard select { color: var(--navy-700); background: #F4F2FC; border-color: rgba(30, 36, 82, .2); }
.icard select option { background: #fff; }
.ib { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; border: 1px solid rgba(30, 36, 82, .15); background: rgba(30, 36, 82, .04); color: var(--navy-700); }
.ib:hover:not([disabled]) { background: rgba(107, 79, 216, .14); }
.ib[disabled] { opacity: .35; cursor: default; }
.ib[aria-pressed="true"] { background: rgba(232, 181, 74, .3); border-color: var(--gold); }
.ib.up .ic { transform: rotate(90deg); } .ib.down .ic { transform: rotate(-90deg); }
.ib.danger { color: #B3264A; }
.unusual-box { display: flex; gap: 6px; }
.unusual-box input { flex: 1; }
.hist { display: grid; gap: 4px; padding: 8px; border-radius: 10px; background: #F1EEFB; }
.gtag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-family: var(--f-head); background: color-mix(in srgb, var(--gc, #8C74F2) 22%, white); color: #1E2452; border: 1px solid color-mix(in srgb, var(--gc, #8C74F2) 60%, white); }
.gtag .x { border: 0; background: transparent; color: #1E2452; font-size: 1rem; line-height: 1; padding: 0 2px; }
.trash { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; background: rgba(255, 255, 255, .03); }
.trash summary { cursor: pointer; font-family: var(--f-head); font-size: .88rem; color: var(--lav); }
.trash > * + * { margin-top: 8px; }
.trow { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-size: .88rem; }
.sel-idea { display: grid; gap: 6px; border-left: 5px solid var(--gc, #8C74F2); }
.devgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.devgrid .label { margin-top: 2px; }
.dims { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dim { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); font-size: .88rem; }
.dim b { font-family: var(--f-head); font-weight: 500; color: var(--gold-2); }
.ask-card .statement { font-size: 1rem; line-height: 1.7; padding: 10px 12px; border-radius: 12px; background: #fff; color: var(--navy-700); }
.ask-dl { display: grid; grid-template-columns: 112px 1fr; gap: 6px 10px; margin: 10px 0; font-size: .88rem; }
.ask-dl dt { color: var(--lav); font-family: var(--f-head); }
.ask-dl dd { margin: 0; }
.check.big div { padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .04); }
.submit-box { border-color: rgba(232, 181, 74, .45); }
.offer { justify-self: start; }
.mm { display: grid; gap: 10px; }
.mm-tools { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.mm-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mm-row .label { margin: 0; white-space: nowrap; }
.mm-row input { flex: 1; min-width: 180px; }
.mm-row select { flex: 1; min-width: 160px; }
.mm-canvas { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); touch-action: none; }
.mm-svg { display: block; width: 100%; height: auto; user-select: none; }
.mm-svg.linking { cursor: crosshair; }
.mm-node { cursor: grab; outline: none; }
.mm-node .mm-box { fill: rgba(255, 255, 255, .95); stroke: rgba(191, 179, 242, .9); stroke-width: 2; }
.mm-node.center .mm-box { fill: #7A5CF0; stroke: #B9A6FF; }
.mm-node.idea .mm-box { stroke: #E8B54A; stroke-width: 3; }
.mm-node.sel .mm-box { stroke: #F6D27A; stroke-width: 5; }
.mm-node:focus-visible .mm-box { stroke: #7FEBFF; stroke-width: 5; }
.mm-label { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; font: 500 15px/1.35 var(--f-body); color: #1E2452; overflow: hidden; word-break: break-word; }
.mm-node.center .mm-label { color: #fff; font: 600 17px/1.35 var(--f-head); }
.mm-preview { width: 100%; height: auto; border-radius: 14px; display: block; margin: 8px 0; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.t-idea { display: grid; gap: 4px; align-content: start; }
.t-idea .top, .icard .top { align-items: center; }
.t-idea.del { opacity: .6; }
.t-idea .top { display: flex; flex-wrap: wrap; gap: 4px; }
.tlog { display: grid; gap: 4px; max-height: 260px; overflow: auto; padding-right: 6px; }
.in-studio .tracker { width: 320px; }
@media (max-width: 1180px) {
  .panel--dock { width: min(560px, calc(100% - 120px)); }
  .panel--dock.panel--wide { width: calc(100% - 120px); }
  .devgrid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .rail { top: auto; bottom: calc(150px + var(--safe-b)); left: 12px; grid-auto-flow: row; }
  .rbtn { width: 56px; font-size: 0; gap: 0; padding: 10px 4px; }
  .in-studio .minimap { display: none; }
  .in-studio .tracker { width: 280px; }
  .panel--dock, .panel--dock.panel--wide { left: 84px; right: 12px; width: auto; }
  .dims { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .rail { left: 8px; bottom: calc(76px + var(--safe-b)); padding: 4px; }
  .rbtn { width: 46px; }
  .panel--dock, .panel--dock.panel--wide { top: auto; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); max-height: 82vh; }
  .ask-dl { grid-template-columns: 1fr; }
  .gcols { grid-template-columns: 1fr; }
}

/* ---------- Room 3 · flowchart design desk ---------- */
.edp .soon button { color: var(--dim); }
.edp .soon .n { background: transparent; border: 1.5px dashed var(--dim); color: var(--dim); }
.approach .tag.gold, .approach .tag { white-space: normal; text-align: left; }
.tag.gold { background: rgba(232, 181, 74, .18); color: var(--gold-2); }
.conds { display: grid; gap: 10px; }
.cond { display: grid; grid-template-columns: 30px 1fr 34px; gap: 10px; align-items: start; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.cond .cn { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--violet); color: #fff; font-family: var(--f-head); font-size: .85rem; }
.cgrid { display: grid; grid-template-columns: 92px 1fr; gap: 6px 10px; align-items: center; }
.cgrid input { width: 100%; }
.ck { font-family: var(--f-head); font-size: .9rem; color: var(--gold-2); }
.ck.soft { color: var(--muted); font-size: .82rem; }
.cond .ib, .fc-arrow .ib { border-color: var(--line-2); background: rgba(255, 255, 255, .06); color: var(--lav-2); }
.cond .ib.danger, .fc-arrow .ib.danger { color: var(--rose); }
.fc { display: grid; gap: 10px; }
.fc-adds { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-add { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 8px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .05); font-size: .84rem; }
.fc-add:hover { background: rgba(140, 116, 242, .25); }
.fc-sym .fc-shape { stroke: #1E2452; stroke-width: 6; }
.fc-sym.fc-start .fc-shape { fill: #7FE0B0; } .fc-sym.fc-end .fc-shape { fill: #F49AA8; }
.fc-sym.fc-process .fc-shape { fill: #fff; } .fc-sym.fc-decision .fc-shape { fill: #F6D27A; } .fc-sym.fc-io .fc-shape { fill: #9FD1FF; }
.fc-svg { display: block; width: 100%; height: auto; user-select: none; }
.fc-svg.linking { cursor: crosshair; }
.fc-canvas { max-height: 62vh; overflow: auto; }
.fc-node { cursor: grab; outline: none; touch-action: none; }
.fc-node .fc-shape { stroke: rgba(30, 36, 82, .55); stroke-width: 2; }
.fc-start .fc-shape { fill: #7FE0B0; } .fc-end .fc-shape { fill: #F49AA8; }
.fc-process .fc-shape { fill: rgba(255, 255, 255, .96); } .fc-decision .fc-shape { fill: #F6D27A; } .fc-io .fc-shape { fill: #9FD1FF; }
.fc-node.sel .fc-shape { stroke: #FFFFFF; stroke-width: 5; filter: drop-shadow(0 0 8px rgba(246, 210, 122, .8)); }
.fc-node:focus-visible .fc-shape { stroke: #7FEBFF; stroke-width: 5; }
.fc-node.peer .fc-shape { stroke: #7FEBFF; stroke-width: 4; stroke-dasharray: 6 4; }
.fc-peer rect { fill: #7FEBFF; } .fc-peer text { fill: #10163F; font: 600 12px var(--f-head); }
.fc-node.err .fc-shape { stroke: #E0607A; stroke-width: 4; stroke-dasharray: 8 5; }
.fc-label { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center; font: 500 14.5px/1.3 var(--f-body); color: #1E2452; overflow: hidden; word-break: break-word; }
.fc-label.empty { color: rgba(30, 36, 82, .45); font-style: italic; }
.fc-link { fill: none; stroke: #CFC6F7; stroke-width: 2.6; }
.fc-link.on { stroke: #F6D27A; stroke-width: 3.4; }
.fc-yn rect { stroke: rgba(255, 255, 255, .6); stroke-width: 1; }
.fc-yn.yes rect { fill: #3FBF86; } .fc-yn.no rect { fill: #E0607A; }
.fc-yn text { fill: #fff; font: 600 14px var(--f-head); }
.fc-arrow { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: .84rem; }
.fc-arrow.yes { border-color: rgba(63, 191, 134, .7); } .fc-arrow.no { border-color: rgba(224, 96, 122, .7); }
.fc-arrow .ib { width: 28px; height: 28px; }
.fc-status { padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); display: grid; gap: 4px; }
.fc-status.ok { border-color: rgba(127, 224, 176, .5); background: rgba(127, 224, 176, .1); color: var(--mint); display: flex; align-items: center; gap: 6px; }
.fc-status.bad { border-color: rgba(244, 154, 168, .5); background: rgba(244, 154, 168, .08); }
.fc-status.bad b { color: var(--rose); font-family: var(--f-head); font-weight: 600; }
.fc-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fc-legend > div { display: flex; align-items: center; gap: 8px; }
.card.case { display: grid; gap: 8px; }
.card.case textarea { width: 100%; }
@media (max-width: 760px) {
  .cgrid { grid-template-columns: 1fr; }
  .cond { grid-template-columns: 26px 1fr 30px; padding: 10px; }
  .fc-add { min-height: 36px; padding: 0 10px 0 6px; font-size: .78rem; }
  .fc-svg { min-width: 760px; }
  .fc-canvas { touch-action: pan-x pan-y; max-height: 56vh; }
}
.cgrid input { padding: 9px 12px; }
.design-top { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.approach { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.approach .label { margin: 0; }
/* while a tool panel is docked on the right, toasts move to the free area on the left */
@media (min-width: 1000px) {
  body:has(.panel--dock) #toasts { left: calc((100% - min(860px, 100% - 140px)) / 2); top: auto; bottom: calc(110px + var(--safe-b)); }
}

/* test mode */
.testchip { position: fixed; left: 12px; bottom: calc(12px + var(--safe-b)); z-index: 70; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 2px dashed #E8B54A; background: rgba(30, 36, 82, .92); color: #FFE7A8; font-family: var(--f-head); font-size: .9rem; cursor: pointer; }
.testchip.hidden { display: none; }
.tm-rooms { display: grid; gap: 10px; }
.tm-room { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); }
.tm-room.here { border-color: var(--gold); background: rgba(232, 181, 74, .1); }
.tm-room.soon { opacity: .55; }
.tm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tm-head b { flex: 1; font-family: var(--f-head); font-weight: 500; }
.tm-asks ol { margin: 4px 0 0; padding-left: 22px; font-size: .9rem; }
.tm-here { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: rgba(232, 181, 74, .14); margin-bottom: 10px; }
.tm-here .btn { margin-left: auto; }
.tm-fill { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; font-size: .92rem; }
