/* ---- Wingman theme ---------------------------------------------------- */
:root {
    --bg: #101922;

    /* Where a hovered monitor chip's picture sits against the page -- and, because the chip's own
       hover makes it a stacking context, where the CHIP has to sit as well. Named rather than
       written twice: the two numbers are one statement, and the day they disagreed the preview
       went behind the remote desktop and stayed there through two wrong diagnoses. */
    --preview-z: 40;

    /* The margin between the page and the window, named because four separate rules used to
       quote it: body's own padding, the console shell's height (the viewport less twice this),
       the flyout deck's left and right, and the lean console's height. Each carried a comment
       saying "body has 1.5rem padding all round", which is a number kept in four places by
       hand -- and the shell's height silently lies about the page's size the moment one of
       them moves.

       It is now only the DOCUMENT pages' margin -- Administrator Settings, Change Password, the
       public join page. The console opts out of it entirely and runs to the window's edges with
       its padding on the inside of its columns, so this no longer has anything to do with how
       much of somebody's desktop is visible, and it is back to the 1.5rem that was measured for
       pages that are read rather than worked in. */
    --page-pad: 1.5rem;

    --surface: #17232f;
    --surface-2: #0c141c;
    --border: #26323d;

    /* The terminal's own background, and the only place it is written down.

       It lived as a hex literal in the xterm theme in wingman-console.js, which was fine while
       nothing else needed to know it. The console pane now has ten pixels of padding around the
       character grid, and a gutter in a different colour from the grid reads as a mat around the
       terminal rather than as room inside it -- so the stylesheet and the renderer have to agree,
       and this is the thing they agree on. wingman-console.js reads it from here.

       Deliberately not --surface-2 (#0c141c), though they are within two points of each other.
       That one is a chrome colour and moves when the chrome is retuned; this is the paper a
       shell's output is printed on, and it has every reason to stay put while the chrome moves. */
    --term-bg: #0b131b;

    /* The machine list's track width.

       280px. It was 370, which was measured so the FLYOUT panel would not wrap a label -- but the
       panel is fixed-positioned over the work surface and never actually needed the column to be
       that wide to hold it. It has its own floor now (--panel-w in Home.razor.css), so this number
       is free to be what the list itself wants: a machine name and its marks, with the work
       surface getting the ninety pixels back.

       Long names ellipsise rather than wrap, which they already did at 370 -- the list has always
       been a column of one-line rows. If a name has to be read in full it is in the row's title
       and on its flyout.

       It used to be named alongside two insets, --col-a-pad and --col-a-bar, because the HEADER
       did arithmetic with all three: the wordmark was centred over this column, and what it had
       to centre on was the column's content rather than its track. There is no header and the
       wordmark is not over this column, so --col-a-pad has gone and --col-a-bar earned a real
       job instead -- see below, and note that it is no longer the cosmetic value it was. */
    /* The machine list's own fill, which is a step UP from the page and not down.

       Down was the obvious direction and the wrong one. The work surface's viewport is
       --surface-2, nearly black, and the two columns touch -- so a dark sidebar merged into the
       screen it is meant to be distinct FROM. A step up separates it from the page and from the
       picture at the same time.

       One step, not two: --surface is what a device row lifts to on hover, and the list's own
       fill has to stay below that or hovering a row would stop showing at all. The two steps
       are deliberately about the same size -- list above page, row above list -- so the list
       reads as one level of chrome rather than as a panel with a brighter panel inside it. */
    --col-a-bg: #141f2a;

    --col-a: 280px;

    /* The inset INSIDE a column, and the same on both of them: the columns run to the window's
       edges now, so this is the only thing holding their contents off it.

       It replaces --col-a-pad, which was 14px on the right of the machine list against 8 on the
       left -- and the right was really 25, because scrollbar-gutter reserves its strip inside the
       padding and nothing accounted for it. That asymmetry is what this fixes: the list's
       padding-right is this figure LESS the gutter, so what you see is the same either side.
       Column A's content box comes out exactly the width it was, because the space being spent on
       the left was already being wasted on the right. */
    --col-pad: 1rem;

    /* The width of the machine list's CONTENT, which is the width of the Create Session button --
       and therefore the width a pane tab is given, so the two read as one grid across the seam
       rather than as two columns that happen to be next to each other.

       The scrollbar's gutter cancels out of this and that is worth saying out loud: the list's
       padding-right is --col-pad LESS the gutter, and the gutter is then added back on top of it,
       so the pair comes to exactly two --col-pads whatever width the browser reserves. The
       obvious expression would carry --col-a-bar and be subtly wrong on a browser that reserves a
       different amount. */
    --col-a-content: calc(var(--col-a) - 1px - 2 * var(--col-pad));

    /* The wordmark's height on the console, where it shares a row with the pane tabs.

       It had a line of its own at the top of the machine list, and --brand-gap went with it: the
       gap under the logo, which column B had to clear to get its tabs level with Create Session.
       Both are gone with the line, and so is the 38 pixels it cost.

       A RESERVED height rather than whatever the image happens to give, because the <img> carries
       an onerror that hides itself -- a logo that fails to load should leave a hole where it was
       rather than let the row close up around nothing. */
    --brand-h: 1.75rem;

    /* The height of the two things at the top of the two columns: the Create Session button and a
       pane tab. They are the same width and start on the same line, so being three quarters of a
       pixel apart in height is the one thing left that reads as a near-miss rather than a grid.

       2.25rem is what an ordinary button already comes to -- .875rem of text at the page's
       line-height, plus its padding and border -- so the button does not actually change size;
       this only names the figure and holds the tab to it. The tab was the taller of the two
       because it carries two lines of small text instead of one line of normal text.

       In rem so a larger default font size grows the controls and their contents together. */
    --row-h: 2.25rem;

    /* What the scrollbar actually takes, which is not a guess: ::-webkit-scrollbar below sets it
       to 11px. It was 10 here, measured by eye against a rule in the same stylesheet.

       THIS IS LOAD-BEARING NOW, which it was not when it was first written. The machine list's
       padding-right is --col-pad LESS this, so that the gutter and the padding together come to
       the same inset as the padding on the left; one pixel of a wrong answer here is one pixel of
       visible asymmetry. A browser that reserves a different width (Firefox honours
       scrollbar-width: thin its own way) is off by that difference and by nothing else. */
    --col-a-bar: 11px;
    --text: #ffffff;
    --muted: #8b9bab;
    --accent: #17bae8;      /* cyan  */
    --accent-rgb: 23, 186, 232;   /* the same colour, for rgba() tints */
    --accent-ink: #04141c;  /* text on a cyan button */
    --accent-2: #c2365b;    /* crimson */
    /* Reachable. Green because that is what people read as "fine, nothing to do here", and most
       of the list is in this state most of the time. It was cyan, which is also the colour of
       every button and link in the product -- so the one mark that reports a fact looked like the
       marks you click. */
    --online: #3ddc84;
    --online-rgb: 61, 220, 132;

    /* Somebody is attached to that machine RIGHT NOW. Amber rather than green, deliberately: this
       is not a healthy idle state, it is a caution. Someone is driving a customer's computer, and
       the row saying so should read as "note this" rather than as "all well". */
    --live: #ffc53d;
    --live-rgb: 255, 197, 61;
    --font-body: 'IBM Plex Sans', 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
    --radius: 8px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    padding: var(--page-pad);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* One page is not a page: the session surface is the whole window, edge to edge, and 1.5rem of
   console padding around a remote desktop is screen space taken from the thing somebody is
   trying to work in. It also made the window scroll -- the shell is 100vh tall and the padding
   is added outside it.

   This matters more than it looks: that page is what the control app's WebView2 shell loads, and
   there a margin around the picture would read as a broken window rather than as a layout.

   :has() rather than a class on <body>, because the padding is on an ancestor of every component
   -- a layout cannot style the element that contains it, and a scoped stylesheet reaches neither.
   The alternative is JavaScript that adds a class on load and takes it off again, which is a
   second thing to get wrong on the way out. */
body:has(.session-shell) { padding: 0; }

h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0 0 .6rem; }
h1 { font-size: 1.9rem; letter-spacing: -.015em; }
h2 { font-size: 1.2rem; }
h1:focus { outline: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

hr { border: 0; border-top: 1px solid var(--border); }

code, .mono { font-family: var(--font-mono); }

/* ---- controls --------------------------------------------------------- */
button, .btn {
    font-family: inherit;
    font-size: .875rem;
    padding: .4rem .8rem;
    border-radius: 6px;
    cursor: pointer;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    transition: border-color .15s, background .15s, color .15s, filter .15s;
}
button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
button:disabled { opacity: .4; cursor: not-allowed; }
button:disabled:hover { border-color: var(--border); color: var(--text); }

.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-accent:hover { filter: brightness(1.1); color: var(--accent-ink); border-color: var(--accent); }

.btn-danger { border-color: var(--accent-2); color: var(--accent-2); background: transparent; }
.btn-danger:hover { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }

input, select, textarea {
    font-family: inherit;
    font-size: .9rem;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .45rem .55rem;
}
input::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(23, 186, 232, .25);
}

/* ---- tables ----------------------------------------------------------- */
table { border-collapse: collapse; }
th { color: var(--muted); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
td { text-align: left; }
thead tr { border-bottom: 1px solid var(--border); }
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: 0; }

/* ---- utilities -------------------------------------------------------- */
.muted { color: var(--muted); }
.error { color: var(--accent-2); }
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
}
/* .topbar moved to css/topbar.css, shared with the public join page. */
.dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; }
.dot.online { background: var(--online); box-shadow: 0 0 7px var(--online); }
.dot.offline { background: #3a4855; }

/* Somebody is attached to this machine right now -- streaming its screen, on its backstage
   desktop, or holding a shell. Amber, and it has to survive being the only thing distinguishing
   two otherwise identical rows in a list read at a glance.

   Three states on one mark rather than a second mark beside it: amber implies online, so folding
   "in use" into the dot that already says "reachable" loses nothing. */
.dot.live {
    background: var(--live);
    box-shadow: 0 0 8px var(--live);
}

/* ---- framework bits --------------------------------------------------- */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--accent); }
.invalid { outline: 1px solid var(--accent-2); }
.validation-message { color: var(--accent-2); }

.blazor-error-boundary {
    background: var(--accent-2);
    padding: 1rem 1rem 1rem 1rem;
    color: #fff;
    border-radius: var(--radius);
}
.blazor-error-boundary::after { content: "An error has occurred."; }

.darker-border-checkbox.form-check-input { border-color: #929292; }

/* ---- full-screen hint --------------------------------------------------- */
/* Global rather than in Home.razor.css on purpose: this element is created by
   wingman-screen.js, so it never gets the [b-xxxxx] attribute that Blazor's CSS
   isolation rewrites selectors to require, and a scoped rule would never match it. */
.fs-hint {
    position: absolute;
    top: 1.1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    padding: .45rem .9rem;
    background: rgba(0, 0, 0, .82);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: #fff;
    font-size: .78rem;
    white-space: nowrap;
    pointer-events: none;
    opacity: 1;
    transition: opacity .6s ease;
}

.fs-hint.fading { opacity: 0; }
.fs-hint.error { border-color: var(--accent-2); color: #ffd9e2; }

/* ---- scrollbars ---------------------------------------------------------
   The default is a pale Windows scrollbar, which on a dark surface is the brightest thing on the
   page and sits right beside the device list. Both syntaxes are here on purpose: Firefox supports
   only the standard properties, Chromium until recently only the ::-webkit- ones.

   The thumb is drawn with a transparent border and background-clip so it reads as a slim bar with
   room around it, rather than a block filling the full gutter width. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }

::-webkit-scrollbar-thumb {
    background: var(--border);
    border: 3px solid transparent;
    background-clip: content-box;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }
::-webkit-scrollbar-thumb:active { background: var(--accent); background-clip: content-box; }

/* Where two scrollbars meet; left alone it is a light grey square. */
::-webkit-scrollbar-corner { background: transparent; }

/* ---- settings sections --------------------------------------------------
   Tabs, not a second row of top-bar buttons: these are places within one screen rather than
   destinations, and the top bar is for leaving the screen you are on. */
.settings-tabs {
    display: flex;
    gap: .3rem;
    margin-top: 1rem;
    border-bottom: 1px solid var(--border);

    /* WRAPS, now that there are seven of them. A row of tabs that overflows is a tab you cannot
       reach at all -- and the two longest names arrived together, when Setup was split into
       Control App and Remote Desktop. A second row of tabs is untidy; a hidden one is broken. */
    flex-wrap: wrap;
}

/* And each name stays on one line. "Remote Desktop" breaking in half would make one tab twice the
   height of its neighbours and drag the whole strip with it. */
.settings-tabs button { white-space: nowrap; }

.settings-tabs button {
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: .5rem .75rem;
    color: var(--muted);
    font: inherit;
    cursor: pointer;
}

.settings-tabs button:hover { color: var(--text); }

.settings-tabs button.on {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ---- paste catcher ------------------------------------------------------
   The fallback for "Paste Clipboard" when the browser will not hand over the
   clipboard by itself: over plain http, in Firefox, or with the permission
   refused. See wingman-clipboard.js.

   Global rather than in Home.razor.css deliberately. That file is Blazor-scoped,
   so every selector in it compiles with an attribute Blazor stamps onto the
   markup IT renders -- and this markup is built by a script, so it carries no
   such attribute and would match none of those rules. It would have arrived
   unstyled: a bare textarea in the top-left corner of the page. */
.paste-catch {
    position: fixed;
    inset: 0;
    background: rgba(4, 10, 16, .72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.paste-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
    width: 100%;
    max-width: 28rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .5);
}

.paste-card p { margin: 0 0 .75rem; color: var(--muted); }

.paste-card textarea {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    /* Monospace, because this is where a token or a password lands and the
       difference between l, 1 and I has to be visible. */
    font: 500 .9rem/1.4 'IBM Plex Mono', monospace;
    padding: .5rem .6rem;
    resize: vertical;
}

.paste-card textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.paste-actions {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    margin-top: .75rem;
}


/* ---- the Remote Desktop defaults ---------------------------------------
   A column of plain labelled controls rather than a grid: they are independent switches, not a
   form with fields that relate to each other, and a column reads top to bottom in the order the
   sentence does. */
.rdp-prefs {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    max-width: 44rem;
    margin: 0 0 .25rem;
}

/* The whole label is the target, so the words are clickable and not just the box. */
.rdp-prefs label {
    display: flex;
    align-items: center;
    gap: .45rem;
    cursor: pointer;
}

.rdp-prefs input[type="checkbox"] { cursor: pointer; margin: 0; }

/* The qualifier after a setting is an aside about it, so it is quieter than the setting and does
   not wrap into a second column of its own. */
.rdp-prefs label .muted { font-size: .82rem; }

.rdp-prefs select { margin-left: .2rem; }


/* ---- toolbar controls, shared by the console and the session page ----------------------------

   These were scoped to Home.razor.css until the session page needed the same toolbar, where they
   reached nothing: a scoped stylesheet matches only the elements its own component declared. The
   visible symptom was a button with an invisible glyph that could not be clicked, because an SVG
   with no width inside a button with no padding has no area to click.

   Global rather than duplicated: two copies of a control's appearance is two things to change and
   one to forget. */

/* ---- the two input switches, and the glyph buttons beside them ----------
   A switch that is LIT when that input is live, which replaced a two-part chip spelling the state
   out in words. The words were right for one control and wrong for a row of them: four of them to
   say what two colours say, on a bar that had run out of room. They moved to the tooltips.

   aria-pressed carries the state for anything not reading the colour, which is the part a
   highlight cannot do by itself and the reason the old chip was built the way it was. */
.tgl {
    font-size: .78rem;
    line-height: 1;
    padding: .42rem .6rem;

    /* "My Input" and "User Input" are two words each and must stay on one line. Squeezed in a
       flex row these buttons shrink below their text, and the text then wraps -- which makes the
       button twice as tall as every other control beside it and the whole row grows with it. The
       label is the one thing in here that cannot afford to reflow. */
    white-space: nowrap;
}

.tgl.on {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
}

/* Off for User Input means somebody is sitting at a keyboard that does nothing, which is the one
   state on this bar that is dangerous to walk away from. So it is loud rather than quiet -- the
   cost of not noticing falls on the person who cannot reach the button. */
.tgl.warn {
    background: var(--accent-2);
    border-color: var(--accent-2);
    color: #fff;
    font-weight: 600;
}

.tgl:disabled { opacity: .45; }

/* A button that is only a picture. Square, so a row of them reads as a set, and sized to the text
   buttons beside it rather than to its own glyph -- the toolbar is a flex row and a short control
   sits visibly sunk in it. */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .34rem;
    width: 1.9rem;
    height: 1.9rem;
}

.icon-btn svg { width: 1.05rem; height: 1.05rem; display: block; }
.icon-btn:disabled { opacity: .45; }

/* A glyph button that is also LABELLED, which on the screen toolbar is exactly one control:
   Pop Out. .icon-btn is a box 1.9rem square, sized for a drawing, so words put in it come out
   squashed -- this is the other way round, a text button that happens to carry a mark.

   THE SVG RULE HAS TO BE HERE, globally, and not in the page's scoped stylesheet. The element is
   declared by ToolGlyph, so a scoped descendant selector is rewritten with the PAGE's scope id
   and matches nothing at all. That exact fact cost this toolbar its Listen button once. */
.glyph-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .78rem;
    line-height: 1;
    padding: .42rem .55rem;
}

.glyph-btn svg { width: .95rem; height: .95rem; display: block; }

/* The Encoding marks used to be sized smaller here, when Sharp, Smooth and eKVM were rows of a
   drop-down and then segments of a pill. They are two ordinary .glyph-btn switches on the bar now,
   beside Audio and Paste, so they take .glyph-btn's own size above and there is nothing left to
   say -- a drawing that is one of three in a panel is a hint, and a drawing on a button of this bar
   is the control when the words come off at 820px.

   THE NOTE THAT OUTLIVES THE RULE, because it cost two deploys: the svg is declared by ToolGlyph,
   so a selector for it in a page's SCOPED stylesheet is rewritten with that page's scope id and
   matches nothing at all -- no error, no warning, and a glyph left at the browser's default size.
   Anything sizing a ToolGlyph belongs in this file or behind ::deep.
   ToolbarGlyphTests.No_scoped_stylesheet_tries_to_size_a_glyph_it_cannot_reach fails it now. */
.glyph-btn:disabled { opacity: .45; }

/* A glyph button that is also a setting, so it has to show which way it is set. Same fill as the
   .tgl switches beside it: there is one way of saying "this is the one that is on" on this bar. */
.icon-btn.on {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}


/* ---- the toolbar's own answer to the pointer -------------------------------------------------

   SOLID RATHER THAN OUTLINED, asked for. Every button in the product answers the pointer by
   drawing a cyan outline and turning its label cyan, and on a page that is read that is right:
   the control is a word on a background, and an outline is enough to say "this one". On a toolbar
   it is not. That row is twenty-odd marks packed shoulder to shoulder, and an outline on one of
   them is a thin line among many thin lines -- the thing that moved is the hardest thing to see.

   THE FULL ACCENT, solid teal with the dark ink on it. This was a .22 tint of the same colour for
   one day, and the reason it was a tint is worth keeping because it explains what had to change
   before this could be right.

   A SOLID CYAN FILL IS SPOKEN FOR: .tgl.on, .icon-btn.on and .chip.on all use it, and the note on
   .icon-btn.on says why -- "there is one way of saying 'this is the one that is on' on this bar".
   While the fill was the ONLY thing carrying that state, hovering an off switch made it look
   switched on, which is the exact question My Input exists to answer. A tint was the compromise.

   WHAT CHANGED IS THE LABELS. My Input and User Input now read ": On" / ": Off", and Audio says
   which it is -- asked for in the same breath as this -- so the state is in the words and the fill
   is no longer load-bearing. That makes the pointer free to take the whole colour. The two
   requests arrived together and only work together: solid hover on unlabelled toggles would be
   the lie the tint was avoiding.

   AND THEN THE SWITCHES STOPPED FILLING AT ALL, asked for a step later: "they can look like the
   other buttons, even when on. Their text alone reports their state." So on the session bar the
   clash this paragraph is about has no remaining way to happen -- a .tgl there is never lit, and
   the only thing the accent means on that row is "the pointer is here". The reasoning is kept
   because the dashboard's copies of those switches DO still light up: there is no room for ": On"
   beside them, so the fill is still the only thing saying it there.

   A button that is already on still has to answer the pointer, which the rule below does by
   brightening -- otherwise the one control that is switched ON would be the one that ignores the
   mouse.

   THE LAST SELECTOR IS THE BAR ITSELF, and it is there because the four class names above were
   not the same thing as "the toolbar". Listing classes missed two controls on the one row this was
   asked about: Ctrl+Alt+Del is a plain button -- its label has to be words, so it never wore
   .icon-btn -- and the monitor chips are .session-monitors .chip, not .chips .chip, so the chip
   selector written for the dashboard's groups sailed straight past them. Both kept the outline
   while everything beside them filled, which is the one outcome the request was against.

   Reported as "Ctrl+Alt+Del still has the old :hover style". The chips had the same fault and
   nobody had hovered one yet, which is the argument for naming the ROW rather than its members:
   a button added to this bar tomorrow is covered without anybody remembering this.

   The more specific rules below still win, which is what keeps the meaning intact: .on brightens
   instead of filling, .warn keeps its own colour, and close stays red on its three classes.

   Still not plain `button`, because the outline is right on every page of text and this was asked
   about this row. */
.tgl:not(:disabled):hover,
.icon-btn:not(:disabled):hover,
.glyph-btn:not(:disabled):hover,
.chips .chip:not(:disabled):hover,
.session-bar button:not(:disabled):hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
}

/* A button that is already filled has nothing left to fill, so it answers by brightening -- the
   transition on `button` names filter for exactly this. Without it the one control on the bar
   that is switched ON would be the one control that does not respond to the pointer, and the
   tint above would have taken its colour away while it was being pointed at. */
.tgl.on:not(:disabled):hover,
.icon-btn.on:not(:disabled):hover,
.chips .chip.on:not(:disabled):hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    filter: brightness(1.12);
}

/* AND THAT FILTER HIDES THE PREVIEW HANGING OUT OF THE CHIP, which is the whole of a fault
   reported twice: "the active monitor's thumbnail preview in the toolbar rendered under/behind
   the viewport".

   A `filter` other than none makes an element a STACKING CONTEXT. So hovering the lit chip -- the
   one moment its preview is on screen -- turns that chip into a context of its own, and the
   preview's z-index: 40 stops being measured against the page and starts being measured against
   its own chip. The chip itself is positioned with z-index auto, and the picture comes after the
   toolbar in the document, so the picture paints last and the preview is behind it.

   EVERY PART OF THAT IS CONDITIONAL ON THE HOVER, which is why it took three attempts to see. It
   is the ACTIVE chip only, because only `.on` has the filter; it is only while the pointer is on
   it, which is only while the preview exists; and a harness that rendered the preview without
   putting a pointer on the chip reported the page as correct, twice, because without :hover there
   is no filter and no stacking context. The first fix was written for a compositing fault that was
   not happening and is gone again.

   So the chip is lifted to the preview's own level. It cannot be lifted BY the preview -- an
   element cannot raise the context it is trapped in -- and the filter is not worth losing: it is
   the only way a button that is already filled can answer the pointer at all.

   One number for both, because they are one statement: the preview sits at --preview-z against the
   page, whether it is measured there directly or through the chip holding it. */
.chips .chip.on:not(:disabled):hover {
    position: relative;
    z-index: var(--preview-z);
}

/* And the loud one keeps its own colour while it does it. */
.tgl.warn:not(:disabled):hover {
    background: var(--accent-2);
    border-color: var(--accent-2);
    color: #fff;
    filter: brightness(1.12);
}


/* Two groups rather than one flat row: a monitor belongs to a session, so the numbers mean
   "display N of whichever session is selected". Gathering each group on its own tightened
   background says they are different axes without needing a caption to explain it. */
.chips {
    display: inline-flex;
    gap: .2rem;
    padding: .15rem;
    border: 1px solid var(--border);
    border-radius: .45rem;
}

.chips .chip {
    min-width: 2rem;
    height: 1.7rem;
    padding: 0 .45rem;
    font-size: .78rem;
    line-height: 1;
    border-radius: .3rem;
}

/* The selected chip has to read as "this is what you are looking at" from across the room,
   so it takes the accent fill rather than just a brighter border. */
.chips .chip.on {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
}

/* The hovered monitor's picture, hanging below its chip.

   ABSOLUTE so the toolbar does not reflow when one appears -- a row of buttons that jumps as the
   pointer crosses it is worse than no preview at all.

   Here rather than scoped to a page because both the dashboard's screen pane and the session page
   draw this row now, and a scoped rule reaches the one component that declared the markup. The
   positioning context stays with each of them: the dashboard's chips are draggable and the
   session page's are not, so the selector that makes a chip relative is not the same on both. */
.monitor-preview {
    position: absolute;
    top: calc(100% + .35rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--preview-z);
    padding: 3px;
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
    line-height: 0;
    pointer-events: none;        /* never steals the hover that is showing it */
}

.monitor-preview img { display: block; width: 200px; height: auto; border-radius: 2px; }


/* ---- the modal, and the other styles more than one page uses --------------------------------

   Moved out of Home.razor.css, where four other pages were relying on them and getting nothing: a
   scoped stylesheet matches only the elements its own component declared, and none of those pages
   has a sheet of its own. The modals on Administrator Settings and Backups had no backdrop and no
   box -- position:fixed and z-index were written down and never applied.

   Global, because a style two pages share cannot be scoped to one of them. ScopedStyleTests now
   says so for every class in these files. */

.sec-title {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0;
}
/* ---- confirmation modal ------------------------------------------------ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 10, 16, .72);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
    padding: 1rem;
}
.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    max-width: 30rem;
    width: 100%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .5);
}
.modal h2 { margin: 0 0 .6rem; }.modal p { margin: 0 0 1.1rem; color: var(--muted); }.modal p strong { color: var(--text); }.modal-actions { display: flex; gap: .5rem; justify-content: flex-end; }
/* Failures stay on screen until dismissed — the status line scrolls past too easily. */
.file-error {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    margin: .5rem;
    padding: .5rem .65rem;
    border: 1px solid var(--accent-2);
    border-radius: 6px;
    background: rgba(194, 54, 91, .12);
    color: var(--text);
    font-size: .85rem;
}.file-error > span { flex: 1 1 auto; }
/* The .fs-hint element is built in JS and so carries no CSS-isolation attribute; its styles
   live in wwwroot/app.css, where they can actually reach it. */

/* Privilege level, on the device's own meta line. A small caps label rather than a coloured dot:
   the difference between Elevated and Limited decides what you can do on that machine, and a dot
   would need a legend to say which colour meant which. */
.priv {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.priv.elevated { color: var(--accent); }.priv.limited { color: var(--accent-2); }