/* paula design foundation - THE one place for design tokens and base elements.
   Every module builds on these; no module ships its own colours, fonts or spacing.

   Look and feel is taken from the geo/svg2route frontend:
   white cards on cool light grey, red is a marker only (never a surface),
   blue for links, status always as a pastel background with dark text. */

:root
{
    /* surfaces and lines */
    --bg: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --surface-3: #f0f2f4;
    --border: #e3e5e8;
    --border-strong: #cfd3d8;

    /* text */
    --text: #1f2328;
    --text-muted: #6b7280;
    --text-faint: #9aa1a9;
    --text-invert: #ffffff;

    /* brand and interaction */
    --accent: #d50c2d;
    --accent-hover: #b30a26;
    --link: #2a6db0;
    --focus: #2a6db0;
    --select-bg: #eaeef4;
    --select-line: #c6d2e2;

    /* what an anchor shows on hover - overridden where the surface is dark */
    --anchor-hover: rgba(42, 109, 176, .14);

    /* status, always a background/foreground pair */
    --ok-bg: #e8f5ec;    --ok-fg: #1e7a3c;
    --run-bg: #e7f0fb;   --run-fg: #1f5fa8;
    --wait-bg: #fdf4e0;  --wait-fg: #8a6320;
    --err-bg: #fdeaea;   --err-fg: #b4232a;
    --idle-bg: #eef0f2;  --idle-fg: #6b7280;

    /* type */
    --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: "Cascadia Mono", Consolas, "SF Mono", monospace;
    --fs-xs: 11px;
    --fs-sm: 12px;
    --fs-base: 14px;
    --fs-md: 15px;
    --fs-lg: 18px;
    --fs-xl: 22px;
    --fs-2xl: 28px;

    /* spacing, shape, depth */
    --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
    --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
    --radius: 8px;
    --radius-sm: 5px;
    --radius-pill: 999px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
    --shadow-lg: 0 4px 12px rgba(16, 24, 40, .10);
    /* what floats over the page - a dialog, a panel, a box that stands above the rest */
    --shadow-pop: 0 10px 30px rgba(16, 24, 40, .18);
    /* what folds out of a field - a list to pick from */
    --shadow-list: 0 6px 24px rgba(0, 0, 0, .35);

    /* what darkens the page behind a dialog, and the dark stage a file is shown on */
    --backdrop: rgba(16, 24, 40, .35);
    --stage-bg: #22262b;
    --stage-fg: #c8cdd2;

    /* frame */
    --topbar-h: 52px;
    --sidebar-w: 224px;
    --sidebar-narrow: 56px;
    --icon-size: 20px;
    /* the bell in the corner - the stack of messages and the panel keep clear of it */
    --bell-size: 36px;
}

/* --- base ------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

body
{
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 var(--fs-base)/1.5 var(--font);
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }

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

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* blazor moves the focus to the page heading on every navigation so screen
   readers announce the new page; the heading is not operable, so it gets the
   focus without the ring */
h1:focus-visible { outline: none; }

/* numbers line up in columns wherever they are compared */
.num { font-variant-numeric: tabular-nums; }

/* a value that must not be torn apart at a space - a phone number is one word to a reader */
.nowrap { white-space: nowrap; }

/* a sign or a word in the colour of what it says: green where nothing changes, red where something
   is written or left out. On a span around a drawn icon the drawing takes it over - it is drawn in
   the colour of its text */
.ink-ok  { color: var(--ok-fg); }
.ink-err { color: var(--err-fg); }

/* a block set apart from the one above it - a table under a table, a hint under a list */
.space-above { margin-top: 1rem; }

/* --- form fields: ONE shape, everywhere ---------------------------------
   Written once and not per form (ground rule "the same thing is solved once"). Without it a
   field falls back to what the browser draws by itself: Arial, a white ground and a 2px
   inset frame that Chrome renders as two grey lines along the left edge - which is exactly
   what stood in the anchor popover and on every generated settings page until 2026-08-14,
   while the management dialogs next door looked like the platform.
   Checkbox and radio are left alone on purpose: their look IS their meaning, and a padded
   box with a border is neither. */
input, select, textarea
{
    padding: 4px 8px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    /* the browser gives a field its own font - without this one line the platform's type
       stops at the edge of every input */
    font: inherit;
}

/* a tick box and a radio dot ARE their look - a padded box with a border is neither. They
   go back to what the browser draws, and they carry more weight than the line above so
   they win it (the base rule stays at element weight on purpose, or no class could ever
   dress a field differently) */
input[type=checkbox], input[type=radio] { all: revert; }

input:disabled, select:disabled, textarea:disabled { color: var(--text-muted); cursor: not-allowed; }

/* --- frame: topbar, sidebar, main -------------------------------------- */

.topbar
{
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: 0 var(--s5);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    z-index: 20;
}

.brand
{
    display: flex;
    align-items: baseline;
    gap: var(--s2);
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--text);
}

.brand-mark { color: var(--accent); }

.brand-sub { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 400; }

/* the bar has a frame and a middle: the user block above, the administration and the
   version below, the modules in between and scrolling */
.sidebar
{
    position: fixed;
    top: var(--topbar-h); bottom: 0; left: 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 10;
    transition: width .12s ease;
}

.sidebar.collapsed { width: var(--sidebar-narrow); }

/* While dragging nothing may lag behind: a soft change of width looks good when folding and limps
   after the pointer when dragging. */
.sidebar.dragging, .main.dragging { transition: none; }

/* The edge at which the sidebar becomes wider. It lies ON the dividing line and is wider than it -
   a line of one pixel is hit by nobody.

   Invisible until pointer or keyboard reach it: a permanently visible edge would be an invitation
   nobody asked for. Invisible does not mean unreachable though - it carries a tabindex, otherwise
   the tab key would never find it. */
.sidebar-grip
{
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    width: 6px;
    margin-left: -3px;
    z-index: 11;
    cursor: col-resize;
    background: transparent;
    transition: background .12s ease;
}

.sidebar-grip:hover,
.sidebar-grip:focus-visible,
.sidebar-grip.dragging { background: var(--accent); outline: none; }

/* While dragging, this surface catches the mouse over the whole page - otherwise the edge loses
   the pointer as soon as it is faster than the drawing. */
.drag-catch
{
    position: fixed;
    inset: 0;
    z-index: 50;
    cursor: col-resize;
}

.nav-user
{
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s6) var(--s4);
    border-bottom: 1px solid var(--border);
    /* Who works here stands where one looks first, and it gets the room for that: the circle is
       32px, the air above and below it 24 - together the 80 this block keeps even when a fully
       unfolded menu underneath pushes against it (2026-08-25). */
    min-height: 80px;
    flex-shrink: 0;
}

.nav-user-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.avatar
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px; height: 32px;
    border-radius: var(--radius-pill);
    background: var(--select-bg);
    color: var(--link);
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: .02em;
}

.avatar-empty { background: var(--surface-3); color: var(--text-muted); }

/* Middle and foot both scroll, and both give way - in proportion to what they hold.

   Until 2026-08-20 only the middle did, and it lost every time: a flex item with
   `overflow` other than `visible` may shrink to nothing, one with `overflow: visible`
   may not shrink at all. So the foot - user settings, administration, and under it ONE
   ROW PER MODULE - took whatever it wanted, and the module list above it was squeezed
   down to a sliver. With eleven modules there was nothing left of it to see, and the
   navigation of the whole platform stood in a two-pixel strip.

   `flex-basis: auto` plus `min-height: 0` on both is what makes them share: each may
   shrink, and shrinking is distributed by how tall they would like to be. Whoever holds
   more keeps more. */
.nav-middle,
.nav-foot
{
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    /* the bar is narrow - a thin bar, and never the reserved gutter of a wide one */
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* The modules keep at least half the bar. Without it an unfolded foot - settings and
   administration, both open - pushes them into a strip of a few rows, and the part one actually
   works with is the part that gives way. A share and not a number of pixels: the bar is as tall
   as the window, so half of it means half of whatever that is right now (2026-08-25). */
.nav-middle { padding: var(--s3) 0; min-height: 50%; }

/* the foot only takes what it needs: it grows no further than its content, while the
   middle takes the rest - a nav bar with three modules must not push its foot to the
   bottom edge */
.nav-foot { flex-grow: 0; border-top: 1px solid var(--border); padding: var(--s2) 0; }

.nav-version
{
    padding: var(--s2) var(--s4);
    color: var(--text-faint);
    font-size: var(--fs-xs);
    text-align: center;
}

.sidebar.collapsed .nav-version { display: none; }

/* one row: icon, text, and for a node the chevron. A button and a link have to look
   the same here, hence the reset of the button's own looks */
.nav-item
{
    display: flex;
    align-items: center;
    gap: var(--s3);
    width: 100%;
    padding: var(--s2) var(--s4);
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.nav-item:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }

/* the whole row marks the page one is on - so the mark survives the narrow bar */
.nav-item.active
{
    background: var(--select-bg);
    border-left-color: var(--accent);
    font-weight: 600;
}

.nav-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-chevron { color: var(--text-muted); font-size: 13px; line-height: 1; transition: transform .12s ease; }

.nav-node { position: relative; }

.nav-node.open > .nav-node-head .nav-chevron { transform: rotate(180deg); }

.nav-node:not(.open) > .nav-children { display: none; }

/* the children of a node - indented so far that they line up under its text */
.nav-children .nav-item { padding-left: calc(var(--s4) + var(--icon-size) + var(--s3)); }

/* a node inside a node: its children step in once more, or a grandchild would stand exactly
   as far left as its uncle and the level would be invisible (decided 2026-08-12) */
.nav-children .nav-children .nav-item
{
    padding-left: calc(var(--s4) + 2 * (var(--icon-size) + var(--s3)));
}

.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-chevron { display: none; }

.sidebar.collapsed .nav-item { justify-content: center; padding: var(--s2); }

/* narrow, the kept open state does not count: a flyout standing there for good would
   cover exactly the page one just made room for. It appears while the pointer or the
   keyboard is on the node, and goes when they leave (measured 2026-08-11) */
.sidebar.collapsed .nav-node > .nav-children { display: none; }

.sidebar.collapsed .nav-node:hover > .nav-children,
.sidebar.collapsed .nav-node:focus-within > .nav-children
{
    display: block;
    position: absolute;
    top: 0; left: 100%;
    z-index: 12;
    min-width: 200px;
    padding: var(--s1) 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: var(--shadow-lg);
}

/* the flyout must not be cut off by the column it stands beside - narrow there is
   nothing to scroll anyway, one icon per module (measured 2026-08-11). It applies to the
   foot as well since it scrolls too (2026-08-20): a clipped flyout would be the same
   fault one line further down. */
.sidebar.collapsed .nav-middle,
.sidebar.collapsed .nav-foot { overflow: visible; }

/* in the foot it opens UPWARDS: growing downwards would put everything but the first
   entry below the edge of the screen */
.sidebar.collapsed .nav-foot .nav-node:hover > .nav-children,
.sidebar.collapsed .nav-foot .nav-node:focus-within > .nav-children
{
    top: auto;
    bottom: 0;
}

.sidebar.collapsed .nav-children .nav-text { display: block; }

.sidebar.collapsed .nav-children .nav-item { justify-content: flex-start; padding: var(--s2) var(--s4); }

/* the sidebar's explaining text - shown instead of an empty frame */
.nav-empty { padding: var(--s2) var(--s4); }

.sidebar.collapsed .nav-empty, .sidebar.collapsed .nav-user-name { display: none; }

.sidebar.collapsed .nav-user { justify-content: center; padding: var(--s4) var(--s2); }

/* an icon takes the colour of its text - hence the mask instead of an <img> */
.icon
{
    flex: 0 0 var(--icon-size);
    width: var(--icon-size); height: var(--icon-size);
    background-color: currentColor;
    mask: var(--icon-url, none) center / contain no-repeat;
    -webkit-mask: var(--icon-url, none) center / contain no-repeat;
}

/* The shipped drawing (Icons) instead of a mask: it stands in the markup and colours itself over
   currentColor - so NO mask and no background, but the same size. The svg fills the frame; without
   this rule it takes all the room it finds (2026-08-18). */
.icon-drawing
{
    display: inline-flex;
    background-color: transparent;
    mask: none;
    -webkit-mask: none;
}

.icon-drawing > svg { width: 100%; height: 100%; display: block; }

/* a module without an icon: its initial, visible but no error */
.icon-initial
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-3);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: var(--fs-xs);
    font-weight: 600;
    mask: none;
    -webkit-mask: none;
}

.main
{
    margin: var(--topbar-h) 0 0 var(--sidebar-w);
    padding: var(--s6) var(--s8) var(--s10);
    /* 1440 again since 2026-09-27: the page does not widen for one wide table - a table scrolls
       sideways inside its own frame */
    max-width: 1440px;
    transition: margin-left .12s ease;
}

.main-wide { margin-left: var(--sidebar-narrow); }

/* --- dashboard: one tile per module -------------------------------------- */

.tiles
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--s4);
}

/* the tile and its settings sign share one box, so the sign can sit in the corner WITHOUT
   being inside the link: the same click cannot navigate and change a value.
   The box is what the grid stretches, so the tile inside has to fill it - otherwise tiles
   in one row end at different heights (measured 2026-08-14: 147 against 160 px) */
.tile-shell { position: relative; display: flex; }

.tile-shell > .tile { flex: 1 1 auto; }

.tile
{
    display: block;
    padding: var(--s2) var(--s3) var(--s3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text);
}

/* out of sight until somebody reaches for it - six tiles would otherwise carry six
   invitations nobody asked for. Out of sight is not out of reach: Tab finds it, which a
   pure hover element never would */
.tile-gear
{
    position: absolute;
    top: var(--s1);
    right: var(--s1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity .12s ease, color .12s ease;
}

.tile-gear svg { width: 15px; height: 15px; }

.tile-shell:hover .tile-gear,
.tile-gear:focus-visible { opacity: 1; }

.tile-gear:hover { color: var(--text); }

.tile-gear:focus-visible { outline: 2px solid var(--border-strong); outline-offset: 1px; }

/* the whole tile is the way into the module, so it has to look reachable */
.tile-link { cursor: pointer; transition: box-shadow .12s ease, border-color .12s ease; }

.tile-link:hover
{
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: var(--text);
}

.tile-head
{
    display: flex;
    align-items: center;
    gap: var(--s2);
    margin-bottom: var(--s2);
    padding-bottom: var(--s1);
    border-bottom: 1px solid var(--border);
}

/* bigger than in the sidebar: here the icon is the face of the module, not a marker
   in a row (decided 2026-08-11) */
.tile-head .icon { --icon-size: 22px; }

.tile-name { font-size: var(--fs-base); font-weight: 600; }

.tile-body { display: flex; flex-direction: column; gap: var(--s1); }

/* one figure of a tile: the number big, what it means beside it, the detail below */
.tile-figure { display: flex; align-items: baseline; gap: var(--s1); flex-wrap: wrap; }

.tile-big { font-size: var(--fs-md); font-weight: 600; line-height: 1.2; }

/* the label gives way, the figure never does: a channel name is free text, and one long
   one would otherwise push the number into a line of its own and make the tile grow
   (measured 2026-08-11). The whole name stays in the tooltip. */
.tile-label
{
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

.tile-note { width: 100%; color: var(--text-faint); font-size: var(--fs-xs); line-height: 1.35; }

/* the figure to the right edge, so the numbers of several lines stand under each other */
.tile-right { margin-left: auto; }

/* the shape of the last day, no axes and no scale - the curve alone */
.tile-spark { width: 100%; }

.tile-spark .chart { margin: 0; }

/* --- page head --------------------------------------------------------- */

.page-head
{
    display: flex;
    align-items: flex-end;
    gap: var(--s4);
    margin-bottom: var(--s6);
}

.page-head .sub
{
    margin-top: var(--s1);
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

.page-head-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }

/* --- the colour picker (2026-08-17) ------------------------------------------------------
   Two parts on one value, next to each other: the field that SHOWS the colour, and the one its
   spelling stands in. The picker stays small and square - it is a colour patch one clicks, and not
   a bar dominating the row. The browser draws its inside itself; here stands only how it sits. */
.colour-field
{
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
}

.colour-pick
{
    flex: 0 0 auto;
    width: 2rem;
    height: 1.9rem;
    padding: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 4px);
    cursor: pointer;
}

/* the string next to it: narrow, because seven characters are everything that belongs in it */
.colour-text
{
    flex: 0 1 8.5rem;
    min-width: 6rem;
    font-family: var(--mono, ui-monospace, monospace);
}

.colour-pick:disabled,
.colour-text:disabled { cursor: default; opacity: .6; }

/* The separator in an action row (2026-08-17). A row of seven signs without any structure is one
   that gets searched in - three groups with a stroke between them can be read. It is a stroke and
   not an element with content, which is why it gets its width from the border and not from a
   character. */
.action-split
{
    align-self: stretch;
    width: 0;
    margin: var(--s1) var(--s1);
    border-left: 1px solid var(--border);
}

/* --- card -------------------------------------------------------------- */

.card
{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* A card that carries anchors must NOT clip: the popover opens downwards and reaches past
   the card's edge - measured on the weather display, where the lower anchors lost their
   dialog. Rounded corners are not worth a cut-off dialog. */
.card:has(.anchor) { overflow: visible; }

/* The same for a card in which a field unfolds its suggestions: the list opens downwards, and
   under the last row of the shopping note it reaches past the card's edge - measured 2026-09-12,
   two of five offered names were to be seen. */
.card:has(.suggest-panel) { overflow: visible; }

.card + .card { margin-top: var(--s4); }

.card-head
{
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s3) var(--s5);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.card-head h2, .card-head h3 { font-size: var(--fs-md); }

.card-body { padding: var(--s5); }

/* --- button ------------------------------------------------------------- */

.btn
{
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    padding: 7px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: 500 var(--fs-base)/1.2 var(--font);
    cursor: pointer;
}

.btn:hover { background: var(--surface-3); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:disabled:hover { background: var(--surface); }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--text-invert); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); }

.btn-danger { color: var(--accent); }
.btn-danger:hover { background: var(--err-bg); }

.btn-sm { padding: 4px 10px; font-size: var(--fs-sm); }

/* a button that is only a symbol: square, no frame until the pointer arrives. What it
   does is in its Title - as a hint and for a screen reader */
.btn-icon
{
    padding: 4px;
    border-color: transparent;
    background: transparent;
    color: var(--text-muted);
}

.btn-icon:hover { background: var(--surface-3); color: var(--text); }
.btn-icon:disabled:hover { background: transparent; }
.btn-icon svg { width: 18px; height: 18px; display: block; }

/* --- status chip -------------------------------------------------------- */

.chip
{
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-sm);
    font-weight: 500;
    white-space: nowrap;
}

.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.chip-ok   { background: var(--ok-bg);   color: var(--ok-fg); }
.chip-run  { background: var(--run-bg);  color: var(--run-fg); }
.chip-wait { background: var(--wait-bg); color: var(--wait-fg); }
.chip-err  { background: var(--err-bg);  color: var(--err-fg); }
.chip-idle { background: var(--idle-bg); color: var(--idle-fg); }

/* the running state is the only one that moves - it says "look again in a moment" */
.chip-run .dot { animation: pulse 1.6s ease-in-out infinite; }

@keyframes pulse { 50% { opacity: .35; } }

/* --- table -------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }

/* While a suggestion field is open in the table, its border must not cut: `overflow-x: auto` clips
   downwards as well, and the unfolded list ended at the edge of the table (measured 2026-08-16).
   The horizontal scrolling is missing in that moment - that is the price, and it is the smaller
   one: whoever is typing does not scroll. */
.table-wrap:has(.suggest-panel) { overflow: visible; }

.table { width: 100%; border-collapse: collapse; }

.table th
{
    padding: var(--s2) var(--s3);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: var(--fs-sm);
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.table td
{
    padding: 10px var(--s3);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

/* no zebra - a row lights up when the pointer is on it, that is enough */
.table tbody tr:hover { background: var(--surface-2); }

/* DENSE ROWS (2026-09-12): the air around a line goes, and the icon button in it loses its own
   frame - a row is as high as its text, not as high as a button */
.table-dense th { padding: var(--s1) var(--s3); }
.table-dense td { padding: 3px var(--s3); }
.table-dense .btn-icon { padding: 1px; }

.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* sortable column heads: the arrow says what is happening, not what could happen */
.table th a.sort { color: inherit; text-decoration: none; white-space: nowrap; }
.table th a.sort:hover { color: var(--text); }
.table th a.sort::after { content: " ↕"; opacity: .35; font-size: 10px; }
.table th a.sort-asc::after { content: " ↑"; opacity: 1; }
.table th a.sort-desc::after { content: " ↓"; opacity: 1; }

/* the filter bar: search box, one drop-down or range per column, the number of hits.
   It wraps, because a wide table brings a lot of them. */
.filter-bar
{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s3);
    margin-bottom: var(--s3);
}

.filter-input
{
    width: 260px;
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: 400 var(--fs-base)/1.3 var(--font);
}

.filter-pick, .filter-range
{
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    font-size: var(--fs-sm);
}

.filter-pick select
{
    max-width: 220px;
    padding: 5px 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: 400 var(--fs-sm)/1.3 var(--font);
}

/* a value that would leave nothing is still shown - one should see what one ruled out */
.filter-pick option:disabled { color: var(--text-faint); }

.filter-number
{
    width: 92px;
    padding: 5px 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: 400 var(--fs-sm)/1.3 var(--font);
    font-variant-numeric: tabular-nums;
}

.filter-date
{
    width: 104px;
    padding: 5px 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: 400 var(--fs-sm)/1.3 var(--font);
    font-variant-numeric: tabular-nums;
}

/* a day field whose text cannot be read: it stays, and it says so where it stands */
.filter-date.filter-bad { border-color: var(--err-fg); outline-color: var(--err-fg); }

/* the typed day with its calendar: the date field is there for the picker, not for the eye */
.filter-day { position: relative; display: inline-flex; align-items: center; gap: 2px; }

.filter-day-hidden
{
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

/* the hit count sits at the end of the bar and is always there, not only while filtering */
.filter-count { margin-left: auto; font-size: var(--fs-sm); white-space: nowrap; }

/* the size of a page, beside the number of entries (2026-09-29) */
.table-size { width: auto; font-size: var(--fs-sm); }

/* what the table can do, at the far right end of its own bar */
.filter-tools { display: inline-flex; align-items: center; gap: var(--s2); }

.table-intro { margin-bottom: var(--s3); }

.table-note { margin-top: var(--s3); font-size: var(--fs-sm); }

.muted { color: var(--text-muted); }

.empty { padding: var(--s6); text-align: center; color: var(--text-muted); }

/* selection: chosen rows and the bar whose actions run over all of them */
.table tbody tr.selected { background: var(--select-bg); }
.table tbody tr.selected:hover { background: var(--select-bg); }

/* THE ROW SOMEBODY STANDS ON - the viewer paging through the list marks its place, a list marks
   the entry whose details are open. It looks like the active entry of the sidebar, everywhere
   (decided 2026-09-17): the bar of the paula icon at the left edge - the width of its
   stroke, rounded on the left where it follows the tile, straight on the right - and the colour
   of a chosen row behind it, without the tick: standing somewhere and choosing something look
   alike, and only the tick arms an action. A module draws no mark of its own. */
.table tbody tr.current { background: var(--select-bg); }
.table tbody tr.current:hover { background: var(--select-bg); }
.table tbody tr.current > td:first-child { position: relative; }

.table tbody tr.current > td:first-child::before
{
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 5px;
  border-radius: 5px 0 0 5px;
  background: var(--accent);
}
.w-pick { width: 34px; }

.toolbar
{
    display: flex;
    align-items: center;
    gap: var(--s3);
    margin-bottom: var(--s3);
    padding: var(--s2) var(--s3);
    background: var(--select-bg);
    border: 1px solid var(--select-line);
    border-radius: var(--radius-sm);
}

/* messages after an action - the text names counts, partial success stays visible */
.notice
{
    margin-bottom: var(--s3);
    padding: var(--s2) var(--s3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.notice-ok  { background: var(--ok-bg);  border-color: var(--ok-fg);  color: var(--ok-fg); }
.notice-err { background: var(--err-bg); border-color: var(--err-fg); color: var(--err-fg); }

/* a message that withdraws by itself still needs the way out for whoever is faster */
.notice { display: flex; align-items: flex-start; gap: var(--s3); }
.notice-text { flex: 1; }

/* the same message without its box - beside the button that caused it */
.notice-bare { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); }

.notice-close
{
    border: 0; background: none; color: inherit; cursor: pointer;
    font-size: var(--fs-lg); line-height: 1; padding: 0 2px; opacity: .6;
}

.notice-close:hover { opacity: 1; }

/* --- notifications: over the page, never in its flow --------------------------------- */

/* the stack starts above the bell that sits in the corner (2026-09-19) */
.toasts
{
    position: fixed; z-index: 70;
    right: var(--s4); bottom: calc(var(--s4) + var(--bell-size) + var(--s2));
    display: flex; flex-direction: column; gap: var(--s2);
    max-width: min(420px, calc(100vw - 2 * var(--s4)));
}

.toast
{
    display: flex; align-items: flex-start; gap: var(--s3);
    padding: var(--s2) var(--s3);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: 0 6px 20px rgba(16, 24, 40, .16);
}

.toast-ok  { background: var(--ok-bg);  border-color: var(--ok-fg);  color: var(--ok-fg); }
.toast-err { background: var(--err-bg); border-color: var(--err-fg); color: var(--err-fg); }

.toast-text { flex: 1; font-size: var(--fs-sm); }

.toast-close
{
    border: 0; background: none; color: inherit; cursor: pointer;
    font-size: var(--fs-lg); line-height: 1; padding: 0 2px; opacity: .6;
}

.toast-close:hover { opacity: 1; }

/* THE BELL AND ITS PANEL (2026-09-19): the memory of the messages. The bell sits in the corner
   under the stack, faint until the pointer comes or the panel is open; the panel hangs on the
   right edge over the page. It lies under the stack, so a message that comes while it is open
   still shows, and under the bell, which closes it again. */
.toast-bell
{
    position: fixed; z-index: 72;
    right: var(--s4); bottom: var(--s4);
    width: var(--bell-size); height: var(--bell-size);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    opacity: .55;
    box-shadow: var(--shadow);
}

.toast-bell:hover, .toast-bell-open { opacity: 1; color: var(--text); }

.toast-bell .icon { --icon-size: 18px; }

.toast-panel
{
    position: fixed; z-index: 69;
    top: 0; right: 0; bottom: 0;
    width: min(420px, 100vw);
    padding: var(--s4) var(--s4) calc(var(--s4) + var(--bell-size) + var(--s2));
    overflow: auto;
    background: var(--surface);
    border-left: 1px solid var(--border-strong);
    box-shadow: var(--shadow-pop);
}

.toast-panel-head { margin: 0 0 var(--s3); font-size: var(--fs-md); }

.toast-panel-none { margin: 0; color: var(--text-muted); font-size: var(--fs-sm); }

.toast-panel-list { list-style: none; margin: 0; padding: 0; }

.toast-panel-row
{
    display: flex; gap: var(--s3); align-items: flex-start;
    padding: var(--s2) 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--fs-sm);
}

.toast-panel-at { flex: 0 0 auto; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.toast-panel-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.toast-panel-err .toast-panel-text { color: var(--err-fg); }

/* --- the place to drop files -------------------------------------------------------- */

/* It lies OVER everything while files hang over the page - above the dialog too, so that
   dropping onto an open one still means the page. */
.drop-veil
{
    position: fixed; inset: 0; z-index: 70;
    display: flex; align-items: center; justify-content: center;
    background: rgba(16, 24, 40, .45);
    /* the pointer belongs to the drag, not to this: a veil that catches hover would swallow the
       dragleave the counter needs, and the overlay would hang there after the drop */
    pointer-events: none;
}

/* WHILE THE PAGE WORKS THE VEIL IS A WALL (2026-09-12): every click lands on it and nowhere
   else. A click into the menu behind it left the page, and a throw of eighteen files was gone
   with it - without a word. The drag state stays as it was: there the pointer must reach the
   page, or the drop never arrives. */
.drop-veil-modal { pointer-events: auto; }

/* A BOX LIKE A DIALOG (2026-09-12): surface, shadow, rounded - no dashed frame. The dashes said
   "drop here" in the language of file managers and said it in both states; a page reading its
   eighteenth file is not a drop target, and the frame only asked what it was. */
.drop-box
{
    padding: var(--s4) var(--s5);
    background: var(--surface);
    border-radius: var(--radius);
    font-weight: 600;
    text-align: center;
    max-width: min(520px, calc(100vw - 2 * var(--s4)));
    box-shadow: var(--shadow-pop);
}

/* THE BOX WHILE THE PAGE WORKS (2026-09-12): a width of its own - the words alone are short, and a
   bar as wide as "Datei 1 von 18" is a bar nobody can read -, the words on the left, the bar under
   them, the way out bottom right. The BOX takes the width: a child alone would be capped by the
   box's own limit. And it takes the pointer back that the veil lets through. */
.drop-box:has(.drop-work) { width: min(600px, calc(100vw - 2 * var(--s4))); max-width: none; pointer-events: auto; }

.drop-work { text-align: left; }

/* THE PART ON ITS WAY UNDER THE WHOLE (2026-10-20): a line of room between the two - the bar of the
   whole above, the words of the part below; one text line is 1.5em (body) */
.drop-part { margin-top: 1.5em; }

/* THE NUMBERS BESIDE A BAR (2026-10-20): the bar takes the room, the numbers stand to its right.
   A browser that still holds yesterday's sheet shows them under the bar - still readable */
.drop-bar { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s2); }
.drop-bar .progress { flex: 1; margin-top: 0; }
.drop-count { white-space: nowrap; font-size: var(--fs-sm); font-weight: 400; color: var(--text-muted); }

/* THE TARGETS ON THE DROP AREA (2026-09-20, evening): rows of tiles under a heading, the one
   under the pointer lit; the box grows to hold them, and the tiles take the pointer the veil
   lets through */
.drop-box:has(.drop-rows) { width: min(760px, calc(100vw - 2 * var(--s4))); max-width: none; text-align: left; font-weight: 400; }
.drop-rows { display: flex; flex-direction: column; gap: var(--s3); }
.drop-heading { font-size: var(--fs-lg, 18px); font-weight: 600; margin-top: var(--s2); }
.drop-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.drop-row-small { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.drop-tile
{
    pointer-events: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--s4) var(--s3) var(--s3);
    text-align: center;
    color: var(--text-muted);
}
.drop-row-small .drop-tile { padding: var(--s3) var(--s2) var(--s2); }
.drop-tile-over { border: 2px solid var(--accent); background: var(--run-bg); color: var(--run-fg); padding: calc(var(--s4) - 1px) calc(var(--s3) - 1px) calc(var(--s3) - 1px); }
.drop-row-small .drop-tile-over { padding: calc(var(--s3) - 1px) calc(var(--s2) - 1px) calc(var(--s2) - 1px); }
.drop-picture svg { display: block; width: 150px; height: 120px; margin: 0 auto var(--s2); }
.drop-row-small .drop-picture svg { width: 56px; height: 56px; }
.drop-paper { fill: var(--surface-2); stroke: currentColor; stroke-width: 2; }
.drop-stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drop-stroke-strong { stroke-width: 3; }
.drop-mark { fill: currentColor; font-size: 13px; }
.drop-tile-name { font-size: var(--fs-md, 15px); font-weight: 600; color: var(--text); }
.drop-tile-over .drop-tile-name { color: var(--run-fg); }
.drop-row-small .drop-tile-name { font-size: var(--fs-sm); font-weight: 500; }
.drop-tile-hint { font-size: var(--fs-xs); margin-top: 2px; }
/* everything inside a tile belongs to the tile for the drag: a picture as the target would hide
   the tile from the counting */
.drop-tile * { pointer-events: none; }

/* THE STEPS OF THE WORK, BY NAME (2026-09-13): one row over the words, the running one stands
   out, the done ones step back, the ones ahead are only announced. */
.drop-steps { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-bottom: var(--s3); font-weight: 400; }
.drop-step-done { color: var(--text-muted); }
.drop-step-active { font-weight: 700; color: var(--accent); }
.drop-step-ahead { color: var(--text-muted); opacity: .7; }

.drop-actions { display: flex; justify-content: flex-end; margin-top: var(--s4); }

/* --- the safety question: a dialog, not a button that turns into a question ---------- */

.dialog-backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 60; }

.dialog
{
    position: fixed; z-index: 61;
    left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(var(--dialog-short), calc(100vw - 2 * var(--s4)));
    padding: var(--s4);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-pop);
}

/* THREE SIZES, AND EACH HAS A NAME (decided 2026-08-30). A question needs less room than a
   form, and a form with a TABLE in it needs more than one with fields - a dialog says which of
   the three it is instead of every page pushing a number of its own into the stylesheet.
   Everything above `short` can scroll, or a long form would push its own buttons off the screen
   on a laptop.

   The second half of the formula stays in all of them: whatever the size says, nothing sticks
   out of a small screen. */
:root
{
    --dialog-short: 460px;
    --dialog-medium: 720px;
    --dialog-large: 1040px;
}

/* WHAT SCROLLS IS THE CONTENT, NOT THE WINDOW (2026-09-20). Before, the whole box scrolled, and
   the title bar with the cross and the button row went out of sight with the first turn of the
   wheel - a window whose title leaves is no window. Now the box is a column: bar, content, buttons;
   the content takes what is left and scrolls alone. `min-height: 0` is what lets a flex child
   shrink below its content at all. */
.dialog-medium
{
    width: min(var(--dialog-medium), calc(100vw - 2 * var(--s4)));
    max-height: calc(100vh - 2 * var(--s4));
    display: flex;
    flex-direction: column;
}

.dialog-large
{
    width: min(var(--dialog-large), calc(100vw - 2 * var(--s4)));
    max-height: calc(100vh - 2 * var(--s4));
    display: flex;
    flex-direction: column;
}

.dialog-medium > .dialog-text,
.dialog-large > .dialog-text
{
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;

    /* ROOM FOR THE FOCUS RING (2026-09-22). A box that scrolls vertically cuts SIDEWAYS as well:
       css does not let `overflow-x: visible` stand beside `overflow-y: auto`, the browser makes
       it `auto` too. The ring of a field lies four pixels outside it (a 2px outline at an offset
       of 2px), a field is as wide as this box - and so the ring was gone on the left and on the
       right. The padding gives it its room, the negative margin gives the room back to the
       dialog, so nothing moves. */
    padding-inline: 4px;
    margin-inline: -4px;

    /* the same at the top and the bottom (2026-09-29): the last field of a full dialog lost the
       lower edge of its ring */
    padding-block: 4px;
    margin-top: -4px;
    margin-bottom: calc(var(--s4) - 4px);
}

/* and the page behind an open dialog stands still: one scrollbar, the dialog's - a wheel that
   moved the page under the backdrop moved the wrong thing (2026-09-20) */
body:has(.dialog-backdrop) { overflow: hidden; }

/* PINNED TO THE TOP EDGE (2026-09-10). It overrules the centring of `.dialog` and therefore has
   to stand after it - both are one class deep, so the later one wins. Only the vertical half is
   replaced: sideways it stays in the middle. */
.dialog-pinned { top: var(--s4); transform: translateX(-50%); }

/* OVER EVERYTHING BEFORE IT (2026-09-11): every dialog shares the two layers above, so a second
   one leaves the box of the first reachable under its backdrop. One that says so takes these two
   layers instead and covers the first, backdrop and all. */
.dialog-backdrop-over { z-index: 70; }

.dialog-over { z-index: 71; }

/* the box carries the focus so Escape reaches it - but it is not a control, so no ring */
.dialog:focus, .dialog:focus-visible { outline: none; }

/* THE VIEWER (2026-08-30): one file shown large, arrows beside it to page the chain. The stage
   is dark on purpose and no token: a picture is judged against dark, and this is the one place
   of the platform that shows pictures. */
.viewer { display: flex; align-items: center; gap: var(--s2); outline: none; }

.viewer-stage
{
    flex: 1;
    min-width: 0;
    /* ONE HEIGHT (2026-09-20): the stage grew with the picture and shrank to "…" between two of
       them, and the dialog jumped with every turn of a page */
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--stage-bg);
    border-radius: var(--radius-sm);
    overflow: auto;
}

.viewer-stage > img { max-width: 100%; max-height: calc(70vh - 2 * var(--s2)); object-fit: contain; }

/* ZOOMED (2026-09-21): the picture is scaled around the pointer and pulled about by it; the stage
   shows the cut-out and nothing runs over its edge */
.viewer-stage.viewer-zoomed { overflow: hidden; }
/* the picture KEEPS the fitted box it is laid out in - the transform scales that box, and the
   clamp counts on it; letting the box grow to the natural size moved every edge (2026-09-21) */
.viewer-stage.viewer-zoomed > img { cursor: grab; transform-origin: 0 0; }
.viewer-stage.viewer-zoomed.viewer-panning > img { cursor: grabbing; }
.viewer-zoom { font-variant-numeric: tabular-nums; color: var(--text-muted); align-self: center; margin-right: auto; }

.viewer-frame { width: 100%; height: 70vh; border: 0; background: #fff; }

/* sound and video with the bar of the browser (2026-09-29) - as big as the stage allows */
.viewer-audio { width: min(100%, 40rem); }

.viewer-video { max-width: 100%; max-height: calc(70vh - 2 * var(--s2)); background: #000; }

.viewer-text
{
    width: 100%;
    max-height: 70vh;
    overflow: auto;
    margin: 0;
    padding: var(--s3);
    background: var(--surface);
    font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
    font-size: 0.9em;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* the sentence on the dark stage - loading, failure, or "not shown, only delivered" */
.viewer-plain { color: var(--stage-fg); padding: var(--s4); text-align: center; }

.viewer-arrow
{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    flex: none;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.viewer-arrow:disabled { opacity: .35; cursor: default; }
.viewer-arrow > svg { width: 1.1rem; height: 1.1rem; }

/* A BAR, not a line of bold text (2026-08-30). A window says where it begins; the surface makes
   the handle visible that was only knowable before, and it gives the cross a place of its own.
   It reaches to the edges: the negative margin takes back the padding of the box, so the bar
   stands where the border is. */
.dialog-title
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s2);
    font-weight: 600;
    margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) var(--s3);
    /* flat on purpose: a bar is a border, not a band. 45 pixels were a third too much of the
       window for a line of text (measured 2026-08-30) */
    padding: 2px var(--s3);
    background: var(--surface-3);
    border-bottom: 1px solid var(--border);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* the cross: a ghost button, and it takes its colour from the row it sits in */
.dialog-close
{
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    flex: none;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-muted);
    cursor: pointer;
}

.dialog-close:hover { background: var(--surface-2); color: var(--text); }
.dialog-close > svg { width: 1rem; height: 1rem; }
/* the title row is the handle: the dialog can be moved by it, and the pointer says so. Selecting
   text no longer works there - while dragging that would be in the way (2026-08-18). */
.dialog-grip { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }

/* THE GRIP AT THE BOTTOM RIGHT CORNER (2026-09-21): a dialog above "short" is pulled bigger or
   smaller here; two short strokes say so, the way every window says it */
.dialog-resize
{
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    touch-action: none;
    background:
        linear-gradient(135deg, transparent 0 55%, var(--border-strong) 55% 62%, transparent 62% 75%, var(--border-strong) 75% 82%, transparent 82%);
    border-bottom-right-radius: var(--radius-sm);
}

/* A DIALOG AT A PULLED SIZE (2026-09-21): the content fills the height it is given - the viewer's
   stage grows and shrinks with the window instead of standing at its own height */
.dialog-sized > .dialog-text { display: flex; flex-direction: column; }
.dialog-sized .viewer { flex: 1 1 auto; min-height: 0; }
.dialog-sized .viewer-stage { height: auto; align-self: stretch; }
.dialog-sized .viewer-stage > img { max-height: 100%; }
.dialog-sized .viewer-frame { height: 100%; }
.dialog-grip:active { cursor: grabbing; }
.dialog-text { margin-bottom: var(--s4); }

.dialog-actions { display: flex; justify-content: flex-end; gap: var(--s2); }

/* what the form itself can do, at the LEFT edge of the same row: it pushes the two on the right
   away from itself, so a delete never sits next to the button that saves */
.dialog-aside { margin-right: auto; }

/* What the modules put into the topbar: between the brand and the pickers, and it takes the
   space that is left over - an input line needs width, and the things to the right of it do not
   grow. Empty it takes none, so a frontend without such a module looks exactly as before. */
.topbar-parts
{
    display: flex;
    align-items: center;
    gap: var(--s2);
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
}

.topbar-parts:empty { display: none; }

/* the pickers keep their place at the right edge. Without parts the auto margin pushes them
   there, with parts the flexible area in front of them does */
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }

/* a square button that carries a sign instead of a word - the one that folds the bar */
.icon-button
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
}

.icon-button:hover { background: var(--surface-3); color: var(--text); }

.burger { font-size: 17px; line-height: 1; }

/* who is signed in, top right: the badge opens the little menu that holds signing in
   and out */
.user-menu { position: relative; display: inline-flex; }

.user-button { padding: 0; border: 0; background: transparent; border-radius: var(--radius-pill); cursor: pointer; }

.user-button:hover .avatar { background: var(--select-line); }

.user-panel
{
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 31;
    min-width: 220px;
    padding: var(--s3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: var(--s1);
}

.user-panel-name { font-weight: 600; margin-bottom: var(--s1); }

/* --- multiple choice filter: a panel with one checkbox per value -------- */

.filter-multi { position: relative; display: inline-flex; align-items: center; gap: var(--s2); }

.filter-multi-button
{
    display: inline-flex;
    align-items: center;
    gap: var(--s1);
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font: inherit;
}

.filter-multi-panel
{
    position: absolute;
    left: 0;
    top: calc(100% + var(--s1));
    z-index: 30;
    min-width: 220px;
    max-height: 320px;
    overflow-y: auto;
    padding: var(--s2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-list);
}

.filter-multi-actions { display: flex; gap: var(--s2); margin-bottom: var(--s2); }

.filter-multi-row { display: flex; align-items: center; gap: var(--s2); padding: 2px 0; cursor: pointer; }

.filter-multi-name { flex: 1; }

/* --- creating and changing in the row ------------------------------------ */

/* a row that can be clicked says so under the pointer - otherwise nobody tries it out */
.row-editable { cursor: pointer; }

.row-editable:hover td { background: var(--surface-2, rgba(255, 255, 255, .04)); }

/* ... and the row the keyboard stands on shows it the way every focus does - drawn inside the
   row, so the edge of the table cannot cut the ring off */
.row-editable:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* the open row and the one for creating carry the same marking: it is the same thing, once for
   something existing and once for something new */
.row-new td,
.row-edit td { background: var(--surface-2, rgba(255, 255, 255, .04)); }

/* the fields in it fill their cell - a table has no room to give away */
.row-new input,
.row-new select,
.row-edit input,
.row-edit select { width: 100%; box-sizing: border-box; }

/* a quantity column needs no full width, and a wide number field looks like an expectation of big
   numbers */
.row-new .cell-narrow input,
.row-edit .cell-narrow input { max-width: 6em; }

/* --- the grid: a table walked cell by cell ------------------------------- */

/* The cell that carries the focus is marked on the CELL, not on the field inside it: one walks
   over cells that hold no field at all - a computed column, a locked row - and the marking has to
   be visible there too, or the keyboard runs blind.

   It is drawn INSIDE the cell (a negative offset) and in the text colour, not in the accent one.
   Both have a reason and the same one: nothing may move and nothing may flash while somebody
   walks through a table. A ring that takes room pushes the row, and a signal colour on every
   second keystroke turns a list into a light show (2026-08-22). */
.table td.cell-active
{
    outline: 2px solid var(--text);
    outline-offset: -2px;
}

/* the browser draws its own ring on a focused cell; the marking above says the same thing better,
   and two rings around one cell is one too many */
.table td[data-row]:focus,
.table td[data-row]:focus-visible { outline: none; }

/* the field is the cell, not something in it: same letters, same size, same place, no frame of
   its own and no height of its own. What one types stands exactly where the text stood */
.table td.cell-edit .cell-input
{
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: inherit;
    text-align: inherit;
    outline: none;
    min-height: 0;
    height: auto;
}

/* what cannot be read stays where it is, and says so where it stands - a message alone would be
   gone by the time somebody looks up */
.table td.cell-bad { outline-color: var(--err-fg); }

/* A row that may not be typed in stays READABLE - it is greyed, not hidden: whoever looks for a
   billed stretch has to find it where it was worked, not somewhere else. */
.table tr.row-locked td { color: var(--text-muted); }

/* a column that carries no field at all - a duration, a sum - says so by not inviting */
.table td.cell-readonly { cursor: default; }

/* The list of a Pick cell, unfolded under it. It hangs on the cell, so the cell may not cut it
   off - overflow stays visible for the one that is open, and nowhere else. */
.table td.cell-edit { position: relative; overflow: visible; }

.cell-list
{
    position: absolute;
    left: -2px;
    top: 100%;
    z-index: 31;
    min-width: calc(100% + 4px);
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-list);
}

.cell-item
{
    text-align: left;
    white-space: nowrap;
    padding: 4px 8px;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
}

.cell-item:hover { background: var(--select-bg); }

/* the highlight has to be visible - it is the whole keyboard way through this list; the same
   colours and the same bar as in the suggestion field, for the same reason */
.cell-marked
{
    background: var(--select-bg);
    box-shadow: inset 3px 0 0 var(--accent);
}

/* A grid is READ IN ROWS, and for that many of them have to fit on the screen: a cell that wraps
   makes its whole row twice as high, and "Sa. 22.08.2026" over two lines costs a third of the
   list. So a cell stays on one line and cuts off what does not fit - the full text is in the
   field as soon as one types into the cell.

   The rows are tight for the same reason: this is a table one reads by the dozen, not a form. */
.grid-table td,
.grid-table th
{
    padding-top: var(--s1);
    padding-bottom: var(--s1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* A GRID, and therefore lines in both directions. Horizontal ones alone leave the columns
   floating in one surface, and one loses the column while reading across a row - which is exactly
   what a spreadsheet does not do. */
.grid-table td,
.grid-table th { border-right: 1px solid var(--border); }

.grid-table td:last-child,
.grid-table th:last-child { border-right: 0; }

/* The column headings stay where they are while the list runs past underneath. Without it one
   scrolls to row eighty and no longer knows which column carries what. */
.grid-table thead th
{
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--surface);
}

/* the activity is the one that carries sentences - it gets the room the fixed columns leave */
.grid-table { table-layout: auto; }

/* The colour picker stays its colour patch, even in a row that otherwise pulls its fields wide: a
   patch over half the column would be a bar and not a patch (2026-08-17). */
.row-new .colour-field,
.row-edit .colour-field { width: 100%; }

.row-new .colour-pick,
.row-edit .colour-pick { width: 2rem; flex: 0 0 2rem; }

/* --- a conversation: bubbles, the parts under an answer, the field (ChatView, 2026-09-30) --------
   It came out of the chat page of the prompt module, unchanged, when a second conversation needed it. */

.chat-view
{
    display: flex;
    flex-direction: column;
    gap: var(--s3);
    padding-bottom: var(--s4);
}

.chat-empty { margin: var(--s4) 0; }

.chat-turn
{
    display: flex;
    flex-direction: column;
    gap: var(--s1);
    max-width: 52rem;
}

/* who said it - the person to the right, so the two are told apart at a glance without colour being the
   only carrier */
.chat-mine { align-self: flex-end; text-align: right; }

.chat-who
{
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.chat-text
{
    padding: var(--s2) var(--s3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    white-space: pre-wrap;
}

.chat-mine .chat-text { background: var(--select-bg, var(--surface-alt)); }

/* THE FORM OF AN ANSWER (2026-10-26) - the blocks AnswerFormat makes of it, as the phone draws them. Every block
   is a line of its own, and an empty line is a gap */
.chat-text .chat-gap { height: .6em; }

.chat-text .chat-heading { font-weight: 600; margin-top: var(--s1); }
.chat-text .chat-h1 { font-size: var(--fs-lg); }
.chat-text .chat-h2 { font-size: var(--fs-md); }

/* an item of a list: its sign or number in front, deeper ones further in */
.chat-text .chat-item { display: flex; gap: .4em; padding-left: calc(var(--chat-depth, 0) * 1.2em); }
.chat-text .chat-mark { flex: 0 0 auto; }

.chat-text .chat-quote
{
    border-left: 3px solid var(--border-strong);
    padding-left: var(--s2);
    color: var(--text-muted);
}

.chat-text code
{
    font-family: var(--mono);
    background: var(--surface-3);
    padding: 0 .2em;
    border-radius: var(--radius-sm);
}

.chat-text .chat-code
{
    margin: var(--s1) 0;
    padding: var(--s2);
    background: var(--surface-3);
    border-radius: var(--radius-sm);
    font-family: var(--mono);
    white-space: pre;
    overflow-x: auto;
}

.chat-text .chat-rule { border: 0; border-top: 1px solid var(--border-strong); margin: var(--s2) 0; }

/* a table is as wide as its cells and scrolls sideways where the bubble is narrower */
.chat-text .chat-table-wrap { overflow-x: auto; margin: var(--s1) 0; }
.chat-text .chat-table { border-collapse: collapse; white-space: normal; }

.chat-text .chat-table th,
.chat-text .chat-table td
{
    border: 1px solid var(--border-strong);
    padding: var(--s1) var(--s2);
    text-align: left;
    vertical-align: top;
}

.chat-text .chat-table th { background: var(--surface-3); font-weight: 600; }

/* what a module shows under a link of the answer - one row per link, under the bubble */
.chat-part { padding-left: var(--s3); }

.chat-ask
{
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding-top: var(--s2);
    border-top: 1px solid var(--border);
}

/* the field holds more than one line: it grows with the text (the rows come from the component) and never
   sideways */
.chat-field
{
    flex: 1 1 auto;
    width: 100%;
    resize: none;
    line-height: 1.4;
}

/* --- suggestion field: type, pick, or leave something new standing ------ */

.suggest { position: relative; display: block; }

.suggest-input { width: 100%; box-sizing: border-box; }

/* IN A DIALOG THE LIST FLOATS (2026-09-29): fixed, it leaves the part of the dialog that scrolls - that
   part cut it off at the dialog's edge and grew a scroll bar for it. The island of the field puts it
   under the field (or above, where there is more room); until then it is not to be seen, so it never
   shows up in the wrong place. */
.dialog .suggest-panel { position: fixed; top: auto; left: auto; min-width: 0; visibility: hidden; }

.dialog .suggest-panel.suggest-placed { visibility: visible; }

.suggest-panel
{
    position: absolute;
    left: 0;
    top: calc(100% + 2px);
    z-index: 31;
    min-width: 100%;
    max-height: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-list);
}

.suggest-item
{
    text-align: left;
    padding: 6px 10px;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
}

/* The highlight MUST be visible - it is the whole keyboard way through this list. It first hung on
   a colour that does not exist in the platform, and the fallback value was white on white: one
   wandered blindly through the suggestions (measured 2026-08-16). Hence the colours of the
   selection that really exist - and a bar in front, so that the row stays recognisable even where
   areas draw weakly. */
.suggest-item:hover { background: var(--select-bg); }

.suggest-marked
{
    background: var(--select-bg);
    box-shadow: inset 3px 0 0 var(--accent);
}

/* shown, but not to be had: what is in the list already stands there greyed, so one sees it is
   there - and nothing happens on it */
.suggest-taken, .suggest-taken:hover { color: var(--text-muted); background: transparent; cursor: default; }

/* --- pager: only there when there is more than one page ----------------- */

.pager
{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--s2);
    margin-top: var(--s3);
}

.pager-window { min-width: 12em; text-align: right; }

/* --- chart: the box has the height, the canvas fills it ----------------- */

.chart { width: 100%; position: relative; }

/* fills the place it is given instead of a fixed height - the caller decides */
.chart-fill { height: 100%; }

.chart-canvas { width: 100%; height: 100%; }

/* --- what lies under the pointer in a chart -----------------------------
   echarts' own tooltip always names the nearest point, however far away the pointer
   stands. These two are placed by chart.js instead - and only when the pointer really
   stands on a curve. Used by the display, which is why they are dark. */

.chart-hover-line
{
    position: absolute; width: 1px; background: var(--border);
    pointer-events: none; z-index: 4;
}

.chart-hover-box
{
    position: absolute; pointer-events: none; z-index: 5;
    background: rgba(8, 12, 22, .96); color: var(--text);
    border: 1px solid var(--border); border-radius: 4px;
    padding: 6px 8px; font-size: var(--fs-sm); white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
}

.chart-hover-dot
{
    display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; margin-right: 5px;
}

.chart-hover-time { color: var(--text-muted); }

/* --- the sign-in form ---------------------------------------------------- */

/* built once and standing in more than one place, so it brings no width of its own:
   it fills whatever it is put into - the user menu today, the start page later */

.login-form { display: flex; flex-direction: column; gap: var(--s2); }

.login-field { display: flex; flex-direction: column; gap: 2px; }

.login-field > span { font-size: 0.85em; color: var(--text-muted); }

.login-problem { color: var(--err-fg); font-size: 0.9em; }

.login-actions { display: flex; gap: var(--s2); margin-top: var(--s1); }

/* the same form standing on a page of its own instead of in the menu: it must not run the
   whole width of a wide screen, a field one has to aim at is no gift */
.login-here { max-width: 22rem; margin-top: var(--s3); }

/* What is being worked on: the chosen mandate, next to the name of the installation. It stood as a
   second line under the user name in the sidebar until 2026-08-18 - there it read as a belonging,
   and that is not what it is.

   Drawn PRESENT (2026-08-19): as large as "paula", in the accent colour on a pale ground, with a
   separating stroke in front. Before that it stood small and muted next to it and was easy to
   overlook - whoever works inside a mandate has to see it without looking. */
.brand-mandate
{
    padding: 2px var(--s2);
    border-left: 1px solid var(--border-strong);
    margin-left: var(--s1);
    border-radius: var(--radius-sm);
    background: var(--select-bg);
    color: var(--accent);
    font-size: var(--fs-lg);
    font-weight: 600;
}

/* --- the management forms: mandates, users, rights ----------------------- */

/* one shape for both pages: fields wrap instead of scrolling sideways, and the labels
   stand above their fields so a long one does not squeeze the input */

.admin-form { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s3) 0; }

.admin-field { display: flex; flex-direction: column; gap: 2px; min-width: var(--field-medium); }

/* FOUR WIDTHS, AND EACH HAS A NAME (decided 2026-08-30). The minimum width decides one thing
   only: from where on a field wraps onto its own line. A postcode does not need the room of a
   mail address, and three parts of a name have to fit into one line - so a form says which of
   the four it wants instead of every page inventing a number of its own.

   `medium` is what a field without a class gets, so nothing that exists changes. The names are
   the same four everywhere; whoever needs something in between takes the nearer one. */
:root
{
    --field-tiny: 90px;
    --field-short: 140px;
    --field-medium: 220px;
    --field-long: 340px;
}

/* EVERY WIDTH IS A RANGE (2026-08-30): from where on the field wraps, and how far it may follow
   the room it is given. Without the upper end a short field swallowed everything that was left -
   a birthday as wide as a note, and the name of the width said nothing (measured: 774 pixels).
   Without the lower end nothing would ever wrap.

   The input follows its cell instead of staying at the browser's twenty characters - otherwise
   the width would be there and nobody would see it. */
.admin-field.tiny { min-width: var(--field-tiny); max-width: 140px; flex: 1 1 auto; }
.admin-field.short { min-width: var(--field-short); max-width: 260px; flex: 1 1 auto; }
.admin-field.medium { min-width: var(--field-medium); max-width: 400px; flex: 1 1 auto; }
.admin-field.long { min-width: var(--field-long); max-width: 640px; flex: 1 1 auto; }

/* A field fills the width it was given - **except a box one ticks** (2026-09-08). Such a box has
   its own size, and stretching it to the width of the line pushed its text to the far edge: in
   the token dialogue the box was 643 pixels wide and the word beside it stood at the right
   margin, one step further left per row, because a longer word left less room over (measured).

   `.admin-check` is worn TOGETHER with this class - that was foreseen where it stands, and this
   rule came later and did not know about it. */
.admin-field > input:not([type="checkbox"]):not([type="radio"]),
.admin-field > select,
.admin-field > textarea { width: 100%; }

/* A LINE BETWEEN TWO PARTS of one form. What belongs together stands together, and where the
   subject changes - the contact itself and what hangs on it - the eye needs the cut
   (decided 2026-08-30). */
.split { border-top: 1px solid var(--border); margin: var(--s4) 0; }

.admin-field > span { font-size: 0.85em; color: var(--text-muted); }

/* flex-direction spelled out: this class is also worn together with .admin-field, which
   stacks its label above its input - without the row here the box and its text would end up
   under each other and the checkbox would stand alone (measured 2026-08-12) */
.admin-check { display: flex; flex-direction: row; align-items: center; gap: var(--s2); cursor: pointer; }

.admin-actions { display: flex; gap: var(--s2); margin-top: var(--s2); }

/* A secret to be seen exactly once: the string of a freshly created access token. It is 74
   characters long, so it MUST wrap - a <pre> otherwise cuts it off or pushes the page sideways,
   and in both cases the reader copies half of it. It stood here without any rule in the stylesheet
   until 2026-08-18 (measured).

   It stays selectable on purpose - it is offered for copying and for nothing else. */
.token-secret {
  margin: var(--s2) 0;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-3);
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.95em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: all;
}

/* Fields below each other instead of next to each other. Without it the NUMBER of fields decides
   what a form looks like: two stand next to each other, three wrap - and the same dialog looks
   different when creating than when changing. */
.admin-form.column { flex-direction: column; flex-wrap: nowrap; }

/* The child selector is the point: a descendant one reaches into a NESTED .admin-form as well
   and puts every field in there on full width - the inner box then wraps every one of them onto
   its own line, and the wrapping box has no way of saying otherwise (measured 2026-08-21, the
   catalogue dialogue of ai). */
.admin-form.column > .admin-field { width: 100%; }

/* Label BESIDE the field instead of above it. Two lines per entry are what makes a dialogue with
   a dozen short numbers twice as tall as it needs to be - and a number that is six characters
   wide does not need a line of its own for its name.

   It is a variant, not the new shape: whoever wants it says so on the field. The label needs a
   fixed width, otherwise every row starts its input somewhere else and the eye finds no column;
   and it needs its own element, so a label written as bare text stays as it was. */
.admin-field.beside { flex-direction: row; align-items: center; gap: var(--s2); min-width: 260px; }

.admin-field.beside > span { width: 8rem; flex: none; }

/* `.suggest` stands among them because it IS such a field - it brings its own box along for the
   list underneath, and without this line that box keeps its own width while the label pushes. */
.admin-field.beside > input,
.admin-field.beside > select,
.admin-field.beside > .suggest { flex: 1; min-width: 0; }

/* a release or an assignment: the module on its own line, its roles indented underneath -
   with many modules that is the only way the eye finds where one stops */

.release { padding: var(--s2) 0; border-top: 1px solid var(--border); }

.release-roles
{
    display: flex;
    flex-wrap: wrap;
    gap: var(--s2) var(--s3);
    margin: var(--s1) 0 var(--s1) var(--s3);
}

/* --- generated settings page --------------------------------------------- */

.setting-row
{
    display: flex;
    align-items: center;
    gap: var(--s2);
    margin: var(--s2) 0;
    flex-wrap: wrap;
}

.setting-label { min-width: 260px; }

.setting-row input[type="number"], .setting-row input[type="text"] { width: 140px; }

.setting-help { margin: 0 0 var(--s2) 0; }

/* Two columns in the settings form: what applies to everybody, and what is set for the chosen
   mandate (2026-08-19). They stand next to each other instead of switching between two views and
   knowing the one only from memory.

   The headings sit over the same columns as the fields - hence the same division as in the row and
   no table: a table would bring borders and row heights along that nobody wants here. */
.setting-columns
{
    display: flex;
    align-items: baseline;
    gap: var(--s2);
    margin-top: var(--s3);
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.setting-columns .setting-column { width: 140px; }

/* When a second column stands there, the label gets a fixed width - otherwise names of different
   lengths shift the fields against each other, and out of two columns a stairway is made. */
.setting-row.two-columns { flex-wrap: nowrap; }

.setting-row.two-columns .setting-label { width: 260px; flex: 0 0 260px; }

.setting-mandate input { width: 140px; }

.setting-problem { color: var(--err-fg); }

.setting-actions { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s3); }

.device-actions { display: inline-flex; gap: var(--s2); margin-left: var(--s3); }

/* the reset button names the value it would put in place - on a line of its own, so the
   sentence and the value do not run into each other and break where they like */
.reset-label { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.35; }

.reset-label .reset-value { color: var(--text-muted); }

/* --- language picker: flag button, panel with one row per language ------ */

.lang { position: relative; }

.lang-button
{
    display: inline-flex;
    align-items: center;
    gap: var(--s1);
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
}

.lang-button:hover { background: var(--surface-3); }

.lang-chevron { color: var(--text-muted); font-size: 9px; }

.flag { display: inline-flex; width: 24px; height: 18px; }

/* a hairline keeps light flag parts visible on the white surface */
.flag svg { width: 100%; height: 100%; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .10); }

/* a language without a flag on file gets a neutral badge with its code */
.flag-fallback
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 3px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .05em;
}

/* click anywhere else = close; sits under the panel, over everything else */
.lang-backdrop { position: fixed; inset: 0; z-index: 30; }

/* THE MENU OF ACTIONS (2026-09-29): a short list in words under its sign. A table and a card cut what
   stands out of them - while the list is open, they let it through, the way they do for a suggestion. */
.action-menu { position: relative; display: inline-block; }

.action-menu-panel
{
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 31;
    min-width: 180px;
    padding: var(--s1) 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.action-menu-entry
{
    padding: var(--s1) var(--s3);
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.action-menu-entry:hover, .action-menu-entry:focus-visible { background: var(--surface-2); }

.table-wrap:has(.action-menu-panel), .card:has(.action-menu-panel) { overflow: visible; }

.lang-panel
{
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 31;
    min-width: 170px;
    /* many languages scroll instead of growing past the screen */
    max-height: min(60vh, 400px);
    overflow-y: auto;
    padding: var(--s1);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.lang-search
{
    width: 100%;
    margin-bottom: var(--s1);
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: 400 var(--fs-sm)/1.3 var(--font);
}

.lang-empty { padding: var(--s3); text-align: center; font-size: var(--fs-sm); }

.lang-item
{
    display: flex;
    align-items: center;
    gap: var(--s2);
    width: 100%;
    padding: 6px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text);
    font: 400 var(--fs-base)/1.3 var(--font);
    text-align: left;
    cursor: pointer;
}

.lang-item:hover { background: var(--surface-3); }

/* what is chosen right now - the picker has to say it inside the list too, not only on the
   button, or one opens it and cannot tell where one stands */
.lang-item-on { font-weight: 600; background: var(--surface-3); }

.lang-name { flex: 1; }

/* the mandate on the button: it is a name, not a flag, so it needs a width limit - a long
   one must not push the user badge off the topbar */
.mandate-name
{
    display: inline-block;
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.lang-check { font-weight: 600; }

/* --- blazor runtime bits ------------------------------------------------ */

/* shown until the webassembly runtime has loaded; the percentage comes from
   blazor itself */
.loading
{
    display: flex;
    height: 100vh;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.loading::after { content: var(--blazor-load-percentage-text, ""); margin-left: var(--s2); }

#blazor-error-ui
{
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 1000;
    padding: var(--s3) var(--s5);
    background: var(--err-bg);
    color: var(--err-fg);
    border-top: 1px solid var(--err-fg);
}

#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* --- the connection ------------------------------------------------------ */

/* The pages are drawn over a standing connection. When it tears, the view keeps standing there
   looking alive while not a single click arrives any more - so it says so, over everything, and
   whoever is standing in front of it cannot go on clicking into the void.

   The framework hangs the state on the box as a class; what it looks like is ours. It lies HIGHER
   than every dialog: a torn connection concerns all of them (2026-08-25). */
#components-reconnect-modal { display: none; }

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected
{
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 200;
    align-items: center;
    justify-content: center;
    background: var(--backdrop);
}

.reconnect-box
{
    width: min(var(--dialog-short), calc(100vw - 2 * var(--s4)));
    padding: var(--s4);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-pop);
    text-align: center;
}

.reconnect-box p { margin: 0; }

/* One sentence at a time, and the way out only where there is one to take: while it is trying
   again there is nothing to decide, and a button that shortens somebody's own reconnection is an
   offer against them */
.reconnect-box > * { display: none; }

.components-reconnect-show .reconnect-trying,
.components-reconnect-failed .reconnect-failed,
.components-reconnect-rejected .reconnect-rejected { display: block; }

.components-reconnect-failed .reload,
.components-reconnect-rejected .reload { display: inline-block; margin-top: var(--s4); }

/* --- anchors: configure where the effect is visible ---------------------- */

/* at rest an anchor is what it stands on - a title, a name, a figure. Only the hover
   shows that it can be clicked */
.anchor { position: relative; border-radius: 3px; }

.anchor:not(.anchor-plain) { cursor: pointer; }

.anchor:not(.anchor-plain):hover { background: var(--anchor-hover); }

.anchor:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* the field stands WHERE the text stood - no box, no heading, nothing that covers what one
   is looking at (decided 2026-08-14). It takes the width of its place and the type of
   its surroundings, so nothing jumps when it opens and nothing looks pasted on. */
.anchor-inline
{
    width: 100%;
    min-width: 4rem;
    max-width: 100%;
    padding: 1px 4px;
    font: inherit;
    color: inherit;
    background: color-mix(in srgb, currentColor 12%, transparent);
    border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
    border-radius: 3px;
    cursor: text;
}

.anchor-inline:focus { outline: 2px solid var(--accent); outline-offset: 0; }

.anchor-problem { color: var(--err-fg); }

.anchor-actions { display: flex; gap: var(--s2); }

/* --- the band of direct ways into configuring ---------------------------- */

.configure-band { display: flex; align-items: baseline; gap: var(--s4); flex-wrap: wrap; }

.configure-service { display: inline-flex; gap: var(--s2); align-items: baseline; }

/* --- a chapter head: name, the two drawings, the level ------------------- */

.chapter-head { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s3); }

.chapter-views { display: inline-flex; gap: var(--s1); }

.chapter-level { display: inline-flex; align-items: center; gap: var(--s2); margin-left: auto; }

/* --- tabs: one header control, two callers - the chapters of the service page and the
   views of the weather page. The active tab carries the accent like a sidebar item. */

.tabs
{
    display: flex;
    gap: var(--s1);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--s4);
    flex-wrap: wrap;
}

.tab
{
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    padding: var(--s2) var(--s4);
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: none;
    color: var(--text);
    font-size: var(--fs-base);
    cursor: pointer;
}

/* a tab may carry the icon of what it leads to - smaller than in the sidebar, because
   here the word carries the meaning and the picture only helps to find it again */
.tab .icon { --icon-size: 16px; }

.tab:hover { background: var(--surface-3); }

.tab-active { border-bottom-color: var(--accent); font-weight: 600; }

/* --- the service page: profile rows, action buttons, readable results ------------- */

.profile-grid { display: grid; grid-template-columns: max-content 1fr; gap: var(--s1) var(--s5); }

.service-actions { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }

/* the chapters of a service: buttons, not a second row of tabs - the tab row above
   belongs to the areas */
.chapter-picker { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }

.service-result { margin-top: var(--s3); display: grid; gap: var(--s1); }

/* the manifest area: a list inside a line - a chapter's settings - does not fit into a
   cell, so it stands under its line. Set off and indented, otherwise it reads like more
   lines of the table above it */
.manifest-nested > td { background: var(--surface-2); padding-left: var(--s5); }

.manifest-nested-head { margin-bottom: var(--s2); font-weight: 600; }

/* what a raw value means, under it: the manifest shows what the service really said, the
   translation is the help underneath - never the other way round */
.manifest-under { color: var(--text-faint); font-size: var(--fs-xs); line-height: 1.35; }

/* Raw JSON: it scrolls inside itself instead of making the page wide, and it keeps its line
   breaks. The COLOURS come from prism.min.css, which the building block loads afterwards - here
   stands only how the block sits */
.json-view {
    margin: 0;
    padding: var(--s3);
    background: var(--surface-2);
    border-radius: var(--radius);
    overflow-x: auto;
    max-height: 70vh;
    overflow-y: auto;
    font-size: var(--fs-xs);
    line-height: 1.45;
}

/* A setting of several lines. It grows downwards only when somebody drags it - a box that
   resizes itself while typing moves everything under it. */
.lines
{
    width: 100%;
    box-sizing: border-box;
    min-height: 8em;
    resize: vertical;
    font: inherit;
    line-height: 1.45;
}

/* On the settings row it takes the WHOLE line: the row is a flex line whose fields are 140px
   wide, and a text of several sentences in that width is unreadable. `flex-basis: 100%` pushes
   it below the label instead of squeezing it in beside it. */
.setting-row .lines
{
    flex: 1 1 100%;
    max-width: 56rem;
}

/* Except where two levels stand next to each other - there it shares the line with the second
   box, and pushing would tear the pair apart. */
.setting-row.two-columns .lines
{
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
}

.setting-mandate:has(.lines) { flex: 1 1 auto; min-width: 0; }

/* The sum under a grid: set apart from the rows, not a row of its own. A spreadsheet leaves the
   space between the last entry and its total, and that space is what makes it a total. */
.grid-sums
{
    display: flex;
    justify-content: flex-end;
    gap: var(--s4);
    margin-top: var(--s4);
    padding-top: var(--s3);
    border-top: 2px solid var(--border);
    font-weight: 600;
}

.grid-sums .num { font-variant-numeric: tabular-nums; min-width: 6em; text-align: right; }

/* A STRIP OF SMALL PICTURES (2026-09-11) - the sides of a photographed card, the face of a
   counterpart -, each a button into the viewer without a button's own look. The box is square and
   the picture is fitted into it whole: a card is landscape, a face is portrait, and a card turned
   by a quarter must not grow out of its box. */
.strip { display: flex; align-items: flex-start; gap: var(--s3); flex-wrap: wrap; }

.strip-item { display: flex; flex-direction: column; align-items: center; gap: var(--s1); }

.strip-open
{
  padding: 0;
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  display: block;
  border-radius: var(--radius);
  width: 100px;
  height: 100px;
  overflow: hidden;
}

.strip-picture
{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* the controls under one picture - move back, turn, move forward - in one short row */
.strip-tools { display: flex; align-items: center; gap: var(--s1); }

/* the swap between two pictures (2026-09-13): as high as the picture box, so the button stands
   at the height of the two it swaps */
.strip-swap { display: flex; align-items: center; height: 100px; }

/* the switch under one picture, in the page's words - small, because it stands under a small
   picture (2026-09-12) */
.strip-keep { display: flex; align-items: center; gap: var(--s1); font-size: 0.85em; color: var(--text-muted); cursor: pointer; }

/* A BAR THAT SAYS HOW FAR (2026-09-11): filled to the share, or pulsing where nobody counts. It
   is as wide as the box it stands in and as flat as a line. */
/* A BLOCK THAT FOLDS (2026-09-17): a head line one clicks, the content under it while it is open */
.fold { margin-top: var(--s3); }

.fold-head
{
  display: flex;
  align-items: center;
  gap: var(--s2);
  width: 100%;
  padding: var(--s2) 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.fold-head:hover .fold-title { color: var(--accent); }
.fold-arrow { display: inline-flex; width: 18px; height: 18px; color: var(--text-muted); }
.fold-arrow > svg { width: 100%; height: 100%; }
.fold-title { font-weight: 600; }
.fold-summary { color: var(--text-muted); font-size: var(--fs-sm); }
.fold-body { padding-top: var(--s2); }

.progress
{
  width: 100%;
  height: 6px;
  margin-top: var(--s2);
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}

.progress-bar
{
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-pulse .progress-bar
{
  width: 35%;
  animation: progress-slide 1.4s ease-in-out infinite;
}

@keyframes progress-slide
{
  0% { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

/* the setup picture of the phone app: it stands on white, whatever the theme does - a scanner
   reads contrast, not taste */
.token-qr { margin: var(--s4) 0; }
.token-qr svg { display: block; border: 1px solid var(--border); border-radius: var(--radius); }
