/* Mini App, Material 3. Base colors come from theme.js (THEME.apply), the rest is derived. */
:root {
  --primary: #6750a4; --on-primary: #fff; --bg: #fef7ff; --surface: #fff; --text: #1d1b20;
  --r: 20px; --r-btn: 24px; --pad: 20px; --gap: 12px; --fs: 15px; --icon: 56px;
  --font: "Google Sans", Roboto, system-ui, -apple-system, sans-serif;
  --primary-cont: color-mix(in srgb, var(--primary) 16%, var(--surface));
  --on-primary-cont: color-mix(in srgb, var(--primary) 72%, var(--text));
  --s1: color-mix(in srgb, var(--primary) 4%, var(--bg));
  --s2: color-mix(in srgb, var(--primary) 7%, var(--bg));
  --s3: color-mix(in srgb, var(--primary) 11%, var(--bg));
  --outline: color-mix(in srgb, var(--text) 14%, transparent);
  --text-2: color-mix(in srgb, var(--text) 72%, var(--bg));
  --muted: color-mix(in srgb, var(--text) 52%, var(--bg));
  --bad: #d93025;
  --ease: cubic-bezier(.2, 0, 0, 1); --dur: 300ms;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bot: env(safe-area-inset-bottom, 0px);
  --dock-h: 80px;
}
:root[data-dock=floating] { --dock-h: 88px; }
:root[data-dock=line] { --dock-h: 64px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 var(--fs)/1.5 var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
.ms { font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; font-size: 24px; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr; display: inline-block; width: 1em; overflow: hidden; flex: none; -webkit-font-smoothing: antialiased; font-feature-settings: "liga"; font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24; }
.ms.fill { font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.muted { color: var(--muted); }

.view { max-width: 600px; margin: 0 auto; padding: calc(var(--safe-top) + 8px) 16px calc(var(--dock-h) + var(--safe-bot) + 24px); }
.view.enter { animation: enter var(--dur) var(--ease) both; }
.view.fwd { animation: fwd var(--dur) var(--ease) both; }
.view.back { animation: back var(--dur) var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@keyframes fwd { from { opacity: 0; transform: translateX(24px); } }
@keyframes back { from { opacity: 0; transform: translateX(-24px); } }

/* header */
.hdr { padding: 16px 4px 20px; display: flex; flex-direction: column; gap: 4px; }
.hdr h1 { font-size: calc(28px * var(--fsk, 1)); line-height: 36px; font-weight: 500; letter-spacing: -.01em; }
.hdr p { color: var(--text-2); }
.hdr-ic { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-cont); color: var(--on-primary-cont); margin-bottom: 12px; overflow: hidden; }
.hdr-ic.logo { background: transparent; border-radius: 0; width: calc(48px * var(--logo-k, 1)); height: calc(48px * var(--logo-k, 1)); }
.hdr.compact .hdr-ic.logo { width: calc(40px * var(--logo-k, 1)); height: calc(40px * var(--logo-k, 1)); }
.hdr.center .hdr-ic.logo { width: calc(72px * var(--logo-k, 1)); height: calc(72px * var(--logo-k, 1)); }
.hdr-ic img { width: 100%; height: 100%; object-fit: contain; }
.hdr.compact { flex-direction: row; align-items: center; gap: 12px; padding: 8px 4px 16px; }
.hdr.compact .hdr-ic { width: 40px; height: 40px; border-radius: 12px; margin: 0; }
.hdr.compact h1 { font-size: calc(22px * var(--fsk, 1)); line-height: 28px; }
.hdr.compact p { font-size: calc(13px * var(--fsk, 1)); }
.hdr.center { align-items: center; text-align: center; padding-top: 24px; }
.hdr.center .hdr-ic { width: 72px; height: 72px; border-radius: 22px; }
.hdr.center .hdr-ic .ms { font-size: 32px; }

/* blocks */
.blk { margin-bottom: var(--gap); }
.banner { display: flex; gap: 16px; align-items: flex-start; padding: var(--pad); border-radius: var(--r); }
.banner b { display: block; font-weight: 500; font-size: calc(16px * var(--fsk, 1)); margin-bottom: 2px; }
.banner p { font-size: calc(14px * var(--fsk, 1)); opacity: .85; }
.banner.tonal { background: var(--primary-cont); color: var(--on-primary-cont); }
.banner.filled { background: var(--primary); color: var(--on-primary); }
.banner.outlined { box-shadow: inset 0 0 0 1px var(--outline); color: var(--text); }
.banner.outlined .ms { color: var(--primary); }
.txt { color: var(--text-2); padding: 0 4px; white-space: pre-wrap; }
.searchbar { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 20px; border-radius: 28px; background: var(--s3); color: var(--text-2); }
.searchbar input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 16px var(--font); }
.searchbar input::placeholder { color: var(--muted); }
.sec-t { font-size: calc(16px * var(--fsk, 1)); font-weight: 500; margin: 20px 4px 12px; }

/* app cards */
.apps { display: flex; flex-direction: column; gap: 8px; }
.apps.l-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.ac { position: relative; display: flex; align-items: center; gap: 16px; padding: 12px 16px 12px 12px; border-radius: var(--r); border: 0; width: 100%; text-align: left; cursor: pointer; overflow: hidden; transition: transform 120ms var(--ease); }
.ac:active { transform: scale(.985); }
:root[data-card=filled] .ac { background: var(--s2); }
:root[data-card=outlined] .ac { background: var(--surface); box-shadow: inset 0 0 0 1px var(--outline); }
:root[data-card=elevated] .ac { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.06); }
.ac::after, .btn::after { content: ""; position: absolute; inset: 0; background: currentColor; opacity: 0; transition: opacity 150ms var(--ease); pointer-events: none; }
.ac:active::after { opacity: .08; }
.ac .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ac .meta b { font-weight: 500; font-size: calc(16px * var(--fsk, 1)); }
.ac .meta small { color: var(--muted); font-size: calc(13px * var(--fsk, 1)); }
.l-grid .ac { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
.l-grid .ac .meta { width: 100%; }
.l-cards .ac { flex-direction: column; align-items: stretch; gap: 16px; padding: var(--pad); }
.l-cards .ac .top { display: flex; gap: 16px; align-items: center; }
.l-cards .ac .desc { color: var(--text-2); font-size: calc(14px * var(--fsk, 1)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aicon { width: var(--icon); height: var(--icon); border-radius: calc(var(--icon) * .225); background: var(--s3); display: grid; place-items: center; color: var(--muted); overflow: hidden; flex: none; }
:root[data-shape=circle] .aicon { border-radius: 50%; }
:root[data-shape=square] .aicon { border-radius: 8px; }
.aicon img { width: 100%; height: 100%; object-fit: cover; }
.aicon.xl { --icon: 96px; }
.aicon.xl .ms { font-size: 40px; }
.price { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--primary-cont); color: var(--on-primary-cont); font-weight: 500; font-size: calc(14px * var(--fsk, 1)); white-space: nowrap; }
.price.owned { background: transparent; color: var(--primary); padding: 0 4px; }
.price.owned .ms { font-size: 20px; }

/* buttons */
.btn { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; padding: 0 24px; border: 0; border-radius: var(--r-btn); background: var(--primary); color: var(--on-primary); font: 500 15px var(--font); letter-spacing: .01em; cursor: pointer; transition: transform 120ms var(--ease); }
.btn:active::after { opacity: .12; }
.btn:active { transform: scale(.985); }
.btn.tonal { background: var(--primary-cont); color: var(--on-primary-cont); }
.btn.text { background: transparent; color: var(--primary); }
.btn.sm { width: auto; height: 40px; padding: 0 16px; font-size: calc(14px * var(--fsk, 1)); }
.btn[disabled] { opacity: .38; pointer-events: none; }
.btn.busy { pointer-events: none; color: transparent; }
.btn.busy::before { content: ""; position: absolute; width: 20px; height: 20px; border: 2.5px solid var(--on-primary); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.tonal.busy::before { border-color: var(--on-primary-cont); border-top-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.iconbtn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; margin-left: -8px; }
.iconbtn:active { background: var(--s3); }

/* detail */
.appbar { height: 56px; display: flex; align-items: center; }
.hero { display: flex; gap: 20px; align-items: center; padding: 8px 4px 24px; }
.hero .meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hero h1 { font-size: calc(26px * var(--fsk, 1)); line-height: 32px; font-weight: 500; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 10px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--outline); color: var(--text-2); font-size: calc(13px * var(--fsk, 1)); }
.chip .ms { font-size: 16px; }
.buy { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.sbp { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-2); font-size: calc(13px * var(--fsk, 1)); }
.sbp i { font-style: normal; font-weight: 700; font-size: calc(11px * var(--fsk, 1)); letter-spacing: .02em; padding: 2px 6px; border-radius: 6px; background: #1d1346; color: #fff; }
.card { background: var(--s1); border-radius: var(--r); padding: var(--pad); margin-bottom: var(--gap); }
:root[data-card=outlined] .card { background: var(--surface); box-shadow: inset 0 0 0 1px var(--outline); }
:root[data-card=elevated] .card { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.06); }
.card h3 { font-size: calc(16px * var(--fsk, 1)); font-weight: 500; margin-bottom: 8px; }
.card .desc { color: var(--text-2); white-space: pre-wrap; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--outline); }
.kv:first-of-type { border-top: 0; padding-top: 0; }
.kv:last-child { padding-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.hint { display: flex; gap: 12px; color: var(--text-2); font-size: calc(13px * var(--fsk, 1)); padding: 4px; }
.hint .ms { font-size: 20px; color: var(--muted); }

/* profile */
.prof { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 24px 0; }
.avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--primary-cont); color: var(--on-primary-cont); display: grid; place-items: center; font-size: calc(36px * var(--fsk, 1)); font-weight: 500; overflow: hidden; margin-bottom: 12px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.prof h1 { font-size: calc(24px * var(--fsk, 1)); font-weight: 500; }
.list { display: flex; flex-direction: column; gap: 2px; border-radius: var(--r); overflow: hidden; margin-bottom: var(--gap); }
.li { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--s2); border: 0; width: 100%; text-align: left; cursor: pointer; }
.li .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.li .meta small { color: var(--muted); font-size: calc(13px * var(--fsk, 1)); }
.li .lead { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-cont); color: var(--on-primary-cont); flex: none; }
.li .aicon { --icon: 44px; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 6px; padding-bottom: 72px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 20px 20px 20px 6px; background: var(--s3); white-space: pre-wrap; overflow-wrap: anywhere; align-self: flex-start; }
.msg.me { align-self: flex-end; border-radius: 20px 20px 6px 20px; background: var(--primary); color: var(--on-primary); }
.msg time { display: block; font-size: calc(11px * var(--fsk, 1)); opacity: .7; text-align: right; margin-top: 2px; }
.msg .who { display: block; font-size: calc(12px * var(--fsk, 1)); font-weight: 500; color: var(--primary); margin-bottom: 2px; }
.day { align-self: center; font-size: calc(12px * var(--fsk, 1)); color: var(--muted); margin: 12px 0 4px; }
.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--dock-h) + var(--safe-bot)); padding: 8px 16px; background: var(--bg); z-index: 4; }
.composer form { max-width: 568px; margin: 0 auto; display: flex; gap: 8px; }
.composer input { flex: 1; min-width: 0; height: 48px; padding: 0 20px; border: 0; outline: 0; border-radius: 24px; background: var(--s3); color: var(--text); font: 400 16px var(--font); }
.composer input::placeholder { color: var(--muted); }
.composer button { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; cursor: pointer; flex: none; }

/* dock: material | floating | line */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; }
.dock-in { display: flex; max-width: 600px; margin: 0 auto; }
.di { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: transparent; cursor: pointer; color: var(--text-2); padding: 0; min-width: 0; }
.di .ind { position: relative; display: grid; place-items: center; }
.di .lb { font-size: calc(12px * var(--fsk, 1)); font-weight: 500; letter-spacing: .02em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.di .dot { position: absolute; top: 2px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
:root[data-dock=material] .dock { background: var(--s2); padding: 12px 8px calc(16px + var(--safe-bot)); }
:root[data-dock=material] .di .ind { width: 64px; height: 32px; border-radius: 16px; transition: background-color 200ms var(--ease); }
:root[data-dock=material] .di.on .ind { background: var(--primary-cont); color: var(--on-primary-cont); }
:root[data-dock=material] .di.on .lb { color: var(--text); font-weight: 600; }
:root[data-dock=floating] .dock { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(16px + var(--safe-bot)); }
:root[data-dock=floating] .dock-in { gap: 4px; padding: 8px; border-radius: 999px; background: var(--surface); box-shadow: 0 8px 28px rgba(0,0,0,.16), 0 0 0 1px var(--outline); }
:root[data-dock=floating] .di { flex-direction: row; gap: 8px; height: 48px; padding: 0 16px; border-radius: 999px; transition: background-color 200ms var(--ease); flex: none; }
:root[data-dock=floating] .di .dot { right: -4px; top: -2px; }
:root[data-dock=floating] .di .lb { font-size: calc(14px * var(--fsk, 1)); }
:root[data-dock=floating] .di.on { background: var(--primary); color: var(--on-primary); }
:root[data-dock=line] .dock { background: var(--surface); box-shadow: 0 -1px 0 var(--outline); padding: 8px 8px calc(8px + var(--safe-bot)); }
:root[data-dock=line] .di { position: relative; padding-top: 6px; }
:root[data-dock=line] .di.on { color: var(--primary); }
:root[data-dock=line] .di.on::before { content: ""; position: absolute; top: -8px; width: 32px; height: 3px; border-radius: 0 0 3px 3px; background: var(--primary); }
:root[data-dock=line] .di .dot { right: -6px; }
:root[data-labels=none] .di .lb, :root[data-labels=active] .di:not(.on) .lb { display: none; }

/* dock: liquid glass (refraction from glass.js; see THIRD-PARTY-NOTICES.md) */
:root[data-dock=glass] { --dock-h: 96px; }
:root[data-dock=glass] .dock { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(14px + var(--safe-bot)); width: min(calc(100% - 32px), 440px); }
:root[data-dock=glass] .dock-in { position: relative; isolation: isolate; padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface) var(--glass-tint, 35%), transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 0 0 1px rgba(255,255,255,.28), inset 0 -1px 1px rgba(0,0,0,.06), 0 12px 32px rgba(0,0,0,.16), 0 2px 6px rgba(0,0,0,.08); }
:root[data-dock=glass][data-scheme=dark] .dock-in { box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 0 0 1px rgba(255,255,255,.1), 0 12px 32px rgba(0,0,0,.5); }
.lg-f { position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none; }
.lg-pill { position: absolute; top: 6px; bottom: 6px; left: 6px; width: 0; border-radius: 999px; pointer-events: none;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 0 0 1px color-mix(in srgb, var(--primary) 20%, transparent);
  transition: left 460ms cubic-bezier(.3, 1.4, .5, 1), width 460ms cubic-bezier(.3, 1.4, .5, 1); }
:root[data-dock=glass][data-scheme=dark] .lg-pill { background: color-mix(in srgb, var(--primary) 24%, transparent); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
:root[data-dock=glass] .di { position: relative; z-index: 1; height: 56px; justify-content: center; gap: 2px; border-radius: 999px; color: var(--text); }
:root[data-dock=glass][data-labels=none] .di { height: 48px; }
:root[data-dock=glass] .di.on { color: var(--primary); }
:root[data-dock=glass] .di .ind { transition: transform 200ms var(--ease); }
:root[data-dock=glass] .di:active .ind { transform: scale(.86); }
:root[data-dock=glass] .di .lb { font-size: calc(11px * var(--fsk, 1)); font-weight: 500; }
:root[data-dock=glass] .di.on .lb { font-weight: 600; }
:root[data-dock=glass] .di .dot { right: -6px; top: 0; }

/* feedback */
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .ms { font-size: 40px; }
.sk { position: relative; overflow: hidden; height: 80px; border-radius: var(--r); background: var(--s2); }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 5%, transparent), transparent); transform: translateX(-100%); animation: shine 1.2s infinite; }
@keyframes shine { to { transform: translateX(100%); } }
.snack { position: fixed; left: 16px; right: 16px; bottom: calc(var(--dock-h) + var(--safe-bot) + 12px); max-width: 568px; margin: 0 auto; padding: 14px 16px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: calc(14px * var(--fsk, 1)); z-index: 10; box-shadow: 0 4px 16px rgba(0,0,0,.2); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 200ms var(--ease), transform 200ms var(--ease); }
.snack.show { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Text never leaves its box: headings and buttons scale with the screen, long words wrap */
.view { container-type: inline-size; }
.hdr h1 { font-size: clamp(20px, 7.5cqi, 28px); line-height: 1.25; text-wrap: balance; }
.hdr.compact h1 { font-size: clamp(17px, 5.5cqi, 22px); }
.hero h1 { font-size: clamp(18px, 6.5cqi, 26px); line-height: 1.25; }
.prof h1 { font-size: clamp(18px, 6cqi, 24px); }
.hdr h1, .hero h1, .prof h1, .sec-t, .banner b, .banner p, .card h3, .card .desc, .hint, .empty, .txt { overflow-wrap: anywhere; }
.hero .meta, .hdr > div { min-width: 0; }
.btn { white-space: nowrap; min-width: 0; max-width: 100%; font-size: clamp(13px, 4.2cqi, 15px); }
.price { flex: none; }
.chip { white-space: nowrap; }
.kv span:last-child { min-width: 0; text-align: right; overflow-wrap: anywhere; }
.li .btn.sm { flex: none; }

/* chat attachments */
.composer .attach { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--s3); color: var(--text-2); cursor: pointer; flex: none; }
.msg.has-media { padding: 4px; }
.msg.has-media .who, .msg.has-media .mt, .msg.has-media time { padding: 0 10px; }
.msg.has-media .mt { display: block; padding-top: 6px; }
.msg img, .msg video { display: block; max-width: 100%; max-height: 320px; border-radius: 16px; background: var(--s3); }

/* catalog tab */
.cat-title { font-size: clamp(22px, 7cqi, 28px); font-weight: 500; margin: 12px 4px 16px; }
.cats { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px var(--gap); padding: 0 16px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex: none; height: 36px; padding: 0 16px; border-radius: 18px; border: 0; background: var(--s2); color: var(--text-2); font: 500 14px var(--font); cursor: pointer; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--outline); transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.cat.on { background: var(--primary); color: var(--on-primary); box-shadow: none; }
.cat:has(.ms) { display: inline-flex; align-items: center; gap: 6px; padding-left: 12px; }
.cat .ms { font-size: 18px; }

/* app badges and prices */
.bdg { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px 0 6px; border-radius: 11px; font-size: calc(11px * var(--fsk, 1)); font-weight: 600; vertical-align: middle; white-space: nowrap; background: var(--primary-cont); color: var(--on-primary-cont); }
.bdg .ms { font-size: 14px; }
.bdg-hit { background: color-mix(in srgb, #f4511e 16%, var(--surface)); color: #d84315; }
.bdg-sale { background: color-mix(in srgb, #188038 16%, var(--surface)); color: #188038; }
.ac .meta b .bdg { margin-left: 4px; }
.l-grid .ac > .bdg { position: absolute; top: 10px; right: 10px; }
.l-cards .ac > .bdg { align-self: flex-start; }
.price s, .chip s { opacity: .55; font-weight: 400; margin-right: 6px; }
.ac.has-cover { padding: 0 0 var(--pad); gap: 14px; }
.ac.has-cover .top { padding: 0 var(--pad); }
.ac.has-cover > .bdg { margin: 0 var(--pad); }
.ac-cover { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }

/* news */
.news { display: flex; flex-direction: column; gap: 10px; }
.nw { display: flex; flex-direction: column; text-align: left; padding: 0; border: 0; border-radius: var(--r); overflow: hidden; background: var(--s2); cursor: pointer; color: inherit; transition: transform 120ms var(--ease); }
.nw:active { transform: scale(.985); }
.nw img { width: 100%; aspect-ratio: 2/1; object-fit: cover; display: block; }
.nw-b { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.nw-b small { color: var(--muted); font-size: calc(12px * var(--fsk, 1)); display: flex; align-items: center; gap: 4px; }
.nw-b small .ms { font-size: 14px; color: var(--primary); }
.nw-b b { font-weight: 500; font-size: calc(16px * var(--fsk, 1)); overflow-wrap: anywhere; }
.nw-b p { margin: 0; color: var(--text-2); font-size: calc(14px * var(--fsk, 1)); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-page { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.news-page img { width: 100%; border-radius: var(--r); }
.news-page small { color: var(--muted); }
.news-page h1 { font-size: clamp(20px, 7cqi, 26px); font-weight: 500; overflow-wrap: anywhere; }
.news-page p { color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* app page look */
.app-page.tinted { --primary: var(--app); --primary-cont: color-mix(in srgb, var(--app) 18%, var(--surface)); --on-primary-cont: color-mix(in srgb, var(--app) 70%, var(--text)); }
.app-page.tinted .hero { background: linear-gradient(180deg, color-mix(in srgb, var(--app) 14%, transparent), transparent); border-radius: var(--r); padding: 16px; margin: 0 -4px 8px; }
.app-page .hero p { margin: 0; font-size: calc(14px * var(--fsk, 1)); }
.cover { margin: 0 -16px 12px; }
.cover img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.shots { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px var(--gap); padding: 0 16px; scrollbar-width: none; }
.shots::-webkit-scrollbar { display: none; }
.shots img { height: 360px; max-width: 70%; flex: none; object-fit: cover; border-radius: 18px; scroll-snap-align: start; background: var(--s3); box-shadow: inset 0 0 0 1px var(--outline); }

.li .unread { min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px; background: var(--bad); color: #fff; font-size: calc(12px * var(--fsk, 1)); font-weight: 600; display: grid; place-items: center; flex: none; }
.ac .meta small .bdg { margin-right: 6px; }

/* ratings and reviews */
.rt { color: #e8a200; font-weight: 600; }
.stars { --p: 100%; display: inline-block; font-size: calc(15px * var(--fsk, 1)); letter-spacing: 1px; line-height: 1; background: linear-gradient(90deg, #f5b400 var(--p), color-mix(in srgb, var(--text) 18%, transparent) var(--p)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stars.sm { font-size: calc(12px * var(--fsk, 1)); }
.rvs { display: flex; flex-direction: column; gap: 14px; }
.rvs h3 { margin: 0; }
.rv-sum { display: flex; gap: 20px; align-items: center; }
.rv-big { font-size: calc(44px * var(--fsk, 1)); font-weight: 600; line-height: 1; display: flex; flex-direction: column; gap: 6px; }
.rv-big small { font-size: calc(12px * var(--fsk, 1)); font-weight: 400; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.rv-dist { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rv-dist div { display: flex; align-items: center; gap: 8px; font-size: calc(11px * var(--fsk, 1)); color: var(--muted); }
.rv-dist i { flex: 1; height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--primary) var(--w), var(--s3) var(--w)); }
.rv { padding-top: 12px; border-top: 1px solid var(--outline); display: flex; flex-direction: column; gap: 6px; }
.rv-h { display: flex; align-items: center; gap: 8px; }
.rv-h b { font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-h small { color: var(--muted); font-size: calc(12px * var(--fsk, 1)); }
.rv p { margin: 0; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.rv-reply { padding: 10px 12px; border-radius: 12px; background: var(--s3); font-size: calc(14px * var(--fsk, 1)); color: var(--text-2); display: flex; flex-direction: column; gap: 2px; }
.rv-reply b { font-weight: 500; color: var(--text); font-size: calc(13px * var(--fsk, 1)); }
.rv-form { display: flex; flex-direction: column; gap: 10px; }
.rv-pick { display: flex; gap: 4px; }
.rv-pick button { width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--s3); font-size: calc(22px * var(--fsk, 1)); color: color-mix(in srgb, var(--text) 25%, transparent); cursor: pointer; }
.rv-pick button.on { color: #f5b400; background: color-mix(in srgb, #f5b400 16%, var(--surface)); }
.rv-form textarea { width: 100%; padding: 12px 14px; border: 0; border-radius: 14px; background: var(--s3); color: var(--text); font: 400 15px var(--font); resize: vertical; outline: none; }
.duo { display: flex; gap: 8px; justify-content: flex-end; }

/* sign step and device logo */
.dev-logo { width: 40px; height: 40px; object-fit: contain; flex: none; color: var(--text, currentColor); padding: 4px; box-sizing: border-box; }
.dev-logo.sm { width: 24px; height: 24px; }
.busy-text .ms { animation: spin 1s linear infinite; }
.buy .sbp .ms { font-size: 16px; color: var(--primary); }
.li .meta small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* app page header: every chip is a filled pill, like the badge */
.chips .chip { height: 28px; padding: 0 12px 0 9px; border-radius: 14px; box-shadow: none; font-weight: 600; background: var(--primary-cont); color: var(--on-primary-cont); }
.chips .chip .ms { font-size: 17px; }
.chips .chip s { font-weight: 500; }
.chips .chip.bdg-hit { background: color-mix(in srgb, #f4511e 16%, var(--surface)); color: #d84315; }
.chips .chip.bdg-sale { background: color-mix(in srgb, #188038 16%, var(--surface)); color: #188038; }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 8px; }
.faq-i { background: var(--surface); border-radius: var(--r-card, 16px); overflow: hidden; }
.faq-i > summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; font-weight: 500; }
.faq-i > summary::-webkit-details-marker { display: none; }
.faq-i > summary > span:first-child { flex: 1; min-width: 0; }
.faq-i > summary .ms { color: var(--text-2); transition: transform 200ms; }
.faq-i[open] > summary .ms { transform: rotate(180deg); }
.faq-a { padding: 0 16px 14px; color: var(--text-2); line-height: 1.5; }
.faq-a p { margin: 0 0 10px; }
.faq-a ul, .faq-a ol { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.faq-a > :last-child { margin-bottom: 0; }

/* install page: download progress */
.dl { display: flex; flex-direction: column; gap: 10px; }
.dl-h { display: flex; align-items: center; gap: 10px; }
.dl-h .ms { color: var(--primary); }
.dl.error .dl-h .ms { color: var(--bad, #d93025); }
.dl-bar { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.dl-bar i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 4px; transition: width 500ms linear; }
.dl.done .dl-bar i { background: #1e8e3e; }
.dl-st { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: calc(13px * var(--fsk, 1)); color: var(--text-2); font-variant-numeric: tabular-nums; }
.dl-st span:empty { display: none; }
.steps { margin: 8px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; text-align: left; color: var(--text-2); line-height: 1.45; }
.steps li::marker { color: var(--text-2); font-weight: 600; }
.dl.done .dl-h .ms { color: #1e8e3e; }

/* icon shape per place (Оформление → Карточки приложений) */
:root[data-sh-home=rounded] [data-apps]:not([data-apps="cat"]) .aicon { border-radius: calc(var(--icon) * .225); }
:root[data-sh-home=circle] [data-apps]:not([data-apps="cat"]) .aicon { border-radius: 50%; }
:root[data-sh-home=square] [data-apps]:not([data-apps="cat"]) .aicon { border-radius: 8px; }
:root[data-sh-catalog=rounded] [data-apps="cat"] .aicon { border-radius: calc(var(--icon) * .225); }
:root[data-sh-catalog=circle] [data-apps="cat"] .aicon { border-radius: 50%; }
:root[data-sh-catalog=square] [data-apps="cat"] .aicon { border-radius: 8px; }
:root[data-sh-page=rounded] .hero .aicon { border-radius: calc(var(--icon) * .225); }
:root[data-sh-page=circle] .hero .aicon { border-radius: 50%; }
:root[data-sh-page=square] .hero .aicon { border-radius: 8px; }
:root[data-sh-purchases=rounded] .purch .aicon { border-radius: calc(var(--icon) * .225); }
:root[data-sh-purchases=circle] .purch .aicon { border-radius: 50%; }
:root[data-sh-purchases=square] .purch .aicon { border-radius: 8px; }
:root[data-sh-avatar=rounded] .prof .avatar { border-radius: 28%; }
:root[data-sh-avatar=square] .prof .avatar { border-radius: 12px; }

/* plans: term and warranty as tags */
.ptags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ptag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px 0 7px; border-radius: 12px; font-size: calc(12px * var(--fsk, 1)); font-weight: 600; white-space: nowrap;
  background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--text-2); }
.ptag .ms { font-size: 15px; }
.ptag.ok { background: color-mix(in srgb, #1e8e3e 15%, var(--surface)); color: #188038; }
.ptag.off { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 14%, transparent); color: var(--muted); font-weight: 500; }
:root[data-scheme=dark] .ptag.ok { background: color-mix(in srgb, #34a853 22%, var(--surface)); color: #81c995; }
.li .meta small.pdesc { white-space: normal; }

/* plan row: compact, tags in one line under the name */
.li[data-plan] { align-items: center; gap: 12px; padding: 10px 14px; }
.li[data-plan] .lead { width: 34px; height: 34px; }
.li[data-plan] .lead .ms { font-size: 19px; }
.li[data-plan] .meta b { font-size: calc(15px * var(--fsk, 1)); }
.li[data-plan] .ptags { flex-wrap: nowrap; gap: 4px; margin-top: 4px; overflow: hidden; }
.li[data-plan] .ptag { height: 20px; padding: 0 7px 0 5px; border-radius: 10px; font-size: calc(11px * var(--fsk, 1)); gap: 3px; flex: none; }
.li[data-plan] .ptag .ms { font-size: 13px; }
.li[data-plan] .price { flex: none; }
.li[data-plan] .ph { display: flex; align-items: center; gap: 8px; }
.li[data-plan] .ph b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li[data-plan] .ph .price { height: 28px; padding: 0 10px; font-size: calc(14px * var(--fsk, 1)); }
.ptag[data-tip] { cursor: help; }

/* badge size (Оформление → Карточки → Размер бейджа) */
.bdg { height: calc(22px * var(--bdg, 1)); padding: 0 calc(8px * var(--bdg, 1)) 0 calc(6px * var(--bdg, 1)); border-radius: calc(11px * var(--bdg, 1)); font-size: calc(11px * var(--bdg, 1)); }
.bdg .ms { font-size: calc(14px * var(--bdg, 1)); }
/* picture banners */
.banner-img { position: relative; border-radius: var(--r-card, 20px); overflow: hidden; background: var(--s2); }
.banner-img img { display: block; width: 100%; height: auto; max-height: 360px; object-fit: cover; }
.bi-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 16px 14px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.bi-cap b { display: block; font-size: calc(17px * var(--fsk, 1)); font-weight: 600; }
.bi-cap p { margin: 4px 0 0; font-size: calc(13px * var(--fsk, 1)); opacity: .9; }
.banner.tap, .banner-img.tap { cursor: pointer; }
.banner.tap:active, .banner-img.tap:active { transform: scale(.985); transition: transform 120ms; }
.banner > .ms:last-child { margin-left: auto; opacity: .7; }

/* how long the signed copy stays on the server */
.sign-ttl { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; font-size: calc(12px * var(--fsk, 1)); color: var(--muted); text-align: center; line-height: 1.35; }
.sign-ttl .ms { font-size: 15px; flex: none; }
.sign-ttl b { font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sign-ttl { display: block; }
.sign-ttl .ms { vertical-align: -3px; margin-right: 4px; }
.cat-offer { grid-column: 1 / -1; align-items: center; }
.cat-offer > div { flex: 1; }
.cat-offer .btn { flex: none; }
.ac.cat-pack { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--primary) 55%, transparent); }
.ac.cat-pack .aicon { background: var(--primary-cont); color: var(--on-primary-cont); }
.ac.cat-pack .aicon .ms { font-size: calc(var(--icon) * .5); }
.cat-line { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 14px; margin: 0 0 var(--gap); border: 0; border-radius: var(--r); background: var(--s2); color: var(--text); font: 500 14px var(--font); text-align: left; cursor: pointer; box-shadow: inset 0 0 0 1px var(--outline); }
.cat-line > span { flex: 1; min-width: 0; }
.cat-line small { color: var(--muted); font-weight: 400; }
.cat-line .ms { color: var(--primary); }
.cat-line b { color: var(--primary); white-space: nowrap; }
.cat-line.owned { cursor: default; font-weight: 400; color: var(--muted); box-shadow: none; }
.cp-ic { background: var(--primary-cont); color: var(--on-primary-cont); }
.cp-pt { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; }
.cp-pt > .ms { color: var(--primary); flex: none; }
.cp-pt b { display: block; font-weight: 500; }
.cp-pt p { color: var(--muted); font-size: calc(14px * var(--fsk, 1)); margin-top: 2px; }
.cp-save { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: var(--r-btn, 14px); background: color-mix(in srgb, #2fbf71 14%, transparent); color: var(--text); font-size: 14px; text-align: left; }
.cp-save .ms { color: #2fbf71; flex: none; }
.cp-save b { color: #2fbf71; font-weight: 600; }
.cp-chip { background: color-mix(in srgb, #2fbf71 18%, transparent) !important; color: #2fbf71 !important; }
.cp-save s { opacity: .7; }
.cp-list { display: grid; gap: 4px; }
.cp-app { display: flex; align-items: center; gap: 12px; padding: 6px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.cp-app span { flex: 1; min-width: 0; }
.cp-app small { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.cp-app small .ms { font-size: 16px; color: var(--primary); }
@media (pointer: fine) { .cats { cursor: grab; } .cats.dragging { cursor: grabbing; user-select: none; } .cats.dragging .cat { pointer-events: none; } }
/* the «Входит сейчас» list of a category follows the catalog's icon shape from Оформление */
:root[data-sh-catalog=rounded] .cp-list .aicon { border-radius: calc(var(--icon) * .225); }
:root[data-sh-catalog=circle] .cp-list .aicon { border-radius: 50%; }
:root[data-sh-catalog=square] .cp-list .aicon { border-radius: 8px; }

/* promo code, referral program, documents (Профиль) */
.promo-form { padding-right: 6px; margin-bottom: var(--gap); }
.promo-form input { text-transform: uppercase; }
.promo-form .btn.sm { height: 44px; border-radius: 22px; }
.promo-card .meta b { letter-spacing: .04em; }
.ref-card .ref-t { color: var(--text-2); margin-bottom: 16px; }
.ref-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.ref-stats div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: calc(var(--r) * .6); background: var(--s2); min-width: 0; }
.ref-stats b { font-size: calc(17px * var(--fsk, 1)); font-weight: 600; overflow-wrap: anywhere; }
.ref-stats small { color: var(--muted); font-size: calc(12px * var(--fsk, 1)); }
.ref-link { width: 100%; height: 48px; margin-top: 16px; border: 0; cursor: pointer; font: inherit; color: var(--text); }
.ref-link .ellipsis { flex: 1; text-align: left; font-size: calc(13px * var(--fsk, 1)); }
.ref-act { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ref-act .btn.sm { width: 100%; height: 44px; }
.doc-text { color: var(--text-2); line-height: 1.55; padding: calc(var(--pad) + 4px) var(--pad); }
.doc-text h3 { color: var(--text); font-size: calc(16px * var(--fsk, 1)); font-weight: 600; margin: 20px 0 8px; }
.doc-text p, .doc-text ul, .doc-text ol { margin: 0 0 12px; }
.doc-text ul, .doc-text ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.doc-text > :first-child { margin-top: 0; }
.doc-text > :last-child { margin-bottom: 0; }
.promo-form input::placeholder { text-transform: none; }
