/* Nintendo Switch edition shell. The photographic frame is an asset; this file only positions live UI inside it. */
:root {
  --switch-blue: #02c7e9;
  --switch-blue-deep: #007a9a;
  --switch-red: #ff514d;
  --switch-red-deep: #b92d32;
  --switch-screen: #f7fafb;
  --switch-screen-ink: #17202a;
  --switch-screen-muted: #65727e;
  --switch-screen-line: #d8e0e5;
  --switch-screen-progress: 0%;
  --switch-stage-paper: #f7f6f2;
  --switch-stage-ink: #2c3033;
}

html,
body.switch-theme {
  min-width: 320px;
  min-height: 100%;
}

body.switch-theme {
  display: block;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 72%, rgba(2, 199, 233, 0.15), transparent 30%),
    radial-gradient(circle at 92% 72%, rgba(255, 81, 77, 0.14), transparent 30%),
    linear-gradient(135deg, #f3f8f8 0%, var(--switch-stage-paper) 48%, #fff4f1 100%) !important;
  color: var(--switch-screen-ink);
}

body.switch-theme.toybox-theme:not(.toybox-home) {
  background:
    radial-gradient(circle at 8% 72%, rgba(2, 199, 233, 0.15), transparent 30%),
    radial-gradient(circle at 92% 72%, rgba(255, 81, 77, 0.14), transparent 30%),
    linear-gradient(135deg, #f3f8f8 0%, var(--switch-stage-paper) 48%, #fff4f1 100%) !important;
}

body.switch-theme::before {
  display: none;
}

body.switch-theme #rightside {
  display: none !important;
}

body.switch-theme #pixel-particles-canvas {
  display: none !important;
}

body.switch-theme #body-wrap,
body.switch-theme.toybox-home #body-wrap,
body.switch-theme.toybox-post #body-wrap {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2;
  display: grid !important;
  width: 100vw !important;
  min-width: 0 !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 0 !important;
  grid-template-rows: auto auto auto;
  place-content: center;
  place-items: center;
  gap: clamp(8px, 1.5vh, 18px);
  padding: clamp(18px, 4vh, 50px) 0 clamp(14px, 3vh, 36px) !important;
  aspect-ratio: auto;
  margin: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

body.switch-theme #body-wrap::before,
body.switch-theme #body-wrap::after {
  display: none !important;
}

.switch-console {
  position: relative;
  width: min(95vw, calc(238.28125dvh - 452px), 1920px);
  max-width: 1920px;
  height: auto;
  aspect-ratio: 1525 / 640;
  filter: drop-shadow(0 22px 34px rgba(0, 0, 0, 0.38));
}

.switch-ambient {
  z-index: 1;
  width: min(92vw, 1180px);
  color: var(--switch-stage-ink);
  text-align: center;
}

.switch-ambient--top {
  display: grid;
  gap: clamp(3px, 0.7vh, 8px);
}

.switch-ambient-title {
  margin: 0;
  color: inherit;
  font-family: var(--pixel-font-family, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: clamp(18px, 1.9vw, 30px);
  line-height: 1.2;
  letter-spacing: 0.1em;
}

.switch-ambient-title span {
  font-weight: 900;
}

.switch-ambient-title small {
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.switch-ambient-tagline {
  margin: 0;
  color: color-mix(in srgb, var(--switch-stage-ink) 66%, transparent);
  font-size: clamp(11px, 1vw, 15px);
  letter-spacing: 0.08em;
}

.switch-ambient--bottom {
  display: grid;
  gap: clamp(6px, 1vh, 10px);
}

.switch-ambient-stats,
.switch-ambient-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.switch-ambient-stats {
  gap: clamp(18px, 3vw, 44px);
}

.switch-ambient-stats a {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: inherit;
  font-size: clamp(11px, 1vw, 15px);
  text-decoration: none;
}

.switch-ambient-stats a:hover,
.switch-ambient-stats a:focus-visible {
  color: var(--switch-red-deep);
}

.switch-ambient-stats strong {
  font-family: var(--pixel-font-family, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 1.2em;
  font-weight: 900;
}

.switch-ambient-legend {
  gap: clamp(10px, 1.5vw, 22px);
  color: color-mix(in srgb, var(--switch-stage-ink) 72%, transparent);
  font-size: clamp(9px, 0.85vw, 13px);
}

.switch-ambient-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.switch-ambient-legend kbd {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  padding: 0 5px;
  border: 1px solid rgba(36, 43, 48, 0.56);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 2px 0 rgba(36, 43, 48, 0.22);
  color: var(--switch-stage-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}

.switch-ambient-legend em {
  font-style: normal;
}

.switch-console-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.switch-screen {
  position: absolute;
  top: 13.7%;
  right: 20.9%;
  bottom: 14.5%;
  left: 18.7%;
  z-index: 3;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 2px;
  background: var(--switch-screen) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  color: var(--switch-screen-ink);
  container-name: switch-screen;
  container-type: inline-size;
  overscroll-behavior: contain;
  scrollbar-color: var(--switch-red) transparent;
  scrollbar-width: thin;
}

.switch-screen:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -5px;
}

.switch-screen::-webkit-scrollbar {
  width: 7px;
}

.switch-screen::-webkit-scrollbar-thumb {
  border: 2px solid var(--switch-screen);
  border-radius: 10px;
  background: linear-gradient(var(--switch-blue), var(--switch-red));
}

.switch-screen-glass {
  position: sticky;
  top: 0;
  z-index: 99;
  width: var(--switch-screen-progress);
  height: 3px;
  margin-bottom: -3px;
  pointer-events: none;
  background: linear-gradient(90deg, var(--switch-blue), #8fe8ef 52%, var(--switch-red));
  box-shadow: 0 0 10px rgba(2, 199, 233, 0.55);
  transition: width 0.12s linear;
}

/* Compact system bar shared by home, article, category, tag, archive and page views. */
body.switch-theme #page-header,
body.switch-theme.toybox-post #page-header,
body.switch-theme.toybox-home #page-header,
body.switch-theme:not(.toybox-home) #page-header {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.switch-theme #page-header::before,
body.switch-theme #page-header::after {
  display: none !important;
}

body.switch-theme #page-header #nav,
body.switch-theme:not(.toybox-home) #page-header #nav,
body.switch-theme #page-header.nav-fixed #nav,
body.switch-theme #page-header.nav-visible #nav,
body.switch-theme #page-header.fixed #nav {
  position: sticky !important;
  top: 0;
  z-index: 80;
  display: flex !important;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 5px 12px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--switch-screen-line) !important;
  border-radius: 0 !important;
  background: rgba(247, 250, 251, 0.94) !important;
  box-shadow: 0 4px 14px rgba(25, 40, 52, 0.07) !important;
  backdrop-filter: blur(14px);
  left: 0 !important;
  right: auto !important;
  margin: 0 !important;
  transform: none !important;
}

/* Navigation lives on the physical controls; the display is reserved for content. */
body.switch-theme #page-header #nav,
body.switch-theme:not(.toybox-home) #page-header #nav,
body.switch-theme #page-header.nav-fixed #nav,
body.switch-theme #page-header.nav-visible #nav,
body.switch-theme #page-header.fixed #nav {
  display: none !important;
}

body.switch-theme.toybox-home #page-header,
body.switch-theme.toybox-home .toybox-deck-header,
body.switch-theme.toybox-home .toybox-bottom-console,
body.switch-theme.toybox-home #recent-posts > #pagination,
body.switch-theme.toybox-home #recent-posts > #footer {
  display: none !important;
}

body.switch-theme #page-header #blog-info,
body.switch-theme:not(.toybox-home) #page-header #blog-info {
  width: auto !important;
  min-width: 0;
}

body.switch-theme #page-header #blog-info .site-brand,
body.switch-theme:not(.toybox-home) #page-header #blog-info .site-brand {
  display: flex;
  height: 38px !important;
  align-items: center;
  gap: 8px;
  padding: 0 9px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.switch-theme #page-header #blog-info .site-icon,
body.switch-theme:not(.toybox-home) #page-header #blog-info .site-icon {
  width: 28px !important;
  height: 28px !important;
  border: 2px solid #fff !important;
  border-radius: 50% !important;
  box-shadow: 0 0 0 2px var(--switch-blue) !important;
}

body.switch-theme #page-header #blog-info .site-name,
body.switch-theme:not(.toybox-home) #page-header #blog-info .site-name {
  color: var(--switch-screen-ink) !important;
  font-size: 15px !important;
  line-height: 1 !important;
  text-shadow: none !important;
}

body.switch-theme #page-header #blog-info .site-tagline,
body.switch-theme:not(.toybox-home) #page-header #blog-info .site-tagline {
  display: none !important;
}

body.switch-theme #page-header #menus {
  width: auto !important;
  min-width: 0;
  flex: 1 1 auto !important;
  justify-content: flex-end;
  gap: 3px;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.switch-theme #page-header #nav .site-page,
body.switch-theme:not(.toybox-home) #page-header #nav .site-page,
body.switch-theme #preferences-button .site-page.preferences {
  min-height: 32px;
  padding: 7px 9px !important;
  border: 1px solid transparent !important;
  border-radius: 7px !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--switch-screen-muted) !important;
  font-size: 11px !important;
}

body.switch-theme #page-header #nav .site-page:hover,
body.switch-theme #page-header #nav .site-page:focus-visible {
  border-color: var(--switch-screen-line) !important;
  background: #fff !important;
  color: var(--switch-red-deep) !important;
}

body.switch-theme #page-site-info,
body.switch-theme:not(.toybox-home) #page-header #page-site-info {
  position: relative !important;
  inset: auto !important;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: auto !important;
  max-width: none !important;
  min-height: 54px;
  margin: 0 14px !important;
  padding: 9px 0 !important;
  text-align: left !important;
  transform: none !important;
}

body.switch-theme:not(.toybox-home) #page-header #page-site-info {
  border: 0 !important;
  border-bottom: 1px solid var(--switch-screen-line) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.switch-theme:not(.toybox-home) #page-header #page-site-info::before,
body.switch-theme:not(.toybox-home) #page-header #page-site-info::after {
  display: none !important;
}

body.switch-theme #page-site-info .toybox-page-kicker {
  align-self: center;
  padding: 5px 7px;
  border-radius: 5px;
  background: var(--switch-blue);
  color: #063a48;
  font-size: 9px;
  font-weight: 900;
}

body.switch-theme:not(.toybox-home) #page-header .toybox-page-kicker {
  position: static !important;
  grid-column: 1 !important;
  grid-row: 1 !important;
  align-self: center !important;
  margin: 0 !important;
  background: var(--switch-blue) !important;
  color: #063a48 !important;
}

body.switch-theme #page-site-info #site-title {
  margin: 0 !important;
  overflow: hidden;
  color: var(--switch-screen-ink) !important;
  font-size: clamp(17px, 2vw, 24px) !important;
  line-height: 1.15 !important;
  text-overflow: ellipsis;
  text-shadow: none !important;
  white-space: nowrap;
}

body.switch-theme:not(.toybox-home) #page-header #page-site-info #site-title {
  position: static !important;
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-self: center !important;
  margin: 0 !important;
  font-family: var(--article-reading-font) !important;
  font-size: clamp(17px, 2vw, 24px) !important;
}

body.switch-theme #page-site-info .toybox-page-hint {
  color: var(--switch-screen-muted) !important;
  font-size: 10px !important;
  white-space: nowrap;
}

body.switch-theme:not(.toybox-home) #page-header .toybox-page-hint {
  position: static !important;
  grid-column: 3 !important;
  grid-row: 1 !important;
  align-self: center !important;
  margin: 0 !important;
  padding: 5px 7px !important;
  border: 1px solid var(--switch-screen-line) !important;
  border-radius: 5px !important;
  background: #fff !important;
  box-shadow: none !important;
  color: var(--switch-screen-muted) !important;
  font-size: 10px !important;
}

body.switch-theme.toybox-home #site-info {
  position: relative !important;
  inset: auto !important;
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 16px 4px;
  text-align: left;
  transform: none !important;
}

body.switch-theme.toybox-home #site-info #site-title {
  margin: 0 !important;
  color: var(--switch-screen-ink) !important;
  font-size: clamp(19px, 2.5vw, 28px) !important;
  line-height: 1 !important;
  text-shadow: none !important;
}

body.switch-theme.toybox-home #site-subtitle {
  margin: 0 !important;
  color: var(--switch-screen-muted) !important;
  font-size: 10px !important;
}

body.switch-theme #content-inner.layout,
body.switch-theme.toybox-home #content-inner.layout,
body.switch-theme.toybox-post #content-inner.layout,
body.switch-theme.toybox-collection #content-inner.layout,
body.switch-theme.toybox-page #content-inner.layout {
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: clamp(12px, 1.5vw, 26px) clamp(14px, 2vw, 34px) clamp(28px, 4vh, 54px) !important;
  background: transparent !important;
}

body.switch-theme.toybox-home #content-inner.layout {
  padding: 10px 12px 16px !important;
}

/* Home: the existing carousel is resized into the display rather than rebuilt. */
body.switch-theme.toybox-home #recent-posts {
  --switch-home-card-height: clamp(280px, calc(var(--switch-screen-height, 520px) - 34px), 480px);
  gap: 8px !important;
}

body.switch-theme.toybox-home .toybox-stage {
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.switch-theme.toybox-home .toybox-deck-header {
  min-height: 36px !important;
  padding: 0 4px 5px !important;
}

body.switch-theme.toybox-home .toybox-recent-title {
  font-size: 13px !important;
}

body.switch-theme.toybox-home .toybox-card-row {
  padding: 0 !important;
}

body.switch-theme.toybox-home .toybox-card-track {
  gap: 10px !important;
  min-height: var(--switch-home-card-height) !important;
}

body.switch-theme.toybox-home .toybox-card-track > .toybox-featured {
  flex-basis: 54% !important;
  width: 54% !important;
  min-width: 360px !important;
}

body.switch-theme.toybox-home .toybox-card-track > .toybox-switch-card {
  flex-basis: 17% !important;
  width: 17% !important;
  min-width: 118px !important;
}

body.switch-theme.toybox-home .toybox-featured {
  grid-template-columns: minmax(150px, 0.88fr) minmax(180px, 1.12fr) !important;
  height: var(--switch-home-card-height) !important;
  min-height: var(--switch-home-card-height) !important;
  padding: 7px !important;
  border-width: 2px !important;
  border-radius: 9px !important;
  box-shadow: 0 5px 0 var(--switch-red-deep), 0 9px 17px rgba(77, 38, 38, 0.16) !important;
}

body.switch-theme.toybox-home .toybox-featured .recent-post-info {
  padding: clamp(32px, 5vh, 58px) clamp(14px, 2vw, 28px) 16px !important;
}

body.switch-theme.toybox-home .toybox-featured .article-title {
  margin-bottom: 8px !important;
  font-size: clamp(20px, 2.1vw, 34px) !important;
}

body.switch-theme.toybox-home .toybox-open-button .toybox-open-label {
  display: inline !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #fff !important;
  font-size: 11px !important;
}

body.switch-theme.toybox-home .toybox-featured .article-meta-wrap {
  margin-bottom: 8px !important;
  padding: 4px 6px !important;
  font-size: 8px !important;
}

body.switch-theme.toybox-home .toybox-featured .content {
  margin: 0 !important;
  font-size: clamp(11px, 0.9vw, 15px) !important;
  line-height: 1.65 !important;
  -webkit-line-clamp: 5 !important;
}

body.switch-theme.toybox-home .toybox-featured-badge,
body.switch-theme.toybox-home .toybox-cleared-badge {
  top: 12px !important;
  padding: 4px 6px !important;
  font-size: 8px !important;
}

body.switch-theme.toybox-home .toybox-featured-badge {
  left: 12px !important;
}

body.switch-theme.toybox-home .toybox-switch-card {
  grid-template-rows: 58% minmax(0, 42%) !important;
  height: calc(var(--switch-home-card-height) - 20px) !important;
  min-height: calc(var(--switch-home-card-height) - 20px) !important;
  padding: 6px 6px 9px !important;
  border-width: 2px !important;
  box-shadow: 0 5px 0 var(--card-depth), 0 9px 14px rgba(47, 44, 39, 0.14) !important;
}

body.switch-theme.toybox-home .toybox-switch-card .recent-post-info {
  grid-template-columns: minmax(0, 1fr) 28px !important;
  padding: 9px 3px 0 !important;
}

body.switch-theme.toybox-home .toybox-switch-card .article-title {
  font-size: clamp(11px, 0.82vw, 14px) !important;
  -webkit-line-clamp: 3 !important;
}

body.switch-theme.toybox-home .toybox-card-arrow {
  width: 26px !important;
  height: 24px !important;
}

body.switch-theme.toybox-home .toybox-collection-dock,
body.switch-theme.toybox-home .toybox-bottom-console {
  margin-top: 10px !important;
  transform: none;
  transform-origin: top center;
}

/* Articles and collection pages retain the same display surface and spacing language. */
body.switch-theme.toybox-post #content-inner.layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 24%);
  align-items: start;
  gap: 14px;
}

body.switch-theme.toybox-post #body-wrap.post #content-inner > #post {
  order: 0 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 22px clamp(18px, 4vw, 42px) !important;
  border: 1px solid var(--switch-screen-line) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 10px 25px rgba(33, 53, 67, 0.08) !important;
}

body.switch-theme.toybox-post #body-wrap.post #content-inner > #post::before,
body.switch-theme.toybox-post #body-wrap.post #content-inner > #post::after {
  display: none !important;
}

body.switch-theme.toybox-post #page-header #post-info,
body.switch-theme.toybox-post #body-wrap.post #page-header #post-info {
  position: relative !important;
  inset: auto !important;
  width: calc(100% - clamp(24px, 4vw, 56px)) !important;
  min-width: 0 !important;
  max-width: none !important;
  margin: clamp(12px, 2vh, 24px) auto !important;
  padding: clamp(22px, 4vh, 46px) clamp(20px, 4vw, 52px) !important;
  transform: none !important;
}

body.switch-theme.toybox-post #post-info .post-title,
body.switch-theme.toybox-post #post-info #post-meta {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
}

body.switch-theme.toybox-post #post-info .post-title {
  font-size: clamp(28px, 3.2vw, 48px) !important;
}

body.switch-theme.toybox-post .switch-screen.switch-screen--single #post-info .pixel-article-sleeve-art {
  display: none !important;
}

body.switch-theme.toybox-post .switch-screen.switch-screen--single #post-info .post-title,
body.switch-theme.toybox-post .switch-screen.switch-screen--single #post-info #post-meta {
  text-align: center !important;
}

body.switch-theme.toybox-post #post #article-container {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 900px !important;
  margin: 0 auto !important;
  color: var(--switch-screen-ink) !important;
  font-family: var(--article-reading-font) !important;
  font-size: clamp(15px, 1.05vw, 18px) !important;
  line-height: 1.88 !important;
}

body.switch-theme.toybox-post .pixel-manual-body,
body.switch-theme.toybox-post .pixel-manual-body.is-single-page {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  grid-template-columns: minmax(0, 1fr) !important;
  overflow-x: hidden !important;
}

body.switch-theme.toybox-post #article-container pre,
body.switch-theme.toybox-post #article-container figure.highlight {
  max-width: 100% !important;
  overflow-x: auto !important;
}

body.switch-theme.toybox-post #aside-content {
  display: block !important;
  order: 1 !important;
  width: 100% !important;
}

body.switch-theme.toybox-post #aside-content .card-widget,
body.switch-theme.toybox-post #card-toc.pixel-manual-index {
  margin: 0 !important;
  padding: 12px !important;
  border: 1px solid var(--switch-screen-line) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  box-shadow: 0 8px 20px rgba(33, 53, 67, 0.07) !important;
}

body.switch-theme.toybox-collection #archive,
body.switch-theme.toybox-collection #category,
body.switch-theme.toybox-collection #tag,
body.switch-theme.toybox-page #page {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 18px clamp(16px, 4vw, 38px) 26px !important;
  border: 1px solid var(--switch-screen-line) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 10px 25px rgba(33, 53, 67, 0.08) !important;
}

body.switch-theme .article-sort-title {
  margin-bottom: 14px !important;
  color: var(--switch-screen-ink) !important;
  font-size: 18px !important;
}

body.switch-theme .article-sort-item {
  min-height: 64px !important;
  margin: 0 0 8px 16px !important;
  padding: 9px 12px !important;
  border: 1px solid var(--switch-screen-line) !important;
  border-left: 4px solid var(--switch-blue) !important;
  border-radius: 8px !important;
  background: #f8fbfc !important;
  box-shadow: none !important;
}

body.switch-theme .article-sort-item:nth-child(3n) {
  border-left-color: var(--switch-red) !important;
}

body.switch-theme #footer {
  margin: 10px 16px 20px !important;
  padding: 12px !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--switch-screen-muted) !important;
  font-size: 10px !important;
}

/* Transparent hit targets align with the real controls in the generated device asset. */
.switch-controls {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.switch-control {
  position: absolute;
  display: grid;
  width: clamp(28px, 3.45%, 54px);
  aspect-ratio: 1;
  place-items: center;
  padding: 0;
  border: 2px solid transparent !important;
  border-radius: 50%;
  background: transparent !important;
  box-shadow: none !important;
  color: transparent !important;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.switch-control:hover,
.switch-control:focus-visible {
  border-color: rgba(255, 255, 255, 0.92) !important;
  outline: 0;
  background: rgba(255, 255, 255, 0.06) !important;
  box-shadow: 0 0 0 4px rgba(9, 15, 20, 0.45), 0 0 18px rgba(255, 255, 255, 0.75) !important;
  transform: translate(-50%, -50%) scale(1.08);
}

.switch-control:active {
  transform: translate(-50%, -50%) scale(0.9);
}

.switch-control-label {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 6;
  padding: 4px 6px;
  border-radius: 5px;
  background: rgba(12, 18, 23, 0.9);
  color: #fff;
  font-family: var(--pixel-font-family, monospace);
  font-size: 9px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -2px);
  white-space: nowrap;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.switch-control:hover .switch-control-label,
.switch-control:focus-visible .switch-control-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.switch-control--up { top: 44.5%; left: 8.95%; }
.switch-control--down { top: 58.3%; left: 8.95%; }
.switch-control--left { top: 51.4%; left: 6%; }
.switch-control--right { top: 51.4%; left: 11.9%; }
.switch-control--x { top: 18.7%; left: 90.9%; }
.switch-control--y { top: 25.7%; left: 88%; }
.switch-control--a { top: 25.7%; left: 93.8%; }
.switch-control--b { top: 32.7%; left: 90.9%; }
.switch-control--capture,
.switch-control--home {
  width: clamp(25px, 2.9%, 45px);
  border-radius: 7px;
}
.switch-control--capture { top: 68.4%; left: 11%; }
.switch-control--home { top: 68.4%; left: 88.8%; border-radius: 50%; }

.switch-mobile-legend {
  display: none;
}

/* The live screen, not the outer browser width, decides how content is composed. */
body.switch-theme .switch-screen.switch-screen--single #page-header #menus > .menus_items {
  display: none !important;
}

body.switch-theme.toybox-post .switch-screen.switch-screen--single #content-inner.layout {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.switch-theme.toybox-post .switch-screen.switch-screen--single #aside-content {
  display: none !important;
}

body.switch-theme.toybox-home .switch-screen.switch-screen--single .toybox-card-track > .toybox-featured {
  flex-basis: 58% !important;
  width: 58% !important;
  min-width: 390px !important;
}

body.switch-theme.toybox-home .switch-screen.switch-screen--single .toybox-card-track > .toybox-switch-card {
  flex-basis: 20% !important;
  width: 20% !important;
  min-width: 140px !important;
}

body.switch-theme.toybox-home .switch-screen.switch-screen--single .toybox-featured .article-title {
  font-size: clamp(20px, 1.8vw, 28px) !important;
}

body.switch-theme.toybox-home .switch-screen.switch-screen--short #recent-posts {
  --switch-home-card-height: clamp(250px, calc(var(--switch-screen-height, 420px) - 24px), 420px);
}

body.switch-theme.toybox-home .switch-screen.switch-screen--short .toybox-featured .content {
  display: -webkit-box !important;
  -webkit-line-clamp: 4 !important;
}

body.switch-theme.toybox-home .switch-screen.switch-screen--short .toybox-featured .recent-post-info {
  padding: 34px 16px 12px !important;
}

body.switch-theme.toybox-home .switch-screen.switch-screen--short .toybox-featured .article-title {
  font-size: clamp(18px, 1.55vw, 24px) !important;
}

body.switch-theme.toybox-home .switch-screen.switch-screen--compact #recent-posts {
  --switch-home-card-height: clamp(240px, calc(var(--switch-screen-height, 540px) - 34px), 360px);
}

body.switch-theme.toybox-home .switch-screen.switch-screen--compact .toybox-featured .recent-post-info {
  padding: 46px 18px 14px !important;
}

body.switch-theme.toybox-home .switch-screen.switch-screen--compact .toybox-card-track > .toybox-featured {
  flex-basis: 68% !important;
  width: 68% !important;
  min-width: 350px !important;
}

body.switch-theme.toybox-home .switch-screen.switch-screen--compact .toybox-card-track > .toybox-switch-card {
  flex-basis: 26% !important;
  width: 26% !important;
  min-width: 130px !important;
}

body.switch-theme.toybox-home .switch-screen.switch-screen--wide .toybox-card-track > .toybox-featured {
  flex-basis: 45% !important;
  width: 45% !important;
  min-width: 500px !important;
}

body.switch-theme.toybox-home .switch-screen.switch-screen--wide .toybox-card-track > .toybox-switch-card {
  flex-basis: 17% !important;
  width: 17% !important;
  min-width: 176px !important;
}

body.switch-theme.toybox-collection .switch-screen.switch-screen--wide .article-sort {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

body.switch-theme.toybox-collection .switch-screen.switch-screen--wide .article-sort::before {
  display: none !important;
}

body.switch-theme.toybox-collection .switch-screen.switch-screen--wide .article-sort-item {
  width: auto !important;
  margin: 0 !important;
}

body.switch-theme.toybox-collection .switch-screen.switch-screen--wide .article-sort-item.year {
  grid-column: 1 / -1;
}

body.switch-theme .switch-screen.switch-screen--tall #page-site-info,
body.switch-theme.toybox-home .switch-screen.switch-screen--tall #site-info {
  min-height: 64px;
}

[data-theme='dark'] body.switch-theme {
  --switch-screen: #11181e;
  --switch-screen-ink: #e9f1f5;
  --switch-screen-muted: #9caab4;
  --switch-screen-line: #2b3a44;
  --switch-stage-ink: #e9f1f5;
  background: radial-gradient(circle at 50% 34%, #394650, #11181e 72%) !important;
}

[data-theme='dark'] body.switch-theme #page-header #nav,
[data-theme='dark'] body.switch-theme.toybox-post #body-wrap.post #content-inner > #post,
[data-theme='dark'] body.switch-theme.toybox-collection #archive,
[data-theme='dark'] body.switch-theme.toybox-collection #category,
[data-theme='dark'] body.switch-theme.toybox-collection #tag,
[data-theme='dark'] body.switch-theme.toybox-page #page,
[data-theme='dark'] body.switch-theme.toybox-post #aside-content .card-widget {
  background: #172129 !important;
}

[data-theme='dark'] body.switch-theme .article-sort-item,
[data-theme='dark'] body.switch-theme.toybox-home .toybox-stage {
  background: #1c2830 !important;
}

@media (max-width: 1180px) {
  body.switch-theme #page-header #menus > .menus_items {
    display: none !important;
  }

  body.switch-theme.toybox-home .toybox-featured .content,
  body.switch-theme.toybox-home #site-subtitle {
    display: none !important;
  }

  body.switch-theme.toybox-post #content-inner.layout {
    grid-template-columns: 1fr !important;
  }

  body.switch-theme.toybox-post #aside-content {
    display: none !important;
  }
}

@media (max-width: 820px), (orientation: portrait) and (max-width: 1100px) {
  body.switch-theme {
    display: block;
    overflow: hidden;
    background: var(--switch-screen) !important;
  }

  body.switch-theme #body-wrap,
  body.switch-theme.toybox-home #body-wrap,
  body.switch-theme.toybox-post #body-wrap {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    display: block !important;
    gap: 0 !important;
    padding: 0 !important;
    aspect-ratio: auto;
    transform: none !important;
  }

  .switch-console {
    width: 100%;
    max-width: none;
    height: 100%;
    aspect-ratio: auto;
    filter: none;
  }

  .switch-ambient {
    display: none !important;
  }

  .switch-console-frame,
  .switch-controls {
    display: none !important;
  }

  .switch-screen {
    inset: 0 0 64px !important;
    border-right: 5px solid var(--switch-red);
    border-left: 5px solid var(--switch-blue);
    border-radius: 0;
  }

  .switch-mobile-legend {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: grid;
    height: 64px;
    grid-template-columns: repeat(5, 1fr);
    overflow: hidden;
    border-top: 3px solid #232a2f;
    background: linear-gradient(90deg, var(--switch-blue) 0 50%, var(--switch-red) 50% 100%);
  }

  .switch-mobile-legend a,
  .switch-mobile-legend button {
    display: grid;
    min-width: 0;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 5px 2px;
    border: 0;
    background: rgba(16, 24, 30, 0.08);
    color: #071116;
    font-size: 10px;
  }

  .switch-mobile-legend a:hover,
  .switch-mobile-legend button:hover,
  .switch-mobile-legend a:focus-visible,
  .switch-mobile-legend button:focus-visible {
    background: rgba(255, 255, 255, 0.34);
  }

  body.switch-theme.toybox-home .toybox-card-track > .toybox-featured {
    min-width: min(82vw, 410px) !important;
  }

  body.switch-theme.toybox-home .toybox-card-track > .toybox-switch-card {
    min-width: 130px !important;
  }
}

@media (max-width: 560px) {
  body.switch-theme.toybox-home .switch-screen.switch-screen--compact #recent-posts {
    --switch-home-card-height: 250px;
  }

  body.switch-theme #page-header #nav,
  body.switch-theme:not(.toybox-home) #page-header #nav {
    padding: 5px 8px !important;
  }

  body.switch-theme #page-header #blog-info .site-name {
    max-width: 86px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.switch-theme #page-site-info {
    grid-template-columns: auto minmax(0, 1fr);
  }

  body.switch-theme #page-site-info .toybox-page-hint {
    display: none;
  }

  body.switch-theme #content-inner.layout,
  body.switch-theme.toybox-home #content-inner.layout,
  body.switch-theme.toybox-post #content-inner.layout {
    padding: 10px 10px 22px !important;
  }

  body.switch-theme.toybox-home .toybox-featured {
    grid-template-columns: minmax(118px, 0.85fr) minmax(0, 1.15fr) !important;
  }

  body.switch-theme.toybox-home .toybox-featured .post_cover {
    display: block !important;
  }

  body.switch-theme.toybox-home .toybox-featured .recent-post-info {
    grid-column: 2 !important;
    padding: 38px 10px 12px !important;
  }

  body.switch-theme.toybox-home .toybox-featured .content {
    display: none !important;
  }

  body.switch-theme.toybox-home .toybox-card-row {
    overflow: visible !important;
  }

  body.switch-theme.toybox-home .toybox-card-track {
    display: grid !important;
    width: 100% !important;
    min-height: 0 !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px !important;
    transform: none !important;
  }

  body.switch-theme.toybox-home .switch-screen.switch-screen--compact .toybox-card-track > .toybox-featured {
    width: 100% !important;
    min-width: 0 !important;
    grid-column: 1 / -1;
  }

  body.switch-theme.toybox-home .switch-screen.switch-screen--compact .toybox-card-track > .toybox-switch-card {
    width: 100% !important;
    min-width: 0 !important;
    height: 220px !important;
    min-height: 220px !important;
  }

  body.switch-theme.toybox-post #body-wrap.post #content-inner > #post,
  body.switch-theme.toybox-collection #archive,
  body.switch-theme.toybox-collection #category,
  body.switch-theme.toybox-collection #tag,
  body.switch-theme.toybox-page #page {
    padding: 16px 14px 22px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .switch-control,
  .switch-control-label,
  .switch-screen-glass {
    transition: none !important;
  }
}
