Skip to content

All your computers and your phone/iPhone, working as one desk. Screens, apps, files, clipboard, calls, texts, notifications, mouse and keyboard, shared between Mac, Windows, Linux , Android, Web and ios / ipados . Free and open source. No account, no cloud, and no shared network needed.

30.0 KB
Raw Blame
/* TwinDesk — Copyright (C) 2026 inukaasith. GPL-3.0, see LICENSE.
   Calls, Messages, Photos and Phone Files pages (ui-calls.js, ui-messages.js, ui-media.js,
   ui-pfiles.js) on the Mac, PC and Linux, with the app's own colours (control.css / app.css); then the call window (callpop.html),
   which has none of its own. Also: pages that need Wi-Fi, over Bluetooth (the shells' wifiOnly). */

/* ---------- Bluetooth: pages that need Wi-Fi ---------- */
.page .wifi-note { margin-bottom: 16px; }
.nav-item .state.warn::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }

/* ---------- shared ---------- */
.hub-top { align-items: center; }
.hub-top-body { flex: 1; min-width: 0; }
.hub-top-body .hint { margin-top: 4px; color: var(--muted); font-size: 12px; }
.hub-top-actions { display: flex; gap: 8px; flex: none; }
.hub-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--track-off) center / cover no-repeat; color: var(--muted); font-weight: 600; font-size: 13px;
}
.hub-input {
  padding: 5px 9px; border-radius: 6px; border: 1px solid var(--control-line); background: var(--control); color: var(--text);
  box-shadow: var(--shadow); font: inherit; user-select: text; min-width: 0;
}
.hub-input:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.hub-list .row .text { overflow: hidden; }
.hub-list .row .label, .hub-list .row .hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-empty { padding: 14px; color: var(--muted); text-align: center; }
.hub-missed { color: var(--bad); }
.hub-grow { flex: 1; min-width: 0; }

/* ---------- Calls ---------- */
.hub-call .hub-avatar { width: 40px; height: 40px; font-size: 16px; }
.hub-call .label { font-weight: 600; font-size: 15px; }
.hub-call .hint { font-variant-numeric: tabular-nums; }
.hub-dial .hub-input { flex: 1; }
.hub-number { font-size: 15px; letter-spacing: 0.5px; font-variant-numeric: tabular-nums; }
.hub-dial .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.hub-keypad { display: grid; grid-template-columns: repeat(3, 64px); gap: 10px 18px; justify-content: center; padding: 8px 0 14px; }
.hub-keypad[hidden] { display: none; }
.hub-key {
  height: 48px; width: 64px; border-radius: 24px; border: 0; padding: 0; background: var(--track-off); color: var(--text);
  font: inherit; font-size: 20px; line-height: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: default;
}
.hub-key small { font-size: 9px; letter-spacing: 1.5px; color: var(--muted); min-height: 9px; }
.hub-key:hover { filter: brightness(0.94); }
.hub-key:active { filter: brightness(0.86); }
.hub-key-call { background: var(--good); color: #fff; }
.hub-key-call svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.hub-key-del { background: none; font-size: 18px; color: var(--muted); }
.hub-scroll { max-height: 380px; overflow-y: auto; }
.hub-more { display: flex; justify-content: center; padding: 6px; }
.hub-more:has(> [hidden]) { display: none; }
.hub-starred::after { content: " ★"; color: var(--warn); font-size: 11px; }
.hub-list .row select { max-width: 250px; }

/* ---------- Messages ---------- */
.hub-msgs { display: flex; height: calc(100vh - 170px); min-height: 360px; } /* the window's height, maximized or not */
.hub-side { width: clamp(260px, 26%, 360px); flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; }
.hub-side-head { display: flex; justify-content: flex-end; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.hub-threads { flex: 1; overflow-y: auto; padding: 4px; }
.hub-thread {
  display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px; border: 0; border-radius: 8px;
  background: none; text-align: left; color: inherit; font: inherit; cursor: default;
}
.hub-thread:hover { background: var(--nav-hover); }
.hub-thread.active { background: var(--accent); color: #fff; }
.hub-thread.active .hub-thread-snippet, .hub-thread.active .hub-thread-time { color: rgba(255, 255, 255, 0.8); }
.hub-thread-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hub-thread-top { display: flex; gap: 6px; align-items: baseline; }
.hub-thread-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-thread.unread .hub-thread-name { font-weight: 700; }
.hub-thread-time { font-size: 11px; color: var(--faint); flex: none; }
.hub-thread-snippet { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hub-conv { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.hub-conv[hidden], .hub-conv-empty[hidden] { display: none; }
.hub-conv-empty { flex: 1; align-self: center; }
.hub-conv-head { padding: 10px 14px; border-bottom: 1px solid var(--line); min-height: 44px; display: flex; flex-direction: column; justify-content: center; }
.hub-conv-name { font-weight: 600; }
.hub-to { width: 100%; }
.hub-conv-scroll { flex: 1; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; }
.hub-conv-scroll > .btn { align-self: center; margin-bottom: 8px; }
.hub-bubbles { display: flex; flex-direction: column; gap: 4px; }
.hub-day { align-self: center; font-size: 11px; color: var(--faint); margin: 10px 0 4px; }
.hub-bubble {
  max-width: min(72%, 680px); padding: 7px 11px; border-radius: 16px; line-height: 1.35; user-select: text;
  white-space: pre-wrap; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 4px;
}
.hub-bubble.in { align-self: flex-start; background: var(--track-off); border-bottom-left-radius: 5px; }
.hub-bubble.out { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.hub-bubble.failed { background: var(--bad); }
.hub-from { font-size: 11px; font-weight: 600; color: var(--muted); }
.hub-status { font-size: 11px; opacity: 0.8; }
.hub-pic { max-width: 260px; max-height: 260px; border-radius: 10px; background: rgba(0, 0, 0, 0.08); min-width: 60px; min-height: 60px; }
.hub-group-note { padding: 10px 14px; border-top: 1px solid var(--line); text-align: center; }
.hub-group-note[hidden], .hub-compose-row[hidden] { display: none; }
.hub-compose-row { display: flex; gap: 8px; align-items: flex-end; padding: 10px 14px; border-top: 1px solid var(--line); }
.hub-compose {
  flex: 1; resize: none; padding: 6px 10px; border-radius: 16px; border: 1px solid var(--control-line);
  background: var(--control); color: var(--text); font: inherit; line-height: 1.35; max-height: 140px; user-select: text;
}
.hub-compose-col { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hub-compose-col > .hub-compose { flex: none; }
.hub-attach { position: relative; align-self: flex-start; }
.hub-attach[hidden], .hub-attach-btn[hidden] { display: none; }
.hub-attach-img { display: block; max-width: 120px; max-height: 90px; border-radius: 8px; border: 1px solid var(--line); }
.hub-attach-x {
  position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; border: none; padding: 0;
  background: var(--text); color: var(--bg, #fff); font-size: 14px; line-height: 20px; cursor: pointer;
}
.hub-attach-btn { font-size: 18px; line-height: 1; min-width: 32px; }
.hub-conv.hub-drop { box-shadow: inset 0 0 0 2px var(--accent); }
.hub-compose:focus { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
@media (max-width: 760px) { .hub-side { width: 200px; } }

/* Messages and Calls use the whole window (the app's other pages keep their reading width: #pages
   in app.css / control.css). Calls' cards flow into as many columns as fit, its lists as tall as the window. */
#pages:has(> #page-messages:not([hidden])), #pages:has(> #page-calls:not([hidden])) { max-width: none; }
/* Messages: the conversation fills what's left of the window below the notes, its compose row always in view. */
#pages:has(> #page-messages:not([hidden])) { min-height: 100%; box-sizing: border-box; display: flex; flex-direction: column; }
#page-messages:not([hidden]), #page-messages .page-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#page-messages .hub-msgs { flex: 1 0 360px; height: auto; min-height: 360px; }
#page-calls .calls-main { column-width: 400px; column-gap: 16px; }
#page-calls .calls-main > * { break-inside: avoid; }
#page-calls .hub-scroll { max-height: max(380px, calc(100vh - 330px)); }

/* ---------- Photos ---------- */
.hub-media[hidden] { display: none; }
.hub-media-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 3px; border-radius: 10px; overflow: hidden; }
.hub-tile {
  position: relative; aspect-ratio: 1; padding: 0; border: 0; margin: 0; overflow: hidden; cursor: default;
  background: var(--track-off);
}
.hub-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hub-tile img:not([src]) { visibility: hidden; }
.hub-tile:hover img { filter: brightness(0.92); }
.hub-dur {
  position: absolute; right: 5px; bottom: 5px; padding: 1px 5px; border-radius: 4px; font-size: 11px;
  background: rgba(0, 0, 0, 0.55); color: #fff; font-variant-numeric: tabular-nums;
}
.hub-check { display: none; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, 0.25); }
.hub-media.selecting .hub-check { display: block; }
.hub-tile.chosen .hub-check { background: var(--accent); }
.hub-tile.chosen img { opacity: 0.8; }
.hub-sentinel { height: 1px; }
.hub-grid .hub-empty { grid-column: 1 / -1; }
.hub-viewer {
  position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, 0.88); display: flex; flex-direction: column;
  -webkit-app-region: no-drag;
}
.hub-viewer[hidden] { display: none; }
.hub-viewer-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
.hub-big { max-width: calc(100% - 120px); max-height: 100%; object-fit: contain; border-radius: 4px; transform-origin: center; transition: transform 0.08s linear; user-select: none; }
.hub-big.zoomed { cursor: grab; transition: none; }
.hub-big.zoomed:active { cursor: grabbing; }
.hub-viewer-stage { overflow: hidden; }
/* The viewer's bar: icon buttons, their names as tooltips; .says shows the words too */
.hub-viewer-bar .ibtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 34px; padding: 0 9px; }
.hub-viewer-bar .ibtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hub-viewer-bar .ibtn:not(.says) .ibtn-label { display: none; }
.hub-viewer-bar .ibtn[hidden] { display: none; }
/* Right click on a photo */
.hub-menu { position: fixed; z-index: 1000; min-width: 190px; padding: 5px; border-radius: 10px; background: var(--content, #1e1e1f); -webkit-backdrop-filter: blur(24px) saturate(1.4); backdrop-filter: blur(24px) saturate(1.4); /* solid: glass makes --card almost clear */ border: 1px solid var(--line, #8884); box-shadow: 0 10px 30px rgba(0,0,0,.35); display: flex; flex-direction: column; }
.hub-menu-item { text-align: left; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.hub-menu-item:hover:not([disabled]), .hub-menu-item:focus-visible { background: var(--accent-soft, rgba(10,132,255,.2)); outline: none; }
.hub-menu-item[disabled] { opacity: .45; cursor: default; }
.hub-menu-sep { height: 1px; margin: 4px 6px; background: var(--line, #8884); }
.hub-viewer-stage .btn { font-size: 20px; padding: 6px 14px; }
.hub-viewer-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: #fff; background: rgba(0, 0, 0, 0.4); }
.hub-viewer-bar .hint { color: rgba(255, 255, 255, 0.7); }
.hub-big-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Phone Files ---------- */
.hub-fs[hidden], .hub-fs-sel[hidden], .hub-fs-new[hidden] { display: none; }
.hub-fs.over .card { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.hub-crumbs { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; flex-wrap: wrap; }
.hub-crumb {
  border: 0; background: none; color: var(--accent); font: inherit; padding: 2px 4px; border-radius: 5px; cursor: default;
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hub-crumb:hover:not(:disabled) { background: var(--nav-hover); }
.hub-crumb:disabled { color: var(--text); font-weight: 600; }
.hub-crumb-sep { color: var(--faint); }
.hub-fs-sel { padding: 6px 10px; border-radius: 8px; background: var(--accent-soft); }
.hub-fs-row { gap: 10px; }
.hub-fs-row.chosen { background: var(--accent-soft); }
.hub-fs-check { flex: none; margin: 0; }
.hub-fs-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-linejoin: round; }
.hub-fs-ico.dir { stroke: var(--accent); fill: var(--accent-soft); }
.hub-fs-status { margin-top: 8px; }
.hub-media-bar .btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---------- the call window ---------- */
body.callpop {
  --text: #1d1d1f; --muted: #6e6e73; --card: #ffffff; --line: rgba(0, 0, 0, 0.08); --track-off: rgba(0, 0, 0, 0.1);
  --good: #30b94d; --bad: #e5373a; --accent: #0a84ff; --control: #f2f2f5;
  margin: 0; height: 100vh; overflow: hidden; background: var(--card); color: var(--text);
  font: 13px -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Ubuntu, sans-serif;
  -webkit-user-select: none; user-select: none; -webkit-app-region: drag;
}
@media (prefers-color-scheme: dark) {
  body.callpop { --text: #f5f5f7; --muted: #98989d; --card: #2a2a2c; --line: rgba(255, 255, 255, 0.08); --track-off: rgba(255, 255, 255, 0.14); --control: #3a3a3c; }
}
.cp { position: relative; height: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); }
.cp-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--track-off) center / cover no-repeat; color: var(--muted); font-size: 20px; font-weight: 600;
}
.cp-text { flex: 1; min-width: 0; -webkit-app-region: no-drag; cursor: default; }
.cp-who { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-sub { color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-buttons { display: flex; gap: 8px; flex: none; -webkit-app-region: no-drag; }
.cp-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: default;
  background: var(--control); color: var(--text);
}
.cp-btn[hidden] { display: none; }
.cp-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cp-btn.good { background: var(--good); color: #fff; }
.cp-btn.bad { background: var(--bad); color: #fff; }
.cp-btn.on { background: var(--accent); color: #fff; }
.cp-btn:active { filter: brightness(0.9); }
.cp-x {
  position: absolute; top: 3px; right: 6px; border: 0; background: none; color: var(--muted); font-size: 15px; line-height: 1;
  padding: 2px 4px; cursor: default; -webkit-app-region: no-drag; opacity: 0; transition: opacity 0.15s;
}
.cp:hover .cp-x { opacity: 1; }
body.callpop.missed .cp-sub { color: var(--bad); }

/* The phone's media controls (ui-nowplaying.js): on the right of the Phone page's card. */
.np { --np-tint: transparent; position: relative; margin: 14px 4px 2px; padding: 10px 12px; border-radius: 12px; background: var(--hover); text-align: left; overflow: hidden; isolation: isolate; }
/* The art's colour washed in from the art's side (General › Colour from the artwork). */
.np.tinted::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, rgb(from var(--np-tint) r g b / 0.42), rgb(from var(--np-tint) r g b / 0.1) 75%); }
.np-top { display: flex; align-items: center; gap: 12px; }
.phone-hero .np { margin: 0 0 0 auto; flex: 0 1 380px; min-width: 240px; }
.np[hidden] { display: none; }
.np-art { width: 52px; height: 52px; flex: none; border-radius: 8px; background: var(--track-off) center / cover no-repeat; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.np.open .np-art { transform: scale(1.06); }
.np-art.none { background-image: linear-gradient(135deg, #bf5af2, #ff375f) !important; }
.np-main { flex: 1; min-width: 0; }
.np-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-sub { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.np-pos { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.np-pos[hidden], .np-volbox[hidden] { display: none; }
/* Seek and volume: the old thin bar, now a range: filled to --np-k, a thumb that shows on hover. */
.np-range { -webkit-appearance: none; appearance: none; flex: 1; min-width: 40px; height: 12px; margin: 0; background: transparent; cursor: pointer; --np-k: 0%; }
.np-range:disabled { cursor: default; }
.np-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) var(--np-k), var(--track-off) var(--np-k)); }
.np-range::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; margin-top: -3.5px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); transform: scale(0); transition: transform 0.15s; }
.np-range:hover::-webkit-slider-thumb, .np-range:focus-visible::-webkit-slider-thumb, .np-range:active::-webkit-slider-thumb { transform: scale(1); }
.np-range:disabled::-webkit-slider-thumb { transform: scale(0) !important; }
.np-range:focus-visible { outline: none; }
.np-time { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; flex: none; }
.np-ctl { display: flex; align-items: center; gap: 2px; flex: none; }
.np-btn { width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; display: grid; place-items: center; cursor: pointer; padding: 0; color: var(--text); }
.np-btn:hover:not(:disabled) { background: var(--track-off); }
.np-btn:disabled { opacity: 0.35; cursor: default; }
.np-btn[hidden] { display: none; }
.np-btn svg { width: 18px; height: 18px; fill: var(--text); stroke: var(--text); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.np-btn svg text { fill: var(--text); font-weight: 700; font-family: inherit; }
/* The chevron: turns over as the drawer opens. */
.np-more { width: 26px; height: 26px; margin-left: 2px; opacity: 0.7; }
.np-more:hover { opacity: 1; }
.np-more svg { width: 15px; height: 15px; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.np.open .np-more svg { transform: rotate(180deg); }
/* The drawer: slides open (its row's height from 0 to its own), fading and rising in. */
.np-drawer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.np.open .np-drawer { grid-template-rows: 1fr; }
.np-drawer-in { min-height: 0; overflow: hidden; }
.np-tools { display: flex; align-items: center; gap: 6px; padding: 8px 0 0 64px; opacity: 0; transform: translateY(-6px); transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.np.open .np-tools { opacity: 1; transform: none; transition-delay: 0.06s; }
.np-skip { width: 30px; height: 30px; }
.np-skip svg { width: 18px; height: 18px; }
.np-volbox { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; margin-left: 4px; }
.np-ico svg { width: 14px; height: 14px; fill: var(--muted); stroke: var(--muted); stroke-width: 1.4; stroke-linejoin: round; display: block; }
.np-out { width: 30px; height: 30px; flex: none; }
.np-out svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); }
.np-out.on svg { stroke: var(--accent); }
.phone-hero .np-tools { padding-left: 0; }
@media (prefers-reduced-motion: reduce) { .np-drawer, .np-tools, .np-more svg, .np-art { transition: none !important; } }
/* Glass: the card a clear pane with the lit rim, the tint glowing through it. */
.glass .np { background: linear-gradient(180deg, var(--sheen), transparent 40%), var(--control); box-shadow: var(--rim); }
/* General's media rows (UI.mediaControlsRow): two rows in a box, lined as the card's own. */
.row + .np-rows > .row:first-child::before, .np-rows + .row::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--row-line); }

/* ---------- a phone's notification in TwinDesk's window (notifpop.js) ---------- */
body.notifpop {
  --text: #1d1d1f; --muted: #6e6e73; --card: #ffffff; --line: rgba(0, 0, 0, 0.08); --track-off: rgba(0, 0, 0, 0.1);
  --accent: #0a84ff; --control: #f2f2f5;
  margin: 0; overflow: hidden; background: var(--card); color: var(--text);
  font: 13px -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Ubuntu, sans-serif;
  -webkit-user-select: none; user-select: none;
}
@media (prefers-color-scheme: dark) {
  body.notifpop { --text: #f5f5f7; --muted: #98989d; --card: #2a2a2c; --line: rgba(255, 255, 255, 0.08); --track-off: rgba(255, 255, 255, 0.14); --control: #3a3a3c; }
}
.npop { box-sizing: border-box; padding: 10px 14px 12px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; animation: npop-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes npop-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .npop { animation: none; } }
.npop [hidden] { display: none !important; }
.npop-head { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.npop-icon { width: 16px; height: 16px; border-radius: 4px; flex: none; background: center / cover no-repeat; }
.npop-icon.none { background-image: linear-gradient(135deg, #64d2ff, #0a84ff); }
.npop-app { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.npop-time { flex: none; font-variant-numeric: tabular-nums; }
.npop-x { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; cursor: default; opacity: 0.6; }
.npop-x:hover { opacity: 1; }
.npop-main { display: flex; gap: 10px; align-items: flex-start; cursor: default; outline: none; }
.npop-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; background: var(--track-off) center / cover no-repeat; }
.npop-text { flex: 1; min-width: 0; }
.npop-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.npop-body { margin-top: 2px; white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; word-break: break-word; }
.npop-pic { display: block; width: 100%; max-height: 200px; object-fit: cover; border-radius: 8px; background: var(--track-off); }
.npop-live { display: flex; align-items: center; gap: 8px; }
.npop-track { flex: 1; height: 4px; border-radius: 2px; background: var(--track-off); overflow: hidden; position: relative; }
.npop-fill { height: 100%; width: 0; border-radius: 2px; background: var(--accent); transition: width 0.4s ease; }
.npop-live.ind .npop-fill { width: 35%; position: absolute; animation: npop-ind 1.2s ease-in-out infinite; }
@keyframes npop-ind { from { left: -35%; } to { left: 100%; } }
.npop-pct { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; flex: none; min-width: 30px; text-align: right; }
.npop-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.npop-btn { border: 0; border-radius: 7px; padding: 5px 11px; background: var(--control); color: var(--text); font: inherit; cursor: default; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.npop-btn:hover { filter: brightness(0.96); }
.npop-btn.primary { background: var(--accent); color: #fff; }
.npop-btn.done { background: #30b94d; color: #fff; }
.npop-reply { display: flex; gap: 6px; margin: 0; }
.npop-reply input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 5px 9px; background: var(--control); color: var(--text); font: inherit; outline: none; -webkit-user-select: text; user-select: text; }
.npop-reply input:focus { border-color: var(--accent); }
/* Capsule (Notifications › Look, #355): a pill at the top centre that opens into the card on hover.
   The window is transparent; the pill keeps 4px for its shadow. */
body.notifpop.capsule { background: transparent; padding: 4px; }
.capsule .npop { border-radius: 22px; background: var(--card); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); padding: 8px 14px; transition: border-radius 0.2s ease; animation-name: npop-drop; }
@keyframes npop-drop { from { opacity: 0; transform: translateY(-10px) scale(0.96); } }
.capsule.open .npop { border-radius: 16px; padding: 10px 14px 12px; }
.capsule:not(.open) .npop { flex-direction: row; align-items: center; gap: 10px; }
.capsule:not(.open) .npop-head { flex: none; }
.capsule:not(.open) .npop-head > :not(.npop-icon) { display: none; }
.capsule:not(.open) .npop-icon { width: 22px; height: 22px; border-radius: 6px; }
.capsule:not(.open) .npop-main { flex: 1; min-width: 0; align-items: center; }
.capsule:not(.open) .npop-avatar { width: 24px; height: 24px; }
.capsule:not(.open) .npop-text { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.capsule:not(.open) .npop-title { flex: none; max-width: 45%; }
.capsule:not(.open) .npop-body { margin: 0; flex: 1; min-width: 0; white-space: nowrap; text-overflow: ellipsis; display: block; color: var(--muted); }
.capsule:not(.open) .npop-pic, .capsule:not(.open) .npop-buttons, .capsule:not(.open) .npop-reply { display: none !important; }
.capsule:not(.open) .npop-live { flex: none; width: 54px; }
.capsule:not(.open) .npop-pct { display: none; }

/* Notifications › Showing here (ui-notifrules.js). */
.notif-hours { display: inline-flex; align-items: center; gap: 6px; }
.notif-time { font: inherit; color: var(--text); background: var(--control); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.notif-apps-head { padding: 10px 14px 2px; text-transform: none; }
.notif-apps-head[hidden] { display: none; }
.row > .notif-app-ico { width: 24px; height: 24px; border-radius: 6px; flex: none; font-size: 11px; }

/* Messages: search over each list, a chat's app on its picture, Delete, and which apps show. */
.hub-side-head { gap: 6px; align-items: center; }
.hub-search { flex: 1; min-width: 0; padding: 5px 9px; }
.hub-avatar-wrap { position: relative; flex: none; display: inline-flex; }
.hub-avatar-app { position: absolute; right: -2px; bottom: -2px; width: 15px; height: 15px; border-radius: 4px; box-shadow: 0 0 0 1.5px var(--card); background: var(--card); }
.hub-conv-head { flex-direction: row; justify-content: flex-start; align-items: center; gap: 10px; }
.hub-conv-head > .hub-to { flex: 1; }
.hub-conv-title { flex: 1; min-width: 0; }
.hub-del { flex: none; }
.msg-apps { margin: 0 0 12px; border-radius: 10px; background: var(--card); box-shadow: var(--card-shadow, none); border: 1px solid var(--line); overflow: hidden; }
.msg-apps[hidden] { display: none; }
.msg-apps-btn { opacity: 0.8; }

/* Photos' albums (ui-media.js): a list on the left, each with its cover and count. */
.hub-media.with-albums { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.hub-media-main { min-width: 0; }
.hub-albums { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 140px); overflow-y: auto; padding: 6px; border-radius: 12px; background: var(--card); box-shadow: var(--card-shadow, none); border: 1px solid var(--line); }
.hub-albums[hidden] { display: none; }
.hub-album { display: flex; align-items: center; gap: 10px; padding: 6px; border: 0; border-radius: 8px; background: none; color: var(--text); text-align: left; cursor: default; font: inherit; }
.hub-album:hover { background: var(--hover); }
.hub-album.on { background: var(--sel-bg, var(--accent-soft)); box-shadow: var(--sel-shadow, none); }
.hub-album-pic { width: 40px; height: 40px; flex: none; border-radius: 7px; background: var(--track-off) center / cover no-repeat; }
.hub-album-pic.all { background-image: linear-gradient(135deg, #ffd60a, #ff9f0a); }
.hub-album-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hub-album-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.hub-album-n { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .hub-media.with-albums { grid-template-columns: 1fr; } .hub-albums { position: static; flex-direction: row; overflow-x: auto; max-height: none; } .hub-album { flex: none; } }
/* Messages and Calls: the pills (Messages) and the gear on one line, the gear at its end even with no pills. */
.msg-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.msg-bar > .msg-pills { margin: 0; flex: 1; min-width: 0; }
.msg-bar > .gear-btn { width: 34px; height: 34px; padding: 6px; margin-left: auto; }
.msg-bar > .gear-btn svg { width: 22px; height: 22px; }
/* Messages fills the window: the view holding the conversation is the page body's flexible part. */
#page-messages .msg-main:not([hidden]) { flex: 1; display: flex; flex-direction: column; min-height: 0; }
/* The search box fits its column (the app's inputs have a 190px minimum). */
.hub-side-head .hub-search { min-width: 0; width: auto; }
/* Attach: a paperclip */
.hub-attach-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; align-self: flex-end; }
.hub-attach-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }