:root {
  --ui-font: "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --display-font: "Montserrat", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --ink: #223044;
  --muted: #55657f;
  --accent: #295bb9;
  --accent-strong: #183e84;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.93);
  --surface-soft: rgba(246, 249, 255, 0.88);
  --glass-border: rgba(82, 112, 180, 0.18);
  --shadow: 0 18px 48px rgba(28, 58, 112, 0.12);
  --radius: 20px;
  --line: rgba(41, 91, 185, 0.14);
  --warn: #9a6818;
  --danger: #b04c4c;
  --ok: #257458;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--ui-font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 16%, rgba(214, 227, 255, 0.7) 0%, transparent 34%),
    radial-gradient(circle at 88% 14%, rgba(255, 238, 221, 0.54) 0%, transparent 30%),
    linear-gradient(180deg, #f6f8fc 0%, #eef3fb 100%);
  overflow-x: hidden;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.62), transparent 22%),
    radial-gradient(circle at 82% 16%, rgba(255, 255, 255, 0.3), transparent 18%);
  opacity: 0.62;
  z-index: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  border-radius: 22px;
}

.brand-button {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.brand-title {
  font-family: var(--display-font);
  color: var(--accent);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

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

#app {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 80px;
}

.status {
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(28, 58, 112, 0.08);
  font-size: 15px;
}

.status:empty {
  display: none;
}

.status.ok {
  border-color: rgba(46, 139, 105, 0.28);
  color: var(--ok);
}

.status.error {
  border-color: rgba(196, 81, 81, 0.28);
  color: var(--danger);
}

.status.warn {
  border-color: rgba(184, 122, 25, 0.28);
  color: var(--warn);
}

.footer-nav {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: -36px auto 48px;
  padding: 18px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(28, 58, 112, 0.08);
}

.footer-nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}

.footer-nav a:hover {
  text-decoration: underline;
}

.footer-copy {
  width: 100%;
  padding-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.panel,
.result-box,
pre,
.card-tile,
.summary-modal {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.panel {
  position: relative;
  padding: 30px;
}

.panel + .panel {
  margin-top: 18px;
}

.research-banner {
  margin-bottom: 18px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(41, 91, 185, 0.08);
  border: 1px solid rgba(41, 91, 185, 0.14);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  font-weight: 400;
}

.legal-page {
  max-width: 920px;
  margin: 0 auto;
}

.legal-page h1 {
  font-family: var(--display-font);
  color: var(--accent);
  font-size: 34px;
  line-height: 1.1;
  margin-bottom: 18px;
  font-weight: 800;
}

.legal-page h2 {
  margin-top: 28px;
}

.panel h2,
.panel h3,
details summary,
.card-tile h3,
.result-box strong {
  color: var(--accent);
}

.panel h2 {
  font-family: var(--display-font);
  font-size: 30px;
  line-height: 1.1;
  margin-bottom: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.panel h3 {
  font-family: var(--display-font);
  font-size: 20px;
  line-height: 1.2;
  margin: 0 0 10px;
  font-weight: 700;
}

.section-intro {
  max-width: 760px;
  margin-bottom: 18px;
}

.section-intro p:last-child {
  margin-bottom: 0;
}

.panel p,
.panel li,
.result-box,
.field small,
pre {
  color: var(--ink);
  line-height: 1.65;
}

.panel p + p,
.result-box p + p {
  margin-top: 10px;
}

small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.home-hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 220px);
  padding: 48px 20px;
  text-align: center;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 8% 10%;
  border-radius: 28px;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.4) 38%,
    rgba(255, 255, 255, 0.1) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 220% 220%;
  filter: blur(18px);
  opacity: 0.7;
  animation: shimmer 12s ease-in-out infinite;
}

.home-hero h1,
.home-hero p {
  position: relative;
  z-index: 1;
}

.home-hero h1 {
  font-family: var(--display-font);
  margin-bottom: 16px;
  font-size: clamp(44px, 8vw, 92px);
  line-height: 0.94;
  letter-spacing: -0.05em;
  color: var(--accent);
  font-weight: 800;
}

.home-hero p {
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(19px, 2.3vw, 28px);
  line-height: 1.38;
  font-weight: 500;
}

.home-hero-actions {
  position: relative;
  z-index: 1;
  margin-top: 28px;
}

.hero-cta {
  min-width: 280px;
  padding: 15px 30px;
  font-size: 16px;
  letter-spacing: 0.08em;
}

.home-hero-note {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin-top: 28px;
  padding: 22px 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(82, 112, 180, 0.16);
  box-shadow: 0 16px 34px rgba(28, 58, 112, 0.08);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.72;
}

.home-consent-panel {
  max-width: 1040px;
  margin: 0 auto 48px;
  display: grid;
  gap: 8px;
}

.consent-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 16;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 118px 24px 32px;
  background: rgba(33, 43, 58, 0.24);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.consent-modal-panel {
  width: min(1040px, 100%);
  max-height: calc(100vh - 150px);
  margin: 0;
  overflow: auto;
  padding: 20px 24px 22px;
  scrollbar-gutter: stable;
}

.consent-modal-panel h2 {
  margin-bottom: 4px;
}

.consent-modal-panel p {
  font-size: 15px;
  line-height: 1.45;
}

.consent-group {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.consent-choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(41, 91, 185, 0.12);
}

.consent-choice input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.consent-choice span {
  color: var(--ink);
  line-height: 1.35;
}

.consent-choice-static {
  opacity: 0.92;
}

.consent-long {
  margin-top: 6px;
}

.consent-long:last-of-type {
  margin-bottom: 8px;
}

.consent-divider {
  height: 1px;
  margin: 6px 0 2px;
  background: linear-gradient(90deg, rgba(62, 103, 200, 0), rgba(62, 103, 200, 0.35), rgba(62, 103, 200, 0));
}

.cookie-tab-home {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 15;
  display: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(62, 103, 200, 0.2);
  color: var(--accent);
  box-shadow: 0 16px 38px rgba(62, 103, 200, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cookie-tab-home.is-visible {
  display: inline-flex;
}

.grid-2,
.grid-3,
.card-grid {
  display: grid;
  gap: 18px;
}

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

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

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.controls-subsection + .controls-subsection {
  margin-top: 22px;
}

.controls-subsection h4 {
  font-family: var(--display-font);
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 17px;
  line-height: 1.25;
}

.controls-subsection p {
  margin-bottom: 12px;
  max-width: 60ch;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  font-family: var(--display-font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--accent-strong);
  line-height: 1.35;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(41, 91, 185, 0.18);
  border-radius: 14px;
  padding: 13px 15px;
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-size: 16px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(41, 91, 185, 0.42);
  box-shadow: 0 0 0 4px rgba(41, 91, 185, 0.1);
  background: #fff;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.multi-options {
  border: 1px solid rgba(41, 91, 185, 0.14);
  border-radius: 16px;
  padding: 10px;
  background: var(--surface-soft);
  max-height: 260px;
  overflow: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.45;
  transition: background 0.2s ease;
}

.choice:hover {
  background: rgba(41, 91, 185, 0.08);
}

.choice input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

button {
  border: 1px solid rgba(41, 91, 185, 0.16);
  border-radius: 999px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--accent);
  cursor: pointer;
  font-family: var(--display-font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(28, 58, 112, 0.14);
}

button.primary {
  background: linear-gradient(120deg, #295bb9, #4b78cf);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
  box-shadow: 0 16px 38px rgba(41, 91, 185, 0.22);
}

button.ghost {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.92), rgba(242, 246, 255, 0.96));
}

button.warn {
  color: var(--warn);
  border-color: rgba(184, 122, 25, 0.25);
}

button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.card-tile {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px;
}

.card-tile-head {
  display: grid;
  gap: 6px;
}

.card-tile-code {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-tile h3 {
  font-size: 20px;
  line-height: 1.28;
  font-weight: 700;
}

.card-status-row,
.dashboard-progress-meta,
.tile-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  color: var(--muted);
}

.card-status-row,
.tile-meta {
  font-size: 14px;
}

.tile-meta {
  margin-top: -2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--display-font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(41, 91, 185, 0.1);
  color: #2a4f94;
}

.badge.accept {
  background: rgba(46, 139, 105, 0.14);
  color: #257458;
}

.badge.mitigate {
  background: rgba(184, 122, 25, 0.14);
  color: #9a6617;
}

.badge.escalate {
  background: rgba(196, 81, 81, 0.14);
  color: #a53d3d;
}

.badge.not-started {
  background: rgba(41, 91, 185, 0.1);
  color: #42537b;
}

.progress {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(41, 91, 185, 0.1);
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #295bb9, #8aa7e7);
  box-shadow: 0 0 18px rgba(41, 91, 185, 0.22);
}

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

.dashboard-panel {
  display: grid;
  gap: 18px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(41, 91, 185, 0.12);
}

.stat-pill strong,
.dashboard-progress-meta strong {
  font-family: var(--display-font);
  font-size: 20px;
  line-height: 1;
  color: var(--accent-strong);
}

.dashboard-progress-meta {
  justify-content: space-between;
  margin-top: 2px;
}

.dashboard-progress-meta p {
  margin: 0;
}

.card-view-panel {
  display: grid;
  gap: 24px;
}

.card-header {
  display: grid;
  gap: 18px;
}

.why-this-matters {
  margin-bottom: 26px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(41, 91, 185, 0.07);
  border: 1px solid rgba(41, 91, 185, 0.12);
}

.why-this-matters h3 {
  margin-bottom: 8px;
}

.card-status-inline {
  color: var(--muted);
  font-size: 15px;
}

.card-goal {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink);
}

.card-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.card-detail-main {
  display: grid;
  gap: 18px;
}

.content-section {
  padding: 22px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid rgba(41, 91, 185, 0.1);
}

.card-sticky-summary {
  position: sticky;
  top: 110px;
  background: var(--surface-strong);
}

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

.summary-card {
  min-height: 100%;
}

.summary-card-wide {
  grid-column: 1 / -1;
}

.result-box {
  padding: 20px;
}

.result-box ul,
.panel ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

pre {
  margin: 0;
  padding: 16px 18px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
  line-height: 1.65;
  background: rgba(244, 248, 255, 0.92);
}

details {
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(41, 91, 185, 0.12);
}

details summary {
  cursor: pointer;
  font-family: var(--display-font);
  font-weight: 700;
}

details p {
  margin-top: 10px;
}

.summary-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(33, 43, 58, 0.22);
  backdrop-filter: blur(8px);
}

.summary-modal {
  width: min(520px, 100%);
  padding: 28px;
  text-align: center;
  background: var(--surface-strong);
}

.summary-modal h3 {
  font-family: var(--display-font);
  margin-bottom: 10px;
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
}

.summary-modal p {
  color: var(--ink);
}

@media (max-width: 840px) {
  .footer-nav {
    margin-top: -24px;
  }
}

.summary-modal-spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto 16px;
  border: 4px solid rgba(41, 91, 185, 0.14);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: summary-spin 0.9s linear infinite;
}

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

@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 40%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@media (max-width: 980px) {
  .grid-2,
  .grid-3,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-stats,
  .summary-grid,
  .card-detail-layout {
    grid-template-columns: 1fr;
  }

  .card-sticky-summary {
    position: static;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .topbar,
  #app,
  .status,
  .footer-nav {
    width: min(100% - 20px, 1120px);
  }

  .topbar {
    padding: 16px;
    border-radius: 20px;
  }

  .panel,
  .card-tile,
  .summary-modal {
    padding: 20px;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
    justify-content: center;
  }

  .home-hero {
    min-height: calc(100vh - 190px);
    padding: 20px 6px;
  }

  .home-hero-note {
    font-size: 17px;
  }

  .consent-modal-backdrop {
    padding: 12px;
    align-items: flex-start;
    padding-top: 92px;
  }

  .consent-modal-panel {
    width: min(100%, 820px);
    max-height: calc(100vh - 108px);
    padding: 16px 16px 18px;
  }

  .cookie-tab-home {
    left: 10px;
    right: 10px;
    bottom: 10px;
    justify-content: center;
  }
}
