/* ============================================================
   LawParVilla — Design System
   Matching inloop.studio: Instrument Serif + Inter + Fira Code
   Primary: Aztec Purple #7147FF
   ============================================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
  /* Colors — Aztec Purple palette */
  --purple:         #7147FF;
  --purple-dark:    #5A35D9;
  --purple-darker:  #3D1FA6;
  --purple-light:   #B1B1FF;
  --purple-faint:   #F5F5FF;
  --purple-glow:    rgba(113, 71, 255, 0.12);

  /* Neutrals — matching inloop.studio */
  --ink-900:        #030012;
  --ink-800:        #1a1a2e;
  --ink-700:        #2d2d44;
  --graphite:       #505967;
  --slate:          #9197A0;
  --sand-200:       #EBEBFF;
  --cloud-50:       #FAFAFB;
  --white:          #FFFFFF;

  /* Semantic */
  --correct:        #22c55e;
  --correct-bg:     #f0fdf4;
  --incorrect:      #ef4444;
  --incorrect-bg:   #fef2f2;
  --warning:        #f59e0b;
  --gold:           #d4a017;
  --gold-light:     #fef3c7;

  /* Typography */
  --font-serif:     "Instrument Serif", Georgia, serif;
  --font-sans:      "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:      "Fira Code", "Consolas", monospace;

  /* Spacing */
  --space-xs:       4px;
  --space-sm:       8px;
  --space-md:       16px;
  --space-lg:       24px;
  --space-xl:       32px;
  --space-2xl:      48px;
  --space-3xl:      64px;
  --space-4xl:      96px;

  /* Radii */
  --radius:         10px;
  --radius-lg:      16px;
  --radius-full:    9999px;

  /* Shadows */
  --shadow-sm:      0 1px 3px rgba(3, 0, 18, 0.06);
  --shadow-md:      0 4px 12px rgba(3, 0, 18, 0.08);
  --shadow-lg:      0 8px 32px rgba(3, 0, 18, 0.12);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--ink-900);
  background: var(--cloud-50);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--purple);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--purple-dark);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink-900);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.125rem; font-family: var(--font-sans); font-weight: 600; }

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}
.container--narrow {
  max-width: 800px;
}

/* --- Kicker (monospace tag) --- */
.kicker {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--purple);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
}
.kicker--light {
  color: var(--purple-light);
}

/* Honor the HTML `hidden` attribute even on elements with display overrides. */
[hidden] { display: none !important; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 12px 24px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1.4;
}
.btn--primary {
  background: var(--purple);
  color: var(--white);
}
.btn--primary:hover {
  background: var(--purple-dark);
  color: var(--white);
}
.btn--ghost {
  background: transparent;
  color: var(--purple);
  border: 2px solid var(--purple);
}
.btn--ghost:hover {
  background: var(--purple-glow);
}
.btn--white {
  background: var(--white);
  color: var(--purple);
}
.btn--white:hover {
  background: var(--sand-200);
  color: var(--purple-dark);
}
.btn--small {
  padding: 8px 16px;
  font-size: 0.8125rem;
}
.btn--large {
  padding: 16px 32px;
  font-size: 1.0625rem;
}
.btn--full {
  width: 100%;
}

/* --- Navigation --- */
.nav {
  padding: var(--space-md) 0;
  position: relative;
  z-index: 10;
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__brand {
  text-decoration: none;
}
.nav__logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--ink-900);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}
.nav__links a {
  font-size: 0.9375rem;
  color: var(--graphite);
  font-weight: 500;
}
.nav__links a:hover {
  color: var(--purple);
}
.nav--game .nav__logo {
  color: var(--purple);
}
.nav__player {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.875rem;
}
.nav__ckp {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--purple);
  background: var(--purple-faint);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}
.nav__name {
  color: var(--graphite);
}
.nav__exit {
  color: var(--slate);
  font-size: 0.8125rem;
}
.nav__court-progress {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--slate);
}

/* --- Flash Messages --- */
.flash {
  position: fixed;
  top: var(--space-md);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  max-width: 600px;
  width: calc(100% - 32px);
  animation: flashIn 0.3s ease;
}
.flash__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius);
  font-size: 0.9375rem;
}
.flash--notice .flash__inner {
  background: var(--purple-faint);
  border: 1px solid var(--purple-light);
  color: var(--purple-darker);
}
.flash--alert .flash__inner {
  background: var(--incorrect-bg);
  border: 1px solid #fca5a5;
  color: #991b1b;
}
.flash__close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 0 0 0 var(--space-md);
}
@keyframes flashIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* === HERO SECTION === */
.hero {
  background: var(--white);
  padding-bottom: var(--space-3xl);
  overflow: hidden;
}
.hero__content {
  text-align: center;
  padding-top: var(--space-3xl);
  max-width: 800px;
  margin: 0 auto;
}
.hero__title {
  font-size: clamp(2.5rem, 8vw, 5rem);
  color: var(--ink-900);
  margin-bottom: var(--space-lg);
  line-height: 1.05;
}
.hero__subtitle {
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  color: var(--graphite);
  margin-bottom: var(--space-md);
  line-height: 1.5;
}
.hero__description {
  font-size: 1.0625rem;
  color: var(--slate);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
}
.hero__cta {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-3xl);
}
.hero__ai-hint {
  width: 100%;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--slate);
  margin-top: var(--space-xs);
}
.hero__ai-hint a {
  color: var(--purple);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  text-decoration: none;
  border-bottom: 1px dashed var(--purple);
}
.hero__ai-hint a:hover {
  color: var(--purple-dark);
  border-bottom-color: var(--purple-dark);
}
.hero__image {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* === SECTIONS === */
.section {
  padding: var(--space-4xl) 0;
}
.section--dark {
  background: var(--ink-900);
  color: var(--white);
}
.section--dark h2 {
  color: var(--white);
}
.section--dark .section__lead {
  color: rgba(255, 255, 255, 0.75);
}
.section--purple {
  background: var(--purple);
  color: var(--white);
}
.section--purple h2 {
  color: var(--white);
}
.section--light {
  background: var(--purple-faint);
}
.section--cta {
  text-align: center;
  background: var(--white);
}
.section__lead {
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  color: var(--graphite);
  max-width: 700px;
  line-height: 1.7;
  margin-inline: auto;
  margin-bottom: var(--space-xl);
}

/* Consistent centered section headers (kicker + h2 + lead) */
.section > .container > .kicker {
  text-align: center;
  margin-bottom: var(--space-sm);
}
.section > .container > h2 {
  text-align: center;
  max-width: 820px;
  margin-inline: auto;
  margin-bottom: var(--space-md);
}
.section > .container > .section__lead {
  text-align: center;
}
.section > .container > .section__lead + .section__lead {
  margin-top: calc(var(--space-md) * -1);
}
.section__cta {
  margin-top: var(--space-2xl);
  text-align: center;
}
.text--white { color: var(--white); }

/* --- Stat Grid --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}
.stat-card {
  text-align: center;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.stat-card__number {
  display: block;
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--purple-light);
}
.stat-card__label {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  color: var(--white);
  margin-top: var(--space-sm);
}
.stat-card__detail {
  display: block;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: var(--space-xs);
}

/* --- Courts Grid (Home) --- */
.courts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-2xl);
}
.court-card {
  padding: var(--space-lg);
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--sand-200);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
}
.court-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.court-card__number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--purple);
  font-weight: 600;
}
.court-card__icon {
  font-size: 1.5rem;
  display: block;
  margin: var(--space-sm) 0;
}
.court-card__name {
  font-size: 1.125rem;
  margin-bottom: var(--space-xs);
}
.court-card__subtitle {
  font-size: 0.8125rem;
  color: var(--slate);
  line-height: 1.4;
}

/* --- Steps Grid --- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}
.step-card {
  padding: var(--space-xl);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.step-card__number {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--purple-light);
  display: block;
  margin-bottom: var(--space-sm);
}
.step-card h3 {
  color: var(--white);
  margin-bottom: var(--space-sm);
}
.step-card p {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
}

/* --- Scoring Table --- */
.scoring-table-wrapper {
  max-width: 600px;
  margin: var(--space-2xl) auto 0;
}
.scoring-table {
  width: 100%;
  border-collapse: collapse;
}
.scoring-table th,
.scoring-table td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  border-bottom: 1px solid var(--sand-200);
}
.scoring-table th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate);
  font-weight: 500;
}
.scoring-table__points {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--purple);
  text-align: right;
}
.scoring-table__highlight {
  background: var(--purple-faint);
}
.scoring-table__highlight td {
  border-bottom: 2px solid var(--purple);
}

.bridge-preview {
  max-width: 700px;
  margin: var(--space-2xl) auto 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* --- Contributors --- */
.contributors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
  margin-top: var(--space-2xl);
}
.contributor-group {
  padding: var(--space-lg);
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--sand-200);
}
.contributor-group h4 {
  color: var(--purple);
  margin-bottom: var(--space-sm);
  font-size: 0.875rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.contributor-group p {
  font-size: 0.9375rem;
  color: var(--graphite);
  line-height: 1.5;
}

/* === AUTH / REGISTRATION PAGE === */
.auth-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding: var(--space-2xl) 0;
}
.auth-card {
  max-width: 540px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--sand-200);
}
.auth-card__header {
  margin-bottom: var(--space-xl);
}
.auth-card__header h1 {
  margin-bottom: var(--space-sm);
}
.auth-card__header p {
  color: var(--graphite);
  font-size: 0.9375rem;
  line-height: 1.5;
}
.auth-card__footnote {
  font-size: 0.8125rem;
  color: var(--slate);
  text-align: center;
  margin-top: var(--space-lg);
  line-height: 1.5;
}

.form-group {
  margin-bottom: var(--space-lg);
}
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: var(--space-sm);
  color: var(--ink-900);
}
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--sand-200);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink-900);
  background: var(--cloud-50);
  transition: border-color 0.2s;
  appearance: none;
}
.form-input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.form-input::placeholder {
  color: var(--slate);
}
.form-hint {
  display: block;
  font-size: 0.8125rem;
  color: var(--slate);
  margin-top: var(--space-xs);
}
.form-actions {
  margin-top: var(--space-xl);
}
.form-errors {
  background: var(--incorrect-bg);
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}
.form-errors h3 {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  color: #991b1b;
  margin-bottom: var(--space-sm);
}
.form-errors ul {
  list-style: none;
  padding: 0;
}
.form-errors li {
  font-size: 0.875rem;
  color: #991b1b;
  padding: 2px 0;
}

/* --- Below-card privacy text --- */
.auth-below-card {
  text-align: center;
  font-size: 0.75rem;
  color: var(--slate);
  margin-top: var(--space-md);
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}
.auth-below-card a {
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-below-card a:hover {
  color: var(--purple-dark);
}

/* --- Academic toggle link --- */
.form-academic-link {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--purple);
  margin-top: var(--space-xs);
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px dashed var(--purple);
  padding-bottom: 1px;
  transition: color 0.2s;
}
.form-academic-link:hover {
  color: var(--purple-dark);
  border-bottom-color: var(--purple-dark);
}

/* --- Autocomplete dropdown --- */
.ac-wrapper {
  position: relative;
}
.ac-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  margin-top: 4px;
  background: var(--white);
  border: 2px solid var(--purple);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
}
.ac-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}
.ac-item {
  padding: 10px 16px;
  font-size: 0.9375rem;
  color: var(--ink-900);
  cursor: pointer;
  transition: background 0.12s;
}
.ac-item:hover,
.ac-item--active {
  background: var(--purple-faint, #F5F5FF);
  color: var(--purple-dark);
}

/* === COURTS MAP PAGE === */
.courts-page {
  padding: var(--space-xl) 0 var(--space-4xl);
}
.courts-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}
.courts-header__subtitle {
  color: var(--graphite);
  font-size: 1.125rem;
  margin-top: var(--space-sm);
}

.progress-bar {
  max-width: 500px;
  margin: var(--space-xl) auto 0;
  background: var(--sand-200);
  border-radius: var(--radius-full);
  height: 12px;
  position: relative;
  overflow: hidden;
}
.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--purple-light));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}
.progress-bar__label {
  display: block;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--slate);
  margin-top: var(--space-sm);
}

.courts-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}
.court-tile {
  background: var(--white);
  border: 2px solid var(--sand-200);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: border-color 0.2s, transform 0.2s;
}
.court-tile:hover {
  border-color: var(--purple-light);
  transform: translateY(-2px);
}
.court-tile--completed {
  border-color: var(--correct);
  background: var(--correct-bg);
}
.court-tile--active {
  border-color: var(--purple);
}
.court-tile__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.court-tile__number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--purple);
  font-weight: 600;
}
.court-tile__icon {
  font-size: 1.25rem;
}
.court-tile__badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: #dcfce7;
  color: #166534;
}
.court-tile__badge--progress {
  background: var(--purple-faint);
  color: var(--purple);
}
.court-tile__name {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}
.court-tile__subtitle {
  font-size: 0.875rem;
  color: var(--slate);
  line-height: 1.4;
  margin-bottom: var(--space-md);
}
.court-tile__score {
  margin-top: var(--space-md);
}
.court-tile__ckp {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #166534;
  font-size: 0.875rem;
}
.courts-complete {
  text-align: center;
  margin-top: var(--space-2xl);
}

/* === SCENARIO PAGE === */
.scenario-page {
  padding: var(--space-xl) 0 var(--space-4xl);
  min-height: 80vh;
}
.court-banner {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg);
  background: var(--purple-faint);
  border-radius: var(--radius-lg);
  border: 1px solid var(--sand-200);
  margin-bottom: var(--space-lg);
}
.court-banner__icon {
  font-size: 2rem;
}
.court-banner__name {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}
.court-banner__anchor {
  font-size: 0.8125rem;
  color: var(--slate);
  font-family: var(--font-mono);
  line-height: 1.4;
}

.scenario-progress {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-xl);
}
.scenario-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sand-200);
  border: 2px solid var(--sand-200);
  transition: all 0.3s;
}
.scenario-dot--done {
  background: var(--purple);
  border-color: var(--purple);
}
.scenario-dot--current {
  background: var(--white);
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}

.scenario-card {
  max-width: 740px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--sand-200);
}
.scenario-card__header {
  margin-bottom: var(--space-xl);
}
.scenario-card__label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--purple);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.scenario-card__title {
  margin-top: var(--space-sm);
}
.scenario-card__premise {
  margin-bottom: var(--space-xl);
  line-height: 1.7;
}
.scenario-card__premise p {
  margin-bottom: var(--space-md);
  color: var(--graphite);
}
.scenario-card__question {
  color: var(--ink-900) !important;
  font-size: 1.0625rem;
}

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-sm);
  border: 2px solid var(--sand-200);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--white);
}
.option-btn:hover {
  border-color: var(--purple-light);
  background: var(--purple-faint);
}
.option-btn:has(:checked) {
  border-color: var(--purple);
  background: var(--purple-faint);
}
.option-btn__radio {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.option-btn__letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sand-200);
  color: var(--graphite);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 2px;
}
.option-btn:has(:checked) .option-btn__letter {
  background: var(--purple);
  color: var(--white);
}
.option-btn__text {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-900);
}
.scenario-card__submit {
  margin-top: var(--space-xl);
}

/* --- Result Card (after answer) --- */
.scenario-card--result {
  border-color: transparent;
}
.result-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius);
  margin-bottom: var(--space-xl);
}
.result-banner--correct {
  background: var(--correct-bg);
  border: 1px solid #86efac;
}
.result-banner--incorrect {
  background: var(--incorrect-bg);
  border: 1px solid #fca5a5;
}
.result-banner__icon {
  font-size: 2rem;
  font-weight: 700;
}
.result-banner--correct .result-banner__icon { color: var(--correct); }
.result-banner--incorrect .result-banner__icon { color: var(--incorrect); }
.result-banner__title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.25rem;
}
.result-banner--correct .result-banner__title { color: #166534; }
.result-banner--incorrect .result-banner__title { color: #991b1b; }
.result-banner__ckp {
  font-family: var(--font-mono);
  font-weight: 600;
  color: #166534;
  font-size: 0.9375rem;
}

.result-explanation {
  margin-bottom: var(--space-xl);
}
.result-explanation h4 {
  margin-bottom: var(--space-md);
}
.result-explanation__correct {
  background: var(--purple-faint);
  padding: var(--space-md);
  border-radius: var(--radius);
  border-left: 3px solid var(--purple);
  margin-bottom: var(--space-md);
  font-size: 0.9375rem;
}
.result-explanation__text {
  font-size: 0.9375rem;
  color: var(--graphite);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}
.result-explanation__reference {
  font-size: 0.8125rem;
  color: var(--slate);
  font-style: italic;
}
.reference-tag {
  font-style: normal;
  font-weight: 600;
}

.result-consequence {
  background: var(--gold-light);
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}
.result-consequence__label {
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: var(--space-sm);
}
.result-consequence__text {
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--ink-700);
  line-height: 1.6;
}

.result-actions {
  margin-top: var(--space-xl);
}

/* === RESULTS PAGE === */
.results-page {
  padding: var(--space-xl) 0 var(--space-4xl);
}
.golden-bridge-banner {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  background: linear-gradient(135deg, var(--purple-faint), var(--gold-light));
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2xl);
}
.golden-bridge-banner__image {
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}
.golden-bridge-banner__score {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--purple);
}
.golden-bridge-banner__rank {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--gold);
  margin: var(--space-sm) 0 var(--space-lg);
}
.golden-bridge-banner__text {
  color: var(--graphite);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  line-height: 1.6;
}

.results-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}
.results-header__score {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--purple);
  margin: var(--space-md) 0;
}
.results-header__rank {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--graphite);
}
.results-header__deficit {
  max-width: 600px;
  margin: var(--space-xl) auto 0;
  padding: var(--space-lg);
  background: var(--gold-light);
  border-radius: var(--radius);
  text-align: left;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}
.result-card {
  background: var(--white);
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}
.result-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.result-card__icon { font-size: 1.25rem; }
.result-card__number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--slate);
}
.result-card h3 {
  font-size: 1.0625rem;
  margin-bottom: var(--space-md);
}
.result-card__score {
  margin-top: var(--space-md);
}
.result-card__bar {
  height: 6px;
  background: var(--sand-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-xs);
}
.result-card__fill {
  height: 100%;
  background: var(--purple);
  border-radius: var(--radius-full);
}
.result-card__ckp {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--purple);
  font-weight: 600;
}
.result-card__incomplete {
  font-size: 0.875rem;
  color: var(--slate);
  margin-bottom: var(--space-md);
}

.share-section {
  text-align: center;
  margin-top: var(--space-3xl);
  padding: var(--space-2xl);
  background: var(--purple-faint);
  border-radius: var(--radius-lg);
}
.share-section h2 { margin-bottom: var(--space-sm); }
.share-section p {
  color: var(--graphite);
  margin-bottom: var(--space-lg);
}

/* === CERTIFICATE === */
.certificate-page {
  padding: var(--space-2xl) 0 var(--space-4xl);
}
.certificate {
  max-width: 800px;
  margin: 0 auto;
}
.certificate__border {
  border: 3px solid var(--purple);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  background: var(--white);
}
.certificate__inner {
  border: 1px solid var(--sand-200);
  border-radius: var(--radius);
  padding: var(--space-3xl) var(--space-2xl);
  text-align: center;
}
.certificate__presented {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.certificate__title {
  font-size: 3rem;
  color: var(--purple);
  margin: var(--space-sm) 0;
}
.certificate__subtitle {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--graphite);
  margin-bottom: var(--space-xl);
}
.certificate__divider {
  width: 80px;
  height: 2px;
  background: var(--purple);
  margin: var(--space-xl) auto;
}
.certificate__recipient {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--ink-900);
}
.certificate__firm {
  font-size: 1.125rem;
  color: var(--graphite);
  margin-top: var(--space-xs);
}
.certificate__body {
  max-width: 500px;
  margin: 0 auto;
  font-size: 1rem;
  color: var(--graphite);
  line-height: 1.6;
}
.certificate__stats {
  display: flex;
  justify-content: center;
  gap: var(--space-2xl);
  margin: var(--space-2xl) 0;
}
.certificate__stat {
  text-align: center;
}
.certificate__stat-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--purple);
}
.certificate__stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--slate);
  margin-top: var(--space-xs);
}
.certificate__date {
  font-size: 0.9375rem;
  color: var(--slate);
}
.certificate__footer {
  margin-top: var(--space-xl);
  font-size: 0.8125rem;
  color: var(--slate);
}
.certificate__tagline {
  font-family: var(--font-serif);
  font-style: italic;
  margin-top: var(--space-xs);
  color: var(--purple);
}
.certificate-actions {
  text-align: center;
  margin-top: var(--space-xl);
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* === LEADERBOARD === */
.leaderboard-page {
  padding: var(--space-xl) 0 var(--space-4xl);
}
.leaderboard-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}
.leaderboard-header p {
  color: var(--graphite);
  margin-top: var(--space-sm);
}
.leaderboard-section {
  margin-bottom: var(--space-2xl);
}
.leaderboard-section h2 {
  margin-bottom: var(--space-lg);
}
.leaderboard-table-wrapper {
  overflow-x: auto;
}
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.leaderboard-table th {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--slate);
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  background: var(--cloud-50);
  border-bottom: 1px solid var(--sand-200);
}
.leaderboard-table td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--sand-200);
  font-size: 0.9375rem;
}
.leaderboard-table__rank {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--purple);
}
.leaderboard-table__firm {
  font-weight: 600;
}
.leaderboard-table__top3 {
  background: var(--purple-faint);
}
.leaderboard-empty {
  text-align: center;
  padding: var(--space-3xl);
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--sand-200);
}
.leaderboard-empty p {
  color: var(--graphite);
  margin-bottom: var(--space-lg);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* === ABOUT / GUIDE PAGES === */
.about-page, .guide-page {
  padding: var(--space-xl) 0 var(--space-4xl);
}
.prose h1 {
  margin-bottom: var(--space-xl);
}
.prose h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}
.prose h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}
.prose p {
  margin-bottom: var(--space-md);
  line-height: 1.7;
  color: var(--graphite);
}
.prose ul {
  margin-bottom: var(--space-md);
  padding-left: var(--space-xl);
}
.prose li {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
  color: var(--graphite);
}
.prose strong {
  color: var(--ink-900);
}
.guide-page__intro {
  font-size: 1.125rem;
  color: var(--graphite);
  margin-bottom: var(--space-2xl);
  line-height: 1.7;
}
.guide-mapping {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--purple);
  padding: var(--space-sm) var(--space-md);
  background: var(--purple-faint);
  border-radius: var(--radius);
  margin-top: var(--space-sm);
}

/* --- Sovereign AI page --- */
.sovereign__kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple);
  background: var(--purple-faint);
  padding: 4px 12px;
  border-radius: var(--radius-full, 9999px);
  margin-bottom: var(--space-md);
}
.sovereign-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: var(--space-xl) 0;
  border: 2px solid var(--purple);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sovereign-stack__layer {
  display: grid;
  grid-template-columns: 90px 1fr;
  grid-template-rows: auto auto;
  gap: 0 var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--sand-200);
}
.sovereign-stack__layer:last-child {
  border-bottom: none;
}
.sovereign-stack__layer:nth-child(1) { background: var(--purple-faint); }
.sovereign-stack__layer:nth-child(2) { background: var(--cloud-50); }
.sovereign-stack__layer:nth-child(3) { background: var(--white); }
.sovereign-stack__label {
  grid-row: 1 / 3;
  align-self: center;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate);
}
.sovereign-stack__value {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink-900);
}
.sovereign-stack__value a {
  color: var(--purple);
  text-decoration: none;
}
.sovereign-stack__value a:hover {
  text-decoration: underline;
}
.sovereign-stack__desc {
  font-size: 0.8125rem;
  color: var(--graphite);
  line-height: 1.4;
}

/* === FOOTER === */
.site-footer {
  background: var(--ink-900);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-3xl) 0 var(--space-xl);
  margin-top: var(--space-3xl);
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}
.footer__presented {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--purple-light);
  margin-bottom: var(--space-xs);
}
.footer__logo-link {
  text-decoration: none;
}
.footer__logo-text {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--white);
}
.footer__tagline {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: var(--space-xs);
}
.footer__featured {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  margin-top: var(--space-md);
  padding: 10px 14px;
  background: rgba(113, 71, 255, 0.12);
  border: 1px solid rgba(177, 153, 255, 0.35);
  border-radius: 10px;
  text-decoration: none;
  transition: background 180ms ease, transform 180ms ease;
  max-width: max-content;
}
.footer__featured:hover {
  background: rgba(113, 71, 255, 0.22);
  transform: translateY(-1px);
}
.footer__featured-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #cfc3ff;
}
.footer__featured-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
}
.footer__featured-cta {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
}
.footer__links h4 {
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-md);
}
.footer__links ul {
  list-style: none;
}
.footer__links li {
  margin-bottom: var(--space-sm);
}
.footer__links a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9375rem;
  transition: color 0.2s;
}
.footer__links a:hover {
  color: var(--white);
}
.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-xl);
}
.footer__legal {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}
.footer__credit {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.5);
}
.footer__credit a {
  color: var(--purple-light);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .hero__title {
    font-size: 2.5rem;
  }
  .hero__cta {
    flex-direction: column;
    align-items: center;
  }
  .hero__cta .btn {
    width: 100%;
    max-width: 320px;
  }
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  /* Mobile nav: logo prominent, links compact */
  .nav__logo {
    font-size: 1.375rem;
  }
  .nav__links {
    gap: var(--space-sm);
  }
  .nav__links a {
    font-size: 0.75rem;
  }
  .nav__links .btn.btn--small {
    font-size: 0.75rem;
    padding: 6px 12px;
  }
  .certificate__stats {
    flex-direction: column;
    gap: var(--space-lg);
  }
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .courts-map {
    grid-template-columns: 1fr;
  }
  .court-banner {
    flex-direction: column;
    text-align: center;
  }
  .option-btn {
    padding: var(--space-md);
  }
  .scenario-card {
    padding: var(--space-lg);
  }
  .auth-card {
    padding: var(--space-lg);
  }
}

/* === LAW FIRM PROFILE PAGES === */

.firm-profile { padding: var(--space-3xl) 0 var(--space-4xl); }

/* Breadcrumb */
.breadcrumb { margin-bottom: var(--space-xl); }
.breadcrumb ol {
  display: flex;
  gap: var(--space-sm);
  list-style: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--slate);
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: var(--space-sm);
  color: var(--sand-200);
}
.breadcrumb a { color: var(--slate); }
.breadcrumb a:hover { color: var(--purple); }

/* Firm Header */
.firm-header { margin-bottom: var(--space-xl); }
.firm-header__name {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 400;
  color: var(--ink-900);
  line-height: 1.15;
  margin-bottom: var(--space-sm);
}
.firm-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.firm-meta-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--graphite);
  background: var(--sand-200);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

/* AI Readiness Card */
.ai-readiness-card {
  background: #fff;
  border: 2px solid var(--purple);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}
.ai-readiness-card__header { margin-bottom: var(--space-lg); }
.ai-readiness-card__kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--purple);
}
.ai-readiness-card__title {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-900);
  margin-top: 4px;
}

/* Gauge */
.ai-readiness-card__gauge {
  margin-bottom: var(--space-lg);
}
.gauge {
  width: 100%;
  height: 32px;
  background: var(--sand-200);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}
.gauge__fill {
  height: 100%;
  width: calc(var(--pct) * 1%);
  min-width: 48px;
  background: linear-gradient(90deg, var(--purple-dark) 0%, var(--purple) 100%);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  transition: width 1s ease;
}
.gauge__value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.ai-readiness-card__detail {
  font-size: 14px;
  color: var(--graphite);
  margin-top: var(--space-sm);
}
.ai-readiness-card__context {
  border-top: 1px solid var(--sand-200);
  padding-top: var(--space-md);
  margin-bottom: var(--space-md);
}
.ai-readiness-card__context p {
  font-size: 14px;
  color: var(--graphite);
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}
.ai-readiness-card__stats {
  display: flex;
  gap: var(--space-xl);
  border-top: 1px solid var(--sand-200);
  padding-top: var(--space-md);
}
.stat-item { text-align: center; }
.stat-item__value {
  display: block;
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--purple);
  line-height: 1;
}
.stat-item__label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate);
  margin-top: 4px;
}

/* Firm Sections */
.firm-section {
  background: #fff;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}
.firm-section h2 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: var(--space-md);
}
.firm-section h3 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--graphite);
  margin: var(--space-md) 0 var(--space-sm);
}
.firm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.firm-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--purple-dark);
  background: var(--purple-faint);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* Website link */
.firm-website-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  text-decoration: none;
  color: var(--ink-900);
  padding: var(--space-md);
  border-radius: var(--radius);
  transition: background 0.2s;
}
.firm-website-link:hover {
  background: var(--purple-faint);
  color: var(--purple);
}
.firm-website-link__icon {
  font-size: 24px;
  color: var(--purple);
}
.firm-website-link small {
  display: block;
  font-size: 12px;
  color: var(--slate);
}

/* CTA section */
.firm-section--play {
  text-align: center;
  background: linear-gradient(135deg, var(--purple-faint) 0%, #fff 100%);
  border-color: var(--purple-light);
}
.firm-section--play h2 { margin-bottom: var(--space-sm); }
.firm-section--play p {
  font-size: 14px;
  color: var(--graphite);
  margin-bottom: var(--space-lg);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Correction link */
.firm-correction {
  text-align: center;
  padding: var(--space-xl) 0;
}
.firm-correction p {
  font-size: 12px;
  color: var(--slate);
}
.firm-correction a { color: var(--purple); }

/* === FIRMS INDEX (country listing) === */
.firms-index { padding: var(--space-3xl) 0 var(--space-4xl); }
.firms-header {
  margin-bottom: var(--space-xl);
  text-align: center;
}
.firms-header h1 {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 400;
  margin-bottom: var(--space-sm);
}
.firms-header__subtitle {
  font-size: 15px;
  color: var(--graphite);
  max-width: 560px;
  margin: 0 auto var(--space-sm);
}
.firms-header__count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--purple);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.firms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}
.firm-card {
  background: #fff;
  border: 1px solid var(--sand-200);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-decoration: none;
  color: var(--ink-900);
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.firm-card:hover {
  border-color: var(--purple);
  box-shadow: var(--shadow-md);
}
.firm-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}
.firm-card__name {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}
.firm-card__est {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--slate);
  white-space: nowrap;
}
.firm-card__desc {
  font-size: 13px;
  color: var(--graphite);
  line-height: 1.5;
  margin-bottom: var(--space-md);
  flex: 1;
}
.firm-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.firm-card__employees {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--slate);
}
.firm-card__arrow {
  color: var(--purple);
  font-size: 16px;
}

/* Mobile adjustments for firm pages */
@media (max-width: 600px) {
  .firm-header__name { font-size: 28px; }
  .ai-readiness-card__stats { gap: var(--space-md); }
  .stat-item__value { font-size: 22px; }
  .firms-grid { grid-template-columns: 1fr; }
}

/* === PRINT (Certificate) === */
@media print {
  .nav, .site-footer, .certificate-actions {
    display: none !important;
  }
  .certificate-page {
    padding: 0;
  }
  .certificate__border {
    border-color: var(--purple);
  }
}


/* ============================================================
   GUIDE ADVISOR (Feature 3) — Ask-the-Guide panel on /guide
   ============================================================ */
.ga-section { margin: var(--space-2xl, 48px) 0; }

.ga-card {
  background: #fff;
  border: 1px solid var(--purple-light, #B1B1FF);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(113, 71, 255, 0.08);
}

.ga-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

.ga-kicker {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
  font-weight: 600;
  color: var(--purple, #7147FF);
  margin: 0 0 6px;
}

.ga-card__title {
  font-family: "Instrument Serif", serif;
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 6px;
  color: #111;
}

.ga-card__sub {
  font-size: 14px;
  color: #555;
  margin: 0;
  line-height: 1.5;
}

/* Shield states */
.ga-shield {
  width: 40px; height: 40px;
  flex-shrink: 0;
  color: #999;
  transition: color 200ms ease, transform 200ms ease;
}
.ga-shield svg { width: 100%; height: 100%; }
.ga-shield[data-state="idle"]     { color: #c8c4e6; }
.ga-shield[data-state="checking"] { color: #f5a623; animation: ga-pulse 300ms ease-in-out infinite alternate; }
.ga-shield[data-state="passed"]   { color: #1f9d55; animation: ga-pop 200ms ease-out; }
.ga-shield[data-state="passed"] .ga-shield__check { opacity: 1; transition: opacity 200ms ease 100ms; }
.ga-shield[data-state="failed"]   { color: #d94545; animation: ga-shake 300ms ease-in-out; }

@keyframes ga-pulse {
  from { opacity: 0.6; transform: scale(0.95); }
  to   { opacity: 1.0; transform: scale(1.05); }
}
@keyframes ga-pop {
  0% { transform: scale(0.8); }
  60% { transform: scale(1.05); }
  100% { transform: scale(1.0); }
}
@keyframes ga-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  50%      { transform: translateX(4px); }
  75%      { transform: translateX(-2px); }
}

/* Form */
.ga-form { display: flex; flex-direction: column; gap: 10px; }
.ga-label {
  font-size: 13px; font-weight: 600; color: #333;
  display: flex; align-items: center; gap: 6px;
}

.ga-form textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px 14px;
  border: 1.5px solid #e4e2f3;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  resize: vertical;
  background: #fafaff;
  transition: border-color 150ms ease, background 150ms ease;
}
.ga-form textarea:focus {
  outline: none;
  border-color: var(--purple, #7147FF);
  background: #fff;
}

.ga-form__row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap;
}

.ga-count {
  font-size: 12px;
  color: #888;
  opacity: 0;
  transition: opacity 200ms ease, color 150ms ease;
}
.ga-count--visible { opacity: 1; }
.ga-count--amber   { color: #d68910; }
.ga-count--red     { color: #c0392b; font-weight: 600; }

.ga-badge {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px;
  padding: 6px 10px;
  background: #f3f1ff;
  border-radius: 999px;
  font-size: 11.5px;
  color: #534AB7;
  width: fit-content;
}
.ga-badge svg { flex-shrink: 0; }

/* Info tooltip */
.ga-info {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #e4e2f3;
  color: #534AB7;
  font-size: 11px;
  font-weight: 600;
  cursor: help;
  position: relative;
  font-style: normal;
}
.ga-info:hover::after,
.ga-info:focus::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 280px;
  padding: 8px 10px;
  background: #2a2440; color: #fff;
  border-radius: 8px;
  font-size: 12px; font-weight: 400;
  line-height: 1.4;
  z-index: 10;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}
.ga-info:hover::before,
.ga-info:focus::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%; transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #2a2440;
  z-index: 10;
}

/* Loading */
.ga-loading {
  margin-top: 20px; padding: 20px;
  background: #faf9ff;
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.ga-loading[hidden] { display: none; }
.ga-dots { display: flex; gap: 6px; }
.ga-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--purple, #7147FF);
  animation: ga-bounce 1.2s infinite ease-in-out both;
}
.ga-dots span:nth-child(1) { animation-delay: 0s; }
.ga-dots span:nth-child(2) { animation-delay: 0.15s; }
.ga-dots span:nth-child(3) { animation-delay: 0.30s; }
@keyframes ga-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
  40%           { transform: scale(1);   opacity: 1; }
}
.ga-loading__copy {
  margin: 0; font-size: 13px; color: #555; font-style: italic;
  transition: opacity 200ms ease;
}
.ga-progress {
  width: 100%; height: 4px; background: #ece9ff; border-radius: 2px; overflow: hidden;
}
.ga-progress__bar {
  width: 40%; height: 100%; background: var(--purple, #7147FF);
  animation: ga-indeterminate 1.6s ease-in-out infinite;
}
@keyframes ga-indeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* Answer card */
.ga-output { margin-top: 20px; }
.ga-answer {
  background: #fff;
  border: 1px solid #e4e2f3;
  border-radius: 12px;
  padding: 20px 22px;
  animation: ga-fade-in 300ms ease-out;
}
@keyframes ga-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ga-answer__head {
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid #f0eef9;
  padding-bottom: 12px; margin-bottom: 14px;
}
.ga-answer__head h3 {
  margin: 0; font-size: 17px; font-weight: 600; flex: 1;
}
.ga-answer__icon { font-size: 20px; }
.ga-answer__badge {
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  background: #e8f7ee; color: #1f9d55;
  border-radius: 999px;
  cursor: help;
}

.ga-answer__body { font-size: 15px; color: #222; line-height: 1.65; }
.ga-answer__body p { margin: 0 0 12px; }
.ga-answer__body > *:last-child { margin-bottom: 0; }
.ga-answer__body h4 {
  font-family: "Instrument Serif", serif;
  font-size: 19px; font-weight: 500;
  margin: 18px 0 8px; color: #111;
}
.ga-answer__body h5 {
  font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 16px 0 6px; color: #5A35D9;
}
.ga-answer__body ul,
.ga-answer__body ol { margin: 0 0 12px; padding-left: 22px; }
.ga-answer__body li { margin-bottom: 6px; }
.ga-answer__body li::marker { color: var(--purple, #7147FF); }
.ga-answer__body strong { font-weight: 600; color: #111; }
.ga-answer__body em { font-style: italic; }
.ga-answer__body code {
  font-family: "Fira Code", ui-monospace, monospace;
  background: #f4f1ff;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: #5A35D9;
}

.ga-inline-disclaimer {
  display: block;
  margin-top: 16px;
  padding: 10px 14px;
  background: #fff8e6;
  border-left: 3px solid #e0a800;
  border-radius: 4px;
  font-size: 13px;
  color: #6b5400;
  line-height: 1.55;
}
.ga-inline-disclaimer strong {
  color: #5a4500;
  margin-right: 4px;
}

.ga-cite {
  color: var(--purple-dark, #5A35D9);
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  font-size: 0.92em;
  cursor: help;
}
.ga-cite:hover { background: #f3f1ff; }

.ga-answer__refs {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid #f0eef9;
}
.ga-answer__refs h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: #555; }
.ga-answer__refs ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ga-answer__refs li {
  padding: 10px 12px;
  background: #faf9ff;
  border-left: 3px solid var(--purple, #7147FF);
  border-radius: 4px;
}
.ga-answer__refs strong { font-size: 13px; color: #333; display: block; margin-bottom: 2px; }
.ga-answer__refs p      { margin: 0; font-size: 12.5px; color: #666; line-height: 1.5; }

.ga-answer__foot {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid #f0eef9;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.ga-disclaimer { margin: 0; font-size: 12px; color: #888; font-style: italic; }

.ga-feedback { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #666; }
.ga-feedback__btn {
  border: 1px solid #e4e2f3;
  background: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 150ms ease;
}
.ga-feedback__btn:hover { background: #f3f1ff; border-color: var(--purple, #7147FF); }
.ga-feedback__btn--on   { background: var(--purple, #7147FF); border-color: var(--purple, #7147FF); }
.ga-feedback__thanks    { color: var(--purple-dark, #5A35D9); font-weight: 500; }

/* Blocked */
.ga-blocked {
  background: #fffbf2;
  border: 1px solid #f5d99a;
  border-radius: 12px;
  padding: 22px;
  animation: ga-fade-in 300ms ease-out;
}
.ga-blocked__icon { font-size: 28px; display: block; margin-bottom: 6px; }
.ga-blocked__title { margin: 0 0 8px; font-size: 17px; font-weight: 600; color: #2a2440; }
.ga-blocked__body  { margin: 0 0 10px; font-size: 14px; line-height: 1.55; color: #444; }
.ga-blocked__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

@media (max-width: 600px) {
  .ga-card { padding: 20px; }
  .ga-card__title { font-size: 22px; }
  .ga-card__head { flex-direction: row; }
}

/* ============================================================
   POLICY GENERATOR (Feature 5) - Wizard at /policy
   ============================================================ */
.policy-page { padding: 40px 0 80px; background: #fafaff; min-height: 100vh; }
.policy-page__head { text-align: center; margin-bottom: 32px; }
.policy-page__head h1 {
  font-family: "Instrument Serif", serif;
  font-size: 38px; line-height: 1.15; margin: 8px 0 10px;
}
.policy-page__intro { color: #555; font-size: 15px; max-width: 56ch; margin: 0 auto; }

/* Stepper */
.pw-stepper {
  list-style: none; padding: 0; margin: 0 0 24px;
  display: flex; justify-content: space-between; align-items: center;
  background: #fff;
  border: 1px solid #e4e2f3;
  border-radius: 12px;
  padding: 14px 16px;
  gap: 8px;
  overflow-x: auto;
}
.pw-stepper__item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #999;
  white-space: nowrap;
  transition: color 200ms ease;
}
.pw-stepper__num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #ece9ff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
  color: #888;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}
.pw-stepper__item--active { color: var(--purple-dark, #5A35D9); font-weight: 600; }
.pw-stepper__item--active .pw-stepper__num { background: var(--purple, #7147FF); color: #fff; transform: scale(1.1); }
.pw-stepper__item--complete .pw-stepper__num { background: #1f9d55; color: #fff; }
.pw-stepper__item--complete .pw-stepper__num::before { content: "✓"; }
.pw-stepper__item--complete .pw-stepper__num { font-size: 0; }
.pw-stepper__item--complete .pw-stepper__num::before { font-size: 12px; }

/* Form panels */
.pw-form {
  background: #fff;
  border: 1px solid #e4e2f3;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 24px rgba(113, 71, 255, 0.08);
}
.pw-panel { display: none; animation: ga-fade-in 250ms ease-out; }
.pw-panel--active { display: block; }
.pw-panel h2 {
  font-family: "Instrument Serif", serif;
  font-size: 26px; margin: 0 0 4px;
}
.pw-panel__sub { color: #666; margin: 0 0 24px; font-size: 14px; }

.pw-field { margin-bottom: 22px; }
.pw-field--nested {
  margin-top: 12px;
  margin-left: 0;
  padding: 12px 14px;
  background: #faf9ff;
  border-left: 3px solid var(--purple, #7147FF);
  border-radius: 6px;
}
.pw-field--nested label { font-size: 13.5px; }
.pw-field__help {
  margin: 4px 0 10px;
  font-size: 12.5px;
  color: #777;
  line-height: 1.5;
}
.pw-field label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: #333; margin-bottom: 8px;
}
.pw-field input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #e4e2f3;
  border-radius: 10px;
  font: inherit; font-size: 15px;
  background: #fafaff;
  transition: border-color 150ms ease, background 150ms ease;
}
.pw-field input[type="text"]:focus { outline: none; border-color: var(--purple, #7147FF); background: #fff; }
.pw-field--error label { color: #c0392b; }
.pw-field--error input[type="text"] { border-color: #c0392b; }
.pw-field--error .pw-chip { border-color: #c0392b; }

/* Chip-style radio/checkbox */
.pw-radios, .pw-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.pw-chip {
  display: inline-flex; align-items: center; cursor: pointer;
  padding: 8px 14px;
  background: #fafaff;
  border: 1.5px solid #e4e2f3;
  border-radius: 999px;
  font-size: 13.5px;
  transition: all 150ms ease;
  user-select: none;
}
.pw-chip:hover { border-color: var(--purple-light, #B1B1FF); background: #f3f1ff; }
.pw-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pw-chip:has(input:checked) {
  background: var(--purple, #7147FF);
  border-color: var(--purple, #7147FF);
  color: #fff;
  font-weight: 500;
}

/* Footer nav */
.pw-nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
  margin-top: 28px; padding-top: 20px;
  border-top: 1px solid #f0eef9;
}
.pw-nav > .btn { flex-shrink: 0; }
.pw-shield {
  width: 32px; height: 32px; color: #c8c4e6;
  transition: color 200ms ease, transform 200ms ease;
  margin: 0 auto;
}
.pw-shield svg { width: 100%; height: 100%; }
.pw-shield[data-state="checking"] { color: #f5a623; animation: ga-pulse 300ms ease-in-out infinite alternate; }
.pw-shield[data-state="passed"]   { color: #1f9d55; animation: ga-pop 200ms ease-out; }
.pw-shield[data-state="passed"] .ga-shield__check { opacity: 1; }
.pw-shield[data-state="failed"]   { color: #d94545; animation: ga-shake 300ms ease-in-out; }

/* Review screen */
.pw-review__list {
  margin: 16px 0; padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.pw-review__list > div {
  display: grid; grid-template-columns: 160px 1fr; gap: 12px;
  padding: 10px 14px;
  background: #faf9ff;
  border-left: 3px solid var(--purple, #7147FF);
  border-radius: 4px;
}
.pw-review__list dt { font-weight: 600; font-size: 13px; color: #555; }
.pw-review__list dd { margin: 0; font-size: 14px; color: #222; }
.pw-review__note { font-size: 13px; color: #666; font-style: italic; margin-top: 16px; }
.pw-badge-block { margin-top: 18px; }

/* Loading */
.pw-loading {
  margin-top: 28px; padding: 28px;
  background: #fff;
  border: 1px solid #e4e2f3;
  border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

/* Output card */
.pw-output {
  margin-top: 28px;
  background: #fff;
  border: 1px solid #e4e2f3;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 6px 28px rgba(113, 71, 255, 0.1);
  transition: transform 200ms ease, box-shadow 200ms ease;
  animation: ga-fade-in 300ms ease-out;
}
.pw-output:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(113, 71, 255, 0.14); }
.pw-output__head { border-bottom: 1px solid #f0eef9; padding-bottom: 16px; margin-bottom: 18px; }
.pw-output__head h2, .pw-output__head h1 {
  font-family: "Instrument Serif", serif;
  margin: 4px 0 10px;
}
.pw-output__badges { display: flex; gap: 8px; flex-wrap: wrap; }
.ga-answer__badge--purple { background: #f3f1ff; color: var(--purple-dark, #5A35D9); }

.pw-output__body { font-size: 14.5px; line-height: 1.65; color: #222; }
.pw-output__pre {
  white-space: pre-wrap; word-wrap: break-word;
  font: inherit;
  background: #fafaff;
  padding: 18px 20px;
  border-radius: 10px;
  border-left: 3px solid var(--purple, #7147FF);
  max-height: 600px; overflow-y: auto;
}

/* Rendered policy document (also reused on /policy/:id and print view) */
.policy-doc__body { font-size: 15px; line-height: 1.7; color: #222; }
.policy-doc__body > *:first-child { margin-top: 0; }
.policy-doc__body > *:last-child { margin-bottom: 0; }
.policy-doc__body p { margin: 0 0 14px; }
.policy-doc__body h2 {
  font-family: "Instrument Serif", serif;
  font-size: 26px; font-weight: 500;
  margin: 28px 0 10px;
  color: #111;
  padding-bottom: 6px;
  border-bottom: 1px solid #ece9ff;
}
.policy-doc__body h3 {
  font-family: "Instrument Serif", serif;
  font-size: 20px; font-weight: 500;
  margin: 22px 0 8px;
  color: var(--purple-dark, #5A35D9);
}
.policy-doc__body h3::before { content: "📜 "; }
.policy-doc__body h4 {
  font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 18px 0 6px; color: #5A35D9;
}
.policy-doc__body ul,
.policy-doc__body ol { margin: 0 0 14px; padding-left: 22px; }
.policy-doc__body li { margin-bottom: 6px; }
.policy-doc__body li::marker { color: var(--purple, #7147FF); }
.policy-doc__body strong { font-weight: 600; color: #111; }
.policy-doc__body em { font-style: italic; }
.policy-doc__body code {
  font-family: "Fira Code", ui-monospace, monospace;
  background: #f4f1ff; padding: 1px 6px; border-radius: 4px;
  font-size: 0.9em; color: #5A35D9;
}

/* Compliance keyword badges (MUST / MUST NOT / SHOULD / MAY) */
.req-badge {
  display: inline-block;
  font-family: var(--font-mono, "Fira Code", ui-monospace, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  margin: 0 4px 0 0;
  vertical-align: 2px;
  line-height: 1.6;
  white-space: nowrap;
}
.req-badge--must,
.req-badge--shall { background: #fde2e2; color: #a01818; border: 1px solid #f5b7b7; }
.req-badge--must-not,
.req-badge--shall-not,
.req-badge--may-not { background: #2b2b2b; color: #fff; border: 1px solid #2b2b2b; }
.req-badge--should { background: #fff1cc; color: #6b5400; border: 1px solid #f0d488; }
.req-badge--should-not { background: #ffe1c2; color: #8a3a00; border: 1px solid #f3b878; }
.req-badge--may { background: #e0f2e0; color: #1f5d1f; border: 1px solid #b9ddb9; }

/* Structured requirements list: badge + statement, one per row */
.req-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.req-list__item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 14px;
  background: #fafaff;
  border-left: 3px solid #ece9ff;
  border-radius: 6px;
}
.req-list__item .req-badge { margin: 2px 0 0; text-align: center; width: 100%; vertical-align: 0; }
.req-list__text { line-height: 1.6; color: #222; }
.req-list__item:has(.req-badge--must),
.req-list__item:has(.req-badge--shall) { border-left-color: #d97070; }
.req-list__item:has(.req-badge--must-not),
.req-list__item:has(.req-badge--shall-not),
.req-list__item:has(.req-badge--may-not) { border-left-color: #2b2b2b; }
.req-list__item:has(.req-badge--should) { border-left-color: #e0a800; }
.req-list__item:has(.req-badge--should-not) { border-left-color: #c97a2a; }
.req-list__item:has(.req-badge--may) { border-left-color: #5fa05f; }

@media (max-width: 540px) {
  .req-list__item { grid-template-columns: 1fr; gap: 6px; }
  .req-list__item .req-badge { max-width: max-content; }
}

/* Markdown tables */
.md-table-wrap { margin: 0 0 18px; overflow-x: auto; }
.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
  border: 1px solid #ece9ff;
  border-radius: 8px;
  overflow: hidden;
}
.md-table th,
.md-table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #f0eef9;
  line-height: 1.55;
}
.md-table thead th {
  background: #f6f3ff;
  font-weight: 600;
  color: #2b2b2b;
  border-bottom: 2px solid #ece9ff;
}
.md-table tbody tr:last-child td { border-bottom: none; }
.md-table tbody tr:nth-child(even) td { background: #fafaff; }

@media print {
  .md-table { break-inside: avoid; }
}

/* Inline guide reference - small book icon + "Section X.X".
   Reads as a citation, not a link. Tooltip names the MinLaw Guide. */
.md-cite {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  color: #6b6485;
  font-size: 0.85em;
  font-weight: 500;
  white-space: nowrap;
  cursor: help;
  text-decoration: none;
}
.md-cite::before {
  content: "📖";
  font-size: 0.95em;
  margin-right: 1px;
}
.md-cite__icon { display: none; }

.policy-doc__disclaimer {
  display: block;
  margin: 24px 0 0;
  padding: 14px 18px;
  background: #fff8e6;
  border-left: 4px solid #e0a800;
  border-radius: 6px;
  font-size: 13.5px;
  color: #6b5400;
  line-height: 1.6;
}
.policy-doc__disclaimer strong { color: #5a4500; margin-right: 6px; }

/* Print / save-as-PDF layout */
.policy-print__main { max-width: 780px; margin: 0 auto; padding: 32px 28px 80px; }
.policy-doc__head {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 18px;
  border-bottom: 2px solid #ece9ff;
}
.policy-doc__kicker {
  text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 11px; font-weight: 700;
  color: var(--purple, #7147FF);
  margin: 0 0 6px;
}
.policy-doc__title {
  font-family: "Instrument Serif", serif;
  font-size: 34px; margin: 0 0 8px; color: #111;
}
.policy-doc__meta { font-size: 12px; color: #666; margin: 0; }

@media print {
  .policy-doc__body h2 { break-after: avoid; }
  .policy-doc__body h3 { break-after: avoid; }
  .policy-doc__body li { break-inside: avoid; }
  .policy-doc__disclaimer { break-inside: avoid; }
  .policy-doc__body code { background: transparent; color: inherit; }
}

.pw-output__refs {
  margin-top: 18px; padding-top: 14px; border-top: 1px solid #f0eef9;
}
.pw-output__refs h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: #555; }
.pw-output__refs ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.pw-output__refs li {
  padding: 10px 12px;
  background: #faf9ff;
  border-left: 3px solid var(--purple, #7147FF);
  border-radius: 4px;
}
.pw-output__refs strong { font-size: 13px; color: #333; display: block; margin-bottom: 2px; }
.pw-output__refs p      { margin: 0; font-size: 12.5px; color: #666; }

.pw-output__foot {
  margin-top: 22px; padding-top: 18px;
  border-top: 1px solid #f0eef9;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.pw-output__foot .btn {
  flex: 1 1 0;
  min-width: 160px;
  padding: 12px 20px;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-align: center;
  justify-content: center;
}

@media (max-width: 700px) {
  .pw-form { padding: 22px; }
  .pw-stepper__label { display: none; }
  .pw-review__list > div { grid-template-columns: 1fr; gap: 2px; }
  .pw-review__list dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
}

/* ============================================================
   HOMEPAGE - Firm Tools section (Ask the Guide + Policy Generator)
   ============================================================ */

/* Hero pill strip */
.hero__tools {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed #d8d4f0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #555;
}
.hero__tools-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.hero__tools-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 10px;
  font-weight: 500;
  color: #8a85a8;
}
@keyframes ht-twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50%      { transform: scale(1.2) rotate(15deg); opacity: 0.7; }
}
.hero__tools-link {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 14px;
  background: var(--purple, #7147FF);
  border: 1.5px solid var(--purple, #7147FF);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: all 180ms ease;
  box-shadow: 0 2px 8px rgba(113, 71, 255, 0.08);
}
.hero__tools-link:hover {
  background: var(--purple-dark, #5A35D9);
  border-color: var(--purple-dark, #5A35D9);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(113, 71, 255, 0.3);
}
.hero__tools-link--secondary {
  background: transparent;
  color: var(--purple-dark, #5A35D9);
}
.hero__tools-link--secondary:hover {
  background: var(--purple, #7147FF);
  color: #fff;
}
.hero__tools-sep { color: #c8c4e6; }

/* Tools section background - subtle purple gradient to differentiate from hero */
.section--tools {
  background: linear-gradient(180deg, #fafaff 0%, #f3f1ff 100%);
  padding: 64px 0;
  position: relative;
}
.section--tools::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple-light, #B1B1FF), transparent);
  opacity: 0.5;
}

/* NEW badge in kicker */
.kicker__new {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 8px;
  background: var(--purple, #7147FF);
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  vertical-align: middle;
  animation: kicker-new-pulse 2.2s ease-in-out infinite;
}
@keyframes kicker-new-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(113, 71, 255, 0.45); }
  50%      { box-shadow: 0 0 0 8px rgba(113, 71, 255, 0); }
}

/* Tools grid */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin: 40px 0 24px;
}

.tool-card {
  background: #fff;
  border: 1.5px solid #e4e2f3;
  border-radius: 20px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 280ms ease,
              border-color 200ms ease;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--purple, #7147FF), var(--purple-light, #B1B1FF));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 320ms ease;
}
.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 44px rgba(113, 71, 255, 0.18);
  border-color: var(--purple-light, #B1B1FF);
}
.tool-card:hover::before { transform: scaleX(1); }

.tool-card__illustration {
  background: linear-gradient(135deg, #faf9ff 0%, #f0edff 100%);
  border-radius: 14px;
  padding: 18px;
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}
.tool-card__illustration svg {
  width: 100%;
  max-width: 260px;
  height: auto;
}

/* ─────────────── Illustration animations ─────────────── */

/* Ask the Guide - speech bubble, citation pills, shield */
.ill-bubble {
  transform-origin: 55px 38px;
  animation: bubble-bob 3.2s ease-in-out infinite;
}
.tool-card:hover .ill-bubble {
  animation: bubble-bob-hover 1.4s ease-in-out infinite;
}
@keyframes bubble-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-4px) rotate(2deg); }
}
@keyframes bubble-bob-hover {
  0%, 100% { transform: translateY(-2px) rotate(-3deg) scale(1); }
  50%      { transform: translateY(-7px) rotate(3deg) scale(1.06); }
}

.ill-cite {
  transform-origin: center;
  opacity: 0.92;
  animation: cite-float 4s ease-in-out infinite;
}
.ill-cite--2 { animation-delay: 0.6s; }
.ill-cite--3 { animation-delay: 1.2s; }
.tool-card:hover .ill-cite { animation-duration: 2s; }
@keyframes cite-float {
  0%, 100% { transform: translateY(0); opacity: 0.92; }
  50%      { transform: translateY(-3px); opacity: 1; }
}

.ill-shield {
  transform-origin: 246px 24px;
  animation: shield-pulse 2.6s ease-in-out infinite;
}
@keyframes shield-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

/* Policy Generator - steps, arrow, seal, sparkles */
.ill-step {
  transform-origin: center;
  opacity: 0;
  animation: step-appear 0.4s ease-out forwards;
}
.ill-step--1 { animation-delay: 0s;    }
.ill-step--2 { animation-delay: 0.12s; }
.ill-step--3 { animation-delay: 0.24s; }
.ill-step--4 { animation-delay: 0.36s; }
.ill-step--5 { animation-delay: 0.48s; }
@keyframes step-appear {
  0%   { opacity: 0; transform: translateX(-8px); }
  100% { opacity: 1; transform: translateX(0); }
}

.tool-card--policy:hover .ill-step {
  animation: step-shimmer 1.6s ease-in-out infinite;
}
.tool-card--policy:hover .ill-step--1 { animation-delay: 0s;    }
.tool-card--policy:hover .ill-step--2 { animation-delay: 0.15s; }
.tool-card--policy:hover .ill-step--3 { animation-delay: 0.3s;  }
.tool-card--policy:hover .ill-step--4 { animation-delay: 0.45s; }
.tool-card--policy:hover .ill-step--5 { animation-delay: 0.6s;  }
@keyframes step-shimmer {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(2px); }
}

.ill-arrow { animation: arrow-march 1.4s ease-in-out infinite; }
@keyframes arrow-march {
  0%, 100% { transform: translateX(0); opacity: 0.9; }
  50%      { transform: translateX(4px); opacity: 1; }
}

.ill-seal {
  transform-origin: 226px 156px;
  animation: seal-stamp 2.8s ease-in-out infinite;
}
.tool-card--policy:hover .ill-seal { animation-duration: 1.4s; }
@keyframes seal-stamp {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.08) rotate(-3deg); }
}

.ill-sparkle {
  transform-origin: center;
  animation: sparkle-twinkle 2.2s ease-in-out infinite;
}
.ill-sparkle--2 { animation-delay: 0.4s; }
.ill-sparkle--3 { animation-delay: 0.8s; }
@keyframes sparkle-twinkle {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50%      { opacity: 1;   transform: scale(1.2); }
}

/* Card body */
.tool-card__body {
  display: flex; flex-direction: column; gap: 12px;
}
.tool-card__kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 700;
  color: var(--purple, #7147FF);
  margin: 0;
}
.tool-card h3 {
  font-family: "Instrument Serif", serif;
  font-size: 30px;
  line-height: 1.12;
  margin: 0;
  color: #111;
}
.tool-card__desc {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.6;
  color: #444;
}
.tool-card__bullets {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex; flex-direction: column; gap: 7px;
}
.tool-card__bullets li {
  position: relative;
  padding-left: 24px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #555;
}
.tool-card__bullets li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 1px;
  width: 17px; height: 17px;
  background: #e8f7ee;
  color: #1f9d55;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 200ms ease, background 200ms ease;
}
.tool-card:hover .tool-card__bullets li::before {
  transform: scale(1.15);
  background: #c9eed8;
}

.tool-card .btn {
  align-self: flex-start;
  margin-top: 8px;
  position: relative;
  overflow: hidden;
}
.tool-card .btn::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s ease, height 0.5s ease;
}
.tool-card .btn:hover::after { width: 320px; height: 320px; }

.tools-trust {
  margin: 12px auto 0;
  max-width: 70ch;
  text-align: center;
  font-size: 13px;
  color: #777;
  line-height: 1.6;
  font-style: italic;
}
.tools-trust strong { color: var(--purple-dark, #5A35D9); font-style: normal; }

@media (max-width: 800px) {
  .tools-grid { grid-template-columns: 1fr; gap: 20px; }
  .tool-card { padding: 22px; }
  .tool-card h3 { font-size: 24px; }
  .tool-card__illustration { min-height: 160px; padding: 14px; }
  .hero__tools { justify-content: center; text-align: center; }
}
