:root {
  color-scheme: light;
  --canvas: #f1f2f4;
  --surface: linear-gradient(145deg, rgb(255 255 255 / .88), rgb(244 252 254 / .52) 72%);
  --ink: #183746;
  --muted: #506d7b;
  --line: rgb(102 152 172 / .22);
  --glass-rim: rgb(255 255 255 / .90);
  --glass-control: rgb(255 255 255 / .55);
  --accent: #086973;
  --accent-deep: #075660;
  --accent-soft: rgb(185 239 234 / .55);
  --shadow: 0 11px 27px rgb(47 91 111 / .075), inset 0 1px 2px rgb(255 255 255 / .9);
  --radius: 23px;
  --sidebar-width: 208px;
  --gutter: 36px;
  --gap: 18px;
  --motion-ease: cubic-bezier(.22, .7, .25, 1);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100vh; background: var(--canvas); color: var(--ink); isolation: isolate; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at 0% 5%, #fafafb 0%, transparent 60%),
    radial-gradient(ellipse at 98% 0%, #e8e9ed 0%, transparent 55%),
    radial-gradient(ellipse at 95% 100%, #dfe3e9 0%, transparent 58%);
  pointer-events: none;
}
button, input, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .48; }
a { color: inherit; text-decoration: none; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid #16878f;
  outline-offset: 3px;
}
h1, h2, p, dl, dd { margin: 0; }
[hidden] { display: none !important; }
.icon { width: 22px; height: 22px; flex: none; vertical-align: middle; }
.muted { color: var(--muted); font-size: .85rem; }

.sidebar {
  position: fixed;
  z-index: 2;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  background: rgb(251 254 255 / .64);
  border-right: 1px solid var(--glass-rim);
  box-shadow: 6px 0 22px rgb(34 78 102 / .04);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  padding: 25px 16px 18px;
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 1.125rem; font-weight: 800; line-height: 1.2; word-break: keep-all; }
.wordmark img { flex: none; width: 39px; height: 39px; filter: drop-shadow(0 3px 6px rgb(10 116 125 / .16)); }
.sidebar > .wordmark { margin: 0 8px 42px; }
.desktop-nav { display: grid; gap: 6px; }
.desktop-nav a {
  min-height: 49px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 15px;
  color: var(--muted);
  font-weight: 650;
}
.desktop-nav a:hover { background: var(--glass-control); color: var(--ink); }
.desktop-nav a[aria-current] {
  background: linear-gradient(145deg, rgb(224 253 249 / .96), rgb(178 232 230 / .69));
  border-color: var(--glass-rim);
  box-shadow: 0 4px 12px rgb(41 112 124 / .08), inset 0 1px 2px #fff;
  color: var(--accent-deep);
}
.desktop-nav .icon { width: 23px; height: 23px; }
.sidebar-card { margin-top: auto; }
.sidebar-pass {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 11px 9px;
  border: 1px solid var(--glass-rim);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.sidebar-pass:hover { border-color: #b2d6d5; }
.sidebar-card-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.sidebar-card-icon .icon { width: 18px; height: 18px; }
.sidebar-pass small { display: block; color: var(--muted); font-size: .66rem; }
.sidebar-pass strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .83rem; }
.sidebar-pass > .icon { width: 14px; height: 14px; color: var(--muted); }

.main-shell { margin-inline-start: var(--sidebar-width); }
.topbar {
  background: linear-gradient(110deg, rgb(255 255 255 / .76), rgb(248 248 249 / .48));
  border-bottom: 1px solid var(--glass-rim);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.topbar-inner, .content { width: min(100%, 1296px); margin-inline: auto; padding-inline: var(--gutter); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 61px; }
.current-page { font-size: .83rem; font-weight: 680; color: var(--muted); }
.mobile-brand, .mobile-nav { display: none; }
.glass-definitions { position: absolute; pointer-events: none; }
.connection-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--glass-rim);
  border-radius: 999px;
  background: var(--glass-control);
  box-shadow: 0 2px 6px rgb(44 103 115 / .055), inset 0 1px 1px #fff;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 720;
  white-space: nowrap;
}
.connection-chip:hover:not(:disabled) { background: var(--accent-soft); }
.connection-chip i { width: 7px; height: 7px; border-radius: 50%; background: #a4aeb6; }
.connection-chip[data-state="online"] i { background: #15936f; box-shadow: 0 0 0 3px rgb(160 229 207 / .36); }
.connection-chip[data-state="offline"] i { background: #ba5834; }
.connection-chip[data-state="saving"] i { background: #b57c22; }
.content { padding-top: 28px; padding-bottom: 44px; outline: none; }
.loading-panel { padding: 38px 8px; color: var(--muted); }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 22px; }
.page-heading > div { min-width: 0; }
.page-heading h1 { font-size: clamp(1.8rem, 2.85vw, 2.5rem); letter-spacing: -.035em; line-height: 1.2; font-weight: 820; }
.page-heading p { margin-top: 7px; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.page-heading > .button { flex: none; }

.button, .icon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  min-height: 42px;
  border-radius: 14px;
  background: transparent;
  font-weight: 720;
  font-size: .86rem;
  white-space: nowrap;
  transition: background .16s, color .16s, border-color .16s, transform .18s var(--motion-ease);
}
.button:not(:disabled):active, .icon-button:not(:disabled):active { transform: scale(.965); }
.button { padding: 0 13px; }
.button .icon { width: 17px; height: 17px; }
.button--primary {
  background: linear-gradient(155deg, #ddfaf3, #9ddfdc);
  color: #074a54;
  border-color: rgb(94 177 182 / .31);
  box-shadow: inset 0 1px 2px rgb(255 255 255 / .92), 0 4px 9px rgb(20 123 129 / .105);
}
.button--primary:hover:not(:disabled) { background: linear-gradient(155deg, #cef7ee, #87d8d4); }
.button--soft { color: var(--accent-deep); background: var(--accent-soft); border-color: var(--glass-rim); box-shadow: 0 3px 7px rgb(18 102 111 / .07); }
.button--soft:hover:not(:disabled) { background: #d7f7f2; }
.button--quiet { color: var(--muted); background: var(--glass-control); border-color: var(--line); }
.button--quiet:hover:not(:disabled) { color: var(--accent-deep); background: #e7f8fa; }
.button--text { color: var(--accent); padding-inline: 7px; }
.button--text:hover, .text-link:hover { color: var(--accent-deep); background: var(--accent-soft); }
.button--danger { background: #a93438; color: #fff; }
.button--danger:hover { background: #8b272d; }
.button--danger-text { color: #a13338; background: #fdf0f0; }
.button--danger-text:hover { background: #f9e2e4; }
.icon-button { width: 42px; padding: 0; color: var(--muted); background: var(--glass-control); border-color: var(--glass-rim); }
.icon-button:hover { background: var(--accent-soft); color: var(--accent-deep); }
.icon-button .icon { width: 19px; height: 19px; }
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 37px;
  padding: 0 5px 0 8px;
  margin-right: -4px;
  border-radius: 8px;
  color: var(--accent);
  font-weight: 680;
  font-size: .82rem;
  white-space: nowrap;
}
.text-link .icon { width: 15px; height: 15px; }

.panel { min-width: 0; background: var(--surface); border: 1px solid var(--glass-rim); border-radius: var(--radius); box-shadow: var(--shadow); padding: 19px 21px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel h2 { font-size: 1.04rem; line-height: 1.35; font-weight: 760; letter-spacing: -.017em; }
.overview-grid, .analytics-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(286px, 1fr); gap: var(--gap); }
.overview-actions { min-width: 0; display: grid; gap: var(--gap); }
.overview-lower { margin-top: var(--gap); }

.pool-card, .theme-preview {
  --card-frost: #d9eff7;
  --tint: linear-gradient(101deg, #f5fdff 0%, rgb(228 246 252 / .96) 39%, rgb(200 237 249 / .66) 69%, rgb(159 226 244 / .26));
  background:
    linear-gradient(0deg, var(--card-frost) 2%, transparent 58%),
    var(--tint), #c3e5f1 url("/assets/pool.webp") 81% 50% / cover no-repeat;
}
.theme-reef {
  --card-frost: #d8f2ea;
  --tint: linear-gradient(101deg, #f2fffa 0%, rgb(222 249 238 / .97) 39%, rgb(182 239 220 / .71) 69%, rgb(133 225 198 / .35));
}
.theme-night {
  --card-frost: #ecedf9;
  --tint: linear-gradient(101deg, #fcfaff 0%, rgb(241 234 254 / .97) 39%, rgb(223 208 250 / .76) 69%, rgb(199 179 247 / .46));
}
.pool-card {
  position: relative;
  min-width: 0;
  padding: 24px 26px 22px;
  border: 1px solid var(--glass-rim);
  border-radius: 26px;
  color: #153a49;
  box-shadow: 0 11px 26px rgb(25 91 111 / .14), inset 0 1px 2px #fff, inset 0 -2px 3px rgb(89 149 173 / .12);
}
.overview-hero { min-height: 280px; display: flex; flex-direction: column; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.hero-tag, .hero-status {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid var(--glass-rim);
  border-radius: 999px;
  background: rgb(251 255 255 / .68);
  box-shadow: inset 0 1px 1px #fff, 0 2px 5px rgb(39 94 113 / .07);
  color: #234f5c;
  font-size: .8rem;
  font-weight: 720;
  -webkit-backdrop-filter: blur(8px) saturate(145%);
  backdrop-filter: blur(8px) saturate(145%);
}
.hero-tag .icon { width: 17px; height: 17px; }
.hero-tag > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.hero-tag { min-height: 36px; padding-block: 4px; }
button.hero-tag:hover { background: rgb(255 255 255 / .91); }
.hero-status { flex: none; gap: 6px; color: var(--accent-deep); font-size: .69rem; }
.hero-status i { width: 6px; height: 6px; border-radius: 50%; background: #168879; box-shadow: 0 0 0 2px rgb(132 212 196 / .28); }
.hero-price { margin: 22px 0 21px; }
.hero-caption { display: block; margin-bottom: 7px; color: #365e70; font-weight: 650; font-size: .83rem; }
.price-display { display: flex; align-items: baseline; gap: 10px; }
.price-display strong { font-size: clamp(3.4rem, 6vw, 5.15rem); line-height: .98; letter-spacing: -.065em; font-weight: 790; overflow-wrap: anywhere; }
.price-display--long strong { font-size: clamp(2.35rem, 4.45vw, 4.05rem); }
.price-display > span { flex: none; color: #3c6474; font-size: .96rem; font-weight: 680; }
.hero-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding-top: 13px; border-top: 1px solid rgb(73 126 147 / .22); margin-top: auto; }
.hero-facts > div:not(:first-child) { border-left: 1px solid rgb(73 126 147 / .19); padding-left: 15px; }
.hero-facts > div { padding-right: 7px; }
.hero-facts dt { color: #416677; font-size: .75rem; }
.hero-facts dd { margin-top: 3px; font-size: 1.21rem; line-height: 1.25; font-weight: 760; overflow-wrap: anywhere; }

.checkin-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(ellipse at 4% 0%, rgb(200 245 234 / .61), transparent 75%), var(--surface);
}
.checkin-heading { display: flex; align-items: center; gap: 11px; }
.checkin-heading h2 { font-size: 1.12rem; }
.checkin-heading p { margin-top: 3px; color: var(--muted); font-size: .8rem; }
.checkin-glyph {
  display: grid;
  place-items: center;
  flex: none;
  width: 45px;
  height: 45px;
  border-radius: 13px;
  background: linear-gradient(145deg, #f2fffd, #c5f0e9);
  box-shadow: inset 0 1px 2px #fff, 0 0 0 1px rgb(100 177 178 / .19);
  color: var(--accent);
}
.checkin-glyph .icon { width: 25px; height: 25px; }
.checkin-buttons { display: flex; gap: 8px; }
.checkin-buttons .button--primary { flex: 1; }
.progress-number { color: var(--accent); font-size: 1.24rem; line-height: 1.2; font-weight: 780; white-space: nowrap; }
.progress-track { height: 8px; border-radius: 999px; overflow: hidden; background: rgb(110 166 184 / .18); box-shadow: inset 0 1px 2px rgb(63 115 134 / .08); margin: 14px 0 9px; }
.progress-track > span {
  display: block;
  width: var(--progress);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2494ab, #40b9a6);
  transform-origin: left center;
  animation: progress-fill 420ms var(--motion-ease) both;
}
@keyframes progress-fill { from { transform: scaleX(0); } }
.progress-footer { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--muted); font-size: .77rem; }
.progress-footer .button { min-height: 30px; margin-block: -7px; }
.home-progress { align-content: center; }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: var(--gap); }
.metric-tile { display: grid; align-content: start; gap: 7px; padding-block: 14px; }
.metric-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .82rem; font-weight: 670; }
.metric-glyph {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
}
.metric-glyph .icon { width: 17px; height: 17px; }
.metric-value { padding-left: 40px; color: var(--ink); line-height: 1.15; overflow-wrap: anywhere; }
.metric-value strong { font-size: clamp(1.15rem, 2.5vw, 1.56rem); font-weight: 790; letter-spacing: -.034em; }
.metric-value small { font-size: .77rem; margin-left: 2px; color: var(--muted); font-weight: 700; }
.metric-value .button { min-height: 33px; margin-block: -6px; margin-left: -7px; }

.record-list { list-style: none; margin: 6px 0 0; padding: 0; }
.record-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; min-height: 57px; }
.record-row + .record-row { border-top: 1px solid var(--line); }
.record-glyph { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; }
.record-glyph .icon { width: 18px; height: 18px; }
.kind-checkin { color: #0b6d73; background: #e0f3f1; }
.kind-backfill { color: #845019; background: #fbefda; }
.kind-note { color: #634888; background: #f1eafa; }
.record-copy { min-width: 0; flex: 1; }
.record-title { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 7px; }
.record-title strong { font-size: .9rem; font-weight: 720; }
.kind-tag { padding: 3px 6px; border-radius: 6px; font-size: .67rem; font-weight: 720; white-space: nowrap; }
.record-copy p { margin-top: 4px; color: var(--muted); font-size: .78rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.record-visits { flex: none; font-size: .86rem; font-weight: 750; color: var(--accent); }
.record-edit { flex: none; width: 36px; min-height: 36px; }
.record-edit .icon { width: 15px; height: 15px; }

.bars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; align-items: end; padding-top: 16px; }
.bar-column { display: grid; justify-items: center; gap: 7px; font-size: .74rem; color: var(--muted); }
.bar-column strong { font-size: .82rem; font-weight: 710; }
.bar-column.bar-current { color: var(--accent-deep); font-weight: 740; }
.bar-track { position: relative; width: min(29px, 68%); height: 101px; border-radius: 999px; overflow: hidden; background: rgb(115 174 187 / .15); box-shadow: inset 0 1px 2px rgb(60 115 128 / .07); }
.bar-track > div {
  position: absolute;
  inset: auto 0 0;
  height: var(--fill);
  border-radius: inherit;
  background: linear-gradient(180deg, #6ed3c7, #2e97aa);
  box-shadow: inset 0 1px 2px rgb(255 255 255 / .6);
  transform-origin: center bottom;
  animation: bar-rise 420ms var(--motion-ease) both;
}
@keyframes bar-rise { from { transform: scaleY(0); } }
.overview-lower .monthly-panel { padding-top: 19px; }

.cards-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.pass-card { min-width: 0; border: 1px solid var(--glass-rim); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); }
.pass-front { box-shadow: inset 0 1px 2px #fff; min-height: 228px; }
.pass-title { margin-top: 18px; overflow-wrap: anywhere; }
.pass-title h2 { font-size: clamp(1.45rem, 2.6vw, 1.95rem); line-height: 1.2; }
.pass-title p, .pass-dates { color: #3b6777; font-size: .8rem; margin-top: 6px; }
.pass-dates { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 13px; }
.pass-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 5px; padding: 8px 12px; }
.pass-controls > div { display: flex; gap: 6px; }
.pass-controls .button { min-height: 35px; padding-inline: 10px; }
.current-pass { display: inline-flex; align-items: center; gap: 3px; color: var(--accent); font-size: .79rem; font-weight: 720; }
.current-pass .icon { width: 16px; height: 16px; }

.calendar-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, 1fr); align-items: start; gap: var(--gap); }
.calendar-panel { padding: 21px 23px; }
.calendar-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: center; }
.calendar-top h2 { font-size: 1.26rem; }
.calendar-top p, .day-panel-heading p { color: var(--muted); font-size: .84rem; margin-top: 5px; }
.month-arrow { color: var(--accent); background: var(--accent-soft); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin-top: 16px; }
.weekday { color: var(--muted); text-align: center; padding-block: 5px; font-weight: 670; font-size: .81rem; }
.day-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 43px;
  aspect-ratio: 1.04;
  max-height: 62px;
  padding: 0 0 5px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: rgb(229 245 250 / .68);
  color: var(--ink);
  font-weight: 740;
  font-size: .92rem;
}
.day-cell.other-month { color: #657e8a; background: transparent; }
.day-cell.is-today { border-color: #89c9cb; color: var(--accent); }
.day-cell:hover { background: #dff6f5; }
.day-cell[aria-pressed="true"] {
  color: var(--accent-deep);
  background: linear-gradient(145deg, #e0fbf5, #aee5e3);
  border-color: #91d0d3;
  box-shadow: inset 0 1px 2px #fff, 0 3px 7px rgb(28 107 116 / .08);
}
.day-markers { position: absolute; bottom: 6px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; }
.day-markers i, .calendar-legend i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.dot-checkin { background: #168b89; }
.dot-backfill { background: #b57027; }
.dot-note { background: #8758bc; }
.calendar-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 15px; color: var(--muted); font-size: .75rem; }
.calendar-legend span { display: flex; align-items: center; gap: 5px; }
.day-panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 9px; flex-wrap: wrap; }
.day-actions { display: flex; gap: 6px; }
.day-actions .button { min-height: 38px; }
.day-panel .record-row { min-height: 52px; }

.swim-trend-panel { margin-bottom: var(--gap); }
.swim-trend-selector { position: relative; max-width: 65%; }
.swim-trend-selector select {
  appearance: none;
  max-width: 100%;
  min-height: 42px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--glass-rim);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.swim-trend-selector select:focus-visible { outline: 2px solid #16878f; outline-offset: 2px; }
.swim-trend-selector .icon {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--accent-deep);
  pointer-events: none;
}
.swim-trend-figure { margin: 12px 0 0; animation: swim-trend-enter 240ms var(--motion-ease) both; }
@keyframes swim-trend-enter { from { opacity: .45; transform: translateY(4px); } }
.swim-trend-readout { display: flex; align-items: end; justify-content: space-between; gap: 9px; }
.swim-trend-readout p { color: var(--muted); font-size: .75rem; line-height: 1.45; }
.swim-trend-readout span { display: inline-block; margin-left: 4px; color: var(--muted); font-size: .72rem; }
.swim-trend-readout strong { display: inline-block; margin-top: 3px; line-height: 1.18; }
.swim-trend-selected strong { color: var(--accent-deep); font-size: clamp(1.46rem, 4.9vw, 2.08rem); font-weight: 780; }
.swim-trend-average { text-align: right; }
.swim-trend-average strong { font-size: clamp(.94rem, 3.4vw, 1.2rem); }
.swim-trend-chart {
  --plot-height: 152px;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 3px 8px;
  margin-top: 10px;
  font-size: .71rem;
  color: var(--muted);
}
.swim-trend-axis {
  display: grid;
  grid-template-rows: 1fr 1fr 0;
  height: var(--plot-height);
  padding-block: calc(var(--plot-height) * .06);
  text-align: right;
}
.swim-trend-axis span { align-self: start; transform: translateY(-50%); }
.swim-trend-canvas { position: relative; height: var(--plot-height); }
.swim-trend-canvas svg { display: block; width: 100%; height: 100%; overflow: visible; }
.swim-trend-line { fill: none; stroke: #087d87; stroke-width: 2.5px; stroke-linecap: round; stroke-linejoin: round; }
.swim-trend-guide {
  position: absolute;
  inset: 6% auto 6% var(--selected-x);
  border-left: 1px dashed rgb(8 105 115 / .4);
  pointer-events: none;
}
.swim-trend-point {
  position: absolute;
  left: var(--point-x);
  top: var(--point-y);
  width: 6px;
  height: 6px;
  transform: translate(-50%, -50%);
  border: 1px solid rgb(255 255 255 / .9);
  border-radius: 50%;
  background: #15848b;
  pointer-events: none;
}
.swim-trend-point.is-selected { width: 11px; height: 11px; border-width: 2px; box-shadow: 0 0 0 4px rgb(24 148 148 / .20); }
.swim-trend-scrubber {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y;
}
.swim-trend-canvas:has(.swim-trend-scrubber:focus-visible) { outline: 2px solid #16878f; outline-offset: 2px; border-radius: 4px; }
.swim-trend-dates { grid-column: 2; display: flex; justify-content: space-between; gap: 4px; }
.swim-trend-dates span:only-child { margin-inline: auto; }
.swim-trend-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 8px;
  justify-content: space-between;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .72rem;
}
.swim-trend-panel .empty { padding-block: 15px 9px; }

.records-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.records-tool { display: flex; align-items: center; gap: 10px; }
.records-tool > div { flex: 1; min-width: 0; }
.records-tool p { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 4px; }
.filters button {
  background: var(--glass-control);
  color: var(--muted);
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  min-height: 35px;
  font-size: .79rem;
  font-weight: 690;
}
.filters button:hover { background: #e4f0f0; }
.filters button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-deep); }

.stat-hero { min-height: 193px; background-position: 76% 46%; }
.stat-hero .hero-price { margin: 17px 0 8px; }
.stat-hero .price-display strong { font-size: clamp(3.2rem, 5.6vw, 4.8rem); }
.stat-hero .price-display--long strong { font-size: clamp(2.35rem, 4.45vw, 4.05rem); }
.hero-formula { color: #365e70; font-size: .82rem; }
.stats-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.analytics-grid { margin-top: var(--gap); }
.trend-panel .progress-number { font-size: 1rem; }
.trend-chart { display: flex; gap: 8px; margin-top: 13px; }
.trend-axis { height: 108px; display: flex; flex-direction: column; justify-content: space-between; padding: 0 0 2px; text-align: right; color: var(--muted); font-size: .68rem; }
.trend-plot { flex: 1; min-width: 0; }
.trend-plot svg { display: block; width: 100%; height: 108px; overflow: visible; }
.chart-grid { stroke: #dbe7eb; stroke-width: 1px; stroke-dasharray: 4 4; }
.trend-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .68rem; margin-top: 5px; }
.goal-panel p { margin-top: 5px; color: var(--muted); font-size: .82rem; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 25px 6px 17px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 2px; border-radius: 13px; color: var(--accent); background: var(--accent-soft); }
.empty strong { font-size: .93rem; }
.empty p { color: var(--muted); font-size: .81rem; line-height: 1.55; }
.empty .button { margin-top: 4px; }

.editor {
  --sheet-offset: 12px;
  --sheet-scale: .985;
  width: min(520px, calc(100% - 28px));
  max-height: 88vh;
  max-height: min(88dvh, 800px);
  border: 1px solid var(--glass-rim);
  border-radius: 27px;
  padding: 0;
  background: linear-gradient(150deg, rgb(255 255 255 / .96), rgb(232 248 251 / .90));
  color: var(--ink);
  box-shadow: 0 25px 75px rgb(13 51 67 / .22), inset 0 1px 2px #fff;
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  backdrop-filter: blur(22px) saturate(145%);
  overscroll-behavior: contain;
}
.editor::backdrop { background: rgb(53 92 114 / .24); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.editor[open] { animation: sheet-enter 260ms var(--motion-ease) both; }
.editor[open]::backdrop { animation: backdrop-enter 220ms ease-out both; }
@keyframes sheet-enter {
  from { opacity: 0; transform: translateY(var(--sheet-offset)) scale(var(--sheet-scale)); }
}
@keyframes backdrop-enter { from { opacity: 0; } }

@supports (transition-behavior: allow-discrete) and (overlay: auto) {
  .editor {
    opacity: 0;
    transform: translateY(var(--sheet-offset)) scale(var(--sheet-scale));
    transition: opacity 200ms ease, transform 260ms var(--motion-ease),
      display 260ms allow-discrete, overlay 260ms allow-discrete;
  }
  .editor[open] { opacity: 1; transform: none; animation: none; }
  .editor::backdrop {
    opacity: 0;
    transition: opacity 200ms ease, display 260ms allow-discrete, overlay 260ms allow-discrete;
  }
  .editor[open]::backdrop { opacity: 1; animation: none; }
  @starting-style {
    .editor[open] { opacity: 0; transform: translateY(var(--sheet-offset)) scale(var(--sheet-scale)); }
    .editor[open]::backdrop { opacity: 0; }
  }
}
.sheet { padding: 19px 21px 21px; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 15px; }
.sheet-header h2 { font-size: 1.24rem; }
.sheet-header .icon-button { min-height: 36px; width: 36px; }
.form { display: grid; gap: 12px; }
.scan-panel {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--glass-rim);
  border-radius: 15px;
  background: var(--glass-control);
}
.scan-picker { position: relative; justify-content: center; cursor: pointer; min-height: 45px; }
.scan-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.scan-picker:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.scan-picker:has(input:disabled) { opacity: .6; cursor: wait; }
.scan-status { padding-inline: 2px; }
.scan-status--error { color: #a13338; }
.swim-details { border-block: 1px solid var(--line); }
.swim-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  color: var(--accent-deep);
  cursor: pointer;
  font-size: .86rem;
  font-weight: 720;
  list-style: none;
}
.swim-details summary::-webkit-details-marker { display: none; }
.swim-details summary .icon { width: 16px; height: 16px; }
.swim-details[open] summary .icon { transform: rotate(180deg); }
.swim-details .field-grid { padding-bottom: 12px; }
.field { min-width: 0; display: grid; gap: 6px; font-size: .83rem; font-weight: 700; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field input, .field textarea {
  width: 100%;
  min-width: 0;
  min-height: 43px;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid #d7e3e8;
  background: rgb(255 255 255 / .75);
  color: var(--ink);
  font-size: 16px;
  font-weight: 520;
}
.field input::placeholder, .field textarea::placeholder { color: #687e88; font-size: .82rem; }
.field input[type="date"] { min-inline-size: 100%; padding-inline: 8px; }
.field textarea { line-height: 1.5; resize: vertical; }
.form-hint, .form-error { color: var(--muted); font-size: .79rem; line-height: 1.55; }
.form-error { color: #a13338; }
.form-actions { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.form-actions > span { flex: 1; }
.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.theme-option { position: relative; display: grid; gap: 5px; justify-items: center; text-align: center; padding: 6px 4px; border: 1px solid var(--line); border-radius: 10px; font-weight: 670; font-size: .73rem; cursor: pointer; }
.theme-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.theme-option input { width: 15px; height: 15px; accent-color: var(--accent); }
.theme-preview { width: 100%; display: block; aspect-ratio: 1.65; border-radius: 7px; }
.picker-list { display: grid; gap: 8px; }
.picker-row { display: flex; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--glass-control); text-align: left; }
.picker-row > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.picker-row small { display: block; margin-top: 3px; color: var(--muted); }
.picker-row > .icon { color: var(--accent); }
.toast {
  position: fixed;
  z-index: 5;
  bottom: 24px;
  left: 50%;
  width: max-content;
  max-width: min(440px, calc(100vw - 32px));
  transform: translateX(-50%);
  border: 1px solid var(--glass-rim);
  border-radius: 16px;
  background: rgb(237 252 251 / .96);
  color: var(--ink);
  padding: 11px 15px;
  font-size: .85rem;
  box-shadow: 0 6px 18px rgb(9 39 51 / .22);
  animation: toast-enter 230ms var(--motion-ease) both;
}
@keyframes toast-enter { from { opacity: 0; transform: translate(-50%, 7px); } }
.toast--error { background: #fff0f1; color: #8a343b; }

@media (max-width: 1090px) {
  :root { --sidebar-width: 179px; --gutter: 25px; --gap: 14px; }
  .calendar-layout { grid-template-columns: minmax(0, 1.4fr) minmax(255px, 1fr); }
}
@media (max-width: 900px) {
  :root { --gutter: 22px; }
  .sidebar, .current-page { display: none; }
  .main-shell { margin: 0; }
  .topbar-inner { padding-top: env(safe-area-inset-top, 0px); min-height: 60px; }
  .mobile-brand { display: inline-flex; min-width: 0; font-size: clamp(1rem, 4.65vw, 1.16rem); }
  .mobile-brand img { width: 35px; height: 35px; }
  .content { padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px)); }
  .mobile-nav {
    --nav-inset: 5px;
    --lens-scale: 1;
    display: grid;
    grid-template-columns: repeat(var(--tab-count), minmax(0, 1fr));
    position: fixed;
    z-index: 3;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%);
    width: min(530px, calc(100% - 28px));
    min-height: 68px;
    padding: var(--nav-inset);
    border: 1px solid rgb(255 255 255 / .89);
    border-radius: 999px;
    background:
      linear-gradient(174deg, rgb(255 255 255 / .36), transparent 33%, rgb(255 255 255 / .10) 70%, rgb(255 255 255 / .37)),
      rgb(249 250 252 / .19);
    -webkit-backdrop-filter: blur(4px) grayscale(1);
    backdrop-filter: blur(4px) grayscale(1);
    box-shadow:
      0 14px 30px rgb(38 56 78 / .22),
      0 2px 4px rgb(38 56 78 / .09),
      0 0 0 1px rgb(67 89 116 / .22),
      inset 0 4px 6px -2px rgb(255 255 255 / .92),
      inset 0 -5px 7px -2px rgb(68 87 110 / .24);
  }
  .mobile-nav[data-refraction] { backdrop-filter: var(--refraction-filter) blur(2.4px) grayscale(1); }
  .mobile-nav:empty { display: none; }
  .mobile-nav:has(> a:active) { --lens-scale: .94; }
  .mobile-nav::before {
    content: "";
    position: absolute;
    inset-block: var(--nav-inset);
    left: var(--nav-inset);
    width: calc((100% - 2 * var(--nav-inset)) / var(--tab-count));
    transform: translateX(calc(100% * var(--active-tab))) scale(var(--lens-scale));
    border-radius: inherit;
    border: 1px solid rgb(255 255 255 / .97);
    background:
      radial-gradient(ellipse at 22% -15%, rgb(255 255 255 / .82), transparent 65%),
      linear-gradient(158deg, rgb(255 255 255 / .44), rgb(255 255 255 / .12) 52%, rgb(241 243 247 / .61));
    box-shadow:
      0 0 0 1px rgb(69 89 112 / .16),
      0 3px 9px rgb(55 73 96 / .19),
      inset 0 3px 3px -1px rgb(255 255 255 / .95),
      inset 0 -4px 7px -1px rgb(80 96 119 / .26);
    transition: transform 330ms var(--motion-ease);
    pointer-events: none;
  }
  @supports (mask-composite: exclude) or (-webkit-mask-composite: xor) {
    .mobile-nav::after {
      content: "";
      position: absolute;
      inset: 0;
      padding: 3px;
      border-radius: inherit;
      background:
        radial-gradient(ellipse 30% 125% at 8% 0%, rgb(255 255 255 / .92), transparent),
        radial-gradient(ellipse 28% 115% at 96% 100%, rgb(255 255 255 / .86), transparent),
        linear-gradient(178deg, rgb(255 255 255 / .84), rgb(255 255 255 / .09) 45%, rgb(67 88 116 / .32) 86%, rgb(255 255 255 / .51));
      -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      -webkit-mask-composite: xor;
      mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
      mask-composite: exclude;
      pointer-events: none;
    }
  }
  .mobile-nav a {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 4px;
    min-height: 52px;
    border-radius: inherit;
    color: #435365;
    font-weight: 730;
    font-size: .7rem;
    text-shadow: 0 1px 2px rgb(255 255 255 / .96), 0 0 5px rgb(255 255 255 / .75);
    transition: color 180ms ease;
  }
  .mobile-nav a[aria-current] { color: #202e3c; }
  .mobile-nav a[aria-current] .icon { stroke-width: 2.1; }
  .mobile-nav .icon { width: 22px; height: 22px; filter: drop-shadow(0 1px 1px rgb(255 255 255 / .83)); }
  .toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 675px) {
  :root { --gutter: 16px; --gap: 12px; --radius: 20px; }
  .content { max-width: 540px; padding-top: 17px; }
  .topbar-inner { max-width: 540px; }
  .page-heading { margin-bottom: 15px; }
  .page-heading h1 { font-size: 1.69rem; }
  .page-heading p { margin-top: 4px; font-size: .8rem; }
  .page-heading > .button { min-height: 39px; padding-inline: 10px; font-size: .81rem; }
  .overview-grid, .analytics-grid, .cards-grid, .calendar-layout, .records-tools { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 14px 14px; }
  .pool-card { border-radius: 23px; padding: 17px 17px 16px; background-position: 80% 50%; }
  .overview-hero { min-height: 226px; }
  .hero-price { margin: 16px 0 14px; }
  .hero-caption { margin-bottom: 5px; font-size: .78rem; }
  .price-display { gap: 8px; }
  .overview-hero .price-display:not(.price-display--long) strong { font-size: 3.7rem; }
  .price-display > span { font-size: .82rem; }
  .hero-facts { padding-top: 10px; }
  .hero-facts > div:not(:first-child) { padding-left: 10px; }
  .hero-facts dd { font-size: 1rem; }
  .hero-facts dt { font-size: .68rem; }
  .checkin-panel { gap: 11px; }
  .checkin-glyph { width: 40px; height: 40px; }
  .checkin-glyph .icon { width: 22px; height: 22px; }
  .checkin-heading h2 { font-size: 1.04rem; }
  .checkin-heading p { font-size: .76rem; }
  .home-progress .progress-track { margin-top: 10px; }
  .metric-grid { gap: 8px; }
  .metric-tile { padding: 10px 9px; gap: 7px; }
  .metric-label { gap: 4px; font-size: .72rem; }
  .metric-glyph { width: 26px; height: 26px; border-radius: 8px; }
  .metric-glyph .icon { width: 15px; height: 15px; }
  .metric-value { padding-left: 2px; }
  .metric-value .button { margin-left: -2px; padding-left: 4px; font-size: .78rem; }
  .record-row { gap: 7px; }
  .record-title strong { font-size: .81rem; }
  .swim-trend-chart { --plot-height: 126px; }
  .pass-front { min-height: 205px; }
  .pass-controls { padding-inline: 9px; }
  .calendar-panel { padding-inline: 10px; }
  .calendar-grid { gap: 3px; }
  .day-cell { border-radius: 8px; min-height: 40px; }
  .stats-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-hero { min-height: 173px; }
  .editor { --sheet-offset: 24px; --sheet-scale: 1; width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 27px 27px 0 0; }
  .sheet { padding: 14px 16px calc(17px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 354px) {
  :root { --gutter: 11px; }
  .page-heading h1 { font-size: 1.45rem; }
  .page-heading > .button .icon { display: none; }
  .checkin-buttons .button { padding-inline: 9px; }
  .metric-tile { padding-inline: 6px; }
  .metric-label { font-size: .65rem; }
  .metric-label .metric-glyph { width: 20px; height: 20px; }
  .metric-value strong { font-size: 1rem; }
  .hero-facts > div:not(:first-child) { padding-left: 7px; }
  .hero-facts dd { font-size: .91rem; }
  .pass-controls .button { padding-inline: 7px; }
  .panel h2 { font-size: .92rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
  .button:not(:disabled):active, .icon-button:not(:disabled):active { transform: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .mobile-nav, .mobile-nav[data-refraction] {
    background: #f0f3f7;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .mobile-nav::before { background: #fff; }
}
