/* ---- the top bar, shared ------------------------------------------------
   Global rather than page-scoped, and loaded by the public join page as well as
   the console. These rules used to live in Home.razor.css, where Blazor's CSS
   isolation rewrote them to .topline[b-xxxxx] — so they matched Home and nothing
   else. The Admins and Backups headers had been rendering unstyled, which went
   unnoticed while the logo was a small square and became obvious the moment it
   was replaced with a wordmark nearly 2000px wide.

   The join page had its own hand-written copy of the same bar, which is why it
   never quite matched. One file now, so they cannot drift apart again. */

/* A page that fills the window rather than flowing down it: a column with a header at the top
   and something below that scrolls. Worn by the console, Administrator Settings and Change
   Password -- NOT console-specific, despite the name it was given when only one page had it.

   The window less the page's margin, because that is the normal case. Edge to edge is the
   exception and asks for it below. */
.console-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 2 * var(--page-pad));
}

/* Edge to edge, for a page whose content is a work surface rather than a document.

   The console used to float on the page's margin like anything else, which is right for a
   document and wrong for a work surface: it put a frame of background around a machine list and
   somebody else's desktop, and the sidebar read as a card sitting on a canvas rather than as the
   side of the application. Its columns carry their own inner padding instead, so nothing moved
   closer to being unreadable -- the gap is on the inside of the panels now rather than outside
   them.

   OPT IN, which is the part that was wrong at first: this was written on .console-shell itself,
   and three pages wear that class -- so Administrator Settings and Change Password had their
   margins taken away too and their text ran into the edge of the window. A treatment that suits
   one page has to be asked for by that page.

   :has() rather than a class on body, because body belongs to the layout and this belongs to one
   page. Where it is not supported the page simply keeps its margin, which is the state this
   replaced rather than a broken one. The height has to follow the padding: the shell is sized by
   subtracting it, so leaving that alone would hand back at the bottom exactly what was saved at
   the top. */
body:has(.console-shell.full-bleed) {
    padding: 0;
}

.console-shell.full-bleed {
    height: 100vh;
}

.topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}

.topline h1 { margin: 0; font-size: 1.5rem; letter-spacing: .02em; }

.topline h1.brand {
    display: flex;
    /* Centre, not baseline: the tagline belongs on the logo's middle line, and a wordmark has no
       text baseline of its own for the browser to line it up against. */
    align-items: center;
    gap: .6rem;
    font-family: 'IBM Plex Sans Condensed', 'IBM Plex Sans', 'Segoe UI', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* The console's header is GONE, and with it every rule that made one header line itself up
   with two columns: the .topline.over-cols grid, the .topline-head wrapper that made the
   wordmark and the lead slot one cell of it, and the two insets that cancelled each other out.

   What they were for: the strip of open panes had to begin at the same edge as the work surface
   it switches between, which meant the header doing arithmetic against the machine list's width
   -- calc(var(--col-a) + 14px + 1rem) -- and a wrapper so that arithmetic belonged to one cell
   rather than to whichever page happened to fill two. It worked. It was also a great deal of
   machinery to make something spanning both columns pretend it was aligned to one of them, and
   two of the comments above had already been superseded without being deleted.

   The console puts each piece over the column it is about instead: the wordmark at the top of the
   list, the panes inside column B. Neither needs to know the other column's width, so there is
   nothing left here to keep in step -- and the real constraint on the list's width went with it,
   which was that the wordmark plus its lead slot had to fit inside that first cell.

   The rules for what MOVED stay in this file: .topline-tabs, .ptab and the account menu are
   chrome rather than one page's layout, they are global, and they match wherever the markup puts
   them. TopBar's own .topline is untouched -- Administrator Settings and Change Password still
   wear it, and on a single-column page a header is the right shape. */

/* The logo is the way between the console and the join page, so it is a link on
   both. line-height:0 keeps the anchor from adding descender space under it. */
.brand-home {
    display: block;
    line-height: 0;
    border: 0;
}

.brand-home:hover { filter: brightness(1.15); }

/* A wide wordmark, not a square mark: fixing both dimensions squashed it. Height is set and
   width follows the image, so replacing the file with a different proportion needs no CSS change. */
.brand-logo {
    height: 1.5em;
    width: auto;
    display: block;
    flex: 0 0 auto;
    /* Set on the image rather than the header, so the wordmark sits in from the edge without
       moving everything else on the line with it. */
    padding-left: 16px;
}

/* Reset out of the headline's shouting, since this is a sentence rather than a label. */
.brand-tag {
    font-family: var(--font-body);
    font-size: .8rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--muted);
    white-space: nowrap;
}

.topbar { display: flex; justify-content: flex-end; align-items: center; gap: .6rem; color: var(--muted); }

/* First thing to go when there is no room: it is a sentiment, not a control. Still here for the
   join page, which is the one place the tagline is still shown. */
@media (max-width: 52rem) {
    .brand-tag { display: none; }
}

/* ---- the account menu ---------------------------------------------------
   Opened by :hover and :focus-within, with no script. Deliberately NOT a <details>: the browser
   hides its content in a way CSS cannot reliably reopen, so hover-to-open works in some browsers
   and silently fails in others. :hover is the mouse, :focus-within is the keyboard, and since
   tapping the button focuses it, touch comes free. */
.acct { position: relative; }

/* An ordinary button, which is what it is.

   It used to be a ghost: no fill, a transparent border, muted text -- and it grew a fill and a
   border on hover. That reads as "nothing here, until you go looking", which was wrong for a
   control sitting next to Administrator Settings doing the same kind of job. Two controls side by
   side either look alike or they look like one of them is disabled.

   Written as a DELETION rather than as a copy of the button's look. This is a <button>, so it
   already inherits all of it from `button, .btn`; everything removed here was an override telling
   it not to. A copy would have been four values to keep in step with a rule twelve lines away,
   and the first time somebody restyled the buttons these two would have drifted apart again --
   which is the whole fault being fixed.

   What is left is layout, which the button base says nothing about: the row that holds the name
   and its caret, and nowrap so a long name never becomes two lines and changes the row's height.

   `font: inherit` went with them, and that one is easy to miss: it was resetting the font-size
   back to the page's 15px, so even once the fill matched, the text would not have. */
.acct-name {
    display: flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
}

/* Hover, extended to "the menu is open".

   The same accent treatment `button:hover` already gives, but keyed off the wrapper rather than
   the button -- so the control stays lit while the pointer is down in the menu it opened, instead
   of going cold the moment the pointer leaves the button it is attached to. Restated rather than
   left to the base rule for exactly that reason. */
.acct:hover > .acct-name,
.acct:focus-within > .acct-name {
    border-color: var(--accent);
    color: var(--accent);
}

.acct-caret { font-size: .65rem; opacity: .7; }

.acct-menu {
    display: none;
    position: absolute;
    right: 0;
    /* No gap to cross: a gap between the button and the menu drops :hover on the way down and the
       menu closes under the pointer. The spacing is padding inside this box instead. */
    top: 100%;
    z-index: 30;
    min-width: 13rem;
    margin-top: .35rem;
    padding: .25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
    flex-direction: column;
    gap: .1rem;
}

/* The bridge over that margin, so the pointer never crosses dead space. */
.acct-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -.45rem;
    height: .45rem;
}

.acct:hover > .acct-menu,
.acct:focus-within > .acct-menu { display: flex; }

/* The same shape whether it is a link or the log-out form's button, so the two do not read as
   different kinds of thing while sitting next to each other. */
.acct-menu form { margin: 0; display: block; }

.acct-item {
    display: flex;
    /* Centred, now that every item is a single line. It was flex-start, which was there to hold a
       glyph level with the first line of a two-line item -- and a menu with one two-line item in it
       was the thing that needed fixing, not the thing to lay out around. */
    align-items: center;
    gap: .55rem;
    width: 100%;
    padding: .45rem .55rem;
    background: none;
    border: 0;
    border-radius: calc(var(--radius) - 2px);
    color: var(--text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

/* text-decoration again, and this is the whole of the underline-on-some-rows fault. The global
   a:hover underlines and the global button:hover cancels it, so a menu built from five links and
   two buttons answered the pointer two different ways -- which reads as a rendering fault. */
.acct-item:hover { background: var(--surface-2); color: var(--accent); text-decoration: none; }

/* A fixed box whatever is in it, so the labels line up down the menu. The glyphs are inline SVG
   stroked with currentColor, which is what makes them one family and makes them take the row's
   colour on hover -- the emoji they replaced could do neither. The box is sized here rather than on
   the svg so an item that still wants a character gets the same slot. */
.acct-glyph {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    opacity: .85;
}

.acct-glyph svg { width: 1rem; height: 1rem; display: block; }

/* ONE hover for every item in this menu, which is the whole of the rule above. There was a second
   one here -- Log out answered the pointer in the danger colour -- and a menu where the last item
   highlights differently from the rest reads as a rendering fault before it reads as a warning.
   The word "Log out" carries that meaning without the colour. */

/* ---- open panes, beside the wordmark ------------------------------------ */

/* The strip of what is open. Beside the logo rather than above the work surface, because it
   belongs to the whole window: a pane on one machine and a pane on another are peers, and putting
   the strip inside one column would have implied it described that column. */
.topline-tabs {
    display: flex;
    align-items: center;

    /* Written as the sum rather than as the answer, the same way .ptab-kind's font size is: 27px
       is the thing that was asked for, and .3rem is the gap that was already there.

       It is paid for in how many tabs fit before the strip scrolls -- every tab is a fixed
       --col-a-content wide, so this is 27px off the visible run of them. That is the trade, and
       it is the right way round: a strip that scrolls is obvious, where tabs that touch read as
       one object. */
    gap: calc(.3rem + 27px);
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    padding: 0 1rem;
    scrollbar-width: thin;
}

/* A tab is the width of the Create Session button beside it.

   Not because a tab needs 247 pixels -- the longest label is nowhere near it -- but because the
   button is the only other object on this row's line, and two things at the top of two columns
   that are nearly the same width read as a mistake where the same width reads as a grid. It also
   stops the strip reflowing as tabs are opened and closed: every tab is the same size, so the
   ones already open never move.

   --col-a-content is the list's content width, which is what the button fills. */
.ptab {
    display: flex;
    align-items: stretch;
    flex: 0 0 auto;
    width: var(--col-a-content);

    /* Held to the same height as the button across the seam rather than taking whatever two lines
       of small text come to, which was about three quarters of a pixel more. See --row-h. */
    height: var(--row-h);
    border: 1px solid rgba(var(--accent-rgb), .72);
    border-radius: var(--radius);

    /* Create Session's colours, which is the button these sit on one line with. They were a dark
       fill with grey writing, which made the two halves of that line read as unrelated controls.

       The alpha is what keeps the strip legible as a SET: the tab in front is the full accent, the
       rest are the same colour held back, so they are plainly teal tabs without the showing one
       disappearing among them. A flat fill on all of them would have matched the button exactly
       and taken away the only thing the strip says besides what is open. */
    background: rgba(var(--accent-rgb), .72);
    color: var(--accent-ink);
    overflow: hidden;
    transition: border-color .12s, background .12s, filter .12s;
}

/* Brighter rather than a different colour, the same way .btn-accent answers a pointer. */
.ptab:hover { filter: brightness(1.08); }

/* AND THE LABEL STAYS. app.css answers hover on every button with color: var(--accent), which is
   this tab's own background -- so pointing at a tab painted the top line of it in the fill it was
   sitting on and the word disappeared. "Screen", "cmd", "PowerShell": gone, and back on the way
   out.

   Only the top line, because it is the only part of a tab that inherits its colour. The machine
   name underneath names --accent-ink, the pane glyph names it, the close cross names its own; so
   the symptom was one of two lines vanishing, which reads as a rendering fault rather than as a
   hover rule.

   PaneTabStyleTests is the file that exists to catch a mark drawn in the colour the tab is filled
   with, and it could not see this one: the accent was not in any .ptab rule, it was inherited from
   a global one. It looks for that now too. */
.ptab-go:hover { color: var(--accent-ink); }

/* The showing one: the accent at full strength, and 600 like the button. */
.ptab.on {
    border-color: var(--accent);
    background: var(--accent);
    font-weight: 600;
}

.ptab-go {
    display: flex;
    color: inherit;
    flex-direction: row;
    align-items: center;
    gap: .45rem;
    background: none;
    border: 0;

    /* Fills whatever the tab's fixed width leaves after the pin and the close button, so those
       two stay on the trailing edge instead of being pulled left against a short label. It was a
       9rem floor, which is what a tab needed when its width followed its contents; the tab has a
       width of its own now and this follows it. */
    flex: 1 1 auto;
    min-width: 0;

    /* No vertical padding, because the tab now has a fixed height and this stretches to it:
       align-items above is what centres the two lines in it, and padding here would only be
       something for them to overflow out of. */
    padding: 0 .6rem;
    cursor: pointer;
    text-align: left;
    line-height: 1.15;
}

/* The two lines, stacked beside the mark rather than under it. */
.ptab-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

/* PaneGlyph's own span. Unscoped, because this stylesheet is not scoped to anything -- it is the
   one both the console and the join page load.

   Muted until the tab is the one in front, the same way the machine name beneath it is: a tab that
   is not being looked at should read as one quiet object, not as a bright mark with some grey
   writing next to it. */
.ptab .glyph {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.1rem;
    color: var(--accent-ink);
    opacity: .85;
}

.ptab .glyph svg { width: 1rem; height: 1rem; display: block; }
.ptab .glyph.mono { font-size: .62rem; letter-spacing: -.02em; line-height: 1; }
/* Ink, NOT --accent: the accent is now the tab's own background, so the mark would have
   disappeared into it on exactly the tab you are looking at. */
.ptab.on .glyph { color: var(--accent-ink); opacity: 1; }

/* Kind above machine: which of several machines is the question being asked when there are
   several tabs, so it gets the bottom line where the eye lands last and stays. */
/* A point larger than it was, written as the sum rather than as the answer: "+1pt" is the thing
   that was asked for, and 0.8233rem is only what that happens to work out to on a 16px root. */
.ptab-kind { font-size: calc(.74rem + 1pt); overflow: hidden; text-overflow: ellipsis;
             white-space: nowrap; max-width: 100%; }

/* Twice the room it had. The machine name is the half of a tab that varies -- the kind is one of
   seven short words -- and it was the half being truncated. */
/* The machine name, held back from the kind above it by OPACITY rather than by a grey.
   --muted is a light grey for a dark fill and is close to unreadable on teal; the ink colour at
   less than full strength is the same idea that still works on this background. */
.ptab-dev { font-size: calc(.66rem + 1pt); color: var(--accent-ink); opacity: .75;
            max-width: 20rem; overflow: hidden;
            text-overflow: ellipsis; white-space: nowrap; }
.ptab.on .ptab-dev { opacity: .9; }

/* The rule between the label and the close button is drawn in the ink rather than in --border,
   which is a dark grey chosen for a dark fill and vanishes on teal.

   Drawn rather than set in type, so "bolder" is a number. The X was ✕ at .7rem and whatever
   weight the browser's symbol font gave it -- font-weight does not reliably reach a glyph that
   came out of a fallback font, which is why making it heavier in CSS was not an option. */
.ptab-x {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 0;
    border-left: 1px solid rgba(4, 20, 28, .22);
    color: var(--accent-ink);
    opacity: .8;
    padding: 0 .45rem;
    cursor: pointer;
}

.ptab-x svg { width: .72rem; height: .72rem; display: block; }

/* Still the danger colour, which reads on teal, and now at full strength. */
.ptab-x:hover { color: var(--accent-2); background: rgba(194, 54, 91, .18); opacity: 1; }

/* ---- dragged into order ------------------------------------------------- */

/* Dragging a tab. Text selection off, or the drag paints a blue smear across the labels on the
   way past.

   There was a pin here, and a sliver of colour down the leading edge of a pinned tab. Both went
   with the feature: dragging already puts the strip in whatever order somebody wants, and the pin
   only promised to hold that order against churn, which is a second way of saying the same thing
   at the price of a control on every tab. */
.ptab { user-select: none; }
.ptab.dragging { opacity: .45; cursor: grabbing; }

/* Ink rather than the accent, for the third time and the same reason: a mark in the accent on a
   tab filled with the accent is a mark nobody can see. */
.ptab.drop-left  { box-shadow: inset 3px 0 0 0 var(--accent-ink); }
.ptab.drop-right { box-shadow: inset -3px 0 0 0 var(--accent-ink); }




/* The lean console is gone, along with the rail that produced it.

   It folded the machine list away and the chrome above the picture with it, to give a remote
   screen the whole window. The want was real; the price was that the list, the pane tabs and the
   account menu all went at once and one chevron was left to bring them back. Running the columns
   to the window's edges gets most of the same screen for none of that, and Full screen on the
   toolbar is the control for wanting nothing but the picture. */
