/* Picker-only styles stay usable with the original unthemed site. Fallback colours
   apply to controls, never to the page or its original artwork. */
html .media-theme-trigger {
  display:inline-flex; align-items:center; justify-content:center; gap:9px; flex:0 0 auto;
  min-height:42px; max-width:100%; margin:0; padding:9px 13px; border:1px solid var(--mt-border,#554066);
  border-radius:10px; background:var(--mt-surface-2,#261b34); color:var(--mt-text,#f7f0ff); box-shadow:none;
  font:600 12px/1.3 Inter,system-ui,sans-serif; text-transform:none; letter-spacing:0; white-space:nowrap; cursor:pointer;
}
html .media-theme-trigger:hover { border-color:var(--mt-accent,#c49bff); color:var(--mt-accent,#c49bff); }
html .media-theme-trigger svg { width:21px; height:21px; flex:none; }
html .media-theme-mobile-toolbar { margin:0; padding:8px 16px 0; display:flex; justify-content:flex-end; background:var(--mt-bg,#0e0b16); }
html .media-theme-mobile-toolbar[hidden] { display:none!important; }
html .aw-topbar { flex-wrap:wrap; }
html .aw-topbar .media-theme-trigger { font-size:11px; min-height:40px; }
html .media-theme-dialog {
  width:min(1120px,calc(100vw - 40px)); max-width:calc(100vw - 40px); max-height:calc(100dvh - 40px);
  height:min(900px,calc(100dvh - 40px)); margin:auto; padding:0; border:1px solid var(--mt-border,#554066); border-radius:22px;
  overflow:hidden; background:var(--mt-surface-solid,var(--mt-bg,#0e0b16)); color:var(--mt-text,#f7f0ff); box-shadow:0 28px 110px #0009;
  font:400 14px/1.5 Inter,system-ui,-apple-system,'Segoe UI',sans-serif; color-scheme:inherit;
}
html .media-theme-dialog:not([open]) { display:none; }
html .media-theme-dialog::backdrop { background:#05060bbd; backdrop-filter:blur(7px); }
html.media-theme-picker-open { overflow:hidden; }
html .media-theme-dialog *,html .media-theme-dialog *::before,html .media-theme-dialog *::after { box-sizing:border-box; }
html .media-theme-dialog [hidden] { display:none!important; }
html .media-theme-dialog-shell { display:grid; grid-template-rows:auto auto minmax(0,1fr) auto; height:100%; min-height:0; }
html .media-theme-heading { display:flex; justify-content:space-between; gap:20px; align-items:flex-start; padding:25px 28px 18px; margin:0; border:0; }
html .media-theme-heading h2 { margin:3px 0 9px; color:var(--mt-text,#f7f0ff); font:600 28px/1.18 Inter,system-ui,sans-serif; letter-spacing:-.025em; text-transform:none; }
html .media-theme-eyebrow { margin:0; font:600 10px/1.4 Inter,system-ui,sans-serif; color:var(--mt-accent,#c49bff); letter-spacing:.14em; }
html .media-theme-description { margin:0; color:var(--mt-muted,#bcaed0); font-size:12px; max-width:620px; }
html .media-theme-close { display:grid; place-items:center; flex:none; width:42px; min-height:42px; padding:0; border:1px solid var(--mt-border,#554066); border-radius:12px; color:var(--mt-text,#f7f0ff); background:var(--mt-surface-2,#261b34); font:400 27px/1 system-ui,sans-serif; cursor:pointer; }
html .media-theme-tools { display:grid; grid-template-columns:minmax(220px,1.4fr) minmax(160px,1fr) auto; gap:12px; padding:0 28px 19px; border-bottom:1px solid var(--mt-border,#554066); }
html .media-theme-tools label { margin:0; min-width:0; display:block; }
html .media-theme-tools input,html .media-theme-tools select {
  width:100%; min-width:0; height:44px; padding:10px 12px; border:1px solid var(--mt-border,#554066); border-radius:10px;
  color:var(--mt-text,#f7f0ff); background:var(--mt-input,var(--mt-surface-2,#261b34)); font:400 13px/1.4 Inter,system-ui,sans-serif;
}
html .media-theme-tools input::placeholder { color:var(--mt-muted,#bcaed0); opacity:1; }
html .media-theme-modes { display:flex; align-items:center; gap:3px; padding:3px; border:1px solid var(--mt-border,#554066); border-radius:10px; background:var(--mt-surface-2,#261b34); }
html .media-theme-modes button { min-height:36px; padding:6px 11px; border:1px solid transparent; border-radius:7px; background:transparent; color:var(--mt-muted,#bcaed0); font:500 12px/1.3 Inter,system-ui,sans-serif; cursor:pointer; }
html .media-theme-modes button[aria-pressed=true] { color:var(--mt-accent-ink,#1d0d35); background:var(--mt-accent,#c49bff); }
html .media-theme-scroll { min-height:0; overflow-y:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:var(--mt-accent,#c49bff) var(--mt-surface-2,#261b34); padding:18px 28px 26px; }
html .media-theme-results-heading { display:flex; flex-wrap:wrap; justify-content:space-between; gap:5px 12px; align-items:center; margin:0 0 14px; color:var(--mt-muted,#bcaed0); font-size:11px; }
html .media-theme-results-heading p { margin:0; color:var(--mt-text,#f7f0ff); font-size:12px; }
html .media-theme-clear-filters { min-height:36px; margin:0; padding:7px 10px; border:1px solid var(--mt-border,#554066); border-radius:8px; background:var(--mt-surface-2,#261b34); color:var(--mt-accent,#c49bff); font:500 11px/1.4 Inter,system-ui,sans-serif; cursor:pointer; }
html .media-theme-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:15px; margin:0; padding:0; list-style:none; }
html .media-theme-grid>li { display:flex; flex-direction:column; gap:8px; min-width:0; margin:0; padding:0; list-style:none; }
html .media-theme-option {
  display:block; flex:1; width:100%; margin:0; padding:0; overflow:hidden; border:1px solid var(--mt-border,#554066); border-radius:12px;
  background:var(--mt-surface-2,#261b34); color:var(--mt-text,#f7f0ff); text-align:left; cursor:pointer; box-shadow:none;
  font:400 13px/1.4 Inter,system-ui,sans-serif; letter-spacing:0; text-transform:none; transition:border-color .15s,box-shadow .15s;
}
html .media-theme-option:hover { border-color:var(--mt-accent,#c49bff); }
html .media-theme-option[aria-pressed=true] { border-color:var(--mt-accent,#c49bff); box-shadow:0 0 0 2px var(--mt-accent,#c49bff); }
html .media-theme-preview { display:block; position:relative; aspect-ratio:16/9; width:100%; overflow:hidden; background:linear-gradient(125deg,var(--theme-preview-bg) 30%,var(--theme-preview-accent)); }
html .media-theme-preview>img { display:block; width:100%; height:100%; object-fit:cover; }
html .media-theme-preview::after { content:''; position:absolute; inset:50% 0 0; background:linear-gradient(transparent,#0005); pointer-events:none; }
html .media-theme-number { position:absolute; top:8px; left:8px; min-width:29px; padding:4px 6px; color:white; background:#080b12ce; border:1px solid #ffffff50; border-radius:6px; font:600 11px/1.15 Inter,system-ui,sans-serif; }
html .media-theme-selected { position:absolute; z-index:1; right:7px; bottom:7px; padding:4px 7px; border-radius:6px; background:var(--mt-accent,#c49bff); color:var(--mt-accent-ink,#1d0d35); font:600 10px/1.2 Inter,system-ui,sans-serif; }
html .media-theme-miniature { position:absolute; left:10px; bottom:10px; display:flex; gap:4px; width:54%; height:23%; }
html .media-theme-miniature i { display:block; flex:1; border:1px solid var(--theme-preview-accent); border-radius:4px; background:var(--theme-preview-bg); opacity:.9; }
html .media-theme-miniature i:first-child { flex:1.7; }
html .media-theme-caption { display:block; padding:11px 12px 12px; }
html .media-theme-caption strong { display:block; color:var(--mt-text,#f7f0ff); font:600 13px/1.35 Inter,system-ui,sans-serif; min-height:2.7em; overflow-wrap:anywhere; }
html .media-theme-caption small { display:block; color:var(--mt-muted,#bcaed0); font:400 10px/1.35 Inter,system-ui,sans-serif; margin-top:6px; }
html .media-theme-empty { margin:38px auto; text-align:center; max-width:360px; color:var(--mt-muted,#bcaed0); font-size:14px; }
html .media-theme-footer { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:15px; padding:16px 28px; border-top:1px solid var(--mt-border,#554066); background:var(--mt-surface-2,#261b34); }
html .media-theme-storage-note { flex-basis:100%; margin:0; color:var(--mt-muted,#bcaed0); font:400 12px/1.4 Inter,system-ui,sans-serif; }
html .media-theme-current-wrap { min-width:0; }
html .media-theme-current-wrap small { display:block; color:var(--mt-muted,#bcaed0); font:400 10px/1.3 Inter,system-ui,sans-serif; margin-bottom:3px; }
html .media-theme-current-wrap strong { display:block; color:var(--mt-text,#f7f0ff); font:600 13px/1.4 Inter,system-ui,sans-serif; overflow-wrap:anywhere; }
html .media-theme-actions { display:flex; gap:10px; flex-shrink:0; }
html .media-theme-actions button { min-height:42px; padding:10px 17px; border:1px solid var(--mt-border,#554066); border-radius:9px; background:transparent; color:var(--mt-text,#f7f0ff); font:600 12px/1.4 Inter,system-ui,sans-serif; cursor:pointer; }
html .media-theme-actions .media-theme-done { background:var(--mt-accent,#c49bff); color:var(--mt-accent-ink,#1d0d35); border-color:var(--mt-accent,#c49bff); }
html .media-theme-trigger:focus-visible,html .media-theme-dialog :focus-visible { outline:2px solid var(--mt-accent,#c49bff); outline-offset:3px; }
html .media-theme-sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
html .media-theme-like,html .media-theme-community-retry,html .media-theme-community-login,html .media-theme-wish-submit {
  display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:40px; margin:0; padding:8px 12px;
  border:1px solid var(--mt-border,#554066); border-radius:9px; background:var(--mt-surface-2,#261b34);
  color:var(--mt-text,#f7f0ff); font:500 12px/1.4 Inter,system-ui,sans-serif; text-decoration:none; cursor:pointer;
}
html .media-theme-like { width:100%; font-size:15px; }
html .media-theme-like[aria-pressed=true] { color:var(--mt-accent,#c49bff); border-color:var(--mt-accent,#c49bff); }
html .media-theme-dialog :is(.media-theme-like,.media-theme-community-retry,.media-theme-wish-submit):disabled { opacity:.55; cursor:wait; }
html .media-theme-community { margin-bottom:20px; }
html .media-theme-community-notice { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:12px; }
html .media-theme-community-notice p { flex:1 1 260px; margin:0; color:var(--mt-muted,#bcaed0); font-size:12px; }
html .media-theme-wishes { border:1px solid var(--mt-border,#554066); border-radius:12px; background:var(--mt-surface-2,#261b34); }
html .media-theme-wishes summary { padding:13px 15px; color:var(--mt-accent,#c49bff); font:600 13px/1.4 Inter,system-ui,sans-serif; cursor:pointer; }
html .media-theme-wish-form { display:grid; gap:9px; padding:0 15px 15px; margin:0; }
html .media-theme-wish-form label { margin:0; color:var(--mt-text,#f7f0ff); font:500 12px/1.4 Inter,system-ui,sans-serif; }
html .media-theme-wish-form textarea { display:block; resize:vertical; min-height:82px; max-height:220px; width:100%; padding:11px 12px; border:1px solid var(--mt-border,#554066); border-radius:9px; background:var(--mt-input,var(--mt-bg,#0e0b16)); color:var(--mt-text,#f7f0ff); font:400 14px/1.5 Inter,system-ui,sans-serif; }
html .media-theme-wish-form textarea::placeholder { color:var(--mt-muted,#bcaed0); opacity:1; }
html .media-theme-wish-help,html .media-theme-wish-status { margin:0; color:var(--mt-muted,#bcaed0); font:400 11px/1.5 Inter,system-ui,sans-serif; }
html .media-theme-wish-status:empty { display:none; }
html .media-theme-wish-submit { justify-self:start; background:var(--mt-accent,#c49bff); color:var(--mt-accent-ink,#1d0d35); border-color:var(--mt-accent,#c49bff); }
html .media-theme-wish-list { list-style:none; margin:0; padding:0 15px; max-height:280px; overflow-y:auto; overscroll-behavior:contain; }
html .media-theme-wish-list>li { list-style:none; padding:12px 0; border-top:1px solid var(--mt-border,#554066); margin:0; }
html .media-theme-wish-meta { display:flex; flex-wrap:wrap; gap:5px 12px; justify-content:space-between; color:var(--mt-muted,#bcaed0); font:400 10px/1.4 Inter,system-ui,sans-serif; }
html .media-theme-wish-meta strong { color:var(--mt-accent,#c49bff); overflow-wrap:anywhere; font-size:11px; }
html .media-theme-wish-list p { margin:6px 0 0; white-space:pre-wrap; overflow-wrap:anywhere; color:var(--mt-text,#f7f0ff); font:400 12px/1.5 Inter,system-ui,sans-serif; }
html .media-theme-wish-empty { color:var(--mt-muted,#bcaed0); font-size:12px; }
@media(max-width:900px) {
  html .media-theme-tools { grid-template-columns:minmax(180px,1fr) minmax(145px,1fr); }
  html .media-theme-modes { grid-column:1/-1; justify-self:start; }
  html .media-theme-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(min-width:761px) and (max-width:1000px) {
  /* The sidebar already identifies the page; leave room for mail, chat and themes. */
  html .cabinet-topbar .cabinet-breadcrumb { display:none; }
}
@media(max-width:760px) {
  html .media-theme-mobile-toolbar .media-theme-trigger { min-height:40px; font-size:12px; padding:8px 12px; }
  html .media-theme-dialog { width:calc(100vw - 16px); max-width:calc(100vw - 16px); height:calc(100dvh - 24px); max-height:calc(100dvh - 24px); border-radius:16px; }
  html .media-theme-heading { padding:20px 16px 14px; gap:12px; }
  html .media-theme-heading h2 { font-size:24px; }
  html .media-theme-description { font-size:11px; }
  html .media-theme-tools { padding:0 16px 14px; gap:9px; }
  html .media-theme-tools input,html .media-theme-tools select,html .media-theme-wish-form textarea { font-size:16px; }
  html .media-theme-scroll { padding:14px 16px 20px; }
  html .media-theme-grid { gap:12px; }
  html .media-theme-caption { padding:10px; }
  html .media-theme-caption strong { font-size:12px; }
  html .media-theme-footer { padding:13px 16px calc(13px + env(safe-area-inset-bottom)); }
}
@media(max-width:560px) {
  html .media-theme-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  html .media-theme-tools { grid-template-columns:1fr; }
  html .media-theme-modes { grid-column:auto; width:100%; justify-self:stretch; }
  html .media-theme-modes button { flex:1; }
  html .media-theme-results-heading>span { display:none; }
  html .media-theme-footer { flex-wrap:wrap; gap:10px; }
  html .media-theme-current-wrap { width:100%; }
  html .media-theme-actions { width:100%; }
  html .media-theme-actions button { flex:1; }
  html .media-theme-selected { font-size:9px; }
  html .aw-topbar .media-theme-trigger { order:2; margin-left:auto; }
  html .aw-topbar .aw-site-link { order:2; }
  html .aw-topbar .aw-breadcrumb { flex-basis:100%; }
}
@media(max-height:600px) {
  html .media-theme-dialog { height:calc(100dvh - 12px); max-height:calc(100dvh - 12px); }
  html .media-theme-heading { padding-block:10px; }
  html .media-theme-description,html .media-theme-eyebrow { display:none; }
  html .media-theme-heading h2 { font-size:20px; }
  html .media-theme-tools { grid-template-columns:minmax(100px,1fr) minmax(100px,1fr); padding-bottom:8px; }
  html .media-theme-modes { grid-column:1/-1; }
  html .media-theme-footer { padding-block:9px; }
  html .media-theme-current-wrap { width:auto; flex:1; }
  html .media-theme-actions { width:auto; }
}
@media(prefers-reduced-motion:reduce) { html .media-theme-option { transition:none; } }

/* Original-mode header changes only reserve space for the visible theme control.
   The site's original colours, artwork, typography and header background remain. */
html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger) {
  grid-template-columns:auto minmax(0,1fr) auto auto auto;
  gap:clamp(6px,.8vw,13px);
}
html:not(.media-public-themed) .header.site-header.site-header--app:has(> .media-theme-public-trigger) { grid-template-columns:auto minmax(0,1fr) repeat(4,auto); }
html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger) > .brand { grid-column:1; grid-row:1; }
html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger) > .nav { grid-column:2; grid-row:1; }
html:not(.media-public-themed) .header.site-header > .media-theme-public-trigger { grid-column:3; grid-row:1; min-height:44px; }
html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger) > .chat-launch { grid-column:4; grid-row:1; }
html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger) > .site-games-link { grid-column:5; grid-row:1; }
html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger) > .site-app-launch { grid-column:6; grid-row:1; }
html:not(.media-public-themed) .media-hero-art { display:none!important; }
html .media-theme-reset[aria-pressed="true"] { border-color:var(--mt-accent,#c49bff); color:var(--mt-accent,#c49bff); }
@media(max-width:1280px) {
  html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger) { grid-template-columns:minmax(0,1fr) repeat(4,auto); gap:7px; padding-inline:12px; }
  html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger) > .brand { grid-column:1; }
  html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger) > .site-games-link { grid-column:2; }
  html:not(.media-public-themed) .header.site-header > .media-theme-public-trigger { grid-column:3; }
  html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger) > .chat-launch { grid-column:4; }
  html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger) > .menu-button { grid-column:5; grid-row:1; width:44px; height:44px; }
  html:not(.media-public-themed) .header.site-header.site-header--app:has(> .media-theme-public-trigger) { grid-template-columns:minmax(0,1fr) repeat(5,auto); }
  html:not(.media-public-themed) .header.site-header.site-header--app:has(> .media-theme-public-trigger) > .site-app-launch { grid-column:5; }
  html:not(.media-public-themed) .header.site-header.site-header--app:has(> .media-theme-public-trigger) > .menu-button { grid-column:6; }
  html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger):not(:has(> .site-games-link)) { grid-template-columns:minmax(0,1fr) repeat(3,auto); }
  html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger):not(:has(> .site-games-link)) > .media-theme-public-trigger { grid-column:2; }
  html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger):not(:has(> .site-games-link)) > .chat-launch { grid-column:3; }
  html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger):not(:has(> .site-games-link)) > .menu-button { grid-column:4; }
  html:not(.media-public-themed) .header.site-header.site-header--app:has(> .media-theme-public-trigger):not(:has(> .site-games-link)) { grid-template-columns:minmax(0,1fr) repeat(4,auto); }
  html:not(.media-public-themed) .header.site-header.site-header--app:has(> .media-theme-public-trigger):not(:has(> .site-games-link)) > .site-app-launch { grid-column:4; }
  html:not(.media-public-themed) .header.site-header.site-header--app:has(> .media-theme-public-trigger):not(:has(> .site-games-link)) > .menu-button { grid-column:5; }
}
@media(max-width:600px) {
  html:not(.media-public-themed) .site-header .media-theme-public-trigger { width:44px; min-width:44px; padding:0; }
  html:not(.media-public-themed) .site-header .media-theme-public-trigger > span { display:none; }
  html:not(.media-public-themed) .site-header:has(> .media-theme-public-trigger) :is(.site-games-link,.site-app-launch) { width:44px; min-width:44px; padding:0; }
  html:not(.media-public-themed) .site-header:has(> .media-theme-public-trigger) .site-app-launch { font-size:10px; letter-spacing:0; }
  html:not(.media-public-themed) .site-header:has(> .media-theme-public-trigger) .site-games-link > span { display:block; position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
}
@media(max-width:400px) {
  html:not(.media-public-themed) .header.site-header:has(> .media-theme-public-trigger) { gap:4px; padding-inline:8px; }
  html:not(.media-public-themed) .site-header:has(> .media-theme-public-trigger) .brand { gap:5px; font-size:1rem; letter-spacing:.02em; }
  html:not(.media-public-themed) .site-header:has(> .media-theme-public-trigger) .brand-logo { width:26px; height:24px; }
  html:not(.media-public-themed) .site-header:has(> .media-theme-public-trigger) > .chat-launch { min-width:44px; padding-inline:6px; font-size:.65rem; letter-spacing:.02em; }
}
@media(max-width:360px) {
  html:not(.media-public-themed) .header.site-header.site-header--app:has(> .media-theme-public-trigger) { gap:3px; padding-inline:6px; }
  html:not(.media-public-themed) .site-header--app:has(> .media-theme-public-trigger) > .brand { gap:4px; font-size:.85rem; letter-spacing:0; }
  html:not(.media-public-themed) .site-header--app:has(> .media-theme-public-trigger) .brand-logo { width:24px; height:24px; }
}

