/* Shared chrome for draftmesh public share pages. */
:root {
  --doc-read-width: 660px;
  --page-pad-x: clamp(16px, 4vw, 24px);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
.page {
  width: min(var(--doc-read-width), calc(100% - 2 * var(--page-pad-x)));
  margin: 0 auto;
  padding: clamp(10px, 1.5vw, 14px) 0 56px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.site-header {
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0 0 12px;
}
.share-context {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: .76rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.wordmark {
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: 0;
}
.share-context a {
  color: inherit;
  text-decoration: none;
}
.share-context strong {
  color: inherit;
  font-weight: 500;
}
.share-context-sep {
  user-select: none;
}
.share-context time {
  white-space: nowrap;
}
.theme-mode-dropdown {
  flex: 0 0 auto;
  position: relative;
  line-height: 1;
}
.theme-mode-control {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--background-modifier-border, rgba(127, 127, 127, 0.14));
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted, #68706a);
  cursor: pointer;
}
.theme-mode-control:hover {
  color: var(--text-normal, #1d211f);
  background: var(--background-primary-alt, rgba(127, 127, 127, 0.08));
}
.theme-mode-control:focus-visible {
  outline: 2px solid var(--text-accent, #9a5b2f);
  outline-offset: 2px;
}
.theme-mode-icon,
.theme-mode-glyph {
  position: relative;
  display: block;
}
.theme-mode-icon {
  width: 13px;
  height: 13px;
}
.theme-mode-glyph,
.theme-mode-glyph::before,
.theme-mode-glyph::after {
  box-sizing: border-box;
}
.theme-mode-glyph::before,
.theme-mode-glyph::after {
  content: '';
  position: absolute;
}
.theme-mode-icon--system .theme-mode-glyph {
  width: 12px;
  height: 8px;
  margin: 1px 0 0 0.5px;
  border: 1.25px solid currentColor;
  border-radius: 2.5px;
}
.theme-mode-icon--system .theme-mode-glyph::before {
  width: 5px;
  height: 1.25px;
  left: 50%;
  bottom: -4px;
  background: currentColor;
  transform: translateX(-50%);
}
.theme-mode-icon--system .theme-mode-glyph::after {
  width: 1.25px;
  height: 3px;
  left: 50%;
  bottom: -3px;
  background: currentColor;
  transform: translateX(-50%);
}
.theme-mode-icon--light .theme-mode-glyph {
  width: 6.5px;
  height: 6.5px;
  margin: 3.25px;
  border: 1.25px solid currentColor;
  border-radius: 999px;
  box-shadow:
    0 -4px 0 -2.5px currentColor,
    0 4px 0 -2.5px currentColor,
    -4px 0 0 -2.5px currentColor,
    4px 0 0 -2.5px currentColor;
}
.theme-mode-icon--light .theme-mode-glyph::before {
  inset: -3px;
  border-radius: 999px;
  border: 1px solid currentColor;
  opacity: 0.28;
}
.theme-mode-icon--dark .theme-mode-glyph {
  width: 10.5px;
  height: 10.5px;
  margin: 1px 0 0 1.5px;
  border-radius: 999px;
  background: currentColor;
}
.theme-mode-icon--dark .theme-mode-glyph::after {
  width: 10.5px;
  height: 10.5px;
  top: -1.75px;
  left: 4px;
  border-radius: 999px;
  background: var(--background-primary-alt, #fff);
}
.theme-mode-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 132px;
  padding: 4px;
  border: 1px solid var(--background-modifier-border, rgba(127, 127, 127, 0.18));
  border-radius: 8px;
  background: var(--background-primary, #fff);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}
.theme-mode-menu-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-normal, #1d211f);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}
.theme-mode-menu-item:hover,
.theme-mode-menu-item:focus-visible {
  background: var(--background-primary-alt, rgba(127, 127, 127, 0.08));
  outline: 0;
}
.theme-mode-menu-item[aria-checked="true"] .theme-mode-menu-check::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  margin: 1px 0 0 5px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.doc-title {
  width: 100%;
  margin: 0 0 12px;
}
.doc-title h1 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  line-height: 1.15;
  letter-spacing: 0;
  font-weight: 700;
}
.article-shell {
  width: 100%;
}
article {
  width: 100%;
  margin: 0;
  overflow-wrap: anywhere;
}
article > *:first-child { margin-top: 0; }
article > *:last-child { margin-bottom: 0; }
article ul,
article ol {
  padding-inline-start: var(--list-padding, 1.65em);
}
article li {
  margin-block: var(--list-spacing, 0.075em);
}
article li > ul,
article li > ol {
  margin-block: 0.25em 0;
}
article ul ul { list-style-type: circle; }
article ul ul ul { list-style-type: square; }
article ol ol { list-style-type: lower-alpha; }
article ol ol ol { list-style-type: lower-roman; }
article ul.contains-task-list,
article ul:has(> li > input[type="checkbox"]) {
  list-style: none;
}
article > ul.contains-task-list,
article > ul:has(> li > input[type="checkbox"]) {
  padding-inline-start: 0;
}
article li.task-list-item,
article li:has(> input[type="checkbox"]) {
  list-style: none;
}
article li input[type="checkbox"] {
  margin: 0 0.45em 0.15em 0;
  width: 1em;
  height: 1em;
  vertical-align: middle;
}
article a.internal-link.unresolved,
article a[href="#draftmesh-unresolved"] {
  text-decoration-style: dashed;
  cursor: help;
}
.render-error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  padding: 12px 14px;
  font-size: .95rem;
}
article .tag {
  display: inline-flex;
  align-items: center;
  padding: 0.12em 0.55em;
  border-radius: 999px;
  font-size: 0.84em;
  font-weight: 500;
  line-height: 1.35;
  vertical-align: baseline;
  white-space: nowrap;
}
body.share-layout-minimal article .tag {
  background: rgba(127, 127, 127, 0.15);
}
@media (max-width: 620px) {
  .site-header {
    gap: 10px;
    margin-bottom: 10px;
  }
  .doc-title { margin-bottom: 10px; }
  .doc-title h1 { font-size: 1.45rem; }
  .page { padding-top: 8px; }
}
@media print {
  .page { width: 100%; padding: 28px 16px 0; }
  .doc-title, .share-context { width: 100%; }
}

/* Minimal Publish layout */
body.share-layout-minimal {
  background: var(--background-primary, var(--bg1, #fff));
  color: var(--text-normal, #1d211f);
}
body.share-layout-minimal.theme-light {
  color-scheme: light;
}
body.share-layout-minimal.theme-dark {
  color-scheme: dark;
  --background-primary: var(--bg1, #1e1e1e);
  --text-normal: var(--tx1, #d1d1d1);
  --text-muted: var(--tx2, #999);
  --title-color: var(--tx1, #d1d1d1);
}
body.share-layout-minimal .share-context,
body.share-layout-minimal .wordmark {
  color: var(--text-muted, #68706a);
}
body.share-layout-minimal .doc-title h1 {
  font-family: var(--font-interface, Inter, ui-sans-serif, system-ui, sans-serif);
  font-weight: var(--page-title-weight, 600);
  color: var(--title-color, var(--text-normal));
}
body.share-layout-minimal .article-shell-minimal {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
body.share-layout-minimal .markdown-preview-view {
  padding: 0;
}
