* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(800px 480px at 4% -10%, rgba(202, 225, 255, 0.72), transparent 70%),
    radial-gradient(620px 380px at 100% 15%, color-mix(in srgb, var(--color-accent) 16%, transparent), transparent 73%),
    linear-gradient(180deg, #fbfdff 0, var(--canvas) 36rem, #f9fbff 100%);
  line-height: 1.45;
}
button, input, select { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }
.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; }

.alerts-pro-gate { min-height: calc(100vh - var(--header-height, 60px)) !important; }
.alerts-sync-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  padding: 10px 14px;
  border: 1px solid var(--color-accent-border);
  border-radius: 10px;
  background: var(--color-accent-soft);
  color: var(--color-accent-hover);
  font-size: 12px;
}
.alerts-sync-banner span { flex: 1; }
.alerts-sync-banner button {
  padding: 5px 12px;
  border: 1px solid var(--color-accent-border);
  border-radius: 7px;
  background: #fff;
  color: var(--color-accent-hover);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out);
}
.alerts-sync-banner button:hover { background: var(--color-accent-soft); }
.alerts-sync-banner button#alerts-sync-retry { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-contrast); }
.alerts-sync-banner button#alerts-sync-retry:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
@keyframes spin { to { transform: rotate(360deg); } }

.alerts-app { width: min(1200px, calc(100% - 48px)); min-height: 100vh; margin: 0 auto; }
.mobile-alerts-summary { display: none; }
.alerts-pro-gate { display: grid; max-width: 650px; min-height: 100vh; margin: 0 auto; padding: 80px 24px; align-content: center; justify-items: start; }
.alerts-pro-gate h1 { margin: 12px 0; color: var(--ink-strong); font-size: clamp(32px, 7vw, 54px); line-height: 1.08; letter-spacing: -.05em; }
.alerts-pro-gate > p { max-width: 580px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.alerts-pro-gate > div { display: flex; gap: 10px; margin-top: 25px; }
.alerts-pro-gate a { display: inline-grid; min-height: 43px; padding: 0 18px; place-items: center; text-decoration: none; }
.alerts-pro-gate > small { margin-top: 18px; color: var(--faint); }
.alerts-header { min-height: 72px; display: flex; gap: 24px; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(207, 220, 238, 0.76); }
.brand { width: fit-content; display: inline-flex; gap: 9px; align-items: center; color: var(--blue); text-decoration: none; }
.brand strong { font-size: 15px; font-weight: 720; letter-spacing: -0.045em; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--color-accent-border); border-radius: 10px; background: linear-gradient(145deg, var(--color-surface-elevated), var(--color-accent-soft)); box-shadow: 0 5px 14px color-mix(in srgb, var(--color-accent) 12%, transparent); }
.brand-mark svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.header-actions { display: flex; min-width: 0; gap: 10px; align-items: center; justify-content: flex-end; }
.header-actions > a { display: inline-flex; min-height: 34px; align-items: center; }
.header-link { padding-inline: 4px; color: #647792; font-size: 12px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.header-link:hover { color: var(--blue); }
.account-link { max-width: 180px; overflow: hidden; color: #647792; font-size: 12px; font-weight: 650; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.header-actions .account-link { min-width: 0; }
.radar-link { min-height: 34px; display: inline-flex; gap: 5px; align-items: center; padding: 0 11px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 700; text-decoration: none; transition: background-color 160ms ease, transform 140ms var(--ease-out); }
.radar-link:active { transform: scale(0.97); }

main { padding-top: 28px; }
.hero { min-height: 276px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.72fr); gap: 12px; }
.hero-copy, .live-price-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: rgba(255, 255, 255, 0.92); box-shadow: var(--shadow); }
.hero-copy { padding: 39px 41px; background: linear-gradient(140deg, #fff 0%, #f4f8ff 100%); }
.hero-copy::after { position: absolute; right: -84px; bottom: -172px; width: 320px; height: 320px; border: 30px solid color-mix(in srgb, var(--color-accent) 4%, transparent); border-radius: 50%; content: ""; pointer-events: none; }
.eyebrow { display: block; color: var(--blue); font-size: 10px; font-weight: 780; letter-spacing: 0.17em; }
.hero h1 { position: relative; z-index: 1; margin: 9px 0 0; color: var(--ink-strong); font-size: clamp(38px, 5vw, 57px); font-weight: 610; letter-spacing: -0.06em; line-height: 1.05; }
.hero-copy > p { position: relative; z-index: 1; max-width: 520px; margin: 15px 0 0; color: #72829a; font-size: 13px; line-height: 1.75; }
.hero-actions { position: relative; z-index: 1; display: flex; gap: 8px; margin-top: 27px; }
.primary-button, .secondary-button { min-height: 40px; padding: 0 16px; border-radius: 9px; font-size: 12px; font-weight: 720; transition: border-color 160ms ease, background-color 160ms ease, transform 140ms var(--ease-out); }
.primary-button { border: 1px solid var(--color-accent); background: var(--color-accent); color: var(--color-accent-contrast); box-shadow: 0 7px 17px color-mix(in srgb, var(--color-accent) 20%, transparent); }
.secondary-button { border: 1px solid #dce6f3; background: #fff; color: #5d728f; }
.primary-button:active, .secondary-button:active { transform: scale(0.97); }

.live-price-card { display: flex; flex-direction: column; justify-content: center; padding: 31px; background: linear-gradient(150deg, #1f3f72, #17345e 62%, #122b50); color: #fff; }
.live-price-card::after { position: absolute; top: -100px; right: -75px; width: 260px; height: 260px; border: 36px solid rgba(255, 255, 255, 0.035); border-radius: 50%; content: ""; }
.live-price-heading { position: relative; z-index: 1; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.live-price-heading span { display: flex; gap: 8px; align-items: center; color: rgba(255, 255, 255, 0.8); font-size: 12px; font-weight: 650; }
.live-price-heading i { width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 18%, transparent); }
.live-price-heading small { color: rgba(255, 255, 255, 0.5); font-size: 11px; }
.live-price-row { position: relative; z-index: 1; display: flex; gap: 10px; align-items: baseline; margin-top: 23px; }
.live-price-row strong { font-size: clamp(43px, 5vw, 57px); font-weight: 560; letter-spacing: -0.06em; line-height: 1; }
.live-price-row > span { color: rgba(255, 255, 255, 0.8); font-size: 13px; font-weight: 650; }
.live-price-row small { margin-left: 3px; color: rgba(255, 255, 255, 0.45); font-size: 11px; }
.price-scale { position: relative; z-index: 1; height: 5px; margin-top: 27px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); }
.price-scale span { position: absolute; inset: 0; width: 64%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--color-accent) 45%, transparent), var(--color-accent)); }
.price-scale i { position: absolute; top: 50%; left: 64%; width: 11px; height: 11px; border: 2px solid #fff; border-radius: 50%; background: var(--color-accent); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24); transform: translate(-50%, -50%); }
.live-price-card > p { position: relative; z-index: 1; margin: 10px 0 0; color: rgba(255, 255, 255, 0.47); font-size: 11px; }

.overview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.overview-card { min-height: 108px; display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: center; padding: 19px 21px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 255, 255, 0.92); box-shadow: var(--shadow); }
.overview-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; }
.overview-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.overview-icon.strategy { background: var(--blue-soft); color: var(--blue); }
.overview-icon.threshold { background: var(--red-soft); color: var(--red); }
.overview-icon.channel { background: #f2f0ff; color: #7667d9; }
.overview-card small, .overview-card strong, .overview-card p { display: block; }
.overview-card small { color: #94a1b4; font-size: 11px; }
.overview-card strong { margin-top: 2px; color: #344c6c; font-size: 17px; font-weight: 700; letter-spacing: -0.025em; }
.overview-card p { overflow: hidden; margin: 3px 0 0; color: #8a98ab; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; align-items: stretch; }
.rules-panel, .settings-panel, .how-it-works { border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, 0.94); box-shadow: var(--shadow); }
.rules-panel { min-height: 518px; padding: 25px 27px; }
.settings-panel { padding: 25px 23px; }
.section-heading { display: flex; gap: 18px; align-items: flex-end; justify-content: space-between; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.section-heading.compact { align-items: flex-start; }
.section-heading h2 { margin: 4px 0 0; color: #2c4261; font-size: 20px; font-weight: 680; letter-spacing: -0.045em; }
.rule-filter { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #f7faff; }
.rule-filter button { min-height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: #8290a4; font-size: 12px; font-weight: 650; transition: background-color 150ms ease, color 150ms ease, transform 120ms var(--ease-out); }
.rule-filter button[aria-selected="true"] { background: #fff; color: var(--blue); box-shadow: 0 2px 7px rgba(57, 93, 141, 0.09); }
.rule-filter button:active { transform: scale(0.96); }
.rule-list { display: grid; }
.rule-card { min-height: 83px; display: grid; grid-template-columns: 39px minmax(0, 1fr) auto auto; gap: 13px; align-items: center; padding: 13px 2px; border-bottom: 1px solid #e9eef6; }
.rule-card:last-child { border-bottom: 0; }
.rule-card.is-disabled { opacity: 0.58; }
.rule-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; background: var(--red-soft); color: var(--red); font-size: 17px; font-weight: 650; }
.rule-icon.strategy { background: var(--blue-soft); color: var(--blue); }
.rule-copy { min-width: 0; }
.rule-copy strong { display: block; overflow: hidden; color: #3c526f; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.rule-copy p { margin: 4px 0 0; color: #8997ab; font-size: 12px; line-height: 1.45; }
.rule-meta { min-width: 112px; text-align: right; }
.rule-meta strong { display: block; color: #314a6b; font-size: 14px; font-weight: 700; }
.rule-meta span { display: block; margin-top: 3px; color: #9aa6b7; font-size: 11px; }
.rule-menu { position: relative; }
.rule-more { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #8d9aab; font-size: 19px; letter-spacing: 1px; transition: background-color 140ms ease, transform 120ms var(--ease-out); }
.rule-more:hover { background: #f2f6fb; }
.rule-more:active { transform: scale(0.93); }
.rule-actions { position: absolute; z-index: 5; top: calc(100% + 4px); right: 0; width: 128px; display: grid; padding: 5px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; box-shadow: 0 14px 35px rgba(36, 59, 94, 0.15); transform-origin: top right; animation: menu-in 150ms var(--ease-out) both; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-3px) scale(0.97); } }
.rule-actions button { min-height: 31px; padding: 0 9px; border: 0; border-radius: 6px; background: transparent; color: #637690; font-size: 12px; text-align: left; }
.rule-actions button:hover { background: #f4f7fb; }
.rule-actions button.danger { color: var(--red); }
.empty-state { min-height: 370px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-state > span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: var(--blue-soft); color: var(--blue); font-size: 24px; }
.empty-state strong { margin-top: 15px; color: #3d5370; font-size: 15px; }
.empty-state p { max-width: 310px; margin: 7px 0 0; color: #92a0b3; font-size: 12px; line-height: 1.6; }

.setting-group { padding: 17px 0; border-bottom: 1px solid var(--line); }
.setting-group:last-child { padding-bottom: 0; border-bottom: 0; }
.setting-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.setting-row + .setting-row { margin-top: 17px; }
.setting-row > div { min-width: 0; }
.setting-row strong, .setting-row span { display: block; }
.setting-row strong { color: #405672; font-size: 13px; }
.setting-row > div > span { margin-top: 2px; color: #99a5b6; font-size: 12px; line-height: 1.45; }
.switch { position: relative; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > span { width: 35px; height: 20px; display: block; padding: 2px; border-radius: 999px; background: #dce4ee; transition: background-color 170ms ease; }
.switch > span::after { width: 16px; height: 16px; display: block; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(38, 56, 84, 0.25); content: ""; transition: transform 180ms var(--ease-out); }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(15px); }
.switch input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 3px; }
.permission-button { width: 100%; min-height: 32px; margin: 11px 0 15px; border: 1px solid #d5e3f8; border-radius: 8px; background: #f4f8ff; color: var(--blue); font-size: 12px; font-weight: 700; transition: background-color 150ms ease, transform 120ms var(--ease-out); }
.permission-button:active { transform: scale(0.98); }
.permission-button:disabled { cursor: default; color: #8090a6; }
.delivery-identity { display: grid; gap: 4px; margin-top: 12px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbff; }
.delivery-identity span, .time-range label span { color: #8f9caf; font-size: 11px; font-weight: 650; }
.delivery-identity strong { overflow: hidden; color: #526a87; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.time-range input { height: 34px; min-width: 0; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; outline: 0; background: #f8fbff; color: #526a87; font-size: 13px; }
.time-range input:focus { border-color: var(--color-border-focus); box-shadow: 0 0 0 3px var(--color-focus-ring); }
.time-range.is-disabled { opacity: 0.47; pointer-events: none; }
.capability-note { display: grid; grid-template-columns: 16px 1fr; gap: 6px; margin: 10px 0 0; color: #93a0b1; font-size: 11px; line-height: 1.5; }
.capability-note i { width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%; background: #eef3f9; color: #74859c; font-style: normal; }
.time-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; margin-top: 13px; }
.time-range label { min-width: 0; display: grid; gap: 5px; }
.time-range > i { padding-bottom: 8px; color: #a4b0c0; font-size: 11px; font-style: normal; }
.quiet-range-hint { display: block; margin-top: 8px; color: #8f9caf; font-size: 11px; line-height: 1.5; }

.how-it-works { display: grid; grid-template-columns: minmax(250px, 0.7fr) 1.5fr; gap: 36px; align-items: center; margin-top: 12px; padding: 28px 31px; }
.how-it-works h2 { max-width: 280px; margin: 5px 0 0; color: #304663; font-size: 20px; font-weight: 680; letter-spacing: -0.045em; }
.how-it-works ol { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 0; padding: 0; list-style: none; }
.how-it-works li { position: relative; padding-left: 32px; }
.how-it-works li + li::before { position: absolute; top: 4px; bottom: 4px; left: -10px; width: 1px; background: var(--line); content: ""; }
.how-it-works li > span { position: absolute; top: 0; left: 0; color: #b3c7e8; font-size: 11px; font-weight: 750; }
.how-it-works strong { color: #48607e; font-size: 13px; }
.how-it-works p { margin: 4px 0 0; color: #94a1b3; font-size: 12px; line-height: 1.55; }

.rule-dialog { width: min(520px, calc(100% - 28px)); max-height: calc(100vh - 36px); padding: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; border: 0; border-radius: 18px; background: transparent; color: var(--ink); box-shadow: 0 28px 90px rgba(30, 52, 84, 0.25); }
.rule-dialog::backdrop { background: rgba(33, 51, 79, 0.34); backdrop-filter: blur(7px); touch-action: none; }
.dialog-card { padding: 25px 27px 27px; overscroll-behavior: contain; background: #fff; }
.rule-dialog-open { overscroll-behavior: none; }
.dialog-handle { display: none; }
.dialog-card header { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.dialog-card h2 { margin: 5px 0 0; color: #2a4161; font-size: 21px; font-weight: 680; letter-spacing: -0.045em; }
.dialog-close { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #f8faff; color: #8492a6; font-size: 20px; line-height: 1; transition: background-color 150ms ease, transform 120ms var(--ease-out); }
.dialog-close:active { transform: scale(0.94); }
.dialog-field { display: grid; gap: 7px; margin-top: 17px; }
.dialog-field > span, .field-label { color: #7788a1; font-size: 12px; font-weight: 680; }
.dialog-field > input, .dialog-field select, .price-field > div { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; outline: 0; background: #f9fbfe; color: #425a78; font-size: 13px; }
.dialog-field > input:focus, .dialog-field select:focus, .price-field > div:focus-within { border-color: var(--color-border-focus); box-shadow: 0 0 0 3px var(--color-focus-ring); }
.field-label { display: block; margin-top: 18px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.choice-grid input { position: absolute; opacity: 0; }
.choice-grid label > span { min-height: 74px; display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 9px; align-content: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdff; transition: border-color 150ms ease, background-color 150ms ease, transform 120ms var(--ease-out); }
.choice-grid label > span:active { transform: scale(0.98); }
.choice-grid i { grid-row: 1 / 3; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #eef4fc; color: #6f85a3; font-size: 12px; font-style: normal; font-weight: 720; }
.choice-grid b { align-self: end; color: #4b627f; font-size: 13px; }
.choice-grid small { color: #98a5b7; font-size: 11px; }
.choice-grid input:checked + span { border-color: var(--color-border-focus); background: var(--color-accent-soft); box-shadow: inset 0 0 0 1px var(--color-focus-ring); }
.choice-grid input:checked + span i { background: var(--color-accent); color: var(--color-accent-contrast); }
.choice-grid input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.price-field > div { display: flex; align-items: center; padding-right: 10px; }
.price-field > div input { min-width: 0; flex: 1; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; font-size: 19px; font-weight: 650; }
.price-field > div b { color: #8b99ac; font-size: 11px; }
.dialog-field > small { color: #a0adbd; font-size: 11px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.strategy-fields { margin-top: 18px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 10px; background: #f6faff; }
.strategy-description { margin: 0; color: #5d6f88; font-size: 13px; line-height: 1.55; }
.form-error { margin: 13px 0 0; color: #af3f53; font-size: 12px; }
.save-button { width: 100%; min-height: 42px; margin-top: 21px; border: 0; border-radius: 9px; background: var(--color-accent); color: var(--color-accent-contrast); font-size: 13px; font-weight: 730; box-shadow: 0 7px 17px color-mix(in srgb, var(--color-accent) 20%, transparent); transition: background-color 150ms ease, transform 130ms var(--ease-out); }
.save-button:active { transform: scale(0.98); }

.toast { position: fixed; z-index: 110; right: 22px; bottom: 22px; max-width: min(340px, calc(100% - 44px)); padding: 11px 14px; border: 1px solid #d4e0ef; border-radius: 10px; background: rgba(255, 255, 255, 0.97); box-shadow: 0 16px 42px rgba(38, 59, 91, 0.18); color: #526985; font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px) scale(0.98); transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out); }
.toast.visible { opacity: 1; transform: translateY(0) scale(1); }
.toast .toast-message { display: inline; }
.toast .toast-action { display: inline-flex; align-items: center; gap: 4px; margin-left: 12px; padding: 4px 10px; border-radius: 6px; border: 0; background: var(--color-accent-soft); color: var(--color-accent-hover); font-weight: 650; font-size: 12px; cursor: pointer; transition: background-color 160ms var(--ease-out); }
.toast .toast-action:hover { background: color-mix(in srgb, var(--color-accent) 20%, transparent); }
.toast.toast-with-countdown { padding: 12px 16px; }
.toast.toast-with-countdown .toast-undo { background: var(--color-accent); color: var(--color-accent-contrast); font-weight: 700; }
.toast.toast-with-countdown .toast-undo:hover { background: var(--color-accent-hover); }
.toast.toast-with-countdown [data-toast-countdown] { font-variant-numeric: tabular-nums; min-width: 1.2em; display: inline-block; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .live-price-card { min-height: 230px; }
  .content-grid { grid-template-columns: 1fr; }
  .settings-panel { position: static; }
  .how-it-works { grid-template-columns: 1fr; gap: 22px; }
}

@media (max-width: 680px) {
  .alerts-app { width: min(100% - 28px, 520px); }
  .alerts-header { min-height: 64px; }
  .brand strong { display: none; }
  .account-link { max-width: 95px; }
  main { padding-top: 15px; }
  .hero { gap: 9px; }
  .hero-copy { min-height: 278px; padding: 29px 23px; border-radius: 17px; }
  .hero h1 { font-size: 42px; }
  .hero-copy > p { font-size: 12px; }
  .hero-actions { align-items: stretch; flex-direction: column; margin-top: 23px; }
  .live-price-card { min-height: 216px; padding: 25px 23px; border-radius: 17px; }
  .overview-grid { grid-template-columns: 1fr; gap: 8px; margin-top: 9px; }
  .overview-card { min-height: 88px; padding: 14px 17px; }
  .content-grid { gap: 9px; margin-top: 9px; }
  .rules-panel, .settings-panel { padding: 21px 17px; border-radius: 16px; }
  .rules-panel { min-height: 430px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 13px; }
  .section-heading.compact { flex-direction: row; }
  .rule-filter { width: 100%; }
  .rule-filter button { flex: 1; }
  .rule-card { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; }
  .rule-meta { grid-column: 2; grid-row: 2; min-width: 0; text-align: left; }
  .rule-menu { grid-column: 3; grid-row: 1 / 3; }
  .empty-state { min-height: 300px; }
  .how-it-works { margin-top: 9px; padding: 23px 19px; border-radius: 16px; }
  .how-it-works ol { grid-template-columns: 1fr; gap: 15px; }
  .how-it-works li + li::before { display: none; }
  .rule-dialog { width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 18px 18px 0 0; }
  .dialog-card { padding: 13px 18px calc(24px + env(safe-area-inset-bottom)); }
  .dialog-handle { width: 34px; height: 4px; display: block; margin: 0 auto 14px; border-radius: 999px; background: #dce3ec; }
  .choice-grid, .form-row { grid-template-columns: 1fr; }
}

/* Mobile management layout: surface the user's rules before the supporting detail. */
@media (max-width: 680px) {
  .mobile-alerts-summary {
    display: block;
    padding-top: 1px;
  }
  .mobile-summary-heading {
    display: flex;
    min-height: 62px;
    gap: 12px;
    align-items: center;
  }
  .mobile-summary-heading h1 {
    margin: 0;
    color: var(--ink-strong);
    font-size: 25px;
    font-weight: 680;
    letter-spacing: -.045em;
    line-height: 1.1;
  }
  .mobile-summary-heading p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
  }
  .mobile-summary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 2px 0 12px;
  }
  .mobile-summary-actions button {
    min-width: 0;
    min-height: 44px;
    padding-inline: 10px;
    border-radius: 10px;
    font-size: 12px;
  }
  .mobile-summary-actions button:active { transform: scale(.97); }
  .mobile-market-row {
    display: flex;
    min-height: 55px;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .mobile-market-row > div {
    display: flex;
    min-width: 0;
    gap: 7px;
    align-items: baseline;
  }
  .mobile-market-label {
    display: inline-flex;
    flex: 0 0 auto;
    gap: 6px;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
  }
  .mobile-market-label i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
  }
  .mobile-market-row strong {
    color: var(--ink-strong);
    font-size: 22px;
    font-weight: 650;
    letter-spacing: -.045em;
    line-height: 1;
  }
  .mobile-market-row > div > span:last-child {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
  }
  .mobile-market-row small {
    flex: 0 0 auto;
    color: var(--faint);
    font-size: 11px;
    text-align: right;
  }
  .mobile-panel-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-top: 10px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: color-mix(in srgb, var(--color-surface) 72%, var(--color-canvas));
  }
  .mobile-panel-tabs button {
    min-height: 40px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    transition: background-color 160ms var(--ease-out), color 160ms var(--ease-out), transform 120ms var(--ease-out);
  }
  .mobile-panel-tabs button[aria-selected="true"] {
    color: var(--color-primary-contrast);
    background: var(--color-primary);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 18%, transparent);
  }
  .mobile-panel-tabs button:active { transform: scale(.98); }
  .mobile-panel-tabs button > span:not(.mobile-tab-badge) {
    margin-left: 3px;
    opacity: .75;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
  }
  .mobile-tab-badge {
    display: inline-grid;
    width: 17px;
    height: 17px;
    margin-left: 4px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--red);
    font-size: 11px;
    font-weight: 750;
    line-height: 1;
  }
  .mobile-alerts-warning {
    display: flex;
    min-height: 44px;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    margin-top: 9px;
    padding: 8px 10px;
    border: 1px solid color-mix(in srgb, var(--red) 28%, var(--line));
    border-radius: 10px;
    background: color-mix(in srgb, var(--red-soft) 70%, var(--color-surface));
    color: var(--ink);
    font-size: 12px;
  }
  .mobile-alerts-warning > span {
    display: inline-flex;
    min-width: 0;
    gap: 7px;
    align-items: center;
  }
  .mobile-alerts-warning i {
    display: inline-grid;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--red);
    font-style: normal;
    font-size: 11px;
    font-weight: 750;
  }
  .mobile-alerts-warning strong {
    overflow: hidden;
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-alerts-warning button {
    min-height: 32px;
    flex: 0 0 auto;
    padding: 0 9px;
    border: 0;
    border-radius: 7px;
    color: var(--red);
    background: transparent;
    font-size: 12px;
    font-weight: 700;
  }
  .hero, .overview-grid { display: none; }
  .content-grid {
    display: block;
    margin-top: 12px;
  }
  .rules-panel, .settings-panel {
    min-height: 0;
    padding: 15px 15px 17px;
    border-radius: 15px;
  }
  .alerts-app[data-mobile-panel="rules"] .settings-panel,
  .alerts-app[data-mobile-panel="settings"] .rules-panel { display: none; }
  .alerts-app[data-mobile-panel="settings"] .settings-panel { display: block; }
  .section-heading {
    gap: 11px;
    padding-bottom: 12px;
  }
  .section-heading h2 { font-size: 18px; }
  .rule-filter button { min-height: 36px; }
  .rule-card {
    min-height: 0;
    grid-template-columns: 34px minmax(0, 1fr) 40px;
    gap: 9px;
    padding: 12px 0;
  }
  .rule-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 15px;
  }
  .rule-copy strong { font-size: 14px; }
  .rule-copy p {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .rule-meta {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    margin-top: 2px;
    text-align: left;
  }
  .rule-meta strong { font-size: 13px; }
  .rule-meta span { margin-top: 2px; font-size: 11px; }
  .rule-menu {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: center;
  }
  .rule-more {
    width: 40px;
    height: 40px;
  }
  .rule-actions { width: 150px; }
  .empty-state { min-height: 220px; }
  .settings-panel .section-heading { padding-bottom: 12px; }
  .setting-group { padding: 14px 0; }
  .setting-row { gap: 12px; }
  .setting-row strong { font-size: 14px; }
  .setting-row > div > span { font-size: 12px; }
  .switch > span { width: 44px; height: 28px; padding: 3px; }
  .switch > span::after { width: 22px; height: 22px; }
  .switch input:checked + span::after { transform: translateX(16px); }
  .permission-button { min-height: 44px; margin-block: 10px 13px; }
  .capability-note, .quiet-range-hint { font-size: 12px; }
  .how-it-works { display: none; }
  .alerts-app:not(.has-rules) .how-it-works { display: grid; }
}

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