/* Page tools for the documents (screen only): Present, Live demo, PDF and theme buttons, the code-name pencil and its
   popover, and the screen viewer. Plus the print rule for the whole set: every PDF is white, whatever the screen theme. */
/* Doc bar: a sticky strip in the page flow (never over content) with the way back, the page title and the tools. */
.dh-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 1px; pointer-events: none; }
.dochead { position: sticky; top: 0; z-index: 890; height: 52px; display: flex; align-items: center; gap: 12px; margin: 0 -16px 24px; padding: 0 16px;
  background: light-dark(rgb(238 241 245 / .88), rgb(9 12 16 / .88)); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .15s, box-shadow .15s; }
.dochead.stuck { border-bottom-color: light-dark(#dde2ea, #2b3540); box-shadow: var(--sh-float, 0 10px 30px -14px rgb(14 18 23 / .3)); }
.dh-title { margin: 0; min-width: 0; font: 600 14px/1.2 var(--display, "Red Hat Display", system-ui, sans-serif); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: light-dark(#11151b, #e9edf2); }
.docback, .docbar { display: flex; align-items: center; gap: 6px; }
.docbar { margin-left: auto; }
body.present .docback, body.present .dochead { display: none; }
.db-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid light-dark(transparent, #3a4654); border-radius: 999px; cursor: pointer;
  font: 600 13px/1 var(--sans, system-ui, sans-serif); color: light-dark(#11151b, #eef1f5); background: transparent; text-decoration: none; }
.db-btn:hover { background: light-dark(#e3e8ee, #26303b); }
.db-btn:focus-visible, .cn-edit:focus-visible { outline: 2px solid #1d5bc2; outline-offset: 2px; }
.db-present, .db-pdf { background: #f5b700; color: #1a1400; border-color: transparent; }
.db-present:hover, .db-pdf:hover { background: #ffc61a; }
.db-theme { width: 34px; padding: 0; justify-content: center; }
.docbar .ico, .docback .ico, .rail .ico, .jump .ico, .cn-edit .ico, .dv .ico, .zoom-hint .ico, .tour-stage .ico { display: inline-block; width: 15px; height: 15px; background-color: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
:is(.docbar, .docback, .cn-edit, .dv, .zoom-hint, .tour-stage) .i-sun { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2'/%3E%3Cpath d='M12 20v2'/%3E%3Cpath d='m4.93 4.93 1.41 1.41'/%3E%3Cpath d='m17.66 17.66 1.41 1.41'/%3E%3Cpath d='M2 12h2'/%3E%3Cpath d='M20 12h2'/%3E%3Cpath d='m6.34 17.66-1.41 1.41'/%3E%3Cpath d='m19.07 4.93-1.41 1.41'/%3E%3C/svg%3E"); }
:is(.docbar, .docback, .cn-edit, .dv, .zoom-hint, .tour-stage) .i-moon { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z'/%3E%3C/svg%3E"); }
:is(.docbar, .docback, .cn-edit, .dv, .zoom-hint, .tour-stage) .i-play { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='6 3 20 12 6 21 6 3'/%3E%3C/svg%3E"); }
:is(.docbar, .docback, .cn-edit, .dv, .zoom-hint, .tour-stage) .i-pause { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='4' width='4' height='16' rx='1'/%3E%3Crect x='14' y='4' width='4' height='16' rx='1'/%3E%3C/svg%3E"); }
:is(.docbar, .docback, .cn-edit, .dv, .zoom-hint, .tour-stage) .i-pencil { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z'/%3E%3Cpath d='m15 5 4 4'/%3E%3C/svg%3E"); }
:is(.docbar, .docback, .cn-edit, .dv, .zoom-hint, .tour-stage) .i-download { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3Cpath d='M12 15V3'/%3E%3C/svg%3E"); }
:is(.docbar, .docback, .cn-edit, .dv, .zoom-hint, .tour-stage) .i-demo { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z'/%3E%3Cpath d='M12 17v4'/%3E%3Cpath d='M8 21h8'/%3E%3Crect x='2' y='3' width='20' height='14' rx='2'/%3E%3C/svg%3E"); }
:is(.docbar, .docback, .cn-edit, .dv, .zoom-hint, .tour-stage) .i-x { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18'/%3E%3Cpath d='m6 6 12 12'/%3E%3C/svg%3E"); }
:is(.docbar, .docback, .cn-edit, .dv, .zoom-hint, .tour-stage) .i-left { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E"); }
:is(.docbar, .docback, .cn-edit, .dv, .zoom-hint, .tour-stage) .i-right { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E"); }
:is(.docbar, .docback, .cn-edit, .dv, .zoom-hint, .tour-stage) .i-zoom { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3Cpath d='M11 8v6'/%3E%3Cpath d='M8 11h6'/%3E%3C/svg%3E"); }
:is(.docbar, .docback, .cn-edit, .dv, .zoom-hint, .tour-stage) .i-globe { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20'/%3E%3Cpath d='M2 12h20'/%3E%3C/svg%3E"); }
.cn-edit { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 4px; padding: 0; vertical-align: -0.2em; border-radius: 6px;
  border: 1px dashed currentColor; background: transparent; color: inherit; opacity: .6; cursor: pointer; }
.cn-edit:hover { opacity: 1; color: #f5b700; }
.cn-edit .ico { width: 11px; height: 11px; }
[data-codename] { border-bottom: 1px dotted currentColor; cursor: help; }
.cn-pop { position: absolute; z-index: 950; width: min(320px, calc(100vw - 16px)); padding: 14px 14px 12px; border-radius: 12px;
  background: light-dark(#fff, #161b21); color: light-dark(#11151b, #e9edf2); border: 1px solid light-dark(#dde2ea, #2a333e);
  box-shadow: 0 16px 40px -12px rgb(0 0 0 / .45); font: 400 13px/1.5 var(--sans, system-ui, sans-serif); text-align: left; }
.cn-pop label { display: block; font-weight: 600; font-size: 13px; }
.cn-pop p { margin: 4px 0 10px; color: light-dark(#4f5a67, #a6b0bd); text-align: left; }
.cn-pop input { width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid light-dark(#c9d0d9, #3a4654); background: light-dark(#fff, #0e1217); color: inherit; font: inherit; }
.cn-pop input:focus { outline: 2px solid #1d5bc2; outline-offset: 1px; }
.cn-actions { display: flex; gap: 8px; margin-top: 10px; }
.cn-actions button { height: 30px; padding: 0 12px; border-radius: 8px; font: 600 13px/1 var(--sans, system-ui, sans-serif); cursor: pointer; border: 1px solid light-dark(#c9d0d9, #3a4654); background: transparent; color: inherit; }
.cn-actions .cn-save { background: #f5b700; color: #1a1400; border-color: transparent; }
@media (max-width: 640px) {
  .dochead { margin: 0; gap: 6px; }
  .dh-title { display: none; }
  .db-btn span { display: none; }
  .db-btn { height: 40px; min-width: 40px; padding: 0; justify-content: center; }
}

/* Motion: buttons press in, the theme icon turns, the code-name popover eases in. Nothing slides, lifts or loops. */
@media screen and (prefers-reduced-motion: no-preference) {
  .db-btn { transition: background-color .15s, transform .15s; }
  .db-btn:active { transform: scale(.96); }
  .db-theme:hover .ico { animation: db-turn .6s cubic-bezier(.22, 1, .36, 1); }
  .cn-edit { transition: transform .18s, opacity .18s, color .18s; } .cn-edit:hover { transform: rotate(-12deg) scale(1.1); }
  .cn-pop { animation: db-pop .22s cubic-bezier(.22, 1, .36, 1) both; }
}
@keyframes db-turn { from { transform: rotate(-90deg) scale(.7); } to { transform: none; } }
@keyframes db-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* Screens drawn in both themes: the page shows the one that matches it (the deck is dark unless switched to light);
   every PDF prints the dark one. */
.v-light { display: none !important; }
@media screen {
  :root[data-theme="light"] .v-dark { display: none !important; }
  :root[data-theme="light"] .v-light { display: block !important; }
  :root[data-theme="light"] .frame:has(> .v-light) { background: #e6eaf0; border-color: #d4dae2; }
}
@media screen and (prefers-color-scheme: light) {
  :root:not([data-theme]):not([data-deck]) .v-dark { display: none !important; }
  :root:not([data-theme]):not([data-deck]) .v-light { display: block !important; }
  :root:not([data-theme]):not([data-deck]) .frame:has(> .v-light) { background: #e6eaf0; border-color: #d4dae2; }
}

/* Screen viewer (docs.js): any screenshot opens full size, with the arrows to walk through every screen on the page.
   Dark in both themes so each screen reads the same; never printed. */
.zoomable { cursor: zoom-in; position: relative; }
.zoomable:focus-visible { outline: 2px solid #f5b700; outline-offset: 3px; border-radius: 12px; }
.zoom-hint { position: absolute; right: 12px; top: 12px; z-index: 3; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 999px;
  background: rgb(14 18 23 / .8); color: #fff; border: 1px solid rgb(255 255 255 / .2); box-shadow: 0 2px 8px rgb(0 0 0 / .4);
  opacity: 0; transform: scale(.85); transition: opacity .18s, transform .18s; pointer-events: none; }
.zoomable:hover .zoom-hint, .zoomable:focus-visible .zoom-hint { opacity: 1; transform: none; }
@media (hover: none) { .zoom-hint { opacity: .9; transform: none; } }
html.dv-open { overflow: hidden; }
.dv { position: fixed; inset: 0; z-index: 2000; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgb(7 9 12 / .95); color: #e9edf2; font: 400 14px/1.5 var(--sans, "Red Hat Text", system-ui, sans-serif); text-align: left; }
.dv[hidden] { display: none; }
.dv-bar { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 1640px; margin: 0 auto; min-height: 38px; }
.dv-title { font: 600 17px/1.3 var(--display, "Red Hat Display", system-ui, sans-serif); color: #fff; }
.dv-count { color: #a6b0bd; font-size: 13px; font-variant-numeric: tabular-nums; }
.dv-tag { font-size: 12px; font-weight: 600; line-height: 1.5; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.dv-tag[hidden] { display: none; }
.dv-tag.live { background: #1c3a30; color: #3ecf8e; } .dv-tag.building { background: #3a3320; color: #f5b700; } .dv-tag.next { background: #7cb6ff; color: #0b1220; }
.dv-tag.planned { background: #1e2c42; color: #7cb6ff; } .dv-tag.later { background: #212a35; color: #b3bdc8; }
.dv-demo { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 999px;
  background: #f5b700; color: #1a1400; font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.dv-demo:hover { background: #ffc61a; }
.dv-demo[hidden] { display: none; }
.dv-close { margin-left: auto; width: 38px; height: 38px; flex: none; }
.dv-demo:not([hidden]) + .dv-close { margin-left: 0; }
.dv-close, .dv-nav { display: grid; place-items: center; padding: 0; border-radius: 999px; border: 1px solid rgb(255 255 255 / .22);
  background: rgb(23 29 37 / .92); color: #fff; cursor: pointer; }
.dv-close:hover, .dv-nav:hover { background: #f5b700; border-color: #f5b700; color: #1a1400; }
.dv-close .ico { width: 18px; height: 18px; }
.dv-stage { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; min-height: 0; }
.dv-nav { width: 46px; height: 46px; }
.dv-nav[hidden] { display: none; }
.dv-nav .ico { width: 22px; height: 22px; }
.dv-img { grid-column: 2; justify-self: center; max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); width: auto; height: auto;
  object-fit: contain; border-radius: 10px; background: #0e1217; box-shadow: 0 0 0 1px rgb(255 255 255 / .1), 0 28px 70px -20px rgb(0 0 0 / .9); }
.dv-cap { margin: 0 auto; max-width: 92ch; color: #c9d1da; font-size: 14px; text-align: center; hyphens: manual; }
.dv :focus-visible { outline: 2px solid #f5b700; outline-offset: 2px; }
@media (max-width: 640px) {
  .dv-stage { grid-template-columns: minmax(0, 1fr); position: relative; }
  .dv-img { grid-column: 1; }
  .dv-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; z-index: 1; }
  .dv-prev { left: 4px; } .dv-next { right: 4px; }
  .dv-demo span { display: none; } .dv-demo { padding: 0 10px; }
}
@media (prefers-reduced-motion: no-preference) {
  .dv:not([hidden]) { animation: dv-in .2s ease-out both; }
  .dv:not([hidden]) .dv-img { animation: db-pop .3s cubic-bezier(.22, 1, .36, 1) both; }
}
@keyframes dv-in { from { opacity: 0; } to { opacity: 1; } }

/* Rail and jump menu: the page's sections. A rail beside the sheet from 1200px, a menu under the cover below that. */
.folio { display: block; }
.rail { display: none; }
.rail ol, .jump ol { list-style: none; margin: 0; padding: 0; }
.rail-h { margin: 0 0 8px; font: 600 13px/1.4 var(--sans, system-ui, sans-serif); color: light-dark(#5b6673, #97a2ae); }
.rail a, .jump a { display: block; padding: 6px 10px; border-left: 2px solid light-dark(#dde2ea, #2b3540); font: 400 14px/1.4 var(--sans, system-ui, sans-serif);
  color: light-dark(#3e4854, #b3bdc8); text-decoration: none; }
.rail a:hover, .jump a:hover { color: light-dark(#11151b, #e9edf2); }
.rail a[aria-current="true"], .jump a[aria-current="true"] { color: light-dark(#11151b, #e9edf2); font-weight: 600; border-left-color: #f5b700; }
.rail-g { margin-top: 14px; font: 600 12px/1.4 var(--sans, system-ui, sans-serif); color: light-dark(#5b6673, #97a2ae); }
.rail-n { display: inline-block; min-width: 1.6em; font-variant-numeric: tabular-nums; color: light-dark(#5b6673, #97a2ae); }
.top-link { margin-top: 10px; font-size: 13px; }
@media (min-width: 1200px) {
  .folio { display: grid; grid-template-columns: minmax(0, var(--page, 960px)) var(--rail, 224px); column-gap: 40px; justify-content: center; align-items: start; }
  .rail { display: block; position: sticky; top: 72px; max-height: calc(100dvh - 96px); overflow: auto; }
  .jump { display: none; }
}
.jump { margin: 0 0 24px; }
.jump > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 10px; cursor: pointer; list-style: none;
  background: light-dark(#f3f5f8, #19212a); color: light-dark(#11151b, #e9edf2); font: 600 14px/1 var(--sans, system-ui, sans-serif); }
.jump > summary::-webkit-details-marker { display: none; }
.jump > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; transition: rotate .15s; }
.jump[open] > summary::after { rotate: 225deg; }
.jump ol { columns: 2 220px; column-gap: 24px; padding-top: 8px; }
.jump li { break-inside: avoid; }
.jump a { min-height: 44px; display: flex; align-items: center; }
@media (max-width: 640px) { .jump ol { columns: 1; } }

/* Every PDF is white: dark bands, footers and code blocks turn to paper with ink-coloured text. */
@media print {
  .dochead, .docbar, .docback, .rail, .jump, .cn-edit, .cn-pop, .dv, .zoom-hint { display: none !important; }
  [data-codename] { border: 0; }
  .cover-band, .site-footer, .op-band { background: #fff !important; color: #11151b !important; border: 1px solid #d4dae2; box-shadow: none !important; }
  .cover-band .brand, .site-footer .brand, .op-band .brand, .cover-band h1, .op-band h1, .sf-grid dd { color: #0d1116 !important; }
  .cover-band .lead, .op-band .lead, .sf-tag, .sf-grid dd + dd, .sf-legal, .site-footer, .op-band .shot figcaption, .op-band .faint { color: #303a45 !important; }
  .cover-band { border-top: 2.5pt solid #f5b700 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cb-meta li { background: none !important; border: 0 !important; color: #0d1116 !important; }
  .kicker, .kicker .ico, .cb-meta .ico, .sf-grid dt .ico, .sf-tag .ico, .sf-legal .ico { color: #8a5b00 !important; }
  .sf-grid dt { color: #4d5865 !important; }
  .wl-badge { color: #8a5b00 !important; border-color: #e3c472 !important; }
  .sf-top, .sf-legal, .site-footer a { border-color: #d4dae2 !important; }
  pre { background: #f1f3f7 !important; color: #0d1116 !important; border-color: #d4dae2 !important; }
}
