/* TwinDesk — Copyright (C) 2026 inukaasith. GPL-3.0, see LICENSE. */
/* TwinDesk Web, drawn like the TwinDesk phone app (android/…/Ui.kt, "Modern"): the branding on a faintly
   tinted background, the page in a big rounded sheet, soft cards, pill buttons. Two layouts by width: a
   floating tab bar (narrow) or a sidebar with the page centred beside it (html.wide). Dark: html.dark
   (General › Theme; System follows the device), in neutral greys. */
:root {
  --accent: #0a84ff;
  --outer: color-mix(in srgb, #ededf2 91%, var(--accent));
  --sheet: color-mix(in srgb, var(--outer) 35%, #fff);
  --card: #fff;
  --chip: color-mix(in srgb, var(--sheet) 97%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --line: rgba(0, 0, 0, 0.06); --hover: rgba(0, 0, 0, 0.05);
  --text: #1d1d1f; --muted: #6e6e73; --faint: #a1a1a6;
  --good: #30b94d; --warn: #e8a10c; --bad: #e5373a; --track-off: rgba(0, 0, 0, 0.12);
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.06); --border: 0px solid transparent;
  --r-card: 22px; --r-btn: 999px; --btn-h: 40px; --big-h: 48px; --row-min: 52px; --row-pad: 14px 20px;
  --sw-w: 52px; --sw-h: 32px; --title-size: 15px; --head-size: 26px; --base: 15px;
  --top: env(safe-area-inset-top, 0px); --bottom: env(safe-area-inset-bottom, 0px);
  --left: env(safe-area-inset-left, 0px); --right: env(safe-area-inset-right, 0px);
  --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
  color-scheme: light;
}
html.dark {
  --outer: #0e0e10;
  --sheet: #161618;
  --card: #1f1f22;
  --chip: #2a2a2e;
  --accent-soft: color-mix(in srgb, var(--accent) 22%, transparent);
  --line: rgba(255, 255, 255, 0.08); --hover: rgba(255, 255, 255, 0.06);
  --text: #f5f5f7; --muted: #98989d; --faint: #6c6c70;
  --good: #32d74b; --warn: #ffb340; --bad: #ff453a; --track-off: rgba(255, 255, 255, 0.16);
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--outer); color: var(--text); }
body {
  font: var(--base)/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; overscroll-behavior: none;
}
[hidden] { display: none !important; }
/* The language picker's flags where the system has none (Windows, Linux): only the regional-indicator
   letters use this font. Twemoji art, CC-BY 4.0. */
@font-face { font-family: "TwinDesk Flags"; src: url("/lang/flags.woff2") format("woff2"); unicode-range: U+1F1E6-1F1FF; }
html.flagfont body { font-family: "TwinDesk Flags", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
b { font-weight: 600; }
svg.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---- the frame ---- */
#root { height: 100dvh; display: flex; flex-direction: column; }
.identity { display: flex; align-items: center; gap: 12px; padding: calc(var(--top) + 14px) calc(22px + var(--right)) 14px calc(22px + var(--left)); flex: none; }
.identity img { width: 36px; height: 36px; }
.identity .name { font-weight: 700; font-size: 19px; line-height: 1.15; letter-spacing: -0.01em; }
.identity .who { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; min-width: 0; font-variant-numeric: tabular-nums; }
.identity .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.dot.good { background: var(--good); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }

.sheet {
  flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--sheet);
  border-radius: 32px 32px 0 0; overflow: hidden; margin: 0 var(--right) 0 var(--left);
}
.sheet.gap { margin-top: calc(var(--top) + 10px); }
.page { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 20px 20px 24px; animation: rise 0.28s var(--ease) both; }
.page.flush { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* the floating tab bar */
.nav {
  flex: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: 72px; background: var(--card);
  margin: 4px 14px calc(10px + var(--bottom)); border-radius: 28px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12); overflow: hidden;
}
.nav button { appearance: none; border: 0; background: none; display: grid; justify-items: center; align-content: center; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; padding: 0; }
.nav .pill { width: 56px; height: 30px; border-radius: 15px; display: grid; place-items: center; position: relative; transition: background 0.2s; }
.nav button.on { color: var(--text); font-weight: 600; }
.nav button.on .pill { background: var(--accent-soft); color: var(--accent); }
.nav .pill .dot { position: absolute; top: 3px; right: 12px; background: var(--good); }
.nav .pill .count { position: absolute; top: -2px; right: 6px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--bad); color: #fff; font: 700 10px/16px -apple-system, system-ui; padding: 0 4px; font-style: normal; }

/* wide: the sidebar */
html.wide #root { flex-direction: row; }
.side { width: 260px; flex: none; overflow-y: auto; padding: calc(var(--top) + 14px) 10px 14px calc(10px + var(--left)); }
.side .identity { padding: 0 4px 18px; }
.side .identity img { width: 48px; height: 48px; }
.side .group { height: 10px; }
.side .sep { height: 1px; background: var(--line); margin: 8px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 9px; border: 0; background: none; cursor: pointer; font-size: 14px; text-align: left; color: var(--text); }
.nav-item:hover { background: var(--hover); }
.nav-item.on { background: var(--accent-soft); }
.nav-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .state { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.nav-item .state.on::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
html.wide .sheet { border-radius: 26px 0 0 0; margin: 0; }
html.wide .page { padding: 32px 40px 48px; }
html.wide .page > * { max-width: 780px; margin-left: auto; margin-right: auto; }
html.wide .page.wide-page > * { max-width: 1040px; }
html.wide .page.flush > * { max-width: none; }
html.wide .page.flush .thread > *, html.wide .page.flush .composer { width: 100%; max-width: 780px; margin-left: auto; margin-right: auto; }
html.wide .page.flush .thread .msg { margin-left: 0; margin-right: 0; }
html.wide .page.flush .thread { align-items: center; }
html.wide .page.flush .thread > .msg.me, html.wide .page.flush .thread > .msg.them { max-width: 780px; }
/* the Mac's sidebar */

/* ---- the kit ---- */
.tile { display: grid; place-items: center; color: #fff; flex: none; }
.tile svg { stroke: #fff; }
h1.head { font-size: var(--head-size); font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.head-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.head-row > div:first-child { flex: 1; min-width: 0; }
.desc { color: var(--muted); font-size: 14px; margin-top: 2px; max-width: 560px; }
.card-wrap { margin-bottom: 16px; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 600; font-size: var(--title-size); padding: 0 6px 8px; }
.card-title a, .card-title .act { font-weight: 500; font-size: 13px; }
.card { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); border: var(--border); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: var(--row-pad); position: relative; min-height: var(--row-min); }
.row + .row::before { content: ""; position: absolute; top: 0; left: 20px; right: 20px; height: 0.5px; background: var(--line); }
.row.click { cursor: pointer; }
.row.click:hover { background: var(--hover); }
.row .text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row .label { font-size: var(--base); }
.row .hint { color: var(--muted); font-size: 12.5px; }
.row .value { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.row .ctl { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.row .chev { color: var(--faint); font-size: 20px; }
.note { border-radius: 14px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 14px; background: var(--chip); color: var(--text); }
.note.info { background: var(--accent-soft); }
.note.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); }
.note.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; user-select: text; -webkit-user-select: text; overflow-wrap: anywhere; }
.pill-tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent); vertical-align: 2px; margin-left: 6px; }
.pill-tag.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.pill-tag.muted { background: var(--track-off); color: var(--muted); }

.btn {
  appearance: none; border: 0; border-radius: var(--r-btn); height: var(--btn-h); padding: 0 18px; font-size: 14px; font-weight: 600;
  background: var(--chip); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap; transition: transform 0.1s var(--ease), opacity 0.15s, filter 0.15s; touch-action: manipulation; text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; pointer-events: none; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.danger { color: var(--bad); }
.btn.big { height: var(--big-h); width: 100%; font-size: 15px; font-weight: 500; }
.btn.small { height: 32px; padding: 0 14px; font-size: 13px; }
.btn svg.ico { width: 20px; height: 20px; }
.stack { display: grid; gap: 8px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.sw { appearance: none; width: var(--sw-w); height: var(--sw-h); border-radius: 99px; background: var(--track-off); position: relative; flex: none; cursor: pointer; transition: background 0.2s; margin: 0; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: calc(var(--sw-h) - 6px); height: calc(var(--sw-h) - 6px); border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.25s cubic-bezier(0.3, 1.4, 0.5, 1); }
.sw:checked { background: var(--accent); }
.sw:checked::after { transform: translateX(calc(var(--sw-w) - var(--sw-h))); }
.sw:disabled { opacity: 0.4; }

.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--chip); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { appearance: none; border: 0; background: none; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13.5px; font-weight: 500; cursor: pointer; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); }
html.dark .seg button.on { background: #3a3a3e; }
.seg.full { display: grid; width: 100%; }

input.field, textarea.field, select.field {
  width: 100%; border: 0; border-radius: 14px; background: var(--chip); padding: 12px 14px; font-size: 16px; outline: none; resize: none;
}
input.field:focus, textarea.field:focus { box-shadow: 0 0 0 2px var(--accent); }
input[type=range] { accent-color: var(--accent); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { appearance: none; width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); position: relative; }
.swatches button.on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--accent); }

/* ---- the hero: the two devices and the link ---- */
.hero { background: color-mix(in srgb, var(--card) 95%, var(--accent)); border-radius: 28px; margin-bottom: 18px; overflow: hidden; --chip: var(--card); border: var(--border); }
html.dark .hero { background: color-mix(in srgb, var(--card) 96%, var(--accent)); --chip: rgba(255, 255, 255, 0.07); }
.hero-devs { display: grid; grid-template-columns: 1fr 0.9fr 1fr; align-items: center; padding: 32px 20px 20px; }
.dev { display: grid; justify-items: center; gap: 8px; font-weight: 600; font-size: 13px; text-align: center; line-height: 16px; min-width: 0; }
.dev .nm { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding: 0 2px; word-break: break-word; }
.dev .sub { color: var(--muted); font-size: 12px; font-weight: 400; margin-top: -6px; }
.dev .phone { width: 25px; height: 43px; border: 3px solid color-mix(in srgb, var(--text) 85%, transparent); border-radius: 8px; }
.dev .screen { width: 61px; height: 39px; border: 3px solid color-mix(in srgb, var(--text) 85%, transparent); border-radius: 6px; }
.dev .base { width: 75px; height: 5px; margin-top: -5px; border-radius: 0 0 6px 6px; background: color-mix(in srgb, var(--text) 85%, transparent); }
.dev .comp { display: grid; justify-items: center; gap: 3px; }
.link { display: grid; justify-items: center; gap: 8px; }
.link .line { width: 100%; height: 3px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--faint) 0 6px, transparent 6px 12px); background-size: 24px 3px; animation: dash 1.6s linear infinite; }
.link .line.up { background: linear-gradient(90deg, var(--good), var(--accent)); animation: none; box-shadow: 0 0 8px color-mix(in srgb, var(--good) 35%, transparent); }
.link .line.idle { animation: none; }
@keyframes dash { to { background-position: 24px 0; } }
.link .txt { color: var(--muted); font-size: 11.5px; line-height: 14px; text-align: center; font-variant-numeric: tabular-nums; }
.hero-msg { color: var(--muted); font-size: 12.5px; line-height: 17px; text-align: center; padding: 0 20px 14px; }
.hero-btns { display: grid; gap: 8px; padding: 0 16px 16px; }
.hero-btns .pair2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.devctl { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; padding: 14px 16px 16px; }
.devctl button { appearance: none; border: 0; background: var(--chip); border-radius: 18px; padding: 12px 6px 10px; display: grid; justify-items: center; gap: 6px; font-size: 12px; font-weight: 500; cursor: pointer; color: var(--text); }
.devctl button.on { background: var(--accent); color: #fff; }
.devctl button:active { transform: scale(0.97); }
.devctl button:disabled { opacity: 0.4; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.qtile { appearance: none; border: var(--border); background: var(--card); border-radius: 20px; padding: 14px 4px 10px; display: grid; justify-items: center; gap: 8px; font-size: 11.5px; font-weight: 500; color: var(--text); box-shadow: var(--shadow); cursor: pointer; position: relative; }
.qtile .dot { position: absolute; top: 10px; right: 10px; background: var(--good); }

/* ---- not paired: what TwinDesk is ---- */
.promo { text-align: center; padding: 26px 20px 22px; }
.promo img { width: 88px; height: 88px; filter: drop-shadow(0 10px 24px color-mix(in srgb, var(--accent) 35%, transparent)); }
.promo h1 { font-size: 30px; margin: 14px 0 6px; letter-spacing: -0.02em; }
.promo p { color: var(--muted); margin: 0 auto; font-size: 15px; max-width: 460px; }
.feat { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.feat > div { background: var(--card); border-radius: 20px; padding: 14px; display: grid; gap: 8px; box-shadow: var(--shadow); border: var(--border); align-content: start; }
.feat b { font-size: 14px; }
.feat span { color: var(--muted); font-size: 12px; line-height: 16px; }
.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px; }
.dl a { display: grid; gap: 2px; background: var(--chip); border-radius: 16px; padding: 10px 14px; color: var(--text); }
.dl a:hover { filter: brightness(0.97); }
.dl a b { font-size: 14px; }
.dl a span { font-size: 11.5px; color: var(--muted); }
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; position: relative; }
.code-boxes span { height: 54px; border-radius: 14px; background: var(--chip); display: grid; place-items: center; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.code-boxes span.cur { box-shadow: 0 0 0 2px var(--accent); }
.code-boxes input { position: absolute; inset: 0; opacity: 0; font-size: 16px; width: 100%; caret-color: transparent; }
.pair-box { padding: 18px 16px 16px; display: grid; gap: 14px; }
/* the same on a wide screen: what TwinDesk is beside connecting */
html.solo #root { overflow-y: auto; }
html.solo .sheet { border-radius: 0; margin: 0; background: transparent; overflow: visible; flex: none; }
html.solo .identity { max-width: 1120px; width: 100%; margin: 0 auto; padding-top: calc(var(--top) + 22px); }
html.solo .page { overflow: visible; padding: 8px 32px 48px; max-width: 1120px; width: 100%; margin: 0 auto; }
.promo-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr); gap: 36px; align-items: start; }
.promo-grid .promo { text-align: left; padding: 30px 0 26px; }
.promo-grid .promo p { margin: 0; font-size: 17px; max-width: 520px; }
.promo-grid .promo h1 { font-size: 44px; letter-spacing: -0.03em; }
.promo-grid .feat { grid-template-columns: repeat(3, 1fr); }
.promo-grid .aside { position: sticky; top: 20px; display: grid; gap: 0; }
.promo-grid .aside-gap { height: 30px; }

/* ---- Files and the Drop ---- */
.dropzone {
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent); border-radius: var(--r-card); padding: 30px 20px; display: grid; justify-items: center; gap: 10px; text-align: center;
  background: color-mix(in srgb, var(--accent) 5%, transparent); color: var(--muted); margin-bottom: 18px; transition: background 0.15s, border-color 0.15s; cursor: pointer;
}
.dropzone b { color: var(--text); font-size: 16px; }
.dropzone.over { background: var(--accent-soft); border-color: var(--accent); }
.dropzone .tile { margin-bottom: 4px; }
.prog { display: grid; gap: 4px; min-width: 0; flex: 1; }
.thread { flex: 1; overflow-y: auto; padding: 16px 14px 10px; display: flex; flex-direction: column; gap: 4px; }
html.wide .thread { padding: 18px 28px 10px; }
.day { align-self: center; font-size: 11.5px; color: var(--muted); margin: 10px 0 4px; font-weight: 600; }
.msg { max-width: min(80%, 520px); display: grid; gap: 2px; animation: pop 0.18s ease-out; }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } }
.msg.me { align-self: flex-end; justify-items: end; }
.msg.them { align-self: flex-start; }
.bubble { padding: 9px 14px; border-radius: 20px; font-size: 15px; white-space: pre-wrap; word-break: break-word; user-select: text; -webkit-user-select: text; }
.msg.me .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.them .bubble { background: var(--card); border-bottom-left-radius: 6px; box-shadow: var(--shadow); border: var(--border); }
.msg.me .bubble a { color: #fff; text-decoration: underline; }
.meta { font-size: 10.5px; color: var(--muted); padding: 0 8px; display: flex; gap: 10px; }
.meta button { appearance: none; border: 0; background: none; color: var(--accent); font-size: 10.5px; padding: 0; cursor: pointer; font-weight: 600; }
.file { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); border: var(--border); color: var(--text); width: 270px; max-width: 100%; }
.msg.me .file { background: color-mix(in srgb, var(--card) 88%, var(--accent)); }
.file .ext, .ext { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 10.5px/1 -apple-system, system-ui; text-transform: uppercase; overflow: hidden; flex: none; }
.row .ext { width: 36px; height: 36px; border-radius: 9px; font-size: 9.5px; }
.ext img { width: 100%; height: 100%; object-fit: cover; }
.file .nm { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .sz { font-size: 11.5px; color: var(--muted); }
.file .get { width: 34px; height: 34px; border-radius: 17px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); border: 0; cursor: pointer; }
.photo { border-radius: 20px; overflow: hidden; max-width: 250px; display: block; background: var(--chip); }
.photo img { display: block; width: 100%; max-height: 300px; object-fit: cover; }
.bar { height: 4px; border-radius: 2px; background: var(--track-off); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.2s; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px calc(10px + (var(--bottom) * 0)); }
html.wide .composer { padding: 10px 28px 18px; }
.composer textarea { flex: 1; resize: none; border: var(--border); border-radius: 22px; padding: 10px 16px; background: var(--card); max-height: 120px; font-size: 16px; line-height: 1.3; outline: none; box-shadow: var(--shadow); }
.round { appearance: none; border: var(--border); width: 42px; height: 42px; border-radius: 21px; flex: none; display: grid; place-items: center; cursor: pointer; background: var(--card); color: var(--accent); box-shadow: var(--shadow); }
.round.go { background: var(--accent); color: #fff; border-color: var(--accent); }
.round:disabled { opacity: 0.4; }
.empty { text-align: center; color: var(--muted); padding: 30px 26px; margin: auto 0; font-size: 14px; }
.empty .tile { margin: 0 auto 12px; }

/* ---- the screen viewer's bar (the computer's monitor bar) ---- */
.vbar {
  position: fixed; z-index: 42; top: calc(var(--top) + 8px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 4px;
  background: rgba(30, 30, 32, 0.78); color: #fff; border-radius: 14px; -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); transition: transform 0.3s var(--ease), opacity 0.3s; max-width: calc(100vw - 16px); overflow-x: auto; font-size: 13px;
}
.vbar.away { transform: translate(-50%, calc(-100% - var(--top) - 14px)); opacity: 0; pointer-events: none; }
.vbar button { appearance: none; border: 0; background: none; color: #fff; height: 32px; padding: 0 10px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 500; white-space: nowrap; }
.vbar button:hover { background: rgba(255, 255, 255, 0.1); }
.vbar button.on { background: rgba(255, 255, 255, 0.2); }
.vbar button.stop { color: #ff6961; }
.vbar svg.ico { width: 17px; height: 17px; }
.vbar .sep { width: 1px; height: 18px; background: rgba(255, 255, 255, 0.2); margin: 0 2px; }
.vhandle { position: fixed; z-index: 41; top: calc(var(--top) + 2px); left: 50%; transform: translateX(-50%); width: 64px; height: 22px; border: 0; background: none; padding: 0; cursor: pointer; }
.vhandle::after { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.45); margin: 8px auto 0; box-shadow: 0 0 6px rgba(0, 0, 0, 0.5); }
.cam-preview { padding: 0 20px 14px; }
.cam-preview video { width: 100%; border-radius: 16px; background: #000; max-height: 260px; object-fit: cover; }
.cam-preview video.mirror { transform: scaleX(-1); }

/* ---- Clipboard ---- */
.clip-text { margin: 0; font: 14.5px/1.4 -apple-system, system-ui; white-space: pre-wrap; word-break: break-word; max-height: 200px; overflow: auto; background: var(--chip); border-radius: 14px; padding: 12px 14px; min-height: 46px; user-select: text; -webkit-user-select: text; }
.pad16 { padding: 16px; display: grid; gap: 12px; }

/* ---- Notifications ---- */
.alert { background: var(--card); border-radius: 20px; padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); border: var(--border); display: grid; grid-template-columns: 36px 1fr; gap: 12px; animation: pop 0.2s ease-out; }
.alert .aico { width: 36px; height: 36px; border-radius: 10px; background: var(--chip); display: grid; place-items: center; font-weight: 700; color: var(--muted); overflow: hidden; }
.alert .aico img { width: 100%; height: 100%; }
.alert .h { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.alert .t { font-weight: 600; font-size: 14.5px; }
.alert .b { font-size: 14px; white-space: pre-wrap; word-break: break-word; color: var(--text); }

/* ---- steps and recipes (Mount, Shortcuts, the secure connection) ---- */
.steps { margin: 0; padding: 14px 20px 16px 40px; display: grid; gap: 10px; font-size: 14px; }
.steps li::marker { color: var(--muted); font-weight: 600; }
.copybox { display: flex; align-items: center; gap: 8px; background: var(--chip); border-radius: 12px; padding: 8px 8px 8px 12px; margin-top: 6px; }
.copybox .mono { flex: 1; min-width: 0; }
.recipe-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 0; }
.recipe-head b { font-size: 15px; }
.more-row .tile { margin-right: 2px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom) + 96px); transform: translateX(-50%); z-index: 60;
  background: rgba(30, 30, 32, 0.92); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px; max-width: 86vw; text-align: center;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: pop 0.2s;
}
html.wide .toast { bottom: 28px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid var(--track-off); border-top-color: var(--accent); animation: rot 0.8s linear infinite; display: inline-block; flex: none; }
@keyframes rot { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .promo-grid { grid-template-columns: 1fr; gap: 0; }
  .promo-grid .promo { text-align: center; }
  .promo-grid .promo p { margin: 0 auto; }
  .promo-grid .feat { grid-template-columns: 1fr 1fr; }
  /* One column (an iPad held upright): pairing right under the title, as on a phone, not below
     the features and downloads. */
  .promo-grid .promo-main { display: contents; }
  .promo-grid .promo { order: 0; }
  .promo-grid .aside { order: 1; position: static; }
  .promo-grid .aside-gap { display: none; }
  .promo-grid .promo-main > :not(.promo) { order: 2; }
}
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(6, 1fr); } }


/* ---- Overview: the computer, as TwinDesk's own Overview draws a device ---- */
.dv-hero { display: flex; align-items: center; gap: 24px; padding: 22px 24px; border-radius: 28px; background: color-mix(in srgb, var(--card) 95%, var(--accent)); box-shadow: var(--shadow); margin-bottom: 18px; }
html.dark .dv-hero { background: color-mix(in srgb, var(--card) 96%, var(--accent)); }
.dv-pic { flex: none; display: grid; justify-items: center; gap: 0; }
.dv-pic .screen { width: 112px; height: 72px; border: 4px solid color-mix(in srgb, var(--text) 85%, transparent); border-radius: 8px; position: relative; overflow: hidden; }
.dv-pic .screen::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%); }
.dv-pic .base { width: 140px; height: 6px; margin-top: -1px; border-radius: 0 0 7px 7px; background: color-mix(in srgb, var(--text) 85%, transparent); }
.dv-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.dv-main h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-status { color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.dv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dv-actions .btn { height: 38px; padding: 0 14px; font-size: 13.5px; font-weight: 500; }
.dv-actions .btn.on { background: var(--accent); color: #fff; }
.dv-facts { margin: 0; display: grid; grid-template-columns: auto auto; gap: 7px 18px; align-self: stretch; align-content: center; padding-left: 22px; border-left: 1px solid var(--line); font-size: 13px; }
.dv-facts dt { color: var(--muted); }
.dv-facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
.ov-grid > .card-wrap { min-width: 0; }
.ov-grid.one { grid-template-columns: 1fr; }
.ov-grid .span { grid-column: 1 / -1; }
.np { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.np .art { width: 52px; height: 52px; border-radius: 12px; background: var(--chip) center / cover; flex: none; display: grid; place-items: center; color: var(--muted); }
.np .t { flex: 1; min-width: 0; }
.np .t b, .np .t span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np .t span { color: var(--muted); font-size: 13px; }
.np .ctl { display: flex; gap: 4px; }
.np .ctl button { appearance: none; border: 0; width: 40px; height: 40px; border-radius: 20px; background: var(--chip); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.np .ctl svg.ico { width: 18px; height: 18px; }
.dropzone.slim { padding: 20px; margin: 0; border-radius: 0; border: 0; background: none; }
.mini-list .row { min-height: 48px; }
@media (max-width: 760px) {
  .dv-hero { flex-direction: column; text-align: center; padding: 26px 18px 18px; gap: 16px; }
  .dv-main { justify-items: center; width: 100%; }
  .dv-main h2 { white-space: normal; }
  .dv-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); width: 100%; }
  .dv-actions .btn { height: 64px; flex-direction: column; gap: 4px; border-radius: 18px; font-size: 12px; padding: 0 4px; }
  .dv-actions .btn.primary { grid-column: 1 / -1; height: 48px; flex-direction: row; border-radius: 999px; font-size: 15px; }
  .dv-facts { display: none; }
  .ov-grid { grid-template-columns: 1fr; }
}
@media (min-width: 761px) and (max-width: 1100px) { .dv-facts { display: none; } }

/* ---- Shortcuts: one card per shortcut, with its Add button ---- */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 18px; }
.sc { background: var(--card); border-radius: 22px; box-shadow: var(--shadow); padding: 18px; display: grid; gap: 12px; align-content: start; }
.sc .top { display: flex; gap: 14px; align-items: center; }
.sc .top b { font-size: 16px; display: block; }
.sc .top span { color: var(--muted); font-size: 13px; }
.sc .tip { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.sc .btn.add { background: var(--text); color: var(--sheet); }
.sc .btn.add svg.ico { stroke: currentColor; }
/* Pairing: Install first (an iPhone's Home Screen app keeps its own sign-in), and the QR scanner. */
.install-first { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--chip); }
.install-first ol { margin: 0; padding-left: 20px; line-height: 1.55; }
.install-first .btn { justify-self: start; }
.qr-sheet { position: fixed; inset: 0; z-index: 200; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 24px 16px;
  background: rgba(0, 0, 0, .88); color: #fff; text-align: center; }
.qr-sheet .desc { color: rgba(255, 255, 255, .8); max-width: 320px; }
.qr-sheet a { color: #64d2ff; }
.qr-frame { position: relative; width: min(80vw, 340px); aspect-ratio: 1; border-radius: 22px; overflow: hidden; background: #000; }
.qr-video { width: 100%; height: 100%; object-fit: cover; }
.qr-aim { position: absolute; inset: 14%; border: 3px solid rgba(255, 255, 255, .9); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); }

/* Presenting, as Meet and Teams show it */
.present-stage { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; display: grid; place-items: center; }
.present-stage.idle { background: var(--card); border: 1.5px dashed var(--line, rgba(127, 127, 127, 0.35)); cursor: pointer; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: 20px; text-align: center; }
.present-stage.idle b { font-size: 17px; }
.present-prev { width: 100%; height: 100%; object-fit: contain; background: #000; }
.present-live { position: absolute; left: 12px; top: 12px; display: flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 12.5px; font-weight: 600; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.present-live .dot { width: 8px; height: 8px; border-radius: 50%; background: #ff9f0a; }
.present-live .dot.on { background: #ff453a; animation: pb-pulse 1.6s infinite; }
@keyframes pb-pulse { 50% { opacity: 0.35; } }
.present-bar { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom, env(safe-area-inset-bottom)) + 14px); display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 24px); padding: 8px 10px 8px 8px; border-radius: 16px; background: rgba(28, 28, 30, 0.92); color: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.present-bar .pb-prev { width: 64px; height: 40px; border-radius: 8px; object-fit: cover; background: #000; cursor: pointer; flex: none; }
.present-bar .pb-text { display: flex; flex-direction: column; min-width: 0; margin-right: 4px; }
.present-bar .pb-text b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.present-bar .pb-text span { font-size: 12px; opacity: 0.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.present-bar .btn { flex: none; }
.present-bar .btn.danger { background: #ff453a; color: #fff; }
html.presenting .page { padding-bottom: 90px; }

/* The link while connected: a pulse travels along it; just connected: it fills in and both devices glow */
.link .line { position: relative; overflow: hidden; }
.link .line .pulse { display: none; }
.link .line.up .pulse { display: block; position: absolute; top: 0; left: 0; width: 40px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent); animation: travel 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
@keyframes travel { from { left: -40px; } to { left: 100%; } }
.hero.just .link .line.up { animation: fillin 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-origin: left; }
.hero.just .dev .phone, .hero.just .dev .screen { animation: devglow 1.2s 0.5s ease-out both; }
@keyframes fillin { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes devglow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
@media (prefers-reduced-motion: reduce) { .link .line.up .pulse, .hero.just .link .line.up, .hero.just .dev .phone, .hero.just .dev .screen { animation: none; } }

/* The dashboard's install offer */
.install-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 18px; }
.install-card .ic-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.install-card .ic-text .desc { color: var(--muted); font-size: 13px; line-height: 1.4; }
.install-card .ic-btns { display: flex; align-items: center; gap: 12px; flex: none; }
@media (max-width: 560px) { .install-card { flex-wrap: wrap; } .install-card .ic-btns { width: 100%; justify-content: flex-end; } }

/* The TwinDesk Web computers on this network: which one this page is. */
.peers { padding: 12px calc(16px + var(--right)) 4px calc(16px + var(--left)); }
.peers[hidden] { display: none; }
.peers-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 4px 8px; }
.peers-list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.peers-list::-webkit-scrollbar { display: none; }
.peers-list button { appearance: none; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line, rgba(127,127,127,.25)); background: var(--card); color: var(--text); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; max-width: 260px; }
.peers-list button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peers-list button i { font-style: normal; font-size: 11px; color: var(--muted); }
.peers-list button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--card)); font-weight: 600; cursor: default; }
.peers-list button.on i { color: color-mix(in srgb, var(--accent) 70%, var(--text)); }

/* A clipboard alert tapped where the page couldn't write the clipboard by itself: one tap does it. */
.copy-bar { position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 84px); z-index: 60; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 18px; background: var(--card); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); max-width: 560px; margin: 0 auto; }
.copy-bar > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
/* About: who made it, under the name */
.about-hero .muted { max-width: 420px; margin: 0 auto; }
.about-hero .about-by { color: var(--accent); font-weight: 600; font-size: 13px; margin: 8px 0 0; }
