/* iBox: интерфейс в духе iOS 26 — системные цвета и шрифт, сгруппированные списки, стеклянные панели. */
:root {
  color-scheme: light;
  --bg: #f2f2f7; --surface: #ffffff; --surface-2: #f2f2f7; --elevated: #ffffff;
  --label: #000000; --secondary: rgba(60,60,67,.76); --tertiary: rgba(60,60,67,.36); --separator: rgba(60,60,67,.18);
  --fill: rgba(120,120,128,.12); --fill-strong: rgba(120,120,128,.2);
  --accent: #007aff; --accent-tint: rgba(0,122,255,.12); --on-accent: #ffffff;
  --green: #34c759; --red: #ff3b30; --orange: #ff9500; --indigo: #5856d6;
  --glass: rgba(249,249,251,.72); --glass-border: rgba(255,255,255,.6); --glass-shadow: 0 8px 32px rgba(0,0,0,.12), 0 1px 0 rgba(255,255,255,.5) inset;
  --scrim: rgba(0,0,0,.32);
  --radius-group: 22px; --radius-sheet: 34px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', system-ui, sans-serif;
  font-size: 17px; letter-spacing: -.41px;
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --elevated: #1c1c1e;
    --label: #ffffff; --secondary: rgba(235,235,245,.6); --tertiary: rgba(235,235,245,.3); --separator: rgba(84,84,88,.55);
    --fill: rgba(118,118,128,.24); --fill-strong: rgba(118,118,128,.36);
    --accent: #0a84ff; --accent-tint: rgba(10,132,255,.2);
    --green: #30d158; --red: #ff453a; --orange: #ff9f0a; --indigo: #5e5ce6;
    --glass: rgba(30,30,32,.7); --glass-border: rgba(255,255,255,.12); --glass-shadow: 0 8px 32px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.08) inset;
    --scrim: rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --elevated: #1c1c1e;
  --label: #ffffff; --secondary: rgba(235,235,245,.6); --tertiary: rgba(235,235,245,.3); --separator: rgba(84,84,88,.55);
  --fill: rgba(118,118,128,.24); --fill-strong: rgba(118,118,128,.36);
  --accent: #0a84ff; --accent-tint: rgba(10,132,255,.2);
  --green: #30d158; --red: #ff453a; --orange: #ff9f0a; --indigo: #5e5ce6;
  --glass: rgba(30,30,32,.7); --glass-border: rgba(255,255,255,.12); --glass-shadow: 0 8px 32px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.08) inset;
  --scrim: rgba(0,0,0,.5);
}

/* --- основа --- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); overscroll-behavior-y: none; scroll-padding-top: 110px; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--label); line-height: 1.29; overscroll-behavior-y: none; }
main { max-width: 680px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
h1, h2, h3, p, ul, ol { margin: 0; }
a { color: var(--accent); text-decoration: none; }
button, input, select { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
button:disabled { opacity: .35; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
code { font: 13px ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0; overflow-wrap: anywhere; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.footnote, .muted { color: var(--secondary); font-size: 13px; letter-spacing: -.08px; line-height: 1.38; }
.small { font-size: 13px; letter-spacing: -.08px; line-height: 1.38; }
.center { text-align: center; }
.lead { color: var(--secondary); font-size: 17px; line-height: 1.35; }
.error-text { color: var(--red); font-size: 13px; letter-spacing: -.08px; overflow-wrap: anywhere; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.icon { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.inline-icon { width: 16px; height: 16px; display: inline-block; vertical-align: -.2em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.large-title { font-size: 34px; line-height: 1.2; font-weight: 700; letter-spacing: .37px; }
footer { margin: 40px 0 8px; text-align: center; font-size: 12px; color: var(--tertiary); }
body:not([data-view="login"]) footer { display: none; }
body[data-view="login"] .brand, body[data-view="passkey"] .brand, body[data-view="boot"] .brand { visibility: hidden; }
body[data-view="login"] footer { margin-top: 8px; }

/* --- кнопки --- */
.capsule { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 14px 22px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 17px; font-weight: 600; text-align: center; transition: transform 160ms, opacity 160ms; }
.capsule.tinted { background: var(--accent-tint); color: var(--accent); }
.capsule.plain { background: transparent; color: var(--accent); font-weight: 500; min-height: 44px; }
.capsule.danger { background: rgba(255,59,48,.12); color: var(--red); }
.capsule.wide { width: 100%; }
.capsule:active:not(:disabled) { transform: scale(.97); opacity: .85; }
.pill { flex-shrink: 0; min-width: 76px; min-height: 30px; padding: 6px 15px; border-radius: 999px; background: var(--fill); color: var(--accent); font-size: 15px; font-weight: 600; letter-spacing: -.24px; text-align: center; transition: transform 160ms, opacity 160ms; }
.pill.filled { background: var(--accent); color: var(--on-accent); }
.pill:active:not(:disabled) { transform: scale(.95); opacity: .75; }
.text-button { color: var(--accent); font-size: 15px; min-height: 44px; padding: 10px 4px; }
.text-button.center { display: block; width: 100%; text-align: center; margin-top: 8px; }
.icon-button { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--secondary); font-size: 20px; line-height: 1; flex-shrink: 0; }
.primary-link { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 15px; font-weight: 600; transition: transform 160ms, opacity 160ms; }
.primary-link:active { transform: scale(.97); opacity: .85; }
a[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.safari-link { font-size: 13px; letter-spacing: -.08px; }
/* Кнопки, которые собирает shell.js: основная — капсула, вторичная — тонированная. */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.actions > button, .stack > button:not(.pill):not(.row), #selection-body > button, #app-actions-body > button, #app-actions-body .stack > button, #confirmation-actions > button, .empty > button, #catalog-apps > button {
  display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 13px 20px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 17px; font-weight: 600; width: 100%;
  transition: transform 160ms, opacity 160ms;
}
.actions > button.secondary, .stack > button.secondary, #selection-body > button.secondary, #app-actions-body button.secondary, #confirmation-actions > button.secondary, .empty > button.secondary { background: var(--accent-tint); color: var(--accent); }
button.danger, #confirmation-actions > button.danger { background: rgba(255,59,48,.12); color: var(--red); }
.actions > button:active:not(:disabled), .stack > button:active:not(:disabled) { transform: scale(.97); opacity: .85; }

/* --- навигационная панель --- */
.nav-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: calc(52px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); background: transparent; border-bottom: .5px solid transparent; transition: background 200ms, border-color 200ms; }
.scrolled .nav-bar { background: var(--glass); border-bottom-color: var(--separator); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--label); font-size: 17px; font-weight: 600; }
.brand img { border-radius: 7px; }
body[data-view="dashboard"] .brand { visibility: hidden; }
#compact-title { position: absolute; left: 50%; transform: translate(-50%, 4px); bottom: 14px; font-size: 17px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 180ms, transform 180ms; }
.scrolled #compact-title { opacity: 1; transform: translate(-50%, 0); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(160deg, #8e9cff, var(--indigo)); color: #fff; font-size: 14px; font-weight: 600; letter-spacing: 0; flex-shrink: 0; }
.avatar.large { width: 76px; height: 76px; font-size: 30px; }

/* --- онбординг и формы входа --- */
.onboarding { min-height: calc(100dvh - 52px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); display: flex; flex-direction: column; padding: 12px 8px 0; }
#boot-view { align-items: center; justify-content: center; gap: 16px; text-align: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--fill-strong); border-top-color: var(--secondary); animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 28px 8px 8px; }
.hero h1 { font-size: 32px; line-height: 1.15; font-weight: 700; letter-spacing: .3px; max-width: 16ch; text-wrap: balance; }
.hero .lead { max-width: 30ch; }
.hero-icon { border-radius: 22px; box-shadow: 0 10px 30px rgba(0,0,0,.18); margin-bottom: 10px; }
.hero-symbol { display: grid; place-items: center; width: 92px; height: 92px; margin-bottom: 6px; color: var(--accent); }
.hero-symbol svg { width: 84px; height: 84px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.features { list-style: none; padding: 30px 12px 24px; display: flex; flex-direction: column; gap: 22px; }
.features li { display: flex; gap: 16px; align-items: flex-start; }
.features b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.24px; }
.features p { color: var(--secondary); font-size: 15px; letter-spacing: -.24px; line-height: 1.33; margin-top: 2px; }
.symbol { display: grid; place-items: center; width: 38px; flex-shrink: 0; color: var(--accent); }
.symbol svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.symbol.small svg { width: 24px; height: 24px; }
.bottom-actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px 0 calc(16px + env(safe-area-inset-bottom)); position: sticky; bottom: 0; background: linear-gradient(to bottom, transparent, var(--bg) 22%); }
.steps { list-style: none; padding: 0; display: flex; gap: 6px; margin: 4px 0 18px; }
.steps li { flex: 1; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06px; color: var(--tertiary); padding-top: 8px; border-top: 3px solid var(--fill-strong); }
.steps li.current { color: var(--accent); border-top-color: var(--accent); }
.form-view { padding-top: 8px; }
.form-view .large-title { margin-bottom: 6px; }
.form-view > .lead { margin-bottom: 18px; }
.note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 22px; border-radius: var(--radius-group); background: var(--surface); }
.note p { font-size: 15px; letter-spacing: -.24px; line-height: 1.33; color: var(--secondary); }
.group-section { margin: 0 0 22px; }
.stack-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.section-header { padding: 0 16px 7px; font-size: 13px; font-weight: 400; letter-spacing: -.08px; color: var(--secondary); text-transform: uppercase; }
.section-footer { padding: 7px 16px 0; font-size: 13px; letter-spacing: -.08px; line-height: 1.38; color: var(--secondary); }
#apple-form .capsule { margin-top: 22px; }
.trust { margin-top: 26px; }
.trust .status:empty { display: none; }
.status { padding: 12px 16px; border-radius: 16px; background: var(--surface); color: var(--secondary); font-size: 13px; letter-spacing: -.08px; line-height: 1.38; }
.status.error { color: var(--red); font-weight: 600; }
.status.done { color: var(--green); }
.status.attention { color: var(--orange); }
.code-field input { width: 100%; text-align: center; font-size: 34px; font-weight: 600; letter-spacing: .45em; font-variant-numeric: tabular-nums; padding: 14px 0 14px .45em; border: 0; background: transparent; outline: none; }
.code-field input::placeholder { color: var(--tertiary); }
#code-form .capsule { margin-top: 18px; }
.disclosure summary { list-style: none; cursor: pointer; padding: 12px 16px; border-radius: var(--radius-group); background: var(--surface); font-size: 15px; display: flex; justify-content: space-between; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--tertiary); border-bottom: 2px solid var(--tertiary); transform: rotate(45deg) translate(-2px, -2px); align-self: center; transition: transform 180ms; }
.disclosure[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.disclosure ul { padding: 10px 16px 0 34px; color: var(--secondary); font-size: 13px; line-height: 1.7; }
.log { max-height: 240px; overflow: auto; overscroll-behavior: contain; margin-top: 8px; padding: 12px 14px; border-radius: 16px; background: var(--surface); font: 12px/1.65 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--secondary); }
.log time { color: var(--tertiary); margin-right: 8px; }
#job-back { margin-top: 8px; }

/* --- сгруппированные списки --- */
.list { background: var(--surface); border-radius: var(--radius-group); overflow: hidden; }
.row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 11px 16px; text-align: left; font-size: 17px; }
.row + .row::before, .list > .install-row + .install-row::before, .list > .catalog-app + .catalog-app::before { content: ''; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--separator); }
.list.apps > * + *::before { left: 88px !important; }
.row-text { flex: 1; min-width: 0; }
.row-text b { display: block; font-weight: 400; overflow-wrap: anywhere; }
.row-text p { color: var(--secondary); font-size: 13px; letter-spacing: -.08px; margin-top: 2px; overflow-wrap: anywhere; }
.row.link { cursor: pointer; transition: background 120ms; }
.row.link:active { background: var(--fill); }
.row.link::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--tertiary); border-top: 2px solid var(--tertiary); transform: rotate(45deg); margin-left: 4px; flex-shrink: 0; }
.row.action { color: var(--accent); }
.row.destructive { color: var(--red); justify-content: center; }
.row select { border: 0; background: transparent; color: var(--secondary); font-size: 17px; text-align: right; appearance: none; padding: 0 18px 0 0; max-width: 60%; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: right 6px center, right 1px center; background-size: 5px 5px; background-repeat: no-repeat; }
.form-list .field { gap: 16px; }
.field > span { flex: 0 0 82px; }
.field input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 17px; padding: 4px 0; }
.field input::placeholder { color: var(--tertiary); }
.row-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; flex-shrink: 0; }
.row-icon .icon { width: 19px; height: 19px; stroke-width: 1.9; }
.row-icon.gray { background: #8e8e93; }

/* --- вкладки кабинета --- */
.page-heading { padding: 4px 4px 14px; }
.connection { margin: 0 0 14px; padding: 10px 16px; border-radius: 16px; background: var(--surface); color: var(--orange); font-size: 13px; letter-spacing: -.08px; }
.banner { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 18px; border-radius: var(--radius-group); background: var(--surface); }
.banner > div { flex: 1; }
.banner b { font-weight: 600; font-size: 15px; letter-spacing: -.24px; }
.banner p { color: var(--secondary); font-size: 13px; letter-spacing: -.08px; margin-top: 2px; }
.tab-panel { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.tab-panel > .section-footer { margin-top: 2px; }
.group-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 7px; }
.group-heading h2 { font-size: 13px; font-weight: 400; letter-spacing: -.08px; text-transform: uppercase; color: var(--secondary); }
.phone-group { margin-bottom: 22px; }

/* Таб-бар: плавающая стеклянная капсула. */
#navigation { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 2px; padding: 5px; border-radius: 999px; background: var(--glass); border: .5px solid var(--glass-border); box-shadow: var(--glass-shadow); width: min(calc(100% - 32px), 360px); }
#navigation button { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 54px; padding: 6px 4px; border-radius: 999px; color: var(--label); font-size: 10px; font-weight: 600; letter-spacing: .1px; transition: background 200ms, color 200ms; }
#navigation .icon { width: 26px; height: 26px; stroke-width: 1.6; }
#navigation button.selected { background: var(--fill); color: var(--accent); }
#navigation button.selected .icon { stroke-width: 2; }

/* Айфоны. */
.device { display: flex; align-items: center; gap: 14px; }
.device-glyph { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--fill); color: var(--secondary); flex-shrink: 0; }
.device-glyph .icon { width: 26px; height: 26px; }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: -.08px; background: var(--fill); color: var(--secondary); white-space: nowrap; }
.badge.on { background: rgba(52,199,89,.16); color: var(--green); }
.badge.warning { background: rgba(255,149,0,.16); color: var(--orange); }
.badge.danger { background: rgba(255,59,48,.14); color: var(--red); }
.badge.cloud, .badge.update-badge { background: var(--accent-tint); color: var(--accent); }
/* Карточки айфона у коробки (проводной путь). */
.card { background: var(--surface); border-radius: var(--radius-group); padding: 16px; }
.phone { padding: 16px; }
.phone-head { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.phone-head h3 { font-size: 17px; font-weight: 600; }
.device-icon { width: 28px; height: 28px; color: var(--accent); }
.track { list-style: none; display: flex; gap: 4px; margin: 0 0 14px; padding: 0; }
.track li { flex: 1; padding-top: 8px; border-top: 3px solid var(--fill-strong); font-size: 10px; color: var(--tertiary); text-align: center; white-space: nowrap; }
.track li.past { border-top-color: var(--green); }
.track li.now { border-top-color: var(--accent); color: var(--accent); font-weight: 600; }
.track.failed li.now { border-top-color: var(--red); color: var(--red); }
.phone-status { position: relative; }
.phone-status:has(.progress-ring) { padding-right: 70px; min-height: 60px; }
.phone-hint { color: var(--secondary); font-size: 15px; margin-top: 8px; white-space: pre-line; }
.progress-ring { --progress: 0%; position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: conic-gradient(var(--accent) var(--progress), var(--fill-strong) 0); isolation: isolate; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.progress-ring::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); z-index: -1; }
.app-list { list-style: none; padding: 8px 0 0; margin: 12px 0 0; border-top: .5px solid var(--separator); }
.app-list li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 15px; }
.expiry { font-size: 13px; white-space: nowrap; color: var(--secondary); }
.expiry.warning { color: var(--orange); } .expiry.danger { color: var(--red); }

/* Приложения и каталог — как строки App Store. */
.install-row, .catalog-app { position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.app-icon { display: grid; place-items: center; width: 58px; height: 58px; flex: 0 0 58px; border-radius: 14px; object-fit: cover; background: linear-gradient(160deg, hsl(var(--icon-hue, 140), 70%, 55%), hsl(var(--icon-hue, 140), 70%, 42%)); color: #fff; font-size: 26px; font-weight: 600; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.08); }
.row-content { flex: 1; min-width: 0; }
.row-content h3 { font-size: 17px; font-weight: 400; letter-spacing: -.41px; overflow-wrap: anywhere; }
.row-content > p { margin-top: 2px; color: var(--secondary); font-size: 13px; letter-spacing: -.08px; }
.row-content .small:not(.error-text) { color: var(--secondary); }
.install-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
button.app-menu { width: 28px; height: 28px; min-height: 28px; border-radius: 50%; background: var(--fill); color: var(--accent); font-size: 17px; line-height: 1; flex-shrink: 0; padding: 0; display: grid; place-items: center; }
.install-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.install-row .row-content > button, .catalog-app > button { min-width: 84px; min-height: 30px; padding: 6px 15px; border-radius: 999px; background: var(--fill); color: var(--accent); font-size: 15px; font-weight: 600; letter-spacing: -.24px; width: auto; flex-shrink: 0; transition: transform 160ms, opacity 160ms; }
.install-row .row-content > button { margin-top: 10px; }
.install-row .row-content > button:active:not(:disabled), .catalog-app > button:active:not(:disabled) { transform: scale(.95); opacity: .75; }
.ota-status { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--secondary); flex-wrap: wrap; }
.ota-status b { font-weight: 600; color: var(--accent); }
.ota-status b::before { content: ''; display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; border-radius: 50%; border: 2px solid var(--fill-strong); border-top-color: var(--accent); animation: spin 800ms linear infinite; }
.ota-offer { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 10px; }
.ota-offer p { color: var(--secondary); font-size: 13px; letter-spacing: -.08px; }
.ota-offer .primary-link { min-height: 32px; padding: 6px 18px; font-size: 15px; }

/* Поиск — как поле поиска iOS. */
.search { position: relative; display: flex; align-items: center; margin-bottom: 16px; }
.search svg { position: absolute; left: 10px; width: 18px; height: 18px; fill: none; stroke: var(--secondary); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input { width: 100%; height: 38px; padding: 0 12px 0 36px; border: 0; border-radius: 12px; background: var(--fill); font-size: 17px; outline: none; appearance: none; }
.search input::placeholder { color: var(--secondary); }
.sheet .search input { background: var(--fill); }

/* Пусто и загрузка. */
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 24px; text-align: center; background: var(--surface); border-radius: var(--radius-group); }
.empty p { color: var(--secondary); font-size: 15px; letter-spacing: -.24px; max-width: 280px; }
.empty-icon { width: 44px; height: 44px; stroke-width: 1.3; color: var(--tertiary); }
.empty > button { width: auto !important; min-height: 36px !important; padding: 8px 18px !important; font-size: 15px !important; }
.skeleton { height: 76px; border-radius: var(--radius-group); margin-bottom: 12px; background: var(--surface); position: relative; overflow: hidden; }
.skeleton::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, var(--fill) 45%, transparent 70%); background-size: 240% 100%; animation: shimmer 1.6s ease-in-out infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
details > summary { cursor: pointer; }
.card details summary { font-size: 15px; color: var(--accent); padding: 6px 0; }

/* Коробки (проводной путь, показывается, только если они есть у аккаунта). */
.box-head { display: flex; align-items: center; gap: 10px; }
.box-head h3 { flex: 1; font-size: 17px; font-weight: 600; }
.fingerprint { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--fill); }

/* --- всплывающие уведомления --- */
.toast { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; width: calc(100% - 32px); max-width: 480px; padding: 12px 12px 12px 18px; border-radius: 22px; background: var(--glass); border: .5px solid var(--glass-border); box-shadow: var(--glass-shadow); color: var(--label); font-size: 15px; letter-spacing: -.24px; animation: toast-in 240ms cubic-bezier(.2,.9,.3,1.2); }
.toast > span { flex: 1; }
.toast .text-button { font-weight: 600; min-height: 32px; padding: 4px 8px; }
.toast .icon-button { width: 26px; height: 26px; font-size: 18px; }
#update-toast { bottom: auto; top: calc(60px + env(safe-area-inset-top)); }
body:not([data-view="dashboard"]) .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
.sheet .toast { position: sticky; left: auto; bottom: 0; transform: none; width: 100%; margin-top: 16px; }
@keyframes toast-in { from { opacity: 0; translate: 0 16px; scale: .96; } to { opacity: 1; translate: 0 0; scale: 1; } }
.install-card { position: relative; display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; padding: 14px 44px 14px 14px; border-radius: var(--radius-group); background: var(--surface); }
.install-card img { border-radius: 10px; flex-shrink: 0; }
.install-card b { font-size: 15px; font-weight: 600; letter-spacing: -.24px; }
.install-card p { margin-top: 2px; }
.install-card > .icon-button { position: absolute; top: 10px; right: 10px; }

/* --- шторки --- */
body.sheet-open { overflow: hidden; }
.sheet { position: fixed; inset: auto 0 0; margin: auto auto max(8px, env(safe-area-inset-bottom)); width: calc(100% - 16px); max-width: 560px; max-height: calc(92dvh - env(safe-area-inset-top)); padding: 8px 20px calc(22px + env(safe-area-inset-bottom)); border: 0; border-radius: var(--radius-sheet); background: var(--bg); color: var(--label); overflow-y: auto; overscroll-behavior: contain; box-shadow: 0 -2px 40px rgba(0,0,0,.18); }
.sheet[open] { animation: sheet-in 340ms cubic-bezier(.2,.9,.25,1); }
.sheet::backdrop { background: var(--scrim); }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle { width: 100%; height: 16px; position: relative; touch-action: none; }
.sheet-handle::after { content: ''; position: absolute; left: calc(50% - 18px); top: 2px; width: 36px; height: 5px; border-radius: 3px; background: var(--fill-strong); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 16px; touch-action: pan-x; }
.dialog-head h2 { font-size: 22px; font-weight: 700; letter-spacing: .35px; }
#catalog-target { margin: -8px 0 14px; }
#catalog .list.apps { margin-bottom: 8px; }
.alert-sheet { text-align: center; }
.alert-sheet h2 { font-size: 20px; font-weight: 600; margin: 8px 0 8px; }
.alert-sheet #confirmation-message { margin-bottom: 20px; }
#confirmation-actions { gap: 8px; }
.profile-identity { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0 0 24px; text-align: center; }
.profile-identity b { font-size: 22px; font-weight: 700; letter-spacing: .35px; margin-top: 6px; }
#profile .list { margin-bottom: 22px; }
#profile .row-text b { font-weight: 400; }
#profile .group-section { margin-bottom: 22px; }
#jobs .card { background: transparent; border-radius: 0; padding: 0; }
#jobs details { position: relative; }
#jobs summary { padding: 12px 16px; font-size: 15px; list-style: none; }
#jobs summary::-webkit-details-marker { display: none; }
#jobs details p { padding: 0 16px 8px; color: var(--secondary); font-size: 13px; }
#jobs .log { margin: 0 12px 12px; background: var(--bg); }
#jobs > * + *::before { content: ''; position: absolute; left: 16px; right: 0; border-top: .5px solid var(--separator); }
#jobs > * { position: relative; }
.selected-app { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.selected-app h3 { font-size: 17px; font-weight: 600; }
#app-actions-body > p { color: var(--secondary); font-size: 15px; letter-spacing: -.24px; }
#app-actions-body ol { color: var(--secondary); font-size: 15px; padding-left: 22px; line-height: 1.5; }
.team-option { display: flex; flex-direction: column; gap: 4px; }

/* Переключатель как в iOS. */
button.switch { position: relative; width: 51px; height: 31px; flex-shrink: 0; border-radius: 999px; background: var(--fill-strong); transition: background 200ms; }
button.switch::before { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform 220ms cubic-bezier(.3,.9,.3,1.2); }
button.switch[aria-checked="true"] { background: var(--green); }
button.switch[aria-checked="true"]::before { transform: translateX(20px); }

/* Стекло, где браузер умеет размывать. */
@supports ((backdrop-filter: blur(20px)) or (-webkit-backdrop-filter: blur(20px))) {
  .scrolled .nav-bar, #navigation, .toast { backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); }
  .sheet::backdrop { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
}

/* Большой экран: та же раскладка, только по центру и шире. */
@media (min-width: 900px) {
  main { max-width: 760px; }
  .onboarding { min-height: 0; padding-top: 40px; }
  .bottom-actions { position: static; background: none; }
  #navigation { width: 380px; }
  .sheet { margin-bottom: 32px; }
}
@media (max-width: 360px) {
  .large-title, .hero h1 { font-size: 30px; }
  .app-icon { width: 50px; height: 50px; flex-basis: 50px; border-radius: 12px; }
  .list.apps > * + *::before { left: 80px !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.catalog-app .row-content > p.small:not(.muted) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
