:root {
  --forest: #153d32;
  --forest-h: #215946;
  --deep: #102e28;
  --cream: #f6f4ea;
  --surface: #fffefa;
  --soft: #e7f1d8;
  --lime: #b8e071;
  --muted: #5e7268;
  --line: #dbe4d5;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', 'DM Sans', system-ui, -apple-system, sans-serif;
  color: var(--deep);
  background: var(--cream);
  min-height: 100vh;
}
.brand { font-family: 'Fraunces', Georgia, serif; letter-spacing: -0.02em; }
.eyebrow { letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.72rem; font-weight: 700; color: #3b7654; }
.surface-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 6px 24px rgba(16, 46, 40, 0.04);
}
.soft-card {
  background: var(--soft);
  border: 1px solid #cde0b8;
  border-radius: 18px;
}
.formula-box {
  background: #f3f7ed;
  border: 1px solid #cfe0be;
  border-radius: 14px;
  padding: 12px 16px;
  color: #153d32;
}
.math-var {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 600;
}
[hidden] { display: none !important; }
button.pill-btn, .pill-btn {
  border: 1px solid #c7d7c2;
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 0.84rem;
  font-weight: 700;
  background-color: #fffefa !important;
  color: var(--deep) !important;
  cursor: pointer;
  transition: all 0.18s ease;
}
button.pill-btn.active, .pill-btn.active {
  background-color: var(--forest) !important;
  color: #ffffff !important;
  border-color: var(--forest) !important;
}
button.btn-primary, .btn-primary {
  background-color: var(--forest) !important;
  color: #ffffff !important;
  border-radius: 13px;
  padding: 11px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  border: none;
}
button.btn-primary:hover:not(:disabled), .btn-primary:hover:not(:disabled) { background-color: var(--forest-h) !important; transform: translateY(-1px); }
button.btn-primary:disabled, .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
button.btn-secondary, .btn-secondary {
  background-color: var(--soft) !important;
  color: var(--forest) !important;
  border: 1px solid #c5dbb0;
  border-radius: 13px;
  padding: 11px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}
button.btn-secondary:hover:not(:disabled), .btn-secondary:hover:not(:disabled) { background-color: #dcebc7 !important; }
.field-input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  font-size: 0.92rem;
}
.field-input:focus { outline: 2px solid #5a9e74; border-color: #397f5a; }
.map-frame { height: 280px; border-radius: 16px; overflow: hidden; background: #e3ecdc; position: relative; z-index: 1; }
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: rgba(255, 254, 250, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 20px rgba(16, 46, 40, 0.06);
}
button.sub-tab-btn, .sub-tab-btn {
  border-radius: 12px;
  padding: 7px 4px;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
  border: none;
  background-color: transparent;
}
button.sub-tab-btn.active, .sub-tab-btn.active {
  background-color: var(--soft) !important;
  color: var(--forest) !important;
}
.step-item {
  position: relative;
  padding: 0 0 18px 32px;
  border-left: 2px solid #d5e0d1;
  margin-left: 10px;
}
.step-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.step-item::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d5e0d1;
  border: 3px solid #fffefa;
}
.step-item.done { border-left-color: #2f855a; }
.step-item.done::before { background: #2f855a; }
.step-item.current::before { background: #84cc16; box-shadow: 0 0 0 4px #e2f2cb; }
.route-option.winner { border-color: #3b8759; background: #eef7e3; box-shadow: 0 0 0 2px rgba(59, 135, 89, 0.18); }
.qr-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
  width: 136px;
  height: 136px;
  padding: 9px;
  background: #ffffff;
  border: 1px solid #d5e1d1;
  border-radius: 12px;
}
.qr-cell { border-radius: 2px; background: #f3f6ed; }
.qr-cell.dark { background: #153d32; }
input[type=range] { accent-color: #286a46; width: 100%; }

/* Fallback utility classes so layout & theme render instantaneously even if CDN is slow/blocked */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.hidden { display: none; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.place-items-center { place-items: center; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }
.w-full { width: 100%; }
.w-11 { width: 2.75rem; }
.h-11 { height: 2.75rem; }
.w-9 { width: 2.25rem; }
.h-9 { height: 2.25rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.h-3 { height: 0.75rem; }
.h-2\.5 { height: 0.625rem; }
.h-full { height: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-sm { max-width: 24rem; }
.max-w-5xl { max-width: 64rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-1 { padding: 0.25rem; }
.p-2\.5 { padding: 0.625rem; }
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-3\.5 { padding-top: 0.875rem; padding-bottom: 0.875rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-5 { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pb-24 { padding-bottom: 6rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }
.my-3 { margin-top: 0.75rem; margin-bottom: 0.75rem; }
.my-5 { margin-top: 1.25rem; margin-bottom: 1.25rem; }
.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.375rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-3\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.875rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }
.border { border-width: 1px; border-style: solid; border-color: #dbe4d5; }
.border-b { border-bottom: 1px solid #dbe4d5; }
.border-t { border-top: 1px solid #dbe4d5; }
.bg-\[\#153d32\] { background-color: #153d32; }
.bg-\[\#0f2e25\] { background-color: #0f2e25; }
.bg-\[\#b8e071\] { background-color: #b8e071; }
.bg-\[\#e7f1d8\] { background-color: #e7f1d8; }
.bg-\[\#f3f6ec\] { background-color: #f3f6ec; }
.bg-\[\#eef3e8\] { background-color: #eef3e8; }
.bg-\[\#e6eee0\] { background-color: #e6eee0; }
.bg-white { background-color: #ffffff; }
.bg-red-500 { background-color: #ef4444; }
.bg-red-700 { background-color: #b91c1c; }
.bg-red-100 { background-color: #fee2e2; }
.bg-amber-100 { background-color: #fef3c7; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gradient-to-b { background: linear-gradient(to bottom, #153d32, #184539, #0f2e25); }
.text-white { color: #ffffff; }
.text-\[\#153d32\] { color: #153d32; }
.text-\[\#102e28\] { color: #102e28; }
.text-\[\#287044\] { color: #287044; }
.text-\[\#2f7651\] { color: #2f7651; }
.text-\[\#5e7268\] { color: #5e7268; }
.text-\[\#b8e071\] { color: #b8e071; }
.text-red-700 { color: #b91c1c; }
.text-red-800 { color: #991b1b; }
.text-amber-800 { color: #92400e; }
.text-amber-900 { color: #78350f; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.uppercase { text-transform: uppercase; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.relative { position: relative; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.top-5 { top: 1.25rem; }
.right-4 { right: 1rem; }
.z-50 { z-index: 50; }
.z-\[1150\] { z-index: 1150; }
.z-\[1180\] { z-index: 1180; }
.z-\[1190\] { z-index: 1190; }
.z-\[1250\] { z-index: 1250; }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.cursor-pointer { cursor: pointer; }
table.w-full { width: 100%; border-collapse: collapse; }
@media (min-width: 640px) {
  .sm\:inline { display: inline; }
  .sm\:p-5 { padding: 1.25rem; }
  .sm\:p-8 { padding: 2rem; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:col-span-1 { grid-column: span 1 / span 1; }
}
@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lg\:grid-cols-\[1\.25fr_1fr\] { grid-template-columns: 1.25fr 1fr; }
  .lg\:grid-cols-\[1\.35fr_1fr\] { grid-template-columns: 1.35fr 1fr; }
}

