:root {
  color-scheme: dark;
  --bg: #16070b;
  --bg-deep: #050103;
  --surface: #211015;
  --surface-2: #2b151c;
  --surface-3: #3a2028;
  --line: rgba(255, 209, 218, 0.13);
  --text: #fff4f6;
  --muted: #b99ca3;
  --teal: #ff304d;
  --cyan: #ff7183;
  --amber: #ffad42;
  --amber-deep: #e76f1f;
  --red: #ff304d;
  --green: #57e591;
  --accent-2: #ff712e;
  --primary-ink: #200208;
  --glow: rgba(255, 48, 77, .32);
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="inferno"] { --bg: #1b0d05; --bg-deep: #070200; --surface: #29150a; --surface-2: #341c0f; --surface-3: #462718; --line: rgba(255,223,197,.13); --text: #fff6ed; --muted: #c2a28b; --teal: #ff5b22; --cyan: #ff9a3d; --accent-2: #ff2d31; --red: #ff4938; --primary-ink: #211006; --glow: rgba(255, 91, 34, .32); }
:root[data-theme="violet"] { --bg: #11091c; --bg-deep: #030106; --surface: #1c102b; --surface-2: #27163a; --surface-3: #38204f; --line: rgba(237,218,255,.13); --text: #faf3ff; --muted: #b7a3c8; --teal: #a45cff; --cyan: #f05bff; --accent-2: #6557ff; --red: #ff4f9d; --primary-ink: #150724; --glow: rgba(164, 92, 255, .32); }
:root[data-theme="electric"] { --bg: #061521; --bg-deep: #010509; --surface: #0d2233; --surface-2: #142d42; --surface-3: #203f5a; --line: rgba(207,235,255,.13); --text: #f0f8ff; --muted: #9db4c7; --teal: #299fff; --cyan: #4be4ff; --accent-2: #635bff; --red: #ff5470; --primary-ink: #031525; --glow: rgba(41, 159, 255, .32); }
:root[data-theme="cyber"] { --bg: #061a13; --bg-deep: #010805; --surface: #0c281e; --surface-2: #12372a; --surface-3: #1b4c3a; --line: rgba(204,255,235,.13); --text: #effff8; --muted: #96b9ab; --teal: #16e69a; --cyan: #5bffd0; --accent-2: #00a7ff; --red: #ff4968; --primary-ink: #031c13; --glow: rgba(22, 230, 154, .3); }

* { box-sizing: border-box; }
html { background: var(--bg-deep); transition: background-color .45s ease; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 50% -15%, color-mix(in srgb, var(--teal) 23%, #09090b) 0, var(--bg) 34%, var(--bg-deep) 78%); color: var(--text); transition: background .45s ease, color .3s ease; overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.app-shell { width: min(100%, 760px); min-height: 100vh; margin: 0 auto; background: linear-gradient(180deg, rgba(7,16,19,.55), rgba(3,7,8,.9)); position: relative; }
.topbar { height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 8px 18px; position: sticky; top: 0; z-index: 20; background: linear-gradient(180deg, rgba(7,16,19,.98), rgba(7,16,19,.86), transparent); backdrop-filter: blur(10px); }
.brand { background: none; border: 0; display: flex; align-items: center; gap: 10px; padding: 0; text-align: left; cursor: pointer; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #05201c; background: linear-gradient(145deg, var(--teal), #26aab7); box-shadow: 0 9px 30px rgba(80,227,194,.22); }
.brand-mark svg { width: 18px; }
.brand-mark img { position: relative; z-index: 1; width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.brand strong { display: block; font-size: 11px; letter-spacing: .16em; }
.brand small { display: none; }
.connection-pill { border: 1px solid rgba(80,227,194,.22); background: rgba(15,34,36,.85); border-radius: 999px; padding: 7px 10px; display: flex; align-items: center; gap: 7px; font-size: 10px; color: #c8d7d4; cursor: pointer; }
.status-dot { width: 7px; height: 7px; background: var(--amber); border-radius: 50%; box-shadow: 0 0 0 4px rgba(255,193,77,.1); }

main { padding: 0 18px calc(120px + env(safe-area-inset-bottom)); }
.screen { display: none; animation: screen-in .22s ease; }
.screen.is-active { display: block; }
@keyframes screen-in { from { opacity: 0; transform: translateY(5px); } }
.eyebrow { margin: 0 0 8px; color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(28px, 7vw, 42px); letter-spacing: -.045em; line-height: 1.04; }
h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
h3 { margin: 0; }
.hero-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 24px 4px 25px; }
.hero-row > div:first-child { max-width: 500px; }
.hero-copy, .page-title > p, .page-title-row > div > p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 10px 0 0; max-width: 540px; }
.live-orb { width: 70px; height: 70px; flex: 0 0 70px; position: relative; display: grid; place-items: center; color: var(--teal); border: 1px solid rgba(80,227,194,.18); border-radius: 50%; background: radial-gradient(circle, rgba(80,227,194,.14), rgba(80,227,194,.02) 65%); }
.live-orb span { position: absolute; inset: 10px; border: 1px solid rgba(80,227,194,.22); border-radius: inherit; animation: breathe 2.2s infinite; }
.live-orb svg { width: 27px; }
@keyframes breathe { 50% { transform: scale(1.25); opacity: .2; } }
.compact-hero { padding: 10px 2px 12px; }
.compact-hero .eyebrow { margin-bottom: 4px; font-size: 9px; }
.compact-hero h1 { font-size: clamp(22px, 5vw, 29px); }
.compact-hero .live-orb { width: 44px; height: 44px; flex-basis: 44px; }
.compact-hero .live-orb span { inset: 7px; }
.compact-hero .live-orb svg { width: 19px; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 18px; background: rgba(16,27,31,.78); overflow: hidden; box-shadow: var(--shadow); }
.metrics article { padding: 16px 12px; min-width: 0; }
.metrics article + article { border-left: 1px solid var(--line); }
.metrics span, .metrics small { color: var(--muted); font-size: 10px; display: block; }
.metrics strong { display: block; font-size: 25px; margin: 5px 0 2px; color: var(--amber); }
.compact-hero + .metrics { border-radius: 15px; box-shadow: none; }
.compact-hero + .metrics article { padding: 10px 11px; }
.compact-hero + .metrics strong { font-size: 20px; margin: 2px 0 0; }
.compact-hero + .metrics span, .compact-hero + .metrics small { font-size: 9px; }

.login-gate { display: grid; gap: 14px; margin-top: 14px; padding: 17px; border: 1px solid rgba(85,207,255,.18); border-radius: 18px; background: linear-gradient(145deg, rgba(20,43,48,.92), rgba(12,24,28,.92)); }
.login-gate[hidden] { display: none; }
.login-gate strong { font-size: 15px; }
.login-gate p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.login-gate .primary-button { min-height: 46px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 30px 2px 14px; gap: 18px; }
.section-heading.compact-heading { margin-top: 18px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.text-button { border: 0; background: none; color: var(--cyan); display: flex; align-items: center; gap: 6px; padding: 7px 0; font-weight: 750; cursor: pointer; }
.text-button svg { width: 17px; }
.ride-feed { display: grid; gap: 14px; }
.ride-swipe-shell { position: relative; min-width: 0; overflow: hidden; border-radius: var(--radius); background: color-mix(in srgb, var(--surface-2) 82%, #000); }
.swipe-backdrop { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; pointer-events: none; }
.swipe-backdrop span { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 850; letter-spacing: .04em; opacity: .4; transform: scale(.92); transition: opacity .16s ease, transform .16s ease; }
.swipe-backdrop svg { width: 19px; height: 19px; }
.swipe-ignore { color: #ff9ca3; }
.swipe-accept { color: var(--green); }
.ride-swipe-shell:has(.swiping-right) .swipe-ignore, .ride-swipe-shell:has(.swiping-left) .swipe-accept { opacity: 1; transform: scale(1); }
.ride-card { position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid rgba(80,227,194,.16); background: linear-gradient(145deg, rgba(22,41,45,.98), rgba(12,23,26,.98)); box-shadow: var(--shadow); touch-action: pan-y; user-select: none; transform: translateX(var(--swipe-x, 0)); }
.ride-card.is-swiping { transition: none !important; cursor: grabbing; }
.ride-card.is-committing { transition: transform .18s ease, opacity .18s ease !important; opacity: .3; }
.ride-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(var(--teal), var(--cyan)); }
.ride-card.is-accepted::before { background: var(--green); }
.ride-top { display: flex; justify-content: space-between; gap: 14px; padding: 18px 18px 12px 21px; }
.sender { display: flex; align-items: center; gap: 11px; min-width: 0; }
.sender-avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 13px; background: linear-gradient(145deg, #20464a, #153135); display: grid; place-items: center; color: var(--teal); font-weight: 800; }
.sender strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.sender small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }
.new-badge { color: var(--amber); font-size: 9px; font-weight: 850; letter-spacing: .14em; align-self: start; }
.ride-message { margin: 0; padding: 4px 20px 14px; font-size: 19px; font-weight: 680; line-height: 1.42; letter-spacing: -.015em; }
.extracts { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 20px 16px; }
.extract-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 10px; background: rgba(85,207,255,.1); color: #aee8ff; font-size: 11px; }
.extract-chip.money { background: rgba(255,193,77,.1); color: #ffd98c; }
.extract-chip.rule { background: rgba(80,227,194,.1); color: #9df1df; }
.extract-chip svg { width: 13px; height: 13px; }
.ride-actions { display: grid; grid-template-columns: 94px minmax(0, 1fr); gap: 9px; padding: 0 14px 14px; }
.ride-swipe-shell.is-accepted .ride-actions { grid-template-columns: 1fr; }
.ignore-button { min-width: 0; min-height: 69px; border: 1px solid color-mix(in srgb, var(--red) 24%, var(--line)); border-radius: 17px; background: color-mix(in srgb, var(--red) 8%, var(--surface-2)); color: #ff9ca3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 11px; font-weight: 800; cursor: pointer; }
.ignore-button svg { width: 19px; height: 19px; }
.ignore-button:disabled { opacity: .45; cursor: not-allowed; }
.accept-button { width: 100%; border: 0; min-height: 69px; border-radius: 17px; padding: 12px 18px; background: linear-gradient(135deg, #ffc857, #f1a521); color: #18130a; font-weight: 900; letter-spacing: .04em; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 10px 28px rgba(241,165,33,.19); cursor: pointer; }
.accept-button span { display: flex; flex-direction: column; align-items: flex-start; }
.accept-button small { font-weight: 650; opacity: .66; letter-spacing: 0; margin-top: 2px; }
.accept-button svg { width: 23px; }
.ride-card.is-accepted .accept-button { background: #203b33; color: var(--green); box-shadow: none; }
.scope-card { display: flex; gap: 13px; align-items: flex-start; padding: 16px; margin-top: 20px; border: 1px solid var(--line); border-radius: 18px; background: rgba(16,27,31,.6); }
.scope-icon { width: 38px; height: 38px; border-radius: 13px; background: rgba(80,227,194,.1); color: var(--teal); display: grid; place-items: center; flex: 0 0 38px; }
.scope-icon svg { width: 19px; }
.scope-card strong { font-size: 13px; }
.scope-card p { color: var(--muted); font-size: 12px; margin: 5px 0 0; line-height: 1.45; }
.empty-state { text-align: center; padding: 38px 24px; border: 1px dashed rgba(143,164,163,.22); border-radius: var(--radius); background: rgba(16,27,31,.38); }
.empty-state[hidden] { display: none; }
.empty-radar { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; margin: 0 auto 16px; color: var(--muted); background: rgba(143,164,163,.08); }
.empty-state p { color: var(--muted); font-size: 13px; line-height: 1.5; }

.page-title { padding: 24px 3px 23px; }
.page-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.icon-button { width: 46px; height: 46px; border: 0; border-radius: 15px; background: var(--teal); color: #06201c; display: grid; place-items: center; cursor: pointer; flex: 0 0 46px; }
.icon-button.ghost { background: rgba(143,164,163,.08); color: var(--muted); }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; background: rgba(16,27,31,.85); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 16px; }
.segmented button { border: 0; background: transparent; color: var(--muted); border-radius: 10px; padding: 9px 5px; font-size: 11px; cursor: pointer; }
.segmented button.is-active { background: var(--surface-3); color: var(--text); }
.message-list { display: grid; gap: 10px; }
.message-item { padding: 15px; border: 1px solid var(--line); border-radius: 17px; background: rgba(16,27,31,.78); }
.message-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.message-meta span:first-child { color: #bcd0cd; font-weight: 700; }
.message-item p { margin: 10px 0 12px; font-size: 14px; line-height: 1.48; }
.message-bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.message-status { display: inline-flex; border-radius: 999px; padding: 5px 8px; background: rgba(143,164,163,.1); color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.message-status.matched { background: rgba(80,227,194,.1); color: var(--teal); }
.message-status.accepted { background: rgba(104,229,154,.11); color: var(--green); }
.message-status.ignored { background: rgba(255,107,116,.09); color: #ff9ca3; }
.message-bottom small { color: var(--muted); font-size: 10px; }

.logic-note { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid rgba(85,207,255,.14); border-radius: 16px; background: rgba(85,207,255,.055); }
.logic-note span { flex: 0 0 auto; border-radius: 8px; padding: 5px 7px; background: rgba(85,207,255,.13); color: var(--cyan); font-weight: 900; font-size: 10px; letter-spacing: .08em; }
.logic-note p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.rules-list, .groups-list { display: grid; gap: 10px; margin-top: 14px; }
.rule-card { position: relative; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: rgba(16,27,31,.78); cursor: pointer; }
.rule-card.is-off { opacity: .57; }
.rule-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rule-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rule-symbol { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 12px; background: rgba(80,227,194,.1); color: var(--teal); font-weight: 900; }
.rule-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rule-summary { margin: 11px 0 0 46px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.mini-toggle { position: relative; width: 44px; height: 25px; flex: 0 0 44px; }
.mini-toggle input { position: absolute; opacity: 0; }
.mini-toggle i { position: absolute; inset: 0; border-radius: 99px; background: #304044; transition: .2s; }
.mini-toggle i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 19px; height: 19px; border-radius: 50%; background: #c6d0ce; transition: .2s; }
.mini-toggle input:checked + i { background: var(--teal); }
.mini-toggle input:checked + i::after { transform: translateX(19px); background: #06322a; }
.count-badge { border-radius: 99px; padding: 5px 9px; background: rgba(80,227,194,.1); color: var(--teal); font-size: 11px; }
.group-row { display: flex; align-items: flex-start; gap: 12px; width: 100%; min-width: 0; overflow: hidden; padding: 13px; border-radius: 17px; border: 1px solid var(--line); background: rgba(16,27,31,.65); }
.group-avatar { width: 39px; height: 39px; border-radius: 13px; background: linear-gradient(145deg, #1b4d52, #173034); color: var(--teal); display: grid; place-items: center; font-weight: 900; flex: 0 0 39px; }
.group-row > span:nth-child(2) { min-width: 0; flex: 1; }
.group-row strong { display: block; min-width: 0; white-space: normal; overflow-wrap: anywhere; word-break: break-word; font-size: 13px; line-height: 1.4; }
.group-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.group-row .mini-toggle { margin-top: 7px; flex-shrink: 0; }
.groups-list { min-width: 0; overflow: hidden; }
.groups-list > .empty-state { grid-column: 1 / -1; }
.group-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-bottom: 14px; }
.group-search { min-width: 0; min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--bg-deep) 65%, var(--surface)); color: var(--muted); transition: border-color .2s ease, box-shadow .2s ease; }
.group-search:focus-within { border-color: color-mix(in srgb, var(--teal) 58%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 10%, transparent); }
.group-search svg { width: 20px; height: 20px; flex: 0 0 20px; color: var(--cyan); }
.group-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); padding: 0; font-size: 13px; }
.group-search input::placeholder { color: var(--muted); }
.group-bulk-button { min-height: 48px; border: 1px solid color-mix(in srgb, var(--teal) 23%, var(--line)); border-radius: 16px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: color-mix(in srgb, var(--teal) 9%, var(--surface)); color: var(--cyan); font-size: 12px; font-weight: 800; cursor: pointer; transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.group-bulk-button svg { width: 19px; height: 19px; }
.group-bulk-button.is-clear { color: #ff9ca3; border-color: color-mix(in srgb, var(--red) 24%, var(--line)); background: color-mix(in srgb, var(--red) 8%, var(--surface)); }
.group-bulk-button:disabled { opacity: .45; cursor: not-allowed; }
.group-search-empty { grid-column: 1 / -1; }

.settings-section { padding: 18px; border-radius: 20px; border: 1px solid var(--line); background: rgba(16,27,31,.8); margin-bottom: 14px; }
.settings-section h2 { font-size: 15px; margin-bottom: 17px; }
.field-label { display: block; color: #cbd9d7; font-size: 12px; font-weight: 700; margin: 16px 0 7px; }
.field-label:first-of-type { margin-top: 0; }
.field-label small { color: var(--muted); font-weight: 500; }
.text-input, textarea, .input-with-count, .select-wrap { width: 100%; border: 1px solid var(--line); border-radius: 14px; background: #0c171a; color: var(--text); }
.text-input, textarea, select, .input-with-count input { border: 0; outline: 0; color: var(--text); background: transparent; width: 100%; padding: 13px; }
textarea { resize: vertical; line-height: 1.45; }
.input-with-count { display: flex; align-items: center; padding-right: 12px; }
.input-with-count input { min-width: 0; }
.input-with-count span { color: var(--muted); font-size: 10px; flex: 0 0 auto; }
.field-help { color: var(--muted); margin: 7px 2px 0; font-size: 10px; line-height: 1.45; }
.select-wrap { display: flex; align-items: center; padding-right: 12px; }
.select-wrap select { appearance: none; cursor: pointer; }
.select-wrap svg { width: 15px; transform: rotate(90deg); color: var(--muted); }
.toggle-row { display: flex; align-items: center; gap: 12px; position: relative; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.toggle-row:nth-of-type(1) { border-top: 0; }
.setting-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 13px; }
.setting-icon svg { width: 18px; }
.setting-icon.cyan { color: var(--cyan); background: rgba(85,207,255,.1); }
.setting-icon.amber { color: var(--amber); background: rgba(255,193,77,.1); }
.setting-icon.green { color: var(--green); background: rgba(104,229,154,.1); }
.toggle-row > span:nth-child(2) { min-width: 0; flex: 1; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 13px; }
.toggle-row small { color: var(--muted); font-size: 10px; margin-top: 4px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { width: 46px; height: 27px; flex: 0 0 46px; border-radius: 99px; background: #304044; position: relative; transition: .2s; }
.toggle-row i::after { content: ""; position: absolute; width: 21px; height: 21px; border-radius: 50%; background: #d3dcda; left: 3px; top: 3px; transition: .2s; }
.toggle-row input:checked + i { background: var(--teal); }
.toggle-row input:checked + i::after { transform: translateX(19px); background: #06322a; }
.danger-link { width: 100%; border: 1px solid rgba(255,107,116,.16); background: rgba(255,107,116,.05); border-radius: 16px; padding: 14px; color: #ff9ca3; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; }
.danger-link svg { width: 17px; }

.settings-menu { display: grid; gap: 10px; margin-bottom: 16px; }
.settings-tile { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 18px; padding: 13px 14px; background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--teal) 4%, var(--surface))); color: var(--text); display: grid; grid-template-columns: 42px minmax(0,1fr) 18px; gap: 12px; align-items: center; text-align: left; cursor: pointer; transition: transform .2s ease, border-color .25s ease, box-shadow .25s ease; }
.settings-tile > span:nth-child(2) { min-width: 0; }
.settings-tile strong, .settings-tile small { display: block; overflow-wrap: anywhere; }
.settings-tile strong { font-size: 14px; }
.settings-tile small { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.settings-tile-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: var(--cyan); background: color-mix(in srgb, var(--teal) 12%, transparent); }
.settings-tile-icon svg { width: 20px; height: 20px; }
.settings-tile.premium { border-color: color-mix(in srgb, var(--amber) 20%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--amber) 8%, var(--surface)), color-mix(in srgb, var(--teal) 5%, var(--surface))); }
.settings-tile.premium .settings-tile-icon { color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); }
.tile-arrow { width: 17px; height: 17px; color: var(--muted); }
.back-button { border: 0; background: transparent; color: var(--cyan); display: inline-flex; align-items: center; gap: 4px; margin: 15px 0 -8px; padding: 8px 0; font-size: 12px; font-weight: 750; cursor: pointer; }
.back-button svg { width: 17px; height: 17px; transform: rotate(180deg); }
.swipe-guide { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 550; }

.account-hero { display: flex; align-items: center; gap: 16px; padding: 25px 3px; }
.account-avatar { width: 66px; height: 66px; flex: 0 0 66px; display: grid; place-items: center; border-radius: 22px; background: linear-gradient(145deg, #17484b, #11282b); color: var(--teal); }
.account-avatar svg { width: 30px; height: 30px; }
.account-hero h1 { font-size: 27px; }
.mode-badge { display: inline-flex; align-items: center; gap: 7px; margin-top: 8px; color: var(--muted); font-size: 10px; }
.mode-badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.mode-badge.is-connected { color: var(--green); }
.mode-badge.is-connected span { background: var(--green); box-shadow: 0 0 0 4px rgba(104,229,154,.1); }
.connection-pill.is-connected { border-color: rgba(104,229,154,.25); color: var(--green); }
.connection-pill.is-connected .status-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(104,229,154,.1); }
.runtime-card { display: grid; gap: 14px; }
.runtime-card .primary-button[hidden] { display: none; }
.access-card { display: grid; gap: 14px; border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); }
.access-card .primary-button { text-decoration: none; }
.access-card .primary-button[hidden] { display: none; }
.runtime-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.runtime-heading h2 { margin-bottom: 5px; }
.runtime-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.runtime-led { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; margin-top: 4px; background: #405156; box-shadow: 0 0 0 5px rgba(143,164,163,.06); }
.runtime-led.is-waiting { background: var(--amber); box-shadow: 0 0 0 5px rgba(255,193,77,.08); }
.runtime-led.is-connected { background: var(--green); box-shadow: 0 0 0 5px rgba(104,229,154,.09); }
.runtime-led.is-error { background: var(--red); box-shadow: 0 0 0 5px rgba(255,107,116,.08); }
.architecture-card { padding: 17px; border-radius: 20px; border: 1px solid var(--line); background: rgba(16,27,31,.82); }
.arch-top { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.arch-top.muted { opacity: .6; }
.arch-number { color: var(--teal); font: 800 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.arch-top strong { display: block; font-size: 13px; }
.arch-top p { color: var(--muted); margin: 3px 0 0; font-size: 10px; }
.arch-status { color: var(--muted); font-size: 9px; border: 1px solid var(--line); padding: 5px 7px; border-radius: 99px; }
.arch-status.ready { color: var(--green); border-color: rgba(104,229,154,.2); background: rgba(104,229,154,.07); }
.arch-line { height: 22px; border-left: 1px dashed rgba(80,227,194,.2); margin-left: 13px; }
.warning-card { display: flex; align-items: flex-start; gap: 12px; border: 1px solid rgba(255,193,77,.18); border-radius: 18px; background: rgba(255,193,77,.07); padding: 16px; margin: 14px 0; }
.warning-card > span { width: 27px; height: 27px; flex: 0 0 27px; border-radius: 9px; background: rgba(255,193,77,.16); color: var(--amber); display: grid; place-items: center; font-weight: 900; }
.warning-card strong { font-size: 13px; }
.warning-card p { color: #b8a782; margin: 6px 0 0; font-size: 11px; line-height: 1.5; }
.settings-section.compact { margin-bottom: 0; }
.steps-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.steps-list li { display: flex; align-items: flex-start; gap: 10px; }
.steps-list span { width: 23px; height: 23px; flex: 0 0 23px; border-radius: 8px; display: grid; place-items: center; background: rgba(80,227,194,.1); color: var(--teal); font-size: 10px; font-weight: 900; }
.steps-list p { margin: 2px 0 0; color: #c8d5d3; font-size: 11px; line-height: 1.4; }

.bottom-nav { position: fixed; z-index: 30; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(calc(100% - 24px), 720px); min-height: 72px; padding: 7px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid rgba(217,239,237,.13); border-radius: 24px; background: rgba(15,25,28,.93); box-shadow: 0 18px 50px rgba(0,0,0,.5); backdrop-filter: blur(20px); }
.bottom-nav button { min-width: 0; border: 0; background: transparent; color: #849795; border-radius: 17px; padding: 7px 2px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.bottom-nav button.is-active { color: var(--teal); background: rgba(80,227,194,.1); }
.bottom-nav svg { width: 21px; height: 21px; }
.bottom-nav span { font-size: 9px; font-weight: 700; white-space: nowrap; }

.sheet-dialog { width: min(calc(100% - 18px), 600px); max-height: min(90vh, 820px); margin: auto auto max(8px, env(safe-area-inset-bottom)); padding: 0; border: 1px solid rgba(217,239,237,.12); border-radius: 26px; background: #101b1f; color: var(--text); box-shadow: 0 -20px 80px rgba(0,0,0,.62); overflow: auto; }
.sheet-dialog::backdrop { background: rgba(0,0,0,.7); backdrop-filter: blur(5px); }
.sheet-dialog form { padding: 10px 18px 20px; }
.settings-dialog-content { padding: 10px 18px 22px; }
.settings-detail-dialog { width: min(calc(100% - 18px), 620px); }
.settings-filters-dialog { max-height: min(94vh, 900px); }
.settings-dialog-action { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 8px 0 14px; }
.settings-dialog-action p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.premium-dialog-content { text-align: center; }
.premium-dialog-content .dialog-title { text-align: left; }
.premium-mark { width: 72px; height: 72px; margin: 20px auto 14px; border-radius: 24px; display: grid; place-items: center; color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); box-shadow: 0 0 40px color-mix(in srgb, var(--amber) 12%, transparent); }
.premium-mark svg { width: 34px; height: 34px; }
.premium-dialog-content > p { color: var(--muted); margin: 8px auto 18px; max-width: 420px; font-size: 12px; line-height: 1.5; }
.premium-dialog-content .primary-button { text-decoration: none; }
.premium-dialog-content .primary-button[hidden] { display: none; }
.login-dialog { width: min(calc(100% - 24px), 430px); margin: auto; }
.login-dialog-content { padding: 10px 18px 20px; text-align: center; }
.login-dialog .dialog-title { text-align: left; }
.login-qr-stage { min-height: 260px; display: grid; place-items: center; margin: 16px 0; border-radius: 20px; background: #f4fbfa; overflow: hidden; }
.login-qr-stage img { width: min(245px, 78vw); height: min(245px, 78vw); display: block; object-fit: contain; }
.login-qr-stage img[hidden] { display: none; }
.login-spinner { width: 74px; height: 74px; display: grid; place-items: center; border-radius: 50%; color: var(--teal); background: rgba(80,227,194,.1); animation: breathe 1.2s infinite; }
.login-spinner[hidden] { display: none; }
.login-spinner svg { width: 32px; height: 32px; }
.login-dialog h3 { font-size: 18px; }
.login-dialog-status, #loginDialogStatus { margin: 7px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.login-retry { width: 100%; }
.login-retry[hidden] { display: none; }
.login-security { margin: 14px 0 0; color: #b8a782; font-size: 10px; line-height: 1.45; }
.dialog-handle { width: 42px; height: 4px; border-radius: 99px; background: rgba(143,164,163,.3); margin: 0 auto 16px; }
.dialog-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.dialog-title h2 { font-size: 24px; }
.example-chips { display: flex; gap: 7px; overflow-x: auto; margin: 10px 0 18px; padding-bottom: 4px; }
.example-chips button { white-space: nowrap; border: 1px solid var(--line); background: rgba(143,164,163,.07); color: var(--muted); border-radius: 99px; padding: 7px 9px; font-size: 10px; cursor: pointer; }
.primary-button, .secondary-button { border: 0; min-height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; font-weight: 800; cursor: pointer; }
.primary-button { width: 100%; background: var(--teal); color: #06231e; }
.primary-button svg, .secondary-button svg { width: 18px; }
.secondary-button { background: #24373d; color: #dce6e4; }
.dialog-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; margin-top: 18px; }
.dialog-actions .secondary-button[hidden] { display: none; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.toast-region { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(97px + env(safe-area-inset-bottom)); width: min(calc(100% - 32px), 500px); display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 13px 15px; border-radius: 15px; border: 1px solid var(--line); background: rgba(27,44,49,.96); box-shadow: var(--shadow); color: #e6efed; font-size: 12px; animation: toast-in .2s ease; }
.toast.success { border-color: rgba(80,227,194,.2); }
.toast.warning { border-color: rgba(255,193,77,.2); }
.runtime-error { position: fixed; z-index: 100; left: 12px; right: 12px; top: 12px; padding: 12px 14px; border-radius: 14px; background: #5d1820; color: #fff; font-size: 12px; box-shadow: var(--shadow); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Animated color system */
body::before, body::after { content: ""; position: fixed; z-index: 0; width: 48vw; height: 48vw; border-radius: 50%; pointer-events: none; filter: blur(85px); opacity: .12; }
body::before { left: -18vw; top: 8vh; background: var(--teal); animation: ambient-one 13s ease-in-out infinite alternate; }
body::after { right: -20vw; bottom: 8vh; background: var(--accent-2); animation: ambient-two 16s ease-in-out infinite alternate; }
.app-shell { z-index: 1; isolation: isolate; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 82%, transparent), color-mix(in srgb, var(--bg-deep) 94%, transparent)); transition: background .45s ease, border-color .45s ease; }
.app-shell::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .28; background-image: linear-gradient(color-mix(in srgb, var(--teal) 7%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--teal) 7%, transparent) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, #000, transparent 62%); }
.topbar { border-bottom: 1px solid color-mix(in srgb, var(--teal) 12%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--bg-deep) 96%, transparent), color-mix(in srgb, var(--bg) 82%, transparent), transparent); box-shadow: 0 14px 36px rgba(0,0,0,.2); }
.brand-mark { position: relative; overflow: hidden; color: white; background: linear-gradient(145deg, var(--cyan), var(--teal) 46%, var(--accent-2)); background-size: 180% 180%; box-shadow: 0 10px 32px var(--glow), inset 0 1px 0 rgba(255,255,255,.32); animation: gradient-flow 5s ease infinite, logo-breathe 2.8s ease-in-out infinite; }
.brand-mark::after { content: ""; position: absolute; inset: -45%; background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.42) 50%, transparent 62%); transform: translateX(-70%) rotate(8deg); animation: shine-sweep 4.6s ease-in-out infinite; }
.brand-mark svg { position: relative; z-index: 1; }
.connection-pill { border-color: color-mix(in srgb, var(--teal) 28%, transparent); background: color-mix(in srgb, var(--surface) 88%, transparent); color: color-mix(in srgb, var(--text) 78%, var(--teal)); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 8px 24px rgba(0,0,0,.22); transition: border-color .3s ease, color .3s ease, transform .2s ease, background .3s ease; }
.status-dot { background: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 12%, transparent), 0 0 18px var(--glow); animation: status-pulse 1.8s ease-in-out infinite; }
.screen.is-active { animation: screen-in .38s cubic-bezier(.2,.8,.2,1); }
.screen.is-active > .page-title, .screen.is-active > .compact-hero, .screen.is-active > .account-hero { animation: title-rise .5s cubic-bezier(.2,.8,.2,1) both; }
.compact-hero h1, .page-title h1, .account-hero h1 { color: transparent; background: linear-gradient(100deg, var(--text) 12%, color-mix(in srgb, var(--text) 86%, var(--teal)) 47%, var(--teal) 100%); background-clip: text; -webkit-background-clip: text; }
.eyebrow { color: var(--teal); text-shadow: 0 0 22px var(--glow); }
.live-orb { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 32%, transparent); background: radial-gradient(circle, color-mix(in srgb, var(--teal) 21%, transparent), color-mix(in srgb, var(--teal) 3%, transparent) 65%); box-shadow: inset 0 0 20px color-mix(in srgb, var(--teal) 10%, transparent), 0 0 28px color-mix(in srgb, var(--teal) 13%, transparent); }
.live-orb::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: conic-gradient(transparent 0 54%, var(--teal) 72%, var(--cyan) 86%, transparent); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: orb-spin 3.6s linear infinite; }
.live-orb span { border-color: color-mix(in srgb, var(--teal) 35%, transparent); animation: radar-ping 2s ease-out infinite; }
.live-orb svg { filter: drop-shadow(0 0 9px var(--teal)); animation: radar-icon 2.2s ease-in-out infinite; }
.metrics { border-color: color-mix(in srgb, var(--teal) 17%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 91%, transparent), color-mix(in srgb, var(--teal) 6%, var(--surface))); box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 16px 45px rgba(0,0,0,.24); }
.metrics article { position: relative; overflow: hidden; transition: background .3s ease; }
.metrics article::after { content: ""; position: absolute; inset: auto 12px 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--teal), transparent); opacity: .45; transform: scaleX(.25); animation: metric-line 3.4s ease-in-out infinite; }
.metrics article:nth-child(2)::after { animation-delay: .45s; }
.metrics article:nth-child(3)::after { animation-delay: .9s; }
.metrics strong { color: var(--cyan); text-shadow: 0 0 22px var(--glow); animation: metric-pop .55s cubic-bezier(.2,.9,.2,1) both; }
.login-gate, .settings-section, .architecture-card, .logic-note, .message-item, .rule-card, .group-row, .empty-state { border-color: color-mix(in srgb, var(--teal) 14%, var(--line)); background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--teal) 4%, var(--surface))); transition: border-color .3s ease, transform .25s ease, box-shadow .3s ease, background .45s ease; }
.login-gate { position: relative; overflow: hidden; box-shadow: 0 18px 52px rgba(0,0,0,.28); animation: card-rise .5s .12s cubic-bezier(.2,.8,.2,1) both; }
.login-gate::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(var(--cyan), var(--teal), var(--accent-2)); box-shadow: 0 0 22px var(--glow); }
.ride-card { border-color: color-mix(in srgb, var(--teal) 22%, transparent); background: linear-gradient(145deg, color-mix(in srgb, var(--surface-2) 96%, transparent), color-mix(in srgb, var(--teal) 5%, var(--surface))); box-shadow: 0 22px 64px rgba(0,0,0,.36), inset 0 1px 0 rgba(255,255,255,.035); animation: card-rise .48s cubic-bezier(.2,.8,.2,1) both; transition: transform .25s ease, border-color .3s ease, box-shadow .3s ease; }
.ride-card::before { background: linear-gradient(var(--cyan), var(--teal), var(--accent-2)); box-shadow: 0 0 26px var(--glow); }
.ride-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -110px; top: -115px; border-radius: 50%; background: var(--teal); filter: blur(62px); opacity: .1; pointer-events: none; }
.ride-feed .ride-swipe-shell:nth-child(2) .ride-card { animation-delay: .07s; }
.ride-feed .ride-swipe-shell:nth-child(3) .ride-card { animation-delay: .14s; }
.ride-feed .ride-swipe-shell:first-child .ride-card:not(.is-accepted) { animation: card-rise .48s cubic-bezier(.2,.8,.2,1) both, new-ride-glow 2.4s ease-in-out 2; }
.sender-avatar, .group-avatar, .account-avatar { background: linear-gradient(145deg, color-mix(in srgb, var(--teal) 24%, var(--surface-2)), color-mix(in srgb, var(--accent-2) 10%, var(--surface))); color: var(--cyan); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
.extract-chip { background: color-mix(in srgb, var(--cyan) 12%, transparent); color: color-mix(in srgb, var(--cyan) 72%, white); }
.extract-chip.money { background: color-mix(in srgb, var(--amber) 12%, transparent); color: color-mix(in srgb, var(--amber) 74%, white); }
.extract-chip.rule { background: color-mix(in srgb, var(--teal) 12%, transparent); color: color-mix(in srgb, var(--teal) 70%, white); }
.accept-button, .primary-button { position: relative; overflow: hidden; isolation: isolate; background: linear-gradient(115deg, var(--teal), var(--accent-2), var(--cyan), var(--teal)); background-size: 260% 100%; color: white; text-shadow: 0 1px 1px rgba(0,0,0,.25); box-shadow: 0 12px 34px var(--glow), inset 0 1px 0 rgba(255,255,255,.32); animation: gradient-flow 6s ease infinite; transition: transform .18s ease, box-shadow .25s ease, filter .25s ease; }
.accept-button::before, .primary-button::before { content: ""; position: absolute; z-index: -1; inset: -40% -25%; background: linear-gradient(115deg, transparent 36%, rgba(255,255,255,.28) 49%, transparent 62%); transform: translateX(-70%); animation: shine-sweep 3.8s ease-in-out infinite; }
.accept-button:disabled, .primary-button:disabled { opacity: .48; cursor: not-allowed; animation: none; filter: saturate(.55); box-shadow: none; }
.accept-button:disabled::before, .primary-button:disabled::before { animation: none; }
.ride-card.is-accepted .accept-button { background: color-mix(in srgb, var(--green) 14%, var(--surface-2)); color: var(--green); }
.accept-button.is-locked { background: linear-gradient(115deg, #55101a, #9f1428, #e04455, #55101a); box-shadow: 0 12px 34px rgba(225, 40, 67, .24), inset 0 1px 0 rgba(255,255,255,.22); }
.accept-button.is-locked svg { filter: drop-shadow(0 0 8px rgba(255,255,255,.28)); }
.icon-button { color: white; background: linear-gradient(145deg, var(--cyan), var(--teal), var(--accent-2)); box-shadow: 0 10px 28px var(--glow); transition: transform .2s ease, box-shadow .2s ease; }
.rule-symbol, .scope-icon, .steps-list span { background: color-mix(in srgb, var(--teal) 12%, transparent); color: var(--teal); }
.mini-toggle input:checked + i, .toggle-row input:checked + i { background: linear-gradient(90deg, var(--teal), var(--cyan)); box-shadow: 0 0 20px color-mix(in srgb, var(--teal) 24%, transparent); }
.mini-toggle input:checked + i::after, .toggle-row input:checked + i::after { background: white; }
.text-input, textarea, .input-with-count, .select-wrap { background: color-mix(in srgb, var(--bg-deep) 70%, var(--surface)); transition: border-color .25s ease, box-shadow .25s ease; }
.text-input:focus, textarea:focus, .input-with-count:focus-within, .select-wrap:focus-within { border-color: color-mix(in srgb, var(--teal) 58%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 10%, transparent), 0 0 28px color-mix(in srgb, var(--teal) 10%, transparent); }
.bottom-nav { border-color: color-mix(in srgb, var(--teal) 16%, var(--line)); background: color-mix(in srgb, var(--bg) 91%, transparent); box-shadow: 0 20px 58px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.04); }
.bottom-nav button { transition: color .25s ease, background .3s ease, transform .2s ease; }
.bottom-nav button.is-active { color: var(--cyan); background: linear-gradient(145deg, color-mix(in srgb, var(--teal) 18%, transparent), color-mix(in srgb, var(--accent-2) 8%, transparent)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 13%, transparent), 0 8px 26px color-mix(in srgb, var(--teal) 10%, transparent); }
.bottom-nav button.is-active svg { filter: drop-shadow(0 0 7px var(--teal)); animation: nav-icon 2.1s ease-in-out infinite; }
.sheet-dialog { border-color: color-mix(in srgb, var(--teal) 18%, var(--line)); background: linear-gradient(165deg, color-mix(in srgb, var(--surface-2) 96%, #000), var(--bg)); }
.sheet-dialog[open] { animation: dialog-in .38s cubic-bezier(.2,.85,.2,1) both; }
.sheet-dialog::backdrop { background: rgba(0,0,0,.78); animation: backdrop-in .3s ease both; }
.login-spinner { color: var(--teal); background: color-mix(in srgb, var(--teal) 12%, transparent); box-shadow: 0 0 34px var(--glow); }
.toast { border-color: color-mix(in srgb, var(--teal) 20%, var(--line)); background: color-mix(in srgb, var(--surface-2) 96%, transparent); animation: toast-in .34s cubic-bezier(.2,.85,.2,1), toast-glow 2.8s ease-in-out infinite; }
.toast.success { border-color: color-mix(in srgb, var(--teal) 36%, transparent); }

/* Theme picker */
.theme-section { overflow: hidden; }
.theme-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.theme-heading h2 { margin: 0; }
.theme-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.theme-heading .eyebrow { margin-bottom: 4px; }
.theme-heading > span { flex: 0 0 auto; padding: 6px 9px; border: 1px solid color-mix(in srgb, var(--teal) 28%, transparent); border-radius: 99px; color: var(--cyan); background: color-mix(in srgb, var(--teal) 9%, transparent); font-size: 12px; font-weight: 750; }
.theme-picker { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.theme-choice { min-width: 0; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 15px; padding: 10px; background: color-mix(in srgb, var(--bg-deep) 58%, var(--surface)); text-align: left; cursor: pointer; transition: transform .22s ease, border-color .28s ease, background .28s ease, box-shadow .28s ease; }
.theme-choice:last-child { grid-column: 1 / -1; }
.theme-choice.is-active { border-color: color-mix(in srgb, var(--teal) 62%, transparent); background: color-mix(in srgb, var(--teal) 10%, var(--surface)); box-shadow: 0 10px 30px color-mix(in srgb, var(--teal) 12%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--teal) 9%, transparent); }
.theme-choice[data-theme-choice="crimson"] { background: linear-gradient(145deg, #2b151c, #100407); }
.theme-choice[data-theme-choice="inferno"] { background: linear-gradient(145deg, #341c0f, #130701); }
.theme-choice[data-theme-choice="violet"] { background: linear-gradient(145deg, #27163a, #0b0412); }
.theme-choice[data-theme-choice="electric"] { background: linear-gradient(145deg, #142d42, #03101a); }
.theme-choice[data-theme-choice="cyber"] { background: linear-gradient(145deg, #12372a, #03120d); }
.theme-choice.is-active { background-size: 140% 140%; animation: gradient-flow 4.5s ease infinite; }
.theme-choice > span:last-child { min-width: 0; }
.theme-choice strong, .theme-choice small { display: block; }
.theme-choice strong { font-size: 14px; }
.theme-choice small { margin-top: 2px; color: var(--muted); font-size: 12px; }
.theme-swatch { width: 42px; height: 34px; flex: 0 0 42px; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 5px; border-radius: 11px; background: #070709; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.theme-swatch i { width: 8px; height: 24px; border-radius: 99px; transform: scaleY(.72); transition: transform .25s ease; }
.theme-choice.is-active .theme-swatch i { transform: scaleY(1); animation: swatch-wave 1.8s ease-in-out infinite alternate; }
.theme-choice.is-active .theme-swatch i:nth-child(2) { animation-delay: .16s; }
.theme-choice.is-active .theme-swatch i:nth-child(3) { animation-delay: .32s; }
.theme-swatch.crimson i:nth-child(1) { background: #ff304d; } .theme-swatch.crimson i:nth-child(2) { background: #ff7183; } .theme-swatch.crimson i:nth-child(3) { background: #ffad42; }
.theme-swatch.inferno i:nth-child(1) { background: #ff5b22; } .theme-swatch.inferno i:nth-child(2) { background: #ff9a3d; } .theme-swatch.inferno i:nth-child(3) { background: #ff2d31; }
.theme-swatch.violet i:nth-child(1) { background: #a45cff; } .theme-swatch.violet i:nth-child(2) { background: #f05bff; } .theme-swatch.violet i:nth-child(3) { background: #6557ff; }
.theme-swatch.electric i:nth-child(1) { background: #299fff; } .theme-swatch.electric i:nth-child(2) { background: #4be4ff; } .theme-swatch.electric i:nth-child(3) { background: #635bff; }
.theme-swatch.cyber i:nth-child(1) { background: #16e69a; } .theme-swatch.cyber i:nth-child(2) { background: #5bffd0; } .theme-swatch.cyber i:nth-child(3) { background: #00a7ff; }
.field-label, .steps-list p, .message-meta span:first-child { color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
.secondary-button { background: var(--surface-3); color: var(--text); }
.bottom-nav button { color: color-mix(in srgb, var(--muted) 88%, var(--text)); }

@media (hover: hover) {
  .connection-pill:hover, .theme-choice:hover, .rule-card:hover, .group-row:hover, .settings-section:hover, .settings-tile:hover, .group-bulk-button:hover:not(:disabled), .message-item:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--teal) 34%, transparent); box-shadow: 0 14px 38px color-mix(in srgb, var(--teal) 9%, rgba(0,0,0,.32)); }
  .ride-card:hover:not(.is-swiping) { transform: translateX(var(--swipe-x, 0)) translateY(-4px); border-color: color-mix(in srgb, var(--teal) 42%, transparent); box-shadow: 0 28px 72px rgba(0,0,0,.42), 0 0 35px color-mix(in srgb, var(--teal) 10%, transparent); }
  .accept-button:hover, .primary-button:hover { transform: translateY(-2px) scale(1.005); box-shadow: 0 17px 42px var(--glow); filter: saturate(1.1); }
  .icon-button:hover { transform: translateY(-2px) rotate(4deg); box-shadow: 0 14px 36px var(--glow); }
  .bottom-nav button:hover { color: var(--text); transform: translateY(-2px); }
}

@keyframes ambient-one { from { transform: translate3d(-5%, -8%, 0) scale(.9); } to { transform: translate3d(24%, 20%, 0) scale(1.16); } }
@keyframes ambient-two { from { transform: translate3d(4%, 8%, 0) scale(.86); } to { transform: translate3d(-24%, -16%, 0) scale(1.12); } }
@keyframes gradient-flow { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes logo-breathe { 50% { box-shadow: 0 10px 38px color-mix(in srgb, var(--teal) 50%, transparent), inset 0 1px 0 rgba(255,255,255,.35); } }
@keyframes shine-sweep { 0%,42% { transform: translateX(-85%) rotate(8deg); opacity: 0; } 55% { opacity: 1; } 72%,100% { transform: translateX(85%) rotate(8deg); opacity: 0; } }
@keyframes status-pulse { 50% { transform: scale(.82); box-shadow: 0 0 0 7px color-mix(in srgb, var(--teal) 7%, transparent), 0 0 24px var(--glow); } }
@keyframes title-rise { from { opacity: 0; transform: translateY(10px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes orb-spin { to { transform: rotate(360deg); } }
@keyframes radar-ping { 0% { transform: scale(.68); opacity: .8; } 75%,100% { transform: scale(1.35); opacity: 0; } }
@keyframes radar-icon { 50% { transform: scale(1.1) rotate(8deg); } }
@keyframes metric-line { 50% { transform: scaleX(1); opacity: .9; } }
@keyframes metric-pop { from { opacity: 0; transform: translateY(7px) scale(.86); } }
@keyframes card-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes new-ride-glow { 50% { box-shadow: 0 26px 70px rgba(0,0,0,.4), 0 0 34px color-mix(in srgb, var(--teal) 18%, transparent); } }
@keyframes nav-icon { 50% { transform: translateY(-2px) scale(1.08); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(24px) scale(.97); } }
@keyframes backdrop-in { from { opacity: 0; } }
@keyframes toast-glow { 50% { box-shadow: 0 18px 50px rgba(0,0,0,.48), 0 0 20px color-mix(in srgb, var(--teal) 9%, transparent); } }
@keyframes swatch-wave { from { transform: scaleY(.7); } to { transform: scaleY(1); } }

@media (min-width: 720px) {
  .app-shell { border-left: 1px solid rgba(217,239,237,.05); border-right: 1px solid rgba(217,239,237,.05); }
  main { padding-inline: 30px; }
  .topbar { padding-inline: 32px; }
  .metrics article { padding: 18px; }
  .ride-feed { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ride-swipe-shell:first-child:last-child { grid-column: 1 / -1; }
  .rules-list, .groups-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 390px) {
  main { padding-inline: 13px; }
  .topbar { padding-inline: 14px; }
  .hero-row { gap: 10px; }
  .live-orb { width: 58px; height: 58px; flex-basis: 58px; }
  .metrics strong { font-size: 22px; }
  .ride-message { font-size: 17px; }
  .bottom-nav { width: calc(100% - 14px); }
  .bottom-nav span { font-size: 8px; }
  .topbar { padding-inline: 12px; }
  .login-qr-stage { min-height: 230px; }
  .group-tools { grid-template-columns: 1fr; }
  .group-bulk-button { width: 100%; }
}

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