:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #65717f;
  --line: #d9e0e6;
  --panel: #ffffff;
  --soft: #f4f7f8;
  --accent: #0f766e;
  --accent-2: #b45309;
  --danger: #b42318;
  --ok: #157f3b;
  --shadow: 0 18px 44px rgba(28, 38, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(244, 247, 248, 0.92), rgba(232, 237, 239, 0.9)),
    url("data:image/svg+xml,%3Csvg width='900' height='520' viewBox='0 0 900 520' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='900' height='520' fill='%23eef3f2'/%3E%3Cg fill='none' stroke='%2384a9a4' stroke-width='2' opacity='.4'%3E%3Cpath d='M80 120h210v88H80zM360 76h260v110H360zM650 250h170v98H650zM210 310h260v110H210z'/%3E%3Cpath d='M290 164h70M490 186v124M470 365h180M210 365H112V208'/%3E%3C/g%3E%3Cg fill='%230f766e' opacity='.38'%3E%3Ccircle cx='80' cy='120' r='8'/%3E%3Ccircle cx='360' cy='76' r='8'/%3E%3Ccircle cx='650' cy='250' r='8'/%3E%3Ccircle cx='470' cy='365' r='8'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 0 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.1;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.source-pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.input-panel {
  padding: 20px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.stacked-label {
  margin-top: 14px;
}

.url-row {
  display: grid;
  grid-template-columns: 1fr 84px;
  gap: 8px;
}

input,
button {
  height: 42px;
  border: 1px solid var(--line);
  font: inherit;
}

input {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  background: #fff;
}

button {
  cursor: pointer;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.preset-grid {
  display: grid;
  gap: 8px;
  margin: 14px 0 22px;
}

.preset-grid button,
.tab,
.copy-row button {
  background: var(--soft);
  color: var(--ink);
}

.brief {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

ol {
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.7;
}

.results-panel {
  min-height: 680px;
  padding: 20px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 630px;
  text-align: center;
  color: var(--muted);
}

.empty-state h2 {
  max-width: 620px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.35;
}

.signal-map {
  position: relative;
  width: 250px;
  height: 160px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, #f7fbfa, #e6efed);
}

.signal-map span {
  position: absolute;
  width: 18px;
  height: 18px;
  background: var(--accent);
}

.signal-map span:nth-child(1) { left: 28px; top: 32px; }
.signal-map span:nth-child(2) { left: 118px; top: 70px; }
.signal-map span:nth-child(3) { right: 36px; top: 28px; }
.signal-map span:nth-child(4) { left: 58px; bottom: 28px; }
.signal-map span:nth-child(5) { right: 62px; bottom: 36px; }

.hidden {
  display: none;
}

.loading {
  padding: 28px;
  color: var(--muted);
}

.bar {
  height: 8px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), #eab308, var(--accent));
  background-size: 220% 100%;
  animation: scan 1.2s infinite linear;
}

@keyframes scan {
  to { background-position: -220% 0; }
}

.score-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.score-card {
  border: 1px solid var(--line);
  background: var(--soft);
  padding: 14px;
  min-height: 96px;
}

.score-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.score-card strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin: 18px 0;
  overflow-x: auto;
}

.tab {
  min-width: 84px;
  border-bottom: 0;
}

.tab.active {
  background: var(--accent);
  color: #fff;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.summary,
.issue,
.blueprint-block,
.evidence-item {
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
  margin-bottom: 10px;
}

.summary {
  border-left: 5px solid var(--accent);
}

.issue {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
}

.priority {
  align-self: start;
  padding: 6px 8px;
  text-align: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.high { background: var(--danger); }
.medium { background: var(--accent-2); }
.low { background: var(--ok); }

.issue h3,
.blueprint-block h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.issue p,
.blueprint-block p,
.evidence-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.blueprint-block p + p {
  margin-top: 6px;
}

.copy-row {
  display: flex;
  justify-content: end;
  margin-bottom: 8px;
}

pre {
  margin: 0;
  max-height: 540px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #101820;
  color: #d9f7ef;
  padding: 16px;
  font-size: 13px;
  line-height: 1.55;
}

iframe {
  width: 100%;
  min-height: 540px;
  border: 1px solid var(--line);
  background: #fff;
}

@media (max-width: 900px) {
  .shell {
    width: min(100vw - 20px, 680px);
    padding: 18px 0;
  }

  .topbar,
  .workspace {
    display: block;
  }

  .source-pill {
    margin-top: 12px;
  }

  .input-panel {
    margin-bottom: 14px;
  }

  h1 {
    font-size: 30px;
  }

  .score-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .issue {
    grid-template-columns: 1fr;
  }
}
