:root {
  color-scheme: dark;
  --bg: #0a1028;
  --surface: rgba(24, 31, 67, 0.9);
  --surface-strong: rgba(35, 43, 87, 0.92);
  --ink: #F8FBFD;
  --muted: #d9e6ef;
  --line: rgba(168, 216, 240, 0.28);
  --accent: #A8D8F0;
  --accent-strong: #F8FBFD;
  --accent-soft: rgba(168, 216, 240, 0.15);
  --mint: #A8D8F0;
  --lavender: #CBB7F7;
  --nap-color: #4169E1;
  --next-nap-color: #A8D8F0;
  --night-color: #8E6AD8;
  --feed: #8A3FFC;
  --peach: #DFF3FF;
  --warn: #CBB7F7;
  --shadow: 0 18px 46px rgba(4, 7, 24, 0.46);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -12%, rgba(203, 183, 247, 0.24), transparent 34%),
    linear-gradient(180deg, #0a1028 0%, #111a3d 48%, #17264b 100%);
  color: var(--ink);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    radial-gradient(circle, rgba(248, 251, 253, 0.95) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(168, 216, 240, 0.9) 0 1px, transparent 1.7px),
    radial-gradient(circle, rgba(203, 183, 247, 0.85) 0 1.2px, transparent 1.9px);
  background-position: 16px 20px, 88px 62px, 138px 12px;
  background-size: 132px 142px, 176px 188px, 214px 156px;
  opacity: 0.52;
}

body::after {
  background:
    radial-gradient(ellipse at 50% 100%, rgba(158, 230, 211, 0.16), transparent 42%),
    linear-gradient(180deg, transparent 62%, rgba(9, 17, 41, 0.72) 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}

.topbar,
.section-head,
.button-row,
.inline-input {
  display: flex;
  align-items: center;
}

.topbar,
.section-head {
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  padding: 8px 2px 18px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 1.65rem;
}

h2 {
  margin-bottom: 0;
  font-size: 1.12rem;
}

.hero,
.panel,
.note {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: center;
  min-height: 176px;
  padding: 22px;
  border-radius: 8px;
}

.sleep-dashboard {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(24, 31, 67, 0.95), rgba(18, 28, 61, 0.88)),
    var(--surface);
}

.sleep-dashboard::before {
  content: "★";
  position: absolute;
  right: 24px;
  bottom: 18px;
  color: rgba(203, 183, 247, 0.34);
  font-size: 2.2rem;
}

.day-ring-wrap {
  position: relative;
  width: min(220px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  filter: drop-shadow(0 0 22px rgba(203, 183, 247, 0.22));
}

.day-ring {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.day-ring-track,
.day-ring-segment,
.day-ring-now {
  fill: none;
  stroke-linecap: round;
}

.day-ring-track {
  stroke: rgba(203, 183, 247, 0.14);
  stroke-width: 22;
}

.day-ring-segment {
  stroke-width: 22;
}

.day-ring-segment.nap {
  stroke: var(--nap-color);
}

.day-ring-segment.next {
  stroke: var(--next-nap-color);
  stroke-width: 6;
  stroke-dasharray: 1 12;
  opacity: 0.95;
}

.day-ring-segment.night {
  stroke: var(--night-color);
}

.day-ring-segment.night-future {
  stroke: var(--night-color);
  stroke-width: 6;
  stroke-dasharray: 1 12;
  opacity: 0.95;
}

.day-ring-now {
  stroke: #F8FBFD;
  stroke-width: 3;
}

.day-ring-core {
  fill: rgba(12, 18, 44, 0.72);
  stroke: rgba(203, 183, 247, 0.2);
  stroke-width: 1;
}

.day-marker {
  fill: #F8FBFD;
  stroke: var(--lavender);
  stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(203, 183, 247, 0.4));
}

.day-marker.nap {
  stroke: var(--nap-color);
}

.day-marker.next {
  fill: rgba(12, 18, 44, 0.92);
  stroke: var(--next-nap-color);
}

.day-marker.feed {
  fill: var(--feed);
  stroke: #F8FBFD;
}

.day-marker.night {
  fill: rgba(12, 18, 44, 0.92);
  stroke: var(--night-color);
}

.day-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.day-ring-center span,
.day-ring-center small,
.night-callout span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.day-ring-center span:empty {
  display: none;
}

.day-ring-center strong {
  order: 2;
  margin: 5px 0 0;
  font-size: 1.5rem;
  line-height: 1;
}

.day-ring-center small {
  order: 1;
  max-width: 116px;
  line-height: 1.1;
}

.ring-caption-row {
  display: none;
}

.ring-caption {
  min-width: 58px;
  padding: 8px 9px;
  border: 1px solid rgba(203, 183, 247, 0.24);
  border-radius: 999px;
  background: rgba(15, 20, 48, 0.88);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 10px 22px rgba(3, 8, 24, 0.2);
}

.dashboard-copy {
  min-width: 0;
}

.baby-summary,
.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.baby-summary {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(168, 216, 240, 0.28);
  border-radius: 8px;
  background: rgba(168, 216, 240, 0.1);
}

.baby-avatar,
.profile-moon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #111a3d;
  font-size: 1.35rem;
  font-weight: 900;
}

.baby-summary strong,
.baby-summary span,
.profile-card span,
.profile-card strong,
.profile-card small {
  display: block;
}

.baby-summary strong,
.profile-card strong {
  color: var(--ink);
}

.baby-summary span,
.profile-card span,
.profile-card small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.hero h2 {
  margin: 10px 0 10px;
  font-size: clamp(1.85rem, 8vw, 3rem);
  line-height: 0.96;
}

.hero p:last-child,
.fineprint,
.note p {
  color: var(--muted);
  line-height: 1.45;
}

.hero-meter {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 82px;
  height: 82px;
}

.sleep-dashboard .hero-meter {
  display: none;
}

.hero-meter {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 118px;
  height: 118px;
}

.hero-meter svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.meter-bg,
.meter-fg {
  fill: none;
  stroke-width: 10;
}

.meter-bg {
  stroke: #263c5a;
}

.meter-fg {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 314;
  stroke-dashoffset: 314;
  transition: stroke-dashoffset 250ms ease;
}

.hero-meter strong {
  position: relative;
  font-size: 1.45rem;
  line-height: 1;
}

.hero-meter span {
  position: relative;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.dashboard-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(12, 18, 44, 0.72);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.legend-dot.nap {
  background: var(--nap-color);
}

.legend-dot.next {
  background: var(--next-nap-color);
}

.legend-dot.feed {
  background: var(--feed);
  border: 1px solid rgba(248, 251, 253, 0.72);
}

.legend-dot.night {
  background: var(--night-color);
}

.night-callout {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 18, 44, 0.74);
}

.night-callout strong {
  display: block;
  margin-top: 4px;
  font-size: 1.8rem;
  line-height: 1;
}

.night-callout p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.panel,
.note {
  margin-top: 14px;
  padding: 18px;
  border-radius: 8px;
}

.timer-panel {
  background:
    linear-gradient(145deg, rgba(35, 43, 87, 0.94), rgba(24, 31, 67, 0.9)),
    var(--surface-strong);
}

.timer-panel.is-idle .timer,
.timer-panel.is-idle .nap-detail-grid {
  display: none;
}

.pill {
  flex: 0 0 auto;
  max-width: 48%;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.timer {
  margin: 18px 0;
  font-variant-numeric: tabular-nums;
  font-size: clamp(3.2rem, 18vw, 6rem);
  font-weight: 850;
  line-height: 0.95;
  letter-spacing: 0;
}

.nap-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.nap-detail-grid div {
  min-height: 72px;
  padding: 11px;
  border-radius: 8px;
  background: rgba(12, 18, 44, 0.72);
}

.nap-detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.nap-detail-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1rem;
}

.button-row {
  gap: 10px;
}

.start-compact {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.start-main {
  min-height: 62px;
  font-size: 1.2rem;
}

.start-compact .secondary[disabled] {
  display: none;
}

.night-controls {
  margin-top: 10px;
}

.night-button {
  flex: 1;
}

.manual-link {
  margin-top: 8px;
}

.primary,
.secondary,
.top-button,
.text-button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.top-button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(168, 216, 240, 0.14);
  color: var(--accent-strong);
  font-weight: 850;
}

.primary,
.secondary {
  min-height: 50px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 800;
}

.primary {
  flex: 1;
  background: var(--accent);
  color: #111a3d;
}

.full-width {
  width: 100%;
}

.secondary {
  background: rgba(203, 183, 247, 0.18);
  color: var(--ink);
}

.secondary:disabled {
  opacity: 0.45;
}

.text-button {
  min-height: 38px;
  padding: 0;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 800;
}

.danger {
  color: var(--warn);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  color: #111a3d;
  font-size: 1.3rem;
  font-weight: 800;
}

.profile-card {
  margin-top: 16px;
  padding: 13px;
  border: 1px solid rgba(168, 216, 240, 0.22);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(168, 216, 240, 0.12), rgba(203, 183, 247, 0.12));
}

.profile-moon {
  width: 46px;
  height: 46px;
}

.form-grid,
.insight-grid {
  display: grid;
  gap: 12px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 18, 44, 0.76);
  color: var(--ink);
  padding: 0 12px;
}

select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 18, 44, 0.76);
  color: var(--ink);
  padding: 0 12px;
}

.inline-input {
  overflow: hidden;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 18, 44, 0.76);
}

.inline-input input {
  min-height: 46px;
  border: 0;
  border-radius: 0;
}

.inline-input span {
  padding-right: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.insight-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 14px;
}

.insight-grid div {
  min-height: 74px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(12, 18, 44, 0.72);
}

.insight-grid span,
.history span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.insight-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
}

.history {
  display: grid;
  gap: 9px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.history-filter {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
}

.compact-button {
  min-height: 48px;
  padding: 0 14px;
}

.history li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 18, 44, 0.72);
}

.history strong {
  white-space: nowrap;
}

.history-times {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 800;
}

.history-mood {
  align-self: center;
  min-width: 106px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(158, 230, 211, 0.14);
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.history-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.delete-nap {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(203, 183, 247, 0.16);
  color: var(--warn);
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
}

.note {
  background: rgba(56, 38, 70, 0.78);
  box-shadow: none;
}

.notice-card {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 18, 44, 0.72);
}

.notice-card strong {
  display: block;
  margin-bottom: 6px;
}

.notice-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.notification-button {
  margin-top: 12px;
}

.note strong {
  display: block;
  margin-bottom: 6px;
}

.sheet {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-end;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: rgba(2, 8, 18, 0.68);
  z-index: 10;
}

.sheet[aria-hidden="false"] {
  display: flex;
}

.sheet-card {
  position: relative;
  width: min(520px, 100%);
  margin: 0 auto;
  padding: 22px;
  border-radius: 8px;
  background: #181f43;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.profile-sheet-card {
  width: min(720px, 100%);
}

.report-sheet-card {
  width: min(760px, 100%);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.report-filter {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: end;
  gap: 10px;
  margin-top: 14px;
}

.report-filter div {
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 18, 44, 0.72);
}

.report-filter span,
.report-filter strong {
  display: block;
}

.report-filter span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.report-filter strong {
  margin-top: 3px;
}

.report-grid div {
  min-height: 76px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(12, 18, 44, 0.72);
}

.report-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.report-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.2rem;
}

.report-chart-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

.report-chart {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
}

.chart-bg {
  fill: rgba(12, 18, 44, 0.62);
}

.chart-grid {
  stroke: rgba(248, 251, 253, 0.12);
  stroke-width: 1;
}

.chart-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.chart-label.x {
  text-anchor: middle;
}

.chart-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-line.day {
  stroke: var(--mint);
}

.chart-line.night {
  stroke: var(--lavender);
}

.chart-line.total,
.chart-point.total {
  stroke: var(--accent);
  fill: var(--accent);
}

.legend-dot.total {
  background: var(--accent);
}

.report-legend {
  margin-top: 12px;
}

.profile-panel.is-in-sheet {
  margin-top: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.profile-panel.is-in-sheet > .section-head {
  display: none;
}

.close {
  position: sticky;
  top: 0;
  z-index: 2;
  float: right;
  margin: -6px -6px 8px 10px;
  width: 34px;
  height: 34px;
  background: rgba(203, 183, 247, 0.18);
  color: var(--ink);
  font-size: 1rem;
  box-shadow: 0 8px 18px rgba(3, 8, 24, 0.24);
}

.sheet-card > .label {
  clear: both;
}

.mood-options {
  display: grid;
  gap: 10px;
  margin: 18px 0 12px;
}

.mood-options.compact {
  margin-top: 12px;
}

.mood-options[hidden] {
  display: none;
}

.manual-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.manual-card-button {
  display: grid;
  gap: 5px;
  min-height: 74px;
  border: 1px solid rgba(168, 216, 240, 0.24);
  border-radius: 8px;
  background: rgba(168, 216, 240, 0.1);
  color: var(--ink);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.manual-card-button.night {
  border-color: rgba(203, 183, 247, 0.26);
  background: rgba(203, 183, 247, 0.12);
}

.manual-card-button.feeding {
  border-color: rgba(138, 63, 252, 0.28);
  background: rgba(138, 63, 252, 0.13);
}

.start-options {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.manual-card-button strong {
  font-size: 0.95rem;
}

.manual-card-button span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.feeding-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.feed-button {
  min-height: 48px;
}

.feeding-profile {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 18, 44, 0.52);
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 18, 44, 0.62);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.checkbox-grid input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--lavender);
}

.side-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.side-option {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 18, 44, 0.7);
  color: var(--muted);
  font-weight: 800;
}

.side-option.is-selected {
  border-color: rgba(168, 216, 240, 0.78);
  background: rgba(168, 216, 240, 0.16);
  color: var(--accent-strong);
}

.manual-form {
  margin-top: 16px;
}

.mood-option.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(101, 214, 199, 0.18);
}

.mood-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 18, 44, 0.84);
  color: var(--ink);
  padding: 0 14px;
  font-weight: 850;
  text-align: left;
}

.mood-option span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.mood-option.happy span {
  background: var(--mint);
}

.mood-option.neutral span {
  background: var(--accent);
}

.mood-option.upset span {
  background: var(--peach);
}

@media (max-width: 560px) {
  .sheet {
    align-items: flex-end;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .sheet-card {
    width: 100%;
    max-height: min(84vh, calc(100vh - 24px));
    padding: 16px;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
  }

  .profile-sheet-card,
  .report-sheet-card {
    max-height: min(84vh, calc(100vh - 24px));
  }

  .close {
    width: 40px;
    height: 40px;
    margin: -4px -4px 10px 10px;
    background: rgba(213, 225, 255, 0.22);
  }

  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 26px;
    text-align: center;
  }

  .day-ring-wrap {
    width: min(292px, 82vw);
  }

  .hero h2 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .form-grid,
  .insight-grid,
  .history-filter,
  .manual-actions,
  .feeding-actions,
  .report-filter,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .checkbox-grid,
  .side-options {
    grid-template-columns: 1fr;
  }

  .pill {
    max-width: 44%;
  }
}

@supports (height: 100dvh) {
  .sheet-card {
    max-height: calc(100dvh - 32px);
  }

  @media (max-width: 560px) {
    .sheet-card,
    .profile-sheet-card,
    .report-sheet-card {
      max-height: min(84dvh, calc(100dvh - 24px));
    }
  }
}
