:root {
  --surface: #f6f8f7;
  --surface-strong: #ffffff;
  --ink: #17211f;
  --muted: #66736e;
  --line: #d9e2de;
  --line-strong: #aab8b2;
  --teal: #10756b;
  --teal-strong: #0a5d55;
  --coral: #cf553d;
  --amber: #c58a1b;
  --green: #2d7c48;
  --red: #b6483a;
  --shadow: 0 18px 50px rgba(23, 33, 31, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  background: var(--surface);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
}

button,
input,
select {
  font: inherit;
}

button,
a.link-button {
  align-items: center;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  min-height: 40px;
  padding: 9px 13px;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

button:hover,
a.link-button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

input,
select {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

label {
  color: var(--muted);
  display: grid;
  font-size: 0.8rem;
  font-weight: 800;
  gap: 7px;
  letter-spacing: 0;
  text-transform: uppercase;
}

pre {
  background: #101816;
  border-radius: 8px;
  color: #edf7f4;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  margin: 0;
  overflow: auto;
  padding: 18px;
  white-space: pre-wrap;
}

.app-shell {
  margin: 0 auto;
  max-width: 1440px;
  padding: 24px;
}

.topbar {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.topbar h1,
.section-heading h2 {
  letter-spacing: 0;
  margin: 0;
}

.topbar h1 {
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.95;
  max-width: 760px;
}

.section-heading h2 {
  font-size: 1.15rem;
}

.eyebrow {
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin: 0 0 7px;
  text-transform: uppercase;
}

.header-actions,
.button-row,
.status-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-button {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.primary-button:hover {
  background: var(--teal-strong);
}

.metric-strip {
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  overflow: hidden;
}

.metric-strip div {
  background: rgba(255, 255, 255, 0.06);
  min-height: 132px;
  padding: 18px;
}

.metric-strip span {
  color: #a9c7be;
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.metric-strip strong {
  color: #fff;
  display: block;
  font-size: 2rem;
  letter-spacing: 0;
  line-height: 1;
}

.metric-strip p {
  color: #d6e3df;
  margin: 12px 0 0;
}

.workspace-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.7fr);
  margin-bottom: 18px;
}

.tool-panel,
.side-panel,
.output-panel,
.pipeline-panel {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.section-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-heading.compact {
  margin-bottom: 12px;
}

.score-badge {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 116px;
  padding: 10px 12px;
  text-align: right;
}

.score-badge span,
.score-badge strong {
  display: block;
}

.score-badge span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.score-badge strong {
  font-size: 1.45rem;
}

.score-high {
  border-color: rgba(182, 72, 58, 0.42);
  color: var(--red);
}

.score-medium {
  border-color: rgba(197, 138, 27, 0.42);
  color: var(--amber);
}

.score-low {
  border-color: rgba(45, 124, 72, 0.42);
  color: var(--green);
}

.field-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

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

.issue-tile {
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 132px;
  padding: 14px;
  text-align: left;
}

.issue-tile.active {
  background: #eaf6f3;
  border-color: rgba(16, 117, 107, 0.45);
}

.checkbox-mark {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--teal);
  display: inline-flex;
  flex: 0 0 20px;
  font-size: 0.72rem;
  font-weight: 900;
  height: 20px;
  justify-content: center;
  line-height: 1;
  margin-top: 1px;
  width: 20px;
}

.issue-tile strong {
  display: block;
  font-size: 0.94rem;
  line-height: 1.25;
}

.issue-tile small {
  color: var(--muted);
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 8px;
  text-transform: none;
}

.run-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.run-list li {
  border-left: 3px solid var(--teal);
  display: grid;
  gap: 5px;
  padding: 5px 0 5px 12px;
}

.run-list strong {
  font-size: 0.94rem;
}

.run-list span,
.dm-box p,
.legal-strip span,
.empty-state,
.prospect-card span,
.prospect-card small,
.prospect-card p {
  color: var(--muted);
}

.settings-block {
  display: grid;
  gap: 12px;
}

.output-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.dm-box {
  background: #fff8ea;
  border: 1px solid rgba(197, 138, 27, 0.32);
  border-radius: 8px;
  margin-top: 12px;
  padding: 14px;
}

.dm-box strong {
  color: var(--amber);
  display: block;
  margin-bottom: 6px;
}

.dm-box p {
  margin: 0;
}

.pipeline-panel {
  margin-bottom: 18px;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 18px;
}

.prospect-list {
  display: grid;
  gap: 10px;
}

.prospect-card {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
}

.prospect-card strong,
.prospect-card span,
.prospect-card small {
  display: block;
}

.prospect-card p {
  margin: 7px 0 0;
}

.status-buttons button {
  min-height: 34px;
  padding: 7px 10px;
}

.status-buttons .active-status {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.legal-strip {
  align-items: center;
  background: #fbece8;
  border: 1px solid rgba(207, 85, 61, 0.28);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  padding: 14px 16px;
}

.legal-strip strong {
  color: var(--coral);
}

.toast {
  background: var(--ink);
  border-radius: 8px;
  bottom: 20px;
  color: #fff;
  font-weight: 800;
  padding: 12px 14px;
  position: fixed;
  right: 20px;
}

@media (max-width: 1180px) {
  .field-grid,
  .issue-grid,
  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-grid,
  .output-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .section-heading,
  .legal-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .prospect-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .header-actions,
  .button-row,
  .status-buttons {
    display: grid;
    grid-template-columns: 1fr;
  }

  .field-grid,
  .issue-grid,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .metric-strip div {
    min-height: auto;
  }

  .topbar h1 {
    font-size: 2.35rem;
  }
}

@media print {
  .topbar,
  .metric-strip,
  .tool-panel,
  .side-panel,
  .pipeline-panel,
  .legal-strip,
  .toast,
  .button-row {
    display: none !important;
  }

  .app-shell,
  .output-panel {
    box-shadow: none;
    padding: 0;
  }

  .output-grid {
    display: block;
  }

  pre {
    background: #fff;
    color: #111;
  }
}
