/* MaksimOS — retro desktop shell */

@font-face {
  font-family: "Pixelify Sans";
  src: url("/fonts/pixelify-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* The OS pixel face: Jersey 15, sized up a little so it sits where Pixelify
   Sans did. (Pixelify's capital C reads as an O at small sizes.) Jersey has
   one weight, so faux-bold is turned off below. */
@font-face {
  font-family: "MaksimOS Pixel";
  src: url("/fonts/jersey-15.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  size-adjust: 118%;
  /* Everything except ™ (Jersey draws it as full-size "TM"); that falls back to Pixelify. */
  unicode-range: U+0000-2121, U+2123-FFFF;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/fonts/ibm-plex-mono-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --desktop: #477d80;
  --window: #f2f0e8;
  --chrome: #c9c9be;
  --text: #242525;
  --title: #263d65;
  --accent: #d98958;
  --border: #515651;
  --highlight: #fff9e9;
  --title-inactive: #7e8682;
  --muted: #5f635e;
  --on-title: #fff9e9;

  /* Chrome that changes with the light/dark theme. */
  --edge: #242525;
  --bevel-hi: #fff9e9;
  --bevel-mid: #e4e2d8;
  --bevel-lo: #515651;
  --field: #fff9e9;
  --pressed: #dddcd2;
  --select: #263d65;
  --select-text: #fff9e9;

  /* iPhones reserve space for the status bar and home bar. The taskbar grows to
     include the bottom one, so its buttons keep their full 36px. */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --taskbar-h: calc(44px + var(--safe-b));
  --display: "MaksimOS Pixel", "Pixelify Sans", "Courier New", monospace;
  --body: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Bevels: raised and sunken, 1px each side. */
  --raised: inset -1px -1px var(--edge), inset 1px 1px var(--bevel-hi), inset -2px -2px var(--bevel-lo), inset 2px 2px var(--bevel-mid);
  --sunken: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--bevel-hi), inset 2px 2px var(--edge), inset -2px -2px var(--bevel-mid);
  --shadow: 3px 3px 0 rgba(36, 37, 37, 0.35);

  /* A tiny ordered-dither tile for the desktop. */
  --dither: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' shape-rendering='crispEdges'%3E%3Crect width='1' height='1' fill='%23000' fill-opacity='.09'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23000' fill-opacity='.09'/%3E%3Crect x='3' y='1' width='1' height='1' fill='%23fff' fill-opacity='.07'/%3E%3C/svg%3E");
  --checker: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2' shape-rendering='crispEdges'%3E%3Crect width='1' height='1' fill='%23242525'/%3E%3Crect x='1' y='1' width='1' height='1' fill='%23242525'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

html {
  background: var(--chrome);
}

/* Installed on iPhone, fixed layers can stop short of the bottom of the screen. */
@media (display-mode: standalone) {
  html,
  body,
  .desktop,
  .screen {
    height: 100vh;
    height: 100lvh;
  }
  .desktop,
  .screen {
    bottom: auto;
  }
}

html {
  /* Every font in use ships its real weights; never fake bold/italic pixels. */
  font-synthesis: none;
}

body {
  overflow: hidden;
  background: #1c1d1d;
  color: var(--text);
  font: 14px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

svg {
  display: block;
  width: 100%;
  height: 100%;
}

.icon-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
}

[data-icon] {
  display: inline-block;
  flex: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 3000;
}

.is-leaving {
  opacity: 0;
  transition: opacity 0.25s steps(4);
}

:focus-visible {
  outline: 1px dotted var(--text);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------------
   Controls
   --------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 84px;
  min-height: 28px;
  padding: 3px 14px;
  border: 0;
  background: var(--chrome);
  box-shadow: var(--raised);
  color: var(--text);
  font: 15px/1 var(--display);
  text-decoration: none;
  cursor: pointer;
}

.btn:active {
  box-shadow: var(--sunken);
  padding: 4px 13px 2px 15px;
}

.btn:focus-visible {
  outline: 1px dotted var(--text);
  outline-offset: -5px;
}

.btn-default {
  box-shadow: 0 0 0 1px var(--edge), var(--raised);
}

.btn:disabled {
  color: var(--muted);
  text-shadow: 1px 1px var(--bevel-hi);
  cursor: default;
}

input[type="radio"] {
  appearance: none;
  display: inline-grid;
  place-content: center;
  width: 14px;
  height: 14px;
  margin: 0;
  border-radius: 50%;
  background: var(--field);
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--chrome), inset 2px 2px var(--edge);
  cursor: pointer;
}

input[type="radio"]:checked::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--text);
  border-radius: 50%;
}

/* ---------------------------------------------------------------------------
   Boot
   --------------------------------------------------------------------------- */

.boot {
  display: grid;
  place-items: center;
  background: #1c1d1d;
  color: var(--highlight);
  cursor: progress;
}

.boot-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.boot-logo {
  width: 96px;
  height: 96px;
  margin-bottom: 14px;
}

.boot-name {
  margin: 0;
  font: 600 40px/1 var(--display);
  letter-spacing: 0.02em;
  text-shadow: 3px 3px 0 var(--title);
}

.boot-tagline {
  margin: 8px 0 28px;
  color: #b9b7ab;
  font-size: 14px;
}

.boot-log {
  width: 290px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
  font-size: 14px;
}

.boot-line {
  visibility: hidden;
}

.boot-line::before {
  content: "> ";
  color: var(--accent);
}

.boot-line.is-shown {
  visibility: visible;
}

.boot-line b {
  float: right;
  color: #9fc08f;
  font-weight: 600;
}

.boot-skip {
  position: absolute;
  bottom: 28px;
  left: 0;
  right: 0;
  margin: 0;
  color: #6f716b;
  font-size: 12px;
  text-align: center;
}

/* ---------------------------------------------------------------------------
   Welcome / log on
   --------------------------------------------------------------------------- */

.welcome {
  display: grid;
  place-items: center;
  overflow: auto;
  background: var(--dither) 0 0 / 4px 4px repeat, radial-gradient(ellipse at 50% 40%, #2f6a65, #1f5452 75%);
  color: var(--highlight);
}

.welcome[data-mode="login"] {
  background: url("/images/wallpapers/riviera-day.webp") center / cover no-repeat, #417279;
}

.welcome[data-mode="loading"] {
  cursor: progress;
}

.welcome-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 12px;
  text-align: center;
}

.welcome-word {
  margin: 0;
  font: 600 clamp(56px, 11vw, 104px)/1 var(--display);
  text-shadow: 4px 4px 0 #13302f;
  animation: rise 0.2s steps(3) both;
}

.welcome-sub {
  margin: 10px 0 0;
  margin-top: 18px;
  font: 400 clamp(16px, 2.4vw, 22px)/1.3 var(--body);
  text-shadow: 1px 1px 0 #13302f;
  animation: rise 0.2s 0.08s steps(3) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.welcome-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.welcome[data-mode="loading"] .welcome-login,
.welcome[data-mode="login"] .welcome-loading {
  display: none;
}

/* Segmented progress bar: cells fill left to right while the desktop loads. */
.progress {
  width: 300px;
  max-width: 80vw;
  height: 28px;
  margin-top: 44px;
  padding: 4px;
  border: 2px solid #cfc9b8;
  background: #1d4b49;
  box-shadow: 0 0 0 1px #173c3a, inset 0 0 0 1px #102b2a;
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background:
    linear-gradient(#1b2f4f, #1b2f4f) top / 100% 1px no-repeat,
    linear-gradient(#1b2f4f, #1b2f4f) bottom / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, #1b2f4f 0 1px, #d3cdbb 1px 14px, #1b2f4f 14px 15px, transparent 15px 17px);
  animation: progress 1.4s steps(16, end) forwards;
}

@keyframes progress {
  to {
    width: 100%;
  }
}

.welcome-status {
  margin: 14px 0 0;
  font-size: 15px;
  text-shadow: 1px 1px 0 #13302f;
}

/* Log-on window */
.window.login-window {
  position: relative;
  width: min(700px, calc(100vw - 24px));
  text-align: left;
}

.login-window .title-bar {
  height: 32px;
  padding-left: 8px;
}

.login-window .title-icon {
  width: 20px;
  height: 20px;
}

.login-window .title-text {
  font-size: 18px;
}

.login-window .tb {
  width: 26px;
  height: 22px;
  background-size: 10px 10px;
}

.login-body {
  padding: 24px 26px 22px;
}

.login-hero {
  display: grid;
  grid-template-columns: auto 2px 1fr;
  align-items: center;
  gap: 30px;
  padding: 0 6px;
}

.login-art {
  width: 160px;
  height: 160px;
}

.login-rule {
  align-self: stretch;
  margin: 6px 0;
  background: var(--bevel-lo);
  box-shadow: 1px 0 var(--bevel-hi);
}

.login-word {
  margin: 0;
  font: 600 clamp(40px, 7vw, 58px)/1 var(--display);
  letter-spacing: 0.01em;
}

.login-sub {
  margin: 10px 0 0;
  font-size: clamp(17px, 2.4vw, 21px);
}

.login-desc {
  max-width: 38ch;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.login-prompt {
  margin: 26px 0 14px;
  text-align: center;
}

.login-legal {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.login-legal a {
  color: inherit;
}

.login-legal a:hover {
  color: var(--text);
}

.login-body .account-note {
  margin: 14px auto 0;
  text-align: center;
}

.account-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.account-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 14px 16px 14px 16px;
  border: 0;
  background: var(--chrome);
  box-shadow: var(--raised), var(--shadow);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.account-tile:hover:not(:disabled) {
  background: var(--highlight);
}

.account-tile:disabled {
  background: var(--chrome);
  color: var(--muted);
  cursor: not-allowed;
}

.account-tile:disabled .account-tile-icon {
  filter: grayscale(1);
  opacity: 0.6;
}

.account-tile:active:not(:disabled) {
  box-shadow: var(--sunken);
  transform: translate(1px, 1px);
}

.account-tile:focus-visible {
  outline: 1px dotted var(--text);
  outline-offset: -6px;
}

.account-tile-icon {
  width: 36px;
  height: 36px;
}

.google-mark {
  display: inline-block;
  flex: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%23EA4335' d='M24 9.5c3.54 0 6.71 1.22 9.21 3.6l6.85-6.85C35.9 2.38 30.47 0 24 0 14.62 0 6.51 5.38 2.56 13.22l7.98 6.19C12.43 13.72 17.74 9.5 24 9.5z'/%3E%3Cpath fill='%234285F4' d='M46.98 24.55c0-1.57-.15-3.09-.38-4.55H24v9.02h12.94c-.58 2.96-2.26 5.48-4.78 7.18l7.73 6c4.51-4.18 7.09-10.36 7.09-17.65z'/%3E%3Cpath fill='%23FBBC05' d='M10.53 28.59c-.48-1.45-.76-2.99-.76-4.59s.27-3.14.76-4.59l-7.98-6.19C.92 16.46 0 20.12 0 24c0 3.88.92 7.54 2.56 10.78l7.97-6.19z'/%3E%3Cpath fill='%2334A853' d='M24 48c6.48 0 11.93-2.13 15.89-5.81l-7.73-6c-2.15 1.45-4.92 2.3-8.16 2.3-6.26 0-11.57-4.22-13.47-9.91l-7.98 6.19C6.51 42.62 14.62 48 24 48z'/%3E%3C/svg%3E") center / 62% no-repeat;
  box-shadow: inset 0 0 0 1px var(--border);
}

.account-tile-text {
  display: flex;
  flex-direction: column;
  font: 600 17px/1.2 var(--display);
}

.account-tile-text small {
  margin-top: 2px;
  color: var(--muted);
  font: 400 12px var(--body);
}

.account-note {
  max-width: 520px;
  margin: 18px 0 0;
  padding: 6px 12px;
  background: var(--title);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.account-note.is-error {
  background: #7d3424;
}

.scrim-welcome {
  position: absolute;
  z-index: 10;
}

.dialog-text {
  margin: 4px 0 8px;
}

.welcome-power {
  position: absolute;
  left: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border: 0;
  background: rgba(28, 29, 29, 0.6);
  color: var(--highlight);
  font: 15px var(--display);
  cursor: pointer;
}

.welcome-power span {
  width: 24px;
  height: 24px;
}

.welcome-power:hover {
  text-decoration: underline;
}

.welcome-power:focus-visible {
  outline-color: var(--highlight);
}

/* ---------------------------------------------------------------------------
   Desktop
   --------------------------------------------------------------------------- */

.desktop {
  --wall-color: var(--desktop);
  --wall-image: none;
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--dither) 0 0 / 4px 4px repeat, var(--wall-color);
  user-select: none;
  transition: background-color 0.15s steps(3);
}

.desktop.has-image {
  background: var(--wall-image) center / cover no-repeat, var(--wall-color);
}

/* Icons are placed on a snap grid by os.js (cells: 90×96 medium, 106×112
   large, 82×78 small) and can be dragged anywhere, like Windows. */
.desktop-icons {
  position: absolute;
  top: 12px;
  left: 10px;
  right: 10px;
  bottom: calc(var(--taskbar-h) + 12px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.desktop-icons > li {
  position: absolute;
  transition: left 0.12s steps(3), top 0.12s steps(3);
}

:root[data-motion="off"] .desktop-icons > li {
  transition: none;
}

.desktop-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 84px;
  padding: 4px 2px;
  border: 0;
  background: none;
  cursor: default;
}

.desktop-icon > svg,
.desktop-icon > img,
.desktop-icon > [data-icon] {
  width: 32px;
  height: 32px;
}

.desktop-icon span:last-child {
  padding: 0 3px;
  border: 1px dotted transparent;
  color: var(--highlight);
  font: 14px/1.2 var(--display);
  text-align: center;
  text-shadow: 1px 1px 0 #242525, 0 0 4px rgba(0, 0, 0, 0.8);
}

.desktop-icon:focus {
  outline: none;
}

.desktop-icon:hover span:last-child {
  background: rgba(36, 37, 37, 0.25);
}

.desktop-icon.is-selected span:last-child {
  background: var(--title);
  text-shadow: none;
}

.desktop-icon.is-selected > img,
.desktop-icon.is-selected > svg {
  filter: brightness(0.75) sepia(0.6) hue-rotate(180deg);
}

.desktop-icon:focus-visible span:last-child {
  border-color: var(--highlight);
}

.windows {
  position: absolute;
  inset: var(--safe-t) 0 var(--taskbar-h) 0;
  pointer-events: none;
}

/* ---------------------------------------------------------------------------
   Windows
   --------------------------------------------------------------------------- */

.window {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-width: 240px;
  max-width: 100%;
  padding: 3px;
  background: var(--chrome);
  box-shadow: var(--raised), var(--shadow);
  outline: 1px solid var(--edge);
  color: var(--text);
  text-align: left;
  pointer-events: auto;
  user-select: text;
  animation: win-open 0.17s ease-out;
}

.window:focus {
  outline: 1px solid var(--edge);
}

.window.is-restored {
  animation: none;
}

.window.is-closing {
  animation: win-close 0.12s ease-in forwards;
  pointer-events: none;
}

.window.is-minimizing {
  animation: win-minimize 0.15s ease-in forwards;
  pointer-events: none;
}

.window.is-minimized {
  display: none;
}

@keyframes win-open {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}

@keyframes win-close {
  to {
    opacity: 0;
    transform: scale(0.97);
  }
}

@keyframes win-minimize {
  to {
    opacity: 0;
    transform: translateY(40px) scale(0.85);
  }
}

.window.is-maximized {
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
  box-shadow: var(--raised);
}

.window.is-maximized .resize-handle {
  display: none;
}

.title-bar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 3px 0 5px;
  background: var(--title);
  color: var(--highlight);
  user-select: none;
  touch-action: none;
  cursor: default;
}

.window:not(.is-active) .title-bar {
  background: var(--title-inactive);
  color: #e2e0d6;
}

.title-icon {
  width: 16px;
  height: 16px;
}

.title-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font: 600 15px/1 var(--display);
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-controls {
  display: flex;
  flex: none;
  gap: 2px;
}

.tb {
  width: 20px;
  height: 18px;
  padding: 0;
  border: 0;
  background: var(--chrome) center / 8px 8px no-repeat;
  box-shadow: var(--raised);
  image-rendering: pixelated;
  cursor: pointer;
}

.tb:active {
  box-shadow: var(--sunken);
  background-position: calc(50% + 1px) calc(50% + 1px);
}

.tb:focus-visible {
  outline: 1px dotted var(--text);
  outline-offset: -4px;
}

.tb-close {
  margin-left: 2px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges' fill='%23242525'%3E%3Crect x='0' y='0' width='1' height='1'/%3E%3Crect x='1' y='0' width='1' height='1'/%3E%3Crect x='6' y='0' width='1' height='1'/%3E%3Crect x='7' y='0' width='1' height='1'/%3E%3Crect x='1' y='1' width='1' height='1'/%3E%3Crect x='2' y='1' width='1' height='1'/%3E%3Crect x='5' y='1' width='1' height='1'/%3E%3Crect x='6' y='1' width='1' height='1'/%3E%3Crect x='2' y='2' width='1' height='1'/%3E%3Crect x='3' y='2' width='1' height='1'/%3E%3Crect x='4' y='2' width='1' height='1'/%3E%3Crect x='5' y='2' width='1' height='1'/%3E%3Crect x='3' y='3' width='1' height='1'/%3E%3Crect x='4' y='3' width='1' height='1'/%3E%3Crect x='2' y='4' width='1' height='1'/%3E%3Crect x='3' y='4' width='1' height='1'/%3E%3Crect x='4' y='4' width='1' height='1'/%3E%3Crect x='5' y='4' width='1' height='1'/%3E%3Crect x='1' y='5' width='1' height='1'/%3E%3Crect x='2' y='5' width='1' height='1'/%3E%3Crect x='5' y='5' width='1' height='1'/%3E%3Crect x='6' y='5' width='1' height='1'/%3E%3Crect x='0' y='6' width='1' height='1'/%3E%3Crect x='1' y='6' width='1' height='1'/%3E%3Crect x='6' y='6' width='1' height='1'/%3E%3Crect x='7' y='6' width='1' height='1'/%3E%3C/svg%3E");
}

.tb-min {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges' fill='%23242525'%3E%3Crect x='1' y='6' width='6' height='2'/%3E%3C/svg%3E");
}

.tb-max {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges' fill='%23242525'%3E%3Cpath d='M0 0h8v8H0zM1 2v5h6V2z'/%3E%3C/svg%3E");
}

.is-maximized .tb-max {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges' fill='%23242525'%3E%3Cpath d='M2 0h6v5H7V2H3V1H2zM0 3h5v5H0zM1 4v3h3V4z'/%3E%3C/svg%3E");
}

.window:not(.is-active) .tb {
  opacity: 0.85;
}

.window-body {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 3px;
  overflow: auto;
  background: var(--window);
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--bevel-hi);
}

.window-status {
  display: flex;
  flex: none;
  justify-content: space-between;
  gap: 12px;
  margin-top: 3px;
  padding: 2px 6px;
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--bevel-hi);
  color: var(--text);
  font-size: 12px;
}

.resize-handle {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  touch-action: none;
  background:
    linear-gradient(135deg, transparent 50%, var(--bevel-lo) 50%, var(--bevel-lo) 58%, transparent 58%, transparent 66%, var(--bevel-lo) 66%, var(--bevel-lo) 74%, transparent 74%, transparent 82%, var(--bevel-lo) 82%, var(--bevel-lo) 90%, transparent 90%);
}

.dialog-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 18px 6px;
}

.dialog-icon,
.msgbox-icon {
  flex: none;
  width: 32px;
  height: 32px;
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px 14px;
}

.msgbox-text {
  margin: 4px 0 0;
  white-space: pre-line;
}

.msgbox-buttons {
  justify-content: center;
}

/* ---------------------------------------------------------------------------
   Welcome window
   --------------------------------------------------------------------------- */

.welcome-win {
  display: flex;
  gap: 18px;
  padding: 18px 20px 4px;
}

.welcome-win-art {
  flex: none;
  width: 64px;
  height: 64px;
}

.welcome-win h2 {
  margin: 0 0 8px;
  font: 600 20px/1.2 var(--display);
}

.welcome-win p {
  margin: 0 0 10px;
}

.welcome-win kbd {
  padding: 0 4px;
  background: var(--chrome);
  box-shadow: var(--raised);
  font: 12px var(--body);
}

/* ---------------------------------------------------------------------------
   Taskbar
   --------------------------------------------------------------------------- */

.taskbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--taskbar-h);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  background: var(--chrome);
  box-shadow: inset 0 1px var(--bevel-hi), 0 -1px var(--edge);
  user-select: none;
}

.start-button {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  height: 100%;
  gap: 8px;
  padding: 0 14px 0 8px;
  border: 0;
  background: var(--chrome);
  box-shadow: var(--raised);
  color: var(--text);
  font: 400 18px/1 var(--body);
  cursor: pointer;
}

.start-logo {
  width: 26px;
  height: 26px;
}

.start-button.is-open,
.start-button:active {
  box-shadow: var(--sunken);
  background: var(--chrome) var(--checker);
  background-size: 2px 2px;
  background-blend-mode: soft-light;
}

.start-button:focus-visible {
  outline-offset: -5px;
}

.taskbar-divider {
  align-self: stretch;
  width: 2px;
  margin: 2px 2px;
  box-shadow: inset 1px 0 var(--bevel-lo), inset -1px 0 var(--bevel-hi);
}

.quick-launch {
  display: flex;
  flex: none;
  align-items: stretch;
  gap: 4px;
  height: 100%;
}

.ql-group {
  display: flex;
  gap: 4px;
}

.ql-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 100%;
  padding: 0;
  border: 0;
  background: var(--chrome);
  box-shadow: var(--raised);
  cursor: pointer;
}

.ql-button [data-icon] {
  width: 26px;
  height: 26px;
}

.ql-button:active {
  box-shadow: var(--sunken);
}

.ql-button:active [data-icon] {
  transform: translate(1px, 1px);
}

.ql-button:focus-visible {
  outline: 1px dotted var(--text);
  outline-offset: -5px;
}

.tray-flyout {
  position: absolute;
  right: 4px;
  bottom: calc(var(--taskbar-h) - 2px);
  z-index: 2001;
  width: 290px;
  padding: 12px;
  background: var(--chrome);
  box-shadow: var(--raised), var(--shadow);
  outline: 1px solid var(--edge);
  color: var(--text);
  animation: menu-in 0.12s steps(3);
}

.flyout-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.flyout-icon {
  width: 32px;
  height: 32px;
}

.flyout-name {
  margin: 0;
  font: 600 16px/1.2 var(--display);
}

.flyout-detail {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.flyout-status {
  margin: 12px 0;
  padding: 6px 8px;
  background: var(--window);
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--bevel-hi);
  font-size: 12px;
}

.flyout-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.flyout-danger {
  display: block;
  margin: 12px 0 0 auto;
  padding: 2px 0;
  border: 0;
  background: none;
  color: #9a3b26;
  font: 12px var(--body);
  text-decoration: underline;
  cursor: pointer;
}

:root[data-theme="dark"] .flyout-danger {
  color: #e08a6e;
}

.btn-danger:not(:disabled) {
  color: #9a3b26;
  font-weight: 600;
}

:root[data-theme="dark"] .btn-danger:not(:disabled) {
  color: #f0a084;
}

.delete-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.delete-input {
  width: 12em;
  padding: 3px 6px;
  border: 0;
  background: var(--field);
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--bevel-hi), inset 2px 2px var(--edge);
  color: var(--text);
  font: 14px var(--body);
  letter-spacing: 0.08em;
}

.delete-input:focus {
  outline: 1px dotted var(--text);
  outline-offset: 2px;
}

.delete-error {
  margin: 8px 0 0;
  color: #9a3b26;
  font-size: 13px;
}

.flyout-g {
  width: 16px;
  height: 16px;
}

.task-buttons {
  display: flex;
  flex: 1;
  gap: 4px;
  min-width: 0;
  height: 100%;
}

.task-button {
  display: flex;
  flex: 0 1 180px;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 100%;
  padding: 0 8px;
  border: 0;
  background: var(--chrome);
  box-shadow: var(--raised);
  color: var(--text);
  font: 14px/1 var(--display);
  text-align: left;
  cursor: pointer;
}

.task-button.is-active {
  box-shadow: var(--sunken);
  background: var(--pressed);
  font-weight: 600;
}

.task-button:focus-visible {
  outline-offset: -5px;
}

.task-icon {
  flex: none;
  width: 16px;
  height: 16px;
}

.task-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tray {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  height: 100%;
  padding: 0 10px 0 6px;
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--bevel-hi);
}

.tray-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
}

.tray-button [data-icon] {
  width: 20px;
  height: 20px;
}

.tray-button:hover {
  background: rgba(36, 37, 37, 0.08);
}

.tray-button:active,
.tray-button.is-open {
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--bevel-hi);
}

.tray-button:focus-visible {
  outline: 1px dotted var(--text);
  outline-offset: -3px;
}

.tray-arrow {
  width: 9px;
  height: 5px;
  background: currentColor;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.tray-more.is-open .tray-arrow {
  transform: rotate(180deg);
}

.tray-divider {
  align-self: stretch;
  width: 2px;
  margin: 6px 4px;
  box-shadow: inset 1px 0 var(--bevel-lo), inset -1px 0 var(--bevel-hi);
}

.clock {
  padding-left: 4px;
  font: 17px/1 var(--body);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Start menu
   --------------------------------------------------------------------------- */

.start-menu {
  position: absolute;
  left: 4px;
  bottom: calc(var(--taskbar-h) - 2px);
  z-index: 2001;
  display: flex;
  min-width: 250px;
  padding: 3px;
  background: var(--chrome);
  box-shadow: var(--raised), var(--shadow);
  outline: 1px solid var(--edge);
  animation: menu-in 0.12s steps(3);
}

@keyframes menu-in {
  from {
    clip-path: inset(100% 0 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.sm-banner {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 30px;
  padding: 10px 0;
  background: var(--title);
  color: var(--highlight);
}

.sm-banner span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: 600 18px/1 var(--display);
  letter-spacing: 0.06em;
}

.sm-banner b {
  color: #f0ab7f;
}

.sm-items {
  flex: 1;
  margin: 0;
  padding: 2px 0;
  list-style: none;
}

.sm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 14px 0 8px;
  border: 0;
  background: none;
  color: var(--text);
  font: 15px/1 var(--display);
  text-align: left;
  cursor: pointer;
}

.sm-item:hover,
.sm-item:focus-visible {
  outline: none;
  background: var(--title);
  color: var(--highlight);
}

.sm-icon {
  width: 24px;
  height: 24px;
}

.sm-separator {
  height: 2px;
  margin: 3px 4px;
  box-shadow: inset 0 1px var(--bevel-lo), inset 0 -1px var(--bevel-hi);
}

/* ---------------------------------------------------------------------------
   Shut down dialog and off screen
   --------------------------------------------------------------------------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: grid;
  place-items: center;
  padding: 16px;
}

/* Classic 50% dither over the desktop, softened. */
.scrim::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--checker);
  background-size: 2px 2px;
  image-rendering: pixelated;
  opacity: 0.55;
}

.dialog {
  position: relative;
  width: 380px;
  max-width: 100%;
}

.dialog-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.dialog-choices legend {
  margin-bottom: 10px;
  padding: 0;
}

.dialog-choices label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.off {
  display: grid;
  place-items: center;
  background: #1c1d1d;
  color: var(--accent);
}

.off[data-mode="standby"] {
  cursor: none;
}

.off[data-mode="standby"] .off-center {
  display: none;
}

.off-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 0 20px;
  text-align: center;
}

.off-center p {
  margin: 0;
  font: 600 clamp(20px, 3.4vw, 32px)/1.2 var(--display);
}

/* Power-off room (room.js): the message sits below the scene once it has settled.
   While it loads, the "Shutting down..." page stays visible underneath. */
.off.is-loading {
  background: transparent;
}
.off.is-loading .off-center {
  visibility: hidden;
}
.room-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.off.has-room {
  place-items: end center;
}
.off.has-room .off-center {
  position: relative;
  gap: 12px;
  padding: 0 20px max(26px, env(safe-area-inset-bottom));
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms;
}
.off.has-room.is-settled .off-center {
  opacity: 1;
  pointer-events: auto;
}
.off.has-room .off-center p {
  padding: 4px 10px;
  background: rgba(23, 21, 29, 0.78);
  color: #f4ead6;
  font-size: clamp(16px, 2.4vw, 22px);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.noscript {
  max-width: 560px;
  margin: 15vh auto;
  padding: 24px;
  color: var(--highlight);
}

.noscript a {
  color: var(--accent);
}

/* ---------------------------------------------------------------------------
   Dark theme (windows, taskbar, menus)
   --------------------------------------------------------------------------- */

:root[data-theme="dark"] {
  --window: #2a2c2b;
  --chrome: #3b3e3c;
  --text: #e9e6dc;
  --muted: #a9aaa1;
  --border: #1f2120;
  --title: #2f4c7e;
  --title-inactive: #555b58;
  --edge: #0d0e0e;
  --bevel-hi: #62675f;
  --bevel-mid: #4a4e4b;
  --bevel-lo: #1f2120;
  --field: #232524;
  --pressed: #303331;
  --shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
}

:root[data-theme="dark"] .account-tile:hover:not(:disabled) {
  background: #474b48;
}

:root[data-theme="dark"] .tb-close {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges' fill='%23e9e6dc'%3E%3Crect x='0' y='0' width='1' height='1'/%3E%3Crect x='1' y='0' width='1' height='1'/%3E%3Crect x='6' y='0' width='1' height='1'/%3E%3Crect x='7' y='0' width='1' height='1'/%3E%3Crect x='1' y='1' width='1' height='1'/%3E%3Crect x='2' y='1' width='1' height='1'/%3E%3Crect x='5' y='1' width='1' height='1'/%3E%3Crect x='6' y='1' width='1' height='1'/%3E%3Crect x='2' y='2' width='1' height='1'/%3E%3Crect x='3' y='2' width='1' height='1'/%3E%3Crect x='4' y='2' width='1' height='1'/%3E%3Crect x='5' y='2' width='1' height='1'/%3E%3Crect x='3' y='3' width='1' height='1'/%3E%3Crect x='4' y='3' width='1' height='1'/%3E%3Crect x='2' y='4' width='1' height='1'/%3E%3Crect x='3' y='4' width='1' height='1'/%3E%3Crect x='4' y='4' width='1' height='1'/%3E%3Crect x='5' y='4' width='1' height='1'/%3E%3Crect x='1' y='5' width='1' height='1'/%3E%3Crect x='2' y='5' width='1' height='1'/%3E%3Crect x='5' y='5' width='1' height='1'/%3E%3Crect x='6' y='5' width='1' height='1'/%3E%3Crect x='0' y='6' width='1' height='1'/%3E%3Crect x='1' y='6' width='1' height='1'/%3E%3Crect x='6' y='6' width='1' height='1'/%3E%3Crect x='7' y='6' width='1' height='1'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .tb-min {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges' fill='%23e9e6dc'%3E%3Crect x='1' y='6' width='6' height='2'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .tb-max {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges' fill='%23e9e6dc'%3E%3Cpath d='M0 0h8v8H0zM1 2v5h6V2z'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .is-maximized .tb-max {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8' shape-rendering='crispEdges' fill='%23e9e6dc'%3E%3Cpath d='M2 0h6v5H7V2H3V1H2zM0 3h5v5H0zM1 4v3h3V4z'/%3E%3C/svg%3E");
}

/* ---------------------------------------------------------------------------
   Desktop icons: sizes and rename
   --------------------------------------------------------------------------- */

.desktop[data-icon-size="large"] .desktop-icons {
  grid-template-rows: repeat(auto-fill, 104px);
  grid-auto-columns: 100px;
}

.desktop[data-icon-size="large"] .desktop-icon {
  width: 100px;
}

.desktop[data-icon-size="large"] .desktop-icon > img,
.desktop[data-icon-size="large"] .desktop-icon > svg {
  width: 48px;
  height: 48px;
}

.desktop[data-icon-size="small"] .desktop-icons {
  grid-template-rows: repeat(auto-fill, 70px);
  grid-auto-columns: 76px;
}

.desktop[data-icon-size="small"] .desktop-icon {
  width: 76px;
}

.desktop[data-icon-size="small"] .desktop-icon > img,
.desktop[data-icon-size="small"] .desktop-icon > svg {
  width: 24px;
  height: 24px;
}

.desktop[data-icon-size="small"] .icon-label {
  font-size: 13px;
}

.icon-label {
  overflow-wrap: anywhere;
}

.icon-rename {
  width: 100%;
  padding: 0 2px;
  border: 1px solid var(--edge);
  background: #fff9e9;
  color: #242525;
  font: 13px/1.2 var(--body);
  text-align: center;
  outline: none;
}

/* ---------------------------------------------------------------------------
   Menus (context menus and menu-bar dropdowns)
   --------------------------------------------------------------------------- */

.menu {
  position: fixed;
  z-index: 4000;
  min-width: 190px;
  padding: 3px;
  background: var(--chrome);
  box-shadow: var(--raised), var(--shadow);
  outline: 1px solid var(--edge);
  color: var(--text);
  user-select: none;
  animation: menu-in 0.1s steps(2);
}

.menu:focus {
  outline: 1px solid var(--edge);
}

.menu-item {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 26px;
  padding: 0 10px 0 4px;
  border: 0;
  background: none;
  color: var(--text);
  font: 15px/1 var(--display);
  text-align: left;
  cursor: pointer;
}

.menu-item:focus,
.menu-item[aria-expanded="true"] {
  outline: none;
  background: var(--select);
  color: var(--select-text);
}

.menu-item[aria-disabled="true"] {
  color: var(--muted);
  cursor: default;
}

.menu-item[aria-disabled="true"]:focus {
  background: none;
  color: var(--muted);
}

.menu-check {
  justify-self: center;
  width: 8px;
  height: 8px;
}

.menu-item[aria-checked="true"] .menu-check {
  background: currentColor;
  clip-path: polygon(0 50%, 30% 50%, 40% 70%, 80% 0, 100% 0, 45% 100%, 30% 100%);
}

.menu-item[aria-checked="true"] .menu-check.is-radio {
  width: 6px;
  height: 6px;
  clip-path: none;
}

.menu-shortcut {
  padding-left: 18px;
  font: 12px var(--body);
  opacity: 0.8;
}

.menu-item.has-submenu .menu-shortcut::after {
  content: "";
  display: block;
  width: 4px;
  height: 7px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.menu-separator {
  height: 2px;
  margin: 3px 2px;
  box-shadow: inset 0 1px var(--bevel-lo), inset 0 -1px var(--bevel-hi);
}

.menubar {
  display: flex;
  flex: none;
  gap: 2px;
  padding: 2px;
  background: var(--chrome);
}

.menubar-item {
  padding: 2px 8px;
  border: 0;
  background: none;
  color: var(--text);
  font: 14px/1.2 var(--display);
  cursor: pointer;
}

.menubar-item:hover,
.menubar-item:focus-visible,
.menubar-item.is-open {
  outline: none;
  background: var(--select);
  color: var(--select-text);
}

/* ---------------------------------------------------------------------------
   Notepad
   --------------------------------------------------------------------------- */

.window-body.is-flush {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--chrome);
  box-shadow: none;
}

.notepad {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.notepad-text {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  background: var(--field);
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--bevel-hi), inset 2px 2px var(--edge);
  color: var(--text);
  font: 14px/1.55 var(--body);
  resize: none;
  white-space: pre-wrap;
  tab-size: 4;
}

.notepad-text[wrap="off"] {
  white-space: pre;
  overflow-x: auto;
}

.notepad-text:focus {
  outline: none;
}

.notepad-text[readonly] {
  background: var(--window);
}

.window-status span:first-child {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: pre;
}

.window-status span:last-child {
  flex: none;
}

/* ---------------------------------------------------------------------------
   Display Properties
   --------------------------------------------------------------------------- */

.props {
  padding: 12px 14px 0;
}

/* Etched group frame; the legend sits in a gap in the line. */
.groupbox {
  min-width: 0;
  margin: 0 0 12px;
  padding: 6px 12px 12px;
  border: 1px solid var(--bevel-lo);
  box-shadow: 1px 1px var(--bevel-hi), inset 1px 1px var(--bevel-hi);
}

.groupbox legend {
  margin-left: -2px;
  padding: 0 5px;
  font: 600 14px/1.2 var(--display);
}

.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 6px;
  padding: 2px;
}

.wallpaper-swatch {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  border: 0;
  background: none;
  color: var(--text);
  font: 12px/1.2 var(--body);
  text-align: left;
  cursor: pointer;
}

.wallpaper-preview {
  display: block;
  height: 52px;
  background-image: var(--dither);
  background-size: 4px 4px, cover;
  background-position: center;
  box-shadow: var(--sunken);
}

.wallpaper-swatch[aria-checked="true"] {
  background: var(--select);
  color: var(--select-text);
}

.wallpaper-swatch[aria-checked="true"] .wallpaper-preview {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.wallpaper-swatch:focus-visible {
  outline: 1px dotted var(--text);
  outline-offset: 1px;
}

.theme-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.theme-choices label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

/* ---------------------------------------------------------------------------
   Settings: tabs, checkboxes
   --------------------------------------------------------------------------- */

.tabs {
  display: flex;
  padding-left: 4px;
}

.tab {
  position: relative;
  margin-right: -1px;
  padding: 4px 14px 3px;
  border: 0;
  background: var(--chrome);
  box-shadow: inset 1px 1px var(--bevel-hi), inset -1px 0 var(--edge), inset -2px 0 var(--bevel-lo), 0 -1px var(--bevel-lo);
  color: var(--text);
  font: 15px/1.2 var(--display);
  cursor: pointer;
}

.tab[aria-selected="true"] {
  z-index: 1;
  margin-top: -3px;
  padding-bottom: 6px;
  background: var(--window);
}

.tab:focus-visible {
  outline: 1px dotted var(--text);
  outline-offset: -4px;
}

.tab-panel {
  padding: 14px 12px 2px;
  background: var(--window);
  box-shadow: inset 1px 1px var(--bevel-hi), inset -1px -1px var(--edge), inset -2px -2px var(--bevel-lo);
}

.props .tab-panel .groupbox:last-child {
  margin-bottom: 12px;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

input[type="checkbox"] {
  appearance: none;
  display: inline-grid;
  flex: none;
  place-content: center;
  width: 14px;
  height: 14px;
  margin: 0;
  background: var(--field);
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--chrome), inset 2px 2px var(--edge);
  cursor: pointer;
}

input[type="checkbox"]:checked::before {
  content: "";
  width: 8px;
  height: 7px;
  background: var(--text);
  clip-path: polygon(0 45%, 30% 45%, 40% 65%, 80% 0, 100% 0, 45% 100%, 30% 100%);
}

input[type="checkbox"]:disabled,
input[type="checkbox"]:disabled + * {
  opacity: 0.5;
  cursor: default;
}

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 1px dotted var(--text);
  outline-offset: 2px;
}

.setting-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.setting-actions {
  margin-top: 10px;
}

/* ---------------------------------------------------------------------------
   Terminal
   --------------------------------------------------------------------------- */

.terminal {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px 10px;
  background: #1c1d1d;
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--bevel-hi), inset 2px 2px var(--edge);
  color: #d9d6c8;
  font: 14px/1.45 var(--body);
  cursor: text;
}

.term-line {
  min-height: 1.45em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.term-echo {
  color: #f2efe2;
}

.term-accent {
  color: #9fc08f;
  font-weight: 600;
}

.term-dim {
  color: #8f9289;
}

.term-error {
  color: #e39a7c;
}

.term-line a {
  color: #8cb7d9;
}

.term-input-line {
  display: flex;
  margin: 0;
}

.term-prompt {
  flex: none;
  color: #9fc08f;
  white-space: pre;
}

.term-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f2efe2;
  font: inherit;
  caret-color: #9fc08f;
  outline: none;
}

/* Animations off (Settings > General, or the device prefers reduced motion). */
:root[data-motion="off"] *,
:root[data-motion="off"] *::before,
:root[data-motion="off"] *::after {
  animation: none !important;
  transition: none !important;
}

/* ---------------------------------------------------------------------------
   Small screens and touch
   --------------------------------------------------------------------------- */

@media (pointer: coarse) {
  .tb {
    width: 28px;
    height: 24px;
    background-size: 10px 10px;
  }

  .title-bar {
    height: 32px;
  }
}

@media (max-width: 640px) {
  :root {
    --taskbar-h: calc(46px + var(--safe-b));
  }

  .login-body {
    padding: 18px 16px 16px;
  }

  .login-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 14px;
    text-align: center;
  }

  .login-rule {
    display: none;
  }

  .login-art {
    width: 112px;
    height: 112px;
  }

  .login-desc {
    margin-top: 12px;
  }

  .login-prompt {
    margin-top: 18px;
  }

  .account-choices {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .welcome-power {
    position: static;
    margin: 0 auto 16px;
  }

  .start-menu {
    left: 0;
    right: 0;
  }

  .quick-launch {
    display: none;
  }

  .start-button {
    padding-right: 10px;
    font-size: 16px;
  }

  .tray {
    padding-left: 2px;
  }

  .clock {
    font-size: 14px;
  }

  .task-button {
    flex-basis: 46px;
    justify-content: center;
  }

  .task-button .task-label {
    display: none;
  }

  .welcome-win {
    flex-direction: column;
  }

  .welcome-win-art {
    width: 48px;
    height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:root[data-motion="off"] .progress-fill {
  width: 100%;
}

/* ---------------------------------------------------------------------------
   Drag and drop, clipboard
   --------------------------------------------------------------------------- */

.is-cut > svg,
.is-cut .ex-icon {
  opacity: 0.45;
}

.desktop-icon.is-drop-target span:last-child,
.ex-item.is-drop-target,
.ex-place.is-drop-target {
  background: var(--select);
  color: var(--select-text);
}

.ex-main.is-drop-target {
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* ---------------------------------------------------------------------------
   Files (explorer)
   --------------------------------------------------------------------------- */

.explorer {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.ex-toolbar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-top: 1px solid var(--bevel-lo);
  box-shadow: inset 0 1px var(--bevel-hi);
}

.ex-nav {
  display: grid;
  place-items: center;
  width: 30px;
  height: 26px;
  padding: 0;
  border: 0;
  background: var(--chrome);
  box-shadow: var(--raised);
  color: var(--text);
  cursor: pointer;
}

.ex-nav:active:not(:disabled) {
  box-shadow: var(--sunken);
}

.ex-nav:disabled {
  opacity: 0.45;
  cursor: default;
}

.arrow {
  display: block;
  width: 10px;
  height: 10px;
  background: currentColor;
}

.arrow-left {
  clip-path: polygon(0 50%, 60% 0, 60% 30%, 100% 30%, 100% 70%, 60% 70%, 60% 100%);
}

.arrow-right {
  clip-path: polygon(100% 50%, 40% 0, 40% 30%, 0 30%, 0 70%, 40% 70%, 40% 100%);
}

.arrow-up {
  clip-path: polygon(50% 0, 100% 60%, 70% 60%, 70% 100%, 30% 100%, 30% 60%, 0 60%);
}

.ex-address {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 26px;
  margin: 0 2px;
  padding: 0 6px;
  background: var(--field);
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--bevel-hi), inset 2px 2px var(--edge);
}

.ex-address-icon {
  flex: none;
  width: 16px;
  height: 16px;
}

.ex-path {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 13px var(--body);
  outline: none;
}

.ex-actions {
  display: flex;
  gap: 4px;
}

.ex-actions .btn {
  min-width: 0;
  min-height: 26px;
  padding: 2px 10px;
  font-size: 13px;
}

.ex-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.ex-places {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 1px;
  width: 170px;
  padding: 6px 4px;
  overflow-y: auto;
  border-right: 1px solid var(--bevel-lo);
  background: var(--chrome);
}

.ex-place {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 0;
  background: none;
  color: var(--text);
  font: 14px/1.2 var(--display);
  text-align: left;
  cursor: pointer;
}

.ex-place-icon {
  flex: none;
  width: 20px;
  height: 20px;
}

.ex-place:hover {
  background: rgba(36, 37, 37, 0.08);
}

.ex-place.is-current {
  background: var(--select);
  color: var(--select-text);
}

.ex-place:focus-visible {
  outline: 1px dotted var(--text);
  outline-offset: -3px;
}

.ex-main {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 8px;
  background: var(--window);
  box-shadow: inset 1px 1px var(--bevel-lo), inset 2px 2px var(--edge);
  outline: none;
}

.ex-main.view-icons {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 6px;
}

.ex-item {
  display: flex;
  border: 1px dotted transparent;
  color: var(--text);
  cursor: default;
  user-select: none;
}

.ex-item:focus {
  outline: none;
  border-color: var(--text);
}

.view-icons .ex-item {
  width: 96px;
  padding: 4px 2px;
}

.view-icons .ex-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  text-align: center;
}

.view-icons .ex-icon {
  width: 32px;
  height: 32px;
}

.view-icons .ex-label {
  max-width: 100%;
  padding: 0 2px;
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ex-item.is-selected .ex-label,
.view-details .ex-item.is-selected {
  background: var(--select);
  color: var(--select-text);
}

.view-details {
  display: flex;
  flex-direction: column;
}

.view-details .ex-item,
.ex-head {
  display: grid;
  grid-template-columns: minmax(180px, 2.2fr) 1.2fr 1fr 0.6fr;
  align-items: center;
  gap: 8px;
  padding: 2px 6px;
  font-size: 13px;
}

.ex-head {
  position: sticky;
  top: -8px;
  z-index: 1;
  margin: -8px -8px 4px;
  padding: 0;
  background: var(--chrome);
  box-shadow: inset 0 -1px var(--bevel-lo);
}

.ex-col {
  padding: 4px 8px;
  border: 0;
  background: none;
  box-shadow: inset -1px 0 var(--bevel-lo);
  color: var(--text);
  font: 13px var(--display);
  text-align: left;
  cursor: pointer;
}

.view-details .ex-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.view-details .ex-icon {
  flex: none;
  width: 16px;
  height: 16px;
}

.view-details .ex-label,
.ex-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ex-cell {
  color: var(--muted);
}

.view-details .ex-item.is-selected .ex-cell {
  color: inherit;
}

.ex-empty {
  margin: 24px auto;
  color: var(--muted);
  font-size: 13px;
}

/* ---------------------------------------------------------------------------
   Volume flyout
   --------------------------------------------------------------------------- */

.volume-flyout {
  position: absolute;
  right: 74px;
  bottom: calc(var(--taskbar-h) - 2px);
  z-index: 2001;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 8px;
  width: 96px;
  padding: 10px 10px 12px;
  background: var(--chrome);
  box-shadow: var(--raised), var(--shadow);
  outline: 1px solid var(--edge);
  color: var(--text);
  animation: menu-in 0.12s steps(3);
}

.volume-title {
  margin: 0;
  font: 600 14px var(--display);
}

.volume-value {
  font: 13px var(--body);
}

.volume-slider {
  writing-mode: vertical-lr;
  direction: rtl;
  width: 26px;
  height: 130px;
  margin: 0;
  accent-color: var(--title);
  cursor: pointer;
}

.volume-mute {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

.volume-row {
  display: grid;
  grid-template-columns: auto 1fr 3.5em;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.volume-row input {
  accent-color: var(--title);
}

.volume-out {
  font: 13px var(--body);
  text-align: right;
}

.tray-button.is-open {
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--bevel-hi);
}

/* ---------------------------------------------------------------------------
   Orbit browser (Chrome-style chrome inside a MaksimOS window)
   --------------------------------------------------------------------------- */

/* Orbit: MaksimOS chrome. Bevelled tabs and buttons, a sunken address field,
   mono type; the New Tab page is a dark dithered "space" page. Colours come from
   the OS theme variables, so light and dark mode both work. */
.orbit {
  --o-strip: var(--chrome);
  --o-tab: var(--window);
  --o-bar: var(--chrome);
  --o-page: var(--window);
  --o-text: var(--text);
  --o-muted: var(--muted);
  --o-link: var(--title);
  --o-line: var(--border);
  --o-accent: var(--title);
  --o-omni: var(--field);
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  background: var(--o-bar);
  color: var(--o-text);
  font: 14px/1.45 var(--body);
}

:root[data-theme="dark"] .orbit {
  --o-link: #8fb3e8;
  --o-accent: #8fb3e8;
}

.orbit svg {
  fill: currentColor;
}

.orbit-strip {
  display: flex;
  flex: none;
  align-items: flex-end;
  gap: 4px;
  height: 36px;
  padding: 4px 6px 0;
  background: var(--o-strip);
  box-shadow: inset 0 -1px var(--bevel-hi);
}

.orbit-tabs {
  display: flex;
  flex: 0 1 auto;
  gap: 2px;
  min-width: 0;
  height: 100%;
}

.orbit-tab {
  position: relative;
  display: flex;
  flex: 0 1 210px;
  align-items: center;
  gap: 8px;
  min-width: 52px;
  height: calc(100% - 3px);
  margin-top: 3px;
  padding: 0 6px 0 10px;
  background: var(--o-strip);
  box-shadow: inset 1px 1px var(--bevel-hi), inset -1px 0 var(--edge), inset -2px 0 var(--bevel-lo);
  color: var(--o-muted);
  font-size: 14px;
  cursor: default;
  user-select: none;
}

.orbit-tab:hover {
  color: var(--o-text);
}

/* The active tab is taller, lighter, and joins the toolbar below it. */
.orbit-tab.is-active {
  z-index: 1;
  height: calc(100% + 1px);
  margin-top: 0;
  margin-bottom: -1px;
  background: var(--o-bar);
  box-shadow: inset 1px 1px var(--bevel-hi), inset 2px 2px var(--bevel-mid), inset -1px 0 var(--edge), inset -2px 0 var(--bevel-lo);
  color: var(--o-text);
}

.orbit-tab:focus-visible {
  outline: 1px dotted var(--o-text);
  outline-offset: -5px;
}

.orbit-tab-icon {
  flex: none;
  width: 16px;
  height: 16px;
}

.orbit-tab-icon.is-loading {
  border: 2px solid var(--bevel-lo);
  border-top-color: var(--accent);
  animation: orbit-spin 0.8s steps(8) infinite;
}

@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

.orbit-tab-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orbit-tab-close,
.orbit-newtab,
.orbit-btn {
  display: grid;
  flex: none;
  place-items: center;
  padding: 0;
  border: 0;
  background: var(--o-bar);
  color: var(--o-text);
  cursor: pointer;
}

.orbit-tab-close {
  width: 16px;
  height: 16px;
  background: transparent;
}

.orbit-tab-close svg {
  width: 10px;
  height: 10px;
}

.orbit-tab-close:hover {
  box-shadow: var(--raised);
}

.orbit-newtab {
  width: 28px;
  height: 26px;
  margin-bottom: 2px;
  box-shadow: var(--raised);
}

.orbit-newtab svg {
  width: 12px;
  height: 12px;
}

.orbit-btn {
  width: 34px;
  height: 30px;
  box-shadow: var(--raised);
}

.orbit-btn svg {
  width: 16px;
  height: 16px;
}

.orbit-btn[data-act="menu"] {
  width: 26px;
}

.orbit-btn[data-act="menu"] svg {
  width: 4px;
  height: 18px;
}

.orbit-newtab:active,
.orbit-btn:active:not(:disabled) {
  box-shadow: var(--sunken);
}

.orbit-newtab:active svg,
.orbit-btn:active:not(:disabled) svg {
  transform: translate(1px, 1px);
}

.orbit-btn:disabled {
  color: var(--muted);
  opacity: 0.6;
  cursor: default;
}

.orbit-newtab:focus-visible,
.orbit-btn:focus-visible {
  outline: 1px dotted var(--o-text);
  outline-offset: -5px;
}

.orbit-bar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-bottom: 2px solid var(--edge);
  background: var(--o-bar);
}

/* An etched groove between toolbar groups. */
.orbit-sep {
  flex: none;
  width: 2px;
  height: 26px;
  margin: 0 2px;
  box-shadow: inset 1px 0 var(--bevel-lo), inset -1px 0 var(--bevel-hi);
}

.orbit-omnibox {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  background: var(--o-omni);
  box-shadow: var(--sunken);
}

.orbit-omnibox:focus-within {
  outline: 1px dotted var(--o-text);
  outline-offset: -5px;
}

.orbit-site {
  display: grid;
  flex: none;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--o-muted);
}

.orbit-site svg {
  width: 16px;
  height: 16px;
}

.orbit-site svg[viewBox="0 0 8 10"] {
  width: 12px;
}

.orbit-url {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--o-text);
  font: 15px/1 var(--body);
  outline: none;
}

.orbit-url::placeholder {
  color: var(--o-muted);
}

.orbit-view {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--o-page);
}

.orbit-page {
  position: absolute;
  inset: 0;
  overflow: auto;
}

.orbit-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.orbit-link,
.ot-result-title {
  color: var(--o-link);
  text-decoration: none;
  cursor: pointer;
}

.orbit-link:hover,
.ot-result-title:hover {
  text-decoration: underline;
}

.orbit-button {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 16px;
  border: 0;
  background: var(--chrome);
  box-shadow: var(--raised);
  color: var(--text);
  font: 14px var(--body);
  text-decoration: none;
  cursor: pointer;
}

.orbit-button:active {
  box-shadow: var(--sunken);
}

.orbit-button-primary {
  background: var(--title);
  color: var(--on-title);
}

.orbit-button:disabled {
  opacity: 0.55;
  cursor: default;
}

/* New tab: a dark dithered page, pixel wordmark, bevelled tiles. */
.ot-newtab {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
  padding: 52px 24px 36px;
  background: #1c222c var(--dither);
  color: #fff9e9;
}

.ot-logo {
  width: 128px;
  height: 128px;
}

.ot-logo img {
  image-rendering: pixelated;
}

.ot-wordmark {
  margin: 8px 0 28px;
  font: 700 54px/1 var(--display);
  letter-spacing: 0.02em;
  color: #fff9e9;
  text-shadow: 3px 3px 0 #000;
}

.ot-search {
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(600px, 100%);
  height: 50px;
  padding: 0 18px;
  background: #e4e2d8;
  /* Sunken field inside a raised frame, like the OS's dialogs. */
  box-shadow: inset 2px 2px #515651, inset -2px -2px #fff9e9, inset 3px 3px #242525, 0 0 0 4px #c9c9be, 0 0 0 5px #fff9e9, 0 0 0 6px #242525;
}

.ot-search:focus-within {
  outline: 1px dotted #242525;
  outline-offset: -8px;
}

.ot-search-icon {
  flex: none;
  width: 24px;
  height: 24px;
}

.ot-search-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ot-search input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #242525;
  font: 18px/1 var(--body);
  outline: none;
}

.ot-search input::placeholder {
  color: #5f635e;
}

.ot-tiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 8px;
  max-width: 620px;
  margin-top: 40px;
}

.ot-tile {
  display: flex;
  flex: 0 0 140px;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 4px 2px;
  color: #fff9e9;
  text-decoration: none;
}

.ot-tile-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  background: #c9c9be;
  box-shadow: inset -1px -1px #242525, inset 1px 1px #fff9e9, inset -2px -2px #515651, inset 2px 2px #e4e2d8, 3px 3px 0 rgba(0, 0, 0, 0.5);
  color: #2346c4;
  font: 32px/1 "Jersey 25", var(--display);
}

.ot-tile-icon svg {
  width: 26px;
  height: 26px;
  fill: #242525;
}

.ot-tile:hover .ot-tile-icon {
  background: #e4e2d8;
}

.ot-tile:active .ot-tile-icon {
  box-shadow: inset 1px 1px #515651, inset -1px -1px #fff9e9, inset 2px 2px #242525, inset -2px -2px #e4e2d8;
}

.ot-tile:focus-visible {
  outline: 1px dotted #fff9e9;
  outline-offset: 2px;
}

.ot-tile-title {
  max-width: 100%;
  overflow: hidden;
  font: 16px/1.2 var(--body);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Search results */
.ot-results {
  max-width: 680px;
  padding: 20px 28px 40px;
}

.ot-count {
  margin: 0 0 18px;
  color: var(--o-muted);
  font-size: 13px;
}

.ot-result {
  margin-bottom: 24px;
}

.ot-result-url {
  overflow: hidden;
  color: var(--o-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ot-result-title {
  display: block;
  margin: 2px 0 4px;
  padding: 0;
  border: 0;
  background: none;
  font: 24px/1.2 "Jersey 25", var(--display);
  text-align: left;
}

.ot-snippet,
.ot-none {
  margin: 0;
  color: var(--o-muted);
}

.ot-web {
  margin-top: 26px;
}

/* Project and about pages */
.ot-project {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 28px 48px;
}

.ot-cover {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 22px;
  border: 2px solid var(--edge);
  box-shadow: var(--shadow);
}

.ot-h1 {
  margin: 0 0 6px;
  font: 38px/1.1 "Jersey 25", var(--display);
}

.ot-h2 {
  margin: 26px 0 8px;
  font: 24px/1.2 "Jersey 25", var(--display);
}

.ot-lead {
  margin: 0 0 14px;
  color: var(--o-muted);
  font-size: 16px;
}

.ot-p {
  max-width: 64ch;
}

.ot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.ot-tags li {
  padding: 2px 10px;
  background: var(--field);
  box-shadow: var(--sunken);
  color: var(--o-text);
  font-size: 13px;
}

.ot-list {
  padding-left: 20px;
}

.ot-list li {
  margin: 6px 0;
  color: var(--o-muted);
}

.ot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

/* Error / blocked page */
.ot-error {
  max-width: 560px;
  margin: 0 auto;
  padding: 72px 28px 40px;
}

.ot-error-art {
  width: 72px;
  height: 72px;
  margin-bottom: 26px;
  filter: grayscale(1);
  opacity: 0.7;
}

.ot-error-title {
  margin: 0 0 14px;
  font: 30px/1.2 "Jersey 25", var(--display);
}

.ot-error-text {
  margin: 0 0 12px;
  color: var(--o-muted);
}

.ot-error-code {
  margin: 0 0 24px;
  color: var(--o-muted);
  font: 12px ui-monospace, monospace;
}

@media (max-width: 640px) {
  .ex-places {
    display: none;
  }

  .ot-tiles {
    grid-template-columns: repeat(2, 112px);
  }

  .volume-flyout {
    right: 60px;
  }
}

/* ---------------------------------------------------------------------------
   Mail
   --------------------------------------------------------------------------- */

.ql-button {
  position: relative;
}

.ql-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #b5523b;
  box-shadow: 0 0 0 1px var(--edge);
  color: #fff9e9;
  font: 600 10px/16px var(--body);
  text-align: center;
}

.mail,
.compose {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.mail-toolbar {
  display: flex;
  flex: none;
  gap: 2px;
  padding: 4px;
  border-bottom: 1px solid var(--bevel-lo);
  background: var(--chrome);
}

.tool-big {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 74px;
  padding: 4px 8px;
  border: 0;
  background: none;
  color: var(--text);
  font: 13px var(--display);
  cursor: pointer;
}

.tool-big:hover:not(:disabled) {
  box-shadow: var(--raised);
}

.tool-big:active:not(:disabled) {
  box-shadow: var(--sunken);
}

.tool-big:disabled {
  opacity: 0.45;
  cursor: default;
}

.tool-big-icon {
  width: 24px;
  height: 24px;
}

.mail-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.mail-folders {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 1px;
  width: 150px;
  padding: 6px 4px;
  border-right: 1px solid var(--bevel-lo);
  background: var(--chrome);
}

.mail-folder {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  border: 0;
  background: none;
  color: var(--text);
  font: 14px var(--display);
  text-align: left;
  cursor: pointer;
}

.mail-folder:hover {
  background: rgba(36, 37, 37, 0.08);
}

.mail-folder.is-current {
  background: var(--select);
  color: var(--select-text);
}

.mail-count {
  font-weight: 600;
}

.mail-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.mail-list {
  flex: 0 0 40%;
  min-height: 90px;
  overflow-y: auto;
  border-bottom: 3px solid var(--chrome);
  background: var(--window);
  box-shadow: inset 1px 1px var(--bevel-lo);
  outline: none;
}

.mail-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr auto;
  gap: 12px;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(81, 86, 81, 0.15);
  font-size: 13px;
  cursor: default;
}

.mail-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-row.is-unread {
  font-weight: 600;
}

.mail-row.is-unread .mail-who::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  vertical-align: 2px;
  background: var(--accent);
}

.mail-row:hover {
  background: rgba(38, 61, 101, 0.08);
}

.mail-row.is-selected {
  background: var(--select);
  color: var(--select-text);
}

.mail-date {
  color: var(--muted);
}

.mail-row.is-selected .mail-date {
  color: inherit;
}

.mail-read {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px;
  background: var(--window);
}

.mail-read.is-wide {
  flex: 1 1 100%;
}

.mail-head {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--bevel-lo);
}

.mail-title {
  margin: 0 0 8px;
  font: 600 18px/1.3 var(--display);
}

.mail-field {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.mail-text {
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mail-link {
  margin-left: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--title);
  font: 12px var(--body);
  text-decoration: underline;
  cursor: pointer;
}

:root[data-theme="dark"] .mail-link {
  color: #8cb7d9;
}

.mail-hint,
.mail-empty {
  color: var(--muted);
  font-size: 13px;
}

.mail-empty {
  padding: 16px 12px;
}

.contact-list {
  display: flex;
  flex-direction: column;
  margin: 8px 0 16px;
}

.contact-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(81, 86, 81, 0.15);
}

.contact-row .btn {
  min-width: 0;
  min-height: 24px;
  padding: 2px 10px;
  font-size: 13px;
}

.contact-name {
  font-weight: 600;
}

.contact-email,
.contact-fixed {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
}

.contact-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}

.contact-fields label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.contact-fields input,
.compose input,
.admin-search input {
  padding: 4px 6px;
  border: 0;
  background: var(--field);
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--bevel-hi), inset 2px 2px var(--edge);
  color: var(--text);
  font: 13px var(--body);
}

.mail-guest {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  padding: 30px;
  text-align: center;
}

.mail-guest-icon {
  width: 64px;
  height: 64px;
}

.mail-guest h2 {
  margin: 14px 0 6px;
  font: 600 20px var(--display);
}

.mail-guest p {
  max-width: 40ch;
  margin: 0;
  color: var(--muted);
}

/* Compose */
.compose {
  background: var(--chrome);
}

.compose-fields {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
}

.compose-fields label {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: center;
  gap: 8px;
}

.compose-fields label > span {
  font: 14px var(--display);
}

.compose-to-btn {
  min-width: 0;
  min-height: 26px;
  padding: 2px 8px;
}

.compose textarea {
  flex: 1;
  min-height: 120px;
  margin: 0 8px;
  padding: 8px 10px;
  border: 0;
  background: var(--field);
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--bevel-hi), inset 2px 2px var(--edge);
  color: var(--text);
  font: 14px/1.5 var(--body);
  resize: none;
}

.compose textarea:focus,
.compose input:focus,
.contact-fields input:focus,
.admin-search input:focus {
  outline: 1px dotted var(--text);
  outline-offset: 1px;
}

.compose-foot {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 8px;
}

.compose-note {
  flex: 1;
  color: var(--muted);
  font-size: 12px;
}

.compose-count {
  color: var(--muted);
  font: 12px var(--body);
}

/* ---------------------------------------------------------------------------
   Admin Panel
   --------------------------------------------------------------------------- */

.admin {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-bottom: 12px;
}

.admin-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.admin-search {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.admin-search input {
  flex: 1;
  max-width: 360px;
}

.admin-hint,
.admin-error {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.admin-error {
  color: #9a3b26;
}

.admin-table {
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.admin-row {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr 1.2fr 1.2fr 0.4fr 0.5fr 0.9fr 0.8fr;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-bottom: 1px solid rgba(81, 86, 81, 0.15);
}

.admin-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-head {
  position: sticky;
  top: -12px;
  background: var(--window);
  font: 600 13px var(--display);
}

.admin-name {
  font-weight: 600;
}

.admin-num,
.admin-check {
  text-align: center;
}

.admin-check {
  display: flex;
  justify-content: center;
}

.admin-events {
  display: flex;
  flex-direction: column;
  font-size: 13px;
}

.admin-event {
  display: grid;
  grid-template-columns: 170px 1.4fr 1.4fr 1fr;
  gap: 10px;
  padding: 5px 4px;
  border-bottom: 1px solid rgba(81, 86, 81, 0.15);
}

.admin-event > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-when,
.admin-detail {
  color: var(--muted);
}

.admin-what.is-warn {
  color: #9a3b26;
  font-weight: 600;
}

.admin-message {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--field);
  box-shadow: inset 1px 1px var(--bevel-lo), inset -1px -1px var(--bevel-hi);
}

.admin-message h3 {
  margin: 0 0 4px;
  font: 600 15px var(--display);
}

.admin-body {
  margin: 0;
  white-space: pre-wrap;
}

/* Drag-to-select rectangle (public/js/marquee.js). */
.marquee {
  position: fixed;
  z-index: 9000;
  pointer-events: none;
  border: 1px solid var(--title);
  background: rgba(38, 61, 101, 0.18);
}
:root[data-theme="dark"] .marquee {
  border-color: var(--highlight);
  background: rgba(255, 249, 233, 0.16);
}
.is-marquee,
.is-marquee * {
  user-select: none !important;
  cursor: default !important;
}

/* ---------------------------------------------------------------------------
   Max's Logbook (orbit://blog, public/js/blog.js): the blog in MaksimOS style:
   cream paper, navy title strips, bevels, hard shadows, pixel headings.
   --------------------------------------------------------------------------- */

.lb {
  /* Jersey (loaded in care.css) keeps the pixel look but stays legible. */
  --lb-display: "Jersey 25", "Jersey 15", var(--display);
  --lb-label: "Jersey 15", var(--display);
  min-height: 100%;
  padding: 0 0 48px;
  background: var(--desktop) var(--dither);
  color: var(--text);
  font: 15px/1.7 var(--body);
}
.lb a {
  color: inherit;
}
.lb-mast {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 20px 8px;
}
.lb-titlebar {
  display: flex;
  justify-content: space-between;
  padding: 4px 10px;
  background: var(--title);
  color: var(--on-title);
  font: 400 16px/1.4 var(--lb-label);
  letter-spacing: 0.12em;
  box-shadow: var(--shadow);
}
.lb-titlebar-dots {
  color: var(--accent);
}
.lb-mast-inner {
  padding: 18px 22px 20px;
  background: var(--window);
  box-shadow: var(--raised), var(--shadow);
}
.lb-title {
  margin: 0;
  font: 400 clamp(38px, 6vw, 56px)/1 var(--lb-display);
  letter-spacing: 0.01em;
}
.lb-title a {
  text-decoration: none;
}
.lb-sub {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 60ch;
}
.lb-loading,
.lb-empty {
  max-width: 860px;
  margin: 24px auto;
  padding: 16px 20px;
  color: var(--on-title);
  font: 400 17px/1.4 var(--lb-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.lb-index {
  display: grid;
  gap: 18px;
  max-width: 860px;
  margin: 18px auto 0;
  padding: 0 20px;
}
.lb-card {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0;
  text-decoration: none;
  background: var(--window);
  box-shadow: var(--raised), var(--shadow);
  transition: transform 0.12s steps(2), box-shadow 0.12s steps(2);
}
.lb-card:hover,
.lb-card:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: var(--raised), 5px 5px 0 rgba(36, 37, 37, 0.45);
  outline: none;
}
.lb-card-cover,
.lb-card-art {
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
  border-right: 2px solid var(--edge);
}
.lb-card-art {
  display: grid;
  place-items: center;
  background: var(--title) var(--dither);
  color: var(--accent);
  font: 400 64px/1 var(--lb-display);
}
.lb-card-body {
  padding: 14px 18px 16px;
  min-width: 0;
}
.lb-meta {
  font: 400 15px/1.4 var(--lb-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.lb-card-title {
  margin: 4px 0 6px;
  font: 400 27px/1.15 var(--lb-display);
}
.lb-card-excerpt {
  margin: 0 0 10px;
  color: var(--text);
}
.lb-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}
.lb-tags li {
  padding: 1px 8px;
  background: var(--field);
  box-shadow: var(--sunken);
  font: 400 15px/1.7 var(--lb-label);
  letter-spacing: 0.06em;
}
.lb-stats {
  display: flex;
  gap: 16px;
  font: 400 17px/1 var(--lb-label);
}
.lb-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lb-heart {
  display: inline-block;
  width: 14px;
  height: 12px;
  color: #b5523b;
}
.lb-heart svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}
.lb-foot {
  max-width: 860px;
  margin: 18px auto 0;
  padding: 0 20px;
  color: var(--on-title);
  font: 400 15px/1.4 var(--lb-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* post */
.lb-article {
  max-width: 820px;
  margin: 18px auto 0;
  padding: 22px 30px 30px;
  background: var(--window);
  box-shadow: var(--raised), var(--shadow);
}
.lb-back {
  display: inline-block;
  margin-bottom: 14px;
  font: 400 17px/1 var(--lb-label);
  text-decoration: none;
  color: var(--title) !important;
}
:root[data-theme="dark"] .lb-back {
  color: var(--accent) !important;
}
.lb-back:hover {
  text-decoration: underline;
}
.lb-post-title {
  margin: 6px 0 12px;
  font: 400 clamp(34px, 5vw, 48px)/1.05 var(--lb-display);
}
.lb-cover,
.lb-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid var(--edge);
  box-shadow: var(--shadow);
}
.lb-cover {
  margin: 6px 0 20px;
}
.lb-body {
  max-width: 68ch;
}
.lb-body .lb-h {
  margin: 28px 0 8px;
  font: 400 27px/1.2 var(--lb-display);
}
.lb-body h3.lb-h {
  font-size: 22px;
}
.lb-p {
  margin: 0 0 14px;
}
.lb-list {
  margin: 0 0 14px;
  padding-left: 22px;
}
.lb-list li {
  margin-bottom: 4px;
}
.lb-list li::marker {
  color: var(--accent);
}
.lb-quote {
  margin: 0 0 14px;
  padding: 8px 14px;
  border-left: 4px solid var(--accent);
  background: var(--field);
}
.lb-figure {
  margin: 20px 0;
}
.lb-figure figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}
.lb-body code {
  padding: 0 4px;
  background: var(--field);
  box-shadow: var(--sunken);
}
.lb-link {
  color: var(--title) !important;
  text-decoration: underline;
}
:root[data-theme="dark"] .lb-link {
  color: var(--accent) !important;
}

.lb-likebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 26px 0 8px;
  padding-top: 18px;
  border-top: 2px dashed var(--border);
}
.lb-like {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border: 0;
  background: var(--window);
  color: var(--text);
  box-shadow: var(--raised);
  font: 400 18px/1 var(--lb-label);
  cursor: pointer;
}
.lb-like:active {
  box-shadow: var(--sunken);
}
.lb-like .lb-heart {
  color: var(--muted);
}
.lb-like.is-liked .lb-heart {
  color: #b5523b;
}
.lb-like.is-liked {
  box-shadow: var(--sunken);
  background: var(--pressed);
}
.lb-like-count {
  font: 400 17px/1 var(--lb-label);
  color: var(--muted);
}
.lb-signin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--field);
  box-shadow: var(--sunken);
}

.lb-comments {
  margin-top: 26px;
}
.lb-comments-title {
  margin: 0 0 12px;
  font: 400 27px/1.15 var(--lb-display);
}
.lb-comment-list {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.lb-comment {
  padding: 10px 14px 12px;
  background: var(--field);
  box-shadow: var(--sunken);
}
.lb-comment.is-max {
  border-left: 4px solid var(--accent);
}
.lb-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font: 400 17px/1.3 var(--lb-label);
}
.lb-avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: var(--title);
  color: var(--on-title);
  font: 400 16px/1 var(--lb-label);
  box-shadow: 2px 2px 0 rgba(36, 37, 37, 0.35);
}
.is-max .lb-avatar {
  background: var(--accent);
  color: var(--text);
}
.lb-badge {
  padding: 0 6px;
  background: var(--accent);
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lb-comment-time {
  color: var(--muted);
  font-size: 12px;
}
.lb-delete {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}
.lb-comment-text {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.lb-empty-comments {
  color: var(--muted);
}
.lb-compose {
  display: grid;
  gap: 8px;
}
.lb-compose-label {
  font: 400 17px/1 var(--lb-label);
}
.lb-compose-input {
  width: 100%;
  min-height: 84px;
  padding: 8px 10px;
  border: 0;
  background: var(--field);
  color: var(--text);
  box-shadow: var(--sunken);
  font: 15px/1.5 var(--body);
  resize: vertical;
}
.lb-compose-input:focus {
  outline: 2px dotted var(--title);
  outline-offset: 2px;
}
.lb-compose-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.lb-count {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 640px) {
  .lb-card {
    grid-template-columns: 1fr;
  }
  .lb-card-cover,
  .lb-card-art {
    min-height: 120px;
    max-height: 180px;
    border-right: 0;
    border-bottom: 2px solid var(--edge);
  }
  .lb-article {
    padding: 18px 18px 24px;
  }
}

/* Flappy Bird (public/js/flappy.js): the canvas is 144x256, scaled by whole pixels. */
.flappy {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1b2a4a var(--dither);
  outline: none;
  touch-action: none;
  user-select: none;
  cursor: pointer;
}
.flappy-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Mail: links in messages and the "be careful" banner. */
.mail-url {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--title);
  font: inherit;
  text-align: left;
  text-decoration: underline;
  overflow-wrap: anywhere;
  cursor: pointer;
}
:root[data-theme="dark"] .mail-url {
  color: var(--accent);
}
.mail-warning {
  margin-top: 8px;
  padding: 6px 10px;
  background: #fbefc9;
  color: #3a2f12;
  border-left: 4px solid var(--accent);
  box-shadow: var(--sunken);
  font-size: 13px;
  line-height: 1.4;
}

/* Orbit: site icons on tiles and project pages, and orbit://portfolio. */
.ot-tile-icon img {
  width: 36px;
  height: 36px;
}
.ot-project-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.ot-project-head .ot-h1 {
  margin: 0;
}
.ot-project-icon img {
  display: block;
  width: 56px;
  height: 56px;
}
.ot-portfolio {
  max-width: 940px;
  margin: 0 auto;
  padding: 28px 28px 48px;
}
.ot-portfolio-head {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  padding: 16px 20px;
  background: var(--chrome);
  box-shadow: var(--raised), var(--shadow);
}
.ot-portfolio-head .ot-h1 {
  margin: 0 0 4px;
}
.ot-portfolio-head .ot-lead {
  margin: 0;
}
.ot-portfolio-icon img {
  display: block;
  width: 80px;
  height: 80px;
}
.ot-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.ot-pcard {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
  background: var(--o-page);
  box-shadow: var(--raised), var(--shadow);
}
.ot-pcard-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ot-pcard-icon img {
  display: block;
  width: 48px;
  height: 48px;
}
.ot-pcard-title {
  font: 26px/1.1 "Jersey 25", var(--display);
  color: var(--o-text) !important;
  text-decoration: none;
}
.ot-pcard-title:hover {
  text-decoration: underline;
}
.ot-pcard-text {
  flex: 1;
  margin: 0;
  color: var(--o-muted);
  font-size: 13px;
}
.ot-pcard .ot-tags {
  margin: 0;
}
.ot-pcard .ot-actions {
  margin-top: 2px;
}
.ot-portfolio-more {
  margin-top: 24px;
  color: var(--o-muted);
}
.sm-arrow {
  margin-left: auto;
  padding-left: 10px;
  color: var(--accent);
}

/* Logbook: admin writing tools and the editor (orbit://blog/write). */
.lb-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  max-width: 860px;
  margin: 14px auto 0;
  padding: 0 20px;
}
.lb-write {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  background: var(--accent);
  color: #242525 !important;
  box-shadow: var(--raised), var(--shadow);
  font: 18px/1 "Jersey 15", var(--display);
  letter-spacing: 0.04em;
  text-decoration: none;
}
.lb-write:active {
  box-shadow: var(--sunken);
}
.lb-tools-note {
  color: var(--on-title);
  font: 16px/1.2 "Jersey 15", var(--display);
  letter-spacing: 0.06em;
}
.lb-card.is-draft {
  opacity: 0.85;
  outline: 2px dashed var(--accent);
  outline-offset: -6px;
}
.lb-edit {
  float: right;
  margin-left: 12px;
}
.lb-draft-note {
  margin: 0 0 12px;
  padding: 6px 10px;
  background: #fbefc9;
  color: #3a2f12;
  border-left: 4px solid var(--accent);
  font-size: 13px;
}

.lb-editor {
  max-width: 900px;
  margin: 18px auto 0;
  padding: 0 20px;
}
.lb-editor-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 14px;
  background: var(--chrome);
  box-shadow: var(--raised), var(--shadow);
}
.lb-editor-bar .lb-back {
  margin: 0;
}
.lb-editor-status {
  color: var(--muted);
  font: 16px/1 "Jersey 15", var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.lb-editor-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.lb-editor-fields,
.lb-preview {
  margin-top: 16px;
  padding: 20px 24px 24px;
  background: var(--window);
  box-shadow: var(--raised), var(--shadow);
}
.lb-preview {
  max-width: none;
}
.lb-editor-fields {
  display: grid;
  gap: 16px;
}
.lb-field {
  display: grid;
  gap: 6px;
}
.lb-field-label {
  font: 17px/1 "Jersey 15", var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.lb-field-hint {
  color: var(--muted);
  font-size: 12px;
}
.lb-input {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: var(--field);
  color: var(--text);
  box-shadow: var(--sunken);
  font: 15px/1.5 var(--body);
}
.lb-input:focus {
  outline: 2px dotted var(--title);
  outline-offset: 2px;
}
.lb-input-title {
  font: 30px/1.1 "Jersey 25", var(--display);
}
.lb-input-slug {
  font-size: 13px;
}
.lb-input-content {
  min-height: 360px;
  resize: vertical;
  font-size: 15px;
  line-height: 1.65;
  tab-size: 2;
}
.lb-cover-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.lb-cover-preview {
  display: grid;
  place-items: center;
  width: 200px;
  height: 112px;
  overflow: hidden;
  background: var(--field);
  box-shadow: var(--sunken);
  color: var(--muted);
  font-size: 12px;
}
.lb-cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lb-md-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.lb-md-btn {
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  background: var(--chrome);
  color: var(--text);
  box-shadow: var(--raised);
  font: 16px/1 "Jersey 15", var(--display);
  cursor: pointer;
}
.lb-md-btn:active {
  box-shadow: var(--sunken);
}
.lb-md-tools .lb-count {
  margin-left: auto;
}
.lb-editor-danger {
  display: flex;
  justify-content: flex-end;
}
.lb-editor-danger:empty {
  display: none;
}

/* High Scores window (public/js/scores.js). */
.scores .tabs {
  flex-wrap: wrap;
}
.scores-panel {
  min-height: 300px;
}
.scores-list {
  display: grid;
  gap: 2px;
  margin: 6px 0 10px;
  padding: 0;
  list-style: none;
}
.scores-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  background: var(--field);
  box-shadow: var(--sunken);
}
.scores-row.is-me {
  background: #fbefc9;
  color: #242525;
}
.scores-rank {
  width: 34px;
  font: 18px/1 var(--display);
  color: var(--accent);
}
.scores-row:nth-child(1) .scores-rank {
  color: #c99a2e;
}
.scores-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scores-score {
  font: 18px/1 var(--display);
}
.scores-del {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}
.scores-hint,
.scores-empty,
.scores-me {
  color: var(--muted);
  font-size: 13px;
}
.scores-me {
  color: var(--text);
}

/* Minesweeper (public/js/minesweeper.js). */
.mines {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--chrome);
  user-select: none;
}
.mines-frame {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: center;
  margin: 10px;
  padding: 8px;
  box-shadow: var(--raised);
  background: #c9c9be;
}
.mines-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 6px;
  box-shadow: inset 2px 2px #515651, inset -2px -2px #fff9e9;
}
.mines-led {
  min-width: 46px;
  padding: 2px 4px;
  background: #160c0a;
  color: #ff4a2e;
  font: 26px/1 "Jersey 15", monospace;
  letter-spacing: 0.06em;
  text-align: center;
  text-shadow: 0 0 4px rgba(255, 74, 46, 0.55);
  box-shadow: inset 1px 1px #515651, inset -1px -1px #fff9e9;
}
.mines-face {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: #c9c9be;
  box-shadow: inset -1px -1px #242525, inset 1px 1px #fff9e9, inset -2px -2px #515651, inset 2px 2px #e4e2d8;
  cursor: pointer;
}
.mines-face:active {
  box-shadow: inset 1px 1px #515651, inset 2px 2px #242525;
}
.mines-face svg {
  width: 24px;
  height: 24px;
}
.mines-grid {
  display: grid;
  border: 3px solid;
  border-color: #515651 #fff9e9 #fff9e9 #515651;
}
.mines-cell {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: #c9c9be;
  box-shadow: inset -2px -2px #6f746e, inset 2px 2px #fff9e9;
  color: #242525;
  font: 19px/22px "Jersey 15", monospace;
  text-align: center;
  cursor: default;
}
.mines-cell:focus-visible {
  outline: 1px dotted #242525;
  outline-offset: -4px;
}
.mines-cell.is-open {
  background: #d9d8cf;
  box-shadow: inset 1px 1px #8e918a;
}
.mines-cell[data-n="1"] { color: #2346c4; }
.mines-cell[data-n="2"] { color: #2f7d32; }
.mines-cell[data-n="3"] { color: #c0392b; }
.mines-cell[data-n="4"] { color: #1b2a6b; }
.mines-cell[data-n="5"] { color: #7a2418; }
.mines-cell[data-n="6"] { color: #1f7a78; }
.mines-cell[data-n="7"] { color: #242525; }
.mines-cell[data-n="8"] { color: #6f746e; }
.mines-cell.is-flag {
  color: #c0392b;
}
.mines-cell.is-mine {
  color: #242525;
  font-size: 18px;
}
.mines-cell.is-hit {
  background: #e0452e;
}
.mines-cell.is-wrong {
  background: #f1c9bf;
  text-decoration: line-through;
}

/* Solitaire (public/js/solitaire.js). Cards are drawn with CSS, sized by --sol-scale. */
.sol {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.sol-board {
  --sol-scale: 1;
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #2f6a5a var(--dither);
  outline: none;
  user-select: none;
  touch-action: none;
}
.sol-slot,
.sol-card {
  position: absolute;
  width: calc(66px * var(--sol-scale));
  height: calc(92px * var(--sol-scale));
}
.sol-slot {
  display: grid;
  place-items: center;
  border: 2px dashed rgba(255, 249, 233, 0.35);
  color: rgba(255, 249, 233, 0.35);
  font: calc(30px * var(--sol-scale)) / 1 "Jersey 25", monospace;
}
.sol-card {
  background: #fff9e9;
  box-shadow: 0 0 0 1px #242525, 2px 2px 0 1px rgba(0, 0, 0, 0.35);
  color: #242525;
  cursor: grab;
}
.sol-card.is-red {
  color: #b5523b;
}
.sol-card.is-back {
  background:
    repeating-linear-gradient(45deg, transparent 0 3px, rgba(255, 249, 233, 0.14) 3px 5px),
    repeating-linear-gradient(-45deg, transparent 0 3px, rgba(255, 249, 233, 0.14) 3px 5px),
    #263d65;
  box-shadow: 0 0 0 1px #242525, inset 0 0 0 3px #fff9e9, inset 0 0 0 4px #242525, 2px 2px 0 1px rgba(0, 0, 0, 0.35);
  cursor: default;
}
.sol-card.is-dragging {
  box-shadow: 0 0 0 1px #242525, 6px 6px 0 1px rgba(0, 0, 0, 0.35);
  cursor: grabbing;
}
.sol-corner {
  position: absolute;
  top: calc(3px * var(--sol-scale));
  left: calc(4px * var(--sol-scale));
  font: calc(19px * var(--sol-scale)) / 1 "Jersey 15", monospace;
  letter-spacing: -0.02em;
}
.sol-corner-b {
  top: auto;
  left: auto;
  right: calc(4px * var(--sol-scale));
  bottom: calc(3px * var(--sol-scale));
  transform: rotate(180deg);
}
.sol-pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(36px * var(--sol-scale));
  line-height: 1;
}
.sol-win {
  position: absolute;
  inset: 0;
  z-index: 900;
  cursor: pointer;
}

/* Menu items with an app icon (Start menu Programs ▸ / Games ▸). */
.menu-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
}
.menu-icon > svg,
.menu-icon > img {
  width: 20px;
  height: 20px;
}

/* Paint (public/js/paint.js). */
.paint {
  display: flex;
  flex-direction: column;
  height: 100%;
  outline: none;
}
.paint-main {
  display: flex;
  flex: 1;
  min-height: 0;
}
.paint-tools {
  display: grid;
  grid-template-columns: repeat(2, 30px);
  align-content: start;
  gap: 3px;
  padding: 6px;
  background: var(--chrome);
  border-right: 1px solid var(--border);
}
.paint-tool,
.paint-size {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  padding: 0;
  border: 0;
  background: var(--chrome);
  color: var(--text);
  box-shadow: var(--raised);
  cursor: pointer;
}
.paint-tool svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.paint-tool[aria-pressed="true"],
.paint-size[aria-pressed="true"] {
  box-shadow: var(--sunken);
  background: var(--pressed);
}
.paint-size span {
  display: block;
  background: currentColor;
}
.paint-sep {
  grid-column: 1 / -1;
  height: 2px;
  margin: 4px 0;
  box-shadow: inset 0 1px var(--bevel-lo), inset 0 -1px var(--bevel-hi);
}
.paint-stage {
  flex: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 12px;
  background: #8e918a var(--dither);
}
.paint-canvas-wrap {
  position: relative;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.4);
  /* Checkerboard shows transparent pixels. */
  background: conic-gradient(#e4e2d8 25%, #fff9e9 0 50%, #e4e2d8 0 75%, #fff9e9 0) 0 0 / 16px 16px;
}
.paint-canvas,
.paint-overlay {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.paint-overlay {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  touch-action: none;
}
.paint[data-tool="fill"] .paint-overlay,
.paint[data-tool="picker"] .paint-overlay {
  cursor: cell;
}
.paint-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: var(--chrome);
  border-top: 1px solid var(--border);
}
.paint-current {
  position: relative;
  flex: none;
  width: 40px;
  height: 34px;
}
.paint-swatch {
  position: absolute;
  width: 24px;
  height: 24px;
  box-shadow: 0 0 0 1px #242525, inset 0 0 0 1px #fff9e9;
}
.paint-swatch.is-primary {
  top: 0;
  left: 0;
  z-index: 1;
}
.paint-swatch.is-secondary {
  right: 0;
  bottom: 0;
}
.paint-swatch.is-clear,
.paint-color.is-clear {
  background: conic-gradient(#c9c9be 25%, #fff9e9 0 50%, #c9c9be 0 75%, #fff9e9 0) 0 0 / 8px 8px;
}
.paint-palette {
  display: grid;
  grid-template-columns: repeat(10, 18px);
  gap: 2px;
}
.paint-color {
  width: 18px;
  height: 16px;
  padding: 0;
  border: 0;
  box-shadow: inset 1px 1px #515651, inset -1px -1px #fff9e9, 0 0 0 1px #242525;
  cursor: pointer;
}
.paint-custom input {
  width: 30px;
  height: 26px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

/* Music (public/js/music.js): a tiny Winamp-style player. */
.amp {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 8px;
  background: linear-gradient(#3a3f4a, #262a32);
  color: #c9d1c4;
  font: 13px/1.3 var(--body);
}
.amp-display {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 4px 8px;
  padding: 6px;
  background: #0b0f0c;
  box-shadow: inset 1px 1px #000, inset -1px -1px #5a606b;
}
.amp-led {
  grid-row: span 2;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6ec46e;
  font: 30px/1 "Jersey 15", monospace;
  text-shadow: 0 0 5px rgba(110, 196, 110, 0.6);
}
.amp-state {
  font-size: 14px;
}
.amp-title-wrap {
  overflow: hidden;
  white-space: nowrap;
  color: #6ec46e;
  font: 16px/1.2 "Jersey 15", monospace;
}
.amp-title {
  display: inline-block;
  padding-left: 100%;
  animation: amp-scroll 14s linear infinite;
}
@keyframes amp-scroll {
  to { transform: translateX(-100%); }
}
:root[data-motion="off"] .amp-title {
  animation: none;
  padding-left: 0;
}
.amp-viz {
  width: 152px;
  height: 34px;
  image-rendering: pixelated;
}
.amp-seek {
  width: 100%;
  accent-color: #e3b95f;
}
.amp-controls {
  display: flex;
  gap: 3px;
}
.amp-controls button {
  min-width: 30px;
  height: 24px;
  padding: 0 6px;
  border: 0;
  background: linear-gradient(#6b717d, #474c56);
  color: #e9e6dc;
  box-shadow: inset 1px 1px #8d939f, inset -1px -1px #23262c;
  font: 13px/1 var(--body);
  cursor: pointer;
}
.amp-controls button:active,
.amp-toggle[aria-pressed="true"] {
  box-shadow: inset 1px 1px #23262c, inset -1px -1px #8d939f;
  color: #6ec46e;
}
.amp-toggle {
  font: 14px/1 "Jersey 15", monospace !important;
}
.amp-spacer {
  flex: 1;
}
.amp-hint {
  margin: 0;
  color: #e3b95f;
  font-size: 12px;
}
.amp-list {
  flex: 1;
  margin: 0;
  padding: 4px;
  overflow: auto;
  list-style: none;
  background: #0b0f0c;
  box-shadow: inset 1px 1px #000, inset -1px -1px #5a606b;
  font: 16px/1.4 "Jersey 15", monospace;
}
.amp-item {
  display: flex;
  justify-content: space-between;
  padding: 0 6px;
  color: #6ec46e;
  cursor: default;
}
.amp-item.is-current {
  background: #263d65;
  color: #fff9e9;
}
.amp-item:focus-visible {
  outline: 1px dotted #6ec46e;
}

/* Screensaver (public/js/screensaver.js): low-res canvas scaled up crisply. */
.screensaver {
  position: fixed;
  inset: 0;
  z-index: 100000;
  width: 100vw;
  height: 100vh;
  background: #000;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: none;
}
.saver-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.saver-row select {
  margin-left: 4px;
  font: inherit;
}

/* Guestbook (public/js/guestbook.js). */
.gb {
  height: 100%;
  overflow-y: auto;
  padding: 16px 18px 20px;
  background: var(--window) var(--dither);
}
.gb-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.gb-title {
  margin: 0;
  font: 34px/1 "Jersey 25", var(--display);
}
.gb-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.gb-form,
.gb-signin {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--chrome);
  box-shadow: var(--raised), var(--shadow);
}
.gb-signin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.gb-label {
  font: 17px/1 var(--display);
}
.gb-input {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: var(--field);
  color: var(--text);
  box-shadow: var(--sunken);
  font: 15px/1.5 var(--body);
  resize: vertical;
}
.gb-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gb-count,
.gb-date {
  color: var(--muted);
  font-size: 12px;
}
.gb-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gb-note {
  padding: 10px 14px 12px;
  background: var(--field);
  box-shadow: var(--sunken);
}
.gb-note.is-max {
  border-left: 4px solid var(--accent);
}
.gb-note-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font: 17px/1.2 var(--display);
}
.gb-avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: var(--title);
  color: var(--on-title);
  font: 15px/1 var(--display);
}
.is-max .gb-avatar {
  background: var(--accent);
  color: #242525;
}
.gb-badge {
  padding: 0 6px;
  background: var(--accent);
  color: #242525;
  font-size: 13px;
}
.gb-delete {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
.gb-text {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.gb-empty {
  color: var(--muted);
}
.gb-more {
  margin-top: 12px;
  text-align: center;
}

/* Admin Panel charts (public/js/adminpanel.js). Series colours validated for
   colour-vision deficiency and contrast against each theme's surface. */
.admin {
  --viz-a: #0a8f9c; /* signed in / single series */
  --viz-b: #c4683a; /* guests */
}
:root[data-theme="dark"] .admin {
  --viz-a: #2fa6ae;
  --viz-b: #cf7a44;
}
.viz-a { background: var(--viz-a); }
.viz-b { background: var(--viz-b); }
.viz-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.viz-filters .btn[aria-pressed="true"] {
  box-shadow: var(--sunken);
  background: var(--pressed);
}
.viz-table-toggle {
  margin-left: auto;
}
.viz-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.viz-tile {
  padding: 8px 10px;
  background: var(--field);
  box-shadow: var(--sunken);
}
.viz-tile-label {
  color: var(--muted);
  font: 15px/1 var(--display);
  letter-spacing: 0.04em;
}
.viz-tile-value {
  margin-top: 4px;
  font: 34px/1 "Jersey 25", var(--display);
}
.viz-tile-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}
.viz-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.viz-charts[hidden] {
  display: none;
}
.viz {
  margin: 0;
  padding: 10px 12px 8px;
  background: var(--window);
  box-shadow: var(--raised);
}
.viz-title {
  margin-bottom: 6px;
  font: 18px/1.2 var(--display);
}
.viz-legend {
  display: flex;
  gap: 14px;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 12px;
}
.viz-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.viz-key {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.viz-plot {
  position: relative;
  height: 140px;
  margin-left: 26px;
  border-bottom: 1px solid var(--border);
}
.viz-grid {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(95, 99, 94, 0.3);
}
.viz-axis {
  position: absolute;
  right: 100%;
  top: -7px;
  padding-right: 6px;
  color: var(--muted);
  font-size: 11px;
}
.viz-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 2px;
}
.viz-col {
  flex: 1;
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  height: 100%;
  min-width: 2px;
  justify-content: flex-start;
  cursor: default;
}
.viz-col:hover {
  background: rgba(95, 99, 94, 0.12);
}
.viz-col .viz-seg:last-child {
  border-radius: 3px 3px 0 0;
}
.viz-x {
  display: flex;
  margin-left: 26px;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
}
.viz-x span {
  flex: 1;
  min-width: 2px;
  overflow: visible;
  white-space: nowrap;
}
.viz-rank {
  display: grid;
  gap: 6px;
}
.viz-rank-row {
  display: grid;
  grid-template-columns: 110px 1fr 40px;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.viz-rank-track {
  height: 12px;
}
.viz-rank-track .viz-seg {
  display: block;
  height: 100%;
  border-radius: 0 3px 3px 0;
}
.viz-rank-value {
  text-align: right;
  color: var(--text);
}
.viz-h {
  margin: 18px 0 8px;
  font: 20px/1.2 var(--display);
}
.viz-tip {
  position: fixed;
  z-index: 99999;
  padding: 6px 9px;
  background: #242525;
  color: #fff9e9;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35);
  font: 12px/1.45 var(--body);
  pointer-events: none;
}
.viz-tip-head {
  font: 15px/1.2 var(--display);
}
.admin-table-plain {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table-plain th,
.admin-table-plain td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(95, 99, 94, 0.25);
  text-align: left;
}
.admin-table-plain th {
  font: 15px/1.2 var(--display);
  color: var(--muted);
}
.mod-section {
  margin-bottom: 10px;
}
.mod-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: center;
  margin-bottom: 6px;
  padding: 8px 10px;
  background: var(--field);
  box-shadow: var(--sunken);
}
.mod-meta {
  grid-column: 1;
  color: var(--muted);
  font-size: 12px;
}
.mod-body {
  grid-column: 1;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.mod-row > .btn {
  grid-column: 2;
  grid-row: 1 / span 2;
}

/* ---------------------------------------------------------------------------
   Phone layout (html.is-phone, max-width 640px): home screen with an app
   grid, full-screen apps, Home / Switch-apps buttons in the taskbar.
   --------------------------------------------------------------------------- */
.phone-home,
.phone-nav,
.phone-switcher {
  display: none;
}
.is-phone .desktop-icons,
.is-phone .task-buttons,
.is-phone .taskbar > .taskbar-divider {
  display: none;
}
.is-phone .phone-home:not([hidden]) {
  position: absolute;
  inset: 0 0 var(--taskbar-h) 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: calc(26px + var(--safe-t)) 14px 18px;
  background: linear-gradient(rgba(10, 16, 28, 0.25), rgba(10, 16, 28, 0.55));
  -webkit-overflow-scrolling: touch;
}
.phone-home-top {
  margin-bottom: 22px;
  color: #fff9e9;
  text-align: center;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.55);
}
.phone-clock {
  font: 64px/1 "Jersey 25", var(--display);
}
.phone-date {
  margin-top: 4px;
  font: 18px/1.2 var(--display);
}
.phone-hello {
  margin-top: 8px;
  font: 15px/1.3 var(--body);
  opacity: 0.9;
}
.phone-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 6px;
}
.phone-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: #fff9e9;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.phone-app-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  background: rgba(242, 240, 232, 0.92);
  box-shadow: inset -1px -1px #242525, inset 1px 1px #fff9e9, inset -2px -2px #515651, inset 2px 2px #e4e2d8, 3px 3px 0 rgba(0, 0, 0, 0.45);
}
.phone-app-icon > svg,
.phone-app-icon > img {
  width: 40px;
  height: 40px;
}
.phone-app:active .phone-app-icon {
  box-shadow: inset 1px 1px #515651, inset 2px 2px #242525;
}
.phone-app-label {
  max-width: 100%;
  overflow: hidden;
  font: 15px/1.1 var(--display);
  text-overflow: ellipsis;
  text-shadow: 1px 1px 0 #242525, 0 0 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}
.is-phone .phone-nav {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 10px;
}
.phone-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 58px;
  height: 36px;
  padding: 0 10px;
  border: 0;
  background: var(--chrome);
  color: var(--text);
  box-shadow: var(--raised);
  font: 22px/1 var(--display);
  cursor: pointer;
}
.phone-nav button:active {
  box-shadow: var(--sunken);
}
.phone-count {
  font-size: 14px;
}
.is-phone .start-button {
  min-width: 0;
}
.is-phone .tray-more,
.is-phone #tray-net {
  display: none;
}
.is-phone .phone-switcher:not([hidden]) {
  position: fixed;
  inset: 0 0 var(--taskbar-h) 0;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 18px 14px;
  background: rgba(16, 22, 34, 0.94) var(--dither);
}
.phone-switcher-head {
  color: #fff9e9;
  font: 26px/1 "Jersey 25", var(--display);
}
.phone-switcher-empty {
  color: #c9c9be;
}
.phone-switch-row {
  display: flex;
  gap: 8px;
}
.phone-switch-open {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  background: var(--window);
  color: var(--text);
  box-shadow: var(--raised), var(--shadow);
  font: 18px/1.2 var(--display);
  text-align: left;
  cursor: pointer;
}
.phone-switch-open .phone-app-icon {
  flex: none;
  width: 40px;
  height: 40px;
}
.phone-switch-open .phone-app-icon > svg,
.phone-switch-open .phone-app-icon > img {
  width: 28px;
  height: 28px;
}
.phone-switch-open > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-switch-close {
  width: 52px;
  border: 0;
  background: var(--chrome);
  color: var(--text);
  box-shadow: var(--raised);
  font: 20px/1 var(--display);
  cursor: pointer;
}
.phone-switcher-done {
  align-self: center;
  margin-top: 6px;
}
/* Full-screen apps: bigger title-bar buttons for fingers; games scroll if wide. */
.is-phone .window .tb {
  width: 34px;
  height: 30px;
}
.is-phone .mines {
  overflow: auto;
}
.is-phone .window.is-app {
  inset: 0 !important;
  width: auto !important;
  height: auto !important;
}
.is-phone .window.is-app .resize-handle,
.is-phone .window.is-app .tb-max {
  display: none;
}
/* Message boxes stay compact, centred near the top, and never run off screen. */
.is-phone .window:not(.is-app) {
  left: 8px !important;
  right: 8px !important;
  top: 12% !important;
  width: auto !important;
  max-height: calc(100% - 14%);
  overflow: auto;
}

/* Game button bar (public/js/gamebar.js). */
.game-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  background: var(--chrome);
  border-bottom: 1px solid var(--border);
}
.game-bar-spacer {
  flex: 1;
}
.game-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: 0;
  background: var(--chrome);
  color: var(--text);
  box-shadow: var(--raised);
  font: 16px/1 var(--display);
  cursor: pointer;
  white-space: nowrap;
}
.game-btn:active,
.game-btn[aria-pressed="true"] {
  box-shadow: var(--sunken);
  background: var(--pressed);
}
.game-btn.is-primary {
  background: var(--title);
  color: var(--on-title);
}
.game-btn-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-size: 15px;
}
.game-btn-icon > img,
.game-btn-icon > svg {
  width: 18px;
  height: 18px;
}
.game-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.game-seg {
  display: inline-flex;
}
.game-seg-btn {
  padding: 0 8px;
}
.flappy-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.flappy-shell .flappy {
  flex: 1;
  min-height: 0;
}
.gb-badge.is-guest {
  background: var(--chrome);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--border);
}
.gb-name {
  font-size: 15px;
}
.gb-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.gb-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.gb-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--title);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
:root[data-theme="dark"] .gb-link {
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Avatars, profiles, forum
   -------------------------------------------------------------------------- */

.avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  overflow: hidden;
  width: 32px;
  height: 32px;
  background: var(--title);
  color: var(--on-title);
  font: 18px/1 var(--display);
}
.avatar img,
.gb-avatar img,
.lb-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.gb-avatar img,
.lb-avatar img {
  background: var(--title);
}

.forum {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  height: 100%;
  background: var(--window);
  color: var(--text);
}
.forum-cats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  overflow-y: auto;
  background: var(--chrome);
  box-shadow: inset -1px 0 var(--bevel-lo);
}
.forum-cat {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: 16px/1.1 var(--display);
  text-align: left;
  cursor: pointer;
}
.forum-cat:hover {
  background: var(--pressed);
}
.forum-cat.is-on {
  background: var(--select);
  color: var(--select-text);
}
.forum-main {
  min-width: 0;
  padding: 14px 16px;
  overflow-y: auto;
}
.forum-head,
.profile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.forum-title {
  margin: 0;
  font: 24px/1.1 var(--display);
  overflow-wrap: anywhere;
}
.forum-sub,
.forum-row-meta {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.forum-note {
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
}
.forum-list,
.forum-posts,
.profile-scores,
.profile-badges {
  margin: 0;
  padding: 0;
  list-style: none;
}
.forum-row {
  display: flex;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--bevel-mid);
}
.forum-row.is-pinned {
  background: var(--field);
}
.forum-row-text {
  min-width: 0;
}
.forum-row-title,
.forum-author,
.forum-back {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.forum-row-title {
  font: 18px/1.15 var(--display);
}
.forum-author {
  font-weight: 600;
}
.forum-row-title:hover,
.forum-author:hover,
.forum-back:hover {
  text-decoration: underline;
}
.forum-back {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}
.forum-tag {
  margin-right: 6px;
  padding: 0 5px;
  background: var(--accent);
  color: #242525;
}
.forum-more {
  padding: 12px 0;
  text-align: center;
}
.forum-post {
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--field);
  box-shadow: var(--sunken);
}
.forum-post.is-max {
  border-left: 4px solid var(--accent);
}
.forum-post-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.forum-date {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.forum-body {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.forum-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.forum-form .field {
  width: 100%;
  padding: 6px 8px;
  border: 0;
  background: var(--field);
  color: var(--text);
  box-shadow: var(--sunken);
  font: 13px/1.4 var(--body);
}
.forum-text {
  resize: vertical;
}
.forum-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile {
  height: 100%;
  padding: 16px;
  overflow-y: auto;
  background: var(--window);
  color: var(--text);
}
.profile-head {
  justify-content: flex-start;
}
.profile-head-text {
  flex: 1;
  min-width: 0;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  font-size: 48px;
  box-shadow: var(--sunken);
}
.profile-bio {
  margin: 8px 0 0;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.profile-heading {
  margin: 16px 0 6px;
  font: 18px/1.1 var(--display);
}
.profile-scores li {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--bevel-mid);
  font-size: 13px;
}
.profile-badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}
.profile-badge {
  padding: 7px 8px;
  background: var(--chrome);
  color: var(--muted);
  font-size: 11px;
  opacity: 0.72;
}
.profile-badge strong {
  display: block;
  font: 16px/1.1 var(--display);
}
.profile-badge.is-earned {
  background: #e3b95f;
  color: #242525;
  box-shadow: var(--raised);
  opacity: 1;
}
.profile-avatars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
}
.profile-pick {
  padding: 4px;
  border: 0;
  background: var(--chrome);
  box-shadow: var(--raised);
  cursor: pointer;
}
.profile-pick .avatar {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}
.profile-pick[aria-checked="true"] {
  outline: 3px solid var(--accent);
  outline-offset: -1px;
}
.scores-avatar {
  width: 22px;
  height: 22px;
  font-size: 14px;
}
.wallpaper-custom {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.wallpaper-custom[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   Tray: live count, notifications, toasts
   -------------------------------------------------------------------------- */

.tray-online {
  padding: 0 4px;
  font: 15px/1 var(--display);
  white-space: nowrap;
}
#tray-bell {
  position: relative;
}
#tray-bell .icon-img {
  width: 20px;
  height: 20px;
}
.bell-flyout {
  position: absolute;
  right: 4px;
  bottom: calc(var(--taskbar-h) - 2px);
  z-index: 2001;
  display: flex;
  flex-direction: column;
  width: 320px;
  max-width: calc(100vw - 8px);
  max-height: 60vh;
  background: var(--chrome);
  box-shadow: var(--raised), var(--shadow);
}
.bell-flyout[hidden] {
  display: none;
}
.bell-head {
  margin: 0;
  padding: 8px 10px;
  font: 18px/1 var(--display);
}
.bell-list {
  margin: 0 4px 4px;
  padding: 0;
  overflow-y: auto;
  background: var(--field);
  box-shadow: var(--sunken);
  list-style: none;
}
.bell-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}
.bell-item {
  display: block;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-bottom: 1px solid var(--bevel-mid);
  background: none;
  color: var(--text);
  font: 12px/1.35 var(--body);
  text-align: left;
  cursor: pointer;
}
.bell-item:hover {
  background: var(--pressed);
}
.bell-item.is-new {
  border-left: 4px solid var(--accent);
  font-weight: 600;
}
.bell-title {
  display: block;
  overflow-wrap: anywhere;
}
.bell-date {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.toasts {
  position: absolute;
  right: 10px;
  bottom: calc(var(--taskbar-h) + 10px);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 300px;
  max-width: calc(100vw - 20px);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  background: var(--chrome);
  color: var(--text);
  box-shadow: var(--raised), var(--shadow);
  font: 12px/1.35 var(--body);
  text-align: left;
  cursor: pointer;
  pointer-events: auto;
  animation: toast-in 160ms steps(4);
}
.toast.is-gold {
  background: #e3b95f;
  color: #242525;
}
.toast-icon {
  flex: none;
  width: 28px;
  height: 28px;
}
.toast-icon svg,
.toast-icon img {
  width: 100%;
  height: 100%;
}
.toast-text {
  overflow-wrap: anywhere;
}
@keyframes toast-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Tour
   -------------------------------------------------------------------------- */

.tour {
  position: fixed;
  inset: 0;
  z-index: 9000;
}
.tour.is-center {
  display: grid;
  place-items: center;
  background: rgba(18, 22, 30, 0.62);
}
.tour-hole {
  position: fixed;
  outline: 3px solid var(--accent);
  box-shadow: 0 0 0 200vmax rgba(18, 22, 30, 0.62);
  pointer-events: none;
}
.tour-hole[hidden] {
  display: none;
}
.tour-card {
  position: fixed;
  width: 320px;
  max-width: calc(100vw - 16px);
  padding: 14px;
  background: var(--window);
  color: var(--text);
  box-shadow: var(--raised), var(--shadow);
}
.tour.is-center .tour-card {
  position: static;
}
.tour-title {
  margin: 0 0 6px;
  font: 22px/1.1 var(--display);
}
.tour-text {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
}
.tour-foot {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tour-count {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 640px) {
  .forum {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .forum-cats {
    flex-direction: row;
    overflow-x: auto;
    box-shadow: inset 0 -1px var(--bevel-lo);
  }
  .forum-cat {
    flex: none;
  }
  .tray-online {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Scrollbars: bevelled, with pixel arrows. Firefox can only recolour its own.
   -------------------------------------------------------------------------- */

:root {
  --arrow-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' shape-rendering='crispEdges'%3E%3Cpath fill='%23242525' d='M3 0h2v1h1v1h1v1h1v2H0V3h1V2h1V1h1z'/%3E%3C/svg%3E");
  --arrow-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' shape-rendering='crispEdges'%3E%3Cpath fill='%23242525' d='M0 0h8v2H7v1H6v1H5v1H3V4H2V3H1V2H0z'/%3E%3C/svg%3E");
  --arrow-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='5' height='8' shape-rendering='crispEdges'%3E%3Cpath fill='%23242525' d='M3 0h2v8H3V7H2V6H1V5H0V3h1V2h1V1h1z'/%3E%3C/svg%3E");
  --arrow-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='5' height='8' shape-rendering='crispEdges'%3E%3Cpath fill='%23242525' d='M0 0h2v1h1v1h1v1h1v2H4v1H3v1H2v1H0z'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] {
  --arrow-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' shape-rendering='crispEdges'%3E%3Cpath fill='%23e9e6dc' d='M3 0h2v1h1v1h1v1h1v2H0V3h1V2h1V1h1z'/%3E%3C/svg%3E");
  --arrow-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' shape-rendering='crispEdges'%3E%3Cpath fill='%23e9e6dc' d='M0 0h8v2H7v1H6v1H5v1H3V4H2V3H1V2H0z'/%3E%3C/svg%3E");
  --arrow-left: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='5' height='8' shape-rendering='crispEdges'%3E%3Cpath fill='%23e9e6dc' d='M3 0h2v8H3V7H2V6H1V5H0V3h1V2h1V1h1z'/%3E%3C/svg%3E");
  --arrow-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='5' height='8' shape-rendering='crispEdges'%3E%3Cpath fill='%23e9e6dc' d='M0 0h2v1h1v1h1v1h1v2H4v1H3v1H2v1H0z'/%3E%3C/svg%3E");
}
::-webkit-scrollbar {
  width: 16px;
  height: 16px;
}
::-webkit-scrollbar-track {
  background-color: var(--bevel-mid);
  background-image: var(--dither);
  box-shadow: inset 1px 0 var(--bevel-lo);
}
::-webkit-scrollbar-thumb {
  min-height: 24px;
  min-width: 24px;
  background: var(--chrome);
  box-shadow: var(--raised);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--bevel-mid);
}
::-webkit-scrollbar-thumb:active {
  background: var(--pressed);
}
::-webkit-scrollbar-button:single-button {
  display: block;
  width: 16px;
  height: 16px;
  background-color: var(--chrome);
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: var(--raised);
}
::-webkit-scrollbar-button:single-button:active {
  background-color: var(--pressed);
  box-shadow: var(--sunken);
}
::-webkit-scrollbar-button:single-button:vertical:decrement {
  background-image: var(--arrow-up);
}
::-webkit-scrollbar-button:single-button:vertical:increment {
  background-image: var(--arrow-down);
}
::-webkit-scrollbar-button:single-button:horizontal:decrement {
  background-image: var(--arrow-left);
}
::-webkit-scrollbar-button:single-button:horizontal:increment {
  background-image: var(--arrow-right);
}
::-webkit-scrollbar-corner {
  background: var(--chrome);
}
/* Setting these in Chrome would switch off everything above. */
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-color: var(--chrome) var(--bevel-mid);
  }
}

/* --------------------------------------------------------------------------
   Shared Folder and Big Canvas
   -------------------------------------------------------------------------- */

.shared {
  height: 100%;
  padding: 14px 16px;
  overflow-y: auto;
  background: var(--window);
  color: var(--text);
}
.shared.is-drop-target {
  outline: 3px dashed var(--accent);
  outline-offset: -6px;
}
.shared-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.shared-grid > .forum-note {
  grid-column: 1 / -1;
}
.shared-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: inherit;
  font: 12px/1.25 var(--body);
  cursor: pointer;
}
.shared-item:hover {
  background: var(--pressed);
}
.shared-icon {
  width: 48px;
  height: 48px;
}
.shared-icon svg,
.shared-icon img {
  width: 100%;
  height: 100%;
}
.shared-name,
.shared-owner {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.shared-owner {
  color: var(--muted);
  font-size: 11px;
}
.shared-pick {
  margin: 0;
  padding: 0;
  list-style: none;
}
.shared-pick li {
  padding: 7px 4px;
  border-bottom: 1px solid var(--bevel-mid);
}
.shared-image {
  display: block;
  max-width: 100%;
  background: #fff;
  box-shadow: var(--sunken);
  image-rendering: pixelated;
}
.shared-text {
  margin: 0;
  padding: 10px 12px;
  background: var(--field);
  box-shadow: var(--sunken);
  font: 13px/1.5 var(--body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bigc {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--chrome);
  color: var(--text);
}
.bigc-bar,
.bigc-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 6px 8px;
}
.bigc-tools,
.bigc-actions {
  display: flex;
  gap: 4px;
}
.bigc-tools .btn[aria-pressed="true"] {
  background: var(--select);
  color: var(--select-text);
  box-shadow: var(--sunken);
}
.bigc-picker {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.bigc-picker input {
  width: 40px;
  height: 28px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: var(--sunken);
  cursor: pointer;
}
.bigc-hex {
  font: 13px/1 var(--body);
}
.bigc-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.bigc-color {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  box-shadow: var(--sunken);
  cursor: pointer;
}
.bigc-color[aria-pressed="true"] {
  outline: 3px solid var(--accent);
}
.bigc-left {
  font: 16px/1 var(--display);
}
.bigc-actions {
  margin-left: auto;
}
.bigc-place:not(:disabled) {
  background: var(--accent);
  color: #242525;
}
.bigc-view {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  box-shadow: var(--sunken);
  cursor: crosshair;
  touch-action: none;
}
.bigc-view.is-move {
  cursor: grab;
}
.bigc-view.is-inspect {
  cursor: help;
}
.bigc-view canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.bigc-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  margin: 0;
  padding: 4px 10px;
  transform: translateX(-50%);
  background: rgba(36, 37, 37, 0.82);
  color: #fff9e9;
  font: 15px/1.2 var(--display);
  white-space: nowrap;
  pointer-events: none;
}
.bigc-hint[hidden] {
  display: none;
}
@media (max-width: 640px) {
  .bigc-color {
    width: 28px;
    height: 28px;
  }
}

.admin-canvas {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin: 8px 0;
}
.admin-canvas label {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.admin-canvas .field {
  width: 140px;
  padding: 4px 6px;
  border: 0;
  background: var(--field);
  color: var(--text);
  box-shadow: var(--sunken);
}

.ex-owner {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Announcements and What's New
   -------------------------------------------------------------------------- */

.toasts {
  bottom: calc(var(--taskbar-h) + 10px + var(--announce-h, 0px));
}
.announce {
  position: absolute;
  right: 10px;
  bottom: calc(var(--taskbar-h) + 10px);
  z-index: 2000;
  width: 330px;
  max-width: calc(100vw - 20px);
  padding: 10px 12px 12px;
  background: var(--chrome);
  color: var(--text);
  box-shadow: var(--raised), var(--shadow);
  animation: toast-in 160ms steps(4);
}
.announce-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.announce-icon {
  flex: none;
  width: 26px;
  height: 26px;
}
.announce-icon img {
  width: 100%;
  height: 100%;
}
.announce-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font: 19px/1.1 var(--display);
  overflow-wrap: anywhere;
}
.announce-close {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: var(--chrome);
  color: inherit;
  box-shadow: var(--raised);
  font: 16px/1 var(--body);
  cursor: pointer;
}
.announce-close:active {
  box-shadow: var(--sunken);
}
.announce-body {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.announce-body:last-child {
  margin-bottom: 0;
}
@media (prefers-reduced-motion: reduce) {
  .announce {
    animation: none;
  }
}
.clog {
  height: 100%;
  padding: 16px;
  overflow-y: auto;
  background: var(--window);
  color: var(--text);
}
.clog-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.clog-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bevel-mid);
}
.clog-kind {
  flex: none;
  width: 66px;
  padding: 2px 0;
  background: var(--title);
  color: var(--on-title);
  font: 14px/1.1 var(--display);
  text-align: center;
  align-self: flex-start;
}
.clog-kind.is-changed {
  background: var(--accent);
  color: #242525;
}
.clog-kind.is-fixed {
  background: #6e9a5b;
  color: #242525;
}
.clog-text {
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
}
.clog-text p {
  margin: 2px 0 0;
  color: var(--muted);
}
.admin-form {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px;
  background: var(--chrome);
  box-shadow: var(--raised);
}
.admin-form label {
  display: grid;
  gap: 3px;
  font-size: 12px;
}
.admin-form .field {
  width: 100%;
  padding: 4px 6px;
  border: 0;
  background: var(--field);
  color: var(--text);
  box-shadow: var(--sunken);
  font: 13px/1.4 var(--body);
}
.admin-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
.admin-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.admin-rows {
  margin: 0;
  padding: 0;
  list-style: none;
}
.admin-rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 7px 2px;
  border-bottom: 1px solid var(--bevel-mid);
  font-size: 12px;
}
.admin-rows-main {
  flex: 1;
  min-width: 180px;
  overflow-wrap: anywhere;
}
.admin-rows-main strong {
  display: block;
  font-size: 13px;
}
.admin-status {
  padding: 1px 6px;
  background: var(--bevel-mid);
  color: var(--text);
}
.admin-status.is-live {
  background: #6e9a5b;
  color: #242525;
}
.admin-status.is-scheduled {
  background: var(--accent);
  color: #242525;
}

/* --------------------------------------------------------------------------
   Start search, Game Room
   -------------------------------------------------------------------------- */

.sm-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.sm-search {
  width: calc(100% - 8px);
  margin: 4px 4px 2px;
  padding: 5px 7px;
  border: 0;
  background: var(--field);
  color: var(--text);
  box-shadow: var(--sunken);
  font: 13px/1.3 var(--body);
}
.sm-results {
  flex: 1;
  width: 300px;
  max-width: 100%;
  min-height: 120px;
  margin: 0;
  padding: 2px 0;
  list-style: none;
}
.sm-results[hidden],
.sm-items[hidden] {
  display: none;
}
.sm-result-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sm-result-hint {
  flex: none;
  margin-left: 8px;
  font-size: 11px;
  opacity: 0.75;
}
.sm-noresults {
  padding: 12px;
  font-size: 13px;
}
.arcade {
  height: 100%;
  padding: 14px 16px;
  overflow-y: auto;
  background: var(--window);
  color: var(--text);
}
.arcade-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.arcade-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--bevel-mid);
  font-size: 13px;
}
.arcade-row {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.arcade-state {
  color: var(--muted);
  font-size: 12px;
}
.arcade-state.is-turn {
  padding: 1px 6px;
  background: var(--accent);
  color: #242525;
}
.arcade-players {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}
.arcade-player {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 150px;
  padding: 5px 8px;
  background: var(--chrome);
  box-shadow: var(--raised);
  font-size: 13px;
}
.arcade-mark {
  margin-left: auto;
  font: 15px/1 var(--display);
}
.arcade-status {
  margin: 6px 0 10px;
  font: 19px/1.15 var(--display);
}
.arcade-tools {
  margin-top: 12px;
}
.ttt {
  display: grid;
  grid-template-columns: repeat(3, 80px);
  grid-auto-rows: 80px;
  gap: 4px;
  width: max-content;
  margin: 0 auto;
  padding: 4px;
  background: var(--title);
}
.ttt-cell {
  border: 0;
  background: var(--field);
  color: var(--text);
  font: 52px/1 var(--display);
  cursor: pointer;
}
.ttt-cell:disabled {
  cursor: default;
}
.ttt-cell.is-x {
  color: var(--title);
}
:root[data-theme="dark"] .ttt-cell.is-x {
  color: #8fb1ff;
}
.ttt-cell.is-o {
  color: #b5523b;
}
.chess {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: min(100%, 416px);
  margin: 0 auto;
  box-shadow: 0 0 0 3px var(--title);
}
.chess-cell {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: #e8dcc0;
  cursor: pointer;
}
.chess-cell.is-dark {
  background: #7d9a8c;
}
.chess-cell.is-last {
  background: #e3c971;
}
.chess-cell.is-dark.is-last {
  background: #b9a54e;
}
.chess-cell.is-picked {
  background: #d98958;
}
.chess-cell.is-target::after {
  content: "";
  position: absolute;
  width: 30%;
  height: 30%;
  background: rgba(36, 37, 37, 0.45);
}
.chess-piece {
  font-size: clamp(26px, 8vw, 40px);
  line-height: 1;
}
.chess-piece.is-white {
  color: #fffdf6;
  text-shadow: -1px 0 #242525, 1px 0 #242525, 0 -1px #242525, 0 1px #242525;
}
.chess-piece.is-black {
  color: #242525;
}
.room-caption {
  position: absolute;
  left: 50%;
  top: calc(24px + var(--safe-t));
  max-width: calc(100% - 32px);
  padding: 7px 14px;
  transform: translateX(-50%);
  background: #fff9e9;
  color: #242525;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.45);
  font: 18px/1.2 var(--display);
  text-align: center;
  pointer-events: none;
}
.room-caption[hidden] {
  display: none;
}
.room-hotspots {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.room-hotspots:focus-within {
  left: 12px;
  top: 12px;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
}

.mod-actions {
  display: flex;
  grid-column: 2;
  grid-row: 1 / span 2;
  gap: 4px;
}

/* Real text in the page itself, for search engines and for anyone without JavaScript.
   This cover hides it from the first paint until the OS opens on top, and matches the
   loading screen. Without JavaScript, css/noscript.css removes the cover. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, #2f6a65, #1f5452 75%);
}
.seo-page {
  box-sizing: border-box;
  min-height: 100vh;
  padding: 40px max(22px, calc(50% - 360px));
  background: #1f5452;
  color: #fff9e9;
  font: 16px/1.6 var(--body);
}
.seo-page a {
  color: #fff9e9;
}
.seo-page img {
  max-width: 100%;
  height: auto;
}

.email-prefs {
  padding: 14px 16px;
  font-size: 13px;
}
.email-prefs p {
  margin: 0 0 10px;
}
.email-prefs label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 5px 0;
}
.groupbox .email-prefs {
  padding: 0;
}
.admin-form .admin-check {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* A drawing shown as its own desktop or Files icon. */
.icon-thumb {
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 0 0 1px var(--edge), 2px 2px 0 rgba(0, 0, 0, 0.35);
  image-rendering: pixelated;
}
.name-dialog {
  padding: 12px;
}
.name-dialog-label {
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.name-dialog-input {
  width: 100%;
  padding: 5px 7px;
  border: 0;
  background: var(--field);
  color: var(--text);
  box-shadow: var(--sunken);
  font: 14px/1.3 var(--body);
}
.name-dialog-error {
  margin: 8px 0 0;
  color: #b5523b;
  font-size: 12px;
  white-space: pre-line;
}
