  :root {
    --ink-950: #12151a;
    --ink-900: #191d24;
    --ink-850: #1f242c;
    --ink-800: #262b34;
    --line: #313742;
    --line-soft: #262b34;
    --ivory: #E8E4D9;
    --slate: #9198A6;
    --slate-dim: #7E8499;
    --brass: #C9A24B;
    --brass-bright: #E3C878;
    --brass-dim: #8A7038;
    --teal: #4B9187;
    --teal-bright: #63AFA4;
    --teal-dim: #2E5B54;

    --serif: 'IBM Plex Serif', Georgia, serif;
    --sans: 'IBM Plex Sans', -apple-system, sans-serif;
    --mono: 'IBM Plex Mono', 'SF Mono', monospace;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  body {
    font-family: var(--sans);
    background: var(--ink-950);
    color: var(--ivory);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
  }
  a { color: inherit; }
  button { font-family: inherit; cursor: pointer; }
  :focus-visible { outline: 2px solid var(--brass-bright); outline-offset: 2px; }

  /* ============ App shell ============ */
  .shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
  }

  /* ============ Sidebar ============ */
  .sidebar {
    background: var(--ink-900);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    padding: 32px 24px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }
  .brand { margin-bottom: 40px; }
  .brand-mark {
    width: 34px; height: 34px;
    margin-bottom: 14px;
    position: relative;
  }
  .brand-mark svg { width: 100%; height: 100%; }
  .brand-name {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 20px;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--ivory);
  }
  .brand-tagline {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--brass);
    margin-top: 10px;
    letter-spacing: 0.02em;
    line-height: 1.5;
  }

  .main-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
  }
  .nav-eyebrow {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--slate-dim);
    text-transform: uppercase;
    margin: 0 0 10px 12px;
  }
  .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    color: var(--slate);
    font-size: 14.5px;
    font-weight: 500;
    text-align: left;
    padding: 10px 12px;
    border-radius: 7px;
    position: relative;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .nav-item .nav-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.75; }
  .nav-item:hover { background: var(--ink-850); color: var(--ivory); }
  .nav-item.active {
    background: var(--ink-850);
    color: var(--ivory);
  }
  .nav-item.active::before {
    content: "";
    position: absolute;
    left: -24px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px;
    background: linear-gradient(180deg, var(--brass-bright), var(--teal-bright));
    border-radius: 2px;
  }
  .nav-item.active .nav-icon { opacity: 1; }

  .sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
  }
  .footer-link {
    background: none; border: none;
    color: var(--slate-dim);
    font-size: 12px;
    text-align: left;
    padding: 6px 12px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
  }
  .footer-link:hover { color: var(--slate); background: var(--ink-850); }

  /* Sits at the bottom of the sidebar regardless of how tall the
     openings list above it grows -- margin-top:auto pushes it down
     within the sidebar's flex column rather than needing the nav
     list itself to be sized just right. */
  .sidebar-auth {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line-soft);
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .sidebar-auth-email {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--slate);
    padding: 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar-auth-pitch {
    font-family: var(--sans);
    font-size: 11.5px;
    color: var(--slate);
    padding: 0 4px;
    line-height: 1.4;
  }
  .sidebar-auth-btn {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 12.5px;
    color: var(--ivory);
    background: var(--ink-850);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 8px 12px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
  }
  .sidebar-auth-btn:hover { border-color: var(--brass); color: var(--brass-bright); }
  .sidebar-auth-login { background: var(--brass-bright); color: var(--ink-950); border-color: var(--brass-bright); }
  .sidebar-auth-login:hover { background: var(--ivory); color: var(--ink-950); }

  /* Mobile sidebar toggle */
  .mobile-topbar { display: none; }
  .sidebar-close { display: none; }

  /* ============ Main content ============ */
  .content { min-width: 0; }

  .page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 56px 48px 80px;
  }

  .page-eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--teal-bright);
    margin-bottom: 14px;
  }
  .page-title {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 40px;
    letter-spacing: -0.015em;
    line-height: 1.1;
    margin-bottom: 16px;
  }
  .page-lede {
    font-size: 16px;
    color: var(--slate);
    max-width: 620px;
    line-height: 1.6;
  }

  /* eval-bar style divider -- the signature motif, reused everywhere */
  .eval-rule {
    height: 3px;
    border-radius: 2px;
    margin: 40px 0;
    background: linear-gradient(90deg, var(--ivory) 0%, var(--ivory) 38%, var(--ink-800) 38%, var(--ink-800) 100%);
    opacity: 0.9;
  }

  /* ============ Opening finder ============ */
  .finder-box {
    background: var(--ink-900);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 22px 24px;
    margin-top: 32px;
    width: 100%;
  }
  .finder-label {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 19px;
    color: var(--ivory);
    margin-bottom: 12px;
  }
  .finder-input {
    width: 100%;
    background: var(--ink-850);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    font-family: var(--sans);
    font-size: 14.5px;
    color: var(--ivory);
    margin-bottom: 14px;
  }
  .finder-input::placeholder { color: var(--slate-dim); }
  .finder-input:focus { outline: none; border-color: var(--brass-dim); }
  .finder-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }
  .finder-select {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--ivory);
    background: var(--ink-850);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 9px 12px;
    flex: 1;
    min-width: 140px;
  }
  .finder-select:focus { outline: none; border-color: var(--brass-dim); }
  .finder-completed-btn, .finder-clear-btn {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 13px;
    padding: 9px 16px;
    border-radius: 7px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ivory);
    cursor: pointer;
    white-space: nowrap;
  }
  .finder-completed-btn:hover, .finder-clear-btn:hover { border-color: var(--brass); color: var(--brass-bright); }
  .finder-completed-btn.active {
    background: rgba(75,145,135,0.16);
    border-color: var(--teal);
    color: var(--teal-bright);
  }
  .finder-status {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--teal-bright);
    margin-top: 12px;
    min-height: 16px;
  }
  .opening-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
  .tag.best-match { color: var(--ink-950); background: var(--brass-bright); font-weight: 700; }
  .tag.completed-badge { color: var(--teal-bright); background: rgba(75,145,135,0.16); }
  .opening-progress {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--slate);
    margin-bottom: 14px;
  }

  @media (max-width: 640px) {
    .finder-select { min-width: 100%; }
    .finder-completed-btn, .finder-clear-btn { flex: 1; }
  }

  /* ============ Openings library ============ */
  .openings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 36px;
  }
  .opening-card {
    background: var(--ink-900);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, transform 0.2s ease;
  }
  .opening-card:hover { border-color: var(--brass-dim); transform: translateY(-2px); }

  .opening-eval-strip {
    height: 8px;
    border-radius: 4px;
    margin-bottom: 18px;
    overflow: hidden;
    display: flex;
    background: var(--ink-800);
  }
  .opening-eval-strip .fill { background: var(--ivory); }

  .opening-name {
    font-family: var(--serif);
    font-weight: 600;
    font-size: 21px;
    margin-bottom: 6px;
  }
  .opening-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
  }
  .tag {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 4px;
    background: var(--ink-800);
    color: var(--slate);
    text-transform: uppercase;
  }
  .tag.accent { color: var(--brass-bright); background: rgba(201,162,75,0.12); }

  .opening-desc {
    font-size: 13.5px;
    color: var(--slate);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 20px;
  }

  .opening-actions { display: flex; flex-direction: column; gap: 10px; }
  .btn {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 13px;
    padding: 10px 16px;
    border-radius: 7px;
    border: 1px solid transparent;
    flex: 1;
    text-align: center;
    transition: all 0.15s ease;
  }
  .btn-learn {
    background: transparent;
    border-color: var(--line);
    color: var(--ivory);
  }
  .btn-learn:hover { border-color: var(--brass); color: var(--brass-bright); }
  .btn-practice {
    background: var(--teal-dim);
    color: var(--ivory);
    border-color: var(--teal-dim);
  }
  .btn-practice:hover { background: var(--teal); border-color: var(--teal); }

  /* ============ Learn panel (modal) ============ */
  /* Explore page content blocks (renderable per-opening) */
  .learn-section { margin-bottom: 22px; }
  .learn-section h3 {
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--brass); margin-bottom: 8px;
  }
  .learn-section p { font-size: 14.5px; line-height: 1.7; color: var(--ivory); opacity: 0.92; }

  /* ============ Coming-soon views ============ */
  .coming-soon {
    margin-top: 40px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    padding: 48px 40px;
    text-align: center;
    max-width: 560px;
  }
  .coming-soon .cs-icon { font-family: var(--mono); font-size: 12px; color: var(--teal-bright); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 14px; }
  .coming-soon h3 { font-family: var(--serif); font-size: 22px; margin-bottom: 10px; }
  .coming-soon p { color: var(--slate); font-size: 14px; line-height: 1.6; }

  /* ============ About ============ */
  .about-body p { font-size: 15px; line-height: 1.75; color: var(--ivory); opacity: 0.92; max-width: 640px; margin-bottom: 18px; }
  .about-signoff { font-family: var(--serif); font-style: italic; color: var(--brass-bright); margin-top: 32px; font-size: 16px; }

  /* ============ Legal pages ============ */
  .legal-notice {
    background: rgba(201,162,75,0.08);
    border: 1px solid var(--brass-dim);
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 12.5px;
    color: var(--brass-bright);
    margin-bottom: 32px;
    line-height: 1.6;
    max-width: 640px;
  }
  .legal-body h3 { font-family: var(--serif); font-size: 17px; margin: 28px 0 8px; }
  .legal-body p, .legal-body li { font-size: 13.5px; line-height: 1.7; color: var(--slate); max-width: 680px; }
  .legal-body ul { padding-left: 20px; margin-top: 6px; }
  .legal-body li { margin-bottom: 4px; }


  /* ============ Puzzles page ============ */
  .puzzle-info-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
  .puzzle-rating-badge {
    font-family: var(--mono); font-weight: 600; font-size: 13px;
    background: var(--ink-850); border: 1px solid var(--line); border-radius: 20px;
    padding: 5px 14px; color: var(--brass-bright);
  }
  .puzzle-difficulty-badge {
    font-family: var(--mono); font-weight: 600; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
    background: rgba(75,145,135,0.12); border: 1px solid var(--teal-dim); border-radius: 20px;
    padding: 5px 12px; color: var(--teal-bright);
  }
  #pz-opening-name {
    display: none; font-family: var(--mono); font-size: 11.5px; color: var(--brass-bright);
    margin-bottom: 6px;
  }
  #pz-side-hint { font-size: 13px; color: var(--slate); margin-bottom: 2px; }
  #pz-status { font-size: 15px; color: var(--ivory); min-height: 22px; }

  #pz-solved-banner {
    display: none; align-items: center; gap: 10px;
    background: linear-gradient(135deg, rgba(75,145,135,0.14), rgba(201,162,75,0.10));
    border: 1px solid var(--teal-dim); border-radius: 10px; padding: 14px 18px;
    font-family: var(--serif); font-weight: 600; font-size: 16px; color: var(--teal-bright);
  }

  #pz-explanation {
    display: none;
    background: var(--ink-850); border: 1px solid var(--line); border-radius: 10px;
    padding: 14px 16px; margin-top: 10px;
    font-family: var(--sans); font-size: 13.5px; line-height: 1.6; color: var(--slate);
  }

  .puzzle-actions { display: flex; gap: 10px; flex-wrap: wrap; }
  .puzzle-actions button {
    font-family: var(--sans); font-weight: 600; font-size: 13.5px;
    background: transparent; color: var(--ivory); border: 1px solid var(--line);
    padding: 14px 16px; border-radius: 6px; cursor: pointer;
  }
  .puzzle-actions button:hover { border-color: var(--brass); color: var(--brass-bright); }

  .archive-section { margin-top: 48px; }
  .archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .archive-card {
    display: block; text-align: left; cursor: pointer;
    background: var(--ink-900); border: 1px solid var(--line); border-radius: 10px; padding: 14px;
    font-family: var(--sans); transition: border-color 0.2s ease;
  }
  .archive-card:hover { border-color: var(--brass-dim); }
  .archive-card.active { border-color: var(--teal); background: rgba(75,145,135,0.08); }
  .archive-card.locked { opacity: 0.55; position: relative; }
  .archive-card.locked:hover { border-color: var(--brass-dim); opacity: 0.75; }
  .archive-card .ac-lock { position: absolute; top: 10px; right: 10px; font-size: 12px; opacity: 0.7; }
  .archive-card .ac-num { font-family: var(--mono); font-size: 10.5px; color: var(--slate-dim); margin-bottom: 6px; }
  .archive-card .ac-rating { font-family: var(--mono); font-weight: 600; font-size: 15px; color: var(--brass-bright); margin-bottom: 4px; }
  .archive-card .ac-diff { font-size: 11.5px; color: var(--teal-bright); margin-bottom: 6px; }
  .archive-card .ac-themes { font-size: 11px; color: var(--slate); line-height: 1.4; }

  /* Puzzle board reuses the exact same element IDs as the practice
     trainer (#board-outer, #board-container, #squares, etc.) since
     this is a separate page with no collision risk -- that means all
     of the trainer's existing board/coordinate/flip CSS just works
     here for free, nothing to duplicate. */

  /* ============ Explore page: in-depth content sections ============ */
  .quick-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    margin: 28px 0;
  }
  .quick-fact { background: var(--ink-900); padding: 14px 16px; }
  .quick-fact .qf-label {
    font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--slate-dim); margin-bottom: 6px;
  }
  .quick-fact .qf-value { font-size: 13.5px; color: var(--ivory); line-height: 1.4; }

  .explore-section-title {
    font-family: var(--serif); font-weight: 600; font-size: 22px;
    margin: 44px 0 16px;
  }
  .explore-section-title .num { color: var(--brass); font-family: var(--mono); font-size: 15px; margin-right: 10px; }

  .history-block p { font-size: 14.5px; line-height: 1.75; color: var(--ivory); opacity: 0.92; margin-bottom: 14px; max-width: 720px; }

  .good-for-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .good-for-card { background: var(--ink-900); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
  .good-for-card .gf-label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px; }
  .good-for-card.practicing .gf-label { color: var(--teal-bright); }
  .good-for-card.facing .gf-label { color: var(--brass); }
  .good-for-card p { font-size: 13.5px; line-height: 1.65; color: var(--ivory); opacity: 0.92; }

  .mistakes-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
  .mistakes-list li {
    background: var(--ink-900); border: 1px solid var(--line); border-left: 3px solid var(--brass-dim);
    border-radius: 8px; padding: 14px 16px; font-size: 13.5px; line-height: 1.6; color: var(--ivory); opacity: 0.92;
  }

  .stats-callout {
    background: linear-gradient(135deg, rgba(75,145,135,0.08), rgba(201,162,75,0.06));
    border: 1px solid var(--teal-dim); border-radius: 12px; padding: 24px 26px; margin: 20px 0;
  }
  .stats-callout .sc-header {
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--teal-bright); margin-bottom: 14px;
  }
  .stats-callout ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
  .stats-callout li { font-size: 13.5px; line-height: 1.65; color: var(--ivory); opacity: 0.95; padding-left: 20px; position: relative; }
  .stats-callout li::before { content: "\2022"; position: absolute; left: 0; color: var(--teal-bright); font-weight: 700; }

  .faq-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
  .faq-item:first-child { border-top: 1px solid var(--line); }
  .faq-q { font-family: var(--serif); font-size: 15.5px; font-weight: 600; color: var(--ivory); margin-bottom: 8px; }
  .faq-a { font-size: 13.5px; line-height: 1.65; color: var(--slate); }

  /* ============ Homepage staggered blocks ============ */
  .stagger-block {
    display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
    margin: 64px 0;
  }
  .stagger-block.reverse .stagger-media { order: 2; }
  .stagger-block.reverse .stagger-text { order: 1; }
  .stagger-media {
    background: var(--ink-900); border: 1px solid var(--line); border-radius: 14px;
    aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; padding: 32px;
  }
  .stagger-media svg { width: 100%; height: 100%; }
  .stagger-text .gf-label { margin-bottom: 12px; }
  .stagger-text h3 {
    font-family: var(--serif); font-weight: 600; font-size: 24px; line-height: 1.2; margin-bottom: 14px;
  }
  .stagger-text p { font-size: 14.5px; line-height: 1.7; color: var(--ivory); opacity: 0.92; margin-bottom: 10px; }
  .stagger-text .stagger-cta {
    display: inline-block; margin-top: 10px; font-family: var(--mono); font-size: 12.5px;
    color: var(--brass-bright); text-decoration: none; letter-spacing: 0.02em;
  }
  .stagger-text .stagger-cta:hover { text-decoration: underline; }

  @media (max-width: 780px) {
    .stagger-block, .stagger-block.reverse { grid-template-columns: 1fr; gap: 24px; margin: 40px 0; }
    .stagger-block.reverse .stagger-media { order: 1; }
    .stagger-block.reverse .stagger-text { order: 2; }
    .stagger-media { aspect-ratio: 16 / 10; }
  }

  /* ============ Reusable CTA buttons (used on pricing + homepage) ============ */
  .pricing-cta { font-family: var(--sans); font-weight: 600; font-size: 14px; text-align: center; text-decoration: none; display: block; padding: 13px; border-radius: 8px; cursor: pointer; border: none; width: 100%; }
  .pricing-cta.primary { background: var(--brass); color: var(--ink-950); }
  .pricing-cta.primary:hover { background: var(--brass-bright); }
  .pricing-cta.secondary { background: transparent; color: var(--ivory); border: 1px solid var(--line); }
  .pricing-cta.secondary:hover { border-color: var(--brass-dim); color: var(--brass-bright); }

  .related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
  .related-card {
    display: block; text-decoration: none;
    background: var(--ink-900); border: 1px solid var(--line); border-radius: 10px; padding: 18px;
    transition: border-color 0.2s ease;
  }
  .related-card:hover { border-color: var(--brass-dim); }
  .related-card .rc-name { font-family: var(--serif); font-weight: 600; font-size: 16px; color: var(--ivory); margin-bottom: 6px; }
  .related-card .rc-reason { font-size: 12.5px; line-height: 1.55; color: var(--slate); }

  .video-list { display: flex; flex-direction: column; gap: 10px; }
  .video-item {
    display: flex; align-items: center; gap: 14px;
    background: var(--ink-900); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
    text-decoration: none; transition: border-color 0.2s ease;
  }
  .video-item:hover { border-color: var(--brass-dim); }
  .video-item .vi-icon {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
    background: rgba(201,162,75,0.12); display: flex; align-items: center; justify-content: center;
    color: var(--brass); font-size: 13px;
  }
  .video-item .vi-title { font-size: 13.5px; color: var(--ivory); font-weight: 600; margin-bottom: 2px; }
  .video-item .vi-creator { font-family: var(--mono); font-size: 11px; color: var(--slate-dim); }

  @media (max-width: 700px) {
    .good-for-grid { grid-template-columns: 1fr; }
  }

  /* ============ Auth modal (demo) ============ */
  .auth-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 1000;
    background: rgba(10,12,15,0.72); backdrop-filter: blur(2px);
    align-items: center; justify-content: center; padding: 20px;
  }
  .auth-modal-overlay.visible { display: flex; }
  .auth-modal {
    position: relative; width: 100%; max-width: 400px;
    background: var(--ink-900); border: 1px solid var(--line); border-radius: 14px;
    padding: 32px 28px 28px;
  }
  .auth-modal-close {
    position: absolute; top: 14px; right: 14px;
    background: none; border: none; color: var(--slate); font-size: 22px; line-height: 1;
    cursor: pointer; padding: 4px 8px;
  }
  .auth-modal-close:hover { color: var(--ivory); }
  .auth-modal-eyebrow {
    font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--teal-bright); margin-bottom: 10px;
  }
  .auth-modal-title { font-family: var(--serif); font-weight: 600; font-size: 24px; margin-bottom: 8px; }
  .auth-modal-sub { font-size: 13.5px; color: var(--slate); margin-bottom: 20px; line-height: 1.5; }
  .auth-modal-input {
    width: 100%; font-family: var(--sans); font-size: 14px;
    background: var(--ink-850); border: 1px solid var(--line); border-radius: 8px;
    padding: 12px 14px; color: var(--ivory); margin-bottom: 14px;
  }
  .auth-modal-input:focus { outline: 2px solid var(--brass-dim); outline-offset: 1px; }
  .auth-modal-btn {
    width: 100%; font-family: var(--sans); font-weight: 600; font-size: 14px;
    background: var(--brass); color: var(--ink-950); border: none; border-radius: 8px;
    padding: 13px; cursor: pointer; margin-bottom: 10px;
  }
  .auth-modal-btn:hover:not(:disabled) { background: var(--brass-bright); }
  .auth-modal-btn:disabled { opacity: 0.5; cursor: not-allowed; }
  .auth-modal-btn-secondary {
    background: transparent; color: var(--slate); border: 1px solid var(--line);
  }
  .auth-modal-btn-secondary:hover { color: var(--ivory); border-color: var(--brass-dim); background: transparent; }
  .auth-modal-demo-note {
    font-size: 11.5px; line-height: 1.55; color: var(--slate-dim);
    background: var(--ink-850); border-radius: 8px; padding: 10px 12px; margin-bottom: 16px;
  }

  /* ============ Free-tier gating banner ============ */
  .gating-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(201,162,75,0.10), rgba(75,145,135,0.08));
    border: 1px solid var(--brass-dim); border-radius: 10px;
    padding: 14px 20px; margin: 24px 0 20px 0;
    font-size: 13.5px; color: var(--ivory);
  }
  .gating-banner button {
    font-family: var(--sans); font-weight: 600; font-size: 13px; white-space: nowrap;
    background: var(--brass); color: var(--ink-950); border: none;
    padding: 9px 18px; border-radius: 6px; cursor: pointer;
  }
  .gating-banner button:hover { background: var(--brass-bright); }

  /* ============ Practice (embedded trainer) ============ */
  .practice-wrap { padding: 0 0 60px; }
  /* .page-wrap nested inside .practice-wrap (the header area) already
     provides its own correct horizontal padding matching every other
     page -- adding padding here too would double it up. The trainer
     app section below the header is a separate sibling and needs its
     own matching padding instead (see .trainer-app below). */
  .back-link {
    display: inline-block;
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--slate);
    text-decoration: none;
    padding: 16px 0 0 20px;
    transition: color 0.15s ease;
  }
  .back-link:hover { color: var(--brass-bright); }

  /* ============ Responsive ============ */
  @media (max-width: 860px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar {
      position: fixed; left: 0; top: 0; z-index: 60;
      width: 280px; height: 100vh;
      transform: translateX(-100%);
      transition: transform 0.25s ease;
      box-shadow: 20px 0 40px rgba(0,0,0,0.4);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close {
      display: flex; align-items: center; justify-content: center;
      position: absolute; top: 20px; right: 20px;
      width: 30px; height: 30px; border-radius: 7px;
      background: var(--ink-850); border: 1px solid var(--line); color: var(--slate);
    }
    .mobile-topbar {
      display: flex; align-items: center; justify-content: space-between;
      padding: 16px 20px;
      border-bottom: 1px solid var(--line);
      position: sticky; top: 0; background: var(--ink-950); z-index: 40;
    }
    .mobile-topbar .brand-name { font-size: 16px; }
    .menu-btn {
      background: var(--ink-850); border: 1px solid var(--line); border-radius: 8px;
      width: 38px; height: 38px; color: var(--ivory); font-size: 16px;
    }
    .page-wrap { padding: 36px 22px 60px; }
    .page-title { font-size: 30px; }
    .sidebar-backdrop {
      display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 55;
    }
    .sidebar-backdrop.open { display: block; }
  }


/* ============ Embed mode ============
   Used when this page runs inside an iframe on the Simvoly site (via
   ?embed=1 in the URL) -- hides this site's own nav/header/sidebar so
   only the actual app content shows, since Simvoly provides its own
   page chrome around the iframe. The class is added to <html> by a
   tiny inline script in <head>, before paint, so there's no flash of
   the full layout before it's hidden. */
html.embed-mode .mobile-topbar,
html.embed-mode .sidebar,
html.embed-mode .sidebar-backdrop,
html.embed-mode .back-link { display: none !important; }
html.embed-mode .shell { grid-template-columns: 1fr; min-height: 0; }
html.embed-mode body { min-height: 0; }

/* Soft, dismissible account-creation nudge for guests, shown once
   after reaching the same checkpoint the paywall used to gate --
   never blocks anything, just surfaces the one real reason to sign
   up while the whole site is free. */
.account-nudge {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--ink-900);
  border: 1px solid var(--brass-dim);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.account-nudge.hidden { display: none; }
.account-nudge-text {
  flex: 1;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ivory);
  line-height: 1.4;
}
.account-nudge-cta {
  flex-shrink: 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-950);
  background: var(--brass-bright);
  border-radius: 7px;
  padding: 8px 14px;
  text-decoration: none;
  white-space: nowrap;
}
.account-nudge-cta:hover { background: var(--ivory); }
.account-nudge-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--slate);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.account-nudge-close:hover { color: var(--ivory); }
@media (max-width: 640px) {
  .account-nudge { flex-wrap: wrap; }
  .account-nudge-text { flex-basis: 100%; }
}
