:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --ink: #18212f;
  --muted: #5c6675;
  --line: #d8e0e5;
  --teal: #0f766e;
  --teal-strong: #115e59;
  --amber: #b45309;
  --rose: #be123c;
  --indigo: #3646a5;
  --shadow: 0 18px 44px rgba(24, 33, 47, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px clamp(18px, 4vw, 48px) 16px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: var(--ink);
  color: #f7fbfc;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 36px);
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.header-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 8px 11px;
  color: var(--muted);
  font-size: 13px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 clamp(18px, 4vw, 48px) 18px;
}

.tab,
.secondary-button,
.primary-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  cursor: pointer;
}

.tab {
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  font-weight: 700;
}

.tab.is-active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

main {
  padding: 0 clamp(18px, 4vw, 48px) 48px;
}

.workspace {
  display: none;
}

.workspace.is-active {
  display: block;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(340px, 1.15fr);
  gap: 16px;
  align-items: start;
}

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="number"],
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfc6b8;
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 10px 12px;
  color: var(--ink);
}

input:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 2px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin: 0 0 9px;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.primary-button {
  width: 100%;
  border-color: var(--teal);
  background: var(--teal);
  color: white;
  font-weight: 800;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.secondary-button {
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 800;
}

.microcopy,
.empty-state span,
.muted {
  color: var(--muted);
}

.microcopy {
  margin: 12px 0 0;
  font-size: 13px;
}

.empty-state {
  display: grid;
  gap: 6px;
  min-height: 116px;
  place-content: center;
  border: 1px dashed #cfc6b8;
  border-radius: 8px;
  background: #f8fafb;
  text-align: center;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.score-tile {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 14px;
}

.offer-panel {
  margin-bottom: 16px;
}

.offer-grid,
.checklist-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.offer-grid article,
.checklist-grid article,
.notice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 15px;
}

.offer-grid article {
  display: grid;
  gap: 8px;
  min-height: 172px;
}

.offer-grid article > span,
.checklist-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.offer-grid strong {
  font-size: 22px;
}

.offer-link {
  align-self: end;
  color: var(--teal-strong);
  font-weight: 800;
  text-decoration: none;
}

.offer-link.is-disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.delivery-consent {
  margin-top: 12px;
}

.notice {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  background: #eefaf7;
}

.notice span {
  color: var(--muted);
}

.score-tile span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.score-tile strong {
  font-size: 30px;
}

.issue-list,
.action-list {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.issue-list li,
.action-list li,
.timeline article,
.budget-grid article,
.pod-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 14px;
}

.impact {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  color: white;
  background: var(--indigo);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.impact.critical {
  background: var(--rose);
}

.impact.serious {
  background: var(--amber);
}

.impact.moderate {
  background: var(--indigo);
}

.questionnaire {
  margin-top: 16px;
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
}

fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 16px;
}

legend {
  padding: 0 7px;
  color: var(--teal-strong);
  font-weight: 800;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.action-row .primary-button,
.action-row .secondary-button {
  width: auto;
  min-width: 150px;
}

.report-summary {
  display: grid;
  gap: 16px;
}

.module-grid,
.budget-grid,
.pod-board,
.input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.module-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 16px;
}

.status-pill {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: #e7f8f4;
  color: var(--teal-strong);
  font-weight: 800;
  font-size: 12px;
}

.status-pill.unclear {
  background: #fff1d6;
  color: #92400e;
}

.status-pill.likely_in_scope {
  background: #ffe4e6;
  color: #9f1239;
}

.status-pill.error {
  background: #ffe4e6;
  color: #9f1239;
}

.status-pill.running {
  background: #eef2ff;
  color: #3730a3;
}

.status-pill.pending,
.status-pill.drafted {
  background: #fff1d6;
  color: #92400e;
}

.status-pill.ok,
.status-pill.sent {
  background: #e7f8f4;
  color: var(--teal-strong);
}

.budget-grid article {
  display: grid;
  gap: 8px;
}

meter {
  width: 100%;
  height: 14px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.timeline article {
  display: grid;
  gap: 5px;
}

.pod-card strong,
.timeline strong {
  color: var(--ink);
}

.pod-card span,
.timeline span,
.monitor-card span,
.outbox-card span {
  color: var(--muted);
}

.monitor-list,
.outbox-list,
.run-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.monitor-card,
.outbox-card,
.run-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  padding: 14px;
}

.monitor-card header,
.outbox-card header,
.run-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.monitor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
  font-weight: 800;
  cursor: pointer;
}

.mini-button.danger {
  color: var(--rose);
}

.automation-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.loading {
  position: relative;
}

.loading::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: white;
  vertical-align: -3px;
  animation: spin 0.8s linear infinite;
}

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

@media (max-width: 980px) {
  .app-header,
  .split-layout,
  .question-grid,
  .module-grid,
  .budget-grid,
  .pod-board,
  .input-grid,
  .timeline,
  .offer-grid,
  .checklist-grid,
  .automation-kpis {
    grid-template-columns: 1fr;
  }

  .app-header {
    display: grid;
  }

  .header-meta {
    justify-content: flex-start;
  }

  .score-strip {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }
}

@media (max-width: 560px) {
  .score-strip {
    grid-template-columns: 1fr;
  }

  .panel-head {
    display: grid;
  }

  .action-row .primary-button,
  .action-row .secondary-button {
    width: 100%;
  }
}
