:root {
  --bg: #121212;
  --card: #181818;
  --card-2: #242424;
  --ink: #f5f5f5;
  --muted: #b3b3b3;
  --line: rgba(255, 255, 255, .10);
  --blue: #6fa6d8;
  --green: #28a856;
  --green-2: #35c56b;
  --amber: #d9b060;
  --rose: #d96f9f;
  --violet: #b9a1ff;
  --shadow: 0 18px 44px rgba(0, 0, 0, .38);
  --radius: 8px;
  --float-bottom: max(18px, env(safe-area-inset-bottom));
  --float-tab-height: 52px;
  --woodfish-size: 52px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(29, 185, 84, .16), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(77, 163, 255, .12), transparent 28%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }

.mobile-cloud-login { display: none; }

.app {
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 2fr) minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
}

/* Android 12 / older Chromium viewport fallback. */
body.legacy-viewport .app {
  min-height: 100vh;
  height: 100vh;
}

/* Mid-range Android GPUs can drop large blurred compositor layers. */
body.reduced-effects *,
body.reduced-effects *::before,
body.reduced-effects *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.reduced-effects.simple-theme::before,
body.reduced-effects.simple-theme::after {
  content: none;
  animation: none;
  filter: none;
  will-change: auto;
}

body.reduced-effects.simple-theme .simple-vaccine-reminder span {
  min-width: 100%;
  padding-left: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: none;
}

.app.history-mode {
  grid-template-rows: minmax(0, 1fr) auto;
}

.app.vaccine-mode {
  grid-template-rows: minmax(0, 1fr) auto;
}

.app.history-mode .dashboard,
.app.history-mode .records {
  display: none;
}

.app.vaccine-mode .dashboard,
.app.vaccine-mode .records,
.app.vaccine-mode .history-view {
  display: none;
}

.dashboard {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 16px;
  overflow: hidden;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255, 255, 255, .08), transparent 42%);
}

.tile > * { position: relative; }

.tile.time {
  padding-top: 8px;
  background: linear-gradient(135deg, #202020, #102417);
}
.tile.sleep { background: linear-gradient(135deg, #202020 0%, #211f2d 55%, rgba(143, 128, 216, .24) 100%); }
.tile.feed { background: linear-gradient(135deg, #202020 0%, #2c1f29 55%, rgba(217, 111, 159, .22) 100%); }
.tile.diaper { background: linear-gradient(135deg, #202020 0%, #2a251b 55%, rgba(217, 176, 96, .22) 100%); }

.tile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.tile-title {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.baby-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
  font-size: 22px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.baby-copy {
  min-width: 0;
}

.baby-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.baby-name {
  min-width: 0;
  flex: 0 1 auto;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.2;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.baby-days {
  margin-top: 3px;
  color: rgba(179, 179, 179, .72);
  font-size: 12px;
  font-weight: 400;
  white-space: normal;
  line-height: 1.4;
}

.edit-profile-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .07);
  color: rgba(245, 245, 245, .72);
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.clock {
  margin-top: auto;
  font-size: clamp(40px, 9vw, 96px);
  line-height: .95;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.time-orbit {
  display: none;
}

.date-line, .weather-line {
  color: var(--muted);
  font-size: clamp(10px, 1.8vw, 13px);
  line-height: 1.35;
}

.time-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, .8fr);
  gap: 10px;
  align-items: end;
}

.med-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.med-option {
  position: relative;
  min-width: 0;
  min-height: 28px;
  display: grid;
  grid-template-columns: 11px auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .055);
  color: rgba(245, 245, 245, .68);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  padding: 0 6px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.med-option input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.med-box {
  width: 11px;
  height: 11px;
  border-radius: 4px;
  border: 1px solid rgba(245, 245, 245, .72);
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .24);
  justify-self: center;
}

.med-label {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
}

.med-option input:checked + .med-box {
  border-color: rgba(53, 197, 107, .88);
  background: var(--green-2);
  box-shadow: inset 0 0 0 2px rgba(10, 16, 12, .62), 0 1px 4px rgba(0, 0, 0, .24);
}

.med-option:has(input:checked) {
  color: #9ff0bf;
  border-color: rgba(53, 197, 107, .36);
  background: rgba(53, 197, 107, .14);
}

.daily-checks {
  display: grid;
  gap: 6px;
}

.care-temp-btn {
  min-width: 0;
  flex: 0 0 auto;
  min-height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .055);
  color: rgba(255, 242, 214, .80);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
  padding: 0 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.care-temp-btn.temp-missing {
  color: rgba(255, 242, 214, .92);
  border-color: rgba(255, 211, 110, .26);
  background: rgba(255, 211, 110, .10);
  animation: tempPulse 2.2s ease-in-out infinite;
}

.care-temp-btn.temp-warning {
  color: #ffd36e;
  border-color: rgba(255, 211, 110, .45);
  background: rgba(217, 176, 96, .18);
}

.care-temp-btn.temp-danger {
  color: #fff;
  border-color: rgba(255, 103, 103, .60);
  background: rgba(217, 80, 80, .48);
  box-shadow: 0 0 18px rgba(217, 80, 80, .26), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.growth-record-btn {
  color: rgba(207, 231, 255, .82);
}

@keyframes tempPulse {
  0%, 100% { background: rgba(255, 211, 110, .08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10); }
  50% { background: rgba(255, 211, 110, .20); box-shadow: 0 0 14px rgba(255, 211, 110, .18), inset 0 1px 0 rgba(255, 255, 255, .16); }
}

.care-option {
  color: rgba(255, 242, 214, .70);
}

.care-option input:checked + .med-box {
  border-color: rgba(255, 211, 110, .90);
  background: #ffd36e;
  box-shadow: inset 0 0 0 2px rgba(24, 18, 5, .58), 0 1px 4px rgba(0, 0, 0, .24);
}

.care-option:has(input:checked) {
  color: #ffd36e;
  border-color: rgba(255, 211, 110, .35);
  background: rgba(217, 176, 96, .13);
}

.metric {
  margin-top: auto;
  font-size: clamp(24px, 5.2vw, 54px);
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.sub-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.mini {
  border: 1px solid rgba(102, 115, 133, .18);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: rgba(255, 255, 255, .06);
  min-width: 0;
}

.mini span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.mini strong {
  display: block;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 0;
}

.big-action, .choice-btn {
  min-height: 48px;
  border-radius: var(--radius);
  color: #0b0f0c;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 10px 22px rgba(0, 0, 0, .24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: transform .15s ease, filter .15s ease;
}

.big-action:hover, .choice-btn:hover, .export-btn:hover,
.quick-amounts button:hover, .side-choice:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.big-action.sleep-btn { background: var(--violet); }
.big-action.sleep-btn.ending { background: #d95050; color: #ffffff; }
.choice-btn.feed-btn { background: #ff8fb0; }
.choice-btn.diaper-btn { background: #ffd36e; }

.records {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f1a2a;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.history-view {
  min-height: 0;
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f1a2a;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.app.history-mode .history-view {
  display: grid;
}

.vaccine-view {
  min-height: 0;
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f1a2a;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.app.vaccine-mode .vaccine-view {
  display: grid;
}

.vaccine-head-actions,
.vaccine-next-actions > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vaccine-content {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(112, 199, 247, .09), transparent 28%),
    radial-gradient(circle at 88% 2%, rgba(255, 143, 176, .08), transparent 24%),
    #0d1828;
}

.vaccine-next-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 118px;
  padding: 18px;
  border: 2px solid rgba(112, 199, 247, .50);
  border-radius: var(--radius);
  background: rgba(22, 39, 58, .82);
  box-shadow: 0 0 22px rgba(112, 199, 247, .10), inset 0 1px 0 rgba(255, 255, 255, .10);
}

.vaccine-next-card.due-soon {
  border-color: rgba(255, 211, 110, .90);
  background: rgba(56, 47, 26, .62);
  box-shadow: 0 0 26px rgba(255, 211, 110, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.vaccine-next-card.overdue {
  border-color: rgba(255, 100, 110, .94);
  background: rgba(65, 30, 34, .62);
  box-shadow: 0 0 28px rgba(255, 74, 92, .22), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.vaccine-next-card.overdue .vaccine-next-actions > strong {
  color: #ff6f79;
}

.vaccine-eyebrow {
  color: #70c7f7;
  font-size: 12px;
  font-weight: 900;
}

.vaccine-next-copy h3 {
  margin: 7px 0 5px;
  font-size: clamp(20px, 2.3vw, 30px);
}

.vaccine-next-copy p,
.vaccine-section-head p,
.vaccine-disclaimer {
  margin: 0;
  color: rgba(179, 179, 179, .72);
  font-size: 12px;
  line-height: 1.5;
}

.vaccine-next-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
  flex: 0 0 auto;
}

.vaccine-next-actions > strong {
  color: #ffd36e;
  font-size: clamp(20px, 3vw, 32px);
  line-height: 1;
}

.vaccine-primary-btn,
.vaccine-calendar-btn,
.vaccine-filter-btn,
.vaccine-card-action {
  min-height: 34px;
  border: 1px solid rgba(112, 199, 247, .30);
  border-radius: 8px;
  background: rgba(112, 199, 247, .13);
  color: #d7ecff;
  font-size: 12px;
  font-weight: 900;
}

.vaccine-primary-btn { padding: 0 14px; }
.vaccine-calendar-btn { width: 36px; padding: 0; font-size: 16px; }

.vaccine-progress-panel {
  margin-top: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .045);
}

.vaccine-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vaccine-section-head h3 {
  margin: 0 0 3px;
  font-size: 14px;
}

.vaccine-filter {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 999px;
  background: rgba(0, 0, 0, .18);
}

.vaccine-filter-btn {
  min-height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.vaccine-filter-btn.active {
  background: rgba(255, 255, 255, .90);
  color: #121212;
}

.vaccine-progress-track {
  height: 6px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.vaccine-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #70c7f7, #9ff0bf);
  transition: width .25s ease;
}

.vaccine-plan-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.vaccine-group-label {
  margin: 7px 2px 0;
  color: rgba(179, 179, 179, .66);
  font-size: 11px;
  font-weight: 900;
}

.vaccine-plan-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .045);
}

.vaccine-plan-card.completed { border-color: rgba(53, 197, 107, .22); }
.vaccine-plan-card.completed .vaccine-card-title,
.vaccine-plan-card.completed .vaccine-card-meta,
.vaccine-plan-card.completed .vaccine-status-icon {
  color: rgba(179, 179, 179, .52);
}
.vaccine-plan-card.due-soon { border-color: rgba(255, 211, 110, .50); }
.vaccine-plan-card.overdue {
  border: 2px solid rgba(255, 100, 110, .88);
  box-shadow: 0 0 22px rgba(255, 74, 92, .16), inset 0 1px 0 rgba(255, 255, 255, .10);
}

.vaccine-plan-card.overdue .vaccine-status-icon {
  border-color: rgba(255, 100, 110, .92);
  background: rgba(217, 80, 80, .28);
  color: #ff6f79;
  box-shadow: 0 0 14px rgba(255, 74, 92, .22);
}

.vaccine-card-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.vaccine-status-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
  font-size: 15px;
}

.vaccine-card-copy { min-width: 0; }

.vaccine-card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #dce9f8;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.vaccine-plan-card.completed .vaccine-card-title small {
  color: rgba(179, 179, 179, .46);
}

.vaccine-card-title small {
  flex: 0 0 auto;
  color: rgba(179, 179, 179, .68);
  font-size: 10px;
}

.vaccine-card-meta {
  margin-top: 3px;
  color: rgba(179, 179, 179, .66);
  font-size: 11px;
}

.vaccine-card-details {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.vaccine-card-details span {
  color: rgba(215, 236, 255, .78);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.vaccine-card-details b {
  margin-right: 6px;
  color: rgba(112, 199, 247, .86);
  font-weight: 900;
}

.vaccine-plan-card.completed .vaccine-card-details span {
  color: rgba(179, 179, 179, .48);
}

.vaccine-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vaccine-card-action {
  padding: 0 10px;
}

.vaccine-card-action.icon-only {
  width: 34px;
  padding: 0;
}

.vaccine-card-action.delete-action {
  border-color: rgba(255, 109, 119, .34);
  background: rgba(217, 80, 80, .10);
  color: #ffadb4;
}

.vaccine-card-action.delete-action:hover {
  border-color: rgba(255, 109, 119, .62);
  background: rgba(217, 80, 80, .20);
}

.vaccine-disclaimer {
  padding: 14px 3px calc(var(--float-tab-height) + var(--float-bottom) + 18px);
  text-align: center;
  color: rgba(179, 179, 179, .48);
}

.vaccine-head-color { color: #70c7f7 !important; }

.history-list {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
  gap: 10px;
  background: #0d1828;
}

.history-card {
  position: relative;
  width: 100%;
  height: max-content;
  min-height: 88px;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .055);
  color: var(--ink);
  padding: 12px;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.history-card > * {
  flex-shrink: 0;
}

.history-card strong {
  display: block;
  flex: 0 0 auto;
  margin-bottom: 9px;
  color: #d5e3f4;
  font-size: 15px;
}

.history-card span {
  display: block;
  color: rgba(179, 179, 179, .76);
  font-size: 12px;
  line-height: 1.55;
}

.history-card.vaccine-day,
.timeline-card.vaccine-day {
  border-color: rgba(255, 100, 110, .72);
  box-shadow:
    0 0 0 1px rgba(255, 100, 110, .16),
    0 0 22px rgba(255, 74, 92, .16),
    inset 0 1px 0 rgba(255, 255, 255, .10);
}

.history-card.vaccine-day > strong {
  color: #ff9ba2;
}

.history-vaccine-summary {
  color: #ff9ba2 !important;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(255, 100, 110, .18);
}

.history-growth-summary {
  color: #9ed8ff !important;
  font-weight: 900;
}

.timeline-vaccine {
  color: #ff9ba2 !important;
  font-weight: 900;
}

.summary-chip {
  width: 100%;
  margin-top: 9px;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .06);
  color: rgba(245, 245, 245, .82);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  padding: 7px 9px;
  line-height: 1.35;
}

.history-card.has-summary .summary-chip {
  border-color: rgba(112, 199, 247, .70);
  background: linear-gradient(115deg, rgba(112, 199, 247, .15), rgba(185, 161, 255, .12));
  color: #e9f7ff;
  text-shadow: 0 0 10px rgba(112, 199, 247, .24);
  box-shadow:
    0 0 0 1px rgba(112, 199, 247, .10),
    0 0 20px rgba(112, 199, 247, .18),
    inset 0 1px 0 rgba(255, 255, 255, .16);
  backdrop-filter: blur(15px) saturate(1.15);
  -webkit-backdrop-filter: blur(15px) saturate(1.15);
}

.summary-chip.empty-summary {
  color: rgba(179, 179, 179, .62);
  border-style: dashed;
}

.vaccine-preset-select {
  border-color: rgba(112, 199, 247, .38);
  background-color: rgba(28, 45, 66, .88);
  background-image: linear-gradient(135deg, rgba(112, 199, 247, .10), transparent 52%), url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5' stroke='rgba(215,236,255,.92)' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left top, right 16px center;
  background-size: auto, 20px 20px;
  color: #d7ecff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), 0 0 16px rgba(112, 199, 247, .08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.vaccine-preset-select:focus {
  border-color: rgba(112, 199, 247, .86);
  box-shadow: 0 0 0 3px rgba(112, 199, 247, .16), 0 0 18px rgba(112, 199, 247, .14);
}

.vaccine-preset-select option {
  color: #eaf4ff;
  background: #182338;
}

.mood-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  margin-top: 8px;
}

.mood-btn {
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .07);
  font-size: 18px;
}

.mood-btn.active {
  background: rgba(255, 143, 176, .22);
  border-color: rgba(255, 143, 176, .54);
}

textarea.summary-input {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--ink);
  background: #242424;
  outline: none;
  line-height: 1.45;
}

.delete-day-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 23px;
  height: 23px;
  display: grid !important;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .60);
  opacity: .60;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .20), 0 5px 12px rgba(0, 0, 0, .16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.delete-day-btn svg {
  width: 14px;
  height: 14px;
  display: block;
  pointer-events: none;
}

.delete-day-btn path {
  fill: #333333;
}

.records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 5px 18px;
  border-bottom: 1px solid var(--line);
  background: #122037;
}

.records-head h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.records-head p {
  margin: 0 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  display: inline;
  white-space: nowrap;
}

.records-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
}

.med-record-summary {
  color: rgba(159, 240, 191, .76) !important;
}

.cloud-badge {
  width: fit-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .07);
  color: rgba(245, 245, 245, .72);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

.cloud-badge.ok {
  color: rgba(159, 240, 191, .88);
  border-color: rgba(53, 197, 107, .24);
  background: rgba(53, 197, 107, .12);
}

.cloud-badge.warning {
  color: rgba(255, 211, 110, .92);
  border-color: rgba(255, 211, 110, .24);
  background: rgba(217, 176, 96, .13);
}

.cloud-badge.danger {
  color: rgba(255, 170, 180, .92);
  border-color: rgba(217, 111, 111, .26);
  background: rgba(217, 111, 111, .13);
}

.export-btn {
  height: 30px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid rgba(105, 150, 224, .62);
  background: rgba(56, 96, 160, .28);
  color: #78a8ff;
  font-weight: 900;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 8px 18px rgba(0, 0, 0, .20);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.history-switch-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.history-mode-switch,
.chart-range {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .06);
}

.history-growth-switch {
  border-color: rgba(112, 199, 247, .24);
  background: rgba(112, 199, 247, .08);
}

.view-toggle-btn,
.range-btn {
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: transparent;
  color: rgba(245, 245, 245, .58);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.view-toggle-btn.active,
.range-btn.active {
  background: rgba(255, 255, 255, .92);
  color: #121212;
}

.import-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.import-btn input {
  display: none;
}

.record-content {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: #0d1828;
}

.history-detail {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 6px;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}

.history-detail .record-block {
  display: block;
  min-height: auto;
  border-right: 0;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, .035);
}

.history-detail .items {
  max-height: none;
  overflow: visible;
}

.history-detail .record-row {
  min-height: 30px;
  padding-top: 4px;
  padding-bottom: 4px;
  cursor: default;
}

.history-summary-strip {
  display: none;
  position: sticky;
  top: 0;
  z-index: 2;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  background: rgba(13, 24, 40, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.history-summary-strip span {
  min-width: 0;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-unified-list {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.history-category {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px;
  background: rgba(255, 255, 255, .025);
}

.history-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: rgba(245, 245, 245, .86);
  font-size: 13px;
  font-weight: 900;
}

.history-category-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: normal;
}

.history-category-title span {
  min-width: 0;
  color: rgba(245, 245, 245, .72);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.history-category-head > span {
  flex: 0 0 auto;
  color: rgba(179, 179, 179, .72);
  font-size: 11px;
}

.history-category-list {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.history-event {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
  touch-action: manipulation;
}

.history-event:hover {
  border-color: rgba(120, 169, 255, .28);
  background: rgba(120, 169, 255, .08);
}

.history-event-time {
  color: #d5e3f4;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.history-event-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.history-event-main .pill,
.history-event-main strong,
.history-event-main span {
  max-width: 100%;
}

.history-event-main .pill {
  font-size: 12px;
  line-height: 1.2;
}

.history-event-main strong,
.history-event-detail {
  color: rgba(245, 245, 245, .78);
  font-size: 13px;
  line-height: 1.25;
  font-weight: 900;
}

.history-event-main .accent,
.history-event-main .sleep-accent {
  color: inherit;
  font-size: 13px;
  line-height: 1.25;
}

.history-chart {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: none;
  align-content: start;
  gap: 12px;
  background: #0d1828;
}

.history-timeline {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: none;
  align-content: start;
  gap: 10px;
  background: #0d1828;
}

.history-growth {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  display: none;
  align-content: start;
  gap: 12px;
  background: #0d1828;
}

.history-view.chart-mode .history-list {
  display: none;
}

.history-view.chart-mode .history-chart {
  display: grid;
}

.history-view.timeline-mode .history-list {
  display: none;
}

.history-view.timeline-mode .history-timeline {
  display: grid;
}

.history-view.growth-mode .history-list {
  display: none;
}

.history-view.growth-mode .history-growth {
  display: grid;
}

.growth-overview-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(112, 199, 247, .22);
  border-radius: var(--radius);
  background: rgba(112, 199, 247, .055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
}

.growth-latest-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.growth-history-row {
  border: 1px solid rgba(112, 199, 247, .22);
  border-radius: var(--radius);
  background: rgba(112, 199, 247, .07);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
}

.growth-latest-card > div {
  display: grid;
  gap: 5px;
  padding: 14px;
}

.growth-latest-card > div + div {
  border-left: 1px solid rgba(112, 199, 247, .14);
}

.growth-latest-card span,
.growth-latest-card small {
  color: var(--muted);
}

.growth-latest-card strong {
  color: #9ed8ff;
  font-size: 22px;
}

.growth-history-list {
  display: grid;
  gap: 8px;
}

.growth-history-row {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
}

.growth-history-row time {
  color: rgba(179, 179, 179, .52);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.growth-history-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.growth-history-metric {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding-left: 10px;
  border-left: 1px solid rgba(112, 199, 247, .14);
}

.growth-history-metric > span {
  color: rgba(179, 179, 179, .56);
  font-size: 10px;
  font-weight: 800;
}

.growth-history-metric > strong {
  color: #dff3ff;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}

.growth-history-metric.is-missing > strong,
.growth-history-metric.is-missing > span {
  color: rgba(179, 179, 179, .34);
}

.growth-change {
  color: rgba(179, 179, 179, .60);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.growth-change.is-up { color: #91d9ad; }
.growth-change.is-down { color: #ffadb4; }
.growth-change.is-same { color: #9ed8ff; }
.growth-change.is-empty { color: rgba(179, 179, 179, .30); }
.growth-change.is-first { color: rgba(179, 179, 179, .48); }

.growth-trend-panel {
  min-width: 0;
  padding: 13px 14px 14px;
  border-top: 1px solid rgba(112, 199, 247, .14);
}

.growth-trend-title,
.growth-curve-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.growth-trend-title {
  margin-bottom: 10px;
}

.growth-trend-title strong {
  color: #dceefa;
  font-size: 12px;
}

.growth-trend-title span,
.growth-curve-head span,
.empty-curve span {
  color: rgba(179, 179, 179, .52);
  font-size: 9px;
}

.growth-trend-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.growth-curve {
  min-width: 0;
  padding: 0 10px;
}

.growth-curve + .growth-curve {
  border-left: 1px solid rgba(255, 255, 255, .07);
}

.growth-curve-head strong,
.empty-curve strong {
  font-size: 11px;
}

.growth-curve svg {
  width: 100%;
  height: 126px;
  display: block;
  overflow: visible;
}

.empty-curve {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.growth-trend-fallback {
  min-height: 48px;
}

.growth-reference-note {
  margin: 10px 2px 0;
  color: rgba(179, 179, 179, .48);
  font-size: 9px;
  line-height: 1.45;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.custom-range {
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.custom-range.open {
  display: inline-flex;
}

.custom-range input {
  width: 116px;
  height: 28px;
  padding: 0 32px 0 10px;
  color-scheme: dark;
  font-size: 11px;
  border-radius: 999px;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.chart-card {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .055);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
}

.chart-card h3 {
  margin: 0 0 4px;
  font-size: 13px;
  color: #d5e3f4;
}

.chart-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.trend-svg {
  width: 100%;
  height: 190px;
  display: block;
  overflow: visible;
}

.trend-point {
  cursor: pointer;
}

.trend-point.selected circle:last-child {
  r: 7px;
  filter: drop-shadow(0 0 6px currentColor);
}

.chart-tooltip {
  position: fixed;
  z-index: 70;
  display: none;
  width: 220px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(24, 24, 24, .94);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .42), inset 0 1px 0 rgba(255, 255, 255, .10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: none;
}

.chart-tooltip.open {
  display: block;
}

.chart-tooltip small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 700;
}

.chart-tooltip-date {
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  color: rgba(245, 245, 245, .72);
  font-size: 12px;
}

.chart-tooltip-values {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.chart-tooltip-values > div {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.chart-tooltip-values i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.chart-tooltip-values span {
  color: rgba(179, 179, 179, .82);
}

.chart-tooltip-values strong {
  color: rgba(245, 245, 245, .88);
  font-variant-numeric: tabular-nums;
}

.chart-tooltip-growth {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.chart-tooltip-growth p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  margin: 0;
  color: rgba(245, 245, 245, .78);
  line-height: 1.45;
}

.chart-tooltip-growth b {
  color: rgba(245, 245, 245, .92);
}

.chart-tooltip-growth span {
  grid-column: 1 / -1;
  color: rgba(179, 179, 179, .82);
  font-variant-numeric: tabular-nums;
}

.chart-tooltip-growth em {
  color: #bdf5d0;
  font-style: normal;
}

.trend-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.record-block {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-right: 1px solid rgba(255, 255, 255, .10);
  background: transparent;
  overflow: hidden;
}

.record-block:last-child {
  border-right: 0;
}

.block-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 900;
}

.block-head span {
  color: var(--muted);
  font-weight: 800;
}

.block-head.sleep-head {
  color: #b9a1ff;
}

.block-head.sleep-head span {
  color: #b9a1ff;
}

.block-head.feed-head {
  color: #ff8fb0;
}

.block-head.feed-head span {
  color: #ff8fb0;
}

.block-head.diaper-head {
  color: #ffd36e;
}

.block-head.diaper-head span {
  color: #ffd36e;
}

.record-subhead,
.record-row {
  display: grid;
  align-items: center;
  column-gap: 14px;
}

.record-subhead {
  padding: 5px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #496586;
  font-size: 12px;
  font-weight: 900;
}

.sleep-grid { grid-template-columns: 1fr 1fr 1fr; }
.feed-grid { grid-template-columns: .9fr .9fr 1fr; }
.diaper-grid { grid-template-columns: .9fr 1.4fr; }

.items {
  min-height: 0;
  overflow: auto;
  padding: 0;
}

.record-row {
  min-height: 34px;
  padding: 5px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  color: #5f7a9c;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
  transition: background .15s ease;
}

.record-row:hover {
  background: rgba(255, 255, 255, .045);
}

.record-row strong {
  color: #d5e3f4;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.record-row .accent {
  color: #ffd36e;
}

.record-row .sleep-accent {
  color: #c7a8ff;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(53, 197, 107, .18);
  color: #66d7aa;
  font-weight: 900;
  font-size: 12px;
  white-space: nowrap;
}

.pill.feed-pill {
  background: rgba(217, 111, 159, .20);
  color: #f0a4c8;
}

.pill.direct-pill {
  background: rgba(223, 110, 184, .20);
  color: #f2a2d8;
}

.pill.formula-pill {
  background: rgba(217, 176, 96, .20);
  color: #ffd36e;
}

.empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  padding: 14px 18px;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(179, 179, 179, .42);
  font-size: 11px;
  font-weight: 300;
  line-height: 1.2;
  padding: 0 4px 1px;
}

.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.storage-meter {
  border: 0;
  cursor: pointer;
  --storage-percent: 0;
  min-width: 58px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 0 0 auto;
  padding: 0 6px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(112, 199, 247, .24) calc(var(--storage-percent) * 1%), transparent 0),
    rgba(255, 255, 255, .07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  color: rgba(245, 245, 245, .46);
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.storage-meter strong {
  color: rgba(185, 226, 250, .82);
  font-size: inherit;
}

.app-footer a {
  color: inherit;
  text-decoration: none;
}

.app-footer a:hover {
  color: rgba(245, 245, 245, .62);
}

.floating-tabs {
  position: fixed;
  left: calc(50% - 87px);
  bottom: var(--float-bottom);
  z-index: 45;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 204px;
  height: var(--float-tab-height);
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(26, 26, 26, .10);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .18);
  backdrop-filter: blur(26px) saturate(1.45);
  -webkit-backdrop-filter: blur(26px) saturate(1.45);
}

.woodfish-btn,
.nightlight-btn,
.theme-toggle-btn {
  position: fixed;
  bottom: calc(var(--float-bottom) + (var(--float-tab-height) - var(--woodfish-size)) / 2);
  z-index: 46;
  width: var(--woodfish-size);
  height: var(--woodfish-size);
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(26, 26, 26, .10);
  color: rgba(245, 245, 245, .82);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .32), inset 0 1px 0 rgba(255, 255, 255, .18);
  backdrop-filter: blur(26px) saturate(1.45);
  -webkit-backdrop-filter: blur(26px) saturate(1.45);
}

.woodfish-btn {
  left: calc(50% + 137px);
}

.nightlight-btn {
  left: calc(50% + 79px);
  font-size: 19px;
  line-height: 1;
}

.theme-toggle-btn {
  left: calc(50% + 21px);
  padding: 0;
  color: rgba(245, 245, 245, .78);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  white-space: normal;
}

.nightlight-btn.active {
  background: rgba(255, 244, 218, .22);
  color: #fff3c4;
  border-color: rgba(255, 242, 206, .55);
  box-shadow: 0 18px 40px rgba(255, 220, 150, .16), inset 0 1px 0 rgba(255, 255, 255, .28);
}

.woodfish-btn svg {
  width: 19px;
  height: 19px;
  display: block;
  fill: currentColor;
  opacity: .86;
  pointer-events: none;
}

.woodfish-pop {
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translate(-50%, 0);
  color: #ffd36e;
  font-size: 15px;
  font-weight: 900;
  pointer-events: none;
  animation: woodfishPop .68s ease-out forwards;
  text-shadow: 0 8px 18px rgba(0, 0, 0, .45);
}

.nightlight-frame {
  position: fixed;
  inset: 0;
  z-index: 75;
  pointer-events: none;
  opacity: 0;
  border: clamp(34px, 5vw, 72px) solid rgba(255, 244, 222, .96);
  box-shadow:
    inset 0 0 110px rgba(255, 236, 190, .96),
    inset 0 0 240px rgba(255, 247, 225, .72),
    inset 0 0 420px rgba(255, 244, 218, .30),
    0 0 80px rgba(255, 232, 178, .66);
  transition: opacity .18s ease;
}

.nightlight-frame.active {
  opacity: 1;
}

body.simple-theme {
  background:
    radial-gradient(circle at 18% 16%, rgba(53, 197, 107, .13), transparent 30%),
    radial-gradient(circle at 84% 18%, rgba(185, 161, 255, .12), transparent 28%),
    radial-gradient(circle at 54% 84%, rgba(217, 111, 159, .10), transparent 34%),
    #101214;
  image-rendering: pixelated;
}

body.simple-theme::before,
body.simple-theme::after {
  content: "";
  position: fixed;
  inset: -18%;
  z-index: 0;
  pointer-events: none;
  opacity: .58;
  filter: blur(38px) saturate(1.36);
  background:
    radial-gradient(circle 14vw at 28% 34%, rgba(159, 240, 191, .40), transparent 64%),
    radial-gradient(circle 42vw at 58% 34%, rgba(185, 161, 255, .34), transparent 68%),
    radial-gradient(circle 24vw at 47% 58%, rgba(255, 143, 176, .33), transparent 66%),
    radial-gradient(circle 10vw at 66% 58%, rgba(255, 211, 110, .32), transparent 62%);
  transform: translate3d(-2%, 1%, 0) rotate(-4deg) scale(1.04);
  transform-origin: 48% 52%;
  animation: ambientGlowDrift 14s cubic-bezier(.42, 0, .24, 1) infinite alternate;
  mix-blend-mode: screen;
  will-change: transform, opacity;
}

body.simple-theme::after {
  opacity: .42;
  filter: blur(58px) saturate(1.42);
  background:
    radial-gradient(circle 46vw at 44% 38%, rgba(111, 166, 216, .28), transparent 68%),
    radial-gradient(circle 12vw at 58% 50%, rgba(255, 255, 255, .24), transparent 62%),
    radial-gradient(circle 28vw at 38% 62%, rgba(255, 143, 176, .27), transparent 66%),
    radial-gradient(circle 18vw at 64% 42%, rgba(159, 240, 191, .22), transparent 64%);
  transform-origin: 54% 48%;
  animation: ambientGlowMorph 18s cubic-bezier(.46, 0, .22, 1) -5s infinite alternate;
}

body.simple-theme .app {
  position: relative;
  z-index: 1;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  padding: clamp(12px, 2vw, 26px);
}

body.simple-theme .dashboard {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 1.65fr 1fr;
  gap: 12px;
}

body.simple-theme .tile.time {
  grid-column: 1 / -1;
}

body.simple-theme .tile.diaper,
body.simple-theme .records,
body.simple-theme .history-view,
body.simple-theme .floating-tabs,
body.simple-theme .tile.time .tile-head,
body.simple-theme .tile.time .time-bottom,
body.simple-theme .tile.sleep .big-action,
body.simple-theme .tile.feed .button-grid {
  display: none !important;
}

body.simple-theme .tile {
  justify-content: center;
  align-items: center;
  padding: clamp(18px, 3vw, 42px);
  border-radius: 12px;
  border: 1px solid rgba(213, 229, 255, .30);
  background: rgba(20, 24, 28, .38);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, .28),
    inset 0 1px 0 rgba(255, 255, 255, .10),
    inset 0 0 34px rgba(213, 229, 255, .025);
  backdrop-filter: blur(18px) saturate(1.22);
  -webkit-backdrop-filter: blur(18px) saturate(1.22);
  text-align: center;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

body.simple-theme .nightlight-frame:not(.active) {
  z-index: 2;
  opacity: 0;
  border: 0;
  background: none;
  filter: none;
  box-shadow: none;
  animation: none;
}

body.simple-theme .tile::before {
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .08), transparent 38%),
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .06), transparent 48%);
  opacity: .68;
  mix-blend-mode: screen;
  filter: none;
  transform: none;
  animation: none;
}

body.simple-theme .tile::after {
  content: none;
}

body.simple-theme .tile-head {
  width: 100%;
  justify-content: center;
  font-size: clamp(16px, 2.4vw, 34px);
}

body.simple-theme .clock {
  margin: 0;
  font-size: clamp(64px, 17vw, 240px);
  line-height: .9;
  color: #9ff0bf;
  text-shadow:
    3px 0 0 rgba(15, 56, 32, .62),
    0 3px 0 rgba(15, 56, 32, .62),
    0 0 28px rgba(53, 197, 107, .20);
}

.simple-vaccine-reminder {
  display: none;
}

body.simple-theme .simple-vaccine-reminder:not([hidden]) {
  width: min(500px, 72%);
  height: clamp(40px, 4.4vw, 48px);
  display: flex;
  align-items: center;
  margin: clamp(11px, 1.6vw, 20px) auto 0;
  overflow: hidden;
  border: 1px solid rgba(255, 211, 110, .58);
  border-radius: 999px;
  background: rgba(45, 39, 22, .62);
  color: #ffe39a;
  box-shadow: 0 0 26px rgba(255, 211, 110, .16), inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(14px, 1.45vw, 18px);
  font-weight: 900;
  letter-spacing: .02em;
}

body.simple-theme .simple-vaccine-reminder.overdue {
  border-color: rgba(255, 100, 110, .62);
  background: rgba(62, 27, 33, .64);
  color: #ffb0b6;
  box-shadow: 0 0 28px rgba(255, 74, 92, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
}

body.simple-theme .simple-vaccine-reminder span {
  min-width: max-content;
  padding-left: 100%;
  white-space: nowrap;
  animation: vaccine-marquee 18s linear infinite;
}

@keyframes vaccine-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

body.simple-theme .time-orbit {
  width: min(520px, 80%);
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(3px, .75vw, 7px);
  margin: 0 auto clamp(8px, 1.4vw, 16px);
}

body.simple-theme .time-dot {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(213, 229, 255, .20);
  background: rgba(255, 255, 255, .055);
  color: rgba(245, 245, 245, .92);
  font-size: clamp(9px, 1.4vw, 17px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}

body.simple-theme .time-dot.active {
  border-color: rgba(255, 255, 255, .42);
  background: rgba(255, 255, 255, .16);
  box-shadow:
    0 0 24px rgba(255, 244, 194, .16),
    inset 0 1px 0 rgba(255, 255, 255, .24);
  transform: scale(1.08);
}

body.simple-theme .metric {
  margin: 0;
  font-size: clamp(42px, 8vw, 120px);
  line-height: .95;
  color: #d7ecff;
  text-shadow:
    2px 0 0 rgba(33, 71, 88, .62),
    0 2px 0 rgba(33, 71, 88, .62);
}

body.simple-theme .tile.sleep .sub-metrics,
body.simple-theme .tile.feed .sub-metrics {
  width: min(420px, 90%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 14px;
}

body.simple-theme .tile.sleep .mini:nth-child(2),
body.simple-theme .tile.feed .mini:nth-child(2) {
  display: none;
}

body.simple-theme .tile.sleep .mini,
body.simple-theme .tile.feed .mini {
  min-height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}

body.simple-theme .tile.sleep .mini span,
body.simple-theme .tile.feed .mini span {
  font-size: clamp(11px, 1.6vw, 15px);
}

body.simple-theme .tile.sleep .mini strong,
body.simple-theme .tile.feed .mini strong {
  font-size: clamp(18px, 3vw, 34px);
}

body.simple-theme .tile.time {
  border-color: rgba(53, 197, 107, .36);
  background: rgba(28, 55, 38, .40);
}

body.simple-theme .tile.time .clock {
  position: relative;
  z-index: 2;
}

body.simple-theme .tile.sleep {
  border-color: rgba(185, 161, 255, .38);
  background: rgba(43, 38, 66, .40);
}

body.simple-theme .tile.sleep .metric {
  color: var(--violet);
  text-shadow:
    2px 0 0 rgba(63, 51, 112, .60),
    0 2px 0 rgba(63, 51, 112, .60),
    0 0 24px rgba(185, 161, 255, .18);
}

body.simple-theme .tile.feed {
  border-color: rgba(217, 111, 159, .38);
  background: rgba(61, 36, 50, .40);
}

body.simple-theme .tile.feed .metric {
  color: #ff8fb0;
  text-shadow:
    2px 0 0 rgba(103, 43, 70, .58),
    0 2px 0 rgba(103, 43, 70, .58),
    0 0 24px rgba(217, 111, 159, .18);
}

body.simple-theme .theme-toggle-btn {
  left: calc(50% - 84px);
  bottom: max(18px, env(safe-area-inset-bottom));
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  color: rgba(245, 245, 245, .92);
}

body.simple-theme .nightlight-btn {
  left: calc(50% - 26px);
  bottom: max(18px, env(safe-area-inset-bottom));
}

body.simple-theme .woodfish-btn {
  left: calc(50% + 32px);
  bottom: max(18px, env(safe-area-inset-bottom));
}

body.simple-theme .app-footer {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  z-index: 36;
  display: flex;
  padding: 0;
  color: rgba(179, 179, 179, .42);
  font-size: clamp(10px, 1.1vw, 12px);
  pointer-events: auto;
}

body.simple-theme .app-footer span,
body.simple-theme .app-footer a {
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.simple-theme .app-footer .footer-status {
  max-width: 58%;
}

body.simple-theme .app-footer .storage-meter,
body.simple-theme .app-footer .storage-meter span {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
}

@keyframes ambientGlowDrift {
  0% {
    opacity: .48;
    transform: translate3d(-5%, 3%, 0) rotate(-9deg) scale(.94);
  }
  24% {
    opacity: .74;
    transform: translate3d(4%, -5%, 0) rotate(5deg) scale(1.20);
  }
  57% {
    opacity: .58;
    transform: translate3d(6%, 4%, 0) rotate(-4deg) scale(1.02);
  }
  78% {
    opacity: .70;
    transform: translate3d(-1%, 5%, 0) rotate(4deg) scale(1.15);
  }
  100% {
    opacity: .64;
    transform: translate3d(-4%, -4%, 0) rotate(10deg) scale(1.26);
  }
}

@keyframes ambientGlowMorph {
  0% {
    transform: translate3d(5%, -4%, 0) rotate(8deg) scale(1.06);
    opacity: .34;
  }
  38% {
    transform: translate3d(-5%, 5%, 0) rotate(-10deg) scale(.94);
    opacity: .56;
  }
  72% {
    transform: translate3d(4%, 2%, 0) rotate(4deg) scale(1.16);
    opacity: .46;
  }
  100% {
    transform: translate3d(3%, -1%, 0) rotate(13deg) scale(1.28);
    opacity: .42;
  }
}

body.simple-theme.page-hidden::before,
body.simple-theme.page-hidden::after {
  animation-play-state: paused;
}

@media (max-width: 900px), (pointer: coarse) {
  body.simple-theme::before {
    filter: blur(30px) saturate(1.28);
  }

  body.simple-theme::after {
    filter: blur(44px) saturate(1.32);
  }

  body.simple-theme .tile {
    backdrop-filter: blur(14px) saturate(1.16);
    -webkit-backdrop-filter: blur(14px) saturate(1.16);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.simple-theme::before,
  body.simple-theme::after {
    animation: none;
    opacity: .22;
  }

  body.simple-theme .simple-vaccine-reminder span {
    min-width: 100%;
    padding-left: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: none;
  }
}

@keyframes woodfishPop {
  0% { opacity: 0; transform: translate(-50%, 4px) scale(.82); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(1.18); }
}

.tab-btn {
  position: relative;
  border-radius: 999px;
  background: transparent;
  color: rgba(245, 245, 245, .62);
  font-size: 20px;
  font-weight: 900;
  transition: .16s ease;
}

.vaccine-tab-badge {
  position: absolute;
  top: -8px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #14191f;
  border-radius: 999px;
  background: #d95050;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 5px 14px rgba(217, 80, 80, .38);
}

.vaccine-tab-badge[hidden] {
  display: none;
}

.vaccine-tab-badge.due-soon {
  background: #d9a833;
  box-shadow: 0 5px 14px rgba(217, 168, 51, .34);
}

.tab-btn.active {
  background: rgba(255, 255, 255, .92);
  color: #121212;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .24);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .62);
}

.modal-backdrop.open { display: flex; }

.modal {
  width: min(440px, 100%);
  border-radius: 12px;
  background: #181818;
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .58);
  padding: 16px;
}

.vaccine-modal {
  width: min(560px, 100%);
  max-height: min(88dvh, 760px);
  overflow-y: auto;
}

.vaccine-preset-field {
  margin-bottom: 10px;
}

.vaccine-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.growth-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 560px) {
  .baby-name-row {
    gap: 5px;
  }

  .care-temp-btn {
    padding-inline: 6px;
  }

  .growth-latest-card {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .growth-latest-card > div {
    gap: 4px;
    padding: 10px 6px;
  }

  .growth-latest-card span { font-size: 10px; }
  .growth-latest-card strong { font-size: 15px; }
  .growth-latest-card small { font-size: 8px; white-space: normal; }

  .growth-history-row {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 10px 8px;
  }

  .growth-history-row time { font-size: 10px; }
  .growth-history-metrics { gap: 3px; }
  .growth-history-metric { gap: 2px; padding-left: 6px; }
  .growth-history-metric > strong { font-size: 13px; }
  .growth-change { font-size: 8px; white-space: normal; line-height: 1.25; }
  .growth-trend-panel { padding: 11px 8px 12px; }
  .growth-trend-grid { grid-template-columns: 1fr; }
  .growth-curve { padding: 8px 4px; }
  .growth-curve + .growth-curve {
    border-top: 1px solid rgba(255, 255, 255, .07);
    border-left: 0;
  }
  .growth-curve svg { height: 116px; }
  .empty-curve { min-height: 64px; }
}

@media (min-width: 761px) and (max-width: 1400px) {
  .history-list {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  }
}

.vaccine-form-grid .field { min-width: 0; }

.vaccine-more-fields {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .035);
}

.vaccine-more-fields summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.vaccine-more-fields textarea.summary-input {
  min-height: 72px;
}

.modal.wide-modal {
  width: min(1080px, 96vw);
  height: min(86dvh, 760px);
  max-height: min(86dvh, 760px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.confirm-modal {
  width: min(360px, 100%);
}

.confirm-modal p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 700;
}

.modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title-row h3 {
  margin: 0;
}

.modal-title-row p {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 700;
}

.icon-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 18px;
  font-weight: 900;
}

.history-detail {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.modal h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

.field {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.profile-inline-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin: 10px 0 12px;
}

.profile-inline-fields .field {
  margin: 0;
}

.profile-identity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: end;
  gap: 12px;
}

.profile-identity-row .field {
  margin: 6px 0 2px;
}

.profile-avatar-field .avatar-upload {
  grid-template-columns: 52px auto;
  gap: 8px;
}

.profile-avatar-field .avatar-preview {
  width: 52px;
  height: 52px;
}

.sex-choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.sex-choice-btn {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: rgba(245, 245, 245, .76);
  background: rgba(255, 255, 255, .06);
  font-weight: 900;
}

.sex-choice-btn.active {
  border-color: rgba(53, 197, 107, .68);
  color: #bdf5d0;
  background: rgba(53, 197, 107, .14);
  box-shadow: inset 0 0 0 1px rgba(53, 197, 107, .18);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]), select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 48px 0 12px;
  color: var(--ink);
  background: #242424;
  outline: none;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5' stroke='rgba(245,245,245,.86)' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px 20px;
}

.time-picker-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='22' height='22' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='8.25' stroke='rgba(245,245,245,.92)' stroke-width='2.1'/%3E%3Cpath d='M12 7.5v5l3.5 2.1' stroke='rgba(245,245,245,.92)' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 22px 22px;
}

.custom-select-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 10l5 5 5-5' stroke='rgba(245,245,245,.86)' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 20px 20px;
}

.date-picker-input {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='21' height='21' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='4' y='5.5' width='16' height='14' rx='2.5' stroke='rgba(245,245,245,.88)' stroke-width='2'/%3E%3Cpath d='M8 3.5v4M16 3.5v4M4.5 10h15' stroke='rgba(245,245,245,.88)' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 21px 21px;
}

input:not([type="checkbox"]):not([type="radio"]):focus, select:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(29, 185, 84, .18);
}

.time-picker-popover {
  position: fixed;
  z-index: 90;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 234px;
  max-height: 244px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(24, 24, 24, .96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.time-picker-popover.open {
  display: grid;
}

.choice-popover {
  position: fixed;
  z-index: 90;
  display: none;
  min-width: 220px;
  max-height: min(360px, calc(100dvh - 24px));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(24, 24, 24, .96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.choice-popover.open {
  display: grid;
  gap: 6px;
  align-content: start;
}

.choice-popover.vaccine-choice-popover {
  border-color: rgba(112, 199, 247, .42);
  background: rgba(21, 36, 54, .96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .58), 0 0 22px rgba(112, 199, 247, .12), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.choice-popover.vaccine-choice-popover .choice-option {
  color: #d7ecff;
}

.choice-popover.vaccine-choice-popover .choice-option:hover,
.choice-popover.vaccine-choice-popover .choice-option.active {
  background: rgba(112, 199, 247, .86);
  color: #071018;
}

.native-select-proxy { display: none; }

.choice-option {
  height: 40px;
  border-radius: 9px;
  background: transparent;
  color: rgba(245, 245, 245, .86);
  text-align: left;
  padding: 0 12px;
  font-weight: 900;
}

.choice-option.active {
  background: rgba(53, 197, 107, .90);
  color: #071008;
}

.date-picker-popover {
  position: fixed;
  z-index: 90;
  display: none;
  width: 304px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .13);
  background: rgba(24, 24, 24, .96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.date-picker-popover.open { display: block; }

.date-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--ink);
  font-weight: 900;
}

.date-head button {
  width: 34px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
  font-size: 18px;
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.date-cell {
  height: 34px;
  border-radius: 8px;
  background: transparent;
  color: rgba(245, 245, 245, .86);
  font-weight: 800;
}

.date-cell.muted { color: rgba(179, 179, 179, .36); }
.date-cell.active { background: rgba(53, 197, 107, .90); color: #071008; }
.date-week { color: rgba(179, 179, 179, .62); font-size: 12px; display: grid; place-items: center; }

.time-column {
  min-height: 0;
  max-height: 224px;
  overflow: auto;
  border-radius: 10px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .08);
}

.time-choice {
  width: 100%;
  height: 36px;
  color: rgba(245, 245, 245, .86);
  background: transparent;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.time-choice.active {
  background: rgba(53, 197, 107, .90);
  color: #071008;
}

.avatar-upload {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
}

.avatar-preview {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  font-size: 24px;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-btn {
  min-height: 38px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 800;
  width: fit-content;
}

.file-btn input {
  display: none;
}

.side-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.side-choice {
  min-height: 54px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .18);
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 8px 10px;
}

.side-choice.active {
  background: var(--green-2);
  color: #071008;
  border-color: var(--green-2);
}

.side-choice small {
  font-size: 11px;
  line-height: 1;
  opacity: .72;
  font-weight: 800;
}

.cloud-panel {
  margin: 12px 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.cloud-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 900;
}

.cloud-head span {
  color: rgba(179, 179, 179, .78);
  font-size: 12px;
}

.cloud-login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.cloud-head + .cloud-login-row {
  margin-top: 0;
}

.cloud-login-row input {
  height: 40px;
  padding: 0 12px;
  font-size: 13px;
}

.cloud-login-row button,
.cloud-actions button,
.cloud-actions .import-btn {
  min-height: 40px;
  border-radius: var(--radius);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cloud-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.cloud-actions .subtle {
  opacity: .68;
}

.cloud-panel p {
  margin: 9px 0 0;
  color: rgba(179, 179, 179, .68);
  font-size: 11px;
  line-height: 1.45;
  font-weight: 700;
}

.quick-amounts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.quick-amounts button {
  height: 42px;
  border-radius: var(--radius);
  background: rgba(217, 176, 96, .16);
  color: #ffd48a;
  border: 1px solid rgba(255, 211, 110, .22);
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.timeline-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .055);
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.timeline-date {
  min-width: 0;
}

.timeline-date strong {
  display: block;
  color: #d5e3f4;
  font-size: 14px;
  margin-bottom: 5px;
}

.timeline-date span {
  display: block;
  color: rgba(179, 179, 179, .66);
  font-size: 11px;
  line-height: 1.35;
}

.timeline-area {
  min-width: 0;
}

.timeline-lane {
  position: relative;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(7, 15, 28, .72);
  overflow: hidden;
}

.timeline-lane::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 1px, transparent 1px calc(100% / 6));
  opacity: .55;
}

.sleep-segment {
  position: absolute;
  top: 18px;
  height: 12px;
  border-radius: 999px;
  background: rgba(185, 161, 255, .88);
  box-shadow: 0 0 18px rgba(185, 161, 255, .28);
}

.timeline-marker {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  font-size: 10px;
  border: 1px solid rgba(255, 255, 255, .36);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .24);
}

.timeline-marker.feed {
  top: 5px;
  background: #ff8fb0;
  color: #35101f;
}

.timeline-marker.diaper {
  top: 27px;
  background: #ffd36e;
  color: #31200a;
}

.timeline-scale {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-top: 6px;
  color: rgba(179, 179, 179, .52);
  font-size: 10px;
  font-weight: 700;
}

.timeline-scale span:not(:first-child):not(:last-child) {
  text-align: center;
}

.timeline-scale span:last-child {
  text-align: right;
}

.timeline-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(179, 179, 179, .72);
  font-size: 11px;
  font-weight: 800;
  padding: 0 2px 2px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 999px;
  margin-right: 4px;
  vertical-align: -1px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.modal-actions.direct-mode {
  grid-template-columns: 1fr;
}

.modal-actions.three-actions {
  grid-template-columns: 1fr 1fr 1fr;
}

.modal-actions button,
.modal-actions .import-btn {
  height: 46px;
  border-radius: var(--radius);
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 8px 18px rgba(0, 0, 0, .18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  box-shadow: none;
}
.danger { background: rgba(217, 111, 111, .90); color: #fff; }
.primary { background: var(--green-2); color: #071008; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 80;
  transform: translateX(-50%) translateY(16px);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--green-2);
  color: #071008;
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 760px) {
  .app {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: auto;
    grid-template-rows: auto auto auto;
    padding-bottom: calc(var(--float-bottom) + var(--float-tab-height) + 34px);
  }

  .dashboard {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: minmax(190px, auto);
  }

  .record-content {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .records, .record-block, .items {
    overflow: visible;
  }

  .history-detail {
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px;
  }

  .modal.wide-modal {
    width: min(92vw, 620px);
    height: min(84dvh, 720px);
    max-height: min(84dvh, 720px);
    gap: 8px;
    padding: 12px;
  }

  .history-category {
    padding: 6px;
  }

  .history-event {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 8px;
    min-height: 42px;
    padding: 8px 9px;
  }

  .record-block {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
  }
}

@media (min-width: 761px) and (max-height: 780px) {
  :root {
    --float-bottom: 16px;
    --float-tab-height: 46px;
    --woodfish-size: 46px;
  }

  .app {
    gap: 10px;
    padding: 10px;
    grid-template-rows: minmax(0, 1.7fr) minmax(0, 1fr) auto;
  }

  .dashboard {
    gap: 10px;
  }

  .tile {
    gap: 6px;
    padding: 12px;
  }

  .tile.time {
    padding-top: 8px;
  }

  .avatar {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .baby-profile {
    gap: 8px;
  }

  .baby-name {
    font-size: 15px;
  }

  .baby-days {
    margin-top: 1px;
    font-size: 11px;
  }

  .edit-profile-btn {
    min-height: 30px;
    padding: 0 10px;
  }

  .clock {
    font-size: clamp(46px, 7vw, 72px);
  }

  .date-line, .weather-line {
    font-size: 11px;
    line-height: 1.25;
  }

  .time-bottom {
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(132px, .72fr);
  }

  .med-grid {
    gap: 4px;
  }

  .med-option {
    min-height: 24px;
    font-size: 10px;
    padding: 0 5px;
  }

  .metric {
    font-size: clamp(34px, 4.7vw, 46px);
  }

  .sub-metrics {
    gap: 7px;
  }

  .mini {
    padding: 6px 8px;
  }

  .mini span {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .mini strong {
    font-size: 13px;
  }

  .button-grid {
    gap: 7px;
  }

  .big-action, .choice-btn {
    min-height: 40px;
    font-size: 13px;
  }

  .records-head {
    padding: 6px 12px;
  }

  .record-subhead {
    min-height: 28px;
    font-size: 11px;
  }

  .record-row, .empty {
    min-height: 32px;
    font-size: 12px;
  }

  .items {
    padding-bottom: 58px;
  }

  .floating-tabs {
    left: calc(50% - 87px);
    width: 176px;
    padding: 5px;
  }

  .theme-toggle-btn {
    left: calc(50% + 7px);
  }

  .woodfish-btn {
    left: calc(50% + 123px);
  }

  .nightlight-btn {
    left: calc(50% + 65px);
  }

  .chart-grid {
    gap: 10px;
  }

  .chart-card {
    padding: 10px;
  }
}

@media (orientation: landscape) and (max-width: 960px) and (max-height: 520px) {
  :root {
    --float-bottom: max(8px, env(safe-area-inset-bottom));
    --float-tab-height: 42px;
    --woodfish-size: 42px;
  }

  .app {
    height: auto;
    min-height: 100dvh;
    grid-template-rows: auto auto auto;
    gap: 7px;
    padding: 7px 8px calc(var(--float-bottom) + 48px);
    overflow: auto;
  }

  .dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(128px, auto));
    gap: 7px;
  }

  .tile {
    gap: 5px;
    padding: 8px 10px;
  }

  .tile.time {
    padding-top: 7px;
  }

  .tile-head {
    font-size: 11px;
  }

  .avatar {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .baby-profile {
    gap: 6px;
  }

  .baby-name {
    font-size: 13px;
  }

  .baby-days {
    margin-top: 0;
    font-size: 10px;
  }

  .edit-profile-btn {
    min-height: 26px;
    padding: 0 8px;
    font-size: 10px;
  }

  .clock {
    font-size: clamp(32px, 7.5vw, 48px);
  }

  .date-line,
  .weather-line {
    font-size: 10px;
    line-height: 1.18;
  }

  .time-bottom {
    grid-template-columns: minmax(0, 1fr) minmax(150px, .74fr);
    gap: 7px;
    align-items: end;
  }

  .med-grid {
    gap: 4px;
  }

  .med-option {
    min-height: 21px;
    grid-template-columns: 10px auto;
    gap: 4px;
    padding: 0 4px;
    font-size: 9px;
  }

  .med-box {
    width: 10px;
    height: 10px;
  }

  .metric {
    font-size: clamp(25px, 5.2vw, 38px);
  }

  .sub-metrics {
    gap: 5px;
  }

  .mini {
    padding: 5px 7px;
  }

  .mini span {
    margin-bottom: 1px;
    font-size: 9px;
  }

  .mini strong {
    font-size: 11px;
  }

  .button-grid {
    gap: 5px;
  }

  .big-action,
  .choice-btn {
    min-height: 30px;
    font-size: 11px;
  }

  .records,
  .history-view {
    min-height: 190px;
  }

  .records-head {
    min-height: 30px;
    padding: 4px 9px;
    gap: 6px;
  }

  .records-head h2 {
    font-size: 12px;
  }

  .records-head p,
  .export-btn {
    font-size: 10px;
  }

  .export-btn {
    height: 26px;
    padding: 0 9px;
  }

  .record-content {
    overflow: auto;
  }

  .record-subhead {
    min-height: 24px;
    font-size: 10px;
  }

  .record-row,
  .empty {
    min-height: 28px;
    font-size: 11px;
  }

  .items {
    padding-bottom: 48px;
  }

  .app-footer {
    font-size: 10px;
    padding-bottom: 0;
  }

  .floating-tabs {
    left: calc(50% - 87px);
    width: 168px;
    padding: 5px;
  }

  .theme-toggle-btn {
    left: calc(50% + 3px);
  }

  .woodfish-btn {
    left: calc(50% + 119px);
  }

  .nightlight-btn {
    left: calc(50% + 61px);
  }

  body.simple-theme .app {
    height: 100dvh;
    min-height: 100dvh;
    padding: 8px 8px calc(var(--float-bottom) + var(--woodfish-size) + 10px);
    overflow: hidden;
  }

  body.simple-theme .dashboard {
    height: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1.12fr) minmax(0, 1fr);
    gap: 8px;
  }

  body.simple-theme .tile {
    min-height: 0;
    padding: 10px;
  }

  body.simple-theme .clock {
    font-size: clamp(42px, 16vh, 82px);
  }

  body.simple-theme .metric {
    font-size: clamp(32px, 8vw, 72px);
  }

  body.simple-theme .tile.sleep .sub-metrics,
  body.simple-theme .tile.feed .sub-metrics {
    width: min(320px, 90%);
    margin-top: 8px;
  }

  body.simple-theme .tile.sleep .mini,
  body.simple-theme .tile.feed .mini {
    padding: 0;
    border: 0;
    background: transparent;
  }

  body.simple-theme .tile.sleep .mini strong,
  body.simple-theme .tile.feed .mini strong {
    font-size: clamp(15px, 3vw, 24px);
  }
}

@media (orientation: landscape) and (min-width: 961px) and (max-width: 1400px) and (max-height: 900px) {
  body.simple-theme .app {
    height: 100dvh;
    min-height: 100dvh;
    padding: 12px 14px calc(var(--float-bottom) + var(--woodfish-size) + 16px);
    overflow: hidden;
  }

  body.simple-theme .dashboard {
    height: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1.18fr) minmax(0, 1fr);
    gap: 12px;
  }

  body.simple-theme .tile {
    min-height: 0;
    padding: clamp(12px, 2vw, 24px);
  }

  body.simple-theme .clock {
    font-size: clamp(88px, 13vw, 174px);
  }

  body.simple-theme .metric {
    font-size: clamp(54px, 7vw, 96px);
  }

  body.simple-theme .tile.sleep .sub-metrics,
  body.simple-theme .tile.feed .sub-metrics {
    width: min(360px, 86%);
    margin-top: 10px;
  }

  body.simple-theme .tile.sleep .mini strong,
  body.simple-theme .tile.feed .mini strong {
    font-size: clamp(18px, 2.4vw, 30px);
  }
}

@media (orientation: landscape) and (min-width: 1500px) and (max-width: 2199px) and (max-height: 1180px) {
  :root {
    --float-bottom: 14px;
    --float-tab-height: 48px;
    --woodfish-size: 48px;
  }

  .app {
    gap: 10px;
    padding: 10px 12px;
    grid-template-rows: minmax(0, 2.35fr) minmax(0, .9fr) auto;
  }

  .dashboard {
    gap: 10px;
  }

  .tile {
    gap: 7px;
    padding: 12px 14px;
  }

  .tile-head {
    font-size: 12px;
  }

  .tile.time {
    padding-top: 8px;
  }

  .avatar {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .baby-profile {
    gap: 8px;
  }

  .baby-name {
    font-size: 16px;
  }

  .baby-days {
    margin-top: 1px;
    font-size: 11px;
  }

  .edit-profile-btn {
    min-height: 30px;
    padding: 0 10px;
    font-size: 11px;
  }

  .clock {
    font-size: clamp(58px, 6.2vw, 84px);
  }

  .date-line,
  .weather-line {
    font-size: 11px;
    line-height: 1.22;
  }

  .time-bottom {
    grid-template-columns: minmax(0, 1fr) minmax(230px, .68fr);
    gap: 8px;
  }

  .med-grid {
    gap: 5px;
  }

  .med-option {
    min-height: 24px;
    grid-template-columns: 11px auto;
    gap: 4px;
    padding: 0 5px;
    font-size: 10px;
  }

  .med-box {
    width: 11px;
    height: 11px;
  }

  .metric {
    font-size: clamp(34px, 4.1vw, 48px);
  }

  .sub-metrics {
    gap: 7px;
  }

  .mini {
    padding: 6px 8px;
  }

  .mini span {
    margin-bottom: 2px;
    font-size: 10px;
  }

  .mini strong {
    font-size: 13px;
  }

  .button-grid {
    gap: 7px;
  }

  .big-action,
  .choice-btn {
    min-height: 38px;
    font-size: 13px;
  }

  .records-head {
    min-height: 32px;
    padding: 4px 14px;
  }

  .records-head h2 {
    font-size: 13px;
  }

  .records-head p,
  .export-btn {
    font-size: 11px;
  }

  .export-btn {
    height: 28px;
    padding: 0 11px;
  }

  .record-subhead {
    min-height: 26px;
    font-size: 11px;
  }

  .record-row,
  .empty {
    min-height: 30px;
    font-size: 12px;
  }

  .items {
    padding-bottom: 54px;
  }

  .app-footer {
    font-size: 10px;
  }

  .floating-tabs {
    left: calc(50% - 87px);
    width: 188px;
    padding: 5px;
  }

  .theme-toggle-btn {
    left: calc(50% + 13px);
  }

  .woodfish-btn {
    left: calc(50% + 129px);
  }

  .nightlight-btn {
    left: calc(50% + 71px);
  }
}

@media (min-width: 2200px) and (min-height: 1400px) {
  :root {
    --float-bottom: calc((100dvh - 1320px) / 2 + 18px);
    --float-tab-height: 56px;
    --woodfish-size: 56px;
  }

  body {
    display: grid;
    place-items: center;
  }

  .app {
    width: min(100vw, 2200px);
    height: min(100dvh, 1320px);
    min-height: min(100dvh, 1320px);
    margin: auto;
    gap: 18px;
    padding: 22px;
    grid-template-rows: minmax(0, 1.65fr) minmax(0, .95fr) auto;
  }

  .dashboard {
    gap: 18px;
  }

  .tile {
    gap: 13px;
    padding: 24px;
    border-radius: 12px;
  }

  .tile-head {
    font-size: 16px;
  }

  .avatar {
    width: 60px;
    height: 60px;
    font-size: 28px;
  }

  .baby-name {
    font-size: 22px;
  }

  .baby-days {
    font-size: 14px;
  }

  .edit-profile-btn {
    min-height: 42px;
    padding: 0 16px;
    font-size: 14px;
  }

  .clock {
    font-size: clamp(96px, 5.4vw, 132px);
  }

  .date-line,
  .weather-line {
    font-size: 15px;
  }

  .med-option {
    min-height: 36px;
    font-size: 13px;
  }

  .metric {
    font-size: clamp(60px, 3.4vw, 78px);
  }

  .mini {
    padding: 12px 14px;
  }

  .mini span {
    font-size: 13px;
  }

  .mini strong {
    font-size: 18px;
  }

  .big-action,
  .choice-btn {
    min-height: 58px;
    font-size: 16px;
  }

  .records,
  .history-view {
    border-radius: 12px;
  }

  .records-head {
    min-height: 44px;
    padding: 8px 22px;
  }

  .records-head h2 {
    font-size: 16px;
  }

  .records-head p {
    font-size: 13px;
  }

  .export-btn {
    height: 34px;
    padding: 0 16px;
    font-size: 13px;
  }

  .record-subhead {
    min-height: 34px;
    font-size: 13px;
  }

  .record-row,
  .empty {
    min-height: 38px;
    font-size: 14px;
  }

  .floating-tabs {
    left: calc(50% - 87px);
    width: 240px;
    height: var(--float-tab-height);
  }

  .theme-toggle-btn {
    left: calc(50% + 45px);
  }

  .woodfish-btn {
    left: calc(50% + 161px);
  }

  .nightlight-btn {
    left: calc(50% + 103px);
  }
}

@media (max-width: 460px) {
  :root {
    --float-bottom: max(10px, env(safe-area-inset-bottom));
    --float-tab-height: 46px;
    --woodfish-size: 46px;
  }

  .mobile-cloud-login:not([hidden]) {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
    margin: 8px 8px 0;
    padding: 8px;
    border: 1px solid rgba(53, 197, 107, .24);
    border-radius: var(--radius);
    background: rgba(24, 24, 24, .92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  }

  .mobile-cloud-login input {
    min-width: 0;
    height: 40px;
    padding: 0 9px;
    border-radius: 7px;
    font-size: 12px;
  }

  .mobile-cloud-login button {
    grid-column: 1 / -1;
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border-radius: 7px;
    background: var(--green-2);
    color: #071008;
    font-size: 12px;
    font-weight: 900;
  }

  .app { padding: 8px 8px calc(var(--float-bottom) + var(--float-tab-height) + 38px); gap: 8px; }
  .dashboard { gap: 8px; }
  .tile { padding: 11px; }
  .profile-inline-fields { gap: 8px; }
  .profile-identity-row { gap: 8px; }
  .profile-avatar-field .avatar-upload { grid-template-columns: 48px auto; }
  .profile-avatar-field .avatar-preview { width: 48px; height: 48px; }
  .profile-avatar-field .file-btn { padding: 0 9px; }
  .sex-choice-btn { min-height: 40px; padding: 0 7px; }
  .profile-inline-fields input { padding-left: 10px; padding-right: 38px; }
  .button-grid { grid-template-columns: 1fr; }
  .quick-amounts, .side-choices { grid-template-columns: 1fr 1fr; }
  .side-choice { min-height: 54px; }
  .sub-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .mini { padding: 7px 8px; }
  .mini span { font-size: 10px; margin-bottom: 3px; }
  .mini strong { font-size: 14px; }
  .time-bottom { grid-template-columns: 1fr; }
  .clock { font-size: 38px; }
  .metric { font-size: 21px; }
  .med-grid { gap: 5px; }
  .care-grid { gap: 5px; }
  .care-temp-btn { min-height: 30px; font-size: 11px; }
  .med-option {
    min-height: 30px;
    grid-template-columns: 12px auto;
    justify-content: center;
    padding: 0 6px;
    font-size: 11px;
  }
  .med-box {
    width: 12px;
    height: 12px;
  }
  .floating-tabs {
    left: calc(50% - 80px);
    width: 190px;
    height: var(--float-tab-height);
  }
  .woodfish-btn {
    left: calc(50% + 126px);
  }
  .nightlight-btn {
    left: calc(50% + 76px);
  }
  .theme-toggle-btn {
    left: calc(50% + 26px);
    font-size: 18px;
  }
  .history-actions { gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
  .history-switch-group { order: -1; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
  .chart-grid { grid-template-columns: 1fr; }
  .timeline-card { grid-template-columns: 1fr; gap: 8px; }
  .timeline-date { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .timeline-date strong { margin-bottom: 0; }
  .chart-toolbar { align-items: flex-start; }
  .chart-range { flex-wrap: wrap; border-radius: 14px; }
  .custom-range { display: none; width: 100%; }
  .custom-range.open { display: grid; grid-template-columns: 1fr auto 1fr; visibility: visible; opacity: 1; pointer-events: auto; }
  .custom-range input { width: 100%; }
}

@media (max-width: 430px) {
  .dashboard {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-rows: auto;
  }

  .tile {
    min-height: 178px;
  }

  .tile.time {
    min-height: 250px;
  }

  .clock {
    font-size: clamp(42px, 17vw, 68px);
  }

  .metric {
    font-size: clamp(28px, 11vw, 44px);
  }

  .button-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .choice-btn {
    min-height: 42px;
    font-size: 12px;
  }

  .records-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .records-title-line {
    width: 100%;
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .records-head p {
    margin-left: 0;
  }
}

@media (max-width: 700px) {
  .vaccine-head {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .vaccine-head-actions {
    width: 100%;
  }

  .vaccine-head-actions .export-btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 8px;
  }

  .vaccine-content { padding: 10px; }

  .vaccine-next-card {
    min-height: 0;
    align-items: flex-start;
    padding: 14px;
  }

  .vaccine-next-actions > strong {
    font-size: 18px;
  }

  .vaccine-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .vaccine-filter { width: 100%; }
  .vaccine-filter-btn { flex: 1 1 0; padding: 0 6px; }

  .vaccine-plan-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .vaccine-card-actions {
    justify-content: flex-end;
  }

  .vaccine-form-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .vaccine-modal {
    max-height: 92dvh;
    padding: 14px;
  }
}

.history-month-pager {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(112, 199, 247, .18);
  border-radius: var(--radius);
  background: rgba(112, 199, 247, .06);
  overflow: hidden;
}

.history-month-scroll {
  display: flex;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: rgba(112, 199, 247, .26) transparent;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  padding-bottom: 2px;
}

.history-month-scroll::-webkit-scrollbar { height: 4px; }
.history-month-scroll::-webkit-scrollbar-thumb { border-radius: 99px; background: rgba(112, 199, 247, .26); }

.history-month-option {
  flex: 0 0 auto;
  min-width: 104px;
  min-height: 52px;
  display: grid;
  place-content: center;
  gap: 3px;
  padding: 6px 13px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  background: rgba(255, 255, 255, .07);
  color: var(--ink);
  scroll-snap-align: center;
}

.history-month-option strong { margin: 0; font-size: 13px; white-space: nowrap; }
.history-month-option span { color: var(--muted); font-size: 9px; white-space: nowrap; }

.history-month-option.active {
  border-color: rgba(112, 199, 247, .54);
  background: rgba(112, 199, 247, .16);
  box-shadow: inset 0 0 0 1px rgba(112, 199, 247, .10);
}

.history-month-option.active span { color: rgba(185, 226, 250, .82); }

.history-list-filter {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.history-list-filter::-webkit-scrollbar { display: none; }

.history-list-filter-btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: rgba(179, 179, 179, .76);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.history-list-filter-btn.active {
  border-color: rgba(112, 199, 247, .52);
  background: rgba(112, 199, 247, .16);
  color: #dff3ff;
}

.history-filter-empty { grid-column: 1 / -1; }

body.embedded-host {
  --embedded-content-clearance: 34px;
}

body.embedded-host .floating-tabs,
body.embedded-host .woodfish-btn,
body.embedded-host .nightlight-btn,
body.embedded-host .theme-toggle-btn {
  position: fixed;
  background-color: rgba(24, 24, 24, .84);
}

body.embedded-host .app {
  height: auto;
  min-height: 0;
  overflow: visible;
  grid-template-rows: auto auto auto;
  padding-bottom: calc(var(--float-bottom) + var(--float-tab-height) + var(--embedded-content-clearance));
}

body.embedded-host .history-view,
body.embedded-host .vaccine-view,
body.embedded-host .records {
  overflow: visible;
}

body.embedded-host .history-list,
body.embedded-host .history-chart,
body.embedded-host .history-timeline,
body.embedded-host .history-growth,
body.embedded-host .vaccine-content {
  overflow: visible;
}

@media (orientation: landscape) and (max-height: 520px) {
  body.embedded-host {
    --embedded-content-clearance: 24px;
  }
}

/* Tablet display mode: replace the decorative orbit, keeping the digital clock. */
.tablet-care { display: none; }

/* Shared daily strip on phone and tablet. */
  body.simple-theme .time-orbit { display: none; }

  body.simple-theme .tablet-care {
    display: block;
    flex: 0 0 auto;
    width: min(720px, 94%);
    margin: 0 auto clamp(8px, 1.5vh, 18px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
    text-align: left;
  }

  .tablet-care-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 5px;
    overflow-x: auto;
  }

  /* Auto margins center short rows; on overflow they become zero so every item remains reachable. */
  .tablet-care-grid > :first-child { margin-left: auto; }
  .tablet-care-grid > :last-child { margin-right: auto; }

  .tablet-care-item {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
  }

  .tablet-care-item strong { font-size: inherit; font-variant-numeric: tabular-nums; }
  .tablet-care-item.is-recorded {
    color: #9ff0bf;
    border-color: rgba(159, 240, 191, .28);
    background: rgba(53, 197, 107, .10);
  }

/* Keep sync feedback visible in display mode without changing the clock layout. */
.simple-cloud-status { display: none; }

body.simple-theme .simple-cloud-status {
  display: block;
  position: absolute;
  top: 10px;
  right: 12px;
  max-width: calc(100% - 24px);
  color: var(--muted);
  font: 11px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  text-align: right;
  overflow-wrap: anywhere;
}

body.simple-theme .simple-cloud-status.ok { color: #9ff0bf; }
body.simple-theme .simple-cloud-status.warning { color: #e8cb8c; }
body.simple-theme .simple-cloud-status.danger { color: #ffb0b6; }
.care-check { font-weight: 800; }
