/* Artifact platform tokens — auto-resolved */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}

/* ============================================================
   The Examined Life — contemplative, literary, calm
   ============================================================ */

* { box-sizing: border-box; }

html, body, #root {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-size: 17px;
  line-height: 1.65;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

button:disabled {
  cursor: not-allowed;
}

.el-root {
  min-height: 100vh;
  --guide-accent: var(--primary);
  --guide-accent-tint: var(--primary-tint);
}

/* ============================================================
   SETUP
   ============================================================ */

.setup {
  max-width: 880px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.setup-hero {
  text-align: center;
  padding: 2rem 0 3.5rem;
}

.eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.setup-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 400;
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.lede {
  max-width: 36rem;
  margin: 0 auto;
  font-size: 1.1rem;
  color: var(--text-muted);
  font-style: italic;
}

.setup-section {
  margin: 3rem 0;
}

.setup-section h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.4rem;
  margin: 0 0 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  border-bottom: 1px solid var(--neutral);
  padding-bottom: 0.75rem;
}

.step {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-muted);
  font-size: 1rem;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.guide-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.5rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--neutral);
  border-radius: var(--radius-md);
  text-align: left;
  transition: all 0.18s ease;
  position: relative;
  overflow: hidden;
}

.guide-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent);
  opacity: 0.4;
  transition: opacity 0.18s ease;
}

.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.guide-card.is-selected {
  border-color: var(--card-accent);
  background: var(--card-accent-tint);
  box-shadow: var(--shadow-md);
}

.guide-card.is-selected::before { opacity: 1; }

.guide-glyph {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--card-accent);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.guide-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.guide-tagline {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
}

.depth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.depth-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--neutral);
  border-radius: var(--radius-md);
  text-align: left;
  transition: all 0.18s ease;
}

.depth-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.depth-card.is-selected {
  border-color: var(--guide-accent, var(--primary));
  background: var(--guide-accent-tint, var(--primary-tint));
  box-shadow: var(--shadow-md);
}

.depth-label {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
}

.depth-range {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.depth-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-style: italic;
}

.setup-begin {
  text-align: center;
  margin-top: 3.5rem;
}

.begin-button {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  padding: 0.85rem 2.5rem;
  background: var(--guide-accent, var(--primary));
  color: white;
  border-radius: var(--radius-md);
  letter-spacing: 0.04em;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.begin-button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.begin-button:disabled {
  background: var(--neutral);
  color: var(--text-muted);
  box-shadow: none;
}

.begin-hint {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}

.setup-footer {
  margin-top: 5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================
   CONVERSATION
   ============================================================ */

.conversation {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}

.chat-header {
  border-bottom: 1px solid var(--neutral);
  background: var(--bg);
}

.chat-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.chat-header-guide {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.chat-header-glyph {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: var(--guide-accent-tint);
  color: var(--guide-accent);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  border: 1px solid var(--guide-accent);
}

.chat-header-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
}

.chat-header-meta {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.link-button {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
}

.link-button:hover {
  color: var(--text);
}

.chat-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* The AIChat root — make it fill the shell */
.chat-shell > * {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Messages region — give it generous reading width and air */
.msg {
  padding: 1.25rem 1.75rem;
  max-width: 100%;
  animation: msg-in 0.4s ease both;
}

@keyframes msg-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-meta {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.msg-body {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

.msg-guide .msg-meta {
  color: var(--guide-accent);
}

.msg-guide .msg-body {
  font-style: normal;
}

.msg-user {
  background: var(--surface);
  border-left: 2px solid var(--guide-accent);
}

.msg-user .msg-body {
  color: var(--text);
}

.caret {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--guide-accent);
  margin-left: 4px;
  vertical-align: text-bottom;
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.chat-empty {
  padding: 3rem 1.75rem;
  text-align: center;
  color: var(--text-muted);
}

.chat-empty-glyph {
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--guide-accent);
  margin: 0 0 1rem;
  line-height: 1;
}

.chat-empty-text {
  font-style: italic;
  max-width: 28rem;
  margin: 0 auto;
  line-height: 1.6;
}

.chat-input {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--neutral);
  background: var(--bg);
  align-items: flex-end;
}

.chat-input textarea {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--neutral);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.55;
  resize: none;
  min-height: 56px;
  max-height: 180px;
  transition: border-color 0.15s ease;
}

.chat-input textarea:focus-visible {
  outline: none;
  border-color: var(--guide-accent);
  box-shadow: 0 0 0 3px var(--guide-accent-tint);
}

.chat-input textarea:disabled {
  background: var(--bg);
  color: var(--text-muted);
  font-style: italic;
}

.chat-send {
  font-family: var(--font-sans);
  background: var(--guide-accent);
  color: white;
  padding: 0 1.4rem;
  height: 56px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  transition: all 0.15s ease;
}

.chat-send:not(:disabled):hover {
  filter: brightness(0.92);
}

.chat-send:disabled {
  background: var(--neutral);
  color: var(--text-muted);
}

.generating-overlay {
  position: absolute;
  inset: 0;
  background: var(--scrim);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 10;
  animation: fade-in 0.3s ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.generating-card {
  background: var(--surface);
  padding: 2.5rem 3rem;
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow-lg);
  max-width: 22rem;
}

.generating-glyph {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: var(--guide-accent);
  margin: 0 0 0.5rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.generating-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.generating-sub {
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.92rem;
}

.gen-error {
  position: absolute;
  bottom: 6rem;
  left: 1.5rem;
  right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  color: var(--danger);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.gen-error p { margin: 0; }

/* ============================================================
   PORTRAIT
   ============================================================ */

.portrait {
  max-width: 760px;
  margin: 0 auto;
  padding: 4rem 1.5rem 5rem;
}

.portrait-header {
  text-align: center;
  margin-bottom: 3rem;
}

.portrait-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  font-weight: 400;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  letter-spacing: -0.01em;
}

.portrait-glyph {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--guide-accent-tint);
  color: var(--guide-accent);
  border: 1px solid var(--guide-accent);
  font-size: 1.5rem;
}

/* Print-only metadata line under the title (hidden on screen) */
.portrait-print-meta {
  display: none;
  margin: 0.75rem 0 0;
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.portrait-prose {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.85;
  margin: 0 0 2rem;
}

.portrait-prose p {
  margin: 0 0 1.4rem;
}

.portrait-prose p:first-child::first-letter {
  font-family: var(--font-serif);
  font-size: 3rem;
  float: left;
  line-height: 0.9;
  padding: 0.2rem 0.5rem 0 0;
  color: var(--guide-accent);
  font-weight: 500;
}

.portrait-downloads {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 4rem;
  padding: 1rem 0;
  border-top: 1px solid var(--neutral);
  border-bottom: 1px solid var(--neutral);
}

.portrait-downloads .action-secondary {
  font-size: 0.92rem;
  padding: 0.55rem 1.2rem;
  margin: 0;
}

.portrait-values {
  margin: 4rem 0;
}

.portrait-values h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.4rem;
  margin: 0 0 1.75rem;
  border-bottom: 1px solid var(--neutral);
  padding-bottom: 0.75rem;
  font-style: italic;
}

.value-grid {
  display: grid;
  gap: 1.25rem;
}

.value-card {
  background: var(--surface);
  border: 1px solid var(--neutral);
  border-left: 3px solid var(--guide-accent);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
}

.value-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.value-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 500;
  margin: 0;
  letter-spacing: 0.01em;
}

.value-tradition {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--guide-accent);
  background: var(--guide-accent-tint);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.value-desc {
  margin: 0 0 0.85rem;
  line-height: 1.7;
}

.value-expander {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  padding: 0.3rem 0;
}

.value-expander:hover {
  color: var(--guide-accent);
}

.value-note {
  margin-top: 0.85rem;
  padding: 1rem 1.2rem;
  background: var(--guide-accent-tint);
  border-radius: var(--radius-sm);
  font-size: 0.96rem;
  line-height: 1.65;
  font-style: italic;
  color: var(--text);
  animation: msg-in 0.25s ease both;
}

.value-note p { margin: 0; }

.portrait-closing {
  margin: 4rem 0 3rem;
  text-align: center;
}

.portrait-closing blockquote {
  margin: 0;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--neutral);
  border-bottom: 1px solid var(--neutral);
}

.portrait-closing p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.5;
  margin: 0 0 1rem;
  color: var(--text);
}

.portrait-closing footer {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--guide-accent);
}

.closing-share {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

/* Print-only conversation transcript (hidden on screen) */
.portrait-print-conversation {
  display: none;
}

.portrait-actions {
  text-align: center;
  margin-top: 4rem;
  padding: 2.5rem 1.5rem;
  background: var(--guide-accent-tint);
  border-radius: var(--radius-lg);
}

.start-over-heading {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  margin: 0 0 0.75rem;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.portrait-actions-buttons {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.action-primary {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  padding: 0.8rem 2rem;
  background: var(--guide-accent);
  color: white;
  border-radius: var(--radius-md);
  margin: 0 0.5rem 0.75rem;
  letter-spacing: 0.03em;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s ease;
}

.action-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.action-primary--large {
  font-size: 1.2rem;
  padding: 1rem 2.75rem;
  letter-spacing: 0.05em;
  box-shadow: var(--shadow-md);
}

.action-primary--large:hover {
  box-shadow: var(--shadow-lg);
}

.action-secondary {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  padding: 0.8rem 2rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--neutral);
  border-radius: var(--radius-md);
  margin: 0 0.5rem 0.75rem;
  letter-spacing: 0.03em;
  transition: all 0.18s ease;
}

.action-secondary:hover {
  border-color: var(--guide-accent);
  color: var(--guide-accent);
}

.action-secondary--small {
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  margin: 0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-sans);
}

.replay-note {
  margin: 0 auto;
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 28rem;
  line-height: 1.55;
}

.portrait-footer {
  margin-top: 5rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================
   SHARE DIALOG
   ============================================================ */

.share-dialog {
  border: 1px solid var(--neutral);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  padding: 2rem 2.25rem;
  max-width: 32rem;
  width: calc(100% - 2rem);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-serif);
}

.share-dialog::backdrop {
  background: var(--scrim);
  backdrop-filter: blur(3px);
}

.share-dialog h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

.share-dialog-note {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.55;
}

.share-dialog-preview {
  background: var(--bg);
  border: 1px solid var(--neutral);
  border-left: 3px solid var(--guide-accent);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin: 0 0 1.5rem;
  font-family: var(--font-serif);
  font-size: 0.98rem;
  line-height: 1.65;
  white-space: pre-wrap;
  max-height: 14rem;
  overflow: auto;
}

.share-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 600px) {
  .setup { padding: 2rem 1rem 4rem; }
  .setup-hero { padding: 1rem 0 2rem; }
  .msg { padding: 1rem 1.25rem; }
  .chat-input { padding: 0.75rem 1rem 1rem; }
  .portrait { padding: 2.5rem 1rem 3rem; }
  .portrait-prose p:first-child::first-letter { font-size: 2.4rem; }
  .value-card { padding: 1.25rem; }
  .portrait-closing p { font-size: 1.15rem; }
  .portrait-actions { padding: 2rem 1rem; }
  .share-dialog { padding: 1.5rem 1.25rem; }
}

/* ============================================================
   PRINT — clean page layout for "Save as PDF"
   ============================================================ */

@media print {
  @page {
    size: Letter;
    margin: 0.75in;
  }

  html, body, #root, .el-root {
    background: var(--bg) !important;
    color: var(--text) !important;
  }

  body {
    font-size: 11pt;
    line-height: 1.55;
  }

  /* Hide UI chrome that doesn't belong in the document */
  .no-print,
  .portrait-downloads,
  .portrait-actions,
  .portrait-footer,
  .value-expander,
  .chat-header,
  .chat-input,
  .generating-overlay,
  .share-dialog {
    display: none !important;
  }

  /* Reveal print-only sections */
  .portrait-print-meta { display: block !important; }
  .portrait-print-conversation { display: block !important; }

  .portrait {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .portrait-header {
    text-align: left;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--primary);
    padding-bottom: 0.75rem;
  }

  .portrait-header h1 {
    font-size: 22pt;
    display: block;
  }

  .portrait-glyph {
    display: none;
  }

  /* Prose: remove the decorative drop-cap for a cleaner doc look */
  .portrait-prose { font-size: 11pt; line-height: 1.6; margin-bottom: 1rem; }
  .portrait-prose p:first-child::first-letter {
    font-size: inherit;
    float: none;
    padding: 0;
    color: inherit;
    font-weight: inherit;
  }

  .portrait-values { margin: 1.25rem 0; }
  .portrait-values h2,
  .portrait-print-conversation h2 {
    font-size: 14pt;
    margin: 1.25rem 0 0.5rem;
    border-bottom: 1px solid var(--primary);
    padding-bottom: 0.25rem;
    font-style: normal;
  }

  .value-grid { gap: 0.6rem; }

  .value-card {
    background: transparent !important;
    border: 1px solid var(--primary) !important;
    border-left: 2px solid var(--primary) !important;
    border-radius: 0;
    padding: 0.6rem 0.85rem;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .value-name { font-size: 12pt; }

  .value-tradition {
    background: transparent !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary);
    padding: 0.1rem 0.4rem;
  }

  /* Always show the philosophical note in print, even if collapsed in UI */
  .value-note,
  .value-card .value-note {
    display: block !important;
    background: transparent !important;
    border-left: 2px solid var(--primary);
    border-radius: 0;
    padding: 0.4rem 0.75rem;
    margin-top: 0.5rem;
    animation: none;
  }

  .portrait-closing {
    margin: 1.25rem 0;
    text-align: left;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .portrait-closing blockquote {
    padding: 0.75rem 0;
    border-color: var(--primary);
  }

  .portrait-closing p { font-size: 12pt; }
  .portrait-closing footer { color: var(--primary) !important; }

  .portrait-print-conversation .print-msg {
    margin: 0 0 0.6rem;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Avoid awkward breaks right after a heading */
  h1, h2, h3 {
    page-break-after: avoid;
    break-after: avoid;
  }

  a { color: inherit; text-decoration: none; }
}
