/* The dashboard's whole appearance. One file, because there is not enough of it
   to be worth splitting, and a single request beats three. */

:root {
  --bg: #0d1117;
  --bg-raised: #151b24;
  --bg-sunken: #0a0e14;
  --border: #232c39;
  --border-strong: #2f3b4c;
  --text: #e4e9f0;
  --text-dim: #93a1b5;
  --text-faint: #64748b;
  --accent: #4da3ff;
  --accent-dim: #1e3a5f;
  --ok: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --radius: 10px;
  --radius-sm: 6px;
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;

  /* This page is dark, and the browser needs telling so. Without it the parts
     the browser draws itself — the caret, scrollbars, the inside of a select,
     the panel it offers a saved password from — come out in the light palette
     and sit oddly against everything else. */
  color-scheme: dark;
}

* { box-sizing: border-box; }

/* Controls and the words on them are not text to be selected. Double-clicking
   a button to press it twice quickly should not leave its label highlighted,
   and dragging across a row of buttons should not paint them blue.

   Deliberately narrow: this covers the things you click and the chrome that
   labels them. Everything a person might actually want to copy — addresses,
   MAC addresses, invitation codes, the connection log, the build stamp —
   stays selectable, because taking that away would be a worse fault than the
   one being fixed. */
button,
.btn,
.btn-icon,
.modal h3,
.modal label > span,
.modal .hint,
th,
.brand,
.stat,
.sidebar-head,
.join-platform,
.card-head h3 {
  -webkit-user-select: none;
  user-select: none;
}

/* An input is a control, but what is typed into it is text. */
input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ------------------------------------------------------------------ brand */

.brand { display: flex; align-items: baseline; gap: 7px; }
.brand-mark {
  font-weight: 700; letter-spacing: .5px; color: var(--accent);
  background: var(--accent-dim); padding: 3px 8px; border-radius: var(--radius-sm);
  font-size: 13px;
}
.brand-name { font-weight: 600; letter-spacing: .2px; }

/* ------------------------------------------------------------------ login */

.login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: radial-gradient(1000px 500px at 50% -10%, #16243a 0%, var(--bg) 60%);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--bg-raised);
  border: 1px solid var(--border); border-radius: 14px; padding: 32px;
  display: flex; flex-direction: column; gap: 16px;
}
.login-card .brand { justify-content: center; margin-bottom: 4px; }
/* The language is chosen before signing in as well: a page in a language the
   visitor cannot read is no place to look for the setting that changes it.
   At the foot of the card, where it does not crowd the name. */
.login-card .login-lang { align-self: center; width: auto; }
/* An empty message line, or a row of links with nothing left to show, should
   not leave a hole in the card. */
.login-card p:empty, .login-card .login-switch:not(:has(:not(.hidden))) { display: none; }
.login-hint { margin: 0; color: var(--text-dim); font-size: 13px; text-align: center; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }

/* Plain text buttons under the sign-in button — today only "forgotten your
   password", and only where the server can send the letter. */
.login-switch { display: flex; flex-direction: column; gap: 6px; align-items: center; margin-top: 2px; }
.link {
  background: none; border: none; padding: 2px; font: inherit; font-size: 13px;
  color: var(--accent); cursor: pointer; text-align: center;
}
.link:hover { text-decoration: underline; }
.good { color: var(--ok); font-size: 13px; margin: 0; text-align: center; }

/* ------------------------------------------------------------------ inputs */

/* Every kind of field a form here uses is listed. A type left out of this
   list is not styled at all — it comes out in the browser's own small, pale
   default, which is exactly what happened to the address field when it became
   type=email. */
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], input[type=tel], input[type=url], input[type=file],
select, textarea {
  background: var(--bg-sunken); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); color: var(--text);
  padding: 9px 11px; font: inherit; font-size: 14px; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77,163,255,.15);
}
input::placeholder { color: var(--text-faint); }

/* Choosing a file is a button inside a field; left alone it keeps the pale
   system look next to everything else. */
input[type=file] { padding: 7px 9px; font-size: 13px; }
input[type=file]::file-selector-button {
  background: var(--bg-raised); border: 1px solid var(--border-strong); color: var(--text);
  padding: 5px 10px; border-radius: var(--radius-sm); font: inherit; font-size: 13px;
  margin-right: 10px; cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: #1c2431; border-color: #3b4a5f; }

/* A field the browser has filled in, or thinks it might, is painted by the
   browser itself — white or pale yellow, over the top of everything set above,
   and only until the first keystroke. There is no property that turns that
   painting off; the way round it is an inset shadow thick enough to cover the
   field, since the shadow is drawn above the browser's background but below
   the text. The absurd transition delay keeps it covered: the colour is
   applied with an animation, and one that never arrives never shows.

   :autofill is the standard spelling and -webkit-autofill the one Chrome has
   understood for years. They are listed separately on purpose — a selector
   list is thrown away entirely if a browser does not recognise one part of
   it, which would take the fix down with it. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-box-shadow: inset 0 0 0 1000px var(--bg-sunken);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}
input:autofill,
input:autofill:hover,
input:autofill:focus {
  box-shadow: inset 0 0 0 1000px var(--bg-sunken);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}

/* Buttons are blue and they glow a little.

   They used to be grey outlines with one blue "primary" among them, and the
   grey ones read as disabled: "Send a test message" beside "Save" looked like
   something that could not be pressed. So the whole set carries the accent
   now, and the difference between the main action and the rest is weight and
   fill rather than colour — a filled button for the thing the dialog is for,
   an outlined one for everything else, both unmistakably buttons. */
.btn {
  border: 1px solid var(--accent); background: rgba(77,163,255,.10); color: var(--accent);
  padding: 9px 15px; border-radius: var(--radius-sm); font: inherit; font-size: 14px;
  font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .14s, border-color .14s, box-shadow .14s, color .14s;
}
.btn:hover {
  background: rgba(77,163,255,.20); color: #9ccbff;
  box-shadow: 0 0 10px rgba(77,163,255,.30);
}
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: #06121f; font-weight: 600;
  box-shadow: 0 0 10px rgba(77,163,255,.28);
}
.btn.primary:hover {
  background: #6bb3ff; border-color: #6bb3ff;
  box-shadow: 0 0 16px rgba(77,163,255,.50);
}
/* The buttons in the top bar sit on the bar rather than in a form, and a row
   of filled blue would shout over the page they are above. They keep the same
   colour and light up the same way, on nothing. */
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
/* Deleting is red wherever it appears, and glows red: the one thing that must
   never be pressed by muscle memory aimed at a blue button. */
.btn.danger { color: var(--bad); border-color: #6a2f2a; background: rgba(248,81,73,.08); }
.btn.danger:hover {
  background: rgba(248,81,73,.18); border-color: var(--bad); color: #ff8078;
  box-shadow: 0 0 10px rgba(248,81,73,.30);
}
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn:disabled:hover { background: rgba(77,163,255,.10); color: var(--accent); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Every tick in this program is a switch.

   A checkbox is a small square that says nothing about what it does until you
   read the label; a switch says "on" or "off" from across the room, which is
   what these are — settings left alone for months and glanced at, not filled
   in. They are drawn rather than borrowed so that the state reads at a glance
   in this dark palette: the accent colour and a little of its own light when
   on, and the quiet of everything else when off.

   The size is stated with !important, which is not a habit but is right here.
   A switch has one size wherever it appears, and the rules it lands among were
   written for text fields: ".modal input" stretches to the width of the dialog
   and ".check input" resets it to auto. Both won, and the switch came out as a
   sliver with the label on top of it. */
input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  position: relative; flex: none; margin: 0; cursor: pointer;
  width: 38px !important; height: 21px !important; min-width: 38px; border-radius: 11px;
  background: var(--bg-sunken); border: 1px solid var(--border-strong);
  padding: 0; transition: background .16s, border-color .16s, box-shadow .16s;
}
input[type="checkbox"]::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--text-faint);
  transition: transform .16s ease, background .16s;
}
input[type="checkbox"]:hover { border-color: var(--accent); }
input[type="checkbox"]:checked {
  background: rgba(77,163,255,.22); border-color: var(--accent);
  box-shadow: 0 0 10px rgba(77,163,255,.35);
}
input[type="checkbox"]:checked::after {
  transform: translateX(17px);
  background: var(--accent);
  box-shadow: 0 0 8px rgba(77,163,255,.65);
}
input[type="checkbox"]:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* A switch is taller than a line of text, so the label beside it is centred on
   it rather than sitting on the old checkbox baseline — and gets the same air
   above and below as the ones on the settings page. */
.checkbox { align-items: center; gap: 11px !important; padding: 6px 0; }
/* What belongs to a switch — the fields it turns on — lines up under its
   label rather than under the control. */
.notify-block { margin-left: 49px; }

.error { color: var(--bad); font-size: 13px; margin: 0; min-height: 18px; }

/* ----------------------------------------------------------------- topbar */

.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 20px; height: 56px;
  background: var(--bg-raised); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.stats { display: flex; gap: 20px; margin-left: 8px; flex: 1; overflow: hidden; }
.stat { display: flex; align-items: baseline; gap: 6px; font-size: 13px; color: var(--text-dim); }
.stat b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.lang { width: auto; padding: 6px 8px; font-size: 13px; }

/* ----------------------------------------------------------------- layout */

/* 224px rather than the 280 it started at: a fifth of the sidebar was empty on
   every screen, and that fifth is what decides whether the members table fits
   across 1920 without a horizontal scrollbar. Segment names longer than the
   column are cut with an ellipsis, which they were at 280 too. */
.layout { display: grid; grid-template-columns: 224px 1fr; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

/* The sidebar is a column so the build stamp can sit at its foot rather than
   trailing whatever number of segments happens to be above it. */
.sidebar {
  border-right: 1px solid var(--border); padding: 16px;
  min-height: calc(100vh - 56px);
  display: flex; flex-direction: column;
}
.sidebar .segment-list { flex: 1; }

/* On a screen wide enough for two columns the sidebar keeps its place while
   the page scrolls: the list of segments scrolls inside it and the build stamp
   stays in the bottom-left corner. The help page is several screens long, and
   the version is precisely what somebody who has scrolled to the bottom of it
   is looking for. */
@media (min-width: 861px) {
  .sidebar {
    position: sticky; top: 56px;
    height: calc(100vh - 56px); min-height: 0;
  }
  /* min-height: 0 lets the list shrink to what is left over instead of
     pushing the stamp off the bottom — a flex item refuses to go below its
     content otherwise. */
  .sidebar .segment-list { overflow-y: auto; min-height: 0; }
}

.build-info {
  flex: none;
  margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px; line-height: 1.7;
  color: var(--text-faint); user-select: text;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sidebar-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--text-faint); margin: 0; }

.segment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.segment-list button {
  width: 100%; text-align: left; background: transparent; border: 1px solid transparent;
  color: var(--text); padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 3px;
}
.segment-list button:hover { background: var(--bg-raised); }
.segment-list button.active { background: var(--accent-dim); border-color: #2c547f; }
.segment-list .seg-name { font-weight: 600; font-size: 14px; }
.segment-list .seg-meta { font-size: 12px; color: var(--text-dim); font-family: var(--mono); }
.badge-pending {
  display: inline-block; background: var(--warn); color: #1b1400; font-size: 11px;
  font-weight: 700; border-radius: 20px; padding: 1px 7px; margin-left: 6px;
}

.content { padding: 24px; min-width: 0; }
.empty { color: var(--text-dim); text-align: center; padding: 60px 20px; }

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 20px; overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-head h3 { margin: 0; font-size: 15px; }
.card-body { padding: 18px; }
.card-body p { margin: 0 0 10px; color: var(--text-dim); font-size: 14px; }
.card-body p:last-child { margin-bottom: 0; }

.segment-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.segment-header h1 { margin: 0 0 6px; font-size: 22px; }
.segment-header .sub { color: var(--text-dim); font-family: var(--mono); font-size: 13px; }
.header-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ----------------------------------------------------------------- tables */

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-faint); font-weight: 600; padding: 10px 18px; border-bottom: 1px solid var(--border);
}
td { padding: 12px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }

/* On a table cell, height is a minimum rather than a fixed size. That is
   exactly what is wanted here: every row is at least this tall regardless of
   what its cells currently hold, and a blocked machine whose reason needs a
   second line is still allowed to grow. */
tbody td { height: 56px; }
.log-table tbody td { height: auto; }
tr:last-child td { border-bottom: none; }
tr.pending-row { background: rgba(210,153,34,.06); }

/* A row somebody has marked with a colour. The colour is shown as a bar down
   the left edge and a wash behind the row rather than as the row's background
   proper: a full-strength colour under the text would make half the palette
   unreadable, and the choice of colour is the reader's, not something the
   stylesheet can vet for contrast. colour-mix keeps one value doing both jobs
   — the bar solid, the wash a tenth of it. */
tr.colored-row { background: color-mix(in srgb, var(--row-color) 9%, transparent); }
tr.colored-row td:first-child { box-shadow: inset 3px 0 0 var(--row-color); }
tr.colored-row:hover { background: color-mix(in srgb, var(--row-color) 15%, transparent); }
.mono { font-family: var(--mono); font-size: 13px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Icon buttons. The drawings inherit the button's colour, so a single rule
   governs how the whole set responds. */
.btn-icon {
  background: none; border: 1px solid transparent; color: var(--text-dim);
  padding: 5px; border-radius: var(--radius-sm); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .12s, background .12s, border-color .12s, opacity .12s;
}
.btn-icon svg { width: 16px; height: 16px; fill: currentColor; stroke: currentColor; }
.btn-icon:hover { color: var(--text); background: var(--bg-sunken); border-color: var(--border-strong); }
.btn-icon:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn-icon[data-danger]:hover { color: var(--bad); border-color: #4a2622; }

/* The rename pencil keeps out of the way until the row is pointed at, so a
   column of names stays a column of names. The action icons do not hide:
   something you cannot see is something you will not find. */
.btn-icon.quiet {
  color: var(--text-faint); padding: 3px; margin-left: 6px;
  opacity: 0; vertical-align: -3px;
}
.btn-icon.quiet svg { width: 13px; height: 13px; }
tr:hover .btn-icon.quiet, .btn-icon.quiet:focus-visible { opacity: 1; }
.btn-icon.quiet:hover { color: var(--accent); }

/* Touch has no pointer to hover with, so a button that only appears on hover
   is a button that is not there at all. */
@media (hover: none) {
  .btn-icon.quiet { opacity: 1; }
}

/* A tag is a word in a narrow column: a workshop, a customer, a floor. Set in
   a box so that the eye picks the column out without reading it, and clipped
   rather than allowed to widen the column. */
/* 108px holds a tag of eight or nine characters plus its pencil — inventory
   numbers, in practice. The twenty pixels this gave up are what put the whole
   table inside 1920 with the name column no longer wrapping. */
.col-tag { width: 108px; }
.node-tag {
  display: inline-block; max-width: 118px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: bottom;
  padding: 2px 8px; border-radius: 999px; font-size: 12px;
  background: rgba(77,163,255,.10); border: 1px solid var(--border-strong); color: var(--text-dim);
}

/* The notes button beside the tag: dim when there is nothing behind it, in the
   accent colour when there is, so the column reads at a glance (1.0.110). */
.col-memo { width: 34px; text-align: center; }
th.col-memo svg { width: 14px; height: 14px; opacity: .6; vertical-align: middle; }
.memo-btn { opacity: .35; }
.memo-btn:hover { opacity: 1; }
.memo-btn.has-memo { opacity: 1; color: var(--accent); }
.memo-field { width: 100%; min-height: 220px; resize: vertical; font: inherit; line-height: 1.45; }

/* Headings that sort. Only five of them do — the columns somebody asks a
   question of — and the arrow says which one is in charge and which way. */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--text); }
th.sorted { color: var(--accent); }
.sort-arrow { font-size: 11px; }

/* The corner of the page carries two builds, the server's and the client's.
   They are released apart and their numbers differ, so each is under a heading
   of its own with a rule under it — a reader must not take one for the other.
   Under each, the way to what changed in it. */
.build-part + .build-part { margin-top: 14px; }
.build-side {
  /* The block around it is set in the monospaced face; the heading is a word
     rather than a number, so it goes back to the page's own. Spelled out
     because there is no variable for it — see the note in the stylesheet's
     header about rules that use a variable this file does not define. */
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-dim); padding-bottom: 5px; margin-bottom: 5px;
  border-bottom: 1px solid var(--border);
}
.build-history {
  display: inline-block; margin-top: 3px;
  color: var(--text-faint); text-decoration: none; border-bottom: 1px dotted currentColor;
}
.build-history:hover { color: var(--accent); }

/* The releases themselves, in a dialog. It is a document to be read, so it is
   set as one: a scrolling column with room between the entries rather than a
   table of everything at once. */
.changelog { max-height: 60vh; overflow-y: auto; padding-right: 6px; margin-top: 4px; }
.changelog-entry { padding: 14px 0; border-bottom: 1px solid var(--border); }
.changelog-entry:last-child { border-bottom: none; }
.changelog-head { display: flex; align-items: baseline; gap: 10px; }
.changelog-version { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text); }
.changelog-date { font-size: 12px; color: var(--text-faint); }
.changelog-entry ul { margin: 8px 0 0; padding-left: 20px; color: var(--text-dim); }
.changelog-entry li { margin-bottom: 6px; line-height: 1.6; }

/* The search box over the members table. It sits in the card's heading rather
   than above the card, because it belongs to this table and to no other, and
   it is narrow: a segment of forty is found by three letters, not by a
   sentence. */
/* Just wider than its own placeholder — "Поиск по имени и примечанию" is the
   longest of the nine — and no wider. A search box that runs across the card
   promises a sentence; three letters find a machine here.

   Written as input[type=search].table-filter rather than as .table-filter: the
   rule that dresses every text field sets width to 100%, and an attribute
   selector outweighs a bare class. Without the type in front the box came out
   the full width of the card — measured at 1145px on the live panel. */
input[type=search].table-filter {
  width: 230px; max-width: 100%; margin-left: auto;
  background: var(--bg-sunken); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); color: var(--text);
  padding: 6px 10px; font: inherit; font-size: 13px;
}
.table-filter:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 8px rgba(77,163,255,.25); }
.table-filter::placeholder { color: var(--text-faint); }
/* Rows the search has ruled out. Hidden rather than removed, so that typing
   does not rebuild the table under the caret. */
tr.filtered-out { display: none; }
.filter-empty { padding: 18px 20px 4px; }

/* The address and its copy button stay on one line: wrapping an IP address
   is the one thing this column must never do. */
td .addr { white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* The system's own mark before its name.
   The penguin takes the colour of the text, so it stays legible in either
   theme, and its eyes are painted with the page behind it rather than with
   black — on a dark table a black eye is no eye at all. Beak and feet keep the
   one colour everybody knows the bird by. */
.platform { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.platform svg { width: 15px; height: 15px; flex: none; }
.tux-body { fill: currentColor; stroke: none; }
.tux-eye  { fill: var(--bg); stroke: none; }
.tux-beak { fill: #f0a132; stroke: none; }
.win-pane { fill: #45a3e8; stroke: none; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
.dot.online { background: var(--ok); box-shadow: 0 0 6px rgba(63,185,80,.6); }
.dot.offline { background: var(--text-faint); }
.dot.pending { background: var(--warn); }
.dot.blocked { background: var(--bad); }
.state-label { color: var(--text-dim); font-size: 13px; }

/* The administrator's own remark, on a second line under the machine's name.
   It is set quieter and smaller than the name so that a glance down the column
   still reads the names, and indented past the status dot so that it lines up
   with the name rather than with the dot. Long remarks are cut off rather than
   allowed to widen the column; the whole text is in the tooltip. */
/* The name column is as wide as its longest line and no narrower: a name or a
   note wrapped onto two lines makes every row in the table a different height,
   and a list of forty machines then reads as a ragged column rather than a
   list. The table lays itself out automatically, so nowrap here is what sets
   the width. */
.node-name { display: block; white-space: nowrap; }

/* A machine whose comings and goings go to Telegram, marked beside its name.
   Quiet: it is a fact about the row, not a control, and there is one of these
   for every machine somebody has picked out. */
.notify-mark { display: inline-flex; vertical-align: -3px; margin-left: 6px; color: var(--text-faint); }
.notify-mark svg { width: 14px; height: 14px; stroke: currentColor; fill: none; }

/* The note under the name is shown whole, for the same reason: it is how half
   the machines here are recognised, and "щит на Пушкина…" cut at 260px tells
   you which street but not which one of the four boxes on it. */
/* Which account is signed in, in the top bar beside the buttons. Quiet, and
   shortened rather than allowed to push the buttons off a narrow window: the
   full address is in the tooltip. */
.who {
  color: var(--text-dim); font-size: 13px; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-right: 4px;
}
@media (max-width: 900px) { .who { display: none; } }

/* Dragging a machine onto another segment.
   The row being carried fades; the segment under the pointer lights up. While
   a drag is in progress the whole page stops trying to select text, which is
   what a slow drag over a table otherwise does. */
tr[draggable="true"] { cursor: grab; }
tr.dragging { opacity: .45; cursor: grabbing; }
body.dragging-node { user-select: none; }
.segment-list button.drop-here {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset, 0 0 10px rgba(77,163,255,.22);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* Arranging the list itself. A line above or below the row under the pointer,
   rather than a highlight on it: what is being said is "it will go here", and
   a highlighted row says "it will go into this one" — which is what dropping a
   machine does, two rules up. The two must not look alike. */
.segment-list li[draggable="true"] { cursor: grab; }
.segment-list li.dragging { opacity: .45; cursor: grabbing; }
.segment-list li.drop-above,
.segment-list li.drop-below { position: relative; }
.segment-list li.drop-above::before,
.segment-list li.drop-below::after {
  content: ''; position: absolute; left: 2px; right: 2px; height: 2px;
  background: var(--accent); border-radius: 2px;
}
.segment-list li.drop-above::before { top: -2px; }
.segment-list li.drop-below::after { bottom: -2px; }

.node-note {
  margin-top: 3px; padding-left: 15px;
  font-size: 12px; color: var(--text-dim); font-weight: 400;
  white-space: nowrap;
}

/* Waiting for approval, or blocked with a reason. The state column is gone —
   the dot beside the name carries "up" and "down" on its own — but these two
   are not states the dot can spell out, and the second of them is a sentence
   somebody typed. Under the name, where the eye already is. */
.node-standing {
  margin-top: 3px; padding-left: 15px;
  font-size: 12px; font-weight: 400;
  white-space: nowrap;
}
.node-standing.pending { color: var(--warn); }
.node-standing.blocked { color: var(--bad); }

/* A machine that is up and one that vanished a week ago both used to be a
   grey timestamp. Colour separates them at a glance, which is the whole point
   of looking at this column. */
/* Both directions on two lines: side by side they run together into one long
   number that has to be read twice to be understood.

   The box keeps the height of those two lines whether or not there is
   anything to put in it. Otherwise a row grows the moment traffic starts and
   shrinks again when it stops, and with several machines busy at once the
   whole table twitches — which makes it hard to read exactly when there is
   most to read. */
.rate {
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  min-height: 32px; font-size: 12px; line-height: 1.3;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
/* Fixed width as well as fixed height. The widest value this column can ever
   hold is "↓ 1024.0 МБ/с" — thirteen characters, about 94px in the monospace
   face at 12px, plus the cell's own 36px of padding. 144px leaves room to
   spare, and the column then stops shoving its neighbours about every time a
   machine starts or stops transferring.

   min and max together are what make it stick: the table lays itself out
   automatically, and a plain width is only a suggestion to it. */
.col-rate { width: 128px; min-width: 128px; max-width: 128px; }

.rate-down { color: var(--accent); }
.rate-up { color: var(--warn); }
.rate.idle { color: var(--text-faint); }

/* The machine's own account of itself: the system on top, then a bar each for
   memory and processor. Fixed width for the same reason as the rate column —
   the figures change every half minute, and a column that resizes with them
   makes the whole table twitch. */
/* The bars are the point of the column, and a bar sixty pixels long says
   "somewhere between empty and full" and nothing else. This went 240 → 480 →
   288: twice the original was more room than the reading needs, and the width
   is taken from the rest of the table.

   The MAC column is pinned too, and only so that this one sits next to it: the
   table lays itself out automatically, and the spare width of the row was
   going into MAC, leaving a hand's breadth of nothing between the address and
   the bars. Seventeen monospace characters plus the cell's padding. */
.col-sys { width: 216px; min-width: 216px; max-width: 216px; }
.col-mac { width: 170px; min-width: 170px; max-width: 170px; }
.sysinfo { display: flex; flex-direction: column; gap: 3px; }
.sysinfo-os {
  font-size: 12px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Label, bar, figure — and each row sizes its own figure. "7%" needs a third
   of the room "441 МБ / 971 МБ" does, so the processor bar simply runs on to
   where its number starts. Lining the two bars up looked tidier in a mock-up
   and wasted a centimetre of the column in every row. */
.sysinfo-row {
  display: grid; grid-template-columns: 24px 1fr auto;
  gap: 6px; align-items: center;
}
.sysinfo-label {
  font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-faint);
}
.sysinfo-val {
  font-size: 10.5px; color: var(--text-dim); white-space: nowrap;
  font-variant-numeric: tabular-nums; text-align: right;
}
.bar {
  height: 5px; border-radius: 3px; overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
}
.bar-fill {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), #7cc4ff);
  transition: width 0.4s ease;
}

.version { font-variant-numeric: tabular-nums; white-space: nowrap; }
.version.behind { color: var(--warn); cursor: help; }
.version.unknown { color: var(--text-faint); }

.uptime { font-variant-numeric: tabular-nums; white-space: nowrap; }
.uptime.up { color: var(--ok); }
.uptime.gone { color: var(--text-dim); }
.uptime.never { color: var(--text-faint); font-style: italic; }

/* ---------------------------------------------------------------- invites */

.invite-code {
  font-family: var(--mono); font-size: 15px; letter-spacing: 1px;
  background: var(--bg-sunken); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 6px 10px; display: inline-block;
}
.invite-code.spent { opacity: .45; text-decoration: line-through; }

/* Each platform restarts the numbering, so "step 2" means step 2 of the one
   being followed rather than of a single run-on list. */
.join-platform {
  margin: 22px 0 10px; font-size: 14px; color: var(--text);
  text-transform: uppercase; letter-spacing: .5px;
}
.join-platform:first-child { margin-top: 0; }
.join-note { margin-top: 12px; font-size: 13px; color: var(--text-faint); }

.join-steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.join-steps li { counter-increment: step; position: relative; padding: 0 0 14px 34px; }
.join-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent-dim);
  color: var(--accent); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.join-steps code {
  display: block; font-family: var(--mono); font-size: 13px; margin-top: 6px;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 11px; overflow-x: auto; white-space: pre;
}

/* -------------------------------------------------------- copying commands */

/* A command block carries its own copy button. The button is kept out of the
   way until the pointer or the keyboard reaches the block, because a page of
   instructions read from top to bottom should look like prose, not like a
   column of controls. The room it takes is reserved even while it is hidden,
   so nothing shifts and no command ends up underneath it. */
.code-copy { position: relative; }
.code-copy > pre, .code-copy > code { padding-right: 108px; }

.copy-btn {
  position: absolute; top: 7px; right: 7px;
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 12px; line-height: 1;
  padding: 5px 9px; border-radius: var(--radius-sm);
  background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--text-faint); cursor: pointer;
  /* Faint rather than absent: a button nobody knows about is a button nobody
     presses, and the whole point is that the command need not be retyped. It
     comes up to full strength under the pointer. */
  opacity: .45; transition: opacity .12s, color .12s, border-color .12s;
}
.copy-btn svg { width: 14px; height: 14px; stroke: currentColor; }
.code-copy:hover > .copy-btn,
.code-copy:focus-within > .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }
.copy-btn:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 1px; }
.copy-btn.done { color: var(--ok); border-color: var(--ok); }

/* Touch has no pointer to hover with, and a button nobody can reveal is a
   button that is not there. */
@media (hover: none) {
  .copy-btn { opacity: 1; }
}

/* ------------------------------------------------------------------- help */

/* The help page is a document, so it is set for reading: a measure that does
   not run the width of a wide monitor, and generous space between sections. */
.help { max-width: 860px; }
.help h2 {
  font-size: 20px; margin: 34px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.help h2:first-child { margin-top: 0; }
.help h3 { font-size: 16px; margin: 22px 0 8px; color: var(--text); }
.help p { margin: 0 0 12px; color: var(--text-dim); }
.help ul, .help ol { margin: 0 0 14px; padding-left: 22px; color: var(--text-dim); }
.help li { margin-bottom: 7px; }
.help strong { color: var(--text); font-weight: 600; }
.help code {
  font-family: var(--mono); font-size: 13px; color: var(--text);
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px;
}
.help pre {
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 15px;
  overflow-x: auto; margin: 0 0 14px;
}
.help pre code { background: none; border: none; padding: 0; line-height: 1.65; }

.help-steps { counter-reset: hstep; list-style: none; padding: 0; }
.help-steps li { counter-increment: hstep; position: relative; padding-left: 32px; margin-bottom: 11px; }
.help-steps li::before {
  content: counter(hstep); position: absolute; left: 0; top: 1px;
  width: 21px; height: 21px; border-radius: 50%; background: var(--accent-dim);
  color: var(--accent); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.help-table { margin: 0 0 16px; font-size: 14px; }
.help-table td, .help-table th { padding: 7px 12px; border-bottom: 1px solid var(--border); }
.help-table td:first-child { width: 34%; color: var(--text-dim); }
.help-table th { color: var(--text); font-size: 13px; text-transform: none; letter-spacing: 0; padding-top: 16px; }

.download-list { list-style: none; padding: 0; margin: 0 0 16px; }
.download-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 15px; margin-bottom: 8px;
}
.download-list a { color: var(--accent); text-decoration: none; font-weight: 600; font-family: var(--mono); font-size: 14px; }
.download-list a:hover { text-decoration: underline; }
.download-meta { color: var(--text-faint); font-size: 12px; white-space: nowrap; }
.help-empty { color: var(--text-faint); font-size: 14px; }

/* ------------------------------------------------- the menu on a table row */

/* Opened with the right mouse button on a machine's row. It is drawn as the
   page's own menu rather than the browser's, because what it offers belongs to
   this table: the colour of the row and whether that machine is worth a
   message. Fixed rather than absolute — it is placed against the window, at
   the pointer, and must not scroll away from it. */
.row-menu {
  position: fixed; z-index: 60; min-width: 210px;
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 8px;
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
  font-size: 13px;
}
.row-menu.hidden { display: none; }
.row-menu-head {
  padding: 2px 6px 8px; color: var(--text); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px;
}
.row-menu-label { padding: 0 6px 6px; color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
/* The list of segments to move to, under a rule of its own: everything above
   it changes a mark on this machine, everything below moves the machine. */
.row-menu-sep { height: 1px; margin: 6px 0; background: var(--border); }
.row-menu-sub { margin-left: auto; padding-left: 10px; color: var(--text-faint); font-size: 11px; font-family: var(--mono); }
.row-menu-colors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0 6px 8px; }
.row-swatch {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer; padding: 0;
}
.row-swatch:hover { transform: scale(1.1); }
.row-swatch.chosen { border-color: var(--text); }
/* The way back to a plain row, drawn as an empty place rather than a colour. */
.row-swatch.clear {
  background: transparent; border: 1px dashed var(--border-strong);
  color: var(--text-dim); font-size: 15px; line-height: 1;
}
.row-swatch.clear.chosen { border: 2px solid var(--text); }

.row-menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: none; border: none; border-top: 1px solid var(--border);
  padding: 9px 6px 4px; margin-top: 2px;
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.row-menu-item:hover { color: var(--accent); }
.row-menu-ic { display: inline-flex; }
.row-menu-ic svg { width: 15px; height: 15px; stroke: currentColor; fill: none; }
.row-menu-check { margin-left: auto; color: var(--ok); }

/* ----------------------------------------------------------------- modals */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3,6,11,.72);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50;
}
.modal {
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  border-radius: 14px; width: 100%; max-width: 440px; padding: 24px;
}
/* The connection log is a table, not a form, and needs the room. */
.modal:has(.log-table) { max-width: 760px; }
/* So does the list of releases: it is a page of prose, and prose in a column
   the width of a form is read one clause at a time. */
.modal:has(.changelog) { max-width: 680px; }

/* -------------------------------------------------- the administrator pages */

/* Eight small cards rather than a paragraph of numbers: the first screen is
   read at a glance, and a glance wants shapes, not sentences. */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.stat-card { padding: 16px 18px; margin: 0; }
.stat-value { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

th.sortable { cursor: pointer; user-select: none; }
.support-mail { color: var(--accent); font-size: 18px; font-weight: 600; text-decoration: none; }
.support-mail:hover { text-decoration: underline; }
#s-facts {
  background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-family: var(--mono); font-size: 12px; color: var(--text-dim);
  white-space: pre-wrap; overflow-x: auto; margin: 0;
}
th.sortable:hover { color: var(--text); }

/* The settings pages are forms, and a form reads down the page rather than
   across it. */
.form { display: flex; flex-direction: column; gap: 14px; max-width: 620px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-dim); }
.form textarea {
  background: var(--bg-sunken); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); color: var(--text); padding: 9px 11px;
  font: inherit; font-size: 13px; font-family: var(--mono); width: 100%; resize: vertical;
}
.form .actions { justify-content: flex-start; }

/* ---------------------------------------------------------------- terminal */

/* Eighty columns of monospace is what everything on the far end assumes, and a
   terminal narrower than that wraps every line it is shown. Half as wide again
   as that minimum, because the things people actually run — apt, systemctl,
   ls -l — print past eighty and wrapping them makes output unreadable.
   The side padding is cut to a strip: in this dialog every pixel of margin is
   a column of somebody's output that had to wrap. */
.modal:has(.term-shell) { max-width: 1350px; padding: 20px 14px 16px; }
.term-login { display: block; }
.term-shell { display: block; }
.term-shell.hidden, .term-login.hidden { display: none; }

.term-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px; font-size: 12px;
}
.term-where { color: var(--text-dim); }
.term-state { color: var(--text-faint); }
/* The one control in this strip sits at the far end of it, away from the two
   pieces of text, so the head still reads as a line of writing.

   Not the quiet kind of icon button. Those hide until the row they sit in is
   pointed at, and there is no row here: the button would be invisible in every
   state, which — as the rule for the quiet ones says — means nobody finds it.
   Found exactly that way, on the screen, after the check in jsdom had happily
   clicked a button no human could see. */
.term-full-btn { margin-left: auto; padding: 3px 5px; color: var(--text-faint); }
.term-full-btn svg { width: 14px; height: 14px; fill: none; }
.term-full-btn:hover { color: var(--text); }

/* Full screen. The dialog stops being a card in the middle of the page and
   becomes the page: no backdrop margin, no rounded corners, and the screen
   itself takes every row left over once the heading and the buttons have had
   theirs. The two lines above the terminal go — in this state the window is
   the terminal, and the address is already in the strip below the heading. */
.modal-backdrop.term-full { padding: 0; }
.modal.term-full {
  max-width: none; width: 100vw; height: 100vh; border-radius: 0;
  display: flex; flex-direction: column; padding: 12px 12px 10px;
}
.modal.term-full > h3, .modal.term-full > .hint { display: none; }
.modal.term-full .term-shell { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.modal.term-full .term-screen { flex: 1; height: auto; min-height: 0; }
.modal.term-full .modal-actions { margin-top: 10px; }

/* The screen keeps its height whatever the shell is doing, so the dialog does
   not grow and shrink as output arrives. */
.term-screen {
  height: 60vh; min-height: 260px;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 6px;
  overflow: hidden;
}
.term-screen .xterm { height: 100%; }

/* The scrollbar xterm puts inside its viewport is the browser's own: on
   Windows that is a wide light-grey strip, and the last column of output ends
   up pressed against it. Narrow it, paint it in the colours of everything
   around it, and leave a little air between the text and the bar — a line
   ending under the scrollbar is a line somebody cannot read. */
.term-screen .xterm-viewport {
  background-color: transparent !important;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.term-screen .xterm-viewport::-webkit-scrollbar { width: 9px; }
.term-screen .xterm-viewport::-webkit-scrollbar-track { background: transparent; }
/* The little arrows at the ends belong to a window, not to a pane of output. */
.term-screen .xterm-viewport::-webkit-scrollbar-button { display: none; height: 0; }
.term-screen .xterm-viewport::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 5px;
}
.term-screen .xterm-viewport::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
.term-screen .xterm-screen { margin-right: 6px; }

.log-wrap { max-height: 55vh; overflow-y: auto; margin: 0 -6px; }
.log-table { font-size: 13px; }
.log-table th {
  position: sticky; top: 0; background: var(--bg-raised);
  padding: 8px 10px; font-size: 11px;
}
.log-table td { padding: 7px 10px; }
.log-table tr.log-reason td {
  padding-top: 0; color: var(--text-faint); font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.modal h3 { margin: 0 0 16px; font-size: 17px; }
.modal label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13px; color: var(--text-dim); }
.modal .hint { font-size: 12px; color: var(--text-faint); margin: -8px 0 14px; }
/* Something the dialog tells you rather than asks you: the subnet, which the
   server hands out. Shaped like the fields above it so it reads as part of the
   same form, but with no box around the value — a box says "type here". */
.field-static {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px;
  font-size: 13px; color: var(--text-dim);
}
.field-static b { font-weight: 600; color: var(--text); font-family: var(--mono); }
/* A word in a sentence that does something, for the rare action that belongs
   inside an explanation rather than beside it — "give it another subnet" is
   read as part of why, and a button there would shout. */
.linkish {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--accent); cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.linkish:hover { color: var(--text); }
.confirm-text { color: var(--text-dim); font-size: 14px; margin: 0; line-height: 1.55; }
/* The switch that has to be thrown before an irreversible button will work.
   Set apart from the sentence above it, so that it reads as a second act and
   not as part of the explanation. */
.confirm-arm {
  /* Room on both counts: a clear gap between the sentence and this box, so
     the box reads as a second step rather than as the end of the paragraph,
     and enough padding inside it that the switch is not pressed against the
     red edge. */
  margin-top: 24px; padding: 14px 18px;
  background: rgba(248,81,73,.06); border: 1px solid #4a2622; border-radius: var(--radius-sm);
}
/* Both classes named, and not for tidiness: this element is a `.check` as
   well, and the `.check` rule further down the file sets `margin: 0` and
   `padding: 9px 0`. Same specificity, later in the file — it wins, and the
   spacing above quietly did nothing. */
.confirm-arm.check {
  margin-top: 24px;
  padding: 15px 20px;
  align-items: flex-start;
}
.confirm-arm.check input { margin-top: 1px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
/* Held apart from the buttons a person reaches for: deleting the segment
   shares a row with Save, and next to it is the last place it should be. */
.modal-actions .btn.apart { margin-right: auto; }

/* Answers a click outside the dialog. A short pulse says "still here, use the
   buttons"; doing nothing at all would read as a page that had stopped
   responding. */
.modal.attention { animation: modal-attention .22s ease-out; }
@keyframes modal-attention {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.018); border-color: var(--accent); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .modal.attention { animation: none; border-color: var(--accent); }
}
.checkbox { flex-direction: row !important; align-items: center; gap: 9px !important; }
.checkbox input { width: auto; }

/* --------------------------------------------------- the account's settings */

/* A page rather than a dialog, so it is set for reading: a measure that does
   not run the width of a monitor, and each choice followed by the sentence
   that says what it costs. */
.prefs { max-width: 720px; }
.prefs h1 { font-size: 24px; margin: 0 0 6px; }
.prefs .sub { color: var(--text-dim); margin: 0 0 22px; }
.prefs .card { margin-bottom: 18px; }
.prefs .card-body { display: block; }

/* ------------------------------------------------ updating every client */

/* The bar counts machines finished, not bytes: each step is somebody else's
   apt-get, and a bar that pretended to know how far through it was would be
   inventing the number. */
.progress {
  height: 8px; border-radius: 4px; background: var(--bg-sunken);
  border: 1px solid var(--border); overflow: hidden; margin: 14px 0 10px;
}
.progress-bar { height: 100%; background: var(--accent); transition: width .3s ease; }
.update-line { color: var(--text-dim); font-size: 13px; margin: 0 0 10px; }
.update-log {
  max-height: 190px; overflow-y: auto; font-family: var(--mono); font-size: 12px;
  background: var(--bg-sunken); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
}
/* The list of machines to update. Every one is ticked to begin with, so this
   reads as a list to uncheck from rather than a form to fill in. */
.pick-list {
  max-height: 200px; overflow-y: auto; margin: 8px 0 6px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 10px; background: var(--bg-sunken);
}
/* Each machine is one row of the list and two lines inside it: the name, and
   under it where its version is going. Set tight — a dozen machines should be
   a list you can see at once, not a page to scroll. */
.check.pick { padding: 3px 0; font-weight: 400; align-items: center; }
.pick-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.pick-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-version { color: var(--text-faint); font-size: 11px; }
.pick-tools { display: flex; gap: 14px; margin-bottom: 14px; }
.pick-mode { margin-top: 4px; }

/* The two ways of going about it, laid out like the machines above them: the
   control on the left, the words to its right. The explanation belongs to its
   own choice, so it sits under that choice rather than floating between the
   two as a paragraph of its own. */
.check.mode { align-items: flex-start; padding: 5px 0; font-weight: 400; }
.check.mode input { margin-top: 3px; }
.check.mode .pick-text { line-height: 1.35; }
.mode-hint { color: var(--text-dim); font-size: 12px; max-width: 52ch; }

.update-row { padding: 1px 0; color: var(--text-dim); }
.update-row.good { color: var(--ok); }
.update-row.bad  { color: var(--bad); }
.update-row.warn { color: var(--warn); }

/* A label in a dialog is a caption above its field, which is why .modal label
   stacks. A tick is the other shape entirely — the control first, then what it
   means — so this one has to say so out loud, over that rule. */
/* A switch needs air around it. These are settings read one at a time and
   thought about, not a form to run down, and packed tight they read as one
   grey block. */
.check {
  display: flex; flex-direction: row !important; align-items: center;
  gap: 11px; cursor: pointer; font-weight: 500; color: var(--text);
  margin: 0; padding: 9px 0;
}
.check input { width: auto; margin: 0; flex: none; }
/* The explanation belongs under its own switch, indented to the text above it
   rather than to the control, so a column of settings reads as pairs. The
   indent is the switch (38px) plus the gap (11px). */
.pref-hint { margin: 2px 0 14px 49px; max-width: 60ch; }
.prefs-actions { display: flex; justify-content: flex-end; }

/* What belongs to the tick above it — the bot's token, the address the letters
   go to — indented to sit under that tick's text, so the page reads as
   "switch, and here is what it needs" rather than as one long form. */
.notify-block { margin: 0 0 18px 25px; max-width: 46ch; }
.notify-block .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.notify-block .field > span { font-size: 13px; color: var(--text-dim); }
.notify-block .btn { margin-top: 4px; }
.prefs .field { display: flex; flex-direction: column; gap: 6px; max-width: 46ch; margin-top: 14px; }
.prefs .field > span { font-size: 13px; color: var(--text-dim); }

/* ----------------------------------------------------------------- toasts */

.toast-stack { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: var(--bg-raised); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  padding: 11px 15px; font-size: 14px; max-width: 380px;
  animation: slide-in .18s ease-out;
}
.toast.bad { border-left-color: var(--bad); }
.toast.good { border-left-color: var(--ok); }
@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } }

/* The second-factor card in Settings (since 1.0.105). */
.tfa-state { margin: 0 0 6px; font-weight: 600; color: var(--text-dim); }
.tfa-state.on { color: var(--ok); }
.tfa-form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; max-width: 46ch; }
.tfa-form .field { display: flex; flex-direction: column; gap: 6px; }
.tfa-form .field > span { font-size: 13px; color: var(--text-dim); }
.tfa-form .btn { align-self: flex-start; }
.tfa-qr { background: #fff; padding: 8px; border-radius: 8px; width: 200px; height: 200px; }
.tfa-secret { margin: 0; letter-spacing: 1px; user-select: all; }

/* Who a machine may see (since 1.0.105): the mark under its name and the list
   in the window that sets it. */
.node-vis { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--warn); margin-top: 2px; }
.node-vis svg { width: 14px; height: 14px; stroke: currentColor; }
.vis-list { margin-top: 6px; }
.vis-list .pick-list { max-height: 260px; overflow: auto; }

/* Administrator: a new password for an account, opened under its row, and
   the address the panel listens on (since 1.0.106). */
.setpass-row td { background: var(--bg-soft, rgba(255,255,255,0.03)); }
.setpass-form { max-width: 520px; padding: 6px 0; }
.web-row { display: flex; gap: 12px; flex-wrap: wrap; }
.web-row label { flex: 1 1 180px; }
.warn-text { color: var(--warn); }
