:root {
  color-scheme: light dark;
  --hb-bg: #f3f7f5;
  --hb-surface: #ffffff;
  --hb-surface-strong: #ffffff;
  --hb-surface-soft: #eef5f2;
  --hb-text: #12211c;
  --hb-muted: #687770;
  --hb-line: #dce8e2;
  --hb-accent: #0b826a;
  --hb-accent-strong: #076b57;
  --hb-accent-soft: #e2f4ed;
  --hb-danger: #c23636;
  --hb-shadow: 0 18px 50px rgba(21, 61, 45, .09);
  --hb-shadow-soft: 0 8px 24px rgba(21, 61, 45, .06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background: var(--tg-theme-secondary-bg-color, var(--hb-bg));
  color: var(--tg-theme-text-color, var(--hb-text));
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root {
    --hb-bg: #0c151d;
    --hb-surface: #121f29;
    --hb-surface-strong: #172632;
    --hb-surface-soft: #182630;
    --hb-text: #f4f8f6;
    --hb-muted: #a6b5ad;
    --hb-line: #263b48;
    --hb-accent: #20a987;
    --hb-accent-strong: #35bd99;
    --hb-accent-soft: #153b35;
    --hb-shadow: 0 20px 56px rgba(0, 0, 0, .22);
    --hb-shadow-soft: 0 10px 28px rgba(0, 0, 0, .15);
  }
}

* { box-sizing: border-box; }
html { min-width: 280px; min-height: 100%; background: var(--tg-theme-secondary-bg-color, var(--hb-bg)); }
body { min-width: 280px; min-height: 100%; margin: 0; overflow-x: hidden; background: var(--tg-theme-secondary-bg-color, var(--hb-bg)); }
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(22px, 5vw, 27px); font-weight: 820; letter-spacing: -.045em; }
h2 { font-size: 20px; font-weight: 790; letter-spacing: -.035em; }
h3 { font-size: 23px; font-weight: 820; letter-spacing: -.04em; }
h4 { font-size: 15px; font-weight: 780; letter-spacing: -.015em; }
.hidden { display: none !important; }

.ambient { position: fixed; z-index: 0; width: 270px; height: 270px; border-radius: 50%; filter: blur(24px); opacity: .16; pointer-events: none; }
.ambient-one { top: -150px; right: -120px; background: #28c69e; }
.ambient-two { bottom: -180px; left: -170px; background: #5ca8ff; opacity: .08; }

.app-shell { position: relative; z-index: 1; width: min(100%, 720px); margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 3px 2px 24px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 48px; height: 48px; overflow: hidden; border: 1px solid rgba(255,255,255,.22); border-radius: 17px; background: linear-gradient(145deg, var(--hb-accent), #075a4a); color: #fff; font-weight: 900; letter-spacing: -.06em; box-shadow: 0 13px 30px rgba(11,130,106,.25); }
.logo::after { position: absolute; top: -17px; right: -17px; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; content: ""; }
.logo span { position: relative; z-index: 1; }
.eyebrow { margin-bottom: 4px; color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 10px; font-weight: 850; letter-spacing: .16em; line-height: 1.2; }
.pilot-chip { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); border-radius: 999px; background: color-mix(in srgb, var(--tg-theme-bg-color, var(--hb-surface)) 82%, transparent); color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 11px; font-weight: 760; backdrop-filter: blur(14px); }
.pilot-chip i { width: 7px; height: 7px; border-radius: 50%; background: #29b982; box-shadow: 0 0 0 4px rgba(41,185,130,.13); }

.setting-card, .state-card, .surface-card, .toggle-card { border: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); background: var(--tg-theme-bg-color, var(--hb-surface)); box-shadow: var(--hb-shadow-soft); }
.notification-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; padding: 16px; border-radius: 22px; }
.setting-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: linear-gradient(145deg, var(--hb-accent-soft), color-mix(in srgb, var(--hb-accent-soft) 55%, transparent)); color: var(--tg-theme-button-color, var(--hb-accent)); font-size: 18px; font-weight: 850; }
.setting-icon.subtle { width: 38px; height: 38px; border-radius: 12px; font-size: 15px; }
.setting-copy { min-width: 0; }
.setting-title { display: flex; align-items: center; gap: 8px; }
.setting-title h2 { font-size: 16px; }
.setting-copy p, .toggle-card small, .state-card p, .danger-zone p, .panel-intro p, .info-note p { color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 13px; line-height: 1.48; }
.setting-copy p { margin-top: 3px; }
.status-label { padding: 3px 7px; border-radius: 99px; background: var(--hb-accent-soft); color: var(--tg-theme-button-color, var(--hb-accent)); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.status-label.off { background: color-mix(in srgb, var(--tg-theme-hint-color, var(--hb-muted)) 13%, transparent); color: var(--tg-theme-hint-color, var(--hb-muted)); }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 30px 2px 13px; }
.section-heading h2 { font-size: 19px; }
.count { padding: 6px 10px; border: 1px solid color-mix(in srgb, var(--tg-theme-button-color, var(--hb-accent)) 20%, transparent); border-radius: 999px; background: var(--hb-accent-soft); color: var(--tg-theme-button-color, var(--hb-accent)); font-size: 11px; font-weight: 850; }
.search-list { display: grid; gap: 10px; }
.search-card { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 13px; width: 100%; padding: 15px; overflow: hidden; border: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); border-radius: 19px; background: var(--tg-theme-bg-color, var(--hb-surface)); color: inherit; box-shadow: var(--hb-shadow-soft); text-align: left; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.search-card::before { position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--tg-theme-button-color, var(--hb-accent)); content: ""; }
.search-card:active { transform: scale(.985); }
.search-card-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--hb-accent-soft); color: var(--tg-theme-button-color, var(--hb-accent)); font-size: 18px; font-weight: 850; }
.search-card-copy { min-width: 0; }
.search-card strong { display: block; margin-bottom: 4px; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.search-card small { display: block; overflow: hidden; color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 12px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.search-card-tail { display: grid; justify-items: end; gap: 7px; }
.search-card-chevron { color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 22px; font-weight: 400; line-height: .8; }
.badge { padding: 4px 7px; border-radius: 999px; background: var(--hb-accent-soft); color: var(--tg-theme-button-color, var(--hb-accent)); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.badge.off { background: color-mix(in srgb, var(--tg-theme-hint-color, var(--hb-muted)) 12%, transparent); color: var(--tg-theme-hint-color, var(--hb-muted)); }

.button { min-height: 48px; padding: 0 18px; border: 0; border-radius: 15px; font-weight: 780; letter-spacing: -.01em; cursor: pointer; transition: transform .16s ease, filter .16s ease, opacity .16s ease; }
.button:active { transform: scale(.975); }
.button:disabled { opacity: .45; cursor: default; }
.button.primary { background: linear-gradient(145deg, var(--tg-theme-button-color, var(--hb-accent)), var(--hb-accent-strong)); color: var(--tg-theme-button-text-color, #fff); box-shadow: 0 12px 25px rgba(11,130,106,.19); }
.button.secondary { border: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); background: var(--tg-theme-bg-color, var(--hb-surface)); color: var(--tg-theme-text-color, var(--hb-text)); }
.button.danger { background: rgba(194,54,54,.1); color: var(--hb-danger); }
.button.wide { width: 100%; }
.add-button { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 12px; }
.add-button span { font-size: 20px; font-weight: 500; }

.state-card { padding: 34px 22px; border-radius: 22px; text-align: center; }
.state-card h2 { margin: 11px 0 5px; }
.state-card .button { margin-top: 18px; }
.state-icon, .empty-visual { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto; border-radius: 18px; background: var(--hb-accent-soft); color: var(--tg-theme-button-color, var(--hb-accent)); font-size: 23px; font-weight: 900; }
.empty-state { padding-block: 30px; }
.empty-visual { position: relative; overflow: hidden; font-size: 28px; }
.empty-visual::after { position: absolute; width: 75px; height: 1px; background: currentColor; opacity: .18; transform: rotate(-35deg); content: ""; }
.spinner { display: inline-block; width: 27px; height: 27px; border: 3px solid color-mix(in srgb, var(--tg-theme-button-color, var(--hb-accent)) 22%, transparent); border-top-color: var(--tg-theme-button-color, var(--hb-accent)); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.switch { position: relative; display: inline-flex; flex: 0 0 auto; width: 48px; height: 29px; }
.switch input { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.switch > span { width: 100%; border-radius: 99px; background: color-mix(in srgb, var(--tg-theme-hint-color, var(--hb-muted)) 50%, transparent); transition: .2s ease; }
.switch > span::after { display: block; width: 23px; height: 23px; margin: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); content: ""; transition: .2s cubic-bezier(.22, 1, .36, 1); }
.switch input:checked + span { background: var(--tg-theme-button-color, var(--hb-accent)); }
.switch input:checked + span::after { transform: translateX(19px); }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--tg-theme-button-color, var(--hb-accent)) 25%, transparent); outline-offset: 2px; }
.danger-zone { margin: 28px 3px 0; color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 13px; }
.danger-zone summary { cursor: pointer; font-weight: 720; }
.danger-zone p { margin-top: 8px; }
.danger-zone .button { margin-top: 12px; }

.editor-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; margin-bottom: 14px; }
.editor-title-copy { min-width: 0; }
.editor-heading h2 { overflow: hidden; font-size: 20px; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); border-radius: 14px; background: var(--tg-theme-bg-color, var(--hb-surface)); color: inherit; box-shadow: var(--hb-shadow-soft); cursor: pointer; }
.icon-button span { margin-top: -3px; font-size: 31px; font-weight: 350; line-height: 1; }
.draft-chip { padding: 6px 9px; border-radius: 99px; background: var(--hb-accent-soft); color: var(--tg-theme-button-color, var(--hb-accent)); font-size: 10px; font-weight: 830; }

.step-tabs { position: sticky; top: max(0px, env(safe-area-inset-top)); z-index: 7; display: flex; gap: 6px; margin: 0 -4px; padding: 7px 4px; overflow-x: auto; background: color-mix(in srgb, var(--tg-theme-secondary-bg-color, var(--hb-bg)) 88%, transparent); scrollbar-width: none; backdrop-filter: blur(18px); }
.step-tabs::-webkit-scrollbar { display: none; }
.step-tab { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 1 0 auto; min-width: max-content; min-height: 37px; padding: 5px 10px 5px 6px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 11px; font-weight: 780; cursor: pointer; transition: .18s ease; }
.step-tab.active { border-color: color-mix(in srgb, var(--tg-theme-button-color, var(--hb-accent)) 17%, transparent); background: var(--tg-theme-bg-color, var(--hb-surface)); color: var(--tg-theme-text-color, var(--hb-text)); box-shadow: var(--hb-shadow-soft); }
.step-number { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: color-mix(in srgb, var(--tg-theme-hint-color, var(--hb-muted)) 10%, transparent); color: inherit; font-size: 10px; }
.step-tab.active .step-number { background: var(--hb-accent-soft); color: var(--tg-theme-button-color, var(--hb-accent)); }
.step-badge { position: absolute; top: 4px; right: 5px; width: 6px; height: 6px; border: 1.5px solid var(--tg-theme-bg-color, var(--hb-surface)); border-radius: 50%; background: transparent; }
.step-tab.complete .step-badge { background: #28b982; }
.step-progress { height: 2px; margin: 0 4px 20px; overflow: hidden; border-radius: 99px; background: color-mix(in srgb, var(--tg-theme-hint-color, var(--hb-muted)) 14%, transparent); }
.step-progress span { display: block; width: 25%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--tg-theme-button-color, var(--hb-accent)), #30bea0); transition: width .25s cubic-bezier(.22, 1, .36, 1); }

.panel-stage { min-height: 370px; }
.editor-panel { animation: panel-in .23s ease both; }
@keyframes panel-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
.panel-intro { padding: 4px 2px 15px; }
.panel-intro h3 { margin: 3px 0 5px; }
.panel-kicker { color: var(--tg-theme-button-color, var(--hb-accent)); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.surface-card { margin-bottom: 12px; padding: 17px; border-radius: 21px; }
.field { display: grid; gap: 7px; margin: 0; }
.field > span, fieldset legend { color: var(--tg-theme-text-color, var(--hb-text)); font-size: 12px; font-weight: 780; }
.field > small { justify-self: end; color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 10px; }
input { width: 100%; min-width: 0; min-height: 49px; padding: 12px 13px; border: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); border-radius: 14px; outline: 0; background: var(--tg-theme-secondary-bg-color, var(--hb-surface-soft)); color: var(--tg-theme-text-color, var(--hb-text)); caret-color: var(--tg-theme-button-color, var(--hb-accent)); }
input::placeholder { color: color-mix(in srgb, var(--tg-theme-hint-color, var(--hb-muted)) 72%, transparent); }
input:focus { border-color: var(--tg-theme-button-color, var(--hb-accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tg-theme-button-color, var(--hb-accent)) 15%, transparent); }
input:invalid:not(:placeholder-shown) { border-color: var(--hb-danger); }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.feature-field input { min-height: 54px; font-size: 16px; font-weight: 620; }
.category-field legend { margin-bottom: 11px; }
.category-options { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.category-card { position: relative; min-width: 0; cursor: pointer; }
.category-card input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.category-card-body { display: grid; min-height: 127px; align-content: end; padding: 13px; border: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); border-radius: 17px; background: var(--tg-theme-secondary-bg-color, var(--hb-surface-soft)); transition: .18s ease; }
.category-card-body i { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 14px; border-radius: 12px; background: var(--tg-theme-bg-color, var(--hb-surface)); color: var(--tg-theme-button-color, var(--hb-accent)); font-size: 19px; font-style: normal; box-shadow: var(--hb-shadow-soft); }
.category-card-body strong { font-size: 14px; }
.category-card-body small { margin-top: 3px; color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 10px; line-height: 1.35; }
.category-card > b { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); border-radius: 7px; background: var(--tg-theme-bg-color, var(--hb-surface)); color: transparent; font-size: 11px; transition: .18s ease; }
.category-card input:checked + .category-card-body { border-color: color-mix(in srgb, var(--tg-theme-button-color, var(--hb-accent)) 65%, transparent); background: var(--hb-accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tg-theme-button-color, var(--hb-accent)) 12%, transparent); }
.category-card input:checked ~ b { border-color: var(--tg-theme-button-color, var(--hb-accent)); background: var(--tg-theme-button-color, var(--hb-accent)); color: var(--tg-theme-button-text-color, #fff); }
.category-card input:focus-visible + .category-card-body { outline: 3px solid color-mix(in srgb, var(--tg-theme-button-color, var(--hb-accent)) 25%, transparent); outline-offset: 2px; }

.toggle-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 12px 0; padding: 15px; border-radius: 19px; }
.toggle-card.compact { margin-top: 12px; }
.toggle-copy { min-width: 0; }
.toggle-copy strong { display: block; font-size: 14px; }
.toggle-copy small { display: block; margin-top: 3px; }
.picker-stack { padding: 4px 15px; }
.picker-control { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 68px; padding: 11px 0; border: 0; border-bottom: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.picker-control:last-of-type { border-bottom: 0; }
.picker-leading { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--hb-accent-soft); color: var(--tg-theme-button-color, var(--hb-accent)); font-size: 15px; font-weight: 860; }
.picker-copy { min-width: 0; }
.picker-copy strong { display: block; font-size: 13px; }
.picker-copy small { display: block; margin-top: 3px; overflow: hidden; color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.picker-tail { display: flex; align-items: center; gap: 7px; }
.picker-tail b { min-width: 22px; padding: 4px 6px; border-radius: 99px; background: var(--hb-accent-soft); color: var(--tg-theme-button-color, var(--hb-accent)); font-size: 10px; text-align: center; }
.picker-tail i { color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 24px; font-style: normal; font-weight: 350; }
.native-select-proxy { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.info-note { display: flex; align-items: flex-start; gap: 9px; margin: 12px 4px; }
.info-note > span { display: grid; place-items: center; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: var(--hb-accent-soft); color: var(--tg-theme-button-color, var(--hb-accent)); font-size: 11px; font-weight: 850; }
.currency-field legend { margin-bottom: 9px; }
.currency-options, .details-mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 14px; background: var(--tg-theme-secondary-bg-color, var(--hb-surface-soft)); }
.currency-options label { position: relative; cursor: pointer; }
.currency-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.currency-options span, .details-mode-tabs button { display: grid; place-items: center; min-height: 39px; padding: 7px; border: 0; border-radius: 11px; background: transparent; color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 11px; font-weight: 800; text-align: center; }
.currency-options input:checked + span, .details-mode-tabs button.active { background: var(--tg-theme-bg-color, var(--hb-surface)); color: var(--tg-theme-button-color, var(--hb-accent)); box-shadow: var(--hb-shadow-soft); }
.currency-options input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--tg-theme-button-color, var(--hb-accent)) 22%, transparent); }
.range-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 8px; margin-top: 15px; }
.range-divider { padding-bottom: 17px; color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 12px; }
.input-shell { position: relative; }
.input-shell input { padding-right: 43px; }
.input-shell i { position: absolute; top: 50%; right: 12px; color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 10px; font-style: normal; font-weight: 750; transform: translateY(-50%); pointer-events: none; }
.detail-ranges h4 { margin-bottom: 2px; }
.detail-ranges > .field { margin-top: 14px; }
.details-mode-tabs { grid-template-columns: 1fr 1fr; margin-bottom: 15px; }
.details-mode-tabs button { cursor: pointer; }
.delete-link { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-top: 18px; padding: 13px; border: 0; background: transparent; color: var(--hb-danger); font-size: 13px; font-weight: 750; cursor: pointer; }
.form-error { min-height: 20px; margin-top: 10px; color: var(--hb-danger); font-size: 12px; line-height: 1.4; }
.editor-footer { position: sticky; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 6; display: flex; justify-content: flex-end; gap: 9px; margin: 6px -4px -4px; padding: 8px 4px 4px; background: linear-gradient(180deg, transparent, var(--tg-theme-secondary-bg-color, var(--hb-bg)) 25%); }
.editor-footer .button.primary { min-width: 135px; margin-left: auto; }
.has-native-main-button .editor-footer { display: none; }
.has-native-main-button .app-shell { padding-bottom: max(28px, env(safe-area-inset-bottom)); }

.picker-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; background: transparent; color: var(--tg-theme-text-color, var(--hb-text)); }
.picker-dialog[open] { display: flex; align-items: flex-end; justify-content: center; }
.picker-dialog::backdrop { background: rgba(3, 12, 17, .58); backdrop-filter: blur(5px); }
.picker-sheet { display: flex; flex-direction: column; width: min(100%, 680px); max-height: min(82dvh, 720px); padding: 9px max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); border: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); border-bottom: 0; border-radius: 27px 27px 0 0; background: var(--tg-theme-bg-color, var(--hb-surface)); box-shadow: 0 -20px 70px rgba(0,0,0,.2); animation: sheet-in .26s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes sheet-in { from { transform: translateY(36px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.sheet-handle { flex: 0 0 auto; width: 37px; height: 4px; margin: 0 auto 14px; border-radius: 99px; background: color-mix(in srgb, var(--tg-theme-hint-color, var(--hb-muted)) 32%, transparent); }
.picker-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.picker-header h2 { font-size: 21px; }
.sheet-close { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 12px; background: var(--tg-theme-secondary-bg-color, var(--hb-surface-soft)); color: inherit; font-size: 24px; cursor: pointer; }
.picker-search { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; margin-top: 14px; padding: 0 12px; border: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); border-radius: 14px; background: var(--tg-theme-secondary-bg-color, var(--hb-surface-soft)); }
.picker-search > span { color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 18px; }
.picker-search input { min-height: 45px; padding: 9px 0; border: 0; background: transparent; box-shadow: none; }
.picker-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px 8px; color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 11px; font-weight: 730; }
.picker-summary button { padding: 3px 0; border: 0; background: transparent; color: var(--tg-theme-button-color, var(--hb-accent)); font-size: 11px; font-weight: 800; cursor: pointer; }
.picker-options { flex: 1 1 auto; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); }
.picker-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 9px 3px; border: 0; border-bottom: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); background: transparent; color: inherit; text-align: left; cursor: pointer; }
.picker-option span { font-size: 13px; font-weight: 650; }
.picker-option i { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); border-radius: 8px; color: transparent; font-size: 11px; font-style: normal; }
.picker-option.selected i { border-color: var(--tg-theme-button-color, var(--hb-accent)); background: var(--tg-theme-button-color, var(--hb-accent)); color: var(--tg-theme-button-text-color, #fff); }
.picker-empty { padding: 34px 10px; color: var(--tg-theme-hint-color, var(--hb-muted)); font-size: 13px; text-align: center; }
.picker-footer { flex: 0 0 auto; padding-top: 10px; }

.toast { position: fixed; bottom: max(22px, env(safe-area-inset-bottom)); left: 50%; z-index: 40; max-width: calc(100vw - 32px); padding: 12px 16px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: #10231d; color: #fff; box-shadow: 0 14px 40px rgba(0,0,0,.25); font-size: 13px; font-weight: 690; opacity: 0; transform: translate(-50%, 18px); pointer-events: none; transition: .22s ease; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

button:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--tg-theme-button-color, var(--hb-accent)) 28%, transparent); outline-offset: 2px; }

@media (min-width: 620px) {
  .app-shell { padding-inline: 24px; }
  .picker-sheet { margin-bottom: 18px; border-bottom: 1px solid var(--tg-theme-section-separator-color, var(--hb-line)); border-radius: 27px; }
  .picker-dialog[open] { align-items: center; }
  .category-card-body { min-height: 142px; }
}

@media (max-width: 390px) {
  .app-shell { padding-inline: 12px; }
  .hero { padding-bottom: 20px; }
  .pilot-chip { display: none; }
  .step-tab { padding-right: 8px; font-size: 10px; }
  .step-number { width: 22px; height: 22px; }
  .surface-card { padding: 15px; }
  .category-card-body { padding: 11px; }
  .category-card-body strong { font-size: 13px; }
  .range-grid { gap: 5px; }
  .range-divider { display: none; }
  .range-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 330px) {
  .notification-row { grid-template-columns: minmax(0, 1fr) auto; }
  .notification-row > .setting-icon { display: none; }
  .category-options { grid-template-columns: 1fr; }
  .category-card-body { min-height: 105px; }
  .step-tab span:not(.step-number) { display: none; }
  .step-tab { min-width: 45px; padding: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
