:root {
  --bg: #f6f3ee;
  --panel: #ffffff;
  --panel-soft: #fbf8f3;
  --line: #e4ddd2;
  --ink: #1f2a36;
  --muted: #647180;
  --navy: #345c84;
  --teal: #3f8074;
  --coral: #b96a56;
  --amber: #b5843f;
  --olive: #6d7d4e;
  --sand: #dcc8a1;
  --ok-bg: #edf6ef;
  --ok-ink: #2d6b42;
  --over-bg: #fbebe7;
  --over-ink: #a14d3c;
  --shadow: 0 14px 34px rgba(31, 42, 54, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #f7f4ef 0%, #f3efe8 100%);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  letter-spacing: -0.02em;
}

p {
  margin: 0;
}

.shell {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 36px;
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.header-panel,
.section-panel {
  padding: 24px;
}

.header-panel {
  padding: 22px 24px 20px;
  background:
    radial-gradient(circle at top right, rgba(63, 128, 116, 0.08), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(251, 248, 243, 0.95)),
    linear-gradient(135deg, rgba(63, 128, 116, 0.05), rgba(52, 92, 132, 0.04));
}

.header-copy {
  display: grid;
  gap: 14px;
  align-items: start;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.55));
}

.kids-header-panel {
  background:
    radial-gradient(circle at top right, rgba(181, 132, 63, 0.1), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(251, 248, 243, 0.95)),
    linear-gradient(135deg, rgba(63, 128, 116, 0.04), rgba(181, 132, 63, 0.06));
}

.eyebrow,
.section-kicker {
  margin-bottom: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
}

#board-title {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1;
}

.subtitle {
  max-width: 56ch;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.meta-pill {
  min-height: 56px;
  padding: 10px 14px 11px;
  border-radius: 16px;
  border: 1px solid rgba(31, 42, 54, 0.08);
  background: rgba(255, 255, 255, 0.82);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  flex: 0 1 auto;
  min-width: 158px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.meta-pill::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: rgba(217, 208, 193, 0.95);
}

.meta-pill-month::before {
  background: linear-gradient(180deg, #3f8074, #7aa292);
}

.meta-pill-updated::before {
  background: linear-gradient(180deg, #345c84, #7f9fbd);
}

.meta-pill-household::before {
  background: linear-gradient(180deg, #b5843f, #dcc8a1);
}

.meta-pill-label,
.label,
.budget-copy span,
.feed-sub,
.line-item span,
.tax-note {
  color: var(--muted);
}

.meta-pill-label,
.label {
  display: block;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.meta-pill strong {
  display: block;
  font-size: 0.99rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.nav-panel {
  position: sticky;
  top: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.nav-links,
.nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.nav-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel-soft);
  text-decoration: none;
  font-weight: 700;
}

.nav-chip:hover {
  background: #f2ede6;
}

.action-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fffdf9;
  text-decoration: none;
  font-weight: 700;
}

.action-chip.primary {
  background: #2f5b86;
  border-color: #2f5b86;
  color: white;
}

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

.section-heading h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  line-height: 1.05;
}

.stat-card.ink {
  background: #f7f4ef;
}

.stat-card.coral {
  background: #f8ece7;
}

.stat-card.teal {
  background: #ebf4f1;
}

.stat-card.sand {
  background: #f6f0df;
}

.stat-card.amber {
  background: #f7f1e5;
}

.stat-card.navy {
  background: #edf2f7;
}

.stat-card.olive {
  background: #eef2e8;
}

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

.subpanel {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.subpanel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.subpanel-head h3 {
  font-size: 1.15rem;
}

.subpanel-head span {
  color: var(--muted);
  font-size: 0.92rem;
}

.money-story-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
}

.money-story-main {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fffdf9;
}

.money-story-main strong {
  display: block;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1;
}

.money-story-main span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.money-story-main p {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.money-story-breakdown {
  display: grid;
  gap: 12px;
}

.money-row {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fffdf9;
}

.money-row-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.money-row-copy span {
  color: var(--muted);
  font-size: 0.9rem;
}

.money-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e9e1d6;
}

.money-fill {
  height: 100%;
  border-radius: inherit;
}

.money-fill.coral {
  background: linear-gradient(90deg, #d48b76, #b45d49);
}

.money-fill.navy {
  background: linear-gradient(90deg, #5b7ba0, #345c84);
}

.money-fill.teal {
  background: linear-gradient(90deg, #79a28a, #4f8f74);
}

.budget-list,
.upcoming-list,
.feed-list,
.simple-list,
.account-groups,
.rule-list {
  display: grid;
  gap: 12px;
}

.offline-form {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

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

.form-grid label {
  display: grid;
  gap: 6px;
}

.form-grid label.wide {
  grid-column: 1 / -1;
}

.form-grid span {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-transform: uppercase;
}

.form-grid input,
.form-grid select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--ink);
  font: inherit;
}

.form-grid select:disabled {
  color: #445160;
  background: #f3eee5;
  font-weight: 700;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  padding: 0 16px;
  border: 1px solid #2f5b86;
  background: #2f5b86;
  color: white;
}

.ghost-button {
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--ink);
}

.budget-row {
  display: grid;
  gap: 8px;
}

.budget-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.budget-copy strong,
.line-item strong,
.feed-top strong {
  font-size: 0.98rem;
}

.budget-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #e9e1d6;
}

.budget-fill {
  height: 100%;
  border-radius: inherit;
}

.budget-fill.ok {
  background: linear-gradient(90deg, #79a28a, #4f8f74);
}

.budget-fill.over {
  background: linear-gradient(90deg, #d48b76, #b45d49);
}

.budget-tail {
  font-size: 0.9rem;
  font-weight: 600;
}

.budget-tail.ok {
  color: var(--ok-ink);
}

.budget-tail.over {
  color: var(--over-ink);
}

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

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

.kid-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
}

.owner-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdf9;
}

.kid-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.owner-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.kid-top span {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 700;
}

.owner-top span {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 700;
}

.kid-spend {
  margin: 10px 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
}

.kid-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.owner-metric {
  margin: 10px 0 6px;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.1;
}

.owner-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.kid-owner-card {
  background: linear-gradient(180deg, #fffdfa, #faf6ee);
}

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

.kid-owner-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f3eee5;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.kids-lane-grid,
.kids-track-list {
  display: grid;
  gap: 14px;
}

.kids-lane-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kid-lane-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  background: #fffdf9;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.kid-lane-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(31, 42, 54, 0.08);
}

.kid-lane-card.is-current {
  box-shadow: 0 0 0 2px rgba(31, 42, 54, 0.08), 0 16px 30px rgba(31, 42, 54, 0.09);
}

.kid-lane-head,
.kid-track-header,
.kid-track-latest-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.kid-lane-head strong,
.kid-track-card strong {
  font-size: 1.08rem;
}

.kid-theme-tag,
.kid-track-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 800;
}

.kid-lane-head strong,
.kid-track-header h3 {
  display: block;
  margin-top: 8px;
}

.kid-lane-sport,
.kid-track-sport {
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.kid-lane-motto,
.kid-track-motto {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
}

.kid-lane-copy,
.kid-track-card p,
.kid-mini-item p {
  color: var(--muted);
  line-height: 1.5;
}

.kid-lane-stats,
.kid-track-meta,
.kid-focus-list,
.kid-mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kid-lane-stats span,
.kid-track-meta span,
.kid-focus-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.kid-lane-current {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(31, 42, 54, 0.12);
}

.kids-log-shell {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(31, 42, 54, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.68));
}

.kid-track {
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #fffdf9;
}

.kid-track-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.kid-track-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(31, 42, 54, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.kid-track-label {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
}

.kid-track-card strong {
  font-size: 1.18rem;
  line-height: 1.25;
}

.kid-track-latest {
  display: grid;
  gap: 10px;
}

.kid-track-latest-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

.kid-mini-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kid-mini-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(31, 42, 54, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.kid-mini-item span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.theme-andrew {
  background:
    linear-gradient(180deg, rgba(235, 241, 248, 0.92), rgba(246, 249, 252, 0.96));
  border-color: #ced9e4;
}

.theme-andrew .kid-theme-tag,
.theme-andrew .feed-tag,
.theme-andrew .kid-lane-current {
  color: #20415f;
  background: #dbe7f1;
  border-color: #b9ccdf;
}

.theme-andrew .kid-lane-sport,
.theme-andrew .kid-track-sport {
  color: #2f5b86;
}

.theme-andrew .kid-lane-stats span,
.theme-andrew .kid-track-meta span,
.theme-andrew .kid-focus-pill {
  color: #234b70;
  background: rgba(217, 230, 241, 0.88);
  border: 1px solid #c7d7e6;
}

.theme-emily {
  background:
    linear-gradient(180deg, rgba(249, 238, 240, 0.95), rgba(255, 249, 250, 0.98));
  border-color: #ebd1d6;
}

.theme-emily .kid-theme-tag,
.theme-emily .feed-tag,
.theme-emily .kid-lane-current {
  color: #8a4452;
  background: #f4dfe4;
  border-color: #e7c6ce;
}

.theme-emily .kid-lane-sport,
.theme-emily .kid-track-sport {
  color: #9f5665;
}

.theme-emily .kid-lane-stats span,
.theme-emily .kid-track-meta span,
.theme-emily .kid-focus-pill {
  color: #8f4457;
  background: rgba(245, 224, 229, 0.88);
  border: 1px solid #ebcfd6;
}

.theme-ryan {
  background:
    linear-gradient(180deg, rgba(242, 247, 234, 0.94), rgba(252, 254, 247, 0.98));
  border-color: #d6e2c0;
}

.theme-ryan .kid-theme-tag,
.theme-ryan .feed-tag,
.theme-ryan .kid-lane-current {
  color: #506736;
  background: #e4eed5;
  border-color: #ceddb2;
}

.theme-ryan .kid-lane-sport,
.theme-ryan .kid-track-sport {
  color: #5c7a3b;
}

.theme-ryan .kid-lane-stats span,
.theme-ryan .kid-track-meta span,
.theme-ryan .kid-focus-pill {
  color: #56703a;
  background: rgba(231, 239, 217, 0.9);
  border: 1px solid #d4e1bc;
}

.line-item,
.feed-item {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fffdf9;
}

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

.line-item.compact {
  padding: 12px 14px;
}

.feed-item {
  display: grid;
  gap: 8px;
}

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

.feed-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.feed-sub {
  font-size: 0.9rem;
  line-height: 1.4;
}

.feed-tag,
.rule-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #f0ece5;
}

.empty-state {
  padding: 20px 16px;
  border-radius: 16px;
  border: 1px dashed #d7cdbc;
  color: var(--muted);
  background: #fffcf8;
}

.account-groups {
  gap: 16px;
}

.account-group {
  display: grid;
  gap: 10px;
}

.subgroup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.subgroup-head strong {
  font-size: 1rem;
}

.subgroup-head span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.account-group h4 {
  font-size: 1rem;
}

.category-item {
  align-items: start;
}

.rule-list {
  grid-auto-rows: min-content;
}

.tax-note {
  margin-top: 14px;
  font-size: 0.94rem;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .split-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100vw - 20px, 100%);
    padding: 10px 0 24px;
  }

  .header-panel,
  .section-panel {
    padding: 18px;
  }

  .stat-grid,
  .split-grid,
  .kids-grid,
  .kids-lane-grid,
  .owner-grid,
  .form-grid,
  .money-story-grid,
  .kid-track-grid,
  .kid-mini-list {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .subpanel-head,
  .budget-copy,
  .line-item,
  .feed-top,
  .kid-lane-head,
  .kid-track-header,
  .kid-track-latest-head {
    flex-direction: column;
    align-items: start;
  }

  .meta-strip {
    gap: 10px;
  }

  .meta-pill {
    width: 100%;
    min-width: 0;
  }

  .nav-panel {
    top: 8px;
    align-items: stretch;
  }

  .nav-links,
  .nav-actions {
    width: 100%;
  }

  .nav-chip,
  .action-chip {
    flex: 1 1 auto;
  }
}
