/* The new look: a rail of sections at the left, a bar on top, the page in
   the middle. Step 1 of docs/adr/0027: the shell is new, the pages inside
   it are today's and still use the general stylesheet, given this
   look's colours. The reference is docs/gui/click-dummy.html.
   No inline styles anywhere; the CSP forbids them. */

:root {
  --fwm-bg: #f3f5f8; --fwm-surface: #ffffff; --fwm-sunken: #e9edf2; --fwm-line: #dfe4ea;
  --fwm-fg: #18212c; --fwm-muted: #5d6b7b;
  --fwm-accent: #1f5fd0; --fwm-accent-soft: #e4ecfb;
  --fwm-radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fwm-bg: #10151b; --fwm-surface: #19212a; --fwm-sunken: #222c37; --fwm-line: #2c3743;
    --fwm-fg: #e6ebf1; --fwm-muted: #a1adba;
    --fwm-accent: #6da1ff; --fwm-accent-soft: #1d2f4f;
  }
}
:root[data-theme="dark"] {
  --fwm-bg: #10151b; --fwm-surface: #19212a; --fwm-sunken: #222c37; --fwm-line: #2c3743;
  --fwm-fg: #e6ebf1; --fwm-muted: #a1adba;
  --fwm-accent: #6da1ff; --fwm-accent-soft: #1d2f4f;
}

/* The frame. The page itself scrolls; rail and bar stay. */
body.shell {
  display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); min-height: 100vh;
  background: var(--fwm-bg); color: var(--fwm-fg);
  --bulma-body-background-color: var(--fwm-bg);
  --bulma-link-h: 219deg; --bulma-link-s: 74%; --bulma-link-l: 47%;
  --bulma-primary-h: 219deg; --bulma-primary-s: 74%; --bulma-primary-l: 47%;
  --bulma-radius-large: var(--fwm-radius);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.shell { --bulma-link-l: 71%; --bulma-primary-l: 62%; }
}
:root[data-theme="dark"] body.shell { --bulma-link-l: 71%; --bulma-primary-l: 62%; }

.rail {
  position: sticky; top: 0; height: 100vh; z-index: 30;
  display: flex; flex-direction: column; gap: 0.25rem; padding: 0.75rem 0.5rem;
  background: var(--fwm-surface); border-right: 1px solid var(--fwm-line);
}
.rail-brand { display: grid; place-items: center; height: 2.75rem; margin-bottom: 0.5rem; color: var(--fwm-accent); }
.rail-brand svg { width: 1.75rem; height: 1.75rem; }
.rail a, .rail button {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem; width: 100%;
  padding: 0.5rem 0.125rem; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  color: var(--fwm-muted); font-size: 0.66rem; font-weight: 500; line-height: 1.2; text-align: center;
}
.rail svg { width: 1.3rem; height: 1.3rem; }
.rail a:hover, .rail button:hover { background: var(--fwm-sunken); color: var(--fwm-fg); }
.rail a[aria-current="page"] { background: var(--fwm-accent-soft); color: var(--fwm-accent); }
.rail a:focus-visible, .rail button:focus-visible { outline: 2px solid var(--fwm-accent); outline-offset: 2px; }
.rail-spacer { flex: 1; }
.rail form { margin: 0; }

.shell-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.shell-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding: 0.6rem 1.5rem;
  background: var(--fwm-surface); border-bottom: 1px solid var(--fwm-line);
}
.shell-top h1 { font-size: 1.05rem; font-weight: 600; margin: 0; }
.shell-top .grow { flex: 1; }
.shell-top .who { color: var(--fwm-muted); font-size: 0.85rem; }
.shell-content { flex: 1; padding: 1.25rem 1.5rem 2rem; min-width: 0; }
.shell-content > .wrap { max-width: 80rem; margin: 0 auto; }
.shell-foot { padding: 0.75rem 1.5rem; color: var(--fwm-muted); font-size: 0.75rem; }

/* Today's pages inside the shell: flat cards with a hairline, a calmer heading, quiet table heads. */
body.shell .box { border: 1px solid var(--fwm-line); box-shadow: none; }
body.shell .title { font-weight: 600; }
body.shell h1.title { font-size: 1.5rem; }
body.shell .table thead th { font-size: 0.72rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fwm-muted); white-space: nowrap; }
body.shell .breadcrumb { font-size: 0.85rem; }

/* The Security section: one card per overview. */
.overviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.overviews .box { margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.overviews .box:hover { border-color: var(--fwm-accent); }
.overviews strong { font-size: 1.05rem; }

/* On a phone the rail lies at the bottom. */
@media (max-width: 760px) {
  body.shell { grid-template-columns: minmax(0, 1fr); padding-bottom: 3.6rem; }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto;
    flex-direction: row; border-right: 0; border-top: 1px solid var(--fwm-line); padding: 0.25rem 0.5rem; overflow-x: auto;
  }
  .rail a, .rail button { flex: 1 0 3.6rem; }
  .rail-brand, .rail-spacer { display: none; }
  .shell-top, .shell-content, .shell-foot { padding-left: 1rem; padding-right: 1rem; }
}

/* ---- The new look's own screens (step 2 on: Devices). Their classes
   start with "ui-" so that they stand beside Bulma's. ---- */
:root {
  --fwm-faint: #8a96a4; --fwm-on-accent: #ffffff;
  --fwm-good: #1f8a52; --fwm-good-soft: #e0f3e8; --fwm-warn: #a86400; --fwm-warn-soft: #fbefd9; --fwm-bad: #c2372e; --fwm-bad-soft: #fbe4e2;
  --fwm-shadow: 0 1px 2px rgba(24, 33, 44, 0.06), 0 8px 24px rgba(24, 33, 44, 0.1);
  --fwm-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fwm-faint: #76828f; --fwm-on-accent: #0b1220;
    --fwm-good: #57c98a; --fwm-good-soft: #163324; --fwm-warn: #e3a94a; --fwm-warn-soft: #3a2c12; --fwm-bad: #f0786f; --fwm-bad-soft: #3d1c1a;
    --fwm-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}
:root[data-theme="dark"] {
  --fwm-faint: #76828f; --fwm-on-accent: #0b1220;
  --fwm-good: #57c98a; --fwm-good-soft: #163324; --fwm-warn: #e3a94a; --fwm-warn-soft: #3a2c12; --fwm-bad: #f0786f; --fwm-bad-soft: #3d1c1a;
  --fwm-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
}

body.shell [hidden] { display: none !important; }
.ui-mono { font-family: var(--fwm-mono); font-size: 0.86em; }
.ui-muted { color: var(--fwm-muted); }
.ui-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ui-grow { flex: 1; min-width: 0; }
.ui-under { margin-top: 0.75rem; font-size: 0.85rem; }
.ui-spread { display: flex; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }

.ui-card { background: var(--fwm-surface); border: 1px solid var(--fwm-line); border-radius: var(--fwm-radius); min-width: 0; }
.ui-card > h2 { display: flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0.75rem 1rem; border-bottom: 1px solid var(--fwm-line); font-size: 0.9rem; font-weight: 600; }
.ui-count { color: var(--fwm-muted); font-weight: 500; }
.ui-pad { padding: 0.85rem 1rem; }
.ui-scroll { overflow-x: auto; }
.ui-empty { padding: 1.75rem 1rem; color: var(--fwm-muted); text-align: center; }
.ui-fold { border-top: 1px solid var(--fwm-line); }
.ui-fold > summary { padding: 0.6rem 1rem; cursor: pointer; color: var(--fwm-accent); font-size: 0.85rem; }

.ui-chips { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; padding: 0.6rem 1rem; border-bottom: 1px solid var(--fwm-line); }
.ui-chips > a:not(.ui-btn) { border: 1px solid var(--fwm-line); border-radius: 99px; padding: 0.2rem 0.75rem; color: var(--fwm-muted); font-size: 0.85rem; }
.ui-chips > a:not(.ui-btn):hover { border-color: var(--fwm-accent); color: var(--fwm-fg); }
.ui-chips > a[aria-current="true"] { background: var(--fwm-accent); border-color: var(--fwm-accent); color: var(--fwm-on-accent); }
.ui-chips > a[aria-current="true"]:hover { color: var(--fwm-on-accent); }

.ui-btn { display: inline-block; border: 1px solid var(--fwm-line); background: var(--fwm-surface); border-radius: 8px; padding: 0.35rem 0.8rem; cursor: pointer; color: var(--fwm-fg); font-size: 0.85rem; line-height: 1.4; }
.ui-btn:hover { border-color: var(--fwm-accent); color: var(--fwm-fg); }
.ui-btn.is-primary { background: var(--fwm-accent); border-color: var(--fwm-accent); color: var(--fwm-on-accent); }
.ui-btn.is-danger { border-color: var(--fwm-bad); color: var(--fwm-bad); }
.ui-btn:focus-visible, .ui-chips a:focus-visible, .ui-x:focus-visible, .ui-port:focus-visible, .ui-open:focus-visible { outline: 2px solid var(--fwm-accent); outline-offset: 2px; }

table.ui-list { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ui-list th { text-align: left; font-size: 0.72rem; font-weight: 500; color: var(--fwm-muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 0.55rem 1rem; border-bottom: 1px solid var(--fwm-line); white-space: nowrap; }
.ui-list td { padding: 0.6rem 1rem; border-bottom: 1px solid var(--fwm-line); vertical-align: middle; }
.ui-list tbody tr:last-child td { border-bottom: 0; }
.ui-list tbody tr[data-row] { cursor: pointer; }
.ui-list tbody tr[data-row]:hover, .ui-list tbody tr.is-on { background: var(--fwm-sunken); }
.ui-list td small { display: block; color: var(--fwm-muted); font-size: 0.8rem; }
.ui-list.is-plain td, .ui-list.is-plain th { padding: 0.4rem 1rem; }
.ui-name { display: flex; align-items: center; gap: 0.65rem; min-width: 0; font-weight: 500; }
.ui-open { color: var(--fwm-fg); }
.ui-lookall { align-items: center; padding: 0.5rem 0.9rem 0.75rem; }
.ui-lookall .ui-small { margin-top: 0; }
/* A long text that keeps to one line: cut, with the whole of it in its title. */
.ui-clip { display: inline-block; max-width: 7.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.ui-open:has(.ui-clip) { white-space: nowrap; }
@media (min-width: 1280px) { .ui-clip { max-width: 14rem; } }
.ui-open:hover { color: var(--fwm-accent); }
.ui-glyph { width: 1.9rem; height: 1.9rem; border-radius: 8px; background: var(--fwm-sunken); display: grid; place-items: center; flex: none; color: var(--fwm-muted); }
.ui-glyph svg { width: 1.1rem; height: 1.1rem; }
.ui-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--fwm-faint); display: inline-block; margin-right: 0.4rem; }
.ui-dot.is-success { background: var(--fwm-good); } .ui-dot.is-warning { background: var(--fwm-warn); } .ui-dot.is-danger { background: var(--fwm-bad); }
.ui-pill { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 99px; font-size: 0.78rem; font-weight: 400; background: var(--fwm-sunken); color: var(--fwm-fg); white-space: nowrap; }
.ui-pill.is-success { background: var(--fwm-good-soft); color: var(--fwm-good); }
.ui-pill.is-warning { background: var(--fwm-warn-soft); color: var(--fwm-warn); }
.ui-pill.is-danger { background: var(--fwm-bad-soft); color: var(--fwm-bad); }
.ui-pill.is-info { background: var(--fwm-accent-soft); color: var(--fwm-accent); }

.ui-note { background: var(--fwm-sunken); border-radius: 8px; padding: 0.6rem 0.75rem; color: var(--fwm-muted); font-size: 0.85rem; }
.ui-note.is-danger { background: var(--fwm-bad-soft); color: var(--fwm-bad); }
.ui-note.is-warning { background: var(--fwm-warn-soft); color: var(--fwm-warn); }
#screen > .ui-note, .shell-content .wrap > .ui-note { margin-bottom: 0.75rem; }
.ui-know { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.4rem; }
.ui-know li { border-left: 3px solid var(--fwm-warn); padding-left: 0.6rem; }

.ui-kv { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.4rem 0.75rem; margin: 0; }
.ui-kv dt { color: var(--fwm-muted); }
.ui-kv dd { margin: 0; overflow-wrap: anywhere; }
.ui-more > summary { cursor: pointer; color: var(--fwm-accent); font-size: 0.82rem; }
.ui-more[open] > summary { margin-bottom: 0.4rem; }
.ui-inline { display: flex; gap: 0.4rem; align-items: center; }
.ui-inline .input { max-width: 11rem; }
.ui-row { display: flex; gap: 0.75rem 1rem; flex-wrap: wrap; align-items: flex-start; }
.ui-form { display: grid; gap: 0.3rem; }
.ui-form label { color: var(--fwm-muted); font-size: 0.82rem; margin-top: 0.4rem; }
.ui-form .ui-btn { justify-self: start; margin-top: 0.75rem; }

/* The panel: slides in from the right for whatever was clicked. */
.ui-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(27.5rem, 100%);
  display: flex; flex-direction: column;
  background: var(--fwm-surface); border-left: 1px solid var(--fwm-line); box-shadow: var(--fwm-shadow);
}
.ui-panel > header { display: flex; align-items: flex-start; gap: 0.75rem; padding: 1rem 1.1rem 0.75rem; border-bottom: 1px solid var(--fwm-line); }
.ui-panel > header h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.ui-panel > header p { margin: 0.1rem 0 0; color: var(--fwm-muted); font-size: 0.8rem; }
.ui-x { display: grid; place-items: center; flex: none; width: 1.9rem; height: 1.9rem; border-radius: 8px; background: var(--fwm-sunken); color: var(--fwm-fg); font-size: 1.1rem; line-height: 1; }
.ui-x:hover { color: var(--fwm-accent); }
.ui-body { flex: 1; overflow: auto; padding: 1rem 1.1rem 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; font-size: 0.9rem; }
.ui-body h3 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fwm-muted); font-weight: 500; margin: 0 0 0.5rem; }
.ui-body h3 span { text-transform: none; letter-spacing: 0; }
@media (prefers-reduced-motion: no-preference) {
  .ui-panel { animation: ui-slide 0.16s ease-out; }
  @keyframes ui-slide { from { transform: translateX(1.5rem); opacity: 0.4; } }
}

/* The port view: one square per port, in the groups the names form. */
.ui-portview { display: grid; gap: 0.6rem; }
.ui-portgroups { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; }
.ui-portgroup { display: grid; gap: 0.2rem; }
.ui-portlabel { font-family: var(--fwm-mono); font-size: 0.68rem; color: var(--fwm-faint); }
.ui-ports { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ui-port {
  position: relative; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; overflow: hidden;
  border-radius: 6px; border: 1.5px solid var(--fwm-line); color: var(--fwm-faint);
  font-family: var(--fwm-mono); font-size: 0.7rem; font-weight: 500;
}
.ui-port:hover { border-color: var(--fwm-accent); color: var(--fwm-fg); }
.ui-port.is-up { background: var(--fwm-good-soft); border-color: var(--fwm-good); color: var(--fwm-good); }
.ui-port.is-off { border-style: dashed; background: var(--fwm-sunken); }
.ui-port.is-link::after { content: ""; position: absolute; top: 3px; right: 3px; width: 6px; height: 6px; border-radius: 50%; background: var(--fwm-accent); }
.ui-port[aria-current="true"] { outline: 2px solid var(--fwm-accent); outline-offset: 1px; }
.ui-legend { display: flex; gap: 0.25rem 0.9rem; flex-wrap: wrap; font-size: 0.76rem; color: var(--fwm-muted); }
.ui-legend i { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 3px; border: 1.5px solid var(--fwm-line); margin-right: 0.3rem; vertical-align: -1px; }
.ui-legend i.is-up { background: var(--fwm-good-soft); border-color: var(--fwm-good); }
.ui-legend i.is-off { border-style: dashed; background: var(--fwm-sunken); }
.ui-legend i.is-link { background: var(--fwm-accent); border-color: var(--fwm-accent); border-radius: 50%; }
.ui-portinfo { background: var(--fwm-sunken); border-radius: 8px; padding: 0.6rem 0.75rem; }
.ui-client { display: block; color: var(--fwm-fg); }
.ui-client:hover { color: var(--fwm-accent); }
.ui-client small { color: var(--fwm-muted); }

/* A storage's volumes: how full each is. */
.ui-volume { margin-bottom: 0.75rem; }
.ui-volume:last-child { margin-bottom: 0; }
progress.ui-bar { display: block; width: 100%; height: 6px; margin: 0.25rem 0; border: 0; border-radius: 99px; overflow: hidden; background: var(--fwm-sunken); color: var(--fwm-accent); appearance: none; -webkit-appearance: none; }
progress.ui-bar::-webkit-progress-bar { background: var(--fwm-sunken); }
progress.ui-bar::-webkit-progress-value { background: var(--fwm-accent); }
progress.ui-bar::-moz-progress-bar { background: var(--fwm-accent); }
progress.ui-bar.is-warning::-webkit-progress-value { background: var(--fwm-warn); }
progress.ui-bar.is-warning::-moz-progress-bar { background: var(--fwm-warn); }
progress.ui-bar.is-danger::-webkit-progress-value { background: var(--fwm-bad); }
progress.ui-bar.is-danger::-moz-progress-bar { background: var(--fwm-bad); }

/* A device's own page: its name on top, then two columns of cards. */
.ui-head { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 1rem; }
.ui-head h2 { font-size: 1.35rem; font-weight: 600; margin: 0.1rem 0; }
.ui-head p { margin: 0; font-size: 0.85rem; }
.ui-head .ui-glyph { width: 2.6rem; height: 2.6rem; margin-top: 1.1rem; }
.ui-head .ui-glyph svg { width: 1.5rem; height: 1.5rem; }
.ui-crumb { color: var(--fwm-muted); }
.ui-cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1rem; align-items: start; }
.ui-col { display: grid; gap: 1rem; min-width: 0; }
@media (max-width: 1000px) { .ui-cols { grid-template-columns: minmax(0, 1fr); } }

/* Clients: the search above the list, and small lists in the panel. */
.ui-search { display: flex; gap: 0.5rem; padding: 0.6rem 1rem; border-bottom: 1px solid var(--fwm-line); }
.ui-search .input { flex: 1; min-width: 0; max-width: 32rem; box-shadow: none; }
.ui-plain { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.3rem; }
.ui-points { margin: 0.5rem 0 0; padding-left: 1.1rem; list-style: disc; display: grid; gap: 0.35rem; font-size: 0.85rem; max-width: 60rem; }

/* Machines: the pages of a machine under the panel's head. */
.ui-pages { display: flex; flex-wrap: wrap; gap: 0.3rem; padding: 0.6rem 1.1rem; border-bottom: 1px solid var(--fwm-line); flex: none; }
.ui-pages a { padding: 0.15rem 0.6rem; border: 1px solid var(--fwm-line); border-radius: 99px; color: var(--fwm-fg); font-size: 0.8rem; white-space: nowrap; }
.ui-pages a:hover { border-color: var(--fwm-accent); color: var(--fwm-accent); }
.ui-pages a:focus-visible { outline: 2px solid var(--fwm-accent); outline-offset: 2px; }
.ui-small { font-size: 0.82rem; margin-top: 0.3rem; }
a.ui-pill.is-danger:hover { color: var(--fwm-bad); text-decoration: underline; }

/* Places: the switch in the top bar. */
.shell-site { display: flex; align-items: center; gap: 0.6rem; margin: 0; }
.shell-site select { background: var(--fwm-sunken); border: 1px solid transparent; border-radius: 8px; padding: 0.35rem 0.6rem; color: var(--fwm-fg); font: inherit; font-size: 0.9rem; max-width: 14rem; }
.shell-site select:focus-visible { outline: 2px solid var(--fwm-accent); outline-offset: 1px; }
.shell-site a { font-size: 0.82rem; color: var(--fwm-muted); }
.shell-site a:hover { color: var(--fwm-accent); }

/* The dashboard: numbers on top, what is to know, the places, the last changes. */
.ui-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.ui-tile { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.85rem 1rem; background: var(--fwm-surface); border: 1px solid var(--fwm-line); border-radius: var(--fwm-radius); color: var(--fwm-fg); }
.ui-tile:hover { border-color: var(--fwm-accent); color: var(--fwm-fg); }
.ui-tile:focus-visible { outline: 2px solid var(--fwm-accent); outline-offset: 2px; }
.ui-tile b { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.ui-tile b small { font-size: 0.95rem; font-weight: 500; color: var(--fwm-faint); }
.ui-tile span { color: var(--fwm-muted); font-size: 0.85rem; }
.ui-tile.is-danger b { color: var(--fwm-bad); }
.ui-tile.is-warning b { color: var(--fwm-warn); }
.ui-knowlist, .ui-places, .ui-changes { margin: 0; padding: 0; list-style: none; }
.ui-knowlist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1rem; align-items: center; padding: 0.6rem 1rem 0.6rem 0.85rem; border-bottom: 1px solid var(--fwm-line); border-left: 3px solid var(--fwm-warn); font-size: 0.9rem; }
.ui-knowlist li.is-bad { border-left-color: var(--fwm-bad); }
.ui-knowlist li:last-child, .ui-places li:last-child, .ui-changes li:last-child { border-bottom: 0; }
.ui-knowlist p { margin: 0; }
.ui-where { font-size: 0.82rem; text-align: right; max-width: 14rem; }
.ui-places li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.75rem; align-items: center; padding: 0.65rem 1rem; border-bottom: 1px solid var(--fwm-line); }
.ui-places li form { margin: 0; }
.ui-places li small { grid-column: 1 / -1; color: var(--fwm-muted); font-size: 0.82rem; }
.ui-linkish { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-weight: 600; color: var(--fwm-fg); }
.ui-linkish:hover { color: var(--fwm-accent); text-decoration: underline; }
.ui-linkish:focus-visible { outline: 2px solid var(--fwm-accent); outline-offset: 2px; }
.ui-changes li { padding: 0.6rem 1rem; border-bottom: 1px solid var(--fwm-line); font-size: 0.9rem; }
.ui-changes p { margin: 0; }
.ui-changes small { color: var(--fwm-muted); font-size: 0.8rem; }
@media (max-width: 600px) { .ui-knowlist li { grid-template-columns: minmax(0, 1fr); } .ui-where { text-align: left; max-width: none; } }

/* A machine's own page: its pages under its name, cards one under the other, some side by side. */
.ui-pages.is-page { padding: 0; border-bottom: 0; margin-bottom: 1rem; }
.ui-pages a[aria-current="page"] { background: var(--fwm-accent); border-color: var(--fwm-accent); color: var(--fwm-on-accent); }
.ui-cols.is-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .ui-cols.is-even { grid-template-columns: minmax(0, 1fr); } }
.ui-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 2rem; }
@media (max-width: 760px) { .ui-split { grid-template-columns: minmax(0, 1fr); } }
.ui-stack { display: grid; gap: 0.75rem; }
.ui-stack > p, .ui-stack > figure { margin: 0; }
.ui-tags { line-height: 1.9; }
.ui-sub { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fwm-muted); font-weight: 500; margin: 0 0 0.4rem; }
.ui-kv.is-numbers { grid-template-columns: minmax(0, 1fr) auto; }
.ui-kv.is-numbers dd { text-align: right; }
.ui-kv dt.is-zero { color: var(--fwm-faint); }
.ui-head + .ui-note, .ui-pages + .ui-note, #live > .ui-note { margin-bottom: 0.75rem; }
body.shell .spark { border-bottom-color: var(--fwm-line); }

/* A machine's other pages, taken over from today's: cards whose contents flow, with the space the old boxes had. */
.ui-head.is-sub { margin-bottom: 0.6rem; }
.ui-lead { margin: 0 0 1rem; font-size: 0.9rem; max-width: 60rem; }
.ui-card.is-flow { margin-bottom: 1rem; }
.ui-card.is-flow > :not(h2):not(.ui-scroll):not(.columns) { margin: 0.85rem 1rem; }
.ui-card.is-flow > .ui-scroll { margin: 0.5rem 0; }
.ui-card.is-flow > .columns { margin: 0 0.25rem; }
.ui-card .column > h2 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fwm-muted); font-weight: 500; margin: 0 0 0.4rem; }
.ui-card.is-flow > details > summary { cursor: pointer; color: var(--fwm-accent); font-size: 0.85rem; }
.ui-bad { color: var(--fwm-bad); }
.ui-note.is-success { background: var(--fwm-good-soft); color: var(--fwm-good); }
.ui-note.is-info { background: var(--fwm-accent-soft); color: var(--fwm-accent); }
#live > .ui-note, .ui-lead + .ui-note { margin-bottom: 1rem; }
/* Two tables side by side must not push their card wider than the page: each scrolls inside its half. */
.ui-card .column { min-width: 0; }

/* Security's pages, taken over from today's. */
.ui-btn.is-ghost { border-color: transparent; background: transparent; color: var(--fwm-accent); }
.ui-warn { color: var(--fwm-warn); }
.ui-card.is-flow h3.ui-sub { margin-top: 1rem; }
.ui-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.ui-btn.is-warning { border-color: var(--fwm-warn); color: var(--fwm-warn); }
body.shell pre { background: var(--fwm-sunken); color: var(--fwm-fg); border-radius: 8px; }
.ui-btn.is-static { pointer-events: none; opacity: 0.5; }
.ui-btn.is-label { pointer-events: none; background: var(--fwm-sunken); color: var(--fwm-muted); border-radius: 8px 0 0 8px; }
.ui-pages.is-second { margin-top: -0.5rem; }

/* Security's first page: one card for each of its pages. */
.ui-overviews { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.ui-overview { display: flex; flex-direction: column; gap: 0.4rem; padding: 1rem; color: var(--fwm-fg); }
.ui-overview:hover { border-color: var(--fwm-accent); color: var(--fwm-fg); }
.ui-overview:focus-visible { outline: 2px solid var(--fwm-accent); outline-offset: 2px; }
.ui-overview strong { font-size: 1.05rem; }
.ui-overview span { color: var(--fwm-muted); font-size: 0.9rem; }

/* The map: boxes for machines and devices, lines where one hears the other, a frame per place. */
.ui-mapbox { padding: 1rem; }
.ui-map { display: block; margin: 0 auto; max-width: none; }
.ui-map .zone rect { fill: none; stroke: var(--fwm-line); stroke-dasharray: 4 4; }
.ui-map .zone text { fill: var(--fwm-faint); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.ui-map .link { fill: none; stroke: var(--fwm-faint); stroke-width: 1.6; }
.ui-map .link.is-shared, .ui-map .link.is-extra { stroke-dasharray: 5 4; }
.ui-map .node rect { fill: var(--fwm-surface); stroke: var(--fwm-line); stroke-width: 1.25; }
.ui-map a.node:hover rect, .ui-map a.node:focus rect { stroke: var(--fwm-accent); }
.ui-map a.node:focus { outline: none; }
.ui-map .node.is-loose rect { stroke-dasharray: 4 3; fill: var(--fwm-bg); }
.ui-map .node text { fill: var(--fwm-fg); font-size: 12.5px; font-weight: 500; }
.ui-map .node text.sub { fill: var(--fwm-muted); font-size: 11px; font-weight: 400; }
.ui-map .dot { fill: var(--fwm-faint); }
.ui-map .dot.is-success { fill: var(--fwm-good); }
.ui-map .dot.is-warning { fill: var(--fwm-warn); }
.ui-map .dot.is-danger { fill: var(--fwm-bad); }

/* The map: what is plugged in at a device, unfolded under it, and the button that does it. */
.ui-map .link.is-spine { stroke: var(--fwm-line); stroke-width: 1.4; }
.ui-map .node.is-client rect { stroke-width: 1; }
.ui-map .node.is-client text { font-size: 11.5px; }
.ui-map .node.is-client text.sub { font-size: 10px; }
.ui-map .toggle { cursor: pointer; }
.ui-map .toggle rect { fill: var(--fwm-accent-soft); stroke: var(--fwm-accent); stroke-width: 1; }
.ui-map .toggle text { fill: var(--fwm-accent); font-size: 11px; font-weight: 600; text-anchor: middle; }
.ui-map .toggle:hover rect, .ui-map .toggle.is-open rect { fill: var(--fwm-accent); }
.ui-map .toggle:hover text, .ui-map .toggle.is-open text { fill: var(--fwm-on-accent); }
.ui-card.ui-under { margin-top: 1rem; }
/* A list in a padded part keeps the padding: both classes on one element. */
.ui-pad.ui-plain { padding: 0.85rem 1rem; }

/* A command to copy: what a person runs on a machine. It wraps instead of
   scrolling, so that all of it is seen, and one click takes all of it. */
.ui-cmd {
  margin: 0; padding: 0.6rem 0.75rem; border: 1px solid var(--fwm-line); border-radius: 8px;
  background: var(--fwm-sunken); color: var(--fwm-fg);
  font-family: var(--fwm-mono); font-size: 0.82rem; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere; user-select: all;
}
.ui-cmd:focus-visible { outline: 2px solid var(--fwm-accent); outline-offset: 2px; }
/* Something shown once: the card that holds it stands out until it is left. */
.ui-card.ui-once { border-color: var(--fwm-warn); }
/* The sentence beside a button that acts on every row: on a phone it goes
   under the button instead of into a column a few letters wide. */
.ui-lookall .ui-grow { flex-basis: 18rem; }
/* A page for somebody who is not signed in: one card in the middle, under
   the mark, without rail and bar. */
body.shell.shell-alone { grid-template-columns: minmax(0, 1fr); place-items: center; padding: 1.5rem; }
.shell-alone > main { width: min(24rem, 100%); display: grid; gap: 0.75rem; }
.shell-alone.is-wide > main { width: min(64rem, 100%); }
.shell-alone .rail-brand { margin-bottom: 0; }
.shell-alone .rail-brand svg { width: 2.5rem; height: 2.5rem; }
.shell-alone > main > .ui-small { text-align: center; }
/* A select in a form is no wider than the form: a long choice is cut by
   the browser instead of pushing the select past the edge of a phone. */
.ui-form > .select { min-width: 0; }
.ui-form .select select { max-width: 100%; }
/* Inside a fold everything keeps the box model of the rest of the page.
   Bulma lets every element inherit box-sizing, and what a browser puts
   between <details> and its contents hands on its own, content-box: a
   field in a fold was then wider than its form by its padding. */
details *, details *::before, details *::after { box-sizing: border-box; }
