/* KeyRota documentation (/documentation/): Windows 11 NavigationView on the left, the article on the content layer,
   "On this page" on the right of wide windows. Tokens, buttons, header and footer come from site.css; nothing here
   is set from markup (the server's CSP allows styles from 'self' only). */

:root {
  --doc-text: rgba(255, 255, 255, .86);
  --doc-width: 860px;
  /* Code colours: the dark theme of Visual Studio Code / Windows Terminal. */
  --code-key: #569cd6;
  --code-prop: #9cdcfe;
  --code-str: #ce9178;
  --code-num: #b5cea8;
  --code-com: #6a9955;
  --code-tog: #c586c0;
  --critical-back: #442726;
}

/* --- layout -------------------------------------------------------------------------------------------- */
.docs {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 40px;
  width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 16px;
}
@media (min-width: 640px) { .docs { padding: 0 32px; } }
@media (min-width: 1008px) { .docs { grid-template-columns: 248px minmax(0, 1fr); padding: 0 40px 0 16px; } }
@media (min-width: 1280px) { .docs { grid-template-columns: 248px minmax(0, 1fr) 208px; } }

/* --- NavigationView pane --------------------------------------------------------------------------------- */
.docs-nav { padding: 24px 0 8px; }
@media (min-width: 1008px) {
  .docs-nav {
    position: sticky; top: 48px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto;
    padding: 28px 8px 32px 0; scrollbar-width: thin; scrollbar-color: var(--control-strong) transparent;
  }
}
.docs-nav-title { margin: 0 0 8px; padding: 0 12px; font: 600 14px/20px var(--font-text); }
.docs-nav-title a { color: var(--text-1); }
.docs-nav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.docs-nav-list a {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 36px; padding: 8px 12px;
  border-radius: var(--r-control); color: var(--text-1); line-height: 20px;
  transition: background-color var(--t-fade) linear;
}
.docs-nav-list a:hover { background: var(--subtle-hover); text-decoration: none; }
.docs-nav-list a:active { background: var(--subtle-pressed); color: var(--text-2); }
.docs-nav-list a[aria-current] { background: var(--subtle-hover); }
.docs-nav-list a[aria-current]::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 16px; margin-top: -8px;
  border-radius: 2px; background: var(--accent);
}
.docs-nav-list .icon { color: var(--text-2); }
.docs-nav-list a[aria-current] .icon { color: var(--accent-text); }

/* Narrow windows: the pane becomes a flyout under the header (NavigationView LeftMinimal), opened by "Sections". */
.docs-nav-toggle { display: none; margin: 0 0 16px; }
@media (max-width: 1007px) {
  .js .docs-nav-toggle { display: inline-flex; }
  .js .docs-nav { display: none; }
  .js .docs-nav.open {
    display: block; position: fixed; z-index: 25; top: 48px; left: 0; bottom: 0; width: min(320px, 86vw);
    overflow-y: auto; padding: 16px 8px 24px; background: var(--flyout);
    border-right: 1px solid var(--surface-stroke); box-shadow: var(--shadow-flyout);
    animation: docs-pane-in var(--t-normal) var(--ease-in);
  }
}
@keyframes docs-pane-in { from { transform: translateX(-16px); opacity: 0; } }

/* --- the article ------------------------------------------------------------------------------------------ */
.docs-main { min-width: 0; padding: 24px 0 56px; }
@media (min-width: 1008px) { .docs-main { padding: 32px 0 80px; } }
.docs-article { max-width: var(--doc-width); container-type: inline-size; color: var(--doc-text); }

.docs-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0 0 12px; font: 400 12px/16px var(--font-small); color: var(--text-3); }
.docs-crumbs a { color: var(--text-2); }
.docs-crumbs .icon { width: 12px; height: 12px; color: var(--text-3); }
.docs-crumbs span[aria-hidden] { padding: 0 2px; color: var(--text-3); }

.docs-article h1 { margin: 0 0 4px; font: 600 28px/36px var(--font-display); color: var(--text-1); }
@media (min-width: 640px) { .docs-article h1 { font-size: 40px; line-height: 52px; } }
.docs-updated { margin: 0 0 20px; font: 400 12px/16px var(--font-small); color: var(--text-3); }
.docs-article p.lead { font-size: 18px; line-height: 26px; color: var(--text-2); margin-bottom: 24px; }
.docs-article h2 { margin: 48px 0 12px; font: 600 28px/36px var(--font-display); color: var(--text-1); }
.docs-article h3 { margin: 32px 0 8px; font: 600 20px/28px var(--font-display); color: var(--text-1); }
.docs-article h4 { margin: 24px 0 8px; font: 600 16px/22px var(--font-text); color: var(--text-1); }
@media (max-width: 639px) { .docs-article h2 { font-size: 24px; line-height: 32px; margin-top: 40px; } }
.docs-article h2, .docs-article h3 { scroll-margin-top: 16px; }
.docs-article .anchor {
  display: inline-block; margin-left: 8px; padding: 0 4px; border-radius: var(--r-control);
  font: 400 .8em/1 var(--font-text); color: var(--text-3); opacity: 0; transition: opacity var(--t-fade) linear;
}
.docs-article h2:hover .anchor, .docs-article h3:hover .anchor, .docs-article .anchor:focus-visible { opacity: 1; }
.docs-article .anchor:hover { color: var(--accent-text); text-decoration: none; }
@media (hover: none) { .docs-article .anchor { display: none; } }

.docs-article p { margin: 0 0 12px; line-height: 22px; }
.docs-article ul, .docs-article ol { margin: 0 0 12px; padding-left: 22px; }
.docs-article li { margin: 4px 0; line-height: 22px; }
.docs-article li > ul, .docs-article li > ol { margin: 4px 0 0; }
.docs-article strong { color: var(--text-1); }
.docs-article a { color: var(--accent-text); }
.docs-article :not(pre) > code {
  padding: 1px 5px; border-radius: var(--r-control); font-size: 12.5px;
  color: var(--text-1); background: var(--control); border: 1px solid var(--control-stroke); overflow-wrap: anywhere;
}
.docs-article a code { color: var(--accent-text); }

/* Tables: a card with dividers between the rows; wide tables scroll inside the card. */
.table-wrap {
  margin: 16px 0 20px; overflow-x: auto; border-radius: var(--r-overlay);
  background: var(--card); border: 1px solid var(--card-stroke-visible);
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.table-wrap th {
  padding: 10px 12px; text-align: left; vertical-align: bottom; font-weight: 600; color: var(--text-1);
  border-bottom: 1px solid var(--divider); background: var(--card-2);
}
.table-wrap td { padding: 10px 12px; vertical-align: top; border-top: 1px solid var(--divider); }
.table-wrap tbody tr:first-child td { border-top: 0; }
.table-wrap td:first-child { color: var(--text-1); }
.table-wrap :not(pre) > code { white-space: nowrap; }
@media (max-width: 639px) { .table-wrap table { min-width: 520px; } .table-wrap :not(pre) > code { white-space: normal; } }

/* Code: a card with a title bar and a copy button; long code scrolls inside. */
.codeblock {
  margin: 16px 0 20px; overflow: hidden; border-radius: var(--r-overlay);
  background: var(--control-input); border: 1px solid var(--card-stroke-visible);
}
.codeblock-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px;
  padding: 4px 4px 4px 16px; background: var(--card); border-bottom: 1px solid var(--divider);
}
.codeblock-title { font: 600 12px/16px var(--font-small); color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codeblock-copy { flex: none; min-height: 30px; padding: 4px 10px 5px; font-size: 13px; }
.codeblock-copy.done .icon { color: var(--success); }
.codeblock .code {
  margin: 0; max-height: 640px; overflow: auto; border: 0; border-radius: 0; background: transparent;
  font: 400 13px/20px var(--font-mono); color: var(--text-1); tab-size: 4;
  scrollbar-width: thin; scrollbar-color: var(--control-strong) transparent;
}
.codeblock .code-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.codeblock .ln { display: block; }
.codeblock .code .k { color: var(--code-key); }
.codeblock .code .p { color: var(--code-prop); }
.codeblock .code .s { color: var(--code-str); }
.codeblock .code .n { color: var(--code-num); }
.codeblock .code .c { color: var(--code-com); }
.codeblock .code .t { color: var(--code-tog); }
.codeblock.prompt { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.codeblock.prompt .codeblock-copy { min-height: 30px; }
.codeblock.prompt .code { max-height: 520px; }

/* Text and JSON side by side when the article is wide enough, one under the other otherwise. */
.code-pair { display: grid; gap: 12px; margin: 16px 0 20px; }
.code-pair > .codeblock { margin: 0; min-width: 0; }
@container (min-width: 760px) {
  .code-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  /* Two columns: long lines wrap instead of hiding half of the JSON behind a scroll bar. */
  .code-pair .code { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 18px; }
  .code-pair .ln { padding-left: 4ch; text-indent: -4ch; }
}

/* InfoBar-like callouts. */
.callout {
  display: flex; align-items: flex-start; gap: 12px; margin: 16px 0 20px; padding: 14px 16px;
  border-radius: var(--r-overlay); background: var(--solid-senary); border: 1px solid var(--card-stroke-visible);
}
.callout-icon { margin-top: 3px; color: var(--accent); }
.callout-tip { background: var(--success-back); }
.callout-tip .callout-icon { color: var(--success); }
.callout-warning { background: var(--caution-back); }
.callout-warning .callout-icon { color: var(--caution); }
.callout-body { min-width: 0; }
.callout-title { margin: 0 0 2px; font-weight: 600; color: var(--text-1); }
.callout-body > :last-child { margin-bottom: 0; }

/* Numbered steps. */
ol.doc-steps { list-style: none; counter-reset: step; margin: 16px 0 20px; padding: 0; display: grid; gap: 12px; }
ol.doc-steps > li { counter-increment: step; position: relative; margin: 0; padding-left: 40px; min-height: 28px; }
ol.doc-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -3px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font: 600 13px/1 var(--font-small); color: var(--text-1);
  background: var(--control); border: 1px solid var(--control-stroke);
}

/* Link cards. */
.doc-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: 16px 0 20px; }
.doc-card {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 4px 12px; padding: 16px;
  border-radius: var(--r-overlay); background: var(--card); border: 1px solid var(--card-stroke-visible);
  color: var(--text-1); transition: background-color var(--t-fade) linear;
}
.docs-article a.doc-card, .docs-chooser a.doc-card { color: var(--text-1); }
.doc-card:hover { background: var(--card-hover); text-decoration: none; }
.doc-card:active { background: var(--control-pressed); }
.doc-card .icon { grid-row: 1 / span 2; color: var(--accent-text); }
.doc-card-title { font-weight: 600; }
.doc-card-text { font: 400 12px/16px var(--font-small); color: var(--text-2); }

/* Screenshots of the app. */
.shot { margin: 16px 0 24px; }
.shot-link { display: block; border-radius: var(--r-overlay); }
.shot img {
  width: 100%; height: auto; border-radius: var(--r-overlay); border: 1px solid var(--surface-stroke);
  background: var(--base-alt); box-shadow: 0 8px 16px rgba(0, 0, 0, .26);
}
.shot figcaption { margin-top: 8px; font: 400 12px/16px var(--font-small); color: var(--text-3); }

/* Expander. */
.expander { margin: 16px 0 20px; border-radius: var(--r-control); background: var(--card); border: 1px solid var(--card-stroke-visible); }
.expander summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 48px; padding: 12px 16px; cursor: pointer; font-weight: 600; color: var(--text-1); border-radius: var(--r-control);
}
.expander summary::-webkit-details-marker { display: none; }
.expander summary:hover { background: var(--subtle-hover); }
.expander summary .icon { color: var(--text-2); transition: transform var(--t-fast) var(--ease-in); }
.expander[open] summary .icon { transform: rotate(180deg); }
.expander-body { padding: 12px 16px 16px; border-top: 1px solid var(--divider); }
.expander-body .codeblock { margin: 0; }

/* The language note: a page not translated into the site language yet is shown in English. */
.docs-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; max-width: var(--doc-width);
  margin: 0 0 16px; padding: 12px 16px; border-radius: var(--r-overlay);
  background: var(--solid-senary); border: 1px solid var(--card-stroke-visible); color: var(--text-1);
}
.docs-note[hidden] { display: none; }
.docs-note .icon { color: var(--accent); }
.docs-note > span { flex: 1 1 0; min-width: 180px; }

/* Previous / next. */
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: var(--doc-width); margin-top: 48px; }
.pager {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: var(--r-overlay);
  background: var(--card); border: 1px solid var(--card-stroke-visible); color: var(--text-1);
  transition: background-color var(--t-fade) linear;
}
.pager:hover { background: var(--card-hover); text-decoration: none; }
.pager-next { grid-column: 2; text-align: right; }
.pager-label { font: 400 12px/16px var(--font-small); color: var(--text-3); }
.pager-title { font-weight: 600; color: var(--accent-text); }
@media (max-width: 639px) { .docs-pager { grid-template-columns: 1fr; } .pager-next { grid-column: 1; } }

/* --- "On this page" ------------------------------------------------------------------------------------- */
.docs-toc { display: none; }
@media (min-width: 1280px) {
  .docs-toc {
    display: block; position: sticky; top: 48px; align-self: start; max-height: calc(100vh - 48px); overflow-y: auto;
    padding: 40px 0 32px; scrollbar-width: thin; scrollbar-color: var(--control-strong) transparent;
  }
}
.docs-toc-title { margin: 0 0 8px; font: 600 12px/16px var(--font-small); color: var(--text-1); }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--divider); }
.docs-toc a {
  display: block; margin-left: -1px; padding: 4px 0 4px 12px; border-left: 2px solid transparent;
  font: 400 12px/16px var(--font-small); color: var(--text-2);
}
.docs-toc .toc-l3 a { padding-left: 24px; color: var(--text-3); }
.docs-toc a:hover { color: var(--text-1); text-decoration: none; }
.docs-toc a[aria-current] { color: var(--text-1); border-left-color: var(--accent); }

/* The header link of the documentation: the NavigationView mark under it on wide windows. */
@media (min-width: 1101px) {
  .nav a.docs-current::after {
    content: ""; position: absolute; left: 50%; bottom: 2px; width: 16px; height: 3px; margin-left: -8px;
    border-radius: 2px; background: var(--accent);
  }
}

/* /documentation/: language choice (the script in <head> forwards to the site language). */
.docs-chooser h1 { margin: 0 0 20px; font: 600 28px/36px var(--font-display); }
.docs-chooser .doc-cards { max-width: 640px; }
.docs-chooser-files { display: flex; flex-wrap: wrap; gap: 8px 16px; font: 400 12px/16px var(--font-small); }

.copy-buffer { position: fixed; left: -9999px; top: 0; opacity: 0; }

/* --- the Advanced rotation group in the pane: its pages show while one of them is open ----------------------- */
.docs-nav-chevron { margin-left: auto; color: var(--text-3); }
.docs-nav-sub { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 2px; }
.docs-nav-sub a { padding-left: 40px; }
.docs-nav-sub .icon { width: 16px; height: 16px; }

/* --- the overview: big cards (Fluent SettingsCard-like) ----------------------------------------------------- */
.hub-cards { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin: 24px 0 8px; }
@media (min-width: 720px) { .hub-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.docs-article a.hub-card {
  display: flex; align-items: center; gap: 16px; min-height: 104px; padding: 20px;
  border-radius: var(--r-overlay); background: var(--card); border: 1px solid var(--card-stroke-visible); color: var(--text-1);
  transition: background var(--t-fast) var(--ease-in);
}
.docs-article a.hub-card:hover { background: var(--card-hover); text-decoration: none; }
.docs-article a.hub-card:active { background: var(--control-pressed); }
.hub-icon {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: var(--r-overlay);
  background: var(--control); border: 1px solid var(--control-stroke); color: var(--accent-text);
}
.hub-icon .icon { width: 24px; height: 24px; }
.hub-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hub-title { font: 600 20px/28px var(--font-display); }
.hub-text { font-size: 14px; line-height: 20px; color: var(--text-2); }
.hub-chevron { margin-left: auto; color: var(--text-3); }

/* --- screenshots of the main window and the quick settings panel ------------------------------------------ */
.shot-app { max-width: 380px; }
.shot-panel { width: max-content; max-width: 100%; }
.shot-panel img { width: auto; }
.shot-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; margin: 16px 0 24px; }
.shot-row .shot { margin: 0; flex: 0 1 380px; min-width: 0; }
.shot-row .shot-panel { flex: none; }
.shot-missing {
  display: grid; place-items: center; min-height: 160px; padding: 16px; border-radius: var(--r-overlay);
  border: 1px dashed var(--control-strong); color: var(--text-3); font: 400 12px/16px var(--font-small); text-align: center;
}

/* --- the step-through: one screenshot at a time; without scripts a row that scrolls sideways ---------------- */
.slides {
  margin: 24px 0 32px; padding: 16px 16px 8px; border-radius: var(--r-overlay);
  background: var(--card); border: 1px solid var(--card-stroke-visible);
}
.slides-track {
  position: relative; display: flex; gap: 16px; margin: 0; padding: 0; list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
}
.slides-track::-webkit-scrollbar { display: none; }
.slides-track:focus-visible { outline: 2px solid var(--text-1); outline-offset: 2px; border-radius: var(--r-control); }
.slide { flex: 0 0 100%; scroll-snap-align: center; }
.slide figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.slide img {
  display: block; width: auto; max-width: 100%; height: auto; max-height: min(660px, 76vh);
  border-radius: var(--r-overlay); border: 1px solid var(--surface-stroke);
}
.slide figcaption { display: flex; align-items: baseline; gap: 10px; max-width: 520px; color: var(--text-1); }
.slide-num {
  display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--on-accent); font: 600 12px/1 var(--font-small);
}
.slides-bar { display: none; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; }
.slides.ready .slides-bar { display: flex; }
.slides-dots { display: flex; align-items: center; gap: 2px; }
.slides-dot {
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: var(--r-control); background: transparent; cursor: pointer;
  display: grid; place-items: center;
}
.slides-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--control-strong);
  transition: width var(--t-fast) var(--ease-in), background var(--t-fast) var(--ease-in);
}
.slides-dot:hover::before { background: var(--text-1); }
.slides-dot[aria-current]::before { width: 16px; border-radius: 3px; background: var(--accent); }
.slides-dot:focus-visible { outline: 2px solid var(--text-1); }
.slides-play { margin-left: 8px; }
@media (max-width: 639px) { .slides { padding: 12px 8px 4px; } .slide img { max-height: 60vh; } }
