/* Task Central project page
   White, black, red. Light and dark. */

:root {
  --red: #dc2626;
  --red-hover: #b91c1c;

  --bg: #ffffff;
  --bg-alt: #f6f6f7;
  --text: #101012;
  --muted: #55555c;
  --faint: #8a8a92;
  --line: #e3e3e6;
  --line-strong: #cfcfd4;
  --shot-bg: #eeeef0;
  --code-bg: #f4f4f5;
  --wc-hover: rgba(0, 0, 0, .09);

  --wrap: 1140px;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-alt: #131315;
  --text: #f2f2f4;
  --muted: #a4a4ac;
  --faint: #74747c;
  --line: #26262a;
  --line-strong: #3a3a41;
  --shot-bg: #08080a;
  --code-bg: #17171a;
  --wc-hover: rgba(255, 255, 255, .12);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
p { margin: 0 0 1.05em; }

h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; }

code, pre {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

code {
  font-size: .855em;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .08em .36em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 28px;
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 0; top: 0; z-index: 100;
  background: var(--red); color: #fff; padding: 10px 16px;
}

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 3px; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-weight: 600;
  font-size: .98rem;
}
.brand img { width: 24px; height: auto; }

.topbar-right { display: flex; align-items: center; gap: 18px; }

.gh-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 6px;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.gh-button svg { width: 16px; height: 16px; flex: none; }
.gh-button:hover { background: var(--red); color: #fff; }

.theme-toggle {
  width: 30px; height: 30px;
  border: 0;
  background: none;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: color .15s ease;
}
.theme-toggle:hover { color: var(--red); }
.theme-toggle svg { width: 17px; height: 17px; }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ---------- Masthead ---------- */

.masthead {
  padding: 60px 0 56px;
  border-bottom: 1px solid var(--line);
}

.masthead-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 56px;
  align-items: center;
}

.masthead-logo { width: 54px; height: auto; margin-bottom: 20px; }

.masthead h1 {
  font-size: 2.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

.tagline {
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 46ch;
  margin-bottom: 20px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 0;
  font-family: "JetBrains Mono", monospace;
  font-size: .78rem;
  color: var(--faint);
  margin: 0;
}
.meta span { white-space: nowrap; }
.meta span + span::before {
  content: "/";
  color: var(--line-strong);
  padding: 0 9px;
}

/* ---------- Window frame ---------- */

.win {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-alt);
}

.win-bar {
  display: flex;
  align-items: center;
  padding-left: 14px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}
.win-bar em {
  font-style: normal;
  margin-right: auto;
  font-size: .74rem;
  color: var(--faint);
  font-family: "JetBrains Mono", monospace;
}

/* Windows style caption buttons, aligned right, with the hover fills you get on Windows */
.win-controls { display: flex; align-self: stretch; margin-left: auto; }
.wc {
  width: 42px;
  min-height: 32px;
  position: relative;
  display: block;
  color: var(--muted);
  transition: background .12s ease, color .12s ease;
}
.wc:hover { background: var(--wc-hover); }
.wc-close:hover { background: #e81123; color: #fff; }
.wc::before, .wc::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
.wc-min::before { width: 10px; height: 1px; background: currentColor; }
.wc-max::before { width: 9px; height: 9px; border: 1px solid currentColor; }
.wc-close::before, .wc-close::after { width: 11px; height: 1px; background: currentColor; }
.wc-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.wc-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.wc-close { color: var(--red); }

.masthead-visual .win img {
  width: 100%;
  height: auto;
  background: var(--shot-bg);
}

/* ---------- Document layout ---------- */

.doc-grid {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding-top: 56px;
  padding-bottom: 80px;
}

.toc {
  position: sticky;
  top: 92px;
}
.toc-label {
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 12px;
}
.toc nav { display: flex; flex-direction: column; }
.toc a {
  text-decoration: none;
  color: var(--muted);
  font-size: .89rem;
  padding: 5px 0 5px 12px;
  border-left: 2px solid var(--line);
  transition: color .15s ease, border-color .15s ease;
}
.toc a:hover { color: var(--text); }
.toc a.current { color: var(--red); border-left-color: var(--red); }

/* Prose is held to a readable measure, but the screenshots use the full column. */
.doc { min-width: 0; }
.doc section > *:not(.carousel) { max-width: 68ch; }
#screens > h2 { max-width: none; }

.doc section { margin-bottom: 60px; }
.doc section:last-child { margin-bottom: 0; }

.doc h2 {
  font-size: 1.45rem;
  letter-spacing: -0.015em;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.doc h3 {
  font-size: 1rem;
  margin: 26px 0 8px;
}

.doc p { color: var(--muted); }
.doc h3 + p { margin-top: 0; }

/* Definition list */

.defs { margin: 24px 0 0; }
.defs dt {
  font-weight: 600;
  color: var(--text);
  font-size: .95rem;
  margin-top: 20px;
  padding-left: 13px;
  border-left: 2px solid var(--red);
}
.defs dt:first-child { margin-top: 0; }
.defs dd {
  margin: 5px 0 0 13px;
  color: var(--muted);
  font-size: .96rem;
}

/* Ordered steps */

.steps { margin: 18px 0 0; padding-left: 22px; color: var(--muted); }
.steps li { margin-bottom: 10px; padding-left: 4px; }
.steps li::marker { color: var(--red); font-family: "JetBrains Mono", monospace; font-size: .82em; }
.steps b { color: var(--text); font-weight: 600; }

/* Plain notes list */

.notes { margin: 18px 0 0; padding-left: 20px; color: var(--muted); font-size: .96rem; }
.notes li { margin-bottom: 7px; }
.notes li::marker { color: var(--line-strong); }

/* Spec table */

.spec {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
  font-size: .95rem;
}
.spec th, .spec td {
  text-align: left;
  vertical-align: top;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.spec th {
  width: 118px;
  font-weight: 600;
  padding-right: 20px;
  white-space: nowrap;
}
.spec td { color: var(--muted); }
.spec tr:last-child th, .spec tr:last-child td { border-bottom: 0; }

/* Terminal */

.terminal { background: #0d0d0f; border-color: #26262a; margin: 22px 0; }
.terminal .win-bar { background: #17171a; border-bottom-color: #26262a; }
.terminal .win-bar em { color: #6b6b74; }
.terminal .wc { color: #8b8b95; }
.terminal .wc:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.terminal .wc-close { color: var(--red); }
.terminal .wc-close:hover { background: #e81123; color: #fff; }

/* Wrap rather than scroll so nothing is hidden off the right edge */
.terminal pre {
  margin: 0;
  padding: 20px 18px;
  font-size: .785rem;
  line-height: 1.8;
  color: #e4e4e7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.terminal code { background: none; border: 0; padding: 0; font-size: inherit; }

/* ---------- Carousel ---------- */

.carousel {
  --stage-h: clamp(300px, 50vh, 480px);
  --stage-pad: 16px;
  margin-top: 20px;
}

.stage { display: flex; align-items: center; gap: 12px; }

.viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--shot-bg);
}

.track {
  display: flex;
  transition: transform .35s ease;
  will-change: transform;
}

.slide {
  flex: 0 0 100%;
  min-width: 0;
  height: var(--stage-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--stage-pad);
}

/* Bounded on both axes so a screenshot is never cropped */
.slide img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(var(--stage-h) - (var(--stage-pad) * 2));
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
}

.arrow {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.arrow:hover { color: var(--red); border-color: var(--red); }
.arrow svg { width: 17px; height: 17px; }

.caption-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 14px 44px 0;
}
.caption { font-size: .91rem; color: var(--muted); margin: 0; }
.caption b { color: var(--text); font-weight: 600; margin-right: 7px; }

.counter {
  font-family: "JetBrains Mono", monospace;
  font-size: .78rem;
  color: var(--faint);
  flex: none;
}

.thumbs {
  display: flex;
  gap: 8px;
  margin: 16px 44px 0;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.thumbs::-webkit-scrollbar { height: 5px; }
.thumbs::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

.thumb {
  flex: 0 0 80px;
  height: 52px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--shot-bg);
  cursor: pointer;
  opacity: .55;
  transition: opacity .15s ease, border-color .15s ease;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb:hover { opacity: .85; }
.thumb.active { opacity: 1; border-color: var(--red); }

/* ---------- Roadmap ---------- */

.lead-item {
  border: 1px solid var(--line);
  border-left: 2px solid var(--red);
  border-radius: 0 6px 6px 0;
  padding: 22px 24px;
  margin: 24px 0 30px;
  background: var(--bg-alt);
}
.lead-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 8px;
}
.lead-item h3 { margin: 0 0 10px; font-size: 1.12rem; }
.lead-item > p:last-of-type { margin-bottom: 0; }
.lead-item .notes { margin-top: 14px; }
.notes b { color: var(--text); font-weight: 600; }

/* ---------- Contact form ---------- */

.contact-form { margin-top: 24px; }

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}

.field { display: block; margin: 0 0 16px; }

.field label {
  display: block;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .14);
}

/* Only flag a field once the visitor has actually interacted with it */
.field input:user-invalid,
.field select:user-invalid,
.field textarea:user-invalid { border-color: var(--red); }

.select-wrap { position: relative; display: block; }
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  cursor: pointer;
}
.select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

/* Honeypot */
.contact-form input[name="_gotcha"] {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.submit-button {
  font: inherit;
  font-size: .93rem;
  font-weight: 600;
  color: #fff;
  background: var(--red);
  border: 0;
  border-radius: 6px;
  padding: 11px 24px;
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}
.submit-button:hover { background: var(--red-hover); }
.submit-button[disabled] { opacity: .6; cursor: default; }

.form-status { font-size: .88rem; color: var(--muted); }
.form-status.error { color: var(--red); }

/* ---------- Manual section ---------- */

.manual-link {
  font: inherit;
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 6px 2px;
  cursor: pointer;
  transition: color .15s ease;
}
.manual-link:hover { color: var(--red); }

.manual-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-alt);
  padding: 22px 24px;
  margin: 22px 0;
}
.manual-card-text h3 { font-size: 1.02rem; margin: 0 0 4px; }
.manual-card-text p { margin: 0; color: var(--muted); font-size: .9rem; }

.manual-open {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  color: #fff;
  background: var(--red);
  border: 0;
  border-radius: 6px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background .15s ease;
}
.manual-open:hover { background: var(--red-hover); }
.manual-open svg { width: 18px; height: 18px; }

.manual-note { font-size: .92rem; }

/* ---------- Manual viewer ---------- */

.manual-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  padding: 28px;
  background: rgba(6, 6, 8, .62);
}
.manual-modal[hidden] { display: none; }

.mm-window {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1120px;
  margin: auto;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}

.mm-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}
.mm-bar img { width: 18px; height: auto; }
.mm-heading {
  margin: 0;
  font-size: .86rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mm-bar-tools { display: flex; align-items: stretch; margin-left: auto; }

.mm-close {
  border: 0;
  padding: 0;
  cursor: pointer;
  background: none;
  min-height: 36px;
}

.mm-toc-toggle {
  display: none;
  font: inherit;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 0 14px;
  cursor: pointer;
}
.mm-toc-toggle:hover { color: var(--red); }

.mm-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 262px minmax(0, 1fr);
}

/* Contents sidebar */

.mm-toc {
  border-right: 1px solid var(--line);
  background: var(--bg-alt);
  overflow-y: auto;
  padding: 14px 0 24px;
  display: flex;
  flex-direction: column;
}

.mm-search {
  position: relative;
  padding: 0 14px 12px;
  flex: none;
}
.mm-search svg {
  position: absolute;
  left: 25px;
  top: 9px;
  width: 14px;
  height: 14px;
  color: var(--faint);
  pointer-events: none;
}
.mm-search input {
  width: 100%;
  font: inherit;
  font-size: .85rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 6px 10px 6px 30px;
}
.mm-search input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .14);
}

.mm-toc nav { display: block; padding: 0 10px; }

.mm-toc .toc-h2 {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 4px;
}

.mm-toc a {
  display: block;
  text-decoration: none;
  color: var(--muted);
  font-size: .855rem;
  line-height: 1.4;
  padding: 6px 8px;
  border-radius: 5px;
  transition: background .12s ease, color .12s ease;
}
.mm-toc a:hover { background: var(--bg); color: var(--text); }
.mm-toc a.current { color: var(--red); font-weight: 600; }

.mm-toc .toc-h2 > a { flex: 1; min-width: 0; }

.mm-toc .toc-expand {
  flex: none;
  width: 22px;
  height: 22px;
  border: 0;
  background: none;
  color: var(--faint);
  border-radius: 4px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.mm-toc .toc-expand:hover { background: var(--bg); color: var(--text); }
.mm-toc .toc-expand svg {
  width: 13px;
  height: 13px;
  transition: transform .16s ease;
}
.mm-toc .toc-group.open .toc-expand svg { transform: rotate(90deg); }

.mm-toc .toc-sub { display: none; margin: 0 0 4px 12px; padding-left: 8px; border-left: 1px solid var(--line); }
.mm-toc .toc-group.open .toc-sub { display: block; }
.mm-toc .toc-sub a { font-size: .82rem; color: var(--faint); padding: 4px 8px; }
.mm-toc .toc-sub a:hover { color: var(--text); }

.mm-noresult { margin: 4px 24px; color: var(--faint); font-size: .84rem; }

/* Document pane */

.mm-content {
  overflow-y: auto;
  padding: 30px 44px 80px;
  scroll-behavior: smooth;
}
.mm-content:focus { outline: none; }

.mm-loading, .mm-error { color: var(--muted); font-size: .95rem; }
.mm-error b { display: block; color: var(--text); margin-bottom: 4px; }

.mm-doc { max-width: 74ch; }

.mm-doc h2 {
  font-size: 1.32rem;
  letter-spacing: -0.015em;
  margin: 42px 0 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 12px;
}
.mm-doc > h2:first-child { margin-top: 0; }
.mm-doc h3 {
  font-size: 1.02rem;
  margin: 28px 0 8px;
  scroll-margin-top: 12px;
}
.mm-doc h4 {
  font-size: .93rem;
  margin: 20px 0 6px;
  color: var(--text);
  scroll-margin-top: 12px;
}

.mm-doc p { color: var(--muted); font-size: .95rem; margin: 0 0 1em; }
.mm-doc ul, .mm-doc ol { color: var(--muted); font-size: .95rem; padding-left: 22px; margin: 0 0 1em; }
.mm-doc li { margin-bottom: 6px; }
.mm-doc li::marker { color: var(--line-strong); }
.mm-doc ol > li::marker { color: var(--red); font-size: .85em; }
.mm-doc ul ul, .mm-doc ul ol, .mm-doc ol ul, .mm-doc ol ol { margin: 6px 0 0; }
.mm-doc strong { color: var(--text); font-weight: 600; }
.mm-doc a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }

.mm-doc .table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
.mm-doc table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.mm-doc th, .mm-doc td {
  text-align: left;
  vertical-align: top;
  padding: 9px 14px 9px 0;
  border-bottom: 1px solid var(--line);
}
.mm-doc th { font-weight: 600; white-space: nowrap; }
.mm-doc td { color: var(--muted); }

.mm-doc .code-block {
  position: relative;
  background: #0d0d0f;
  border: 1px solid #26262a;
  border-radius: 6px;
  margin: 0 0 1.2em;
  overflow: hidden;
}
.mm-doc .code-lang {
  display: block;
  padding: 6px 14px;
  background: #17171a;
  border-bottom: 1px solid #26262a;
  color: #6b6b74;
  font-family: "JetBrains Mono", monospace;
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.mm-doc pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: .8rem;
  line-height: 1.7;
  color: #e4e4e7;
}
.mm-doc pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }

.mm-top {
  position: absolute;
  right: 46px;
  bottom: 46px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
  transition: color .15s ease, border-color .15s ease;
}
.mm-top:hover { color: var(--red); border-color: var(--red); }
.mm-top[hidden] { display: none; }
.mm-top svg { width: 18px; height: 18px; }

@media (max-width: 900px) {
  .manual-modal { padding: 0; }
  .mm-window { max-height: 100%; border-radius: 0; border: 0; }
  .mm-main { grid-template-columns: minmax(0, 1fr); }
  .mm-toc-toggle { display: block; }
  .mm-toc {
    display: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 55%;
  }
  .mm-toc.open { display: flex; }
  .mm-content { padding: 22px 20px 60px; }
  .mm-top { right: 18px; bottom: 18px; }
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 14px);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: calc(100% - 36px);
  max-width: 460px;
  padding: 15px 16px 17px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .22);
  overflow: hidden;
  opacity: 0;
  transition: opacity .28s ease, transform .28s ease;
}
.toast[hidden] { display: none; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

.toast-mark {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  margin-top: 1px;
}
.toast-mark svg { width: 14px; height: 14px; }

.toast-body { font-size: .9rem; color: var(--muted); line-height: 1.55; }
.toast-body b { display: block; color: var(--text); font-weight: 600; font-size: .95rem; }

.toast-close {
  flex: none;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--faint);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  margin-left: 2px;
  transition: background .12s ease, color .12s ease;
}
.toast-close:hover { background: var(--bg-alt); color: var(--text); }
.toast-close svg { width: 15px; height: 15px; }

.toast-timer {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: var(--red);
  transform-origin: left center;
}
.toast.counting .toast-timer { animation: toast-countdown 7s linear forwards; }

@keyframes toast-countdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
  .toast.counting .toast-timer { animation: none; }
}

/* ---------- Screenshot viewer ---------- */

.zoomable { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #08080a;
}
.lightbox[hidden] { display: none; }

.lb-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.lb-title {
  margin: 0;
  color: #f2f2f4;
  font-size: .9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.lb-tools button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: #c8c8d0;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: background .12s ease, color .12s ease;
}
.lb-tools button:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.lb-tools button:disabled { opacity: .35; cursor: default; background: none; }
.lb-tools button svg { width: 18px; height: 18px; }
.lb-tools .lb-close:hover { background: #e81123; color: #fff; }

.lb-level {
  font-family: "JetBrains Mono", monospace;
  font-size: .78rem;
  color: #a0a0aa;
  min-width: 52px;
  text-align: center;
}

.lb-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 20px;
  cursor: grab;
  overscroll-behavior: contain;
}
.lb-stage.dragging { cursor: grabbing; }
.lb-stage img {
  display: block;
  max-width: none;
  background: #fff;
  border-radius: 3px;
  user-select: none;
  -webkit-user-drag: none;
}

.lb-hint {
  flex: none;
  margin: 0;
  padding: 10px 16px 14px;
  text-align: center;
  color: #6f6f79;
  font-size: .76rem;
}

@media (max-width: 680px) {
  .lb-hint { display: none; }
  .lb-title { font-size: .82rem; }
}

/* ---------- Closing ---------- */

.closing {
  border-top: 1px solid var(--line);
  padding-top: 30px;
}

.repo-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  font-size: .86rem;
  transition: background .15s ease;
}
.repo-button:hover { background: var(--red-hover); }
.repo-button svg { width: 16px; height: 16px; flex: none; }

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  padding: 26px 0;
}
.footer-inner { display: flex; align-items: center; gap: 11px; }
.footer-inner img { width: 18px; height: auto; opacity: .9; }
.footer-inner p { margin: 0; color: var(--faint); font-size: .84rem; }

/* ---------- Responsive ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .track { transition: none; }
}

@media (max-width: 940px) {
  .masthead { padding: 44px 0 40px; }
  .masthead-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .tagline { max-width: none; }

  .doc-grid { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 40px; }
  .toc {
    position: static;
    margin-bottom: 40px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--line);
  }
  .toc nav { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; }
  .toc-label { flex-basis: 100%; margin-bottom: 4px; }
  .toc a { border-left: 0; padding: 2px 0; }
  .toc a.current { border-left: 0; }
  .doc { max-width: none; }
}

@media (max-width: 680px) {
  .wrap { padding: 0 18px; }
  .repo-link span { display: none; }
  .masthead h1 { font-size: 1.9rem; }
  .carousel { --stage-h: clamp(250px, 50vh, 400px); --stage-pad: 10px; }
  .arrow { display: none; }
  .caption-row, .thumbs { margin-left: 0; margin-right: 0; }
  .thumb { flex: 0 0 68px; height: 46px; }
  .spec th { width: auto; display: block; padding-bottom: 2px; border-bottom: 0; }
  .spec td { display: block; padding-top: 0; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .lead-item { padding: 18px 16px; }
  .toast { bottom: 16px; }
}
