:root {
  color-scheme: dark;
  --bg: #07111e;
  --bg-deep: #040a13;
  --surface: rgba(16, 33, 52, .78);
  --surface-strong: #10243a;
  --surface-soft: rgba(24, 47, 72, .58);
  --line: rgba(145, 188, 229, .18);
  --line-strong: rgba(145, 188, 229, .34);
  --text: #f5f8ff;
  --muted: #9eb1c8;
  --cyan: #38e8e0;
  --cyan-soft: rgba(56, 232, 224, .14);
  --violet: #9b72ff;
  --violet-soft: rgba(155, 114, 255, .16);
  --lime: #9af313;
  --lime-soft: rgba(154, 243, 19, .14);
  --orange: #ff8a3d;
  --orange-soft: rgba(255, 138, 61, .15);
  --red: #ff5b7f;
  --red-soft: rgba(255, 91, 127, .14);
  --amber: #ffc44c;
  --amber-soft: rgba(255, 196, 76, .13);
  --shadow: 0 22px 60px rgba(0, 0, 0, .38);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --content-width: 760px;
  font-family: Inter, ui-rounded, "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: light) {
  html[data-theme="auto"] {
    color-scheme: light;
    --bg: #eef5f8;
    --bg-deep: #dfeaf0;
    --surface: rgba(255, 255, 255, .8);
    --surface-strong: #ffffff;
    --surface-soft: rgba(255, 255, 255, .64);
    --line: rgba(14, 57, 83, .12);
    --line-strong: rgba(14, 57, 83, .24);
    --text: #0b1b2b;
    --muted: #536b80;
    --shadow: 0 22px 60px rgba(31, 77, 102, .16);
  }
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef5f8;
  --bg-deep: #dfeaf0;
  --surface: rgba(255, 255, 255, .82);
  --surface-strong: #ffffff;
  --surface-soft: rgba(255, 255, 255, .64);
  --line: rgba(14, 57, 83, .12);
  --line-strong: rgba(14, 57, 83, .24);
  --text: #0b1b2b;
  --muted: #536b80;
  --shadow: 0 22px 60px rgba(31, 77, 102, .16);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-deep); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: radial-gradient(circle at 20% 0%, rgba(27, 165, 180, .12), transparent 34%), radial-gradient(circle at 95% 17%, rgba(139, 80, 255, .12), transparent 28%), linear-gradient(180deg, var(--bg), var(--bg-deep)); color: var(--text); overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
[hidden] { display: none !important; }

.ambient { position: fixed; width: 320px; height: 320px; border-radius: 50%; pointer-events: none; filter: blur(88px); opacity: .13; z-index: 0; }
.ambient-one { background: var(--cyan); top: -180px; left: -120px; }
.ambient-two { background: var(--violet); right: -180px; top: 30%; }
.glass-card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(24px) saturate(130%); backdrop-filter: blur(24px) saturate(130%); }

.auth-view { min-height: 100dvh; display: grid; place-items: center; padding: calc(26px + var(--safe-top)) 18px calc(28px + var(--safe-bottom)); position: relative; z-index: 2; }
.auth-card { width: calc(100vw - 36px); max-width: 460px; min-width: 0; border-radius: 34px; padding: 30px 24px 24px; position: relative; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%; top: -100px; right: -70px; background: radial-gradient(circle, rgba(56, 232, 224, .28), transparent 70%); }
.brand-orbit { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(145deg, #19c8c2, #8167ff); box-shadow: 0 12px 36px rgba(56, 232, 224, .22); margin-bottom: 28px; transform: rotate(-5deg); }
.brand-orbit span { font-size: 30px; line-height: 1; font-weight: 900; transform: rotate(5deg); color: #fff; }
.eyebrow { margin: 0 0 8px; font-size: 11px; line-height: 1.3; letter-spacing: .16em; text-transform: uppercase; font-weight: 800; color: var(--cyan); }
.auth-card h1 { margin: 0; font-size: clamp(32px, 9vw, 47px); line-height: .99; letter-spacing: -.045em; max-width: 390px; overflow-wrap: anywhere; }
.auth-card h1 span { color: var(--muted); font-weight: 650; }
.auth-intro { color: var(--muted); line-height: 1.52; margin: 18px 0 25px; font-size: 15px; }
.auth-form { display: grid; gap: 14px; }
.field { display: grid; gap: 8px; }
.field > span { font-size: 12px; font-weight: 750; color: var(--muted); margin-left: 4px; }
.field input, .field textarea, .field select, .search-box input { width: 100%; min-height: 54px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-soft); color: var(--text); padding: 0 16px; box-shadow: inset 0 1px rgba(255,255,255,.03); }
.field textarea { min-height: 160px; padding-block: 14px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder, .search-box input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.switch-row { min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 10px 4px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-control { width: 46px; height: 28px; flex: 0 0 auto; border-radius: 18px; background: var(--surface-soft); border: 1px solid var(--line-strong); position: relative; transition: .2s ease; }
.switch-control::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: .2s ease; }
.switch-row input:checked + .switch-control { background: var(--cyan-soft); border-color: var(--cyan); }
.switch-row input:checked + .switch-control::after { transform: translateX(18px); background: var(--cyan); box-shadow: 0 0 16px rgba(56,232,224,.7); }
.switch-row > span:last-child { display: grid; gap: 2px; }
.switch-row strong { font-size: 13px; }
.switch-row small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.primary-action, .face-action, .secondary-action, .danger-action { min-height: 56px; border: 0; border-radius: 18px; display: flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer; font-weight: 820; }
.primary-action { width: 100%; padding-inline: 14px; text-align: center; background: linear-gradient(120deg, #38ddd8, #6e73ff 80%); color: #06131f; box-shadow: 0 16px 34px rgba(61, 212, 219, .2); }
.primary-action i { font-style: normal; font-size: 22px; }
.primary-action:active, .face-action:active, .quick-action:active, .bottom-nav button:active { transform: scale(.98); }
.face-action { width: 100%; margin-top: 14px; border: 1px solid var(--line-strong); background: var(--surface-soft); justify-content: flex-start; padding: 8px 16px; text-align: left; }
.face-action > span:last-child { display: grid; gap: 2px; }
.face-action small { color: var(--muted); font-size: 11px; }
.face-symbol { width: 38px; height: 38px; border: 1px solid var(--cyan); border-radius: 12px; display: grid; place-items: center; color: var(--cyan); font-size: 26px; }
.shop-connection-preview { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; font-size: 12px; color: var(--muted); }
.shop-connection-preview i { width: 18px; height: 1px; background: var(--line-strong); }
.shop-dot, .selector-mark { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.shop-dot.encros, .selector-mark.encros { background: var(--orange); box-shadow: 0 0 12px rgba(255,138,61,.55); }
.shop-dot.kittoner, .selector-mark.kittoner { background: var(--lime); box-shadow: 0 0 12px rgba(154,243,19,.48); }
.selector-mark.all { background: linear-gradient(135deg, var(--orange) 0 45%, var(--lime) 55%); box-shadow: 0 0 12px rgba(56,232,224,.35); }
.form-status { min-height: 18px; margin: 13px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.form-status.is-error { color: var(--red); }

.app-shell { width: min(100%, var(--content-width)); margin: 0 auto; min-height: 100dvh; padding-bottom: calc(98px + var(--safe-bottom)); position: relative; z-index: 1; }
.topbar { height: calc(72px + var(--safe-top)); padding: calc(14px + var(--safe-top)) 18px 10px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 15; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 94%, transparent), color-mix(in srgb, var(--bg) 72%, transparent)); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.brand-mini { display: flex; align-items: center; gap: 11px; }
.brand-mini > span { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #19c8c2, #8167ff); font-weight: 900; color: white; box-shadow: 0 8px 22px rgba(56,232,224,.16); }
.brand-mini > div { display: grid; gap: 1px; }
.brand-mini small { font-size: 10px; font-weight: 800; color: var(--cyan); letter-spacing: .13em; text-transform: uppercase; }
.brand-mini strong { font-size: 19px; letter-spacing: -.025em; }
.topbar-actions { display: flex; gap: 9px; }
.icon-button, .avatar-button { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 16px; display: grid; place-items: center; background: var(--surface-soft); cursor: pointer; }
.avatar-button { border-radius: 50%; background: linear-gradient(145deg, rgba(56,232,224,.2), rgba(155,114,255,.22)); color: var(--text); font-weight: 850; }
.connection-state i { width: 9px; height: 9px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 14px rgba(56,232,224,.75); }
.connection-state.is-offline i { background: var(--red); box-shadow: 0 0 14px rgba(255,91,127,.75); }

.shop-selector-wrap { position: sticky; top: calc(72px + var(--safe-top)); z-index: 14; padding: 8px 18px 10px; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.shop-selector { width: 100%; min-height: 58px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); display: flex; align-items: center; gap: 12px; padding: 9px 14px; text-align: left; cursor: pointer; box-shadow: 0 10px 30px rgba(0,0,0,.1); }
.shop-selector .selector-mark { width: 12px; height: 12px; flex: 0 0 auto; }
.shop-selector > span:nth-child(2) { display: grid; gap: 1px; flex: 1; }
.shop-selector small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 750; }
.shop-selector strong { font-size: 14px; }
.shop-selector i { color: var(--muted); font-style: normal; font-size: 20px; }
.shop-menu { position: absolute; left: 18px; right: 18px; top: 74px; border-radius: 20px; padding: 7px; overflow: hidden; }
.shop-menu button { width: 100%; min-height: 58px; border: 0; background: transparent; border-radius: 15px; display: flex; align-items: center; gap: 12px; padding: 8px 12px; text-align: left; cursor: pointer; }
.shop-menu button:hover, .shop-menu button:focus-visible { background: var(--surface-soft); }
.shop-menu button > span:last-child { display: grid; gap: 2px; }
.shop-menu small { color: var(--muted); }

.main-content { padding: 10px 18px 28px; min-height: 60vh; }
.screen-head { margin: 6px 0 20px; }
.screen-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.screen-head h1 { margin: 0; font-size: clamp(30px, 9vw, 46px); letter-spacing: -.045em; line-height: 1; }
.screen-head p { color: var(--muted); margin: 8px 0 0; font-size: 13px; line-height: 1.45; }
.last-sync { font-size: 10px; color: var(--muted); text-align: right; white-space: nowrap; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 2px 12px; }
.section-title h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.section-title span { color: var(--muted); font-size: 11px; }

.metrics-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.metric-card { min-height: 122px; border: 1px solid var(--line); border-radius: 21px; background: var(--surface); padding: 15px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.metric-card.wide { grid-column: 1 / -1; min-height: 104px; }
.metric-card::after { content: ""; position: absolute; width: 82px; height: 82px; border-radius: 50%; right: -30px; top: -32px; background: var(--accent-soft, var(--cyan-soft)); filter: blur(4px); }
.metric-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.metric-label { font-size: 11px; color: var(--muted); font-weight: 720; line-height: 1.3; }
.metric-value { font-size: 29px; line-height: 1; font-weight: 860; letter-spacing: -.045em; }
.metric-note { color: var(--muted); font-size: 10px; line-height: 1.35; }
.metric-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft, var(--cyan-soft)); color: var(--accent, var(--cyan)); font-size: 16px; }

.priority-stack, .card-list { display: grid; gap: 11px; }
.priority-card, .entity-card, .settings-card { border: 1px solid var(--line); border-radius: 22px; background: var(--surface); padding: 16px; position: relative; overflow: hidden; }
.priority-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; cursor: pointer; min-height: 86px; }
.priority-card .priority-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 15px; color: var(--accent); background: var(--accent-soft); font-size: 21px; }
.priority-card h3, .entity-card h3 { margin: 0; font-size: 15px; line-height: 1.25; letter-spacing: -.012em; }
.priority-card p, .entity-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.priority-card > strong { font-size: 22px; color: var(--accent); }
.priority-card[data-priority="urgent"] { --accent: var(--red); --accent-soft: var(--red-soft); }
.priority-card[data-priority="high"] { --accent: var(--amber); --accent-soft: var(--amber-soft); }
.priority-card[data-priority="positive"] { --accent: var(--cyan); --accent-soft: var(--cyan-soft); }

@keyframes priority-breathe {
  0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent), 0 0 10px color-mix(in srgb, var(--accent) 18%, transparent), inset 0 0 0 1px transparent; }
  50% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 88%, transparent), 0 0 27px color-mix(in srgb, var(--accent) 45%, transparent), inset 0 0 20px color-mix(in srgb, var(--accent) 7%, transparent); }
}
.priority-card.is-highlighted, .entity-card.is-highlighted { animation: priority-breathe 2.4s ease-in-out infinite; border-color: color-mix(in srgb, var(--accent) 65%, var(--line)); }

.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.quick-action { min-height: 86px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface-soft); display: grid; align-content: center; justify-items: center; gap: 7px; padding: 9px; cursor: pointer; text-align: center; }
.quick-action span { width: 36px; height: 36px; border-radius: 13px; display: grid; place-items: center; background: var(--cyan-soft); color: var(--cyan); }
.quick-action small { font-size: 10px; font-weight: 750; }

.search-box { display: flex; align-items: center; gap: 9px; margin: 4px 0 13px; }
.search-box input { min-height: 50px; }
.filter-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip, .pill { border-radius: 999px; white-space: nowrap; }
.filter-chip { min-height: 38px; border: 1px solid var(--line); background: var(--surface-soft); padding: 0 13px; cursor: pointer; font-size: 11px; font-weight: 760; }
.filter-chip.is-active { background: var(--cyan-soft); color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 55%, transparent); }
.entity-card { display: grid; gap: 12px; cursor: pointer; }
.entity-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.entity-head > div:first-child { min-width: 0; }
.entity-head h3 { overflow-wrap: anywhere; }
.entity-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.pill { display: inline-flex; align-items: center; min-height: 26px; padding: 4px 9px; border: 1px solid var(--line); font-size: 9px; line-height: 1.2; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.pill.encros { color: var(--orange); background: var(--orange-soft); border-color: rgba(255,138,61,.35); }
.pill.kittoner { color: var(--lime); background: var(--lime-soft); border-color: rgba(154,243,19,.3); }
.pill.success { color: var(--cyan); background: var(--cyan-soft); }
.pill.warning { color: var(--amber); background: var(--amber-soft); }
.pill.danger { color: var(--red); background: var(--red-soft); }
.entity-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.entity-amount { font-size: 18px; font-weight: 850; color: var(--text); }
.empty-state { min-height: 190px; border: 1px dashed var(--line-strong); border-radius: 24px; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }
.empty-state span { display: block; font-size: 30px; margin-bottom: 10px; }
.empty-state strong { color: var(--text); }
.error-card { border: 1px solid rgba(255,91,127,.35); background: var(--red-soft); border-radius: 20px; padding: 15px; color: var(--red); font-size: 12px; line-height: 1.45; }

.settings-card { display: grid; gap: 13px; }
.settings-card h3 { margin: 0; font-size: 16px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 50px; }
.settings-row + .settings-row { border-top: 1px solid var(--line); padding-top: 11px; }
.settings-row > span:first-child { display: grid; gap: 3px; }
.settings-row small { color: var(--muted); }
.status-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--cyan); font-size: 10px; font-weight: 800; }
.status-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }
.status-chip.off { color: var(--red); }
.secondary-action, .danger-action { padding-inline: 16px; border: 1px solid var(--line-strong); background: var(--surface-soft); min-height: 48px; }
.danger-action { color: var(--red); border-color: rgba(255,91,127,.35); background: var(--red-soft); }
.inline-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.inline-actions > * { flex: 1 1 140px; }

.bottom-nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, var(--content-width)); min-height: calc(74px + var(--safe-bottom)); display: grid; grid-template-columns: repeat(5,1fr); padding: 8px 8px calc(8px + var(--safe-bottom)); z-index: 20; background: color-mix(in srgb, var(--bg-deep) 86%, transparent); border-top: 1px solid var(--line); -webkit-backdrop-filter: blur(24px) saturate(140%); backdrop-filter: blur(24px) saturate(140%); }
.bottom-nav button { min-width: 0; min-height: 54px; border: 0; border-radius: 16px; background: transparent; color: var(--muted); display: grid; justify-items: center; align-content: center; gap: 3px; cursor: pointer; position: relative; }
.bottom-nav button.is-active { color: var(--cyan); background: var(--cyan-soft); }
.nav-icon { font-size: 20px; font-weight: 800; line-height: 1; }
.bottom-nav small { font-size: 9px; font-weight: 760; }
.nav-badge { position: absolute; width: 8px; height: 8px; top: 7px; right: calc(50% - 21px); border-radius: 50%; background: var(--red); box-shadow: 0 0 12px rgba(255,91,127,.8); }

.sheet { position: fixed; inset: 0; z-index: 50; visibility: hidden; pointer-events: none; }
.sheet[aria-hidden="false"] { visibility: visible; pointer-events: auto; }
.sheet-scrim { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(1,7,13,.68); opacity: 0; transition: opacity .22s ease; }
.sheet[aria-hidden="false"] .sheet-scrim { opacity: 1; }
.sheet-panel { position: absolute; left: 50%; bottom: 0; width: min(100%, var(--content-width)); max-height: 92dvh; transform: translate(-50%, 102%); transition: transform .32s cubic-bezier(.2,.8,.2,1); border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 30px 30px 0 0; background: color-mix(in srgb, var(--surface-strong) 96%, transparent); box-shadow: 0 -26px 70px rgba(0,0,0,.48); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px); overflow: hidden; padding-bottom: var(--safe-bottom); }
.sheet[aria-hidden="false"] .sheet-panel { transform: translate(-50%, 0); }
.sheet-handle { width: 42px; height: 5px; background: var(--line-strong); border-radius: 4px; margin: 9px auto 5px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 19px 10px; }
.sheet-head h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.sheet-body { padding: 8px 19px 18px; overflow-y: auto; max-height: calc(92dvh - 156px - var(--safe-bottom)); overscroll-behavior: contain; }
.sheet-actions { display: flex; gap: 9px; padding: 11px 19px 15px; border-top: 1px solid var(--line); }
.sheet-actions > * { flex: 1; }
.detail-grid { display: grid; gap: 10px; }
.detail-pair { min-height: 55px; border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; display: grid; gap: 3px; background: var(--surface-soft); }
.detail-pair small { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; font-weight: 750; }
.detail-pair strong { font-size: 13px; overflow-wrap: anywhere; }
.detail-message { white-space: pre-wrap; line-height: 1.55; font-size: 13px; color: color-mix(in srgb, var(--text) 88%, var(--muted)); border-left: 3px solid var(--cyan); padding: 4px 0 4px 13px; }

.toast-region { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(88px + var(--safe-bottom)); width: min(calc(100% - 28px), 500px); z-index: 90; display: grid; gap: 8px; pointer-events: none; }
.toast { border: 1px solid var(--line-strong); border-radius: 17px; background: var(--surface-strong); box-shadow: var(--shadow); padding: 13px 15px; font-size: 12px; animation: toast-in .25s ease both; }
.toast.error { color: var(--red); border-color: rgba(255,91,127,.38); }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
.loading-layer { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; align-content: center; gap: 16px; background: rgba(2,8,14,.76); -webkit-backdrop-filter: blur(13px); backdrop-filter: blur(13px); }
.loading-orbit { width: 72px; height: 72px; border-radius: 24px; border: 1px solid var(--line-strong); display: grid; place-items: center; background: var(--surface); }
.loading-orbit span { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--cyan); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-layer strong { font-size: 12px; color: var(--muted); }
.offline-banner { position: fixed; top: var(--safe-top); left: 50%; transform: translateX(-50%); z-index: 120; width: min(100%, var(--content-width)); padding: 8px 14px; background: var(--red); color: #fff; text-align: center; font-size: 11px; font-weight: 800; }

.skeleton { overflow: hidden; position: relative; background: var(--surface-soft); border-radius: 12px; min-height: 20px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

@media (max-width: 350px) {
  .topbar, .shop-selector-wrap, .main-content { padding-left: 12px; padding-right: 12px; }
  .shop-menu { left: 12px; right: 12px; }
  .auth-card { padding: 25px 18px 20px; }
  .auth-card h1 { font-size: 31px; }
  .metric-card { padding: 12px; min-height: 112px; }
  .quick-action small { font-size: 9px; }
  .bottom-nav small { font-size: 8px; }
}

@media (min-width: 680px) {
  .metrics-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .metric-card.wide { grid-column: span 2; }
  .priority-stack { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .quick-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .priority-card.is-highlighted, .entity-card.is-highlighted { animation: none !important; box-shadow: 0 0 0 2px var(--accent), 0 0 18px color-mix(in srgb, var(--accent) 32%, transparent); }
}

@media (forced-colors: active) {
  .priority-card.is-highlighted, .entity-card.is-highlighted { outline: 3px solid Highlight; }
  .shop-dot, .selector-mark, .connection-state i { forced-color-adjust: none; }
}
