/* =============================================================================
   TAVERN NPC GENERATOR — styles.css
   Sections:
   1. Custom properties (:root)
   2. Reset and base styles
   3. Page shell and layout
   4. Brand block and intro
   5. Form controls (labels, selects, button-row)
   6. Output panel (header, grid, sections, NPCs, lists)
   7. Ad placeholders
   8. @media (max-width: 980px)  — tablet / small desktop
   9. @media (max-width: 700px)  — mobile (consolidated)
  10. @media (max-width: 340px)  — very small screens
  11. @media (prefers-reduced-motion: reduce)
  12. @media print
============================================================================= */


/* ── 1. Custom properties ─────────────────────────────────────────────────── */

:root {
  color-scheme: light;
  --ink:          #1e2523;
  --muted:        #62706c;
  --paper:        #f5f1e8;
  --panel:        #fffaf0;
  --panel-deep:   #ebe3d3;
  --line:         #d8cdb9;
  --accent:       #7f4035;
  --accent-strong:#5f2c27;
  --gold:         #b5863a;
  --green:        #37695c;
  --shadow:       0 18px 40px rgba(50, 38, 29, 0.14);
}



[data-theme="dark"] {
  color-scheme: dark;
  --ink:          #f2eee4;
  --muted:        #b8c0ba;
  --paper:        #1a1a1a;
  --panel:        #242424;
  --panel-deep:   #30302d;
  --line:         #4b4a44;
  --accent:       #d38a6a;
  --accent-strong:#f0b08e;
  --gold:         #d8ad5c;
  --green:        #8fc6b4;
  --shadow:       0 18px 44px rgba(0, 0, 0, 0.38);
}

[data-theme="dark"] body {
  background:
    linear-gradient(120deg, rgba(211, 138, 106, 0.12), transparent 34%),
    linear-gradient(300deg, rgba(143, 198, 180, 0.10), transparent 38%),
    var(--paper);
  color: var(--ink);
}

[data-theme="dark"] button {
  border-color: rgba(211, 138, 106, 0.72);
  background: #2d2924;
  color: #f5dcc9;
}

[data-theme="dark"] button:hover {
  border-color: var(--gold);
  background: #3a3129;
}

[data-theme="dark"] button:focus-visible,
[data-theme="dark"] select:focus-visible,
[data-theme="dark"] input:focus-visible {
  outline-color: rgba(216, 173, 92, 0.55);
}

[data-theme="dark"] select,
[data-theme="dark"] .scene-library-organizer input {
  border-color: rgba(143, 198, 180, 0.24);
  background: #1f211f;
  color: var(--ink);
}

[data-theme="dark"] label,
[data-theme="dark"] .scene-library-organizer label {
  color: #d8d1c3;
}

[data-theme="dark"] .control-panel,
[data-theme="dark"] .output-panel {
  border-color: var(--line);
  background: rgba(36, 36, 36, 0.94);
}

[data-theme="dark"] .primary-action,
[data-theme="dark"] .lock-toggle[aria-pressed="true"],
[data-theme="dark"] .lock-toggle.is-locked {
  border-color: #9f5f46;
  background: #9f5f46;
  color: #fff7ec;
}

[data-theme="dark"] .primary-action:hover {
  border-color: var(--accent-strong);
  background: #b66f52;
}

[data-theme="dark"] .output-section,
[data-theme="dark"] .scene-library-empty,
[data-theme="dark"] .scene-library-card,
[data-theme="dark"] .resource-card,
[data-theme="dark"] .use-case,
[data-theme="dark"] .genre-card {
  border-color: rgba(75, 74, 68, 0.95);
  background: rgba(31, 32, 30, 0.86);
}

[data-theme="dark"] .output-section p,
[data-theme="dark"] .output-section li,
[data-theme="dark"] .npc-entry p,
[data-theme="dark"] .resource-section p,
[data-theme="dark"] .resource-section li,
[data-theme="dark"] .resource-section summary,
[data-theme="dark"] .support-nav a,
[data-theme="dark"] .footer-links a {
  color: #e4ded0;
}

[data-theme="dark"] .resource-section {
  border-color: var(--line);
  background: rgba(36, 36, 36, 0.92);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .table-use-section,
[data-theme="dark"] .npc-details-panel,
[data-theme="dark"] .privacy-note {
  border-color: rgba(143, 198, 180, 0.32);
  background: rgba(143, 198, 180, 0.09);
}

[data-theme="dark"] .optional-conflict,
[data-theme="dark"] .scene-library-status,
[data-theme="dark"] .save-export-status {
  border-color: rgba(211, 138, 106, 0.28);
  background: rgba(211, 138, 106, 0.10);
  color: #f0b08e;
}

[data-theme="dark"] .ad-placeholder,
[data-theme="dark"] .ad-slot,
[data-theme="dark"] .ad-banner,
[data-theme="dark"] .ad-inline,
[data-theme="dark"] .ad-sidebar {
  border-color: rgba(184, 192, 186, 0.34);
  background: rgba(31, 32, 30, 0.68);
  color: rgba(218, 212, 199, 0.78);
}/* ── 2. Reset and base styles ─────────────────────────────────────────────── */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

/* Custom scrollbar — webkit (thin, parchment-toned) */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: var(--paper);
}

::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(120deg, rgba(127, 64, 53, 0.1),  transparent 34%),
    linear-gradient(300deg, rgba(55, 105, 92, 0.13),  transparent 38%),
    var(--paper);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.5;
}

button,
select {
  font: inherit;
}

button {
  min-height: 42px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: #fff7e7;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 700;
  transition:
    background    160ms ease,
    border-color  160ms ease,
    color         160ms ease,
    transform     160ms ease;
}

button:hover {
  border-color: var(--gold);
  background: #fff0cf;
  transform: translateY(-1px);
}

button:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(181, 134, 58, 0.4);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}


/* ── 3. Page shell and layout ─────────────────────────────────────────────── */

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 20px;
  min-height: calc(100vh - 48px);
}

.control-panel,
.output-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.92);
  box-shadow: var(--shadow);
}

.control-panel {
  align-self: start;
  position: sticky;
  top: 24px;
  padding: 22px;
}

.output-panel {
  min-width: 0;
  padding: 24px;
}


/* ── 4. Brand block and intro ─────────────────────────────────────────────── */

.brand-block {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 1.74rem + 1.2vw, 3rem);
  line-height: 1.02;
}

.intro {
  margin: 12px 0 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}



.theme-toggle {
  margin-top: 14px;
  min-height: 36px;
  border-color: rgba(55, 105, 92, 0.38);
  background: rgba(55, 105, 92, 0.08);
  color: var(--green);
  padding: 6px 11px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
}

[data-theme="dark"] .theme-toggle {
  border-color: rgba(143, 198, 180, 0.42);
  background: rgba(143, 198, 180, 0.10);
  color: var(--green);
}

/* ── 5. Form controls ─────────────────────────────────────────────────────── */

.generator-form {
  display: grid;
  gap: 9px;
  padding-top: 18px;
}

label {
  color: #33403c;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  margin-bottom: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf7;
  color: var(--ink);
  padding: 8px 34px 8px 10px;
}

/* Button row: primary spans full width; secondary buttons fill a 2×2 grid.
   With 4 secondary buttons (Copy, Print, Reroll, Shuffle) this gives a neat
   two-column layout on desktop and collapses gracefully on mobile. */
.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.primary-action {
  grid-column: 1 / -1;
  background: var(--accent);
  color: #fffaf0;
}

.primary-action:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

/* All secondary buttons (Copy, Print, Reroll, Shuffle) sit in the 2-col grid
   without overrides — they simply fill columns left-to-right. */
.button-row button {
  min-width: 0;
}

.save-export-panel {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.compact-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.compact-panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.12;
}

.save-export-status {
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid rgba(55, 105, 92, 0.22);
  border-radius: 999px;
  background: rgba(55, 105, 92, 0.08);
  color: var(--green);
  padding: 4px 8px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.export-actions,
.save-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.export-actions {
  grid-template-columns: 1fr;
}

.save-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.export-actions button,
.save-actions button {
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
}

.export-actions [data-export-format="prep-sheet"] {
  border-color: rgba(55, 105, 92, 0.5);
  background: rgba(55, 105, 92, 0.08);
  color: var(--green);
}

.scene-library-panel {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.scene-library-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  line-height: 1.45;
}

.scene-library-organizer {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.scene-library-organizer label {
  color: var(--green);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scene-library-organizer input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(157, 142, 113, 0.42);
  border-radius: 7px;
  background: rgba(255, 253, 247, 0.85);
  color: var(--ink);
  padding: 8px 9px;
  font: 0.88rem/1.25 Arial, Helvetica, sans-serif;
}

.scene-library-help {
  margin: 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  line-height: 1.35;
}

.scene-library-status {
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid rgba(127, 64, 53, 0.24);
  border-radius: 999px;
  background: rgba(127, 64, 53, 0.08);
  color: var(--accent-strong);
  padding: 4px 8px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.scene-library-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.scene-library-actions button {
  min-width: 0;
  min-height: 38px;
  padding: 7px 9px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
}

.library-clear-action {
  grid-column: 1 / -1;
}

.scene-library-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.scene-library-empty {
  margin: 0;
  border: 1px dashed rgba(98, 112, 108, 0.34);
  border-radius: 7px;
  background: rgba(255, 253, 247, 0.58);
  color: var(--muted);
  padding: 9px 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.86rem;
}

.scene-library-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(216, 205, 185, 0.9);
  border-left: 3px solid var(--gold);
  border-radius: 7px;
  background: rgba(255, 253, 247, 0.72);
  padding: 10px;
}

.scene-library-card h4,
.scene-library-card p {
  margin: 0;
}

.scene-library-card h4 {
  color: var(--green);
  font-size: 1rem;
  line-height: 1.16;
}

.scene-library-tag {
  justify-self: start;
  border: 1px solid rgba(55, 105, 92, 0.2);
  border-radius: 999px;
  background: rgba(55, 105, 92, 0.08);
  color: var(--green);
  padding: 3px 7px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
}

.scene-library-meta {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
}

.scene-library-card-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.scene-library-card-actions button {
  min-width: 0;
  min-height: 34px;
  padding: 5px 8px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
}


/* ── 6. Output panel ──────────────────────────────────────────────────────── */

.output-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.output-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

h2 {
  margin: 0;
  font-size: clamp(2.1rem, 1.76rem + 1.5vw, 3.35rem);
  line-height: 1;
}

.status-pill {
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid rgba(55, 105, 92, 0.28);
  border-radius: 999px;
  background: rgba(55, 105, 92, 0.1);
  color: var(--green);
  padding: 6px 11px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding-top: 18px;
}

.output-section {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.74);
  padding: 16px;
}

.span-2 {
  grid-column: span 2;
}

.output-section h3,
.npc-entry h4 {
  margin: 0;
}

.output-section h3 {
  color: var(--accent-strong);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.output-section-header {
  align-items: flex-start;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.output-section p,
.output-section ul {
  margin: 9px 0 0;
}

.output-section p,
.output-section li {
  color: #313a37;
  font-size: 1.02rem;
}

ul {
  padding-left: 20px;
}

li + li {
  margin-top: 4px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.small-action {
  min-height: 34px;
  border-color: rgba(127, 64, 53, 0.35);
  padding: 5px 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.8rem;
}

.lock-toggle {
  min-height: 34px;
  border-color: rgba(55, 105, 92, 0.36);
  background: rgba(55, 105, 92, 0.08);
  color: var(--green);
  padding: 5px 10px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  white-space: nowrap;
}

.lock-toggle[aria-pressed="true"],
.lock-toggle.is-locked {
  border-color: var(--green);
  background: var(--green);
  color: #fffaf0;
}

.npc-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.npc-entry {
  display: flex;
  min-height: 100%;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  border-left: 3px solid var(--gold);
  padding: 11px 12px;
}

.npc-entry-body {
  min-width: 0;
}

.npc-entry h4 {
  color: var(--green);
  font-size: 1.04rem;
}

.npc-entry p {
  font-size: 0.96rem;
}

.npc-detail-toggle {
  width: fit-content;
  min-height: 32px;
}


.npc-details-panel {
  margin-top: 12px;
  border: 1px dashed rgba(55, 105, 92, 0.38);
  border-radius: 7px;
  background: rgba(55, 105, 92, 0.06);
  padding: 12px;
}

.npc-details-panel p {
  margin: 0;
}

.npc-detail-placeholder {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
}

.optional-conflict {
  background: rgba(127, 64, 53, 0.07);
}

.table-use-section {
  border-color: rgba(55, 105, 92, 0.34);
  background: rgba(55, 105, 92, 0.07);
}

.table-use-notes {
  columns: 2;
  column-gap: 22px;
}

.table-use-notes li {
  break-inside: avoid;
}


/* ── 7. Ad placeholders ──────────────────────────────────────────────────── */

.ad-placeholder,
.ad-slot,
.ad-banner,
.ad-inline,
.ad-sidebar {
  display: grid;
  place-items: center;
  min-height: 74px;
  margin: 22px 0;
  border: 1px dashed rgba(98, 112, 108, 0.38);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.48);
  color: rgba(98, 112, 108, 0.86);
  padding: 14px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.ad-placeholder:empty::before,
.ad-slot:empty::before,
.ad-banner:empty::before,
.ad-inline:empty::before,
.ad-sidebar:empty::before {
  content: "Ad placeholder";
}

.ad-placeholder > *,
.ad-slot > *,
.ad-banner > *,
.ad-inline > *,
.ad-sidebar > * {
  margin: 0;
}

.ad-banner {
  min-height: 90px;
}

.ad-inline {
  min-height: 68px;
}

.ad-sidebar {
  min-height: 180px;
}
/* ── 8. Tablet / small-desktop breakpoint (max-width: 980px) ─────────────── */

@media (max-width: 980px) {
  .app-shell {
    padding: 16px;
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .control-panel {
    position: static;
  }

  /* Two-column form on tablet so it stays compact above the output panel */
  .generator-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .button-row,
  .brand-block,
  .save-export-panel,
  .scene-library-panel {
    grid-column: 1 / -1;
  }

  .save-export-panel,
  .scene-library-panel {
    border-top: 1px solid var(--line);
  }
}


/* ── 9. Mobile breakpoint (max-width: 700px) — consolidated ─────────────── */

@media (max-width: 700px) {
  /* Prevent any horizontal overflow */
  html,
  body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .app-shell {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    margin-left: 0;
    margin-right: 0;
  }

  .workspace,
  .control-panel,
  .output-panel {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .control-panel,
  .output-panel {
    padding: 14px;
    /* Allow content to breathe; hidden would clip text and shadows */
    overflow: visible;
  }

  .brand-block {
    padding-bottom: 12px;
  }

  h1 {
    max-width: 100%;
    font-size: 1.72rem;
    line-height: 1.04;
    overflow-wrap: anywhere;
  }

  h2 {
    font-size: 1.62rem;
    line-height: 1.08;
  }

  .intro {
    max-width: 100%;
    margin-bottom: 0;
    font-size: 0.94rem;
    overflow-wrap: anywhere;
  }

  /* Single-column form on mobile */
  .generator-form {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  label {
    font-size: 0.72rem;
  }

  select {
    min-height: 40px;
    padding: 8px 28px 8px 10px;
    font-size: 0.92rem;
    width: 100%;
    max-width: 100%;
  }

  /* Button row: 2×2 grid for secondary buttons; primary spans full width */
  .button-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    order: -1;
  }

  .primary-action {
    grid-column: 1 / -1;
  }

  .button-row button {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  /* Output */
  .output-header {
    display: grid;
  }

  .output-header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .status-pill {
    width: fit-content;
  }

  .output-grid,
  .npc-list {
    grid-template-columns: 1fr;
  }

  .table-use-notes {
    columns: 1;
  }

  .section-title-row {
    align-items: flex-start;
  }

  .section-actions {
    justify-content: flex-start;
  }

  .span-2 {
    grid-column: auto;
  }

  .privacy-note,
  .local-first-note,
  .local-note,
  .ad-placeholder,
  .ad-slot,
  .ad-banner,
  .ad-inline,
  .ad-sidebar {
    max-width: 100%;
  }
}


/* ── 10. Very small screens (max-width: 340px) ────────────────────────────── */

@media (max-width: 340px) {
  /* Drop to a single column for the button row on tiny phones */
  .button-row {
    grid-template-columns: 1fr;
  }

  .save-actions {
    grid-template-columns: 1fr;
  }

  .compact-panel-header,
  .scene-library-actions,
  .scene-library-card-actions,
  .output-header-actions,
  .section-title-row {
    display: grid;
    justify-items: start;
  }

  .primary-action {
    grid-column: auto;
  }
}


/* ── 11. Reduced motion ───────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  button {
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
  }

  button:hover {
    transform: none;
  }
}


/* Resource content aliases added during AdSense-readiness polish. */
.resource-layer {
  width: min(1080px, 100%);
  margin: 26px auto 0;
  display: grid;
  gap: 16px;
}

.resource-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.9);
  padding: 20px;
  box-shadow: 0 10px 28px rgba(50, 38, 29, 0.08);
}

.resource-section h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.12;
}

.resource-section h3 {
  margin: 0 0 6px;
  color: var(--green);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.86rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.resource-section p,
.resource-section li,
.resource-section summary {
  color: #38433f;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.96rem;
}

.resource-section p {
  margin: 10px 0 0;
}

.resource-grid,
.use-case-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.resource-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.use-case-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.resource-card,
.use-case {
  border: 1px solid rgba(216, 205, 185, 0.9);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.72);
  padding: 14px;
}


.workflow-list {
  margin: 14px 0 0;
  padding-left: 22px;
}

.workflow-list li + li {
  margin-top: 8px;
}

.genre-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.genre-card {
  border: 1px solid rgba(216, 205, 185, 0.9);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.72);
  padding: 14px;
}

.footer-links,
.support-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
}

.footer-links {
  padding: 4px 0 22px;
}

.footer-links a,
.support-nav a,
.resource-section a {
  color: var(--accent-strong);
  font-weight: 800;
}

.support-page {
  width: min(920px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
}

.support-nav {
  justify-content: flex-start;
  margin-bottom: 16px;
}

.faq-section details + details {
  margin-top: 8px;
}

.faq-section details {
  border-top: 1px solid rgba(216, 205, 185, 0.8);
  padding-top: 10px;
}

.faq-section summary {
  cursor: pointer;
  font-weight: 800;
}

.privacy-note {
  border-color: rgba(55, 105, 92, 0.3);
  background: rgba(55, 105, 92, 0.07);
}

@media (max-width: 700px) {
  .resource-layer {
    margin-top: 16px;
    gap: 12px;
  }

  .resource-section {
    padding: 15px;
  }

  .resource-grid,
  .use-case-list {
    grid-template-columns: 1fr;
  }
}


/* ── 12. Print ────────────────────────────────────────────────────────────── */

@media print {
  @page {
    size: letter portrait;
    margin: 0.45in;
  }

  html,
  body {
    min-height: 0;
    background: #fff;
    color: #111;
    font-size: 10pt;
    line-height: 1.24;
  }

  .app-shell {
    width: auto;
    min-height: 0;
    padding: 0;
  }

  .workspace {
    display: block;
    min-height: 0;
  }

  .control-panel,
  .scene-library-panel,
  .resource-layer,
  .resource-section,
  .ad-placeholder,
  .ad-slot,
  .ad-banner,
  .ad-inline,
  .ad-sidebar,
  button,
  .output-header-actions,
  .section-actions,
  .npc-details-panel {
    display: none;
  }

  .output-panel {
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    padding: 0;
  }

  .output-header {
    display: block;
    border-bottom: 2px solid #111;
    padding-bottom: 0.12in;
    margin-bottom: 0.12in;
  }

  .output-header .eyebrow {
    display: none;
  }

  /* Keep the venue name on the first page. */
  h2 {
    break-after: avoid;
    page-break-after: avoid;
    font-size: 20pt;
    line-height: 1.05;
  }

  .output-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.08in;
    padding-top: 0;
  }

  .span-2 {
    grid-column: span 2;
  }

  .npc-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.06in;
    margin-top: 0.05in;
  }

  .npc-entry {
    gap: 0.04in;
    border-left: 2px solid #444;
    padding: 0.04in 0.06in;
  }

  /* Prevent headings from being orphaned at the bottom of a page. */
  .output-section h3 {
    break-after: avoid;
    page-break-after: avoid;
    color: #111;
    font-size: 8pt;
    letter-spacing: 0.03em;
  }

  /* Avoid breaking inside an output section when possible. */
  .output-section {
    border: 1px solid #aaa;
    border-radius: 0;
    background: #fff;
    padding: 0.07in;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .output-section p,
  .output-section ul {
    margin-top: 0.04in;
  }

  .output-section p,
  .output-section li,
  .npc-entry p {
    color: #111;
    font-size: 9pt;
  }

  .npc-entry h4 {
    color: #111;
    font-size: 9.5pt;
  }

  ul {
    padding-left: 0.16in;
  }

  li + li {
    margin-top: 0.02in;
  }

  .table-use-notes {
    columns: 3;
    column-gap: 0.18in;
  }

  .optional-conflict,
  .table-use-section {
    background: #fff;
  }

  /* Status and lock UI add no meaning on paper. */
  .status-pill {
    display: none;
  }

  .lock-toggle,
  .npc-detail-toggle,
  .npc-details-panel {
    display: none;
  }
}





