:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --panel: #fff;
  --soft: #f1f2ed;
  --ink: #252d29;
  --muted: #6a716b;
  --line: #dedfd7;
  --accent: #285a48;
  --link: #315f8b;
  --focus: #478e70;
  --danger: #a33333;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  background: var(--bg);
  color: var(--ink);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191e1c;
  --panel: #202723;
  --soft: #29322d;
  --ink: #e5e9e1;
  --muted: #aab4ab;
  --line: #3a453e;
  --accent: #a5d5b4;
  --link: #91b9e5;
  --focus: #8bc4a6;
  --danger: #ffb2ac;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --bg: #191e1c;
    --panel: #202723;
    --soft: #29322d;
    --ink: #e5e9e1;
    --muted: #aab4ab;
    --line: #3a453e;
    --accent: #a5d5b4;
    --link: #91b9e5;
    --focus: #8bc4a6;
    --danger: #ffb2ac;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
select,
summary {
  cursor: pointer;
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button {
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 9px 13px;
  min-height: 40px;
  line-height: 1.3;
}
button:hover {
  background: var(--soft);
}
button:disabled {
  opacity: 0.6;
  cursor: wait;
}
button.primary,
.button.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
button.quiet,
.text-button {
  background: transparent;
  border-color: transparent;
}
.text-button {
  color: var(--link);
}
.danger {
  color: var(--danger);
}
input,
select {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px 12px;
  background: var(--panel);
  color: var(--ink);
  min-height: 42px;
}
input:focus,
select:focus {
  border-color: var(--focus);
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-weight: 500;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: -1px;
  overflow-wrap: anywhere;
}
h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  line-height: 1.3;
}
h3 {
  font-size: 19px;
}
p {
  line-height: 1.65;
}
small {
  line-height: 1.5;
}
.muted {
  color: var(--muted);
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.6;
}
.header {
  height: 86px;
  display: grid;
  grid-template-columns: 1fr minmax(150px, 540px) 1fr;
  align-items: center;
  gap: 32px;
  padding: 0 38px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
}
.brand:hover {
  text-decoration: none;
}
.brand b {
  font-family: Georgia, serif;
  font-size: 29px;
  font-weight: 500;
}
.brand small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1px;
}
.header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.account-button {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-form {
  display: flex;
  align-items: stretch;
  justify-self: center;
  width: 100%;
  min-width: 0;
}
.search-form input {
  border-radius: 5px 0 0 5px;
  border-right: 0;
  flex: 1;
  width: 100%;
  background: var(--panel);
}
.search-form button {
  border-radius: 0 5px 5px 0;
  padding: 8px 16px;
  color: var(--accent);
  font-size: 22px;
  background: var(--panel);
}
.layout {
  display: grid;
  grid-template-columns: 205px minmax(0, 1fr);
  gap: 32px;
  max-width: 1600px;
  margin: auto;
  padding: 0 38px;
}
.sidebar {
  padding: 35px 18px 30px 0;
  min-width: 0;
  border-right: 1px solid var(--line);
}
.rail-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--muted);
  margin-bottom: 16px;
}
.sidebar nav {
  display: grid;
  gap: 5px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  padding: 11px 12px;
  border-radius: 5px;
  font-size: 14px;
}
.icon {
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: middle;
}
.search-form button,
.close-button,
.mobile-menu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.search-form:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 5px;
}
.search-form input:focus-visible {
  outline: none;
}
.sidebar nav a.active {
  background: var(--soft);
  color: var(--accent);
  font-weight: 600;
}
.sidebar nav a:hover {
  background: var(--soft);
  text-decoration: none;
  color: var(--ink);
}
main {
  min-width: 0;
  min-height: calc(100vh - 164px);
  padding: 38px 0 64px;
}
main:focus {
  outline: none;
}
.welcome {
  padding: 30px 0 42px;
  border-bottom: 1px solid var(--line);
}
.welcome h1 {
  max-width: 650px;
  font-size: 54px;
  margin: 19px 0;
}
.welcome > p {
  color: var(--muted);
  max-width: 550px;
  margin-bottom: 0;
  font-size: 16px;
}
.topics-section,
.selected-section,
.continue-section {
  margin-top: 34px;
}
.section-heading {
  display: flex;
  align-items: baseline;
  gap: 20px;
  justify-content: space-between;
}
.section-heading h2 {
  font-size: 24px;
}
.section-heading p {
  font-size: 12px;
}
.topics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.topic {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 20px 18px;
  color: var(--ink);
  border-radius: 6px;
  background: var(--panel);
}
.topic:hover {
  border-color: var(--accent);
  text-decoration: none;
  background: var(--soft);
}
.topic strong {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
  overflow-wrap: anywhere;
}
.topic-number {
  font-family: Georgia, serif;
  color: var(--muted);
  font-size: 13px;
}
.topic > .icon {
  color: var(--accent);
}
.discovery-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 32px;
}
.result-card {
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.result-card h2 {
  margin: 9px 0 12px;
  font-size: 26px;
  overflow-wrap: anywhere;
}
.result-card p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}
.result-card h2 a {
  color: var(--ink);
}
.result-kicker {
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.read-link {
  font-size: 13px;
  color: var(--accent);
}
.reading-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.reading-card {
  padding: 20px;
  background: var(--soft);
  border-radius: 5px;
  color: var(--ink);
  min-width: 0;
}
.reading-card h3 {
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.page-heading {
  border-bottom: 1px solid var(--line);
  padding: 15px 0 20px;
  margin-bottom: 25px;
}
.page-heading h1 {
  margin-bottom: 14px;
}
.page-heading p:last-child {
  margin-bottom: 0;
}
.load-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 30px 0;
  margin: 0;
  text-align: center;
  color: var(--muted);
  grid-column: 1 / -1;
}
.load-status:empty {
  display: none;
}
.load-status > p {
  margin: 0;
}
main > .load-status:only-child {
  min-height: calc(100dvh - 280px);
}
.load-status .error-box {
  width: 100%;
  text-align: left;
}
.discovery-list > .empty {
  grid-column: 1 / -1;
}

.error-box {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  padding: 24px;
  margin: 20px 0;
  grid-column: 1/-1;
}
.error-box h2 {
  font-size: 23px;
}
.error-box p {
  color: var(--muted);
}
.notice {
  padding: 14px 18px;
  background: var(--soft);
  border-left: 3px solid var(--accent);
  font-size: 13px;
}
.empty {
  padding: 50px 15px;
  text-align: center;
  max-width: 650px;
  margin: auto;
}
.empty h2 {
  font-size: 26px;
}
.empty p {
  color: var(--muted);
}
.empty-icon .icon {
  width: 40px;
  height: 40px;
}
.empty-icon {
  display: block;
  font-size: 40px;
  color: var(--accent);
  margin-bottom: 20px;
}
.button {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 10px 15px;
  background: var(--panel);
  font-size: 14px;
}
.article-layout {
  display: grid;
  grid-template-columns: 165px minmax(0, 800px);
  gap: 30px;
  justify-content: center;
}
.article-page {
  min-width: 0;
}
.article-heading h1 {
  margin: 15px 0 22px;
  font-size: 44px;
  letter-spacing: -0.5px;
}
.article-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  font-size: 12px;
}
.article-tools button {
  font-size: 12px;
  min-height: 36px;
  padding: 7px 10px;
}
.article-tools a {
  margin-left: auto;
}
.toc {
  align-self: start;
  position: sticky;
  top: 25px;
  font-size: 12px;
  max-height: calc(100vh - 50px);
  overflow: auto;
  padding-right: 8px;
}
.toc summary {
  font-weight: 600;
  font-size: 13px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line);
}
.toc nav {
  display: grid;
  gap: 3px;
  padding-top: 10px;
}
.toc button {
  background: transparent;
  border: 0;
  text-align: left;
  font-size: 12px;
  min-height: 32px;
  line-height: 1.5;
  color: var(--muted);
  padding: 5px 0;
  overflow-wrap: anywhere;
}
.toc button:hover {
  color: var(--link);
}
.toc button.active {
  color: var(--accent);
  font-weight: 600;
}
.toc button.active::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 7px 2px 0;
  border-radius: 50%;
  background: currentColor;
}
.toc .toc-level-3 {
  padding-left: 12px;
}
.toc .toc-level-4 {
  padding-left: 22px;
}
.wiki-content {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  display: flow-root;
}
.wiki-content h2,
.wiki-content h3,
.wiki-content h4 {
  scroll-margin-top: 24px;
  display: flow-root;
}
.wiki-content h2 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin: 30px 0 16px;
  font-size: 28px;
}
.wiki-content h3 {
  margin: 24px 0 12px;
  font-weight: 600;
}
.wiki-content p {
  line-height: inherit;
  margin: 0 0 18px;
}
.wiki-content ul,
.wiki-content ol {
  padding-left: 24px;
  display: flow-root;
}
.wiki-content li {
  margin-bottom: 5px;
}
.wiki-content img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.wiki-content figure {
  margin: 20px 0;
}
.wiki-content .infobox,
.wiki-content .thumb,
.wiki-content .tright,
.wiki-content .mw-halign-right {
  float: right;
  clear: right;
  width: min(290px, 45%);
  margin: 0 0 24px 25px;
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
}
.wiki-content .thumbinner {
  max-width: 100%;
}
.wiki-content .thumbcaption,
.wiki-content figcaption {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 8px;
}
.wiki-content table {
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.55;
  max-width: 100%;
  width: auto;
}
.wiki-content table.infobox {
  width: min(290px, 45%);
}
.wiki-content th,
.wiki-content td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  vertical-align: top;
}
.wiki-content th {
  background: var(--soft);
  font-weight: 600;
}
.wiki-content .table-scroll {
  overflow: auto;
  max-width: 100%;
  margin: 20px 0;
}
.wiki-content .table-scroll table {
  min-width: 100%;
}
.wiki-content blockquote {
  margin: 20px 0;
  padding: 10px 20px;
  border-left: 3px solid var(--accent);
  background: var(--soft);
}
.wiki-content pre {
  overflow: auto;
  white-space: pre-wrap;
  padding: 15px;
  background: var(--soft);
}
.wiki-content .references {
  font-size: 13px;
}
.wiki-content .reference {
  font-size: 11px;
}
.wiki-content .hatnote {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}
.wiki-content .navbox {
  margin-top: 25px;
}
.wiki-content [id] {
  scroll-margin-top: 25px;
}
.wiki-content [role="button"] {
  cursor: zoom-in;
}
.image-unavailable {
  display: block;
  padding: 20px;
  background: var(--soft);
  font-size: 12px;
  color: var(--muted);
}
.article-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--line);
  padding: 16px;
  margin-top: 30px;
  font-size: 12px;
}
.article-categories strong {
  width: 100%;
  font-weight: 500;
}
.library-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0;
}
.library-controls > input {
  flex: 1;
  min-width: 170px;
}
.collection-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: stretch;
  margin-bottom: 20px;
}
.collection-tab {
  position: relative;
  display: flex;
  min-width: 0;
}
.collection-tabs button,
.collection-tabs summary {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.collection-select.active {
  background: var(--soft);
  border-color: var(--accent);
  color: var(--accent);
}
.collection-options {
  position: static;
}
.collection-options summary {
  display: grid;
  place-items: center;
  width: 40px;
  height: 100%;
  min-height: 40px;
  margin-left: -1px;
  border: 1px solid var(--line);
  border-radius: 0 5px 5px 0;
  list-style: none;
  font-size: 20px;
  line-height: 1;
}
.collection-options summary::-webkit-details-marker {
  display: none;
}
.collection-tab:has(.collection-options) .collection-select {
  border-radius: 5px 0 0 5px;
}
.collection-menu {
  position: absolute;
  z-index: 8;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 170px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 10px 35px #0002;
}
.collection-menu button {
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 13px;
}
.new-collection {
  color: var(--accent);
}
.personal-item {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.personal-item > div {
  min-width: 0;
}
.personal-title {
  font-family: Georgia, serif;
  font-size: 23px;
  overflow-wrap: anywhere;
}
.personal-item small {
  display: block;
  margin-top: 7px;
  font-size: 12px;
}
.personal-item .actions {
  flex-shrink: 0;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.about-copy {
  max-width: 750px;
  font-size: 16px;
}
.about-copy h2 {
  margin-top: 35px;
}
.footer {
  max-width: 1600px;
  margin: auto;
  border-top: 1px solid var(--line);
  padding: 23px 38px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 11px;
  color: var(--muted);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 26px;
  width: min(460px, calc(100% - 28px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 20px 80px #0003;
}
dialog::backdrop {
  background: #10251a80;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dialog-head h2 {
  margin: 0;
  font-size: 26px;
  overflow-wrap: anywhere;
}
.close-button {
  font-size: 24px;
  padding: 4px 10px;
  border: 0;
  background: transparent;
}
.field {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  font-size: 13px;
}
.field input,
.field select {
  width: 100%;
}
.form-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 1em;
}
dialog .auth-switch {
  display: block;
  width: 100%;
  margin: 0;
  color: var(--accent);
}
body:has(dialog[open]) {
  overflow: hidden;
}
dialog .close-button {
  flex-shrink: 0;
}
dialog form > .primary {
  width: 100%;
  margin-bottom: 12px;
}
dialog > small {
  display: block;
  margin-top: 12px;
}
dialog > button {
  margin: 6px 6px 6px 0;
}
.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
  overflow-wrap: anywhere;
}
.check-row input {
  min-height: 20px;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.zoom-image {
  max-width: 100%;
  max-height: 65vh;
  display: block;
  margin: auto auto 15px;
}
.dialog-notifications:empty,
#notifications:empty {
  display: none;
}
#notifications {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 5px 30px #0002;
  max-width: calc(100% - 32px);
  width: max-content;
  z-index: 20;
  font-size: 13px;
}
.skip-link {
  position: fixed;
  left: 10px;
  top: -100px;
  z-index: 30;
  background: var(--panel);
  padding: 12px;
}
.skip-link:focus {
  top: 10px;
}
.mobile-menu {
  display: none;
}
.nav-backdrop {
  display: none;
}
.drawer-close {
  display: none;
}
:root[data-font="large"] .wiki-content {
  font-size: 19px;
}
:root[data-width="wide"] .article-layout {
  grid-template-columns: 165px minmax(0, 1fr);
}
@media (min-width: 1600px) {
  .header {
    padding-left: max(38px, calc((100vw - 1524px) / 2));
    padding-right: max(38px, calc((100vw - 1524px) / 2));
  }
}
@media (max-width: 1200px) {
  .header {
    padding: 0 24px;
    grid-template-columns: 1fr minmax(130px, 480px) 1fr;
    gap: 22px;
  }
  .layout {
    padding: 0 24px;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 22px;
  }
  .article-layout {
    display: flex;
    flex-direction: column;
    gap: 22px;
  }
  .toc {
    position: static;
    max-height: none;
    width: 100%;
    padding: 0;
  }
  .toc summary {
    padding: 12px 0;
  }
  .toc nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 20px;
  }
  .section-heading {
    display: block;
  }
  .section-heading h2 {
    margin-bottom: 8px;
  }
  .section-heading p {
    margin-bottom: 20px;
  }
  .welcome h1 {
    font-size: 46px;
  }
}
@media (max-width: 900px) {
  .wiki-content .infobox,
  .wiki-content table.infobox,
  .wiki-content .thumb,
  .wiki-content .tright,
  .wiki-content .mw-halign-right {
    float: none;
    width: 100%;
    margin: 18px 0;
  }
  .wiki-content .infobox img {
    max-height: 520px;
  }
  .wiki-content .infobox {
    display: table;
  }
}
@media (max-width: 800px) {
  .header {
    height: auto;
    min-height: 120px;
    grid-template-columns: 1fr auto;
    gap: 14px;
    padding: 16px 20px;
  }
  .header > .search-form {
    grid-column: 1/-1;
    grid-row: 2;
  }
  .brand b {
    font-size: 25px;
  }
  .brand img {
    width: 32px;
    height: 32px;
  }
  .brand small {
    font-size: 9px;
  }
  .mobile-menu {
    display: block;
    border: 0;
    background: transparent;
    padding: 5px;
    min-width: 32px;
  }
  .header-actions {
    gap: 0;
  }
  .header-actions button {
    font-size: 12px;
    padding: 8px;
  }
  .account-button {
    max-width: 95px;
  }
  .layout {
    display: block;
    padding: 0 24px;
  }
  .sidebar {
    position: fixed;
    z-index: 42;
    inset: 0 auto 0 0;
    display: block;
    width: min(320px, 86vw);
    padding: 28px 22px;
    border: 0;
    border-right: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 12px 0 45px #0003;
    transform: translateX(-105%);
    visibility: hidden;
    transition:
      transform 180ms ease,
      visibility 180ms;
  }
  .nav-open .sidebar {
    transform: translateX(0);
    visibility: visible;
  }
  .sidebar nav {
    grid-template-columns: 1fr;
  }
  .drawer-close {
    position: absolute;
    top: 17px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border: 0;
    background: transparent;
  }
  .nav-backdrop {
    position: fixed;
    z-index: 41;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #08130d99;
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 180ms ease,
      visibility 180ms;
    font-size: 0;
  }
  .nav-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
  }
  .mobile-nav-open {
    overflow: hidden;
  }
  main {
    padding-top: 24px;
  }
  .welcome {
    padding-top: 20px;
  }
  .welcome h1 {
    font-size: 42px;
    max-width: 550px;
  }
  .topics {
    gap: 10px;
  }
  .topic {
    padding: 18px 12px;
    gap: 8px;
  }
  .topic-number {
    display: none;
  }
  .reading-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .article-heading h1 {
    font-size: 38px;
  }
  .footer {
    padding: 22px 24px;
  }
  .article-tools a {
    margin-left: 0;
  }
  .personal-item .actions button {
    font-size: 12px;
  }
  .article-layout {
    gap: 12px;
  }
}
@media (max-width: 480px) {
  .header {
    padding: 12px 14px;
    gap: 12px;
  }
  .brand-wrap {
    gap: 4px;
  }
  .brand {
    gap: 7px;
  }
  .brand small {
    letter-spacing: 0;
  }
  .header-actions button {
    padding: 7px;
    min-height: 36px;
  }
  .header-actions .account-button {
    max-width: 76px;
  }
  .layout {
    padding: 0 18px;
  }
  .welcome h1 {
    font-size: 38px;
    letter-spacing: -0.6px;
  }
  .welcome > p {
    font-size: 14px;
  }
  .welcome {
    padding-bottom: 28px;
  }
  .topics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topic strong {
    font-size: 13px;
  }
  .discovery-list,
  .reading-cards {
    grid-template-columns: 1fr;
  }
  .result-card h2 {
    font-size: 25px;
  }
  .section-heading h2 {
    font-size: 23px;
  }
  .page-heading h1 {
    font-size: 34px;
  }
  .article-heading h1 {
    font-size: 35px;
  }
  .wiki-content {
    font-size: 16px;
  }
  .wiki-content .infobox img {
    max-height: 350px;
  }
  .wiki-content .toc {
    display: none;
  }
  .toc nav {
    grid-template-columns: 1fr;
  }
  .personal-item {
    align-items: start;
    flex-direction: column;
    gap: 12px;
  }
  .personal-item .actions {
    width: 100%;
  }
  .personal-title {
    font-size: 22px;
  }
  .footer {
    padding: 22px 18px;
    flex-wrap: wrap;
  }
  .empty {
    padding: 35px 0;
  }
  .empty h2 {
    font-size: 24px;
  }
  dialog {
    padding: 20px;
  }
  .library-controls select {
    flex: 1;
  }
  .article-tools {
    gap: 5px;
  }
  .article-tools a {
    width: 100%;
    padding: 8px 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
@media print {
  .header,
  .sidebar,
  .footer,
  .toc,
  .article-tools,
  .article-categories,
  #notifications,
  .skip-link,
  dialog {
    display: none !important;
  }
  :root,
  :root[data-theme] {
    color-scheme: light;
    --bg: white;
    --panel: white;
    --soft: #f3f3f3;
    --accent: black;
    --ink: black;
    --muted: #444;
    --line: #bbb;
    --link: black;
  }
  .layout,
  .article-layout {
    display: block;
    padding: 0;
  }
  main {
    padding: 0;
    min-height: 0;
  }
  .article-page {
    width: 100%;
  }
  .wiki-content {
    font-size: 11pt;
  }
  .wiki-content a {
    text-decoration: underline;
  }
  .table-scroll {
    overflow: visible !important;
  }
  .article-heading h1 {
    font-size: 28pt;
  }
}
/* Preserve readable cells: wide tables scroll instead of collapsing into letters. */
.wiki-content .table-scroll table {
  overflow-wrap: normal;
  word-break: normal;
  max-width: none;
}
.wiki-content .table-scroll th,
.wiki-content .table-scroll td {
  min-width: 110px;
}
@media (max-width: 480px) {
  .brand small {
    max-width: 100px;
    line-height: 1.25;
  }
  .toc:not([open]) {
    margin-bottom: 0;
  }
}
.wiki-content table.infobox {
  table-layout: fixed;
  overflow-wrap: anywhere;
}
.wiki-content .infobox td,
.wiki-content .infobox th {
  min-width: 0;
}
.wiki-content math {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

@media (max-width: 600px) {
  input,
  select,
  .search-form input {
    font-size: 16px;
  }
}

.header-actions { gap: 2px; }
.header-actions .quiet { display: grid; place-items: center; width: 34px; height: 34px; min-height: 34px; min-width: 34px; flex: 0 0 34px; padding: 0; border: 0; border-radius: 8px; font-size: 12px; transition: background-color .18s, color .18s; }
.header-actions .quiet:is(:hover,:focus-visible) { background: var(--soft); color: var(--accent); }
.header-actions .account-button { margin-left: 6px; }
@media (prefers-reduced-motion: reduce) { .header-actions .quiet { transition: none; } }

.header-actions .quiet { font-size: 13px; line-height: 1; font-weight: 600; letter-spacing: 0; }
.header-actions .quiet svg { width: 16px; height: 16px; display: block; }

.brand { transition: color .18s ease; }
.brand:is(:hover, :focus-visible) { color: var(--accent); text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .brand { transition: none; } }

.collection-picker { display: grid; gap: 10px; margin-bottom: 16px; }
.collection-choice { position: relative; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--panel); }
.collection-choice input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; }
.collection-choice:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.collection-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.collection-choice-name { flex: 1; min-width: 0; }
.collection-choice > .icon { flex-shrink: 0; }
.collection-choice-count { color: var(--muted); font-size: 12px; }
.collection-choice-check { width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; color: transparent; flex-shrink: 0; }
.collection-choice:has(input:checked) .collection-choice-check { color: var(--panel); background: var(--accent); border-color: var(--accent); }

@media (max-width: 600px) {
  .collection-tabs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .collection-tab { width: 100%; }
  .collection-select { flex: 1; min-width: 0; text-align: left; }
  .collection-options { flex: 0 0 44px; }
  .collection-options summary { width: 44px; }
  .collection-tabs > button { text-align: left; }
  .collection-menu { max-width: 100%; }
  .library-controls { display: grid; grid-template-columns: minmax(0, 1fr); }
  .library-controls > input, .library-controls > select { width: 100%; min-width: 0; font-size: 16px; }
  .personal-item .actions { display: flex; flex-wrap: wrap; gap: 8px; }
  .personal-item .actions > button { min-height: 44px; }
}

.dialog-head { align-items: flex-start; }
.dialog-head > button { flex-shrink: 0; align-self: flex-start; }
.dialog-head > h2 { min-width: 0; margin-top: 0; }
