:root {
  color-scheme: dark;
  font: 15px/1.45 system-ui, sans-serif;
  color: #f1f3f5;
  background: #17191c;
  --background: #17191c;
  --raised: #202328;
  --line: #343941;
  --muted: #adb5c0;
  --accent: #91b9ff;
  --primary: #285ab7;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1 { font-size: 1.45rem; font-weight: 650; line-height: 1.25; }
h2 { font-size: 1rem; font-weight: 650; }
small { display: block; color: var(--muted); font-size: .86rem; }
.shell { width: min(100%, 640px); height: var(--tg-viewport-stable-height, 100dvh); margin: auto; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.topbar, .tabbar { display: flex; align-items: center; }
.topbar { gap: 10px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); }
.brand, .balance { display: inline-flex; align-items: center; gap: 8px; }
.brand { font-weight: 650; }
.brandmark { display: block; border-radius: 50%; object-fit: cover; }
.balance { margin-left: auto; padding: 5px; font-variant-numeric: tabular-nums; }
.demo { color: var(--muted); font-size: .8rem; }
#screens { overflow: auto; overscroll-behavior: contain; }
.screen { padding: 20px 16px 24px; }
.subscription { display: grid; gap: 14px; }
.subscription-header { display: grid; gap: 5px; }
.subscription-header p, .intro, .feedback, .profile-note { color: var(--muted); }
.subscription-header p { font-size: .91rem; }
.primary, .secondary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 9px 12px; border-radius: 6px; font-weight: 600; }
.primary { background: var(--primary); border: 1px solid transparent; color: #fff; }
.primary:hover { background: #3266c3; }
.secondary { border: 1px solid var(--line); color: var(--accent); margin-top: 12px; background: transparent; }
.secondary:hover, .plan:hover { background: var(--raised); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 22px 0 6px; }
.meter { padding: 8px 0 12px; border-bottom: 1px solid var(--line); }
.meter-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.meter-label span { color: var(--muted); }
.meter-track { height: 5px; overflow: hidden; border-radius: 3px; background: var(--line); }
.meter-track::before { content: ""; display: block; width: var(--usage, 0%); height: 100%; background: var(--accent); }
.device { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; }
.device-count { margin-left: auto; font-variant-numeric: tabular-nums; }
.intro { margin: 6px 0 14px; }
.plan-list { border-top: 1px solid var(--line); }
.plan-list > p { margin: 10px 0; }
.plan { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 9px; text-align: left; width: 100%; padding: 11px 0; color: inherit; background: none; border: 0; border-bottom: 1px solid var(--line); }
.plan strong { display: block; }
.plan-price { font-variant-numeric: tabular-nums; }
.plan-arrow { color: var(--muted); }
.trial { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding: 10px 0; }
.text-button, .back, .steps a { color: var(--accent); font-weight: 600; }
.text-button { background: transparent; border: 0; padding: 6px 0; }
.text-button:hover, .back:hover, .steps a:hover { text-decoration: underline; }
.profile-card, .wallet-card { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.profile-avatar { display: grid; flex: none; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; font-weight: 650; }
.wallet-card { flex-wrap: wrap; justify-content: space-between; }
.wallet-card strong { font-variant-numeric: tabular-nums; }
.wallet-card small { flex-basis: 100%; }
.profile-note, .feedback, .empty { margin-top: 8px; font-size: .86rem; }
.feedback:empty { display: none; }
.record { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.record strong { overflow-wrap: anywhere; }
.record-value { text-align: right; }
.empty { color: var(--muted); }
.support-thread { display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.message { max-width: 92%; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: .9rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.message[data-you] { justify-self: end; background: var(--raised); }
.support-form { display: grid; gap: 7px; margin-top: 12px; }
.support-form label { font-weight: 600; }
.support-form textarea, #manual-link { width: 100%; padding: 8px; color: inherit; background: var(--raised); border: 1px solid var(--line); border-radius: 6px; }
.support-form textarea { resize: vertical; }
#manual-link { margin: 8px 0; }
.link-list, .faq { margin-top: 12px; }
.link-list a, .faq summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; }
.faq p, .steps p { color: var(--muted); padding: 6px 0; }
.back { display: inline-block; margin-bottom: 10px; }
.steps { display: grid; gap: 13px; padding-left: 22px; }
.tabbar { border-top: 1px solid var(--line); padding-bottom: max(4px, env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; display: grid; gap: 3px; justify-items: center; padding: 9px 1px 4px; color: var(--muted); font-size: .76rem; }
.tabbar a[aria-current] { color: var(--accent); font-weight: 650; }
dialog { width: min(calc(100% - 32px), 420px); padding: 17px; color: inherit; background: var(--background); border: 1px solid var(--line); border-radius: 8px; }
dialog::backdrop { background: #0009; }
dialog h2 { padding-right: 30px; }
dialog p { margin-top: 6px; }
.close { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; color: inherit; background: none; border: 0; border-radius: 5px; }
.close:hover { background: var(--raised); }
.payment-actions button { width: 100%; margin-top: 12px; justify-content: center; }
#checkout-profile { margin: 10px 0 0; }
@media (max-width: 360px) {
  .topbar, .screen { padding-inline: 12px; }
}