/* ============================================================
 * GoodJewBadJew.com — Styles
 * ============================================================ */

:root {
    --navy-deep: #0a1840;
    --navy: #14255c;
    --navy-light: #1f3579;
    --gold: #d4a236;
    --gold-bright: #f1c64a;
    --gold-pale: #f5e4a8;
    --cream: #fbf6e7;
    --parchment: #faf6e2;
    --parchment-dark: #ACA07A;
    --parchment-shadow: #ACA07A;
    --ink: #0f1425;
    --ink-scroll: #3a2a10;
    --accent-red: #c93636;
    --stamp-red: #b22b2b;
    --approve-green: #5a8a3a;
    --shadow: rgba(10, 24, 64, 0.25);
  }

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

  html {
    scroll-behavior: smooth;
  }

  body {
    font-family: 'Cormorant Garamond', 'Frank Ruhl Libre', serif;
    background-color: var(--navy-deep);
    background-image:
      radial-gradient(ellipse at top, rgba(212, 162, 54, 0.12), transparent 65%),
      radial-gradient(ellipse at bottom, rgba(31, 53, 121, 0.4), transparent 60%),
      url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-attachment: fixed;
    color: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
  }

  /* ============================================================ */
  /* ROTATION LOCK — shown only on narrow phones in portrait mode */
  /* ============================================================ */
  .rotation-lock {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--navy-deep);
    background-image:
      radial-gradient(ellipse at top, rgba(212, 162, 54, 0.15), transparent 65%),
      radial-gradient(ellipse at bottom, rgba(31, 53, 121, 0.5), transparent 60%);
    align-items: center;
    justify-content: center;
    padding: 40px 30px;
    text-align: center;
  }

  /* Rotation-lock trigger DISABLED — site now works natively in portrait.
     The overlay markup is kept as a fallback but is never shown by CSS. */
  /*
  @media (max-width: 900px) and (orientation: portrait) {
    .rotation-lock { display: flex; }
    body { overflow: hidden; }
    header, .progress-wrap, .container, .floating-rabbi, .rabbi-reopen-tab, footer {
      visibility: hidden;
    }
  }
  */

  .rotation-lock-inner {
    max-width: 360px;
  }

  .rotation-phone {
    width: 120px;
    height: 120px;
    margin: 0 auto 28px;
    animation: rotate-phone 3s ease-in-out infinite;
    transform-origin: center center;
  }
  .rotation-phone svg { width: 100%; height: 100%; }

  @keyframes rotate-phone {
    0%, 40% { transform: rotate(0deg); }
    55%, 95% { transform: rotate(-90deg); }
    100% { transform: rotate(0deg); }
  }

  .rotation-arrow {
    animation: arrow-flash 3s ease-in-out infinite;
  }
  @keyframes arrow-flash {
    0%, 40% { opacity: 1; }
    45%, 55% { opacity: 0.3; }
    60%, 100% { opacity: 1; }
  }

  .rotation-title {
    font-family: 'Frank Ruhl Libre', serif;
    font-weight: 900;
    font-size: 2.2rem;
    color: var(--gold-bright);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
    text-shadow: 2px 2px 0 rgba(212, 162, 54, 0.3);
  }

  .rotation-message {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: var(--cream);
    line-height: 1.4;
    margin-bottom: 20px;
  }

  .rotation-nag {
    font-family: 'Caveat', cursive;
    font-size: 1.3rem;
    color: var(--gold);
    opacity: 0.85;
    font-style: italic;
  }

  /* ===== HEADER ===== */
  header {
    text-align: center;
    padding: 30px 20px 24px;
    border-bottom: 3px double var(--gold);
    position: relative;
    background: linear-gradient(180deg, rgba(10, 24, 64, 0.6) 0%, transparent 100%);
  }

  .logo-wrap {
    max-width: 800px;
    margin: 0 auto;
  }
  .logo-img {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
  }
  .tagline {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.2rem, 2.6vw, 1.8rem);
    color: var(--gold-pale);
    margin-top: 8px;
    opacity: 0.95;
  }
  .sub-tagline {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--gold-bright);
    letter-spacing: 0.1em;
    margin-top: 6px;
  }

  /* ===== MITZVAH SHARE BUTTON (top of page) ===== */
  .mitzvah-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 8px 18px;
    background: rgba(212, 162, 54, 0.08);
    color: var(--gold-bright);
    border: 1px solid var(--gold);
    border-radius: 30px;
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.02em;
  }
  .mitzvah-share:hover {
    background: var(--gold);
    color: var(--navy-deep);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(212, 162, 54, 0.35);
  }
  .mitzvah-share:active { transform: translateY(0); }
  .mitzvah-share.copied {
    background: #5a8a3a;
    border-color: #7fb352;
    color: #fff;
    animation: mitzvah-pop 0.4s ease-out;
  }
  .mitzvah-icon {
    font-size: 1.1rem;
    color: inherit;
  }
  @keyframes mitzvah-pop {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.08); }
  }

  /* Mitzvah caption inside report card, above Share button */
  .report-mitzvah {
    width: 100%;
    text-align: center;
    font-family: 'Caveat', cursive;
    font-size: 1.35rem;
    color: var(--stamp-red);
    margin: 0 0 6px 0;
    letter-spacing: 0.01em;
    font-weight: 700;
  }

  /* ===== LAYOUT ===== */
  .container {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px 48px 20px;
  }

  /* ===== SECTIONS ===== */
  .section {
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-light) 100%);
    border: 2px solid var(--gold);
    border-radius: 6px;
    padding: 28px 32px;
    margin-bottom: 28px;
    box-shadow: 5px 5px 0 var(--gold), 8px 8px 30px rgba(0, 0, 0, 0.4);
    position: relative;
  }
  .section::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid rgba(245, 228, 168, 0.25);
    border-radius: 4px;
    pointer-events: none;
  }
  .section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 2px dashed var(--gold);
    padding-bottom: 14px;
    margin-bottom: 20px;
  }
  .section-number {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 2.8rem;
    font-weight: 900;
    color: var(--gold-bright);
    line-height: 1;
    text-shadow: 2px 2px 0 var(--navy-deep);
  }
  .section-title {
    font-family: 'Frank Ruhl Libre', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--gold-pale);
    line-height: 1.2;
  }
  .section-subtitle {
    font-style: italic;
    color: var(--gold);
    font-size: 1.13rem;
    margin-top: 4px;
    opacity: 0.95;
  }
  .intro-text {
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--cream);
    margin-bottom: 10px;
  }
  .intro-text em {
    color: var(--gold-bright);
    font-weight: 600;
  }

  /* ===== HOLIDAY GRID ===== */
  .holiday-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-top: 16px;
  }
  .holiday-btn {
    background: var(--navy-deep);
    border: 2px solid var(--gold);
    border-radius: 4px;
    padding: 14px 10px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--cream);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    box-shadow: 2px 2px 0 var(--gold);
    line-height: 1.2;
  }
  .holiday-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--gold-bright);
    background: var(--navy-light);
    border-color: var(--gold-bright);
  }
  .holiday-btn.selected {
    background: var(--gold);
    color: var(--navy-deep);
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0 var(--gold-bright);
    border-color: var(--gold-bright);
  }
  .holiday-btn.selected::before {
    content: "✓";
    position: absolute;
    top: 2px;
    right: 6px;
    font-weight: 700;
    color: var(--navy-deep);
  }
  .holiday-emoji { display: block; font-size: 1.5rem; margin-bottom: 4px; }
  .holiday-sub { display: block; font-size: 0.75rem; opacity: 0.75; font-style: italic; margin-top: 2px; }

  /* ===== QUESTIONS ===== */
  .question { padding: 20px 0; border-bottom: 1px dotted var(--gold); }
  .question:last-child { border-bottom: none; }
  .question-text {
    font-size: 1.15rem;
    line-height: 1.4;
    margin-bottom: 14px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    color: var(--cream);
  }
  .question-num {
    font-family: 'Frank Ruhl Libre', serif;
    font-weight: 900;
    color: var(--navy-deep);
    background: var(--gold);
    border: 1.5px solid var(--gold-bright);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
  }
  .answer-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: 42px;
  }
  .answer-btn {
    background: var(--navy-deep);
    border: 1.5px solid var(--gold);
    border-radius: 6px;
    padding: 10px 16px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    font-weight: 500;
    color: var(--cream);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
  }
  .answer-btn:hover {
    background: var(--navy-light);
    border-color: var(--gold-bright);
    transform: translateX(4px);
  }
  .answer-btn.selected-good {
    background: var(--approve-green);
    color: #fff;
    border-color: var(--gold-bright);
  }
  .answer-btn.selected-mid {
    background: var(--gold);
    color: var(--navy-deep);
    border-color: var(--gold-bright);
    font-weight: 600;
  }
  .answer-btn.selected-bad {
    background: var(--accent-red);
    color: #fff;
    border-color: var(--gold);
  }

  /* ===== PROGRESS BAR with depth and floating bubble ===== */
  .progress-wrap {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 18px 20px 46px;  /* extra bottom padding for the bubble below */
    background: linear-gradient(180deg, var(--navy-deep) 0%, rgba(10, 24, 64, 0.95) 80%, rgba(10, 24, 64, 0.6) 100%);
    margin: 0 -20px 18px;
  }
  @media (max-width: 700px) {
    .progress-wrap {
      padding: 12px 16px 38px;
    }
  }

  .progress-bar {
    position: relative;
    height: 14px;
    background: linear-gradient(180deg, rgba(10, 20, 40, 0.85) 0%, rgba(20, 37, 92, 0.4) 100%);
    border-radius: 10px;
    box-shadow:
      inset 0 2px 4px rgba(0, 0, 0, 0.6),
      inset 0 -1px 1px rgba(255, 255, 255, 0.05),
      0 1px 0 rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(212, 162, 54, 0.3);
    overflow: visible;
  }
  .progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 9px;
    background: linear-gradient(180deg, #f1c64a 0%, #d4a236 55%, #a97d22 100%);
    box-shadow:
      inset 0 1px 1px rgba(255, 240, 180, 0.6),
      inset 0 -2px 2px rgba(100, 60, 10, 0.4),
      0 0 12px rgba(241, 198, 74, 0.5),
      0 0 24px rgba(241, 198, 74, 0.3);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
  }
  /* Shine highlight across the top of the fill */
  .progress-fill::before {
    content: "";
    position: absolute;
    top: 1px;
    left: 4px;
    right: 4px;
    height: 4px;
    background: linear-gradient(180deg, rgba(255, 248, 220, 0.7) 0%, rgba(255, 248, 220, 0) 100%);
    border-radius: 6px 6px 0 0;
    pointer-events: none;
  }

  /* Percentage bubble — sits BELOW the bar so it never clips when bar is sticky at top */
  .progress-bubble {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    transform: translateX(0);
    min-width: 44px;
    padding: 4px 10px;
    background: var(--cream);
    color: var(--navy-deep);
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    border-radius: 5px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
  }
  .progress-bubble::after {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-bottom-color: var(--cream);
  }

  .calculate-section { text-align: center; padding: 50px 20px 20px; }
  .calculate-btn {
    background: var(--gold);
    color: var(--navy-deep);
    border: 3px solid var(--gold-bright);
    border-radius: 4px;
    padding: 20px 44px;
    font-family: 'Frank Ruhl Libre', serif;
    font-weight: 900;
    font-size: 1.35rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 5px 5px 0 var(--navy-deep), 0 0 25px rgba(212, 162, 54, 0.4);
  }
  .calculate-btn:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--navy-deep), 0 0 35px rgba(212, 162, 54, 0.6);
    background: var(--gold-bright);
  }
  .calculate-btn:disabled { opacity: 0.4; cursor: not-allowed; }
  .calculate-btn.is-loading { opacity: 0.85; cursor: wait; transform: none !important; }
  .calc-hint { margin-top: 14px; font-style: italic; color: var(--gold-pale); opacity: 0.75; }

  /* ===== CALCULATE BUTTON LOADING STATE ===== */
  .calc-spinner {
    display: none;
    width: 18px;
    height: 18px;
    margin-left: 12px;
    border: 3px solid rgba(10, 24, 64, 0.25);
    border-top-color: var(--navy-deep);
    border-radius: 50%;
    vertical-align: middle;
    animation: spin 0.8s linear infinite;
  }
  .calc-spinner.active { display: inline-block; }
  @keyframes spin { to { transform: rotate(360deg); } }

  .calc-loading-line {
    display: none;
    margin-top: 18px;
    font-family: 'Caveat', cursive;
    font-size: 1.35rem;
    color: var(--gold-bright);
    opacity: 0;
    transition: opacity 0.3s ease;
    min-height: 1.6em;
  }
  .calc-loading-line.show { display: block; opacity: 1; }
  .calc-loading-line.fade-out { opacity: 0; }

  /* ===== FLOATING RABBI ===== */
  /* On desktop/wide screens: parked in the gutter to the right of the 900px container.
     On narrower screens where there's no gutter room: parked at fixed top-right. */
  .floating-rabbi {
    position: fixed;
    top: 140px;                    /* starts roughly at the first question area, below the big logo */
    left: calc(50% + 460px);       /* half of page + half of container (450) + small gap */
    z-index: 100;
    width: 240px;
    /* GPU-accelerated transform-based animation avoids layout thrash on scroll.
       We use translateY to shift the rabbi vertically instead of animating `top`.
       NOTE: `will-change: transform` is intentionally NOT set here. Leaving it on
       permanently is a CSS anti-pattern and, critically, it promotes this element to
       its own compositing layer which corrupts html2canvas's global transform pass —
       that shattered the report-card rabbi in the shared image. Do not re-add it. */
    transform: translateY(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.5));
  }

  /* Once user scrolls down past the header, translate rabbi UP to a higher sticky position.
     Starting top is 140px, target is ~20px, so translateY(-120px). */
  .floating-rabbi.scrolled {
    transform: translateY(-120px);
  }

  /* When minimized, slide off the right edge. Combines with scrolled state if both apply. */
  .floating-rabbi.minimized {
    transform: translateX(calc(100% + 60px));
    pointer-events: none;
  }
  .floating-rabbi.minimized.scrolled {
    transform: translateX(calc(100% + 60px)) translateY(-120px);
  }

  /* On viewports too narrow to have gutter space, tuck rabbi at top-right corner */
  @media (max-width: 1200px) {
    .floating-rabbi {
      left: auto;
      right: 20px;
      top: 20px;
      width: 220px;
      transform: none;
    }
    .floating-rabbi.scrolled { transform: none; }
    .floating-rabbi.minimized.scrolled {
      transform: translateX(calc(100% + 60px));
    }
  }

  /* Hide entirely on small phones — portrait mode is blocked by rotation overlay,
     and landscape will use the narrow-desktop layout above */
  @media (max-width: 700px) {
    .floating-rabbi {
      width: 170px;
      right: 12px;
      top: 12px;
    }
  }

  /* ===== REOPEN TAB (pill on right edge when rabbi is hidden) ===== */
  .rabbi-reopen-tab {
    position: fixed;
    top: 45%;
    right: 0;
    transform: translateX(100%);
    z-index: 99;
    background: var(--gold);
    color: var(--navy-deep);
    border: 2px solid var(--gold-bright);
    border-right: none;
    border-radius: 24px 0 0 24px;
    padding: 10px 16px 10px 20px;
    font-family: 'Frank Ruhl Libre', serif;
    font-weight: 900;
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 4px 14px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
  }
  .rabbi-reopen-tab.show {
    transform: translateX(0);
  }
  .rabbi-reopen-tab:hover {
    background: var(--gold-bright);
    padding-right: 22px;
  }
  .rabbi-reopen-tab .tab-icon {
    font-size: 1.1rem;
    line-height: 1;
  }
  @media (max-width: 700px) {
    .rabbi-reopen-tab {
      top: 50%;
      padding: 8px 12px 8px 16px;
      font-size: 0.75rem;
    }
  }

  .rabbi-frame {
    background: var(--navy);
    border: 3px solid var(--gold);
    border-radius: 10px;
    padding: 14px;
    position: relative;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .rabbi-frame::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px solid var(--gold-bright);
    border-radius: 6px;
    pointer-events: none;
    opacity: 0.5;
  }
  .rabbi-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--gold);
  }
  .rabbi-label {
    font-family: 'Frank Ruhl Libre', serif;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    color: var(--gold-bright);
    text-transform: uppercase;
  }
  .rabbi-toolbar-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .minimize-btn, .mute-btn {
    background: var(--navy-deep);
    color: var(--gold);
    border: 1px solid var(--gold);
    border-radius: 3px;
    width: 22px;
    height: 22px;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    font-family: 'Frank Ruhl Libre', serif;
    font-weight: 700;
    transition: all 0.2s ease;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  .minimize-btn:hover, .mute-btn:hover { background: var(--gold); color: var(--navy-deep); }
  .mute-btn[aria-pressed="true"] { opacity: 0.55; }

  /* Label text on the minimize button — hidden on desktop, shown on smaller screens */
  .minimize-label { display: none; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; }
  .minimize-icon { display: inline-flex; }
  @media (max-width: 700px) {
    .minimize-btn {
      width: auto;
      padding: 0 8px;
    }
    .minimize-label { display: inline; }
  }

  .rabbi-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: radial-gradient(circle at center, #fdf8e7 0%, #f0e3b8 100%);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
  }
  .rabbi-svg { width: 100%; height: 100%; display: block; }

  .rabbi-svg .mouth, .rabbi-svg .eyebrow-left, .rabbi-svg .eyebrow-right,
  .rabbi-svg .eye-left, .rabbi-svg .eye-right, .rabbi-svg .cheek-left, .rabbi-svg .cheek-right {
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    transform-box: fill-box;
  }

  @keyframes breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
  .rabbi-svg .head-group { animation: breathe 4s ease-in-out infinite; transform-origin: center bottom; transform-box: fill-box; }

  @keyframes mensch-sway { 0%, 100% { transform: rotate(-1deg) translateY(0); } 50% { transform: rotate(1deg) translateY(-2px); } }
  @keyframes cheek-pulse { 0%, 100% { opacity: var(--cheek-op, 0.5); transform: scale(1); } 50% { opacity: calc(var(--cheek-op, 0.5) + 0.2); transform: scale(1.1); } }
  @keyframes skeptic-brow { 0%, 40%, 100% { transform: translateY(0) rotate(0); } 20% { transform: translateY(-4px) rotate(-3deg); } }
  @keyframes headshake { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-2deg); } 80% { transform: rotate(2deg); } 90% { transform: rotate(-1deg); } }
  @keyframes slow-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.15); } }
  @keyframes sigh { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-3px); } 60% { transform: translateY(2px); } }
  @keyframes eyes-down { 0%, 100% { transform: translateY(0); } 30%, 70% { transform: translateY(3px); } }

  .tier-mensch .head-group { animation: mensch-sway 3s ease-in-out infinite; }
  .tier-mensch .cheek-left, .tier-mensch .cheek-right { animation: cheek-pulse 3s ease-in-out infinite; --cheek-op: 0.75; }
  .tier-nice .head-group { animation: breathe 3.5s ease-in-out infinite; }
  .tier-nice .eye-left, .tier-nice .eye-right { animation: slow-blink 5s ease-in-out infinite; }
  .tier-bubbe .head-group { animation: breathe 4s ease-in-out infinite; }
  .tier-bubbe .eye-left, .tier-bubbe .eye-right { animation: slow-blink 6s ease-in-out infinite; }
  .tier-wip .head-group { animation: breathe 4.5s ease-in-out infinite; }
  .tier-skeptic .eyebrow-right { animation: skeptic-brow 4s ease-in-out infinite; }
  .tier-skeptic .head-group { animation: headshake 6s ease-in-out infinite, breathe 4s ease-in-out infinite; }
  .tier-schlump .head-group { animation: headshake 7s ease-in-out infinite, breathe 4s ease-in-out infinite; }
  .tier-schlump .eye-left, .tier-schlump .eye-right { animation: eyes-down 5s ease-in-out infinite; }
  .tier-oi .head-group { animation: sigh 5s ease-in-out infinite; }
  .tier-oi .eye-left, .tier-oi .eye-right { animation: eyes-down 6s ease-in-out infinite; }

  /* ===== HANDS (thumbs-up only) — visible on Mensch tier ===== */
  .rabbi-thumbs-up, .rabbi-tears { display: none; }
  .tier-mensch .rabbi-thumbs-up { display: block; animation: thumbs-up-in 0.5s ease-out; }

  /* Crying: rabbi cries when score is sub-150 (adds .tier-crying class) */
  .tier-crying .rabbi-tears { display: block; }
  .tier-crying .tear-left, .tier-crying .tear-right {
    animation: tear-drop 2.5s ease-in infinite;
    transform-origin: center top;
  }
  .tier-crying .tear-right { animation-delay: 0.6s; }
  .tier-crying .head-group { animation: cry-sob 3s ease-in-out infinite; }
  .tier-crying .mouth { d: path("M 180 278 Q 200 268 220 278"); }
  .tier-crying .eyebrow-left { transform: translateY(-3px) rotate(15deg); transform-origin: right center; }
  .tier-crying .eyebrow-right { transform: translateY(-3px) rotate(-15deg); transform-origin: left center; }

  @keyframes tear-drop {
    0% { opacity: 0; transform: translateY(0) scale(0.6); }
    20% { opacity: 1; transform: translateY(0) scale(1); }
    80% { opacity: 1; transform: translateY(80px) scale(1); }
    100% { opacity: 0; transform: translateY(110px) scale(0.8); }
  }
  @keyframes cry-sob {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-4px) rotate(-2deg); }
    50% { transform: translateY(2px); }
    75% { transform: translateY(-3px) rotate(2deg); }
  }
  @keyframes thumbs-up-in {
    0% { opacity: 0; transform: translate(0, 30px) scale(0.5); }
    100% { opacity: 1; transform: translate(0, 0) scale(1); }
  }

  /* ===== BROW FURROW — subtle worry line on lower tiers ===== */
  .tier-skeptic .brow-furrow,
  .tier-schlump .brow-furrow,
  .tier-oi .brow-furrow { opacity: 0.6; transition: opacity 0.4s ease; }

  .rabbi-speech {
    position: absolute;
    top: 30px;
    right: calc(100% + 15px);
    background: var(--cream);
    border: 2px solid var(--navy-deep);
    border-radius: 12px;
    padding: 10px 14px;
    font-family: 'Caveat', cursive;
    font-size: 1.05rem;
    line-height: 1.3;
    color: var(--navy-deep);
    min-width: 180px;
    max-width: 240px;
    opacity: 0;
    transform: scale(0.8) translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 3px 3px 0 var(--navy-deep);
  }
  .rabbi-speech.show { opacity: 1; transform: scale(1) translateX(0); }
  .rabbi-speech::after { content: ""; position: absolute; right: -10px; top: 20px; border: 6px solid transparent; border-left-color: var(--navy-deep); }
  .rabbi-speech::before { content: ""; position: absolute; right: -7px; top: 22px; border: 4px solid transparent; border-left-color: var(--cream); z-index: 1; }
  .speech-attribution {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 0.75rem;
    color: var(--accent-red);
    margin-bottom: 4px;
    opacity: 0.9;
    font-weight: 600;
  }

  @media (max-width: 700px) {
    .rabbi-speech {
      right: 0; top: calc(100% + 10px); bottom: auto;
      max-width: 200px; font-size: 0.95rem;
    }
    .rabbi-speech::after { right: 30px; top: -10px; bottom: auto; border: 6px solid transparent; border-bottom-color: var(--navy-deep); border-left-color: transparent; }
    .rabbi-speech::before { right: 32px; top: -7px; bottom: auto; border: 4px solid transparent; border-bottom-color: var(--cream); border-left-color: transparent; }
  }

  .score-panel {
    background: var(--navy-deep);
    border: 2px solid var(--gold);
    border-radius: 6px;
    padding: 12px 14px;
    margin-top: 10px;
  }
  .score-label {
    font-family: 'Frank Ruhl Libre', serif;
    font-weight: 700;
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    color: var(--gold);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 4px;
  }
  .score-number {
    text-align: center;
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    color: var(--gold-bright);
    transition: transform 0.3s ease;
  }
  .score-max { font-size: 0.9rem; opacity: 0.5; font-weight: 400; color: var(--cream); }
  .score-number.pop { transform: scale(1.2); }
  .score-number.positive { color: #9fd868; }
  .score-number.negative { color: #ff6a6a; }
  .score-status {
    text-align: center;
    font-style: italic;
    font-size: 0.82rem;
    color: var(--gold-pale);
    margin-top: 3px;
    min-height: 1.2em;
  }
  .score-bar {
    height: 6px;
    background: rgba(212, 162, 54, 0.15);
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
  }
  .score-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-red), var(--gold), var(--approve-green));
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* ============================================== */
  /* REPORT: PARCHMENT SCROLL                        */
  /* ============================================== */
  .report-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 37, 0.85);
    backdrop-filter: blur(6px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
  }
  .report-overlay.show { display: flex; opacity: 1; }

  .scroll-wrapper {
    max-width: 680px;
    width: 100%;
    position: relative;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .report-overlay.show .scroll-wrapper { transform: scale(1) translateY(0); }

  /* Scroll top and bottom curls */
  .scroll-cap {
    height: 28px;
    background:
      linear-gradient(180deg, #8a6d2e 0%, #a07f3d 30%, #6b5321 55%, #46371a 100%);
    border: 2px solid var(--parchment-shadow);
    border-radius: 28px / 50%;
    box-shadow:
      inset 0 3px 8px rgba(255, 220, 150, 0.4),
      inset 0 -3px 8px rgba(0, 0, 0, 0.5),
      0 3px 10px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 2;
  }
  .scroll-cap::before {
    content: "";
    position: absolute;
    left: 10px; right: 10px; top: 50%;
    height: 2px;
    background: rgba(0, 0, 0, 0.35);
    transform: translateY(-50%);
  }

  .report-card {
    position: relative;
    /* Solid parchment, matched exactly to the html2canvas capture background (#faf6e2).
       Layered gradient/noise textures don't survive html2canvas — it painted the flat
       fallback for the lower half, creating the textured-top / flat-bottom seam. A single
       solid tone renders identically on screen and in the shared image, top to bottom. */
    background: var(--parchment);
    color: var(--ink-scroll);
    padding: 44px 50px;
    box-shadow:
      inset 0 20px 40px -20px rgba(160, 130, 80, 0.22),
      inset 0 -20px 40px -20px rgba(160, 130, 80, 0.22),
      inset 10px 0 20px -10px rgba(160, 130, 80, 0.14),
      inset -10px 0 20px -10px rgba(160, 130, 80, 0.14),
      0 10px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    margin: -10px 0;
    z-index: 1;
    border-left: 1px solid var(--parchment-shadow);
    border-right: 1px solid var(--parchment-shadow);
  }

  /* Decorative corners */
  .report-card::before {
    content: "✡";
    position: absolute;
    top: 20px; left: 20px;
    font-size: 1.6rem;
    color: var(--parchment-shadow);
    opacity: 0.45;
  }
  .report-card::after {
    content: "✡";
    position: absolute;
    top: 20px; right: 20px;
    font-size: 1.6rem;
    color: var(--parchment-shadow);
    opacity: 0.45;
  }

  /* ===== RUBBER STAMP ===== */
  .rubber-stamp {
    position: absolute;
    top: 40px;
    right: 30px;
    width: 130px;
    height: 130px;
    transform: rotate(14deg);
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.4s ease 0.6s, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s;
  }
  .report-overlay.show .rubber-stamp {
    opacity: 1;
    transform: rotate(14deg) scale(1);
    animation: stamp-impact 0.4s ease 0.4s 1;
  }
  @keyframes stamp-impact {
    0% { transform: rotate(14deg) scale(1.6); opacity: 0; }
    30% { transform: rotate(14deg) scale(0.85); opacity: 1; }
    60% { transform: rotate(14deg) scale(1.05); }
    100% { transform: rotate(14deg) scale(1); }
  }

  .rubber-stamp svg {
    width: 100%;
    height: 100%;
    filter: url(#stamp-rough);
  }

  @media (max-width: 550px) {
    .rubber-stamp { width: 90px; height: 90px; top: 20px; right: 15px; }
  }

  .report-header {
    text-align: center;
    border-bottom: 2px solid var(--ink-scroll);
    padding-bottom: 18px;
    margin-bottom: 22px;
    position: relative;
  }
  .report-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--ink-scroll);
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-transform: uppercase;
  }
  .report-subtitle {
    font-style: italic;
    font-family: 'Montserrat', sans-serif;
    color: var(--ink-scroll);
    opacity: 0.7;
    font-size: 0.95rem;
    margin-top: 6px;
  }

  .report-logo {
    display: block;
    width: 75%;
    max-width: 320px;
    height: auto;
    margin: 0 auto 12px;
    /* The wordmark sits slightly right of the artwork's optical center, so nudge left to
       land the center of "GOOD" on the card's centerline. Increase the % to move further. */
    transform: translateX(-5%);
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.2));
  }
  /* Mobile: enlarge the header logo (~+50%). Desktop stays at 75%/320px above.
     margin:0 auto keeps it centered; overflow stays within the card's side padding. */
  @media (max-width: 600px) {
    .report-logo { width: 115%; max-width: none; }
  }

  /* Instagram share prompt — sits under the red nag line, inside the shareable image. */
  .report-instagram {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.92rem;
    color: var(--ink-scroll);
    text-decoration: none;
    line-height: 1.35;
  }
  .report-instagram strong { color: var(--ink-scroll); font-weight: 700; white-space: nowrap; }
  .report-instagram:hover strong { text-decoration: underline; }

  .report-rabbi {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    border: 3px solid var(--ink-scroll);
    border-radius: 50%;
    overflow: hidden;
    background: radial-gradient(circle at center, #fdf8e7 0%, #f0e3b8 100%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: relative;
  }
  .report-rabbi::after {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1px solid var(--parchment-shadow);
    border-radius: 50%;
    pointer-events: none;
  }
  .report-rabbi svg { width: 100%; height: 100%; }

  /* Print rabbi PNG: hidden on screen, shown in print */
  .report-rabbi-print {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center bottom;
    position: absolute;
    inset: 0;
  }

  .report-hero {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 18px 0;
    padding: 18px;
    background: rgba(255, 245, 210, 0.4);
    border-top: 1px solid var(--parchment-shadow);
    border-bottom: 1px solid var(--parchment-shadow);
  }
  .report-hero-text {
    flex: 1;
    text-align: left;
    min-width: 0;
  }
  @media (max-width: 520px) {
    .report-hero {
      flex-direction: column;
      text-align: center;
      gap: 14px;
    }
    .report-hero-text { text-align: center; }
    .report-rabbi { width: 130px; height: 130px; }
  }

  .report-rating { text-align: center; margin: 16px 0; }
  .report-rating-label {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink-scroll);
    font-weight: 700;
    opacity: 0.7;
    font-family: 'Montserrat', sans-serif;
  }
  .report-rating-score {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.8rem;
    font-weight: 800;
    line-height: 1;
    color: var(--ink-scroll);
    margin: 4px 0 2px;
    transition: all 0.5s ease;
    letter-spacing: -0.02em;
  }
  .report-rating-score.bonus { color: var(--approve-green); text-shadow: 0 0 20px rgba(90, 138, 58, 0.4); }
  .report-rating-score.penalty { color: var(--stamp-red); text-shadow: 0 0 20px rgba(178, 43, 43, 0.4); }

  /* Floating +50 / −15 that pops up from the score */
  .floating-points {
    position: absolute;
    top: 20%;
    right: -10px;
    font-family: 'Frank Ruhl Libre', serif;
    font-weight: 900;
    font-size: 2rem;
    pointer-events: none;
    animation: float-up-and-fade 2.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    z-index: 20;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  .floating-points.bonus { color: var(--approve-green); }
  .floating-points.penalty { color: var(--stamp-red); }
  @keyframes float-up-and-fade {
    0% { opacity: 0; transform: translateY(0) scale(0.5); }
    20% { opacity: 1; transform: translateY(-10px) scale(1.15); }
    40% { transform: translateY(-25px) scale(1); }
    100% { opacity: 0; transform: translateY(-70px) scale(1); }
  }
  .report-rating-max { font-size: 1.8rem; opacity: 0.4; font-weight: 400; }
  .report-rating-tier {
    font-family: 'Caveat', cursive;
    font-size: 1.7rem;
    color: var(--stamp-red);
    font-weight: 700;
    line-height: 1.1;
  }
  .report-verdict {
    font-size: 0.98rem;
    line-height: 1.65;
    margin: 18px 0;
    padding: 18px;
    background: rgba(255, 245, 210, 0.6);
    border-left: 4px solid var(--ink-scroll);
    font-style: italic;
    color: var(--ink-scroll);
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
  }
  .report-tips { margin: 18px 0; }
  .report-tips h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    color: var(--ink-scroll);
    margin-bottom: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }
  .report-tips ul { list-style: none; padding: 0 0 0 20px; }
  .report-tips li {
    padding: 6px 0 6px 28px;
    position: relative;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--ink-scroll);
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
  }
  .report-tips li::before { content: "✡"; position: absolute; left: 4px; color: var(--stamp-red); }

  /* ===== QUESTION SUBMISSION ===== */
  .submit-question {
    background: rgba(255, 245, 210, 0.6);
    border: 2px dashed var(--ink-scroll);
    border-radius: 4px;
    padding: 20px;
    margin: 22px 0;
  }
  .submit-question h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    color: var(--ink-scroll);
    margin-bottom: 6px;
    font-weight: 400;
  }
  .submit-question .sub-intro {
    font-size: 0.95rem;
    color: var(--ink-scroll);
    opacity: 0.85;
    margin-bottom: 12px;
    font-family: 'Montserrat', sans-serif;
    font-style: italic;
    line-height: 1.5;
  }
  .submit-question .reward-line {
    background: rgba(212, 162, 54, 0.2);
    border: 1px solid var(--gold);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.88rem;
    margin-bottom: 12px;
    color: var(--ink-scroll);
  }
  .submit-question textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px 12px;
    border: 1.5px solid var(--ink-scroll);
    border-radius: 4px;
    background: rgba(255, 250, 230, 0.7);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--ink-scroll);
    resize: vertical;
  }
  .submit-question textarea:focus {
    outline: none;
    border-color: var(--stamp-red);
    background: rgba(255, 250, 230, 0.9);
  }
  .submit-question input[type=email] {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--ink-scroll);
    border-radius: 4px;
    background: rgba(255, 250, 230, 0.7);
    font-family: 'Cormorant Garamond', serif;
    font-size: 1rem;
    color: var(--ink-scroll);
    margin-top: 8px;
  }
  .submit-question button {
    margin-top: 10px;
    padding: 10px 20px;
    background: var(--ink-scroll);
    color: var(--parchment);
    border: 2px solid var(--ink-scroll);
    border-radius: 4px;
    font-family: 'Frank Ruhl Libre', serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .submit-question button:hover:not(:disabled) {
    background: var(--stamp-red);
    border-color: var(--stamp-red);
    transform: translateY(-1px);
  }
  .submit-question button:disabled { opacity: 0.5; cursor: not-allowed; }

  .submit-result {
    padding: 14px;
    border-radius: 4px;
    margin-top: 10px;
    font-family: 'Caveat', cursive;
    font-size: 1.15rem;
    line-height: 1.3;
    display: none;
  }
  .submit-result.show { display: block; animation: fadeInUp 0.4s ease; }
  .submit-result.success {
    background: rgba(90, 138, 58, 0.15);
    border: 2px solid var(--approve-green);
    color: var(--approve-green);
  }
  .submit-result.duplicate {
    background: rgba(178, 43, 43, 0.12);
    border: 2px solid var(--stamp-red);
    color: var(--stamp-red);
  }
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Discourage widows/orphans across the report card text. The JS noWidow() bonds the
     final two words as a hard guarantee (and for the share image); this improves the
     rest of the line breaking where the browser supports it. */
  .report-verdict,
  .report-tips li,
  .nag-line,
  .report-rating-tier,
  .report-signature,
  .report-instagram,
  .share-bonus-copy,
  .share-bonus-result {
    text-wrap: pretty;
  }

  /* ===== SHARE FOR POINTS ===== */
  .share-bonus {
    background: rgba(212, 162, 54, 0.16);
    border: 2px solid var(--gold);
    border-radius: 4px;
    padding: 18px 20px;
    margin: 22px 0;
    text-align: center;
  }
  .share-bonus h4 {
    font-family: 'Frank Ruhl Libre', serif;
    font-size: 1.3rem;
    color: var(--ink-scroll);
    margin-bottom: 6px;
    font-weight: 900;
  }
  .share-bonus .share-bonus-copy {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    color: var(--ink-scroll);
    line-height: 1.4;
    margin-bottom: 14px;
  }
  .share-bonus .share-bonus-copy strong { color: var(--stamp-red); }
  .share-bonus button {
    padding: 11px 22px;
    background: var(--ink-scroll);
    color: var(--gold-bright);
    border: 2px solid var(--ink-scroll);
    border-radius: 4px;
    font-family: 'Frank Ruhl Libre', serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 2px 2px 0 var(--gold);
  }
  .share-bonus button:hover:not(:disabled) {
    background: var(--stamp-red);
    border-color: var(--stamp-red);
    color: var(--cream);
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--gold-bright);
  }
  .share-bonus button:disabled { opacity: 0.6; cursor: default; }
  .share-bonus-result {
    display: none;
    margin-top: 12px;
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    line-height: 1.3;
    color: var(--approve-green);
  }
  .share-bonus-result.show { display: block; animation: fadeInUp 0.4s ease; }

  .report-signature {
    text-align: center;
    margin-top: 24px;
    font-family: 'Caveat', cursive;
    font-size: 1.45rem;
    color: var(--ink-scroll);
    padding-top: 14px;
  }
  .nag-line {
    text-align: center;
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: var(--stamp-red);
    opacity: 0.85;
    margin-top: 8px;
    padding: 8px 12px;
    font-style: italic;
  }
  .report-buttons { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
  .report-buttons button {
    flex: 1;
    min-width: 130px;
    padding: 12px;
    border: 2px solid var(--ink-scroll);
    background: var(--parchment);
    color: var(--ink-scroll);
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    box-shadow: 2px 2px 0 var(--ink-scroll);
  }
  .report-buttons button:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink-scroll); }
  .report-buttons .primary { background: var(--ink-scroll); color: var(--gold-bright); }

  footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 3px double var(--gold);
    margin-top: 40px;
    font-size: 0.85rem;
    color: var(--gold-pale);
    opacity: 0.75;
  }
  footer p { margin: 4px 0; }
  footer .disclaimer {
    font-style: italic;
    font-size: 0.8rem;
    max-width: 600px;
    margin: 10px auto;
  }

  /* ===== FOOTER LEGAL LINKS ===== */
  .footer-links {
    margin-top: 18px !important;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
  }
  .footer-link {
    color: var(--gold-bright);
    text-decoration: none;
    border-bottom: 1px dotted var(--gold);
    padding-bottom: 1px;
    cursor: pointer;
    transition: color 0.15s ease;
  }
  .footer-link:hover { color: var(--gold-pale); border-bottom-color: var(--gold-bright); }
  .footer-sep { opacity: 0.5; margin: 0 10px; }

  /* ===== LEGAL LIGHTBOX ===== */
  .legal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  .legal-lightbox.is-open { display: flex; }
  .legal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 24, 64, 0.82);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }
  .legal-panel {
    position: relative;
    width: min(880px, 96vw);
    height: min(88vh, 920px);
    background: var(--parchment);
    border: 3px solid var(--gold);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 6px var(--navy-deep);
    overflow: hidden;
    animation: legalPop 0.18s ease-out;
  }
  @keyframes legalPop {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  .legal-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--navy-deep);
    display: block;
  }
  .legal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--gold-bright);
    background: var(--navy-deep);
    color: var(--gold-bright);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  }
  .legal-close:hover {
    background: var(--gold);
    color: var(--navy-deep);
    transform: scale(1.08);
  }
  @media (max-width: 600px) {
    .legal-lightbox { padding: 10px; }
    .legal-panel { width: 100%; height: 92vh; }
  }

  .email-rabbi-btn {
    display: inline-block;
    margin-top: 18px;
    padding: 12px 28px;
    background: var(--gold);
    color: var(--navy-deep);
    border: 2.5px solid var(--gold-bright);
    border-radius: 4px;
    font-family: 'Frank Ruhl Libre', serif;
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 4px 4px 0 var(--navy-deep), 0 0 20px rgba(212, 162, 54, 0.3);
  }
  .email-rabbi-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--navy-deep), 0 0 30px rgba(212, 162, 54, 0.5);
    background: var(--gold-bright);
  }
  .email-rabbi-note {
    font-family: 'Caveat', cursive;
    font-size: 1.05rem;
    color: var(--gold-pale);
    opacity: 0.85;
    margin-top: 10px !important;
    font-style: italic;
  }

  .star-burst {
    position: fixed;
    pointer-events: none;
    font-size: 2rem;
    z-index: 999;
    animation: starBurst 0.8s ease-out forwards;
  }
  @keyframes starBurst {
    0% { transform: scale(0) rotate(0); opacity: 1; }
    100% { transform: scale(1.5) rotate(180deg) translateY(-80px); opacity: 0; }
  }

  /* PRINT */
  @media print {
    @page { size: letter; margin: 0.4in; }
    body { background: white !important; color: black !important; overflow: visible !important; }
    /* Force hide the rotation-lock overlay during print — the portrait media query would otherwise trigger it */
    .rotation-lock { display: none !important; }
    header, footer, .container, .floating-rabbi, .report-buttons, .rabbi-speech, .progress-bar, .progress-wrap, .submit-question, .rabbi-reopen-tab {
      display: none !important;
    }
    /* Make sure all elements that were visibility:hidden by rotation-lock media query become visible again */
    header, .progress-wrap, .container, .floating-rabbi, .rabbi-reopen-tab, footer {
      visibility: visible !important;
    }
    .report-overlay {
      position: static !important;
      background: none !important;
      display: block !important;
      opacity: 1 !important;
      overflow: visible !important;
      padding: 0 !important;
    }
    .scroll-wrapper { transform: none !important; max-width: 100% !important; }
    .scroll-cap { display: none !important; }
    .report-card {
      max-width: 100% !important;
      max-height: none !important;
      box-shadow: none !important;
      margin: 0 !important;
      page-break-inside: avoid;
    }
    .rubber-stamp { opacity: 1 !important; transform: rotate(14deg) !important; }
    /* Kill the SVG displacement filter in print — the roughness effect renders badly
       when the print engine downsamples, making the text unreadable. Clean stamp only. */
    .rubber-stamp svg { filter: none !important; }

    /* Swap SVG rabbi for PNG rabbi in print — clean illustration matches the shared image.
       We use BOTH the <img> tag AND background-image on the container as belt-and-suspenders
       since Chrome and Safari print engines are inconsistent about which they'll render. */
    .report-rabbi svg { display: none !important; }
    .report-rabbi {
      position: relative !important;
      overflow: hidden !important;
      background:
        url('./RABBI_SCHMUEL.png') center bottom / contain no-repeat,
        radial-gradient(circle at center, #fdf8e7 0%, #f0e3b8 100%) !important;
      -webkit-print-color-adjust: exact !important;
      print-color-adjust: exact !important;
      color-adjust: exact !important;
    }
    .report-rabbi-print {
      display: block !important;
      position: absolute !important;
      top: 0 !important;
      left: 0 !important;
      width: 100% !important;
      height: 100% !important;
      object-fit: contain !important;
      object-position: center bottom !important;
      -webkit-print-color-adjust: exact !important;
      print-color-adjust: exact !important;
    }
    /* Force all images to print (Chrome/Safari sometimes strip images without this) */
    img { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  }