:root {
  --bg: #ddffe2;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-soft: rgba(202, 253, 212, 0.9);
  --surface-muted: rgba(181, 240, 194, 0.9);
  --text: #0b361d;
  --text-muted: #456750;
  --primary: #006b1b;
  --primary-soft: #91f78e;
  --tertiary: #fdc003;
  --danger: #f0623d;
  --danger-deep: #b02500;
  --shadow: 0 20px 40px rgba(11, 54, 29, 0.08);
  --shadow-soft: 0 14px 28px rgba(11, 54, 29, 0.05);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-pill: 999px;
  --max-width: 560px;
  --font-display: "Fraunces", serif;
  --font-body: "Plus Jakarta Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.65), transparent 26%),
    radial-gradient(circle at 85% 18%, rgba(145, 247, 142, 0.5), transparent 24%),
    linear-gradient(180deg, #e6ffeb 0%, #d7fbde 48%, #c9f4d2 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.56), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(145, 247, 142, 0.3), transparent 18%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
}

.app-shell {
  max-width: var(--max-width);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 18px calc(120px + env(safe-area-inset-bottom));
  position: relative;
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: fixed;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.app-shell::before {
  top: -48px;
  right: -64px;
  background: rgba(145, 247, 142, 0.36);
}

.app-shell::after {
  bottom: 68px;
  left: -88px;
  background: rgba(253, 192, 3, 0.14);
}

.topbar,
.page,
.bottom-nav,
.toast-region,
.dialog-root {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px 18px;
  background: rgba(221, 255, 226, 0.72);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(145, 247, 142, 0.28);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 18px;
  background: linear-gradient(135deg, #006b1b 0%, #91f78e 100%);
  color: #d1ffc8;
  font-size: 22px;
  box-shadow: var(--shadow-soft);
}

.brand-kicker {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow-soft);
}

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

.hero {
  padding: 4px 4px 8px;
}

.entry-page {
  min-height: calc(100vh - 48px);
  display: grid;
  place-items: center;
}

.entry-card {
  width: 100%;
  max-width: 520px;
  padding: 32px 26px;
  border-radius: 34px;
  background:
    radial-gradient(circle at top right, rgba(145, 247, 142, 0.2), transparent 34%),
    rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.entry-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3rem);
  line-height: 0.98;
}

.entry-copy,
.entry-note,
.entry-error {
  line-height: 1.7;
}

.entry-copy {
  margin: 16px 0 0;
  color: var(--text);
}

.entry-note {
  margin: 16px 0 0;
  color: var(--text-muted);
}

.entry-error {
  margin: 16px 0 0;
  color: var(--danger-deep);
  font-weight: 700;
}

.entry-actions {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 0.98;
}

.hero p {
  margin: 12px 0 0;
  max-width: 40ch;
  color: var(--text-muted);
  line-height: 1.6;
}

.panel {
  padding: 22px;
  background: var(--surface);
  backdrop-filter: blur(18px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.panel--soft {
  background: rgba(202, 253, 212, 0.72);
}

.panel-title,
.section-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-copy {
  margin: 4px 0 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.stack {
  display: grid;
  gap: 14px;
}

.child-card {
  overflow: hidden;
  display: grid;
  gap: 18px;
  padding: 20px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(145, 247, 142, 0.22), transparent 36%),
    rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.child-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.child-card__identity,
.child-row__identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.child-card__name {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 800;
}

.child-card__avatar,
.child-row__avatar,
.avatar-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.child-card__avatar,
.avatar-preview {
  border: 3px solid rgba(145, 247, 142, 0.9);
  box-shadow: var(--shadow-soft);
}

.child-row__avatar {
  border: 2px solid rgba(145, 247, 142, 0.75);
}

.child-card__avatar--placeholder,
.child-row__avatar--placeholder,
.avatar-preview--placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(145, 247, 142, 0.45) 0%, rgba(255, 255, 255, 0.82) 100%);
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 800;
}

.muted {
  color: var(--text-muted);
}

.ratio-chip {
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  background: rgba(145, 247, 142, 0.28);
  text-align: right;
}

.ratio-chip strong {
  display: block;
  font-size: 1.15rem;
}

.ratio-chip span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.battery {
  display: grid;
  gap: 10px;
}

.battery__labels {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.82rem;
  font-weight: 700;
}

.battery__track {
  height: 16px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: rgba(181, 240, 194, 0.9);
}

.battery__fill {
  height: 100%;
  border-radius: inherit;
  transition: width 180ms ease, background 180ms ease;
}

.battery__fill--green {
  background: linear-gradient(135deg, #006b1b 0%, #91f78e 100%);
}

.battery__fill--yellow {
  background: linear-gradient(135deg, #fdc003 0%, #ffe8a2 100%);
}

.battery__fill--red {
  background: linear-gradient(135deg, #b02500 0%, #f0623d 100%);
}

.battery__fill--empty {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%);
}

.counter-grid,
.stats-grid,
.summary-grid,
.actions-row {
  display: grid;
  gap: 12px;
}

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

.counter-button {
  display: grid;
  gap: 8px;
  align-content: center;
  justify-items: start;
  min-height: 104px;
  padding: 18px;
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.counter-button:active,
.nav-item:active,
.pill-button:active,
.action-button:active,
.icon-button:active {
  transform: scale(0.98);
}

.counter-button--positive {
  background: linear-gradient(135deg, #006b1b 0%, #54b44d 100%);
  color: #f3ffee;
}

.counter-button--negative {
  background: rgba(181, 240, 194, 0.88);
}

.counter-button__symbol {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.6rem;
  font-weight: 700;
}

.counter-button--negative .counter-button__symbol {
  background: rgba(255, 255, 255, 0.48);
}

.counter-button__label {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.counter-button__count {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
}

.stats-grid,
.summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-pill,
.summary-card {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
}

.stat-pill__label,
.summary-card__label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat-pill__value,
.summary-card__value {
  font-size: 1.36rem;
  font-weight: 800;
}

.empty-state {
  display: grid;
  gap: 16px;
  padding: 26px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-soft);
  text-align: left;
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-state p {
  color: var(--text-muted);
  line-height: 1.6;
}

.action-button,
.pill-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px;
  border-radius: var(--radius-pill);
  font-weight: 700;
}

.action-button--primary,
.pill-button--active {
  color: #efffea;
  background: linear-gradient(135deg, #006b1b 0%, #54b44d 100%);
}

.action-button--secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.pill-row {
  display: flex;
  gap: 10px;
  padding: 6px;
  border-radius: var(--radius-pill);
  background: rgba(202, 253, 212, 0.9);
}

.pill-button {
  flex: 1;
  background: transparent;
  color: var(--text-muted);
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.photo-field,
.photo-field__preview-wrap {
  display: grid;
  gap: 12px;
}

.photo-field__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.photo-upload-button {
  cursor: pointer;
}

.avatar-preview {
  width: 92px;
  height: 92px;
  overflow: hidden;
}

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

.field label {
  margin-left: 4px;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: inset 0 0 0 2px transparent;
  outline: 0;
}

.field input:focus,
.field select:focus {
  box-shadow: inset 0 0 0 2px rgba(0, 107, 27, 0.22);
}

.field-error {
  min-height: 1.1rem;
  color: var(--danger-deep);
  font-size: 0.82rem;
  font-weight: 600;
}

.children-list {
  display: grid;
  gap: 12px;
}

.child-row {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.76);
}

.child-row__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.child-row__name {
  margin: 0 0 4px;
  font-size: 1.12rem;
  font-weight: 800;
}

.child-row__actions {
  display: flex;
  gap: 10px;
}

.mini-button {
  min-width: 86px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(202, 253, 212, 0.8);
  font-size: 0.92rem;
  font-weight: 700;
}

.mini-button--danger {
  color: var(--danger-deep);
  background: rgba(240, 140, 116, 0.22);
}

.chart-panel {
  padding: 20px 18px 16px;
}

.chart-wrap {
  position: relative;
  min-height: 240px;
  margin-top: 14px;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  padding: 20px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 24px), calc(var(--max-width) - 12px));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  background: rgba(221, 255, 226, 0.78);
  backdrop-filter: blur(18px);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.nav-item {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 62px;
  border-radius: 22px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.nav-item--active {
  background: linear-gradient(135deg, #b9f474 0%, #d8ffad 100%);
  color: var(--text);
}

.nav-item__icon {
  font-size: 1.2rem;
}

.toast-region {
  position: fixed;
  left: 50%;
  bottom: calc(112px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 480px);
  display: grid;
  gap: 10px;
}

.toast {
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(11, 54, 29, 0.92);
  color: #efffea;
  box-shadow: var(--shadow);
}

.dialog-root:empty {
  display: none;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
  background: rgba(11, 54, 29, 0.16);
}

.dialog {
  width: min(100%, 520px);
  padding: 24px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.dialog h3,
.dialog p {
  margin: 0;
}

.dialog p {
  margin-top: 10px;
  color: var(--text-muted);
  line-height: 1.6;
}

.dialog .actions-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

@media (max-width: 420px) {
  .app-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .panel,
  .child-card {
    padding: 18px;
  }

  .hero h2 {
    font-size: 1.86rem;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }
}
