:root {
  --forest: #153f3a;
  --forest-deep: #0c2d2a;
  --leaf: #2f8f62;
  --lime: #c7e55b;
  --sun: #f6bd45;
  --cream: #fffaf0;
  --paper: #ffffff;
  --ink: #17312e;
  --muted: #667b76;
  --line: #dce8df;
  --danger: #b33d3d;
  --shadow: 0 18px 55px rgba(12, 45, 42, .12);
}

* { box-sizing: border-box; }
html { background: var(--cream); color: var(--ink); font-family: "DM Sans", sans-serif; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 85% 0%, rgba(199,229,91,.24), transparent 25rem), var(--cream); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .22; background-image: radial-gradient(#17312e 0.55px, transparent 0.55px); background-size: 13px 13px; }
a { color: inherit; }
button, input, textarea { font: inherit; }
.page-shell { position: relative; width: min(100% - 32px, 980px); margin: 0 auto; padding: 44px 0 32px; }
.masthead { max-width: 760px; margin-bottom: 28px; }
.masthead-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.eyebrow, .label { display: block; color: var(--leaf); font-size: .82rem; font-weight: 700; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid rgba(47,143,98,.24); border-radius: 999px; background: rgba(255,255,255,.72); }
.top-donate { display: inline-flex; align-items: center; gap: 7px; padding: 10px 15px; border-radius: 999px; background: var(--sun); color: var(--forest-deep); font-size: .9rem; font-weight: 800; text-decoration: none; box-shadow: 0 8px 18px rgba(246,189,69,.24); transition: transform .2s ease, box-shadow .2s ease; }
.top-donate:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(246,189,69,.34); }
.top-donate span { color: #b73f48; }
h1, h2 { font-family: "Fraunces", Georgia, serif; color: var(--forest-deep); margin: 0; line-height: 1.04; }
h1 { max-width: 720px; font-size: clamp(2.4rem, 7vw, 4.8rem); letter-spacing: -.04em; }
h2 { font-size: clamp(1.55rem, 4vw, 2.1rem); letter-spacing: -.025em; }
.masthead p { max-width: 680px; margin: 16px 0 0; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }
.progress-card, .milestones, .walk-log, .admin-card { border: 1px solid rgba(21,63,58,.1); border-radius: 26px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.progress-card { overflow: hidden; padding: clamp(22px, 5vw, 38px); }
.score-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.score { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.score strong { font-family: "Fraunces", Georgia, serif; color: var(--forest); font-size: clamp(3.2rem, 10vw, 6.2rem); line-height: .95; letter-spacing: -.06em; }
.score span { color: var(--muted); font-size: 1.2rem; font-weight: 600; }
.percent-pill { display: grid; place-items: center; min-width: 74px; min-height: 74px; border-radius: 50%; background: var(--lime); color: var(--forest-deep); font-family: "Fraunces", Georgia, serif; font-size: 1.25rem; font-weight: 800; transform: rotate(5deg); }
.route-wrap { margin-top: 12px; }
.route-map { display: block; width: 100%; overflow: visible; }
.route-shadow, .route-base, .route-done { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.route-shadow { stroke: rgba(12,45,42,.1); stroke-width: 25; transform: translateY(7px); }
.route-base { stroke: #dfe9e2; stroke-width: 20; stroke-dasharray: 4 25; }
.route-done { stroke: var(--leaf); stroke-width: 20; stroke-dasharray: 0 9999; transition: stroke-dashoffset 1s ease-out; }
.route-pin circle { fill: var(--paper); stroke: var(--forest); stroke-width: 5; }
.route-pin text { fill: var(--forest); text-anchor: middle; font: 700 14px "DM Sans", sans-serif; }
.finish-pin circle { fill: var(--sun); }
.walker { filter: drop-shadow(0 6px 5px rgba(12,45,42,.24)); }
.walker circle { fill: var(--cream); stroke: var(--forest); stroke-width: 4; }
.walker text { font-size: 35px; text-anchor: middle; }
.walker-photo { overflow: visible; }
.route-caption { margin-top: -5px; color: var(--muted); text-align: center; font-size: 1.05rem; }
.route-caption strong { color: var(--forest); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 14px 0 30px; }
.stat-grid article { min-width: 0; padding: 17px; border-radius: 18px; background: var(--forest); color: white; }
.stat-grid article:nth-child(even) { background: #225d53; }
.stat-grid .stat-icon { display: block; margin-bottom: 15px; font-size: 1.25rem; }
.stat-grid strong { display: block; color: var(--lime); font-family: "Fraunces", Georgia, serif; font-size: 1.8rem; line-height: 1; }
.stat-grid article > span:last-child { display: block; margin-top: 5px; color: rgba(255,255,255,.72); font-size: .82rem; line-height: 1.25; }
.milestones, .walk-log { padding: clamp(22px, 5vw, 34px); margin-top: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 24px; }
.section-heading > span { color: var(--muted); font-size: .9rem; font-weight: 600; }
.badge-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.milestone-badge { padding: 18px 12px; border: 1px dashed #cad8cd; border-radius: 18px; background: #f4f7f3; color: #8a9995; text-align: center; filter: grayscale(1); opacity: .65; }
.milestone-badge.earned { border-style: solid; border-color: rgba(47,143,98,.22); background: #eff9e0; color: var(--forest); filter: none; opacity: 1; }
.badge-icon { display: block; margin-bottom: 8px; font-size: 1.7rem; }
.milestone-badge strong, .milestone-badge > span:last-child { display: block; }
.milestone-badge > span:last-child { margin-top: 3px; font-size: .78rem; }
.timeline { position: relative; list-style: none; margin: 0; padding: 0 0 0 20px; }
.timeline::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 5px; width: 2px; background: var(--line); }
.timeline li { position: relative; display: grid; grid-template-columns: 130px 1fr; gap: 18px; padding: 0 0 22px 18px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -20px; top: 6px; width: 14px; height: 14px; border: 3px solid var(--paper); border-radius: 50%; background: var(--leaf); box-shadow: 0 0 0 2px var(--leaf); }
.walk-date { color: var(--muted); font-size: .91rem; font-weight: 600; }
.walk-details strong, .walk-details span { display: block; }
.walk-details strong { color: var(--forest); font-size: 1.05rem; }
.walk-details span { margin-top: 3px; color: var(--muted); line-height: 1.45; }
.empty-state { display: grid; place-items: center; min-height: 150px; border: 1px dashed var(--line); border-radius: 18px; color: var(--muted); text-align: center; }
.empty-state span { font-size: 2rem; }
.empty-state p { margin: 8px 0 0; }
.donate-button { display: flex; justify-content: space-between; align-items: center; gap: 15px; width: 100%; margin-top: 18px; padding: 20px 24px; border-radius: 18px; background: var(--sun); color: var(--forest-deep); font-weight: 800; text-decoration: none; box-shadow: 0 10px 24px rgba(246,189,69,.24); transition: transform .2s ease, box-shadow .2s ease; }
.donate-button:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(246,189,69,.34); }
footer { padding: 30px 0 0; color: var(--muted); text-align: center; font-size: .9rem; }
footer span { color: #d85858; }

.admin-body { background: #edf4ef; }
.admin-shell { position: relative; width: min(100% - 32px, 980px); margin: 0 auto; padding: 44px 0; }
.compact-shell { width: min(100% - 32px, 500px); }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--forest); font-weight: 700; text-decoration: none; }
.admin-header { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-bottom: 28px; }
.admin-header h1, .admin-card > h1 { margin-top: 6px; font-size: clamp(2.3rem, 7vw, 3.8rem); }
.admin-header p, .admin-card > p { margin: 9px 0 0; color: var(--muted); line-height: 1.55; }
.admin-actions { display: flex; align-items: center; gap: 13px; white-space: nowrap; }
.admin-actions a, .text-button { padding: 9px 12px; border: 0; background: transparent; color: var(--forest); font-weight: 700; text-decoration: none; cursor: pointer; }
.admin-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 18px; align-items: start; }
.admin-card { padding: clamp(22px, 5vw, 32px); }
.admin-mark { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 20px; border-radius: 18px; background: var(--lime); font-size: 1.8rem; transform: rotate(-4deg); }
.admin-card h2 { font-size: 1.75rem; }
.admin-card > p { margin-bottom: 22px; }
.stack-form { display: grid; gap: 9px; margin-top: 22px; }
.stack-form label { margin-top: 7px; color: var(--forest); font-size: .9rem; font-weight: 700; }
.stack-form label span { color: var(--muted); font-weight: 500; }
.stack-form input, .stack-form textarea { width: 100%; padding: 13px 14px; border: 1px solid #c8d6cd; border-radius: 11px; outline: none; background: white; color: var(--ink); }
.stack-form input:focus, .stack-form textarea:focus { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(47,143,98,.14); }
.stack-form button { margin-top: 10px; padding: 14px 18px; border: 0; border-radius: 11px; background: var(--forest); color: white; font-weight: 800; cursor: pointer; }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 65px; }
.input-suffix span { position: absolute; top: 13px; right: 14px; color: var(--muted); }
.flash { margin: 0 0 18px; padding: 13px 15px; border-radius: 11px; font-weight: 600; }
.flash.success { background: #dff4d0; color: #225c38; }
.flash.error { background: #f9dddd; color: #852f2f; }
.admin-walks { border-top: 1px solid var(--line); }
.admin-walk-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.admin-walk-row div { min-width: 0; }
.admin-walk-row strong, .admin-walk-row span { display: block; }
.admin-walk-row span { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: .86rem; line-height: 1.35; text-overflow: ellipsis; }
.delete-button { padding: 7px 9px; border: 0; background: transparent; color: var(--danger); font-size: .83rem; font-weight: 700; cursor: pointer; }
.empty-state.small { min-height: 120px; }

@media (max-width: 700px) {
  .page-shell, .admin-shell { width: min(100% - 22px, 980px); padding-top: 25px; }
  .masthead { margin-bottom: 20px; }
  .masthead-top { align-items: center; }
  .top-donate { padding: 9px 13px; }
  .masthead p { font-size: 1rem; }
  .progress-card { border-radius: 21px; }
  .score strong { font-size: 3.8rem; }
  .percent-pill { min-width: 62px; min-height: 62px; font-size: 1.05rem; }
  .route-map { margin: 6px -10px 0; width: calc(100% + 20px); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .badge-row { grid-template-columns: repeat(2, 1fr); }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
  .admin-header { display: block; }
  .admin-actions { margin: 14px -9px 0; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
