
/* ============================================================
   Theme — auto-generated from site.config.json
   ============================================================ */

/* ── Variables ───────────────────────────────────────────── */
:root {
  --header-bg:          #1a1a2e;
  --header-fg:          #eaeaea;
  --header-font:        'Segoe UI', Arial, sans-serif;
  --header-size:        1rem;
  --logo-height:        44px;

  --footer-bg:          #16213e;
  --footer-fg:          #aaaaaa;
  --footer-font:        'Segoe UI', Arial, sans-serif;
  --footer-size:        0.875rem;

  --body-bg:            #f0f2f5;
  --body-fg:            #1a1a2e;
  --body-font:          'Segoe UI', Arial, sans-serif;
  --body-size:          1rem;
  --link:               #0057b8;
  --link-hover:         #003d80;

  --form-bg:            #ffffff;
  --form-radius:        8px;
  --form-shadow:        0 2px 16px rgba(0,0,0,0.10);
  --input-border:       #c4c9d4;
  --input-focus:        #0057b8;
  --btn-bg:             #0057b8;
  --btn-fg:             #ffffff;
  --btn-hover:          #003d80;
  --color-error:        #c0001a;
  --color-success:      #006b3c;

  --nav-link:           #d0d4e0;
  --nav-hover:          #ffffff;
  --nav-active:         #f5c842;
  --nav-cta-bg:         #f5c842;
  --nav-cta-fg:         #1a1a2e;
  --nav-cta-hover:      #e0b800;

  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;

  --max-content: 1100px;
  --max-form:    480px;
  --header-h:    64px;
  --mobile-bp:   768px;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

/* ── Base ────────────────────────────────────────────────── */
body {
  font-family:      var(--body-font);
  font-size:        var(--body-size);
  color:            var(--body-fg);
  background-color: var(--body-bg);
  min-height:       100vh;
  display:          flex;
  flex-direction:   column;
  line-height:      1.6;
}

main { flex: 1; padding: var(--space-xl) var(--space-md); }

a { color: var(--link); text-decoration: underline; }
a:hover, a:focus { color: var(--link-hover); }

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

ul, ol { list-style: none; }

/* ── ADA: skip link ──────────────────────────────────────── */
.skip-link {
  position: absolute; top: -100%; left: var(--space-md);
  background: var(--btn-bg); color: var(--btn-fg);
  padding: var(--space-sm) var(--space-md);
  z-index: 9999; border-radius: 0 0 4px 4px;
  font-weight: bold; text-decoration: none;
  transition: top 0.1s;
}
.skip-link:focus { top: 0; outline: 3px solid var(--nav-active); }

/* ── ADA: focus rings ────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--input-focus);
  outline-offset: 2px;
}

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

/* ============================================================
   HEADER — shared base
   ============================================================ */
.header {
  background:  var(--header-bg);
  color:       var(--header-fg);
  font-family: var(--header-font);
  font-size:   var(--header-size);
  position:    sticky;
  top:         0;
  z-index:     100;
  height:      var(--header-h);
  box-shadow:  0 1px 4px rgba(0,0,0,0.3);
}

.header__inner {
  max-width:   var(--max-content);
  margin:      0 auto;
  padding:     0 var(--space-lg);
  height:      100%;
  display:     flex;
  align-items: center;
  justify-content: space-between;
  gap:         var(--space-md);
}

/* Brand / logo */
.header__brand {
  display:     flex;
  align-items: center;
  gap:         var(--space-sm);
  text-decoration: none;
  color:       var(--header-fg);
  flex-shrink: 0;
}
.header__brand:hover, .header__brand:focus { color: var(--nav-hover); }

.header__logo   { height: var(--logo-height); width: auto; }
.header__site-name {
  font-size:   1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── Minimal header (auth pages) ─────────────────────────── */
.header--minimal .header__inner { justify-content: center; }

/* ============================================================
   NAV — desktop
   ============================================================ */
.nav {
  display:     flex;
  align-items: center;
  gap:         var(--space-xl);
}

.nav__links,
.nav__cta,
.nav__user {
  display:     flex;
  align-items: center;
  gap:         var(--space-lg);
}

/* Common link style */
.nav__link {
  color:           var(--nav-link);
  text-decoration: none;
  font-weight:     500;
  font-size:       0.9375rem;
  padding:         var(--space-xs) 0;
  border-bottom:   2px solid transparent;
  white-space:     nowrap;
  transition:      color 0.15s, border-color 0.15s;
}
.nav__link:hover, .nav__link:focus {
  color:        var(--nav-hover);
  border-color: var(--nav-hover);
}
.nav__link--active {
  color:        var(--nav-active);
  border-color: var(--nav-active);
}

/* CTA button link (Sign Up) */
.nav__link--cta {
  background:    var(--nav-cta-bg);
  color:         var(--nav-cta-fg);
  padding:       0.4rem 1rem;
  border-radius: 4px;
  border-bottom: none;
  font-weight:   700;
}
.nav__link--cta:hover, .nav__link--cta:focus {
  background: var(--nav-cta-hover);
  color:      var(--nav-cta-fg);
  border-bottom: none;
}

/* Username label */
.nav__username {
  color:      var(--nav-link);
  font-size:  0.875rem;
  opacity:    0.7;
  font-style: italic;
}

/* Logout button styled as nav link */
.nav__logout-btn {
  background:  none;
  border:      none;
  cursor:      pointer;
  color:       var(--nav-link);
  font:        500 0.9375rem var(--header-font);
  padding:     var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition:  color 0.15s, border-color 0.15s;
}
.nav__logout-btn:hover, .nav__logout-btn:focus {
  color:        var(--nav-hover);
  border-color: var(--nav-hover);
}

.nav__logout-form { display: inline; }

/* ── Hamburger toggle button (hidden on desktop) ─────────── */
.nav__toggle {
  display:        none;
  flex-direction: column;
  justify-content: space-between;
  width:          28px;
  height:         20px;
  background:     none;
  border:         none;
  cursor:         pointer;
  padding:        0;
  flex-shrink:    0;
}
.nav__toggle-bar {
  display:       block;
  width:         100%;
  height:        2px;
  background:    var(--header-fg);
  border-radius: 2px;
  transition:    transform 0.2s, opacity 0.2s;
}

/* ============================================================
   NAV — mobile (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {

  .nav__toggle { display: flex; }

  /* Nav panel — hidden by default */
  .nav {
    position:    fixed;
    top:         var(--header-h);
    left:        0; right: 0;
    background:  var(--header-bg);
    flex-direction: column;
    align-items: flex-start;
    gap:         0;
    padding:     var(--space-md) 0;
    max-height:  calc(100vh - var(--header-h));
    overflow-y:  auto;
    box-shadow:  0 4px 12px rgba(0,0,0,0.3);
    /* Hidden state */
    opacity:     0;
    transform:   translateY(-8px);
    pointer-events: none;
    transition:  opacity 0.2s, transform 0.2s;
  }

  /* Open state — toggled by nav.js */
  .nav--open {
    opacity:        1;
    transform:      translateY(0);
    pointer-events: auto;
  }

  .nav__links,
  .nav__cta,
  .nav__user {
    flex-direction: column;
    align-items:    flex-start;
    gap:            0;
    width:          100%;
  }

  .nav__link,
  .nav__logout-btn {
    display:    block;
    width:      100%;
    padding:    0.85rem var(--space-lg);
    border-bottom: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size:  1rem;
  }
  .nav__link:first-child { border-top: none; }

  .nav__link--cta {
    margin:        var(--space-sm) var(--space-lg);
    width:         calc(100% - 2 * var(--space-lg));
    text-align:    center;
    border-radius: 4px;
  }

  .nav__username {
    display:  block;
    padding:  0.85rem var(--space-lg) 0.25rem;
    font-size: 0.875rem;
  }

  /* Animated bars → X when open */
  .nav--open ~ * .nav__toggle-bar:nth-child(1),
  [aria-expanded="true"] .nav__toggle-bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }
  [aria-expanded="true"] .nav__toggle-bar:nth-child(2) { opacity: 0; }
  [aria-expanded="true"] .nav__toggle-bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background:  var(--footer-bg);
  color:       var(--footer-fg);
  font-family: var(--footer-font);
  font-size:   var(--footer-size);
}

/* Minimal footer */
.footer--minimal .footer__inner {
  max-width:   var(--max-content);
  margin:      0 auto;
  padding:     var(--space-md) var(--space-lg);
  display:     flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap:   wrap;
  gap:         var(--space-md);
}
.footer--minimal nav { display: flex; gap: var(--space-lg); }
.footer--minimal a   { color: var(--footer-fg); opacity: 0.7; text-decoration: none; }
.footer--minimal a:hover { opacity: 1; text-decoration: underline; }

/* Full footer */
.footer--full .footer__inner {
  max-width:   var(--max-content);
  margin:      0 auto;
  padding:     var(--space-2xl) var(--space-lg) var(--space-xl);
  display:     grid;
  grid-template-columns: 1fr auto auto;
  gap:         var(--space-2xl);
  align-items: start;
}

.footer__site-name {
  font-size:   1.1rem;
  font-weight: 700;
  color:       var(--footer-fg);
}

.footer__tagline {
  font-size:  0.875rem;
  opacity:    0.6;
  margin-top: var(--space-xs);
}

.footer__nav,
.footer__legal {
  display:        flex;
  flex-direction: column;
  gap:            var(--space-sm);
}

.footer__nav a,
.footer__legal a {
  color:           var(--footer-fg);
  text-decoration: none;
  font-size:       0.9rem;
  opacity:         0.7;
  transition:      opacity 0.15s;
}
.footer__nav a:hover,
.footer__legal a:hover { opacity: 1; text-decoration: underline; }

.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding:    var(--space-md) var(--space-lg);
  text-align: center;
  font-size:  0.8125rem;
  opacity:    0.5;
}

@media (max-width: 768px) {
  .footer--full .footer__inner {
    grid-template-columns: 1fr;
    gap:                   var(--space-xl);
  }
  .footer--minimal .footer__inner { flex-direction: column; text-align: center; }
  .footer--minimal nav             { justify-content: center; }
}

/* ============================================================
   BREADCRUMBS (app layout)
   ============================================================ */
.breadcrumb {
  background:  var(--form-bg);
  border-bottom: 1px solid var(--input-border);
  padding:     var(--space-sm) var(--space-lg);
}

.breadcrumb__list {
  max-width:   var(--max-content);
  margin:      0 auto;
  display:     flex;
  align-items: center;
  flex-wrap:   wrap;
  gap:         var(--space-xs);
  font-size:   0.875rem;
}

.breadcrumb__item { display: flex; align-items: center; gap: var(--space-xs); }
.breadcrumb__item a { color: var(--link); }
.breadcrumb__item--current { color: #666; }
.breadcrumb__sep { color: #999; }

/* ============================================================
   AUTH FORMS  (minimal layout)
   ============================================================ */
.auth-container {
  max-width:     var(--max-form);
  margin:        var(--space-xl) auto;
  background:    var(--form-bg);
  border-radius: var(--form-radius);
  box-shadow:    var(--form-shadow);
  padding:       var(--space-xl);
}

.auth-container h1 {
  font-size:     1.6rem;
  margin-bottom: var(--space-lg);
}

/* ── Form groups ─────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-md); }

.form-group label {
  display:       block;
  font-weight:   600;
  margin-bottom: var(--space-xs);
  font-size:     0.9375rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"] {
  width:         100%;
  padding:       0.6rem 0.75rem;
  font-size:     var(--body-size);
  font-family:   var(--body-font);
  border:        1.5px solid var(--input-border);
  border-radius: 4px;
  background:    #fff;
  color:         var(--body-fg);
  transition:    border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus {
  border-color: var(--input-focus);
  box-shadow:   0 0 0 3px color-mix(in srgb, var(--input-focus) 20%, transparent);
  outline:      none;
}
.form-group input[aria-invalid="true"] { border-color: var(--color-error); }

.field-hint  { display: block; font-size: 0.8125rem; color: #666; margin-top: var(--space-xs); }
.field-error { display: block; font-size: 0.875rem; color: var(--color-error); margin-top: var(--space-xs); font-weight: 600; }

/* ── Consent checkboxes ──────────────────────────────────── */
.consent-group {
  border: 1.5px solid var(--input-border);
  border-radius: var(--form-radius);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
}
.consent-group legend { font-weight: 700; padding: 0 var(--space-sm); }
.consent-intro { font-size: 0.875rem; color: #555; margin: var(--space-xs) 0 var(--space-md); }

.consent-item { display: flex; align-items: flex-start; gap: var(--space-sm); margin-bottom: var(--space-md); }
.consent-item:last-of-type { margin-bottom: 0; }
.consent-item input[type="checkbox"] {
  margin-top: 0.2em; width: 1.1rem; height: 1.1rem;
  flex-shrink: 0; accent-color: var(--input-focus); cursor: pointer;
}
.consent-item label { font-size: 0.9rem; line-height: 1.5; cursor: pointer; }

/* ── Buttons ─────────────────────────────────────────────── */
.required      { color: var(--color-error); margin-left: 2px; }
.required-note { font-size: 0.8125rem; color: #666; margin-bottom: var(--space-md); }
.form-actions  { margin-top: var(--space-lg); }

.btn {
  display:       inline-block;
  padding:       0.65rem 1.5rem;
  font-size:     var(--body-size);
  font-family:   var(--body-font);
  font-weight:   600;
  border:        none;
  border-radius: 4px;
  cursor:        pointer;
  text-decoration: none;
  transition:    background-color 0.15s, box-shadow 0.15s;
  line-height:   1.4;
}
.btn-primary   { background: var(--btn-bg);    color: var(--btn-fg); width: 100%; }
.btn-primary:hover, .btn-primary:focus { background: var(--btn-hover); color: var(--btn-fg); }
.btn-secondary { background: transparent; color: var(--btn-bg); border: 2px solid var(--btn-bg); }
.btn-secondary:hover, .btn-secondary:focus { background: var(--btn-bg); color: var(--btn-fg); }

.form-footer-link { text-align: center; margin-top: var(--space-md); font-size: 0.9rem; color: #555; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  border-radius: 4px; padding: var(--space-md);
  margin-bottom: var(--space-md); font-size: 0.9375rem; line-height: 1.5;
}
.alert--error {
  background: color-mix(in srgb, var(--color-error) 10%, white);
  border: 1.5px solid var(--color-error); color: var(--color-error);
}
.alert--error a { color: var(--color-error); font-weight: 700; }
.alert--success {
  background: color-mix(in srgb, var(--color-success) 10%, white);
  border: 1.5px solid var(--color-success); color: var(--color-success);
}
.alert--info {
  background: color-mix(in srgb, var(--input-focus) 10%, white);
  border: 1.5px solid var(--input-focus); color: var(--body-fg);
}
.alert ul { margin: var(--space-xs) 0 0 var(--space-md); }
.alert ul li { margin-bottom: var(--space-xs); }
.alert ul a  { color: inherit; }

/* ============================================================
   APP ZONE — cards, profile, info lists
   ============================================================ */
.page-container {
  max-width: var(--max-content);
  margin:    0 auto;
}

.page-header {
  margin-bottom: var(--space-xl);
}
.page-header h1 { font-size: 1.8rem; }
.page-header p  { color: #666; margin-top: var(--space-xs); }

.card {
  background:    var(--form-bg);
  border-radius: var(--form-radius);
  box-shadow:    var(--form-shadow);
  padding:       var(--space-xl);
  margin-bottom: var(--space-xl);
}
.card h2 {
  font-size:      1.05rem;
  margin-bottom:  var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom:  1.5px solid var(--input-border);
}
.card--warning { border: 1.5px solid color-mix(in srgb, var(--color-error) 40%, transparent); }

.profile-container { max-width: 640px; margin: 0 auto; }
.profile-container h1 { font-size: 1.8rem; margin-bottom: var(--space-xl); }

.info-list {
  display: grid; grid-template-columns: max-content 1fr;
  gap: var(--space-xs) var(--space-lg); align-items: baseline;
}
.info-list dt { font-weight: 600; color: #555; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }
.info-list dd { font-size: 0.9375rem; }

.radio-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

/* ── Badge ───────────────────────────────────────────────── */
.badge { display: inline-block; padding: 0.2em 0.6em; border-radius: 999px; font-size: 0.8125rem; font-weight: 700; }
.badge--active {
  background: color-mix(in srgb, var(--color-success) 15%, white);
  color: var(--color-success); border: 1px solid var(--color-success);
}

/* ── Text utilities ──────────────────────────────────────── */
.text-muted  { color: #777; font-size: 0.875rem; }
.text-center { text-align: center; }

/* ============================================================
   PUBLIC ZONE — marketing page utilities
   ============================================================ */
.section {
  padding: var(--space-2xl) var(--space-md);
}
.section__inner {
  max-width: var(--max-content);
  margin:    0 auto;
}
.section--alt { background: var(--form-bg); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  main { padding: var(--space-lg) var(--space-md); }

  .auth-container, .card {
    padding:       var(--space-lg) var(--space-md);
    border-radius: 0;
    box-shadow:    none;
  }

  .info-list { grid-template-columns: 1fr; }
  .info-list dt { margin-top: var(--space-sm); }

  .footer--full .footer__inner { grid-template-columns: 1fr; }

  .breadcrumb { padding: var(--space-xs) var(--space-md); }
}

@media (max-width: 480px) {
  .header__site-name { font-size: 1rem; }
  .auth-container h1 { font-size: 1.35rem; }
}

/* ============================================================
   HOME PAGE
   ============================================================ */

/* Hero */
.hero {
  background:  var(--header-bg);
  color:       var(--header-fg);
  padding:     var(--space-2xl) var(--space-md);
  text-align:  center;
}
.hero__inner {
  max-width: var(--max-content);
  margin:    0 auto;
}
.hero__headline {
  font-size:     clamp(2rem, 5vw, 3.2rem);
  font-weight:   700;
  line-height:   1.15;
  margin-bottom: var(--space-md);
  color:         var(--header-fg);
}
.hero__subtext {
  font-size:     clamp(1rem, 2.5vw, 1.25rem);
  opacity:       0.8;
  max-width:     640px;
  margin:        0 auto var(--space-xl);
  line-height:   1.6;
}
.hero__actions {
  display:         flex;
  gap:             var(--space-md);
  justify-content: center;
  flex-wrap:       wrap;
}

.btn-hero-primary {
  background:    var(--nav-cta-bg);
  color:         var(--nav-cta-fg);
  padding:       0.85rem 2rem;
  border-radius: 4px;
  font-weight:   700;
  font-size:     1.0625rem;
  text-decoration: none;
  transition:    background 0.15s;
  display:       inline-block;
}
.btn-hero-primary:hover,
.btn-hero-primary:focus {
  background: var(--nav-cta-hover);
  color:      var(--nav-cta-fg);
}

.btn-hero-secondary {
  background:    transparent;
  color:         var(--header-fg);
  padding:       0.85rem 2rem;
  border-radius: 4px;
  font-weight:   600;
  font-size:     1.0625rem;
  text-decoration: none;
  border:        2px solid rgba(255,255,255,0.4);
  transition:    border-color 0.15s, color 0.15s;
  display:       inline-block;
}
.btn-hero-secondary:hover,
.btn-hero-secondary:focus {
  border-color: var(--header-fg);
  color:        var(--header-fg);
}

/* Features grid */
.section__heading {
  font-size:     clamp(1.5rem, 3vw, 2rem);
  font-weight:   700;
  text-align:    center;
  margin-bottom: var(--space-2xl);
}

.feature-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap:                   var(--space-xl);
}

.feature-card {
  background:    var(--form-bg);
  border-radius: var(--form-radius);
  padding:       var(--space-xl);
  text-align:    center;
  box-shadow:    var(--form-shadow);
  transition:    transform 0.15s;
}
.feature-card:hover { transform: translateY(-2px); }

.feature-card__icon {
  font-size:     2.5rem;
  margin-bottom: var(--space-md);
  color:         var(--btn-bg);
  line-height:   1;
}
.feature-card__title {
  font-size:     1.15rem;
  font-weight:   700;
  margin-bottom: var(--space-sm);
}
.feature-card__desc {
  font-size:  0.9375rem;
  color:      #555;
  line-height: 1.6;
}

/* CTA section */
.cta-section {
  background:  var(--btn-bg);
  color:       var(--btn-fg);
  text-align:  center;
}
.cta-section__inner {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            var(--space-md);
}
.cta-section__headline {
  font-size:   clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color:       var(--btn-fg);
}
.cta-section__subtext {
  font-size: 1.0625rem;
  opacity:   0.85;
}
.btn-cta {
  background:    var(--nav-cta-bg);
  color:         var(--nav-cta-fg);
  padding:       0.85rem 2.5rem;
  border-radius: 4px;
  font-weight:   700;
  font-size:     1.0625rem;
  text-decoration: none;
  margin-top:    var(--space-sm);
  display:       inline-block;
  transition:    background 0.15s;
}
.btn-cta:hover,
.btn-cta:focus { background: var(--nav-cta-hover); color: var(--nav-cta-fg); }

@media (max-width: 768px) {
  .hero { padding: var(--space-xl) var(--space-md); }
  .hero__actions { flex-direction: column; align-items: center; }
  .btn-hero-primary,
  .btn-hero-secondary { width: 100%; max-width: 320px; text-align: center; }
  .feature-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   LEGAL PAGES
   ============================================================ */
.legal-page { padding: var(--space-xl) var(--space-md); }

.legal-page__inner {
  max-width:  760px;
  margin:     0 auto;
}

.legal-page__header {
  border-bottom: 2px solid var(--input-border);
  padding-bottom: var(--space-lg);
  margin-bottom:  var(--space-xl);
}

.legal-page__header h1 {
  font-size:     clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: var(--space-xs);
}

.legal-page__meta {
  font-size: 0.875rem;
  color:     #666;
}

.legal-page__body h2 {
  font-size:     1.1rem;
  font-weight:   700;
  margin:        var(--space-xl) 0 var(--space-sm);
  color:         var(--body-fg);
}

.legal-page__body h2:first-child { margin-top: 0; }

.legal-page__body p {
  margin-bottom: var(--space-md);
  line-height:   1.7;
  color:         #333;
}

.legal-page__body ul,
.legal-page__body ol {
  list-style:    disc;
  margin:        0 0 var(--space-md) var(--space-xl);
  line-height:   1.7;
  color:         #333;
}

.legal-page__body ol { list-style: decimal; }

.legal-page__body li { margin-bottom: var(--space-xs); }

.legal-page__footer {
  border-top:  1px solid var(--input-border);
  padding-top: var(--space-lg);
  margin-top:  var(--space-2xl);
  font-size:   0.9rem;
  color:       #666;
}

/* Legal table (cookie policy) */
.legal-table {
  width:           100%;
  border-collapse: collapse;
  font-size:       0.9rem;
  margin:          var(--space-md) 0 var(--space-xl);
}
.legal-table th {
  background:    var(--form-bg);
  padding:       0.6rem 0.75rem;
  text-align:    left;
  font-weight:   700;
  border:        1px solid var(--input-border);
  white-space:   nowrap;
}
.legal-table td {
  padding:       0.6rem 0.75rem;
  border:        1px solid var(--input-border);
  vertical-align: top;
  line-height:   1.5;
}

@media (max-width: 600px) {
  .legal-table { font-size: 0.8rem; }
  .legal-table th,
  .legal-table td { padding: 0.4rem 0.5rem; }
}

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-headline {
  font-size:     clamp(2rem, 4vw, 2.8rem);
  font-weight:   700;
  margin-bottom: var(--space-xl);
}

.about-mission__inner {
  max-width: 760px;
  margin:    0 auto;
}

.about-mission__block h2 {
  font-size:     1.4rem;
  font-weight:   700;
  margin-bottom: var(--space-md);
  color:         var(--btn-bg);
}

.about-mission__text {
  font-size:   1.0625rem;
  line-height: 1.8;
  color:       #444;
}

.values-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:                   var(--space-xl);
}

.value-card {
  background:    var(--form-bg);
  border-radius: var(--form-radius);
  padding:       var(--space-xl);
  text-align:    center;
  box-shadow:    var(--form-shadow);
}

.value-card__icon {
  font-size:     2rem;
  color:         var(--btn-bg);
  margin-bottom: var(--space-md);
  line-height:   1;
}

.value-card__title {
  font-size:     1.1rem;
  font-weight:   700;
  margin-bottom: var(--space-sm);
}

.value-card__desc {
  font-size:   0.9375rem;
  color:       #555;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .values-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   PRICING PAGE
   ============================================================ */

/* Header */
.pricing-header { text-align: center; }
.pricing-header__inner {
  max-width:      var(--max-content);
  margin:         0 auto;
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            var(--space-lg);
}
.pricing-header__headline {
  font-size:   clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
}
.pricing-header__subtext {
  font-size: 1.0625rem;
  color:     #555;
  max-width: 560px;
}

/* Billing toggle */
.billing-toggle {
  display:     flex;
  align-items: center;
  gap:         var(--space-md);
}
.billing-toggle__label {
  font-size:   0.9375rem;
  font-weight: 500;
  color:       #666;
  transition:  color 0.15s;
}
.billing-toggle__label--active { color: var(--body-fg); font-weight: 700; }

.billing-toggle__switch {
  position:      relative;
  width:         52px;
  height:        28px;
  border-radius: 999px;
  background:    var(--input-border);
  border:        none;
  cursor:        pointer;
  padding:       0;
  transition:    background 0.2s;
  flex-shrink:   0;
}
.billing-toggle__switch--active { background: var(--btn-bg); }
.billing-toggle__switch:focus-visible {
  outline: 3px solid var(--input-focus);
  outline-offset: 2px;
}
.billing-toggle__knob {
  position:      absolute;
  top:           3px;
  left:          3px;
  width:         22px;
  height:        22px;
  border-radius: 50%;
  background:    #fff;
  box-shadow:    0 1px 4px rgba(0,0,0,0.2);
  transition:    transform 0.2s;
  display:       block;
}
.billing-toggle__switch--active .billing-toggle__knob { transform: translateX(24px); }
.billing-toggle__save {
  display:       inline-block;
  background:    color-mix(in srgb, var(--color-success) 15%, white);
  color:         var(--color-success);
  border:        1px solid var(--color-success);
  font-size:     0.75rem;
  font-weight:   700;
  padding:       0.1em 0.5em;
  border-radius: 3px;
  margin-left:   var(--space-xs);
  vertical-align: middle;
}

/* Pricing grid */
.pricing-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap:                   var(--space-lg);
  align-items:           start;
}

/* Pricing card */
.pricing-card {
  background:     var(--form-bg);
  border-radius:  var(--form-radius);
  border:         2px solid var(--input-border);
  padding:        var(--space-xl);
  position:       relative;
  display:        flex;
  flex-direction: column;
  gap:            var(--space-lg);
  transition:     box-shadow 0.15s;
}
.pricing-card:hover { box-shadow: var(--form-shadow); }
.pricing-card--highlight {
  border-color: var(--btn-bg);
  box-shadow:   0 4px 24px rgba(0, 87, 184, 0.15);
}
.pricing-card__badge {
  position:       absolute;
  top:            -14px;
  left:           50%;
  transform:      translateX(-50%);
  background:     var(--btn-bg);
  color:          var(--btn-fg);
  font-size:      0.75rem;
  font-weight:    700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding:        0.3em 1em;
  border-radius:  999px;
  white-space:    nowrap;
}
.pricing-card__name { font-size: 1.25rem; font-weight: 700; }
.pricing-card__desc { font-size: 0.9rem; color: #666; margin-top: var(--space-xs); }

.pricing-price__amount  { font-size: 2.2rem; font-weight: 800; color: var(--body-fg); }
.pricing-price__period  { font-size: 0.9rem; color: #666; margin-left: 2px; }
.pricing-price__note    { display: block; font-size: 0.8rem; color: var(--color-success); font-weight: 600; margin-top: var(--space-xs); }

.pricing-card__cta { display: block; text-align: center; width: 100%; padding: 0.7rem 1rem; }

.pricing-features {
  list-style:     none;
  display:        flex;
  flex-direction: column;
  gap:            var(--space-sm);
  margin:         0;
  flex:           1;
}
.pricing-feature         { display: flex; align-items: flex-start; gap: var(--space-sm); font-size: 0.9rem; line-height: 1.4; }
.pricing-feature__icon   { font-size: 0.875rem; font-weight: 700; flex-shrink: 0; margin-top: 0.1em; width: 1.2em; text-align: center; }
.pricing-feature--yes .pricing-feature__icon { color: var(--color-success); }
.pricing-feature--no  .pricing-feature__icon { color: #ccc; }
.pricing-feature__text--muted { color: #aaa; }

/* FAQ */
.pricing-faq__inner { max-width: 720px; margin: 0 auto; }
.faq-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.faq-item { border: 1.5px solid var(--input-border); border-radius: var(--form-radius); overflow: hidden; }
.faq-item__question {
  padding:         var(--space-md) var(--space-lg);
  font-weight:     600;
  font-size:       0.9375rem;
  cursor:          pointer;
  list-style:      none;
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  background:      var(--form-bg);
  transition:      background 0.15s;
}
.faq-item__question::-webkit-details-marker { display: none; }
.faq-item__question::after { content: '▸'; font-size: 0.8rem; opacity: 0.5; transition: transform 0.2s; flex-shrink: 0; margin-left: var(--space-md); }
.faq-item[open] .faq-item__question { background: color-mix(in srgb, var(--btn-bg) 5%, white); }
.faq-item[open] .faq-item__question::after { transform: rotate(90deg); }
.faq-item__question:hover { background: color-mix(in srgb, var(--btn-bg) 5%, white); }
.faq-item__question:focus-visible { outline: 3px solid var(--input-focus); outline-offset: -3px; }
.faq-item__answer { padding: var(--space-md) var(--space-lg); font-size: 0.9375rem; color: #444; line-height: 1.6; border-top: 1px solid var(--input-border); }

@media (max-width: 768px) {
  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
  .billing-toggle { flex-wrap: wrap; justify-content: center; }
}

/* ============================================================
   FOOTER — attribution line
   ============================================================ */
.footer__attribution {
  margin-top: var(--space-xs);
  font-size:  0.75rem;
  opacity:    0.5;
}
.footer__attribution a {
  color: inherit;
  text-decoration: underline;
}

/* ============================================================
   BETA READER APP
   ============================================================ */

.br-page-header {
  max-width:     var(--max-content);
  margin:        0 auto var(--space-sm);
}
.br-page-title {
  font-size:     1.8rem;
  font-weight:   700;
  display:       flex;
  align-items:   center;
  gap:           var(--space-sm);
  margin-bottom: var(--space-xs);
}
.br-page-subtitle { color: #666; font-size: 0.9375rem; }
.br-privacy-note  {
  display:     inline-block;
  margin-left: var(--space-md);
  font-size:   0.8125rem;
  color:       var(--color-success);
  font-style:  italic;
}

/* Badge */
.br-badge {
  display:        inline-block;
  padding:        0.15em 0.55em;
  border-radius:  999px;
  font-size:      0.75rem;
  font-weight:    700;
  background:     color-mix(in srgb, var(--input-focus) 12%, white);
  color:          var(--input-focus);
  border:         1px solid var(--input-focus);
  vertical-align: middle;
}

/* ── Engine selector bar ─────────────────────────────────── */
.br-engine-bar {
  display:       flex;
  align-items:   center;
  gap:           var(--space-md);
  max-width:     var(--max-content);
  margin:        0 auto var(--space-lg);
  background:    var(--form-bg);
  border-radius: var(--form-radius);
  box-shadow:    var(--form-shadow);
  padding:       var(--space-sm) var(--space-lg);
}
.br-engine-bar__label {
  font-size:      0.75rem;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color:          #666;
  white-space:    nowrap;
  flex-shrink:    0;
}
.br-engine-bar__select {
  flex:          1;
  padding:       0.4rem 0.6rem;
  font-size:     0.9375rem;
  font-family:   var(--body-font);
  border:        1.5px solid var(--input-border);
  border-radius: 4px;
  background:    #fff;
  color:         var(--body-fg);
  cursor:        pointer;
}
.br-engine-bar__select:focus {
  border-color: var(--input-focus);
  outline:      none;
  box-shadow:   0 0 0 3px color-mix(in srgb, var(--input-focus) 20%, transparent);
}

/* ── Layout ──────────────────────────────────────────────── */
.br-layout {
  display:               grid;
  grid-template-columns: 240px 1fr;
  gap:                   var(--space-lg);
  max-width:             var(--max-content);
  margin:                0 auto;
  align-items:           start;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.br-sidebar {
  background:    var(--form-bg);
  border-radius: var(--form-radius);
  box-shadow:    var(--form-shadow);
  padding:       var(--space-lg);
  position:      sticky;
  top:           calc(var(--header-h) + var(--space-md));
}
.br-sidebar__label {
  display:        block;
  font-size:      0.75rem;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color:          #666;
  margin-bottom:  var(--space-xs);
}
.br-project-select {
  width:         100%;
  padding:       0.5rem 0.6rem;
  font-size:     0.9375rem;
  font-family:   var(--body-font);
  border:        1.5px solid var(--input-border);
  border-radius: 4px;
  background:    #fff;
  color:         var(--body-fg);
  cursor:        pointer;
  margin-bottom: var(--space-sm);
}
.br-project-select:focus {
  border-color: var(--input-focus);
  outline:      none;
  box-shadow:   0 0 0 3px color-mix(in srgb, var(--input-focus) 20%, transparent);
}
.br-new-project-btn {
  display:       block;
  width:         100%;
  padding:       0.5rem 0.75rem;
  font-size:     0.875rem;
  font-family:   var(--body-font);
  font-weight:   600;
  color:         var(--btn-bg);
  background:    color-mix(in srgb, var(--btn-bg) 8%, white);
  border:        1.5px dashed var(--btn-bg);
  border-radius: 4px;
  cursor:        pointer;
  text-align:    center;
  transition:    background 0.15s;
}
.br-new-project-btn:hover,
.br-new-project-btn:focus { background: color-mix(in srgb, var(--btn-bg) 15%, white); outline: none; }

.br-sidebar__divider { border: none; border-top: 1px solid var(--input-border); margin: var(--space-md) 0; }

.br-sidebar__info {
  display:               grid;
  grid-template-columns: auto 1fr;
  gap:                   var(--space-xs) var(--space-md);
  font-size:             0.875rem;
  align-items:           baseline;
}
.br-sidebar__info dt {
  font-weight:    600;
  color:          #777;
  text-transform: uppercase;
  font-size:      0.7rem;
  letter-spacing: 0.04em;
  white-space:    nowrap;
}
.br-sidebar__info dd { color: var(--body-fg); }

/* Chapter stats scroll table */
.br-chapter-stats {
  max-height:    140px;
  overflow-y:    auto;
  border:        1px solid var(--input-border);
  border-radius: 4px;
  margin-top:    var(--space-xs);
}
.br-stats-table {
  width:           100%;
  border-collapse: collapse;
  font-size:       0.8rem;
}
.br-stats-table th {
  background:     #f4f5f7;
  padding:        0.3rem 0.5rem;
  text-align:     left;
  font-weight:    700;
  font-size:      0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color:          #666;
  border-bottom:  1px solid var(--input-border);
  border-right:   1px solid var(--input-border);
  position:       sticky;
  top:            0;
}
.br-stats-table th:last-child { border-right: none; }
.br-stats-table td {
  padding:      0.35rem 0.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--input-border) 50%, transparent);
  border-right:  1px solid color-mix(in srgb, var(--input-border) 60%, transparent);
}
.br-stats-table td:last-child { border-right: none; }
.br-stats-table__row--latest td {
  background:  color-mix(in srgb, var(--input-focus) 6%, white);
  font-weight: 600;
}
.br-stats-table tfoot td {
  border-top:    1.5px solid var(--input-border);
  border-bottom: none;
  background:    #f4f5f7;
  font-size:     0.75rem;
  font-weight:   700;
}
.br-stats__legend { font-size: 0.7rem; color: #999; margin-top: var(--space-xs); font-style: italic; }

/* ── Main workspace ────────────────────────────────────────── */
.br-main { display: flex; flex-direction: column; gap: var(--space-lg); }

/* Shared panel */
.br-panel {
  background:    var(--form-bg);
  border-radius: var(--form-radius);
  box-shadow:    var(--form-shadow);
  padding:       var(--space-lg);
}
.br-panel__heading {
  font-size:      0.9375rem;
  font-weight:    700;
  margin-bottom:  var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom:  1.5px solid var(--input-border);
  color:          var(--body-fg);
  display:        flex;
  align-items:    baseline;
  gap:            var(--space-sm);
  flex-wrap:      wrap;
}
.br-panel__heading-hint { font-size: 0.8rem; font-weight: 400; color: #999; font-style: italic; }
.br-panel--settings { padding: var(--space-md) var(--space-lg); }

/* Settings */
.br-settings__label-row { margin-bottom: var(--space-sm); }
.br-settings__section-label { font-size: 0.8125rem; font-weight: 700; color: #555; }
.br-settings__note { font-size: 0.8rem; font-weight: 400; color: #999; margin-left: var(--space-xs); }
.br-settings__row { display: flex; flex-wrap: wrap; gap: var(--space-md); align-items: flex-end; }
.br-settings__group { display: flex; flex-direction: column; gap: var(--space-xs); flex: 1; min-width: 130px; }
.br-settings__label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #666; }

.br-select {
  padding:       0.45rem 0.6rem;
  font-size:     0.9rem;
  font-family:   var(--body-font);
  border:        1.5px solid var(--input-border);
  border-radius: 4px;
  background:    #fff;
  color:         var(--body-fg);
  cursor:        pointer;
}
.br-select:focus { border-color: var(--input-focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--input-focus) 20%, transparent); }
.br-select--sm { font-size: 0.8125rem; padding: 0.3rem 0.5rem; }

.br-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }

/* ── Bible panel ────────────────────────────────────────────── */
.br-panel--bible { padding: var(--space-lg); }

.br-bible__title-area { text-align: center; margin-bottom: var(--space-md); }
.br-bible__heading {
  font-size:     0.9375rem;
  font-weight:   700;
  color:         var(--body-fg);
  margin-bottom: var(--space-sm);
}
.br-bible__actions {
  display:         flex;
  justify-content: center;
  gap:             var(--space-lg);
  margin-bottom:   var(--space-md);
}
.br-bible__action-link { font-size: 0.8125rem; font-weight: 600; color: var(--btn-bg); text-decoration: none; }
.br-bible__action-link:hover { text-decoration: underline; }
.br-bible__title-hr { border: none; border-top: 1.5px solid var(--input-border); margin: 0 0 var(--space-md); }

.br-upload__zone {
  border:        2px dashed var(--input-border);
  border-radius: var(--form-radius);
  padding:       var(--space-md);
  text-align:    center;
  cursor:        pointer;
  transition:    border-color 0.15s, background 0.15s;
}
.br-upload__zone:hover,
.br-upload__zone:focus { border-color: var(--input-focus); background: color-mix(in srgb, var(--input-focus) 5%, white); outline: none; }
.br-upload__icon     { font-size: 1.5rem; margin-bottom: var(--space-xs); line-height: 1; }
.br-upload__filename { font-size: 0.875rem; font-weight: 600; color: var(--body-fg); margin-bottom: 2px; }
.br-upload__hint     { font-size: 0.75rem; color: #999; }

/* Parsed bible content */
.br-bible__parsed { margin-top: var(--space-md); }
.br-bible__section { margin-bottom: var(--space-md); }
.br-bible__section:last-child { margin-bottom: 0; }
.br-bible__section-label {
  display:        block;
  font-size:      0.7rem;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color:          var(--btn-bg);
  margin-bottom:  var(--space-xs);
  padding-bottom: var(--space-xs);
  border-bottom:  1.5px solid var(--input-border);
}
.br-bible__table {
  width:           100%;
  border-collapse: collapse;
  font-size:       0.8rem;
}
.br-bible__table th {
  padding:        0.25rem 0.4rem;
  text-align:     left;
  font-weight:    700;
  font-size:      0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color:          #888;
  border-bottom:  1px solid var(--input-border);
  border-right:   1px solid color-mix(in srgb, var(--input-border) 60%, transparent);
}
.br-bible__table th:last-child { border-right: none; }
.br-bible__table td {
  padding:       0.3rem 0.4rem;
  border-bottom: 1px solid color-mix(in srgb, var(--input-border) 40%, transparent);
  border-right:  1px solid color-mix(in srgb, var(--input-border) 40%, transparent);
  color:         #333;
}
.br-bible__table td:last-child { border-right: none; }
.br-bible__table tr:last-child td { border-bottom: none; }

/* ── Processing options ─────────────────────────────────────── */
.br-checks {
  border:         none;
  padding:        0;
  margin:         0;
  display:        flex;
  flex-direction: column;
  gap:            var(--space-xs);
}
.br-check-item {
  display:     flex;
  align-items: center;
  gap:         var(--space-xs);
}
.br-check-item__label {
  display:     flex;
  align-items: center;
  gap:         var(--space-xs);
  font-size:   0.875rem;
  font-weight: 500;
  cursor:      pointer;
  user-select: none;
}
.br-check-item__input {
  width:        1rem;
  height:       1rem;
  flex-shrink:  0;
  accent-color: var(--input-focus);
  cursor:       pointer;
}

/* Tooltip */
.br-tooltip-wrap {
  position:   relative;
  display:    inline-flex;
  align-items: center;
  margin-left: 2px;
}
.br-tooltip-icon {
  display:       inline-flex;
  align-items:   center;
  justify-content: center;
  width:         16px;
  height:        16px;
  border-radius: 50%;
  border:        1.5px solid #aaa;
  font-size:     0.65rem;
  font-weight:   700;
  color:         #888;
  cursor:        help;
  flex-shrink:   0;
  line-height:   1;
  transition:    border-color 0.15s, color 0.15s;
}
.br-tooltip-wrap:hover .br-tooltip-icon {
  border-color: var(--input-focus);
  color:        var(--input-focus);
}
.br-tooltip-text {
  position:      absolute;
  bottom:        calc(100% + 6px);
  left:          50%;
  transform:     translateX(-50%);
  min-width:     200px;
  max-width:     280px;
  background:    #1e1e2e;
  color:         #e0e0e0;
  font-size:     0.75rem;
  line-height:   1.5;
  padding:       0.5rem 0.75rem;
  border-radius: 4px;
  box-shadow:    0 4px 12px rgba(0,0,0,0.25);
  pointer-events: none;
  opacity:       0;
  transition:    opacity 0.15s;
  z-index:       50;
  white-space:   normal;
  font-weight:   400;
}
.br-tooltip-wrap:hover .br-tooltip-text { opacity: 1; }

/* ── Editor ─────────────────────────────────────────────────── */
.br-editor { border: 1.5px solid var(--input-border); border-radius: 4px; overflow: hidden; }
.br-editor__toolbar {
  display:       flex;
  align-items:   center;
  flex-wrap:     wrap;
  gap:           2px;
  padding:       var(--space-sm) var(--space-md);
  background:    #f4f5f7;
  border-bottom: 1px solid var(--input-border);
}
.br-editor__tool {
  background:    none;
  border:        1px solid transparent;
  border-radius: 3px;
  padding:       0.2rem 0.5rem;
  cursor:        pointer;
  font-size:     0.875rem;
  font-family:   var(--body-font);
  color:         var(--body-fg);
  line-height:   1.4;
  min-width:     28px;
  text-align:    center;
  transition:    background 0.1s;
}
.br-editor__tool:hover,
.br-editor__tool:focus { background: #e0e2e6; border-color: var(--input-border); outline: none; }
.br-editor__tool-sep { display: inline-block; width: 1px; height: 18px; background: var(--input-border); margin: 0 var(--space-xs); flex-shrink: 0; }
.br-editor__content {
  min-height:  380px;
  max-height:  560px;
  overflow-y:  auto;
  padding:     var(--space-lg);
  outline:     none;
  font-family: Georgia, 'Times New Roman', serif;
  font-size:   1rem;
  line-height: 1.85;
  color:       var(--body-fg);
}
.br-editor__content:empty::before { content: attr(aria-placeholder); color: #aaa; pointer-events: none; }
.br-editor__content p  { margin-bottom: var(--space-md); }
.br-editor__content h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: var(--space-sm); }
.br-editor__content h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: var(--space-sm); }
.br-editor__footer {
  display:       flex;
  align-items:   center;
  gap:           var(--space-lg);
  padding:       var(--space-xs) var(--space-md);
  background:    #f4f5f7;
  border-top:    1px solid var(--input-border);
  font-size:     0.8rem;
  color:         #888;
}
.br-editor__hint { margin-left: auto; font-style: italic; }

/* ── Submit ──────────────────────────────────────────────────── */
.br-submit-row { display: flex; justify-content: flex-start; width: 100% }
.br-submit-btn {
  padding:       0.7rem 1.75rem;
  font-size:     1rem;
  font-family:   var(--body-font);
  font-weight:   700;
  background:    var(--btn-bg);
  color:         var(--btn-fg);
  border:        none;
  border-radius: 4px;
  cursor:        pointer;
  transition:    background 0.15s, box-shadow 0.15s;
}
.br-submit-btn:hover,
.br-submit-btn:focus { background: var(--btn-hover); box-shadow: 0 2px 8px rgba(0,0,0,0.15); outline: none; }

/* ── Results ─────────────────────────────────────────────────── */
.br-results {
  background:    var(--form-bg);
  border-radius: var(--form-radius);
  box-shadow:    var(--form-shadow);
  overflow:      hidden;
  width:         100%;
}
.br-results__header {
  padding:       var(--space-md) var(--space-lg);
  border-bottom: 1.5px solid var(--input-border);
  background:    #f4f5f7;
}
.br-results__header .br-panel__heading { margin: 0 0 var(--space-sm); padding: 0; border: none; }

.br-results__selectors { width: 100%; }
.br-results__selector-row {
  display:     flex;
  gap:         var(--space-md);
  align-items: flex-end;
}
.br-results__control-group { display: flex; flex-direction: column; gap: var(--space-xs); }
.br-results__control-group--wide { flex: 1; }
.br-results__control-label {
  font-size:      0.7rem;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color:          #666;
}
.br-results__chapter-select { width: 100%; }

.br-results__tabbar {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         0 var(--space-lg);
  border-bottom:   1px solid var(--input-border);
  background:      #f4f5f7;
}
.br-results__tabs { display: flex; }
.br-results__tab {
  padding:       0.55rem 1rem;
  font-size:     0.875rem;
  font-weight:   600;
  color:         #666;
  background:    none;
  border:        none;
  border-bottom: 2px solid transparent;
  cursor:        pointer;
  transition:    color 0.15s, border-color 0.15s;
}
.br-results__tab:hover { color: var(--body-fg); }
.br-results__tab--active { color: var(--btn-bg); border-color: var(--btn-bg); }
.br-results__tab:focus { outline: 3px solid var(--input-focus); outline-offset: -3px; }

.br-export-btn {
  padding:       0.3rem 0.75rem;
  font-size:     0.8rem;
  font-family:   var(--body-font);
  font-weight:   600;
  color:         #aaa;
  background:    none;
  border:        1px solid #ddd;
  border-radius: 4px;
  cursor:        not-allowed;
}

.br-results__pane { padding: var(--space-lg); min-height: 200px; }

.br-results__summary-bar {
  display:        flex;
  flex-wrap:      wrap;
  gap:            var(--space-xl);
  margin-bottom:  var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom:  1px solid var(--input-border);
}
.br-results__summary-item { display: flex; flex-direction: column; gap: 2px; }
.br-results__summary-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #888; }
.br-results__summary-value { font-size: 0.9375rem; font-weight: 600; color: var(--body-fg); }
.br-sentiment--tense { color: #8b4513; }

.br-results__section { margin-bottom: var(--space-lg); }
.br-results__section:last-of-type { margin-bottom: 0; }
.br-results__section-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--btn-bg); margin-bottom: var(--space-sm); }
.br-results__section p  { font-size: 0.9375rem; line-height: 1.7; color: #333; }
.br-results__list { list-style: disc; padding-left: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-xs); }
.br-results__list li { font-size: 0.9375rem; line-height: 1.6; color: #333; }

/* Metrics */
.br-metrics__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-xl); }
.br-metric-card { background: #f4f5f7; border-radius: var(--form-radius); border: 1px solid var(--input-border); padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-xs); text-align: center; }
.br-metric-card__value { font-size: 1.5rem; font-weight: 800; color: var(--btn-bg); line-height: 1; }
.br-metric-card__label { font-size: 0.75rem; font-weight: 600; color: #555; line-height: 1.3; }
.br-metric-card__sublabel { display: block; font-size: 0.7rem; font-weight: 400; color: #999; margin-top: 2px; }
.br-metrics__vs-note { font-size: 0.9375rem; color: #555; line-height: 1.6; }

/* Markdown */
.br-results__md { background: #1e1e2e; color: #cdd6f4; border-radius: 4px; padding: var(--space-lg); font-size: 0.875rem; line-height: 1.7; overflow-x: auto; white-space: pre-wrap; font-family: 'Courier New', Courier, monospace; }

/* ── Modal ───────────────────────────────────────────────────── */
.br-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.br-modal-overlay--open { opacity: 1; pointer-events: auto; }
.br-modal { background: var(--form-bg); border-radius: var(--form-radius); box-shadow: 0 8px 40px rgba(0,0,0,0.25); padding: var(--space-xl); width: 100%; max-width: 420px; transform: translateY(-16px); transition: transform 0.2s; }
.br-modal-overlay--open .br-modal { transform: translateY(0); }
.br-modal__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-lg); }
.br-modal__title  { font-size: 1.2rem; font-weight: 700; }
.br-modal__close  { background: none; border: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: #999; padding: 0.2rem 0.4rem; border-radius: 3px; }
.br-modal__close:hover { color: var(--body-fg); }
.br-modal__close:focus { outline: 3px solid var(--input-focus); outline-offset: 2px; }
.br-modal__label  { display: block; font-weight: 600; margin-bottom: var(--space-xs); font-size: 0.9375rem; }
.br-modal__input  { width: 100%; padding: 0.6rem 0.75rem; font-size: var(--body-size); font-family: var(--body-font); border: 1.5px solid var(--input-border); border-radius: 4px; background: #fff; color: var(--body-fg); }
.br-modal__input:focus { border-color: var(--input-focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--input-focus) 20%, transparent); }
.br-modal__input[aria-invalid="true"] { border-color: var(--color-error); }
.br-modal__actions { display: flex; justify-content: flex-end; gap: var(--space-md); margin-top: var(--space-lg); }
.br-modal__btn { padding: 0.6rem 1.25rem; font-size: 0.9375rem; font-family: var(--body-font); font-weight: 600; border-radius: 4px; cursor: pointer; border: none; transition: background 0.15s; }
.br-modal__btn--cancel { background: #e8eaee; color: var(--body-fg); }
.br-modal__btn--cancel:hover { background: #d8dae0; }
.br-modal__btn--create { background: var(--btn-bg); color: var(--btn-fg); }
.br-modal__btn--create:hover { background: var(--btn-hover); }
.br-modal__btn:focus { outline: 3px solid var(--input-focus); outline-offset: 2px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .br-layout  { grid-template-columns: 1fr; }
  .br-sidebar { position: static; }
}
@media (max-width: 600px) {
  .br-two-col                    { grid-template-columns: 1fr; }
  .br-settings__group            { min-width: 100%; }
  .br-results__selector-row      { flex-direction: column; }
  .br-results__control-group--wide { width: 100%; }
  .br-results__tabbar            { flex-direction: column; align-items: flex-start; gap: var(--space-xs); padding: var(--space-sm) var(--space-md); }
  .br-metrics__grid              { grid-template-columns: repeat(2, 1fr); }
  .br-modal                      { margin: var(--space-md); max-width: 100%; }
  .br-tooltip-text               { left: auto; right: 0; transform: none; }
}


/* ============================================================
   APPS DASHBOARD
   ============================================================ */

.apps-dashboard {
  max-width: var(--max-content);
  margin:    0 auto;
}

.apps-dashboard__header {
  margin-bottom: var(--space-xl);
}
.apps-dashboard__title {
  font-size:     1.8rem;
  font-weight:   700;
  margin-bottom: var(--space-xs);
}
.apps-dashboard__subtitle { color: #666; font-size: 0.9375rem; }

.apps-dashboard__grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap:                   var(--space-xl);
}

.app-card {
  background:     var(--form-bg);
  border-radius:  var(--form-radius);
  box-shadow:     var(--form-shadow);
  border:         1.5px solid var(--input-border);
  padding:        var(--space-xl);
  display:        flex;
  flex-direction: column;
  gap:            var(--space-md);
  transition:     box-shadow 0.15s, transform 0.15s;
}
.app-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  transform:  translateY(-2px);
}

.app-card__header {
  display:     flex;
  align-items: center;
  gap:         var(--space-md);
}
.app-card__icon {
  font-size:   2rem;
  color:       var(--btn-bg);
  line-height: 1;
  flex-shrink: 0;
}
.app-card__title-row {
  display:     flex;
  align-items: center;
  gap:         var(--space-sm);
  flex-wrap:   wrap;
}
.app-card__name {
  font-size:   1.15rem;
  font-weight: 700;
}
.app-card__badge {
  display:       inline-block;
  padding:       0.15em 0.55em;
  border-radius: 999px;
  font-size:     0.75rem;
  font-weight:   700;
  background:    color-mix(in srgb, var(--input-focus) 12%, white);
  color:         var(--input-focus);
  border:        1px solid var(--input-focus);
}

.app-card__description {
  font-size:   0.9375rem;
  color:       #555;
  line-height: 1.6;
  flex:        1;
}

.app-card__stats {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   var(--space-sm);
  padding:               var(--space-md) 0;
  border-top:            1px solid var(--input-border);
  border-bottom:         1px solid var(--input-border);
}
.app-card__stat {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  gap:            2px;
  text-align:     center;
}
.app-card__stat-value {
  font-size:   1.1rem;
  font-weight: 700;
  color:       var(--btn-bg);
}
.app-card__stat-label {
  font-size:   0.7rem;
  color:       #888;
  line-height: 1.3;
}

.app-card__cta {
  display:         block;
  text-align:      center;
  padding:         0.65rem 1rem;
  background:      var(--btn-bg);
  color:           var(--btn-fg);
  border-radius:   4px;
  font-weight:     700;
  text-decoration: none;
  transition:      background 0.15s;
}
.app-card__cta:hover,
.app-card__cta:focus {
  background: var(--btn-hover);
  color:      var(--btn-fg);
}

@media (max-width: 768px) {
  .apps-dashboard__grid { grid-template-columns: 1fr; }
}

