/* Marketing tokens follow html.dark-mode, restored by the site's fg-theme preference. */
.tg-public {
  --fg-ink: var(--text-primary);
  --fg-muted: var(--text-secondary);
  --fg-canvas: var(--bg-page);
  --fg-surface: var(--bg-surface);
  --fg-surface-alt: var(--bg-surface-2);
  --fg-line: var(--border-strong);
  --fg-control-border: var(--border-strong);
  --fg-focus: var(--accent-primary);
  --fg-primary-bg: var(--text-primary);
  --fg-primary-ink: var(--bg-surface);
  --fg-selected-bg: var(--accent-soft);
  --fg-selected-ink: var(--text-primary);
  --fg-status-matched-bg: var(--accent-soft);
  --fg-status-matched-ink: var(--accent-primary);
  --fg-status-review-bg: var(--accent-secondary-soft);
  --fg-status-review-ink: var(--accent-secondary);
  --shell-bottom-bar-h: 0px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 32px 56px;
}
.tg-public #template-gallery .tg-head h1 {
  font: 700 34px/1.12 var(--font-display);
  /* Marketing heading sizes are important, so the gallery overrides them locally. */
  font-size: 34px !important;
  letter-spacing: -.02em;
  margin-bottom: 6px;
}
.tg-public #template-gallery .tg-head .tg-sub { max-width: 680px; }
.tg-public #template-gallery .tg-panel { top: 96px; }
.tg-public #template-gallery .tg-access {
  color: var(--fg-muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 10px 0 0;
}
.tg-public #template-gallery .tg-access a { text-decoration: underline; }
.tg-public #template-gallery .tg-formulas li { display: block; min-width: 0; }
.tg-public #template-gallery .tg-formulas code {
  display: block;
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: 11px;
  line-height: 1.5;
  color: var(--fg-muted);
}
.tg-public .tg-audience { color: var(--fg-muted); margin-top: 24px; }
@media (max-width: 900px) {
  .tg-public { padding: 18px 16px 40px; }
  .tg-public #template-gallery .tg-head { flex-direction: column; align-items: stretch; }
  .tg-public #template-gallery .tg-dock {
    bottom: 0;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  body:has(.tg-public .tg-detail-page) { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .tg-public #template-gallery .tg-head h1 { font-size: 26px !important; }
}
.tg-public #template-gallery .tg-panel h1 { font-size: 20px !important; }
.tg-public #template-gallery .tg-card h2 { font-size: 13.5px !important; letter-spacing: normal; }
.tg-public #template-gallery .tg-panel h2 { font-size: 12px !important; letter-spacing: normal; }
.tm-nav-links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 7px; }

