:root {
  color-scheme: light;
  --ink: #202321;
  --ink-soft: #4e5551;
  --muted: #777d79;
  --canvas: #f6f6f3;
  --surface: #ffffff;
  --line: #e6e7e3;
  --line-strong: #d7d9d4;
  --forest: #24463b;
  --forest-light: #dfeae5;
  --coral: #df614d;
  --coral-light: #f9e6e1;
  --lavender: #6d6593;
  --lavender-light: #ebe8f3;
  --blue: #3f7185;
  --blue-light: #e2eef2;
  --sand: #eee7d8;
  --radius-lg: 28px;
  --radius-md: 20px;
  --shadow-sm: 0 1px 2px rgba(28, 33, 30, 0.04), 0 8px 28px rgba(28, 33, 30, 0.055);
  --shadow-lg: 0 24px 70px rgba(31, 43, 37, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, rgba(223, 97, 77, 0.055), transparent 25rem),
    var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(63, 113, 133, 0.26);
  outline-offset: 3px;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

.site-header {
  position: relative;
  z-index: 10;
  width: min(1180px, calc(100% - 56px));
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--forest);
  box-shadow: 0 8px 24px rgba(36, 70, 59, 0.2);
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.brand-mark--small {
  width: 42px;
  height: 42px;
  font-size: 18px;
  box-shadow: none;
}

.brand-mark--tiny {
  width: 28px;
  height: 28px;
  font-size: 12px;
  box-shadow: none;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 15px;
  line-height: 1.1;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.privacy-pill {
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  font-weight: 700;
}

.live-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  flex: 0 0 auto;
  margin-right: 7px;
  border-radius: 50%;
  background: #55a272;
  box-shadow: 0 0 0 3px rgba(85, 162, 114, 0.12);
}

.quiet-button,
.refresh-button,
.older-button {
  border: 0;
  cursor: pointer;
}

.quiet-button {
  padding: 10px 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.quiet-button:hover {
  color: var(--ink);
}

.dashboard {
  width: min(1080px, calc(100% - 56px));
  margin: 76px auto 110px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(360px, 0.97fr);
  align-items: stretch;
  gap: clamp(30px, 7vw, 88px);
  margin-bottom: 44px;
}

.hero-copy-wrap {
  padding: 28px 0 22px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
}

.overline {
  margin-bottom: 16px;
  color: var(--coral);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: 23px;
  font-size: clamp(49px, 6.5vw, 78px);
  font-weight: 730;
  letter-spacing: -0.065em;
  line-height: 0.94;
}

.hero h1 span {
  color: #939894;
  font-weight: 500;
}

.hero-copy {
  max-width: 430px;
  margin-bottom: 31px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.refresh-button {
  min-height: 46px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 720;
  box-shadow: 0 2px 7px rgba(28, 33, 30, 0.035);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.refresh-button:hover {
  border-color: #bec2bc;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.refresh-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.refresh-button.is-loading .refresh-icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.latest-card {
  position: relative;
  isolation: isolate;
  min-height: 414px;
  overflow: hidden;
  padding: 30px;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  border-radius: var(--radius-lg);
  color: white;
  background: var(--forest);
  box-shadow: var(--shadow-lg);
}

.latest-card::before,
.latest-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.latest-card::before {
  width: 280px;
  height: 280px;
  top: -155px;
  right: -80px;
  border: 58px solid rgba(255, 255, 255, 0.055);
}

.latest-card::after {
  width: 170px;
  height: 170px;
  right: -70px;
  bottom: -85px;
  background: rgba(255, 255, 255, 0.045);
}

.latest-card--meal { background: #8a483c; }
.latest-card--sleep { background: #514a70; }
.latest-card--diaper { background: #345d6d; }
.latest-card--attendance { background: var(--forest); }

.latest-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.latest-badge {
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 10px;
  font-weight: 780;
  letter-spacing: 0.03em;
}

.latest-badge .live-dot {
  background: #9fe0b5;
  box-shadow: 0 0 0 3px rgba(159, 224, 181, 0.1);
}

.latest-time {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
}

.latest-icon {
  width: 58px;
  height: 58px;
  margin: 43px 0 20px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: var(--forest);
  background: #f7f2e8;
}

.latest-icon svg {
  width: 27px;
  height: 27px;
}

.latest-label {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.latest-card h2 {
  max-width: 360px;
  margin-bottom: 9px;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 680;
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.latest-detail {
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 13px;
  line-height: 1.5;
}

.latest-footer {
  width: 100%;
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
}

.latest-footer svg {
  width: 18px;
  height: 18px;
}

.latest-card--loading {
  justify-content: center;
}

.latest-skeleton {
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.13);
  animation: pulse 1.4s ease-in-out infinite;
}

.latest-skeleton--badge {
  width: 105px;
  height: 27px;
  margin-bottom: 60px;
}

.latest-skeleton--title {
  width: 80%;
  height: 32px;
  margin-bottom: 14px;
}

.latest-skeleton--copy {
  width: 48%;
  height: 14px;
}

@keyframes pulse {
  50% { opacity: 0.48; }
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 94px;
}

.summary-card {
  min-height: 176px;
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.summary-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.summary-icon {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--forest);
  background: var(--forest-light);
}

.summary-card--meal .summary-icon {
  color: #9c4435;
  background: var(--coral-light);
}

.summary-card--sleep .summary-icon {
  color: var(--lavender);
  background: var(--lavender-light);
}

.summary-card--diaper .summary-icon {
  color: var(--blue);
  background: var(--blue-light);
}

.summary-icon svg {
  width: 18px;
  height: 18px;
}

.summary-label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.02em;
}

.summary-value {
  display: block;
  margin-bottom: 7px;
  font-size: 28px;
  font-weight: 720;
  letter-spacing: -0.045em;
}

.summary-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.section-heading .overline {
  margin-bottom: 9px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(34px, 4.5vw, 48px);
  font-weight: 720;
  letter-spacing: -0.052em;
}

.updated-at {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.feed {
  display: grid;
  gap: 18px;
}

.day-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.day-heading {
  padding: 25px 28px 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.day-heading h3 {
  margin-bottom: 3px;
  font-size: 19px;
  font-weight: 730;
  letter-spacing: -0.03em;
}

.day-date {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
}

.event-count {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--canvas);
  font-size: 10px;
  font-weight: 720;
}

.event-list {
  margin: 0;
  padding: 8px 17px;
  list-style: none;
}

.event-row {
  min-height: 92px;
  padding: 21px 12px;
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) 105px;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.event-row:last-child {
  border-bottom: 0;
}

.event-row--latest {
  margin: 4px 0;
  border: 0;
  border-radius: 17px;
  background: #faf5eb;
}

.event-marker {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--forest);
  background: var(--forest-light);
}

.event-marker svg {
  width: 21px;
  height: 21px;
}

.event-row--meal .event-marker {
  color: #9c4435;
  background: var(--coral-light);
}

.event-row--sleep .event-marker {
  color: var(--lavender);
  background: var(--lavender-light);
}

.event-row--diaper .event-marker {
  color: var(--blue);
  background: var(--blue-light);
}

.event-label-row {
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-category {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.most-recent-label {
  padding: 3px 6px;
  border-radius: 999px;
  color: #7d6541;
  background: var(--sand);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.event-copy h4 {
  margin-bottom: 4px;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.event-meta {
  margin-bottom: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-time-wrap {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.event-time {
  color: var(--ink-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

.event-relative {
  color: #9a9e9b;
  font-size: 10px;
}

.feed-actions {
  padding-top: 24px;
  text-align: center;
}

.older-button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12px;
  font-weight: 720;
  box-shadow: 0 2px 7px rgba(28, 33, 30, 0.035);
}

.older-button:hover {
  border-color: #b9bdb7;
}

.older-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.site-footer {
  width: min(1080px, calc(100% - 56px));
  margin: 0 auto;
  padding: 28px 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-weight: 700;
}

.login-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 30px;
  display: grid;
  place-items: center;
}

.login-shell::before,
.login-shell::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
}

.login-shell::before {
  width: 520px;
  height: 520px;
  top: -300px;
  right: -140px;
  background: rgba(223, 97, 77, 0.1);
}

.login-shell::after {
  width: 440px;
  height: 440px;
  left: -270px;
  bottom: -240px;
  background: rgba(36, 70, 59, 0.1);
}

.login-card {
  width: min(100%, 500px);
  padding: clamp(34px, 7vw, 58px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 32px 90px rgba(31, 43, 37, 0.13);
  backdrop-filter: blur(16px);
}

.login-card .brand-mark {
  margin-bottom: 38px;
}

.login-card .overline {
  margin-bottom: 12px;
}

.login-card h1 {
  margin-bottom: 19px;
  font-size: clamp(37px, 8vw, 50px);
  font-weight: 720;
  letter-spacing: -0.06em;
  line-height: 0.99;
}

.login-intro {
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  height: 54px;
  margin-bottom: 12px;
  padding: 0 46px 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface);
  font-size: 16px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.password-field input:hover {
  border-color: #b6bbb5;
}

.password-field input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(36, 70, 59, 0.08);
}

.password-field span {
  position: absolute;
  top: 16px;
  right: 17px;
  color: var(--muted);
}

.login-form button {
  width: 100%;
  min-height: 53px;
  padding: 13px 17px;
  border: 0;
  border-radius: 13px;
  color: white;
  background: var(--forest);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  box-shadow: 0 10px 25px rgba(36, 70, 59, 0.18);
  transition: transform 150ms ease, background 150ms ease;
}

.login-form button:hover {
  background: #1d3b31;
  transform: translateY(-1px);
}

.privacy-note {
  margin: 25px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 10px;
}

.form-error,
.error-card {
  padding: 13px 15px;
  border: 1px solid #ecc1b8;
  border-radius: 12px;
  color: #873e31;
  background: #fff0ec;
  font-size: 12px;
}

.form-error {
  margin-bottom: 18px;
}

.error-card {
  padding: 26px;
}

.error-card p {
  margin: 8px 0 18px;
}

.empty-message {
  padding: 28px;
  color: var(--muted);
}

.skeleton-card,
.loading-line {
  background: linear-gradient(100deg, #eeeFEB 30%, #fafaf8 50%, #eeeFEB 70%);
  background-size: 240% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to { background-position-x: -240%; }
}

.loading-day {
  padding: 34px 28px;
}

.loading-line {
  height: 14px;
  margin: 0 0 18px;
  border-radius: 8px;
}

.loading-line--short {
  width: 34%;
}

@media (max-width: 820px) {
  .site-header,
  .dashboard,
  .site-footer {
    width: min(100% - 34px, 1080px);
  }

  .dashboard {
    margin-top: 48px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .hero-copy-wrap {
    padding-bottom: 0;
  }

  .hero h1 {
    max-width: 650px;
  }

  .latest-card {
    min-height: 365px;
  }

  .summary-grid {
    margin-bottom: 72px;
  }
}

@media (max-width: 620px) {
  .site-header {
    min-height: 76px;
  }

  .privacy-pill {
    display: none;
  }

  .dashboard {
    margin-top: 36px;
    margin-bottom: 80px;
  }

  .hero h1 {
    font-size: clamp(46px, 14vw, 62px);
  }

  .hero-copy {
    margin-bottom: 24px;
  }

  .latest-card {
    min-height: 350px;
    padding: 24px;
  }

  .latest-icon {
    margin-top: 37px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .summary-card {
    min-height: 0;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .summary-top {
    margin: 0;
    grid-column: 1;
  }

  .summary-value {
    margin: 0;
    grid-column: 2;
    grid-row: 1 / span 2;
    font-size: 25px;
  }

  .summary-note {
    margin: 9px 0 0 45px;
    grid-column: 1;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .day-heading {
    padding: 21px 18px 18px;
  }

  .event-list {
    padding: 6px 10px;
  }

  .event-row {
    min-height: 89px;
    padding: 18px 9px;
    grid-template-columns: 40px minmax(0, 1fr) 72px;
    gap: 11px;
  }

  .event-marker {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .event-marker svg {
    width: 19px;
    height: 19px;
  }

  .event-copy h4 {
    font-size: 14px;
  }

  .event-meta {
    max-width: 165px;
  }

  .event-relative {
    display: none;
  }

  .event-time {
    font-size: 11px;
  }

  .most-recent-label {
    display: none;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }

  .login-shell {
    padding: 18px;
  }

  .login-card {
    border-radius: 25px;
  }
}

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