/* ==========================================================================
   Datapack Codex — accessible stylesheet
   WCAG AA+ : dark default + light toggle, rem typography, >=4.5:1 body contrast,
   semantic layout, visible focus, print stylesheet (white bg).
   ========================================================================== */

/* ---- Design tokens: DARK (default) ---------------------------------------- */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg:            #0f1218;   /* page */
  --bg-elev:       #161b24;   /* sidebar / cards */
  --bg-elev-2:     #1d2430;   /* code, table stripes */
  --bg-inset:      #0b0e13;   /* code blocks */

  --text:          #e8ebf2;   /* body — ~14.5:1 on --bg */
  --text-muted:    #b3bccd;   /* secondary — ~8.3:1 on --bg */
  --text-faint:    #8d97a8;   /* meta — ~5.1:1 on --bg */

  --link:          #7cc4ff;   /* ~8.2:1 on --bg */
  --link-hover:    #a9d8ff;
  --border:        #2a3341;
  --border-strong: #3a4658;

  --accent:        #7cc4ff;
  --accent-ink:    #06213a;   /* text on accent fills */

  /* Semantic callout hues (all tuned for >=4.5:1 text on their tint) */
  --note-bar:      #6aa9ff;  --note-bg:      #12203a;  --note-tx:  #cfe0ff;
  --warn-bar:      #ffbf47;  --warn-bg:      #2a2410;  --warn-tx:  #ffe6ab;
  --tip-bar:       #57d38c;  --tip-bg:       #0f2519;  --tip-tx:   #b9f0d0;
  --trick-bar:     #c99bff;  --trick-bg:     #201633;  --trick-tx: #e6d4ff;
  --danger-bar:    #ff8a80;  --danger-bg:    #2c1512;  --danger-tx:#ffc9c2;

  --ver-tag-bg:    #22304a;  --ver-tag-tx:   #cfe0ff;  --ver-tag-bd:#3a537f;

  /* Version-delta marking: text added/changed in the release being documented.
     >=6.8:1 on every surface it can sit on (bg, elev, elev2). */
  --upd-tx:        #ff8a80;  --upd-src-tx:   #ffb3ab;

  /* Search-result highlight. 9.33:1 text on its own tint. */
  --mark-bg:       #43391a;  --mark-tx:      #ffe6ab;

  /* Scrollbars. Sized and coloured deliberately rather than left to the
     browser default, which is a 6px near-invisible sliver - unusable if
     you cannot see it, and this site is built for a reader who cannot. */
  --sb-track:      #161b24;  --sb-thumb:     #8a9ab0;  --sb-thumb-hi: #b3bccd;
}

/* ---- Design tokens: LIGHT -------------------------------------------------- */
:root[data-theme="light"] {
  color-scheme: light;

  --bg:            #ffffff;
  --bg-elev:       #f4f6fa;
  --bg-elev-2:     #e9edf4;
  --bg-inset:      #f4f6fa;

  --text:          #14181f;   /* ~15:1 on white */
  --text-muted:    #3c4657;   /* ~9:1 */
  --text-faint:    #5a6577;   /* ~5.3:1 */

  --link:          #0b5fb3;   /* ~6.4:1 on white */
  --link-hover:    #08427d;
  --border:        #d3dae4;
  --border-strong: #b6c0ce;

  --accent:        #0b5fb3;
  --accent-ink:    #ffffff;

  --note-bar:      #1667c9;  --note-bg:      #eaf2ff;  --note-tx:  #103a68;
  --warn-bar:      #9a6b00;  --warn-bg:      #fff5e0;  --warn-tx:  #5c3f00;
  --tip-bar:       #0f8a4d;  --tip-bg:       #e7f8ee;  --tip-tx:   #0a4a2a;
  --trick-bar:     #7a3ec9;  --trick-bg:     #f3ebff;  --trick-tx: #3d1d68;
  --danger-bar:    #c22a1c;  --danger-bg:    #fdecea;  --danger-tx:#7a160d;

  --ver-tag-bg:    #eaf2ff;  --ver-tag-tx:   #103a68;  --ver-tag-bd:#a9c8ef;

  /* Version-delta marking — see dark block. >=5.6:1 on every surface. */
  --upd-tx:        #b3251a;  --upd-src-tx:   #8f1d14;
  --mark-bg:       #fff3c4;  --mark-tx:      #4a3400;   /* 10.59:1 */
  --sb-track:      #e9edf4;  --sb-thumb:     #5a6576;  --sb-thumb-hi: #3c4657;
}

/* ---- Reset-ish + base ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;                 /* respect user's browser font size */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;            /* ~17px base, rem-scalable */
  line-height: 1.7;
  overflow-wrap: break-word;
}

/* ---- Skip link (keyboard nav) -------------------------------------------- */
.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3.5rem;
  z-index: 1000;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.6rem 1rem;
  border-radius: 0 0 0.4rem 0.4rem;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0; }

/* Visually-hidden but screen-reader accessible */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---- Visible focus everywhere -------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ---- Layout --------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.site-header .brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.site-header .brand .logo { font-size: 1.4rem; line-height: 1; }
.site-header .spacer { flex: 1 1 auto; }

.header-search {
  position: relative;
  max-width: 22rem;
  flex: 1 1 14rem;
}
.header-search input {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.75rem;
  color: var(--text);
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
}
.header-search input::placeholder { color: var(--text-faint); }

.search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0; right: 0;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
  max-height: 60vh;
  overflow-y: auto;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  padding: 0.35rem;
}
.search-results:empty { display: none; }
.search-results a {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 0.35rem;
  text-decoration: none;
  color: var(--text);
}
.search-results a small { display:block; color: var(--text-faint); font-size: 0.82rem; }
.search-results a:hover,
.search-results a.active { background: var(--bg-elev-2); }

.theme-toggle, .nav-toggle {
  font: inherit;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  color: var(--text);
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
  border-radius: 0.5rem;
  cursor: pointer;
}
.theme-toggle:hover, .nav-toggle:hover { border-color: var(--accent); }
.nav-toggle { display: none; }

.layout {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  align-items: start;
  max-width: 84rem;
  margin: 0 auto;
}

/* ---- Sidebar nav ---------------------------------------------------------- */
.sidebar {
  position: sticky;
  top: 3.75rem;
  align-self: start;
  max-height: calc(100vh - 3.75rem);
  overflow-y: auto;
  padding: 1.25rem 0.5rem 2.5rem 1.25rem;
  border-right: 1px solid var(--border);
}
.sidebar nav h2 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  margin: 1.4rem 0 0.4rem;
}
.sidebar nav h2:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a {
  display: block;
  padding: 0.32rem 0.6rem;
  border-radius: 0.4rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.sidebar li a:hover { background: var(--bg-elev-2); color: var(--text); }
.sidebar li a[aria-current="page"] {
  background: var(--ver-tag-bg);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

/* ---- Main content --------------------------------------------------------- */
.content {
  min-width: 0;
  padding: 1.5rem clamp(1.1rem, 3vw, 3rem) 5rem;
}
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-faint);
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--text-muted); }

.content h1 {
  font-size: clamp(1.75rem, 1.2rem + 2vw, 2.4rem);
  line-height: 1.2;
  margin: 0.2rem 0 0.4rem;
}
.content h2 {
  font-size: 1.55rem;
  line-height: 1.25;
  margin: 2.4rem 0 0.8rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 5rem;
}
.content h3 {
  font-size: 1.22rem;
  margin: 1.8rem 0 0.6rem;
  scroll-margin-top: 5rem;
}
.content h4 { font-size: 1.05rem; margin: 1.3rem 0 0.5rem; color: var(--text-muted); }
.content p, .content li { color: var(--text); }
.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 60ch;
}

.content a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.content a:hover { color: var(--link-hover); }

/* Heading anchor links */
.anchor {
  margin-left: 0.4rem;
  font-size: 0.8em;
  opacity: 0;
  text-decoration: none;
  color: var(--text-faint);
}
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }

/* ---- Code ----------------------------------------------------------------- */
code, pre, kbd, samp {
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
}
:not(pre) > code {
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  padding: 0.1rem 0.38rem;
  font-size: 0.88em;
  color: var(--text);
}
pre {
  position: relative;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 1rem 0;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; color: var(--text); }
.code-caption {
  display: block;
  font-size: 0.8rem;
  color: var(--text-faint);
  margin: 0.9rem 0 -0.4rem;
  font-family: ui-monospace, Consolas, monospace;
}
.copy-btn {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  font: inherit; font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  color: var(--text-muted);
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: 0.35rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}
pre:hover .copy-btn, .copy-btn:focus { opacity: 1; }

/* ---- Tables --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
th, td {
  text-align: left;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  vertical-align: top;
}
thead th {
  background: var(--bg-elev-2);
  color: var(--text);
  font-weight: 700;
  position: sticky;
  top: 0;
}
tbody tr:nth-child(even) { background: var(--bg-elev); }

/* ---- Callouts ------------------------------------------------------------- */
.callout {
  border-left: 4px solid var(--note-bar);
  background: var(--note-bg);
  color: var(--note-tx);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  margin: 1.1rem 0;
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.callout .callout-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.callout code { background: rgba(127,127,127,0.18); border-color: transparent; }
.callout.note   { border-color: var(--note-bar);   background: var(--note-bg);   color: var(--note-tx); }
.callout.warn   { border-color: var(--warn-bar);   background: var(--warn-bg);   color: var(--warn-tx); }
.callout.tip    { border-color: var(--tip-bar);    background: var(--tip-bg);    color: var(--tip-tx); }
.callout.trick  { border-color: var(--trick-bar);  background: var(--trick-bg);  color: var(--trick-tx); }
.callout.danger { border-color: var(--danger-bar); background: var(--danger-bg); color: var(--danger-tx); }

/* Version-difference callout gets a monospace-ish list feel */
.callout.version ul { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.callout.version li { margin: 0.15rem 0; }

/* ---- Version tag chips ---------------------------------------------------- */
/* ---- Version-delta marking ------------------------------------------------
   Text added or changed in the release a page is being updated to is wrapped in
   .upd (red), immediately followed by a .upd-src link carrying the reference
   URL for that release's update notes, rendered as "(Site: 26.2)".

     <span class="upd">new or changed prose</span>
     <a class="upd-src" href="https://minecraft.wiki/w/Java_Edition_26.2"
        rel="external">(Site: 26.2)</a>

   Both hues are contrast-verified in contrast.py against bg, elev and elev2 in
   both themes. Colour is never the only signal: .upd-src states the version in
   text, so the marking survives greyscale and screen readers. */
.upd {
  color: var(--upd-tx);
  font-weight: 500;
}

a.upd-src {
  color: var(--upd-src-tx);
  font-size: 0.85em;
  font-weight: 600;
  white-space: nowrap;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  margin-left: 0.25rem;
}

a.upd-src:hover, a.upd-src:focus-visible { text-decoration-thickness: 2px; }

/* Print: red does not survive monochrome, so expose the reference URL. */
@media print {
  .upd { color: #000; font-weight: 700; text-decoration: underline; }
  a.upd-src::after { content: " " attr(href); font-weight: 400; }
}

.ver {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.05rem 0.45rem;
  border-radius: 0.4rem;
  background: var(--ver-tag-bg);
  color: var(--ver-tag-tx);
  border: 1px solid var(--ver-tag-bd);
  white-space: nowrap;
  vertical-align: baseline;
}

/* ---- Cards grid (home) ---------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}
.card {
  display: block;
  padding: 1.1rem 1.2rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { margin: 0 0 0.3rem; font-size: 1.1rem; color: var(--text); }
.card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }
.card .card-icon { font-size: 1.5rem; }

/* ---- On this page (TOC) --------------------------------------------------- */
.toc-inline {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 0.9rem 1.1rem;
  margin: 1.2rem 0 2rem;
}
.toc-inline strong { display:block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 0.4rem; }
.toc-inline ul { margin: 0; padding-left: 1.1rem; columns: 2; column-gap: 2rem; }
.toc-inline li { margin: 0.15rem 0; }
.toc-inline a { color: var(--link); text-decoration: none; }
.toc-inline a:hover { text-decoration: underline; }

/* ---- Footer --------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem clamp(1.1rem, 3vw, 3rem);
  color: var(--text-faint);
  font-size: 0.88rem;
  max-width: 84rem;
  margin: 0 auto;
}
.site-footer a { color: var(--text-muted); }

/* ---- Responsive ----------------------------------------------------------- */
@media (max-width: 60rem) {
  .layout { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed;
    inset: 3.4rem 0 auto 0;
    max-height: calc(100vh - 3.4rem);
    background: var(--bg-elev);
    border-right: 0;
    border-bottom: 1px solid var(--border);
    z-index: 90;
    display: none;
  }
  .sidebar.open { display: block; }
  .toc-inline ul { columns: 1; }
  .header-search { order: 5; flex-basis: 100%; max-width: none; }
}

/* ---- Print (white background, ink-friendly) ------------------------------- */
@media print {
  :root, :root[data-theme="dark"], :root[data-theme="light"] {
    --bg:#fff; --bg-elev:#fff; --bg-elev-2:#f3f3f3; --bg-inset:#f7f7f7;
    --text:#000; --text-muted:#222; --text-faint:#444;
    --link:#003; --border:#bbb; --border-strong:#999;
  }
  body { background:#fff; color:#000; font-size: 11pt; }
  .site-header, .sidebar, .theme-toggle, .nav-toggle, .header-search,
  .copy-btn, .anchor, .skip-link { display: none !important; }
  .layout { display: block; max-width: none; }
  .content { padding: 0; }
  a { color:#000; text-decoration: underline; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color:#444; }
  pre, table, .callout, .card { break-inside: avoid; border-color:#bbb; }
  h1, h2, h3 { break-after: avoid; }
}


/* ---- Search --------------------------------------------------------------- */
/* Type-ahead extras in the header dropdown */
.search-results[hidden] { display: none; }
.search-results mark,
.search-output mark {
  background: var(--mark-bg);
  color: var(--mark-tx);
  padding: 0 0.1em;
  border-radius: 0.15rem;
}
.search-more,
.search-none {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin: 0;
}
.search-more { color: var(--link); font-weight: 600; }

/* Full search page */
.search-page-box {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  padding: 1rem 1.1rem;
  margin: 1.25rem 0;
}
.search-page-box label { display: block; margin-bottom: 0.4rem; }
#q {
  width: 100%;
  font-size: 1.15rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.45rem;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
}
#q::placeholder { color: var(--text-faint); }
.search-facets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 0.5rem;
}
.btn {
  font: inherit;
  font-size: 0.9rem;
  padding: 0.35rem 0.8rem;
  border-radius: 0.4rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev-2);
  color: var(--text);
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
}
.btn .n { opacity: 0.85; margin-left: 0.3rem; }
.search-count { margin: 0.4rem 0 0; color: var(--text-muted); font-size: 0.92rem; }
.search-output { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.search-hit {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.search-hit > a { font-size: 1.05rem; font-weight: 600; }
.hit-section {
  display: inline-block;
  margin-left: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-faint);
}
.hit-snippet {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.search-more-row { padding: 1rem 0; }

@media print {
  .search-page-box, .search-facets, .search-more, .search-more-row { display: none; }
  .search-output mark { background: none; color: #000; font-weight: 700; }
}


/* ---- Block & item imagery -------------------------------------------------- */
/* .spr itself is generated into assets/mc-sprites.css, one class per texture. */
.blockview-btn {
  padding: 2px;
  margin-right: 0.15rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  background: none;
  cursor: pointer;
  line-height: 0;
  vertical-align: middle;
}
.blockview-btn:hover { border-color: var(--accent); }
.blockview-btn[aria-expanded="true"] { border-color: var(--accent); background: var(--bg-elev-2); }

.block3d-row > td { background: var(--bg-elev); }
.block3d {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-start;
  padding: 1rem;
}
.block3d:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
.block3d-head {
  display: flex;
  gap: 1rem;
  align-items: center;
  width: 100%;
  justify-content: space-between;
}
.block3d-hint { flex: 1 1 14rem; margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.block3d-angle { display: block; color: var(--text-faint); font-size: 0.85rem; }

/* Six planes rotated into a cube. perspective on the stage, not the cube, so
   the cube's own transform is free to carry the rotation. */
.cube-stage {
  perspective: 520px;
  padding: 2.2rem 2.6rem;
  touch-action: none;
  cursor: grab;
}
.cube-stage:active { cursor: grabbing; }
.cube3d {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.08s linear;
}
.cube3d .face {
  position: absolute;
  top: 0; left: 0;
  overflow: hidden;
  backface-visibility: hidden;
}

.face-list {
  flex: 1 1 16rem;
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.7rem;
  align-items: center;
  font-size: 0.9rem;
}
.face-list dt { color: var(--text-muted); }
.face-list dd { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .cube3d { transition: none; }
}
@media print {
  .blockview-btn { border: none; }
  .block3d, .block3d-row { display: none; }
}


/* ---- Scrollbars ----------------------------------------------------------- */
/* Firefox / the standard property. */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--sb-thumb) var(--sb-track);
}
/* WebKit and Blink, where "thin" is not enough control. 14px is wide enough
   to grab without a precise pointer; the inset border gives the thumb visual
   padding without shrinking the hit area. */
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track {
  background: var(--sb-track);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb {
  background: var(--sb-thumb);
  border-radius: 8px;
  border: 3px solid var(--sb-track);
  background-clip: padding-box;
  min-height: 2.5rem;
}
::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active { background: var(--sb-thumb-hi); }
::-webkit-scrollbar-corner { background: var(--sb-track); }

/* Wide content scrolls inside its own box; make that obvious rather than
   leaving a reader to discover it by accident. */
.table-wrap:focus-visible,
pre:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
