:root {
  color-scheme: light;
  --paper: #fff;
  --canvas: #f8f9fa;
  --ink: #202122;
  --muted: #54595d;
  --line: #a2a9b1;
  --soft-line: #eaecf0;
  --link: #0645ad;
  --accent: #6254a4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 15px; line-height: 1.62; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 10; padding: 8px 12px; background: white; }
.skip-link:focus { left: 8px; }
.topbar { height: 70px; display: flex; align-items: center; gap: 20px; padding: 0 34px; background: var(--paper); border-bottom: 1px solid var(--soft-line); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; flex: 0 0 40px; }
.brand-copy { display: grid; line-height: 1.15; letter-spacing: .08em; }
.brand-copy strong { font: 700 14px Georgia, serif; }
.brand-copy small { margin-top: 4px; color: var(--muted); font: 11px Georgia, serif; letter-spacing: .01em; }
.top-note { margin-left: auto; color: var(--muted); font-size: 12px; }
.menu-button { display: none; border: 0; background: none; font-size: 22px; cursor: pointer; }
.page-shell { max-width: 1440px; margin: auto; display: grid; grid-template-columns: 225px minmax(0, 1fr); min-height: calc(100vh - 70px); }
.sidebar { padding: 27px 20px 32px 34px; color: var(--muted); font-size: 13px; }
.sidebar-title { padding-bottom: 9px; margin-bottom: 9px; border-bottom: 1px solid var(--line); color: var(--ink); font: 16px Georgia, serif; }
.sidebar nav { display: grid; gap: 3px; }
.nav-link { padding: 4px 8px; color: var(--link); border-radius: 2px; }
.nav-link.active { color: var(--ink); background: #eaecf0; }
.sidebar-rule { height: 1px; margin: 24px 0 13px; background: var(--line); }
.sidebar-label { margin: 0 0 6px; color: var(--ink); font-weight: 600; }
.sidebar-blurb { margin: 0; font-size: 12px; line-height: 1.5; }
.sidebar-stamp { width: 104px; margin: 30px auto 0; padding: 13px 8px; border: 1px solid #b6b0d6; color: var(--accent); text-align: center; font-size: 10px; font-weight: 700; letter-spacing: .1em; transform: rotate(-5deg); }
.sidebar-stamp span { font-size: 23px; }
.main-column { min-width: 0; padding: 24px 40px 70px 24px; background: var(--paper); border-left: 1px solid var(--soft-line); }
.notice { display: flex; gap: 10px; align-items: flex-start; max-width: 1100px; margin: 0 auto 20px; padding: 10px 13px; border: 1px solid #c8c1e1; background: #f8f6ff; color: #39334f; font-size: 13px; }
.notice-icon { color: var(--accent); font-size: 17px; line-height: 1.4; }
.page-tabs { max-width: 1100px; margin: auto; display: flex; align-items: center; min-height: 39px; border-bottom: 1px solid var(--line); color: var(--link); font-size: 13px; }
.page-tabs > span:not(.tab-spacer):not(.tab-meta) { padding: 7px 12px; }
.page-tabs .selected { color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-bottom-color: var(--paper); margin-bottom: -1px; }
.tab-spacer { flex: 1; }
.tab-meta { color: var(--muted); font-size: 12px; }
article { max-width: 1100px; margin: auto; }
.article-header { padding: 28px 0 16px; border-bottom: 1px solid var(--line); }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: 10px; font-weight: 700; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
h1 { margin: 3px 0 0; font-size: clamp(32px, 4.5vw, 42px); line-height: 1.18; letter-spacing: -.025em; }
.subtitle { margin: 7px 0 0; color: var(--muted); font: italic 15px Georgia, serif; }
.article-tools { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0 15px; color: var(--muted); font-size: 12px; }
.article-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.text-button, .toc-toggle { border: 0; padding: 0; color: var(--link); background: transparent; font: inherit; cursor: pointer; }
.editor-toolbar { margin: 0 0 22px; padding: 13px 15px; border: 1px solid #a2a9b1; background: #f8f9fa; font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.editor-toolbar[hidden] { display: none; }
.editor-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.editor-buttons button { padding: 5px 9px; border: 1px solid #a2a9b1; border-radius: 2px; background: white; color: var(--ink); font: inherit; cursor: pointer; }
.editor-buttons button:hover { background: #eaecf0; }
.editor-buttons #save-button, .editor-buttons #download-button { border-color: var(--link); color: var(--link); }
#editor-status { min-height: 1em; margin: 8px 0 0; color: var(--muted); }
body.edit-mode [data-edit-key] { outline: 1px dashed #7568b5; outline-offset: 3px; cursor: text; }
body.edit-mode [data-edit-key]:focus { outline: 2px solid var(--accent); background: #f8f6ff; }
.article-body { font-family: Georgia, "Times New Roman", serif; font-size: 16px; }
.article-body p { margin: 0 0 14px; }
.lead { max-width: 760px; }
.editor-note { max-width: 760px; color: var(--muted); font-size: 14px; }
.infobox { float: right; width: 285px; margin: 0 0 22px 28px; border: 1px solid var(--line); background: #f8f9fa; font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.infobox-title { padding: 8px; background: #e8e5f3; color: #25213a; text-align: center; font: 700 16px Georgia, serif; }
.infobox-portrait { margin: 9px; }
.infobox-portrait img { display: block; width: 100%; height: auto; }
.infobox-portrait figcaption { margin-top: 5px; color: var(--muted); text-align: center; font-size: 11px; }
.portrait-placeholder { min-height: 138px; margin: 9px; display: grid; place-content: center; justify-items: center; gap: 4px; border: 1px dashed #a2a9b1; background: linear-gradient(135deg, #f1f0f7, #fafafa); color: #72717b; }
.portrait-placeholder span { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid #c7c4d2; border-radius: 50%; font: 19px Georgia, serif; }
.portrait-placeholder small { font-size: 10px; }
.infobox table { width: 100%; border-collapse: collapse; }
.infobox th, .infobox td { padding: 6px 8px; border-top: 1px solid #eaecf0; text-align: left; vertical-align: top; }
.infobox th { width: 39%; font-weight: 600; }
.infobox-caption { padding: 7px 9px; color: var(--muted); font-size: 11px; font-style: italic; }
.toc { width: fit-content; min-width: 255px; margin: 23px 0 25px; padding: 12px 17px 13px; border: 1px solid var(--line); background: #fff; font: 13px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.toc-heading { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 5px; text-align: center; }
.toc ol { margin: 0; padding-left: 24px; }
.toc.collapsed ol { display: none; }
.article-section { clear: both; scroll-margin-top: 18px; }
.article-section h2 { display: flex; gap: 10px; align-items: baseline; margin: 25px 0 10px; padding-bottom: 4px; border-bottom: 1px solid var(--soft-line); font-size: 25px; }
.article-section h2 > span:first-child { color: var(--accent); font: 700 11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.article-section h2 .heading-label { color: inherit; font: inherit; }
.article-photo { float: right; width: min(40%, 290px); margin: 2px 0 16px 22px; padding: 6px; border: 1px solid var(--line); background: var(--canvas); }
.article-photo img { display: block; width: 100%; height: auto; }
.article-photo figcaption { padding: 6px 3px 2px; color: var(--muted); font: 11px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.photo-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 650px; margin: 18px 0; }
.photo-row .article-photo { float: none; width: auto; margin: 0; align-self: start; }
.photo-row.single-photo { grid-template-columns: minmax(0, 310px); }
.section-placeholder { color: #72777d; font-size: 14px; font-style: italic; }
.references ol { padding-left: 25px; font-size: 14px; }
.article-footer { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--soft-line); color: var(--muted); font: 12px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

@media (max-width: 760px) {
  .topbar { height: 62px; padding: 0 16px; gap: 12px; }
  .menu-button { display: block; }
  .top-note { display: none; }
  .page-shell { display: block; }
  .sidebar { display: none; position: absolute; z-index: 5; width: 245px; padding: 20px; background: white; border: 1px solid var(--soft-line); box-shadow: 0 8px 20px #0002; }
  .sidebar.open { display: block; }
  .main-column { padding: 16px 18px 48px; border: 0; }
  .notice { font-size: 12px; }
  .tab-meta { display: none; }
  .article-header { padding-top: 24px; }
  .article-tools { font-size: 11px; }
  .infobox { float: none; width: min(100%, 360px); margin: 0 auto 20px; }
  .article-photo { float: none; width: min(100%, 360px); margin: 8px auto 18px; }
  .photo-row { grid-template-columns: 1fr; max-width: 360px; margin: 18px auto; }
  .photo-row.single-photo { grid-template-columns: 1fr; }
  .article-body { font-size: 15px; }
  .article-section h2 { font-size: 22px; }
}

@media print {
  body, .main-column { background: white; }
  .topbar, .sidebar, .page-tabs, .article-tools, .editor-toolbar, .menu-button { display: none !important; }
  .page-shell { display: block; }
  .main-column { padding: 0; }
  .notice { border-color: #999; }
}
