/* APP My Pool — customer app. Implements the "APP My Pool" Claude Design screens. */

@font-face { font-family: Figtree; src: url(fonts/figtree.202cfb54.woff2) format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'Material Symbols Rounded'; src: url(fonts/material-symbols-rounded.fedcbccf.woff2) format('woff2'); font-weight: 400; font-display: block; }

:root {
  --navy: #0B2A5B; --blue: #1460D6; --blue-hover: #0F4FB5; --text: #13213A; --muted: #5A6B85; --faint: #8DA0BC;
  --page: #F4F7FB; --card: #FFFFFF; --line: #C9D6E8; --line-2: #E1E8F2; --line-3: #EDF1F7; --tint: #EAF2FC; --tint-2: #EEF4FC; --seg: #E3EAF4;
  --good: #16924A; --good-bg: #E7F6EC; --good-ink: #0E6B35;
  --warn: #B26F00; --warn-bg: #FFF6E3; --warn-ink: #9A5B00;
  --crit: #C62828; --crit-bg: #FDECEC; --crit-ink: #8E1C1C;
  --shadow: 0 1px 2px rgba(11, 42, 91, .06);
  --shadow-lift: 0 1px 2px rgba(11, 42, 91, .06), 0 6px 18px rgba(11, 42, 91, .06);
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #E6EDF6; color: var(--text); font: 16px/1.45 Figtree, system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }
h1 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 800; color: var(--navy); letter-spacing: -.01em; }
h2 { margin: 0; font-size: 17px; font-weight: 800; color: var(--navy); }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(20, 96, 214, .5); outline-offset: 2px; }

.ms { font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; font-size: 22px; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr; -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga'; font-variation-settings: 'FILL' 0; display: inline-block; flex: none; user-select: none; }
.ms.fill { font-variation-settings: 'FILL' 1; }
.ms.sm { font-size: 15px; } .ms.lg { font-size: 26px; }
.ms.blue { color: var(--blue); } .ms.muted { color: var(--muted); } .ms.chev { color: var(--faint); font-size: 22px; }

/* ── Shell: phone column, centred on larger screens ── */
.shell { position: relative; max-width: 480px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: var(--page); display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; flex: none; display: flex; align-items: center; justify-content: space-between; height: calc(52px + var(--safe-top)); padding: var(--safe-top) 12px 0; background: var(--card); border-bottom: 1px solid var(--line-2); }
.tb-side { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.icon-btn { position: relative; width: 44px; height: 44px; border: 0; border-radius: 22px; background: transparent; color: var(--navy); display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--tint); }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 5px; background: var(--crit); border: 2px solid #fff; }
.logo { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; line-height: 1; padding: 4px 8px; }
.logo img { display: block; }
.logo-sm img { height: 34px; width: auto; }
.logo-lg { align-items: flex-start; padding: 0; }
.logo-lg img { width: 210px; max-width: 70vw; height: auto; }

.view { flex: 1; min-height: 0; }
.view.bare { background: var(--card); display: flex; flex-direction: column; }
.tabs { position: sticky; bottom: 0; z-index: 20; flex: none; display: grid; grid-template-columns: repeat(6, 1fr); background: var(--card); border-top: 1px solid var(--line-2); padding: 6px 4px calc(8px + var(--safe-bottom)); }
.tab { height: 52px; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); padding: 0; min-width: 0; }
.tab-pill { width: 46px; height: 28px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.tab-label { font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.tab.on { color: var(--blue); } .tab.on .tab-pill { background: var(--tint); }

@media (min-width: 1024px) {
  body { padding: 24px 0; }
  .shell { max-width: 720px; display: grid; grid-template-columns: 200px 1fr; grid-template-rows: auto 1fr; border-radius: 24px; overflow: hidden; min-height: calc(100vh - 48px); box-shadow: 0 10px 40px rgba(11, 42, 91, .1); }
  .topbar { grid-column: 1 / -1; position: static; }
  .tabs { grid-row: 2; position: static; display: flex; flex-direction: column; gap: 2px; padding: 16px 10px; border-top: 0; border-right: 1px solid var(--line-2); }
  .tab { flex-direction: row; justify-content: flex-start; gap: 10px; height: 46px; padding: 0 8px; border-radius: 12px; }
  .tab .tab-label { font-size: 14px; }
  .tab.on { background: var(--tint); }
  .tab.on .tab-pill { background: transparent; }
  .view { grid-column: 2; overflow-y: auto; }
  .shell:has(.tabs[hidden]) .view { grid-column: 1 / -1; }
}

/* ── Layout primitives ── */
.pad { padding: 18px 16px 28px; }
.stack { display: grid; gap: 14px; } .stack-sm { display: grid; gap: 12px; } .stack-xs { display: grid; gap: 8px; margin-top: 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.title-row.end { align-items: flex-end; }
.sub { font-size: 15px; color: var(--muted); margin-top: 3px; }
.h-tight { margin-top: 2px; font-size: 24px; }
.section { margin-top: 4px; }
.muted { color: var(--muted); } .navy { color: var(--navy); } .blue { color: var(--blue); }
.small { font-size: 13px; } .fine { font-size: 12px; line-height: 1.5; color: var(--muted); } .center { text-align: center; }
.strong { font-weight: 700; } .strong-lg { font-size: 16px; font-weight: 600; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .tnum { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.eyebrow.blue { font-size: 13px; letter-spacing: .12em; color: var(--blue); }
.dim { opacity: .65; }
.tone-good { color: var(--good); } .tone-warn { color: var(--warn); } .tone-crit { color: var(--crit); } .tone-muted { color: var(--muted); }

.card { background: var(--card); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); border: 0; text-align: left; color: inherit; width: 100%; }
.card.list { padding: 0; overflow: hidden; border-radius: 18px; }
.card.flush { padding: 0; overflow: hidden; border-radius: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.center-card { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 24px 20px; }
.state-ic { width: 56px; height: 56px; border-radius: 28px; background: var(--tint); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.state-ic .ms { font-size: 28px; }
.center-state { display: grid; gap: 12px; justify-items: center; text-align: center; padding-top: 64px; }
.h2 { font-size: 22px; }

/* ── Buttons ── */
.btn { height: 54px; border: 0; border-radius: 14px; padding: 0 18px; font-size: 16px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); color: #fff; }
.btn-lift { font-size: 17px; box-shadow: 0 8px 20px rgba(20, 96, 214, .3); }
.btn-secondary { background: var(--card); color: var(--navy); border: 1.5px solid var(--line); font-size: 15px; }
.btn-secondary:hover { border-color: var(--blue); color: var(--navy); }
.btn-secondary.danger { color: var(--crit); }
.btn-ghost { background: var(--card); color: var(--blue); border: 1.5px solid var(--line); height: 50px; font-size: 15px; border-radius: 12px; }
.btn-done { background: var(--good-bg); color: var(--good-ink); height: 50px; font-size: 15px; border-radius: 12px; }
.treat-actions .btn-primary { height: 50px; font-size: 15px; border-radius: 12px; }
.btn-md { height: 46px; font-size: 14px; border-radius: 12px; }
.btn-sm { height: 42px; font-size: 14px; border-radius: 10px; width: auto; padding: 0 16px; }
.btn:disabled { opacity: .55; cursor: default; }
.link-btn { border: 0; background: transparent; color: var(--blue); font-weight: 700; font-size: 14px; padding: 8px 0; }
.link-btn.sm { font-size: 13px; padding: 6px 0; }
.link-btn.danger { color: var(--crit); }
.pill-btn { height: 40px; padding: 0 10px 0 14px; border: 1.5px solid var(--line); border-radius: 20px; background: var(--card); display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--navy); white-space: nowrap; }
.pill-btn.blue { color: var(--blue); font-weight: 700; font-size: 13px; padding: 0 14px; }

.seg { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; background: var(--seg); border-radius: 12px; padding: 4px; }
.seg-btn { height: 40px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg-btn.on { background: var(--card); color: var(--navy); font-weight: 700; box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.chip-scroll { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.chip-row, .chip-wrap { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--card); color: var(--navy); font-weight: 700; font-size: 13px; }
.chip.on { border-color: var(--blue); background: var(--blue); color: #fff; }
.chip-round { height: 36px; padding: 0 14px; border-radius: 18px; }
.chip-row .chip-round { height: 38px; }
.chip-sq { height: 32px; padding: 0 10px; border-radius: 8px; border: 0; background: var(--tint-2); font-size: 12px; }
.chip-sq.on { background: var(--navy); color: #fff; }

/* ── Welcome & sign in ── */
.welcome { min-height: 100%; flex: 1; display: flex; flex-direction: column; padding-top: calc(8px + var(--safe-top)); }
.welcome .logo-lg { padding: 8px 24px 0; }
.welcome-copy { padding: 28px 24px 0; }
.display { margin-top: 10px; font-size: 38px; line-height: 1.04; letter-spacing: -.02em; text-wrap: balance; }
.lead { margin-top: 12px; font-size: 16px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.auth-screen .lead { font-size: 15px; }
.points { margin: 22px 24px 0; display: grid; gap: 12px; }
.point { display: flex; gap: 12px; align-items: center; font-size: 15px; font-weight: 500; }
.point-ic { width: 28px; height: 28px; border-radius: 14px; background: var(--tint); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.point-ic .ms { font-size: 18px; }
.welcome-water { position: relative; flex: 1; min-height: 190px; margin-top: 24px; background:
  radial-gradient(120% 60% at 20% 0%, rgba(255, 255, 255, .55), transparent 60%),
  repeating-linear-gradient(170deg, rgba(255, 255, 255, .18) 0 2px, transparent 2px 22px),
  linear-gradient(180deg, #8EC5F2 0%, #4F9BE3 55%, #2A74C9 100%); }
.welcome-cta { position: absolute; left: 24px; right: 24px; bottom: calc(24px + var(--safe-bottom)); display: grid; gap: 10px; }
.welcome-note { text-align: center; font-size: 13px; background: rgba(255, 255, 255, .88); border-radius: 10px; padding: 8px; }
.auth-screen { padding: calc(16px + var(--safe-top)) 24px calc(32px + var(--safe-bottom)); display: grid; gap: 0; align-content: start; }
.auth-screen h1 { margin-top: 12px; font-size: 28px; }
.back-inline { margin-left: -12px; }
.auth-screen .seg { margin-top: 24px; }
.auth-screen form { margin-top: 18px; }
.label { font-size: 13px; font-weight: 600; }
.input-wrap { height: 54px; border: 1.5px solid var(--line); border-radius: 12px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: #fff; }
.input-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20, 96, 214, .15); }
.input-bare { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 17px; background: transparent; }
.field-error { color: var(--crit); font-size: 14px; font-weight: 600; margin-top: 10px; }
.note-box { padding: 16px; border-radius: 14px; background: var(--page); font-size: 14px; line-height: 1.5; color: var(--muted); }
.auth-screen .note-box { margin-top: 28px; }
.note-box strong { color: var(--text); }
.note-box.blue { background: var(--tint-2); color: var(--text); padding: 14px; border-radius: 16px; }
.note-box.blue .navy { color: var(--navy); }
.auth-screen .fine { margin-top: 20px; }
.otp { position: relative; margin-top: 26px; }
.otp-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-box { height: 58px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: var(--navy); }
.otp-box.active { border: 2px solid var(--blue); }
.otp-input { position: absolute; inset: 0; opacity: 0; width: 100%; font-size: 16px; cursor: text; }
.otp-status { margin-top: 20px; display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--blue); font-weight: 600; min-height: 1px; }
.otp-status:empty { margin-top: 0; }
.auth-screen > .btn-sm { margin-top: 18px; justify-self: start; }
.check-row { margin-top: 22px; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check-row input { width: 20px; height: 20px; accent-color: var(--blue); }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.pulse { animation: pulse 1s infinite; }

.banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.banner-good { background: var(--good-bg); color: var(--good-ink); }
.pool-card { width: 100%; text-align: left; border: 1.5px solid var(--line-2); background: #fff; border-radius: 16px; padding: 12px; display: flex; gap: 14px; align-items: center; }
.pool-card:hover, .pool-card.on { border-color: var(--blue); }
.pool-card.on { border-width: 2px; }
.pool-name { font-size: 17px; font-weight: 700; color: var(--navy); }
.status-dot { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.status-dot::before { content: ''; width: 8px; height: 8px; border-radius: 4px; background: currentColor; }
.art { flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #3D5C86; background: linear-gradient(135deg, #CFE3F8, #E4EFFB); }
.art-pool { width: 88px; height: 72px; border-radius: 10px; }
.art-pool .ms { font-size: 30px; }
.art-product { width: 84px; height: 84px; background: linear-gradient(135deg, #EEF2F8, #F6F8FC); color: var(--faint); }
.art-product.tall { width: 92px; height: 104px; }
.art-product .ms { font-size: 32px; }

/* ── Home ── */
.alert-critical { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: var(--crit); color: #fff; font-size: 14px; line-height: 1.45; }
.alert-title { font-weight: 800; font-size: 16px; margin-bottom: 3px; }
.health { display: flex; gap: 18px; align-items: center; padding: 18px; box-shadow: var(--shadow-lift); }
.health-label { font-size: 22px; font-weight: 800; margin: 4px 0 6px; }
.meta { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.ring { --ring: var(--good); flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: conic-gradient(var(--ring) calc(var(--pct) * 1%), var(--seg) 0); }
.ring.tone-warn { --ring: var(--warn); } .ring.tone-crit { --ring: var(--crit); }
.ring-lg { width: 112px; height: 112px; }
.ring-in { border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-lg .ring-in { width: 94px; height: 94px; }
.ring-n { font-size: 36px; font-weight: 800; line-height: 1; color: var(--navy); }
.ring-of { font-size: 12px; color: var(--muted); margin-top: 2px; }
.row-btn { width: 100%; text-align: left; border: 0; background: var(--page); border-radius: 14px; padding: 12px; display: flex; gap: 12px; align-items: center; }
.num-badge { width: 36px; height: 36px; flex: none; border-radius: 18px; background: var(--tint); color: var(--blue-hover); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }
.num-badge.crit { background: var(--crit-bg); color: #A31C1C; }
.meta-line { margin-top: 12px; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.nudge { width: 100%; text-align: left; border: 0; background: var(--warn-bg); border-radius: 16px; padding: 14px; display: flex; gap: 12px; align-items: center; color: inherit; }
.nudge .small { color: #5A4A2A; margin-top: 2px; }
.nudge-ic { color: var(--warn-ink); font-size: 24px; }
.nudge.static { font-size: 14px; line-height: 1.45; border-radius: 14px; align-items: flex-start; }
.install { border-radius: 16px; padding: 14px; background: var(--navy); color: #fff; display: flex; gap: 12px; align-items: center; }
.install .small { color: #C7D6EE; margin-top: 2px; }
.install-ic { width: 44px; height: 44px; flex: none; border-radius: 11px; background: var(--blue); display: flex; align-items: center; justify-content: center; }
.install .icon-btn { color: #C7D6EE; }
.install .icon-btn:hover { background: rgba(255, 255, 255, .1); }

/* ── Results ── */
.score-chip { padding: 6px 10px; border-radius: 999px; font-weight: 800; font-size: 14px; background: var(--good-bg); white-space: nowrap; }
.score-chip.tone-warn { background: var(--warn-bg); } .score-chip.tone-crit { background: var(--crit-bg); }
.xrow { border-bottom: 1px solid var(--line-3); }
.xrow:last-child { border-bottom: 0; }
.xrow-btn { width: 100%; min-height: 54px; border: 0; background: transparent; display: flex; align-items: center; gap: 12px; padding: 0 16px; text-align: left; }
.status { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.status .ms { font-size: 20px; }
.xrow-body { padding: 0 16px 14px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.xrow-body .strong { color: var(--text); font-weight: 600; }
.trow { display: grid; grid-template-columns: minmax(0, 1.6fr) .8fr .8fr 1.1fr 28px; gap: 6px; padding: 11px 14px; border-top: 1px solid var(--line-3); align-items: center; font-size: 13px; }
.trow.thead { background: var(--page); border-top: 0; padding: 10px 14px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.trow > span:nth-child(n+2):nth-child(-n+4) { text-align: right; }
.trow .ms { font-size: 20px; justify-self: end; }
.tunit { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.treat-card { padding: 0; overflow: hidden; box-shadow: var(--shadow-lift); }
.treat-head { padding: 16px; display: flex; gap: 14px; }
.tag { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .05em; background: var(--tint); color: var(--blue-hover); }
.tag-crit { background: var(--crit-bg); color: #A31C1C; }
.tag-good { background: var(--good-bg); color: var(--good-ink); margin-left: 8px; vertical-align: 1px; }
.treat-name { font-size: 18px; font-weight: 800; margin-top: 6px; color: var(--navy); }
.treat-qty { font-size: 28px; font-weight: 800; color: var(--blue); line-height: 1.1; }
.treat-why { padding: 0 16px 14px; font-size: 14px; line-height: 1.5; }
.howto { margin: 0 16px; padding: 14px; border-radius: 14px; background: var(--tint-2); }
.steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; }
.step-n { width: 24px; height: 24px; flex: none; border-radius: 12px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.fact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-3); margin: 14px 16px 0; border-radius: 12px; overflow: hidden; }
.fg-cell { background: #fff; padding: 10px 12px; }
.fg-k { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--muted); display: flex; gap: 4px; align-items: center; }
.fg-v { font-size: 14px; font-weight: 600; margin-top: 3px; line-height: 1.35; }
.callout { margin: 12px 16px 0; padding: 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; display: flex; gap: 8px; }
.callout .ms { font-size: 18px; }
.callout-crit { background: var(--crit-bg); color: var(--crit-ink); }
.callout-good { background: var(--good-bg); color: var(--good-ink); }
.treat-actions { padding: 14px 16px 16px; display: grid; gap: 8px; }
.big-good { font-size: 18px; font-weight: 800; color: var(--good); }
.tip { padding: 14px; border-radius: 16px; background: var(--warn-bg); display: flex; gap: 10px; font-size: 14px; line-height: 1.45; }
.tip-ic { color: var(--warn-ink); }

/* ── History chart ── */
.chart-card { padding: 14px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: 14px; font-size: 15px; }
.chart-plot { position: relative; margin-top: 6px; }
.chart-plot svg { display: block; overflow: visible; }
.tick { position: absolute; left: 0; width: 8%; text-align: right; font-size: 10px; color: var(--muted); line-height: 1; transform: translateY(-50%); top: var(--top); }
.chart .band { fill: var(--good-bg); }
.chart .grid { stroke: var(--line-3); }
.chart .line { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: #fff; stroke: var(--blue); stroke-width: 2; }
.chart .dot.last { fill: var(--blue); }
.xlabels { position: absolute; left: 9.3%; right: 3.1%; bottom: 2px; display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.legend-swatch { width: 14px; height: 10px; background: var(--good-bg); border-radius: 2px; }
.hist-row { width: 100%; border: 0; border-top: 1px solid var(--line-3); background: #fff; display: flex; align-items: center; gap: 12px; padding: 12px 16px; text-align: left; }
.hist-row:first-child { border-top: 0; }
.mini-ring { width: 42px; height: 42px; flex: none; border-radius: 21px; border: 3px solid currentColor; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }
.hist-row .mini-ring { color: var(--good); } .hist-row .mini-ring.tone-warn { color: #E0A100; } .hist-row .mini-ring.tone-crit { color: var(--crit); }
.trend { font-size: 13px; font-weight: 700; }

/* ── My Pool, equipment ── */
.pool-photo { height: 150px; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .9);
  background: repeating-linear-gradient(170deg, rgba(255, 255, 255, .16) 0 2px, transparent 2px 20px), linear-gradient(180deg, #8EC5F2, #3E88D8); }
.pool-photo .ms { font-size: 48px; }
.pool-head { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pool-title { font-size: 19px; font-weight: 800; color: var(--navy); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { text-align: left; border: 0; background: #fff; border-radius: 16px; padding: 14px; min-height: 104px; display: flex; flex-direction: column; gap: 6px; color: inherit; box-shadow: var(--shadow); }
.tile:hover { box-shadow: 0 0 0 2px var(--blue); }
.tile-ic { color: var(--blue); font-size: 26px; }
.tile-label { font-size: 15px; font-weight: 700; color: var(--navy); }
.tile-sub { font-size: 12px; color: var(--muted); line-height: 1.35; }
.kv-card { padding: 6px 16px; border-radius: 18px; }
.kv-title { font-size: 15px; font-weight: 800; color: var(--navy); padding: 10px 0 4px; }
.facts { display: grid; }
.fact { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-3); font-size: 14px; }
.kv-card > .facts:first-child .fact:first-child { border-top: 0; }
.fact-v { font-weight: 600; text-align: right; }
.equip-row { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; }
.equip-row:hover { box-shadow: 0 0 0 2px var(--blue); }
.equip-ic { width: 64px; height: 64px; flex: none; border-radius: 12px; background: var(--tint-2); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.equip-ic .ms { font-size: 30px; }
.equip-ic.sm { width: 44px; height: 44px; border-radius: 10px; }
.equip-ic.sm .ms { font-size: 22px; }
.flag { padding: 3px 8px; border-radius: 6px; background: #FFF0D1; color: #7A4800; font-size: 11px; font-weight: 800; white-space: nowrap; }
.equip-photo { height: 170px; border-radius: 18px; background: linear-gradient(135deg, #EEF2F8, #F6F8FC); display: flex; align-items: center; justify-content: center; color: var(--faint); }
.equip-photo .ms { font-size: 56px; }
.timeline { display: grid; gap: 12px; margin: 8px 0 6px; }
.tl-item { display: flex; gap: 12px; font-size: 14px; }
.tl-dot { width: 10px; height: 10px; margin-top: 5px; flex: none; border-radius: 5px; background: var(--blue); }
.buy-row { display: flex; gap: 12px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line-3); }
.buy-row:last-child { border-bottom: 0; }

/* ── Shop & cart ── */
.cart-btn { position: relative; width: 44px; height: 44px; border: 0; border-radius: 22px; background: #fff; display: flex; align-items: center; justify-content: center; color: var(--navy); box-shadow: 0 1px 2px rgba(11, 42, 91, .08); }
.cart-count { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.product { display: flex; gap: 14px; padding: 14px; border-radius: 18px; }
.product-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.product-body .btn { margin-top: auto; width: 100%; }
.why { align-self: flex-start; padding: 2px 7px; border-radius: 5px; background: var(--tint); color: var(--blue-hover); font-size: 11px; font-weight: 800; margin-bottom: 4px; }
.price { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 10px; flex-wrap: wrap; }
.price-n { font-size: 19px; font-weight: 800; }
.dark-cta { border: 0; border-radius: 18px; background: var(--navy); color: #fff; padding: 18px; text-align: left; display: flex; gap: 12px; align-items: center; }
.dark-cta .small { color: #C7D6EE; margin-top: 2px; }
.cta-title { font-size: 17px; font-weight: 800; }
.cart-row { display: flex; gap: 12px; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--line-3); }
.qty { display: flex; align-items: center; gap: 4px; }
.qty-btn { width: 40px; height: 40px; border-radius: 20px; border: 1.5px solid var(--line); background: #fff; color: var(--navy); display: flex; align-items: center; justify-content: center; }
.qty-btn .ms { font-size: 20px; }
.qty-n { min-width: 24px; text-align: center; font-weight: 800; }
.cart-total { display: flex; justify-content: space-between; padding: 14px 16px; font-size: 15px; }

/* ── Help, notifications, profile ── */
.help-item { width: 100%; text-align: left; border: 0; background: #fff; color: var(--navy); border-radius: 18px; padding: 16px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow); text-decoration: none; }
.help-item:hover { text-decoration: none; color: var(--navy); }
.help-ic { width: 48px; height: 48px; flex: none; border-radius: 24px; background: var(--tint); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.help-label { font-size: 17px; font-weight: 800; }
.help-item.dark { background: var(--navy); color: #fff; }
.help-item.dark .help-ic { background: var(--blue); color: #fff; }
.ai-head { display: flex; align-items: center; gap: 10px; }
.ai-avatar { width: 40px; height: 40px; border-radius: 20px; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; }
.ai-title { font-size: 18px; font-weight: 800; color: var(--navy); }
.notif { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line-3); background: #fff; display: flex; gap: 12px; padding: 14px 16px; }
.notif.unread { background: #F2F7FE; }
.notif-ic { width: 38px; height: 38px; flex: none; border-radius: 19px; background: var(--tint); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.notif-ic .ms { font-size: 20px; }
.profile-head { display: flex; gap: 14px; align-items: center; }
.avatar { width: 60px; height: 60px; flex: none; border-radius: 30px; background: var(--navy); color: #fff; font-size: 24px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.avatar.sm { width: 40px; height: 40px; font-size: 16px; }
.menu { padding: 4px 16px; border-radius: 18px; }
.menu-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); padding: 12px 0 4px; }
.menu-row { width: 100%; min-height: 50px; border: 0; border-top: 1px solid var(--line-3); background: transparent; display: flex; align-items: center; gap: 12px; text-align: left; padding: 0; font-size: 15px; font-weight: 600; }
.menu > .menu-row:first-child { border-top: 0; }
.menu-row:disabled { cursor: default; }
.menu-ic { color: var(--blue); font-size: 21px; }
.menu-row.danger, .menu-row.danger .menu-ic { color: var(--crit); }
.pref-head { padding: 12px 0 6px; }
.switch-row { width: 100%; min-height: 54px; border: 0; border-top: 1px solid var(--line-3); background: transparent; display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px 0; }
.switch-label { display: block; font-size: 15px; font-weight: 600; }
.switch-sub { display: block; font-size: 12px; color: var(--muted); }
.switch { position: relative; width: 50px; height: 30px; flex: none; border-radius: 15px; background: var(--line); transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .2s; }
.switch-row[aria-checked="true"] .switch { background: var(--blue); }
.switch-row[aria-checked="true"] .switch::after { left: 23px; }

/* ── Toast, skeleton, offline ── */
.toast { position: fixed; left: 50%; transform: translateX(-50%); width: calc(min(480px, 100vw) - 32px); bottom: calc(96px + var(--safe-bottom)); z-index: 30; padding: 12px 16px; border-radius: 12px; background: var(--navy); color: #fff; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.toast > span:nth-child(2) { flex: 1; }
.toast-ic { color: #7FB2FF; font-size: 20px; }
.toast-btn { border: 0; background: transparent; color: #7FB2FF; font-weight: 800; padding: 6px 4px; }
.sk { border-radius: 16px; background: linear-gradient(90deg, #E8EEF6 25%, #F1F5FA 50%, #E8EEF6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.sk-title { height: 30px; width: 55%; border-radius: 8px; } .sk-card { height: 140px; } .sk-card.short { height: 90px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.offline-bar { display: none; }
body.is-offline .offline-bar { display: flex; position: sticky; top: calc(52px + var(--safe-top)); z-index: 19; gap: 8px; align-items: center; justify-content: center; padding: 6px 12px; background: var(--warn-bg); color: var(--warn-ink); font-size: 13px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── Install guide ── */
.install-screen { padding-bottom: 120px; }
.install-hero { display: grid; justify-items: center; text-align: center; gap: 8px; padding-top: 8px; }
.install-app-icon { border-radius: 16px; box-shadow: 0 6px 18px rgba(11, 42, 91, .25); }
.perks { list-style: none; margin: 0; padding: 14px 16px; display: grid; gap: 12px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); font-size: 14px; line-height: 1.4; }
.perks li { display: flex; gap: 12px; align-items: flex-start; }
.isteps { list-style: none; margin: 0; padding: 4px 16px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); }
.istep { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-3); }
.istep:first-child { border-top: 0; }
.istep-n { width: 28px; height: 28px; flex: none; border-radius: 14px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.istep-text { font-size: 15px; font-weight: 600; }
.istep-ic { width: 40px; height: 40px; flex: none; border-radius: 10px; background: var(--tint); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.state-ic.good { background: var(--good-bg); color: var(--good); }
.mt { margin-top: 8px; }
.share-arrow { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(8px + var(--safe-bottom)); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--blue); pointer-events: none; }
.share-arrow.right { left: auto; right: 14px; transform: none; align-items: flex-end; }
.share-arrow-label { background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 10px; box-shadow: 0 6px 16px rgba(20, 96, 214, .35); }
.share-arrow .ms { font-size: 34px; }
.share-arrow.right .ms { margin-right: 6px; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
.bounce { animation: bounce 1.1s ease-in-out infinite; }

/* ── Booking ── */
.book .q { font-size: 14px; font-weight: 700; margin-bottom: 8px; display: block; }
.chip-lg { min-height: 40px; height: auto; padding: 8px 14px; border-radius: 20px; font-size: 14px; font-weight: 600; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip-box { height: 44px; border-radius: 12px; font-size: 13px; }
.textarea { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; font-size: 15px; resize: vertical; background: #fff; }
.textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(20, 96, 214, .15); }
.photo-btn { height: 56px; border: 1.5px dashed #9FB6D6; border-radius: 12px; background: #fff; color: var(--blue); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.thumbs:empty { display: none; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--line-3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.uploading img { opacity: .5; }
.thumb-x { position: absolute; top: 3px; right: 3px; width: 26px; height: 26px; border-radius: 13px; border: 0; background: rgba(11, 42, 91, .75); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.thumb-x .ms { font-size: 16px; }
.thumb-spin { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--navy); }
.seg-btn.on.urgent { color: var(--crit); }
.contact-card { padding: 12px 14px; border-radius: 14px; font-size: 14px; }
.done-screen { padding: 48px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.done-screen .btn { margin-top: 4px; }
.done-ic { width: 72px; height: 72px; border-radius: 36px; background: var(--good-bg); color: var(--good); display: flex; align-items: center; justify-content: center; }
.done-ic .ms { font-size: 40px; }
.ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); background: #fff; padding: 6px 10px; border-radius: 6px; }
.tag-blue { background: var(--tint); color: var(--blue-hover); }
.tag-warn { background: var(--warn-bg); color: var(--warn-ink); }
.tag-muted { background: var(--line-3); color: var(--muted); }
.requests .tag, .buy-row .tag { margin-left: 0; white-space: nowrap; }

/* ── Ask Pool Patrol chat ── */
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 100%; padding-bottom: 12px; }
.chat-list { display: flex; flex-direction: column; gap: 10px; }
.bubble-row { display: flex; }
.bubble-row.me { justify-content: flex-end; }
.bubble { max-width: 84%; padding: 11px 14px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.them .bubble { background: #fff; color: var(--text); border-radius: 18px 18px 18px 4px; box-shadow: var(--shadow); }
.me .bubble { background: var(--blue); color: #fff; border-radius: 18px 18px 4px 18px; }
.bubble-author { font-size: 12px; font-weight: 700; color: var(--blue); margin-bottom: 2px; }
.bubble-time { font-size: 11px; opacity: .7; margin-top: 4px; text-align: right; }
.chat-wait { align-self: flex-start; display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); padding: 2px 4px; }
.suggest { min-height: 36px; padding: 6px 12px; border-radius: 18px; border: 1.5px solid #BBD2F2; background: var(--tint); color: var(--blue-hover); font-size: 13px; font-weight: 600; text-align: left; }
.chat-bar { position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 8px 0 4px; background: var(--page); margin-top: auto; }
.chat-input { flex: 1; min-width: 0; height: 48px; border: 1.5px solid var(--line); border-radius: 24px; padding: 0 16px; font-size: 15px; background: #fff; }
.chat-input:focus { outline: none; border-color: var(--blue); }
.send-btn { width: 48px; height: 48px; flex: none; border: 0; border-radius: 24px; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; }
.send-btn:disabled { opacity: .6; }

/* Shop: rewards and promotions */
.card.reward { display: flex; gap: 12px; align-items: center; background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; border: 0; }
.card.reward .small { color: #D6E4FA; margin-top: 2px; }
.reward-kicker, .offer-kicker { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.reward-kicker { color: #BFD5F7; }
.card.offer { border: 1.5px dashed var(--blue); background: var(--tint-2); }
.offer-kicker { display: flex; gap: 6px; align-items: center; color: var(--blue); margin-bottom: 4px; }
.offer-kicker .ms { font-size: 18px; }
.card.offer p { margin: 4px 0 0; }
