:root {
  color-scheme: dark;
  --leaflet-ink: #f7f7fb;
  --leaflet-muted: #9ca3af;
  --leaflet-line: rgba(255, 255, 255, .11);
  --leaflet-soft: rgba(255, 255, 255, .045);
  --leaflet-panel: linear-gradient(145deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025));
  --leaflet-violet: #8b5cf6;
  --leaflet-violet-light: #c4b5fd;
  --leaflet-pink: #ec4899;
  --leaflet-danger: #fca5a5;
  --leaflet-shadow: 0 28px 90px rgba(0, 0, 0, .34);
}

html { background: #0a0a0b; }
body.leaflets-page {
  margin: 0;
  min-height: 100vh;
  background: #0a0a0b;
  color: var(--leaflet-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.leaflets-page .site-header { display: block; padding: 0; }

.site-nav-link { position: relative; }
.site-nav-link::after {
  position: absolute;
  right: 12px;
  bottom: 0;
  left: 12px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #a78bfa, #f472b6);
  content: "";
  opacity: 0;
  transition: opacity .2s ease;
}
.site-nav-link:hover { border-radius: 8px; background: rgba(255, 255, 255, .05); color: #fff; }
.site-nav-link:hover::after,
.site-nav-link.active::after { opacity: 1; }
.site-nav-link.active { color: #fff !important; }

.gradient-text {
  background: linear-gradient(135deg, #fff 0%, #a78bfa 50%, #f472b6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}
.hero-gradient {
  background: radial-gradient(ellipse at 50% 0%, rgba(139, 92, 246, .15) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 50%, rgba(244, 114, 182, .1) 0%, transparent 40%);
}

.leaflet-app { max-width: 1180px; margin: 0 auto; padding: 46px 24px 28px; color: var(--leaflet-ink); }
.leaflet-app * { box-sizing: border-box; }
.leaflet-app button,
.leaflet-app input,
.leaflet-app select { font: inherit; }
.leaflet-app button { cursor: pointer; }
.leaflet-app button:disabled { cursor: wait; opacity: .55; }
.leaflet-app .prototype-note {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--leaflet-muted);
  font-size: 13px;
}
.leaflet-app .prototype-note a { color: var(--leaflet-violet-light); text-decoration: none; }
.leaflet-app .prototype-note a:hover { color: #fff; }
.leaflet-app .calculator-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding: 0 0 30px; }
.leaflet-app h1 { margin: 0 0 7px; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; letter-spacing: -.035em; }
.leaflet-app h2 { margin: 0 0 18px; font-size: 24px; }
.leaflet-app h3 { margin: 0; font-size: 19px; }
.leaflet-app p { margin: 0; }
.leaflet-app .muted { color: var(--leaflet-muted); }
.leaflet-app .link-button { border: 0; padding: 0; background: transparent; color: var(--leaflet-violet-light); text-decoration: none; }
.leaflet-app .link-button:hover { color: #fff; }
.leaflet-app .layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.leaflet-app .panel {
  border: 1px solid var(--leaflet-line);
  border-radius: 24px;
  background: var(--leaflet-panel);
  box-shadow: var(--leaflet-shadow);
  backdrop-filter: blur(18px);
}
.leaflet-app .form-panel { padding: 30px; }
.leaflet-app .summary { position: sticky; top: 76px; padding: 26px; }
.leaflet-app .step { padding: 24px 0; border-top: 1px solid var(--leaflet-line); }
.leaflet-app .step:first-of-type { border-top: 0; padding-top: 0; }
.leaflet-app .step-title { display: flex; gap: 11px; align-items: center; margin-bottom: 16px; font-weight: 750; }
.leaflet-app .step-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(196, 181, 253, .38);
  border-radius: 50%;
  background: rgba(139, 92, 246, .14);
  color: var(--leaflet-violet-light);
  font-size: 13px;
}
.leaflet-app .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.leaflet-app label.field { display: grid; gap: 8px; font-weight: 650; }
.leaflet-app label.field > span:first-child { font-size: 14px; }
.leaflet-app select,
.leaflet-app input[type="number"] {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 13px;
  outline: none;
  background: rgba(255, 255, 255, .055);
  color: #fff;
}
.leaflet-app select option { background: #17171c; color: #fff; }
.leaflet-app select:focus,
.leaflet-app input:focus,
.leaflet-app button:focus-visible { border-color: var(--leaflet-violet); outline: 3px solid rgba(139, 92, 246, .22); outline-offset: 2px; }
.leaflet-app .segmented { display: flex; flex-wrap: wrap; gap: 9px; }
.leaflet-app .checks { display: grid; gap: 10px; }
.leaflet-app .check-row { display: flex; gap: 9px; align-items: start; color: #e5e7eb; font-weight: 550; }
.leaflet-app .check-row input { margin-top: 4px; accent-color: var(--leaflet-violet); }
.leaflet-app .field-note { margin-top: 7px; color: var(--leaflet-muted); font-size: 13px; font-weight: 400; }
.leaflet-app .choice { position: relative; }
.leaflet-app .choice input { position: absolute; opacity: 0; pointer-events: none; }
.leaflet-app .choice span {
  display: block;
  padding: 10px 14px;
  border: 1px solid var(--leaflet-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  color: #d1d5db;
}
.leaflet-app .choice input:checked + span {
  border-color: var(--leaflet-violet);
  background: rgba(139, 92, 246, .16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .3);
}
.leaflet-app .choice input:focus-visible + span { outline: 3px solid rgba(139, 92, 246, .28); }
.leaflet-app details { border: 1px solid var(--leaflet-line); border-radius: 15px; background: rgba(255, 255, 255, .025); }
.leaflet-app summary { padding: 15px 17px; font-weight: 750; cursor: pointer; }
.leaflet-app .details-body { padding: 0 17px 17px; }
.leaflet-app .primary,
.leaflet-app .secondary,
.leaflet-app .ghost { min-height: 48px; padding: 12px 18px; border-radius: 999px; border: 1px solid transparent; font-weight: 750; transition: .2s ease; }
.leaflet-app .primary { background: linear-gradient(100deg, var(--leaflet-violet), var(--leaflet-pink)); color: #fff; box-shadow: 0 10px 30px rgba(139, 92, 246, .18); }
.leaflet-app .primary:hover { transform: translateY(-1px); box-shadow: 0 14px 36px rgba(139, 92, 246, .32); }
.leaflet-app .secondary { border-color: rgba(167, 139, 250, .55); background: rgba(139, 92, 246, .08); color: #ddd6fe; }
.leaflet-app .ghost { border-color: var(--leaflet-line); background: rgba(255, 255, 255, .05); color: #f3f4f6; }
.leaflet-app .full { width: 100%; }
.leaflet-app .result-head { display: flex; gap: 14px; justify-content: space-between; align-items: start; margin: 30px 0 15px; }
.leaflet-app .status { padding: 6px 10px; border: 1px solid rgba(139, 92, 246, .25); border-radius: 999px; background: rgba(139, 92, 246, .12); color: #ddd6fe; font-size: 13px; font-weight: 750; white-space: nowrap; }
.leaflet-app .offers { display: grid; gap: 12px; }
.leaflet-app .offer {
  width: 100%;
  padding: 19px;
  border: 1px solid var(--leaflet-line);
  border-radius: 17px;
  background: rgba(255, 255, 255, .035);
  color: var(--leaflet-ink);
  text-align: left;
  transition: .2s ease;
}
.leaflet-app .offer:hover { border-color: rgba(167, 139, 250, .5); transform: translateY(-1px); }
.leaflet-app .offer.selected { border: 2px solid var(--leaflet-violet); background: linear-gradient(135deg, rgba(139, 92, 246, .17), rgba(236, 72, 153, .07)); }
.leaflet-app .offer.near { border-color: rgba(251, 191, 36, .36); border-style: dashed; background: rgba(251, 191, 36, .045); }
.leaflet-app .offer-top { display: flex; gap: 12px; justify-content: space-between; align-items: start; }
.leaflet-app .offer-price { color: #fff; font-size: 26px; font-weight: 850; letter-spacing: -.03em; white-space: nowrap; }
.leaflet-app .offer-meta { margin-top: 8px; color: var(--leaflet-muted); font-size: 14px; }
.leaflet-app .offer-note { margin-top: 11px; color: var(--leaflet-violet-light); font-size: 14px; font-weight: 650; }
.leaflet-app .hidden { display: none !important; }
.leaflet-app .summary-list { display: grid; gap: 12px; margin: 19px 0; }
.leaflet-app .summary-row { display: flex; gap: 14px; justify-content: space-between; padding-bottom: 10px; border-bottom: 1px solid var(--leaflet-line); }
.leaflet-app .summary-row span:first-child { color: var(--leaflet-muted); }
.leaflet-app .summary-row strong { text-align: right; }
.leaflet-app .summary-total { margin: 24px 0 17px; }
.leaflet-app .summary-total strong { display: block; margin: 2px 0 4px; font-size: 36px; letter-spacing: -.045em; }
.leaflet-app .summary-empty { padding: 24px 0; color: var(--leaflet-muted); }
.leaflet-app .tier { margin: 14px 0; padding: 13px; border: 1px solid rgba(96, 165, 250, .2); border-radius: 12px; background: rgba(59, 130, 246, .08); color: #bfdbfe; font-size: 14px; }
.leaflet-app .speed-options { display: grid; gap: 9px; margin-top: 12px; }
.leaflet-app .speed-option { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 12px; border: 1px solid var(--leaflet-line); border-radius: 12px; background: rgba(255, 255, 255, .035); }
.leaflet-app .error { padding: 16px; border: 1px solid rgba(248, 113, 113, .28); border-radius: 14px; background: rgba(127, 29, 29, .22); color: var(--leaflet-danger); }

.leaflets-page dialog { position: fixed; inset: 0; width: min(560px, calc(100vw - 28px)); margin: auto; padding: 0; border: 1px solid rgba(255, 255, 255, .13); border-radius: 22px; background: #16161b; color: #fff; box-shadow: 0 35px 110px rgba(0, 0, 0, .65); }
.leaflets-page dialog::backdrop { background: rgba(3, 3, 5, .78); backdrop-filter: blur(8px); }
.leaflets-page .dialog-body { padding: 27px; }
.leaflets-page .dialog-body h2 { margin: 0 0 18px; font-size: 24px; }
.leaflets-page .dialog-body p { margin: 0; }
.leaflets-page .dialog-body .muted { color: var(--leaflet-muted); }
.leaflets-page .diff { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin: 20px 0; }
.leaflets-page .diff-box { padding: 14px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 13px; background: rgba(255, 255, 255, .045); }
.leaflets-page .diff-box small { display: block; margin-bottom: 4px; color: var(--leaflet-muted); }
.leaflets-page .dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.leaflets-page dialog .primary,
.leaflets-page dialog .ghost { min-height: 48px; padding: 12px 18px; border-radius: 999px; font-weight: 750; }
.leaflets-page dialog .primary { border: 1px solid transparent; background: linear-gradient(100deg, var(--leaflet-violet), var(--leaflet-pink)); color: #fff; }
.leaflets-page dialog .ghost { border: 1px solid var(--leaflet-line); background: rgba(255, 255, 255, .05); color: #f3f4f6; }
.leaflets-page .toast { position: fixed; bottom: 22px; left: 50%; z-index: 80; padding: 12px 18px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; background: #24242b; color: #fff; box-shadow: var(--leaflet-shadow); transform: translateX(-50%); }

@media (max-width: 840px) {
  .leaflet-app { padding: 34px 16px 20px; }
  .leaflet-app .calculator-head { align-items: start; flex-direction: column; }
  .leaflet-app .layout { grid-template-columns: 1fr; }
  .leaflet-app .summary { position: static; }
  .leaflet-app .form-panel { padding: 22px; }
}
@media (max-width: 680px) {
  .leaflet-app .grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .leaflet-app { padding-right: 12px; padding-left: 12px; }
  .leaflet-app .offer-top,
  .leaflet-app .result-head { align-items: start; flex-direction: column; }
  .leaflet-app .panel { border-radius: 19px; }
  .leaflet-app .form-panel,
  .leaflet-app .summary { padding: 18px; }
  .leaflets-page .diff { grid-template-columns: 1fr; }
  .leaflets-page .diff > strong { justify-self: center; transform: rotate(90deg); }
  .leaflets-page .dialog-actions { flex-direction: column-reverse; }
  .leaflets-page .dialog-actions button { width: 100%; }
}

/* Leaflet v2 uses the same layout primitives as the existing calculator tabs. */
.leaflet-v2-shell select { color: #fff; }
.leaflet-v2-shell select option { padding: 8px; background: #1a1a2e; color: #fff; }
.leaflet-v2-shell input[type="number"] { color: #fff; }
.leaflet-v2-shell .muted { color: #9ca3af; font-size: 14px; }
.leaflet-v2-shell .checks .check-row { display: flex; gap: 10px; align-items: center; color: #d1d5db; font-size: 14px; cursor: pointer; }
.leaflet-v2-shell .checks input { width: 16px; height: 16px; accent-color: #8b5cf6; }
.leaflet-v2-shell .result-head { display: flex; gap: 16px; justify-content: space-between; align-items: start; }
.leaflet-v2-shell .status { padding: 6px 10px; border: 1px solid rgba(139, 92, 246, .28); border-radius: 999px; background: rgba(139, 92, 246, .12); color: #c4b5fd; font-size: 12px; font-weight: 700; white-space: nowrap; }
.leaflet-v2-shell .offers { display: grid; gap: 12px; }
.leaflet-v2-shell .offer { width: 100%; padding: 16px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; background: rgba(255, 255, 255, .05); color: #fff; text-align: left; transition: .2s ease; }
.leaflet-v2-shell .offer:hover { border-color: rgba(255, 255, 255, .2); }
.leaflet-v2-shell .offer.selected { border: 2px solid #8b5cf6; background: rgba(139, 92, 246, .1); }
.leaflet-v2-shell .offer.near { border-color: rgba(245, 158, 11, .34); border-style: dashed; background: rgba(245, 158, 11, .045); }
.leaflet-v2-shell .offer-top { display: flex; gap: 12px; justify-content: space-between; align-items: start; }
.leaflet-v2-shell .offer h3 { font-size: 17px; font-weight: 700; }
.leaflet-v2-shell .offer-price { color: #fff; font-size: 20px; font-weight: 800; white-space: nowrap; }
.leaflet-v2-shell .offer-meta { margin-top: 6px; color: #9ca3af; font-size: 13px; }
.leaflet-v2-shell .offer-note { margin-top: 8px; color: #c4b5fd; font-size: 13px; font-weight: 600; }
.leaflet-v2-shell .summary-list { display: grid; gap: 0; margin-bottom: 18px; }
.leaflet-v2-shell .summary-row { display: flex; gap: 16px; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); font-size: 14px; }
.leaflet-v2-shell .summary-row span:first-child { color: #9ca3af; }
.leaflet-v2-shell .summary-row strong { color: #fff; text-align: right; }
.leaflet-v2-shell .tier { margin: 14px 0; padding: 12px; border-radius: 12px; background: rgba(139, 92, 246, .1); color: #c4b5fd; font-size: 13px; }
.leaflet-v2-shell .speed-options { display: grid; gap: 8px; margin-top: 12px; }
.leaflet-v2-shell .speed-option { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 12px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px; background: rgba(255, 255, 255, .04); }
.leaflet-v2-shell .secondary { min-height: 42px; padding: 9px 15px; border: 1px solid rgba(139, 92, 246, .6); border-radius: 999px; background: rgba(139, 92, 246, .08); color: #ddd6fe; font-weight: 600; }
.leaflet-v2-shell .error { padding: 16px; border: 1px solid rgba(248, 113, 113, .3); border-radius: 14px; background: rgba(127, 29, 29, .22); color: #fca5a5; }

@media (max-width: 640px) {
  .leaflet-v2-shell .result-head,
  .leaflet-v2-shell .offer-top { flex-direction: column; }
}
