:root {
  --bg: #f3f6f5;
  --card: #ffffff;
  --card-soft: #f8fbf9;
  --line: #dde5e1;
  --text: #1f2b2f;
  --muted: #68777d;
  --accent: #009845;
  --accent-2: #1fa96a;
  --accent-soft: #ddf4e5;
  --warn: #cf8b0d;
  --danger: #d65749;
  --shadow: 0 8px 28px rgba(0, 0, 0, .08);
  --radius: 14px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 5vw, 56px);
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

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

.brand-logo {
  width: 190px;
  height: 58px;
  object-fit: contain;
  object-position: left center;
}

.brand-logo.logo-error {
  display: none;
}

.brand-title {
  font-size: 18px;
  font-weight: 900;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.top-actions,
.export-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.demo-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 56px;
}

.notice {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent-soft) 70%, #fff);
  color: var(--text);
}

.notice span,
.muted,
.scenario-note,
.upload-note,
.quota-card p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 16px;
}

.two-columns {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.section-title {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
p {
  margin: 0;
}

h1 {
  margin-top: 4px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
}

label {
  display: block;
  margin-top: 14px;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
  color: var(--text);
  padding: 12px;
  font: inherit;
}

textarea {
  min-height: 280px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.45;
}

.scenario-note,
.upload-note {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
}

.upload-note {
  color: var(--accent);
  font-weight: 800;
}

.counter-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-soft);
}

.switch-row strong,
.switch-row span {
  display: block;
}

.switch-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.switch {
  position: relative;
  width: 48px;
  height: 30px;
  flex: 0 0 auto;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  cursor: pointer;
}

.switch::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .18);
  transition: left .2s ease;
}

.switch.off {
  background: color-mix(in srgb, var(--muted) 32%, transparent);
}

.switch.off::before {
  left: 4px;
}

.quota-card {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-soft) 60%, #fff);
}

.quota-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.quota-value {
  margin-top: 5px;
  color: var(--accent);
  font-size: 22px;
  font-weight: 900;
}

.btn {
  min-height: 42px;
  border-radius: 11px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  margin-top: 16px;
  border: none;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 24%, transparent);
}

.btn-secondary {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
}

.btn.compact {
  min-height: 36px;
  padding: 8px 11px;
  font-size: 12px;
}

.message {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger) 10%, #fff);
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.message.show {
  display: block;
}

.results {
  margin-top: 18px;
}

.hidden {
  display: none;
}

.executive {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.score-circle {
  width: 126px;
  height: 126px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0 100%, color-mix(in srgb, var(--muted) 18%, transparent) 100% 100%);
}

.score-inner {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--card);
  font-size: 32px;
  font-weight: 900;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.kpi {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.kpi strong,
.kpi span {
  display: block;
}

.kpi strong {
  color: var(--accent);
  font-size: 28px;
}

.kpi span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.mini-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
  line-height: 1.5;
}

.findings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.filters label {
  margin: 0;
}

.findings-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.finding {
  padding: 15px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 12px;
  background: var(--card-soft);
}

.finding.sev-critical {
  border-left-color: #9f1239;
}

.finding.sev-high {
  border-left-color: var(--danger);
}

.finding.sev-medium {
  border-left-color: var(--warn);
}

.finding.sev-low {
  border-left-color: var(--accent);
}

.finding-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.finding-title {
  font-weight: 900;
  line-height: 1.35;
}

.finding-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.badge {
  white-space: nowrap;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.finding p {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--card-soft);
}

@media (max-width: 900px) {
  .two-columns,
  .score-grid,
  .findings-list {
    grid-template-columns: 1fr;
  }

  .topbar,
  .executive,
  .findings-header {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    align-items: stretch;
  }

  .top-actions .btn,
  .top-actions .demo-pill {
    width: 100%;
    justify-content: center;
  }

  .brand-logo {
    width: 168px;
    height: 52px;
  }

  .score-circle {
    width: 104px;
    height: 104px;
  }

  .score-inner {
    width: 76px;
    height: 76px;
  }
}
