:root{color-scheme:dark;--bg:#08090b;--ink:#f4f4f5;--muted:#999a9f;--line:rgba(255,255,255,.12)}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;-webkit-font-smoothing:antialiased}button,input,select,textarea{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer;color:inherit;border:0}button:disabled{opacity:.45;cursor:wait}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid white;outline-offset:4px}a{color:inherit}svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.svg-library{position:absolute;width:0;height:0;overflow:hidden}.hidden{display:none!important}
.atmosphere{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:-1}.halo{position:absolute;width:540px;height:520px;top:-350px;left:calc(50% - 150px);background:radial-gradient(ellipse,rgba(239,241,248,.26),transparent 65%);filter:blur(60px)}.halo-bottom{top:60%;left:-420px;width:720px;opacity:.35}.grain{position:absolute;inset:0;background-image:radial-gradient(rgba(255,255,255,.12) .45px,transparent .45px);background-size:4px 4px;opacity:.045}
main{max-width:740px;margin:auto;padding:24px 22px calc(115px + env(safe-area-inset-bottom))}.topbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:26px}.brand{display:flex;gap:12px;align-items:center;background:none;padding:0;text-align:left;letter-spacing:-.5px;font-size:20px;font-weight:700}.brand small{display:block;color:#75767d;font-size:8px;font-weight:600;letter-spacing:2.2px;margin-top:2px}.logo{display:flex;align-items:center;justify-content:center;width:43px;height:43px;background:#f1f1f2;color:#141518;border-radius:14px;font:700 28px/1 Georgia,serif;letter-spacing:-7px;padding-right:6px;box-shadow:0 5px 30px #ffffff13}.logo span{opacity:.45}.avatar{background:#ffffff0a;border:1px solid var(--line);border-radius:50%;width:39px;height:39px;font-weight:600;color:#cacbd0}
.glass{background:linear-gradient(135deg,rgba(255,255,255,.075),rgba(255,255,255,.018));border:1px solid var(--line);box-shadow:inset 0 1px 0 #ffffff0a,0 12px 45px #00000030;backdrop-filter:blur(28px) saturate(0);-webkit-backdrop-filter:blur(28px) saturate(0)}.eyebrow{font-size:9px;letter-spacing:2px;color:#93949a;font-weight:600}.hero{position:relative;overflow:hidden;border-radius:28px;padding:32px;min-height:325px}.hero h1{position:relative;font-size:66px;line-height:.99;letter-spacing:-4px;font-weight:600;margin:28px 0 19px}.hero h1 span,.page-heading h1 span{color:#a6a7ad}.hero p{font-size:14px;color:#acadb2;margin-bottom:23px;position:relative}.ghost-word{position:absolute;right:-65px;top:38px;font-size:100px;font-weight:700;letter-spacing:-8px;color:transparent;-webkit-text-stroke:1px #ffffff0c;transform:rotate(-12deg);filter:blur(.3px);user-select:none}.hero:after{content:"";position:absolute;pointer-events:none;width:170px;height:190px;right:-100px;bottom:-120px;border-radius:50%;background:#eee;filter:blur(70px);opacity:.23}.primary{display:inline-flex;align-items:center;justify-content:center;gap:18px;border-radius:13px;padding:13px 19px;background:#ececed;color:#0b0c0e;font-size:13px;font-weight:650}.primary:hover{background:#fff}.primary svg{width:18px}.hero-seal{position:relative;margin-top:18px;color:#73747c;font-size:10px;display:flex;gap:5px;align-items:center}.hero-seal svg{width:13px;height:13px}.status-line{display:flex;gap:8px;align-items:center;font-size:10px;color:#898a92;margin:20px 1px}.pulse{width:5px;height:5px;background:#b8b9bf;border-radius:50%;box-shadow:0 0 10px #ffffff44;flex-shrink:0}.edition{margin-left:auto;font-size:8px;letter-spacing:1.8px;white-space:nowrap;color:#62636c}.stats{display:grid;grid-template-columns:repeat(3,1fr);margin:28px 0 34px}.stats>div{display:flex;flex-direction:column;align-items:center;border-right:1px solid var(--line)}.stats>div:last-child{border:0}.stats strong{font-size:30px;font-weight:450;letter-spacing:-1px}.stats span{font-size:10px;color:#868791}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:28px 0 16px}.section-heading h2{font-size:16px;font-weight:600;letter-spacing:-.4px;margin:0}.section-heading .eyebrow{font-size:8px}
.tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.tile{position:relative;display:flex;flex-direction:column;align-items:flex-start;text-align:left;min-height:145px;padding:19px;border-radius:20px;transition:background .2s,transform .2s}.tile:hover{background:#ffffff0a;transform:translateY(-2px)}.tile>svg:first-child{margin-bottom:20px;width:24px;height:24px;color:#c9c9ce}.tile strong{font-size:14px;font-weight:550;letter-spacing:-.25px}.tile small{color:#868791;font-size:11px;margin-top:5px;line-height:1.45}.tile .corner{position:absolute;right:16px;top:18px;width:13px;height:13px;color:#5b5c65}.wide-link{margin-top:14px;width:100%;display:flex;gap:14px;align-items:center;padding:18px 20px;border-radius:20px;text-align:left}.wide-link span{display:flex;flex:1;flex-direction:column}.wide-link strong{font-size:13px;font-weight:500}.wide-link small{font-size:11px;color:#81828c;margin-top:3px}.wide-link>svg:last-child{width:16px;color:#777884}
.page-heading{margin:32px 0 25px}.page-heading h1{font-size:44px;line-height:1.12;font-weight:550;letter-spacing:-2px;margin:17px 0 14px}.page-heading p{color:var(--muted);font-size:13px;max-width:430px;margin:0}.page-heading.compact h1{font-size:36px}.archive-actions{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}.subtle{background:#ffffff06;border:1px solid var(--line);border-radius:12px;padding:10px 13px;display:inline-flex;align-items:center;justify-content:center;gap:8px;font-size:12px}.subtle svg{width:15px;height:15px}.search{display:flex;align-items:center;gap:12px;border-radius:16px;padding:15px 17px}.search svg{width:18px;height:18px;color:#8a8b93}.search input{border:0;background:none;color:inherit;min-width:0;width:100%;outline:0;font-size:13px}.search input::placeholder{color:#6b6c75}.filters{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0 16px}.filters label{display:flex;gap:9px;align-items:center;min-width:0;border-bottom:1px solid var(--line);padding:8px 0}.filters label span{font-size:10px;color:#777884}.filters select{color:#c3c4c9;border:0;background:none;min-width:0;width:100%;font-size:11px;padding:5px 0}.filters select option{background:#18191d;color:white}.chips{display:flex;gap:7px;overflow-x:auto;padding:3px 1px 10px;scrollbar-width:none}.chips button{white-space:nowrap;background:none;border:1px solid #ffffff12;color:#82838d;border-radius:30px;padding:8px 14px;font-size:11px}.chips button.selected{background:#dedee1;color:#111216;border-color:transparent}.notice{color:#92939d;font-size:12px;line-height:1.65;min-height:18px}.global-notice:empty{display:none}.global-notice{color:#babac1;font-size:12px;background:#ffffff06;border:1px solid var(--line);padding:12px 16px;border-radius:12px}.message{display:block;width:100%;padding:18px 19px;text-align:left;margin-bottom:10px;border-radius:20px}.row-top{display:flex;gap:11px;align-items:center}.chat-icon{width:35px;height:35px;border-radius:12px;background:#ffffff08;border:1px solid #ffffff0b;display:flex;align-items:center;justify-content:center;color:#a5a6af;font-size:13px;flex-shrink:0}.chat-meta{min-width:0;display:flex;flex-direction:column;flex:1}.chat-meta strong{font-size:13px;font-weight:550;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.chat-meta small{font-size:10px;color:#7d7e88}.time{font-size:9px;color:#777884;white-space:nowrap}.message .body{font-size:13px;color:#c7c8ce;margin:13px 0;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere}.row-bottom{display:flex;justify-content:space-between;color:#757680;font-size:9px}.badge{display:flex;align-items:center;gap:5px}.badge:before{content:"";width:3px;height:3px;border-radius:50%;background:#999aa3}
.service-panel{border-radius:22px;padding:22px;margin:12px 0}.service-panel h2{font-size:17px;font-weight:600;letter-spacing:-.4px;margin:0 0 14px;overflow-wrap:anywhere}.service-text{white-space:pre-wrap;overflow-wrap:anywhere;color:#b8b9c0;font-size:13px;line-height:1.75}.service-text a{color:#eee;text-decoration:underline;text-underline-offset:3px}.service-text code,.service-text pre{font-family:ui-monospace,monospace;background:#ffffff08;border-radius:5px;padding:1px 4px}.service-text pre{white-space:pre-wrap;padding:12px}.service-buttons{display:flex;flex-direction:column;gap:8px;margin-top:19px}.button-row{display:flex;gap:8px}.action-button{flex:1;min-width:0;overflow-wrap:anywhere;text-align:left;font-size:12px;line-height:1.5;padding:12px 13px;border-radius:12px;background:#ffffff05;border:1px solid #ffffff10;display:flex;align-items:center;justify-content:space-between;gap:6px;text-decoration:none}.action-button svg{width:13px;height:13px;flex-shrink:0;color:#7d7e87}.action-button.primary-action{background:#e5e5e8;color:#121317;border-color:transparent}.action-button.danger{border-color:#ffffff3c;background:#ffffff0b}.action-button:hover{border-color:#ffffff38}.service-panel.user{margin-left:38px;background:#ffffff09}.service-panel.user .service-text{color:#e1e1e5}.chat-label{display:block;font-size:9px;letter-spacing:1.5px;color:#777884;margin-bottom:8px}.composer{border-radius:20px;padding:18px;margin-top:20px}.composer label{display:block;font-size:12px;color:#b9b9c1;margin-bottom:9px}.composer textarea{width:100%;color:inherit;border:0;resize:vertical;min-height:70px;background:none;font-size:13px;outline:0;line-height:1.6}.composer textarea::placeholder{color:#696a75}.composer-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:9px}.composer-bottom small{font-size:9px;color:#777884}.composer .primary{font-size:11px;padding:10px 14px;gap:9px}.privacy{display:flex;gap:13px;align-items:flex-start;border-radius:20px;padding:20px;margin-top:25px}.privacy svg{width:18px;color:#83848e}.privacy p{margin:0;color:#858690;font-size:11px}
footer{font-size:8px;letter-spacing:2px;text-align:center;color:#464751;margin-top:45px}footer span{margin:0 8px}
dialog{color:inherit;border-radius:24px;max-width:560px;width:calc(100% - 28px);max-height:85dvh;overflow:auto;padding:28px;background:#191a1dee}dialog::backdrop{background:#0009;backdrop-filter:blur(15px);-webkit-backdrop-filter:blur(15px)}dialog .close{float:right;background:#ffffff08;color:#ccc;border-radius:50%;width:30px;height:30px;font-size:22px;padding:0}dialog h2{font-size:22px;margin-bottom:8px}dialog h3{font-size:13px;margin-top:24px}#detail-date{font-size:11px;color:#888993}#detail-body{font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere;margin:20px 0}#detail-media img,#detail-media video{max-width:100%;border-radius:12px}#detail-media audio{max-width:100%}.version{padding:13px 0;border-top:1px solid var(--line);white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;color:#b8b9c0}.version small{display:block;margin-bottom:6px;color:#777884;font-size:9px}
@media(min-width:650px){main{padding-top:32px}.hero{min-height:345px;padding:40px}.hero h1{font-size:79px}.hero-seal{font-size:11px;right:40px}.tiles{grid-template-columns:repeat(3,minmax(0,1fr))}.tile{min-height:158px}.page-heading h1{font-size:52px}}
@media(max-width:380px){main{padding-left:16px;padding-right:16px}.hero{padding:26px 23px}.hero h1{font-size:57px}.hero-seal{display:none}.tile{padding:16px}.button-row{flex-wrap:wrap}.action-button{flex-basis:100%}.time{font-size:8px}.page-heading h1{font-size:38px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* Liquid glass palette. Personal preferences are applied before the first API call. */
:root {
  --secondary: #b8bac4;
  --quiet: #9295a2;
  --faint: #717583;
  --line: rgba(255, 255, 255, .16);
  --surface: rgba(24, 25, 31, .54);
  --opaque: #1a1b21;
  --glass-top: rgba(255, 255, 255, .12);
  --glass-bottom: rgba(255, 255, 255, .025);
  --edge: rgba(255, 255, 255, .23);
  --shine: rgba(255, 255, 255, .1);
  --shadow: rgba(0, 0, 0, .24);
  --button: #f1f2f5;
  --button-ink: #111217;
  --soft: rgba(255, 255, 255, .07);
  --halo: rgba(239, 241, 248, .3);
  --backdrop: rgba(0, 0, 0, .52);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f0f1f4;
  --ink: #14151b;
  --muted: #626574;
  --secondary: #4e5261;
  --quiet: #676b79;
  --faint: #787d8b;
  --line: rgba(29, 34, 52, .13);
  --surface: rgba(255, 255, 255, .48);
  --opaque: #f9fafc;
  --glass-top: rgba(255, 255, 255, .85);
  --glass-bottom: rgba(255, 255, 255, .15);
  --edge: rgba(255, 255, 255, .98);
  --shine: rgba(255, 255, 255, .85);
  --shadow: rgba(43, 49, 72, .09);
  --button: #20222c;
  --button-ink: #fafafd;
  --soft: rgba(36, 42, 65, .045);
  --halo: rgba(104, 112, 135, .2);
  --backdrop: rgba(48, 52, 69, .18);
}
body { font-weight: 500; }
svg { stroke-width: 1.85; }
.hero h1, .page-heading h1 { font-weight: 760; }
.hero h1 span, .page-heading h1 span { color: var(--secondary); }
.hero p, .page-heading p { color: var(--secondary); font-weight: 520; }
.brand { font-weight: 800; }
.brand small, .eyebrow, .edition { color: var(--quiet); font-weight: 750; }
.section-heading h2, .tile strong, .wide-link strong { font-weight: 720; }
.stats strong { font-weight: 720; }
.stats span, .status-line, .hero-seal { color: var(--quiet); font-weight: 600; }
.tile small, .wide-link small, .chat-meta small, .time, .row-bottom { color: var(--quiet); }
.tile>svg:first-child, .chat-icon, .avatar { color: var(--secondary); }
.tile .corner, .wide-link>svg:last-child, .search svg, .action-button svg { color: var(--quiet); }
.chat-meta strong, .primary, .subtle, .action-button, .chips button { font-weight: 650; }
.message .body, .service-text, .service-panel.user .service-text { color: var(--secondary); font-weight: 520; }
.service-text strong { color: var(--ink); font-weight: 750; }
.service-text a { color: var(--ink); }
.service-text code, .service-text pre { background: var(--soft); }
.notice, .chat-label, .composer-bottom small, .privacy p, #detail-date, .version small { color: var(--quiet); }
.composer label, .version { color: var(--secondary); }
.search input::placeholder, .composer textarea::placeholder { color: var(--faint); }
.filters label span, .filters select { color: var(--secondary); }
.filters select option { background: var(--opaque); color: var(--ink); }
.privacy svg { color: var(--quiet); }
footer { color: var(--faint); font-weight: 650; }
.header-controls { display: flex; gap: 10px; align-items: center; }
.appearance-button { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; }
.appearance-button svg { width: 18px; height: 18px; }

/* Curved highlights, translucent depth and refracted edges on every surface. */
.glass, .subtle, .action-button, .chips button, .filters label, .chat-icon, .avatar, .global-notice, dialog .close {
  background:
    radial-gradient(ellipse at 12% 0%, var(--shine), transparent 62%),
    linear-gradient(145deg, var(--glass-top), var(--glass-bottom) 54%, var(--shine)),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--edge), inset 0 -1px 0 var(--shine),
    0 8px 32px var(--shadow);
  backdrop-filter: blur(26px) saturate(115%);
  -webkit-backdrop-filter: blur(26px) saturate(115%);
}
.hero { box-shadow: inset 0 1px 0 var(--edge), inset 1px 0 0 var(--shine), 0 24px 60px var(--shadow); }
.hero::after { background: var(--ink); opacity: .12; }
.ghost-word { -webkit-text-stroke-color: var(--line); opacity: .45; }
.halo { background: radial-gradient(ellipse, var(--halo), transparent 65%); }
.grain { background-image: radial-gradient(var(--ink) .45px, transparent .45px); }
.tile:hover { background-color: var(--soft); }
.primary, .action-button.primary-action, .chips button.selected {
  color: var(--button-ink);
  background: linear-gradient(145deg, var(--button), var(--button));
  border-color: transparent;
  box-shadow: inset 0 1px 0 var(--edge), 0 5px 22px var(--shadow);
}
.primary:hover { background: var(--button); }
.primary svg, .primary-action svg { color: inherit; }
.action-button.danger { border-color: var(--quiet); background-color: var(--soft); }
.action-button:hover { border-color: var(--quiet); }
.service-panel.user { background-color: var(--soft); }
.global-notice { color: var(--secondary); }
.filters label { padding: 10px 12px; border-radius: 13px; }
.chips button { color: var(--secondary); }
.logo { background: var(--button); color: var(--button-ink); }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
dialog .close { color: var(--ink); }

/* Appearance settings remain usable without Telegram authorization or storage. */
.appearance-dialog { padding: 28px; }
.appearance-dialog h2 { font-weight: 780; letter-spacing: -.7px; margin-top: 14px; }
.appearance-intro { color: var(--secondary); font-size: 13px; margin-bottom: 24px; }
.theme-fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.theme-fieldset legend { font-size: 13px; font-weight: 700; margin-bottom: 11px; }
.theme-picker { display: flex; gap: 4px; padding: 5px; border-radius: 16px; }
.theme-picker label { position: relative; flex: 1; cursor: pointer; text-align: center; }
.theme-picker input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.theme-picker span { display: block; padding: 11px 3px; border-radius: 11px; font-size: 11px; font-weight: 700; color: var(--quiet); }
.theme-picker input:checked + span { color: var(--button-ink); background: var(--button); box-shadow: 0 4px 16px var(--shadow); }
.theme-picker input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.preference-row { display: flex; align-items: center; gap: 16px; position: relative; padding: 18px; border-radius: 19px; margin-bottom: 10px; cursor: pointer; }
.preference-row > span:first-child { flex: 1; min-width: 0; }
.preference-row strong { display: block; font-size: 13px; font-weight: 720; }
.preference-row small { display: block; color: var(--quiet); font-size: 10px; line-height: 1.6; margin-top: 5px; }
.preference-row input { position: absolute; right: 18px; opacity: 0; width: 44px; height: 27px; margin: 0; cursor: pointer; }
.switch-track { width: 44px; height: 27px; border-radius: 30px; flex-shrink: 0; border: 1px solid var(--line); background: var(--soft); box-shadow: inset 0 1px 4px var(--shadow); }
.switch-track::before { content: ''; display: block; width: 21px; height: 21px; border-radius: 50%; margin: 2px; background: var(--quiet); box-shadow: inset 0 1px 1px var(--edge), 0 2px 4px var(--shadow); }
.preference-row input:checked + .switch-track { background: var(--button); border-color: transparent; }
.preference-row input:checked + .switch-track::before { transform: translateX(17px); background: var(--button-ink); }
.preference-row input:focus-visible + .switch-track { outline: 2px solid var(--ink); outline-offset: 3px; }
.appearance-hint { color: var(--quiet); font-size: 10px; line-height: 1.6; margin: 16px 0; }
.appearance-hint:empty { display: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline-color: var(--ink); }

/* Blur can be fully removed while retaining readable glass highlights. */
html[data-blur="off"] .glass, html[data-blur="off"] .subtle,
html[data-blur="off"] .action-button, html[data-blur="off"] .chips button,
html[data-blur="off"] .filters label,
html[data-blur="off"] .chat-icon, html[data-blur="off"] .avatar,
html[data-blur="off"] .global-notice, html[data-blur="off"] dialog .close {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background-color: var(--opaque);
}
html[data-blur="off"] dialog::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
html[data-blur="off"] .halo { display: none; }
html[data-blur="off"] .ghost-word, html[data-blur="off"] .hero::after { filter: none; }

/* Small icon gestures and soft transitions; no continuous page movement. */
html[data-motion="on"] button, html[data-motion="on"] .action-button,
html[data-motion="on"] svg, html[data-motion="on"] .switch-track,
html[data-motion="on"] .switch-track::before, html[data-motion="on"] .theme-picker span {
  transition: transform .24s cubic-bezier(.2,.8,.2,1), background-color .2s, box-shadow .2s, color .2s;
}
html[data-motion="on"] .view:not(.hidden) { animation: glass-arrive .32s ease-out; }
html[data-motion="on"] dialog[open] { animation: glass-arrive .22s ease-out; }
html[data-motion="on"] button:active:not(:disabled) { transform: scale(.97); }
html[data-motion="on"] button:is(:hover,:focus-visible) svg[data-icon="spark"] { animation: sparkle .75s ease-in-out; }
html[data-motion="on"] button:is(:hover,:focus-visible) svg[data-icon="grid"] { animation: icon-turn .65s ease-in-out; }
html[data-motion="on"] button:is(:hover,:focus-visible) svg[data-icon="settings"] { animation: icon-rock .7s ease-in-out; }
html[data-motion="on"] button:is(:hover,:focus-visible) svg[data-icon="archive"] { animation: icon-bob .65s ease-in-out; }
html[data-motion="on"] button:is(:hover,:focus-visible) svg[data-icon="arrow"] { transform: translateX(3px); }
@keyframes sparkle { 0%,100% { transform: rotate(0) scale(1); } 45% { transform: rotate(14deg) scale(1.16); } 70% { transform: rotate(-8deg) scale(.98); } }
@keyframes icon-bob { 0%,100% { transform: translateY(0); } 45% { transform: translateY(-3px); } }
@keyframes icon-turn { 0%,100% { transform: rotate(0); } 50% { transform: rotate(12deg) scale(1.07); } }
@keyframes icon-rock { 0%,100% { transform: rotate(0); } 35% { transform: rotate(-12deg); } 70% { transform: rotate(10deg); } }
@keyframes glass-arrive { from { opacity: .3; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
html[data-motion="off"] .tile:hover { transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .tile:hover { transform: none; }
}

/* Static aurora: gradients are painted once, without full-screen filter layers. */
:root { --accent: #b2a0ff; --accent-rgb: 178, 160, 255; --accent-ink: #000000; }
:root[data-theme] {
  --button: var(--accent);
  --button-ink: var(--accent-ink);
  --control-surface: linear-gradient(145deg, rgba(var(--accent-rgb), .18), rgba(var(--accent-rgb), .06)), var(--surface);
  --control-hover: linear-gradient(145deg, rgba(var(--accent-rgb), .28), rgba(var(--accent-rgb), .12)), var(--surface);
  --control-border: rgba(var(--accent-rgb), .35);
}
body {
  background:
    radial-gradient(ellipse at 0% 0%, rgba(var(--accent-rgb), .20), transparent 48%),
    radial-gradient(ellipse at 100% 35%, rgba(var(--accent-rgb), .10), transparent 50%),
    var(--bg);
  background-repeat: no-repeat;
}
.atmosphere { display: none; }
.hero {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(var(--accent-rgb), .16), transparent 62%),
    linear-gradient(145deg, var(--glass-top), var(--glass-bottom)), var(--surface);
}
.hero::after { display: none; }
.ghost-word { filter: none; }
.hero h1 span { color: var(--accent-soft, var(--ink)); }
html[data-theme="light"] .hero h1 span { color: var(--secondary); }
.accent-palette { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-bottom: 13px; }
.color-swatch { position: relative; min-width: 0; height: 44px; border-radius: 13px; background: var(--swatch); border: 2px solid transparent; box-shadow: inset 0 1px 1px #ffffff70; }
@media(min-width:500px) { .accent-palette { grid-template-columns: repeat(8, minmax(0,1fr)); } }
.color-swatch[aria-pressed="true"] { outline: 1.5px solid var(--ink); outline-offset: 2px; }
.custom-color { display: flex; align-items: center; gap: 12px; padding: 12px 15px; border-radius: 15px; }
.custom-color label { font-size: 12px; font-weight: 700; flex: 1; }
.custom-color input[type="color"] { width: 33px; height: 33px; padding: 0; border: 0; border-radius: 9px; background: none; cursor: pointer; }
.custom-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.custom-color input[type="color"]::-webkit-color-swatch { border: 1px solid var(--line); border-radius: 9px; }
.custom-color input[type="text"] { width: 82px; min-width: 0; color: var(--ink); background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 7px; font: 12px ui-monospace,monospace; }
#accent-error:empty { display: none; }
.appearance-dialog { overscroll-behavior: contain; }

/* Never blur every button or nested child, even with full effects enabled. */
.subtle, .action-button, .chips button, .filters label, .chat-icon, .avatar,
.global-notice, dialog .close, .theme-picker, .preference-row, .custom-color,
.appearance-button {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* Auto uses this mode on narrow screens or touch devices, including old saved preferences. */
html[data-effects="lite"] .glass {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: inset 0 1px 0 var(--edge), 0 3px 10px var(--shadow);
}
html[data-effects="lite"] dialog::backdrop { backdrop-filter: none; -webkit-backdrop-filter: none; }
html[data-effects="lite"] .view:not(.hidden) { animation: none; }
html[data-effects="lite"] .hero h1 { text-wrap: balance; }
html[data-document-hidden="true"] *, html[data-document-hidden="true"] *::before,
html[data-document-hidden="true"] *::after { animation-play-state: paused !important; }
@supports (content-visibility: auto) {
  html[data-effects="lite"] .message { content-visibility: auto; contain-intrinsic-size: auto 155px; }
}
@media (max-width: 600px) {
  main { padding: 18px 16px calc(105px + env(safe-area-inset-bottom)); }
  .hero { padding: 27px 24px; min-height: 0; }
  .hero h1 { font-size: clamp(46px, 13.5vw, 66px); letter-spacing: -3px; }
  .appearance-dialog { padding: 23px 18px; max-height: 90dvh; }
  .preference-row { padding: 15px; }
  .theme-picker span { min-height: 40px; display: grid; place-items: center; }
  .color-swatch { border-radius: 11px; }
  .button-row { flex-wrap: wrap; }
  .action-button { min-height: 44px; }
}

/* A compact workspace: featured actions, settings cards and separate choices. */
.service-panel.configuration { padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.workspace-summary { border-radius: 22px; padding: 18px 20px; margin-bottom: 18px; border-left: 3px solid var(--accent); }
.summary-caption { display: block; margin-bottom: 8px; font-size: 10px; font-weight: 800; letter-spacing: 1.5px; color: var(--quiet); }
.workspace-summary .service-text { font-size: 13px; line-height: 1.8; color: var(--secondary); }
.native-controls { display: flex; flex-direction: column; gap: 16px; }
html[data-effects] .control-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; background: none; background-color: transparent; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; overflow: visible; }
.setting-row { position: relative; display: flex; flex-wrap: wrap; align-content: flex-start; align-items: center; gap: 12px; width: 100%; min-width: 0; min-height: 138px; padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); text-align: left; text-decoration: none; }
.setting-row:hover, .option-card:hover, .module-card:hover { background: var(--soft); border-color: var(--quiet); }
.control-icon { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 12px; background: rgba(var(--accent-rgb), .12); color: var(--accent-soft); }
.control-icon svg { width: 19px; height: 19px; }
.control-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.control-copy strong { font-size: 14px; font-weight: 750; letter-spacing: -.25px; overflow-wrap: anywhere; }
.control-copy small { color: var(--quiet); font-size: 11px; line-height: 1.5; }
.setting-row .control-copy { flex-basis: 100%; order: 2; }
.setting-row > svg { width: 15px; height: 15px; color: var(--quiet); margin-left: auto; }
.control-value { margin-left: auto; max-width: calc(100% - 48px); font-size: 11px; font-weight: 650; color: var(--accent-soft); text-align: right; overflow-wrap: anywhere; }
.setting-row:has(.control-value) > svg { display: none; }
.setting-row[data-kind="toggle"], .setting-row[data-wide="true"] { grid-column: 1 / -1; min-height: 76px; flex-wrap: nowrap; align-content: center; }
.setting-row[data-kind="toggle"] .control-copy, .setting-row[data-wide="true"] .control-copy { flex-basis: auto; order: 0; }
.control-switch { position: relative; flex: 0 0 44px; width: 44px; height: 27px; border: 1px solid var(--line); border-radius: 30px; background: var(--soft); }
.control-switch > span { position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; background: var(--quiet); border-radius: 50%; }
.control-switch[data-on="true"] { background: var(--accent); border-color: transparent; }
.control-switch[data-on="true"] > span { left: 20px; background: var(--accent-ink); }
.option-grid, .module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.option-card, .module-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); text-align: left; text-decoration: none; }
.option-card .control-copy, .module-card .control-copy { width: 100%; }
.option-card[data-selected="true"] { border-color: var(--accent); background: linear-gradient(145deg, rgba(var(--accent-rgb), .16), var(--surface)); }
.choice-marker { position: absolute; top: 20px; right: 18px; width: 21px; height: 21px; border: 1px solid var(--line); border-radius: 50%; }
.option-card[data-selected="true"] .choice-marker { background: var(--accent); color: var(--accent-ink); border: 0; display: grid; place-items: center; }
.choice-marker svg { width: 13px; height: 13px; }
.option-traits { width: 100%; display: flex; flex-direction: column; gap: 8px; padding-top: 5px; }
.option-trait { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.option-trait small { font-size: 10px; color: var(--quiet); }
.trait-meter { width: 42%; height: 4px; border-radius: 8px; background: var(--soft); overflow: hidden; }
.trait-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.option-grid:not([data-group="models"]) .option-card { flex-direction: row; align-items: center; min-height: 76px; padding: 16px 42px 16px 16px; }
.option-grid:not([data-group="models"]) .choice-marker { top: calc(50% - 10px); right: 12px; }
.option-grid:not([data-group="models"]) .control-icon { display: none; }
.module-card { min-height: 148px; }
.module-card > svg { position: absolute; right: 18px; bottom: 18px; width: 16px; height: 16px; color: var(--quiet); }
.module-status { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-right: 20px; color: var(--quiet); font-size: 10px; }
.module-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--quiet); }
.module-status.enabled { color: var(--accent-soft); }
.module-status.enabled::before { background: var(--accent); }
html[data-theme="light"] :is(.setting-row, .option-card, .module-card, .tile) .control-icon { color: var(--ink); }
html[data-theme="light"] .control-value, html[data-theme="light"] .module-status.enabled { color: var(--secondary); }
.context-navigation, .pagination-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.context-back, .page-step { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 14px; background: var(--soft); font-size: 12px; color: var(--secondary); text-decoration: none; }
.context-back > svg, .page-step > svg { width: 14px; height: 14px; }
.backward > svg { transform: rotate(180deg); }
.pagination-controls { justify-content: space-between; }
.page-step { flex: 1; }
.action-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.action-strip > :only-child { grid-column: 1 / -1; }
.feature-action, .destructive-control, .download-card { display: flex; align-items: center; gap: 12px; padding: 18px; width: 100%; min-width: 0; min-height: 68px; border-radius: 22px; text-align: left; text-decoration: none; }
.feature-action { background: var(--accent); color: var(--accent-ink); }
.feature-action .control-icon { background: rgba(0,0,0,.08); color: inherit; }
.feature-action .control-copy small { color: inherit; opacity: .75; }
.feature-action > svg, .destructive-control > svg, .download-card > svg { width: 16px; height: 16px; }
.destructive-control { background: var(--soft); border: 1px solid var(--line); color: var(--ink); }
.destructive-control .control-icon { color: var(--ink); background: var(--soft); }
.download-card { margin-top: 16px; background: var(--soft); }
.download-card > span:not(.control-icon) { flex: 1; font-size: 13px; overflow-wrap: anywhere; }
.board-grid { display: flex; flex-direction: column; gap: 6px; }
.board-row { display: flex; gap: 6px; }
.board-cell { flex: 1; min-width: 0; min-height: 44px; padding: 12px 4px; border-radius: 12px; background: var(--soft); font-size: 20px; }
@media(min-width:650px) {
  .module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media(max-width:360px) {
  .control-list, .option-grid, .action-strip { grid-template-columns: minmax(0, 1fr); }
  .setting-row { min-height: 74px; flex-wrap: nowrap; padding: 16px; }
  .setting-row .control-copy { flex-basis: auto; order: 0; }
  .setting-row .control-value { max-width: 26%; }
  .control-copy strong { font-size: 13px; }
  .module-card { padding: 16px 14px; }
}

/* Softer touch targets and a dedicated personal-instructions editor. */
.primary, .subtle, .action-button, .chips button, .context-back, .page-step,
.board-cell,
.theme-picker, .theme-picker span { border-radius: 999px; }
.composer, .preference-row, dialog { border-radius: 24px; }
#instructions { width: min(520px, calc(100% - 28px)); padding: 26px; }
#instructions h2 { padding-right: 28px; }
.instructions-description { color: var(--secondary); font-size: 13px; line-height: 1.7; }
#instructions-text { width: 100%; min-height: 170px; padding: 18px; border: 1px solid var(--line); border-radius: 24px; background: var(--soft); color: var(--ink); resize: vertical; }
#instructions-form .primary { width: 100%; justify-content: center; }
.avatar { display: grid; place-items: center; padding: 0; overflow: hidden; }
.avatar img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar svg { width: 19px; height: 19px; }

/* Pagination swipe: horizontal gestures flip pages, buttons stay as fallback. */
#service-content { touch-action: pan-y; }
.pagination-controls[data-swipe="true"]::after {
  content: "или листайте свайпом ← →";
  flex-basis: 100%;
  text-align: center;
  font-size: 10px;
  color: var(--quiet);
}
/* Seamless page turns: tactile drag behind the finger, directional slide-in. */
html[data-motion="on"] .service-panel.page-turn-next { animation: page-in-right .32s cubic-bezier(.2,.8,.2,1); }
html[data-motion="on"] .service-panel.page-turn-left { animation: page-in-left .32s cubic-bezier(.2,.8,.2,1); }
@keyframes page-in-right { from { opacity: 0; transform: translateX(56px); } to { opacity: 1; transform: translateX(0); } }
@keyframes page-in-left { from { opacity: 0; transform: translateX(-56px); } to { opacity: 1; transform: translateX(0); } }

/* A quiet header and a five-section dock keep every destination within reach. */
.topbar { justify-content: flex-end; margin-bottom: 12px; }
.page-heading { margin: 18px 0 24px; }
.page-heading h1, .page-heading.compact h1 { font-size: clamp(30px, 7vw, 42px); letter-spacing: -1.5px; margin: 8px 0 12px; }
.archive-heading { margin: 8px 0 18px; }
.archive-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.archive-actions .subtle { min-height: 48px; padding: 12px; border-radius: 16px; }
.chips { padding: 6px 6px 10px; scroll-padding-inline: 6px; }
.chips button { flex: 0 0 auto; min-height: 44px; }
#more, #more-history { width: 100%; min-height: 48px; margin-top: 12px; }
.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { min-height: 128px; padding: 18px; gap: 14px; border-radius: 22px; }
.tile .control-copy { flex: initial; }
.tile .corner { top: 24px; right: 18px; }
#home-tiles .tile:first-child { grid-column: 1 / -1; min-height: 110px; flex-direction: row; align-items: center; padding: 22px; background: linear-gradient(115deg, rgba(var(--accent-rgb), .18), var(--surface)); }
#home-tiles .tile:first-child .control-icon { width: 48px; height: 48px; flex-basis: 48px; border-radius: 16px; }
#home-tiles .tile:first-child .control-copy { flex: 1; padding-right: 18px; }
#home-tiles .tile:first-child .corner { position: static; }
#home-tiles .tile:last-child { grid-column: 1 / -1; min-height: 78px; flex-direction: row; align-items: center; }
#home-tiles .tile:last-child .control-copy { flex: 1; padding-right: 16px; }
#home-tiles .tile:last-child .corner { position: static; }
#profile-tiles .tile { flex-direction: row; align-items: center; min-height: 96px; gap: 12px; padding: 16px; }
#profile-tiles .tile .control-copy { flex: 1; padding-right: 0; }
#profile-tiles .tile .corner { display: none; }
#profile-tiles .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
.wide-link { border-radius: 22px; min-height: 80px; }
.segment-tabs { display: flex; gap: 5px; padding: 5px; border-radius: 18px; margin-bottom: 10px; }
.segment-tabs button { flex: 1; min-width: 0; min-height: 46px; padding: 12px; border-radius: 13px; background: none; color: var(--secondary); font-size: 12px; font-weight: 700; }
.segment-tabs button.selected { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 16px var(--shadow); }
.instruction-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 22px; }
.instruction-actions .subtle { min-height: 44px; background: none; border: 0; padding: 10px 4px; color: var(--secondary); }
.instruction-actions .subtle:last-child { color: var(--quiet); }
@media(max-width:440px) {
  #profile-tiles { grid-template-columns: minmax(0, 1fr); }
  #profile-tiles .tile { min-height: 80px; }
  #profile-tiles .tile .corner { display: block; position: static; }
  .feature-action, .destructive-control { padding: 16px 14px; gap: 10px; }
  .action-strip:has(> :nth-child(2)) .control-icon { display: none; }
}

/* Modal content stays opaque in both themes and every effects mode. */
html[data-theme] dialog.glass {
  background: var(--opaque);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overscroll-behavior: contain;
}
html:has(dialog[open]) { overflow: hidden; }
#appearance::backdrop { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
#appearance { padding: 0; max-height: calc(100dvh - 32px); overflow: hidden; }
#appearance[open] { display: flex; flex-direction: column; }
.appearance-header { flex-shrink: 0; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.appearance-header h2 { margin: 8px 0 4px; }
.appearance-header .appearance-intro { margin: 0; }
.appearance-header .close { width: 40px; height: 40px; }
.appearance-body { padding: 18px 22px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.appearance-footer { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; margin: 0; border-top: 1px solid var(--line); text-align: left; letter-spacing: 0; }
.appearance-footer .appearance-hint { margin: 0; }
.appearance-footer .subtle { min-height: 44px; flex-shrink: 0; }
.telegram-accent { display: grid; place-items: center; color: var(--swatch-ink); }
.telegram-accent svg { width: 21px; height: 21px; stroke-width: 1.8; }
#accent-source-hint { margin: 8px 0 14px; }
.theme-picker span { min-height: 44px; display: grid; place-items: center; }

/* Short menus use compact rows instead of mostly empty two-column tiles. */
html[data-effects] .control-list[data-compact="true"],
.module-grid[data-compact="true"], .option-grid[data-compact="true"] { grid-template-columns: minmax(0, 1fr); }
.control-list[data-compact="true"] .setting-row { min-height: 72px; flex-wrap: nowrap; align-content: center; padding: 16px; }
.control-list[data-compact="true"] .control-copy { flex-basis: auto; order: 0; }
.control-list[data-compact="true"] .control-value { max-width: 28%; }
.module-grid[data-compact="true"] .module-card { min-height: 78px; flex-direction: row; align-items: center; padding: 16px 40px 16px 16px; gap: 12px; }
.module-grid[data-compact="true"] .module-status { margin-top: 0; padding-right: 0; }
.module-grid[data-compact="true"] .module-card > svg { right: 14px; bottom: calc(50% - 8px); }
.option-grid[data-compact="true"][data-group="models"] .option-card { min-height: 96px; display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 10px 14px; padding-right: 48px; }
.option-grid[data-compact="true"] .option-traits { grid-column: 2; padding-top: 0; }
.option-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
@media(max-width:649px) {
  .module-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.notice:empty { display: none; }
.workspace-summary { padding: 16px 18px; margin-bottom: 14px; }
.native-controls { gap: 12px; }
@media(max-width:380px) {
  .appearance-header, .appearance-body { padding-left: 16px; padding-right: 16px; }
  .appearance-footer { padding: 10px 16px; gap: 8px; flex-wrap: wrap; }
  .appearance-footer .subtle { width: 100%; }
  .module-grid[data-compact="true"] .module-card { flex-wrap: wrap; }
  .module-grid[data-compact="true"] .module-status { margin-left: 48px; }
}

/* Header and dialog actions follow the selected accent. */
.appearance-button, dialog .close {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}
:is(.subtle, .action-button, .chips button, .context-back, .page-step,
    .download-card, .instruction-actions .subtle) svg { color: inherit; }
.chips button.selected { outline: 2px solid var(--ink); outline-offset: 2px; }
.action-button.danger { background: var(--accent); border-color: transparent; }
:is(button.tile, button.wide-link, .setting-row, .option-card, .module-card) {
  background: var(--control-surface);
  border-color: var(--control-border);
}
:is(button.tile, button.wide-link, .setting-row, .option-card, .module-card):hover {
  background: var(--control-hover);
  border-color: var(--accent);
}
.destructive-control { background: rgba(var(--accent-rgb), .14); border-color: var(--accent); }
.segment-tabs button:not(.selected), .theme-picker input:not(:checked) + span { background: rgba(var(--accent-rgb), .14); color: var(--ink); }
.header-controls .avatar { flex-shrink: 0; width: 40px; height: 40px; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.avatar-initials { font-size: 13px; color: inherit; }
.hero h1 { margin-top: 0; }
@media(max-width:360px) {
  .header-controls { gap: 8px; }
}

/* One continuous navigation bar with a measured sliding accent pill. */
html[data-theme] .dock {
  position: fixed;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  width: min(540px, calc(100% - 16px));
  padding: 6px;
  border: 1px solid rgba(var(--accent-rgb), .3);
  border-radius: 22px;
  background: linear-gradient(rgba(var(--accent-rgb), .08), rgba(var(--accent-rgb), .08)), var(--opaque);
  box-shadow: 0 6px 24px var(--shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.dock button {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 58px;
  padding: 8px 2px;
  border-radius: 16px;
  background: none;
  color: var(--ink);
  font-size: clamp(8px, 2.5vw, 10px);
  font-weight: 650;
  line-height: 1.25;
}
.dock button svg { width: 21px; height: 21px; stroke-width: 1.8; filter: none; }
.dock button.active { color: var(--accent-ink); }
.dock-indicator {
  position: absolute;
  left: 0;
  top: 6px;
  height: 58px;
  border-radius: 16px;
  background: var(--accent);
  opacity: 0;
  pointer-events: none;
}
.dock[data-active="true"] .dock-indicator { opacity: 1; }
html[data-motion="on"] .dock-indicator { transition: transform .32s cubic-bezier(.2,.8,.2,1), width .22s ease, background-color .2s; }
.dock button:focus-visible { outline-color: var(--accent); outline-offset: 2px; }

/* Hover/focus reveal the top-up label; the first touch reveals it before opening payment. */
.header-topup { width: 40px; height: 40px; min-height: 40px; padding: 0; gap: 0; overflow: hidden; font-size: 12px; flex-shrink: 0; }
.header-topup svg { width: 18px; height: 18px; }
.header-topup span { max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; }
.header-topup.expanded { width: 132px; gap: 7px; }
.header-topup.expanded span { max-width: 90px; opacity: 1; }
html[data-motion="on"] .header-topup { transition: width .22s ease, gap .22s ease, background-color .2s; }
html[data-motion="on"] .header-topup span { transition: max-width .22s ease, opacity .18s ease; }

/* The profile repeats the user's photo beside the title. */
.profile-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.profile-title h1 { flex: 1; min-width: 0; font-size: clamp(24px, 6.5vw, 38px); letter-spacing: -1.2px; margin: 8px 0 12px; }
.profile-avatar { flex: 0 0 64px; width: 64px; height: 64px; border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink); }
.profile-avatar .avatar-initials { font-size: 20px; }

/* Every tab shares the main page's translucent, accent-tinted controls. */
html[data-theme] :is(button.tile, button.wide-link, .setting-row, .option-card,
    .module-card, .feature-action, .destructive-control, .download-card,
    .board-cell, .context-back, .page-step, .subtle, .action-button,
    .chips button, .segment-tabs button, .filters label, button.message) {
  background: var(--control-surface);
  color: var(--ink);
  border: 1px solid var(--control-border);
}
html[data-theme] :is(button.tile, button.wide-link, .setting-row, .option-card,
    .module-card, .feature-action, .destructive-control, .download-card,
    .board-cell, .context-back, .page-step, .subtle, .action-button,
    .chips button, .segment-tabs button, button.message):hover {
  background: var(--control-hover);
  border-color: var(--accent);
}
html[data-theme] :is(.segment-tabs button.selected, .chips button.selected, .action-button.primary-action) {
  background: var(--button);
  color: var(--button-ink);
  border-color: transparent;
}
html[data-theme] .option-card[data-selected="true"] { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
html[data-theme] :is(.feature-action, .destructive-control) .control-icon { background: rgba(var(--accent-rgb), .12); color: var(--accent-soft); }
html[data-theme="light"] :is(.feature-action, .destructive-control) .control-icon { color: var(--ink); }
html[data-theme] .feature-action .control-copy small { color: var(--quiet); opacity: 1; }

/* Search and informational panels share the card palette across sections. */
html[data-theme] :is(.search, .segment-tabs, .workspace-summary, .privacy) {
  background: var(--control-surface);
  color: var(--ink);
  border: 1px solid var(--control-border);
  border-radius: 22px;
}
html[data-theme] .search:hover { background: var(--control-hover); border-color: var(--accent); }
html[data-theme] .search:focus-within { border-color: var(--accent); }
.search input::placeholder { color: var(--quiet); }

.message-avatar { border-radius: 50%; overflow: hidden; padding: 0; }
.message-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
