:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #66716d;
  --subtle: #89928e;
  --line: #d9e0dc;
  --panel: #ffffff;
  --surface: #f7f8f4;
  --surface-strong: #edf4ef;
  --teal: #00875a;
  --teal-dark: #006b48;
  --green: #2f8f46;
  --amber: #bd7b16;
  --coral: #d24b32;
  --blue: #2878b7;
  --lavender: #7251b5;
  --gold: #e2a923;
  --shadow: 0 14px 34px rgba(27, 45, 38, 0.1);
  --radius: 8px;
  --radius-sm: 6px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--surface);
  color: var(--ink);
}

body {
  min-width: 320px;
}

a {
  color: var(--teal-dark);
}

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

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.policy-page {
  background:
    linear-gradient(180deg, rgba(237, 244, 239, 0.9), rgba(247, 248, 244, 0.98)),
    var(--surface);
}

.policy-shell {
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.policy-back {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: var(--teal-dark);
  font-weight: 900;
  text-decoration: none;
}

.policy-hero,
.policy-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.policy-hero {
  padding: clamp(24px, 5vw, 42px);
  margin-top: 18px;
}

.policy-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1;
  max-width: 760px;
}

.policy-hero p,
.policy-section p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.policy-hero p {
  max-width: 680px;
}

.policy-date {
  margin-bottom: 0;
  font-weight: 800;
}

.policy-section {
  padding: clamp(20px, 4vw, 30px);
  margin-top: 16px;
}

.policy-section h2 {
  margin-bottom: 10px;
}

.policy-section p:last-child {
  margin-bottom: 0;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-lockup {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: var(--ink);
  border-radius: var(--radius);
  flex: 0 0 auto;
  position: relative;
  overflow: hidden;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  display: block;
  position: absolute;
  border-radius: 999px;
  background: #fff;
}

.brand-mark::before {
  width: 22px;
  height: 3px;
  transform: rotate(-28deg);
}

.brand-mark::after {
  width: 4px;
  height: 4px;
  left: 10px;
  top: 26px;
}

.brand-mark span {
  width: 4px;
  height: 4px;
  right: 10px;
  top: 13px;
}

.eyebrow {
  margin: 0 0 3px;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--teal-dark);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

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

h1 {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1.08;
}

h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.12;
}

h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

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

.primary-action,
.secondary-action,
.text-action,
.sync-pill,
.icon-button {
  border: 0;
  border-radius: var(--radius-sm);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  line-height: 1.15;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.primary-action {
  background: var(--teal);
  color: #fff;
  padding: 0 14px;
  box-shadow: 0 8px 22px rgba(0, 135, 90, 0.18);
}

.primary-action:hover,
.secondary-action:hover,
.text-action:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-action:disabled,
.secondary-action:disabled,
.text-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.secondary-action {
  background: #eef2ee;
  color: var(--ink);
  padding: 0 13px;
  border: 1px solid var(--line);
}

.text-action {
  min-height: 34px;
  padding: 0 8px;
  color: var(--teal-dark);
  background: transparent;
}

.sync-pill {
  padding: 0 12px;
  color: var(--muted);
  background: #eef2ee;
  border: 1px solid var(--line);
}

.sync-pill.cloud {
  color: var(--teal-dark);
  background: #eaf8ef;
  border-color: #bfe5cc;
}

.icon-button {
  width: 40px;
  height: 40px;
  color: var(--ink);
  background: #eef2ee;
  border: 1px solid var(--line);
  padding: 0;
}

.icon-button.ghost {
  background: transparent;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.workspace {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 20px;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 22px clamp(16px, 3vw, 34px) 32px;
  flex: 1;
}

.rail {
  align-self: start;
  position: sticky;
  top: 98px;
  display: grid;
  gap: 14px;
}

.nav-list {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: 0 10px 28px rgba(27, 45, 38, 0.07);
}

.nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-weight: 800;
  text-align: left;
}

.nav-item.active {
  color: var(--ink);
  background: var(--surface-strong);
}

.rail-note {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--muted);
  line-height: 1.45;
}

.rail-note p:last-child {
  margin-bottom: 0;
}

.note-title {
  color: var(--ink);
  font-weight: 900;
  margin-bottom: 6px;
}

.content-area {
  min-width: 0;
}

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

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

.view-title {
  max-width: 780px;
}

.view-title p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.morning-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 124px;
  gap: 16px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 26px);
  box-shadow: var(--shadow);
}

.morning-copy h2 {
  font-size: clamp(1.52rem, 2.4vw, 2.35rem);
  max-width: 760px;
}

.morning-copy p:not(.eyebrow) {
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.42;
  max-width: 620px;
}

.score-ring {
  width: 112px;
  height: 112px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle, #fff 0 58%, transparent 59%),
    conic-gradient(var(--teal) calc(var(--score) * 1%), #edf0ed 0);
}

.score-ring span,
.score-ring small {
  grid-area: 1 / 1;
}

.score-ring span {
  transform: translateY(-8px);
  font-size: 1.72rem;
  font-weight: 950;
}

.score-ring small {
  transform: translateY(20px);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.reward-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 1fr);
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.reward-rail::-webkit-scrollbar {
  display: none;
}

.reward-tile {
  scroll-snap-align: start;
  min-height: 112px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
  display: grid;
  align-content: space-between;
  box-shadow: 0 8px 24px rgba(27, 45, 38, 0.06);
}

.reward-tile span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.reward-tile strong {
  font-size: 1.45rem;
  line-height: 1;
}

.reward-tile p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.3;
}

.reward-tile.green {
  border-top: 4px solid var(--green);
}

.reward-tile.blue {
  border-top: 4px solid var(--blue);
}

.reward-tile.amber {
  border-top: 4px solid var(--gold);
}

.reward-tile.coral {
  border-top: 4px solid var(--coral);
}

.quest-panel {
  background: #17211d;
  color: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.quest-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.36fr);
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.quest-header .eyebrow {
  color: #9fe5c2;
}

.quest-header h3 {
  font-size: 1.16rem;
}

.quest-header p {
  color: rgba(255, 255, 255, 0.76);
  margin: 5px 0 0;
}

.quest-meter,
.mini-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.quest-meter span,
.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #52d17e, #e2a923);
}

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

.mission-card {
  min-height: 86px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 12px;
  text-align: left;
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.mission-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.28);
}

.mission-card.done {
  background: rgba(47, 143, 70, 0.25);
  border-color: rgba(159, 229, 194, 0.44);
}

.mission-state {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--teal-dark);
  font-size: 0.72rem;
  font-weight: 950;
}

.mission-card.done .mission-state {
  color: #fff;
  background: var(--green);
}

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

.mission-card strong {
  margin-bottom: 4px;
}

.mission-card small {
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.3;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  min-height: 92px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  align-content: space-between;
}

.metric strong {
  font-size: 1.3rem;
}

.metric span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.25;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.dashboard-grid.focus-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.7fr);
}

.panel,
.card,
.member-card,
.request-card,
.ledger-card,
.kid-card,
.badge-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(27, 45, 38, 0.065);
}

.panel {
  padding: 18px;
}

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

.panel-header p {
  color: var(--muted);
  margin: 7px 0 0;
  line-height: 1.42;
}

.hero-run {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(240px, 0.86fr);
  gap: 16px;
}

.route-map {
  min-height: 300px;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(23, 33, 29, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(23, 33, 29, 0.06) 1px, transparent 1px),
    linear-gradient(135deg, #eef4f0, #ffffff 58%, #f6eee9);
  background-size: 34px 34px, 34px 34px, 100% 100%;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.route-line {
  position: absolute;
  left: 14%;
  right: 12%;
  top: 48%;
  height: 8px;
  transform: rotate(-16deg);
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--teal) var(--progress, 42%), rgba(23, 33, 29, 0.17) var(--progress, 42%)),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 255, 255, 0.75) 18px 22px);
  box-shadow: 0 0 0 5px rgba(14, 124, 114, 0.06);
}

.map-dot,
.car-pin {
  position: absolute;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.map-dot {
  width: 64px;
  height: 64px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 0.72rem;
  text-align: center;
}

.map-dot.home {
  left: 9%;
  bottom: 24%;
}

.map-dot.school {
  right: 7%;
  top: 16%;
  background: #17211d;
  color: #fff;
}

.car-pin {
  left: calc(15% + (var(--progress-number, 42) * 0.62%));
  top: calc(57% - (var(--progress-number, 42) * 0.22%));
  width: 46px;
  height: 46px;
  background: var(--coral);
  color: #fff;
  box-shadow: 0 14px 28px rgba(200, 85, 66, 0.25);
  transition:
    left 500ms ease,
    top 500ms ease;
}

.map-caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(217, 224, 220, 0.8);
  padding: 11px 12px;
  color: var(--muted);
  line-height: 1.35;
}

.ride-summary {
  display: grid;
  gap: 12px;
}

.ride-person {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.avatar {
  width: 54px;
  height: 54px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  background: var(--teal);
}

.avatar.amber {
  background: var(--amber);
}

.avatar.blue {
  background: var(--blue);
}

.avatar.lavender {
  background: var(--lavender);
}

.ride-person p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.ride-token {
  border: 1px solid #bee3d2;
  border-radius: var(--radius);
  background: #eef9f3;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ride-token span {
  color: var(--teal-dark);
  font-weight: 900;
}

.ride-token strong {
  font-size: 1.65rem;
  letter-spacing: 0;
}

.detail-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-pills span {
  border: 1px solid var(--line);
  background: #f8faf8;
  border-radius: 999px;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 0.82rem;
  font-weight: 850;
}

.step-list {
  display: grid;
  gap: 8px;
}

.step {
  min-height: 50px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.step-icon {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--subtle);
  font-size: 0.62rem;
  font-weight: 900;
}

.step.done .step-icon {
  background: var(--green);
}

.step.active .step-icon {
  background: var(--coral);
}

.step strong {
  display: block;
  margin-bottom: 2px;
  font-size: 0.92rem;
}

.step span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.3;
}

.side-stack {
  display: grid;
  gap: 16px;
}

.card {
  padding: 16px;
}

.card p {
  color: var(--muted);
  line-height: 1.42;
}

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

.quick-action {
  min-height: 90px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfb;
  padding: 13px;
  color: var(--ink);
}

.quick-action svg {
  color: var(--teal);
}

.quick-action:hover {
  border-color: #a8d9c1;
  background: #f1faf5;
}

.quick-action strong,
.quick-action span {
  display: block;
}

.quick-action span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.32;
}

.badge-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.15;
  font-weight: 800;
  font-size: 0.75rem;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #f8faf8;
}

.badge.green {
  color: #1f6a34;
  background: #ebf7ee;
  border-color: #cfe8d4;
}

.badge.amber {
  color: #875210;
  background: #fff4df;
  border-color: #efd6ac;
}

.badge.coral {
  color: #9e3527;
  background: #fff0ed;
  border-color: #efc6be;
}

.badge.blue {
  color: #23648f;
  background: #edf6fb;
  border-color: #cbe0ef;
}

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

.member-grid,
.request-grid,
.ledger-grid,
.kid-grid,
.badge-shelf {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.member-card,
.request-card,
.ledger-card,
.kid-card,
.badge-card {
  padding: 15px;
  display: grid;
  gap: 12px;
}

.reward-hero {
  min-height: 160px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(23, 33, 29, 0.94), rgba(40, 120, 183, 0.86)),
    #17211d;
  border-radius: var(--radius);
  padding: clamp(18px, 4vw, 30px);
  box-shadow: var(--shadow);
}

.reward-hero .eyebrow {
  color: #bdebcf;
}

.reward-hero h3 {
  font-size: clamp(1.45rem, 2.5vw, 2rem);
}

.reward-hero p {
  color: rgba(255, 255, 255, 0.78);
  margin: 8px 0 0;
}

.level-stack {
  width: 118px;
  height: 118px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.14) 0 56%, transparent 57%),
    conic-gradient(#52d17e 0 74%, rgba(255, 255, 255, 0.2) 0);
  text-align: center;
}

.level-stack strong,
.level-stack span {
  grid-area: 1 / 1;
}

.level-stack strong {
  transform: translateY(-7px);
  font-size: 1.85rem;
}

.level-stack span {
  transform: translateY(22px);
  font-size: 0.74rem;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.72);
}

.badge-card {
  overflow: hidden;
  position: relative;
}

.badge-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--teal);
}

.badge-card.blue::before {
  background: var(--blue);
}

.badge-card.amber::before {
  background: var(--gold);
}

.badge-card.coral::before {
  background: var(--coral);
}

.badge-medal {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  font-weight: 950;
  box-shadow: 0 10px 20px rgba(0, 135, 90, 0.18);
}

.badge-card.blue .badge-medal {
  background: var(--blue);
}

.badge-card.amber .badge-medal {
  background: var(--gold);
}

.badge-card.coral .badge-medal {
  background: var(--coral);
}

.badge-card p {
  color: var(--muted);
  line-height: 1.36;
  margin: 0;
}

.badge-card .mini-progress {
  background: #edf0ed;
}

.member-heading {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.member-heading p,
.request-card p,
.ledger-card p,
.kid-card p {
  color: var(--muted);
  margin: 4px 0 0;
  line-height: 1.36;
}

.detail-list {
  display: grid;
  gap: 9px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.detail-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  color: var(--muted);
  border-bottom: 1px solid #edf0ed;
  padding-bottom: 8px;
}

.detail-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-list strong {
  color: var(--ink);
  text-align: right;
}

.empty-state {
  border: 1px dashed #bcc7c1;
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  line-height: 1.42;
}

.schedule-table {
  display: grid;
  gap: 8px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 96px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px;
  background: #fff;
}

.schedule-row strong {
  display: block;
}

.schedule-row span {
  color: var(--muted);
  font-size: 0.86rem;
}

.ledger-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #edf0ed;
}

.ledger-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  width: var(--balance);
  background: var(--teal);
}

.kid-pass {
  min-height: 320px;
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(300px, 1fr);
  gap: 16px;
}

.kid-hero {
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(14, 124, 114, 0.92), rgba(57, 121, 168, 0.9)),
    var(--teal);
  color: #fff;
  padding: clamp(20px, 4vw, 34px);
  display: grid;
  align-content: space-between;
  min-height: 320px;
}

.kid-hero h2 {
  font-size: 2rem;
  line-height: 1.05;
}

.kid-hero p {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.45;
}

.kid-driver-card {
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius);
  padding: 16px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.kid-driver-card p {
  color: var(--muted);
  margin-bottom: 0;
}

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

.kid-check {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
}

.kid-check span:first-child {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 0.68rem;
  font-weight: 900;
}

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

.timeline-event {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  border-left: 3px solid var(--teal);
  padding: 4px 0 4px 12px;
}

.timeline-event time {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.84rem;
}

.timeline-event strong {
  display: block;
}

.timeline-event p {
  color: var(--muted);
  margin: 2px 0 0;
  line-height: 1.35;
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(740px, calc(100vw - 28px));
}

.modal::backdrop {
  background: rgba(23, 33, 29, 0.46);
  backdrop-filter: blur(4px);
}

.modal-panel {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  padding: 20px;
}

.modal-panel.compact {
  width: min(560px, calc(100vw - 28px));
}

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

.modal-copy {
  color: var(--muted);
  line-height: 1.45;
  margin: 12px 0 16px;
}

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

.form-grid.one-col {
  grid-template-columns: 1fr;
}

.form-grid label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.88rem;
}

.span-2 {
  grid-column: span 2;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5cf;
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(14, 124, 114, 0.22);
  outline-offset: 2px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  z-index: 50;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  background: #17211d;
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 13px 14px;
}

.reward-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  display: grid;
  place-items: center;
}

.reward-pop {
  background: #17211d;
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  text-align: center;
  animation: popIn 900ms ease both;
}

.reward-pop strong {
  display: block;
  font-size: 1.15rem;
}

.reward-pop span {
  display: block;
  color: #bdebcf;
  margin-top: 4px;
  font-weight: 900;
}

.reward-piece {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 14px;
  border-radius: 3px;
  background: var(--piece-color);
  transform: translate(-50%, -50%) rotate(var(--angle));
  animation: burst 850ms ease-out forwards;
}

@keyframes popIn {
  0% {
    transform: scale(0.92);
    opacity: 0;
  }
  18%,
  78% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.98);
    opacity: 0;
  }
}

@keyframes burst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateY(-150px);
  }
}

.toast strong {
  display: block;
  margin-bottom: 4px;
}

.toast p {
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
  line-height: 1.34;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
  }

  .nav-item svg {
    display: none;
  }

  .rail-note {
    display: none;
  }

  .dashboard-grid,
  .dashboard-grid.focus-grid,
  .hero-run,
  .kid-pass {
    grid-template-columns: 1fr;
  }

  .member-grid,
  .request-grid,
  .ledger-grid,
  .kid-grid,
  .badge-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: center;
    flex-direction: row;
    padding: 12px;
    gap: 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  h1 {
    font-size: 1rem;
  }

  .topbar .eyebrow {
    display: none;
  }

  .brand-lockup {
    gap: 8px;
  }

  .topbar-actions {
    flex: 0 0 auto;
  }

  .topbar-actions .primary-action {
    width: 44px;
    padding: 0;
    font-size: 0;
  }

  .topbar-actions .primary-action svg {
    margin: 0;
  }

  .workspace {
    padding: 14px 12px 24px;
  }

  .rail {
    position: static;
    z-index: auto;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 6px;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(27, 45, 38, 0.1);
  }

  .nav-item {
    min-height: 54px;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
    padding: 5px 3px;
    text-align: center;
  }

  .nav-item svg {
    display: block;
    width: 17px;
    height: 17px;
  }

  .view-header,
  .panel-header {
    flex-direction: column;
  }

  .morning-strip {
    grid-template-columns: 1fr;
  }

  .quest-header,
  .quest-grid,
  .reward-hero {
    grid-template-columns: 1fr;
  }

  .quest-grid {
    display: grid;
  }

  .reward-hero {
    display: grid;
  }

  .level-stack {
    justify-self: start;
  }

  .score-ring {
    width: 92px;
    height: 92px;
    justify-self: start;
  }

  .reward-rail {
    grid-auto-columns: minmax(184px, 76%);
  }

  .status-strip,
  .grid-2,
  .member-grid,
  .request-grid,
  .ledger-grid,
  .kid-grid,
  .badge-shelf,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

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

  .schedule-row {
    grid-template-columns: 1fr;
  }

  .route-map {
    min-height: 270px;
  }

  .kid-hero {
    min-height: 240px;
  }

  .map-dot {
    width: 56px;
    height: 56px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }

  .toast-stack {
    bottom: 18px;
    right: 12px;
    left: 12px;
  }

  .toast {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .metric {
    min-height: 82px;
  }

  .kid-hero h2 {
    font-size: 1.55rem;
  }

  .kid-hero {
    min-height: 220px;
  }

  .quick-action {
    min-height: 78px;
    padding: 10px;
  }

  .mission-card {
    min-height: 76px;
  }

  .quick-action span {
    font-size: 0.78rem;
  }

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