:root {
  --bg: #06080b;
  --card: rgba(255, 255, 255, 0.045);
  --card-hi: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.08);
  --text: #eef2f6;
  --muted: #8a94a3;
  --dim: #5b6472;
  --cpu: #2dd4bf;
  --gpu: #84cc16;
  --ram: #a78bfa;
  --net: #f59e0b;
  --up: #60a5fa;
  --ok: #22c55e;
  --err: #ef4444;
  --ambient: 45, 212, 191;
  --pad-l: max(14px, env(safe-area-inset-left));
  --pad-r: max(14px, env(safe-area-inset-right));
  color-scheme: dark;
}

/* themes (Settings › Display); --accent comes from the accent colour */
body[data-theme="amoled"] { --bg: #000; --card: rgba(255, 255, 255, 0.035); --card-hi: rgba(255, 255, 255, 0.06); --line: rgba(255, 255, 255, 0.06); }
body[data-theme="amoled"]::before { display: none; }
body[data-theme="midnight"] { --bg: #060a17; --card: rgba(120, 150, 255, 0.07); --card-hi: rgba(120, 150, 255, 0.11); --line: rgba(140, 170, 255, 0.13); --muted: #8d97b8; }
body[data-theme="warm"] { --bg: #0e0907; --card: rgba(255, 196, 150, 0.06); --card-hi: rgba(255, 196, 150, 0.1); --line: rgba(255, 196, 150, 0.1); --text: #f6ede5; --muted: #a8968a; --dim: #6f6259; }
body[data-theme="graphite"] { --bg: #16181c; --card: rgba(255, 255, 255, 0.06); --card-hi: rgba(255, 255, 255, 0.09); --line: rgba(255, 255, 255, 0.1); }
body[data-theme="graphite"]::before { opacity: .45; }
#dots i.on { background: color-mix(in srgb, var(--accent, #fff) 55%, white); }

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

body::before {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background:
    radial-gradient(60% 80% at 78% 30%, rgba(var(--ambient), 0.16), transparent 70%),
    radial-gradient(50% 60% at 10% 100%, rgba(var(--ambient), 0.06), transparent 70%);
  transition: background 1.2s ease;
  pointer-events: none;
}

/* the wallpaper (Settings › Display): behind the pages, darkened by --wp-dim and blurred by --wp-blur; a blurred
   picture reaches past the screen's edges so the blur does not fade them out */
#wallpaper {
  position: fixed;
  inset: calc(-2 * var(--wp-blur, 0px));
  background: center / cover no-repeat;
  filter: blur(var(--wp-blur, 0px));
  pointer-events: none;
}
#wallpaper::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, var(--wp-dim, .45)); }
/* the ambient glow would sit under the picture: the album-art tint is not drawn while there is a wallpaper */
body.has-wallpaper::before { display: none; }

/* a page's photo background (Settings › Pages): one dimmed picture from the Photo frame's folder behind a page's
   widgets; the two layers crossfade like the Photo frame widget, and the grid paints above them */
.page-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.page-bg-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s ease; }
.page-bg-img.on { opacity: 1; }
.page-bg-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, var(--pb-dim, .45)); }
.grid { position: relative; z-index: 1; }

button { font: inherit; color: inherit; background: none; border: 0; }
.muted { color: var(--muted); }
.empty { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; white-space: pre-line; padding: 8px; }

/* ---------- pager & grid ---------- */
#pager {
  position: relative;
  display: flex;
  height: 100vh;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior: contain;
  /* no stretch or glow at the first and last page: the wrap-around swipe takes that gesture instead (#651) */
  overscroll-behavior-x: none;
}
#pager::-webkit-scrollbar { display: none; }
#pager { transition: opacity .32s ease, filter .32s ease; }
#pager.fade { opacity: 0; filter: blur(8px); }
.page {
  flex: 0 0 100vw;
  height: 100vh;
  position: relative;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  padding: 10px var(--pad-r) 17px var(--pad-l);
}
.grid {
  height: 100%;
  display: grid;
  /* --pb-cols / --pb-rows come from the screen: 12 × 6 on a phone, more rows on a tablet. */
  grid-template-columns: repeat(var(--pb-cols, 12), minmax(0, 1fr));
  grid-template-rows: repeat(var(--pb-rows, 6), minmax(0, 1fr));
  gap: 8px;
}
/* Widget coordinates are saved from the left edge in both the panel and the editor. */
/* The pager scrolls by positive offsets (page i at i × width), so it stays left to right as well. */
[dir="rtl"] #pager { direction: ltr; }
[dir="rtl"] #pager > .page { direction: rtl; }
[dir="rtl"] .grid, [dir="rtl"] .ov-map { direction: ltr; }
[dir="rtl"] .grid > .w { direction: rtl; }
[dir="rtl"] input[type="range"] { direction: ltr; }
/* Charts and playback controls use physical x coordinates; command output keeps its terminal order. */
[dir="rtl"] :where(canvas, .bar, .times, .track, .deck-meter, .cmd-o, .fh-days) { direction: ltr; unicode-bidi: isolate; }
.w { position: relative; min-width: 0; min-height: 0; overflow: hidden; container-type: size; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: clamp(10px, 7cqmin, 20px); }

.w-title { display: flex; align-items: baseline; gap: 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--c, var(--muted)); white-space: nowrap; overflow: hidden; }
.w-sub { margin-inline-start: auto; font-size: 10.5px; letter-spacing: 0; text-transform: none; font-weight: 400; color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.mini-btn { margin-inline-start: auto; font-size: 10.5px; letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--muted); padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, .07); }

/* ---------- dots, page title, overview ---------- */
#dots {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0; padding: 0 10px 0 4px; z-index: 6;
  max-width: calc(100vw - 16px);
  border-radius: 999px; border: 1px solid transparent;
  touch-action: none; /* a slide along the dots picks a page instead of scrolling */
}
/* the dot stays small; the button around it is the size of a fingertip, and shrinks when there are many pages */
#dots .dot {
  /* --n is the number of pages: 24 px each while they fit, narrower when there are many */
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: clamp(10px, calc((100vw - 96px) / var(--n, 8)), 24px); height: 22px;
  padding: 0; border: none; background: transparent; cursor: pointer; outline: none; touch-action: none;
}
#dots .dot:focus-visible i { box-shadow: 0 0 0 1.5px var(--accent, #fff); }
#dots .dot.aim i { background: rgba(255, 255, 255, 0.9); transform: scale(1.5); }
#dots i { transition: width .25s, background .25s, transform .15s; }
body.dots-hidden #dots { display: none; }
/* the page bar (Settings › Display › Page navigation): the same buttons with the page's icon and name */
#dots .dot-ic, #dots .dot-nm { display: none; }
#dots.pagebar {
  gap: 4px; padding: 4px; border-color: var(--line); background: rgba(14, 17, 22, 0.94);
  border-radius: 16px; bottom: 6px; max-width: calc(100vw - 12px); overflow: hidden;
}
#dots.pagebar .dot {
  width: auto; height: 40px; min-width: 0; max-width: 140px; flex: 0 1 auto; gap: 6px; padding: 0 12px;
  border-radius: 12px; color: var(--muted); font: inherit;
}
#dots.pagebar .dot i { display: none; }
#dots.pagebar .dot-ic { display: inline-flex; align-items: center; font-size: 18px; line-height: 1; }
#dots.pagebar .dot-ic svg { width: 18px; height: 18px; }
#dots.pagebar .dot-nm { display: block; min-width: 0; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dots.pagebar .dot.on { color: var(--text); background: color-mix(in srgb, var(--accent, #2dd4bf) 22%, transparent); }
#dots.pagebar .dot.aim, #dots.pagebar .dot:focus-visible { box-shadow: inset 0 0 0 1.5px var(--accent, #fff); }
#dots.pagebar .page-all, #dots.pagebar .page-pause { min-width: 32px; min-height: 40px; margin: 0; }
/* A bottom or top page bar that is wider than the screen (many pages on a narrow phone, e.g. 16:9 at ~750 CSS px):
   main.js adds .pb-tight, then only the current page keeps its name and the spacing is tightened. Wide screens and
   the side bar (pb-vertical) are untouched. */
#dots.pagebar.pb-tight:not(.pb-vertical) { gap: 2px; padding: 3px; }
#dots.pagebar.pb-tight:not(.pb-vertical) .dot { padding: 0 9px; gap: 5px; max-width: none; }
#dots.pagebar.pb-tight:not(.pb-vertical) .dot:not(.on) .dot-ic + .dot-nm { display: none; } /* only when an icon stands in front of the name: a page without an icon keeps its name */
#dots.pagebar.pb-tight:not(.pb-vertical) .dot.on .dot-nm { max-width: none; font-size: 13px; overflow: visible; text-overflow: clip; }
#dots.pagebar.pb-tight:not(.pb-vertical) .page-all, #dots.pagebar.pb-tight:not(.pb-vertical) .page-pause { min-width: 30px; }
#dots.pagebar .page-all svg, #dots.pagebar .page-pause svg { width: 13px; height: 13px; }
body.controls-top #dots.pagebar:not(.pb-vertical) { bottom: auto; top: 6px; }
/* down the left or right edge: icon above a short name */
#dots.pagebar.pb-vertical {
  flex-direction: column; top: 50%; bottom: auto; left: 6px; right: auto; transform: translateY(-50%);
  max-width: none; max-height: calc(100vh - 12px);
}
body.pagebar-right #dots.pagebar.pb-vertical { left: auto; right: 6px; }
#dots.pagebar.pb-vertical .dot { flex-direction: column; justify-content: center; width: 64px; height: auto; min-height: 40px; padding: 6px 4px; gap: 3px; flex: 0 1 auto; }
#dots.pagebar.pb-vertical .dot-nm { max-width: 58px; font-size: 10.5px; }
/* always shown: the bar gets its own strip of the screen and the pages the rest */
body.pagebar-docked { --pb-h: 52px; --pb-w: 76px; }
body.pagebar-docked:not(.pagebar-left):not(.pagebar-right) #pager,
body.pagebar-docked:not(.pagebar-left):not(.pagebar-right) .page { height: calc(100vh - var(--pb-h)); }
body.pagebar-docked:not(.pagebar-left):not(.pagebar-right) .page { padding-bottom: 10px; }
body.pagebar-docked.controls-top:not(.pagebar-left):not(.pagebar-right) #pager { margin-top: var(--pb-h); }
body.pagebar-docked #dots.pagebar:not(.pb-vertical) {
  left: 0; right: 0; bottom: 0; transform: none; max-width: none; height: var(--pb-h); justify-content: center;
  border-radius: 0; border-width: 1px 0 0; padding: 0 8px;
}
body.pagebar-docked.controls-top #dots.pagebar:not(.pb-vertical) { top: 0; bottom: auto; border-width: 0 0 1px; }
body.pagebar-docked.pagebar-left #pager { margin-left: var(--pb-w); }
body.pagebar-docked.pagebar-left #pager, body.pagebar-docked.pagebar-right #pager { width: calc(100vw - var(--pb-w)); }
body.pagebar-docked.pagebar-left .page, body.pagebar-docked.pagebar-right .page { flex-basis: calc(100vw - var(--pb-w)); padding-bottom: 10px; }
body.pagebar-docked #dots.pagebar.pb-vertical {
  top: 0; bottom: 0; transform: none; max-height: none; width: var(--pb-w); justify-content: center; overflow-y: auto;
  border-radius: 0; left: 0; border-width: 0 1px 0 0;
}
body.pagebar-docked.pagebar-right #dots.pagebar.pb-vertical { left: auto; right: 0; border-width: 0 0 0 1px; }
.page-all {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: rgba(255, 255, 255, 0.5);
  padding: 3px 5px; margin: 0 2px 0 4px; min-width: 22px; min-height: 22px;
  border-radius: 999px; cursor: pointer; outline: none; touch-action: manipulation;
}
.page-all svg { width: 10px; height: 10px; fill: currentColor; pointer-events: none; }
.page-all:hover { color: rgba(255, 255, 255, 0.9); }
.page-all:focus-visible { box-shadow: 0 0 0 1.5px var(--accent, #fff); }
#dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.22); transition: width .25s, background .25s; }
#dots i.on { width: 16px; background: rgba(255, 255, 255, 0.7); }
#dots.paused { border-color: rgba(245, 158, 11, 0.55); background: rgba(20, 16, 8, 0.78); }
#dots.paused i.on { background: #f59e0b; }
.page-pause {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: rgba(255, 255, 255, 0.65);
  padding: 3px 5px; margin: -3px -4px -3px 0; min-width: 22px; min-height: 20px;
  border-radius: 999px; cursor: pointer; outline: none; touch-action: manipulation;
}
.page-pause::before { content: ''; position: absolute; top: -6px; right: -8px; bottom: -5px; left: 0; }
.page-pause svg { width: 10px; height: 10px; fill: currentColor; pointer-events: none; }
.page-pause .i-pause { display: block; }
.page-pause .i-play { display: none; }
.page-pause.on .i-pause { display: none; }
.page-pause.on .i-play { display: block; }
.page-pause:hover { color: rgba(255, 255, 255, 0.9); }
.page-pause:focus-visible { box-shadow: 0 0 0 1.5px #f59e0b; }
.page-pause.on { color: #f59e0b; }

#pagePauseOverlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 18;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
#pagePauseOverlay.show { opacity: 1; visibility: visible; }
.rot-overlay-icon {
  width: 76px; height: 76px; border-radius: 50%;
  background: rgba(18, 18, 22, .52);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, .18);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .12);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, .85); transform: scale(.84);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
#pagePauseOverlay.show .rot-overlay-icon { transform: scale(1); }
.rot-overlay-icon svg { width: 38px; height: 38px; fill: currentColor; }
body.night #pagePauseOverlay { display: none; }

#ptitle {
  position: fixed; left: 50%; top: 10px; transform: translate(-50%, -8px); z-index: 7;
  padding: 5px 14px; border-radius: 99px; font-size: 13px; font-weight: 600;
  background: rgba(20, 24, 30, .92); border: 1px solid var(--line);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#ptitle.on { opacity: 1; transform: translate(-50%, 0); }

#overview {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 15; padding: 12px var(--pad-r) 14px var(--pad-l);
  background: #06080b; display: flex; flex-direction: column; gap: 10px;
}
.ov-head { font-size: 15px; font-weight: 700; display: flex; align-items: baseline; gap: 4px; }
.ov-head small { font-size: 11.5px; font-weight: 400; color: var(--muted); margin-left: 8px; }
#ovGrid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 10px; overflow-y: auto; }
.ov-tile {
  display: flex; flex-direction: column; gap: 5px; padding: 7px; border-radius: 14px; min-height: 0;
  background: #10141a; border: 1px solid var(--line); text-align: start;
}
#ovPcs { margin-inline-start: auto; display: flex; gap: 6px; }
.ov-pc { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; }
.ov-pc.on { border-color: rgba(var(--ambient), .8); background: rgba(var(--ambient), .16); font-weight: 600; }
.w-pcswitch { padding: 9px 12px; display: flex; flex-direction: column; gap: 6px; }
.pcs-row { flex: 1; display: flex; flex-wrap: wrap; align-items: center; align-content: center; gap: 8px; min-height: 0; overflow: hidden; }
.pcs-row .ov-pc { font-size: 15px; padding: 8px 16px; }
.pcs-row .ov-pc:disabled { opacity: .5; }
.pcs-sub { color: var(--muted); font-size: 12px; }
.pcs-sub:empty { display: none; }
.ov-tile.on { border-color: rgba(var(--ambient), .8); box-shadow: 0 0 0 2px rgba(var(--ambient), .25); }
.ov-tile:active { transform: scale(.97); }
.ov-map { flex: 1; min-height: 28px; display: grid; grid-template-columns: repeat(var(--pb-cols, 12), 1fr); grid-template-rows: repeat(var(--pb-rows, 6), 1fr); gap: 2px; }
.ov-map span { background: rgba(255, 255, 255, .07); border-radius: 4px; display: grid; place-items: center; font-size: 11px; overflow: hidden; }
.ov-name { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-name b { color: var(--muted); font-weight: 600; }

#offline {
  position: fixed; top: 8px; right: var(--pad-r); z-index: 6; display: none;
  font-size: 11.5px; padding: 3px 10px; border-radius: 99px; background: rgba(239, 68, 68, .18); color: #fca5a5;
}
body.offline #offline { display: flex; align-items: center; gap: 5px; }
/* Wake-on-LAN: under the offline pill, only while the PC is unreachable (main.js shows it when the app can wake it) */
#wake { position: fixed; top: 38px; right: var(--pad-r); z-index: 6; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 280px; }
body.night #wake { z-index: 31; }
#wake[hidden] { display: none; }
#wake button { min-height: 44px; padding: 0 18px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .1); color: var(--text); font-size: 14px; font-weight: 600; }
#wake button:disabled { opacity: .6; }
/* opaque backing: the note is the one message that says what to check, and it can sit over the media widget's own text */
#wake .note { font-size: 12px; color: var(--text); text-align: start; padding: 8px 12px; border-radius: 12px; background: rgba(24, 24, 28, .96); border: 1px solid rgba(255, 255, 255, .16); }
#wake .note:empty { display: none; }
.ico { width: 1em; height: 1em; vertical-align: -0.15em; flex: none; }
.ico.m { margin-right: .35em; }

/* ---------- calm page switching ---------- */
#navCard {
  position: fixed; z-index: 18; left: 50%; bottom: 22px; transform: translate(-50%, 30px);
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: min(760px, 94vw);
  padding: 12px 14px 12px 12px; border-radius: 18px;
  background: rgba(16, 20, 26, .97); border: 1px solid rgba(var(--ambient), .45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .4);
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
}
#navCard.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.nv-ring { position: relative; width: 52px; height: 52px; flex: 0 0 auto; display: grid; place-items: center; }
.nv-ring svg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; transform: rotate(-90deg); }
.nv-ring circle { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 3.5; }
.nv-ring #nvRing { stroke: rgb(var(--ambient)); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; }
.nv-ring b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes nav-ring { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 100; } }
.nv-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nv-text b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-text span { font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-text small { font-size: 12px; color: var(--muted); opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nv-text small:empty { display: none; }
.nv-btn { flex: 0 0 auto; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; background: rgba(255, 255, 255, .08); }
.nv-btn.go { background: rgba(var(--ambient), .22); color: #fff; }
.nv-btn:active { transform: scale(.96); }
#navChip {
  position: fixed; z-index: 17; top: 8px; left: 50%; transform: translate(-50%, -40px);
  display: flex; align-items: center; gap: 2px; width: max-content; max-width: 86vw; border-radius: 999px;
  background: rgba(16, 20, 26, .95); border: 1px solid var(--line);
  opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s;
}
#navChip.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#navChip button { display: flex; align-items: center; gap: 7px; padding: 5px 6px 5px 12px; font-size: 12.5px; min-width: 0; }
#navChip b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#navChip small { color: var(--muted); white-space: nowrap; }
#ncX { padding: 5px 12px 5px 6px !important; color: var(--muted); }
body.night #navCard, body.night #navChip { display: none; }

.toast {
  position: fixed; z-index: 20; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  display: flex; flex-direction: column; align-items: center; max-width: 80vw;
  padding: 8px 16px; border-radius: 12px; font-size: 13px;
  background: rgba(20, 24, 30, .97); border: 1px solid var(--line);
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.toast b { font-size: 13.5px; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(239, 68, 68, .5); color: #fecaca; }
.toast.ok { border-color: rgba(34, 197, 94, .5); color: #bbf7d0; }
.toast.warn { border-color: rgba(245, 158, 11, .5); color: #fde68a; }

/* ---------- clock ---------- */
.w-clock { display: flex; flex-direction: column; justify-content: center; padding-inline-start: 2px; text-align: start; }
.w-clock.clock-centered { padding-inline: 2px; text-align: center; }
.w-clock.clock-centered > .status, .w-clock.clock-centered > .wx { align-self: center; width: fit-content; max-width: 100%; }
.status { font-size: 11.5px; font-size: clamp(10px, 5cqh, 12.5px); color: var(--muted); display: flex; align-items: center; gap: 5px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; }
.status .sep { color: var(--dim); }
.status .qm b { font-weight: 600; }
.status .qm .sep { margin-right: 5px; }
.status .smini { color: #fca5a5; font-weight: 600; }
.status .upd { color: #93c5fd; font-weight: 600; }
.dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--dim); transition: background .3s; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(34, 197, 94, .7); }
.dot.off { background: var(--err); }
.clock {
  font-weight: 200;
  font-size: calc(var(--tf, .6) * 24vw);
  line-height: .95; letter-spacing: -0.04em; margin-inline-start: -.03em;
  display: flex; align-items: flex-start;
}
[dir="rtl"] .w-clock > .clock { justify-content: flex-end; margin-inline-start: 0; }
.w-clock.clock-centered > .clock { justify-content: center; margin-inline-start: 0; }
/* Keep the time in reading order while the date and labels inherit the interface direction. */
[dir="rtl"] .clock, [dir="rtl"] #nClock { direction: ltr; unicode-bidi: isolate; }
@supports (font-size: 1cqh) {
  .clock { font-size: min(calc(var(--tf, .6) * 100cqh), 30cqw); }
  [dir="rtl"] .clock { font-size: min(calc(var(--tf, .6) * 100cqh), 25cqw); }
}
.clock .colon { opacity: .55; margin: 0 .01em; }
.clock .colon.dim { opacity: .2; }
.clock .sec { font-size: .2em; font-weight: 400; color: var(--muted); letter-spacing: 0; margin: .5em 0 0 .45em; }
.clock .sec:empty { display: none; }
.clock .ap { font-size: .2em; font-weight: 400; color: var(--muted); letter-spacing: 0; align-self: flex-end; margin: 0 0 .35em .3em; }
.clock .ap:empty { display: none; }
.date { font-size: 15px; font-size: clamp(11px, 7.5cqh, 19px); color: #c9d1db; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx { display: flex; align-items: center; gap: 8px; margin-top: 6px; margin-top: clamp(2px, 4cqh, 14px); min-width: 0; }
.wx-icon { font-size: 26px; font-size: clamp(18px, 13cqh, 34px); line-height: 1; }
.wx-temp { font-size: 26px; font-size: clamp(18px, 13cqh, 34px); font-weight: 300; letter-spacing: -0.02em; }
.wx-meta { display: flex; flex-direction: column; font-size: 11.5px; font-size: clamp(10px, 5.4cqh, 13px); line-height: 1.35; min-width: 0; }
.wx-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container (max-height: 80px) { .w-clock .date, .w-clock .wx-meta { display: none; } }

/* ---------- weather & forecast ---------- */
.w-weather { display: flex; align-items: center; padding: 0 clamp(8px, 6cqmin, 18px); }
.w-weather .wx { margin: 0; gap: 3cqw; }
.w-weather .wx-icon, .w-weather .wx-temp { font-size: min(40cqh, 18cqw); }
.w-weather .wx-meta { font-size: clamp(10px, 13cqh, 15px); }
.w-forecast { padding: 9px 11px; display: flex; flex-direction: column; gap: 4px; }
.fc { flex: 1; min-height: 0; display: flex; }
.fc-i { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-evenly; font-size: clamp(10px, 8cqh, 14px); }
.fc-t { color: var(--muted); font-size: .85em; white-space: nowrap; }
.fc-ic { font-size: 1.6em; line-height: 1.1; }
.fc-v { font-weight: 500; white-space: nowrap; }
.fc-v small { color: var(--muted); font-weight: 400; }
.fc-r { font-size: .78em; color: #7dd3fc; min-height: 1.1em; white-space: nowrap; }
.fc.vert { flex-direction: column; }
.fc.vert .fc-i { flex-direction: row; justify-content: space-between; gap: 6px; }
.fc.vert .fc-ic { font-size: 1.2em; }

/* ---------- media ---------- */
.w-media { padding: clamp(8px, 4cqh, 16px) clamp(10px, 3cqw, 18px); display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.m-top { display: flex; gap: clamp(8px, 3cqw, 18px); min-width: 0; min-height: 0; flex: 1; align-items: center; }
.art-wrap {
  position: relative; flex: 0 0 auto;
  height: min(58cqh, 34cqw); max-height: 100%; aspect-ratio: 1;
  border-radius: clamp(8px, 6cqh, 18px); overflow: hidden;
  background: linear-gradient(135deg, rgba(var(--ambient), .35), rgba(255, 255, 255, .04));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.art-wrap img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; }
.art-wrap img.on { opacity: 1; }
.art-ph { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; font-size: 34px; color: rgba(255, 255, 255, .5); }
.m-text { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.m-app { display: flex; align-items: center; gap: 5px; font-size: clamp(9px, 4.5cqh, 13px); letter-spacing: .12em; text-transform: uppercase; color: rgb(var(--ambient)); font-weight: 600; }
.m-swap { position: absolute; top: clamp(6px, 3cqh, 12px); inset-inline-end: clamp(8px, 2.5cqw, 14px); z-index: 1; display: inline-flex; font-size: 12px; padding: 2px; gap: 2px; border: 1px solid rgba(var(--ambient), .45); border-radius: 999px; background: rgba(255,255,255,.06); color: rgb(var(--ambient)); cursor: pointer; }
.m-swap[hidden] { display: none; }
.m-swap svg { width: 1.5em; height: 1.5em; padding: .25em; border-radius: 999px; fill: currentColor; opacity: .55; box-sizing: content-box; }
.m-swap .sw-pc { background: rgb(var(--ambient)); color: #000; opacity: 1; }
.m-swap.phone .sw-pc { background: none; color: inherit; opacity: .55; }
.m-swap.phone .sw-ph { background: rgb(var(--ambient)); color: #000; opacity: 1; }
.m-source-icon { display: inline-flex; flex: 0 0 auto; }
.m-source-icon:empty { display: none; }
.m-source-icon svg { width: 1.25em; height: 1.25em; display: block; }
.m-title { font-size: clamp(13px, 9cqh, 30px); font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m-artist { font-size: clamp(11px, 6cqh, 19px); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { position: relative; height: 18px; display: flex; align-items: center; touch-action: none; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.bar::before { content: ""; position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .12); }
.bar::after { content: ""; position: absolute; left: -6px; right: -6px; top: -12px; bottom: -12px; } /* a finger-sized target around the thin bar */
.fill { position: relative; height: 4px; border-radius: 2px; background: var(--text); width: 0; }
.fill::after { content: ""; position: absolute; right: -5px; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--text); transition: transform .12s; }
.bar.scrubbing .fill::after { transform: scale(1.8); box-shadow: 0 0 0 4px rgba(255, 255, 255, .18); }
.bar:focus-visible .fill::after { transform: scale(1.8); box-shadow: 0 0 0 4px rgba(255, 255, 255, .18); } /* its own rule: Chromium < 86 drops a rule it cannot parse */
/* the bubble with the time the song will continue from, over the thumb while the bar is held or focused */
.scrub-tip {
  position: absolute; bottom: 100%; left: clamp(24px, var(--tip, 0%), calc(100% - 24px)); transform: translate(-50%, -8px);
  padding: 3px 9px; border-radius: 9px; background: rgba(8, 10, 13, .88); border: 1px solid rgba(255, 255, 255, .14); color: var(--text);
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; z-index: 2;
}
.bar.scrubbing .scrub-tip { opacity: 1; }
.bar:focus-visible .scrub-tip { opacity: 1; }
.bar.scrubbing + .times .m-pos { color: var(--text); font-weight: 600; }
.times { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: -1px; }
.m-controls { display: flex; align-items: center; gap: 4px; }
.ic { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; transition: transform .12s, background .2s; }
.ic svg { width: 24px; height: 24px; fill: currentColor; }
.ic:active { transform: scale(.88); background: var(--card-hi); }
.ic.play { width: 50px; height: 50px; background: var(--text); color: #0b0d10; }
.ic.play svg { width: 26px; height: 26px; }
.ic.sm { width: 34px; height: 34px; }
.ic.sm svg { width: 20px; height: 20px; }
.i-pause, .playing .i-play { display: none; }
.playing .i-pause { display: block; }
.i-mute, .muted-on .i-vol { display: none; }
.muted-on .i-mute { display: block; color: var(--err); }
.vol { flex: 1; display: flex; align-items: center; gap: 4px; margin-left: 4px; min-width: 0; }
.vol-val { font-size: 11px; color: var(--muted); width: 22px; text-align: right; }
.volume-unavailable .volr, .w-volume.unavailable .vb { opacity: .35; pointer-events: none; }
.w-volume.unavailable .vb-v { color: var(--muted); }
input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; min-width: 0; height: 28px; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--text) var(--p, 50%), rgba(255, 255, 255, .14) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--text); margin-top: -6px; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.w-media.idle .m-progress, .w-media.idle .m-controls .ic:not(.play) { opacity: .35; }
.offline-msg {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  text-align: center; padding: 16px; background: rgba(6, 8, 11, .85); font-size: 12.5px; color: var(--muted);
}
.offline-msg b { font-size: 15px; color: var(--text); font-weight: 600; }
body.offline .offline-msg { display: flex; }
body.offline .w-media.phone-song .offline-msg { display: none; }
@container (max-height: 150px) { .w-media .m-progress { display: none; } }
@container (max-height: 110px) { .w-media .m-top { display: none; } .w-media { justify-content: center; } }
@container (max-width: 250px) { .w-media .vol { display: none; } }
@container (min-height: 230px) and (min-width: 420px) { .w-media .ic.play { width: 62px; height: 62px; } .w-media .ic { width: 52px; height: 52px; } }

/* Preserve physical transport order and isolate measurements from surrounding RTL labels. */
[dir="rtl"] :where(.m-controls, .t-val, .g-val, .s-main, .s-main .multi b, .gd-big, .m-row > span:last-child, .wx-temp, .fc-v, .wc-t) {
  direction: ltr;
  unicode-bidi: isolate;
}
[dir="rtl"] :is(.t-val, .gd-temp) { text-align: right; }
[dir="rtl"] .s-main { justify-content: flex-end; }

/* ---------- metric tile ---------- */
.w-stat { padding: clamp(5px, 9cqh, 10px) clamp(8px, 6cqw, 12px); }
.w-stat canvas { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 52%; opacity: .5; }
.w-stat .t-val, .w-stat .t-sub { text-shadow: 0 1px 6px rgba(0, 0, 0, .9); }
.t-label { position: relative; font-size: clamp(9px, 12cqh, 11px); letter-spacing: .14em; color: var(--c); font-weight: 700; white-space: nowrap; }
.t-val { position: relative; margin-top: 1px; white-space: nowrap; }
.t-val b { font-size: clamp(16px, 30cqh, 40px); font-weight: 500; letter-spacing: -0.02em; }
.t-val small { font-size: clamp(10px, 14cqh, 15px); color: var(--muted); margin-left: 2px; }
.t-sub { position: relative; font-size: clamp(9.5px, 13cqh, 13px); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container (max-height: 60px) { .w-stat .t-sub { display: none; } }

/* ---------- gauge (also pomodoro and pushed gauges) ---------- */
.w-gauge, .w-pomodoro { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px; gap: 1px; }
.g-dial { position: relative; height: min(66cqh, 88cqw); aspect-ratio: 1; flex: 0 0 auto; }
.g-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.g-dial .bg, .q-dial .bg { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 9; }
.g-dial .fg, .q-dial .fg { fill: none; stroke: var(--qc, var(--q)); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .8s ease; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--qc, var(--q)) 50%, transparent)); }
.g-val { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; font-size: min(15cqh, 22cqw); font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; }
.g-val small { font-size: .5em; color: var(--muted); margin-left: 1px; }
.g-label { font-size: clamp(9px, 6cqh, 13px); letter-spacing: .12em; font-weight: 700; color: var(--q, var(--text)); white-space: nowrap; }
.g-sub { font-size: clamp(9px, 5.4cqh, 12px); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-align: center; }
@container (max-height: 120px) { .w-gauge .g-sub { display: none; } .w-gauge .g-dial { height: 72cqh; } }

.w-water-intake { padding: 9px 12px; display: grid; align-content: start; gap: 4px; }
.water-total { font-size: clamp(12px, 10cqh, 24px); font-variant-numeric: tabular-nums; }
.water-remaining { color: var(--muted); font-size: 11px; }
.water-progress { width: 100%; height: 8px; accent-color: #38bdf8; }
.water-quick, .water-form { display: flex; gap: 4px; min-width: 0; }
.water-form > * { flex: 1; }
.water-custom { width: 0; min-width: 36px; min-height: 26px; border: 1px solid var(--border);
  border-radius: 6px; padding-inline: 5px; color: inherit; background: var(--card-bg, transparent); }
.w-water-intake .chip-btn { min-height: 26px; line-height: 1; margin: 0; padding: 3px 5px; }
@container (max-height: 115px) {
  .w-water-intake { padding: 5px 7px; gap: 2px; }
  .w-water-intake .chip-btn, .water-custom { min-height: 20px; }
}

/* ---------- chart & meters ---------- */
.w-chart, .w-meters { padding: 9px 12px 0; display: flex; flex-direction: column; }
.w-meters { padding-bottom: 10px; }
.s-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.s-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--c); white-space: nowrap; }
.s-name { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-main { display: flex; align-items: baseline; gap: 3px; margin-top: 1px; min-width: 0; }
.s-main b { font-size: clamp(18px, 15cqh, 34px); font-weight: 500; letter-spacing: -0.02em; }
.s-main small { font-size: 12.5px; color: var(--muted); }
.s-main .multi { font-size: 12px; margin-right: 12px; white-space: nowrap; }
.s-main .multi b { font-size: clamp(13px, 10cqh, 20px); font-weight: 600; }
.chips { margin-inline-start: auto; display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; overflow: hidden; }
.chip { font-size: 11px; padding: 3px 7px; border-radius: 8px; background: rgba(255, 255, 255, .06); color: #cdd5df; white-space: nowrap; }
.w-chart canvas { flex: 1; width: calc(100% + 24px); margin: 4px -12px 0; min-height: 0; }
.chart-missing { margin-block: 2px 5px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.meters { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; flex: 1; justify-content: space-evenly; min-height: 0; }
.m-row { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.m-row span:last-child { color: #d5dce5; }
.track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.track i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--c, var(--cpu)); transition: width .6s ease; }
.disks { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; }

/* ---------- AI quotas ---------- */
.w-quotas { background: none; border: 0; }
.q-grid { height: 100%; display: flex; gap: 10px; }
.q-card {
  position: relative; display: flex; flex-direction: column; padding: 10px 14px; min-width: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px;
  background: radial-gradient(90% 70% at 50% 0%, color-mix(in srgb, var(--q) 13%, transparent), transparent 70%), var(--card);
}
.q-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.q-logo { font-size: 17px; color: var(--q); line-height: 1; align-self: center; }
.q-name { font-size: 15px; font-weight: 700; }
.q-plan { font-size: 11px; color: var(--q); background: color-mix(in srgb, var(--q) 15%, transparent); padding: 2px 8px; border-radius: 7px; font-weight: 600; white-space: nowrap; }
.q-upd { margin-inline-start: auto; font-size: 11px; color: var(--dim); white-space: nowrap; }
.q-rings { flex: 1; display: flex; justify-content: space-around; align-items: center; gap: 8px; min-height: 0; }
.q-ring { display: flex; flex-direction: column; align-items: center; min-width: 0; flex: 1; }
.q-dial { position: relative; width: min(50cqh, 170px); max-width: 100%; aspect-ratio: 1; }
.q-dial svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.q-dial .pace { stroke: rgba(255, 255, 255, .85); stroke-width: 2.5; stroke-linecap: round; }
.q-pct { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; font-size: min(10cqh, 28px); font-weight: 500; letter-spacing: -0.02em; }
.q-pct small { font-size: .45em; color: var(--muted); margin-left: 1px; }
.q-label { font-size: 12px; font-weight: 600; margin-top: 5px; text-align: center; white-space: nowrap; }
.q-left { font-size: 11px; font-weight: 650; color: #86efac; text-align: center; }
.q-reset { font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; }
.q-pace { font-size: 11px; margin-top: 2px; text-align: center; white-space: nowrap; color: var(--muted); }
.q-pace.fast { color: #fbbf24; }
.q-pace.over { color: #f87171; }
.q-pace.calm { color: #86efac; }
/* A card with two or three rings (Antigravity has three): the columns can be narrower than their labels, and a column with more
   lines (reset time, pace, "% left") used to push its ring up or down against the others. Top-align the rings, centre the group in
   the card, and let the labels wrap inside their column. The four-or-more grid (.q-rings-grid) keeps its own ellipsis rules. */
.q-rings:not(.q-rings-grid) { flex: 0 1 auto; margin-block: auto; align-items: flex-start; }
.q-rings:not(.q-rings-grid) .q-ring { flex: 1 1 0; }
.q-rings:not(.q-rings-grid) :is(.q-label, .q-left, .q-reset, .q-pace) { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.q-foot { font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }
.q-details { display: grid; gap: 2px; padding: 5px 0; border-top: 1px solid var(--line); font-size: 10.5px; min-width: 0; }
.q-detail { display: flex; justify-content: space-between; gap: 6px; min-width: 0; color: var(--muted); }
.q-detail strong { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-breakdown { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-alert { color: #f87171; font-weight: 700; }
.q-foot .q-err { color: #fca5a5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-ov-hero { flex: 1; display: flex; justify-content: space-around; align-items: center; gap: 12px; min-height: 0; padding: 6px 0; }
.q-ov-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.q-ov-lbl { font-size: 11px; color: var(--muted); white-space: nowrap; }
.q-ov-val { font-size: clamp(18px, 8cqh, 26px); font-weight: 600; color: var(--text); white-space: nowrap; }
@container (max-height: 200px) { .q-reset, .q-pace, .q-foot, .q-details { display: none; } .q-dial { width: min(58cqh, 124px); } }
@container (max-width: 420px) { .q-grid { flex-direction: column; } }

/* ---------- sessions & GitHub ---------- */
.w-sessions, .w-github { padding: 10px 12px; display: flex; flex-direction: column; }
.w-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; min-width: 0; }
.w-sum { font-size: 11.5px; color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-list { flex: 1; display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); grid-auto-rows: 44px; gap: 6px 8px; overflow-y: auto; align-content: start; }
.sess { display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 10px; background: rgba(255, 255, 255, .035); border: 1px solid transparent; min-width: 0; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.sess:focus-visible { outline: 2px solid var(--accent); }
.sess .st { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: var(--dim); }
.sess.busy .st { background: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.sess.shell .st { background: #60a5fa; box-shadow: 0 0 6px #60a5fa; }
.sess.waiting { border-color: rgba(239, 68, 68, .45); background: rgba(239, 68, 68, .1); }
.sess.waiting .st { background: #ef4444; box-shadow: 0 0 10px #ef4444; }
.sess.idle { opacity: .62; }
/* The pulses are not CSS animations: a running animation makes the browser draw a frame on every display refresh (120 a
   second on a 120 Hz phone) for as long as it is on screen. main.js flips beat-2 .. beat-4 on <html> instead, from its 250 ms tick
   and only while something that pulses is shown, so the panel draws a frame only when a pulse changes. The beat has two
   steps, a little less smooth than a fade and far cheaper. */
html.beat-3 .sess.busy .st, html.beat-4 .sess.shell .st, html.beat-2 .sess.waiting .st { opacity: .35; }
.sess .tl { font-size: 12px; width: 14px; text-align: center; flex: 0 0 14px; }
.sess .tl.claude { color: #d97757; }
.sess .tl.codex { color: #e5e7eb; }
.sess .tl.cursor { color: #67e8f9; }
.sess .tl.opencode { color: #a78bfa; }
.sess .tl.antigravity { color: #38bdf8; }
.sess .tl.grok { color: #f8fafc; }
.sess-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sess .nm { min-width: 0; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess-meta { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess .ds { font-size: 11px; color: var(--muted); white-space: nowrap; text-align: right; }
.sess.waiting .ds { color: #fca5a5; }
.sess.busy .ds { color: #fcd34d; }
.session-backdrop { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 22; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(3, 5, 9, .78); }
.session-panel { width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: #1b1f26; box-shadow: 0 20px 60px #0009; }
.session-panel-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 6px 0; background: #1b1f26; color: var(--muted); font-size: 12px; }
.session-panel h2 { margin: 6px 0 14px; font-size: 20px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.session-close { border: 0; background: transparent; color: var(--text); font-size: 20px; padding: 2px 8px; cursor: pointer; }
.session-detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 12px; }
.session-detail-row span { color: var(--muted); }
.session-detail-row strong { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.session-note { margin: 12px 0 0; color: var(--dim); font-size: 11px; }
.session-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.session-cell { min-width: 0; padding: 6px 9px; box-shadow: 0 0 0 .5px var(--line); }
.session-cell span { display: block; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-cell strong { display: block; margin-top: 1px; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
@media (max-width: 420px) { .session-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.session-conv { margin-top: 12px; border-top: 1px solid var(--line); }
.conv-h { margin: 12px 0 6px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.conv-step { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 12px; }
.conv-step .cs-t { font-weight: 600; white-space: nowrap; }
.conv-step .cs-d { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-step .cs-a { color: var(--dim); font-size: 11px; white-space: nowrap; }
.conv-step.on .cs-a { color: #d97757; }
.conv-list { max-height: 42vh; overflow-y: auto; padding-right: 4px; }
.conv-msg { margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; background: #ffffff0d; font-size: 12px; line-height: 1.4; }
.conv-msg.assistant { background: #d977571a; }
.conv-who { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.conv-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.conv-text.clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.conv-toggle { width: 100%; margin-top: 4px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; }
.gh-bell { font-size: 11.5px; padding: 2px 8px; border-radius: 8px; background: rgba(255, 255, 255, .08); white-space: nowrap; }
.gh-sec { display: flex; justify-content: space-between; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 3px 0; font-weight: 600; }
.gh-sec b { color: var(--text); }
.gh-list { display: flex; flex-direction: column; gap: 3px; margin-bottom: 5px; }
.gh-pr { display: flex; align-items: center; gap: 7px; font-size: 12px; min-width: 0; height: 22px; }
.gh-pr .ci { width: 14px; flex: 0 0 14px; text-align: center; font-size: 11px; font-weight: 700; }
.gh-pr .ci.SUCCESS { color: #4ade80; }
.gh-pr .ci.FAILURE, .gh-pr .ci.ERROR { color: #f87171; }
.gh-pr .ci.PENDING, .gh-pr .ci.EXPECTED { color: #fbbf24; }
.gh-pr .ci.none { color: var(--dim); }
.gh-pr .rp { color: var(--muted); white-space: nowrap; flex: 0 0 auto; max-width: 42%; overflow: hidden; text-overflow: ellipsis; }
.gh-pr .tt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gh-pr .rv { font-size: 10px; padding: 1px 5px; border-radius: 5px; flex: 0 0 auto; }
.gh-pr .rv.APPROVED { background: rgba(74, 222, 128, .15); color: #86efac; }
.gh-pr .rv.CHANGES_REQUESTED { background: rgba(248, 113, 113, .15); color: #fca5a5; }
.gh-pr.draft .tt { color: var(--muted); font-style: italic; }
.gh-err { font-size: 11px; color: #fca5a5; margin-top: auto; }

/* ---------- processes ---------- */
.w-processes { background: none; border: 0; display: flex; flex-direction: column; gap: 8px; }
.p-head { display: flex; align-items: center; gap: 12px; height: 30px; flex: 0 0 auto; min-width: 0; }
.p-sum { font-size: 12px; color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg { display: flex; background: rgba(255, 255, 255, .06); border-radius: 10px; padding: 3px; }
.seg button { font-size: 12px; font-weight: 600; padding: 5px 14px; border-radius: 8px; color: var(--muted); }
.seg button.on { background: rgba(255, 255, 255, .14); color: var(--text); }
.p-grid { flex: 1; display: grid; gap: 7px 10px; min-height: 0; }
.proc { position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); min-width: 0; }
.proc:active { background: var(--card-hi); }
.p-ico { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #0b0d10; position: relative; overflow: hidden; }
.p-ico img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; object-fit: contain; background: transparent; }
.p-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.p-title { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-title .p-count { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.p-title .p-lock { font-size: 10px; margin-left: 4px; opacity: .6; }
.p-bar { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.p-bar i { display: block; height: 100%; width: 0; background: #f472b6; border-radius: 2px; transition: width .5s ease; }
.p-nums { text-align: right; flex: 0 0 auto; display: flex; flex-direction: column; line-height: 1.15; }
.p-nums b { font-size: 14px; font-weight: 600; }
.p-nums small { font-size: 11px; color: var(--muted); }

/* instance sheet: pick one process or all of them */
.p-sheet {
  position: fixed; z-index: 12; top: 10px; right: var(--pad-r); bottom: 18px; left: var(--pad-l);
  display: flex; flex-direction: column; padding: 12px 14px;
  background: #0c0e12; border: 1px solid var(--line); border-radius: 18px; isolation: isolate;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
}
.ps-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ps-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ps-title b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-title small { font-size: 12px; color: var(--muted); }
.ps-btn { font-size: 13px; font-weight: 600; padding: 8px 14px; border-radius: 10px; background: rgba(255, 255, 255, .08); white-space: nowrap; }
.ps-btn.danger { background: rgba(239, 68, 68, .18); color: #fca5a5; }
.ps-btn.armed { background: var(--err); color: #fff; }
.ps-btn:disabled { opacity: .35; }
/* lists scroll up and down; a sideways swipe on them goes on to the pager and turns the page (#445) */
.ps-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; touch-action: pan-x pan-y; }
.pi { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 11px; background: rgba(255, 255, 255, .04); min-height: 46px; }
.pi .pid { font-size: 11px; color: var(--muted); flex: 0 0 64px; }
.pi .lbl { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pi .lbl b { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi .lbl b.sess { color: #f5a37f; }
.pi .lbl small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pi .num { text-align: right; font-size: 11px; line-height: 1.25; color: var(--muted); flex: 0 0 auto; }
.pi .num b { font-size: 13px; color: var(--text); }
.pi .ps-btn { padding: 7px 12px; }

/* ---------- shortcuts & big button ---------- */
.w-shortcuts { background: none; border: 0; }
.deck-grid { height: 100%; display: grid; gap: 8px; }
.key {
  position: relative; min-width: 0; min-height: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--k) 22%, transparent), rgba(255, 255, 255, .03));
  border: 1px solid color-mix(in srgb, var(--k) 35%, transparent);
  transition: transform .1s, filter .2s; overflow: hidden;
}
.key:active { transform: scale(.94); filter: brightness(1.3); }
.key .k-icon { font-size: clamp(16px, 7cqmin, 30px); line-height: 1; }
.key .k-icon.k-icon-img img { display: block; width: 24px; height: 24px; width: clamp(16px, 7cqmin, 30px); height: clamp(16px, 7cqmin, 30px); object-fit: contain; border-radius: 6px; }
.key .k-label { font-size: clamp(10px, 3.6cqmin, 14px); font-weight: 500; color: #e5e9ef; max-width: 92%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-button .key .k-icon { font-size: min(40cqh, 30cqw); }
.w-button .key .k-icon.k-icon-img img { width: 40px; height: 40px; width: min(40cqh, 30cqw); height: min(40cqh, 30cqw); }
.w-button .key .k-label { font-size: clamp(10px, 15cqh, 18px); }
/* Per-shortcut icon size (settings > Shortcuts > Icon size): medium, large, and max (the icon fills the key). The key
   is its own size container, so every size is measured against the key and not the widget around it: the sizes
   always grow in that order and never overflow a short key. Only an emoji and an uploaded picture (.k-icon-up) are
   sized; a program's own icon keeps the size of an unsized key. Each size has a px value first for WebViews older than
   Chromium 105 (no container query units), where the rule after it is dropped. */
.key.k-isz-m, .key.k-isz-l, .key.k-isz-max { container-type: size; }
/* A sized key is a container, so the cq units in the rules every key shares would measure the key instead of the widget:
   in a Shortcuts grid the name and a program's icon would shrink next to unsized neighbours. The grid computes the
   widget-relative sizes once (a registered length is resolved where it is set) and a sized key reads them back. */
@property --k-lbl { syntax: '<length>'; inherits: true; initial-value: 14px; }
@property --k-img { syntax: '<length>'; inherits: true; initial-value: 30px; }
.deck-grid { --k-lbl: clamp(10px, 3.6cqmin, 14px); --k-img: clamp(16px, 7cqmin, 30px); }
.deck-grid .key.k-isz-m .k-label, .deck-grid .key.k-isz-l .k-label, .deck-grid .key.k-isz-max .k-label { font-size: var(--k-lbl); }
.deck-grid .key.k-isz-m .k-icon.k-icon-img:not(.k-icon-up) img, .deck-grid .key.k-isz-l .k-icon.k-icon-img:not(.k-icon-up) img,
.deck-grid .key.k-isz-max .k-icon.k-icon-img:not(.k-icon-up) img { width: var(--k-img); height: var(--k-img); }
/* the inline emoji icon carries a trailing margin (.ico.m) meant for text; on a sized key it would push it off-centre */
.key.k-isz-m .k-icon .ico, .key.k-isz-l .k-icon .ico, .key.k-isz-max .k-icon .ico { margin: 0; }
.key.k-isz-m .k-icon { font-size: 36px; font-size: min(46cqh, 50cqw); }
.key.k-isz-m .k-icon.k-icon-up img { width: 36px; height: 36px; width: min(46cqh, 50cqw); height: min(46cqh, 50cqw); }
.key.k-isz-l .k-icon { font-size: 44px; font-size: min(56cqh, 62cqw); }
.key.k-isz-l .k-icon.k-icon-up img { width: 44px; height: 44px; width: min(56cqh, 62cqw); height: min(56cqh, 62cqw); }
/* max: the icon takes whatever the label leaves (about 24px of height; the container's size already excludes the padding),
   and is never smaller than "large", even on a very short key */
.key.k-isz-max { padding: 0; } /* a padding here would shrink the size the cq units measure, and "large" has none */
.key.k-isz-max .k-icon { flex: 1 1 0; min-height: 44px; min-height: min(56cqh, 62cqw); padding: 0; width: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; line-height: 1; font-size: 56px; font-size: max(min(56cqh, 62cqw), min(calc(100cqh - 24px), 100cqw)); }
.key.k-isz-max .k-icon.k-icon-up img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
/* with the picture as the key's background the icon is hidden, so the label keeps the size it has on any Big button */
.key.k-isz-max:not(.k-cover) .k-label { flex: 0 0 auto; font-size: 12px; }
.deck-grid .key.k-isz-max:not(.k-cover) .k-label { font-size: var(--k-lbl); }
.key.k-isz-max.k-cover { padding: 0 0 4px; padding: 0 0 7cqh; }
/* Big button with "fill with the picture": the picture covers the key, the label sits on a shade at the bottom. */
/* padding in % follows the width, so a wide, short key would lose its label: the inset follows the height (cqh) */
.key.k-cover { justify-content: flex-end; padding-bottom: 4px; padding-bottom: 7cqh; }
.key.k-cover .k-icon { display: none; }
.key.k-cover .k-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.key.k-cover .k-shade { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(to top, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0) 55%); pointer-events: none; }
.key.k-cover .k-label { position: relative; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); color: #fff; }
.key.k-cover::before, .key.k-cover::after { z-index: 1; }
/* a dark ring keeps the toggle dot visible on a light picture */
.key.k-cover.toggle::before { box-shadow: 0 0 0 2px rgba(0, 0, 0, .55); }
.key.k-cover.toggle.on::before { box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), 0 0 9px #4ade80; }
/* Big button without its label: the icon is centred alone, and a filled key needs no shade for the text. */
.key.k-nolabel .k-label, .key.k-nolabel .k-shade { display: none; }
.key::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow .2s; }
.key.ok::after { box-shadow: inset 0 0 0 2px var(--ok); }
.key.err::after { box-shadow: inset 0 0 0 2px var(--err); }
.key.busy { opacity: .6; }
.key.toggle::before { content: ""; position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .16); transition: background .2s, box-shadow .2s; }
.key.toggle.on::before { background: #4ade80; box-shadow: 0 0 9px #4ade80; }
.key.toggle.on { filter: brightness(1.18) saturate(1.2); }

/* ---------- world clocks ---------- */
.w-worldclock { padding: 6px 4px; }
.wc-row { height: 100%; display: flex; }
.wc { flex: 1; min-width: 0; container-type: inline-size; display: flex; flex-direction: column; align-items: center; justify-content: center; border-left: 1px solid var(--line); }
.wc:first-child { border-left: 0; }
.wc-n { font-size: clamp(9.5px, 10cqh, 13px); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 95%; }
.wc-t { font-size: min(36cqh, 36cqw); font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; }
.wc-ap { font-size: .42em; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.wc-row.h12 .wc-t { font-size: min(36cqh, 28cqw); }
.wc-s { font-size: clamp(9px, 9cqh, 12px); color: var(--dim); white-space: nowrap; }
.wc-row.vert { flex-direction: column; }
.wc-row.vert .wc { flex-direction: row; justify-content: space-between; padding: 0 10px; border-left: 0; border-top: 1px solid var(--line); gap: 8px; }
.wc-row.vert .wc:first-child { border-top: 0; }
.wc-row.vert .wc-t { font-size: clamp(14px, 9cqh, 30px); order: 2; }
.wc-row.vert .wc-s { display: none; }

/* ---------- calendar ---------- */
.w-calendar { padding: 9px 10px; display: flex; flex-direction: column; gap: 4px; }
.cal { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: clamp(10px, 6cqh, 15px); }
.cal-h { font-size: .78em; color: var(--muted); font-weight: 600; }
.cal-d { display: grid; place-items: center; border-radius: 8px; }
.cal-d.out { color: var(--dim); opacity: .5; }
.cal .we { color: #fca5a5; }
.cal-d.today { background: rgb(var(--ambient)); color: #06080b; font-weight: 700; }

/* ---------- pomodoro ---------- */
.w-pomodoro { --q: #ef4444; }
.w-pomodoro.brk { --q: #22c55e; }
.w-pomodoro.long { --q: #38bdf8; }
.w-pomodoro .g-dial { height: min(52cqh, 80cqw); }
.w-pomodoro:not(.run) .g-val { color: var(--muted); }
.pomo-btns { display: flex; gap: 8px; margin-top: 4px; }
.pb { width: clamp(30px, 14cqh, 46px); height: clamp(30px, 14cqh, 46px); border-radius: 50%; background: rgba(255, 255, 255, .08); font-size: clamp(13px, 6cqh, 19px); }
.pb.main { background: var(--q); color: #06080b; }
.pb:active { transform: scale(.9); }
@container (max-height: 160px) { .w-pomodoro .g-sub { display: none; } }

/* ---------- focus history (#350) ---------- */
.w-focushistory { --q: #ef4444; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 10px; }
.w-focushistory .fh-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.w-focushistory .fh-total { flex-shrink: 0; margin-left: auto; color: var(--text); letter-spacing: 0; text-transform: none; font-weight: 600; }
.fh-line { position: relative; flex: 1; min-height: 0; color: var(--q); cursor: pointer; }
.fh-plot { position: absolute; inset: 0; }
.fh-line svg { display: block; width: 100%; height: 100%; overflow: visible; }
.fh-guide { position: absolute; top: 0; bottom: -4px; width: 1px; background: var(--muted); opacity: .7; pointer-events: none; }
.fh-tip { position: absolute; top: 0; transform: translateX(-50%); padding: 2px 8px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); color: var(--text); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.fh-days .sel { color: var(--text); font-weight: 700; }
.fh-days { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; color: var(--muted); cursor: pointer; }
.fh-days button { margin: 0; padding: 0; min-width: 0; border-radius: 4px; cursor: inherit; }
.fh-days button:focus-visible { outline: 2px solid var(--q); outline-offset: 1px; }
.fh-days .today { color: var(--q); font-weight: 700; }
/* a short widget has no room for the weekdays: they stay for the keyboard, out of sight and out of the finger's way, and
   show over the chart's foot while one of them has the focus */
@container (max-height: 90px) {
  .w-focushistory .fh-days { position: absolute; left: 14px; right: 14px; bottom: 6px; opacity: 0; pointer-events: none; }
  .w-focushistory .fh-days:focus-within { opacity: 1; background: var(--bg); border-radius: 4px; }
}
@container (max-width: 260px) { .w-focushistory .fh-days { font-size: 9px; } .w-focushistory .w-title { letter-spacing: .06em; } }

/* ---------- countdown ---------- */
.w-countdown { padding: 8px 12px; display: flex; flex-direction: column; justify-content: center; }
.cd-l { font-size: clamp(10px, 11cqh, 14px); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-v { font-size: min(38cqh, 17cqw); font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; }
.cd-s { font-size: clamp(9.5px, 10cqh, 13px); color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-countdown.past .cd-v { color: #86efac; }

/* ---------- note, label ---------- */
.w-note {
  border-radius: 14px; padding: clamp(8px, 7cqmin, 16px);
  background: linear-gradient(160deg, color-mix(in srgb, var(--n) 30%, #10131a), color-mix(in srgb, var(--n) 14%, #0b0d12));
  border: 1px solid color-mix(in srgb, var(--n) 40%, transparent);
}
.note-t { white-space: pre-wrap; font-size: clamp(11px, calc(var(--nf) * 1cqmin), 44px); line-height: 1.3; color: color-mix(in srgb, var(--n) 25%, #fff); overflow: hidden; height: 100%; }
.w-label { display: flex; align-items: center; padding: 0 4px; }
.w-pagebuttons { display: flex; flex-direction: column; gap: 4px; }
.pgb { flex: 1; min-height: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 56px), 1fr)); grid-auto-rows: minmax(0, 1fr); container-type: size; }
.pgb-b {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 28px; padding: 4px 8px;
  border-radius: clamp(10px, 7cqmin, 16px); border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; touch-action: manipulation; container-type: inline-size;
}
.pgb-b.on { border-color: color-mix(in srgb, var(--accent, #fff) 70%, transparent); background: color-mix(in srgb, var(--accent, #2dd4bf) 18%, transparent); }
.pgb-b:active { transform: scale(0.97); }
.pgb-i { font-size: 18px; line-height: 1; }
.pgb-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* a narrow button keeps its icon only (when it has one) */
@container (max-width: 84px) { .pgb-i + .pgb-t { display: none; } }
.lbl-t { font-size: min(55cqh, 12cqw); font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- command ---------- */
.w-command { padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; --c: #38bdf8; }
.w-command.bad { --c: #f87171; }
.cmd-o { flex: 1; min-height: 0; overflow: hidden; white-space: pre; font: 11.5px/1.35 "Roboto Mono", monospace; color: #d5dce5; }
.cmd-o.big { display: flex; align-items: center; white-space: nowrap; font: 300 min(42cqh, 14cqw)/1 Roboto, sans-serif; letter-spacing: -0.02em; color: var(--text); }
.w-command.bad .cmd-o { color: #fca5a5; }
.cmd-f { font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container (max-height: 70px) { .w-command .cmd-f { display: none; } }

/* ---------- pushed value, notifications ---------- */
.w-push { padding: 9px 12px; display: flex; flex-direction: column; gap: 3px; }
.w-push .w-title { color: var(--c, var(--muted)); }
.push-empty { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; color: var(--muted); font-size: 12px; }
.push-empty code { font: 10.5px "Roboto Mono", monospace; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.push-big { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.pv { font-size: min(42cqh, 20cqw); font-weight: 400; letter-spacing: -0.02em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c, var(--text)); }
.pv small { font-size: .45em; color: var(--muted); margin-left: 3px; }
.ps { font-size: clamp(10px, 10cqh, 14px); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.push-big .track { margin-top: 4px; }
.push-gauge { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.push-gauge .g-dial { height: min(70cqh, 80cqw); }
.push-list, .inbox { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin-top: 3px; touch-action: pan-x pan-y; }
.pl-i { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, .035); border-left: 3px solid var(--lc, transparent); }
.pl-l { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-v { color: var(--lc, var(--muted)); white-space: nowrap; font-weight: 600; }
.w-inbox { padding: 9px 12px; display: flex; flex-direction: column; }
.ib-i { padding: 5px 9px; border-radius: 9px; background: rgba(255, 255, 255, .035); border-left: 3px solid var(--lc); }
.ib-h { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.ib-h b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-h span { font-size: 10.5px; color: var(--dim); white-space: nowrap; }
.ib-t { font-size: 11.5px; color: var(--muted); }

/* ---------- analog clock ---------- */
.w-analog { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.analog { width: min(100cqh, 100cqw); aspect-ratio: 1; flex: 0 1 auto; min-height: 0; }
.w-analog:has(.an-l) .analog { width: min(88cqh, 100cqw); }
.analog .face { fill: rgba(255, 255, 255, .035); stroke: var(--line); stroke-width: .8; }
.analog .tk { stroke: rgba(255, 255, 255, .25); stroke-width: .6; stroke-linecap: round; }
.analog .tk.b { stroke: rgba(255, 255, 255, .7); stroke-width: 1.6; }
.analog text { fill: var(--muted); font-size: 8px; text-anchor: middle; font-weight: 500; }
.analog .hh { stroke: var(--text); stroke-width: 3.4; stroke-linecap: round; }
.analog .mh { stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; }
.analog .sh { stroke: rgb(var(--ambient)); stroke-width: .9; stroke-linecap: round; }
.analog .hub { fill: rgb(var(--ambient)); }
.an-l { font-size: clamp(10px, 6cqh, 14px); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
@container (max-height: 140px) { .an-l { display: none; } }

/* ---------- time progress ---------- */
.w-progress { padding: 9px 12px; display: flex; flex-direction: column; gap: 4px; --c: #a78bfa; }
.pr-list { flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; min-height: 0; }

/* ---------- stopwatch, timer, counter ---------- */
.w-stopwatch, .w-timer, .w-counter { padding: 9px 12px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.w-stopwatch .w-title, .w-timer .w-title, .w-counter .w-title { align-self: stretch; }
.sw-t { font-size: min(30cqh, 15cqw); font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; color: var(--muted); }
.w-stopwatch.run .sw-t { color: var(--text); }
.w-stopwatch { --q: #22c55e; }
.sw-laps { align-self: stretch; overflow: hidden; display: flex; flex-direction: column; gap: 2px; min-height: 0; flex: 1; }
.sw-lap { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); padding: 1px 6px; }
.w-timer { justify-content: space-between; }
.w-timer .g-dial { height: min(38cqh, 60cqw); flex: 0 1 auto; min-height: 0; }
.w-timer:not(.run) .g-val { color: var(--muted); }
.tm-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.chip-btn { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 9px; background: rgba(255, 255, 255, .08); }
.chip-btn:active { background: var(--q); color: #06080b; }
.ct-n { flex: 1; display: flex; align-items: center; font-size: min(48cqh, 30cqw); font-weight: 300; color: var(--q); line-height: 1; }

.timer-layout { display: contents; }
@container (min-aspect-ratio: 3/2) {
  .timer-layout {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: repeat(3, auto);
    align-content: center;
    align-items: center;
    justify-items: center;
    column-gap: 6px;
  }
  .timer-layout > * { grid-column: 1; }
  .timer-layout > :is(.pomo-btns, .tm-btns) {
    grid-area: 1 / 2 / span 3;
    flex-direction: column;
    margin: 0;
    gap: 3px;
  }
  .timer-layout > .tm-btns.presets {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(3, auto);
  }
  .timer-layout .pb { width: min(20cqh, 42px); height: min(20cqh, 42px); }
  .timer-layout .chip-btn { padding: 2px 4px; }
  .w-timer .timer-layout .g-dial { height: min(60cqh, 45cqw); }
  .timer-layout > :is(.w-title, .sw-laps) { justify-self: stretch; }
  .timer-layout .sw-laps { max-height: 25cqh; overflow-y: auto; }
}

/* ---------- breathe ---------- */
.w-breathe { cursor: pointer; }
.br-stage { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; }
.br-ball { width: min(84cqh, 84cqw); aspect-ratio: 1; border-radius: 50%; grid-area: 1 / 1;
  background: radial-gradient(circle at 40% 35%, rgba(var(--ambient), .55), rgba(var(--ambient), .12) 70%); box-shadow: 0 0 40px rgba(var(--ambient), .25); }
.br-txt { grid-area: 1 / 1; text-align: center; z-index: 1; }
.br-w { font-size: clamp(13px, 9cqh, 26px); font-weight: 600; }
.br-c { font-size: clamp(18px, 16cqh, 52px); font-weight: 300; }

/* ---------- quote ---------- */
.w-quote { padding: clamp(8px, 6cqmin, 18px) clamp(10px, 6cqmin, 20px); display: flex; flex-direction: column; justify-content: center; cursor: pointer; }
.qt-mark { position: absolute; top: -.15em; left: .12em; font-size: min(60cqh, 30cqw); color: rgba(var(--ambient), .18); font-family: Georgia, serif; line-height: 1; }
.qt-q { position: relative; font-size: clamp(12px, calc(var(--qf, 1) * 11cqh), 30px); line-height: 1.3; font-weight: 400; font-style: italic; }
.qt-a { position: relative; margin-top: 4px; font-size: clamp(10px, 7cqh, 14px); color: var(--muted); }

/* ---------- checklist ---------- */
.w-checklist { padding: 9px 12px; display: flex; flex-direction: column; gap: 4px; --c: #22c55e; }
.w-checklist.all .w-sub { color: #22c55e; font-weight: 600; }
.cl-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; touch-action: pan-x pan-y; }
.cl-i { display: flex; align-items: center; gap: 9px; text-align: start; padding: 5px 8px; border-radius: 9px; background: rgba(255, 255, 255, .035); font-size: 13px; }
.cl-box { width: 18px; height: 18px; flex: 0 0 18px; border-radius: 5px; border: 1.5px solid var(--dim); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #06080b; }
.cl-i.done .cl-box { background: #22c55e; border-color: #22c55e; }
.cl-i.done .cl-t { color: var(--muted); text-decoration: line-through; }

/* ---------- battery, quota ring (dial widgets) ---------- */
.w-html, .w-hadash { padding: 0; }
.w-html.bare-html, .w-hadash.bare-html { background: transparent; border-color: transparent; box-shadow: none; }
.w.url-html { overflow: visible; border-radius: 0; }
.w.pf { padding: 0; overflow: hidden; background: #000; }
.pf-img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1s ease; }
.pf-img.on { opacity: 1; }
/* Camera (widgets/camera.js) */
.w.cam { padding: 0; overflow: hidden; background: #000; }
.cam-img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; visibility: hidden; }
.cam-img.on { visibility: visible; }
.cam-note { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; }
.cam-note[hidden] { display: none; }
.cam-cap { position: absolute; left: 8px; bottom: 6px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; max-width: calc(100% - 16px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-note { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; }
.html-frame { width: 100%; height: 100%; border: 0; display: block; background: transparent; }
.w-batteries { padding: 9px 12px; display: flex; flex-direction: column; gap: 4px; }
.w-batteries .w-title { color: #4ade80; }
.bt-list { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: space-evenly; gap: 2px; }
.bt-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(40px, 30%) 46px; align-items: center; gap: 8px; font-size: 14px; flex-shrink: 0; }
.bt-ico { font-size: 17px; text-align: center; }
.bt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bt-bar i { display: block; height: 100%; width: calc(var(--v) * 100%); background: var(--c); border-radius: 4px; }
.bt-pct { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.bt-row.low .bt-pct { color: #fca5a5; }
.w-obs { padding: 9px 10px; display: flex; flex-direction: column; gap: 7px; }
.obs-top { display: flex; gap: 6px; }
.obs-pill { flex: 1; display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .07); min-width: 0; }
.obs-pill b { font-size: 13px; letter-spacing: .1em; color: var(--muted); }
.obs-led { width: 10px; height: 10px; border-radius: 50%; background: #3f4651; flex: none; }
.obs-time { margin-inline-start: auto; font-variant-numeric: tabular-nums; font-size: 15px; color: var(--muted); }
.obs-pill.on b, .obs-pill.on .obs-time { color: #fff; }
.obs-pill.live.on { background: rgba(239, 68, 68, .2); border-color: rgba(239, 68, 68, .5); }
.obs-pill.rec.on { background: rgba(244, 63, 94, .16); border-color: rgba(244, 63, 94, .45); }
.obs-pill.on .obs-led { background: #ef4444; box-shadow: 0 0 14px rgba(239, 68, 68, .45); }
html.beat-4 .obs-pill.on .obs-led { box-shadow: 0 0 34px rgba(239, 68, 68, .9); }
.obs-pill.can:active, .obs-sc:active { transform: scale(.97); }
.obs-pill.busy, .obs-sc.busy { opacity: .55; }
.obs-scene { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); }
.obs-scene b { color: var(--text); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obs-mic { margin-inline-start: auto; font-size: 18px; }
.obs-mic.muted { opacity: .6; }
.obs-scenes { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); grid-auto-rows: minmax(38px, 1fr); gap: 6px; overflow: hidden; }
.obs-sc { border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); color: var(--text); border-radius: 10px; font: inherit; font-size: 13px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obs-sc.cur { background: rgba(167, 139, 250, .22); border-color: rgba(167, 139, 250, .55); font-weight: 600; }
.dc-top { display: flex; align-items: center; gap: 6px; }
.dc-where { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dc-kind { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.dc-btn { margin-inline-start: auto; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); color: var(--text); border-radius: 10px; font-size: 18px; padding: 5px 9px; }
.dc-btn + .dc-btn { margin-left: 0; }
.dc-btn.on { background: rgba(239, 68, 68, .22); border-color: rgba(239, 68, 68, .5); }
.dc-btn:disabled { opacity: .7; }
.dc-btn:active { transform: scale(.95); }
.dc-btn.busy, .dc-chan.busy { opacity: .55; }
.dc-btn.mode.on { background: rgba(245, 158, 11, .2); border-color: rgba(245, 158, 11, .5); }
.dc-warn { font-size: 12px; color: #fbbf24; padding: 4px 8px; border-left: 3px solid #f59e0b; background: rgba(245, 158, 11, .08); border-radius: 6px; }
/* screen share: 🖥️ in the top row, then Discord's picker, the running apps, or Stop */
.dc-btn.share.on { background: rgba(88, 101, 242, .28); border-color: rgba(88, 101, 242, .6); }
.dc-share { flex: none; border: none; border-radius: 12px; background: #5865f2; color: #fff; font: inherit; font-weight: 700; padding: 10px; }
.dc-share.stop { background: #da373c; }
.dc-share:disabled, .dc-app:disabled { opacity: .4; }
.dc-share.busy, .dc-app.busy { opacity: .55; }
.dc-sharing { flex: none; font-size: 13px; font-weight: 600; color: #23a55a; }
.dc-hint { flex: none; font-size: 11px; color: var(--muted); }
.dc-apps { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.dc-app { flex: none; border: none; background: rgba(255, 255, 255, .06); color: var(--text); border-radius: 9px; font: inherit; font-size: 13px; padding: 8px 10px; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* chat (read-only): 💬 in the top row, then a channel picker and the messages */
.dc-btn.chat { position: relative; }
.dc-btn.chat.on { background: rgba(88, 101, 242, .28); border-color: rgba(88, 101, 242, .6); }
.dc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #f23f43; flex: none; }
.dc-btn.chat .dc-dot { position: absolute; top: 2px; right: 2px; }
.dc-chatbar { display: flex; gap: 6px; align-items: center; flex: none; }
.dc-pick { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); color: var(--text); border-radius: 10px; font: inherit; font-size: 13px; font-weight: 600; padding: 5px 9px; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-pick small { color: var(--muted); font-weight: 400; font-size: 11px; }
.dc-open { flex: none; border: 1px solid rgba(88, 101, 242, .6); background: rgba(88, 101, 242, .3); color: var(--text); border-radius: 10px; font-size: 16px; padding: 4px 10px; }
.dc-picklist { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.dc-pickrow { flex: none; display: flex; align-items: center; gap: 8px; border: none; background: rgba(255, 255, 255, .05); color: var(--text); border-radius: 9px; font: inherit; font-size: 13px; padding: 7px 9px; text-align: start; min-width: 0; }
.dc-pickrow.cur { background: rgba(35, 165, 90, .3); font-weight: 600; }
.dc-pickrow.back { background: none; color: var(--muted); font-weight: 600; }
.dc-pickrow .dc-pname { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-pickrow small { color: var(--muted); }
.dc-msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.dc-msg { flex: none; display: flex; gap: 7px; padding: 3px 2px; }
.dc-msg.cont { padding-top: 0; }
.dc-msg .dc-ico, .dc-msgav { width: 26px; height: 26px; font-size: 11px; flex: none; }
.dc-msgb { min-width: 0; flex: 1; }
.dc-who { font-size: 12px; font-weight: 700; }
.dc-who small { color: var(--muted); font-weight: 400; font-size: 10px; margin-inline-start: 6px; }
.dc-msgtext { font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-extra { font-size: 11px; color: var(--muted); }
.dc-members { display: flex; flex-wrap: wrap; gap: 5px; }
.dc-member { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: rgba(88, 101, 242, .22); }
.dc-member.muted, .dc-member.deaf { background: rgba(255, 255, 255, .07); color: var(--muted); }
/* flex-wrap, not grid: an open block's height depends on how many channels wrap, which a grid's pre-sized rows can't track without overlapping the next row */
.dc-servers { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; overflow-y: auto; }
.dc-block:not(.open) .dc-server { flex: 1; }
/* fixed, not grow/shrink: a sparse last row must not stretch its tiles bigger than a full row's */
.dc-block { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 0 0 96px; }
.dc-block.open { flex: 1 1 100%; max-width: 100%; padding: 6px; border-radius: 12px; background: rgba(88, 101, 242, .08); border: 1px solid rgba(88, 101, 242, .25); }
.dc-ico { flex: none; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: #5865f2; color: #fff; font-size: 13px; font-weight: 700; }
.dc-ico img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dc-member .dc-ico { width: 18px; height: 18px; font-size: 10px; }
/* who is talking: Discord's green ring around the avatar */
.dc-member.speaking { box-shadow: inset 0 0 0 1px rgba(35, 165, 90, .75); }
.dc-member.speaking .dc-ico { box-shadow: 0 0 0 2px #23a55a; }
.dc-member { display: inline-flex; align-items: center; gap: 5px; }
.dc-stext { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.dc-server { display: flex; flex-direction: row; align-items: center; gap: 8px; width: 100%; background: none; border: none; color: var(--text); font: inherit; padding: 0; text-align: start; min-width: 0; }
.dc-server:not(.open) { flex-direction: column; justify-content: flex-start; text-align: center; gap: 4px; }
.dc-server:not(.open) .dc-stext { align-items: center; max-width: 100%; }
.dc-server .dc-ico { width: clamp(40px, 14vmin, 72px); height: clamp(40px, 14vmin, 72px); font-size: clamp(17px, 6vmin, 32px); }
.dc-server b { font-size: 13px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-server small { color: var(--muted); font-size: 10px; }
.dc-server.open { flex: none; }
.dc-server.open .dc-ico { width: 28px; height: 28px; font-size: 13px; }
.dc-server.open { flex-direction: row; }
.dc-server.here b::before { content: '● '; color: #3ba55d; }
.dc-server:active { transform: scale(.97); }
.dc-chans { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
.dc-chan { display: flex; flex-direction: column; align-items: flex-start; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); color: var(--text); border-radius: 10px; font: inherit; font-size: 13px; padding: 5px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-chan.cur { background: rgba(88, 101, 242, .28); border-color: rgba(88, 101, 242, .6); font-weight: 600; }
/* favourites: the ★ bar above the servers, stars beside a server or channel while choosing */
.dc-favbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.dc-favhint { flex: 1; font-size: 11px; color: var(--muted); }
.dc-favbtn { border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); color: var(--text); border-radius: 999px; font: inherit; font-size: 12px; padding: 3px 10px; }
.dc-favbtn.on { background: rgba(35, 165, 90, .25); border-color: rgba(35, 165, 90, .6); }
.dc-headrow { display: flex; align-items: center; gap: 4px; min-width: 0; }
.dc-gone { flex: none; display: flex; flex-direction: column; gap: 4px; }
.dc-goneid { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.dc-goneid small { color: var(--muted); }
.dc-headrow > .dc-server, .dc-headrow > .dc-chan { flex: 1; min-width: 0; }
.dc-star { flex: none; border: none; background: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 2px 4px; }
.dc-star.on { color: #f0b232; }
.dc-block.editing:not(.open) { flex-basis: 120px; }
/* who is in a favourite server's voice channel */
.dc-room { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dc-room > .dc-chan { width: 100%; }
.dc-people { display: flex; flex-wrap: wrap; gap: 3px 8px; padding: 0 4px; }
.dc-person { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-person .dc-ico { width: 16px; height: 16px; font-size: 9px; }
.dc-invoice { color: #3ba55d; }
.dc-notes { display: flex; flex-direction: column; gap: 4px; overflow: hidden; min-height: 0; }
.dc-note { display: flex; flex-direction: column; font-size: 12px; padding: 4px 8px; border-left: 3px solid #5865f2; background: rgba(255, 255, 255, .04); border-radius: 6px; }
.dc-note span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-discord { padding: 9px 10px; display: flex; flex-direction: column; gap: 8px; }
/* Discord "focus" layout. Left: server switcher, the channel you are in (or how to join one) and round call
   buttons; right: the chosen server's voice channels as big keys, or all servers while the switcher is open. */
.w-discord.dcf { padding: 0; }
.dcf-wrap { flex: 1; min-height: 0; display: flex; flex-direction: row; }
.dcf-left { flex: 0 0 48%; min-width: 0; display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; background: rgba(255, 255, 255, .03); box-sizing: border-box; }
.dcf-right { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 16px 14px; overflow-y: auto; box-sizing: border-box; }
.dcf-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dcf-switch { display: inline-flex; align-items: center; gap: 8px; min-width: 0; height: 48px; padding-block: 0; padding-inline: 5px 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-size: 15px; }
.dcf-switch.open { border-color: rgba(88, 101, 242, .7); background: rgba(88, 101, 242, .18); }
.dcf-switch .ico { width: 18px; height: 18px; flex: none; }
.dcf-sname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcf-sico { flex: none; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: #5865f2; color: #fff; font-size: 15px; font-weight: 700; }
.dcf-sico img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dcf-recent { flex: none; padding: 0; border: none; background: none; border-radius: 50%; opacity: .85; }
.dcf-now, .dcf-empty { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; overflow: hidden; }
.dcf-label, .dcf-hint { font-size: 14px; color: var(--muted); }
.dcf-name { font-size: clamp(20px, 5cqmin, 34px); font-weight: 700; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dcf-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 0; flex: 0 1 auto; overflow-y: auto; } /* many members: scroll, don't cut */
.dcf-chip { display: inline-flex; align-items: center; gap: 7px; padding-block: 4px; padding-inline: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: 15px; }
.dcf-chip.muted, .dcf-chip.deaf { color: var(--muted); }
.dcf-av { flex: none; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: #3b3f4a; font-size: 12px; font-weight: 700; }
.dcf-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dcf-chip.speaking .dcf-av { box-shadow: 0 0 0 2px var(--card, #13151b), 0 0 0 4px #23a55a; }
.dcf-eico { width: 76px; height: 76px; border-radius: 50%; background: rgba(255, 255, 255, .06); color: var(--muted); display: flex; align-items: center; justify-content: center; }
.dcf-eico .ico { width: 36px; height: 36px; }
.dcf-back { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; height: 52px; padding: 0 20px; border-radius: 999px; border: none; background: #5865f2; color: #fff; font: inherit; font-size: 16px; font-weight: 600; }
.dcf-back span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcf-back .ico { width: 20px; height: 20px; flex: none; }
.dcf-calls { display: flex; justify-content: center; gap: clamp(12px, 5cqw, 36px); }
.dcf-call { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: none; color: #c4c8d2; font: inherit; font-size: 14px; padding: 0; }
.dcf-disc { width: clamp(56px, 14cqmin, 88px); height: clamp(56px, 14cqmin, 88px); border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #2b2f3a; color: #fff; }
.dcf-disc .ico { width: 40%; height: 40%; }
.dcf-call.on .dcf-disc { background: #fff; color: #da373c; }
.dcf-call.leave .dcf-disc { background: #da373c; }
.dcf-call:disabled { opacity: .45; }
.dcf-call.leave:disabled .dcf-disc { background: #2b2f3a; color: #6b7080; }
.dcf-call:active .dcf-disc { transform: scale(.94); }
.dcf-cap { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; padding: 0 4px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; align-content: start; }
.dcf-chan, .dcf-srv { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 64px; padding: 0 16px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-size: 18px; text-align: start; }
.dcf-srv { padding-inline-start: 10px; font-size: 16px; }
.dcf-chan span, .dcf-srv span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcf-chan .ico { width: 20px; height: 20px; flex: none; opacity: .8; }
.dcf-chan.cur, .dcf-srv.cur { background: #5865f2; border-color: #5865f2; color: #fff; font-weight: 600; }
.dcf-chan.busy { opacity: .55; }
.dcf-chan:active, .dcf-srv:active { transform: scale(.97); }
/* focus layout: the Screen share and Chat tabs */
.dcf-calls.many { gap: clamp(6px, 2cqw, 18px); }
.dcf-calls.many .dcf-disc { width: min(clamp(50px, 12cqmin, 78px), calc((48cqw - 64px) / 5)); height: min(clamp(50px, 12cqmin, 78px), calc((48cqw - 64px) / 5)); }
/* a narrower widget: the call buttons lose their labels, then the two sides stack (a phone-sized widget) */
@container (max-width: 760px) {
  .dcf-calls .dcf-cl { display: none; }
  .dcf-calls, .dcf-calls.many { gap: 6px; }
  .dcf-left { padding: 12px; gap: 10px; }
  .dcf-right { padding: 12px 10px; }
}
@container (max-width: 520px) {
  .dcf-wrap { flex-direction: column; overflow-y: auto; }
  .dcf-left { flex: none; }
  .dcf-now, .dcf-empty { flex: none; }
  .dcf-name { font-size: 20px; }
  .dcf-eico { display: none; }
  .dcf-disc, .dcf-calls.many .dcf-disc { width: min(52px, calc((100cqw - 72px) / 5)); height: min(52px, calc((100cqw - 72px) / 5)); }
  .dcf-right { flex: none; overflow: visible; }
  .dcf-right.chat .dcf-msgs { min-height: 180px; }
  .dcf-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .dcf-chan, .dcf-srv { min-height: 48px; font-size: 15px; }
}
.dcf-calls.many .dcf-cl { font-size: 13px; white-space: nowrap; }
.dcf-call { position: relative; }
.dcf-call.sel .dcf-disc { background: #5865f2; }
.dcf-call.live .dcf-disc { background: #f23f43; }
.dcf-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #f23f43; }
.dcf-call > .dcf-dot { position: absolute; top: 0; inset-inline-end: 4px; width: 16px; height: 16px; box-shadow: 0 0 0 3px #1a1c22; }
.dcf-badge { text-transform: uppercase; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: #f23f43; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
.dcf-label { display: inline-flex; align-items: center; gap: 8px; }
.dcf-hint b { color: var(--text); }
.dcf-tabs { flex: none; align-self: flex-start; display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .04); max-width: 100%; overflow-x: auto; }
.dcf-tab { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 10px; border: none; background: transparent; color: var(--muted); font: inherit; font-size: 15px; font-weight: 600; }
.dcf-tab.on { background: rgba(255, 255, 255, .09); color: var(--text); }
.dcf-right.chat { overflow: hidden; }
.dcf-note { padding: 18px 8px; color: var(--muted); font-size: 15px; text-align: center; }
.dcf-chatbar { flex: none; display: flex; align-items: center; gap: 10px; min-width: 0; }
.dcf-pick, .dcf-open { display: inline-flex; align-items: center; gap: 8px; min-width: 0; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-size: 15px; }
.dcf-pick.open { border-color: rgba(88, 101, 242, .7); background: rgba(88, 101, 242, .18); }
.dcf-pick span, .dcf-open span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcf-pick .ico, .dcf-open .ico { width: 18px; height: 18px; flex: none; }
.dcf-open { margin-inline-start: auto; flex: none; }
.dcf-ro { flex: none; font-size: 13px; color: var(--muted); }
@container (max-width: 1000px) { .dcf-ro { display: none; } .dcf-open span { display: none; } }
.dcf-plist { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.dcf-prow { flex: none; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .04); color: var(--text); font: inherit; font-size: 16px; text-align: start; }
.dcf-prow > span:not(.dcf-av):not(.dcf-dot) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcf-prow .ico { width: 18px; height: 18px; flex: none; opacity: .8; }
.dcf-prow.cur { background: #5865f2; border-color: #5865f2; color: #fff; font-weight: 600; }
.dcf-prow.back { background: none; border-color: transparent; color: var(--muted); }
.dcf-msgs { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding: 6px 8px; border-radius: 14px; background: rgba(0, 0, 0, .18); }
.dcf-msgs > :first-child { margin-top: auto; }
.dcf-msg { flex: none; display: flex; gap: 12px; padding: 8px 4px 2px; }
.dcf-msg.cont { padding-top: 0; }
.dcf-mav, .dcf-mgap { flex: none; width: 38px; height: 38px; }
.dcf-mav { border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: #3b3f4a; font-size: 14px; font-weight: 700; }
.dcf-mav img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dcf-mgap { height: 0; }
.dcf-mb { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dcf-who { display: flex; align-items: baseline; gap: 8px; font-size: 15px; }
.dcf-who b { font-weight: 600; }
.dcf-who small { font-size: 12px; color: var(--muted); }
.dcf-mt { font-size: 16px; line-height: 1.35; color: #d7dae2; white-space: pre-wrap; overflow-wrap: anywhere; }
.dcf-mx { font-size: 13px; color: var(--muted); }
.dcf-pickpc { flex: none; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; border-radius: 14px; border: none; background: #5865f2; color: #fff; font: inherit; font-size: 18px; font-weight: 600; }
.dcf-pickpc .ico { width: 24px; height: 24px; }
.dcf-pickpc:disabled { opacity: .45; }
.dcf-app { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 58px; padding: 0 14px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-size: 16px; text-align: start; }
.dcf-app > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcf-appi { flex: none; width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: #3b3f4a; font-size: 14px; font-weight: 700; }
.dcf-app:disabled { opacity: .5; }
.dcf-app.busy, .dcf-pickpc.busy, .dcf-stop.busy { opacity: .55; }
.dcf-shint { padding: 2px 4px; font-size: 13px; color: var(--muted); }
.dcf-warn { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 100%; padding: 10px 14px; border-radius: 12px; background: rgba(240, 178, 50, .14); border: 1px solid rgba(240, 178, 50, .45); color: #f0b232; font-size: 14px; }
.dcf-warnbtn { height: 40px; padding: 0 16px; border-radius: 10px; border: none; background: #f0b232; color: #1a1300; font: inherit; font-size: 14px; font-weight: 600; }
.dcf-warnbtn.busy { opacity: .55; }
/* recent notifications under the channels, as in the list layout */
.dcf-notes { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.dcf-ntf { display: flex; flex-direction: column; gap: 2px; padding: 6px 10px; border-inline-start: 3px solid #5865f2; border-radius: 6px; background: rgba(255, 255, 255, .04); font-size: 13px; }
.dcf-ntf span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcf-livebox { flex: none; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: rgba(242, 63, 67, .12); border: 1px solid rgba(242, 63, 67, .4); }
.dcf-lt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dcf-lt b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcf-lt small { font-size: 13px; color: #c4c8d2; }
.dcf-stop { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 54px; padding: 0 20px; border-radius: 14px; border: none; background: #da373c; color: #fff; font: inherit; font-size: 16px; font-weight: 600; }
.dcf-stop .ico { width: 20px; height: 20px; }


/* Discord current-channel bar. Wide: names and labelled buttons; narrower: round icon buttons, then stacked
   avatars, then only the name and the buttons; two rows tall or more: stacked, the buttons in a row at the bottom. */
.w-discord-bar { background: #5865f2; border-color: #5865f2; color: #fff; }
.w-discord-bar[hidden] { display: none; }
.w-discord-bar .empty { color: rgba(255, 255, 255, .8); }
.dcb { height: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 16px; padding: 0 18px; }
.dcb-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.dcb-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dcb-vi { width: 20px; height: 20px; flex: none; }
.dcb-name { font-size: clamp(15px, 22cqh, 26px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcb-guild { flex: 0 1 auto; min-width: 0; font-size: 13px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* a long server name gives way to the channel's */
.dcb-chips { display: flex; gap: 6px; overflow: hidden; }
.dcb-chip { flex: none; display: inline-flex; align-items: center; gap: 7px; padding-block: 3px; padding-inline: 3px 11px; border-radius: 999px; background: rgba(0, 0, 0, .25); font-size: 14px; }
.dcb-av { flex: none; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: #3b3f4a; font-size: 11px; font-weight: 700; color: #fff; }
.dcb-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dcb-chip.speaking .dcb-av, .dcb-av.speaking { box-shadow: 0 0 0 2px #5865f2, 0 0 0 4px #23a55a; }
.dcb-stack { display: none; align-items: center; }
.dcb-stack .dcb-av { border: 2px solid #5865f2; margin-inline-start: -8px; }
.dcb-stack .dcb-av:first-child { margin-inline-start: 0; }
.dcb-btns { flex: none; display: flex; gap: 8px; }
.dcb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 54px; padding: 0 18px; border-radius: 999px; border: none; background: rgba(0, 0, 0, .28); color: #fff; font: inherit; font-size: 15px; font-weight: 600; white-space: nowrap; }
.dcb-btn .ico { width: 22px; height: 22px; flex: none; }
.dcb-btn.on { background: #fff; color: #da373c; }
.dcb-btn.leave { background: #da373c; }
.dcb-btn:disabled { opacity: .6; }
.dcb-btn.busy { opacity: .55; }
.dcb-btn:active { transform: scale(.95); }
/* the bar while sharing, and its Screen and Chat buttons */
.dcb-badge { flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: #f23f43; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.dcb-sub { font-size: 13px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcb-btn { position: relative; }
.dcb-btn.share.live { background: #f23f43; }
.dcb-dot { position: absolute; top: 2px; inset-inline-end: 2px; width: 12px; height: 12px; border-radius: 50%; background: #f23f43; box-shadow: 0 0 0 2px #5865f2; }
/* less room: Sound goes first, then Chat, then Stop (Mic and Leave stay) */
@container (max-width: 640px) { .dcb-btns.n5 .dcb-btn.deafen { display: none; } }
@container (max-width: 560px) { .dcb-btns.n4 .dcb-btn.deafen, .dcb-btns.n5 .dcb-btn.chat { display: none; } .dcb-sub { display: none; } }
/* while you share, Stop stays at every size: only the Screen button that opens the share view gives way */
@container (max-width: 460px) { .dcb-btns .dcb-btn.chat, .dcb-btns .dcb-btn.share:not(.live) { display: none; } }
@container (max-width: 900px) {
  .dcb-l { display: none; }
  .dcb-btn { width: 48px; height: 48px; padding: 0; }
}
@container (max-width: 560px) {
  .dcb { gap: 10px; padding: 0 12px; }
  .dcb-chips, .dcb-guild { display: none; }
  .dcb-stack { display: flex; }
  .dcb-btns { gap: 6px; }
  .dcb-btn { width: 44px; height: 44px; }
}
/* short and narrow (one grid row, two to four columns): the name and Sound give way, so Mic and Leave are never cut */
@container (max-width: 300px) and (max-height: 89px) {
  .dcb { justify-content: center; gap: 6px; padding: 0 6px; }
  .dcb-info, .dcb-btn.deafen, .dcb-btn.chat, .dcb-btn.share:not(.live) { display: none; }
  .dcb-btns { gap: 6px; }
  .dcb-btn { width: min(44px, 40cqh); height: min(44px, 40cqh); min-width: 32px; min-height: 32px; }
}
@container (max-width: 300px) and (min-height: 90px) {
  .dcb { flex-direction: column; justify-content: center; gap: 8px; padding: 6px 8px; }
  .dcb-info { flex: none; width: 100%; align-items: center; }
  .dcb-vi, .dcb-stack { display: none; }
  .dcb-name { font-size: 14px; }
}
@container (min-height: 200px) {
  .dcb { flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 14px 16px; gap: 10px; }
  .dcb-info { flex: 1; min-height: 0; }
  .dcb-chips { flex-wrap: wrap; }
  .dcb-btns { width: 100%; }
  .dcb-btn { flex: 1; width: auto; height: 50px; border-radius: 14px; padding: 0 8px; }
}
@container (min-height: 200px) and (min-width: 520px) {
  .dcb-l { display: inline; }
}
@container (min-height: 200px) and (max-width: 300px) {
  .dcb { align-items: center; text-align: center; }
  .dcb-info { width: 100%; align-items: center; }
  .dcb-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 16px; }
  .dcb-btns { flex-wrap: wrap; }
  .dcb-btn.leave { flex-basis: 100%; }
}
/* a large Discord widget grows its buttons, names and avatars with it, for a phone on a stand at desk distance (#420);
   at the usual sizes each clamp stays at its minimum, the size given above */
.w-discord .dc-where { font-size: clamp(16px, min(6cqmin, 3.4cqw), 26px); }
/* the buttons share the top row with the channel name, so the widget's width limits them too */
.w-discord .dc-btn { font-size: clamp(18px, min(6.5cqmin, 4cqw), 30px); padding: clamp(5px, min(1.6cqmin, 1cqw), 9px) clamp(9px, min(2.8cqmin, 1.7cqw), 15px); border-radius: clamp(10px, 3cqmin, 14px); }
.w-discord .dc-members { gap: clamp(5px, 1.5cqmin, 10px); }
.w-discord .dc-member { font-size: clamp(12px, 4.2cqmin, 20px); padding: clamp(3px, 1cqmin, 6px) clamp(8px, 2.4cqmin, 14px); gap: clamp(5px, 1.5cqmin, 9px); }
.w-discord .dc-member .dc-ico { width: clamp(18px, 6.5cqmin, 34px); height: clamp(18px, 6.5cqmin, 34px); font-size: clamp(10px, 3.2cqmin, 16px); }
.w-discord .dc-who { font-size: clamp(12px, 3.6cqmin, 17px); }
.w-discord .dc-msgtext { font-size: clamp(13px, 4cqmin, 19px); }
.w-discord .dc-msg .dc-ico, .w-discord .dc-msgav { width: clamp(26px, 7cqmin, 40px); height: clamp(26px, 7cqmin, 40px); font-size: clamp(11px, 3cqmin, 16px); }
.w-steam { padding: 9px 12px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.w-steam .w-title { color: #79a9e8; }
.st-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-count { color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: none; }
.st-list::-webkit-scrollbar { display: none; }
.st-row { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 9px; padding: 4px 6px; border-radius: 8px; font-size: 13px; }
.st-portrait { width: 34px; height: 34px; border-radius: 50%; position: relative; display: grid; place-items: center; overflow: visible; background: rgba(255,255,255,.08); }
.st-avatar, .st-avatar-fallback { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: rgba(255,255,255,.08); color: #c7d5e0; font-size: 14px; font-weight: 700; }
.st-dot { position: absolute; right: -1px; bottom: -1px; width: 9px; height: 9px; border: 2px solid var(--bg); box-sizing: border-box; border-radius: 50%; background: #4b5563; }
.st-row.state-1 .st-dot, .st-event .st-dot.state-1 { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, .5); }
.st-row.state-2 .st-dot, .st-event .st-dot.state-2 { background: #ef4444; }
.st-row.state-3 .st-dot, .st-row.state-4 .st-dot, .st-event .st-dot.state-3, .st-event .st-dot.state-4 { background: #f59e0b; }
.st-row.state-5 .st-dot, .st-row.state-6 .st-dot, .st-event .st-dot.state-5, .st-event .st-dot.state-6 { background: #60a5fa; }
.st-row:not(.online) { color: var(--muted); opacity: .82; }
.st-info { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.st-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-sub { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-row.online .st-sub { color: #9baec7; }
.st-activity-list { gap: 5px; }
.st-event { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px 5px; border-radius: 8px; background: rgba(255,255,255,.025); }
.st-event .st-portrait, .st-event .st-avatar, .st-event .st-avatar-fallback { width: 30px; height: 30px; }
.st-time { color: var(--dim); font-size: 10px; white-space: nowrap; }
.st-error { color: #f59e0b; font-size: 11px; line-height: 1.3; }
.w-ha { padding: 9px 10px; display: flex; flex-direction: column; gap: 6px; }
.w-ha .w-title { color: #41bdf5; }
.ha-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); grid-auto-rows: minmax(64px, 1fr); gap: 6px; overflow: hidden; }
.ha-tile { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 6px 9px; border-radius: 12px; background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .06); min-width: 0; transition: background .2s, border-color .2s; }
.ha-tile.on { background: rgba(250, 204, 21, .14); border-color: rgba(250, 204, 21, .35); }
.ha-tile.can:active { transform: scale(.97); }
.ha-tile.busy { opacity: .6; }
.ha-tile.gone { opacity: .45; }
.ha-ico { font-size: 20px; line-height: 1; }
.ha-name { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ha-state { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ha-tile.on .ha-state { color: #fde68a; }
.ha-err { grid-column: 1 / -1; font-size: 12px; color: #f59e0b; }
.w-apps { padding: 9px 12px; display: flex; flex-direction: column; gap: 6px; }
.w-apps .w-title { color: #a78bfa; }
.ap-count { color: var(--muted); font-weight: 600; }
.ap-search { width: 100%; box-sizing: border-box; padding: 7px 11px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .05); color: inherit; font: inherit; font-size: 14px; outline: none; }
.ap-search:focus { border-color: rgba(167, 139, 250, .5); }
.ap-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  grid-auto-rows: 88px; gap: 6px; scrollbar-width: none; align-content: start; }
.ap-grid::-webkit-scrollbar { display: none; }
.ap-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 6px 4px; min-width: 0;
  border-radius: 12px; border: 1px solid transparent; background: rgba(255, 255, 255, .04); color: inherit; font: inherit; cursor: pointer; }
.ap-tile:active { transform: scale(.96); background: rgba(255, 255, 255, .09); }
.ap-tile.busy { opacity: .55; }
.ap-tile.armed { border-color: rgba(167, 139, 250, .7); background: rgba(167, 139, 250, .16); }
.ap-tile.armed .ap-name { color: #ddd6fe; font-weight: 600; white-space: normal; text-align: center; }
.ap-ico { width: 44px; height: 44px; object-fit: contain; flex-shrink: 0; }
.ap-letter { display: grid; place-items: center; border-radius: 11px; background: rgba(167, 139, 250, .2); font-size: 20px; font-weight: 700; }
.ap-name { max-width: 100%; font-size: 11px; line-height: 1.2; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-docker { padding: 9px 12px; display: flex; flex-direction: column; gap: 4px; }
.w-docker .w-title { color: #38bdf8; }
.dk-count { color: var(--muted); font-weight: 600; }
.dk-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: none; }
.dk-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; font-size: 14px; }
.dk-row:active, .dk-row.open { background: rgba(255, 255, 255, .06); }
.dk-dot { width: 8px; height: 8px; border-radius: 50%; background: #4b5563; }
.dk-row.ok .dk-dot { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, .6); }
.dk-row.warn .dk-dot { background: #f59e0b; }
.dk-row.bad .dk-dot { background: #ef4444; }
.dk-row.off { color: var(--muted); }
.dk-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-name small { color: var(--muted); font-size: 11.5px; }
.dk-stat { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dk-acts { display: flex; gap: 8px; padding: 2px 6px 6px 22px; }
.dk-btn { flex: 1; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: var(--text); border-radius: 9px; padding: 7px 0; font: inherit; font-size: 13px; font-weight: 600; }
.dk-btn.danger { color: #fca5a5; border-color: rgba(239, 68, 68, .4); }
.dk-btn.go { color: #86efac; border-color: rgba(34, 197, 94, .4); }
.w-agenda { padding: 9px 12px; display: flex; flex-direction: column; gap: 4px; }
.w-agenda .w-title { color: #60a5fa; }
.ag-err { color: #f59e0b; }
.ag-list { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.ag-list > *, .dk-list > * { flex-shrink: 0; }
.ag-day { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.ag-day:first-child { margin-top: 0; }
.ag-row { position: relative; display: grid; grid-template-columns: 8px 54px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; font-size: 14px; overflow: hidden; }
.ag-row.now { background: color-mix(in srgb, var(--c) 18%, transparent); }
.ag-row.now::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: calc(var(--p, 0) * 100%); background: var(--c); }
.ag-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.ag-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.ag-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-title small { color: var(--muted); font-size: 12px; }
.ag-when { color: var(--c); font-size: 12px; font-weight: 600; white-space: nowrap; }
.w-agenda.small { justify-content: center; gap: 2px; border-left: 4px solid var(--c, #60a5fa); }
.ag-big-s { font-size: clamp(11px, 16cqh, 15px); color: var(--c, #60a5fa); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-big-t { font-size: clamp(14px, 26cqh, 26px); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-onair { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(2px, 6cqh, 12px); padding: 8px; }
.oa-sign {
  font-weight: 800; letter-spacing: .14em; font-size: min(26cqh, 13cqw); line-height: 1; color: #3f4651;
  border: max(2px, 1.6cqh) solid currentColor; border-radius: 12px; padding: .2em .55em .2em .69em; transition: color .3s, background .3s; /* no box-shadow here: the glow is stepped by the beat, and a transition would run a frame per refresh */
}
.w-onair.on .oa-sign { color: #fff; background: #dc2626; border-color: #fca5a5; box-shadow: 0 0 14px rgba(239, 68, 68, .45); }
html.beat-4 .w-onair.on .oa-sign { box-shadow: 0 0 34px rgba(239, 68, 68, .9); }
.oa-sub { font-size: clamp(10px, 9cqh, 14px); color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.w-onair.on .oa-sub { color: #fecaca; }
.w-battery, .w-quotaring { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6px; gap: 1px; }
.g-sub.hot { color: #f87171; }

/* ---------- top processes ---------- */
.w-topprocs { padding: 9px 12px; display: flex; flex-direction: column; gap: 5px; }
.tp-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; }
.tp-i { display: flex; align-items: center; gap: 8px; font-size: 12.5px; height: 20px; }
.tp-i .p-ico { width: 18px; height: 18px; flex: 0 0 18px; font-size: 10px; border-radius: 5px; }
.tp-n { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-i b { font-weight: 600; white-space: nowrap; }

/* ---------- volume ---------- */
.w-volume { padding: 9px 12px; display: flex; flex-direction: column; gap: 6px; }
.vb-row { flex: 1; min-height: 0; display: flex; align-items: center; gap: 10px; }
.vb { flex: 1; height: 26px; border-radius: 13px; background: rgba(255, 255, 255, .08); overflow: hidden; position: relative; touch-action: none; }
.vb i { position: absolute; left: 0; bottom: 0; background: var(--text); border-radius: inherit; }
.w-volume.muted .vb i { background: var(--dim); }
.vb-v { font-size: clamp(12px, 9cqh, 22px); font-weight: 500; min-width: 3.2em; text-align: right; }
.w-volume.vert .vb-row { flex-direction: column-reverse; }
.w-volume.vert .vb { width: min(46px, 40cqw); height: auto; align-self: center; flex: 1; }
.w-volume.vert .vb-v { text-align: center; min-width: 0; }
.w-volume .pomo-btns { justify-content: center; }

/* ---------- sun & moon, air quality ---------- */
.w-sun { padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; --c: #fbbf24; }
.sun-arc { flex: 1; min-height: 0; width: 100%; }
.sa-bg { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 1.5; stroke-dasharray: 3 3; }
.sa-fg { fill: none; stroke: #fbbf24; stroke-width: 2; }
.sa-h { stroke: var(--line); stroke-width: 1; }
.sa-sun { fill: #fde68a; filter: drop-shadow(0 0 6px #fbbf24); }
.w-sun.night .sa-sun { fill: #475569; filter: none; }
.sun-row { display: flex; justify-content: space-between; gap: 6px; font-size: clamp(10px, 7cqh, 13px); }
.sun-row .sl { color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.moon { font-size: clamp(10px, 7cqh, 13px); color: var(--muted); text-align: center; white-space: nowrap; }
@container (max-height: 130px) { .w-sun .moon { display: none; } }
.w-air { padding: 9px 12px; display: flex; flex-direction: column; gap: 4px; }
.aq-main { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 0; }
.aq-v { font-size: min(40cqh, 22cqw); font-weight: 400; color: var(--c, var(--text)); line-height: 1; }
.aq-c { font-size: clamp(11px, 8cqh, 15px); color: var(--muted); }
.aq-chips { display: flex; gap: 5px; flex-wrap: wrap; overflow: hidden; max-height: 24px; }
@container (max-height: 100px) { .w-air .aq-chips { display: none; } }

/* ---------- hacker news, exchange rates, crypto ---------- */
.w-hackernews { padding: 9px 12px; display: flex; flex-direction: column; gap: 4px; }
.hn-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.hn-i { display: flex; gap: 8px; align-items: flex-start; height: 30px; }
.hn-r { width: 18px; text-align: right; font-size: 11px; color: #ff6600; font-weight: 700; padding-top: 1px; flex: 0 0 18px; }
.hn-b { min-width: 0; flex: 1; }
.hn-t { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hn-m { font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* a column, so the list gets the height that is left and scrolls within it */
.w-feeds { display: flex; flex-direction: column; }
.fd-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; touch-action: pan-x pan-y; scrollbar-width: none; }
.fd-list::-webkit-scrollbar { display: none; }
.fd-i { flex: none; height: 30px; min-width: 0; border-left: 2px solid transparent; padding-left: 6px; }
/* the accent bar: an article this phone hasn't opened yet */
.fd-i.link { border-left-color: var(--c); cursor: pointer; }
.fd-i.link.read { border-left-color: transparent; }
.fd-i.read .fd-t { opacity: .65; }
.fd-list.wrap .fd-i { height: auto; padding-top: 1px; padding-bottom: 1px; }
.fd-list.wrap .fd-t { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--fl, 2); line-height: 1.25; }
.fd-i.link:active { background: rgba(255, 255, 255, .06); }
.fd-t { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-m { font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-exchange, .w-crypto { padding: 9px 12px; display: flex; flex-direction: column; gap: 4px; --c: #34d399; }
.w-crypto { --c: #f7931a; }
.fx-list { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: space-evenly; gap: 2px; }
.fx-i { display: grid; grid-template-columns: var(--fx-name, 3.6em) minmax(0, 1fr) auto 28%; align-items: center; gap: 8px; font-size: clamp(11px, 7cqh, 15px); min-height: 0; }
.fx-i b { font-weight: 700; color: var(--muted); }
.fx-v { font-weight: 500; text-align: right; white-space: nowrap; }
.chg { font-size: .8em; white-space: nowrap; font-weight: 600; }
.chg.up { color: #4ade80; }
.chg.down { color: #f87171; }
.fx-sp { width: 100%; height: 22px; }
@container (max-width: 260px) { .fx-i { grid-template-columns: var(--fx-name, 3.4em) minmax(0, 1fr) auto; } .fx-sp { display: none; } }

/* ---------- image ---------- */
.w-image { background: #000; }
.im-img { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; }
.w-image.err .im-img { display: none; }
.w-image.err::after { content: "Image unavailable"; position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.im-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 10px 6px; font-size: 12px; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }

/* ---------- permission prompt ---------- */
#approval { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 90; background: rgba(4, 5, 8, .88); display: flex; align-items: center; justify-content: center; padding: 14px var(--pad-r) 14px var(--pad-l); }
.ap-card {
  width: 100%; height: 100%; display: flex; flex-direction: column; gap: 6px; padding: 14px 18px;
  border-radius: 22px; background: #10131a; border: 1px solid rgba(217, 119, 87, .55);
  box-shadow: 0 0 0 4px rgba(217, 119, 87, .12), 0 20px 60px rgba(0, 0, 0, .6);
}
.ap-head { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.ap-logo { color: #d97757; font-size: 16px; }
.ap-logo.opencode { color: #a78bfa; }
.ap-logo.codex { color: #67e8f9; }
.ap-logo.claude { color: #d97757; }
.ap-sep { color: var(--dim); }
.ap-context { min-width: 0; display: flex; align-items: baseline; gap: 7px; font-size: 12px; color: var(--muted); }
#apProject { flex: 0 1 auto; min-width: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 13px; font-weight: 650; }
#apCwd { flex: 1 1 0; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; color: var(--muted); font: 11.5px/1.3 "Roboto Mono", monospace; white-space: normal; overflow-wrap: anywhere; }
#apCwd:empty { display: none; }
.ap-count:empty { display: none; }
.ap-count { margin-inline-start: auto; font-size: 12px; padding: 2px 8px; border-radius: 8px; background: rgba(255, 255, 255, .08); }
.ap-tool { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.ap-desc { font-size: 13px; color: var(--muted); }
.ap-desc:empty { display: none; }
.ap-detail { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 10px 12px; border-radius: 12px; background: #06080b; border: 1px solid var(--line);
  font: 12.5px/1.45 "Roboto Mono", monospace; color: #d5dce5; white-space: pre-wrap; word-break: break-word; touch-action: pan-y; -webkit-user-select: text; user-select: text; }
/* What Allow always would save (OpenCode's proposed pattern), shown so the card says what it agrees to. */
.ap-pattern { font-size: 12px; color: var(--muted); }
.ap-pattern:empty { display: none; }
.ap-foot { display: flex; align-items: center; gap: 12px; }
.ap-time { flex: 1; font-size: 12px; color: var(--dim); }
.ap-btn { min-width: 150px; padding: 14px 22px; border-radius: 14px; font-size: 17px; font-weight: 700; }
.ap-btn.deny { background: rgba(239, 68, 68, .16); color: #fca5a5; border: 1px solid rgba(239, 68, 68, .4); }
.ap-btn.always { background: rgba(34, 197, 94, .13); color: #86efac; border: 1px solid rgba(34, 197, 94, .4); }
.ap-btn.allow { background: #22c55e; color: #052e14; }
.ap-btn:active { transform: scale(.96); }
.ap-btn:disabled { opacity: .4; }
/* OpenCode's third button (Allow always): the two greens and the deny share the row, so the countdown hides and
   the buttons give up their fixed width. */
#approval.with-always .ap-time { display: none; }
#approval.with-always .ap-btn { min-width: 0; flex: 1; padding: 14px 8px; }
/* Agent questions (OpenCode forms): the question steps aside and the answers take the space. */
#approval.with-choices .ap-detail { flex: 0 0 auto; max-height: 26%; }
#approval.with-choices .ap-choices { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; touch-action: pan-y; }
.ap-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; padding: 12px 16px; border-radius: 14px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--text); font-size: 15px; font-weight: 600; }
.ap-opt small { font-size: 12px; font-weight: 400; color: var(--muted); }
.ap-opt:active { transform: scale(.98); }
.ap-opt:disabled { opacity: .4; }
.ap-custom { display: flex; gap: 8px; align-items: stretch; }
.ap-custom input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 14px; background: #06080b; border: 1px solid var(--line);
  color: var(--text); font: inherit; font-size: 15px; -webkit-user-select: text; user-select: text; }
.ap-custom input:focus { outline: none; border-color: rgba(34, 197, 94, .5); }
.ap-custom .ap-btn { min-width: 0; padding: 12px 18px; font-size: 15px; }

/* ---------- night ---------- */
#night { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 30; background: #000; display: none; flex-direction: column; align-items: center; justify-content: center; color: #4a3a33; }
body.night #night { display: flex; }

/* OLED burn-in protection (Settings › Display): with pixel shift the panel steps a few pixels every 2 minutes and the
   night clock drifts; with idle dim a dark layer covers the panel until it is touched. */
body.shifted { transform: translate(var(--shift-x, 0px), var(--shift-y, 0px)); transition: transform 2s ease; }
body.shifted #night > * { transform: translate(var(--night-x, 0), var(--night-y, 0)); transition: transform 3s ease; }
body::after { content: ""; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 85; background: #000; opacity: 0; pointer-events: none; transition: opacity 1.5s ease; }
body.dimmed::after { opacity: .65; pointer-events: auto; }
body.waking::after { opacity: 0; pointer-events: auto; transition: opacity .2s ease; }
#nClock { font-size: 34vh; font-weight: 200; letter-spacing: -0.04em; line-height: 1; }
#nDate { font-size: 16px; margin-top: 6px; text-transform: capitalize; }

/* ---------- rules ---------- */
.w-rules, .w-chargecare, .w-nextup, .w-moon { padding: 9px 12px; display: flex; flex-direction: column; gap: 6px; }
.ru-pause { margin-inline-start: auto; font-size: 11.5px; padding: 3px 10px; border-radius: 99px; background: rgba(255, 255, 255, .07); color: var(--muted); font-weight: 600; }
.w-rules.paused .ru-pause { background: rgba(var(--ambient), .22); color: var(--text); }
.ru-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.ru-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 9px; background: rgba(255, 255, 255, .035); font-size: 13px; }
.ru-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.ru-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .12); flex: 0 0 auto; }
.ru-row.on { background: rgba(var(--ambient), .14); }
.ru-row.on .ru-name { color: var(--text); font-weight: 600; }
.ru-row.on .ru-dot { background: rgb(var(--ambient)); box-shadow: 0 0 8px rgb(var(--ambient)); }
.ru-note { font-size: 12px; color: #fde68a; padding: 2px 2px 4px; }
.w-rules.paused .ru-row { opacity: .5; }

/* ---------- battery care ---------- */
.cc-body { flex: 1; min-height: 0; display: grid; place-items: center; }
.cc-wrap { position: relative; height: 100%; aspect-ratio: 1; max-width: 100%; display: grid; place-items: center; }
.cc-ring { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.cc-ring circle { fill: none; stroke-width: 8; }
.cc-bg { stroke: rgba(255, 255, 255, .07); }
.cc-band { stroke: rgba(255, 255, 255, .16); stroke-width: 13 !important; transition: opacity .3s; }
.cc-fg { stroke: var(--cc, rgb(var(--ambient))); stroke-linecap: round; transition: stroke-dasharray .6s; }
.cc-pct { position: relative; font-size: clamp(11px, 11cqmin, 38px); font-weight: 700; font-variant-numeric: tabular-nums; }
.cc-sub { font-size: 12px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- next up ---------- */
.nu-when { font-size: 13px; font-weight: 600; color: var(--nu, rgb(var(--ambient))); text-transform: uppercase; letter-spacing: .04em; }
.nu-title { font-size: clamp(16px, 9cqmin, 34px); font-weight: 700; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nu-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: auto; }
.nu-track { margin-top: 6px; }
.nu-track i { background: var(--nu, rgb(var(--ambient))); }
.w-nextup > :not(.nu-title) { flex-shrink: 0; }
@container (max-height: 110px) { .w-nextup .w-title { display: none; } .nu-title { -webkit-line-clamp: 1; font-size: clamp(15px, 14cqh, 22px); } .nu-meta { margin-top: 0; } .nu-track { margin-top: auto; } }

/* ---------- moon ---------- */
.mo-body { flex: 1; min-height: 0; display: flex; align-items: center; gap: 12px; }
.mo-disc { height: 100%; width: auto; aspect-ratio: 1; flex: 0 0 auto; }
.mo-dark { fill: #161b22; stroke: rgba(255, 255, 255, .08); }
.mo-lit { fill: #e8e4d8; filter: drop-shadow(0 0 6px rgba(232, 228, 216, .35)); }
.mo-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mo-name { font-size: 15px; }
.mo-ill { font-size: 13px; color: var(--muted); }
.mo-next { font-size: 12px; color: var(--muted); opacity: .85; }

/* ---------- word clock ---------- */
.w-wordclock { display: flex; flex-direction: column; justify-content: center; padding: 6px 8px; }
.wc-lead { font-size: clamp(12px, 6cqmin, 22px); color: var(--muted); letter-spacing: .02em; }
.wc-main { font-size: clamp(22px, 15cqmin, 76px); font-weight: 300; line-height: 1.02; letter-spacing: -.02em; }
.wc-main .hr { font-weight: 700; color: rgb(var(--ambient)); }
.wc-date { font-size: clamp(11px, 5cqmin, 18px); color: var(--muted); margin-top: .5em; }

/* ---------- smart stack ---------- */
.w-stack { position: relative; overflow: hidden; padding: 0; }
.stack-wrap { position: relative; width: 100%; height: 100%; overflow: hidden; }
.stack-item {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.98);
  transition: opacity 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}
.stack-item.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  z-index: 2;
}
.stack-item.prev {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px) scale(0.98);
  z-index: 1;
}
.stack-item > .w {
  width: 100%;
  height: 100%;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}
.stack-dots {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10;
  pointer-events: auto;
}
.stack-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease, border-radius 0.25s ease;
  border: none;
  padding: 0;
  outline: none;
}
.stack-dot:hover {
  background: rgba(255, 255, 255, 0.6);
}
.stack-dot.active, .stack-dot.on {
  width: 14px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.85);
}
.stack-dots.paused {
  border: 1px solid rgba(245, 158, 11, 0.55);
  background: rgba(20, 16, 8, 0.72);
}
.stack-dots.paused .stack-dot.active {
  background: #f59e0b;
}
.stack-pause {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  padding: 4px 6px;
  margin: -4px -5px -4px 1px;
  min-width: 24px;
  min-height: 22px;
  border-radius: 999px;
  cursor: pointer;
  outline: none;
  touch-action: manipulation;
}
.stack-pause::before {
  content: '';
  position: absolute;
  top: -6px; right: -8px; bottom: -6px; left: -2px;
}
.stack-pause svg {
  width: 10px;
  height: 10px;
  fill: currentColor;
  pointer-events: none;
}
.stack-pause .i-pause { display: block; }
.stack-pause .i-play { display: none; }
.stack-pause.on .i-pause { display: none; }
.stack-pause.on .i-play { display: block; }
.stack-pause:hover {
  color: rgba(255, 255, 255, 0.9);
}
.stack-pause:focus-visible {
  box-shadow: 0 0 0 1.5px #f59e0b;
}
.stack-pause.on {
  color: #f59e0b;
}



.q-dots { position: absolute; top: 10px; right: 14px; display: flex; gap: 5px; align-items: center; z-index: 10; pointer-events: auto; }
.q-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .25); cursor: pointer; transition: all .2s ease; }
.q-dot.active { background: var(--accent, #2dd4bf); transform: scale(1.3); }
.q-card.q-card-compact { padding: 8px 10px; }
.q-card.q-card-compact .q-head { margin-bottom: 2px; }
.q-rings.q-rings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 6px 14px;
  align-content: center;
  justify-content: center;
  padding: 2px 0;
}
.q-rings-grid .q-ring { width: 100%; justify-content: center; }
.q-rings-grid .q-dial { width: 86px; height: 86px; width: min(34cqh, 86px); height: min(34cqh, 86px); }
.q-rings-grid .q-pct { font-size: 22px; font-size: min(10cqh, 22px); }
.q-rings-grid .q-label { font-size: 11px; font-weight: 600; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.q-rings-grid .q-reset { font-size: 10px; color: var(--dim); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.q-rings-grid .q-pace { display: none; }
.q-grid { position: relative; }

/* ---------- GPU details ---------- */
.w-gpu { padding: 9px 12px 10px; display: flex; flex-direction: column; }
.gd-big { display: flex; align-items: baseline; gap: 3px; margin-top: 1px; min-width: 0; }
.gd-big b { font-size: clamp(18px, 15cqh, 34px); font-weight: 500; letter-spacing: -0.02em; }
.gd-big small { font-size: 12.5px; color: var(--muted); }
.gd-big .empty { height: auto; padding: 18px 0; }
.gd-temp { margin-inline-start: auto; font-size: 12px; color: #fdba74; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd-rows { margin-top: 6px; }
.gd-chips { margin: 8px 0 0; justify-content: flex-start; max-height: 48px; }
@container (max-height: 190px) { .w-gpu .gd-chips { display: none; } }
@container (max-height: 120px) { .w-gpu .gd-rows .meter:nth-child(n+2) { display: none; } }
/* app console: the focused app's keys, and a dial when the profile has one */
.w.ac { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); position: relative; }
.w.ac.ac-has-dial { grid-template-columns: minmax(0, 1fr) auto; }
.ac-title { grid-column: 1 / -1; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); grid-auto-rows: minmax(44px, 1fr); grid-gap: 8px; min-height: 0; overflow: hidden; }
.ac-key { border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; background: rgba(255, 255, 255, .06); color: var(--text); font: inherit; font-size: 15px; padding: 4px 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-key:active { background: rgba(255, 255, 255, .16); }
.ac-key:disabled { opacity: .45; }
.ac-dial { align-self: center; margin-left: 12px; width: 132px; height: 132px; border-radius: 50%; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; justify-content: center; touch-action: none; }
.ac-dial[hidden] { display: none; }
.ac-knob { width: 64%; height: 64%; border-radius: 50%; background: rgba(255, 255, 255, .1); position: relative; }
.ac-knob::after { content: ""; position: absolute; top: 8%; left: 50%; width: 4px; height: 22%; margin-left: -2px; border-radius: 2px; background: var(--accent, #60a5fa); }
.ac-note { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; }
.ac-note[hidden] { display: none; }
/* dictation: a big microphone button, what was heard, and a status line */
.w.dc { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10px; }
.dc-mic { width: 84px; height: 84px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .07); color: var(--text); display: flex; align-items: center; justify-content: center; flex: none; }
.dc-mic .ico { width: 38px; height: 38px; }
.dc-mic.on { background: var(--err, #ef4444); border-color: transparent; color: #fff; }
html.beat-3 .dc-mic.on { opacity: .7; }
.dc-text { margin-top: 10px; font-size: 16px; max-width: 100%; max-height: 4.2em; overflow-y: auto; touch-action: pan-y; word-break: break-word; }
.dc-text:empty { display: none; }
.dc-note { margin-top: 6px; font-size: 13px; color: var(--muted); }
/* Settings › Display › controls at the top (#181): the page dots and the Allow / Deny buttons move up, for a panel that
   stands below the screen, where the bottom edge is hard to reach */
body.controls-top #dots { bottom: auto; top: 0; }
body.controls-top #ptitle { top: 34px; }
/* the space the dots need moves from the bottom to the top */
body.controls-top .page { padding-top: 17px; padding-bottom: 10px; }
/* the header stays first; the buttons come right after it, above the request */
body.controls-top .ap-head { order: -2; }
body.controls-top .ap-foot { order: -1; margin-bottom: 4px; }

/* Spectrum bars (widgets/spectrum.js) */
.w-spectrum { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.w-spectrum .spec-wrap { flex: 1; min-height: 0; position: relative; }
.w-spectrum .spec-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; }
.w-spectrum .spec-msg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; pointer-events: none; }
.w-spectrum .spec-msg[hidden] { display: none; }


/* Note editor (tap a Note widget on the phone) */
.note-edit { position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.note-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; width: min(92vw, 560px); display: flex; flex-direction: column; gap: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.note-ta { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; line-height: 1.4; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); resize: vertical; }
.note-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* text for screen readers only (an icon-only element keeps its meaning) */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Steam library (widgets/steam-library.js): covers of the installed games, most recently played first */
.w-steam-library { padding: 9px 12px; display: flex; flex-direction: column; gap: 6px; }
.w-steam-library .w-title { color: #79a9e8; }
.sl-count { color: var(--dim); font-weight: 400; letter-spacing: 0; }
.sl-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 8px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(clamp(62px, 22cqh, 104px), 1fr)); scrollbar-width: none; }
.sl-grid::-webkit-scrollbar { display: none; }
.sl-tile { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 0; text-align: left; border-radius: 9px; transition: transform .12s; }
.sl-can-launch .sl-tile:active { transform: scale(.96); }
.sl-tile.busy { opacity: .55; }
.sl-cover { position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(160deg, #1e3a5f, #0f172a); border: 1px solid var(--line); }
.sl-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.sl-cover.has-art img { opacity: 1; }
.sl-initials { font-size: clamp(14px, 9cqh, 26px); font-weight: 800; color: rgba(255, 255, 255, .5); letter-spacing: .04em; }
.sl-name { font-size: 11px; line-height: 1.2; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-status { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-tile.running .sl-cover { border-color: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, .35); }
.sl-tile.running .sl-status { color: #4ade80; font-weight: 600; }
.sl-tile.armed .sl-cover { border-color: rgba(167, 139, 250, .8); box-shadow: 0 0 0 2px rgba(167, 139, 250, .35); }
.sl-tile.armed .sl-status { color: #ddd6fe; font-weight: 600; }
/* a favorite: a small gold corner on the cover */
.sl-tile.fav .sl-cover::after { content: ''; position: absolute; top: 0; right: 0; z-index: 1; border-style: solid; border-width: 0 14px 14px 0;
  border-color: transparent #fbbf24 transparent transparent; }
.sl-tile.sl-updating .sl-status, .sl-tile.sl-paused .sl-status, .sl-tile.sl-update .sl-status { color: #fbbf24; }
.sl-progress { position: absolute; left: 0; top: 0; height: 3px; background: #60a5fa; border-radius: 3px; transition: width .6s; }
/* a short library (two rows of the grid): covers sized to the height, the name only on the cover's own art */
@container (max-height: 175px) {
  .sl-grid { grid-template-columns: repeat(auto-fill, clamp(36px, calc((100cqh - 42px) * .66), 110px)); justify-content: start; }
  .sl-name, .sl-status { display: none; }
  .sl-tile.armed .sl-status { display: block; position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 9px;
    white-space: normal; background: rgba(0, 0, 0, .7); padding: 2px; }
}
/* Lyrics (widgets/lyrics.js): timed lines follow the song, the current one lit in the middle */
.w-lyrics { padding: 9px 12px 6px; display: flex; flex-direction: column; gap: 6px; }
.w-lyrics .w-title { color: rgb(var(--ambient)); }
.ly-list { position: relative; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); }
.ly-list::-webkit-scrollbar { display: none; }
.w-lyrics.timed .ly-list { padding: 40cqh 0; }
.ly-line { max-width: 96%; font-size: calc(clamp(13px, 9cqh, 26px) * var(--ly-scale, 1)); font-weight: 700; line-height: 1.35; padding: 3px 0; color: rgba(255, 255, 255, .32); transition: color .35s, transform .35s; transform-origin: left center; }
.ly-line.past { color: rgba(255, 255, 255, .2); }
.ly-line.now { color: var(--text); transform: scale(1.04); }
.ly-line.gap { color: rgba(255, 255, 255, .18); }
.w-lyrics.plain .ly-line { color: var(--text); font-weight: 500; font-size: calc(clamp(12px, 6.5cqh, 18px) * var(--ly-scale, 1)); }
.ly-note { font-size: 12px; color: var(--muted); text-align: center; }
.ly-note[hidden] { display: none; }
.w-lyrics:not(.timed):not(.plain) .ly-note { margin: auto; }
.ly-credit { position: absolute; right: 10px; top: 9px; font-size: 9px; letter-spacing: .1em; color: var(--dim); }

/* MODULYX: USB assistant on the "PC not connected" screen */
#usbHelp { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 7; width: min(560px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px; background: rgba(18, 20, 30, .96); border: 1px solid rgba(99, 102, 241, .55); color: var(--text); font-size: 14px; line-height: 1.4; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
body.night #usbHelp { z-index: 31; }
#usbHelp[hidden] { display: none; }
#usbHelp b { font-size: 15px; color: #A5B4FC; }
#usbHelp .usb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
#usbHelp button { min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .1); color: var(--text); font-size: 14px; font-weight: 600; }
#usbHelp button#usbDev { background: #6366F1; border-color: #6366F1; color: #fff; }

/* ==================================================================================================
   MODULYX theme "Nocturne Precision" (Settings › Display › Theme). Solid surfaces, crisp 1px strokes, no glow, no shadows.
   Tokens come from the MODULYX UI kit: canvas #0A0E17, card #111726, raised #182238, stroke #1E2638, indigo #6366F1, cyan #22D3EE.
   ================================================================================================== */
@font-face { font-family: "Inter MODULYX"; src: url("Inter-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
body[data-theme="modulyx"] {
  --bg: #0A0E17; --card: #111726; --card-hi: #182238; --line: #1E2638;
  --text: #F1F5F9; --muted: #8B93A7; --dim: #5C667B;
  --cpu: #22D3EE; --gpu: #34D399; --ram: #818CF8; --net: #FBBF24; --up: #6366F1;
  --ok: #34D399; --err: #F87171; --warn: #FBBF24; --ambient: 99, 102, 241;
  font-family: "Inter MODULYX", Inter, Roboto, "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "tnum" 1;
}
body[data-theme="modulyx"]::before { display: none; }                     /* no ambient glow */
body[data-theme="modulyx"] .card { box-shadow: none; }                      /* depth by surface tiers and 1px strokes only */
body[data-theme="modulyx"] .w-title { font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--c, var(--muted)); }
body[data-theme="modulyx"] button, body[data-theme="modulyx"] input, body[data-theme="modulyx"] select, body[data-theme="modulyx"] textarea { font-family: inherit; }

/* ---- MODULYX theme: components (shared by every widget) ---- */
body[data-theme="modulyx"] .bar::before { height: 6px; border-radius: 99px; background: var(--card-hi); }
body[data-theme="modulyx"] .fill { height: 6px; border-radius: 99px; background: linear-gradient(90deg, #6366F1, #22D3EE); }
body[data-theme="modulyx"] .fill::after { right: -9px; top: -6px; width: 18px; height: 18px; background: var(--text); border: 2px solid var(--card); box-sizing: border-box; }
body[data-theme="modulyx"] .bar.scrubbing .fill::after, body[data-theme="modulyx"] .bar:focus-visible .fill::after { box-shadow: none; transform: scale(1.25); }
body[data-theme="modulyx"] .track { height: 6px; border-radius: 99px; background: var(--card-hi); }
body[data-theme="modulyx"] .track i { border-radius: 99px; }
body[data-theme="modulyx"] .chip { background: var(--card-hi); border: 1px solid var(--line); color: var(--muted); border-radius: 8px; font-weight: 600; }
body[data-theme="modulyx"] .chip-btn { background: var(--card-hi); border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
body[data-theme="modulyx"] .seg { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
body[data-theme="modulyx"] .seg button.on { background: var(--card-hi); box-shadow: 0 0 0 1px var(--line) inset; color: var(--text); }
body[data-theme="modulyx"] .ic { border-radius: 12px; }
body[data-theme="modulyx"] .ic:active { background: var(--card-hi); }
body[data-theme="modulyx"] .ic.play { border-radius: 50%; background: #6366F1; color: #F1F5F9; }
body[data-theme="modulyx"] .ic.play:active { background: #4F46E5; }

/* ---- MODULYX theme: widgets ---- */
/* clock: semibold, tight, as the kit's display numerals */
body[data-theme="modulyx"] .clock { font-weight: 500; letter-spacing: -0.035em; }
body[data-theme="modulyx"] .clock .sec { font-weight: 500; }
/* statistic tiles: big semibold numeral, unit as a small caps badge */
body[data-theme="modulyx"] .w-stat { padding: clamp(8px, 9cqh, 16px) clamp(10px, 6cqw, 18px); }
body[data-theme="modulyx"] .t-val b { font-weight: 600; letter-spacing: -0.03em; }
body[data-theme="modulyx"] .t-val small { font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
body[data-theme="modulyx"] .w-stat .t-val, body[data-theme="modulyx"] .w-stat .t-sub { text-shadow: none; }
body[data-theme="modulyx"] .w-stat canvas { opacity: .85; }
/* media */
body[data-theme="modulyx"] .m-title { font-weight: 600; letter-spacing: -0.015em; }
/* shortcut keys: uniform solid tile, icon on top, name below, shortcut colour only on the icon and the active border */
body[data-theme="modulyx"] .deck-grid { gap: 12px; }
body[data-theme="modulyx"] .key { background: var(--card); border: 1px solid var(--line); border-radius: 16px; align-items: flex-start; justify-content: space-between; padding: clamp(10px, 6cqmin, 20px); }
body[data-theme="modulyx"] .key.k-isz-max { padding: 0; }
body[data-theme="modulyx"] .key .k-icon { color: var(--k, var(--cpu)); }
body[data-theme="modulyx"] .key .k-label { align-self: stretch; text-align: start; font-weight: 600; color: var(--text); max-width: 100%; font-size: clamp(12px, 4.6cqmin, 22px); }
body[data-theme="modulyx"] .key:active { filter: none; background: var(--card-hi); border-color: var(--k, var(--cpu)); }

/* ---- MODULYX theme: rings, gauges and the palette of colours written inline by the widgets ---- */
body[data-theme="modulyx"] .g-dial .bg, body[data-theme="modulyx"] .q-dial .bg { stroke: var(--card-hi); stroke-width: 8; }
body[data-theme="modulyx"] .g-dial .fg, body[data-theme="modulyx"] .q-dial .fg { stroke-width: 8; filter: none; }
body[data-theme="modulyx"] .q-dial { width: min(56cqh, 250px); }
body[data-theme="modulyx"] .q-dial .pace { stroke: var(--text); }
body[data-theme="modulyx"] .g-val { font-weight: 600; letter-spacing: -0.03em; }
body[data-theme="modulyx"] .g-label { letter-spacing: .08em; font-weight: 600; }
body[data-theme="modulyx"] .g-sub.hot { color: var(--err); }
body[data-theme="modulyx"] [style*="#84cc16" i] { --q: #34D399 !important; --qc: #34D399 !important; --c: #34D399 !important; }
body[data-theme="modulyx"] [style*="#22c55e" i] { --q: #34D399 !important; --qc: #34D399 !important; --c: #34D399 !important; }
body[data-theme="modulyx"] [style*="#4ade80" i] { --q: #34D399 !important; --qc: #34D399 !important; --c: #34D399 !important; }
body[data-theme="modulyx"] [style*="#f97316" i] { --q: #FBBF24 !important; --qc: #FBBF24 !important; --c: #FBBF24 !important; }
body[data-theme="modulyx"] [style*="#f59e0b" i] { --q: #FBBF24 !important; --qc: #FBBF24 !important; --c: #FBBF24 !important; }
body[data-theme="modulyx"] [style*="#facc15" i] { --q: #FBBF24 !important; --qc: #FBBF24 !important; --c: #FBBF24 !important; }
body[data-theme="modulyx"] [style*="#eab308" i] { --q: #FBBF24 !important; --qc: #FBBF24 !important; --c: #FBBF24 !important; }
body[data-theme="modulyx"] [style*="#ef4444" i] { --q: #F87171 !important; --qc: #F87171 !important; --c: #F87171 !important; }
body[data-theme="modulyx"] [style*="#2dd4bf" i] { --q: #22D3EE !important; --qc: #22D3EE !important; --c: #22D3EE !important; }
body[data-theme="modulyx"] [style*="#38bdf8" i] { --q: #22D3EE !important; --qc: #22D3EE !important; --c: #22D3EE !important; }
body[data-theme="modulyx"] [style*="#a78bfa" i] { --q: #818CF8 !important; --qc: #818CF8 !important; --c: #818CF8 !important; }
body[data-theme="modulyx"] [style*="#60a5fa" i] { --q: #818CF8 !important; --qc: #818CF8 !important; --c: #818CF8 !important; }

/* ---- MODULYX theme: sliders and Control Deck ---- */
body[data-theme="modulyx"] input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(to right, #22D3EE var(--p, 50%), var(--card-hi) var(--p, 50%)); }
body[data-theme="modulyx"] input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -8px; background: var(--text); border: 2px solid var(--card); box-sizing: border-box; box-shadow: none; }
body[data-theme="modulyx"] .deck-slider { accent-color: #22D3EE; }
body[data-theme="modulyx"] .deck-button, body[data-theme="modulyx"] .deck-hold { background: var(--card-hi); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-weight: 600; min-height: 44px; }
body[data-theme="modulyx"] .deck-button:active, body[data-theme="modulyx"] .deck-hold:active { border-color: #22D3EE; }

/* ---- MODULYX theme: other widgets ---- */
body[data-theme="modulyx"] .w-pomodoro { --q: #6366F1; }
body[data-theme="modulyx"] .w-pomodoro.brk { --q: #34D399; }
body[data-theme="modulyx"] .w-pomodoro.long { --q: #22D3EE; }
body[data-theme="modulyx"] .w-note { background: color-mix(in srgb, var(--n, #fbbf24) 10%, var(--card)); border-color: color-mix(in srgb, var(--n, #fbbf24) 30%, var(--line)); }
body[data-theme="modulyx"] .wc-t { font-weight: 500; letter-spacing: -0.03em; }
body[data-theme="modulyx"] .gh-pr { font-size: 13px; height: 26px; }
body[data-theme="modulyx"] .gh-sec { font-size: 11px; letter-spacing: .08em; }
body[data-theme="modulyx"] .gh-pr .ci.SUCCESS { color: var(--ok); }
body[data-theme="modulyx"] .gh-pr .ci.FAILURE, body[data-theme="modulyx"] .gh-pr .ci.ERROR { color: var(--err); }
body[data-theme="modulyx"] .gh-pr .ci.PENDING, body[data-theme="modulyx"] .gh-pr .ci.EXPECTED { color: var(--warn); }

/* ---- MODULYX theme: text scale (small-text widgets get larger, using the panel's own --widget-font-scale) ---- */
body[data-theme="modulyx"] .control-deck, body[data-theme="modulyx"] .w-sessions, body[data-theme="modulyx"] .w-github, body[data-theme="modulyx"] .w-feeds, body[data-theme="modulyx"] .w-inbox, body[data-theme="modulyx"] .w-hackernews, body[data-theme="modulyx"] .w-agenda, body[data-theme="modulyx"] .w-checklist, body[data-theme="modulyx"] .w-rules, body[data-theme="modulyx"] .w-topprocs, body[data-theme="modulyx"] .w-command, body[data-theme="modulyx"] .w-docker, body[data-theme="modulyx"] .w-obs, body[data-theme="modulyx"] .w-batteries, body[data-theme="modulyx"] .w-exchange, body[data-theme="modulyx"] .w-crypto, body[data-theme="modulyx"] .w-nextup { --widget-font-scale: 1.2; }
/* ON AIR: a flat state indicator, no glow */
body[data-theme="modulyx"] .w-onair.on .oa-sign { background: var(--err); border-color: var(--err); color: #0A0E17; box-shadow: none; }
body[data-theme="modulyx"] html.beat-4 .w-onair.on .oa-sign, html.beat-4 body[data-theme="modulyx"] .w-onair.on .oa-sign { box-shadow: none; }
body[data-theme="modulyx"] .w-onair.on .oa-sub { color: var(--err); }