:root {
  --ink: #f6f1e4; --dim: #c9c6b4; --glass: rgba(24, 32, 22, .58); --glass-2: rgba(24, 32, 22, .82);
  --line: rgba(255, 248, 225, .16); --ok: #7ee08a; --warn: #ffd46a; --bad: #ff8a7a; --sim: #b9b3ff;
  --accept: #ffd24a; --reject: #c04cff; --forward: #48e0a0; --left: #4ac8ff; --right: #ff8a4a; --startle: #ffffff;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  font: 15px/1.35 ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #9fb8c9; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.card, .chip, .tools button, .dock, .sheet, .toast, .why { backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2); }

.hud { position: fixed; top: calc(10px + var(--sat)); left: calc(10px + var(--sal)); right: calc(10px + var(--sar)); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.card { background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 9px 12px; min-width: 150px; max-width: 58vw; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.status .row { display: flex; align-items: baseline; gap: 6px; }
.label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
#epoch { font-size: 20px; font-variant-numeric: tabular-nums; }
.behavior { font-size: 13px; color: var(--ink); margin: 2px 0 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.energy { height: 7px; border-radius: 9px; background: rgba(255,255,255,.14); overflow: hidden; }
#energy-bar { height: 100%; width: 60%; border-radius: inherit; background: linear-gradient(90deg, #f2b61e, #ffe28a); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.hud { right: calc(70px + var(--sar)); }
.right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.chip { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.chip.work { color: var(--warn); } .chip.work::before { animation: pulse 1s infinite ease-in-out; }
.chip { background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat; background-position: 13px calc(100% - 3px); background-size: calc((100% - 26px) * var(--p, 0)) 2px; }
.chip.ok { color: var(--ok); } .chip.fail { color: var(--bad); } .chip.sim { color: var(--sim); }
.chip a { color: inherit; text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; margin: -10px 0; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }

.tools { position: fixed; right: calc(10px + var(--sar)); top: calc(10px + var(--sat)); display: flex; flex-direction: column; gap: 8px; }
.tools button { width: 48px; height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); display: grid; place-items: center; font-weight: 700; padding: 0; }
.tools button span:not(.sr) { display: none; }
.tools svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tools button[aria-expanded="true"], .tools button[aria-pressed="true"] { background: rgba(255, 226, 138, .28); border-color: rgba(255, 226, 138, .6); }

.dock-wrap { position: fixed; left: 0; right: 0; bottom: calc(10px + var(--sab)); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 calc(8px + var(--sar)) 0 calc(8px + var(--sal)); }
.dock { pointer-events: auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 6px; border-radius: 22px; background: var(--glass); border: 1px solid var(--line); width: min(520px, 100%); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.dock button { min-height: 64px; border: 0; border-radius: 16px; background: rgba(255,255,255,.07); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12.5px; font-weight: 650; transition: transform .12s, background .2s, opacity .2s; touch-action: manipulation; }
.dock button svg { width: 30px; height: 30px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.dock button:active:not(:disabled) { transform: scale(.93); background: rgba(255,255,255,.2); }
.dock button:disabled { opacity: .38; cursor: not-allowed; }
.dock button:focus-visible, .tools button:focus-visible, .close:focus-visible { outline: 2px solid var(--warn); outline-offset: 2px; }
@media (hover: hover) { .dock button:hover:not(:disabled) { background: rgba(255,255,255,.16); } }
.why { pointer-events: none; margin: 0; font-size: 12.5px; padding: 5px 12px; border-radius: 999px; background: var(--glass-2); color: var(--warn); }

.sheet { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; max-height: 72vh; overflow: auto; background: var(--glass-2); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 6px 18px calc(18px + var(--sab)); box-shadow: 0 -12px 40px rgba(0,0,0,.35); animation: up .28s cubic-bezier(.2,.9,.2,1); }
.grip { width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.3); margin: 4px auto 6px; }
.sheet header { display: flex; justify-content: space-between; align-items: center; }
.sheet h2 { margin: 4px 0; font-size: 19px; }
.close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.06); }
.sub { margin: 0 0 12px; color: var(--dim); font-size: 13px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 820px) and (min-height: 560px) {
  .sheet { left: auto; right: calc(72px + var(--sar)); bottom: auto; top: calc(96px + var(--sat)); width: 400px; border-radius: 20px; border-bottom: 1px solid var(--line); max-height: calc(100vh - 220px); padding-bottom: 18px; }
  .grip { display: none; }
  body:has(.sheet:not([hidden])) .toast { left: calc((100% - 472px - var(--sar)) / 2); max-width: min(460px, calc(100% - 504px - var(--sar))); }
}
.honest { padding-left: 18px; margin: 6px 0 12px; } .honest li { margin: 6px 0; }
.ids { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 12px; } .ids dt { color: var(--dim); } .ids dd { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.keys { font-size: 12px; color: var(--dim); } kbd { font: 12px ui-monospace, monospace; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; }
.toast { position: fixed; z-index: 6; left: 50%; transform: translateX(-50%); bottom: calc(172px + var(--sab)); width: max-content; max-width: min(90vw, 460px); padding: 10px 16px; border-radius: 14px; background: var(--glass-2); border: 1px solid var(--line); font-size: 13.5px; text-align: center; }
.stats { position: fixed; left: calc(10px + var(--sal)); bottom: calc(100px + var(--sab)); font: 11px ui-monospace, monospace; background: rgba(0,0,0,.5); padding: 3px 6px; border-radius: 6px; }

@media (orientation: landscape) and (max-height: 520px) {
  .dock-wrap { left: auto; right: calc(66px + var(--sar)); width: auto; align-items: flex-end; }
  .dock { width: min(430px, 60vw); } .dock button { min-height: 52px; }
  .tools { top: calc(10px + var(--sat)); right: calc(10px + var(--sar)); } .hud { right: calc(70px + var(--sar)); }
  .sheet { max-height: 88vh; left: auto; width: min(420px, 60vw); right: 0; border-radius: 20px 0 0 0; }
  body:has(.sheet:not([hidden])) .toast { left: calc((100% - min(420px, 60vw)) / 2); max-width: calc(100% - min(420px, 60vw) - 16px); }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 0; display: none; background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(20, 16, 6, .38) 100%); }
body[data-tier="medium"] #vignette { display: block; }
@media (max-width: 600px) and (orientation: portrait) {
  .hud { right: calc(10px + var(--sar)); }
  .tools { flex-direction: row; top: calc(var(--hud-b, 92px) + 8px); right: calc(10px + var(--sar)); gap: 6px; }
  .tools button { width: 44px; height: 44px; border-radius: 12px; }
  .tools svg { width: 19px; height: 19px; }
}
#sim-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 999px; background: #f2c14e; color: #2a1d05; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
#sim-tag[hidden] { display: none; }
/* Round 6: presence, ticker, overview labels, badges, coach, low energy */
.presence { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 10px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 12px; font-weight: 650; color: var(--ink); backdrop-filter: blur(12px); }
.presence::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 8px #ff5a5a; animation: pulse 1.6s infinite; }
.ticker { list-style: none; margin: 0 0 6px; padding: 0; font-size: 12px; color: var(--dim); }
.ticker li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: tin .4s ease-out; }
.ticker li.someone { color: #bfe3ff; } .ticker li + li { opacity: .7; }
@keyframes tin { from { opacity: 0; transform: translateY(-4px); } }
.labels { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.labels .label { position: absolute; letter-spacing: 0; text-transform: none; left: 0; top: 0; white-space: nowrap; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(20, 26, 16, .62); border: 1px solid var(--line); color: var(--ink); will-change: transform; }
.say-hi { position: fixed; left: 0; top: 0; z-index: 2; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid #fff3b0; background: rgba(255, 216, 74, .92); color: #2a1d05; box-shadow: 0 4px 14px rgba(0,0,0,.3); cursor: pointer; will-change: transform; }
.say-hi[hidden] { display: none; }
.labels .label.fly { background: #ffd84a; color: #2a1d05; border-color: #fff3b0; box-shadow: 0 0 16px rgba(255, 216, 74, .8); font-size: 13px; }
.tools button { position: relative; font-size: 19px; }
.count-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: #ffd84a; color: #2a1d05; font: 800 12px/18px system-ui; font-style: normal; text-align: center; padding: 0 4px; }
.trophy-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.trophy-list li { display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto; column-gap: 8px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.07); border: 1px solid var(--line); }
.trophy-list i { grid-row: span 2; font-size: 28px; font-style: normal; display: grid; place-items: center; }
.trophy-list b { font-size: 13.5px; } .trophy-list span { font-size: 12px; color: var(--dim); }
.trophy-list li.got { background: rgba(255, 216, 74, .14); border-color: rgba(255, 216, 74, .5); }
.trophy-list li.locked { opacity: .6; }
.badge-toast { position: fixed; z-index: 8; left: 50%; top: calc(120px + var(--sat)); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 14px; border-radius: 18px; background: linear-gradient(135deg, rgba(60, 46, 10, .92), rgba(24, 32, 22, .92)); border: 1px solid rgba(255, 216, 74, .7); box-shadow: 0 10px 40px rgba(0,0,0,.4), 0 0 30px rgba(255, 216, 74, .35); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); max-width: 90vw; }
.badge-toast .ic { font-size: 34px; font-style: normal; } .badge-toast b { display: block; font-size: 15px; } .badge-toast span { font-size: 12.5px; color: var(--dim); }
.badge-toast.small { border-color: var(--line); background: var(--glass-2); box-shadow: 0 8px 24px rgba(0,0,0,.3); } .badge-toast.small .ic { font-size: 24px; }
@keyframes pop { from { transform: translateX(-50%) scale(.6); opacity: 0; } }
.confetti { position: fixed; left: 50%; top: calc(150px + var(--sat)); z-index: 7; pointer-events: none; }
.confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; animation: conf 1.6s cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes conf { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 60% { opacity: 1; } 100% { transform: translate(var(--x), calc(var(--y) * -1.6 + 260px)) rotate(var(--r)); opacity: 0; } }
.coach { position: fixed; z-index: 9; width: min(340px, calc(100vw - 24px)); padding: 14px 16px 12px; border-radius: 18px; background: #fff8e4; color: #2a2414; box-shadow: 0 16px 50px rgba(0,0,0,.45); animation: coachpop .4s ease-out; }
@keyframes coachpop { from { transform: scale(.6); opacity: 0; } }
.coach p { margin: 4px 0 10px; font-size: 14.5px; line-height: 1.4; } .coach .step { font-size: 12px; font-weight: 800; color: #9a7a2a; letter-spacing: .08em; }
.coach .row { display: flex; justify-content: flex-end; gap: 8px; }
.coach button { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 0; font-weight: 750; }
.coach .skip { background: transparent; color: #7a6a4a; } .coach .next { background: #2a2414; color: #ffe28a; }
.coach.above::after, .coach.below::after { content: ''; position: absolute; left: var(--ax, 50%); width: 14px; height: 14px; margin-left: -7px; background: inherit; transform: rotate(45deg); }
.coach.below::after { top: -7px; } .coach.above::after { bottom: -7px; }
.coach-spot { position: fixed; z-index: 8; pointer-events: none; box-shadow: 0 0 0 3px #ffd84a, 0 0 22px 6px rgba(255,216,74,.55), 0 0 0 200vmax rgba(6,10,4,.55); transition: left .25s, top .25s, width .25s, height .25s; }
.coach.left::after { content: ''; position: absolute; top: var(--ay, 50%); right: -7px; width: 14px; height: 14px; margin-top: -7px; background: inherit; transform: rotate(45deg); }
body.brain-open .coach, body.brain-open .coach-spot { visibility: hidden; }
.acct { display: flex; gap: 8px; align-items: center; }
.new-fly { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px 0 10px; border-radius: 999px; background: #ffd84a; color: #2a1d05; border: 1px solid #fff3b0; font-size: 13px; font-weight: 800; box-shadow: 0 6px 18px rgba(0,0,0,.25); pointer-events: auto; }
.new-fly svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.new-fly[hidden] { display: none; }
@keyframes glow { 50% { outline-color: rgba(255, 216, 74, .3); } }
.energy.low #energy-bar { background: linear-gradient(90deg, #e2542a, #ffb05a); animation: pulse 1.2s infinite; }
.dock button.hint:not(:disabled) { box-shadow: 0 0 0 2px #ffd84a inset, 0 0 18px rgba(255, 216, 74, .5); animation: glow 1.2s infinite; }
/* Round 10: other flies, fly card */
.labels .label.fly.other { background: rgba(20, 26, 16, .62); color: var(--ink); border-color: var(--line); box-shadow: none; font-size: 12px; }
.labels .label.fly.other.stopped { font-style: italic; color: var(--dim); }
#flycard .ids dd { overflow-wrap: anywhere; }
.labels .label.other { pointer-events: auto; cursor: pointer; }
.follow-btn { display: flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; margin-top: 12px; width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 226, 138, .22); color: var(--ink); font-weight: 700; }
.back-mine { position: fixed; z-index: 3; left: 50%; transform: translateX(-50%); bottom: calc(120px + var(--sab)); min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(255, 226, 138, .6); background: var(--glass); color: var(--ink); font-weight: 700; }
/* v2: wallet, creation, session panel */
.wallet-btn { min-height: 44px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); font-weight: 700; font-size: 13px; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-list, .wl-flies, .costs { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.wl-item, .btns button { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); font-weight: 650; }
.wl-item.dev { border-color: var(--warn); color: var(--warn); }
.wl-flies label { display: flex; gap: 8px; align-items: center; min-height: 36px; }
#wl-addr { word-break: break-all; }
.link { background: none; border: 0; color: var(--warn); text-decoration: underline; padding: 0; }
.field { display: grid; gap: 4px; margin: 10px 0; font-size: 13px; }
.field input { min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: var(--ink); padding: 0 10px; font-size: 16px; }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btns .danger { border-color: var(--bad); color: var(--bad); }
.costs li { font-size: 13px; } .costs .total { font-weight: 800; }
.err { color: var(--bad); font-size: 13px; }
.mg-det summary { cursor: pointer; font-size: 12px; opacity: .8; } .mg-det li { font-size: 12px; overflow-wrap: anywhere; }
.finish { width: auto; margin: 0 auto 8px; display: block; padding: 0 18px; pointer-events: auto; }
@media (max-width: 420px) { .btns { grid-template-columns: 1fr; } }
.sync-banner { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 50; padding: 4px 12px; border-radius: 12px; background: var(--panel, #222); color: var(--dim, #aaa); font-size: 12px; }
.sync-banner[hidden] { display: none; }
/* UX1: phone drawer, merged status pill, compact chrome, share for any fly */
.tools .drawer-only, .side-handle { display: none; }
.side-handle { position: fixed; z-index: 4; right: var(--sar); top: 50%; transform: translateY(-50%); width: 44px; height: 56px; padding: 0; border: 0; background: none; }
.side-handle span { display: flex; align-items: center; justify-content: center; width: 28px; height: 44px; margin-left: auto; border-radius: 12px 0 0 12px; background: var(--glass-2); border: 1px solid var(--line); border-right: 0; font-size: 18px; }
.follow-bar { position: fixed; z-index: 3; left: 50%; transform: translateX(-50%); bottom: calc(120px + var(--sab)); display: flex; gap: 6px; pointer-events: none; }
.follow-bar > * { pointer-events: auto; }
.follow-bar .back-mine { position: static; transform: none; }
.share-pill { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; background: #ffd84a; color: #2a1d05; font-weight: 800; text-decoration: none; white-space: nowrap; }
.share-row { display: flex; gap: 8px; } .share-row .follow-btn { flex: 1; }
.copy-url { width: 100%; margin-top: 8px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: var(--ink); padding: 0 10px; font-size: 13px; }
.brain-slot { position: absolute; z-index: 31; left: calc(8px + var(--sal)); bottom: calc(100% + 8px + var(--bph, 0px)); width: 44px; height: 44px; display: grid; place-items: center; padding: 0; background: none; border: 0; color: var(--ink); pointer-events: auto; }
.brain-slot[hidden] { display: none; }
.brain-slot::before { content: ""; position: absolute; width: 32px; height: 32px; border-radius: 50%; background: var(--glass-2); border: 1px solid var(--line); }
.brain-slot::after { content: ""; position: relative; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--brain-svg) center / contain no-repeat; mask: var(--brain-svg) center / contain no-repeat; }
.brain-slot.on::before { animation: bpulse .5s ease-out; } .brain-slot[aria-expanded="true"] { color: #9fe8ff; }
@keyframes bpulse { 30% { transform: scale(1.22); box-shadow: 0 0 12px #4ac8ff; } }
:root { --brain-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7'%3E%3Cpath d='M12 7.5c-2-1.6-5.4-1.2-5.6 1.6-.2 2.6 2 4.6 5.6 4.6s5.8-2 5.6-4.6C17.4 6.3 14 5.9 12 7.5zM6.2 6.4C4 6 2.6 8 2.8 10.5c.2 2.4 1.8 3.9 3.6 3.2M17.8 6.4c2.2-.4 3.6 1.6 3.4 4.1-.2 2.4-1.8 3.9-3.6 3.2M12 13.7c-1.6 0-2.4 1.1-2.2 2.2.2 1 1.1 1.4 2.2 1.4s2-.4 2.2-1.4c.2-1.1-.6-2.2-2.2-2.2zM12 17.3V21'/%3E%3C/svg%3E"); }
body.brain-open .follow-bar, body.brain-open .toast, body.brain-open .side-handle { display: none; }
body:has(#finish-action:not([hidden])) .follow-bar { display: none; }
@media (orientation: landscape) and (max-height: 520px) { body.brain-open .dock-wrap { right: calc(var(--bpw, 0px) + 8px); } }
@media (max-width: 600px) and (orientation: portrait), (orientation: landscape) and (max-height: 520px) {
  .side-handle, .tools .drawer-only { display: grid; }
  .tools { display: none; flex-direction: column; top: 50%; transform: translateY(-50%); right: calc(6px + var(--sar)); padding: 4px; gap: 4px; border-radius: 16px; background: var(--glass-2); border: 1px solid var(--line); z-index: 4; }
  body.tools-open .tools { display: flex; } body.tools-open .side-handle { display: none; }
  .tools button { width: 44px; height: 44px; border-radius: 12px; }
  .tools svg { width: 19px; height: 19px; }
  .hud { right: calc(10px + var(--sar)); align-items: center; top: calc(6px + var(--sat)); left: calc(6px + var(--sal)); }
  .hud .card { padding: 5px 10px; min-width: 0; max-width: 60vw; border-radius: 12px; }
  .hud .card .row { gap: 4px; } #epoch { font-size: 15px; } .label { font-size: 12px; }
  .behavior { font-size: 12px; margin: 0 0 4px; }
  .ticker { display: none; }
  .right .wallet-btn, #presence, #sim-tag { display: none !important; }
  .acct { display: contents; }
  .new-fly { position: fixed; z-index: 3; top: calc(var(--hud-b, 60px) + 8px); right: calc(10px + var(--sar)); width: 44px; height: 44px; padding: 0; justify-content: center; }
  .new-fly span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  body.cta-on .new-fly, body.tools-open .new-fly, body:has(.sheet:not([hidden])) .new-fly { display: none; }
  .right { flex-direction: row; }
  .chip { min-height: 32px; padding: 4px 10px; font-size: 12px; display: inline-block; line-height: 24px; }
  .right { flex: none; }
  .chip::before { display: inline-block; margin-right: 5px; vertical-align: 1px; }
  .dock-wrap { bottom: calc(6px + var(--sab)); flex-direction: column; }
  .dock { padding: 4px; gap: 4px; border-radius: 18px; }
  .dock button { min-height: 52px; font-size: 12px; gap: 1px; border-radius: 14px; }
  .dock button svg { width: 24px; height: 24px; }
  .follow-bar { bottom: calc(76px + var(--sab)); }
  .toast { bottom: calc(148px + var(--sab)); }
  .badge-toast { top: calc(var(--hud-b, 120px) + 10px); }
}
@media (orientation: landscape) and (max-height: 520px) {
  .tools { top: 50%; } .hud .card { max-width: 40vw; } .toast { bottom: calc(176px + var(--sab)); }
  .dock button { min-height: 48px; }
}
.dock { position: relative; }
.dock .why { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; }
@media (max-width: 600px) and (orientation: portrait), (orientation: landscape) and (max-height: 520px) {
  .dock .why { z-index: 1; font-size: 13px; padding: 8px 14px; }
  .hud .card { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; align-items: baseline; }
  .hud .card > :not(.row) { grid-column: 1 / -1; }
  .behavior { margin: 0 0 4px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .tools { display: none; grid-auto-flow: column; grid-template-rows: repeat(5, 44px); }
  body.tools-open .tools { display: grid; }
}
@media (max-width: 600px) and (orientation: portrait), (orientation: landscape) and (max-height: 520px) {
  .dock button { min-height: 48px; }
  .hud .card { max-width: 56vw; }
  .side-handle { height: 48px; }
}
@media (max-width: 600px) and (orientation: portrait) {
  .behavior { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
}
#glnote { bottom: auto; top: calc(64px + var(--sat)); }
.follow-btn, .wl-item, .btns button { min-height: 48px; }
.follow-btn.primary { background: #ffd84a; color: #2a1d05; border-color: #fff3b0; font-weight: 800; }
.follow-btn.primary:disabled { opacity: .55; cursor: progress; }
.follow-btn.secondary { background: transparent; color: var(--ink); }
.total-line { margin: 12px 0 2px; font-size: 14px; font-weight: 750; }
.step-line { margin: 10px 0 0; color: var(--ink); font-weight: 650; }
#cr-adv .sub { margin: 0 0 6px; }
#cr-det .costs { margin: 6px 0 0; }
.follow-btn.copied { background: rgba(126, 224, 138, .28); border-color: var(--ok); color: var(--ok); animation: copied .35s cubic-bezier(.2,.9,.2,1.4); }
@keyframes copied { 40% { transform: scale(1.06); } }
.cta { pointer-events: auto; width: min(420px, 100%); margin: 0; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
#wl-conn .ids dt { white-space: nowrap; }
#wl-conn .ids dd { word-break: normal; white-space: pre-line; min-width: 0; }
@media (max-width: 819px), (max-height: 559px) { body:has(.sheet:not([hidden])) .toast { top: calc(var(--hud-b, 60px) + 8px); bottom: auto; } }
.bv-rp { position: relative; overflow: visible; }
.bv-rp::before { content: attr(data-tip); position: absolute; top: 50%; right: calc(100% + 8px); transform: translateY(-50%); width: max-content; max-width: min(250px, 60vw); padding: 6px 9px; border-radius: 8px; background: rgba(20,18,14,.94); color: #f6f1e4; font: 500 12px/1.35 system-ui, sans-serif; white-space: normal; text-align: left; pointer-events: none; opacity: 0; z-index: 30; }
@media (hover: hover) { .bv-rp:hover::before { opacity: 1; } }
.bv-rp:focus-visible::before, .bv-rp.tip-on::before { opacity: 1; }
.bv-rp:disabled { opacity: .35; cursor: default; }
#topup-ask .ta-btns { display: flex; gap: 8px; }
#topup-ask .ta-btns button { flex: 1; }
.mwa-gate { position: fixed; z-index: 33; left: 16px; right: 16px; bottom: calc(24px + var(--sab)); padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: #1e2618; box-shadow: 0 -12px 40px rgba(0,0,0,.5); text-align: center; }
.mwa-gate p { margin: 0; font-weight: 700; }
.energy-row .energy-lbl { display: flex; align-items: baseline; gap: 4px; font-size: 12px; opacity: .9; margin: 6px 0 4px; }
#energy-delta { font-style: normal; font-weight: 800; color: #ff9a6a; opacity: 0; }
#energy-delta.up { color: #7ee08a; }
#energy-delta.pop { animation: edelta 2.4s ease-out forwards; }
@keyframes edelta { 0% { opacity: 0; transform: translateY(4px); } 12%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.fly-pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 0 6px; border-radius: 12px; border: 1px solid var(--line); background: rgba(20, 24, 36, .78); color: var(--ink); font-weight: 800; }
.fly-pick span { flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fly-pick button { width: 44px; height: 40px; border: 0; border-radius: 10px; background: rgba(255,255,255,.1); color: inherit; font-size: 22px; }
.board { list-style: none; margin: 10px 0 0; padding: 0; display: grid; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.04); }
.board li + li { border-top: 1px solid var(--line); }
.board button, .board-head { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 8px; width: 100%; padding: 0 12px; text-align: left; }
.board button { min-height: 36px; border: 0; border-radius: 0; background: transparent; color: var(--ink); font-size: 14px; }
.board button.mine { background: rgba(255, 216, 74, .16); }
.board b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-head { min-height: 26px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); } .board-head b { font-weight: 600; }
.board-more button, .board-more p { display: block; width: 100%; margin: 0; padding: 0 12px; line-height: 36px; text-align: center; color: var(--dim); font-size: 13px; }
.fl-find { width: 100%; min-height: 36px; margin-top: 10px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--ink); font: inherit; font-size: 16px; }
@media (pointer: fine) { .board button { min-height: 30px; } .board-more button, .board-more p { line-height: 30px; } .fl-find { font-size: 14px; } }
.board i { font-style: normal; opacity: .7; font-variant-numeric: tabular-nums; } .board span { opacity: .75; font-size: 13px; font-variant-numeric: tabular-nums; }
.follow-bar { width: max-content; max-width: calc(100vw - 24px); } .follow-bar .back-mine { min-width: 0; white-space: normal; text-align: left; overflow: hidden; } .follow-bar .back-mine span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.follow-bar .share-pill { flex-shrink: 0; }
#ask, #topup-ask { z-index: 32; }
@media (max-width: 600px) and (orientation: portrait) { body:not(.brain-open):not(:has(#finish-action:not([hidden]))):has(#back-mine:not([hidden])) .brain-slot { position: fixed; bottom: calc(126px + var(--sab)); } }
/* UI10: icons */
.ic { width: 18px; height: 18px; flex: none; }
.ic-in { width: .95em; height: .95em; margin-left: .25em; vertical-align: -.12em; }
.close { display: grid; place-items: center; padding: 0; color: var(--ink); cursor: pointer; } .close .ic { width: 20px; height: 20px; }
.chip a .ic-in { flex: none; }
.chip .pv { display: none; align-items: center; gap: 3px; margin-left: 6px; padding-left: 6px; border-left: 1px solid var(--line); color: var(--dim); font-weight: 650; vertical-align: middle; line-height: 1; }
.chip .pv .ic { width: 14px; height: 14px; }
.trophy-list i { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); color: var(--dim); }
.trophy-list li.got i { background: rgba(255, 216, 74, .18); border-color: rgba(255, 216, 74, .6); color: #ffd84a; }
.trophy-list i .ic { width: 20px; height: 20px; }
.badge-toast .ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 216, 74, .18); border: 1px solid rgba(255, 216, 74, .6); color: #ffd84a; }
.badge-toast .ic .ic { width: 22px; height: 22px; border: 0; background: none; }
.badge-toast.small .ic { width: 36px; height: 36px; } .badge-toast.small .ic .ic { width: 18px; height: 18px; }
/* UI10: one button system */
.follow-btn, .btns button, .wl-item, .share-pill, .back-mine, .wallet-btn, .new-fly { min-height: 44px; border-radius: 12px; font-family: inherit; font-size: 14px; line-height: 1.2; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.follow-btn, .btns button, .share-pill, .back-mine { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 14px; }
.follow-btn, .btns button, .wl-item { background: rgba(255, 255, 255, .07); border: 1px solid var(--line); color: var(--ink); }
.follow-btn.primary, .share-pill { background: #ffd84a; color: #2a1d05; border: 1px solid #fff3b0; font-weight: 800; }
.follow-btn.secondary { background: transparent; }
.btns .danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.follow-btn:disabled, .btns button:disabled, .wl-item:disabled, .icon-btn:disabled { opacity: .5; cursor: not-allowed; }
.follow-btn:focus-visible, .btns button:focus-visible, .wl-item:focus-visible, .share-pill:focus-visible, .back-mine:focus-visible, .wallet-btn:focus-visible, .new-fly:focus-visible, .icon-btn:focus-visible, .fly-pick button:focus-visible, .board button:focus-visible { outline: 2px solid var(--warn); outline-offset: 2px; }
.back-mine { min-width: 0; border: 1px solid rgba(255, 226, 138, .6); background: var(--glass); color: var(--ink); }
.back-mine span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); cursor: pointer; }
.icon-btn[hidden] { display: none; }
.wallet-btn, .new-fly { border-radius: 12px; }
.fly-pick button { display: grid; place-items: center; padding: 0; }
.fly-pick button .ic { width: 20px; height: 20px; }
@media (pointer: fine) { .wallet-btn, .new-fly { min-height: 36px; } .sheet .follow-btn, .sheet .btns button, .wl-item { min-height: 40px; } }
@media (max-width: 600px) and (orientation: portrait), (orientation: landscape) and (max-height: 520px) { .chip .pv { display: inline-flex; } }
/* phones: the status chip never covers the fly's card: the card keeps 40% of the bar and a long status wraps under itself */
@media (max-width: 600px) and (orientation: portrait), (orientation: landscape) and (max-height: 520px) {
  .hud .card { flex: 0 100 auto; min-width: 40vw; }
  .hud .right { flex: none; min-width: 0; max-width: calc(100% - 40vw - 10px); }
  .chip { white-space: normal; line-height: 16px; padding: 8px 10px; min-width: 0; }
}
/* phone held sideways: the brain button in the free bottom-left corner, clear of the bar in the middle */
@media (orientation: landscape) and (max-height: 520px) { .brain-slot { position: fixed; left: calc(8px + var(--sal)); bottom: calc(8px + var(--sab)); } }
/* short phones: the tools drawer in two columns, clear of the status chip and of the bar above the dock */
@media (max-width: 600px) and (orientation: portrait) and (max-height: 700px) { body.tools-open .tools { display: grid; grid-auto-flow: column; grid-template-rows: repeat(5, 44px); } }
/* My fly: fly and balance, fee share, three rows to open */
#wl-conn .zone { padding: 16px 0; border-top: 1px solid var(--line); display: grid; gap: 12px; }
#wl-conn .zone.first { border-top: 0; padding-top: 8px; }
#wl-conn .follow-btn, #wl-conn .field, #wl-conn .wl-flies, #wl-conn p { margin: 0; }
#ss-panel { display: grid; gap: 12px; }
.wl-flies label { gap: 9px; font-size: 17px; font-weight: 750; cursor: pointer; }
.wl-flies small { font-size: 13px; font-weight: 500; color: var(--dim); }
.wl-flies input { appearance: none; -webkit-appearance: none; flex: none; width: 10px; height: 10px; margin: 0; border-radius: 50%; border: 1.5px solid var(--dim); }
.wl-flies input:checked { background: var(--ok); border-color: var(--ok); }
.bal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.bal .n { font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bal .s, #ss-why { font-size: 13px; color: var(--dim); }
#wl-conn details > summary { list-style: none; cursor: pointer; }
#wl-conn details > summary::-webkit-details-marker { display: none; }
.topup[open] { flex-basis: 100%; }
.topup > summary { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .07); font-size: 14px; font-weight: 700; }
#ss-panel:has(> #ss-renew:not([hidden])) .topup > summary { display: none; }
.topup .in { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.topup .btns { display: block; } .topup .btns button { padding: 0 18px; }
.hs-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.hs-top b { font-size: 15px; }
.hs-top .c { font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
.hs-top .c.ok { color: var(--ok); } .hs-top .c.bad { color: var(--bad); } .hs-top .c.warn { color: var(--warn); }
.bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: #ffd84a; }
.hs-line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.hs-line .amt { font-weight: 750; font-variant-numeric: tabular-nums; }
.hs-line .dim, .hs-line #hs-left { color: var(--dim); white-space: nowrap; }
.hs-say { font-size: 14px; }
.more > summary { display: flex; align-items: center; gap: 6px; min-height: 28px; font-size: 13px; color: var(--dim); }
.more > summary::after, .row > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--dim); border-bottom: 2px solid var(--dim); transform: rotate(-45deg); transition: transform .15s; }
.more[open] > summary::after, .row[open] > summary::after { transform: rotate(45deg); }
.more .ids, .row .ids { gap: 6px 14px; font-size: 13px; }
.more .ids { margin: 8px 0 0; }
.rows { padding: 6px 0 0; border-top: 1px solid var(--line); }
.row > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-size: 15px; font-weight: 650; }
.row > summary small { margin-left: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 500; color: var(--dim); }
.row .in { display: grid; gap: 8px; padding: 2px 0 14px; }
.btns.solo { grid-template-columns: 1fr; } .btns.solo:has(> [hidden]) { display: none; }
#wl-row-in { display: flex; gap: 8px; } #wl-row-in > * { flex: 1; }
@media (prefers-reduced-motion: reduce) { .more > summary::after, .row > summary::after { transition: none; } }
