/* Вики — вариант 1 «Чат»: чёрный + зелёный #7CEB46; детский режим — тёмно-синий + жёлтый #F2C94C */
:root{--bg:#0A0A0A;--card:#141414;--line:#2A2A2A;--text:#F2F2F2;--muted:#A8A8A8;--acc:#7CEB46;--acc-ink:#0A0A0A;
  --bubble:#232323;--kid-bg:#0B0F1A;--kid-card:#1A2238;--kid-line:#2A3350;--kid:#F2C94C;--kid-ink:#1A1400;--kid-muted:#9AA4BF;
  color-scheme:dark}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--text);
  font:16px/1.45 Inter,"Segoe UI",system-ui,-apple-system,Roboto,sans-serif;-webkit-tap-highlight-color:transparent}
#app{height:100%;max-width:560px;margin:0 auto;position:relative}
/* Планшет и компьютер: меню разговоров всегда слева, разговор справа */
@media (min-width:900px){
  #app{max-width:1280px}
  body.wide .drawer{position:absolute;inset:0 auto 0 0;width:320px;background:none;display:block!important}
  body.wide .drawer-in{width:320px;max-width:none}
  body.wide #b-drawer-close,body.wide #b-menu{display:none}
  body.wide #scr-chat,body.wide #scr-list,body.wide #scr-settings,body.wide #scr-kidpick{left:320px}
  .screen.center{max-width:520px;margin:0 auto}
  .m-user{max-width:70%}.m-viki{max-width:80%}
}
[hidden]{display:none!important}
button{font:inherit;color:inherit;cursor:pointer}
input{font:inherit}
svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.screen{position:absolute;inset:0;display:flex;flex-direction:column;
  padding:env(safe-area-inset-top,0) 0 env(safe-area-inset-bottom,0)}
.screen.center{align-items:center;padding-left:24px;padding-right:24px;padding-bottom:calc(24px + env(safe-area-inset-bottom,0))}
.col{display:flex;flex-direction:column}.row{display:flex;align-items:center}.wrap{flex-wrap:wrap}
.center{align-items:center;justify-content:center}.center-t{text-align:center}.between{justify-content:space-between}
.grow{flex:1 1 auto;min-height:0}.w100{width:100%}.pad{padding:18px 20px}
.gap6{gap:6px}.gap8{gap:8px}.gap10{gap:10px}.gap12{gap:12px}.gap14{gap:14px}.gap18{gap:18px}.mb18{margin-bottom:18px}
.scroll{overflow-y:auto}.muted{color:var(--muted)}.small{font-size:13px}.right{align-self:flex-end}
h1{font-size:20px;margin:0;font-weight:700}h2{margin:0;font-weight:500}p{margin:0}
.foot{text-align:center;padding-top:12px}
.logo{font-weight:800;letter-spacing:-.03em;display:inline-flex;align-items:flex-end;line-height:1}
.logo .i{position:relative}.logo .i b{position:absolute;left:50%;border-radius:50%;background:var(--acc)}
.logo.big{font-size:64px}.logo.big .i b{top:6px;width:15px;height:15px;margin-left:-7.5px}
.logo.mid{font-size:48px}.logo.mid .i b{top:4px;width:11px;height:11px;margin-left:-5.5px}
.logo.sm{font-size:24px}.logo.sm .i b{top:2px;width:6px;height:6px;margin-left:-3px}
.field{display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--muted)}
.field input,.add-row input,#s-city,#f-kid-add input,.composer input{height:52px;border-radius:14px;border:1px solid var(--line);
  background:var(--card);color:var(--text);padding:0 16px;font-size:16px;width:100%;outline:none}
input:focus{border-color:var(--acc)}
.code{letter-spacing:.4em;text-align:center;font-size:22px!important}
.age{width:70px!important}
.btn{height:54px;border-radius:14px;border:1px solid #3A3A3A;background:transparent;font-size:16px;padding:0 18px;
  display:inline-flex;align-items:center;justify-content:center;gap:10px}
.btn.primary{background:var(--acc);color:var(--acc-ink);border:none;font-weight:600}
.btn.kid{background:var(--kid);color:var(--kid-ink);border:none;font-weight:600}
.btn.sm{height:52px;min-width:52px;padding:0 14px}
.btn:disabled{opacity:.5}
.link{background:none;border:none;color:var(--acc);padding:8px 0;font-size:15px}
.error{color:#FF8A80;font-size:14px}
.icon{width:44px;height:44px;border-radius:22px;border:1px solid var(--line);background:var(--card);
  display:inline-flex;align-items:center;justify-content:center;color:#CFCFCF;flex:none}
.bar{display:flex;align-items:center;gap:10px;padding:14px 16px;border-bottom:1px solid #1E1E1E}
.bar h1{flex:1}
/* ПИН */
.dots{display:flex;gap:16px;margin:8px 0}.dots i{width:14px;height:14px;border-radius:50%;border:2px solid var(--acc)}
.dots i.on{background:var(--acc)}
.pad-keys{display:grid;grid-template-columns:repeat(3,72px);gap:14px}
.pad-keys button{height:64px;border-radius:32px;border:1px solid var(--line);background:var(--card);font-size:24px}
.pad-keys button.flat{border:none;background:none;font-size:15px;color:var(--muted)}
.bio{width:110px;height:110px;border-radius:30px;border:2px solid var(--acc);background:#121A0E;color:var(--acc);margin-top:8px}
.bio svg{width:56px;height:56px;stroke-width:1.3}
/* Разговор */
.msgs{flex:1;overflow-y:auto;padding:18px 16px 8px;display:flex;flex-direction:column;gap:14px}
.m-user{align-self:flex-end;max-width:80%;background:var(--bubble);padding:12px 14px;border-radius:18px 18px 4px 18px;white-space:pre-wrap;word-wrap:break-word}
.m-viki{max-width:90%;display:flex;flex-direction:column;gap:6px}
.m-viki .who{font-size:12px;font-weight:600;color:var(--acc)}
.m-viki .txt{white-space:pre-wrap;word-wrap:break-word;color:#E6E6E6}
.m-viki .txt.typing::after{content:"▍";animation:blink 1s infinite;color:var(--acc)}
@keyframes blink{50%{opacity:0}}
.m-tool{font-size:13px;color:var(--muted);display:flex;gap:6px;align-items:center}
.confirm{background:#121A0E;border:1px solid #2E4A1E;border-radius:18px;padding:14px;display:flex;flex-direction:column;gap:12px}
.confirm .row{gap:8px}.confirm .btn{flex:1;height:46px}
.confirm.done{opacity:.6}
.greet{background:var(--card);border-radius:18px;padding:14px 16px;display:flex;flex-direction:column;gap:6px}
.greet .big{font-size:20px;font-weight:700}
.composer{display:flex;gap:10px;align-items:center;padding:10px 14px calc(14px + env(safe-area-inset-bottom,0))}
.composer input{border-radius:26px;height:52px}
.mic{width:64px;height:64px;border-radius:32px;border:none;background:var(--acc);color:var(--acc-ink);flex:none;display:flex;align-items:center;justify-content:center}
.mic svg{width:28px;height:28px;stroke-width:2}
.mic.rec{background:#FF5A4F;color:#fff;animation:pulse 1.2s infinite}
.mic.busy{opacity:.6}
@keyframes pulse{50%{box-shadow:0 0 0 10px rgba(255,90,79,.25)}}
.chips{display:flex;gap:8px;padding:0 16px 4px;flex-wrap:wrap}
.chip{height:44px;padding:0 16px;border-radius:22px;border:1px solid var(--line);background:var(--card)}
.chip.on{background:var(--acc);color:var(--acc-ink);border:none;font-weight:600}
/* Меню */
.drawer{position:absolute;inset:0;background:rgba(0,0,0,.55);z-index:5}
.drawer-in{width:86%;max-width:360px;height:100%;background:#0E0E0E;border-right:1px solid var(--line);
  padding:calc(16px + env(safe-area-inset-top,0)) 16px 16px;display:flex;flex-direction:column;gap:16px}
.nav{height:48px;border-radius:12px;border:none;background:var(--card);text-align:left;padding:0 16px}
.chat-item{display:flex;align-items:center;gap:8px;border-radius:12px;background:transparent;border:1px solid transparent;padding:0 0 0 12px;min-height:46px}
.chat-item.cur{border-color:var(--line);background:var(--card)}
.chat-item .t{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:none;border:none;text-align:left;padding:12px 0}
.chat-item .del{width:40px;height:40px;border:none;background:none;color:var(--muted)}
/* Списки, настройки */
.card{background:var(--card);border-radius:18px;padding:4px 16px}
.card.row{padding:14px 16px}
.item{background:var(--card);border-radius:16px;padding:12px 14px;display:flex;gap:12px;align-items:flex-start}
.item .tx{flex:1;white-space:pre-wrap;word-wrap:break-word}
.item .sub{font-size:12px;color:var(--muted)}
.item.done .tx{text-decoration:line-through;opacity:.55}
.check{width:26px;height:26px;border-radius:8px;border:2px solid var(--acc);background:none;flex:none;margin-top:1px}
.item.done .check{background:var(--acc)}
.add-row{display:flex;gap:8px;padding:14px 20px 0}
.switch-row{display:flex;justify-content:space-between;align-items:center;min-height:52px;gap:12px}
.card .switch-row+.switch-row{border-top:1px solid #1F1F1F}
input[type=checkbox][role=switch]{appearance:none;width:48px;height:28px;border-radius:14px;background:#333;position:relative;flex:none;margin:0}
input[type=checkbox][role=switch]::after{content:"";position:absolute;left:3px;top:3px;width:22px;height:22px;border-radius:11px;background:#BDBDBD;transition:.15s}
input[type=checkbox][role=switch]:checked{background:var(--acc)}
input[type=checkbox][role=switch]:checked::after{left:23px;background:var(--bg)}
.ic{color:#CFCFCF;width:26px;height:26px}
.toast{position:absolute;left:16px;right:16px;bottom:calc(96px + env(safe-area-inset-bottom,0));background:#222;border:1px solid var(--line);
  border-radius:14px;padding:12px 16px;z-index:9;text-align:center}
dialog{background:#111;color:var(--text);border:1px solid var(--line);border-radius:24px;padding:24px}
dialog::backdrop{background:rgba(0,0,0,.6)}
/* ===== Детский режим ===== */
.kidtheme,.kidmode #scr-chat{background:var(--kid-bg)}
.kidmode #scr-chat .bar{border-color:#1C2440}
.kidmode .icon{background:transparent;border-color:var(--kid-line)}
.kidmode .m-viki .who{color:var(--kid)}
.kidmode .m-user{background:var(--kid-line)}
.kidmode .m-viki .txt{font-size:18px;color:#F2F2F2}
.kidmode .mic{background:var(--kid);color:var(--kid-ink);width:76px;height:76px;border-radius:38px}
.kidmode .composer input{background:var(--kid-card);border-color:var(--kid-line)}
.kidmode .chip{border-color:var(--kid);color:var(--kid);background:transparent}
.kidmode .logo .i b{background:var(--kid)}
.kid-badge{height:34px;padding:0 12px;border-radius:17px;background:var(--kid);color:var(--kid-ink);font-weight:600;font-size:14px;display:inline-flex;align-items:center}
.kmuted{color:var(--kid-muted)}
.kidtheme .icon{background:transparent;border-color:var(--kid-line)}
.kidtheme .bar{border-color:#1C2440}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.vbtn{height:72px;border-radius:16px;border:1px solid var(--kid-line);background:#121829;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.vbtn.on{border:2px solid var(--kid);background:var(--kid-card)}
.vbtn small{color:var(--kid-muted)}
.kchip{height:44px;padding:0 16px;border-radius:22px;border:1px solid var(--kid-line);background:var(--kid-card)}
.kchip.on{background:var(--kid);color:var(--kid-ink);border:none;font-weight:600}
.kchip input{height:40px;border:none;background:none;color:var(--text);width:120px;outline:none}
