:root {
  --paper: #f5f1e8;
  --paper-strong: #fbf9f4;
  --ink: #17342f;
  --muted: #6b7a73;
  --line: rgba(23, 52, 47, 0.12);
  --green: #2f6b58;
  --green-soft: #dce9df;
  --mint: #b9d7c3;
  --coral: #e47e65;
  --coral-soft: #f6ded6;
  --sun: #f1bd59;
  --sun-soft: #f9ebc9;
  --blue: #50738b;
  --blue-soft: #dbe6ec;
  --white: #fffefa;
  --danger: #b74f48;
  --shadow-sm: 0 8px 24px rgba(31, 61, 53, 0.07);
  --shadow-lg: 0 28px 80px rgba(31, 61, 53, 0.16);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 30px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% -10%, rgba(255, 255, 255, 0.9), transparent 32rem),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(228, 126, 101, 0.3);
  outline-offset: 2px;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(2px);
  opacity: 0.32;
}

.ambient-one {
  top: -16rem;
  right: 5vw;
  background: rgba(185, 215, 195, 0.7);
}

.ambient-two {
  bottom: -20rem;
  left: 8vw;
  background: rgba(241, 189, 89, 0.42);
}

.app-frame {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 220px minmax(0, 940px);
  gap: 28px;
  width: min(1200px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
}

.desktop-rail {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 48px);
  min-height: 600px;
  padding: 18px 14px;
}

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

.brand-button {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 15px;
  color: var(--white);
  background: var(--green);
  box-shadow: 0 8px 20px rgba(47, 107, 88, 0.22);
}

.brand-mark svg {
  width: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 19px;
  letter-spacing: 0.1em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.rail-nav {
  display: grid;
  gap: 8px;
  margin-top: 54px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  border: 0;
  border-radius: 15px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.45);
}

.nav-item.active {
  color: var(--green);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
}

.nav-item svg,
.icon-button svg,
.button svg,
.inline-icon svg,
.metric-icon svg,
.empty-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item b {
  font-size: 14px;
  font-weight: 650;
}

.rail-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: auto;
  padding: 14px 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.rail-note p {
  margin: 0;
}

.privacy-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 4px;
  border: 2px solid var(--white);
  border-radius: 999px;
  background: #4ea879;
  box-shadow: 0 0 0 2px rgba(78, 168, 121, 0.18);
}

.app-shell {
  position: relative;
  min-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 36px;
  background: rgba(251, 249, 244, 0.84);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 249, 244, 0.89);
  backdrop-filter: blur(18px);
}

.mobile-brand {
  display: none;
}

.persona-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
}

.persona-switch button {
  min-width: 66px;
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  transition: 160ms ease;
}

.persona-switch button.active {
  color: var(--white);
  background: var(--green);
  box-shadow: 0 5px 14px rgba(47, 107, 88, 0.2);
}

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--white);
  cursor: pointer;
}

.timer-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--coral);
  box-shadow: 0 0 0 3px var(--white);
}

.main-content {
  min-height: calc(100vh - 128px);
  padding: 34px 34px 56px;
}

.page-enter {
  animation: page-in 260ms ease both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.view-heading h1,
.view-heading h2,
.hero h1 {
  margin: 0;
  font-family: ui-serif, "Songti SC", "STSong", serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.view-heading h1 {
  margin-top: 7px;
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.15;
}

.view-heading p {
  max-width: 520px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.eyebrow {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.date-badge,
.soft-badge,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.date-badge {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.7);
  font-size: 12px;
}

.date-badge svg,
.soft-badge svg {
  width: 15px;
  height: 15px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  overflow: hidden;
  padding: 33px;
  border-radius: var(--radius-lg);
  color: var(--white);
  background: var(--green);
  box-shadow: 0 20px 40px rgba(47, 107, 88, 0.2);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero::before {
  top: -95px;
  right: -45px;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 0 0 30px rgba(255,255,255,.035), 0 0 0 70px rgba(255,255,255,.025);
}

.hero::after {
  bottom: -64px;
  left: 42%;
  width: 150px;
  height: 150px;
  background: rgba(185, 215, 195, 0.12);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero .eyebrow {
  color: #d7eadc;
}

.hero h1 {
  max-width: 560px;
  margin-top: 10px;
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.15;
}

.hero p {
  max-width: 520px;
  margin: 13px 0 0;
  color: rgba(255,255,255,.78);
  font-size: 14px;
  line-height: 1.7;
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 23px;
}

.hero-status {
  display: grid;
  place-items: center;
  align-self: center;
  width: 138px;
  height: 138px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  box-shadow: inset 0 0 0 10px rgba(255,255,255,.035);
  text-align: center;
}

.hero-status strong,
.hero-status span {
  display: block;
}

.hero-status strong {
  font-size: 32px;
  letter-spacing: -0.04em;
}

.hero-status span {
  margin-top: 3px;
  color: rgba(255,255,255,.68);
  font-size: 11px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  color: var(--white);
  background: var(--green);
  box-shadow: 0 8px 18px rgba(47,107,88,.16);
}

.hero .button-primary {
  color: var(--green);
  background: var(--white);
}

.button-secondary {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255,255,255,.75);
}

.hero .button-secondary {
  border-color: rgba(255,255,255,.25);
  color: var(--white);
  background: rgba(255,255,255,.09);
}

.button-ghost {
  color: var(--green);
  background: transparent;
}

.button-danger {
  color: var(--danger);
  background: rgba(183,79,72,.08);
}

.button-small {
  min-height: 35px;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 12px;
}

.button-block {
  width: 100%;
}

.section {
  margin-top: 28px;
}

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

.section-header h2,
.section-header h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.section-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.text-button {
  padding: 5px;
  border: 0;
  color: var(--green);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

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

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.68);
  box-shadow: var(--shadow-sm);
}

.person-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
}

.person-card::after {
  content: "";
  position: absolute;
  top: -35px;
  right: -32px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--person-soft);
  opacity: .7;
}

.person-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 16px;
  color: var(--person-color);
  background: var(--person-soft);
  font-family: ui-serif, "Songti SC", serif;
  font-size: 19px;
  font-weight: 800;
}

.person-head h3 {
  margin: 0;
  font-size: 17px;
}

.person-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.progress-line {
  height: 6px;
  overflow: hidden;
  margin: 21px 0 9px;
  border-radius: 99px;
  background: rgba(23,52,47,.08);
}

.progress-line > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--person-color);
  transition: width 320ms ease;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.person-card .button-row {
  margin-top: 18px;
}

.tip-card,
.quote-card,
.insight-card,
.setup-card {
  padding: 21px 22px;
}

.tip-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  background: var(--sun-soft);
  border-color: rgba(185,133,41,.12);
  box-shadow: none;
}

.tip-card .metric-icon {
  color: #9f6f1e;
  background: rgba(255,255,255,.55);
}

.tip-card h3,
.insight-card h3,
.setup-card h3,
.quote-card h3 {
  margin: 0;
  font-size: 15px;
}

.tip-card p,
.insight-card p,
.setup-card p,
.quote-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 13px;
  color: var(--green);
  background: var(--green-soft);
}

.child-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--person-soft), rgba(255,255,255,.78));
  box-shadow: var(--shadow-sm);
}

.child-hero h1 {
  margin: 7px 0 0;
  font-family: ui-serif, "Songti SC", serif;
  font-size: clamp(26px, 4vw, 36px);
}

.child-hero p {
  max-width: 540px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.child-hero .avatar {
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background: rgba(255,255,255,.66);
  font-size: 27px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.mini-stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.65);
}

.mini-stat strong,
.mini-stat span {
  display: block;
}

.mini-stat strong {
  font-size: 19px;
}

.mini-stat span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

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

.task-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 7px 20px rgba(31,61,53,.045);
}

.task-check {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  margin-top: 1px;
  border: 1.5px solid rgba(23,52,47,.22);
  border-radius: 10px;
  color: transparent;
  background: transparent;
  cursor: pointer;
}

.task-check svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
}

.task-card.done .task-check {
  border-color: var(--green);
  color: var(--white);
  background: var(--green);
}

.task-card.done .task-title {
  color: var(--muted);
  text-decoration: line-through;
}

.task-title {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.45;
}

.task-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 13px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.task-sub span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-sub svg {
  width: 13px;
  height: 13px;
}

.task-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tool-chip {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--green);
  background: rgba(220,233,223,.42);
  cursor: pointer;
  font-size: 10px;
  font-weight: 750;
}

.task-menu {
  display: flex;
  gap: 7px;
}

.task-menu .icon-button {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.task-menu .icon-button svg {
  width: 17px;
  height: 17px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 225px;
  padding: 30px;
  border: 1px dashed rgba(23,52,47,.18);
  border-radius: 22px;
  background: rgba(255,255,255,.36);
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  color: var(--green);
  background: var(--green-soft);
}

.empty-state h3 {
  margin: 14px 0 0;
  font-size: 16px;
}

.empty-state p {
  max-width: 330px;
  margin: 7px 0 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.soft-badge {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 750;
}

.soft-badge.coral {
  color: #a34d3e;
  background: var(--coral-soft);
}

.soft-badge.blue {
  color: var(--blue);
  background: var(--blue-soft);
}

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

.review-card {
  padding: 23px;
}

.review-card .status-orb {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 15px;
  color: var(--green);
  background: var(--green-soft);
}

.review-card.complete .status-orb {
  color: var(--white);
  background: var(--green);
}

.review-card h3 {
  margin: 14px 0 0;
  font-size: 17px;
}

.review-card p {
  min-height: 40px;
  margin: 7px 0 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.reflection-card {
  padding: 24px;
}

.reflection-answer {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.reflection-answer:last-child {
  border-bottom: 0;
}

.reflection-answer span {
  color: var(--muted);
  font-size: 11px;
}

.reflection-answer p {
  margin: 5px 0 0;
  font-size: 14px;
  line-height: 1.6;
}

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

.metric-card {
  padding: 18px;
}

.metric-card .metric-icon {
  width: 35px;
  height: 35px;
}

.metric-card strong {
  display: block;
  margin-top: 18px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.metric-card > span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.chart-card {
  padding: 23px;
}

.week-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  height: 180px;
  margin-top: 22px;
}

.day-column {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 9px;
  height: 100%;
  text-align: center;
}

.day-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 4px;
  height: 100%;
  padding-top: 12px;
  border-bottom: 1px solid var(--line);
}

.day-bars i {
  display: block;
  width: 10px;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  transition: height 320ms ease;
}

.day-bars .elder-bar { background: var(--blue); }
.day-bars .younger-bar { background: var(--coral); }

.day-column span {
  color: var(--muted);
  font-size: 10px;
}

.chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 99px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 16px;
}

.settings-card {
  padding: 24px;
}

.settings-card h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.settings-card > p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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

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

.field.full {
  grid-column: 1 / -1;
}

.field label,
.field-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255,255,255,.82);
}

.field textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.55;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a3aaa6;
}

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

.choice-card {
  position: relative;
}

.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card span {
  display: block;
  min-height: 74px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  cursor: pointer;
  transition: 150ms ease;
}

.choice-card span strong,
.choice-card span small {
  display: block;
}

.choice-card span strong {
  font-size: 13px;
}

.choice-card span small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.choice-card input:checked + span {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px var(--green);
}

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

.range-row label input {
  position: absolute;
  opacity: 0;
}

.range-row label span {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255,255,255,.7);
  cursor: pointer;
  font-size: 12px;
}

.range-row label input:checked + span {
  border-color: var(--green);
  color: var(--white);
  background: var(--green);
}

.data-actions {
  display: grid;
  gap: 10px;
}

.privacy-panel {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  color: var(--muted);
  background: var(--green-soft);
  font-size: 11px;
  line-height: 1.55;
}

.privacy-panel svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  color: var(--green);
}

.bottom-nav {
  display: none;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17,38,34,.48);
  backdrop-filter: blur(8px);
  animation: fade-in 180ms ease both;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(520px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 28px;
  background: var(--paper-strong);
  box-shadow: 0 30px 90px rgba(12,37,31,.28);
  animation: modal-in 220ms ease both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-wide {
  width: min(680px, 100%);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 14px;
  background: rgba(251,249,244,.94);
  backdrop-filter: blur(10px);
}

.modal-head h2 {
  margin: 0;
  font-family: ui-serif, "Songti SC", serif;
  font-size: 23px;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.modal-body {
  padding: 12px 24px 25px;
}

.modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px calc(18px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(251,249,244,.94);
  backdrop-filter: blur(10px);
}

.close-button {
  border: 0;
  background: transparent;
}

.timer-modal {
  width: min(430px, 100%);
  overflow: hidden;
  text-align: center;
}

.timer-stage {
  padding: 34px 30px 25px;
  color: var(--white);
  background: var(--green);
}

.timer-stage .eyebrow {
  color: rgba(255,255,255,.65);
}

.timer-title {
  margin: 10px 0 0;
  font-size: 17px;
}

.timer-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 212px;
  height: 212px;
  margin: 28px auto 20px;
  border-radius: 50%;
  background: conic-gradient(var(--sun) var(--timer-progress), rgba(255,255,255,.12) 0);
}

.timer-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: var(--green);
}

.timer-time {
  position: relative;
  z-index: 1;
  font-variant-numeric: tabular-nums;
  font-size: 43px;
  font-weight: 780;
  letter-spacing: -0.05em;
}

.timer-stage > p {
  margin: 0;
  color: rgba(255,255,255,.7);
  font-size: 12px;
}

.timer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 19px 22px calc(22px + var(--safe-bottom));
}

.checklist {
  display: grid;
  gap: 9px;
}

.check-row {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.72);
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.check-row span {
  font-size: 12px;
  line-height: 1.5;
}

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 28px;
  max-width: min(420px, calc(100% - 32px));
  padding: 11px 16px;
  border-radius: 999px;
  color: var(--white);
  background: rgba(23,52,47,.94);
  box-shadow: 0 12px 35px rgba(23,52,47,.22);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: 180ms ease;
  font-size: 12px;
  text-align: center;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hidden {
  display: none !important;
}

.muted { color: var(--muted); }
.danger-text { color: var(--danger); }
.mt-0 { margin-top: 0 !important; }
.mt-16 { margin-top: 16px !important; }

@media (max-width: 980px) {
  .app-frame {
    display: block;
    width: min(760px, calc(100% - 28px));
    padding: 14px 0;
  }

  .desktop-rail { display: none; }
  .mobile-brand { display: flex; }
  .app-shell { min-height: calc(100vh - 28px); }
}

@media (max-width: 700px) {
  body { background: var(--paper-strong); }

  .ambient { display: none; }

  .app-frame {
    width: 100%;
    padding: 0;
  }

  .app-shell {
    min-height: 100vh;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--paper-strong);
  }

  .topbar {
    min-height: 66px;
    padding: 10px 15px;
  }

  .mobile-brand .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .mobile-brand .brand-mark svg { width: 26px; }
  .mobile-brand strong { font-size: 16px; }
  .mobile-brand small { display: none; }

  .persona-switch {
    position: absolute;
    top: calc(100% + 12px);
    left: 16px;
    z-index: 5;
    box-shadow: 0 8px 25px rgba(31,61,53,.09);
  }

  .persona-switch button {
    min-width: 61px;
    padding: 7px 11px;
    font-size: 11px;
  }

  .main-content {
    min-height: calc(100vh - 138px);
    padding: 71px 16px calc(98px + var(--safe-bottom));
  }

  .view-heading {
    display: block;
    margin-bottom: 20px;
  }

  .view-heading .date-badge {
    margin-top: 13px;
  }

  .hero {
    display: block;
    padding: 26px 22px;
    border-radius: 25px;
  }

  .hero h1 { font-size: 30px; }
  .hero-status { display: none; }

  .card-grid,
  .review-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .child-hero {
    padding: 21px;
    border-radius: 24px;
  }

  .child-hero .avatar {
    width: 58px;
    height: 58px;
    border-radius: 19px;
    font-size: 22px;
  }

  .stat-row { gap: 7px; }
  .mini-stat { padding: 12px 10px; }
  .mini-stat strong { font-size: 17px; }

  .task-card {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 16px;
  }

  .task-menu {
    grid-column: 2;
    justify-content: flex-start;
  }

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

  .week-chart { gap: 5px; }
  .day-bars { gap: 2px; }
  .day-bars i { width: 8px; }

  .form-grid,
  .choice-grid { grid-template-columns: 1fr; }

  .bottom-nav {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px 12px calc(8px + var(--safe-bottom));
    border-top: 1px solid var(--line);
    background: rgba(251,249,244,.93);
    backdrop-filter: blur(18px);
  }

  .bottom-nav .nav-item {
    display: grid;
    place-items: center;
    gap: 3px;
    padding: 5px;
    border-radius: 12px;
  }

  .bottom-nav .nav-item.active {
    box-shadow: none;
    background: transparent;
  }

  .bottom-nav .nav-item svg {
    width: 20px;
    height: 20px;
  }

  .bottom-nav .nav-item b {
    font-size: 9px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 91vh;
    border-radius: 27px 27px 0 0;
  }

  .modal-head { padding: 20px 19px 13px; }
  .modal-body { padding: 10px 19px 22px; }
  .modal-footer { padding: 13px 19px calc(16px + var(--safe-bottom)); }

  .timer-modal { border-radius: 27px 27px 0 0; }
  .timer-stage { padding-top: 27px; }
  .timer-ring { width: 190px; height: 190px; }

  .toast {
    bottom: calc(83px + var(--safe-bottom));
  }
}

@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;
  }
}
