:root {
  --bg: #f5ecdf;
  --panel: rgba(255, 250, 244, 0.92);
  --panel-strong: #fffaf4;
  --ink: #2c2a27;
  --muted: #7c6b5f;
  --line: rgba(105, 82, 63, 0.14);
  --sea: #2f524f;
  --sea-2: #6f8f89;
  --accent: #8f6246;
  --accent-soft: #efe0cf;
  --warning-soft: #fff1df;
  --shadow: 0 20px 40px rgba(91, 70, 49, 0.08), 0 4px 14px rgba(91, 70, 49, 0.06);
  --shadow-soft: 0 14px 32px rgba(120, 93, 69, 0.07);
  --radius: 28px;
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Georgia", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.88), transparent 24%),
    radial-gradient(circle at 100% 12%, rgba(212, 186, 157, 0.32), transparent 22%),
    linear-gradient(180deg, #fff8ef 0%, var(--bg) 55%, #efe2d2 100%);
  color: var(--ink);
  font-family: var(--sans);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.18) 0, transparent 18%),
    radial-gradient(circle at 84% 72%, rgba(159, 123, 94, 0.08) 0, transparent 20%);
  opacity: 0.9;
}

body {
  display: flex;
  justify-content: center;
}

.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  padding: 16px 16px calc(104px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 6px 16px;
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, rgba(250, 242, 231, 0.94), rgba(250, 242, 231, 0.72));
}

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

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

.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(126, 98, 72, 0.16);
  background: rgba(255, 250, 245, 0.9);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 1.2rem;
  line-height: 1.18;
}

h2 {
  font-size: 1.45rem;
  line-height: 1.15;
}

h3 {
  font-size: 1.08rem;
  line-height: 1.2;
}

.eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.eyebrow.light,
.muted.light {
  color: rgba(53, 44, 37, 0.76);
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.tiny-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.screen {
  display: grid;
  gap: 16px;
}

.card,
.hero-card {
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.94), rgba(255, 248, 240, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 248px;
  color: var(--ink);
}

.hero-media {
  padding: 0;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 22px 20px;
  background:
    linear-gradient(180deg, rgba(255, 249, 241, 0.06), rgba(255, 245, 232, 0.78) 56%, rgba(255, 248, 242, 0.96));
}

.hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hero-topline .eyebrow {
  margin-bottom: 0;
}

.overlay-pill {
  backdrop-filter: blur(12px);
  background: rgba(255, 248, 241, 0.82);
}

.hero-stack {
  margin-top: 12px;
}

.hero-stack .seed-item {
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.88), rgba(252, 244, 235, 0.84));
  border-color: rgba(108, 82, 60, 0.16);
  backdrop-filter: blur(16px);
}

.hero-stack .seed-item.is-highlighted {
  background: linear-gradient(180deg, rgba(255, 243, 227, 0.92), rgba(250, 234, 214, 0.88));
}

.hero-stack .seed-item .muted {
  color: rgba(63, 49, 39, 0.86);
}

.pulse-hero {
  min-height: 224px;
}

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

.status-pill,
.meta-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-pill {
  background: linear-gradient(180deg, #f4e8d9, #ecdbc7);
  color: #7a5942;
  border: 1px solid rgba(131, 96, 69, 0.14);
}

.status-pill.tone-neutral {
  background: linear-gradient(180deg, #f4e8d9, #ecdbc7);
  color: #7a5942;
  border-color: rgba(131, 96, 69, 0.14);
}

.status-pill.tone-success {
  background: linear-gradient(180deg, #e8f3ee, #dceddf);
  color: #2f5c50;
  border-color: rgba(47, 92, 80, 0.18);
}

.status-pill.tone-watch {
  background: linear-gradient(180deg, #e8f6f3, #d9efec);
  color: #2d6962;
  border-color: rgba(45, 105, 98, 0.18);
}

.status-pill.tone-warning {
  background: linear-gradient(180deg, #fff1dc, #f8e1bf);
  color: #8a5a1e;
  border-color: rgba(151, 93, 31, 0.2);
}

.status-pill.tone-critical {
  background: linear-gradient(180deg, #ffe5db, #f8cdc2);
  color: #9a4d3b;
  border-color: rgba(154, 77, 59, 0.22);
}

.status-pill.tone-science {
  background: linear-gradient(180deg, #e4f1f7, #d7eaf2);
  color: #3b6273;
  border-color: rgba(59, 98, 115, 0.18);
}

.status-pill.tone-spawning {
  background: linear-gradient(180deg, #fff0e4, #f6dcc4);
  color: #8c5d3a;
  border-color: rgba(140, 93, 58, 0.2);
}

.meta-label {
  background: linear-gradient(180deg, #fff8ef, #f3e6d6);
  color: #7a6450;
  border: 1px solid rgba(131, 96, 69, 0.1);
}

.clean-list {
  margin: 0;
  padding-left: 18px;
}

.clean-list li {
  margin-bottom: 8px;
  line-height: 1.4;
}

.clean-list.compact li {
  margin-bottom: 6px;
}

.two-up,
.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.baby-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 14px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fdf6ee, #f1e3d2);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(131, 96, 69, 0.1);
}

.baby-tracker-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.baby-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 15px;
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(250, 243, 233, 0.94));
  box-shadow: var(--shadow-soft);
}

.baby-panel-image,
.baby-panel-sheet {
  width: 100%;
  border-radius: 16px;
  object-fit: cover;
  display: block;
}

.baby-panel-image {
  aspect-ratio: 4 / 3;
  margin-bottom: 12px;
}

.baby-panel-sheet {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: #f7fbfc;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.photo-strip.large {
  grid-template-columns: repeat(3, 1fr);
}

.photo-strip img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.field span {
  font-size: 0.85rem;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px 14px;
  background: linear-gradient(180deg, #fffdf9, #fbf3e8);
  font: inherit;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.field textarea {
  resize: vertical;
}

.segmented,
.lang-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  background: linear-gradient(180deg, #f7ecde, #efdfca);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 4px;
}

.field .segmented {
  width: 100%;
}

.segmented button,
.ghost-button,
.nav-item,
.lang-btn,
.primary-button {
  appearance: none;
  border: none;
  background: transparent;
  font: inherit;
  color: inherit;
}

.segmented button,
.lang-btn {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-weight: 700;
}

.segmented button.is-selected,
.lang-btn.is-active {
  background: linear-gradient(180deg, #fffaf4, #fff7ef);
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(113, 86, 62, 0.1);
}

.ghost-button,
.primary-button {
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  font-weight: 600;
}

.ghost-button {
  background: linear-gradient(180deg, #fdf7ef, #f4e7d6);
}

.primary-button {
  background: linear-gradient(180deg, #365f59, #294844);
  color: #fff8ef;
  box-shadow: 0 10px 24px rgba(47, 82, 79, 0.2);
}

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

.hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.voice-card {
  background: linear-gradient(180deg, #fffaf5, #fff5eb);
}

.install-card {
  background: linear-gradient(180deg, #fdf7ee, #fffaf4);
}

.signal-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.signal-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px;
  background: linear-gradient(180deg, #fffaf4, #f7ede1);
  box-shadow: var(--shadow-soft);
}

.signal-panel h3 {
  margin-bottom: 10px;
}

.insight-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px;
  background: linear-gradient(180deg, #fffaf4, #f6ecdf);
  box-shadow: var(--shadow-soft);
}

.insight-card.is-highlighted,
.seed-item.is-highlighted,
.question-card.is-highlighted {
  border-color: rgba(161, 103, 67, 0.34);
  background: linear-gradient(180deg, #fff7ea, #f7e6d5);
  box-shadow: 0 16px 30px rgba(161, 103, 67, 0.1);
}

.seed-item.tone-neutral,
.insight-card.tone-neutral {
  background: linear-gradient(180deg, #fffaf4, #f7ede1);
  border-color: var(--line);
}

.seed-item.tone-success,
.insight-card.tone-success {
  background: linear-gradient(180deg, #f2faf6, #e7f4ec);
  border-color: rgba(61, 115, 90, 0.18);
  box-shadow: 0 14px 28px rgba(61, 115, 90, 0.08);
}

.seed-item.tone-watch,
.insight-card.tone-watch {
  background: linear-gradient(180deg, #eef9f7, #e1f1ee);
  border-color: rgba(45, 105, 98, 0.18);
  box-shadow: 0 14px 28px rgba(45, 105, 98, 0.08);
}

.seed-item.tone-warning,
.insight-card.tone-warning {
  background: linear-gradient(180deg, #fff8ea, #f7ead0);
  border-color: rgba(160, 115, 40, 0.2);
  box-shadow: 0 14px 28px rgba(160, 115, 40, 0.08);
}

.seed-item.tone-critical,
.insight-card.tone-critical {
  background: linear-gradient(180deg, #fff2eb, #f7ddd3);
  border-color: rgba(154, 77, 59, 0.22);
  box-shadow: 0 14px 28px rgba(154, 77, 59, 0.1);
}

.seed-item.tone-science,
.insight-card.tone-science {
  background: linear-gradient(180deg, #eef6fb, #e2edf5);
  border-color: rgba(59, 98, 115, 0.18);
  box-shadow: 0 14px 28px rgba(59, 98, 115, 0.08);
}

.seed-item.tone-spawning,
.insight-card.tone-spawning {
  background: linear-gradient(180deg, #fff7ee, #f5e5d6);
  border-color: rgba(140, 93, 58, 0.2);
  box-shadow: 0 14px 28px rgba(140, 93, 58, 0.08);
}

.insight-detail {
  margin-top: 8px;
  line-height: 1.45;
  color: var(--muted);
}

.insight-detail strong {
  color: var(--ink);
}

.env-panel {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(80, 115, 111, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.72), transparent 42%),
    linear-gradient(180deg, rgba(241, 249, 246, 0.9), rgba(250, 242, 231, 0.92));
}

.voice-actions,
.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 12px;
}

.inline-link-btn {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(161, 103, 67, 0.2);
  background: rgba(255, 249, 241, 0.92);
  color: #6b4f39;
  font-size: 0.82rem;
}

.inline-link-btn:hover {
  background: rgba(255, 243, 231, 0.98);
}

.infographic-grid,
.timeline-grid {
  display: grid;
  gap: 12px;
}

.infographic-card,
.timeline-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 14px;
  background: linear-gradient(180deg, #fffbf7, #f7ede1);
  box-shadow: var(--shadow-soft);
}

.infographic-image,
.timeline-image {
  width: 100%;
  display: block;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 12px;
}

.infographic-image {
  aspect-ratio: 16 / 10;
}

.timeline-image {
  aspect-ratio: 4 / 3;
}

.infographic-step-title {
  margin: 0 0 6px;
  font-size: 0.96rem;
  line-height: 1.3;
}

.media-preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.media-preview-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  background: linear-gradient(180deg, #fffaf5, #f7ecdf);
}

.media-preview-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  background: #e8f3f5;
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  padding: 8px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff8ef, #f1e3d3);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  color: #5f4c3d;
}

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

.compact-stack {
  gap: 8px;
}

.experiment-card {
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(247, 237, 226, 0.92));
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.experiment-image,
.story-image,
.question-image {
  width: 100%;
  display: block;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 12px;
}

.experiment-image {
  aspect-ratio: 16 / 10;
}

.story-image {
  aspect-ratio: 16 / 9;
}

.question-image {
  aspect-ratio: 16 / 10;
}

.story-card {
  background: linear-gradient(180deg, #fffaf3, #f8ecdf);
}

.experiment-card .muted {
  margin-top: 6px;
}

.experiment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.experiment-meta span {
  font-size: 0.78rem;
  background: linear-gradient(180deg, #fff8ef, #f0dfcc);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: #5e4b3c;
}

.map-card {
  overflow: hidden;
}

.map-image {
  width: 100%;
  border-radius: 18px;
  margin-top: 4px;
  display: block;
}

.seed-item,
.question-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 14px;
  background: linear-gradient(180deg, #fffaf4, #f7ede1);
  box-shadow: var(--shadow-soft);
}

.question-card {
  background: linear-gradient(180deg, #fff9f2, #f7ecde);
}

.answer-block {
  margin-top: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(80, 115, 111, 0.16);
  background: linear-gradient(180deg, rgba(241, 249, 246, 0.92), rgba(250, 242, 231, 0.94));
}

.lesson-archive-item {
  overflow: hidden;
}

.lesson-archive-item summary {
  list-style: none;
  cursor: pointer;
}

.lesson-archive-item summary::-webkit-details-marker {
  display: none;
}

.lesson-archive-item[open] {
  background: linear-gradient(180deg, #fff7ea, #f7e6d5);
}

.lesson-archive-item .archive-body {
  margin-top: 12px;
}

.question-type {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #916948;
}

.table-wrap {
  overflow-x: auto;
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.log-table th,
.log-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(430px, 100%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255, 249, 241, 0.92), rgba(248, 238, 225, 0.98));
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(126, 98, 72, 0.12);
  box-shadow: 0 -10px 24px rgba(103, 78, 56, 0.08);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  border-radius: 16px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.nav-label {
  display: block;
}

.nav-badge {
  position: absolute;
  top: 6px;
  right: 10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #a76543, #855237);
  color: #fff8ef;
  font-size: 0.66rem;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(143, 98, 70, 0.18);
}

.nav-item.is-active {
  background: linear-gradient(180deg, #345b56, #294844);
  color: #fff8ef;
  box-shadow: 0 8px 18px rgba(47, 82, 79, 0.18);
}

@media (max-width: 360px) {
  .two-up,
  .grid-two,
  .photo-strip.large {
    grid-template-columns: 1fr;
  }

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

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