:root { --bg: #0b1020; --panel: #121a33; --panel2: #1a2447; --text: #eef1fb; --muted: #9aa6c8; --accent: #ff4f7b; --accent2: #6c7cff; --line: #263160; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
button, input, select { font: inherit; color: inherit; }
.app { display: flex; flex-direction: column; height: 100%; }
.top { display: flex; gap: 10px; align-items: center; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.15rem; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
#q { flex: 1; min-width: 160px; }
input[type=search], #ain, #gf, select { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.btn { background: linear-gradient(135deg, var(--accent), var(--accent2)); border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 600; cursor: pointer; }
.iconbtn { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; cursor: pointer; }
.iconbtn.listening { background: var(--accent); }
.body { flex: 1; display: flex; min-height: 0; }
.side { width: 260px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 10px; gap: 8px; }
.tabs { display: flex; gap: 6px; }
.tabs button { flex: 1; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 6px; cursor: pointer; }
.tabs button.active { border-color: var(--accent); }
#groups { overflow: auto; flex: 1; }
#groups a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
#groups a.active, #groups a:hover, #groups a:focus { background: var(--panel2); outline: none; }
main { flex: 1; overflow: auto; padding: 18px 22px; }
h1 { margin: 0 0 12px; font-size: 1.5rem; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cats button { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.cats button.active { background: var(--accent); border-color: var(--accent); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; text-align: start; }
.tile:hover, .tile:focus { border-color: var(--accent); outline: none; transform: translateY(-1px); }
.tile img { width: 28px; height: 28px; border-radius: 6px; background: #fff; flex: none; }
.tile .t { font-weight: 600; }
.tile .h { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.small { font-size: .85rem; } .muted, .note { color: var(--muted); } .spacer { flex: 1; }
.assistant { position: fixed; right: 16px; bottom: 16px; width: min(420px, calc(100vw - 32px)); max-height: 70vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 20px 60px #0008; padding: 12px; gap: 8px; z-index: 10; }
.ahead { display: flex; align-items: center; }
.log { overflow: auto; display: flex; flex-direction: column; gap: 6px; min-height: 80px; }
.log .u { align-self: flex-end; background: var(--panel2); border-radius: 12px 12px 2px 12px; padding: 7px 11px; max-width: 85%; }
.log .a { align-self: flex-start; background: #24305f; border-radius: 12px 12px 12px 2px; padding: 7px 11px; max-width: 85%; }
.aform { display: flex; gap: 6px; } #ain { flex: 1; }
.empty { color: var(--muted); padding: 30px 0; }
@media (max-width: 760px) { .side { display: none; } .body { flex-direction: column; } .brand span { display: none; } }
[dir=rtl] .log .u { align-self: flex-start; } [dir=rtl] .log .a { align-self: flex-end; }
/* Premium, AI Studio and ads */
.iconbtn.plan.gold { background: linear-gradient(135deg, #ffd54f, #ff8f00); color: #2b1a00; border-color: transparent; font-weight: 600; }
.modal { position: fixed; inset: 0; background: #0009; display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal[hidden] { display: none; }
.mcard { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; width: min(460px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 24px 70px #000a; }
.mcard.wide { width: min(640px, 100%); }
.mcard h2 { margin: 0 0 10px; font-size: 1.3rem; padding-inline-end: 40px; }
.mcard ul { line-height: 1.8; padding-inline-start: 20px; }
.mclose { position: absolute; top: 12px; inset-inline-end: 12px; }
.btn.wide { display: block; width: 100%; text-align: center; text-decoration: none; margin-top: 10px; }
.ok { color: #9ef0b5; font-weight: 600; } .warn { background: #ff4f7b22; border-radius: 10px; padding: 8px 12px; }
.code { display: inline-block; margin-top: 6px; font-size: 1.3rem; letter-spacing: .12em; background: #000; padding: 6px 12px; border-radius: 8px; user-select: all; }
.adult { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; } .adult input { margin-top: 4px; width: 18px; height: 18px; }
.shake { animation: shake .4s; } @keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.restore { margin-top: 14px; } .restore summary { cursor: pointer; } .restore form { display: flex; gap: 8px; margin-top: 8px; }
.restore input { flex: 1; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; text-transform: uppercase; }
.stabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.stabs button { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.stabs button.active { background: var(--accent2); border-color: var(--accent2); }
.stform { display: flex; flex-direction: column; gap: 8px; }
.stform textarea { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; color: var(--text); font: inherit; resize: vertical; }
.pick { display: block; border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; cursor: pointer; }
.pick input { display: block; margin: 8px auto 0; }
.stout { margin-top: 12px; } .stout audio { width: 100%; }
.chips span { display: inline-block; background: var(--panel2); border-radius: 999px; padding: 3px 10px; margin: 3px; font-size: .85rem; }
.link { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; padding: 4px 0; }
.adslot { margin-top: 18px; } .adslot[hidden] { display: none; } .adlabel { font-size: 11px; color: var(--muted); }
.promo { width: 100%; border: 1px dashed #ffd54f88; background: #ffd54f14; color: #ffe082; border-radius: 12px; padding: 10px; cursor: pointer; font-weight: 600; }
.foot { margin-top: 18px; } .foot a { color: var(--muted); }
@media (max-width: 760px) { #studiobtn span { display: none; } }
.assistant[hidden] { display: none; }
#ain { min-width: 0; }
[dir=rtl] .assistant { right: auto; left: 16px; }
a.btn { color: #fff; text-decoration: none; }
