/* Two Lots explainer. Tokens inherit from the page (--paper, --ink, ...) when defined,
   otherwise fall back to the site defaults below. Never use --rule for text. */
.two-lots {
  --tl-paper: var(--paper, #eef2f1);
  --tl-surface: var(--surface, #ffffff);
  --tl-ink: var(--ink, #14222a);
  --tl-muted: var(--muted, #4b5b62);
  --tl-rule: var(--rule, #c3cfcd);
  --tl-accent: var(--accent, #0e6655);
  --tl-less: var(--less, #1f5fa8);
  --tl-more: var(--more, #a8510a);
  --tl-head: var(--font-head, "Archivo", "Bahnschrift", "Segoe UI", system-ui, sans-serif);
  --tl-body: var(--font-body, "Spectral", Georgia, "Times New Roman", serif);
}
@media (prefers-color-scheme: dark) {
  .two-lots {
    --tl-paper: var(--paper, #0f171b);
    --tl-surface: var(--surface, #16232a);
    --tl-ink: var(--ink, #e6eeee);
    --tl-muted: var(--muted, #a5b6bb);
    --tl-rule: var(--rule, #2c3d44);
    --tl-accent: var(--accent, #4fc1a6);
    --tl-less: var(--less, #7fb2ea);
    --tl-more: var(--more, #f0a35a);
  }
}
/* explicit theme hooks (page sets data-theme on <html> or on the mount element) */
[data-theme="dark"] .two-lots, .two-lots[data-theme="dark"] {
  --tl-paper: var(--paper, #0f171b);
  --tl-surface: var(--surface, #16232a);
  --tl-ink: var(--ink, #e6eeee);
  --tl-muted: var(--muted, #a5b6bb);
  --tl-rule: var(--rule, #2c3d44);
  --tl-accent: var(--accent, #4fc1a6);
  --tl-less: var(--less, #7fb2ea);
  --tl-more: var(--more, #f0a35a);
}
[data-theme="light"] .two-lots, .two-lots[data-theme="light"] {
  --tl-paper: var(--paper, #eef2f1);
  --tl-surface: var(--surface, #ffffff);
  --tl-ink: var(--ink, #14222a);
  --tl-muted: var(--muted, #4b5b62);
  --tl-rule: var(--rule, #c3cfcd);
  --tl-accent: var(--accent, #0e6655);
  --tl-less: var(--less, #1f5fa8);
  --tl-more: var(--more, #a8510a);
}

.two-lots {
  box-sizing: border-box;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(12px, 3vw, 28px);
  background: var(--tl-surface);
  color: var(--tl-ink);
  border: 1px solid var(--tl-rule);
  border-radius: 10px;
  font-family: var(--tl-body);
  font-size: 1rem;
  line-height: 1.45;
}
.two-lots *, .two-lots *::before, .two-lots *::after { box-sizing: border-box; }
.two-lots p { margin: 0; }

.tl-head { margin-bottom: 12px; }
.tl-kicker {
  font-family: var(--tl-head);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tl-muted);
}
.tl-title {
  margin: 2px 0 0;
  font-family: var(--tl-head);
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(1.35rem, 3.4vw, 2rem);
  line-height: 1.15;
  color: var(--tl-ink);
}

.tl-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(12px, 2.5vw, 28px);
  align-items: start;
  min-height: 300px;
}
.tl-platwrap {
  background: var(--tl-paper);
  border-radius: 8px;
  padding: 8px;
}
.tl-plat { display: block; width: 100%; height: auto; }
.tl-tags { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 6px 4px 2px; }
.tl-tag { font-size: 0.85rem; color: var(--tl-ink); line-height: 1.3; }

/* illustration (no text inside the SVG) */
.tl-ground { fill: var(--tl-paper); }
.tl-street { fill: var(--tl-muted); fill-opacity: 0.18; }
.tl-street-line { stroke: var(--tl-muted); stroke-width: 2; stroke-dasharray: 16 12; opacity: 0.7; }
.tl-curb { stroke: var(--tl-muted); stroke-width: 2; }
.tl-lot { fill: var(--tl-surface); stroke: var(--tl-ink); stroke-width: 1.5; stroke-dasharray: 7 5; }
.tl-asphalt { fill: var(--tl-muted); fill-opacity: 0.26; }
.tl-stalls line { stroke: var(--tl-surface); stroke-width: 2.5; }
.tl-car { fill: var(--tl-muted); fill-opacity: 0.8; }
.tl-lane { stroke: var(--tl-surface); stroke-width: 2.5; stroke-dasharray: 12 10; }
.tl-review { fill: none; stroke: var(--tl-accent); stroke-width: 5; stroke-dasharray: 14 8; }
.tl-footprint { fill: var(--tl-ink); fill-opacity: 0.14; }
.tl-face-side { fill: var(--tl-accent); fill-opacity: 0.55; }
.tl-face-front { fill: var(--tl-accent); fill-opacity: 0.3; stroke: var(--tl-accent); stroke-width: 1.2; }
.tl-floorline { stroke: var(--tl-accent); stroke-width: 1.2; }
.tl-window { fill: var(--tl-surface); fill-opacity: 0.85; }
.tl-shop { fill: var(--tl-more); fill-opacity: 0.85; }
.tl-roof { fill: var(--tl-accent); fill-opacity: 0.4; stroke: var(--tl-accent); stroke-width: 2; }
.tl-rooftop { fill: var(--tl-surface); fill-opacity: 0.6; stroke: var(--tl-accent); stroke-width: 1; }
.tl-unitline { stroke: var(--tl-surface); stroke-width: 3; }
.tl-tree { fill: var(--tl-accent); fill-opacity: 0.28; stroke: var(--tl-accent); stroke-width: 1.5; }
.tl-ridge { stroke: var(--tl-accent); stroke-width: 2.5; }
.tl-path { fill: var(--tl-muted); fill-opacity: 0.3; }
.tl-bld, .tl-review { transition: opacity 0.2s linear; }

/* panel */
.tl-panel { min-width: 0; }
.tl-bars-head {
  font-family: var(--tl-head);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--tl-ink);
}
.tl-row { margin-bottom: 12px; }
.tl-row-label { font-family: var(--tl-head); font-size: 0.95rem; font-weight: 600; color: var(--tl-ink); }
.tl-row-line { display: grid; grid-template-columns: minmax(0, 1fr) 6.4em; align-items: center; gap: 8px; margin-top: 4px; }
.tl-row-line.tl-has-sub { grid-template-columns: 3.6em minmax(0, 1fr) 6.4em; }
.tl-sub { font-size: 0.85rem; color: var(--tl-muted); }
.tl-track {
  height: 22px;
  display: flex;
  gap: 2px;
  background: var(--tl-paper);
  border-radius: 3px;
  overflow: hidden;
}
.tl-seg { display: block; height: 100%; flex: 0 0 auto; }
.tl-seg-land { background: var(--tl-accent); }
.tl-seg-bldg { background: var(--tl-muted); }
.tl-seg-today { background: var(--tl-muted); }
.tl-seg-more { background: var(--tl-more); }
.tl-seg-less { background: var(--tl-less); }
.tl-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--tl-ink); }
.tl-delta { font-size: 0.9rem; font-weight: 700; white-space: nowrap; }
.tl-more { color: var(--tl-more); }
.tl-less { color: var(--tl-less); }
.tl-emph .tl-seg-bldg { outline: 3px solid var(--tl-ink); outline-offset: -3px; }
.tl-legend { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--tl-muted); margin-bottom: 10px; }
.tl-key { display: inline-block; width: 14px; height: 14px; border-radius: 2px; }
.tl-key-land { background: var(--tl-accent); }
.tl-key-bldg { background: var(--tl-muted); margin-left: 8px; }
.tl-slider { margin: 6px 0 10px; }
.tl-slider label { display: block; font-family: var(--tl-head); font-size: 0.9rem; font-weight: 600; color: var(--tl-ink); }
.tl-slider input { width: 100%; accent-color: var(--tl-accent); margin: 6px 0 2px; }
.tl-slider-out { font-size: 0.9rem; color: var(--tl-ink); }
.tl-totals {
  font-size: 0.95rem;
  color: var(--tl-ink);
  background: var(--tl-paper);
  border-left: 4px solid var(--tl-accent);
  padding: 8px 10px;
  border-radius: 4px;
}
.tl-punch {
  margin-top: 8px;
  font-family: var(--tl-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--tl-ink);
  background: var(--tl-paper);
  border-left: 4px solid var(--tl-accent);
  padding: 8px 10px;
  border-radius: 4px;
}
.tl-next ol { margin: 0; padding-left: 1.4em; }
.tl-next li { margin-bottom: 12px; color: var(--tl-ink); font-size: 1.02rem; }
.tl-next strong { font-family: var(--tl-head); }

/* end card: inverted (ink background, surface text) in both themes */
.tl-end {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--tl-ink);
  color: var(--tl-surface);
  border-radius: 8px;
  padding: 24px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.tl-end.tl-on { display: flex; }
.tl-end-title { font-family: var(--tl-head); font-stretch: 112%; font-weight: 700; font-size: clamp(1.6rem, 4.5vw, 2.8rem); color: var(--tl-surface); }
.tl-end-line { font-size: clamp(1rem, 2.4vw, 1.3rem); color: var(--tl-surface); }
.tl-reduced[data-scene="5"] .tl-end { display: flex; position: static; grid-column: 1 / -1; padding: 16px; }

.tl-caption {
  margin-top: 14px !important;
  min-height: 3.1em;
  font-size: clamp(1.05rem, 2.3vw, 1.3rem);
  line-height: 1.4;
  color: var(--tl-ink);
  background: var(--tl-paper);
  padding: 10px 12px;
  border-radius: 6px;
}
.tl-note { margin-top: 8px !important; font-size: 0.82rem; color: var(--tl-muted); }

/* controls */
.tl-controls, .tl-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tl-btn, .tl-step {
  font: inherit;
  font-family: var(--tl-head);
  font-size: 0.92rem;
  font-weight: 600;
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 2px solid var(--tl-muted);
  background: var(--tl-surface);
  color: var(--tl-ink);
  cursor: pointer;
}
.tl-btn:hover, .tl-step:hover { background: var(--tl-paper); color: var(--tl-ink); }
.tl-btn-primary { background: var(--tl-accent); border-color: var(--tl-accent); color: var(--tl-surface); min-width: 6.5em; }
.tl-btn-primary:hover { background: var(--tl-ink); border-color: var(--tl-ink); color: var(--tl-surface); }
.tl-btn[aria-disabled="true"], .tl-btn[aria-disabled="true"]:hover {
  background: var(--tl-surface);
  color: var(--tl-muted);
  border-style: dashed;
  cursor: not-allowed;
}
.tl-step { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; }
.tl-step-n { font-variant-numeric: tabular-nums; }
.tl-step[aria-current="step"] { background: var(--tl-accent); border-color: var(--tl-accent); color: var(--tl-surface); }
.tl-step[aria-current="step"]:hover { background: var(--tl-ink); border-color: var(--tl-ink); color: var(--tl-surface); }
.tl-btn:focus-visible, .tl-step:focus-visible, .tl-slider input:focus-visible {
  outline: 3px solid var(--tl-accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--tl-surface);
}
.tl-progress { margin-top: 10px; height: 4px; background: var(--tl-paper); border-radius: 2px; overflow: hidden; }
.tl-progress span { display: block; height: 100%; width: 0; background: var(--tl-accent); }

/* reduced motion: static step-through */
.tl-reduced .tl-btn-primary, .tl-reduced .tl-progress { display: none; }
@media (prefers-reduced-motion: reduce) {
  .tl-bld, .tl-review { transition: none; }
}

/* narrow screens */
@media (max-width: 680px) {
  .tl-stage { grid-template-columns: minmax(0, 1fr); }
  .tl-step-t { display: none; }
  .tl-step { min-width: 44px; justify-content: center; }
  .tl-tag { font-size: 0.8rem; }
}
