/* Theme tokens are intentionally independent of message and account data. */
:root{--page-bg:#070b12;--bg:#0a1524;--ink:#e9e8df;--muted:#c2cbd1;--edge:#d4ded254;--surface:#1b2b36ed;--mine:#29404ae8;--action:#34515c;--header:#0b1429e8;--form:#172633ed;--drawer-bg:#132233f9;--field:#0c1b2b;--topic:#263a48;--note:#22323dcc;--quiet:#a9bcc0;--danger:#ffb0a5;--focus:#cbded3;--ring:#8fb4c9;--ring-soft:#8fb4c926;--contrast-mine:#2f5364;--contrast-assistant:#16222cf2;--background-image:url('/static/night-sky.svg');--text-size:15px;--font-family:Nunito,'Trebuchet MS',sans-serif;--font-fallback:'Trebuchet MS',sans-serif;color-scheme:dark}
:root[data-theme="graphite"]{--page-bg:#15191d;--bg:#191e23;--ink:#edf0ec;--muted:#c2c9c8;--edge:#a8b7b758;--surface:#30383de9;--mine:#3b4b51e9;--action:#506369;--header:#1f262ae9;--form:#29343ae9;--drawer-bg:#222b30f9;--field:#263037;--topic:#37454b;--note:#333c41d9;--quiet:#bed0d0;--ring:#9db1ae;--ring-soft:#9db1ae26;--contrast-mine:#455c65;--contrast-assistant:#232a30f2}
:root[data-theme="forest"]{--page-bg:#071511;--bg:#0e211c;--ink:#eef2e6;--muted:#c8d7cd;--edge:#aecab260;--surface:#1d3730ed;--mine:#2c4a3de8;--action:#365c4e;--header:#10251fe9;--form:#1b332bed;--drawer-bg:#152d25f9;--field:#19352d;--topic:#2c463c;--note:#263d32d9;--quiet:#b8d4bd;--ring:#8fbfa3;--ring-soft:#8fbfa326;--contrast-mine:#31553f;--contrast-assistant:#16281ff2}
:root[data-theme="daylight"]{color-scheme:light;--page-bg:#dce8ee;--bg:#edf5f8;--ink:#193442;--muted:#48636c;--edge:#506e795d;--surface:#fffffff0;--mine:#d4e9eaf2;--action:#c3dbde;--header:#e4f0f4ef;--form:#fffffff0;--drawer-bg:#edf5f8fd;--field:#fff;--topic:#dcecef;--note:#e2eef0ee;--quiet:#425e67;--danger:#a33129;--focus:#32677a;--ring:#32677a;--ring-soft:#32677a1f;--contrast-mine:#cfe6ea;--contrast-assistant:#fff}
:root[data-theme="ivory"]{color-scheme:light;--page-bg:#ece5d8;--bg:#f5f0e7;--ink:#392e24;--muted:#69594a;--edge:#836c595a;--surface:#fffaf2f2;--mine:#e9dcc8f2;--action:#e0cfb6;--header:#f0e7d9f0;--form:#fffaf2ef;--drawer-bg:#f4ecdefd;--field:#fffaf4;--topic:#ebddcb;--note:#efe7d9ee;--quiet:#655447;--danger:#a43127;--focus:#785430;--ring:#785430;--ring-soft:#7854301f;--contrast-mine:#efe0c8;--contrast-assistant:#fffdf8}
:root[data-theme="mist"]{color-scheme:light;--page-bg:#e6e8e6;--bg:#f2f3f0;--ink:#273639;--muted:#536468;--edge:#75868962;--surface:#fffffff0;--mine:#dce6e3f2;--action:#cfdeda;--header:#edf1eeef;--form:#fff;--drawer-bg:#f2f4f2fd;--field:#fff;--topic:#e1e9e6;--note:#e7ece9ee;--quiet:#526569;--danger:#aa3029;--focus:#3d736c;--ring:#3d736c;--ring-soft:#3d736c1f;--contrast-mine:#dbe7e3;--contrast-assistant:#fff}
:root[data-font="system"]{--font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
:root[data-font="humanist"]{--font-family:'Trebuchet MS',Verdana,sans-serif}
:root[data-font="serif"]{--font-family:Georgia,'Times New Roman',serif}
:root[data-font="manrope"]{--font-family:'Manrope',var(--font-fallback)}
:root[data-font="plex"]{--font-family:'IBM Plex Sans',var(--font-fallback)}
:root[data-font="golos"]{--font-family:'Golos Text',var(--font-fallback)}
:root[data-size="small"]{--text-size:14px}
:root[data-size="large"]{--text-size:18px}
:root[data-size="extra"]{--text-size:21px}
body{background:var(--page-bg);color:var(--ink);font-family:var(--font-family);font-size:var(--text-size)}
.phone{background-color:var(--bg);background-image:var(--background-image);background-size:cover;background-position:center}
:root[data-background="quiet"]{--background-image:none}
:root[data-background="paper"]{--background-image:url('/static/paper.svg')}
:root[data-background="horizon"]{--background-image:url('/static/horizon.svg')}
:root[data-background="constellations"]{--background-image:url('/static/constellations.svg')}
:root[data-background="stars"]{--background-image:url('/static/night-sky.svg')}
button,input,select{font-family:inherit}
button:focus-visible,input:focus-visible,select:focus-visible{outline-color:var(--focus)}
.top{background:var(--header);border-color:var(--edge)}.settings-trigger{margin-left:auto;font-size:24px}.title{font-size:1.2em}.sub{color:var(--muted);font-size:.8em}.login-view,#recovery-codes{background:var(--form);color:var(--ink)}.login-view p,.empty{color:var(--muted)}.login-view input,.topic-create input{background:var(--field);color:var(--ink)}.primary,.buttons button,#recovery-codes button{background:var(--action)}
.bubble{background:var(--surface);border-color:var(--edge);font-size:1em}.bubble.mine{background:var(--mine);border-color:var(--edge)}.bubble.note,.chip{background:var(--note);color:var(--muted);font-size:.88em}.label,.work-status,.feedback-body,.route .timer,.route .reason{color:var(--quiet)}.label{font-size:.78em}.work-status{font-size:.84em}.feedback{border-color:var(--edge)}.feedback-body{font-size:.8em}.rate{border-color:var(--edge);color:var(--ink)}.rate.chosen{background:var(--mine);border-color:var(--focus)}.error,.chip button,.attachment button.detach{color:var(--danger)}.attachment{background:var(--note);border-color:var(--edge);color:var(--ink)}.attachment span{color:var(--muted)}.composer{background:var(--form)}.composer input{color:var(--ink);font-size:1em}.composer input::placeholder,.login-view input::placeholder{color:var(--muted);opacity:1}.demo-action{color:var(--muted);border-color:var(--edge);font-size:.8em}.question,.route{background:var(--surface)}.route-meter{background:var(--edge)}.route .timer{font-size:.8em}.route .reason{font-size:.72em}.drawer{background:var(--drawer-bg)}.topics button{background:var(--topic);color:var(--ink);border-color:var(--edge)}.topics button.active{border-color:var(--focus)}.logout{color:var(--muted)}.watermark{color:var(--muted);background:var(--header)}
:root[data-size="extra"] .chat-view{padding-inline:12px}:root[data-size="extra"] .bubble{max-width:96%}
.settings-dialog{position:fixed;inset:0;margin:auto;width:min(100vw - 16px,440px);height:min(96dvh,830px);max-height:96dvh;padding:0;border:1px solid var(--edge);border-radius:20px;background:var(--bg);color:var(--ink);box-shadow:0 24px 70px #0005;overflow:hidden;font-family:var(--font-family);font-size:var(--text-size)}.settings-dialog::backdrop{background:#06131cca}.settings-head{display:flex;justify-content:space-between;align-items:center;padding:20px 22px 14px;background:var(--header);border-bottom:1px solid var(--edge)}.settings-head h2{font-size:1.45em;margin:0;font-weight:700}.eyebrow{font-size:.64em;letter-spacing:.15em;color:var(--muted);margin:0 0 3px}.settings-scroll{height:calc(100% - 83px);overflow-y:auto;padding:4px 22px 36px;scrollbar-color:var(--muted) transparent}.settings-dialog h3{font-size:1.1em;font-weight:700;margin:21px 0 3px}.settings-note{font-size:.8em;color:var(--muted);margin:2px 0 14px;line-height:1.45}.settings-dialog label{font-size:.86em;margin:14px 0 6px;font-weight:600}.settings-dialog input,.settings-dialog select{display:block;width:100%;min-height:44px;padding:8px 11px;background:var(--field);color:var(--ink);border:1px solid var(--edge);border-radius:10px;font-size:.92em}.settings-dialog option,.settings-dialog optgroup{color:var(--ink);background:var(--field)}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.appearance-sample{background:var(--surface);border:1px solid var(--edge);border-radius:15px;padding:12px 14px;margin:20px 0 27px}.appearance-sample span{font-size:.73em;color:var(--muted)}.appearance-sample p{margin:4px 0 0;font-size:1em}.connections-form{border-top:1px solid var(--edge);padding-top:2px}.connections-form fieldset{margin:16px 0;border:1px solid var(--edge);border-radius:14px;padding:4px 14px 16px;min-width:0}.connections-form legend{font-weight:700;font-size:.86em;padding:0 7px}.settings-save{background:var(--action);border:1px solid var(--edge);border-radius:11px;min-height:46px;width:100%;font-weight:700}.settings-save:disabled{opacity:.55}.settings-dialog .settings-note[role="status"]{min-height:1.5em;margin:10px 0 0}
.settings-dialog select{appearance:none;-webkit-appearance:none;background-image:none;cursor:pointer}
@media(prefers-reduced-motion:reduce){.settings-dialog *{scroll-behavior:auto}}

/* VegaNova is a selectable visual shell, not a new auth/chat implementation. */
.vega-header-action{display:none}
:root[data-theme="veganova"]{--page-bg:#070c18;--bg:#0b1423;--ink:#edf4ff;--muted:#a1b3ca;--edge:#23374e;--surface:#101b2d;--mine:#193450;--action:#6dafff;--header:#0b1423;--form:#101b2d;--drawer-bg:#101b2d;--field:#0d192a;--topic:#15253b;--note:#15253b;--quiet:#97abc4;--danger:#ffb4ba;--focus:#6dafff;--ring:#6dafff;--ring-soft:#6dafff30;--contrast-mine:#1c4364;--contrast-assistant:#14283f;color-scheme:dark}
:root[data-theme="veganova"] .phone{width:min(100vw,1400px);height:100dvh;max-height:none;background-color:var(--bg)}
:root[data-theme="veganova"] .top{height:82px;gap:10px;padding:12px 16px;border-bottom:1px solid var(--edge);background:var(--header)}
:root[data-theme="veganova"] .top>div{flex:1;min-width:0}
:root[data-theme="veganova"] .top .title{font-size:0;line-height:1.3}
:root[data-theme="veganova"] .top .title::after{content:'VEGA NOVA  /  ЧАТ';display:block;color:var(--action);font-size:11px;font-weight:700;letter-spacing:.16em}
:root[data-theme="veganova"] .top .sub{max-width:100%;font-size:18px;line-height:1.35;font-weight:700;color:var(--ink)}
:root[data-theme="veganova"] .phone:has(#chat-view.hidden) .top .sub{display:none}
:root[data-theme="veganova"] .phone:has(#chat-view:not(.hidden)) #settings-open{display:none}
:root[data-theme="veganova"] .phone:has(#chat-view:not(.hidden)) .vega-header-action{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;min-width:44px;min-height:44px;padding:0 14px;border:1px solid var(--edge);border-radius:12px;background:var(--note);color:var(--ink);font:600 13px/1 var(--font-family)}
:root[data-theme="veganova"] .vega-header-action:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
:root[data-theme="veganova"] .chat-view{height:calc(100% - 82px);padding:0 12px max(14px,env(safe-area-inset-bottom));background:var(--bg)}
:root[data-theme="veganova"] .messages{padding:20px 4px 12px;scrollbar-color:#3f6385 transparent}
:root[data-theme="veganova"] .jump-latest{background:#193450;border:0;color:var(--ink)}
:root[data-theme="veganova"] .bubble{max-width:min(91%,710px);border-radius:17px 17px 17px 6px;line-height:1.55}
:root[data-theme="veganova"] .bubble.mine{border-radius:17px 17px 6px 17px}
:root[data-theme="veganova"] .bubble.note{border-radius:10px}
:root[data-theme="veganova"] .composer{gap:4px;padding:4px 5px 4px 8px;min-height:56px;border-radius:17px;border-color:#365573;background:var(--form)}
:root[data-theme="veganova"] .composer #attach{order:0;color:var(--muted)}
:root[data-theme="veganova"] .composer #attach svg{vertical-align:middle;pointer-events:none}
:root[data-theme="veganova"] .composer input[name="message"]{order:1;font-size:1em}
:root[data-theme="veganova"] .composer #record{order:2;color:var(--muted)}
:root[data-theme="veganova"] .composer button[type="submit"]{order:3;flex:0 0 46px;min-width:46px;min-height:46px;border-radius:12px;background:var(--action);color:#071322}
:root[data-theme="veganova"] .drawer{background:var(--drawer-bg);border-color:var(--edge)}
:root[data-theme="veganova"] .topics button{background:var(--topic);border-color:var(--edge)}
:root[data-theme="veganova"] .topics button.active{border-color:var(--ring)}
:root[data-theme="veganova"] .login-view{max-width:min(92vw,480px);margin:clamp(18px,12vh,110px) auto 0;background:var(--form)}
@media(min-width:860px){
 :root[data-theme="veganova"] .phone:has(#chat-view:not(.hidden)) .drawer{width:278px;top:0;bottom:0;transform:none;transition:none;z-index:2}
 :root[data-theme="veganova"] .phone:has(#chat-view:not(.hidden)) .drawer-head #close-menu{display:none}
 :root[data-theme="veganova"] .phone:has(#chat-view:not(.hidden)) .top,:root[data-theme="veganova"] .phone:has(#chat-view:not(.hidden)) .chat-view{margin-left:278px;width:calc(100% - 278px)}
 :root[data-theme="veganova"] .phone:has(#chat-view:not(.hidden)) .top #menu{display:none}
 :root[data-theme="veganova"] .phone:has(#chat-view:not(.hidden)) .backdrop{display:none!important}
 :root[data-theme="veganova"] .chat-view{padding-inline:28px}
}
@media(max-width:360px){:root[data-theme="veganova"] .top{padding-inline:9px;gap:5px}:root[data-theme="veganova"] .top .sub{font-size:16px}:root[data-theme="veganova"] .composer{gap:0}}

