/* Light and dark colors. js/theme.js sets data-theme on <html>. */
:root {
  color-scheme: light;
  --page: #fff;
  --frame: #f2f2f2;
  --frame-border: rgba(22, 22, 22, .06);
  --panel: #fafafa;
  --text: #161616;
  --muted: #888;
  --link: #2489ee;
  --link-hover: #126bcc;
  --badge: #eaf4ff;
  --tooltip: #222;
  --tooltip-text: #fff;
  --rail-border: #e6e6e6;
  --tab-hover-text: #333;
  --tab-selected: #fff;
  --scrollbar: #ddd;
  --control-hover: rgba(22, 22, 22, .06);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f0f10;
  --frame: #242426;
  --frame-border: rgba(255, 255, 255, .08);
  --panel: #19191b;
  --text: #f2f2f2;
  --muted: #9a9aa0;
  --link: #5aaeff;
  --link-hover: #8cc6ff;
  --badge: rgba(36, 137, 238, .2);
  --tooltip: #f2f2f2;
  --tooltip-text: #161616;
  --rail-border: #343438;
  --tab-hover-text: #ddd;
  --tab-selected: #19191b;
  --scrollbar: #444;
  --control-hover: rgba(255, 255, 255, .08);
}

/* ---------- Dark overrides for the Figma export ---------- */
:root[data-theme="dark"] body { background-color: var(--page) !important; }
:root[data-theme="dark"] #container [data-breakpoint-id] { background-color: var(--page); }

/* Card front: gray frame artwork, the cutout that shows the page, and shadow. */
:root[data-theme="dark"] #container img[alt="background-image"][src$=".svg"] { filter: brightness(.149); }
:root[data-theme="dark"] #container div:has(> div > div > img[alt="background-image"][src$=".svg"]) {
  box-shadow: 0 16px 24px 5px rgba(0, 0, 0, .5);
}
:root[data-theme="dark"] #container div:has(> div > div > img[alt="background-image"][src$=".svg"]) > :nth-child(2) > div,
:root[data-theme="dark"] #container .card-back-cutout > div { background-color: var(--page); }

/* Without the light rim, which reads as a white border on a dark frame. */
:root[data-theme="dark"] #container div:has(> div > div > img[alt="background-image"][src$=".svg"]) > :nth-child(3) {
  background-image: none;
}
:root[data-theme="dark"] #container div:has(> div > div > img[alt="background-image"][src$=".svg"]) > :nth-child(3) > div:first-child {
  background-color: var(--frame);
}

/* Page text. These generated names set the only dark text colors. */
:root[data-theme="dark"] #container :is(.css-hc4kpu, .css-om0jhk, .css-l6j9af) { color: var(--text); }
:root[data-theme="dark"] #container .css-5vl8yv { color: rgba(242, 242, 242, .7); }
:root[data-theme="dark"] #container :is(.css-e1z5dy, .css-29khxp) { color: rgba(242, 242, 242, .55); }

/* ---------- Toggle in the top right corner, level with the logo ---------- */
.theme-toggle {
  position: fixed;
  z-index: 10000;
  top: 26px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 150ms ease;
}
.theme-toggle:hover { background: var(--control-hover); }
.theme-toggle:focus-visible { outline: 2px solid #7356df; outline-offset: 2px; }
/* Figma's text navigation is gone; the logo leads home. */
#container [data-breakpoint-id] > :is(a, [role="link"]):not(:has(img)) { display: none; }
@media (max-width: 799px) {
  .theme-toggle { top: 12px; right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle { transition: none; }
}

/* ---------- Text cannot be selected ---------- */
body,
#container * {
  -webkit-user-select: none;
  user-select: none;
}
