/* ============================================================================
   Text→PDF — live preview that mirrors the PDF typeset output.
   ============================================================================ */

/* The note that tells you the preview is not showing what the PDF will draw.
   Sits directly under the "Preview" label, inside the pane's flex column. */
.tpEmojiNote {
  margin: -2px 0 0;
  font: 400 11.5px var(--sans), sans-serif;
  color: var(--soft);
  opacity: .9
}

.tpEmojiNote[hidden] {
  display: none!important
}

/* The emoji style control. Sits inline in the toolbars of both PDF tools, so it
   is styled in the same weight as the other toolbar rows rather than as a
   settings control. */
.tp-tools .emoji-seg button {
  padding: 5px 11px
}

/* Advanced disclosure. Reuses the .seg-adjacent look of .guide but reads as
   part of the options card, and only takes vertical space when opened. */
.adv {
  margin-top: 10px
}

.adv>summary {
  cursor: pointer;
  list-style: none;
  font: 600 10px var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  user-select: none
}

.adv>summary::before {
  content: '\25B8\00a0'
}

.adv[open]>summary::before {
  content: '\25BE\00a0'
}

.adv>summary:hover {
  color: var(--ink)
}

.adv-body {
  padding-top: 9px
}

#tpPrev.tp-prev {
  font-family: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--fg);
  padding: 16px 18px;
}

#tpPrev h1 {
  font-size: 23px;
  font-weight: 600;
  line-height: 1.2;
  margin: 22px 0 10px;
  letter-spacing: -.01em
}

#tpPrev h1:first-child {
  margin-top: 0
}

#tpPrev h2 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.25;
  margin: 20px 0 8px
}

#tpPrev h3 {
  font-size: 15.5px;
  font-weight: 600;
  margin: 16px 0 6px
}

#tpPrev h4 {
  font-size: 14px;
  font-weight: 600;
  margin: 14px 0 5px
}

#tpPrev p {
  margin: 0 0 12px
}

#tpPrev p:last-child {
  margin-bottom: 0
}

#tpPrev ul.tp-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#tpPrev ul.tp-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
  line-height: 1.55;
}

#tpPrev ul.tp-list li .tp-marker {
  flex: none;
  min-width: 18px;
  color: var(--soft);
  font-weight: 500;
}

#tpPrev ul.tp-list li .tp-li-body {
  flex: 1;
  min-width: 0
}

#tpPrev blockquote {
  border-left: 2.5px solid var(--line2);
  padding: 1px 0 1px 16px;
  margin: 12px 0 16px;
  color: var(--soft);
  font-style: italic;
}

#tpPrev blockquote p {
  margin: 6px 0
}

#tpPrev pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0 14px;
  overflow-x: auto;
  font: 12.5px/1.55 var(--mono);
  white-space: pre;
}

#tpPrev pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg)
}

#tpPrev code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1.5px 5px;
  color: var(--fg);
}

#tpPrev table {
  border-collapse: collapse;
  margin: 12px 0 16px;
  width: 100%;
  font-size: 13.5px;
}

#tpPrev th,
#tpPrev td {
  border: 1px solid var(--line2);
  padding: 7px 11px;
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}

#tpPrev th {
  background: var(--surface-2);
  font-weight: 600;
}

#tpPrev tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--surface-2) 40%, transparent)
}

#tpPrev hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

#tpPrev a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px
}

#tpPrev a:hover {
  color: var(--accent-h)
}

#tpPrev s {
  opacity: .65
}

#tpPrev strong {
  font-weight: 600
}

#tpPrev .tp-img-placeholder {
  display: inline-block;
  padding: 1px 6px;
  border: 1px dashed var(--line2);
  border-radius: 4px;
  font: 11px var(--mono);
  color: var(--soft);
  background: var(--surface-2);
}

#tpPrev img {
  max-width: 100%;
  border-radius: 8px;
  margin: 6px 0
}

/* Stacked fractions in the preview — matches the \frac{a}{b} markers emitted
   by mathToReadable (text-pdf.js). The PDF keeps the flat (a)/(b) fallback. */
.tp-frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  vertical-align: -0.55em;
  font-size: 0.82em;
  line-height: 1.05;
  margin: 0 3px;
  position: relative;
}

.tp-frac .tp-fn {
  padding: 0 5px 1px;
  border-bottom: 1.2px solid currentColor
}

.tp-frac .tp-fd {
  padding: 1px 5px 0
}

/* Markdown | Preview panes: make the split draggable (see js/uix). */
.tp-panes {
  grid-template-columns: var(--tpSplit, 1fr 1fr)
}

@media (max-width:880px) {
  .tp-panes {
    grid-template-columns: 1fr
  }
}