/* The app's own look: every window of the desktop app — sign-in, the computers, a session,
   settings — and the same pages in a browser. It comes after ui.css and turns the shared pieces
   (.btn, .field, .switch) into a Mac app's; the website loads it too, with site.css on top.
   Mac scale: 13px text in the system font, the system's own blue, and a status colour that
   means one thing each — green is reachable, orange is waiting at a login screen, grey is gone.
   Dark and light follow the computer's appearance; a page that must stay dark (a session, where
   the far screen is the content) says so with <html data-theme="dark">. */
:root {
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
  /* the Mac's own dark greys, a breath cooler — the blue lives in the icon and the accent */
  --win: #1c1d21; --form: #1c1d21; --side: #232429; --side-glass: rgba(34,35,41,.62); --card: #26282d; --card-hi: #2e3036; --sheet: #2b2d33;
  --well: rgba(255,255,255,.055); --sep: rgba(255,255,255,.08); --edge: rgba(255,255,255,.1);
  --fill: rgba(255,255,255,.12); --fill-hi: rgba(255,255,255,.17); --hover: rgba(255,255,255,.06); --sel: rgba(255,255,255,.1);
  --rim: inset 0 .5px 0 rgba(255,255,255,.12), 0 .5px 1px rgba(0,0,0,.35);
  --ink: #f2f2f4; --ink-2: #b0b2ba; --ink-3: #8b8e98;
  --accent: #0a84ff; --accent-hi: #3d9bff; --accent-ink: #78b8ff; --accent-tint: rgba(10,132,255,.2);
  --on: #30d158; --wait: #ff9f0a; --stop: #ff453a;
  --thumb-a: #2b2d33; --thumb-b: #24262b; --lift: 0 14px 30px -14px rgba(0,0,0,.8);
  /* glass: the floating sidebar and the toolbar's capsules, as the Mac has drawn them since macOS 26 */
  --glass-bg: rgba(255,255,255,.07); --glass-hi: rgba(255,255,255,.12); --glass-rim: inset 0 0 0 .5px rgba(255,255,255,.14), 0 1px 3px rgba(0,0,0,.25);
  --panel: #26272c; --panel-rim: inset 0 0 0 .5px rgba(255,255,255,.1), 0 8px 24px rgba(0,0,0,.25);
  --dim: var(--ink-2); --faint: var(--ink-3); --cyan-ink: var(--accent-ink);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme=dark]) {
    color-scheme: light;
    --win: #ffffff; --form: #f5f5f7; --side: #efeff1; --side-glass: rgba(240,240,242,.8); --card: #ffffff; --card-hi: #f5f5f7; --sheet: #ffffff;
    --well: #ffffff; --sep: rgba(0,0,0,.08); --edge: rgba(0,0,0,.11);
    --fill: #ffffff; --fill-hi: #f6f6f8; --hover: rgba(0,0,0,.045); --sel: rgba(0,0,0,.075);
    --rim: 0 0 0 .5px rgba(0,0,0,.22), 0 1px 1.5px rgba(0,0,0,.08);
    --ink: #1d1d1f; --ink-2: #57575d; --ink-3: #808087;
    --accent: #007aff; --accent-hi: #1f8bff; --accent-ink: #0068d6; --accent-tint: rgba(0,122,255,.12);
    --on: #28cd41; --wait: #ff9500; --stop: #ff3b30;
    --thumb-a: #ececef; --thumb-b: #e2e2e6; --lift: 0 8px 20px -12px rgba(0,0,0,.35);
    /* on a white window a white capsule is invisible: light mode fills them grey instead */
    --glass-bg: rgba(0,0,0,.05); --glass-hi: rgba(0,0,0,.085); --glass-rim: inset 0 0 0 .5px rgba(0,0,0,.07);
    --panel: #ebebee; --panel-rim: inset 0 0 0 .5px rgba(0,0,0,.1), 0 6px 18px rgba(0,0,0,.06);
  }
}
body { background: var(--win); color: var(--ink); font: 13px/1.45 var(--sans) }
p, small, h1, h2, h3 { text-wrap: pretty } /* no word left alone on the last line */
.sub { text-wrap: balance }
.toolbar .btn.tint { color: inherit; background: var(--glass-bg) } /* one capsule style up there */
a { color: var(--accent-ink) } a:hover { color: var(--accent-hi) }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent) }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: 0 }

/* controls — the size and shape of a Mac's regular push button, text field and switch */
.btn { height: 28px; padding: 0 12px; border-radius: 7px; gap: 6px; border: 0; font: 500 13px/1 var(--sans); color: var(--ink);
  background: var(--fill); box-shadow: var(--rim) }
.btn:hover { background: var(--fill-hi) }
.btn:active { filter: brightness(.95) }
.btn.primary { color: #fff; background: var(--accent); box-shadow: inset 0 .5px 0 rgba(255,255,255,.25), 0 .5px 1px rgba(0,0,0,.3) }
.btn.primary:hover { background: var(--accent-hi); filter: none }
.btn.danger { color: var(--stop); border: 0 }
.btn.plain { height: 28px; padding: 0 8px; color: var(--accent-ink); font-weight: 500; box-shadow: none; background: none }
.btn.plain:hover { background: var(--hover) }
.btn.icon { width: 28px; padding: 0 }
.btn.small { height: 22px; padding: 0 9px; border-radius: 6px; font-size: 12px }
.btn svg { flex: none }
.field, input.field, select.field { height: 28px; padding: 0 9px; border-radius: 7px; font: 13px/1 var(--sans); color: var(--ink);
  background: var(--well); border: 1px solid var(--edge); box-shadow: inset 0 1px 1px rgba(0,0,0,.12) }
input.field:focus, select.field:focus, input.field:focus-visible { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent) }
/* a pop-up button, not a text field: raised, with the Mac's double chevron */
select.field { height: 22px; padding: 0 24px 0 9px; border-radius: 6px; font-size: 12.5px; border: 0; background-color: var(--fill); box-shadow: var(--rim); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 16' fill='none' stroke='%238b93a8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6l3-3 3 3M2 10l3 3 3-3'/%3E%3C/svg%3E");
  background-size: 7px 12px; background-position: right 8px center; background-repeat: no-repeat }
select.field option { background: var(--sheet); color: var(--ink) }
.switch { width: 26px; height: 15px; background: color-mix(in srgb, var(--ink) 22%, transparent); box-shadow: inset 0 0 0 .5px rgba(0,0,0,.15) }
.switch::after { top: 1.5px; left: 1.5px; width: 12px; height: 12px; box-shadow: 0 .5px 2px rgba(0,0,0,.35) }
.switch:checked { background: var(--accent) }
.switch:checked::after { transform: translateX(11px) }

/* a sheet: what a Mac shows for a question — title, a sentence, the buttons bottom right */
dialog { width: min(27rem, calc(100% - 32px)); padding: 22px 22px 18px; border: 0; border-radius: 14px; color: var(--ink);
  background: var(--sheet); box-shadow: 0 0 0 .5px var(--edge), 0 24px 70px rgba(0,0,0,.45) }
dialog::backdrop { background: rgba(0,0,0,.35) }
dialog h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; letter-spacing: -.005em }
dialog p { margin: 0 0 16px; color: var(--ink-2); font-size: 13px; line-height: 1.5 }
dialog .acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 6px }
dialog .acts .btn { min-width: 76px }

/* the window's own bar. In the desktop app on a Mac the window has no title bar: this one is
   it, the traffic lights sit in its left end, and it moves the window (main.js). No line under
   it: the content runs up to it, the way a Mac window's toolbar sits over its content now. */
.toolbar { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 12px 0 20px; flex: none; background: var(--win) }
/* toolbar items are glass capsules: one shape for every button, menu and field up there */
.toolbar .btn, .toolbar .field { height: 30px; border-radius: 999px; background: var(--glass-bg); box-shadow: var(--glass-rim); border: 0; padding: 0 13px }
.toolbar .btn:hover { background: var(--glass-hi) }
.toolbar .btn.tint { color: var(--accent-ink); background: var(--accent-tint) }
.toolbar .btn.tint:hover { background: color-mix(in srgb, var(--accent) 28%, transparent) }
.toolbar .btn.icon { width: 30px; padding: 0 }
.toolbar .btn:disabled, .toolbar .field:disabled { opacity: .45 }
.toolbar .ttl { display: grid; min-width: 0; margin-right: auto }
.toolbar h1 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.toolbar .ttl span { color: var(--ink-3); font-size: 11px; line-height: 1.3 }
body.titlebar .toolbar, body.titlebar .drag { -webkit-app-region: drag }
body.titlebar .toolbar :is(button, a, input, select, label) { -webkit-app-region: no-drag }
/* On a Mac the window behind a sidebar is the desktop, blurred (main.js asks for vibrancy):
   the page leaves it see-through there and paints everything else itself. */
body.titlebar.vib main, body.titlebar.vib .toolbar { background: var(--win) }
/* the sidebar floats inside the window, inset and rounded, on the window's own background */
.float { margin: 8px; border-radius: 16px; background: var(--panel); box-shadow: var(--panel-rim) }

/* a source list's row: the same in the computers' sidebar and in settings */
.src { display: flex; align-items: center; gap: 9px; width: 100%; height: 28px; padding: 0 8px; border: 0; border-radius: 6px;
  background: none; color: var(--ink); font: 13px/1 var(--sans); text-align: left; cursor: pointer; text-decoration: none }
.src:hover { background: var(--hover); color: var(--ink) }
.src.on { background: var(--sel) }

/* a status dot: green is reachable, orange is a login screen, grey is gone */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; background: color-mix(in srgb, var(--ink-3) 70%, transparent) }
.dot.on { background: var(--on) }
.dot.wait { background: var(--wait) }

/* a state in a word, the one chip every window uses */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--fill); color: var(--ink-2) }
.pill.on { background: color-mix(in srgb, var(--on) 16%, transparent); color: color-mix(in srgb, var(--on) 75%, var(--ink)) }
.pill.wait { background: color-mix(in srgb, var(--wait) 16%, transparent); color: color-mix(in srgb, var(--wait) 75%, var(--ink)) }
.pill.accent { background: var(--accent-tint); color: var(--accent-ink) }
