:root {
  color-scheme: dark;
  --bg: #100d16;
  --panel: #191421;
  --panel-2: #211a2b;
  --line: #382b49;
  --text: #ffffff;
  --muted: #a99bb9;
  --accent: #a879e8;
  --accent-2: #c6a5ff;
  --warning: #f5c76b;
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 80% 0%, rgba(168,121,232,.16), transparent 34rem), var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select { font: inherit; }
.app-shell { max-width: 980px; margin: 0 auto; padding: 0 20px env(safe-area-inset-bottom); }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(145,160,178,.14); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #ffffff; color: #7138b8; font-weight: 950; font-size: 22px; }
.brand strong { display: block; font-size: 14px; letter-spacing: .16em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; letter-spacing: .25em; }
.build-tag, .section-note { color: var(--muted); font-size: 10px; letter-spacing: .16em; font-weight: 800; }
.hero { padding: 54px 0 28px; max-width: 680px; }
.eyebrow { display: flex; align-items: center; gap: 9px; color: #c6a5ff; font-size: 10px; font-weight: 850; letter-spacing: .2em; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: #a879e8; box-shadow: 0 0 14px #a879e8; }
h1 { margin: 17px 0 12px; font-size: clamp(42px, 8vw, 72px); line-height: .98; letter-spacing: -.065em; }
h1 span { color: var(--accent); }
.hero p { max-width: 540px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.prototype-warning { padding: 15px 17px; margin: 0 0 22px; border: 1px solid rgba(245,199,107,.34); border-radius: 14px; background: rgba(245,199,107,.07); color: #d7c59e; font-size: 12px; line-height: 1.55; }
.prototype-warning strong { display: block; color: var(--warning); margin-bottom: 3px; }
.panel { padding: 23px; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(23,33,45,.94), rgba(16,23,32,.96)); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section-heading > div { display: flex; align-items: center; gap: 12px; }
.step { color: var(--accent); font-size: 11px; font-weight: 900; letter-spacing: .08em; }
h2 { margin: 0; font-size: 19px; letter-spacing: -.025em; }
.field-grid, .version-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.version-grid { margin-top: 15px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: #dbe4ee; font-size: 12px; font-weight: 750; }
.field small { color: var(--muted); font-size: 10px; font-weight: 450; line-height: 1.4; }
input, select { width: 100%; min-height: 45px; border: 1px solid #463653; border-radius: 11px; background: #120e19; color: var(--text); padding: 0 12px; outline: none; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(168,121,232,.14); }
input:disabled, select:disabled { opacity: .5; cursor: not-allowed; }
.hint { margin: -7px 0 15px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.version-hint { margin: 12px 0 0; }
.filter-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.filter-row { display: grid; grid-template-columns: minmax(0,1fr) 66px 104px; align-items: center; gap: 7px; min-height: 64px; padding: 8px 9px; border: 1px solid #443451; border-radius: 12px; background: rgba(168,121,232,.045); }
.filter-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 11px; font-weight: 650; }
.filter-name input { width: 17px; height: 17px; min-height: 0; accent-color: var(--accent); flex: 0 0 auto; }
.filter-name span { overflow-wrap: anywhere; }
.filter-setting { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: #bca9d1; font-size: 8px; font-weight: 750; }
.count-input, .distance-input { min-height: 34px; padding: 0 6px; border-radius: 8px; font-size: 11px; text-align: right; }
.count-input:disabled, .distance-input:disabled { opacity: .35; }
.disabled-feature { display: flex; align-items: center; gap: 9px; padding: 14px; border: 1px dashed #344354; border-radius: 11px; color: #8392a4; font-size: 11px; line-height: 1.5; }
.disabled-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #718094; }
.search-panel { border-color: rgba(168,121,232,.34); }
.search-summary { color: var(--muted); font-size: 12px; margin: -5px 0 15px; }
.progress-track { height: 9px; background: #273342; border-radius: 20px; overflow: hidden; }
#progressBar { width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7138b8, #c6a5ff); transition: width .15s linear; }
.progress-meta { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.button-row { display: flex; gap: 10px; margin-top: 20px; }
.primary-button, .secondary-button { min-height: 48px; padding: 0 18px; border-radius: 12px; font-weight: 850; font-size: 12px; border: 0; cursor: pointer; }
.primary-button { flex: 1; background: #ffffff; color: #7138b8; }
.primary-button span { float: right; font-size: 18px; line-height: 12px; }
.primary-button:disabled, .secondary-button:disabled { opacity: .45; cursor: not-allowed; }
.secondary-button { min-width: 88px; background: #30263d; color: var(--text); }
.status { min-height: 18px; margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.results-section { padding: 28px 0 12px; }
.text-button { padding: 8px 0 8px 10px; background: transparent; color: var(--accent); font-size: 11px; font-weight: 800; border: 0; cursor: pointer; }
.text-button:disabled { opacity: .35; cursor: not-allowed; }
.results-list { display: grid; gap: 11px; }
.empty-state { min-height: 155px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px dashed #354353; border-radius: var(--radius); color: var(--muted); text-align: center; padding: 20px; }
.empty-icon { font-size: 27px; color: var(--accent); }
.empty-state strong { color: var(--text); font-size: 13px; }
.empty-state span { font-size: 11px; }
.result-card { border: 1px solid var(--line); border-radius: 15px; background: var(--panel); padding: 15px; }
.result-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.result-seed { font-size: 17px; font-weight: 900; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.result-sub { margin-top: 4px; color: var(--muted); font-size: 10px; }
.candidate-label { color: var(--warning); border: 1px solid rgba(245,199,107,.3); background: rgba(245,199,107,.07); border-radius: 20px; padding: 5px 8px; font-size: 9px; font-weight: 850; white-space: nowrap; }
.result-details { display: grid; gap: 7px; margin-top: 13px; }
.structure-result-group { padding: 9px 0 2px; border-top: 1px solid #34283f; }
.structure-result-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.structure-result-heading strong { color: #e9ddf8; font-size: 11px; }
.structure-result-heading span { color: #c6a5ff; font-size: 9px; text-align: right; }
.candidate-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-top: 1px solid #263342; padding: 7px 0 0; margin-top: 6px; }
.candidate-name { color: #dbe4ee; font-size: 11px; font-weight: 700; }
.candidate-meta { color: var(--muted); font-size: 10px; text-align: right; font-variant-numeric: tabular-nums; }
.result-actions { display: flex; justify-content: flex-end; margin-top: 11px; }
.copy-button { background: transparent; color: var(--accent); font-size: 10px; font-weight: 800; padding: 5px 0 2px 10px; border: 0; cursor: pointer; }
footer { display: flex; justify-content: space-between; gap: 12px; padding: 28px 0 32px; margin-top: 22px; border-top: 1px solid rgba(145,160,178,.14); color: #718094; font-size: 10px; }
.footer-brand { color: #ffffff; font-weight: 900; letter-spacing: .14em; }
@media (max-width: 620px) {
  .app-shell { padding-left: 14px; padding-right: 14px; }
  .hero { padding-top: 39px; }
  .panel { padding: 17px; border-radius: 15px; }
  .field-grid, .version-grid, .filter-list { grid-template-columns: 1fr; }
  .filter-row { grid-template-columns: minmax(0,1fr) 64px 100px; }
  .section-note { font-size: 8px; }
  footer { flex-direction: column; }
}

.powered-by { margin-left: 4px; color: #d7c3f5; font-size: 9px; letter-spacing: .13em; }
.brand small { color: #c6a5ff; }
.climate-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin: 13px 0 15px; }
.climate-chip { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid #443451; border-radius: 11px; background: rgba(168,121,232,.07); }
.climate-chip span { color: #c6a5ff; font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.climate-chip strong { color: #f4effa; font-size: 11px; }
.footer-brand em { color: #c6a5ff; font-style: normal; }
@media (max-width: 620px) { .climate-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .powered-by { display: block; margin: 5px 0 0; } }


/* v0.4 Climate Lab */
.climate-lab-panel { border-color: rgba(168,121,232,.34); }
.climate-input-grid { margin-top: 14px; }
.climate-action-row { display: flex; align-items: center; gap: 13px; margin-top: 16px; flex-wrap: wrap; }
.climate-button { flex: 0 0 auto; min-width: 190px; }
.climate-edition-note { color: #c6a5ff; font-size: 10px; font-weight: 750; line-height: 1.5; }
.climate-output { margin-top: 16px; }
.climate-empty, .climate-error { border: 1px dashed #514064; border-radius: 12px; padding: 16px; color: var(--muted); font-size: 11px; }
.climate-error { border-color: rgba(245,125,125,.45); color: #ffb6b6; }
.climate-result-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.climate-result-heading strong { color: #fff; font-size: 12px; }
.climate-result-heading span { color: var(--muted); font-size: 10px; text-align: right; }
.climate-value-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.climate-value-card { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid #443451; border-radius: 11px; background: rgba(168,121,232,.07); }
.climate-value-card span { color: #d7c3f5; font-size: 10px; font-weight: 750; }
.climate-value-card strong { color: #fff; font-size: 16px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.climate-value-card small { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.climate-caveat { margin-top: 13px; }
@media (max-width: 620px) {
  .climate-value-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .climate-result-heading { align-items: flex-start; flex-direction: column; }
  .climate-result-heading span { text-align: left; }
  .climate-button { width: 100%; }
}

.version-hint { border-left: 3px solid var(--purple, #7138B8); padding-left: 12px; }

/* v0.9 biome parameter import */
.biome-data-tools { margin-top: 18px; padding: 15px; border: 1px solid rgba(168,121,232,.28); border-radius: 13px; background: rgba(113,56,184,.07); }
.biome-data-tools .field input[type="file"] { width: 100%; margin-top: 8px; color: var(--muted); font-size: 11px; }
.biome-match-result { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding: 14px; border: 1px solid rgba(168,121,232,.45); border-radius: 12px; background: rgba(113,56,184,.12); color: #fff; font-size: 12px; overflow-wrap: anywhere; }
.biome-match-result span, .biome-match-result small { color: var(--muted); line-height: 1.5; }


/* v1.0 bounded parameter-space scan */
.biome-scan-tools { margin-top: 18px; padding: 15px; border: 1px solid rgba(168,121,232,.34); border-radius: 13px; background: rgba(113,56,184,.055); }
.scan-heading { margin-bottom: 8px; }
.scan-heading h3 { margin: 0; color: #fff; font-size: 14px; }
.scan-hit-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; margin-top: 12px; }
.scan-hit { display: flex; flex-direction: column; gap: 4px; padding: 9px; border: 1px solid rgba(168,121,232,.22); border-radius: 9px; background: rgba(0,0,0,.12); }
.scan-hit strong { color: #fff; font-size: 11px; font-variant-numeric: tabular-nums; }
.scan-hit small { color: var(--muted); font-size: 9px; }
@media (max-width: 620px) { .scan-hit-list { grid-template-columns: 1fr; } }
