/* HUSH app shell. Loaded after style.css. */
html, body { height:100%; }
body { overflow:hidden; }
.app { display:grid; grid-template-columns:252px 1fr; height:100vh; height:100dvh; }
.demobar { flex:none; background:#14121f; border-bottom:1px solid rgba(143,123,255,.3); color:#c4bcff; font:11.5px/1.4 var(--mono); padding:8px 20px; }
.demobar b { color:#fff; font-weight:600; }
.demobar a { color:#fff; text-decoration:underline; text-underline-offset:3px; margin-left:4px; white-space:nowrap; }

/* sidebar */
.side { background:var(--bg2); border-right:1px solid var(--line); display:flex; flex-direction:column; min-height:0; }
.side .brand { padding:18px 18px 14px; }
.side .new { margin:4px 14px 14px; justify-content:flex-start; border-radius:12px; height:40px; }
.snav { padding:0 10px; display:grid; gap:2px; }
.snav button { display:flex; align-items:center; gap:11px; width:100%; background:none; border:0; padding:9px 10px; border-radius:9px; font:500 13.5px var(--sans); color:var(--muted); cursor:pointer; text-align:left; }
.snav button:hover { background:rgba(255,255,255,.03); color:var(--text); }
.snav button.on { background:var(--panel2); color:var(--text); }
.snav svg { width:17px; height:17px; flex:none; }
.snav .badge { margin-left:auto; font:500 10.5px var(--mono); color:var(--muted); background:var(--panel2); border:1px solid var(--line2); border-radius:6px; padding:1px 6px; }
.snav button.on .badge { background:var(--bg); }
.side .lbl { font:500 10.5px var(--mono); letter-spacing:.12em; text-transform:uppercase; color:var(--dim); padding:20px 20px 8px; display:flex; justify-content:space-between; }
.convs { flex:1; overflow-y:auto; padding:0 10px; min-height:0; }
.convs button { display:block; width:100%; text-align:left; background:none; border:0; padding:8px 10px; border-radius:8px; font-size:13px; color:var(--muted); cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.convs button:hover { color:var(--text); background:rgba(255,255,255,.03); }
.convs button.on { color:var(--text); background:var(--panel); }
.convs .empty { font-size:12.5px; color:var(--dim); padding:4px 10px; }
.side .foot { border-top:1px solid var(--line); padding:14px 18px; font-size:11.5px; color:var(--dim); line-height:1.5; }
.side .foot button { background:none; border:0; padding:0; color:var(--muted); text-decoration:underline; cursor:pointer; font-size:11.5px; }

/* main */
.main { display:flex; flex-direction:column; min-width:0; min-height:0; }
.top { height:60px; flex:none; display:flex; align-items:center; gap:12px; padding:0 20px; border-bottom:1px solid var(--line); }
.top h1 { font:600 15px var(--sans); margin:0; white-space:nowrap; }
.top .sp { flex:1; }
.burger { display:none; background:none; border:0; padding:6px; cursor:pointer; }
.burger svg { width:20px; height:20px; }
.pill { display:inline-flex; align-items:center; gap:8px; height:34px; padding:0 12px; border-radius:999px; border:1px solid var(--line2); font:500 11.5px var(--mono); color:var(--muted); background:none; cursor:pointer; white-space:nowrap; }
.pill.key-on { color:var(--live); border-color:rgba(62,240,166,.35); }
.seg { display:inline-flex; border:1px solid var(--line2); border-radius:999px; padding:3px; }
.seg button { border:0; background:none; font:500 12px var(--sans); color:var(--muted); padding:5px 12px; border-radius:999px; cursor:pointer; }
.seg button.on { background:var(--panel2); color:var(--text); }
.wallet.on { border-color:var(--line2); background:var(--panel); color:var(--text); }
.wallet .av { width:18px; height:18px; border-radius:50%; background:conic-gradient(from 40deg,#8f7bff,#3ef0a6,#ffb547,#8f7bff); }
.mainnet-warn { display:none; background:rgba(255,181,71,.08); border-bottom:1px solid rgba(255,181,71,.25); color:var(--warn); font:12px var(--mono); padding:8px 20px; }
body.mainnet .mainnet-warn { display:block; }

.body { flex:1; display:grid; grid-template-columns:1fr 320px; min-height:0; }
.body.full { grid-template-columns:1fr; }
.body.full .rp { display:none; }
.view { display:none; min-height:0; overflow-y:auto; }
.view.on { display:flex; flex-direction:column; }
.pad { padding:28px 32px 60px; max-width:1100px; width:100%; }

/* right panel */
.rp { border-left:1px solid var(--line); overflow-y:auto; padding:16px; display:grid; gap:14px; align-content:start; background:var(--bg2); }
.box { background:var(--panel); border:1px solid var(--line); border-radius:var(--r); padding:16px; }
.box h5 { margin:0 0 12px; font:500 10.5px var(--mono); letter-spacing:.12em; text-transform:uppercase; color:var(--muted); display:flex; justify-content:space-between; align-items:center; }
.bal { font:400 44px/1 var(--serif); display:flex; align-items:baseline; gap:8px; }
.bal small { font:500 13px var(--mono); color:var(--muted); }
.usd { font:12px var(--mono); color:var(--muted); margin:6px 0 14px; }
.row2 { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.row2 .btn { width:100%; border-radius:10px; }
.kline { display:flex; justify-content:space-between; font:12px var(--mono); color:var(--muted); padding:5px 0; }
.kline b { color:var(--text); font-weight:500; }
.box .bar { margin:10px 0 4px; }
.mini { font-size:12px; color:var(--muted); line-height:1.5; margin:10px 0 0; }
.meter { display:flex; gap:3px; margin:8px 0; }
.meter i { flex:1; height:18px; border-radius:3px; background:var(--panel2); }
.meter i.on { background:var(--live); opacity:.85; }

/* chat */
.chat { flex:1; display:flex; flex-direction:column; min-height:0; }
.msgs { flex:1; overflow-y:auto; padding:30px 0 10px; }
.msgs .in { max-width:760px; margin:0 auto; padding:0 24px; }
.hello { text-align:center; padding:8vh 0 20px; }
.hello h2 { font:400 clamp(40px,5vw,60px)/1 var(--serif); margin:16px 0 12px; }
.hello h2 em { color:var(--accent2); }
.hello p { color:var(--muted); margin:0 auto; max-width:440px; }
.sugs { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:34px; text-align:left; }
.sugs button { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:14px; cursor:pointer; font-size:13.5px; color:#cfcdc8; line-height:1.4; }
.sugs button:hover { border-color:var(--line2); }
.sugs button span { display:block; font:10.5px var(--mono); color:var(--accent2); margin-bottom:6px; letter-spacing:.06em; text-transform:uppercase; }
.vprops { display:flex; gap:22px; justify-content:center; flex-wrap:wrap; margin-top:26px; font:11.5px var(--mono); color:var(--muted); }
.vprops span { display:flex; gap:7px; align-items:center; }
.vprops svg { width:13px; height:13px; color:var(--live); }
@media (max-width:760px){ .sugs { grid-template-columns:1fr; } }

.msg { margin:0 0 26px; animation:in .3s ease; }
.msg.user { display:flex; justify-content:flex-end; }
.msg.user .txt { background:var(--panel2); border:1px solid var(--line2); border-radius:16px 16px 4px 16px; padding:11px 15px; max-width:80%; white-space:pre-wrap; }
.msg.ai .who { display:flex; align-items:center; gap:8px; font:500 11.5px var(--mono); color:var(--muted); margin-bottom:8px; }
.msg.ai .who svg { width:18px; height:18px; }
.msg.ai .txt { color:#dedcd7; }
.msg.ai .txt p { margin:0 0 12px; }
.msg.ai .txt ul, .msg.ai .txt ol { margin:0 0 12px; padding-left:20px; }
.msg.ai .txt li { margin:4px 0; }
.msg.ai .txt code { font:12.5px var(--mono); background:var(--panel2); padding:1px 5px; border-radius:5px; }
.msg.ai .txt pre { background:#06070a; border:1px solid var(--line); border-radius:10px; padding:14px; overflow-x:auto; font:12.5px/1.6 var(--mono); margin:0 0 12px; }
.msg.ai .txt pre code { background:none; padding:0; }
.msg.ai .txt h4 { margin:16px 0 8px; font:600 15px var(--sans); }
.caret { display:inline-block; width:7px; height:15px; background:var(--accent2); vertical-align:-2px; animation:blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity:0; } }
.rcpt { display:flex; flex-wrap:wrap; gap:6px 14px; font:11px var(--mono); color:var(--dim); margin-top:6px; }
.rcpt button { background:none; border:0; padding:0; color:var(--accent2); cursor:pointer; font:inherit; }
.thinking { display:flex; gap:6px; align-items:center; font:12px var(--mono); color:var(--muted); }
.thinking i { width:6px; height:6px; border-radius:50%; background:var(--accent2); animation:bob 1s infinite; }
.thinking i:nth-child(2){ animation-delay:.15s } .thinking i:nth-child(3){ animation-delay:.3s }
@keyframes bob { 50% { transform:translateY(-4px); opacity:.4; } }

.composer { flex:none; padding:10px 24px 18px; }
.composer .in { max-width:760px; margin:0 auto; }
.cbox { background:var(--panel); border:1px solid var(--line2); border-radius:18px; padding:12px 12px 10px 16px; transition:.15s; }
.cbox:focus-within { border-color:var(--accent); box-shadow:0 0 0 4px rgba(143,123,255,.08); }
.cbox textarea { width:100%; resize:none; background:none; border:0; outline:0; color:var(--text); font:15px/1.5 var(--sans); max-height:200px; min-height:24px; }
.cbar { display:flex; align-items:center; gap:8px; margin-top:8px; }
.chip { display:inline-flex; align-items:center; gap:6px; height:30px; padding:0 11px; border-radius:999px; border:1px solid var(--line2); background:none; font:500 12px var(--sans); color:var(--muted); cursor:pointer; }
.chip:hover { color:var(--text); }
.chip.on { color:var(--accent2); border-color:rgba(143,123,255,.4); background:rgba(143,123,255,.07); }
.chip.off { opacity:.5; cursor:not-allowed; }
.chip svg { width:14px; height:14px; }
.send { margin-left:auto; width:36px; height:36px; border-radius:50%; border:0; background:var(--text); color:#07080a; cursor:pointer; display:grid; place-items:center; }
.send:disabled { opacity:.3; cursor:default; }
.send svg { width:16px; height:16px; }
.hint { display:flex; justify-content:space-between; gap:10px; font:11px var(--mono); color:var(--dim); margin-top:9px; padding:0 6px; flex-wrap:wrap; }

/* model select */
.msel { position:relative; }
.msel > button { display:inline-flex; align-items:center; gap:8px; height:34px; padding:0 12px; border-radius:10px; border:1px solid var(--line2); background:var(--panel); font:500 13px var(--sans); cursor:pointer; }
.msel > button svg { width:12px; height:12px; color:var(--muted); }
.mlist { position:absolute; top:40px; left:0; width:330px; background:var(--panel); border:1px solid var(--line2); border-radius:14px; padding:6px; z-index:30; box-shadow:0 20px 60px rgba(0,0,0,.5); display:none; }
.mlist.on { display:block; }
.mlist button { display:grid; grid-template-columns:1fr auto; gap:2px 10px; width:100%; text-align:left; background:none; border:0; padding:10px 12px; border-radius:9px; cursor:pointer; }
.mlist button:hover, .mlist button.on { background:var(--panel2); }
.mlist b { font:500 13.5px var(--sans); }
.mlist small { font:11px var(--mono); color:var(--muted); grid-column:1; }
.mlist .tag { grid-row:1/3; grid-column:2; align-self:center; }

/* tables / pages */
.ph { display:flex; justify-content:space-between; align-items:end; gap:20px; margin-bottom:24px; flex-wrap:wrap; }
.ph h2 { font:400 40px/1 var(--serif); margin:0 0 6px; }
.ph p { margin:0; color:var(--muted); font-size:14px; }
.tiles { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:22px; }
.tile { background:var(--panel); border:1px solid var(--line); border-radius:var(--r); padding:16px; }
.tile span { font:10.5px var(--mono); color:var(--muted); text-transform:uppercase; letter-spacing:.08em; }
.tile b { display:block; font:400 30px/1.1 var(--serif); margin-top:6px; }
.tile small { font:11px var(--mono); color:var(--dim); }
@media (max-width:900px){ .tiles { grid-template-columns:1fr 1fr; } }
.tbl { width:100%; border-collapse:collapse; background:var(--panel); border:1px solid var(--line); border-radius:var(--r); overflow:hidden; font-size:13.5px; }
.tblw { border:1px solid var(--line); border-radius:var(--r); overflow-x:auto; }
.tblw .tbl { border:0; border-radius:0; min-width:640px; }
.tbl th { text-align:left; font:500 10.5px var(--mono); letter-spacing:.08em; text-transform:uppercase; color:var(--muted); padding:12px 16px; border-bottom:1px solid var(--line); background:var(--bg2); }
.tbl td { padding:13px 16px; border-bottom:1px solid var(--line); }
.tbl tr:last-child td { border-bottom:0; }
.tbl tr.click { cursor:pointer; } .tbl tr.click:hover td { background:rgba(255,255,255,.02); }
.tbl .m { font:12.5px var(--mono); }
.tbl .mut { color:var(--muted); }
.st { font:600 10.5px var(--mono); letter-spacing:.06em; text-transform:uppercase; padding:3px 8px; border-radius:6px; }
.st.active { background:rgba(62,240,166,.1); color:var(--live); }
.st.settled { background:rgba(143,123,255,.12); color:var(--accent2); }
.st.expired, .st.spent { background:rgba(255,255,255,.05); color:var(--muted); }
.st.pending { background:rgba(255,181,71,.1); color:var(--warn); }
.emptyc { text-align:center; padding:50px 20px; color:var(--muted); border:1px dashed var(--line2); border-radius:var(--r); }
.emptyc .btn { margin-top:16px; }
.grid2 { display:grid; grid-template-columns:1.3fr 1fr; gap:14px; margin-bottom:14px; }
@media (max-width:1000px){ .grid2 { grid-template-columns:1fr; } }
.chart { width:100%; height:160px; display:block; }
.chart rect { fill:var(--accent); opacity:.55; } .chart rect.me { fill:var(--live); opacity:1; }
.chart text { fill:var(--dim); font:10px var(--mono); }

/* agents */
.agents { display:grid; grid-template-columns:repeat(2,1fr); gap:14px; }
@media (max-width:1100px){ .agents { grid-template-columns:1fr; } }
.agent .tl { max-height:170px; overflow-y:auto; }
.agent .acts { display:flex; gap:8px; margin-top:14px; }
.tools { display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
.tools span { font:11px var(--mono); color:var(--muted); border:1px solid var(--line2); border-radius:6px; padding:2px 7px; }

/* dev */
.field { display:grid; gap:7px; margin-bottom:16px; }
.field label { font:500 11px var(--mono); letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
.inp { display:flex; align-items:center; gap:8px; background:var(--bg2); border:1px solid var(--line2); border-radius:10px; padding:0 6px 0 14px; height:44px; }
.inp input, .inp select, textarea.ta { flex:1; background:none; border:0; outline:0; color:var(--text); font:13px var(--mono); min-width:0; }
.inp select option { background:var(--panel); }
textarea.ta { background:var(--bg2); border:1px solid var(--line2); border-radius:10px; padding:12px 14px; font:14px/1.5 var(--sans); resize:vertical; min-height:80px; }
.inp:focus-within, textarea.ta:focus { border-color:var(--accent); }
.inp .btn { height:32px; }

/* modal */
.scrim { position:fixed; inset:0; background:rgba(3,4,6,.72); backdrop-filter:blur(6px); z-index:50; display:none; place-items:center; padding:16px; }
.scrim.on { display:grid; animation:fade .2s; }
@keyframes fade { from { opacity:0; } }
.modal { width:100%; max-width:460px; background:var(--panel); border:1px solid var(--line2); border-radius:20px; padding:24px; max-height:90vh; overflow-y:auto; animation:pop .25s ease; }
@keyframes pop { from { transform:translateY(10px) scale(.98); opacity:0; } }
.modal .mh { display:flex; justify-content:space-between; align-items:start; margin-bottom:18px; }
.modal h3 { font:400 30px/1.05 var(--serif); margin:0; }
.modal .mh p { margin:6px 0 0; color:var(--muted); font-size:13.5px; }
.x { background:none; border:0; color:var(--muted); cursor:pointer; font-size:22px; line-height:1; padding:2px 6px; }
.amts { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:14px; }
.amts button { height:44px; border-radius:10px; border:1px solid var(--line2); background:var(--bg2); font:500 13px var(--mono); cursor:pointer; color:var(--text); }
.amts button.on { border-color:var(--accent); background:rgba(143,123,255,.1); color:var(--accent2); }
.note { display:flex; gap:10px; font-size:12.5px; color:var(--muted); background:var(--bg2); border:1px solid var(--line); border-radius:10px; padding:11px 13px; margin-bottom:16px; line-height:1.5; }
.note svg { width:16px; height:16px; flex:none; color:var(--accent2); margin-top:1px; }
.modal .btn.wide { width:100%; height:46px; border-radius:12px; }
.steps2 { display:grid; gap:2px; margin:6px 0 18px; }
.steps2 div { display:flex; align-items:center; gap:12px; padding:9px 0; font-size:13.5px; color:var(--dim); transition:.2s; }
.steps2 div i { width:20px; height:20px; border-radius:50%; border:1.5px solid var(--line2); flex:none; display:grid; place-items:center; font:normal 11px var(--mono); }
.steps2 div small { margin-left:auto; font:11px var(--mono); color:var(--dim); }
.steps2 div.run { color:var(--text); }
.steps2 div.run i { border-color:var(--accent); border-top-color:transparent; animation:spin .8s linear infinite; }
.steps2 div.done { color:var(--muted); }
.steps2 div.done i { background:var(--live); border-color:var(--live); color:#03140c; }
.steps2 div.done i::after { content:"✓"; }
@keyframes spin { to { transform:rotate(360deg); } }
.keybox { font:13px var(--mono); background:#06070a; border:1px solid var(--line); border-radius:10px; padding:14px; word-break:break-all; color:var(--live); margin-bottom:14px; }
.wallets { display:grid; gap:8px; }
.wallets button { display:flex; align-items:center; gap:12px; height:54px; padding:0 16px; border-radius:12px; border:1px solid var(--line2); background:var(--bg2); cursor:pointer; font:500 14px var(--sans); color:var(--text); }
.wallets button:hover { border-color:var(--accent); }
.wallets i { width:28px; height:28px; border-radius:8px; }
.wallets small { margin-left:auto; font:11px var(--mono); color:var(--muted); }
.range { width:100%; accent-color:var(--accent); }
.checks { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.checks label { display:flex; align-items:center; gap:8px; font-size:13px; background:var(--bg2); border:1px solid var(--line2); border-radius:10px; padding:10px 12px; cursor:pointer; text-transform:none; letter-spacing:0; font-family:var(--sans); color:var(--text); }
.checks input { accent-color:var(--accent); }
.json { font:12px/1.7 var(--mono); background:#06070a; border:1px solid var(--line); border-radius:10px; padding:14px; color:#c7c9ce; white-space:pre; overflow-x:auto; margin:0 0 14px; }
.json .k { color:var(--accent2); } .json .s { color:var(--live); }

/* responsive */
@media (max-width:1240px){ .body { grid-template-columns:1fr; } .rp { display:none; } .body.showrp .rp { display:grid; position:fixed; right:0; top:60px; bottom:0; width:320px; z-index:25; box-shadow:-20px 0 60px rgba(0,0,0,.5); } }
@media (max-width:860px){
  .app { grid-template-columns:1fr; }
  .side { position:fixed; left:0; top:0; bottom:0; width:270px; z-index:40; transform:translateX(-100%); transition:.25s; }
  body.menu .side { transform:none; box-shadow:20px 0 60px rgba(0,0,0,.6); }
  .burger { display:block; }
  .top { padding:0 12px; gap:8px; }
  .top .hide-s { display:none; }
  .pad { padding:20px 16px 50px; }
  .msgs .in, .composer { padding-left:16px; padding-right:16px; }
  .composer .in { padding:0; }
}
@media (max-width:520px){ .seg { display:none; } .mlist { width:calc(100vw - 32px); } }

.balpill { display:none; color:var(--text); }
@media (max-width:1240px){ .balpill { display:inline-flex; } }
@media (max-width:520px){ #keyPill { display:none; } }
