/* ROGGH Library headless wiki — iRO-wiki-inspired simple skin */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Verdana, Geneva, "DejaVu Sans", sans-serif;
  font-size: 13px;
  color: #1d2733;
  background: #eef1f4;
  line-height: 1.55;
}
a { color: #16407a; text-decoration: none; }
a:hover { color: #b3312a; text-decoration: underline; }
a.new { color: #b3312a; }

/* ---------- header ---------- */
.site-header {
  background: #27406e;
  border-bottom: 3px solid #d7a52a;
  color: #fff;
}
.site-header .inner {
  max-width: 1180px; margin: 0 auto; padding: 12px 18px;
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
.site-header a { color: #fff; }
.site-title { font-size: 22px; font-weight: bold; letter-spacing: .5px; }
.site-title a:hover { text-decoration: none; color: #ffd772; }
.site-tagline { font-size: 12px; color: #b9c6dc; }
.site-header .header-right { margin-left: auto; font-size: 12px; }
.site-header .header-right a { color: #cfe0f7; margin-left: 10px; }

/* ---------- layout ---------- */
.layout {
  max-width: 1180px; margin: 14px auto 0; padding: 0 18px 30px;
  display: grid; grid-template-columns: 232px 1fr; gap: 16px; align-items: start;
}
.layout.has-toc { grid-template-columns: 232px minmax(0, 1fr) 240px; }
.sidebar { display: flex; flex-direction: column; gap: 14px; }
.content {
  background: #fff; border: 1px solid #c8d2dd;
  padding: 18px 24px 26px; min-width: 0;
}

/* ---------- sidebar boxes ---------- */
.box { background: #fff; border: 1px solid #c8d2dd; }
.box > h2, .box > .box-head {
  margin: 0; padding: 6px 10px; font-size: 12px; text-transform: uppercase;
  letter-spacing: .8px; color: #fff; background: #35527d;
  border-bottom: 1px solid #27406e;
}
.box .box-body { padding: 8px 10px; }
.box ul { list-style: none; margin: 0; padding: 0; }
.box li { margin: 3px 0; }
.box li a { display: block; padding: 2px 4px; border-radius: 3px; }
.box li a:hover { background: #eef2f8; text-decoration: none; }
.box li.active > a { background: #dfe8f4; font-weight: bold; }
.box .count { color: #7d8a99; font-size: 11px; }
.box-foot { padding: 6px 10px; border-top: 1px solid #e2e8ef; font-size: 11px; color: #7d8a99; }

.search-form { display: flex; gap: 6px; }
.search-form input[type="search"] {
  flex: 1; min-width: 0; padding: 5px 7px; font-size: 12px;
  border: 1px solid #b9c4d0; border-radius: 3px; font-family: inherit;
}
.search-form button {
  padding: 5px 10px; font-size: 12px; font-family: inherit; cursor: pointer;
  color: #fff; background: #35527d; border: 1px solid #27406e; border-radius: 3px;
}
.search-form button:hover { background: #27406e; }

/* ---------- content chrome ---------- */
.breadcrumb { font-size: 11px; color: #7d8a99; margin-bottom: 6px; }
.breadcrumb a { color: #4c6b96; }
.content h1 {
  margin: 0 0 4px; font-size: 21px; color: #1b2f52;
  border-bottom: 2px solid #35527d; padding-bottom: 6px;
}
.meta { font-size: 11px; color: #7d8a99; margin: 6px 0 14px; }
.meta .sep { margin: 0 6px; color: #c2ccd6; }

.article img { max-width: 100%; height: auto; border: 1px solid #d5dce3; }
.article p { margin: 9px 0; }
.article ul, .article ol { margin: 9px 0; padding-left: 26px; }
.article li { margin: 3px 0; }
.article h2 {
  font-size: 16px; margin: 22px 0 8px; padding: 4px 10px;
  background: #eef2f8; border-left: 5px solid #35527d; color: #1b2f52;
}
.article h3 { font-size: 14px; margin: 16px 0 6px; color: #24406b; border-bottom: 1px dashed #c9d3de; }
.article h4 { font-size: 13px; margin: 13px 0 4px; color: #2c3e57; }
.article blockquote {
  margin: 10px 0; padding: 6px 14px; border-left: 4px solid #b6c6dd;
  background: #f5f8fb; color: #43536b;
}
.article hr, .wp-block-separator { border: none; border-top: 1px solid #d5dce3; margin: 18px 0; }
.article pre {
  background: #f4f6f9; border: 1px solid #d5dce3; padding: 10px 12px;
  overflow-x: auto; font-size: 12px;
}
.article code { font-family: Consolas, "Courier New", monospace; font-size: 12px; }
.article p > code, .article li > code { background: #f0f3f7; padding: 1px 4px; border-radius: 2px; }
.article figure { margin: 12px 0; }
.article figcaption { font-size: 11px; color: #7d8a99; text-align: center; }
.article embed, .article iframe, .article video { max-width: 100%; }

/* tables — wiki style */
.table-wrap, .article .wp-block-table { overflow-x: auto; }
.article table, table.wiki {
  border-collapse: collapse; margin: 10px 0; font-size: 12px; background: #fff;
}
.article table th, table.wiki th {
  background: #e2e9f1; border: 1px solid #aebccb; padding: 5px 9px; text-align: left; font-weight: bold;
}
.article table td, table.wiki td { border: 1px solid #c8d2dd; padding: 4px 9px; vertical-align: top; }
.article table tr:nth-child(even) td { background: #f7f9fb; }

/* spoiler boxes (bbspoiler replacement) */
details.spoiler {
  border: 1px solid #d9c472; margin: 10px 0; background: #fffdf3;
}
details.spoiler > summary {
  cursor: pointer; padding: 5px 10px; background: #fdf3c7; color: #6b5710;
  font-weight: bold; list-style: none; user-select: none;
}
details.spoiler > summary::before { content: "\25B8  "; }
details.spoiler[open] > summary::before { content: "\25BE  "; }
details.spoiler > div.spoiler-body { padding: 8px 12px; border-top: 1px solid #eadfae; }

/* copy chips (copy-the-code replacement) */
.copy-chip {
  font-family: Consolas, "Courier New", monospace; font-size: 12px;
  background: #eef2f8; border: 1px dashed #8ea6c4; border-radius: 3px;
  padding: 1px 7px; cursor: pointer; white-space: nowrap; display: inline-block;
}
.copy-chip:hover { background: #dfe9f5; border-color: #35527d; }
.copy-chip.copied { background: #dff3df; border-color: #4b9b4b; }

/* quest grid (quest_grid shortcode) */
.quest-grid {
  border: 1px solid #c8d2dd; margin: 12px 0; background: #f8fafc;
}
.quest-grid h3, .quest-grid .qg-title {
  margin: 0; padding: 5px 10px; font-size: 13px; background: #e2e9f1; color: #1b2f52;
  border-bottom: 1px solid #c8d2dd;
}
.quest-grid ul { margin: 0; padding: 8px 14px 8px 30px; }
.quest-grid li { margin: 2px 0; }

/* ---------- TOC box (built client-side; lives in the sticky right rail) ---------- */
.toc-rail { position: sticky; top: 10px; align-self: start; min-width: 0; }
.toc-rail .tocbox ul { max-height: calc(100vh - 120px); }
.tocbox {
  background: #f4f7fa; border: 1px solid #c8d2dd; margin: 0 0 16px; padding: 8px 14px;
  font-size: 12px;
}
.tocbox.sticky { position: sticky; top: 6px; z-index: 30; }
.toc-head { display: flex; align-items: baseline; gap: 8px; cursor: pointer; user-select: none; }
.toc-head .toc-label { font-weight: bold; color: #1b2f52; white-space: nowrap; }
.toc-head .toc-now {
  flex: 1; min-width: 0; font-size: 11px; color: #7d8a99;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right;
}
.toc-head .toc-toggle { color: #35527d; font-size: 11px; transition: transform .15s; }
.tocbox.collapsed .toc-toggle { transform: rotate(-90deg); }
.tocbox ul {
  list-style: none; margin: 6px 0 2px; padding: 0;
  max-height: 46vh; overflow-y: auto;
}
.tocbox.collapsed ul { display: none; }
.tocbox li { margin: 1px 0; }
.tocbox li.toc-l3 { padding-left: 14px; font-size: 11px; }
.tocbox li a { display: block; padding: 2px 6px; border-radius: 3px; }
.tocbox li a:hover { background: #e7edf5; text-decoration: none; }
.tocbox li.toc-active > a { background: #dfe8f4; font-weight: bold; }
.toc-num { display: inline-block; min-width: 26px; color: #4c6b96; font-weight: bold; }

/* ---------- homepage (mirrors original: cards + quick nav + recent updates) ---------- */
.home-header { text-align: center; padding: 8px 0 2px; }
.home-header h1 { border: none; padding: 0; margin: 0 0 4px; font-size: 24px; }
.home-header .sub { margin: 0; color: #5b6a7c; font-size: 13px; }
.feat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px 0 4px; }
.feat-card { border: 1px solid #c8d2dd; background: #fff; display: flex; flex-direction: column; }
.fc-thumb {
  display: block; aspect-ratio: 11 / 5; background-size: cover; background-position: center 25%;
  background-color: #e2e9f1; border-bottom: 1px solid #c8d2dd;
}
.fc-body { padding: 9px 12px 12px; }
.fc-meta {
  display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .6px;
  color: #7a5d13; background: #f3e9d0; border-radius: 3px; padding: 1px 6px; margin-bottom: 6px;
}
.feat-card h3 { margin: 0 0 4px; font-size: 14px; }
.feat-card p { margin: 0; font-size: 12px; color: #5b6a7c; }
.quick-nav { border: 1px solid #c8d2dd; background: #f8fafc; padding: 10px 14px 12px; margin: 16px 0; }
.quick-nav h3 { margin: 0 0 2px; font-size: 14px; color: #1b2f52; }
.quick-nav p { margin: 0 0 9px; font-size: 12px; color: #7d8a99; }
.qn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.qn-item {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid #c8d2dd; background: #fff;
  padding: 7px 12px; border-radius: 3px; font-weight: bold; font-size: 12px;
}
.qn-item:hover { background: #eef2f8; border-color: #8ea6c4; text-decoration: none; }
.qn-item svg { width: 17px; height: 17px; fill: #35527d; flex: none; }
.recent-updates h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ru-more { font-size: 11px; font-weight: normal; }
.recent-strip {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px;
  scroll-snap-type: x proximity;
}
.ru-card {
  flex: 0 0 170px; scroll-snap-align: start; border: 1px solid #c8d2dd; background: #fff;
  display: flex; flex-direction: column;
}
.ru-card:hover { text-decoration: none; border-color: #8ea6c4; }
.ru-thumb {
  display: block; aspect-ratio: 16 / 9; background-size: cover; background-position: center 25%;
  background-color: #e2e9f1; border-bottom: 1px solid #e2e9f1;
}
.ru-title { display: block; padding: 7px 9px 2px; font-size: 12px; font-weight: bold; color: #16407a; line-height: 1.35; }
.ru-date { display: block; padding: 0 9px 9px; font-size: 10px; color: #8b97a5; margin-top: auto; }
.ru-card.no-thumb .ru-title { padding-top: 11px; min-height: 74px; }

/* ---------- homepage v2: hero search, task tiles, class tiles ---------- */
.layout.home-wide { grid-template-columns: minmax(0, 1fr); }
.content.home { background: transparent; border: none; padding: 0; }
.hero {
  text-align: center; padding: 34px 20px 26px; margin-bottom: 14px; color: #fff;
  background: linear-gradient(135deg, #27406e 0%, #35527d 60%, #4a6aa0 100%);
  border: 1px solid #1d3257; border-bottom: 3px solid #d7a52a;
}
.content .hero h1 { color: #fff; border: none; font-size: 30px; margin: 0 0 6px; letter-spacing: .5px; padding: 0; }
.hero .sub { color: #cfe0f7; font-size: 14px; margin: 0 0 18px; }
.hero-search { display: flex; max-width: 640px; margin: 0 auto 12px; }
.hero-search input[type="search"] {
  flex: 1; min-width: 0; padding: 12px 14px; font-size: 15px; font-family: inherit;
  border: 2px solid #fff; border-right: none; border-radius: 4px 0 0 4px; outline: none;
}
.hero-search input[type="search"]:focus { border-color: #ffd772; }
.hero-search button {
  padding: 0 22px; font-size: 14px; font-weight: bold; font-family: inherit; cursor: pointer;
  color: #1b2f52; background: #d7a52a; border: 2px solid #d7a52a; border-radius: 0 4px 4px 0;
}
.hero-search button:hover { background: #ffd772; border-color: #ffd772; }
.hero-chips {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 6px 8px; font-size: 12px; color: #b9c6dc;
}
.hero-chips a {
  color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: 12px; padding: 2px 10px;
}
.hero-chips a:hover { background: rgba(255,255,255,.25); color: #fff; text-decoration: none; }

.home-panel { background: #fff; border: 1px solid #c8d2dd; padding: 14px 18px 18px; margin-bottom: 14px; }

/* orientation row: featured cards beside start-here / what's-new */
.orient-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.orient-row .home-panel { margin-bottom: 0; }
.side-stack { display: flex; flex-direction: column; gap: 14px; }
.side-stack .home-panel { margin-bottom: 0; }
.start-list { list-style: none; margin: 0; padding: 0; }
.start-list li { margin: 0 0 4px; }
.start-list a {
  display: block; padding: 7px 10px; border: 1px solid #c8d2dd; border-radius: 3px;
  background: #f8fafc; font-weight: bold; font-size: 13px;
}
.start-list a:hover { background: #eef2f8; border-color: #8ea6c4; text-decoration: none; }
.wn-stats { margin: 0 0 8px; font-size: 13px; color: #1b2f52; }
.wn-stats .wn-last { font-size: 11px; color: #8b97a5; }
.wn-link { font-size: 13px; }

/* wiki floor: categories beside the guide-page directory */
.wiki-floor { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0 14px; align-items: start; }
.hub-list { list-style: none; margin: 0; padding: 0; columns: 1; }
.hub-list li { margin: 0; border-bottom: 1px solid #e6ebf1; }
.hub-list li:last-child { border-bottom: none; }
.hub-list a { display: block; padding: 5px 4px; font-size: 12px; }
.hub-list a:hover { background: #eef2f8; text-decoration: none; }
.article .home-h2 {
  display: flex; align-items: baseline; gap: 12px; margin: 0 0 12px; padding: 0 0 0 10px;
  font-size: 16px; color: #1b2f52; background: none; border: none; border-left: 5px solid #d7a52a;
}
.home-h2 .more { margin-left: auto; font-size: 11px; font-weight: normal; }
.home-panel .cat-grid { margin: 0 0 10px; }

.task-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.task-tile {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid #c8d2dd; border-radius: 4px; background: #f8fafc;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.task-tile:hover {
  transform: translateY(-2px); box-shadow: 0 3px 8px rgba(27,47,82,.15);
  border-color: #8ea6c4; text-decoration: none;
}
.tt-icon {
  flex: none; width: 40px; height: 40px; border-radius: 8px; background: #35527d;
  display: flex; align-items: center; justify-content: center;
}
.tt-icon svg { width: 22px; height: 22px; fill: #fff; }
.tt-title { display: block; font-weight: bold; font-size: 14px; color: #16407a; }
.tt-desc { display: block; font-size: 11px; color: #7d8a99; }

.class-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.class-tile {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 12px 6px;
  text-align: center; background: #fff; border: 1px solid #c8d2dd;
  border-top: 4px solid var(--c); border-radius: 4px;
  transition: transform .12s, box-shadow .12s;
}
.class-tile:hover { transform: translateY(-2px); box-shadow: 0 3px 8px rgba(27,47,82,.15); text-decoration: none; }
.ct-badge {
  width: 44px; height: 44px; border-radius: 50%; background: var(--c); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: bold; font-size: 15px; letter-spacing: .5px;
}
.ct-name { font-weight: bold; font-size: 12px; color: #1b2f52; }
.ct-sub { font-size: 10px; color: #8b97a5; }

@media (max-width: 880px) {
  .task-grid { grid-template-columns: repeat(2, 1fr); }
  .class-grid { grid-template-columns: repeat(3, 1fr); }
  .content .hero h1 { font-size: 24px; }
  .orient-row, .wiki-floor { grid-template-columns: minmax(0, 1fr); }
  .orient-row .home-panel { margin-bottom: 14px; }
}
@media (max-width: 520px) {
  .task-grid { grid-template-columns: 1fr; }
  .class-grid { grid-template-columns: repeat(2, 1fr); }
  .home-panel { padding: 12px; }
}

/* ---------- lists (home, category, A-Z, search) ---------- */
.post-list { list-style: none; margin: 10px 0; padding: 0; }
.post-list li { padding: 8px 4px; border-bottom: 1px solid #e6ebf1; }
.post-list li:last-child { border-bottom: none; }
.post-list .pl-title { font-size: 14px; font-weight: bold; }
.post-list .pl-excerpt { color: #5b6a7c; font-size: 12px; margin-top: 2px; }
.post-list .pl-meta { color: #8b97a5; font-size: 11px; margin-top: 2px; }
.badge {
  display: inline-block; font-size: 10px; padding: 0 6px; border-radius: 3px;
  background: #e2e9f1; color: #35527d; margin-right: 6px; vertical-align: 1px;
}
.badge.cat { background: #f3e9d0; color: #7a5d13; }

.alpha-index { margin: 8px 0 2px; font-size: 12px; line-height: 1.9; }
.alpha-index a { margin-right: 5px; font-weight: bold; }
.alpha-letter {
  font-size: 15px; font-weight: bold; color: #1b2f52; margin: 16px 0 4px;
  border-bottom: 2px solid #dfe6ee; padding-bottom: 2px;
}

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 12px 0; }
.cat-card { border: 1px solid #c8d2dd; background: #f8fafc; padding: 10px 12px; }
.cat-card h3 { margin: 0 0 4px; font-size: 14px; }
.cat-card p { margin: 0; font-size: 11px; color: #7d8a99; }

.welcome {
  border: 1px solid #c8d2dd; background: #f4f7fa; padding: 12px 16px; margin-bottom: 16px;
}

/* ---------- search page ---------- */
#search-input {
  width: 100%; padding: 8px 10px; font-size: 14px; font-family: inherit;
  border: 1px solid #b9c4d0; border-radius: 3px;
}
.search-stats { color: #7d8a99; font-size: 12px; margin: 10px 0; }
.search-hit { margin-bottom: 14px; }
.search-hit .sh-title { font-size: 14px; font-weight: bold; }
.search-hit .sh-snippet { color: #5b6a7c; font-size: 12px; }
.search-hit mark { background: #ffe9a8; padding: 0 1px; }

/* ---------- footer ---------- */
.site-footer {
  max-width: 1180px; margin: 0 auto; padding: 14px 18px 30px;
  font-size: 11px; color: #7d8a99; text-align: center;
}
.site-footer a { color: #4c6b96; }

/* ---------- homepage layout fixes ---------- */
/* the generic .article ul padding was indenting these lists from their headings */
.article .start-list, .article .hub-list { padding: 0; margin: 0; }

/* panels in a row share one height instead of leaving gaps */
.orient-row, .wiki-floor { align-items: stretch; }
.wiki-floor .home-panel { margin-bottom: 14px; }

/* two-up category grid; an odd last card spans the row instead of sitting alone */
.wiki-floor .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wiki-floor .cat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (max-width: 520px) { .wiki-floor .cat-grid { grid-template-columns: minmax(0, 1fr); } }

/* featured thumbnails: taller crop anchored to the top so titles in the art stay visible */
.fc-thumb { aspect-ratio: 16 / 9; background-position: center top; }

/* readable minimum text size, and no tracked all-caps labels */
.fc-meta { font-size: 12px; text-transform: none; letter-spacing: 0; }
.box > h2, .box > .box-head { font-size: 13px; text-transform: none; letter-spacing: 0; }
.breadcrumb, .meta, .box .count, .box-foot, .post-list .pl-meta, .ru-date, .ct-sub,
.tt-desc, .search-stats, .cat-card p, .quick-nav p, .article figcaption,
.site-footer, .wn-stats .wn-last, .home-h2 .more, .badge { font-size: 12px; }
.ru-title { font-size: 13px; }

/* header links: larger tap targets */
.site-header .header-right a { display: inline-block; padding: 10px 8px; margin-left: 2px; font-size: 13px; }

/* slimmer scrollbar on the recent-updates strip */
.recent-strip { scrollbar-width: thin; scrollbar-color: #8ea6c4 #e2e9f1; }

/* images inside tables keep their set size; max-width:100% collapses them to slivers in auto-width cells (the figure scrolls sideways on narrow screens instead) */
.article table img { max-width: none; height: auto; }

/* ---------- inner pages match the homepage panels ---------- */
.box { padding: 14px 8px 8px; }
.box > h2, .box > .box-head {
  margin: 0 8px 8px; padding: 0 0 0 10px; font-size: 15px; color: #1b2f52;
  background: none; border: none; border-left: 5px solid #d7a52a;
}
.content h1 {
  font-size: 22px; padding: 0 0 0 12px; margin: 0 0 6px;
  border: none; border-left: 5px solid #d7a52a;
}
.article h2 {
  font-size: 17px; padding: 0 0 0 10px; background: none; border-left: 5px solid #d7a52a;
}

/* sidebar lists: link and count share one line */
.box li { display: flex; align-items: baseline; gap: 6px; }
.box li > a { flex: 1; min-width: 0; }
.box li .count { flex: none; padding-right: 4px; font-variant-numeric: tabular-nums; }

/* post lists: use the full column (the generic article-list padding and 75ch cap were squeezing them) */
.article .post-list { padding: 0; margin: 10px 0; }
.content:not(.home) .article .post-list li { max-width: none; }

/* ---------- thumbnails in post lists and search results ---------- */
.post-list li, .search-hit { display: flex; gap: 12px; align-items: flex-start; }
.pl-body, .sh-body { flex: 1; min-width: 0; }
.pl-thumb, .sh-thumb {
  flex: none; display: block; width: 128px; aspect-ratio: 16 / 9; overflow: hidden;
  background: #e2e9f1; border: 1px solid #d5dce3;
}
.pl-thumb img, .sh-thumb img {
  display: block; width: 100%; height: 100%; max-width: none; border: none;
  object-fit: cover; object-position: center top;
}
@media (max-width: 520px) { .pl-thumb, .sh-thumb { width: 88px; } }

/* ---------- readability, accessibility, print ---------- */
body {
  font-family: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
.article { font-size: 15px; line-height: 1.65; }
/* keep reading lines short on pages without the TOC rail */
.content:not(.home) .article p,
.content:not(.home) .article li { max-width: 75ch; }

/* muted text: the old greys were ~3.5:1 on white; this is ~5.4:1 */
.breadcrumb, .meta, .box .count, .box-foot, .post-list .pl-meta, .ru-date, .ct-sub,
.tt-desc, .search-stats, .cat-card p, .quick-nav p, .article figcaption,
.site-footer, .toc-head .toc-now, .wn-stats .wn-last { color: #5d6a79; }

/* keyboard focus */
:focus-visible { outline: 3px solid #d7a52a; outline-offset: 2px; }
.hero-search input[type="search"]:focus-visible { outline: 3px solid #ffd772; outline-offset: 2px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: #d7a52a; color: #1b2f52; padding: 8px 14px; font-weight: bold;
}
.skip-link:focus { left: 8px; top: 8px; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .task-tile:hover, .class-tile:hover { transform: none; }
}

@media print {
  .site-header, .sidebar, .toc-rail, .site-footer, .skip-link { display: none !important; }
  .layout, .layout.has-toc { display: block; margin: 0; padding: 0; }
  .content { border: none; padding: 0; }
  body { background: #fff; font-size: 12pt; }
}

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .layout.has-toc { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .content { order: 1; padding: 14px 14px 20px; }
  .site-header .inner { padding: 10px 12px; }
  .feat-cards { grid-template-columns: 1fr; }
  .tocbox.sticky { position: static; }
  .layout.has-toc .toc-rail { position: static; }
}

/* mid-width: the right rail can't fit — park it above the article, not over it */
@media (min-width: 881px) and (max-width: 1120px) {
  .layout.has-toc { grid-template-columns: 232px minmax(0, 1fr); }
  .layout.has-toc .toc-rail { position: static; grid-column: 2; grid-row: 1; }
  .layout.has-toc .content { grid-row: 2; }
  .layout.has-toc .sidebar { grid-row: 1 / span 2; }
}
