:root {
  color-scheme: light;
  --bg:#f8fafc; --panel:#ffffff; --panel2:#f1f5f9; --muted:#64748b; --text:#0f172a;
  --line:rgba(15,23,42,.10); --accent:#0ea5e9; --accent2:#7c3aed; --good:#059669;
  --mine:#dff4ff; --other:#f1f5f9; --danger:#e11d48;
}
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html, body { margin:0; height:100%; color:var(--text); font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; background:#f8fafc; }
body::before { content:""; position:fixed; inset:0; pointer-events:none; background:radial-gradient(circle at 14% 6%, rgba(14,165,233,.20), transparent 30%), radial-gradient(circle at 88% 2%, rgba(124,58,237,.13), transparent 34%), linear-gradient(180deg,#f8fafc,#eef6ff 58%,#f8fafc); }
button,input,textarea { font:inherit; }
button { border:0; cursor:pointer; }
.app { position:relative; min-height:100dvh; display:flex; align-items:center; justify-content:center; padding:max(16px,env(safe-area-inset-top)) 14px max(16px,env(safe-area-inset-bottom)); }
.hidden { display:none !important; }
.card { width:min(440px,100%); border:1px solid var(--line); border-radius:32px; background:rgba(255,255,255,.86); backdrop-filter:blur(24px); box-shadow:0 24px 70px rgba(15,23,42,.12); }
.home { padding:22px; }
.hero { padding:4px 2px 18px; }
.brandPill { display:inline-flex; align-items:center; gap:6px; padding:7px 11px; border:1px solid rgba(14,165,233,.22); border-radius:999px; background:rgba(14,165,233,.09); color:#0369a1; font-size:12px; font-weight:900; letter-spacing:.08em; }
h1 { margin:16px 0 8px; font-size:32px; letter-spacing:-.04em; line-height:1.05; color:#0f172a; }
p { margin:0; color:var(--muted); line-height:1.55; }
.roomCard { position:relative; overflow:hidden; margin:6px 0 16px; padding:20px; border:1px solid rgba(14,165,233,.16); border-radius:28px; background:linear-gradient(135deg,#e0f2fe,#eef2ff 62%,#faf5ff); box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 12px 32px rgba(14,165,233,.10); }
.roomCard::after { content:""; position:absolute; right:-35px; top:-45px; width:140px; height:140px; border-radius:999px; background:rgba(14,165,233,.16); filter:blur(2px); }
.roomCard span { display:block; color:#475569; font-weight:850; font-size:13px; }
.bigCode { display:block; margin:6px 0 18px; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:64px; letter-spacing:10px; line-height:1; color:#075985; text-shadow:0 10px 26px rgba(14,165,233,.18); }
.primary { width:100%; padding:15px 18px; border-radius:18px; background:linear-gradient(135deg,#38bdf8,#60a5fa 56%,#a78bfa); color:#ffffff; font-weight:950; box-shadow:0 14px 30px rgba(14,165,233,.22); }
.soft { padding:13px 10px; border-radius:18px; background:rgba(255,255,255,.8); border:1px solid var(--line); color:#0f172a; font-weight:850; box-shadow:0 8px 20px rgba(15,23,42,.05); }
.ghost,.iconBtn { background:rgba(255,255,255,.82); color:#0f172a; border:1px solid var(--line); box-shadow:0 8px 20px rgba(15,23,42,.05); }
.field { display:block; margin-top:14px; color:#334155; font-weight:850; font-size:13px; }
.field input { margin-top:8px; }
.field.compact { margin:0 0 14px; }
input,textarea { width:100%; border:1px solid var(--line); background:rgba(255,255,255,.92); color:var(--text); border-radius:18px; padding:14px 15px; outline:none; box-shadow:inset 0 1px 0 rgba(255,255,255,.8); }
input:focus,textarea:focus { border-color:rgba(14,165,233,.65); box-shadow:0 0 0 4px rgba(14,165,233,.12); }
.quickGrid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.deviceMini { margin-top:14px; padding:11px 13px; border-radius:16px; background:rgba(255,255,255,.68); color:var(--muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; border:1px solid var(--line); }
.deviceMini strong { color:#6d28d9; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; }
.chat { width:min(820px,100%); height:100dvh; max-height:900px; display:flex; flex-direction:column; overflow:hidden; border:1px solid var(--line); border-radius:28px; background:rgba(255,255,255,.86); backdrop-filter:blur(22px); box-shadow:0 24px 70px rgba(15,23,42,.12); }
.topbar { display:grid; grid-template-columns:56px 1fr 68px; align-items:center; gap:8px; padding:12px 12px; border-bottom:1px solid var(--line); background:rgba(255,255,255,.86); }
.iconBtn { height:42px; border-radius:16px; font-weight:900; }
#backHome { font-size:30px; line-height:0; }
.chatTitle { text-align:center; min-width:0; }
.chatTitle strong { display:block; font-size:16px; color:#0f172a; }
.chatTitle small { display:block; margin-top:3px; color:var(--muted); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.messages { flex:1; overflow:auto; padding:16px 12px 96px; display:flex; flex-direction:column; gap:10px; scroll-behavior:smooth; background:linear-gradient(180deg,rgba(248,250,252,.4),rgba(239,246,255,.55)); }
.msg { position:relative; max-width:84%; border:1px solid rgba(15,23,42,.06); border-radius:20px; padding:10px 12px; word-break:break-word; white-space:pre-wrap; line-height:1.45; box-shadow:0 10px 24px rgba(15,23,42,.08); color:#0f172a; }
.msg.mine { align-self:flex-start; background:linear-gradient(180deg,#e0f2fe,#bae6fd); border-bottom-left-radius:6px; }
.msg.other { align-self:flex-end; background:linear-gradient(180deg,#ffffff,#f1f5f9); border-bottom-right-radius:6px; }
.meta { color:#475569; opacity:.82; font-size:11px; margin-bottom:5px; white-space:nowrap; }
.copyMsg { display:inline-flex; align-items:center; margin-top:8px; padding:5px 10px; border-radius:999px; background:rgba(14,165,233,.10); color:#0369a1; font-size:12px; font-weight:900; }
.msg.other .copyMsg { background:rgba(124,58,237,.09); color:#6d28d9; }
.msg img { display:block; max-width:min(340px,100%); border-radius:16px; margin-top:7px; background:#f8fafc; }
.md { white-space:normal; }
.md p { margin:0 0 7px; color:inherit; line-height:1.5; }
.md p:last-child { margin-bottom:0; }
.md h1,.md h2,.md h3 { margin:2px 0 8px; line-height:1.25; color:#0f172a; }
.md h1 { font-size:20px; } .md h2 { font-size:18px; } .md h3 { font-size:16px; }
.md ul { margin:4px 0 6px 20px; padding:0; } .md li { margin:3px 0; }
.md blockquote { margin:5px 0; padding:4px 0 4px 10px; border-left:3px solid rgba(14,165,233,.45); color:#334155; background:rgba(14,165,233,.05); border-radius:8px; }
.md code { background:rgba(15,23,42,.06); border:1px solid rgba(15,23,42,.08); border-radius:7px; padding:1px 5px; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:.92em; }
.md pre { max-width:100%; overflow:auto; background:rgba(15,23,42,.05); border:1px solid rgba(15,23,42,.08); border-radius:14px; padding:10px; margin:6px 0; white-space:pre; }
.md pre code { border:0; background:transparent; padding:0; } .md a { color:#0369a1; text-decoration:underline; }
.composer { position:sticky; bottom:0; display:flex; gap:8px; padding:10px max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); border-top:1px solid var(--line); background:rgba(255,255,255,.86); backdrop-filter:blur(18px); }
.composer textarea { resize:none; max-height:120px; min-height:48px; padding:13px 14px; border-radius:20px; }
#pick { width:48px; flex:0 0 48px; border-radius:18px; background:rgba(15,23,42,.06); color:#0f172a; font-size:24px; font-weight:800; border:1px solid var(--line); }
#send { flex:0 0 auto; border-radius:18px; padding:0 16px; background:linear-gradient(135deg,#38bdf8,#818cf8); color:white; font-weight:950; }
.drawerShade { position:fixed; inset:0; z-index:20; background:rgba(15,23,42,.24); backdrop-filter:blur(4px); }
.drawer { position:fixed; z-index:30; left:50%; bottom:0; transform:translateX(-50%); width:min(480px,100%); padding:10px 18px max(18px,env(safe-area-inset-bottom)); border:1px solid var(--line); border-bottom:0; border-radius:28px 28px 0 0; background:rgba(255,255,255,.96); box-shadow:0 -24px 70px rgba(15,23,42,.16); }
.drawerHandle { width:46px; height:5px; border-radius:999px; margin:0 auto 12px; background:rgba(100,116,139,.28); }
.drawerHead { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.drawerHead strong { font-size:18px; color:#0f172a; }
.closeDrawer { width:38px; height:38px; border-radius:14px; background:rgba(15,23,42,.06); color:#0f172a; font-size:24px; }
.full { width:100%; margin-top:14px; }
.drawerTip { margin-top:12px; color:var(--muted); font-size:13px; }
.recent { margin:0; }
.recentItem { width:100%; margin:8px 0 0; padding:13px 14px; border-radius:16px; background:#f8fafc; border:1px solid var(--line); color:#0f172a; text-align:left; font-weight:850; font-size:13px; }
.infoList { display:grid; gap:10px; margin:12px 0; }
.infoList div { padding:12px; border:1px solid var(--line); border-radius:16px; background:#f8fafc; }
.infoList span { display:block; color:var(--muted); font-size:12px; margin-bottom:5px; }
.infoList strong { display:block; color:#075985; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:12px; word-break:break-all; }
.dangerSoft { padding:14px 16px; border-radius:18px; background:rgba(225,29,72,.08); border:1px solid rgba(225,29,72,.18); color:#be123c; font-weight:900; }
@media (max-width:640px) { .app{padding:0;} .home{width:100%; min-height:100dvh; border:0; border-radius:0; display:flex; flex-direction:column; justify-content:center;} .chat{border:0; border-radius:0; height:100dvh; max-height:none;} .msg{max-width:88%;} h1{font-size:34px;} .bigCode{font-size:70px;} }
