/* ── LEP Brand Design System ──────────────────────────────────────────────── */

:root {
  --navy:       #1A3A5C;
  --blue:       #0FA3D1;
  --blue-dark:  #0d8ab5;
  --white:      #ffffff;
  --gray-50:    #f4f7fb;
  --gray-100:   #e8eef5;
  --gray-300:   #c0cdd8;
  --gray-500:   #7a8fa3;
  --text:       #1e2d3d;
  --text-muted: #5a6e80;
  --error:      #dc2626;
  --error-bg:   #fef2f2;
  --success:    #16a34a;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow:     0 2px 12px rgba(26,58,92,0.08);
  --shadow-md:  0 4px 24px rgba(26,58,92,0.12);
  --font:       'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ────────────────────────────────────────────────────────────────── */

.site-header {
  background: var(--navy);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.site-header img.logo {
  height: 40px;
  width: auto;
}

.site-header .header-title {
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ── Main content ───────────────────────────────────────────────────────────── */

.content {
  flex: 1;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

/* ── Page title ─────────────────────────────────────────────────────────────── */

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */

.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin-bottom: 16px;
}

/* ── Form elements ──────────────────────────────────────────────────────────── */

.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(15,163,209,0.12);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--blue);
  height: 6px;
  cursor: pointer;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ── Tab toggle (postcode / coords) ─────────────────────────────────────────── */

.tab-toggle {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 16px;
  width: fit-content;
}

.tab-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab-btn.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ── Direction radio ────────────────────────────────────────────────────────── */

.direction-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.direction-option {
  position: relative;
}

.direction-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
}

.direction-option label {
  display: block;
  text-align: center;
  padding: 7px 4px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  margin: 0;
}

.direction-option input[type="radio"]:checked + label {
  border-color: var(--blue);
  background: rgba(15,163,209,0.08);
  color: var(--blue-dark);
}

/* ── Turbine badge ──────────────────────────────────────────────────────────── */

.turbine-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 20px;
}

.turbine-badge .badge-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.turbine-badge .badge-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
}

/* ── Slider with value display ──────────────────────────────────────────────── */

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-row input[type="range"] { flex: 1; }

.slider-value {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navy);
  min-width: 48px;
  text-align: right;
}

/* ── Primary button ─────────────────────────────────────────────────────────── */

.btn-primary {
  width: 100%;
  padding: 12px 24px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}

.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Loading state ──────────────────────────────────────────────────────────── */

.htmx-indicator {
  display: none;
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.htmx-request .htmx-indicator { display: block; }

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--gray-100);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Results section ────────────────────────────────────────────────────────── */

.results-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-top: 8px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.results-header {
  margin-bottom: 20px;
}

.results-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 2px;
}

.results-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Metric cards ───────────────────────────────────────────────────────────── */

.metrics-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid var(--gray-100);
}

.metric-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
}

.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 3px;
}

.metric-card.full-width {
  grid-column: 1 / -1;
}

/* ── Chart ──────────────────────────────────────────────────────────────────── */

.chart-container {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

/* ── Monthly breakdown ──────────────────────────────────────────────────────── */

details { margin-top: 12px; }

summary {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-dark);
  cursor: pointer;
  padding: 8px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

summary::-webkit-details-marker { display: none; }
summary::before { content: "▶"; font-size: 0.65rem; transition: transform 0.15s; }
details[open] summary::before { transform: rotate(90deg); }

.monthly-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.85rem;
}

.monthly-table th {
  background: var(--gray-50);
  color: var(--text-muted);
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}

.monthly-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text);
}

.monthly-table tr:last-child td {
  font-weight: 700;
  color: var(--navy);
  background: var(--gray-50);
}

/* ── Disclaimer ─────────────────────────────────────────────────────────────── */

.disclaimer {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 16px;
  line-height: 1.5;
}

/* ── Error / info alerts ────────────────────────────────────────────────────── */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-error {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(220,38,38,0.2);
}

.alert-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid rgba(29,78,216,0.15);
}

/* ── Footer ─────────────────────────────────────────────────────────────────── */

.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.55);
  text-align: center;
  font-size: 0.75rem;
  padding: 14px 24px;
  letter-spacing: 0.02em;
}

.site-footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
}

.site-footer a:hover { color: var(--white); }

/* ── Designer: wider content, selects, multi-metric grids, tables ───────────── */

body.designer .content,
.content.designer { max-width: 860px; }

select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  cursor: pointer;
}

select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(15,163,209,0.12);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
  cursor: pointer;
  flex: none;
}

.checkbox-row label {
  margin-bottom: 0;
  font-weight: 500;
  cursor: pointer;
}

.array-block {
  border-top: 1px solid var(--gray-100);
  padding-top: 14px;
  margin-top: 6px;
}

.array-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.month-grid .form-group { margin-bottom: 0; }
.month-grid label { font-size: 0.72rem; font-weight: 500; color: var(--text-muted); }
.month-grid input { padding: 6px 8px; font-size: 0.8rem; }

.gate-box { border: 1.5px solid rgba(15,163,209,0.25); }

/* Variable-width metric grids */
.metrics-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}
.metrics-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.metrics-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

.results-title.small {
  font-size: 0.95rem;
  margin: 18px 0 10px;
}

.section-divider {
  border: none;
  border-top: 1px solid var(--gray-100);
  margin: 22px 0;
}

.alert-success {
  background: #f0fdf4;
  color: var(--success);
  border: 1px solid rgba(22,163,74,0.2);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin: 12px 0;
}

/* Wide scrollable data tables */
.table-scroll {
  overflow-x: auto;
  margin: 8px 0;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
}

.data-table {
  border-collapse: collapse;
  font-size: 0.78rem;
  white-space: nowrap;
  min-width: 100%;
}

.data-table th {
  background: var(--gray-50);
  color: var(--text-muted);
  font-weight: 600;
  padding: 7px 10px;
  text-align: right;
  border-bottom: 1px solid var(--gray-100);
}

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
  position: sticky;
  left: 0;
  background: var(--white);
  font-weight: 600;
}

.data-table th:first-child { background: var(--gray-50); }

.data-table td {
  padding: 6px 10px;
  text-align: right;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text);
}

/* ── Calculate button kept at the top of the designer form ──────────────────── */
.btn-calculate-top {
  margin-bottom: 18px;
}

/* ── Results placeholder (shown before the first calculation) ───────────────── */
.results-placeholder {
  cursor: pointer;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  background: var(--white);
  padding: 28px 24px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.results-placeholder:hover,
.results-placeholder:focus-visible {
  border-color: var(--blue);
  background: rgba(15, 163, 209, 0.04);
  outline: none;
}

.placeholder-chart {
  width: 100%;
  max-width: 300px;
  height: auto;
  margin: 0 auto 16px;
  display: block;
}

.placeholder-chart rect {
  fill: var(--gray-100);
  transition: fill 0.15s;
}

.results-placeholder:hover .placeholder-chart rect,
.results-placeholder:focus-visible .placeholder-chart rect {
  fill: #d7e6f3;
}

.placeholder-cta-btn {
  display: inline-block;
  background: var(--blue);
  color: var(--white);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 9px 20px;
  border-radius: var(--radius);
  transition: background 0.15s;
}

.results-placeholder:hover .placeholder-cta-btn,
.results-placeholder:focus-visible .placeholder-cta-btn {
  background: var(--blue-dark);
}

.placeholder-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 12px;
  line-height: 1.5;
}

/* ── Embed mode (inside the website iframe) ─────────────────────────────────── */
/* When loaded with ?embed=1 the app drops its own header/footer and grey page
   background so it blends cleanly into the host page instead of looking like a
   boxed-in mini-site with duplicate logo and footer. */

body.embed {
  background: transparent;
  /* Collapse to content height so the page can report its true size to the
     embedding iframe (the default min-height:100vh would inflate it to the
     iframe's own height and defeat auto-resizing). */
  min-height: 0;
}

body.embed .site-header,
body.embed .site-footer {
  display: none;
}

body.embed .content {
  padding: 8px 4px 16px;
  max-width: 900px;
}

/* The host page already shows a big hero heading, so soften the in-app title. */
body.embed .page-title {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

body.embed .page-subtitle {
  margin-bottom: 18px;
}

/* Cards get a touch more lift so they read as the focal content on a white page. */
body.embed .card {
  box-shadow: var(--shadow-md);
}

/* ── Find-a-wind-turbine selector ───────────────────────────────────────────── */

/* Progress / breadcrumb */
.finder-progress {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.8rem;
}

.finder-step-num {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: var(--blue);
  background: rgba(15,163,209,0.1);
  padding: 3px 9px;
  border-radius: 20px;
  flex: none;
}

.finder-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.finder-crumb {
  border: none;
  background: var(--gray-100);
  color: var(--text-muted);
  padding: 3px 10px;
  border-radius: 20px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.finder-crumb:hover { background: var(--gray-300); color: var(--text); }

.finder-crumb-sep { color: var(--gray-300); font-weight: 700; }

.finder-restart {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--blue-dark);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  padding: 3px 4px;
}
.finder-restart:hover { text-decoration: underline; }

/* Question card */
.finder-question { padding: 24px; }

.finder-q-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.35;
}

.finder-q-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.finder-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.finder-option {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 15px 18px;
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: var(--font);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.finder-option:hover {
  border-color: var(--blue);
  background: rgba(15,163,209,0.05);
}
.finder-option:active { transform: scale(0.99); }

.finder-option-label {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}

.finder-option-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.finder-option-arrow {
  margin-left: auto;
  color: var(--blue);
  font-weight: 700;
  font-size: 1.1rem;
  flex: none;
}

/* Result card */
.finder-result {
  padding: 24px;
  border-top: 4px solid var(--blue);
}

.finder-result-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--success);
}

.finder-result-name {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1.1;
  margin-top: 4px;
}

.finder-result-tagline {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
}

.finder-why {
  font-size: 0.9rem;
  color: var(--text);
  margin-top: 14px;
  line-height: 1.55;
}

.finder-bestfor {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.finder-tag {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--blue-dark);
  background: rgba(15,163,209,0.1);
  padding: 4px 10px;
  border-radius: 20px;
}

.finder-specs {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
  font-size: 0.88rem;
}

.finder-specs th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
  width: 38%;
}

.finder-specs td {
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text);
  font-weight: 600;
}

.finder-product-link {
  display: inline-block;
  width: auto;
  margin-top: 20px;
  text-decoration: none;
  text-align: center;
}

/* Compare chips */
.finder-compare { margin-top: 20px; }

.finder-compare-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.finder-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.finder-chip {
  border: 1.5px solid var(--gray-300);
  background: var(--white);
  color: var(--navy);
  padding: 8px 16px;
  border-radius: 20px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.finder-chip:hover { border-color: var(--blue); background: rgba(15,163,209,0.06); }

.finder-restart-btn {
  display: block;
  margin-top: 16px;
  border: none;
  background: transparent;
  color: var(--blue-dark);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
}
.finder-restart-btn:hover { text-decoration: underline; }

/* ── Designer: two-column layout + live system preview ──────────────────────── */

/* Give the sizing tool room for two columns on larger screens. Placed after the
   embed rules so it wins for the (wider) designer page in or out of an iframe. */
body.designer .content { max-width: 1180px; }

.designer-layout { display: block; }

/* The "Your system" preview card. */
.system-preview {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.system-preview-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin-bottom: 12px;
}

.preview-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}
.preview-row + .preview-row { border-top: 1px solid var(--gray-100); }

.preview-icons {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px;
  min-height: 52px;
  flex: 1;
  min-width: 0;
}

.preview-icon {
  height: 50px;
  width: auto;
  max-width: 50px;
  object-fit: contain;
  transform-origin: bottom center;
  animation: iconPopIn 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Solar panels read better a touch smaller and denser. */
.preview-icons-panels { min-height: 40px; }
.preview-icons-panels .preview-icon { height: 34px; max-width: 34px; }

.preview-icon.leaving { animation: iconPopOut 0.28s ease forwards; }

.preview-overflow {
  align-self: center;
  background: var(--gray-100);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  animation: iconPopIn 0.3s ease both;
}

.preview-count {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  flex: none;
  text-align: right;
  min-width: 92px;
}
.preview-count span { color: var(--navy); font-weight: 800; }

@keyframes iconPopIn {
  from { opacity: 0; transform: translateY(8px) scale(0.6); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes iconPopOut {
  from { opacity: 1; transform: translateY(0)   scale(1); }
  to   { opacity: 0; transform: translateY(6px) scale(0.5); }
}

/* Desktop: inputs left (narrower, scroll), results/preview right (wider, sticky). */
@media (min-width: 900px) {
  .designer-layout {
    display: grid;
    grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }
  .designer-output {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }
}

/* ── Finder: product photo beside the recommendation ────────────────────────── */

.finder-result { display: block; }

.finder-result-img {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  margin: 4px auto 0;
  animation: finderImgIn 0.4s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes finderImgIn {
  from { opacity: 0; transform: translateY(10px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

@media (min-width: 680px) {
  .finder-result {
    display: flex;
    gap: 24px;
    align-items: flex-start;
  }
  .finder-result-main { flex: 1; min-width: 0; }
  .finder-result-aside { flex: none; width: 200px; padding-top: 8px; }
  .finder-result-img { margin-top: 0; }
}

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 520px) {
  .content { padding: 18px 14px 32px; }
  .grid-2 { grid-template-columns: 1fr; }
  .metrics-row { grid-template-columns: 1fr; }
  .metrics-grid.cols-3, .metrics-grid.cols-5 { grid-template-columns: 1fr 1fr; }
  .month-grid { grid-template-columns: repeat(3, 1fr); }
  .direction-grid { grid-template-columns: repeat(2, 1fr); }
  .page-title { font-size: 1.3rem; }
}
