/* === Theme tokens ===
 * Default = dark theme. Toggle to light by adding `.light-theme` to <html> or
 * <body>. nav.js stores user preference in localStorage and respects
 * (prefers-color-scheme: light) on first visit.
 *
 * Earlier the dark-theme :root rules used self-referencing values like
 * `--bg: var(--bg)` which collapsed to invalid; concrete colors restored. */
:root{
  --bg:#0b0d12;
  --card:#11151c;
  --text:#e7eaf2;
  --muted:#9aa3b2;
  --line:rgba(255,255,255,.12);
  --accent:#7c5cff;
  --accent2:#00d4ff;
  --accent-dim:rgba(124,92,255,.18);
  --grad1:rgba(124,92,255,.35);--grad2:rgba(0,212,255,.18);--topbar-bg:rgba(11,13,18,.7);
  --btn-bg:rgba(255,255,255,.04);--tile-bg:rgba(255,255,255,.03);--input-bg:rgba(0,0,0,.2);
  --pill-bg:rgba(255,255,255,.06);--pill-border:rgba(255,255,255,.14);
  --r:14px;
  --font-family-ui:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  --font-size-base:16px;
  --font-size-hero-title:34px;
  --space-wrap-x:18px;
  --space-card-pad:14px;
  --space-grid-gap:12px;
  --space-hero-top:24px;
  --space-hero-bottom:10px;
  --grid-min:240px;--grid-max:340px;--grid-panel-min:260px;--grid-panel-max:340px;--grid-img-min:240px;--grid-img-max:330px;--grid-campaign-min:260px;--grid-campaign-max:360px;
  --grid-gap:var(--space-grid-gap);
  --tile-pad-y:10px;--tile-pad-x:14px;
  --devices-cards-columns:2;
  --devices-cards-columns-xs:1;
  --devices-cards-gap:var(--space-grid-gap);
  --device-browser-side-width:320px;
  --device-browser-gap:14px;
}
:root.light-theme,
.light-theme {
  --bg:#ffffff;
  --card:#f4f7fa;
  --text:#111827;
  --muted:#4b5563;
  --line:rgba(0,0,0,.08);
  --accent:#5b3de8;
  --accent2:#00a3cc;
  --accent-dim:rgba(91,61,232,.10);
  --grad1:rgba(124,92,255,.12);--grad2:rgba(0,212,255,.08);--topbar-bg:rgba(255,255,255,.8);
  --btn-bg:rgba(0,0,0,.04);--tile-bg:rgba(0,0,0,.02);--input-bg:#ffffff;
  --pill-bg:rgba(0,0,0,.05);--pill-border:rgba(0,0,0,.1);
}
/* First-visit auto-pick by OS preference (until user clicks the toggle). */
@media (prefers-color-scheme: light) {
  :root:not(.dark-theme):not(.light-theme) {
    --bg:#ffffff;--card:#f4f7fa;--text:#111827;--muted:#4b5563;--line:rgba(0,0,0,.08);
    --accent:#5b3de8;--accent2:#00a3cc;--accent-dim:rgba(91,61,232,.10);
    --grad1:rgba(124,92,255,.12);--grad2:rgba(0,212,255,.08);--topbar-bg:rgba(255,255,255,.8);
    --btn-bg:rgba(0,0,0,.04);--tile-bg:rgba(0,0,0,.02);--input-bg:#ffffff;
    --pill-bg:rgba(0,0,0,.05);--pill-border:rgba(0,0,0,.1);
  }
}
.scrollToTop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  transform: translateY(20px);
  z-index: 900;
}
.scrollToTop.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.scrollToTop:hover {
  background: var(--accent2);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:var(--font-family-ui);font-size:var(--font-size-base);background:radial-gradient(900px 500px at 20% -10%,var(--grad1),transparent 60%),radial-gradient(600px 400px at 90% 0%,var(--grad2),transparent 55%),var(--bg);color:var(--text);line-height:1.45}
a{color:inherit;text-decoration:none}
.wrap{max-width:1100px;margin:0 auto;padding:0 var(--space-wrap-x)}
.topbar{position:sticky;top:0;backdrop-filter:blur(10px);background:var(--topbar-bg);border-bottom:1px solid var(--line);z-index:1000;display:flex;align-items:center;transition:transform .2s ease,opacity .2s ease}
.topbar.topbar--hidden{transform:translateY(-100%);opacity:0;pointer-events:none}
.topbar-inner{display:flex;align-items:center;justify-content:space-between;padding:12px 0;gap:12px}
.logo{font-weight:900;letter-spacing:.2px}
.nav{display:flex;flex-wrap:wrap;gap:12px;opacity:.9}
.langSelect{max-width:120px;min-width:90px;width:auto;flex:0 0 auto}
.input.langSelect{width:110px;max-width:110px;min-width:0;flex:0 0 110px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
.nav a:hover{opacity:1}
.featuredGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--grid-panel-min)), var(--grid-panel-max)));
  gap: var(--grid-gap);
}
.featuredSection {
  background: linear-gradient(135deg, var(--grad1), transparent), var(--card);
  border: 1px solid var(--accent);
}
.homeHero {
  padding: var(--space-hero-top) 0 var(--space-hero-bottom);
}
.hero h1{margin:0 0 6px;font-size:var(--font-size-hero-title)}
.muted{color:var(--muted)}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.row > *{min-width:0}
.row--top{align-items:flex-start}
.row--align-end{align-items:flex-end}
.row--between{justify-content:space-between}
.row--end{justify-content:flex-end}
.row--nowrap{flex-wrap:nowrap}
.row--gap-8{gap:8px}
.row--gap-12{gap:12px}
.plainFiltersRow{display:flex;gap:10px;flex-wrap:wrap;align-items:end}
.plainFiltersRow .fieldSearch{flex:2;min-width:min(240px,100%)}
.plainFiltersRow .fieldSelect{min-width:min(200px,100%)}
.plainFiltersRow .fieldSelectWide{min-width:min(220px,100%)}
.plainFiltersRow .fieldPer{min-width:min(140px,100%)}
.plainFiltersRow .fieldAction{min-width:min(120px,100%);flex:0}
.plainFormRow{display:flex;gap:10px;flex-wrap:wrap;align-items:end}
.plainFormRow .fieldCode{flex:2;min-width:min(220px,100%)}
.plainFormRow .fieldAction{flex:0;min-width:min(160px,100%)}
.plainFormRow .fieldActionSmall{flex:0;min-width:min(140px,100%)}
.plainBundleRow{display:flex;gap:10px;flex-wrap:wrap;justify-content:space-between;align-items:end;margin:10px 0}
.plainBundleRow .bundleInfo{flex:2;min-width:min(260px,100%)}
.plainBundleRow .bundleForm{flex:3;min-width:min(320px,100%)}
.plainPagerRow{display:flex;justify-content:center;margin-top:10px;gap:10px;flex-wrap:wrap;align-items:center}
.pageSectionHead,
.homeSection .sectionHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.pageSectionHead > *,
.homeSection .sectionHead > *,
.pageActionRow > *{min-width:0}
.pageSectionHead h1,
.pageSectionHead h2,
.pageSectionHead .title,
.homeSection .sectionHead h2{margin:0}
.pageSectionHeadStart{align-items:flex-start}
.pageSectionText{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1 1 280px}
.pageActionRow{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  flex-wrap:wrap;
}
.centerActionRow{justify-content:center;margin-top:10px}
.sectionSummary{margin-top:8px}
.sectionSummary[hidden]{display:none!important}
.sectionBody{margin-top:10px}
.devicePanelIntro{margin:6px 0 0}
.devicePanelIntroSub{margin-top:4px}
.deviceTagRow{margin-top:10px}
.deviceVideoWrap{margin-top:14px}
.deviceVideoHead{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.deviceVideoLabel{margin-bottom:6px}
.deviceVideoActions{margin-left:auto;gap:8px}
.deviceVideoTile{padding:0;overflow:hidden}
.deviceVideoFrame{width:100%;aspect-ratio:16/9;height:auto;border:0;display:block}
.deviceNavToolbar{gap:8px}
.deviceNavToolbar #deviceNavSearch{min-width:0;flex:1}
.compareBar{margin:8px 0}
.emptyState{
  margin-top:12px;
  padding:10px 12px;
  border:1px dashed rgba(255,255,255,.14);
  border-radius:12px;
  background:rgba(255,255,255,.03);
  line-height:1.4;
}
.emptyState.compact{margin-top:10px;padding:9px 11px}
.emptyState[hidden]{display:none!important}
.emptyState .btn{margin-top:8px}
.gsi-only #device{display:none!important}
.gsi-only a[href="#gsi"],.gsi-only a[href="gsi.html"]{display:none!important}
.btn{border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:var(--btn-bg);display:inline-flex;align-items:center;gap:8px;justify-content:center}
.btn{white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.btn.primary{border:0;background:linear-gradient(135deg,rgba(124,92,255,.95),rgba(0,212,255,.55))}
.btn:hover{transform:translateY(-1px)}
a:focus-visible,.btn:focus-visible,.input:focus-visible,.select:focus-visible,button:focus-visible{outline:2px solid rgba(124,92,255,.65);outline-offset:2px}
.card{margin:16px 0;padding:var(--space-card-pad);border:1px solid var(--line);border-radius:var(--r);background:var(--card)}
.card h2,.card h3{margin:0 0 10px}
.card > *:first-child{margin-top:0}
.card > *:last-child{margin-bottom:0}
.input,.select{border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:var(--input-bg);color:var(--text);min-width:220px;flex:1;width:100%;max-width:100%}
/* When inputs/selects are wrapped in a non-flex <div> inside a .row, make them expand to the wrapper width. */
.row > div > .input,.row > div > .select{width:100%}
.select{flex:0;min-width:180px}
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--grid-min)),var(--grid-max)));gap:var(--grid-gap);margin-top:12px;align-content:start;align-items:start;grid-auto-rows:max-content;justify-content:start}
/* Devices listing page: keep deterministic 2-column cards by default. */
#deviceCards.grid{
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--devices-cards-gap);
}
@media (max-width: 480px) {
  #deviceCards.grid{grid-template-columns:1fr !important}
}

mark {
  background: var(--accent);
  color: #fff;
  padding: 0 2px;
  border-radius: 2px;
}
:root.light-theme mark {
  background: var(--accent2);
}
#deviceAdminLinks {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
}
.adminToolsHead {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  padding: 0 4px;
}
.adminToolsGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.adminToolBtn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  font-size: 13px;
  justify-content: center;
}
.adminToolBtn .icon {
  font-size: 16px;
}
#deviceNavTreeEmpty {
  padding: 2rem 1rem;
  text-align: center;
}
.navLoader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  min-height: 150px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 4px solid rgba(255,255,255,.1);
  border-left-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--card);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}
body .toast { opacity: 1; transform: translateX(-50%) translateY(0); }

.tile {border:1px solid var(--line);border-radius:12px;padding:var(--tile-pad-y) var(--tile-pad-x);background:var(--tile-bg);position:relative; transition: transform 0.2s ease, border-color 0.2s ease;}
.tile:hover { transform: translateY(-2px); border-color: var(--accent); }
/* Non-interactive form/status tiles in the donate detail shouldn't lift on hover. */
.donateDetail .tile:hover { transform: none; border-color: var(--line); }

.tile,.title,.kv b{overflow-wrap:anywhere;word-break:break-word}
.tile h3{margin:0 0 6px;font-size:16px}
.tileHead{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.tileHead h3{margin:0;font-size:16px}
.tileMeta{font-size:12px;color:var(--muted);white-space:nowrap}
.kv{
  display:flex;
  gap:8px;
  align-items:baseline;
  font-size:13px;
  color:var(--muted);
  min-width:0;
}
.kv > *{min-width:0}
.kv span{
  flex:0 0 auto;
  min-width:64px;
  overflow-wrap:anywhere;
  word-break:break-word;
}
.kv span::after{
  content:':';
  margin-left:1px;
}
.kv b{
  color:var(--text);
  font-weight:650;
  flex:1;
  text-align:left;
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* Home device/GSI cards: keep KV labels from expanding rows excessively. */
#deviceList .kv,
#gsiList .kv{align-items:start}
#deviceList .kv span,
#gsiList .kv span{min-width:52px}
#deviceList .deviceBuildLine b,
#gsiList .gsiFile{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* Prevent long hashes from breaking the layout */
.hashBtn{
  border:0;
  background:transparent;
  color:var(--text);
  font-weight:650;
  padding:0;
  margin:0;
  max-width:100%;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  text-align:left;
  cursor:pointer;
}
.hashBtn:hover{opacity:.9;text-decoration:underline}

.toast{
  position:fixed;
  left:50%;
  bottom:22px;
  transform:translateX(-50%);
  background:rgba(11,13,18,.95);
  border:1px solid var(--line);
  border-radius:14px;
  padding:10px 12px;
  color:var(--text);
  z-index:999;
  font-size:13px;
}
.small{font-size:13px;color:var(--muted)}
.m-0{margin:0}
.mt-0{margin-top:0}
.mt-4{margin-top:4px}
.mt-6{margin-top:6px}
.mt-8{margin-top:8px}
.mt-10{margin-top:10px}
.mt-12{margin-top:12px}
.mt-14{margin-top:14px}
.mb-6{margin-bottom:6px}
.mb-8{margin-bottom:8px}
.mb-10{margin-bottom:10px}
.mb-12{margin-bottom:12px}
.footer{padding:18px 0 30px}
@media (max-width: 860px){.nav{display:none}}
@media (max-width: 560px){.grid{grid-template-columns:1fr}.hero h1{font-size:28px}}

/* Mobile: topbar support buttons should not squeeze into tiny columns */
@media (max-width: 560px){
  .topbar-inner{flex-wrap:wrap}
  #supportLinksTop{justify-content:flex-start!important;width:100%}
  #supportLinks{justify-content:flex-start}
}
.title{font-weight:800;margin-bottom:8px}

/* Home page layout */
.homeHero{
  background:linear-gradient(rgba(0,0,0,.6), rgba(0,0,0,.8)), url("https://images.unsplash.com/photo-1628126235206-5260b9ea6441?ixlib=rb-4.0.3&auto=format&fit=crop&w=1600&q=80") center/cover no-repeat;
  color:#fff;
  padding:4rem 2rem;
  border-radius:12px;
  margin-top:1rem;
}
.homeHero .muted{color:#ddd}
.homeHeroGrid{display:grid;grid-template-columns:1.2fr .8fr;gap:38px;align-items:stretch}
.homeHeroLead{display:flex;flex-direction:column;gap:12px;justify-content:center}
.homeHeroActions{margin-top:4px;gap:10px;flex-wrap:wrap}
.homeHeroBadges{gap:8px;margin-top:2px}
.homeHeroCard{border:1px solid rgba(255,255,255,.2);border-radius:12px;padding:1.5rem;background:rgba(255,255,255,.1);backdrop-filter:blur(10px);box-shadow:0 12px 28px rgba(0,0,0,.2);display:flex;flex-direction:column;justify-content:center;color:#fff}
.homeHeroCard .muted{color:#ddd}
.homeHeroSteps{display:grid;gap:10px;margin-top:12px}
.homeHeroStats{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px;margin-top:12px}
.homeStat{border:1px solid rgba(255,255,255,.12);border-radius:12px;padding:8px 10px;background:rgba(10,14,22,.35)}
.homeStatValue{font-size:18px;font-weight:700}
.homeStatLabel{font-size:12px;color:var(--muted)}
.homeColumns{display:grid;grid-template-columns: repeat(2, minmax(0, 1fr));gap:28px;align-items:start}
.homeColumn{display:flex;flex-direction:column;gap:18px;min-width:0}
.homeColumns .homeSection{margin:0; min-width:0;}
.sectionTitle{display:flex;flex-direction:column;gap:4px;min-width:0}
.sectionActions{display:flex;align-items:center;gap:8px}
.featureSection{padding:2rem}
.featureGrid{
  display: flex;
  flex-wrap: wrap;
  gap: 38px;
  align-items: stretch;
}
.featureGrid > * {
  flex: 1 1 calc(33.333% - 38px);
  min-width: 280px;
}
.homeFilters{gap:10px;align-items:center}
.homeFilters .input{flex:1 1 220px}
.homeFilters .select{flex:0 0 200px}

/* Update .homeList */
.homeList {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
  align-items: start;
}
.homeList.is-loading{min-height:180px}

/* Update .homeList .tile */
.homeList .tile {
  padding: 16px;
  height: 100%;
  width: 100%;
  min-width: 0;
  flex: none;
}

/* Home device builds: keep a strict two-cards-per-row layout. */
#deviceList{
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:18px;
}

/* Mobile responsiveness (Google Husky fix) */
@media (max-width: 720px) {
  .homeList {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  #deviceList{
    grid-template-columns:1fr;
  }
}

/* Find and update .homeList .deviceCard */
#deviceList .deviceCard {
  padding: 18px !important;
  gap: 16px !important;
  grid-template-columns: 112px minmax(0, 1fr) !important;
  transition: transform 0.2s, box-shadow 0.2s;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--line);
  min-height: 100%;
}
#deviceList .deviceCard:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

@media (max-width: 480px) {
  #deviceList .deviceCard { grid-template-columns: 1fr !important; text-align: center; }
  #deviceList .deviceMeta { align-items: center; }
  #deviceList .deviceCardActions { justify-content: center; }
}

/* Find and update .homeList .deviceThumb */
#deviceList .deviceThumb {
  width: 112px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  background: rgba(255,255,255,0.03);
}
#deviceList .deviceThumb img{width:100%;height:100%;object-fit:cover;display:block}
#deviceList .deviceThumbPlaceholder{width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:12px;letter-spacing:.02em}
.device-img-placeholder{
  width:100%;
  height:140px;
  object-fit:cover;
  border-radius:8px;
  margin-bottom:1rem;
  background:#f0f0f0 url("https://images.unsplash.com/photo-1598327105666-5b89351cb315?ixlib=rb-4.0.3&auto=format&fit=crop&w=400&q=80") center/cover no-repeat;
}
.homeList .deviceMeta,
.homeList .gsiMeta{min-width:0;display:flex;flex-direction:column;gap:8px;align-content:start}
/* Hierarchy & Typography */
#deviceList .deviceCardTitle {
  font-size: 18px !important;
  font-weight: 800 !important;
  margin-bottom: 8px;
}
.homeList .gsiTitle{text-align:left;width:100%;line-height:1.3;margin:0}

#deviceList .deviceMeta .kv {
  font-size: 14px !important;
  margin-bottom: 6px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
}
.homeList .gsiMeta .kv{display:grid;grid-template-columns:52px minmax(0,1fr);column-gap:6px;align-items:start}

#deviceList .deviceMeta .kv span {
  font-weight: 600 !important;
  color: var(--muted);
}

/* The Build Highlight Line */
#deviceList .deviceBuildLine {
  background: var(--accent-dim);
  padding: 8px 12px;
  border-radius: 10px;
  margin: 10px 0;
  border: 1px solid rgba(124, 92, 255, 0.1);
}
.homeList .deviceMeta .kv b,
.homeList .gsiMeta .kv b{text-align:left;white-space:normal;overflow-wrap:anywhere;word-break:break-word}
.homeList .deviceCardActions,
.homeList .gsiCardActions{margin-top:auto;padding-top:4px;justify-content:flex-start;align-items:center}
.homeList .gsiCard{height:auto;display:grid;gap:8px;align-content:start}
.homeList .gsiTitle{white-space:normal;overflow-wrap:anywhere;word-break:break-word}
.homeList .gsiFile{
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
  max-width:100%;
}
.homeList .row{flex-wrap:wrap}
.homeHasStats .homeHeroBadges [data-i18n="home_badge_devices"]{display:none}
@media (max-width: 920px){
  .homeHeroGrid{grid-template-columns:1fr}
  .homeColumns{grid-template-columns:1fr}
}
@media (max-width: 560px){
  #deviceList .deviceCard{grid-template-columns:90px 1fr !important;gap:12px !important}
  #deviceList .deviceThumb{width:90px !important}
  .homeHeroStats{grid-template-columns:repeat(auto-fit,minmax(110px,1fr))}
  .homeFilters{flex-direction:column;align-items:stretch}
  .homeFilters .select{flex:1 1 auto;width:100%}
}

/* Skeleton loaders */
.skeletonCard{position:relative;overflow:hidden}
.skeletonBlock{position:relative;background:rgba(255,255,255,.08);border-radius:10px;overflow:hidden}
.skeletonLine{position:relative;height:12px;background:rgba(255,255,255,.08);border-radius:999px;overflow:hidden}
.skeletonLine.sm{height:10px}
.skeletonLine.lg{height:14px}
.skeletonPad{padding:6px 0}
.skeletonCard:after,
.skeletonBlock:after,
.skeletonLine:after{
  content:"";
  position:absolute;
  top:0;left:-120%;
  width:120%;
  height:100%;
  background:linear-gradient(90deg,rgba(255,255,255,0),rgba(255,255,255,.18),rgba(255,255,255,0));
  animation:skeleton-shimmer 1.6s infinite;
}
@keyframes skeleton-shimmer{
  0%{left:-120%}
  100%{left:120%}
}
@media (prefers-reduced-motion: reduce){
  .skeletonCard:after,
  .skeletonBlock:after,
  .skeletonLine:after{animation:none}
}

/* Devices page hero */
.devicesHeroGrid{display:grid;grid-template-columns:1.3fr .7fr;gap:18px;align-items:start}
.devicesHeroGrid.devicesHeroGrid--single{grid-template-columns:minmax(0,1fr)}
.devicesHeroLead,.devicesHeroSide{min-width:0}
.devicesHeroSide[hidden]{display:none!important}
.devicesHeroControls[hidden]{display:none!important}
.devicesHeroCard{border:1px solid var(--line);border-radius:14px;padding:12px;background:rgba(255,255,255,.03)}
.devicesHeroSearchRow,
.devicesHeroFilters{margin-top:10px}
.compareBar .pageActionRow{margin-left:auto}
@media (max-width: 920px){
  .devicesHeroGrid{grid-template-columns:1fr}
}

/* Mobile navigation toggle */
.navToggle{display:none;border:1px solid var(--line);border-radius:12px;padding:8px 10px;background:var(--btn-bg);cursor:pointer;color:var(--text)}
@media (max-width: 560px){
  .navToggle{display:inline-flex}
  .topbar-inner{position:relative}
  .nav{display:none;position:absolute;top:52px;left:0;right:0;flex-direction:column;gap:8px;padding:10px;background:var(--bg);border:1px solid var(--line);border-radius:14px;margin:0 18px;z-index:50;box-shadow:0 10px 30px rgba(0,0,0,0.2)}
  .nav.open{display:flex}
}

/* Small screens: phones */
@media (max-width: 480px){
  .wrap{padding:0 12px}
  .hero{padding:18px 0 8px}
  .hero h1{font-size:24px}
  .btn{padding:9px 10px}
  .input,.select{min-width:0;padding:9px 10px}
  .tile h3{font-size:15px}
  .devicesHeroCard{padding:10px}
}

/* Ultra-compact (watch / very small) */
@media (max-width: 360px){
  body{font-size:14px}
  .topbar-inner{gap:8px}
  .btn{padding:8px 9px;font-size:12px}
  .chip,.chipBtn{font-size:12px}
  .card{padding:12px}
  .devicePhotoFrame{aspect-ratio:1/1}
}

#deviceHeader .deviceImg{height:auto;max-height:220px;object-fit:contain}
#deviceName{overflow-wrap:anywhere;word-break:break-word}
@media (max-width: 560px){#deviceHeader .deviceImg{max-height:180px}}

/* Device page layout */
.split{display:grid;grid-template-columns:260px minmax(0,1fr);gap:14px;align-items:start}
.split > *{min-width:0}
.split.split--single{grid-template-columns:minmax(0,1fr)}
.deviceHeaderSplit{display:grid;grid-template-columns:minmax(0,340px) minmax(0,1fr);gap:16px;align-items:start}
.deviceHeaderSplit > div{min-width:0}
.deviceHeaderActions{gap:8px;flex-wrap:wrap;margin-top:12px}
.compatToggle{margin:0}
.devicePanel{min-width:0}
.devicePanel .grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--grid-panel-min)),var(--grid-panel-max)));gap:var(--grid-gap);align-items:start;justify-content:start;align-content:start}
.devicePanel .tile{height:auto}
.imgGroup .grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,var(--grid-img-min)),var(--grid-img-max)));justify-content:start;align-content:start}
.imgTileMedia{height:160px}
.bundleCard{background:rgba(255,255,255,.03)}
#device .devicePanel .tile{
  padding:10px 14px;
}
#device .bundleRow{
  grid-template-columns:minmax(0,1fr) auto;
  align-items:start;
}
#device .bundleSide{
  min-width:132px;
}
#device .bundleItemActions{
  min-width:132px;
}
@media (max-width: 720px){
  .split,
  .deviceHeaderSplit,
  .deviceBrowserGrid{grid-template-columns:1fr}
  .devicePanel .grid,
  .imgGroup .grid{grid-template-columns:1fr}
}

/* Device card media */
/* Device cards (devices page) */
.deviceCard{display:flex;flex-direction:column;gap:8px;height:auto;position:relative}
.deviceCardMedia{aspect-ratio:4/3;border-radius:12px;overflow:hidden;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.03);display:flex;align-items:center;justify-content:center}
.deviceCardImg{width:100%;height:100%;object-fit:cover;display:block}
.deviceCardPlaceholder{width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:12px;letter-spacing:.02em}
.cmpBadge{position:absolute;top:10px;right:10px;display:flex;gap:6px;align-items:center;padding:6px 8px;border-radius:999px;border:1px solid var(--line);background:var(--card)}

/* Home page device + GSI grids: allow cards to shrink to content. */
#deviceList.grid,
#gsiList.grid{
  align-items:start;
  align-content:start;
  grid-auto-rows:max-content;
}
#deviceList .tile,
#gsiList .tile{
  height:auto;
  min-height:0;
  align-self:start;
}
#deviceList .deviceCard{align-items:flex-start;min-height:0}
#deviceList .deviceCardTitle{
  white-space:normal;
  overflow-wrap:anywhere;
  word-break:break-word;
}
#deviceList .deviceBuildLine b{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* Device header photo frame */
.devicePhotoFrame{aspect-ratio:4/3;border-radius:16px;overflow:hidden;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.03);width:100%;max-width:100%;display:flex;align-items:center;justify-content:center;padding:10px}
.devicePhoto{width:100%;height:100%;max-width:100%;object-fit:contain;display:block}
@media (max-width: 560px){
  .devicePhotoFrame{aspect-ratio:16/9}
}

/* Devices browser */
.stack{display:flex;flex-direction:column;gap:8px}
.stack--gap-10{gap:10px}
.stack--gap-12{gap:12px}
.deviceBrowserFacet{display:grid;gap:10px}
.deviceBrowserSectionHead{margin-top:14px}
.deviceBrowserContent{min-width:0}
.brandItem{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line);background:rgba(255,255,255,.03);border-radius:12px;color:var(--text);cursor:pointer}
.brandItem:hover{opacity:.95}
.brandItem.active{border-color:rgba(124,92,255,.65);background:rgba(124,92,255,.14)}

/* Per-device: file-explorer style navigation */
.deviceBrowserGrid{display:grid;grid-template-columns:var(--device-browser-side-width) 1fr;gap:var(--device-browser-gap);align-items:start}
.deviceBrowserSide{position:sticky;top:74px;max-height:calc(100vh - 92px);overflow:auto}
.deviceBrowserMain{min-width:0}
.deviceQuickNavCard{position:sticky;top:74px;z-index:20}
.deviceQuickNavRow{gap:8px;flex-wrap:wrap}
.deviceDownloadsTools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0;margin:8px 0 10px}
.deviceDownloadsTools[hidden]{display:none!important}
.deviceDownloadsTools .actionRowWrap{width:100%}
.deviceDownloadsTools .pageActionRow{margin-left:0}
.deviceNavTree{margin-top:10px}
.deviceNavTree .navChildren {
  border-left: 1px solid rgba(255,255,255,0.08);
  margin-left: 14px;
}
.deviceNavTree .navRow, .deviceNavTree .navLeaf {
  position: relative;
}
.deviceNavToolbar .relative { position: relative; }
.navSearchWrap { display: flex; align-items: center; }
.navSearchClear {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.navSearchClear:hover { color: var(--text); }
.navSearchCount {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  background: var(--bg);
  padding: 0 4px;
  font-size: 10px;
}

/* Tree Elbow Connectors */
.deviceNavTree .navChildren {
  border-left: 1px solid rgba(255,255,255,0.08);
  margin-left: 14px;
  padding-left: 4px;
}
.deviceNavTree .navRow::before, .deviceNavTree .navLeaf::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 14px;
  width: 12px;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.deviceNavTree .navDepth-0::before { display: none; }
.navTree details[open] > summary .caret { transform: rotate(90deg); }
.navTree details .navChildren {
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform-origin: top;
  transform: scaleY(0.95);
  opacity: 0;
  max-height: 0;
}
.navTree details[open] .navChildren {
  transform: scaleY(1);
  opacity: 1;
  max-height: 1000px; /* Arbitrary large number */
  transition: opacity 0.5s ease, transform 0.3s ease, max-height 0.5s ease-out;
}
.navTree .caret { 
  display: inline-block; 
  transition: transform 0.2s ease-in-out; 
  width: 14px; 
  text-align: center;
}
.deviceSkeletonGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.deviceSkeletonTile{height:96px;border-radius:12px;border:1px solid var(--line);background:linear-gradient(90deg,rgba(255,255,255,.04),rgba(255,255,255,.09),rgba(255,255,255,.04));background-size:200% 100%;animation:deviceShimmer 1.2s infinite}
@keyframes deviceShimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
@media (max-width: 920px){
  .deviceBrowserGrid{grid-template-columns:1fr}
  .deviceQuickNavCard{position:static}
  .deviceSkeletonGrid{grid-template-columns:1fr}
  .deviceBrowserSide{position:static;max-height:none;overflow:visible}
}

/* Device page polish */
#device .hero{
  background:linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8)), url('https://images.unsplash.com/photo-1511707171634-5f897ff02aa9?ixlib=rb-4.0.3&auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
  border:1px solid rgba(135,196,255,.25);
  color: white;
  border-radius: 12px;
  margin-top: 1rem;
}
#device .hero .muted { color: #ddd; }
.donateHero {
  background:linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8)), url('https://images.unsplash.com/photo-1550565118-3a14e8d0386f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
  color: white;
  border-radius: 12px;
  margin-top: 1rem;
  padding: 3rem 2rem;
}
.donateHero .muted { color: #ddd; }
#device #deviceHeader{
  border:1px solid rgba(150,216,255,.24);
  background:linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
}
#device .devicePhotoFrame{
  border:1px solid rgba(152,210,255,.32);
  box-shadow:0 12px 30px rgba(0,0,0,.25);
}
#device .deviceBrowserSide{
  border:1px solid rgba(150,216,255,.20);
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  overflow-x:hidden;
}
#device .devicePanel{
  border:1px solid rgba(150,216,255,.18);
  background:linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.02));
}
#device .imgTileMedia,
#device .romCatImg,
#device .bundleLeadLogo,
#device .bundleItemLogo{
  background:rgba(255,255,255,.07);
}

/* Device page: compact left navigation (avoid long empty full-width boxes). */
#device .navTree details{
  border:0;
  background:transparent;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
}
#device .navTree{
  align-items:flex-start;
}
#device .navTree > details,
#device .navTree > .navLeaf{
  align-self:flex-start;
}
#device .navTree details > summary{
  width:auto;
  max-width:100%;
}
#device .navTree .navRow,
#device .navTree .navLeaf{
  display:grid;
  grid-template-columns:10px auto 1fr;
  align-items:center;
  column-gap:6px;
  width:fit-content;
  max-width:100%;
  min-width:0;
  padding:4px 8px;
  min-height:24px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.03);
  border-radius:10px;
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}
#device .navTree .navLabel{
  grid-column:3;
  min-width:0;
  max-width:none;
  font-size:16px;
  line-height:1.22;
  letter-spacing:.01em;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  overflow-wrap:anywhere;
  word-break:break-word;
}
#device .navTree .navLeaf{
  color:var(--text);
}
#device .navTree .navLeaf.navActive{
  border-color:rgba(124,92,255,.48);
  background:rgba(124,92,255,.18);
  box-shadow:0 0 0 1px rgba(124,92,255,.18);
}
#device .navTree .navChildren{
  padding:4px 0 2px 10px;
  border-left:1px dashed rgba(255,255,255,.10);
  margin-left:8px;
}

.navTree{display:flex;flex-direction:column;gap:3px}
.navTree details{border:1px solid rgba(255,255,255,.10);border-radius:12px;background:rgba(255,255,255,.02)}
.navTree details summary{list-style:none;cursor:pointer}
.navTree details summary::-webkit-details-marker{display:none}
.navRow{display:flex;align-items:center;gap:8px;padding:9px 10px;border-radius:12px;min-height:38px}
.navRow:hover, .navLeaf:hover { background: rgba(255,255,255, .04); }
.navRow:focus-visible, .navLeaf:focus-visible {
  outline: 2px solid rgba(124,92,255,.65);
  outline-offset: -2px;
  background: rgba(124,92,255,.1);
}
.navLeaf.navActive { font-weight: 800; background: rgba(124,92,255,.08); }

.navRow .caret{width:14px;height:14px;display:inline-flex;align-items:center;justify-content:center;opacity:.85;flex:0 0 auto;transition:transform .12s ease}
.navTree details[open] > summary .caret{transform:rotate(90deg)}
.navLabel{min-width:0;flex:1;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.navRow .label{display:flex;align-items:center;gap:8px;min-width:0;flex:1}
.navRow .label span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.navLogo{width:18px;height:18px;object-fit:contain;border-radius:6px;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.06);flex:0 0 auto}
.navFolder .navLogo{width:22px;height:22px;border-radius:8px}
.navChildren{padding:1px 0 3px 0}

.navLeaf{display:flex;align-items:center;gap:8px;width:100%;border:0;background:transparent;color:var(--text);cursor:pointer;padding:9px 10px;border-radius:12px;min-height:38px}
.navLeaf:hover{background:rgba(255,255,255,.04)}
.navLeaf .label{display:flex;align-items:center;gap:8px;min-width:0;flex:1}
.navLeaf .label span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.navLeaf.navActive{background:rgba(124,92,255,.14);border:1px solid rgba(124,92,255,.35)}

#device .navTree .navRow .caret,
#device .navTree .navLeaf .caret{grid-column:1}
#device .navTree .navLogo{grid-column:2}

/* Stable tree layout: indent inside each row, not via external margins. */
.navIndent{padding-left:calc(0px + (var(--depth,0) * 3px))}
.navLabel{max-width:none}
.navDepth-1 .navLabel{max-width:none}
.navDepth-2 .navLabel{max-width:none}
.navDepth-3 .navLabel{max-width:none}
.navDepth-0{border-color:rgba(120,195,255,.30);background:rgba(120,195,255,.07)}
.navDepth-1{border-color:rgba(255,255,255,.14);background:rgba(255,255,255,.03)}
.navDepth-2{border-color:rgba(255,255,255,.10);background:rgba(255,255,255,.02)}
.navDepth-3{border-color:rgba(255,255,255,.08);background:rgba(255,255,255,.015)}
#device .navTree .navDepth-2,
#device .navTree .navDepth-3{
  border-left:2px solid rgba(124,92,255,.18);
}
#device .deviceBrowserSide #deviceNavSearch{
  font-size:13px;
  padding-right:74px;
  border-color:rgba(255,255,255,.18);
  background:rgba(255,255,255,.03);
}
#device .deviceBrowserSide #deviceNavSearch:focus{
  border-color:rgba(124,92,255,.55);
  box-shadow:0 0 0 2px rgba(124,92,255,.18);
}
#device .deviceNavToolbar{
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
#device .deviceNavToolbar .navSearchWrap{
  flex:1 1 220px;
  min-width:180px;
}
#device .deviceNavToolbar .navSearchClear{
  right:40px;
  width:22px;
  height:22px;
  border-radius:999px;
  background:rgba(255,255,255,.04);
  font-size:14px;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
}
#device .deviceNavToolbar .navSearchClear:hover{
  background:rgba(255,255,255,.10);
}
#device .deviceNavToolbar .navSearchCount{
  right:8px;
  min-width:22px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  font-weight:600;
  color:var(--text);
}
#device .navTree .caret{
  color:var(--muted);
  font-size:12px;
}
#device .navTree .navLeaf .caret{
  font-size:9px;
  opacity:.55;
}
#device .navTree .navRow:hover,
#device .navTree .navLeaf:hover{
  background:rgba(255,255,255,.06);
  border-color:rgba(255,255,255,.18);
}
#device .navIndent{
  padding-left:calc(0px + (var(--depth,0) * 6px));
}
#device .navDepth-0{
  border-color:rgba(120,195,255,.24);
  background:rgba(120,195,255,.05);
}

.devicePanel{min-width:0}


/* Rich text content (admin editor output) */
.rt-content{line-height:1.55}
.rt-content img{max-width:100%;height:auto;border-radius:12px}
.rt-content iframe{max-width:100%;border:0;border-radius:12px}
.rt-content h1{font-size:28px;margin:18px 0 10px}
.rt-content h2{font-size:22px;margin:16px 0 8px}
.rt-content h3{font-size:18px;margin:14px 0 8px}
.rt-content blockquote{border-left:3px solid rgba(255,255,255,.18);padding-left:12px;margin:12px 0;color:rgba(255,255,255,.85)}
.rt-content pre{overflow:auto;padding:12px;border-radius:12px;background:rgba(0,0,0,.28);border:1px solid rgba(255,255,255,.12)}
.rt-content code{background:rgba(255,255,255,.06);padding:2px 6px;border-radius:8px}
.rt-content .markdown-heading{margin:16px 0 10px}
.rt-content .markdown-heading .anchor{display:none}
.rt-content .heading-element{margin:0}
.rt-content .highlight{margin:12px 0;border:1px solid rgba(255,255,255,.12);background:rgba(0,0,0,.22);border-radius:12px;overflow:auto}
.rt-content .highlight pre{margin:0;background:transparent;border:0;padding:12px}
.rt-content .highlight code{background:transparent;border:0;padding:0}
.rt-content .highlight .zeroclipboard-container{display:none}
.rt-content .highlight .pl-c{color:#93a1c3}
.rt-content .highlight .pl-k{color:#8f7dff}
.rt-content .highlight .pl-s,
.rt-content .highlight .pl-s1,
.rt-content .highlight .pl-s2{color:#9fd8b6}
.rt-content .highlight .pl-en{color:#66c0ff}
.rt-content .highlight .pl-v,
.rt-content .highlight .pl-c1{color:#f3c97a}
.rt-content table{width:100%;border-collapse:collapse;margin:12px 0}
.rt-content table th,
.rt-content table td{border:1px solid rgba(255,255,255,.12);padding:6px 8px}

/* v7 UI chips + collapsible helpers */
.spacer{flex:1}
.btn.tiny{padding:6px 10px;border-radius:999px;font-size:13px}
.campDetailSticky{position:sticky;top:10px;z-index:10;background:rgba(20,27,43,.88);backdrop-filter:blur(8px);padding:8px;border:1px solid var(--line);border-radius:12px}
.campDetailSticky{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.chipRow{display:flex;flex-wrap:wrap;gap:6px}
.chip{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;border:1px solid var(--line);font-size:13px;line-height:1.2;color:var(--text);white-space:normal;overflow-wrap:anywhere;word-break:break-word}
.chipBtn{border:1px solid var(--line);border-radius:12px;padding:8px 10px;background:rgba(255,255,255,.04);display:block;width:100%;text-align:left;color:var(--text);cursor:pointer;white-space:normal;overflow-wrap:anywhere;word-break:break-word}
.chipBtn:hover{transform:translateY(-1px)}
.chipBtn.active{border-color:rgba(124,92,255,.6);background:rgba(124,92,255,.16)}
.chipBtn.active{outline:2px solid rgba(124,92,255,.35)}
.campSearchWrap input{width:100%}
.brandItem{white-space:normal}
.brandItem span:first-child{overflow-wrap:anywhere;word-break:break-word;text-align:left}

/* Donate page: categories + campaigns list should work well on mobile.
   Desktop: two columns. Mobile: stack + horizontal-scroll categories chips so 10k+ categories
   doesn't push campaigns below the fold.
*/
.campLayout{display:grid;grid-template-columns:260px 1fr;gap:16px;align-items:start}
.campCatsCol{min-width:0;position:sticky;top:12px}
.campCardsCol{min-width:0}
.campCatsCol .stack a,.campCatsCol .stack button{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
}
.campCatsCol .stack a:hover,.campCatsCol .stack button:hover{background:rgba(255,255,255,.06)}
.donateHeroGrid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,0.8fr);gap:16px;align-items:start}
.donateHeroPanel{border:1px solid var(--line);border-radius:16px;padding:12px;background:rgba(255,255,255,.03)}
.donateSteps{margin:6px 0 8px;padding-left:18px;line-height:1.4}
#campaignCards.grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  justify-content:start;
}
.campCard{display:flex;flex-direction:column;gap:10px;padding:14px;background:rgba(255,255,255,.02)}
.campCardHero{width:100%;aspect-ratio:16/9;border-radius:12px;overflow:hidden;background:rgba(255,255,255,.03);border:1px solid var(--line)}
.campCardHero img{width:100%;height:100%;object-fit:cover;display:block}
.campCardBody{display:flex;flex-direction:column;gap:6px}
.campCardMeta{display:flex;flex-wrap:wrap;gap:8px}
.campBadge{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:999px;border:1px solid var(--line);background:rgba(255,255,255,.04);font-size:12px;color:var(--muted)}
.campBadge.ok{border-color:rgba(46,204,113,.55);color:#baf4cf;background:rgba(46,204,113,.12)}
.campBadge.warn{border-color:rgba(255,193,7,.55);color:#ffe59a;background:rgba(255,193,7,.12)}
.campBadge.info{border-color:rgba(0,212,255,.45);color:#c8f5ff;background:rgba(0,212,255,.10)}
.campCard{position:relative}
.campFeatured{
  position:absolute;
  top:10px;
  right:10px;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--bg);
  background:linear-gradient(135deg,#ffd666,#ff8c42);
  box-shadow:0 4px 14px rgba(0,0,0,.35);
}
.campCardActions{margin-top:10px;display:flex;gap:8px;flex-wrap:wrap}

/* Donate detail text readability */
.donateDetail #campBody{
  max-width:78ch;
  margin-left:auto;
  margin-right:auto;
  line-height:1.75;
  text-wrap:pretty;
}
.donateDetail #campHeader{flex:1 1 auto;width:100%}
.donateDetail #campTitle{margin:0}
.donateDetail #campSubtitle,
.donateDetail #campMetaChips,
.donateDetail #campTotals{margin-top:6px}
.donateDetail #campHero{margin-top:12px}
.donateDetail #campProgress{margin-top:10px}
.donateDetail #campBody{margin-top:12px}
.donateDetail #campThanks{margin-top:12px}
.donateDetail #campPerks{margin-top:12px}
.donateDetail #campPerks h3{margin-top:0}
.donateDetail #campPerksList{margin:0;padding-left:18px}
.donateDetail #campPay{margin-top:14px}
.donateDetail #campPay h3{margin-top:0}
.donateDetail #receiptDetailsBox{margin-top:6px;align-items:center;gap:8px}
.donateDetail #receiptDetailsBox label{display:flex;gap:8px;align-items:center}
.donateDetail #tiersRow{margin-top:10px}
.donateDetail #tiersRow .muted{margin-bottom:8px}
.donateDetail #tiersList{grid-template-columns:repeat(auto-fit,minmax(220px,360px));justify-content:start;gap:12px}
.donateDetail #amountRow{align-items:end}
.donateDetail #donorPrivacyBox{margin-top:10px}
.donateDetail #donorPrivacyBox .tile{margin-top:6px;padding:10px}
.donateDetail #donorPrivacyOpts{margin-top:10px}
.donateDetail #donorPrivacyOpts .muted.small{margin-bottom:6px}
.donateDetail #donorPrivacyOpts .row{gap:10px;flex-wrap:wrap}
.donateDetail #donorAliasBox{margin-top:8px}
/* Space the "Hide my email" checkbox off the radio options above (match the 10px gap used elsewhere). */
.donateDetail #donorPrivacyOpts > label.small{margin-top:10px}
.donateDetail #donorPrivacyBox label.small{display:flex;gap:8px;align-items:center}
.donateDetail #donorPrivacyBox .muted.small.mt-8{margin-top:8px}
.donateDetail #campBody > :first-child{margin-top:0}
.donateDetail #campBody > :last-child{margin-bottom:0}
.donateDetail #campBody p,
.donateDetail #campBody li{
  overflow-wrap:anywhere;
  word-break:normal;
}
.donateDetail #campBody p{margin:0 0 1em}
.donateDetail #campBody ul,
.donateDetail #campBody ol{margin:0 0 1em;padding-left:1.25em}
.donateDetail #campBody li + li{margin-top:.35em}
.donatePage .payMethodsGrid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(240px,360px));
  justify-content:start;
  gap:14px;
}
.donatePage .payMethodCard{
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.02);
  padding:12px;
}
.donatePage .payMethodCard .btn{
  width:auto;
  max-width:100%;
}
.donatePage #paypal-button-container{
  width:100%;
  max-width:320px;
}
.donatePage #paypal-button-container > div{
  max-width:320px !important;
}
.donatePage #paypalMonthlyBtn{
  padding:8px 10px;
  font-size:13px;
}
@media (max-width: 720px){
  .donateHeroGrid{grid-template-columns:1fr}
  .campLayout{grid-template-columns:1fr}
  .campCatsCol{position:static}
	  		  /* Categories: wrap for small sets; enable swipe strip only when JS adds .catsScroll */
		  #campCatsWrap:not(.catsMany){display:flex;flex-direction:row;gap:8px;flex-wrap:wrap;overflow:visible;max-width:100%}
		  #campCatsWrap:not(.catsMany).catsScroll{flex-wrap:nowrap;overflow:auto;padding-bottom:6px}
		  #campCatsWrap:not(.catsMany) .chipBtn, #campCatsWrap:not(.catsMany) .btn{flex:0 0 auto}
		  #campCatsWrap:not(.catsMany).catsScroll .chipBtn, #campCatsWrap:not(.catsMany).catsScroll .btn{white-space:nowrap}
		  #campCatsWrap:not(.catsMany):not(.catsScroll) .chipBtn, #campCatsWrap:not(.catsMany):not(.catsScroll) .btn{white-space:normal}
		  #campCatsWrap.catsMany{display:flex;flex-direction:column;gap:8px;overflow:visible}
		  #campCatsWrap.catsMany input{width:100%}
  /* Search box should not fight the header on small screens */
  .campListHeader{flex-wrap:wrap}
  .campSearchWrap{flex-basis:100%}
  .donatePage #paypal-button-container,
  .donatePage #paypal-button-container > div{
    max-width:100% !important;
  }
  .donatePage .payMethodsGrid{grid-template-columns:1fr}
  #campaignCards.grid{grid-template-columns:1fr}
}

/* Donate campaign titles: allow admin-controlled alignment */
.donate-campaign-title{display:block;width:100%;margin:0;text-align:left}
.donate-campaign-title.align-center{text-align:center}
.donate-campaign-title.align-right{text-align:right}


/* ===== Fixes / Admin UI helpers ===== */
/* Ensure HTML hidden attribute always works (was overridden by .stack/.row display rules) */
[hidden]{display:none !important;}

/* Global form controls (admin uses raw <input>/<select>/<textarea>)
   IMPORTANT: do NOT apply this to checkboxes/radios (it breaks alignment).
*/
input:not([type]),
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
select,
textarea{
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px 12px;
  background:rgba(0,0,0,.22);
  color:var(--text);
  font:inherit;
}

/* Keep checkboxes/radios compact + aligned (use native control, with accent color). */
input[type="checkbox"],
input[type="radio"]{
  width:18px;
  height:18px;
  margin:0;
  padding:0;
  accent-color:var(--accent);
}
select{color-scheme:dark;}
textarea{min-height:120px;}
option{background:var(--card);color:var(--text);}

/* Checkbox rows: stable (no tetris/overlap)
   IMPORTANT: do NOT force width:100% globally.
   When a checkbox label is allowed to shrink too far and we use
   overflow-wrap:anywhere, browsers can wrap character-by-character
   (looks like "vertical" text). */
.checkitem{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  border-radius:12px;
  width:auto;
  box-sizing:border-box;
  min-width:0;
  flex-wrap:nowrap;
  flex:1 1 100%;
  max-width:100%;
  overflow-wrap:normal;
  word-break:normal;
}
.checkitem input[type="checkbox"],
.checkitem input[type="radio"]{
  margin:2px 0 0 0;
  width:20px;
  height:20px;
  flex:0 0 auto;
  /* Keep the control next to the text even if markup puts it last. */
  order:0;
}
.checktext{
  /* Let text wrap, but keep the checkbox visually attached to the start. */
  flex:1 1 auto;
  min-width:0;
  writing-mode:horizontal-tb;
  white-space:normal;
  overflow-wrap:normal;
  word-break:keep-all;
  line-height:1.25;
  order:1;
}

/* Admin checkbox groups: keep each label full width to avoid shrink/vertical wrapping. */
.checks{
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:stretch;
  min-width:0;
}



/* If a checkbox group sits inside a flex row, keep it from collapsing into a super-narrow
   column (which makes long labels look "vertical"). */
.row .checks, .controlsRow .checks{flex:1 1 320px;min-width:260px}
@media(max-width:560px){.row .checks, .controlsRow .checks{min-width:0}}
.checks .checkitem{width:100%}

/* Inline checkbox (compact, prevents character-by-character wrapping). */
.checkitem.inline{display:inline-flex;align-items:center;gap:10px;width:auto;max-width:none}
.checkitem.inline{flex:0 0 auto}
.checkitem.inline .checktext{white-space:nowrap;overflow-wrap:normal}

/* Ultra-compact inline checkbox for admin toolbars/rows.
   Used by Admin (class="inlineCheck" or class="checkitem inlineCheck"). */
.inlineCheck{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:0;
  border:0;
  background:transparent;
  min-width:0;
  max-width:100%;
}
.inlineCheck input[type="checkbox"],
.inlineCheck input[type="radio"]{
  flex:0 0 auto;
  margin:0;
}
.inlineCheck .checktext,
.inlineCheck span{
  display:inline-block;
  /* Prevent inherited .tile overflow-wrap:anywhere from turning short words vertical */
  white-space:nowrap;
  overflow-wrap:normal;
  word-break:normal;
  overflow:hidden;
  text-overflow:ellipsis;
  line-height:1.2;
}
/* Keep Enable/Disable from shifting the label width when toggled via JS */
.inlineCheck .checktext{min-width:7ch}

/* When inlineCheck is combined with checkitem, remove the big box styling */
.checkitem.inlineCheck{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:0;
  border:0;
  background:transparent;
  border-radius:0;
  width:auto;
}
.checkitem.inlineCheck .checktext{
  white-space:nowrap;
  overflow-wrap:normal;
}

/* Admin split layout (devices/releases/gsi/file editor etc.) */
.adminSplit{display:grid;grid-template-columns:340px 1fr;gap:14px;align-items:start}
.adminSide{min-width:0}
.adminMain{min-width:0}
@media (max-width: 920px){.adminSplit{grid-template-columns:1fr}}

.sideList{display:flex;flex-direction:column;gap:6px;max-height:55vh;overflow:auto;padding-right:4px}
.sideLink{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:12px;border:1px solid var(--line);background:rgba(255,255,255,.03);text-align:left}
.sideLink .meta{white-space:nowrap}
.sideLink:hover{opacity:.95}
.sideLink.active{border-color:rgba(124,92,255,.65);background:rgba(124,92,255,.14)}
.sideLink .meta:empty{display:none}
.sideHead{margin:10px 0 6px;font-weight:800;color:rgba(255,255,255,.92)}

/* Admin: optional pill/tab mode for small section navigation.
   Use <div class="sideList sideListTabs"> to make items shrink to their text.
   (Fixes "full-width boxes" when you want compact pills, as in screenshot 2a.) */
.sideListTabs{flex-direction:row;flex-wrap:wrap;align-items:flex-start;max-height:none;overflow:visible;padding-right:0}
.sideListTabs .sideLink{display:inline-flex;align-items:center;gap:6px;width:auto;white-space:nowrap;max-width:min(100%, 320px);overflow:hidden;text-overflow:ellipsis}

/* Tables in admin */
.tablewrap{overflow:auto}
table{width:100%;border-collapse:collapse}
th,td{padding:10px 10px;border-bottom:1px solid var(--line);vertical-align:top}
th{font-weight:800;color:rgba(255,255,255,.92)}
/* Utility: keep specific cells on one line */
.nowrap{white-space:nowrap}
/* Campaign/title blocks inside admin donation log should wrap safely */
.campTitle{white-space:normal;overflow-wrap:anywhere;word-break:break-word}
.campCell{white-space:normal;overflow-wrap:anywhere;word-break:break-word}
/* Prevent long strings (campaign ids, emails, sha256) from overlapping */
table td{overflow-wrap:anywhere;word-break:break-word}
@media (max-width: 560px){
  /* Mobile: allow wrapping inside cells to avoid text overlap.
     Keep explicit .nowrap cells on one line. */
  table{display:block;overflow-x:auto}
  th,td{white-space:normal}
}

/* Buttons */
.btn.danger{border-color:rgba(255,90,90,.45);background:rgba(255,90,90,.08)}
.btn.danger:hover{opacity:.95}
.btn.disabled-paytab{background:rgba(255,255,255,.04);color:var(--muted);border-color:rgba(255,255,255,.12);box-shadow:none}
.btn.disabled-paytab:hover{transform:none}

/* <details> preview blocks */
details{border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:rgba(255,255,255,.02)}
details summary{cursor:pointer;font-weight:800}



/* Changelog UX (v59) */
.release{
  padding-top:12px;
  margin-top:12px;
  border-top:1px solid rgba(255,255,255,.10);
}
.release.collapsed{
  max-height:240px;
  overflow:hidden;
}
.showMoreRow{
  margin-top:10px;
}


/* Admin header meta truncation */
.metaEllipsis{display:inline-block;max-width:60vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}

/* Small label chips */
.pillRow{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.pill{display:inline-block;max-width:100%;padding:3px 8px;border-radius:999px;border:1px solid var(--pill-border);background:var(--pill-bg);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}


 /* Per-device changelog: ROM category image */
 .romCatImg{display:block;width:160px;max-width:100%;height:96px;object-fit:contain;border-radius:10px;margin-top:10px;background:var(--btn-bg);padding:6px;}/* Per-device changelog attachment cards */
.attCard { display: flex; flex-direction: column; gap: 16px; padding: 24px !important; transition: transform 0.2s; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.attCard:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.attCardHeader { display: flex; align-items: center; gap: 16px; }
.attCardLogo { width: 56px !important; height: 56px !important; object-fit: contain; border-radius: 12px; background: var(--btn-bg); padding: 6px; margin: 0 !important; border: 1px solid var(--line); flex-shrink: 0; }
.attCardTitleWrap { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.attCard .h2 { font-size: 18px !important; margin: 0 !important; color: var(--text); font-weight: 700; line-height: 1.2; }
.attMetaRow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start !important; margin: 0 !important; }
.attMetaChip { padding: 4px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); font-size: 13px !important; color: var(--text); font-weight: 600; }
.attGrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 24px; margin-top: 16px; width: 100%; }
body[data-page="changelog"] .attCard { padding: 32px !important; border-left: 4px solid var(--accent) !important; border-radius: 16px; background: var(--card); box-shadow: 0 4px 12px rgba(0,0,0,0.1); height: 100%; display: flex; flex-direction: column; gap: 16px; }
body[data-page="changelog"] .attCard .h2 { font-size: 20px !important; font-weight: 800; }
.attCardNotesWrap { background: rgba(0, 0, 0, 0.12); padding: 20px; border-radius: 12px; border: 1px solid var(--line); margin-top: 12px; flex-grow: 1; }
:root.light-theme .attCardNotesWrap { background: rgba(0, 0, 0, 0.03); }
.attCardNotesWrap .noteList { margin-left: 20px; }
.attCardNotesWrap .noteList li { font-size: 14px; line-height: 1.7; margin-bottom: 8px; }

/* Per-device changelog controls */
.changelogDeviceControls{margin-top:12px;padding:12px;border:1px solid var(--line);border-radius:14px;background:rgba(20,27,43,.55);display:flex;flex-direction:column;gap:10px}
.changelogSearch{min-width:220px;flex:1}
.changelogFilterRow{gap:8px}
.changelogFilterExtras{justify-content:space-between;flex-wrap:wrap;gap:10px}
.changelogShareRow{margin-left:auto}
.changelogDeviceList{margin-top:12px}
.changelogSearchRow{align-items:center}
.changelogToggles{align-items:center}
.changelogResultsMeta{margin-left:auto}
.changelogSideTitle{margin-bottom:10px}
.changelogSubList{margin-left:12px;margin-top:4px;display:flex;flex-direction:column;gap:4px}
body[data-page="changelog"] .navCount{font-size:11px;color:var(--muted);margin-left:auto;white-space:nowrap}
.changelogProjectChips{gap:8px;margin-top:10px}
body[data-page="changelog"] .changelogProjectChips .chipBtn{
  width:auto;
  display:inline-flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
  max-width:220px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.changelogProjectChips .chipLabel{
  overflow:hidden;
  text-overflow:ellipsis;
}
.changelogProjectChips .chipBadge{
  display:inline-flex;
  align-items:center;
  padding:2px 6px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(10,14,22,.45);
  font-size:10px;
  color:var(--muted);
  flex:0 0 auto;
}
.changelogAttachments{margin-top:8px}
body[data-page="changelog"] .changelogRecent{
  margin-top:12px;
}
body[data-page="changelog"] .changelogRecentList{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:8px;
}
body[data-page="changelog"] .changelogRecentRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.02);
}
body[data-page="changelog"] .changelogRecentClickable{
  cursor:pointer;
  transition:transform .12s ease, border-color .12s ease, background .12s ease;
}
body[data-page="changelog"] .changelogRecentClickable:hover{
  transform:translateY(-1px);
  border-color:rgba(124,92,255,.35);
  background:rgba(124,92,255,.08);
}
body[data-page="changelog"] .changelogRecentClickable:focus-visible{
  outline:2px solid rgba(124,92,255,.65);
  outline-offset:2px;
}
body[data-page="changelog"] .changelogRecentMain{
  min-width:0;
  flex:1;
}
body[data-page="changelog"] .changelogRecentTitle{
  font-weight:650;
  color:var(--text);
  white-space:normal;
  overflow-wrap:anywhere;
}
body[data-page="changelog"] .changelogRecentActions{
  flex:0 0 auto;
}
body[data-page="changelog"] [data-cat-section]{scroll-margin-top:110px}
body[data-page="changelog"] mark{
  background:rgba(124,92,255,.35);
  color:var(--text);
  padding:0 2px;
  border-radius:4px;
}

/* Per-device changelog hero */
.changelogHero{display:flex;gap:16px;align-items:flex-start;flex-wrap:wrap}
.changelogHeroMedia{width:140px;height:140px;object-fit:cover;border-radius:16px;border:1px solid var(--line);background:rgba(255,255,255,.04);flex:0 0 auto}
.changelogHeroInfo{flex:1;min-width:240px;display:flex;flex-direction:column;gap:6px}
.changelogHeroTitle .h1{margin:0}
.changelogHeroTitle .h2{margin:0;font-size:18px}
.changelogHeroMeta{margin-top:4px}
.changelogHeroActions{display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.changelogHeroIntro{margin-top:8px}
.maintainerNoteCard {
  margin-top: 12px;
  padding: 12px 16px;
  background: rgba(124, 92, 255, 0.08);
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
}
.maintainerNoteCard .noteHeader {
  font-weight: 800;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.maintainerNoteCard .noteBody {
  font-size: 14px;
  line-height: 1.5;
}
:root.light-theme .maintainerNoteCard {
  background: rgba(91, 61, 232, 0.05);
}
@media (max-width:720px){
  .changelogHeroMedia{width:100%;height:auto;max-height:240px}
}

/* Per-device changelog sections */
.changelogCategory{border:1px solid var(--line);border-radius:14px;padding:12px;margin-top:24px;background:rgba(255,255,255,.02)}
.changelogCategory > summary{list-style:none;cursor:pointer}
.changelogCategory > summary::-webkit-details-marker{display:none}
.changelogCategorySummary{display:flex;align-items:center;justify-content:space-between;gap:12px}
.changelogCategoryTitle{font-weight:700;font-size:16px}
.changelogCategoryCounts{display:flex;flex-wrap:wrap;gap:6px}
.changelogCategoryCounts .pill{font-size:11px;padding:2px 8px}
.changelogCategoryBody{margin-top:10px}
.changelogCategoryMeta{margin-top:6px}
.changelogCategoryActions{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.changelogCategoryEmpty{margin-top:10px}
.changelogProjectGroup{margin-top:8px}
.changelogProjectTitle{margin-top:8px;font-weight:600}
body[data-page="changelog"] .romCatImg{margin-left:auto;margin-right:auto}

#changelogBackTop{
  position:fixed;
  right:16px;
  bottom:18px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(10,14,22,.8);
  color:var(--text);
  cursor:pointer;
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease,transform .2s ease;
  z-index:140;
}
#changelogBackTop.visible{opacity:1;pointer-events:auto;transform:translateY(-2px)}
body[data-page="changelog"] .navLeaf:focus-visible,
body[data-page="changelog"] .chipBtn:focus-visible,
body[data-page="changelog"] .btn:focus-visible{
  outline:2px solid rgba(124,92,255,.7);
  outline-offset:2px;
}

/* Device images (.img) grouping */
.imgGroup{margin-top:10px}
.imgGroupHeader{display:flex;align-items:flex-start;gap:10px;justify-content:space-between}
.imgGroupTitleWrap{display:flex;align-items:center;gap:10px;min-width:0}
.imgGroupTitleWrap b{white-space:normal;overflow-wrap:anywhere;word-break:break-word;line-height:1.15}
.imgGroupTitleWrap > div{min-width:0}
.imgGroupTitleWrap .muted.small{margin-top:2px;white-space:normal;overflow-wrap:anywhere}
.imgGroupIcon{width:36px;height:36px;object-fit:contain;border-radius:10px;border:1px solid var(--line);background:rgba(255,255,255,.06);flex:0 0 auto}
.imgProjectHeader{display:flex;align-items:center;gap:10px;min-width:0}
.imgProjectHeader img{width:42px;height:42px;object-fit:contain;border-radius:10px;border:1px solid var(--line);background:rgba(255,255,255,.06)}
.imgProjectHeader > div{min-width:0}
.imgProjectHeader .muted.small{white-space:normal;overflow-wrap:anywhere;word-break:break-word}
.imgTileMedia{width:100%;height:140px;object-fit:cover;border-radius:10px;border:1px solid var(--line);margin-bottom:8px;background:rgba(255,255,255,.04)}
.imgTileMediaLogo{object-fit:fill;background:rgba(255,255,255,.06);height:220px;padding:0}
.imgTileHead{display:flex;align-items:flex-start;gap:8px;min-width:0}
.imgTileHead h3{margin:0;min-width:0;line-height:1.3;overflow-wrap:anywhere;word-break:break-word}
.imgTileHeadLogo{width:26px;height:26px;object-fit:contain;border-radius:8px;border:1px solid var(--line);background:rgba(255,255,255,.06);flex:0 0 auto}
.tileRecovery{grid-column:1 / -1;display:flex;flex-direction:column;align-items:center;text-align:center;padding:14px 16px}
.tileRecovery .imgTileMedia{display:block;width:100%;max-width:100%;margin-left:auto;margin-right:auto;align-self:center}
.tileRecovery .imgTileHead{width:100%;justify-content:center}
.tileRecovery .imgTileHead h3{text-align:center}
.tileRecoverySub{margin-top:4px;text-align:center}
.tileRecovery .pillRow{justify-content:center}
.tileRecovery .kv.compact{justify-content:center}
.tileRecovery .row{justify-content:center}
.tileRecovery .noteWrap{max-width:100%;margin:10px 0 0}
.tileRecovery .tn-details{max-width:100%;margin:10px 0 0;text-align:center}
.tileRecovery .tn-details .tn{max-width:100%;margin:8px 0 0;text-align:left}
#device .tileRecovery .noteRich{
  max-width:100%;
  margin:10px 0 0;
  text-align:left;
}
#device .tileRecovery .noteRich p[align="center"],
#device .tileRecovery .noteRich div[align="center"]{
  text-align:center;
}
#downloadsSummary,#buildsSummary{
  display:inline-flex;align-items:center;gap:8px;
  padding:4px 10px;border-radius:999px;border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.04);
}

/* Admin quick actions */
.quickSteps{display:grid;gap:10px}
.quickStep{border:1px solid var(--line);border-radius:12px;padding:10px;background:rgba(255,255,255,.02)}


/* Admin: Device images (.img) add-rows layout */
.imgAddBody{display:flex;flex-direction:column;gap:8px}
.imgAddRowGrid{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:end;border:1px solid var(--line);border-radius:12px;padding:10px;background:rgba(255,255,255,.02)}
.imgAddRowGrid input,.imgAddRowGrid select{width:100%}
.imgAddRowGrid .imgAddActions{grid-column:1/-1;display:flex;justify-content:flex-end}
@media(min-width:900px){
  .imgAddRowGrid{grid-template-columns:1.1fr 1.1fr 180px 1fr 1fr 1fr 1fr auto}
  .imgAddRowGrid .imgAddActions{grid-column:auto}
}

/* Device bundles */
.bundleBox{border:1px solid var(--line);border-radius:12px;padding:12px;margin-top:10px;background:rgba(255,255,255,.02)}
.bundleRow{display:grid;grid-template-columns:1fr auto;gap:14px;padding:10px 0;border-top:1px solid rgba(255,255,255,.08)}
.bundleRow:first-child{border-top:0;padding-top:0}
.bundleTitle{font-weight:700;color:var(--text)}
.bundleMeta{font-size:13px;color:var(--muted)}
.bundleLeadLogo{width:42px;height:42px;object-fit:contain;border-radius:10px;border:1px solid var(--line);background:rgba(255,255,255,.06)}
.bundleSide{display:flex;flex-direction:column;gap:4px;align-items:flex-end;min-width:180px}
.bundleSide .row{justify-content:flex-end}
.kv.compact{display:flex;gap:4px;align-items:center;justify-content:flex-start}
.kv.compact span{white-space:nowrap}
.kv.compact span::after{content:':';margin-left:1px}
.kv.compact b{font-weight:650}

/* Bundle: provider badges + per-file rows */
.bundleProviders{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.bundleProv{display:flex;align-items:center;gap:6px;padding:4px 8px;border-radius:999px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.04);font-size:12px;color:var(--muted)}
.bundleProv img{width:18px;height:18px;object-fit:contain;border-radius:6px;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.06)}
.bundleProvFallback{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:6px;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.06);font-size:11px;color:var(--text)}

.bundleItems{margin-top:10px;border-top:1px solid rgba(255,255,255,.08);padding-top:10px}
.bundleItemGroup{margin-top:10px}
.bundleGroupTitle{font-weight:650;color:var(--text);margin:6px 0}
.bundleItemRow{display:flex;justify-content:space-between;gap:14px;padding:10px 0;border-top:1px solid rgba(255,255,255,.08)}
.bundleItemRow:first-child{border-top:0}
.bundleItemLeft{display:flex;gap:10px;align-items:flex-start;flex:1;min-width:240px}
.bundleItemLogo{width:42px;height:42px;object-fit:contain;border-radius:10px;border:1px solid var(--line);background:rgba(255,255,255,.06);flex:0 0 auto}
.bundleItemLogoFallback{display:flex;align-items:center;justify-content:center;font-weight:700}
.bundleItemTitle{font-weight:650;color:var(--text)}
.bundleItemMeta{font-size:13px;color:var(--muted)}
.bundleItemActions{display:flex;flex-direction:column;gap:6px;align-items:flex-end;min-width:200px}
.bundleItemActions .row{justify-content:flex-end}
@media(max-width:720px){
  .bundleRow{grid-template-columns:1fr}
  .bundleSide{align-items:flex-start;min-width:0}
  .bundleItemRow{flex-direction:column}
  .bundleItemActions{align-items:flex-start;min-width:0}
}

/* Admin: Donation attachments (existing files) quick-add layout */
.attERowGrid{display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:end;border:1px solid var(--line);border-radius:12px;padding:10px;background:rgba(255,255,255,.02)}
.attERowGrid input{width:100%}
.attERowGrid .attEActions{grid-column:1/-1;display:flex;justify-content:flex-end}
@media(min-width:900px){
  .attERowGrid{grid-template-columns:1fr 1fr 160px auto}
  .attERowGrid .attEActions{grid-column:auto}
}

@media (max-width: 420px){
  .wrap{padding:0 12px}
  .btn{padding:10px 10px}
  .langSelect{max-width:100%}
}
@media (max-width: 860px){
  body[data-page="changelog"] .changelogSidebar{
    position:sticky !important;
    top:64px !important;
    background:rgba(11,13,18,.92);
    border:1px solid rgba(255,255,255,.12);
    border-radius:12px;
    padding:10px;
    max-height:52vh;
    overflow:auto;
    z-index:60;
  }
}
@media (max-width: 720px){
  .tileHead{flex-direction:column;align-items:flex-start}
  .tileMeta{white-space:normal}
}
@media (max-width: 360px){
  .hero h1{font-size:24px}
  .btn{padding:10px 8px}
  .input,.select{min-width:0;width:100%}
  .grid{gap:10px}
}
@media (max-width: 320px){
  .topbar-inner{gap:8px}
  .btn{font-size:13px}
  .nav{margin:0 10px}
}
@media (max-width: 280px){
  .wrap{padding:0 8px}
  .btn{padding:8px 6px}
  .nav{margin:0 8px}
}

/* Manuals */
.manual-shell{display:grid;grid-template-columns:320px 1fr;gap:14px;align-items:start}
@media(max-width:900px){.manual-shell{grid-template-columns:1fr}}
.manual-viewer{border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.02);border-radius:14px;padding:12px;min-height:220px}
.manual-body{white-space:pre-wrap;word-break:break-word}
.manual-item{width:100%;text-align:left;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.02);border-radius:12px;padding:10px;margin:6px 0;cursor:pointer}
.manual-item:hover{border-color:rgba(104,150,255,.45);background:rgba(104,150,255,.10)}
.manual-item:focus-visible{outline:2px solid rgba(104,150,255,.65);outline-offset:2px}
.manual-item__title{color:var(--text);font-weight:700}
.manual-item__meta{font-size:13px;color:var(--muted)}
.manual-item__excerpt{font-size:13px;color:var(--muted);margin-top:4px}
.manuals-nav .chip{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.18);font-weight:600;color:var(--text)}
.manuals-nav .chip.active{background:linear-gradient(135deg,rgba(124,92,255,.5),rgba(0,212,255,.45));color:#0a0d14;border:0}
.manuals-nav .chip:focus-visible{outline:2px solid rgba(124,92,255,.8);outline-offset:2px}


/* Tech note (device notes / instructions) */
.tn{font-size:13px;line-height:1.55}
.tn-h{margin:10px 0 6px 0}
.tn-p{margin:6px 0}
.tn-pre{margin:8px 0;padding:10px;border:1px solid rgba(255,255,255,.08);border-radius:10px;overflow:auto;background:rgba(0,0,0,.18)}
.tn-code{padding:1px 6px;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:rgba(0,0,0,.12);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}
.tn-ul,.tn-ol{margin:6px 0 6px 18px}
.tn-details{margin-top:6px}
.tn-details>summary{cursor:pointer}
.noteWrap{margin-top:0}
.tn img{max-width:100%;height:auto;border-radius:12px;box-shadow:0 6px 16px rgba(0,0,0,.25);cursor:zoom-in}
.noteRich img{max-width:100%;height:auto;border-radius:12px;box-shadow:0 6px 16px rgba(0,0,0,.25);cursor:zoom-in}

/* Changelog note card (simple notes) */
.noteCard{
  margin-top:10px;
  padding:12px 14px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:14px;
  background:
    linear-gradient(155deg, rgba(124,92,255,.14), rgba(0,212,255,.08) 40%, rgba(255,255,255,.03) 70%),
    rgba(255,255,255,.02);
  box-shadow:0 10px 22px rgba(0,0,0,.22);
  position:relative;
}
.noteCard:before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:4px;
  border-radius:14px 0 0 14px;
  background:linear-gradient(180deg,var(--accent),var(--accent2));
  opacity:.75;
}
.noteCard--compact{padding:9px 11px}
.noteCardHeader{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding-left:6px;
}
.noteCardTitle{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.35px;
  color:var(--text);
}
.noteCardTitle:before{
  content:"";
  width:7px;
  height:7px;
  border-radius:999px;
  background:linear-gradient(135deg,var(--accent),var(--accent2));
  box-shadow:0 0 0 3px rgba(255,255,255,.05);
}
.noteCardMeta{display:flex;flex-wrap:wrap;gap:6px}
.noteCardChip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:2px 8px;
  border-radius:999px;
  font-size:11px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(10,14,22,.35);
  color:var(--muted);
}
.noteCardBody{margin-top:8px;padding-left:6px;font-size:13px;line-height:1.6}
.noteCardBody .rt-content p:first-child{margin-top:0}
.noteCardBody--plain{white-space:normal}
.noteCardBody--plain p{margin:6px 0}
.noteCardBody--plain p:first-child{margin-top:0}
.noteList{margin:6px 0 6px 18px;padding:0;color:var(--text)}
.noteList li{margin:4px 0}

/* Changelog page: tighter, more professional notes/attachments */
body[data-page="changelog"] .noteCard{
  background:rgba(255,255,255,.03);
  border-color:rgba(255,255,255,.18);
  box-shadow:0 8px 18px rgba(0,0,0,.18);
}
body[data-page="changelog"] .noteCard:before{
  opacity:.45;
}
body[data-page="changelog"] .noteCardHeader{
  padding-left:2px;
  gap:4px;
}
body[data-page="changelog"] .noteCardTitle{
  font-size:11px;
  letter-spacing:.5px;
}
body[data-page="changelog"] .noteCardBody{
  margin-top:10px;
  padding-left:2px;
  border-top:1px solid rgba(255,255,255,.08);
  padding-top:8px;
}
body[data-page="changelog"] .noteList{
  margin:6px 0 2px 18px;
}
body[data-page="changelog"] .noteList li{
  margin:6px 0;
  line-height:1.55;
}
body[data-page="changelog"] .noteList li::marker{
  color:rgba(124,92,255,.85);
}

/* Note image lightbox (device page) */
.noteLightbox{position:fixed;inset:0;background:rgba(0,0,0,.75);display:none;z-index:140;overflow:auto;padding:72px 16px 24px}
.noteLightbox.open{display:block}
.noteLightboxStage{min-height:calc(100vh - 96px);display:flex;align-items:flex-start;justify-content:center}
.noteLightboxStage.noteLightboxStage--fit{align-items:center}
.noteLightbox img{max-width:none;max-height:none;border-radius:14px;box-shadow:0 18px 40px rgba(0,0,0,.45);background:var(--bg);display:block;margin:0 auto}
.noteLightbox-close{position:absolute;top:16px;right:16px;border:1px solid rgba(255,255,255,.25);background:rgba(10,14,22,.75);color:var(--text);border-radius:10px;padding:6px 10px;cursor:pointer}
.noteLightboxControls{position:absolute;left:16px;top:16px;display:flex;gap:8px;align-items:center;background:rgba(10,14,22,.75);border:1px solid rgba(255,255,255,.16);border-radius:12px;padding:6px 8px}
.noteLightboxControls button{border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.06);color:var(--text);border-radius:8px;padding:4px 8px;cursor:pointer}
.noteLightboxControls input[type=range]{width:140px}

/* Rich text content tweaks (install/faq/changelog) */
.rt-content h1,.rt-content h2,.rt-content h3,.rt-content h4{margin:14px 0 8px 0}
.rt-content p{margin:8px 0}
.rt-content pre{margin:10px 0;padding:12px;border:1px solid rgba(255,255,255,.08);border-radius:12px;overflow:auto;background:rgba(0,0,0,.18)}
.rt-content code{padding:1px 6px;border-radius:8px;border:1px solid rgba(255,255,255,.08);background:rgba(0,0,0,.12);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}
.rt-content ul,.rt-content ol{margin:8px 0 8px 20px}

/* Collapsible long pages */
.rt-content.rt-collapsed{max-height:520px;overflow:hidden;position:relative}
.rt-content.rt-collapsed:after{content:"";position:absolute;left:0;right:0;bottom:0;height:90px;background:linear-gradient(to bottom, rgba(20,27,43,0), rgba(20,27,43,1));pointer-events:none}

/* Programs page */
.programsHero{
  background:linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.8)), url('https://images.unsplash.com/photo-1521737604893-d14cc237f11d?ixlib=rb-4.0.3&auto=format&fit=crop&w=1600&q=80') center/cover no-repeat;
  color:#fff;
  border-radius:12px;
  margin-top:1rem;
  padding:3rem 2rem;
}
.programsHero .muted{color:#ddd}
.programsHeroGrid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,0.8fr);gap:16px;align-items:start}
.programsHeroPanel{border:1px solid var(--line);border-radius:16px;padding:12px;background:rgba(255,255,255,.05);backdrop-filter:blur(4px)}
.programsSteps{padding-left:18px;margin:8px 0}
.programsLayout{display:grid;grid-template-columns:minmax(0,320px) minmax(0,1fr);gap:14px;align-items:start;margin:16px 0}
.programsSide{position:sticky;top:74px;max-height:calc(100vh - 92px);overflow:auto}
.programsMain{min-width:0;display:flex;flex-direction:column;gap:14px}
.programCards{--grid-min:240px;--grid-max:340px}
.programCard{padding:0;overflow:hidden;display:flex;flex-direction:column;gap:0;border:1px solid rgba(255,255,255,.12);background:linear-gradient(160deg, rgba(255,255,255,.05), rgba(255,255,255,.02))}
.programCard.active{border-color:rgba(124,92,255,.7);box-shadow:0 10px 30px rgba(0,0,0,.25)}
.programCardHero{aspect-ratio:16/9;background:rgba(255,255,255,.04);overflow:hidden}
.programCardHero img{width:100%;height:100%;object-fit:cover;display:block}
.programCardHero--placeholder{background:linear-gradient(135deg, rgba(124,92,255,.18), rgba(0,212,255,.12))}
.programCardBody{padding:12px;display:flex;flex-direction:column;gap:8px}
.programCardTitle{font-weight:800;font-size:17px}
a.programCardTitle{color:inherit;text-decoration:none;display:block;min-width:0;max-width:100%;overflow-wrap:anywhere;word-break:break-word}
a.programCardTitle:hover,a.programCardTitle:focus{text-decoration:underline;text-underline-offset:3px}
.programCardMeta{display:flex;flex-wrap:wrap;gap:6px}
.programCardActions{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}
.programDetailHead{display:flex;gap:12px;align-items:flex-end;justify-content:space-between;flex-wrap:wrap}
.programDetailActions{display:flex;gap:8px;flex-wrap:wrap}
.programHeroMedia img,.programHeroMedia iframe{width:100%;border-radius:16px;display:block}
.programNote{border-left:3px solid rgba(124,92,255,.65);padding:10px 12px;border-radius:12px;background:rgba(124,92,255,.08)}
.programProofGrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px}
.programProofGrid img{width:100%;height:100%;object-fit:cover;border-radius:12px;border:1px solid var(--line)}
.programProofGrid .proofFile{
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:flex-start;
  justify-content:flex-start;
  padding:10px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  text-decoration:none;
  color:inherit;
  min-height:120px;
}
.programProofGrid .proofIcon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:42px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(124,92,255,.45);
  background:rgba(124,92,255,.12);
  font-size:12px;
  font-weight:700;
}
.programProofGrid .proofName{
  font-size:13px;
  line-height:1.3;
  word-break:break-word;
}
.programProofGrid .proofVideo video{
  width:100%;
  max-height:220px;
  border-radius:10px;
  border:1px solid var(--line);
  background:#000;
}
.programProofGrid .proofVideo a{font-size:12px}
@media (max-width: 900px){
  .programsHeroGrid{grid-template-columns:1fr}
}
@media (max-width: 920px){
  .programsLayout{grid-template-columns:1fr}
  .programsSide{position:static;max-height:none;overflow:visible}
}

/* Keep rich-editor note rendering close to admin preview on device page */
#device .noteRich{font-size:14px;line-height:1.6}
#device .noteRich p{margin:10px 0}
#device .noteRich h1,#device .noteRich h2,#device .noteRich h3,#device .noteRich h4{margin:12px 0 8px}
#device .noteRich img.rt-img,
#device .noteRich img{
  display:block;
  width:auto!important;
  max-width:100%!important;
  height:auto!important;
}
#device .noteRich iframe,
#device .noteRich .noteEmbed{
  display:block;
  width:100%!important;
  max-width:100%;
  min-height:clamp(220px,42vw,420px)!important;
}

/* Version chooser cards when opening project-level "All versions" */
.versionJumpCard .imgTileMediaLogo{width:28px;height:28px;border-radius:8px;object-fit:contain}

/* Desktop: keep at least 2 cards per row for device downloads/build panels */
@media (min-width: 1100px){
  #device .devicePanel .grid,
  #device .imgGroup .grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}


/* Public note media: normalize rich-editor output for all device-page notes. */
#device .noteRich .noteImageRow{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,140px),1fr));
  gap:10px;
  justify-items:center;
  align-items:start;
}
#device .noteRich .noteImageRow img.rt-img,
#device .noteRich .noteImageRow img{
  margin:0 !important;
  width:min(100%,220px)!important;
  max-width:100%!important;
  object-fit:contain;
}
#device .noteRich .noteEmbedRow{
  margin:12px 0 0;
}
@media (max-width:720px){
  #device .noteRich .noteImageRow{
    grid-template-columns:repeat(auto-fit,minmax(min(100%,120px),1fr));
  }
  #device .noteRich iframe,
  #device .noteRich .noteEmbed{
    min-height:240px!important;
  }
}

/* Public alerts and error boxes */
.flash{
  padding:10px 12px;
  border-radius:12px;
  background:rgba(124,92,255,.12);
  border:1px solid rgba(124,92,255,.35);
  margin:12px 0;
}
.flash.flash--error{
  background:rgba(255,90,90,.12);
  border-color:rgba(255,90,90,.35);
}
.error{
  padding:10px 12px;
  border-radius:12px;
  background:rgba(255,90,90,.12);
  border:1px solid rgba(255,90,90,.35);
  color:#ffd6d6;
}

/* Plain (no-JS) public pages */
.plainWrap{max-width:1100px;margin:0 auto;padding:0 var(--space-wrap-x)}
.plainWrap--narrow{max-width:900px}
.plainWrap--compact{max-width:760px}
.plainWrap--spacious{padding-bottom:40px}
.plainTop{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:14px 0}
.plainTop a{color:inherit;text-decoration:none}
.plainGrid{display:grid;grid-template-columns:300px 1fr;gap:14px;align-items:start}
@media(max-width:900px){.plainGrid{grid-template-columns:1fr}}
.plainSectionTitle{margin:0 0 10px 0}
.plainCategoryRow{display:flex;gap:10px;flex-wrap:wrap}
.plainFilterForm{margin-top:12px}
.plainFilterActions{margin-top:10px}
.plainTierGrid{grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}
.plainDonateActions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:8px}
.plainPerksList{margin:0;padding-left:18px}
body.donatePlain .plainCampaignTitle{margin:12px 0 4px 0}
.campaignCard h3{margin:0 0 6px 0}
.campaignCard .meta{font-size:.92em;opacity:.85}
.maintenanceWrap{
  max-width:760px;
  margin:40px auto;
  padding:20px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.04);
}

/* Invoice */
.inv-wrap{max-width:860px;margin:24px auto;padding:20px}
.inv-actions{justify-content:flex-end;gap:8px;margin-bottom:10px}
.inv-head{display:flex;justify-content:space-between;gap:20px;align-items:flex-start}
.inv-meta{font-size:14px;color:var(--muted)}
.inv-title{font-size:28px;font-weight:800}
.inv-box{border:1px solid var(--line);border-radius:14px;padding:14px}
.inv-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}
.inv-table{width:100%;border-collapse:collapse;margin-top:10px}
.inv-table th,.inv-table td{border-bottom:1px solid var(--line);padding:10px;text-align:left}
.inv-table th:last-child,.inv-table td:last-child{text-align:right}
.inv-total{margin-top:14px;text-align:right;font-size:18px;font-weight:700}
@media(max-width:720px){
  .inv-head{flex-direction:column}
  .inv-grid{grid-template-columns:1fr}
}
@media print{
  body.invoicePage .topbar,
  body.invoicePage .footer,
  body.invoicePage .inv-actions{display:none !important}
  body.invoicePage .inv-wrap{margin:0;max-width:none}
}

/* Public changelog page */
body[data-page="changelog"] .release{border:1px solid rgba(255,255,255,.08);border-radius:12px;padding:14px;margin-bottom:12px}
body[data-page="changelog"] .release h2{margin:0 0 10px 0}
body[data-page="changelog"] .releaseBody.collapsed{max-height:220px;overflow:hidden;position:relative}
body[data-page="changelog"] .releaseBody.collapsed:after{content:"";position:absolute;left:0;right:0;bottom:0;height:70px;background:linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.85));pointer-events:none}
body[data-page="changelog"] .releaseBody.expanded{max-height:none !important;overflow:visible !important}
body[data-page="changelog"] .showMoreBtn{margin-top:10px}
body[data-page="changelog"] .img-left{float:left;margin:0 16px 10px 0;max-width:45%}
body[data-page="changelog"] .img-right{float:right;margin:0 0 10px 16px;max-width:45%}
body[data-page="changelog"] .indent-10cm{margin-left:10cm}
body[data-page="changelog"] .clearfix:after{content:"";display:block;clear:both}
body[data-page="changelog"] .changelogLayout{display:flex;gap:16px;align-items:flex-start}
body[data-page="changelog"] .changelogSidebar{width:260px;flex:0 0 260px;position:sticky;top:12px;max-height:calc(100vh - 120px);overflow:auto;padding-right:6px}
body[data-page="changelog"] .changelogMain{flex:1 1 auto;min-width:0}
@media (max-width: 860px){
  body[data-page="changelog"] .changelogLayout{display:block}
  body[data-page="changelog"] .changelogSidebar{position:static;width:auto;max-height:none;margin-bottom:12px}
}
body[data-page="changelog"] .navTree details{border-left:2px solid rgba(255,255,255,.08);padding-left:10px;margin:6px 0}
body[data-page="changelog"] .navTree summary{cursor:pointer;user-select:none}
body[data-page="changelog"] .navTree a{display:block;padding:6px 8px;border-radius:10px;text-decoration:none}
body[data-page="changelog"] .navTree a.active{background:rgba(255,255,255,.08)}
body[data-page="changelog"] .navTree .muted{opacity:.8}
body[data-page="changelog"] .releaseHeader{display:flex;justify-content:space-between;gap:10px;align-items:baseline}
body[data-page="changelog"] .releaseMeta{font-size:12px;opacity:.75}
body[data-page="changelog"] .changelogViewSelect{min-width:160px}

/* Professional Changelog Refinements */
.pro-meta { font-size: 14px; color: var(--muted); font-weight: 500; }
.changelogHero { padding: 32px; background: var(--card); border-radius: 20px; box-shadow: 0 8px 32px rgba(0,0,0,0.2); border: 1px solid var(--line); }
.changelogHeroMedia { border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line); }
.navLeaf.active { background: var(--accent-dim); color: var(--accent); border-left: 3px solid var(--accent); padding-left: 13px; }
.changelogRecentRow { padding: 16px; border-radius: 12px; transition: background 0.2s; }
.changelogRecentRow:hover { background: var(--tile-bg); }

/* Admin public changelog editor */
body.adminPublicChangelog .apWrap{max-width:1200px;margin:18px auto;padding:0 14px}
body.adminPublicChangelog .apCard{background:rgba(0,0,0,.28);border:1px solid rgba(255,255,255,.08);border-radius:18px;padding:16px}
body.adminPublicChangelog .apRow{display:flex;gap:12px;flex-wrap:wrap;align-items:center;justify-content:space-between}
body.adminPublicChangelog .apInput{min-width:320px}
body.adminPublicChangelog .apNotice{padding:10px 12px;border-radius:12px;margin-top:12px}
body.adminPublicChangelog .apNotice--ok{background:rgba(0,255,0,.08);border:1px solid rgba(0,255,0,.12)}
body.adminPublicChangelog .apNotice--warn{background:rgba(255,180,0,.08);border:1px solid rgba(255,180,0,.12)}
body.adminPublicChangelog .apActions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
body.adminPublicChangelog .apForm{margin-top:14px}
body.adminPublicChangelog .apToolbar{margin-top:12px}
body.adminPublicChangelog .apHelp{margin-top:10px}
body.adminPublicChangelog .apFilePick{display:none}
body.adminPublicChangelog .apFatal{
  max-width:980px;
  margin:24px auto;
  padding:18px;
  border-radius:12px;
  background:rgba(255,0,0,.06);
  font-family:var(--font-family-ui);
}

/* Recover page */
body.recoverPage .hero h1{margin-bottom:8px}
body.recoverPage .hero p{max-width:70ch}
body.recoverPage .recoverForm{gap:12px}
body.recoverPage .recoverHelp{margin-top:6px}
body.recoverPage .recoverNote{margin-top:6px}

/* My donation page */
body.myDonationPage .donationMain{padding:16px 0 28px}
body.myDonationPage .donationHeader{gap:12px}
body.myDonationPage .donationMeta{margin-top:6px}
body.myDonationPage .donationMetaLine{margin-top:4px}
body.myDonationPage .donationTokenInfo{margin-top:8px}
body.myDonationPage .donationFlash{margin-top:12px}
body.myDonationPage .donationSection{margin-top:12px}
body.myDonationPage .donationActions{margin-top:14px}
body.myDonationPage .donationFixCard{margin-top:14px}
body.myDonationPage .donationFixActions{margin-top:10px}
body.myDonationPage .donationFooterNote{margin-top:14px}
body.myDonationPage .donationCodeValue{font-size:1.2em}
body.myDonationPage .donationAttachmentRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:1px solid rgba(0,0,0,.10);
  background:rgba(0,0,0,.02);
  padding:10px;
  border-radius:14px;
  flex-wrap:wrap;
}
body.myDonationPage .donationAttachmentsCard{margin-top:14px}
body.myDonationPage .donationAttachmentsList{display:flex;flex-direction:column;gap:10px}
body.myDonationPage .donationRawDetails{margin-top:14px;padding:12px}
body.myDonationPage .donationRawDetails summary{cursor:pointer}
body.myDonationPage .donationRawDetails pre{margin-top:10px;max-height:420px;overflow:auto}

/* Announcement Banner */
.announcementBanner {
  background: var(--accent, var(--accent));
  color: #fff;
  text-align: center;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
}
.announcementBanner a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.announcementBanner a:hover {
  text-decoration: none;
}
.noteDefs {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 12px;
  font-size: 0.9em;
}
.noteDefs dt {
  font-weight: 600;
  color: var(--muted);
  text-align: right;
}
.noteDefs dd {
  margin: 0;
}

/* Responsive scaling and text wrap fixes */
@media (max-width: 600px) {
  table, .container-aligned {
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
  }
}

/* ── Checkbox / radio alignment: bare labels (no helper class) + baseline fix.
   Added site-wide so a <label><input type=checkbox> text</label> never drops the
   box below its label. Existing .checkitem/.inlineCheck/.checkrow layouts kept. */
input[type="checkbox"], input[type="radio"]{ vertical-align:middle; }
label:not(.checkitem):not(.inlineCheck):not(.checkrow):not(.btn):not(.check):has(> input[type="checkbox"]),
label:not(.checkitem):not(.inlineCheck):not(.checkrow):not(.btn):not(.check):has(> input[type="radio"]){
  display:inline-flex; align-items:center; gap:8px;
}
.checkitem > input[type="checkbox"], .checkitem > input[type="radio"]{ margin-top:0; }
