:root {
  --brand: #d3e6d7;
  --brand-ink: #1f4d3a;
  --brand-wash: rgba(211, 230, 215, 0.55);
  --bg: #f6f7fb;
  --panel: rgba(255, 255, 255, 0.92);
  --panel2: rgba(255, 255, 255, 0.98);
  --text: rgba(15, 23, 42, 0.94);
  --muted: rgba(15, 23, 42, 0.62);
  --border: rgba(15, 23, 42, 0.14);
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  --a: var(--brand-ink);
  --danger: #dc2626;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

html[data-theme="dark"] {
  --brand: #2c6b50;
  --brand-ink: #d3e6d7;
  --brand-wash: rgba(44, 107, 80, 0.28);
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.06);
  --panel2: rgba(255, 255, 255, 0.09);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.65);
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  --a: var(--brand-ink);
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

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

.authCurtain {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

body[data-auth="blocked"] .authCurtain {
  display: flex;
}

/* When the Netlify Identity modal is open, hide our curtain so it doesn't block interaction. */
body[data-auth-modal="true"] .authCurtain {
  display: none;
}

.authCurtainCard {
  width: min(520px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  padding: 16px;
}

.authCurtainTitle {
  font-weight: 950;
  font-size: 16px;
}

.authCurtainText {
  margin-top: 6px;
  color: rgba(15, 23, 42, 0.7);
  font-size: 13px;
  line-height: 1.35;
}

.authCurtainActions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Netlify Identity widget must sit above the auth curtain. */
.netlify-identity-widget,
.netlify-identity-modal,
.netlify-identity-overlay {
  z-index: 2000 !important;
}

.scrollAnchor {
  scroll-margin-top: 140px;
}

html:not([data-theme="dark"]) body {
  background: radial-gradient(1100px 700px at 15% 0%, rgba(211, 230, 215, 0.55), transparent 55%),
    radial-gradient(900px 650px at 100% 10%, rgba(211, 230, 215, 0.35), transparent 60%),
    var(--bg);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: rgba(246, 247, 251, 0.72);
  border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .topbar {
  background: rgba(11, 16, 32, 0.75);
}

.topbar {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
}

.brand .title {
  font-weight: 850;
  letter-spacing: 0.2px;
  font-size: 18px;
}

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

.controls {
  display: grid;
  gap: 8px;
}

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

.pillLink {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.hint {
  color: var(--muted);
  font-size: 12px;
}

.pill {
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}

.pill--active {
  border-color: rgba(31, 77, 58, 0.32);
  background: var(--brand-wash);
}

.pill--danger {
  border-color: rgba(239, 68, 68, 0.7);
  background: rgba(239, 68, 68, 0.08);
}

.content {
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.fullSpan {
  grid-column: 1 / -1;
}

.topRow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
}

.topRow > .card {
  height: 100%;
}

@media (min-width: 980px) {
  .grid {
    grid-template-columns: 420px 1fr;
    align-items: start;
  }

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

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

html[data-theme="dark"] .card {
  background: rgba(255, 255, 255, 0.06);
}

.cardTitle {
  font-weight: 800;
  margin: 2px 0 10px;
  font-size: 14px;
  font-family: var(--sans);
}

.formGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 520px) {
  .formGrid {
    grid-template-columns: 1fr 1fr;
  }
}

.field--full {
  grid-column: 1 / -1;
}

.label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.input,
.textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  outline: none;
  font-family: var(--sans);
}

html[data-theme="dark"] .input,
html[data-theme="dark"] .textarea {
  background: rgba(255, 255, 255, 0.07);
}

select.input {
  cursor: pointer;
}

.textarea {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.45;
  resize: vertical;
}

.summary {
  display: grid;
  gap: 10px;
}

.summary .help {
  font-size: 13px;
}

.kpiRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kpi {
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 14px;
  padding: 12px;
}

html[data-theme="dark"] .kpi {
  background: rgba(255, 255, 255, 0.07);
}

.kpiLabel {
  font-size: 13px;
  color: var(--muted);
}

.kpiValue {
  margin-top: 4px;
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 0.2px;
}

.subValue {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.secScoreGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

@media (min-width: 980px) {
  .secScoreGrid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.secScoreCard {
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 16px;
  padding: 12px;
  min-width: 0;
}

.secScoreTop {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.secScoreName {
  font-weight: 950;
  font-size: 13px;
}

.secScoreNum {
  font-weight: 950;
  font-size: 30px;
  letter-spacing: -0.02em;
  color: var(--brand-ink);
  font-family: var(--mono);
  white-space: nowrap;
}

.secScoreMeta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.historyChart {
  margin-top: 10px;
}

.historyActions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.trendBox {
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 14px;
  padding: 10px;
}

.trendHead {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.trendTitle {
  font-weight: 900;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.trendLegend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
}

.trendKey {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.trendSwatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid rgba(15, 23, 42, 0.14);
}

.trendSvg {
  width: 100%;
  height: 180px;
  display: block;
  margin-top: 10px;
}

.trendSvg--grouped {
  height: 260px;
}

.issues {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.summaryNav {
  margin: 6px 0 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.summaryOpts {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

@media (min-width: 720px) {
  .summaryOpts {
    grid-template-columns: 1fr 1fr;
  }
}

.issue {
  border: 1px solid rgba(239, 68, 68, 0.55);
  background: rgba(239, 68, 68, 0.08);
  border-radius: 12px;
  padding: 10px;
  font-size: 12px;
  color: var(--text);
}

.section {
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 10px;
}

html[data-theme="dark"] .section {
  background: rgba(255, 255, 255, 0.07);
}

.sectionHeader {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.section[data-open="false"] .sectionBody {
  display: none;
}

.sectionBody {
  margin-top: 10px;
}

.sectionHeaderActions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.sectionTitle {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.sectionTitle .name {
  font-weight: 900;
}

.badge {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 980px) {
  .row {
    grid-template-columns: 1fr 1fr;
  }
}

.inlineRow {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.checkbox {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.checkbox input {
  accent-color: var(--a);
}

.miniInput {
  width: 92px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  outline: none;
}

.help {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.expStar {
  margin-left: 1px;
  color: var(--text);
  font-weight: 950;
}

.mono {
  font-family: var(--mono);
}

.subTitle {
  margin-top: 12px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 950;
}

.categoryActions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.catChart {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.catGroup {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: var(--panel2);
}

.catGroupSummary {
  cursor: pointer;
}

.catGroupSummaryHint {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 850;
}

.catSub {
  margin-top: 8px;
  padding-left: 12px;
  display: grid;
  gap: 8px;
  border-left: 2px solid rgba(15, 23, 42, 0.08);
}

.catRow {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 10px;
  align-items: center;
}

.catRow--sub .catLabel {
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
}

.catPct--sub {
  color: var(--muted);
  font-weight: 850;
}

.catLabel {
  font-size: 12px;
  color: var(--text);
}

.catMeta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.catPct {
  text-align: right;
  font-weight: 900;
  font-family: var(--mono);
  color: var(--brand-ink);
}

.catBar {
  margin-top: 6px;
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.catBarFill {
  height: 100%;
  width: 0%;
  background: var(--brand-wash);
  border: 1px solid rgba(31, 77, 58, 0.18);
  border-radius: 999px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--border);
  padding: 8px 6px;
  text-align: left;
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-weight: 900;
}

.table tr.ok td {
  background: rgba(22, 163, 74, 0.06);
}

.table tr.bad td {
  background: rgba(220, 38, 38, 0.08);
}

.table tr.omit td {
  background: rgba(217, 119, 6, 0.06);
}

.table tr.ok td:first-child {
  border-left: 4px solid rgba(22, 163, 74, 0.75);
}

.table tr.bad td:first-child {
  border-left: 4px solid rgba(220, 38, 38, 0.8);
}

.table tr.omit td:first-child {
  border-left: 4px solid rgba(217, 119, 6, 0.75);
}

.linkBtn {
  border: 1px solid var(--border);
  background: var(--panel2);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}

.linkBtn--danger {
  border-color: rgba(239, 68, 68, 0.7);
  background: rgba(239, 68, 68, 0.08);
}

.rowActions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gridEditor {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .gridEditor {
  background: rgba(255, 255, 255, 0.05);
}

.gridEditor[data-active="true"] {
  border-color: rgba(31, 77, 58, 0.45);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.gridEditorHeader {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.gridEditorTitle {
  font-weight: 900;
  font-size: 12px;
}

.gridEditorHint {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

.answerGrid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

@media (min-width: 980px) {
  .answerGrid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }
}

.qBtn {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 7px 6px;
  background: var(--panel2);
  cursor: pointer;
  min-height: 44px;
  display: grid;
  gap: 2px;
  justify-items: center;
}

html[data-theme="dark"] .qBtn {
  background: rgba(255, 255, 255, 0.07);
}

.qNum {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--mono);
}

.qAns {
  font-size: 13px;
  font-weight: 900;
  font-family: var(--mono);
}

.qBtn--active {
  border-color: rgba(31, 77, 58, 0.45);
  background: var(--brand-wash);
}

.qBtn--filled .qAns {
  color: var(--a);
}
.sumSection {
  margin-top: 14px;
  border: 1px solid var(--border);
  background: var(--panel2);
  border-radius: 16px;
  padding: 12px;
}

.sumSectionHead {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.sumSectionTitle {
  font-weight: 950;
  font-size: 18px;
}

.sumSectionMeta {
  color: var(--muted);
  font-size: 12px;
}

.twoCol {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 980px) {
  .twoCol {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
  }
}

.fold {
  margin-top: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  overflow: hidden;
}

html[data-theme="dark"] .fold {
  background: rgba(255, 255, 255, 0.05);
}

.foldSummary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 900;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr minmax(160px, auto) 16px;
  gap: 10px;
  align-items: baseline;
}

.foldSummary::-webkit-details-marker {
  display: none;
}

.foldSummary::after {
  content: "▸";
  color: var(--muted);
  font-weight: 950;
  justify-self: end;
}

.fold[open] > .foldSummary::after {
  content: "▾";
}

.foldMeta {
  font-weight: 800;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  justify-self: end;
}

.foldBody {
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}
