  /* ── RESULT SCREEN ── */
  #result {
    background: var(--parchment);
    color: var(--ink);
    min-height: 100vh;
  }

  /* First-run example banner (read-only sample story) */
  .sample-banner {
    background: rgba(138,111,58,0.1);
    border: 1px solid rgba(138,111,58,0.35);
    border-radius: 5px;
    padding: 0.6rem 0.9rem;
    margin-bottom: 1.1rem;
    font-family: 'Crimson Pro', serif;
    font-style: italic;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #6b5526;
    text-align: center;
  }

  .result-header {
    background: var(--ink);
    padding: 1.5rem 1.5rem 2rem;
    position: relative;
  }

  .result-back {
    background: none;
    border: none;
    color: var(--stone);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
    display: block;
  }

  .result-image-container {
    width: 100%;
    min-height: 240px;
    margin-bottom: 1.5rem;
    position: relative;
  }

  /* Horizontal scrollable gallery — global map bios with multiple photos */
  .grave-gallery-strip {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.25rem;
    height: 240px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
  }
  .grave-gallery-strip::-webkit-scrollbar { height: 3px; }
  .grave-gallery-strip::-webkit-scrollbar-thumb { background: rgba(201,168,76,0.4); border-radius: 2px; }

  .grave-gallery-slide {
    flex: 0 0 auto;
    scroll-snap-align: start;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .grave-gallery-slide img {
    height: 100%;
    width: auto;
    max-width: 90vw;
    object-fit: contain;
    opacity: 0.9;
    display: block;
  }
  .grave-gallery-slide.portrait img {
    border-radius: 3px;
    max-width: 60vw;
  }
  .grave-gallery-label {
    position: absolute;
    bottom: 0.4rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26,20,16,0.75);
    color: rgba(232,212,160,0.85);
    font-family: 'Crimson Pro', serif;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    white-space: nowrap;
    pointer-events: none;
  }

  .result-image-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    height: 240px;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    overflow: hidden;
  }

  .result-image-slot {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .result-image-slot.portrait {
    flex: 0 0 25%;
    max-width: 25%;
  }

  .result-image-slot.gravestone {
    flex: 1 1 auto;
    min-width: 0;
  }

  .result-image-slot img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.85;
  }

  .result-image-slot.portrait img {
    border-radius: 3px;
  }

  /* When no portraits, gravestone is centered and a bit wider */
  .result-image-row.solo .result-image-slot.gravestone {
    max-width: 70%;
  }

  .result-image-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(transparent, var(--ink));
    pointer-events: none;
  }

  .result-name {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--parchment);
    line-height: 1.2;
  }

  .result-dates {
    font-family: 'Crimson Pro', serif;
    font-style: italic;
    color: var(--gold);
    font-size: 1.1rem;
    margin-top: 0.25rem;
  }

  .result-body { padding: 1.5rem; }

  .result-section {
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(12px);
    animation: fade-up 0.6s ease forwards;
  }

  .result-section:nth-child(1) { animation-delay: 0.1s; }
  .result-section:nth-child(2) { animation-delay: 0.25s; }
  .result-section:nth-child(3) { animation-delay: 0.4s; }
  .result-section:nth-child(4) { animation-delay: 0.55s; }

  @keyframes fade-up {
    to { opacity: 1; transform: translateY(0); }
  }

  .section-label {
    font-family: 'Playfair Display', serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--stone);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(138,126,110,0.3);
  }

  .biography-text {
    font-family: 'Crimson Pro', serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #2a2016;
  }

  .biography-text p { margin-bottom: 1rem; }

  /* AI-honesty caption — small, calm note beneath every generated bio.
     Muted gold-on-dark to read as honest scholarship, not a warning. */
  .ai-disclaimer-note {
    margin-top: 1rem;
    padding: 0.5rem 0.75rem;
    border-left: 2px solid rgba(201,168,76,0.5);
    background: rgba(201,168,76,0.06);
    color: #8a6f3a;
    font-family: 'Crimson Pro', serif;
    font-style: italic;
    font-size: 0.82rem;
    line-height: 1.5;
    border-radius: 0 4px 4px 0;
  }

  /* First-view explainer reuses the symbol bottom-sheet shell; just give the
     longer body text comfortable spacing. */
  .ai-disclaimer-sheet .symbol-sheet-text { line-height: 1.6; }

  /* "Report a problem" link inside the caption — quiet, underlined, inline. */
  .ai-report-link {
    background: none;
    border: none;
    padding: 0;
    margin-left: 0.15rem;
    color: var(--gold, #c9a84c);
    font-family: 'Crimson Pro', serif;
    font-style: italic;
    font-size: 0.82rem;
    text-decoration: underline;
    cursor: pointer;
  }
  .ai-report-link:hover { color: #e8d4a0; }

  /* Report bottom-sheet (reuses .symbol-sheet shell from modals.css). */
  .report-sheet-sub {
    font-family: 'Crimson Pro', serif;
    color: var(--cream, #e8d4a0);
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.85;
    margin-bottom: 1rem;
  }
  .report-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }
  .report-reason-chip {
    background: rgba(201,168,76,0.08);
    border: 1px solid rgba(201,168,76,0.35);
    color: var(--cream, #e8d4a0);
    font-family: 'Crimson Pro', serif;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
  }
  .report-reason-chip.selected {
    background: rgba(201,168,76,0.22);
    border-color: var(--gold, #c9a84c);
    color: #fff;
  }
  .report-note {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 6px;
    color: var(--cream, #e8d4a0);
    font-family: 'Crimson Pro', serif;
    font-size: 0.9rem;
    padding: 0.6rem 0.7rem;
    margin-bottom: 1rem;
    resize: vertical;
  }
  .report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
  }
  .report-cancel {
    background: none;
    border: 1px solid rgba(138,126,110,0.4);
    color: var(--stone, #8a7e6e);
    font-family: 'Crimson Pro', serif;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
  }
  .report-submit {
    background: rgba(201,168,76,0.2);
    border: 1px solid var(--gold, #c9a84c);
    color: #fff;
    font-family: 'Crimson Pro', serif;
    font-size: 0.9rem;
    padding: 0.5rem 1.1rem;
    border-radius: 4px;
    cursor: pointer;
  }
  .report-submit:disabled { opacity: 0.45; cursor: default; }
  .report-status {
    color: #c97a3a;
    font-family: 'Crimson Pro', serif;
    font-size: 0.82rem;
    margin-top: 0.7rem;
    text-align: right;
  }

  .biography-text sup.cite {
    font-size: 0.7em;
    vertical-align: super;
    line-height: 0;
    margin-left: 1px;
  }
  .biography-text sup.cite a {
    color: var(--gold, #c9a55a);
    text-decoration: none;
    font-weight: 600;
  }
  .biography-text sup.cite a:hover {
    text-decoration: underline;
  }
  .biography-text sup.cite-noref {
    color: var(--stone, #888);
    cursor: help;
  }
  .sources-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .source-item {
    font-size: 0.85rem;
    color: var(--stone);
    padding: 0.5rem 0.75rem;
    background: rgba(138,126,110,0.08);
    border-left: 2px solid var(--gold);
    font-style: italic;
  }

  .source-item a {
    color: var(--moss);
    text-decoration: underline;
    word-break: break-all;
  }

  .location-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--stone);
    font-style: italic;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(138,126,110,0.3);
    margin-bottom: 1.5rem;
  }

  /* Action buttons */
  .result-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem 2rem;
    background: var(--parchment);
    border-top: 1px solid rgba(138,126,110,0.2);
    position: sticky;
    bottom: 0;
  }

  .action-btn {
    flex: 1;
    padding: 0.9rem;
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
  }

  .action-save {
    background: var(--ink);
    color: var(--parchment);
  }

  .action-save:hover { background: #2a2016; }
  .action-save.saved { background: var(--moss); }

  .action-share {
    background: transparent;
    border: 1px solid var(--ink) !important;
    color: var(--ink);
  }

  .action-share:hover { background: rgba(26,20,16,0.08); }

  .action-export {
    background: transparent;
    border: 1px solid var(--ink) !important;
    color: var(--ink);
  }

  .action-export:hover { background: rgba(26,20,16,0.08); }

  .action-new {
    background: var(--gold);
    color: var(--ink);
    font-weight: 700;
  }

  .action-new:hover { background: #d4b55a; }

  /* Error message */
  .error-box {
    background: rgba(139,58,42,0.1);
    border: 1px solid rgba(139,58,42,0.4);
    color: var(--rust);
    padding: 1rem;
    font-style: italic;
    font-size: 0.9rem;
    margin-top: 1rem;
    display: none;
    max-width: 360px;
    text-align: center;
  }

  /* Symbols on the stone — tappable meaning chips */
  .symbol-hint {
    font-size: 0.8rem;
    color: var(--stone);
    font-style: italic;
    margin-bottom: 0.6rem;
  }

  .symbol-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .symbol-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: 'Crimson Pro', serif;
    font-size: 0.85rem;
    line-height: 1.2;
    color: var(--ink);
    background: rgba(138,126,110,0.08);
    border: 1px solid rgba(138,126,110,0.3);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    margin: 0;
  }

  button.symbol-chip-tappable {
    cursor: pointer;
    color: #8a6f2e;
    background: rgba(201,168,76,0.1);
    border-color: rgba(201,168,76,0.5);
    font-weight: 600;
    transition: background 0.15s ease, border-color 0.15s ease;
  }

  button.symbol-chip-tappable:hover {
    background: rgba(201,168,76,0.2);
    border-color: var(--gold);
  }

  .symbol-chip-caret {
    color: var(--gold);
    font-weight: 700;
  }

  /* Symbol meaning bottom-sheet */
  .symbol-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,20,16,0.55);
    z-index: 3000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: symbol-sheet-fade 0.2s ease;
  }

  @keyframes symbol-sheet-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .symbol-sheet {
    width: 100%;
    max-width: 480px;
    background: var(--parchment);
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    padding: 0.75rem 1.5rem 2rem;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.35);
    animation: symbol-sheet-slide 0.25s ease;
  }

  @keyframes symbol-sheet-slide {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .symbol-sheet-handle {
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: rgba(138,126,110,0.4);
    margin: 0 auto 1rem;
  }

  .symbol-sheet-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: #8a6f2e;
    text-transform: capitalize;
    margin-bottom: 0.75rem;
  }

  .symbol-sheet-text {
    font-family: 'Crimson Pro', serif;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ink);
    margin-bottom: 1.5rem;
  }

  /* Mentions sheet — a list of name-safe one-line source hyperlinks. Reuses the
     parchment .symbol-sheet shell; each line styled like a source link. */
  .mention-lines {
    margin-bottom: 1.5rem;
  }

  .mention-line {
    display: block;
    font-family: 'Crimson Pro', serif;
    font-size: 0.98rem;
    line-height: 1.4;
    color: var(--moss);
    text-decoration: underline;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(26,20,16,0.12);
  }

  .mention-line:last-child { border-bottom: none; }
  .mention-line:hover { color: #5a6a48; }

  /* Link-rot: a mention whose URL is unusable renders as plain (non-clickable) text. */
  .mention-line-dead {
    color: var(--ink);
    text-decoration: none;
    opacity: 0.85;
  }

  .symbol-sheet-close {
    width: 100%;
    padding: 0.8rem;
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--ink);
    border-radius: 6px;
    cursor: pointer;
  }

  .symbol-sheet-close:hover { background: rgba(26,20,16,0.08); }
