/* Leaf — one signature element (the doorway ring), everything else quiet. */
:root{
 --paper:#F5F3EE;--surface:#FFFFFF;--ink:#17191C;--mute:#646A72;--line:#E3DFD7;
 --leaf:#1E7A4E;--leaf-soft:#E3F1E9;--amber:#A86B12;--amber-soft:#FBEFD9;--stop:#B42318;
 --display:ui-rounded,"SF Pro Rounded",system-ui,-apple-system,"Segoe UI",sans-serif;
 --body:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
 --r:20px;--ease:cubic-bezier(.2,.7,.2,1);
 color-scheme:light dark;
}
@media (prefers-color-scheme:dark){:root{--paper:#0F1210;--surface:#171B18;--ink:#ECEEE9;--mute:#9AA19B;--line:#262B27;--leaf:#52C48D;--leaf-soft:#153223;--amber:#E6A945;--amber-soft:#33260F;--stop:#F97066}}
@media (prefers-contrast:more){:root{--mute:var(--ink);--line:var(--ink)}}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;min-height:100dvh;background:var(--paper);color:var(--ink);font:17px/1.45 var(--body)}
button,input,textarea{font:inherit;color:inherit}
button{cursor:pointer;border:0;background:none}
:focus-visible{outline:3px solid var(--leaf);outline-offset:3px;border-radius:12px}

.top{display:flex;align-items:center;justify-content:space-between;max-width:480px;margin:0 auto;padding:max(14px,env(safe-area-inset-top)) 20px 6px}
.brand{display:flex;align-items:center;gap:8px;font:700 19px var(--display);letter-spacing:-.01em}
.mark{width:22px;height:22px;fill:none;stroke:var(--leaf);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.mark path:first-child{fill:var(--leaf-soft)}
.gear{width:44px;height:44px;display:grid;place-items:center;border-radius:14px;color:var(--mute)}
.gear:hover{background:var(--surface)}
.page{max-width:480px;margin:0 auto;padding:10px 20px calc(28px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:14px}

h1{font:700 clamp(28px,7vw,34px)/1.12 var(--display);letter-spacing:-.02em;margin:0}
h2{font:650 15px var(--body);color:var(--mute);margin:0 0 8px}
.eyebrow{font-size:14px;font-weight:650;color:var(--mute);margin:8px 0 -8px;text-transform:none}
.lede{color:var(--mute);margin:0}
.note{color:var(--mute);font-size:14px;margin:4px 0}
.status{color:var(--mute);font-size:15px;margin:0}

.ic{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:none}
.tiles{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:6px}
.tile{display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;gap:22px;min-height:118px;padding:18px;border-radius:var(--r);background:var(--surface);border:1px solid var(--line);text-align:left;font-weight:650;transition:transform .15s var(--ease),border-color .15s}
.tile .ic{color:var(--leaf)}
.tile:hover{border-color:var(--leaf);transform:translateY(-2px)}
.tile:active{transform:scale(.98)}
.tiles .tile:last-child:nth-child(odd){grid-column:1/-1;min-height:84px;flex-direction:row;align-items:center;justify-content:flex-start}

.now{margin-top:10px}
.row{display:flex;align-items:center;gap:10px;background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:6px 6px 6px 12px;margin-bottom:8px}
.row-main{flex:1;display:flex;align-items:center;gap:12px;text-align:left;min-height:52px}
.row-main span{display:flex;flex-direction:column}
.row-main small,.card small{color:var(--mute);font-size:14px}

/* The signature: a doorway whose ring carries the whole state. */
.door{position:relative;border-radius:28px;background:var(--surface);padding:22px 18px;border:2px solid var(--line);transition:border-color .3s var(--ease),background .3s var(--ease)}
.door::after{content:"";position:absolute;inset:-7px;border-radius:34px;border:2px solid transparent;pointer-events:none}
.door.waiting::after{border-color:var(--leaf);opacity:.35;animation:breathe 2.6s var(--ease) infinite}
.door.asking{border-color:var(--amber);background:var(--amber-soft)}
.door.asking::after{border-color:var(--amber);animation:breathe 1.1s var(--ease) infinite}
.door.live{border-color:var(--leaf);background:var(--leaf-soft)}
@keyframes breathe{0%,100%{transform:scale(1);opacity:.15}50%{transform:scale(1.015);opacity:.6}}
.door-body{display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px}
.door-body p{margin:0}
.qr{background:#fff;border-radius:16px;padding:8px;line-height:0}
.qr svg{display:block;width:min(66vw,280px);height:auto}
.code{font:700 clamp(40px,12vw,52px)/1 var(--display);font-variant-numeric:tabular-nums;letter-spacing:.06em;color:var(--ink)}
.check{width:56px;height:56px;border-radius:50%;background:var(--leaf);position:relative}
.check::after{content:"";position:absolute;left:19px;top:14px;width:12px;height:22px;border:solid var(--surface);border-width:0 4px 4px 0;transform:rotate(45deg)}
.spinner{width:30px;height:30px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--leaf);animation:spin .9s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

.preview,.stage-video{width:100%;border-radius:var(--r);background:#000;aspect-ratio:16/10;object-fit:contain}
.preview{max-height:30vh}
.meter{height:14px;border-radius:99px;background:var(--surface);border:1px solid var(--line);overflow:hidden}
.meter i{display:block;height:100%;width:2%;background:var(--leaf);transition:width 80ms linear}
.card{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px}
.card span{display:flex;flex-direction:column;min-width:0;overflow-wrap:anywhere}
.card.text{display:block;white-space:pre-wrap;overflow-wrap:anywhere;max-height:40vh;overflow:auto;font-size:16px}

.go,.quiet,.stop{min-height:52px;border-radius:16px;padding:0 20px;font-weight:650;transition:transform .12s var(--ease),filter .12s}
.go{background:var(--leaf);color:#fff}
@media (prefers-color-scheme:dark){.go{color:#08140E}}
.quiet{background:transparent;color:var(--ink);border:1px solid var(--line)}
.stop{background:transparent;color:var(--stop);border:1px solid color-mix(in srgb,var(--stop) 40%,transparent)}
.stop.small{min-height:40px;padding:0 14px;font-size:15px}
.go:active,.quiet:active,.stop:active{transform:scale(.98)}
.go:hover{filter:brightness(1.06)}
.pair{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;width:100%}
.pair>*{flex:1 1 140px}
.stack{display:flex;flex-direction:column;gap:10px;margin-top:10px}
.page>.stop,.page>.quiet{width:100%}

.scrim{position:fixed;inset:0;background:rgba(10,14,12,.4);z-index:40;animation:fade .2s}
.sheet{position:fixed;z-index:41;left:0;right:0;bottom:0;margin:0 auto;max-width:520px;background:var(--surface);border-radius:26px 26px 0 0;padding:22px 20px calc(20px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:12px;animation:rise .28s var(--ease)}
.sheet h2{font:700 21px var(--display);color:var(--ink)}
.choice{display:flex;gap:12px;align-items:flex-start;border:1px solid var(--line);border-radius:16px;padding:14px;cursor:pointer}
.choice:has(input:checked){border-color:var(--leaf);background:var(--leaf-soft)}
.choice input{margin-top:4px;width:20px;height:20px;accent-color:var(--leaf)}
.choice span{display:flex;flex-direction:column}
.choice small{color:var(--mute);font-size:14px}
textarea{width:100%;border:1px solid var(--line);border-radius:14px;padding:12px;background:var(--paper);resize:vertical}
@keyframes rise{from{transform:translateY(24px);opacity:0}}
@keyframes fade{from{opacity:0}}

.toast{position:fixed;z-index:60;left:50%;bottom:calc(22px + env(safe-area-inset-bottom));transform:translateX(-50%);max-width:min(440px,calc(100vw - 32px));background:var(--ink);color:var(--paper);padding:12px 16px;border-radius:14px;font-size:15px;animation:rise .2s var(--ease)}

@media (prefers-reduced-motion:reduce){*,*::after{animation:none!important;transition:none!important}}
