:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #d9dde3;
  --accent: #2563eb;
  --danger: #b91c1c;
  --ok: #15803d;
  --warn: #b45309;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111318; --card: #1b1e25; --text: #e5e7eb; --muted: #9ca3af; --line: #2f343d; --accent: #60a5fa; --danger: #f87171; --ok: #4ade80; --warn: #fbbf24; }
}
/* The stick's scheme once one has been opened here (scheme.js), from the workspace's (webui-app/src/styles.css). */
:root[data-scheme="inkvermillion"] { color-scheme: light; --bg: #ebe6e0; --card: #e7e1da; --text: #343232; --muted: #23688b; --line: #d5d2cd;
  --accent: #8c362c; --danger: #b23e34; --ok: #409681; --warn: #c89041; }
:root[data-scheme="coldink"] { color-scheme: dark; --bg: #0f1419; --card: #1f2428; --text: #eaedf1; --muted: #7893a1; --line: #363d45;
  --accent: #4b708b; --danger: #a6483f; --ok: #4b9b87; --warn: #c09559; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
#shell { max-width: 28rem; margin: 0 auto; padding: max(1rem, env(safe-area-inset-top)) 1rem 2rem; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 600; margin: .5rem 0 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: .75rem; padding: 1rem; margin-bottom: 1rem; }
h1 { font-size: 1.15rem; margin: 0 0 .75rem; }
h2 { font-size: 1rem; margin: 0 0 .75rem; }
p { line-height: 1.55; margin: .5rem 0; }
.muted { color: var(--muted); font-size: .875rem; }
code { font-size: .8rem; word-break: break-all; }
label { display: block; font-size: .875rem; margin: .75rem 0 .25rem; }
input { width: 100%; font: inherit; font-size: 1rem; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: .5rem; background: transparent; color: inherit; }
#code-input { font-family: ui-monospace, monospace; letter-spacing: .15em; text-transform: uppercase; }
button { font: inherit; font-size: .95rem; padding: .55rem 1rem; margin: .75rem .5rem 0 0; border-radius: .5rem; border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
button.quiet { background: transparent; color: var(--text); border-color: var(--line); }
button.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.row { display: flex; flex-wrap: wrap; }
.note { min-height: 1.4em; font-size: .875rem; color: var(--danger); }
.note.ok { color: var(--ok); }
.note.busy { color: var(--muted); }
.sticks { list-style: none; margin: 0; padding: 0; }
.sticks li { display: flex; align-items: center; gap: .5rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.sticks li:first-child { border-top: 0; }
.sticks .who { flex: 1; min-width: 0; }
.sticks .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticks button { margin: 0; }
#workspace { position: fixed; inset: 0; background: var(--bg); }
#workspace-frame { width: 100%; height: 100%; border: 0; display: block; }
.chip { position: fixed; right: max(.75rem, env(safe-area-inset-right)); bottom: max(.75rem, env(safe-area-inset-bottom)); margin: 0; display: flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem; font-size: .8rem; border-radius: 999px; background: var(--card); color: var(--text); border: 1px solid var(--line); box-shadow: 0 1px 4px rgb(0 0 0 / .15); opacity: .9; }
.chip .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--ok); }
.chip.warn .dot { background: var(--warn); }
.chip.bad .dot { background: var(--danger); }
.chip.direct .dot { box-shadow: 0 0 0 .18rem color-mix(in srgb, var(--ok) 35%, transparent); }
.menu { position: fixed; right: max(.75rem, env(safe-area-inset-right)); bottom: calc(max(.75rem, env(safe-area-inset-bottom)) + 2.5rem); width: min(18rem, calc(100vw - 1.5rem));
  background: var(--card); border: 1px solid var(--line); border-radius: .75rem; padding: .75rem; box-shadow: 0 4px 16px rgb(0 0 0 / .2); }
.menu button { width: 100%; margin: .5rem 0 0; }
.banner { position: fixed; left: 50%; transform: translateX(-50%); top: max(.5rem, env(safe-area-inset-top)); display: flex; align-items: center; gap: .75rem;
  background: var(--card); border: 1px solid var(--line); border-radius: .75rem; padding: .4rem .75rem; box-shadow: 0 2px 8px rgb(0 0 0 / .2); font-size: .875rem; z-index: 10;
  width: max-content; max-width: calc(100vw - 2rem); box-sizing: border-box; }
.banner button { margin: 0; padding: .3rem .8rem; }
.steps { margin: .5rem 0 .75rem; padding-left: 1.4rem; }
.steps li { margin: .25rem 0; }
/* On a phone the workspace's header has room only in its middle: the chip shrinks to its dot there. */
@media (max-width: 767px) {
  .chip { top: max(.5rem, env(safe-area-inset-top)); bottom: auto; right: auto; left: 50%; transform: translateX(-50%);
    width: 2rem; height: 2rem; padding: 0; justify-content: center; }
  .chip #chip-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .chip .dot { width: .75rem; height: .75rem; }
  .menu { top: calc(max(.5rem, env(safe-area-inset-top)) + 2.5rem); bottom: auto; right: auto; left: 50%; transform: translateX(-50%); }
  #workspace:not([hidden]) ~ .banner { top: calc(max(.5rem, env(safe-area-inset-top)) + 3rem); }
}
body.over #shell { position: fixed; inset: 0; z-index: 5; overflow: auto; background: var(--bg); box-shadow: 0 0 0 100vmax var(--bg); }
