/* Quiet Library: neutral stone surfaces, restrained sage accents, and serif prose. */
:root {
  scrollbar-gutter: stable;
  color-scheme: light;
  --bg: #f8f8f6; --surface: #efefeb; --text: #303532; --muted: #60665f;
  --line: #d9ddd7; --link: #38634f; --accent: #718e79; --soft: #e8ece6;
  --header-bg: #bacbb7; --header-control-bg: #cad7c8; --header-border: #8c9e88;
  --header-muted: #495645; --header-link: #294c35; --header-hover: #afc1ab;
  --layout-width: 1600px; --layout-gutter: 32px; --header-height: 100px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #202122; --surface: #292b2c; --text: #e5e5e0; --muted: #b3b7b1;
  --line: #414544; --link: #a9cbb5; --accent: #93ad9a; --soft: #323735;
  --header-bg: #405744; --header-control-bg: #384d3c; --header-border: #718773;
  --header-muted: #d1d9cf; --header-link: #dbeddd; --header-hover: #4b6650;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #202122; --surface: #292b2c; --text: #e5e5e0; --muted: #b3b7b1;
    --line: #414544; --link: #a9cbb5; --accent: #93ad9a; --soft: #323735;
    --header-bg: #405744; --header-control-bg: #384d3c; --header-border: #718773;
    --header-muted: #d1d9cf; --header-link: #dbeddd; --header-hover: #4b6650;
  }
}
body {
  /* Material still supplies article components, but inherits this palette. */
  --md-default-fg-color: var(--text); --md-default-fg-color--light: var(--muted);
  --md-default-fg-color--lighter: var(--accent); --md-default-fg-color--lightest: var(--line);
  --md-default-bg-color: var(--bg); --md-primary-fg-color: var(--link);
  --md-accent-fg-color: var(--link); --md-typeset-a-color: var(--link);
  --md-code-bg-color: var(--surface); --md-code-fg-color: var(--text);
  --md-typeset-table-color: var(--line); --md-typeset-table-color--light: var(--soft);
  color: var(--text); background: var(--bg); font: 16px/1.65 system-ui, sans-serif;
}
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
a { color: var(--link); text-underline-offset: 3px; }
button, input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 7px 10px; }
button { margin: 0; cursor: pointer; }
button:hover { background: var(--soft); }
input[type="checkbox"] { accent-color: var(--link); }
:is(a,button,input,select,summary):focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
form { background: var(--surface); }
.site-header {
  --bg: var(--header-control-bg); --line: var(--header-border); --muted: var(--header-muted);
  --link: var(--header-link); --accent: var(--header-link); --soft: var(--header-hover);
  position: sticky; top: 0; z-index: 10; min-height: 64px;
  padding: 10px max(var(--layout-gutter),calc((100% - var(--layout-width))/2 + var(--layout-gutter)));
  background: var(--header-bg); color: var(--text); border-bottom: 1px solid var(--line);
  gap: 8px 16px; justify-content: flex-start;
}
.site-header .site-brand {
  color: var(--text);
  display: flex; align-items: center; gap: 10px; flex: 0 1 240px; width: 240px; min-width: 0; height: 34px;
  font: 600 27px/34px Georgia, serif; letter-spacing: -.6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-header .site-logo { width: 32px; height: 32px; flex: none; object-fit: contain; }
.site-header .site-brand-label { min-width: 0; font: inherit; overflow: hidden; text-overflow: ellipsis; }
.site-header .site-brand.is-page-title { font-size: 20px; font-weight: 400; letter-spacing: 0; }
#header-search-slot { flex: 1; min-width: 150px; max-width: 310px; }
.header-search { display: flex; gap: 6px; background: transparent; margin: 0; padding: 0; }
.header-search input { width: 100%; min-width: 0; font-size: 14px; }
.header-search input::placeholder { color: var(--muted); opacity: 1; }
.header-search button, .icon-button { display: inline-flex; align-items: center; justify-content: center; flex: none; min-width: 44px; min-height: 44px; padding: 9px; }
.header-search svg, .icon-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
#header-context-slot { margin-left: auto; flex: 0 1 auto; }
.site-header .context-form { font-size: 12px; gap: 8px 12px; }
.context-form .full-site-link { font: inherit; color: var(--link); text-decoration: underline; }
.context-form select, .context-form select option, .context-form input, .context-form button { color: var(--text); background: var(--bg); border-color: var(--line); color-scheme: inherit; }
.context-form select { max-width: 240px; padding: 7px; }
.context-form select option:disabled { color: var(--muted); }
.context-form .dm-toggle input, .context-form .campaign-options input[type="checkbox"] { accent-color: var(--link); }
.header-tools { display: flex; gap: 2px; }
#navigation-toggle, #search-toggle { display: none; }
.section-navigation { flex: 0 0 100%; border-top: 1px solid var(--line); padding-top: 2px; }
.section-navigation ul { display: flex; flex-wrap: wrap; gap: 4px 24px; list-style: none; margin: 0; padding: 0; }
.section-navigation a { display: block; font: 14px/1.4 system-ui, sans-serif; padding: 5px 0; color: var(--muted); border-bottom: 2px solid transparent; }
.section-navigation a:hover { color: var(--link); border-color: var(--line); }
.section-navigation a[aria-current] { color: var(--link); font-weight: 600; border-color: var(--accent); }
.layout {
  grid-template-columns: 230px minmax(0,1fr) 215px; grid-template-areas: "navigation article toc";
  max-width: var(--layout-width); margin: 0 auto; padding: 20px var(--layout-gutter) 72px; gap: 24px; align-items: start;
}
.layout--no-toc { grid-template-columns: 230px minmax(0,1fr); grid-template-areas: "navigation article"; }
.layout--no-navigation { grid-template-columns: minmax(0,1fr) 215px; grid-template-areas: "article toc"; }
.layout--no-navigation.layout--no-toc { grid-template-columns: minmax(0,1fr); grid-template-areas: "article"; }
.layout--no-navigation > .site-sidebar { display: none; }
.layout .article-main { max-width: 1040px; width: 100%; margin: 0; }
.site-sidebar, .page-toc { top: calc(var(--header-height) + 20px); max-height: calc(100dvh - var(--header-height) - 40px); color: var(--muted); }
.site-sidebar { padding-right: 20px; border-right: 1px solid var(--line); }
.page-toc { position: static; top: auto; max-height: none; overflow: visible; overscroll-behavior: auto; border-color: var(--line); padding-left: 20px; }
.page-nav-title, .site-navigation > summary { font: 500 18px/1.35 Georgia, serif; color: var(--text); overflow-wrap: anywhere; margin: 0 0 10px; }
.site-navigation > summary { list-style: none; }
.site-navigation > summary::-webkit-details-marker { display: none; }
.nav-all-label { display: none; }
.page-toc summary { font-weight: 500; font-size: 12px; color: var(--muted); }
.site-sidebar a, .page-toc a { color: var(--muted); padding-top: 4px; padding-bottom: 4px; }
.site-sidebar a:hover, .page-toc a:hover, .site-sidebar a[aria-current="page"] { background: var(--soft); color: var(--link); }
.page-toc a.is-active { border-color: var(--accent); color: var(--link); }
.nav-tree ul, .page-backlinks:not(:first-child) { border-color: var(--line); }
.nav-tree details > summary::before { color: var(--accent); }
.md-typeset .breadcrumbs { font: 12px/1.6 system-ui, sans-serif; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a { color: var(--muted); }
html[dir] .md-typeset .breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; padding: 0; margin: 0; list-style: none; }
html[dir] .md-typeset .breadcrumbs li { display: inline-flex; align-items: baseline; padding: 0; margin: 0; }
.md-typeset .breadcrumbs li + li::before { content: "/"; color: var(--accent); margin: 0 8px; }
.md-typeset { font: 18px/1.8 Georgia, 'Times New Roman', serif; overflow-wrap: break-word; }
.article-main { display: flow-root; }
.md-typeset :is(h1,h2,h3,h4,h5,h6) { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; color: var(--text); scroll-margin-top: calc(var(--header-height) + 24px); }
.md-typeset h1 { font-size: 40px; line-height: 1.25; letter-spacing: -.35px; margin: 0 0 23px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.md-typeset h2 { font-size: 28px; line-height: 1.25; margin: 2em 0 .7em; padding-bottom: 8px; border-bottom: 1px solid var(--line); clear: both; }
.md-typeset h3 { font-size: 22px; line-height: 1.4; }
.md-typeset h4 { font-size: 19px; }
.md-typeset p { margin: 0 0 1.1em; }
/* Indent prose lists without changing navigation, gallery, or card layouts. */
html[dir] .md-typeset :is(ul,ol):not(:where(.breadcrumbs *, .grid.cards *, .gallery *, .home-destinations *)) { padding-inline-start: 2em; margin-inline: 0; }
html[dir] .md-typeset li:not(:where(.breadcrumbs *, .grid.cards *, .gallery *, .home-destinations *)) { margin-inline: 0; padding-inline-start: .25em; }
.md-typeset .grid.cards { background: var(--surface); font: 14px/1.65 system-ui, sans-serif; padding: 12px 16px; border-left: 2px solid var(--accent); margin-bottom: 24px; }
.md-typeset .grid.cards.ext-one-column { font-size: 16px; }
.md-typeset .grid.cards > ul > li { border: 0; padding: 0; border-radius: 0; }
.md-typeset .grid.cards > ul > li:hover { box-shadow: none; border: 0; }
.md-typeset .grid.cards p:last-child { margin-bottom: 0; }
.md-typeset blockquote, .md-typeset .admonition:not(.image):not(.gallery) { color: var(--text); background: var(--surface); border-color: var(--accent); box-shadow: none; font-size: inherit; }
.md-typeset .admonition-title { background: var(--soft); font: 600 14px/1.6 system-ui,sans-serif; }
/* Give callout icons and wrapped titles explicit spacing. */
html .md-typeset :is(.admonition,details):not(.image):not(.gallery):not(.quote) {
  padding: 0 18px; color: var(--text); background: var(--surface); border-color: var(--accent); box-shadow: none; font-size: inherit;
}
html .md-typeset :is(.admonition,details):not(.image):not(.gallery):not(.quote) > :is(.admonition-title,summary) {
  margin: 0 -18px 16px; padding: 12px 18px 12px 48px;
  color: var(--text); background: var(--soft); font: 500 15px/1.6 system-ui,sans-serif;
}
html .md-typeset :is(.admonition,details):not(.image):not(.gallery):not(.quote) > :is(.admonition-title,summary)::before { left: 18px; top: 14px; background-color: var(--link); }
html .md-typeset details:not(.image):not(.gallery):not(.quote) > summary { padding-inline-end: 44px; }
html .md-typeset details:not(.image):not(.gallery):not(.quote) > summary::after { right: 16px; top: 14px; color: var(--link); }
html .md-typeset details:not([open]) > summary { margin-bottom: 0; }
/* Literary quotes use the article's typography, without an alert-style title bar. */
html .md-typeset blockquote,
html .md-typeset .admonition.quote:not(.image),
html .md-typeset details.quote {
  color: var(--text); background: var(--soft); border: 0; border-inline-start: 3px solid var(--accent);
  border-radius: 0; box-shadow: none; font: inherit; margin: 1.5em 0; padding: 1em 1.25em;
}
html .md-typeset .quote > .admonition-title,
html .md-typeset details.quote > summary {
  background: transparent; color: var(--link); border: 0; border-radius: 0;
  font: 400 .9em/1.6 Georgia, 'Times New Roman', serif; margin: 0 0 .8em; padding: 0;
}
html .md-typeset .quote > .admonition-title::before,
html .md-typeset details.quote > summary::before { display: none; }
html .md-typeset details.quote > summary { padding-inline-end: 1.75em; }
html .md-typeset details.quote > summary::after { inset-inline-end: 0; top: .2em; color: var(--muted); }
html .md-typeset details.quote:not([open]) > summary { margin-bottom: 0; }
html .md-typeset :is(blockquote,.admonition.quote,details.quote) > :last-child { margin-bottom: 0; }
.md-typeset .note-embed { background: var(--surface); border-color: var(--accent); }
.md-typeset table:not([class]) { background: var(--bg); font: 14px/1.6 system-ui,sans-serif; }
.md-typeset table:not([class]) th { background: var(--surface); }
.md-typeset hr { border-color: var(--line); }
.md-typeset .map-image { width: 100%; }
.md-typeset .taelgar-session-zoom { top: var(--header-height); }
.campaign-picker > summary, .campaign-options, .campaign-all { border-color: var(--line); }
.campaign-options { color: var(--text); background: var(--bg); }
.campaign-picker summary:focus-visible { outline-color: var(--link); }
.site-dialog { color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; width: min(480px,calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 20px; font: 14px/1.6 system-ui,sans-serif; }
.site-dialog::backdrop { background: #10181780; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.dialog-heading h2 { font: 400 23px/1.3 Georgia,serif; margin: 0; }
.dialog-heading button { min-width: 44px; min-height: 44px; font-size: 22px; }
.appearance-control { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.appearance-control select { min-width: 140px; }
#settings-dialog-body:not(:empty) { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.site-dialog .context-form { background: transparent; display: flex; flex-direction: column; align-items: stretch; gap: 14px; margin: 0; padding: 0; font-size: 14px; }
.site-dialog .context-form select { max-width: 100%; }
.site-dialog .custom-date-controls { flex-direction: column; align-items: stretch; }
.site-dialog .campaign-options { position: static; width: auto; max-width: 100%; }
.site-dialog .header-search input { font-size: 16px; }
.nav-drawer { margin: 0; height: 100dvh; max-height: 100dvh; width: min(350px,88vw); max-width: 88vw; border: 0; border-right: 1px solid var(--line); border-radius: 0; }
.nav-drawer .site-sidebar { display: block; position: static; width: 100%; max-height: none; overflow: visible; border: 0; padding: 0; }
.nav-drawer .site-navigation > summary { display: none; }
.site-dialog-open { overflow: hidden; }
.back-to-top {
  position: fixed; z-index: 15; top: calc(var(--header-height) + 12px); left: 50%; transform: translateX(-50%);
  max-width: calc(100vw - 32px); min-height: 44px; margin: 0; padding: 10px 18px;
  font: 600 14px/1.4 system-ui,sans-serif; white-space: nowrap;
  color: var(--bg); background: var(--link); border: 1px solid var(--link); border-radius: 24px;
  box-shadow: 0 4px 16px #0003;
}
.back-to-top:hover { color: var(--bg); background: var(--link); box-shadow: 0 4px 20px #0005; }
.site-footer { color: var(--muted); border-color: var(--line); }
.skip-link { background: var(--bg); border-color: var(--link); }
.image-viewer, .diagram-popup { background: var(--bg); color: var(--text); }
/* Diagrams retain their rendered neutral palette, including explicit light backgrounds. */
.mermaid-output:not(:empty), .diagram-popup-content:has(svg) { background: #fff; border-radius: 4px; }
.diagram-popup-content pre { background: var(--surface); color: var(--text); }
.md-typeset .dm-only-block, .md-typeset .dm-note-popup { background: var(--surface); color: var(--text); }
.md-typeset .dm-block-label, .dm-note-header, .md-typeset .dm-note-close { color: var(--link); }
@media (min-width:1101px) {
  .site-header .header-search input { padding: 5px 10px; line-height: 1.4; }
  .site-header .header-search button, .site-header .icon-button { min-width: 36px; min-height: 36px; padding: 7px; }
  .site-header .context-form select { min-height: 32px; padding: 4px 7px; line-height: 1.4; }
  .nav-tree > [data-nav-root]:not(.active-section) { display: none; }
  .nav-tree > .active-section > details > summary { display: none; }
  .nav-tree > .active-section > details > ul { padding: 0; margin: 0; border: 0; }
}
@media (min-width:1660px) {
  :root { --layout-width: 1660px; }
  .layout { grid-template-columns: 260px minmax(0,1fr) 245px; }
  .layout--no-toc { grid-template-columns: 260px minmax(0,1fr); }
  .layout--no-navigation { grid-template-columns: minmax(0,1fr) 245px; }
  .layout--no-navigation.layout--no-toc { grid-template-columns: minmax(0,1fr); }
}
@media (max-width:1200px) {
  :root { --layout-gutter: 24px; }
  .layout { column-gap: 24px; }
  .site-header .site-brand { flex-basis: 210px; width: 210px; }
  .context-form select { max-width: 215px; }
}
@media (max-width:1100px) {
  .site-interactive { --header-height: 64px; }
  .site-interactive .site-header { padding: 10px var(--layout-gutter); flex-wrap: nowrap; gap: 8px; min-height: 64px; }
  .site-interactive .site-brand { flex: 1; width: auto; font-size: 23px; }
  .site-interactive .site-logo { width: 28px; height: 28px; }
  .site-interactive #navigation-toggle, .site-interactive #search-toggle { display: inline-flex; }
  .site-interactive #header-context-slot, .site-interactive #header-search-slot, .site-interactive .section-navigation { display: none; }
  .layout, .layout--no-navigation { grid-template-columns: minmax(0,1fr) 180px; grid-template-areas: "article toc"; }
  .layout--no-toc, .layout--no-navigation.layout--no-toc { grid-template-columns: minmax(0,1fr); grid-template-areas: "article"; }
  .site-interactive .layout > .site-sidebar { display: none; }
  .md-typeset .breadcrumbs { display: none; }
  .page-toc { border: 0; border-left: 1px solid var(--line); padding: 0 0 0 20px; border-radius: 0; }
  .nav-section-label { display: none; } .nav-all-label { display: inline; }
  /* No-script fallback retains ordinary navigation, context and search forms. */
  html:not(.site-interactive) .layout { display: flex; flex-direction: column; }
  html:not(.site-interactive) .site-sidebar { display: block; position: static; max-height: none; width: 100%; }
}
@media (max-width:800px) {
  .site-interactive .site-header { padding: 10px 12px; }
  .layout { display: flex; flex-direction: column; padding: 24px 18px 44px; margin: 0 auto; }
  .layout .article-main { order: 1; }
  .page-toc { order: 2; position: static; max-height: none; width: 100%; padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); }
  .page-toc:not(:has(.page-backlinks)), .page-toc .page-contents, .page-nav-title { display: none; }
  .page-backlinks:not(:first-child) { margin: 0; padding: 0; border: 0; }
  .md-typeset { font-size: 16px; line-height: 1.7; }
  .md-typeset h1 { font-size: 34px; } .md-typeset h2 { font-size: 26px; }
  .md-typeset img[align], .md-typeset .taelgar-image--aside, .md-typeset .taelgar-image--aside.taelgar-image--align-left { float: none; display: block; max-width: 100%; max-height: 480px; width: auto; margin: 16px auto; }
}
@media (max-width:360px) {
  .site-interactive .site-header { padding: 8px; gap: 4px; }
  .site-interactive .site-brand { font-size: 20px; }
}
@media print {
  :root { color-scheme: light; --bg: #fff; --text: #222; --muted: #555; --surface: #eee; --soft: #eef1ec; --line: #ccc; --link: #34513e; }
  .site-header, .site-sidebar, .page-toc, .site-dialog, .back-to-top, .site-footer { display: none !important; }
  .layout { display: block; padding: 0; } .layout .article-main { max-width: none; }
}

/* Suggestions stay attached to the field being typed into, without locking the page. */
.search-suggestions {
  position: fixed; z-index: 30; display: flex; flex-direction: column; overflow: hidden;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); background: var(--bg); box-shadow: 0 10px 28px #10181730;
  font: 14px/1.5 system-ui,sans-serif;
}
.floating-search-filter { display: flex; align-items: center; gap: 10px; flex: none; }
.floating-search-filter label { flex: none; color: var(--muted); font-size: 12px; }
.floating-search-filter select { min-width: 0; max-width: 100%; font-size: 13px; padding: 5px 8px; }
.floating-search-status { flex: none; color: var(--muted); margin: 10px 0; font-size: 12px; }
.floating-search-error { color: var(--text); border-left: 3px solid var(--accent); padding: 8px 12px; margin: 10px 0; background: var(--surface); }
.floating-search-results { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.floating-search-list { list-style: none; padding: 0; margin: 0; }
.floating-search-list > li { padding: 10px 2px; border-top: 1px solid var(--line); }
.floating-search-list h3 { margin: 0; font: 400 18px/1.4 Georgia,serif; }
.floating-search-list h3 a { color: var(--link); text-decoration: none; }
.floating-search-list h3 a:hover { text-decoration: underline; }
.floating-search-path { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; margin: 3px 0 5px; }
.floating-search-excerpt { font-size: 13px; line-height: 1.55; margin: 0; overflow-wrap: anywhere; }
.floating-search-excerpt mark { color: var(--text); background: var(--soft); font-weight: 600; box-shadow: inset 0 -1px var(--accent); }
.floating-search-pagination { flex: none; display: flex; justify-content: space-between; gap: 12px; padding-top: 10px; }
.floating-search-pagination button { margin: 0; padding: 5px 10px; font-size: 12px; }
.floating-search-pagination button[aria-disabled="true"] { opacity: .6; cursor: wait; }
.floating-search-pagination button:last-child { margin-left: auto; }
.floating-search-fallback { margin-top: 8px; }
#search-toggle span { display: inline-flex; }
#search-toggle .search-close-icon { display: none; }
.has-search-input #search-toggle .search-open-icon { display: none; }
.has-search-input #search-toggle .search-close-icon { display: inline-flex; }
@media (max-width:1100px) {
  .site-interactive .site-header.has-search-input { flex-wrap: wrap; }
  .site-interactive .has-search-input #header-search-slot { display: block; order: 3; flex: 1 0 100%; max-width: none; }
  .site-interactive .has-search-input .header-search input { font-size: 16px; }
}
@media print { .search-suggestions { display: none !important; } }
