:root {
  --bg: var(--tg-theme-secondary-bg-color, #f2f5f4);
  --surface: var(--tg-theme-bg-color, #ffffff);
  --surface-raised: #ffffff;
  --text: var(--tg-theme-text-color, #15211d);
  --muted: var(--tg-theme-hint-color, #6c7a75);
  --line: rgba(24, 55, 45, .10);
  --accent: #168a62;
  --accent-strong: #0f7050;
  --accent-soft: #e5f4ee;
  --blue: #3277d6;
  --blue-soft: #eaf2ff;
  --amber: #b26a13;
  --amber-soft: #fff1dc;
  --orange: #c95425;
  --orange-soft: #ffebe3;
  --red: #bd3440;
  --red-soft: #ffeaec;
  --violet: #7759c7;
  --violet-soft: #f1ecff;
  --shadow: 0 10px 32px rgba(25, 51, 43, .08);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 15px;
  --safe-top: max(12px, env(safe-area-inset-top));
  --safe-bottom: max(8px, env(safe-area-inset-bottom));
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--tg-theme-secondary-bg-color, #101714);
    --surface: var(--tg-theme-bg-color, #17201d);
    --surface-raised: #1c2824;
    --text: var(--tg-theme-text-color, #f0f6f3);
    --muted: var(--tg-theme-hint-color, #93a29c);
    --line: rgba(224, 247, 238, .10);
    --accent: #40c494;
    --accent-strong: #78d8b5;
    --accent-soft: #173d31;
    --blue-soft: #172d48;
    --amber-soft: #3a2b18;
    --orange-soft: #43251c;
    --red-soft: #402127;
    --violet-soft: #2c2545;
    --shadow: 0 14px 36px rgba(0, 0, 0, .22);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.icon-sprite { position: fixed; width: 0; height: 0; overflow: hidden; }
.icon { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app-shell { width: min(100%, 760px); margin: 0 auto; min-height: 100dvh; background: var(--bg); }
.app-shell[aria-busy="true"] { pointer-events: none; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; min-height: 70px; padding: var(--safe-top) 18px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); }
.brand-mark { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border-radius: 13px; color: white; background: var(--accent); box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 25%, transparent); }
.brand-mark .icon { width: 23px; height: 23px; stroke-width: 2; }
.brand-mark.large { width: 62px; height: 62px; border-radius: 20px; margin: 0 auto 20px; }
.brand-mark.large .icon { width: 34px; height: 34px; }
.brand-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: 18px; letter-spacing: -.02em; }
.eyebrow { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .07em; line-height: 1.4; text-transform: uppercase; }
.icon-button, .primary-icon-button { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border: 0; border-radius: 14px; background: var(--surface); cursor: pointer; }
.icon-button:active, .primary-icon-button:active { transform: scale(.95); }
.primary-icon-button { color: white; background: var(--accent); }
.health-dot { position: absolute; width: 8px; height: 8px; margin: -21px 0 0 21px; border: 2px solid var(--surface); border-radius: 50%; background: var(--amber); }
.health-dot.ok { background: var(--accent); }
.avatar { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; border: 1px solid color-mix(in srgb, var(--violet) 18%, var(--line)); border-radius: 50%; color: var(--violet); background: var(--violet-soft); font-weight: 800; }
.avatar-large { width: 54px; height: 54px; font-size: 20px; }

.main-content { padding: 8px 16px calc(92px + var(--safe-bottom)); }
.view { display: none; animation: view-in .22s ease both; }
.view.is-active { display: block; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.protection-card { position: relative; display: flex; min-height: 178px; overflow: hidden; padding: 24px; border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); }
.protection-copy { position: relative; z-index: 2; width: 72%; }
.protection-card h1 { max-width: 460px; margin: 18px 0 8px; font-size: clamp(23px, 6vw, 34px); line-height: 1.06; letter-spacing: -.04em; }
.protection-card p { max-width: 430px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; color: var(--accent-strong); background: var(--accent-soft); font-size: 12px; font-weight: 750; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.shield-orbit { position: absolute; right: -16px; bottom: -25px; display: grid; place-items: center; width: 155px; height: 155px; color: white; border-radius: 50%; background: var(--accent); }
.shield-orbit .icon { position: relative; z-index: 2; width: 58px; height: 58px; stroke-width: 1.35; }
.orbit-ring { position: absolute; width: 112px; height: 112px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; box-shadow: 0 0 0 18px rgba(255,255,255,.08), 0 0 0 36px rgba(255,255,255,.05); }

.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin: 12px 0 26px; }
.metric-card { min-width: 0; padding: 15px 13px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.metric-card span, .metric-card small { display: block; overflow: hidden; color: var(--muted); font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
.metric-card strong { display: block; margin: 4px 0 1px; font-size: 27px; letter-spacing: -.04em; }
.section-heading, .page-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 24px 2px 12px; }
.section-heading h2, .page-heading h1 { margin: 1px 0 0; font-size: 22px; letter-spacing: -.035em; }
.page-heading { align-items: center; margin-top: 10px; }
.page-heading h1 { font-size: 30px; }
.text-button { display: inline-flex; align-items: center; gap: 4px; padding: 7px 4px; border: 0; color: var(--accent-strong); background: none; font-size: 13px; font-weight: 750; cursor: pointer; }
.text-button .icon { width: 16px; height: 16px; }
.count-badge { min-width: 34px; padding: 7px 10px; border-radius: 999px; color: var(--accent-strong); background: var(--accent-soft); font-size: 13px; font-weight: 800; text-align: center; }

.children-strip { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 5px; scrollbar-width: none; scroll-snap-type: x proximity; }
.children-strip::-webkit-scrollbar { display: none; }
.child-mini-card { display: grid; grid-template-columns: 43px minmax(110px, 1fr) auto; align-items: center; flex: 0 0 min(82vw, 310px); gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); scroll-snap-align: start; }
.child-avatar { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 15px; color: var(--blue); background: var(--blue-soft); font-size: 16px; font-weight: 850; }
.child-copy { min-width: 0; }
.child-copy strong, .child-copy span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.child-copy strong { font-size: 14px; }
.child-copy span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.state-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.state-dot.online { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.state-dot.error { background: var(--red); box-shadow: 0 0 0 5px var(--red-soft); }
.empty-mini-card { flex: 1; padding: 18px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--radius-lg); color: var(--muted); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); font-size: 13px; text-align: center; }

.card-list { display: grid; gap: 10px; }
.alert-card { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); cursor: pointer; text-align: left; }
.alert-card:active { transform: scale(.99); }
.severity-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 15px; }
.severity-icon .icon { width: 21px; height: 21px; }
.severity-icon.low { color: var(--blue); background: var(--blue-soft); }
.severity-icon.medium { color: var(--amber); background: var(--amber-soft); }
.severity-icon.high { color: var(--orange); background: var(--orange-soft); }
.severity-icon.critical { color: var(--red); background: var(--red-soft); }
.alert-card-copy { min-width: 0; }
.alert-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.alert-card h3 { margin: 0; overflow: hidden; font-size: 14px; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.alert-card p { display: -webkit-box; overflow: hidden; margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.score-pill { min-width: 38px; padding: 5px 7px; border-radius: 10px; background: var(--bg); font-size: 11px; font-weight: 800; text-align: center; }

.conversation-tip { display: grid; grid-template-columns: 44px 1fr; gap: 13px; margin-top: 20px; padding: 17px; border: 1px solid color-mix(in srgb, var(--violet) 18%, var(--line)); border-radius: var(--radius-lg); background: var(--violet-soft); }
.tip-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 15px; color: var(--violet); background: color-mix(in srgb, var(--surface) 75%, transparent); }
.conversation-tip h3 { margin: 2px 0 5px; font-size: 15px; }
.conversation-tip p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

.filter-bar { display: flex; gap: 7px; overflow-x: auto; margin: 8px -16px 16px; padding: 0 16px 3px; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip, .segmented-control button { flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 12px; font-weight: 700; cursor: pointer; }
.filter-chip.is-active { border-color: var(--text); color: var(--surface); background: var(--text); }
.segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; border-radius: 14px; background: color-mix(in srgb, var(--text) 7%, transparent); }
.segmented-control button { border: 0; border-radius: 11px; background: transparent; }
.segmented-control button.is-active { color: var(--text); background: var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.search-field { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; padding: 0 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.search-field .icon { width: 18px; color: var(--muted); }
.search-field input { width: 100%; padding: 12px 0; border: 0; outline: 0; background: transparent; }
.is-hidden { display: none !important; }

.notice { display: flex; align-items: flex-start; gap: 10px; padding: 14px; border-radius: var(--radius-md); }
.notice .icon { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; }
.notice p { margin: 0; font-size: 12px; line-height: 1.5; }
.notice.calm { color: var(--accent-strong); background: var(--accent-soft); }
.notice.warning { color: var(--amber); background: var(--amber-soft); }
.children-list { display: grid; gap: 11px; margin-top: 16px; }
.child-card { padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.child-card-head { display: flex; align-items: center; gap: 12px; }
.child-card-head .child-copy { flex: 1; }
.child-card-head .child-copy strong { font-size: 16px; }
.status-label { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: 12px; }
.child-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 15px; }
.child-stat { padding: 11px; border-radius: 13px; background: var(--bg); }
.child-stat span { display: block; color: var(--muted); font-size: 10px; }
.child-stat strong { display: block; margin-top: 3px; font-size: 12px; }
.child-card-actions { display: flex; gap: 8px; margin-top: 13px; }
.secondary-button, .danger-button, .primary-button { min-height: 44px; padding: 10px 16px; border: 0; border-radius: 14px; font-weight: 750; cursor: pointer; }
.secondary-button { color: var(--text); background: var(--bg); }
.danger-button { color: var(--red); background: var(--red-soft); }
.primary-button { color: white; background: var(--accent); }
.primary-button:disabled { opacity: .5; cursor: wait; }
.full-width { width: 100%; }
.add-child-card { display: grid; grid-template-columns: 46px 1fr 20px; align-items: center; width: 100%; gap: 12px; margin-top: 12px; padding: 15px; border: 1px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--radius-lg); color: var(--text); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); text-align: left; cursor: pointer; }
.add-child-card .add-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; color: var(--accent-strong); background: var(--surface); }
.add-child-card strong, .add-child-card small { display: block; }
.add-child-card small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.chevron { width: 18px; height: 18px; color: var(--muted); }

.contact-legend { display: flex; gap: 15px; margin: 14px 3px 11px; color: var(--muted); font-size: 10px; }
.contact-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }
.legend-dot.new { background: var(--blue); }.legend-dot.watch { background: var(--amber); }.legend-dot.trusted { background: var(--accent); }
.contact-list { display: grid; gap: 8px; }
.contact-row { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.contact-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: var(--blue); background: var(--blue-soft); font-weight: 800; }
.contact-copy { min-width: 0; }
.contact-copy strong, .contact-copy span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.contact-copy strong { font-size: 13px; }
.contact-copy span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.contact-status-button { padding: 7px 9px; border: 0; border-radius: 10px; color: var(--amber); background: var(--amber-soft); font-size: 10px; font-weight: 800; cursor: pointer; }
.contact-status-button.trusted { color: var(--accent-strong); background: var(--accent-soft); }
.contact-status-button.muted { color: var(--muted); background: var(--bg); }

.settings-profile { display: flex; align-items: center; gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.settings-profile strong, .settings-profile span { display: block; }
.settings-profile span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.menu-group { overflow: hidden; margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.menu-group button { display: grid; grid-template-columns: 42px minmax(0,1fr) 18px; align-items: center; width: 100%; gap: 11px; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.menu-group button:last-child { border-bottom: 0; }
.menu-group strong, .menu-group small { display: block; }
.menu-group strong { font-size: 13px; }
.menu-group small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.menu-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; }
.menu-icon .icon { width: 19px; height: 19px; }
.menu-icon.blue { color: var(--blue); background: var(--blue-soft); }.menu-icon.violet { color: var(--violet); background: var(--violet-soft); }.menu-icon.green { color: var(--accent); background: var(--accent-soft); }.menu-icon.amber { color: var(--amber); background: var(--amber-soft); }
.version-line { margin: 22px 0 0; color: var(--muted); font-size: 10px; text-align: center; }

.bottom-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); width: min(100%, 760px); margin: 0 auto; padding: 7px 7px var(--safe-bottom); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(20px); }
.bottom-nav button { display: flex; min-width: 0; flex-direction: column; align-items: center; gap: 3px; padding: 5px 2px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 700; cursor: pointer; }
.bottom-nav button.is-active { color: var(--accent-strong); }
.bottom-nav .icon { width: 21px; height: 21px; }
.nav-icon-wrap { position: relative; display: flex; }
.nav-dot { position: absolute; top: -1px; right: -4px; width: 7px; height: 7px; border: 2px solid var(--surface); border-radius: 50%; background: var(--red); }

.sheet-backdrop, .modal { position: fixed; z-index: 50; inset: 0; background: rgba(9, 18, 15, .45); backdrop-filter: blur(4px); }
.bottom-sheet { position: fixed; z-index: 60; right: 0; bottom: 0; left: 0; width: min(100%, 760px); max-height: 88dvh; margin: auto; overflow: auto; border-radius: 26px 26px 0 0; background: var(--surface); box-shadow: 0 -18px 50px rgba(0,0,0,.18); animation: sheet-up .25s ease both; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet-handle { width: 38px; height: 4px; margin: 9px auto 3px; border-radius: 999px; background: var(--line); }
.sheet-header, .modal-header { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 17px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); }
.sheet-header h2, .modal-header h2 { margin: 1px 0 0; font-size: 22px; letter-spacing: -.03em; }
.sheet-content { padding: 0 17px calc(24px + var(--safe-bottom)); }
.detail-hero { display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center; padding: 15px; border-radius: var(--radius-lg); background: var(--bg); }
.detail-score { font-size: 18px; font-weight: 850; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.detail-cell { padding: 13px; border: 1px solid var(--line); border-radius: 14px; }
.detail-cell span { display: block; color: var(--muted); font-size: 10px; }
.detail-cell strong { display: block; margin-top: 4px; font-size: 12px; }
.snippet-box { margin-top: 13px; padding: 15px; border-left: 3px solid var(--accent); border-radius: 4px 14px 14px 4px; background: var(--bg); font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.signal-list { display: grid; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; }
.signal-list li { display: flex; gap: 9px; padding: 11px; border-radius: 13px; background: var(--bg); font-size: 12px; line-height: 1.4; }
.signal-list li::before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--amber); }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
.sheet-section-title { margin: 20px 0 8px; font-size: 14px; }

.modal { display: grid; place-items: end center; padding-top: var(--safe-top); }
.modal-card { width: min(100%, 760px); max-height: 96dvh; overflow: auto; border-radius: 26px 26px 0 0; background: var(--surface); box-shadow: 0 -18px 50px rgba(0,0,0,.18); animation: sheet-up .25s ease both; }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-content { padding: 18px 17px calc(25px + var(--safe-bottom)); }
.method-grid { display: grid; gap: 10px; }
.method-card { display: grid; grid-template-columns: 50px minmax(0,1fr) 20px; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); text-align: left; cursor: pointer; }
.method-card.recommended { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 35%, var(--surface)); }
.method-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px; color: var(--accent-strong); background: var(--accent-soft); }
.method-card strong, .method-card small { display: block; }
.method-card small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.recommended-label { display: inline-flex !important; width: fit-content; margin: 0 0 5px !important; padding: 3px 6px; border-radius: 7px; color: var(--accent-strong) !important; background: var(--accent-soft); font-size: 8px !important; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.consent-box { display: flex; align-items: flex-start; gap: 10px; margin-top: 15px; padding: 13px; border-radius: 14px; background: var(--bg); color: var(--muted); font-size: 11px; line-height: 1.45; }
.consent-box input { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--accent); }
.step-list { display: grid; gap: 11px; margin: 0 0 17px; padding: 0; list-style: none; counter-reset: step; }
.step-list li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; color: var(--muted); font-size: 12px; line-height: 1.4; counter-increment: step; }
.step-list li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 10px; color: var(--accent-strong); background: var(--accent-soft); font-weight: 850; }
.qr-frame { display: grid; place-items: center; width: min(75vw, 290px); aspect-ratio: 1; margin: 12px auto; padding: 13px; border: 1px solid var(--line); border-radius: 24px; background: white; }
.qr-frame img { width: 100%; height: 100%; }
.timer-line { color: var(--muted); font-size: 11px; text-align: center; }
.progress-line { height: 4px; overflow: hidden; margin: 8px auto 16px; border-radius: 999px; background: var(--line); }
.progress-line i { display: block; width: 100%; height: 100%; background: var(--accent); transform-origin: left; }
.form-field { display: grid; gap: 6px; margin: 13px 0; }
.form-field span { color: var(--muted); font-size: 11px; font-weight: 700; }
.form-field input, .form-field select { width: 100%; min-height: 48px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 14px; outline: 0; background: var(--bg); }
.form-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.code-input { font-size: 24px !important; font-weight: 800; letter-spacing: .25em; text-align: center; }
.secure-note { display: flex; gap: 8px; margin: 12px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.secure-note .icon { width: 16px; height: 16px; flex: 0 0 auto; color: var(--accent); }
.success-state { padding: 15px 0; text-align: center; }
.success-icon { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 17px; border-radius: 26px; color: white; background: var(--accent); }
.success-icon .icon { width: 38px; height: 38px; stroke-width: 2.2; }
.success-state h3 { margin: 0 0 7px; font-size: 23px; }
.success-state p { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }

.switch-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { font-size: 13px; }.switch-row small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.switch { position: relative; width: 45px; height: 27px; }
.switch input { position: absolute; opacity: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: color-mix(in srgb, var(--muted) 28%, transparent); transition: .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: .2s; }
.switch input:checked + i { background: var(--accent); }.switch input:checked + i::after { transform: translateX(18px); }
.range-row { margin: 17px 0; }
.range-label { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 12px; font-weight: 700; }
.range-row input { width: 100%; accent-color: var(--accent); }
.chart-bars { display: flex; align-items: flex-end; gap: 7px; height: 130px; margin: 16px 0; padding: 12px 8px 0; border-bottom: 1px solid var(--line); }
.chart-bar { position: relative; flex: 1; min-height: 3px; border-radius: 6px 6px 0 0; background: var(--accent); }
.chart-bar span { position: absolute; right: 0; bottom: -20px; left: 0; color: var(--muted); font-size: 8px; text-align: center; }
.category-row { display: grid; grid-template-columns: minmax(90px,1fr) 2fr 28px; align-items: center; gap: 8px; margin: 10px 0; font-size: 11px; }
.category-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--bg); }.category-track i { display: block; height: 100%; border-radius: inherit; background: var(--violet); }

.toast-region { position: fixed; z-index: 100; right: 14px; bottom: calc(82px + var(--safe-bottom)); left: 14px; display: grid; justify-items: center; gap: 7px; pointer-events: none; }
.toast { max-width: 520px; padding: 11px 15px; border-radius: 13px; color: white; background: #1e2a26; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .22s ease both; }
.toast.error { background: #8f2933; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.fatal-state { display: grid; place-content: center; min-height: 100dvh; padding: 28px; text-align: center; }
.fatal-state h1 { margin: 0 0 8px; font-size: 26px; }.fatal-state p { max-width: 420px; margin: 0 auto 20px; color: var(--muted); line-height: 1.5; }
.fatal-state .primary-button { justify-self: center; }
.empty-state { padding: 30px 18px; border: 1px dashed var(--line); border-radius: var(--radius-lg); color: var(--muted); background: var(--surface); font-size: 12px; line-height: 1.5; text-align: center; }
.skeleton-card { height: 76px; border-radius: var(--radius-lg); background: linear-gradient(90deg, var(--surface) 25%, color-mix(in srgb, var(--surface) 60%, var(--line)) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skeleton-row { min-height: 70px; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (min-width: 620px) {
  .main-content { padding-right: 24px; padding-left: 24px; }
  .metric-grid { gap: 12px; }
  .alert-card { padding: 17px; }
  .children-strip { margin-right: -24px; margin-left: -24px; padding-right: 24px; padding-left: 24px; }
  .filter-bar { margin-right: -24px; margin-left: -24px; padding-right: 24px; padding-left: 24px; }
  .modal { place-items: center; padding: 24px; }
  .modal-card { max-width: 560px; border-radius: 26px; }
  .bottom-sheet { bottom: 16px; max-width: 610px; border-radius: 26px; }
}

@media (max-width: 370px) {
  .protection-card { padding: 19px; }.protection-copy { width: 78%; }.shield-orbit { right: -42px; }
  .metric-card { padding: 12px 9px; }.metric-card strong { font-size: 23px; }.metric-card span,.metric-card small { font-size: 9px; }
  .bottom-nav button { font-size: 8px; }
}

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