/* Circadian Pad - tablet-style launcher
 * Look and feel is driven by attributes on .device, set from Settings > Wallpaper & Theme:
 *   data-mode="light|dark"   data-accent="vine|sunrise|prolifix|allphase"   data-font="system|montserrat|lora|dmsans|poppins"
 * Colours come from the Circadian product labels: Sunrise gold #fed66a, leaf green #5a8a56,
 * ProLifix magenta/crimson #b6324c, All Phase / Long Shadow charcoal #2e2a29. */
@font-face { font-family: "CP Montserrat"; src: url(../fonts/montserrat.woff) format("woff"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "CP Lora"; src: url(../fonts/lora.woff) format("woff"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "CP DM Sans"; src: url(../fonts/dmsans.woff) format("woff"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "CP Poppins"; src: url(../fonts/poppins-400.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "CP Poppins"; src: url(../fonts/poppins-700.woff) format("woff"); font-weight: 500 900; font-display: swap; }
.device {
  --sys: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font: var(--sys);
  --label: #ffffff;
  --dock: rgba(255, 255, 255, 0.22);
  --sheet: #f5f5f3;
  --card: #ffffff;
  --soft: #e9ebe6;
  --seg-on: #ffffff;
  --ink: #1b1a19;
  --ink2: #6b6b6b;
  --ink3: #3d3d3d;
  --line: #dedfdb;
  --accent: #145100;
  --accent-ink: #ffffff;
  --wall-dim: 1;
  --ts: 1;          /* text size: set from Settings */
}
.device { --font: "CP Montserrat", var(--sys); }
.device[data-font="system"] { --font: var(--sys); }
.device[data-size="s"] { --ts: .88; }
.device[data-size="l"] { --ts: 1.15; }
.device[data-size="xl"] { --ts: 1.3; }
.device[data-font="montserrat"] { --font: "CP Montserrat", var(--sys); }
.device[data-font="lora"] { --font: "CP Lora", Georgia, "Times New Roman", serif; }
.device[data-font="dmsans"] { --font: "CP DM Sans", var(--sys); }
.device[data-font="poppins"] { --font: "CP Poppins", var(--sys); }
.device[data-mode="dark"] {
  /* Circadian night: the site's forest green taken down to near-black */
  --dock: rgba(8, 22, 6, 0.42);
  --sheet: #0c160a;
  --card: #15240f;
  --soft: #203319;
  --seg-on: #2d4724;
  --ink: #eef3e8;
  --ink2: #a3b29b;
  --ink3: #d5dfcc;
  --line: #263a20;
  --wall-dim: .72;
}
.device[data-accent="circadian"] { --accent: #145100; }
.device[data-accent="vine"] { --accent: #3f7a3b; }
.device[data-accent="sunrise"] { --accent: #b8860b; }
.device[data-accent="prolifix"] { --accent: #b0237f; }
.device[data-accent="allphase"] { --accent: #2e2a29; }
.device[data-mode="dark"][data-accent="circadian"] { --accent: #6fb04f; --accent-ink: #0b2200; }
.device[data-mode="dark"][data-accent="vine"] { --accent: #7fbf6f; --accent-ink: #10200e; }
.device[data-mode="dark"][data-accent="sunrise"] { --accent: #fed66a; --accent-ink: #2e2a29; }
.device[data-mode="dark"][data-accent="prolifix"] { --accent: #e868bf; --accent-ink: #2b0620; }
.device[data-mode="dark"][data-accent="allphase"] { --accent: #d9d6cf; --accent-ink: #1b1a19; }

html, body {
  margin: 0; height: 100%;
  background: radial-gradient(circle at 50% 30%, #2b2d33, #0d0e10 70%);
  overflow: hidden;
}
body { display: flex; align-items: center; justify-content: center; }
.nojs { color: #fff; font: 18px sans-serif; }

/* ---------- the tablet ----------
 * A landscape tablet with a wider frame at the sides: a camera dot on the left and a round home button on the
 * right (with a Circadian leaf on it: an original design, not any phone maker's). The screen keeps the same shape. */
.device {
  --w: min(96vw, calc(94vh * 1.53));
  width: var(--w);
  height: calc(var(--w) / 1.53);
  box-sizing: border-box;
  padding: calc(var(--w) * 0.021) calc(var(--w) * 0.056);
  border-radius: calc(var(--w) * 0.042);
  background: linear-gradient(145deg, #2a2b30, #111215);
  box-shadow: 0 0 0 2px #45464c, 0 0 0 4px #1a1b1e, 0 40px 90px rgba(0, 0, 0, 0.65);
  font-family: var(--font);
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}
.screen {
  position: relative; width: 100%; height: 100%;
  border-radius: calc(var(--w) * 0.022);
  overflow: hidden;
  container-type: size;
  background: #000;
}
.wallpaper { position: absolute; inset: 0; background: #1b1a19 url(../img/wallpaper.svg) center / cover no-repeat; transition: transform .35s, filter .35s, opacity .3s; filter: brightness(var(--wall-dim)); }
.screen.app-open .wallpaper { transform: scale(1.06); filter: blur(6px) brightness(calc(var(--wall-dim) * .7)); }

/* ---------- status bar ---------- */
.status {
  position: absolute; top: 0; left: 0; right: 0; z-index: 30;
  height: 3.4cqh; padding: 0 2.4cqw;
  display: flex; align-items: center; gap: 1.1cqw;
  color: #fff; font-size: calc(1.65cqh * var(--ts)); font-weight: 600; letter-spacing: .01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  pointer-events: none;
  transition: color .2s;
}
.screen.light-app .status { color: var(--ink); text-shadow: none; }
.screen.light-app .sb-wifi { fill: var(--ink); }
.screen.light-app .sb-batt { border-color: var(--ink2); }
.screen.light-app .sb-batt::after, .screen.light-app #sb-batt-fill { background: var(--ink); }
.sb-date { font-weight: 500; opacity: .95; }
.sb-right { margin-left: auto; display: flex; align-items: center; gap: .7cqw; }
.sb-wifi { height: 1.55cqh; fill: #fff; }
.sb-batt-text { font-size: calc(1.45cqh * var(--ts)); }
.sb-batt {
  width: 3.7cqh; height: 1.75cqh; box-sizing: border-box; padding: 2px;
  border: 1.5px solid rgba(255, 255, 255, .85); border-radius: .45cqh; position: relative;
}
.sb-batt::after { content: ''; position: absolute; right: -.55cqh; top: 32%; width: .35cqh; height: 36%; background: rgba(255, 255, 255, .85); border-radius: 0 2px 2px 0; }
#sb-batt-fill { display: block; height: 100%; width: 100%; background: #fff; border-radius: .2cqh; }

/* ---------- home screen ---------- */
.home { position: absolute; top: 5cqh; left: 0; right: 0; bottom: 15.5cqh; transition: transform .3s, opacity .3s; }
.screen.app-open .home, .screen.app-open .dock { opacity: 0; transform: scale(.94); }
.grid {
  display: grid; grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 15.5cqh; row-gap: 3cqh;
  padding: 3.5cqh 9cqw 0;
}
.app {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1cqh;
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  color: var(--label); font: inherit; -webkit-tap-highlight-color: transparent; outline: none;
}
.app .ic {
  width: 6.7cqw; height: 6.7cqw; border-radius: 23%;
  background: center / cover no-repeat;
  box-shadow: 0 .5cqh 1.4cqh rgba(0, 0, 0, .35);
  transition: transform .15s, filter .15s;
}
.app.pixel .ic { image-rendering: pixelated; }
.app:hover .ic, .app:focus-visible .ic { transform: scale(1.07); }
.app:focus-visible .ic { box-shadow: 0 0 0 .35cqh #fff, 0 .5cqh 1.4cqh rgba(0, 0, 0, .35); }
.app:active .ic { transform: scale(.9); filter: brightness(.75); }
.app .lbl {
  font-size: calc(1.5cqh * var(--ts)); font-weight: 500; text-shadow: 0 1px 3px rgba(0, 0, 0, .65);
  /* the full name, wrapping onto a second line at most ("…" after that) */
  max-width: 11.5cqw; text-align: center; line-height: 1.18; white-space: normal; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.app .ic { position: relative; }
.app .badge {
  position: absolute; top: -.7cqh; right: -.7cqh; z-index: 2;
  min-width: 2.2cqh; height: 2.2cqh; padding: 0 .5cqh; box-sizing: border-box;
  background: #ff3b30; color: #fff; border-radius: 1.1cqh; font-size: calc(1.3cqh * var(--ts)); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.dots { position: absolute; bottom: 1.2cqh; left: 0; right: 0; display: flex; justify-content: center; gap: .9cqh; }
.dots span { width: .85cqh; height: .85cqh; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.dots .on { background: #fff; }

.dock {
  position: absolute; bottom: 2.2cqh; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 1.7cqw;
  padding: 1.4cqh 1.7cqw; border-radius: 3.4cqh;
  background: var(--dock);
  -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 1cqh 3cqh rgba(0, 0, 0, .25);
  transition: transform .3s, opacity .3s;
}
.screen.app-open .dock { transform: translateX(-50%) scale(.94); }
.dock .app .lbl { display: none; }
/* the logo overlay (Brand in launcher.js sets its size and place) */
.brand-logo { position: absolute; z-index: 4; object-fit: contain; pointer-events: none; user-select: none; -webkit-user-drag: none; transition: opacity .3s; }
.screen.app-open .brand-logo, .screen.arranging .brand-logo { opacity: 0; }
.dock .app .ic { width: 6.2cqw; height: 6.2cqw; }
.dock .sep { width: 1px; align-self: stretch; margin: .6cqh 0; background: rgba(255, 255, 255, .45); }

/* ---------- app window ---------- */
.appwin {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column;
  background: #000;
  opacity: 0; pointer-events: none;
  transform: scale(.15); border-radius: 4cqh;
  transition: transform .32s cubic-bezier(.2, .85, .25, 1), opacity .22s, border-radius .32s;
}
.appwin.open { opacity: 1; pointer-events: auto; transform: none; border-radius: 0; }
.appbody { flex: 1; position: relative; overflow: hidden; padding-top: 3.4cqh; }
.appwin.game .appbody { padding-top: 0; }
.appbody iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
/* apps start below the status bar (an absolute iframe ignores the padding above, so the app's title ran under the clock);
   games still fill the screen and leave room for the status bar themselves */
.appwin:not(.game) .appbody iframe { top: 3.4cqh; height: auto; bottom: 0; }
.homebar {
  flex: 0 0 auto; height: 2.8cqh; border: 0; margin: 0; padding: 0;
  background: #000; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  touch-action: none; outline: none;
}
.homebar span { width: 13cqw; height: .6cqh; border-radius: 1cqh; background: rgba(255, 255, 255, .7); transition: width .15s, background .15s; }
.homebar:hover span, .homebar:focus-visible span { width: 16cqw; background: #fff; }
.appwin.light { background: var(--sheet); }
.appwin.light .homebar { background: var(--sheet); }
.appwin.light .homebar span { background: var(--ink2); }

/* ---------- native app shared ---------- */
.native { position: absolute; inset: 3.4cqh 0 0 0; color: var(--ink); background: var(--sheet); font-size: calc(1.75cqh * var(--ts)); display: flex; flex-direction: column; }
.native button { font: inherit; }
.scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.pill {
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--soft); color: var(--accent); font-weight: 700; font-size: calc(1.55cqh * var(--ts));
  padding: .7cqh 2.1cqh; min-width: 7.4cqh; letter-spacing: .02em;
}
.pill.solid { background: var(--accent); color: var(--accent-ink); }
.pill.big { font-size: calc(1.8cqh * var(--ts)); padding: 1cqh 3cqh; }
.pill:active { filter: brightness(.9); }
.pill.loading { position: relative; color: transparent; }
.pill.loading::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 1.8cqh; height: 1.8cqh; margin: -.9cqh 0 0 -.9cqh;
  border: .3cqh solid var(--line); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.mini-ic { border-radius: 23%; background: center / cover no-repeat; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.pixel-ic { image-rendering: pixelated; }

/* ---------- Catalog ---------- */
.cat-top { display: flex; align-items: flex-end; gap: 2cqw; padding: 2.4cqh 4cqw 1.6cqh; }
.cat-top h1 { margin: 0; font-size: calc(4.4cqh * var(--ts)); font-weight: 800; letter-spacing: -.02em; }
.cat-date { color: var(--ink2); font-size: calc(1.5cqh * var(--ts)); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3cqh; }
.seg { margin-left: auto; display: flex; background: var(--soft); border-radius: 1.2cqh; padding: .35cqh; gap: .3cqh; }
.seg button { border: 0; background: none; padding: .7cqh 2.2cqh; border-radius: .9cqh; cursor: pointer; font-weight: 600; color: var(--ink); font-size: calc(1.55cqh * var(--ts)); }
.seg button.on { background: var(--seg-on); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.cat-body { padding: 0 4cqw 4cqh; }
.feature {
  position: relative; height: 38cqh; border-radius: 2.4cqh; overflow: hidden; cursor: pointer;
  background: #111 center / cover no-repeat; box-shadow: 0 1cqh 3cqh rgba(0, 0, 0, .18);
  image-rendering: pixelated;
}
.feature::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(0, 0, 0, .8)); }
.feature .ftxt { position: absolute; left: 2.6cqw; right: 2.6cqw; bottom: 2.4cqh; z-index: 1; color: #fff; display: flex; align-items: flex-end; gap: 1.6cqw; }
.feature .tag { font-size: calc(1.4cqh * var(--ts)); font-weight: 700; letter-spacing: .08em; color: #ffcf33; text-transform: uppercase; }
.feature h2 { margin: .3cqh 0; font-size: calc(3.6cqh * var(--ts)); font-weight: 800; }
.feature p { margin: 0; font-size: calc(1.7cqh * var(--ts)); opacity: .9; }
.feature .fgrow { flex: 1; }
.sec-h { display: flex; align-items: baseline; margin: 3.4cqh 0 1.2cqh; }
.sec-h h3 { margin: 0; font-size: calc(2.4cqh * var(--ts)); font-weight: 800; }
.list { background: var(--card); border-radius: 1.8cqh; padding: 0 1.8cqw; }
.row { display: flex; align-items: center; gap: 1.4cqw; padding: 1.5cqh 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row .mini-ic { width: 7.2cqh; height: 7.2cqh; }
.row .rt { flex: 1; min-width: 0; }
.row .rn { font-weight: 700; font-size: calc(1.9cqh * var(--ts)); }
.row .rs { color: var(--ink2); font-size: calc(1.5cqh * var(--ts)); margin-top: .3cqh; }
.empty { text-align: center; color: var(--ink2); padding: 10cqh 0; }
.empty b { display: block; color: var(--ink); font-size: calc(2.2cqh * var(--ts)); margin-bottom: .8cqh; }

/* detail page */
.back { border: 0; background: none; color: var(--accent); font-weight: 600; font-size: calc(1.8cqh * var(--ts)); cursor: pointer; padding: 1.6cqh 4cqw .4cqh; text-align: left; }
.dhead { display: flex; align-items: center; gap: 2cqw; padding: 1.4cqh 4cqw 2cqh; }
.dhead .mini-ic { width: 15cqh; height: 15cqh; box-shadow: 0 .6cqh 1.6cqh rgba(0, 0, 0, .18); }
.dhead h2 { margin: 0; font-size: calc(3.4cqh * var(--ts)); font-weight: 800; }
.dhead .dsub { color: var(--ink2); font-size: calc(1.7cqh * var(--ts)); margin: .4cqh 0 1.4cqh; }
.facts { display: flex; margin: 0 4cqw; padding: 1.6cqh 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts div { flex: 1; text-align: center; border-right: 1px solid var(--line); }
.facts div:last-child { border-right: 0; }
.facts small { display: block; color: var(--ink2); font-size: calc(1.2cqh * var(--ts)); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.facts b { display: block; font-size: calc(2.1cqh * var(--ts)); margin-top: .4cqh; color: var(--ink3); }
.shots { display: flex; gap: 1.4cqw; overflow-x: auto; padding: 2.4cqh 4cqw; scroll-snap-type: x mandatory; }
.shots img { height: 30cqh; aspect-ratio: 16 / 9; border-radius: 1.4cqh; scroll-snap-align: start; box-shadow: 0 .5cqh 1.4cqh rgba(0, 0, 0, .2); image-rendering: pixelated; flex: 0 0 auto; }
.dtext { padding: 0 4cqw 4cqh; line-height: 1.5; }
.dtext h3 { font-size: calc(2.2cqh * var(--ts)); margin: 2.4cqh 0 .8cqh; }
.dtext p { margin: 0 0 1.2cqh; color: var(--ink3); }
.dtext ul { margin: 0; padding-left: 2.4cqh; color: var(--ink3); }
.dtext .ver { color: var(--ink2); font-size: calc(1.5cqh * var(--ts)); margin-bottom: .6cqh; }

/* ---------- Settings ---------- */
.set { display: flex; height: 100%; }
.set-side { width: 31%; border-right: 1px solid var(--line); background: var(--sheet); overflow-y: auto; padding: 2cqh 1.6cqw; box-sizing: border-box; }
.set-side h1 { font-size: calc(3.6cqh * var(--ts)); margin: .6cqh .8cqw 2cqh; font-weight: 800; }
.acct { display: flex; align-items: center; gap: 1.2cqw; background: var(--card); border-radius: 1.6cqh; padding: 1.6cqh 1.2cqw; margin-bottom: 2.4cqh; cursor: pointer; border: 0; width: 100%; text-align: left; color: var(--ink); }
.avatar { width: 6.4cqh; height: 6.4cqh; border-radius: 50%; background: linear-gradient(135deg, #fed66a, #5a8a56); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: calc(2.4cqh * var(--ts)); flex: 0 0 auto; }
.acct b { display: block; font-size: calc(1.8cqh * var(--ts)); }
.acct small { color: var(--ink2); font-size: calc(1.4cqh * var(--ts)); }
.group { background: var(--card); border-radius: 1.6cqh; overflow: hidden; margin-bottom: 2.4cqh; }
.item { display: flex; align-items: center; gap: 1cqw; width: 100%; border: 0; background: none; padding: 1.25cqh 1cqw; cursor: pointer; color: var(--ink); text-align: left; border-bottom: 1px solid var(--line); font-size: calc(1.7cqh * var(--ts)); }
.item:last-child { border-bottom: 0; }
.item.on { background: var(--accent); color: var(--accent-ink); }
.item .sq { width: 3cqh; height: 3cqh; border-radius: .8cqh; display: flex; align-items: center; justify-content: center; color: #fff; font-size: calc(1.6cqh * var(--ts)); flex: 0 0 auto; }
.set-main { flex: 1; overflow-y: auto; padding: 3cqh 4cqw; box-sizing: border-box; }
.set-main h2 { font-size: calc(3cqh * var(--ts)); margin: 0 0 2.4cqh; font-weight: 800; }
.card { background: var(--card); border-radius: 1.6cqh; padding: 2cqh 2cqw; margin-bottom: 2.2cqh; }
.card h4 { margin: 0 0 .8cqh; font-size: calc(1.9cqh * var(--ts)); }
.card p { margin: 0; color: var(--ink2); line-height: 1.5; }
.soon { display: inline-block; font-size: calc(1.25cqh * var(--ts)); font-weight: 800; letter-spacing: .06em; color: #8a5a00; background: #fed66a; border-radius: .7cqh; padding: .3cqh .9cqh; margin-left: .8cqh; vertical-align: middle; }
.kv { display: flex; justify-content: space-between; padding: 1.2cqh 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span:last-child { color: var(--ink2); }
.kv a { color: var(--accent); text-decoration: none; }
.ghost { opacity: .55; pointer-events: none; }
.bk-list { margin-top: 1cqh; }
.bk-row { border-top: 1px solid var(--line); }
.bk-row summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4cqh 1.2cqw; padding: 1.2cqh 0; cursor: pointer; list-style: none; }
.bk-row summary::-webkit-details-marker { display: none; }
.bk-row summary::before { content: "›"; display: inline-block; width: 1.2em; color: var(--ink2); transition: transform .15s; }
.bk-row[open] summary::before { transform: rotate(90deg); }
.bk-v { font-weight: 700; color: var(--ink); }
.bk-when { color: var(--ink2); flex: 1; }
.bk-size { color: var(--ink2); }
.bk-body { padding: 0 0 1.4cqh 1.6em; }
.wall-cat { margin: 3cqh 0 0; font-size: calc(1.5cqh * var(--ts)); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink2); }
.walls { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: start; gap: 1.6cqh 1.2cqw; margin-top: 1.4cqh; }
@container (max-width: 700px) { .walls { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.wall-opt { border: 0; padding: 0; background: none; cursor: pointer; color: var(--ink2); font-size: calc(1.3cqh * var(--ts)); text-align: center; }
.wall-opt .th { display: block; aspect-ratio: 1.43; border-radius: 1cqh; background: #444 center / cover no-repeat; box-shadow: 0 0 0 1px var(--line); margin-bottom: .6cqh; position: relative; overflow: hidden; }
.wall-opt.on .th { box-shadow: 0 0 0 .35cqh var(--accent); }
.wall-opt.on { color: var(--ink); font-weight: 700; }
.wall-opt .th.add { background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: calc(3.4cqh * var(--ts)); color: var(--ink2); }
.choice { display: flex; gap: .8cqw; flex-wrap: wrap; margin-top: 1.4cqh; }
.choice button { border: 0; cursor: pointer; border-radius: 1.2cqh; padding: 1.1cqh 1.6cqw; background: var(--soft); color: var(--ink); font-size: calc(1.6cqh * var(--ts)); min-width: 10cqh; }
.choice button.on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.choice .dot { display: inline-block; width: 1.6cqh; height: 1.6cqh; border-radius: 50%; vertical-align: -.25cqh; margin-right: .6cqw; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.choice.fonts button { min-width: 16cqh; text-align: left; }
.choice.fonts button b { display: block; font-size: calc(2.4cqh * var(--ts)); margin-bottom: .2cqh; }
.choice.fonts button small { opacity: .75; font-size: calc(1.25cqh * var(--ts)); }
.btn-row { display: flex; gap: 1cqw; flex-wrap: wrap; margin-top: 1.4cqh; }
.btn { border: 0; cursor: pointer; border-radius: 1.2cqh; padding: 1.1cqh 1.8cqw; background: var(--soft); color: var(--accent); font-weight: 700; font-size: calc(1.6cqh * var(--ts)); }
.btn.solid { background: var(--accent); color: var(--accent-ink); }
.note { color: var(--ink2); font-size: calc(1.4cqh * var(--ts)); margin-top: 1cqh; line-height: 1.45; }

/* ---------- arrange mode (press and hold an icon) ---------- */
@keyframes jiggle { 0% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } 100% { transform: rotate(-1.6deg); } }
.grid.arranging .app .ic { animation: jiggle .32s ease-in-out infinite; }
.grid.arranging .app:nth-child(2n) .ic { animation-delay: -.16s; }
.grid.arranging .app { cursor: grab; touch-action: none; position: relative; }
.grid.arranging .app.dragging { opacity: .25; }
.grid .app .rm {
  display: none; position: absolute; top: -.9cqh; left: calc(50% - 3.35cqw - .9cqh);
  width: 2.6cqh; height: 2.6cqh; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: rgba(40, 40, 42, .85); color: #fff; font-size: calc(2cqh * var(--ts)); line-height: 2.4cqh; font-weight: 700; z-index: 2;
}
.grid.arranging .app .rm { display: block; }
/* the dock while arranging: its apps jiggle and get a − (remove from the dock); it lights up when an app is dragged onto it */
.dock .app .rm { display: none; position: absolute; top: -.9cqh; left: -.9cqh; width: 2.6cqh; height: 2.6cqh; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: rgba(40, 40, 42, .85); color: #fff; font-size: calc(2cqh * var(--ts)); line-height: 2.4cqh; font-weight: 700; z-index: 2; }
.dock .app { position: relative; }
.screen.arranging .dock .app[data-pin] .rm { display: block; }
.screen.arranging .dock .app[data-pin] .ic { animation: jiggle .32s ease-in-out infinite; }
.screen.arranging .dock .app[data-pin] { cursor: grab; touch-action: none; }
.dock .app.dragging { opacity: .25; }
.dock.drop-target { box-shadow: inset 0 0 0 .35cqh rgba(255, 255, 255, .85), 0 1cqh 3cqh rgba(0, 0, 0, .25); }
.drag-ghost.drop-out { opacity: .45; }
.dock-empty { display: none; color: rgba(255, 255, 255, .85); font-size: calc(1.4cqh * var(--ts)); font-weight: 700; padding: 1.6cqh 2cqw; }
.screen.arranging .dock-empty { display: block; }
.drag-ghost { position: absolute; z-index: 40; pointer-events: none; transform: scale(1.12); filter: drop-shadow(0 1.4cqh 2cqh rgba(0, 0, 0, .45)); }
.drag-ghost .lbl { display: none; }
.done-btn {
  position: absolute; top: 4.4cqh; right: 2.4cqw; z-index: 35; display: none;
  border: 0; cursor: pointer; border-radius: 999px; padding: .9cqh 2.4cqh;
  background: rgba(255, 255, 255, .85); color: #1b1a19; font: inherit; font-weight: 700; font-size: calc(1.7cqh * var(--ts));
  box-shadow: 0 .4cqh 1.2cqh rgba(0, 0, 0, .25);
}
.screen.arranging .done-btn { display: block; }
.arrange-tip { position: absolute; top: 4.6cqh; left: 50%; transform: translateX(-50%); z-index: 35; display: none; color: #fff; font-size: calc(1.5cqh * var(--ts)); font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.screen.arranging .arrange-tip { display: block; }

/* ---------- small screens: fill the display, no bezel ---------- */
@media (max-width: 760px), (max-height: 480px) {
  .device { width: 100vw; height: 100vh; height: 100dvh; padding: 0; border-radius: 0; box-shadow: none; }
  .screen { border-radius: 0; }
  .camera { display: none; }
  /* no frame on phones: the home button floats at the right edge (drag it up or down) */
  .hwbtn {
    position: fixed; right: 10px; left: auto; top: var(--hb-y, 72%); transform: translateY(-50%);
    width: 48px; height: 48px; opacity: .62; z-index: 9999; touch-action: none;
    background: radial-gradient(circle at 50% 38%, rgba(70, 74, 80, .92), rgba(22, 24, 28, .92));
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .35), 0 4px 14px rgba(0, 0, 0, .45);
  }
  .hwbtn:hover, .hwbtn:focus-visible, .hwbtn.down { opacity: .95; }
  .hwbtn.down { transform: translateY(-50%) scale(.92); }
}

/* ---------- frame: camera and home button ---------- */
.camera {
  position: absolute; left: calc(var(--w) * 0.026); top: 50%; transform: translateY(-50%);
  width: calc(var(--w) * 0.0075); height: calc(var(--w) * 0.0075); border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #3c4a66, #0b0d12 70%); box-shadow: 0 0 0 1px #2c2d33;
}
.hwbtn {
  --hb: calc(var(--w) * 0.036);
  position: absolute; right: calc(var(--w) * 0.028 - var(--hb) / 2); top: 50%; transform: translateY(-50%);
  width: var(--hb); height: var(--hb); min-width: 30px; min-height: 30px; border-radius: 50%; padding: 0; border: 0; cursor: pointer;
  background: radial-gradient(circle at 50% 35%, #2b2d33, #121317 72%);
  box-shadow: inset 0 0 0 2px #3c3e45, inset 0 -2px 4px rgba(255, 255, 255, .06), 0 1px 1px rgba(255, 255, 255, .06);
  display: flex; align-items: center; justify-content: center;
  transition: transform .08s, box-shadow .08s, opacity .15s; -webkit-tap-highlight-color: transparent;
}
.hwbtn svg { width: 44%; height: 44%; fill: #6a6d75; transition: fill .15s; }
.hwbtn:hover svg, .hwbtn:focus-visible svg { fill: #8fd16f; }
.hwbtn:focus-visible { outline: 2px solid #8fd16f; outline-offset: 3px; }
.hwbtn.down { transform: translateY(-50%) scale(.93); box-shadow: inset 0 0 0 2px #4a4c54, inset 0 3px 8px rgba(0, 0, 0, .6); }

/* ---------- open-apps switcher ---------- */
.switcher {
  position: absolute; inset: 0; z-index: 60; display: flex; flex-direction: column; justify-content: center;
  background: rgba(10, 14, 9, .55); -webkit-backdrop-filter: blur(18px) saturate(1.2); backdrop-filter: blur(18px) saturate(1.2);
  opacity: 0; transition: opacity .22s; color: #fff;
}
.switcher.open { opacity: 1; }
.screen.switching .home, .screen.switching .dock { opacity: .25; }
.sw-head { position: absolute; top: 5cqh; left: 4cqw; right: 4cqw; display: flex; align-items: center; }
.sw-title { flex: 1; font-size: calc(2.4cqh * var(--ts)); font-weight: 800; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.sw-clear { border: 0; border-radius: 999px; padding: 1cqh 2cqw; background: rgba(255, 255, 255, .2); color: #fff; font: inherit; font-weight: 700; font-size: calc(1.6cqh * var(--ts)); cursor: pointer; }
.sw-row { display: flex; gap: 2.6cqw; overflow-x: auto; padding: 4cqh 5cqw; scroll-snap-type: x mandatory; scrollbar-width: none; }
.sw-row::-webkit-scrollbar { display: none; }
.sw-card { flex: 0 0 auto; width: 21cqw; position: relative; scroll-snap-align: center; transition: transform .22s, opacity .22s; }
.sw-card.gone { transform: translateY(-120%) !important; opacity: 0 !important; }
.sw-top { display: flex; align-items: center; gap: .8cqw; margin-bottom: 1.2cqh; }
.sw-ic { width: 3.2cqw; height: 3.2cqw; border-radius: 23%; background: center / cover no-repeat; flex: none; }
.sw-name { font-weight: 700; font-size: calc(1.6cqh * var(--ts)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.sw-pane {
  width: 100%; height: 44cqh; border: 0; border-radius: 2.4cqh; cursor: pointer; touch-action: pan-x;
  background: var(--sheet); color: var(--ink2); font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4cqh;
  box-shadow: 0 1.2cqh 3cqh rgba(0, 0, 0, .4);
}
.sw-pane.game { background: linear-gradient(160deg, #1d2a17, #0c130a); color: #cfe3c2; }
.sw-pane:focus-visible { outline: 3px solid #8fd16f; outline-offset: 3px; }
.sw-big { width: 9cqw; height: 9cqw; border-radius: 23%; background: center / cover no-repeat; box-shadow: 0 .6cqh 1.6cqh rgba(0, 0, 0, .25); }
.sw-state { font-size: calc(1.45cqh * var(--ts)); font-weight: 600; padding: 0 1.4cqw; text-align: center; }
.sw-x {
  position: absolute; top: 4.2cqh; right: -1cqw; width: 4cqh; height: 4cqh; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(30, 30, 30, .75); color: #fff; font-size: calc(2.4cqh * var(--ts)); line-height: 1; box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.sw-empty { margin: 0 auto; font-size: calc(2cqh * var(--ts)); opacity: .85; padding: 14cqh 0; }
.sw-hint { text-align: center; font-size: calc(1.4cqh * var(--ts)); opacity: .8; }
@container (max-aspect-ratio: 1/1) {
  .sw-card { width: 62cqw; } .sw-ic { width: 7cqw; height: 7cqw; } .sw-big { width: 22cqw; height: 22cqw; } .sw-pane { height: 52cqh; } .sw-x { right: -2cqw; }
}
@container (max-aspect-ratio: 1/1) {
  .grid { grid-template-columns: repeat(4, 1fr); padding: 4cqh 5cqw 0; grid-auto-rows: 12cqh; }
  .app .ic { width: 15cqw; height: 15cqw; }
  .dock .app .ic { width: 13cqw; height: 13cqw; }
  .app .lbl { font-size: calc(1.4cqh * var(--ts)); max-width: 22cqw; }
}
.dtext a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* ---------- folders ---------- */
.app.folder .fic {
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 6%; padding: 11%; box-sizing: border-box;
  background: rgba(255, 255, 255, .28);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), 0 .5cqh 1.4cqh rgba(0, 0, 0, .3);
}
.device[data-mode="dark"] .app.folder .fic { background: rgba(30, 30, 32, .45); }
.app.folder .fic span.badge { border-radius: 1.1cqh; background: #ff3b30; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.app.folder .fic span:not(.badge) { border-radius: 22%; background: center / cover no-repeat; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
/* holding an app over another: it grows and glows to show a folder will be made */
.grid .app.merge-target .ic { transform: scale(1.18); box-shadow: 0 0 0 .45cqh rgba(255, 255, 255, .9), 0 .8cqh 2cqh rgba(0, 0, 0, .35); animation: none; }

.folder-view {
  position: absolute; inset: 0; z-index: 36; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 12, 10, .25); -webkit-backdrop-filter: blur(16px) brightness(.8); backdrop-filter: blur(16px) brightness(.8);
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.folder-view.open { opacity: 1; pointer-events: auto; }
.fpanel {
  width: min(62cqw, 92cqh); padding: 2.6cqh 3cqw 3cqh; box-sizing: border-box; border-radius: 4cqh;
  background: rgba(255, 255, 255, .26); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 2cqh 6cqh rgba(0, 0, 0, .3);
  transform: scale(.92); transition: transform .22s, opacity .2s;
}
.folder-view.open .fpanel { transform: none; }
.fpanel.leaving { opacity: .55; }
.fname {
  display: block; width: 100%; box-sizing: border-box; margin: 0 0 .6cqh; padding: .6cqh 1cqw;
  border: 0; border-radius: 1.2cqh; background: transparent; color: #fff; text-align: center;
  font: inherit; font-size: calc(3.4cqh * var(--ts)); font-weight: 700; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); outline: none;
}
.fname:hover { background: rgba(255, 255, 255, .12); }
.fname:focus { background: rgba(0, 0, 0, .25); }
.fhint { text-align: center; color: rgba(255, 255, 255, .85); font-size: calc(1.35cqh * var(--ts)); margin-bottom: 2.2cqh; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.fgrid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 15cqh; row-gap: 2cqh; }
.fgrid .app .ic { width: 6.7cqw; height: 6.7cqw; }
.folder-view.arranging .fgrid .app .ic { animation: jiggle .32s ease-in-out infinite; }
.folder-view.arranging .fgrid .app { cursor: grab; touch-action: none; position: relative; }
.folder-view.arranging .fgrid .app .rm { display: block; }
.fgrid .app.dragging { opacity: .25; }
.fgrid .app .rm { display: none; position: absolute; top: -.9cqh; left: calc(50% - 3.35cqw - .9cqh); width: 2.6cqh; height: 2.6cqh; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: rgba(40, 40, 42, .85); color: #fff; font-size: calc(2cqh * var(--ts)); line-height: 2.4cqh; font-weight: 700; z-index: 2; }
@container (max-aspect-ratio: 1/1) {
  .fpanel { width: 88cqw; }
  .fgrid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 12cqh; }
  .fgrid .app .ic { width: 15cqw; height: 15cqw; }
}

.fname-row { position: relative; display: block; cursor: text; }
.fname-row .pencil { position: absolute; right: 1.4cqw; top: 50%; transform: translateY(-50%); color: rgba(255, 255, 255, .75); font-size: calc(2.2cqh * var(--ts)); pointer-events: none; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.fname { background: rgba(255, 255, 255, .1); }
.ffoot { display: flex; align-items: center; justify-content: flex-end; gap: 1.6cqw; margin-top: 1.6cqh; }
.fsaved { color: #fff; font-size: calc(1.5cqh * var(--ts)); font-weight: 600; opacity: 0; transition: opacity .25s; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.fsaved.show { opacity: 1; }
.fdone { border: 0; cursor: pointer; border-radius: 999px; padding: 1cqh 3cqh; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; font-size: calc(1.8cqh * var(--ts)); box-shadow: 0 .4cqh 1.2cqh rgba(0, 0, 0, .25); }
.fdone:active { filter: brightness(.9); }

/* ---- Account: sign-in form, admin defaults (v1.14) */
.keep { display: flex; align-items: center; gap: .8cqh; color: var(--ink2); font-size: calc(1.5cqh * var(--ts)); cursor: pointer; }
.keep input, .arow input { width: 2.2cqh; height: 2.2cqh; accent-color: var(--accent); flex: 0 0 auto; }
.btn:disabled { opacity: .6; cursor: default; }
.form-msg { color: #b3261e; font-size: calc(1.5cqh * var(--ts)); min-height: 1.2em; }
.form-msg:empty { min-height: 0; }
[role="status"].form-msg { color: var(--accent); font-weight: 700; margin-top: 1cqh; }
.links { display: flex; flex-wrap: wrap; gap: .6cqh 2cqw; font-size: calc(1.5cqh * var(--ts)); }
.lnk { color: var(--accent); text-decoration: none; font-weight: 700; }
.lnk:hover { text-decoration: underline; }
.admin-apps { margin-top: 1.4cqh; border-top: 1px solid var(--line); }
.arow { display: flex; align-items: center; gap: 1.2cqh; padding: 1cqh 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.arow .mini-ic { width: 4.4cqh; height: 4.4cqh; flex: 0 0 auto; }
.arow .an { flex: 1; font-weight: 700; }
.arow .aw { color: var(--ink2); font-size: calc(1.4cqh * var(--ts)); }

/* ---- Update site (v1.16) */
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pick-row { display: flex; align-items: center; gap: 1.4cqh; margin-top: 1.6cqh; flex-wrap: wrap; }
.pick-row label.btn { display: inline-block; }
.pick-row input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.off { opacity: .5; pointer-events: none; }
.fname-txt { color: var(--ink2); font-size: calc(1.5cqh * var(--ts)); word-break: break-all; }
.upbar { margin-top: 1.4cqh; height: 1cqh; border-radius: 1cqh; background: var(--soft); overflow: hidden; }
.upbar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.ver-label { color: var(--ink2); font-size: calc(1.4cqh * var(--ts)); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.ver-big { font-size: calc(3.4cqh * var(--ts)); font-weight: 800; margin: .4cqh 0; color: var(--ink); }
.ver-date { color: var(--ink2); font-size: calc(1.5cqh * var(--ts)); }
.ver-ok { margin-top: 1.2cqh; padding: 1cqh 1.4cqh; border-radius: 1cqh; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--ink); font-weight: 700; font-size: calc(1.5cqh * var(--ts)); }
.ver-card h4 { margin-top: 2cqh; }
ul.chg { margin: .6cqh 0 0; padding-left: 2.4cqh; color: var(--ink); line-height: 1.5; font-size: calc(1.55cqh * var(--ts)); }
ul.chg li { margin: .5cqh 0; }
ul.chg ul { padding-left: 2.4cqh; margin: .4cqh 0; color: var(--ink2); }
ul.chg code, .mbody code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; background: var(--soft); padding: .1em .35em; border-radius: .4em; word-break: break-all; }
.modal { position: absolute; inset: 0; z-index: 60; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; padding: 4cqh; }
.mbox { background: var(--card); color: var(--ink); width: min(110cqh, 100%); max-height: 100%; border-radius: 2cqh; display: flex; flex-direction: column; box-shadow: 0 2cqh 6cqh rgba(0, 0, 0, .35); }
.mhead { display: flex; align-items: center; justify-content: space-between; padding: 2cqh 2.4cqh 1.4cqh; border-bottom: 1px solid var(--line); }
.mhead h3 { margin: 0; font-size: calc(2.2cqh * var(--ts)); }
.mx { border: 0; background: var(--soft); color: var(--ink); width: 4.4cqh; height: 4.4cqh; border-radius: 50%; font-size: calc(2.6cqh * var(--ts)); line-height: 1; cursor: pointer; }
.mbody { overflow: auto; padding: 1.4cqh 2.4cqh 2.4cqh; }
details.ver-sec { border-bottom: 1px solid var(--line); padding: 1.2cqh 0; }
details.ver-sec summary { cursor: pointer; display: flex; gap: 1.6cqh; align-items: baseline; font-size: calc(1.8cqh * var(--ts)); }
details.ver-sec summary span { color: var(--ink2); font-size: calc(1.4cqh * var(--ts)); }
/* admin: CIMIS key box (SprayLight) */
.cimis-key { width: 100%; box-sizing: border-box; margin: 1.2cqh 0; padding: 1.1cqh 1.2cqh; border-radius: 1cqh; border: 1px solid var(--line); background: var(--card, #fff); color: inherit; font: inherit; }

/* admin: App names */
.admin-names .arow { display: flex; align-items: center; gap: 1cqw; padding: .8cqh 0; border-bottom: 1px solid var(--line); }
.admin-names .an { flex: 0 0 26%; }
.name-in { flex: 1; min-width: 0; padding: .9cqh 1cqw; border-radius: .9cqh; border: 1px solid var(--line); background: var(--card); color: inherit; font: inherit; }
.admin-names .arow .name-in { width: auto; height: auto; flex: 1 1 auto; accent-color: auto; }

/* =====================================================================================================
 * Glass look (v1.21): frosted, see-through surfaces with a bright rim and a soft top highlight.
 * A general "frosted glass" style (no other company's artwork, icons or fonts). Everything is in this block:
 * delete it to go back to the solid look.
 * ===================================================================================================== */
.device {
  --glass: rgba(255, 255, 255, .6);              /* cards and lists */
  --glass-2: rgba(255, 255, 255, .38);           /* buttons, segmented controls */
  --glass-rim: rgba(255, 255, 255, .85);         /* the bright top edge */
  --glass-edge: rgba(255, 255, 255, .45);        /* the thin outline */
  --glass-sheet: rgba(240, 243, 237, .66);       /* full-screen sheets (Settings, Catalog, apps) */
  --glass-shadow: 0 .6cqh 2.2cqh rgba(20, 30, 15, .12);
  --glass-blur: blur(30px) saturate(1.7);
}
.device[data-mode="dark"] {
  --glass: rgba(36, 56, 30, .5);
  --glass-2: rgba(60, 84, 52, .38);
  --glass-rim: rgba(255, 255, 255, .22);
  --glass-edge: rgba(255, 255, 255, .1);
  --glass-sheet: rgba(8, 18, 6, .58);
  --glass-shadow: 0 .6cqh 2.2cqh rgba(0, 0, 0, .35);
}
/* the wallpaper shows through every sheet, softly blurred */
.screen.app-open .wallpaper { filter: blur(10px) brightness(var(--wall-dim)) saturate(1.2); }
.appwin.light, .appwin.glassy { background: var(--glass-sheet); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.appwin.light .homebar, .appwin.glassy .homebar { background: transparent; }
.appwin.glassy .appbody iframe { background: transparent; }
.native, .set-side { background: transparent; }
.set-side { border-right-color: var(--glass-edge); }
/* cards, lists, groups, dialogs: frosted panes with a lit top edge */
.list, .group, .card, .acct, .mbox, .sw-pane {
  background: var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-rim), inset 0 0 0 1px var(--glass-edge), var(--glass-shadow);
}
.sw-pane { -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.sw-pane.game { background: linear-gradient(160deg, rgba(29, 42, 23, .82), rgba(12, 19, 10, .82)); }
.mbox { -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
/* buttons and pills: lighter glass, fully rounded */
.btn, .pill, .choice button, .mx, .upbar, .wall-opt .th.add {
  background: var(--glass-2);
  box-shadow: inset 0 1px 0 var(--glass-rim), inset 0 0 0 1px var(--glass-edge);
}
.btn, .pill { border-radius: 999px; }
.btn.solid, .pill.solid {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 .4cqh 1.2cqh color-mix(in srgb, var(--accent) 35%, transparent);
}
.seg { background: var(--glass-2); box-shadow: inset 0 1px 0 var(--glass-rim), inset 0 0 0 1px var(--glass-edge); border-radius: 999px; }
.seg button { border-radius: 999px; }
.seg button.on { background: var(--glass); box-shadow: inset 0 1px 0 var(--glass-rim), 0 .3cqh .9cqh rgba(0, 0, 0, .12); }
/* the selected Settings item: a lit accent pill instead of a flat bar */
.group { overflow: visible; padding: .5cqh; }
.item { border-radius: 1.1cqh; border-bottom-color: transparent; }
.item.on { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 .3cqh 1cqh color-mix(in srgb, var(--accent) 30%, transparent); }
.item .sq { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4); }
.kv { border-bottom-color: var(--glass-edge); }
.name-in, .cimis-key { background: var(--glass); border-color: var(--glass-edge); }

/* app icons: a glass sheen on top (highlight at the top, rim light, soft shade at the bottom) */
.app .ic, .mini-ic, .sw-ic, .sw-big { position: relative; }
.app .ic::after, .mini-ic::after, .sw-ic::after, .sw-big::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, rgba(255, 255, 255, .34) 0%, rgba(255, 255, 255, .1) 30%, rgba(255, 255, 255, 0) 52%, rgba(0, 0, 0, .1) 100%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .6), inset 0 0 0 1px rgba(255, 255, 255, .2), inset 0 -.3cqh .6cqh rgba(0, 0, 0, .12);
}
.app.pixel .ic::after { background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 45%); }
.app .ic { box-shadow: 0 .6cqh 1.6cqh rgba(0, 0, 0, .3), 0 0 0 .5px rgba(0, 0, 0, .15); }
.app .badge { box-shadow: 0 .2cqh .6cqh rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .4); }
/* folder icons: clear glass with a lit rim */
.app.folder .fic {
  background: linear-gradient(180deg, rgba(255, 255, 255, .42), rgba(255, 255, 255, .2));
  -webkit-backdrop-filter: blur(16px) saturate(1.8); backdrop-filter: blur(16px) saturate(1.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), inset 0 0 0 1px rgba(255, 255, 255, .35), 0 .6cqh 1.6cqh rgba(0, 0, 0, .25);
}
.app.folder .fic::after { display: none; }
.device[data-mode="dark"] .app.folder .fic { background: linear-gradient(180deg, rgba(60, 70, 58, .5), rgba(20, 26, 18, .45)); }
/* the dock and an open folder: big glass panels */
.dock {
  background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .14));
  -webkit-backdrop-filter: blur(28px) saturate(1.9); backdrop-filter: blur(28px) saturate(1.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 0 0 1px rgba(255, 255, 255, .28), 0 1cqh 3cqh rgba(0, 0, 0, .22);
}
.device[data-mode="dark"] .dock { background: linear-gradient(180deg, rgba(40, 56, 34, .5), rgba(10, 20, 8, .42)); }
.fpanel {
  background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .16));
  -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), inset 0 0 0 1px rgba(255, 255, 255, .3), 0 2cqh 6cqh rgba(0, 0, 0, .3);
}
/* floating buttons on the wallpaper (Done, Close all) */
.done-btn, .sw-clear {
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, .3)); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(20px) saturate(1.8); backdrop-filter: blur(20px) saturate(1.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 0 0 1px rgba(255, 255, 255, .35), 0 .4cqh 1.2cqh rgba(0, 0, 0, .2);
}
.sw-x { background: rgba(40, 40, 40, .55); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 4px rgba(0, 0, 0, .35); }
.switcher { background: rgba(10, 14, 9, .38); }
/* Settings > Games & Apps: tap a name to rename (admins) */
.appname-row { align-items: center; }
.an-left { display: flex; align-items: center; gap: 1cqw; flex: 1; min-width: 0; flex-wrap: wrap; }
.an-left .mini-ic { width: 3.6cqh; height: 3.6cqh; border-radius: 23%; background: center / cover no-repeat; flex: none; }
.name-btn { border: 0; background: none; padding: .3cqh .4cqw; margin: -.3cqh -.4cqw; border-radius: .8cqh; color: var(--ink); font: inherit; cursor: pointer; text-align: left; }
.name-btn:hover, .name-btn:focus-visible { background: var(--glass-2, var(--soft)); }
.name-btn .pen { color: var(--ink2); font-size: .85em; }
.name-edit { flex: 1; min-width: 12cqw; max-width: 40cqw; padding: .8cqh 1cqw; border-radius: .9cqh; border: 1px solid var(--accent); background: var(--card); color: var(--ink); font: inherit; }
.btn.tiny { padding: .6cqh 1.4cqw; }
.was { color: var(--ink2); font-size: .8em; }
.name-msg { color: var(--ink2); font-size: .85em; }
.appwin.glassy .homebar span { background: var(--ink2); }

/* Settings > Wallpaper & Theme > Logo (admin): a small preview of the home screen corner */
.brand-pv { position: relative; aspect-ratio: 16 / 7; border-radius: 1.4cqh; background: #333 center / cover no-repeat; overflow: hidden; margin: 1cqh 0 1.4cqh; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.brand-pv-dock { position: absolute; left: 50%; bottom: 6%; transform: translateX(-50%); width: 38%; height: 13%; border-radius: 1.2cqh; background: rgba(255, 255, 255, .28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.brand-pv-logo { position: absolute; right: 6%; bottom: 6%; max-width: 24%; object-fit: contain; }
.brand-size { display: flex; align-items: center; gap: 1.2cqw; margin-top: 1.4cqh; }
.brand-size label { min-width: 11em; font-weight: 700; }
.brand-size input[type=range] { flex: 1; accent-color: var(--accent); }

/* Settings > Games & Apps > Dock */
.dock-row { align-items: center; }
.dock-btns { display: flex; gap: .6cqw; }
.dock-btns .btn { min-width: 3.4cqw; }

/* Settings -> Game controller: live button test */
.padtest { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8cqh; margin-top: 1.2cqh; }
.pt-cell { border-radius: 1.2cqh; padding: 0.9cqh 1cqh; background: rgba(127,127,127,0.12); border: 1px solid rgba(127,127,127,0.25); transition: background 0.08s; }
.pt-cell b { display: block; font-size: calc(1.8cqh * var(--ts)); }
.pt-cell small { display: block; color: var(--ink2); font-size: calc(1.2cqh * var(--ts)); line-height: 1.25; }
.pt-cell.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pt-cell.on small { color: inherit; }
@container (max-width: 760px) { .padtest { grid-template-columns: repeat(2, 1fr); } }
