/* ==========================================================
   Cosmic Trolley — design tokens
   Light: pale blue / lavender, soft raised surfaces
   Dark:  deep indigo / violet, glowing glass panels
   ========================================================== */

/* Registered properties: lets the browser animate/transition them */
@property --beam-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@property --blob-1 { syntax: "<color>"; inherits: true; initial-value: #a98cf0; }
@property --blob-2 { syntax: "<color>"; inherits: true; initial-value: #7fb4f5; }
@property --blob-3 { syntax: "<color>"; inherits: true; initial-value: #f3b6d6; }

:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);          /* weighty, buttery */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Light theme (default) */
  --bg-from: #e3ecf8;
  --bg-to: #cfc6f3;
  --blob-1: #a98cf0;
  --blob-2: #7fb4f5;
  --blob-3: #f3b6d6;
  --orb-opacity: 0.6;

  --surface: rgba(255, 255, 255, 0.55);
  --surface-strong: rgba(255, 255, 255, 0.85);
  --border: rgba(255, 255, 255, 0.7);
  --shadow: 0 30px 60px -20px rgba(90, 80, 160, 0.35),
            0 8px 20px -8px rgba(90, 80, 160, 0.2);

  --text: #1f2347;
  --text-soft: #5b6390;
  --accent-1: #ff6b8b;   /* coral */
  --accent-2: #8a6cf0;   /* violet */
  --accent-3: #5b8cf5;   /* blue */
  --accent-grad: linear-gradient(120deg, var(--accent-1), var(--accent-2) 55%, var(--accent-3));
  --beam-tip: #ff6b8b;

  --input-bg: rgba(255, 255, 255, 0.8);
  --input-shadow: inset 0 2px 6px rgba(120, 130, 190, 0.18),
                  0 1px 0 rgba(255, 255, 255, 0.9);
  --saved-glow: rgba(138, 108, 240, 0.45);
  --grain-opacity: 0.35;
  --radius-lg: 28px;
  --radius-md: 18px;

  /* Sandblasted grain (SVG fractal noise, desaturated) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n' x='0' y='0'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] {
  --bg-from: #1a1838;
  --bg-to: #3b2a6e;
  --blob-1: #7a4df0;
  --blob-2: #2f6bff;
  --blob-3: #d6409f;
  --orb-opacity: 0.55;

  --surface: rgba(255, 255, 255, 0.07);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.14);
  --shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.6),
            0 8px 24px -8px rgba(122, 77, 240, 0.25);

  --text: #f1efff;
  --text-soft: #a9a5d6;
  --beam-tip: #ffffff;

  --input-bg: rgba(20, 18, 50, 0.55);
  --input-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4),
                  0 1px 0 rgba(255, 255, 255, 0.06);
  --saved-glow: rgba(255, 107, 139, 0.45);
  --grain-opacity: 0.28;
}

/* Follow the OS unless the user has chosen manually */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-from: #1a1838;
    --bg-to: #3b2a6e;
    --blob-1: #7a4df0;
    --blob-2: #2f6bff;
    --blob-3: #d6409f;
    --orb-opacity: 0.55;
    --surface: rgba(255, 255, 255, 0.07);
    --surface-strong: rgba(255, 255, 255, 0.12);
    --border: rgba(255, 255, 255, 0.14);
    --shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.6),
              0 8px 24px -8px rgba(122, 77, 240, 0.25);
    --text: #f1efff;
    --text-soft: #a9a5d6;
    --beam-tip: #ffffff;
    --input-bg: rgba(20, 18, 50, 0.55);
    --input-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4),
                    0 1px 0 rgba(255, 255, 255, 0.06);
    --saved-glow: rgba(255, 107, 139, 0.45);
    --grain-opacity: 0.28;
  }
}

/* ---------- Atmosphere: orb colours react to app state ---------- */
body[data-state="loading"] {
  --blob-1: #4f8dff;
  --blob-2: #9a6cff;
  --blob-3: #31d4e0;
}
body[data-state="verdict"] {
  --blob-1: #ff6b8b;
  --blob-2: #8a6cf0;
  --blob-3: #ffb86b;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(160deg, var(--bg-from), var(--bg-to));
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
}

/* Ambient orbs: radial gradients (no blur filter = cheap) drifting on the GPU */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ambient span {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  opacity: var(--orb-opacity);
  background: radial-gradient(closest-side, var(--c), transparent);
  transition: --blob-1 1.6s ease, --blob-2 1.6s ease, --blob-3 1.6s ease;
  animation: drift var(--t) ease-in-out infinite alternate;
  will-change: transform;
}
.ambient span:nth-child(1) { --size: 620px; --c: var(--blob-1); --t: 26s; --dx: 80px;  --dy: 60px;  top: -200px; left: -180px; }
.ambient span:nth-child(2) { --size: 560px; --c: var(--blob-2); --t: 32s; --dx: -70px; --dy: -50px; bottom: -220px; right: -160px; }
.ambient span:nth-child(3) { --size: 380px; --c: var(--blob-3); --t: 38s; --dx: -90px; --dy: 70px;  top: 42%; left: 58%; opacity: calc(var(--orb-opacity) * 0.6); }

@keyframes drift {
  to { transform: translate3d(var(--dx), var(--dy), 0) scale(1.08); }
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(16px, 4vw, 40px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-grad);
  box-shadow: 0 6px 16px -4px var(--saved-glow);
  display: grid;
  place-items: center;
}
.brand-mark::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.icon-btn:hover { transform: translateY(-2px); }
.icon-btn:focus-visible,
.btn:focus-visible,
.entity input:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

/* ---------- Layout ---------- */
main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: min(680px, 100% - 32px);
  margin: 0 auto;
  padding: 16px 0 56px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero { text-align: center; }
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.hero h1 em {
  font-style: normal;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  margin: 0 auto;
  max-width: 46ch;
  color: var(--text-soft);
  line-height: 1.55;
}

/* ---------- Glass card + sandblasted grain ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  padding: clamp(20px, 4vw, 32px);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(--grain);
  background-size: 180px 180px;
  mix-blend-mode: overlay;
  opacity: var(--grain-opacity);
  pointer-events: none;
}

/* Trolley track motif */
.track {
  position: relative;
  height: 6px;
  margin-bottom: 26px;
  border-radius: 99px;
  background: repeating-linear-gradient(90deg, var(--border) 0 10px, transparent 10px 18px);
  overflow: hidden;
}
.track::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -40px;
  width: 36px;
  height: 10px;
  border-radius: 99px;
  background: var(--accent-grad);
  box-shadow: 0 0 14px var(--saved-glow);
  animation: roll 3.2s linear infinite;
  animation-play-state: paused;
}
.is-loading .track::after { animation-play-state: running; }
@keyframes roll { to { transform: translateX(760px); } }

/* ---------- Form ---------- */
/* The 3D stage for the "Diverging Timelines" effect */
.dilemma {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 14px;
  perspective: 1000px;
}

.entity {
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 1.2s var(--ease),
              opacity 1.2s var(--ease),
              filter 1.2s var(--ease);
  will-change: transform, opacity, filter;
}
.entity label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding-left: 6px;
}

.field { position: relative; isolation: isolate; }
.entity input {
  width: 100%;
  font: inherit;
  font-size: 1.02rem;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  box-shadow: var(--input-shadow);
}
.entity input::placeholder { color: var(--text-soft); opacity: 0.7; }

/* Winner halo: a pseudo-element whose OPACITY animates (compositor-friendly) */
.field::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px var(--accent-2),
              0 0 36px 4px var(--saved-glow),
              0 0 90px 18px rgba(138, 108, 240, 0.28);
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}

/* Timeline A: the spared entity moves toward you, razor sharp, haloed */
.entity.is-saved { transform: translateZ(20px); }
.entity.is-saved .field::after { opacity: 1; }

/* Timeline B: the discarded entity falls back into an alternate timeline */
.entity.is-sacrificed {
  transform: translateZ(-80px) scale(0.9);
  opacity: 0.55;
  filter: brightness(0.7) grayscale(1) blur(4px);
  cursor: pointer;
  pointer-events: auto; /* Ensures the user can click it to type */
}

.entity.is-sacrificed:hover {
  filter: brightness(0.9) grayscale(0.5) blur(1px); /* Previews un-blur on hover */
}

.vs {
  width: 46px;
  height: 46px;
  margin-bottom: 4px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.35s ease;
}
.vs:hover { transform: rotate(180deg); }

.actions { margin-top: 24px; display: flex; justify-content: center; }

/* ---------- Primary CTA: border beam + squishy physics ---------- */
.btn {
  position: relative;
  isolation: isolate;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  border: 0;
  cursor: pointer;
  padding: 15px 36px;
  border-radius: 999px;
  background: var(--accent-grad);
  box-shadow: 0 14px 28px -10px var(--saved-glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.5s var(--ease-spring), filter 0.2s ease;
  will-change: transform;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.7; cursor: progress; }

/* Compressed: squashes down, bulges out sideways */
.btn:active:not(:disabled) {
  transform: scale(1.07, 0.88);
  transition: transform 0.14s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* Released: elastic rebound with a custom curve on every segment */
.btn.is-release { animation: squish-release 0.75s both; }
@keyframes squish-release {
  0%   { transform: scale(1.07, 0.88); animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1.25); }
  32%  { transform: scale(0.95, 1.08); animation-timing-function: cubic-bezier(0.3, 0.6, 0.4, 1); }
  62%  { transform: scale(1.025, 0.98); animation-timing-function: cubic-bezier(0.3, 0.6, 0.4, 1); }
  100% { transform: scale(1, 1); }
}

/* Border beam: a conic comet orbiting the outside edge of the button */
.btn::before,
.btn::after {
  content: "";
  position: absolute;
  inset: -2px;
  padding: 2px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--beam-angle),
    transparent 0deg,
    transparent 240deg,
    var(--accent-3) 285deg,
    var(--accent-2) 320deg,
    var(--beam-tip) 355deg,
    transparent 360deg
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  animation: beam 3.8s linear infinite;
  pointer-events: none;
  z-index: -1;
}
/* Soft bloom behind the crisp beam */
.btn::after {
  inset: -4px;
  padding: 4px;
  filter: blur(7px);
  opacity: 0.55;
}
.is-loading .btn::before,
.is-loading .btn::after { animation-duration: 1.5s; }

@keyframes beam { to { --beam-angle: 360deg; } }

/* ---------- Verdict: optical de-blur reveal ---------- */
.verdict[hidden] { display: none; }
.verdict { animation: card-in 0.8s var(--ease) 0.25s both; }
@keyframes card-in {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to   { opacity: 1; transform: none; }
}

.reveal { animation: deblur 0.95s var(--ease) var(--d, 0s) both; }
@keyframes deblur {
  from { opacity: 0; filter: blur(14px); transform: translate3d(0, 12px, 0) scale(0.98); }
  to   { opacity: var(--reveal-opacity, 1); filter: blur(0); transform: none; }
}

.outcomes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.outcome {
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
  border: 1px solid var(--border);
}
.outcome small {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--text-soft);
}
.outcome strong { display: block; font-size: 1.15rem; overflow-wrap: anywhere; }

.outcome.saved {
  --d: 0.45s;
  background: var(--surface-strong);
  box-shadow: 0 0 0 1px var(--accent-2), 0 0 32px -4px var(--saved-glow);
}
.outcome.sacrificed {
  --d: 0.6s;
  --reveal-opacity: 0.6;
  background: transparent;
  opacity: 0.6;
}

.reasoning {
  --d: 0.8s;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
}
.reasoning::before {
  content: "“";
  display: block;
  font-size: 2.6rem;
  line-height: 0.6;
  margin-bottom: 8px;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Cipher text reveal ----------
   Real text stays in the DOM (for layout + screen readers);
   an aria-hidden overlay shows the scramble. */
.cipher { position: relative; }
.cipher-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: var(--text-soft);
  opacity: 0;
}
.cipher.is-scrambling .cipher-real { opacity: 0; }
.cipher.is-scrambling .cipher-fx { opacity: 1; }

.status { text-align: center; color: var(--text-soft); min-height: 1.4em; margin: 16px 0 0; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 16px 28px;
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* ---------- Responsive + graceful degradation ---------- */
@media (max-width: 560px) {
  .dilemma { grid-template-columns: 1fr; }
  .vs { justify-self: center; margin: 0; transform: rotate(90deg); }
  .vs:hover { transform: rotate(270deg); }
  .outcomes { grid-template-columns: 1fr; }
  .btn { width: 100%; }
}

/* Touch / small screens: keep the drama, shed the expensive bits */
@media (max-width: 560px), (hover: none) and (pointer: coarse) {
  body { background-attachment: scroll; }
  .card { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .card::after { mix-blend-mode: normal; opacity: 0.07; }
  .btn::after { display: none; }                       /* no blurred bloom */
  .ambient span:nth-child(3) { display: none; }        /* one fewer orb */
  .entity.is-sacrificed {
    transform: translateZ(-60px) scale(0.92);
    filter: brightness(0.7) grayscale(1) blur(3px);    /* lighter blur */
  }
  .field::after {
    box-shadow: 0 0 0 1px var(--accent-2), 0 0 28px 2px var(--saved-glow);
  }
  @keyframes deblur {
    from { opacity: 0; filter: blur(8px); transform: translate3d(0, 10px, 0) scale(0.98); }
    to   { opacity: var(--reveal-opacity, 1); filter: blur(0); transform: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================
   Cursor Spotlight Canvas & Trail
   ========================================================== */
.trail-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99;
  mix-blend-mode: screen;
}

/* ==========================================================
   3D Tilt Card Container Tuning
   ========================================================== */
#dilemmaCard {
  transform-style: preserve-3d;
  will-change: transform;
  transition: box-shadow 0.3s ease;
}

/* Lift shadow slightly when tilted */
#dilemmaCard:hover {
  box-shadow: 0 35px 75px -15px rgba(90, 80, 160, 0.45),
              0 10px 24px -6px rgba(90, 80, 160, 0.25);
}

:root[data-theme="dark"] #dilemmaCard:hover {
  box-shadow: 0 35px 80px -20px rgba(0, 0, 0, 0.8),
              0 10px 30px -6px rgba(122, 77, 240, 0.4);
}

/* ==========================================================
   Presets Bar
   ========================================================== */
.presets {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.preset-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.preset-btn {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.preset-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent-2);
}

.preset-btn:active {
  transform: translateY(1px);
}

/* Provider Dropdown */
.provider-dropdown {
  width: 100%;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--input-shadow);
  cursor: pointer;
  outline: none;
}
.provider-dropdown:focus {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

/* ==========================================================
   Header Layout Update (With Drawer Toggle)
   ========================================================== */
.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================
   Left Side Drawer & Backdrop Scrim
   ========================================================== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 26, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.side-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(340px, 86vw);
  background: var(--surface-strong);
  border-right: 1px solid var(--border);
  box-shadow: 20px 0 50px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  z-index: 1001;
  transform: translateX(-100%);
  transition: transform 0.35s var(--ease);
  display: flex;
  flex-direction: column;
}
.side-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}
.drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
}

.close-drawer-btn {
  width: 32px;
  height: 32px;
  font-size: 0.9rem;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.drawer-section h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.key-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid;
}
.key-badge.demo {
  background: rgba(138, 108, 240, 0.12);
  color: var(--accent-2);
  border-color: rgba(138, 108, 240, 0.25);
}
.key-badge.active {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.25);
}

.section-desc {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-soft);
  margin-bottom: 12px;
}

.drawer-actions {
  display: flex;
  gap: 8px;
}

.btn-subtle {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.btn-subtle:hover {
  border-color: var(--accent-2);
}
.btn-subtle.danger {
  color: #ef4444;
}

.drawer-instructions {
  margin: 0;
  padding-left: 18px;
  font-size: 0.76rem;
  line-height: 1.5;
  color: var(--text-soft);
}
.drawer-instructions li {
  margin-bottom: 6px;
}
.drawer-instructions code {
  font-size: 0.8em;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.toggle-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.muted-note {
  font-size: 0.7rem;
  color: var(--text-soft);
  opacity: 0.7;
}

/* ==========================================================
   Disclaimer Modal
   ========================================================== */
body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 26, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.modal-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(480px, 100%);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 36px);
  text-align: left;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.35s var(--ease);
}
.modal-backdrop.is-visible .modal-card {
  transform: none;
}

.modal-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ff9800;
  background: rgba(255, 152, 0, 0.12);
  border: 1px solid rgba(255, 152, 0, 0.25);
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 14px;
}

.modal-card h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.modal-lead {
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 12px;
}
.modal-text {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-soft);
  margin-bottom: 16px;
}
.modal-note {
  font-size: 0.78rem;
  line-height: 1.45;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: var(--radius-md);
  margin-bottom: 22px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.btn-text {
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  padding: 10px 16px;
}
.btn-text:hover {
  color: #ef4444;
}

/* ==========================================================
   Lockout Screen
   ========================================================== */
.lockout-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-from);
  z-index: 3000;
  display: none;
  place-items: center;
  padding: 20px;
  text-align: center;
}
.lockout-screen.is-active {
  display: grid;
}
.lockout-card {
  width: min(380px, 100%);
  padding: 32px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.lockout-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}
.lockout-card p {
  margin: 0 0 8px;
  font-size: 0.86rem;
}