/* Shared by the dashboard and the login page: the colour-theme switch, the hole
 * "blueprint" background and its small plate. Colours come from kiq-tokens.css,
 * a copy of the website's design tokens, so the Engine follows the same
 * light / dark / system themes as kaddieiq.com. */

/* ---------- theme switch (same look as the website's) ---------- */
.theme { display: flex; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--bg) 70%, transparent); }
.theme button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer; padding: 0; transition: color .25s ease, background-color .25s ease; }
.theme button:hover { color: var(--ink); }
.theme button[aria-checked="true"] { color: var(--gold-hi); background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--tile-edge); }
.theme button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.theme svg { width: 16px; height: 16px; }

/* ---------- background: blueprint of a famous hole ---------- */
.kiq-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: var(--bp-op);
  background-color: var(--bp-ink);
  -webkit-mask: var(--bp-land) center/cover no-repeat; mask: var(--bp-land) center/cover no-repeat; }
@media (max-aspect-ratio: 1/1) { .kiq-bg { -webkit-mask-image: var(--bp-port); mask-image: var(--bp-port); } }

/* ---------- the plate: which hole, and a way to change it ---------- */
.kiq-plate { position: fixed; right: clamp(12px, 2vw, 22px); bottom: 12px; z-index: 30; text-align: right; max-width: 260px;
  font: 400 11.5px/1.35 var(--body); color: var(--muted); padding: 8px 10px; border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); border: 1px solid var(--rule);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.kiq-plate-n { margin: 0; font: var(--fw-title) 12.5px/1.25 var(--head); color: var(--soft); }
.kiq-plate-btn { margin-top: 5px; font: 500 11.5px/1 var(--body); color: var(--gold-hi); background: transparent;
  border: 1px solid var(--rule); border-radius: 999px; padding: 6px 11px; cursor: pointer; }
.kiq-plate-btn:hover { border-color: var(--gold); }
.kiq-plate-btn:focus-visible, .kiq-plate-menu button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.kiq-plate-menu { position: absolute; right: 0; bottom: calc(100% + 8px); width: 250px; max-height: 60vh; overflow: auto; text-align: left;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 14px; padding: 6px; box-shadow: var(--tile-shadow); }
.kiq-plate-menu[hidden] { display: none; }
.kiq-plate-menu button { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 9px;
  padding: 8px 10px; cursor: pointer; color: var(--ink); font: 500 13px/1.3 var(--body); }
.kiq-plate-menu button span { display: block; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.kiq-plate-menu button:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.kiq-plate-menu button[aria-checked="true"] { box-shadow: inset 2px 0 0 var(--gold); }
.kiq-plate-menu hr { border: 0; border-top: 1px solid var(--rule); margin: 6px 4px; }
@media (max-width: 640px) { .kiq-plate-n, .kiq-plate-src { display: none; } }
