/* Sudo AI — app */
body.app { height: 100vh; height: 100dvh; overflow: hidden; }
.app-rain { position: fixed; inset: 0; width: 100%; height: 100%; opacity: .16; z-index: 0; }
.app svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app .social svg, .wallet-opt svg { stroke: none; }
.app .social svg path[fill='none'] { stroke: currentColor; }
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 290px 1fr; height: 100%; }

.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: rgba(57,255,136,.03); display: inline-grid; place-items: center; cursor: pointer; color: var(--gdim); transition: .2s; flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover:not(:disabled) { color: var(--g); border-color: var(--line2); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.link-btn { border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; }
.link-btn:hover { color: var(--red); }
.danger { color: var(--red) !important; }
kbd { font: 11px var(--mono); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line2); background: rgba(57,255,136,.05); color: var(--gdim); }

/* ---------- sidebar ---------- */
.side { display: flex; flex-direction: column; gap: 14px; padding: 18px 14px 14px; background: rgba(2, 8, 5, .92); border-right: 1px solid var(--line); backdrop-filter: blur(16px); min-height: 0; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.side-top .brand { font-size: 17px; }
.side-close { display: none; }
.new-chat svg { width: 18px; height: 18px; stroke-width: 2.4; }
.side-search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.3); }
.side-search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.side-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: 14px var(--sans); }
.side-search:focus-within { border-color: var(--line2); }
.side-label { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.conv-list { flex: 1; overflow-y: auto; margin: -4px -6px 0; padding: 0 6px; min-height: 60px; }
.conv-group { font: 500 11px var(--mono); color: #4f6b5c; padding: 12px 8px 6px; }
.conv { display: flex; align-items: center; gap: 8px; padding: 9px 8px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; transition: background .15s; }
.conv:hover { background: rgba(57,255,136,.05); }
.conv.active { background: rgba(57,255,136,.09); border-color: var(--line2); }
.conv-ic { font: 700 14px var(--mono); color: var(--g3); }
.conv.active .conv-ic { color: var(--g); }
.conv-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-txt b { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-txt small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-del { opacity: 0; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.conv-del svg { width: 16px; height: 16px; }
.conv:hover .conv-del, .conv.active .conv-del { opacity: 1; }
.conv-del:hover { color: var(--red); background: rgba(255,93,108,.1); }
.conv-empty { padding: 18px 10px; font-size: 13.5px; color: var(--muted); text-align: center; }
.side-bottom { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.mini-token { padding: 14px; border-radius: 14px; border: 1px solid var(--line2); background: radial-gradient(ellipse at 0 0, rgba(57,255,136,.12), transparent 60%), rgba(0,0,0,.3); display: flex; flex-direction: column; gap: 10px; }
.mini-token-top { display: flex; gap: 10px; align-items: center; }
.mini-token-top > div { display: flex; flex-direction: column; line-height: 1.3; }
.mini-token-top .muted { font-size: 12.5px; }
.mini-coin { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(57,255,136,.5); display: grid; place-items: center; background: #031008; box-shadow: 0 0 18px -4px rgba(57,255,136,.6); }
.mini-coin img { width: 22px; height: 22px; }
.ca-mini { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(0,0,0,.4); cursor: pointer; color: var(--g); }
.ca-mini code { font: 12.5px var(--mono); }
.ca-mini svg { width: 15px; height: 15px; }
.mini-more { font-size: 13px; }
.side-bottom .socials:empty { display: none; }
.side-scrim { display: none; }

/* ---------- main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(1, 5, 3, .7); backdrop-filter: blur(14px); flex: none; }
.menu-btn { display: none; }
.modes { display: flex; padding: 4px; gap: 4px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.35); }
.mode { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; transition: .2s; }
.mode svg { width: 17px; height: 17px; }
.mode.active { background: rgba(57,255,136,.13); color: var(--g); box-shadow: inset 0 0 0 1px rgba(57,255,136,.25); }
.mode:not(.active):hover { color: var(--text); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.meters { display: flex; gap: 14px; }
.meter { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline; font: 12px var(--mono); }
.meter-k { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; }
.meter-v { color: var(--g); font-weight: 700; }
.meter-bar { grid-column: 1 / -1; height: 3px; margin-top: 4px; border-radius: 3px; background: rgba(57,255,136,.12); overflow: hidden; width: 70px; }
.meter-bar i { display: block; height: 100%; background: var(--g); box-shadow: 0 0 8px var(--g); transition: width .4s; }
.wallet-wrap { position: relative; }
.wallet-btn { font-family: var(--mono); font-size: 13.5px; }
.wdot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.wallet-btn.on .wdot { background: var(--g); box-shadow: 0 0 8px var(--g); }
.wallet-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 290px; padding: 8px; border-radius: 14px; border: 1px solid var(--line2); background: rgba(3, 12, 7, .98); box-shadow: 0 20px 60px -10px #000; z-index: 30; animation: fadein .15s; }
.wm-addr { padding: 10px; display: flex; flex-direction: column; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.wm-addr .muted { font-size: 12px; }
.wm-addr code { font: 12px var(--mono); color: var(--g); word-break: break-all; }
.wm-row { display: flex; justify-content: space-between; padding: 6px 10px; font-size: 13.5px; }
.wm-row b { font-weight: 600; text-align: right; }
.wm-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.wm-item:hover { background: rgba(57,255,136,.07); }
.banner { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 9px 16px; font-size: 13.5px; color: var(--amber); background: rgba(255,193,77,.06); border-bottom: 1px solid rgba(255,193,77,.2); flex: none; text-align: center; }

.view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.view.active { display: flex; }

/* ---------- chat ---------- */
.chat-bar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; flex: none; }
.picker { position: relative; }
.picker-btn { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 12px 0 6px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(3, 12, 7, .85); cursor: pointer; min-width: 230px; text-align: left; transition: .2s; }
.picker-btn:hover { border-color: var(--g); }
.picker-btn .pbadge { width: 34px; height: 34px; font-size: 12px; }
.picker-txt { display: flex; flex-direction: column; flex: 1; line-height: 1.25; }
.picker-txt b { font-size: 14.5px; }
.picker-txt small { font-size: 12px; color: var(--muted); }
.chev { width: 18px; height: 18px; color: var(--muted); }
.picker-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 25; width: 340px; max-height: min(70vh, 560px); overflow-y: auto; padding: 8px; border-radius: 14px; border: 1px solid var(--line2); background: rgba(3, 12, 7, .98); box-shadow: 0 24px 70px -10px #000; animation: fadein .15s; }
.pop-title { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 10px 6px; }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 10px; cursor: pointer; text-align: left; }
.pop-item:hover { background: rgba(57,255,136,.07); }
.pop-item.sel { background: rgba(57,255,136,.11); }
.pop-item .pbadge { width: 32px; height: 32px; font-size: 11.5px; }
.pop-txt { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.pop-txt b { font-size: 14px; font-weight: 600; }
.pop-txt small { font-size: 12px; color: var(--muted); }
.pop-item.locked { opacity: .55; }
.lock { width: 16px; height: 16px; color: var(--amber); }
.tick { color: var(--g); font-weight: 700; }
.chat-tools { margin-left: auto; display: flex; gap: 8px; }

.messages { flex: 1; overflow-y: auto; padding: 10px 20px 20px; min-height: 0; scroll-behavior: smooth; }
.msgs-in { max-width: 860px; margin: 0 auto; }
.welcome { max-width: 760px; margin: 0 auto; padding: 7vh 0 20px; text-align: center; }
.welcome-logo { width: 74px; height: 74px; margin: 0 auto 22px; border-radius: 20px; display: grid; place-items: center; background: rgba(57,255,136,.06); border: 1px solid var(--line2); box-shadow: 0 0 60px -10px rgba(57,255,136,.6); }
.welcome-logo img { width: 52px; height: 52px; }
.welcome-title { font: 700 clamp(24px, 3.4vw, 34px) var(--mono); letter-spacing: -.02em; margin: 0 0 10px; color: var(--g); text-shadow: 0 0 24px rgba(57,255,136,.35); min-height: 1.3em; }
.welcome-title .cursor { height: .9em; margin-left: 4px; }
.suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 34px; text-align: left; }
.sug { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: rgba(3, 12, 7, .75); cursor: pointer; transition: .2s; text-align: left; }
.sug b { font: 600 12px var(--mono); color: var(--g); text-transform: uppercase; letter-spacing: .08em; }
.sug span { font-size: 14px; color: #c3dccd; }
.sug:hover { border-color: var(--line2); transform: translateY(-2px); box-shadow: var(--glow); }

.msg { display: flex; gap: 14px; padding: 18px 0; animation: fadein .25s; }
.msg + .msg { border-top: 1px solid rgba(57,255,136,.06); }
.av { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; font: 700 12px var(--mono); }
.av-you { background: rgba(255,193,77,.1); color: var(--amber); border: 1px solid rgba(255,193,77,.35); }
.av-ai { background: rgba(57,255,136,.1); color: var(--g); border: 1px solid var(--line2); }
.msg .pbadge.av { width: 34px; height: 34px; font-size: 12px; }
.msg-body { flex: 1; min-width: 0; }
.msg-name { display: flex; align-items: center; gap: 10px; font: 600 13px var(--mono); color: var(--gdim); margin-bottom: 4px; min-height: 22px; }
.msg-you .msg-name { color: var(--amber); }
.msg-act { margin-left: auto; opacity: 0; border: 1px solid var(--line); background: none; color: var(--muted); font: 12px var(--mono); padding: 2px 8px; border-radius: 6px; cursor: pointer; }
.msg:hover .msg-act { opacity: 1; }
.msg-act:hover { color: var(--g); border-color: var(--line2); }
.streaming .msg-act { display: none; }

.md { font-size: 15.5px; line-height: 1.7; color: #dcf5e6; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 12px; }
.md h3, .md h4, .md h5, .md h6 { margin: 18px 0 8px; line-height: 1.3; color: #fff; }
.md h3 { font-size: 20px; } .md h4 { font-size: 17px; } .md h5, .md h6 { font-size: 15.5px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 24px; }
.md li { margin: 4px 0; }
.md li.sub { margin-left: 20px; list-style-type: circle; }
.md li::marker { color: var(--g2); }
.md a { text-decoration: underline; text-underline-offset: 3px; }
.md strong { color: #fff; }
.md code { font: 13.5px var(--mono); background: rgba(57,255,136,.08); border: 1px solid rgba(57,255,136,.14); padding: 1px 6px; border-radius: 6px; color: #9dffc4; }
.md blockquote { margin: 0 0 12px; padding: 4px 0 4px 14px; border-left: 3px solid var(--g3); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.md .tbl { overflow-x: auto; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 10px; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; }
.md th, .md td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.md th { background: rgba(57,255,136,.06); color: var(--g); font-weight: 600; }
.md tr:last-child td { border-bottom: 0; }
.code { margin: 0 0 14px; border-radius: 12px; border: 1px solid var(--line2); background: #010704; overflow: hidden; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 14px; background: rgba(57,255,136,.05); border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
.code-copy { border: 1px solid var(--line); background: none; color: var(--gdim); font: 12px var(--mono); padding: 3px 10px; border-radius: 6px; cursor: pointer; }
.code-copy:hover { color: var(--g); border-color: var(--line2); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.code pre code { background: none; border: 0; padding: 0; font-size: 13.5px; line-height: 1.6; color: #b8f5d0; }
.md .cursor { width: 8px; height: 16px; margin-left: 2px; vertical-align: -2px; }
.thinking { display: flex; gap: 6px; padding: 8px 0; }
.thinking i { width: 8px; height: 8px; border-radius: 2px; background: var(--g); animation: think 1.1s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes think { 0%, 80%, 100% { opacity: .2; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

.composer { padding: 6px 20px 16px; flex: none; }
.composer-in { max-width: 860px; margin: 0 auto; display: flex; align-items: flex-end; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 18px; border: 1px solid var(--line2); background: rgba(3, 12, 7, .92); box-shadow: 0 0 0 4px rgba(57,255,136,.03), 0 20px 50px -20px #000; transition: border-color .2s, box-shadow .2s; }
.composer-in:focus-within { border-color: rgba(57,255,136,.6); box-shadow: 0 0 0 4px rgba(57,255,136,.08), 0 0 40px -10px rgba(57,255,136,.4); }
.composer-prompt { font: 700 18px/38px var(--mono); color: var(--g); }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--text); font: 15.5px/1.55 var(--sans); padding: 8px 0; max-height: 220px; min-height: 38px; }
.composer textarea::placeholder { color: #557463; }
.send-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; cursor: pointer; display: grid; place-items: center; background: linear-gradient(180deg, #4dff97, #19c862); color: #021108; flex: none; transition: .2s; }
.send-btn svg { width: 19px; height: 19px; stroke-width: 2.4; }
.send-btn:hover { box-shadow: 0 0 20px -2px rgba(57,255,136,.8); }
.send-btn:disabled { opacity: .4; cursor: default; box-shadow: none; }
.composer-meta { max-width: 860px; margin: 8px auto 0; display: flex; justify-content: space-between; font-size: 12px; color: #557463; padding: 0 6px; }

/* ---------- image studio ---------- */
.view-image { overflow-y: auto; }
.studio { display: grid; grid-template-columns: 380px 1fr; gap: 24px; padding: 22px; max-width: 1400px; width: 100%; margin: 0 auto; align-items: start; }
.studio-form { position: sticky; top: 0; padding: 22px; border-radius: 18px; border: 1px solid var(--line2); background: rgba(3, 12, 7, .9); }
.studio-title { font-size: 20px; margin: 0 0 16px; }
.field-label { display: block; font: 600 11.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 18px 0 8px; }
.studio-title + .field-label { margin-top: 0; }
.studio-form textarea { width: 100%; resize: vertical; border-radius: 12px; border: 1px solid var(--line2); background: rgba(0,0,0,.4); color: var(--text); font: 15px/1.5 var(--sans); padding: 12px 14px; outline: 0; min-height: 110px; }
.studio-form textarea:focus { border-color: rgba(57,255,136,.6); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0,0,0,.3); color: var(--muted); font-size: 13px; cursor: pointer; transition: .15s; }
.chip-btn:hover { color: var(--text); border-color: var(--line2); }
.chip-btn.active { color: var(--g); border-color: rgba(57,255,136,.5); background: rgba(57,255,136,.1); }
.aspects { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.aspect { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 8px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.3); color: var(--muted); font: 11.5px var(--mono); cursor: pointer; }
.aspect i { display: block; border: 1.5px solid currentColor; border-radius: 3px; }
.aspect-ic { height: 20px; display: grid; place-items: center; }
.aspect.active { color: var(--g); border-color: rgba(57,255,136,.5); background: rgba(57,255,136,.08); }
.img-models { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.imodel { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.3); cursor: pointer; text-align: left; transition: .15s; }
.imodel .pbadge { width: 32px; height: 32px; font-size: 11.5px; }
.imodel > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.imodel b { font-size: 14px; font-weight: 600; }
.imodel small { font-size: 12px; color: var(--muted); }
.imodel.active { border-color: rgba(57,255,136,.55); background: rgba(57,255,136,.08); }
.imodel.locked { opacity: .55; }

.stage { position: relative; min-height: 440px; border-radius: 18px; border: 1px solid var(--line2); background: radial-gradient(ellipse at center, rgba(57,255,136,.06), transparent 70%), rgba(3, 12, 7, .8); display: grid; place-items: center; overflow: hidden; }
.stage-empty, .stage-loading { text-align: center; color: var(--muted); }
.stage-empty svg { width: 56px; height: 56px; margin: 0 auto 10px; color: #2a5b3d; stroke-width: 1.2; }
.stage-loading { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.stage-loading p { font: 600 16px var(--mono); color: var(--g); margin: 18px 0 0; }
.dots::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.loader-grid { width: 120px; height: 120px; border-radius: 16px; border: 1px solid var(--line2); background:
  linear-gradient(90deg, transparent, rgba(57,255,136,.35), transparent) 0 0 / 50% 100% no-repeat,
  repeating-linear-gradient(0deg, rgba(57,255,136,.12) 0 1px, transparent 1px 12px),
  repeating-linear-gradient(90deg, rgba(57,255,136,.12) 0 1px, transparent 1px 12px);
  animation: sweep 1.3s linear infinite; box-shadow: 0 0 50px -10px rgba(57,255,136,.6); }
@keyframes sweep { from { background-position: -100% 0, 0 0, 0 0; } to { background-position: 200% 0, 0 0, 0 0; } }
.stage-img { margin: 0; width: 100%; height: 100%; display: flex; flex-direction: column; }
.stage-img img { width: 100%; max-height: 64vh; object-fit: contain; background: #000; cursor: zoom-in; animation: fadein .5s; }
.stage-img figcaption { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 14px; color: #c3dccd; }
.stage-img figcaption span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gallery-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 12px; }
.gallery-head h3 { margin: 0; font-size: 17px; }
.gallery-head .muted { font: 12.5px var(--mono); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gal-item { aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; padding: 0; cursor: pointer; background: #000; transition: .2s; }
.gal-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gal-item:hover { border-color: var(--g); box-shadow: var(--glow); }
.gal-item:hover img { transform: scale(1.05); }
.gal-empty { grid-column: 1 / -1; padding: 30px; text-align: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--line); border-radius: 14px; }

/* ---------- gate ---------- */
.gate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(1, 3, 2, .72); backdrop-filter: blur(10px); animation: fadein .3s; overflow-y: auto; }
.gate-card { width: min(460px, 100%); padding: 34px 30px 26px; border-radius: 22px; border: 1px solid var(--line2); background: radial-gradient(ellipse at 50% 0, rgba(57,255,136,.14), transparent 60%), rgba(3, 12, 7, .97); text-align: center; box-shadow: 0 40px 100px -20px #000, 0 0 80px -30px rgba(57,255,136,.6); }
.gate-logo { width: 68px; height: 68px; margin: 0 auto 18px; }
.gate-logo img { width: 100%; height: 100%; filter: drop-shadow(0 0 20px rgba(57,255,136,.6)); }
.gate-kicker { font: 500 12px var(--mono); color: var(--g); letter-spacing: .1em; text-transform: uppercase; }
.gate-card h2 { font-size: 26px; letter-spacing: -.02em; margin: 8px 0 8px; }
.gate-card > p { margin: 0 0 22px; font-size: 14.5px; }
.gate-card > p b { color: var(--text); }
.wallet-list { display: flex; flex-direction: column; gap: 8px; }
.wallet-opt { display: flex; align-items: center; gap: 14px; height: 58px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(0,0,0,.35); cursor: pointer; transition: .2s; text-align: left; }
.wallet-opt svg { width: 32px; height: 32px; border-radius: 8px; flex: none; }
.wallet-opt b { flex: 1; font-size: 16px; font-weight: 600; }
.wallet-opt:hover { border-color: var(--g); background: rgba(57,255,136,.06); }
.wallet-opt.ready { border-color: var(--line2); }
.wallet-opt.loading { pointer-events: none; opacity: .7; }
.wallet-opt.loading > span:last-child { visibility: hidden; position: relative; }
.wallet-opt.loading::after { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--g); border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.w-detected { font: 600 11px var(--mono); color: var(--g); text-transform: uppercase; letter-spacing: .06em; }
.w-install, .w-open { font-size: 13px; color: var(--muted); }
.gate-perks { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin: 22px 0 18px; font-size: 13px; color: var(--muted); }
.gate-perks b { color: var(--g); }
.gate-back { font-size: 13.5px; color: var(--muted); }
.gate-back:hover { color: var(--g); }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.9); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 30px; animation: fadein .2s; }
.lightbox figure { margin: 0; max-width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; border: 1px solid var(--line2); background: #020805; }
.lightbox img { max-width: 100%; max-height: 72vh; object-fit: contain; margin: 0 auto; background: #000; }
.lightbox figcaption { padding: 14px 16px; }
.lightbox figcaption p { margin: 0 0 10px; color: #d6f2e1; font-size: 14.5px; }
.lb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lb-actions .muted { flex: 1; font: 12px var(--mono); min-width: 200px; }
.lb-close { position: absolute; top: 16px; right: 16px; background: rgba(0,0,0,.6); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .studio { grid-template-columns: 1fr; }
  .studio-form { position: static; }
  .meters .meter-bar { width: 52px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 70; top: 0; bottom: 0; left: 0; width: min(310px, 86vw); transform: translateX(-102%); transition: transform .3s cubic-bezier(.2,.7,.2,1); }
  .side-open .side { transform: none; box-shadow: 30px 0 80px #000; }
  .side-close, .menu-btn { display: inline-grid; }
  .side-open .side-scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0,0,0,.6); }
  .topbar { padding: 0 12px; gap: 10px; }
  .meters { display: none !important; }
  .chat-bar { flex-wrap: wrap; padding: 10px 12px; }
  .picker { flex: 1; }
  .picker-btn { min-width: 0; width: 100%; }
  .messages { padding: 6px 14px 14px; }
  .composer { padding: 4px 12px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .composer-meta span:first-child { display: none; }
}
@media (max-width: 560px) {
  .mode span { display: none; }
  .mode { padding: 0 12px; }
  .top-right { gap: 8px; }
  .wallet-btn #walletLabel { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
  .suggest { grid-template-columns: 1fr; }
  .welcome { padding-top: 3vh; }
  .studio { padding: 12px; }
  .picker-pop { width: calc(100vw - 24px); }
  .wallet-menu { width: min(290px, calc(100vw - 24px)); }
  .aspects { grid-template-columns: repeat(5, 1fr); }
}

/* agents + artists */
.agent-desc { flex: 1; min-width: 0; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artists { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.artist { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 9px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.3); cursor: pointer; transition: .15s; text-align: center; }
.artist .pbadge { width: 30px; height: 30px; margin-bottom: 2px; }
.artist b { font-size: 13px; font-weight: 600; }
.artist small { font-size: 11px; color: var(--muted); line-height: 1.2; }
.artist:hover { border-color: var(--line2); }
.artist.active { border-color: rgba(57,255,136,.55); background: rgba(57,255,136,.08); }
.gen-btn { margin-top: 20px; }
@media (max-width: 900px) { .agent-desc { order: 3; width: 100%; flex: none; white-space: normal; } }
