/* Dark-only, no light-mode variant: confirmed against the real akka.io site, which stays
   pure black even with the OS/browser set to prefers-color-scheme: light. This isn't a
   general-purpose starter template choice, it's the actual brand identity. */
:root {
    --font-sans: Instrument Sans, system-ui, sans-serif;
    --font-mono: Roboto Mono, ui-monospace, monospace;
    --bg: #000;
    --fg: #fff;
    --primary: #ffce4a;
    --secondary: #00d8dd;
    --ok: #72d35b;
    --warn: #ff9925;
    --err: #fa3823;
    --surface-1: #18181b;
    --surface-2: #27272a;
    --surface-3: #3f3f46;
    --surface-4: #52525b;
    --divider: rgba(255, 255, 255, .15);
    --radius: 6px;
    --body-max-width: 64rem;
    color-scheme: dark;
    accent-color: var(--secondary);
}

* {
    box-sizing: border-box;
}

html {
    font-family: var(--font-sans);
    color: var(--fg);
    background: var(--bg);
    line-height: 1.5;
}

body {
    margin: 0 auto;
    padding: 1.5rem;
    max-width: var(--body-max-width);
}

h1, h2, h3 {
    font-weight: 550;
    margin: 1.5rem 0 .75rem;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }

a {
    color: var(--secondary);
    font-weight: 550;
    text-decoration: none;
}

button, input, select, textarea {
    font: inherit;
    font-size: .9375rem;
    color: var(--fg);
    border-radius: var(--radius);
}

button {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-weight: 550;
    height: 2.25rem;
    padding: 0 .75rem;
    background: 0 0;
    border: 1px solid var(--surface-4);
    cursor: pointer;
    transition: .15s;
}

button[hidden] {
    display: none;
}

button:hover {
    background: var(--surface-2);
}

button:active {
    background: var(--surface-3);
}

button[type=submit], .btn-primary {
    background: var(--primary);
    border-color: transparent;
    color: #000;
}

button[type=submit]:hover, .btn-primary:hover {
    background: var(--primary);
    filter: brightness(.88);
}

input, select, textarea {
    background: var(--surface-2);
    border: 1px solid var(--surface-4);
    padding: .5rem .75rem;
    width: 100%;
}

/* Text inputs and selects are as tall as buttons, so a control row lines up. Textareas size to
   their rows; checkboxes and radios keep their own size. */
input:not([type="checkbox"]):not([type="radio"]), select {
    height: 2.25rem;
    padding-top: 0;
    padding-bottom: 0;
}

select {
    appearance: none;
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2352525b' stroke-width='2'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .75rem center;
}

input:focus, select:focus, textarea:focus, button:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 2px;
}

label {
    display: block;
    font-size: .875rem;
    font-weight: 550;
    margin-bottom: .25rem;
}

.required-mark {
    color: var(--warn);
}

/* Visually hidden but still announced by screen readers — used where a control already has a
   visible section label (e.g. the date input under "Access Duration") and a second visible
   <label> would just duplicate it. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

label small {
    font-weight: 400;
    opacity: .65;
}

/* A fieldset is just a field with several controls: no box, and its legend reads like a label. */
fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

legend {
    font-weight: 550;
    font-size: .875rem;
    padding: 0;
    margin-bottom: .25rem;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    font-size: .8125rem;
}

th {
    background: var(--surface-2);
    font-weight: 550;
    padding: .5rem .75rem;
    text-align: left;
}

th:first-child { border-radius: var(--radius) 0 0 0; }
th:last-child { border-radius: 0 var(--radius) 0 0; }

td {
    background: var(--surface-2);
    padding: .5rem .75rem;
    vertical-align: top;
}

tr:hover td {
    background: var(--surface-3);
}

tr:last-child td:first-child { border-radius: 0 0 0 var(--radius); }
tr:last-child td:last-child { border-radius: 0 0 var(--radius) 0; }

tr.highlighted-row td {
    background: rgba(255, 206, 74, .18);
    box-shadow: inset 3px 0 0 0 var(--primary);
}

small {
    font-size: .8125rem;
    opacity: .65;
    display: block;
    margin-top: .25rem;
}

small[hidden] {
    display: none;
}

/* Shares the hint slot with the date hint (see .expiry-row): only visibility toggles, via the
   "visible" class app.js adds/removes, so nothing below it ever shifts. */
#expiry-blocked-hint {
    visibility: hidden;
}

#expiry-blocked-hint.visible {
    visibility: visible;
}

[role=alert] {
    color: var(--err);
    font-size: .875rem;
}

[role=alert].ok {
    color: var(--ok);
}

header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--divider);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    /* the h1's own margin, hoisted here so the header keeps its pre-logo height
       while the logo centres on the title text rather than on its margin box */
    margin: 1.5rem 0 .75rem;
}

.brand h1 {
    margin: 0;
}

.brand img {
    border-radius: 6px;
}

#identity-bar {
    display: flex;
    gap: .5rem;
    align-items: flex-end;
}

#identity-bar a {
    white-space: nowrap;   /* "Log out" must not wrap onto two lines on a phone */
}

#identity-bar input {
    width: 14rem;
}

#tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

#tabs[hidden] {
    display: none;
}

.tab-button[aria-current=page] {
    background: var(--primary);
    color: #000;
    border-color: transparent;
}

/* ==========================================================================
   Shared form building blocks. A control row (.filter-bar) is made of fields
   (.field = label above its control); hint text is the plain <small>.
   Manage Requests, My Requests and Export Data all use these, so they cannot
   drift apart.
   ========================================================================== */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;   /* buttons in the row (Refresh) sit on the controls' baseline */
    gap: 1rem 1.5rem;
    margin-bottom: 1rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    min-width: 0;
}

/* Direct children only: .multiselect-option and .segmented-option are also <label>s and must
   keep their own styling. */
.field > label {
    margin: 0;
}

.field input[type="date"] {
    width: auto;
}

/* A table wider than its container scrolls inside this box instead of making the page scroll. */
.table-scroll {
    overflow-x: auto;
}

/* ==========================================================================
   Status filter — a closed-by-default dropdown supporting multiple checked
   values, styled to look like the plain <select> it replaces. Manage
   Requests' #filters row and Export Data's toolbar both embed one
   (#filter-status / #export-status); initMultiselect() in app.js wires the
   open/close/summary-label behavior.
   ========================================================================== */

.multiselect {
    position: relative;
}

.multiselect-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    width: 100%;
    min-width: 12rem;
    height: 2.25rem;
    padding: 0 .75rem;
    background: var(--surface-2);
    border: 1px solid var(--surface-4);
    border-radius: var(--radius);
    color: var(--fg);
    font-weight: 400;
    text-align: left;
}

.multiselect-toggle::after {
    content: "";
    flex-shrink: 0;
    width: .5rem;
    height: .5rem;
    border-right: 2px solid var(--surface-4);
    border-bottom: 2px solid var(--surface-4);
    transform: rotate(45deg) translateY(-2px);
}

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

.multiselect-toggle[aria-expanded="true"]::after {
    transform: rotate(-135deg) translateY(-1px);
}

.multiselect-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 10;
    min-width: 100%;
    width: max-content;
    max-width: 22rem;
    max-height: 16rem;
    overflow-y: auto;
    background: var(--surface-1);
    border: 1px solid var(--surface-4);
    border-radius: var(--radius);
    padding: .375rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}

.multiselect-panel[hidden] {
    display: none;
}

.multiselect-option {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .4375rem .5rem;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    font-size: .875rem;
}

.multiselect-option:hover {
    background: var(--surface-2);
}

.multiselect-option input[type="checkbox"],
.multiselect-option input[type="radio"] {
    width: auto;
    margin: 0;
}

.multiselect-option[hidden] {
    display: none;
}

/* Only present on the Application panels (#filter-application/#export-application) — Status's
   fixed 8-value list doesn't need one. Sticky so it stays reachable while a long, scrolled
   catalog list is open, rather than scrolling away with the options beneath it. */
.multiselect-search {
    position: sticky;
    top: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 2rem;
    margin: 0 0 .375rem;
    padding: 0 .5rem;
    background: var(--surface-1);
    border: 1px solid var(--surface-4);
    border-radius: calc(var(--radius) - 2px);
    color: var(--fg);
    font-size: .875rem;
}

/* "All" clears every checked box in the panel — a quick way back to the unfiltered state
   without unchecking items one at a time. Sits above a divider, above the checkbox list. */
.multiselect-all {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 0 .375rem;
    padding: .4375rem .5rem;
    border: none;
    border-bottom: 1px solid var(--divider);
    border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
    background: 0 0;
    color: var(--fg);
    font-size: .875rem;
    font-weight: 550;
    text-align: left;
    cursor: pointer;
}

.multiselect-all:hover {
    background: var(--surface-2);
}

.multiselect-all.is-active {
    color: var(--primary);
}

/* The free-text fallback revealed under #application-select when "Other / not listed" is picked
   (issue #21) — margin-top keeps it from butting directly against the dropdown toggle above,
   which otherwise reads as one merged control instead of two stacked fields. */
#application-other-container {
    margin-top: .25rem;
}

/* ==========================================================================
   Segmented Control Switch (Used for Duration & Date Presets)
   ========================================================================== */

/* Submit Request: groups (.field) stacked with one even gap, instead of loose labels, controls and
   hints each spaced by whatever margin they happened to carry. */
#submit-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.field > small {
    margin-top: 0;
}

/* Access Duration: the toggle and its date picker side by side; one hint slot beneath spans both.
   The date hint and the blocked hint occupy that same cell, and the blocked one wins while shown. */
.expiry-row {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);   /* the empty third column lets the hint use the full row */
    align-items: center;
    gap: .25rem .75rem;
}

#expires-at-container {
    display: contents;
}

#expires-at-container[hidden] {
    display: none;
}

#expires-at {
    width: auto;
}

/* width:0 + min-width:100% lets the hint fill the two columns without widening them: a long spanning
   hint would otherwise stretch the first column and push the date picker away from the toggle. */
#expiry-date-hint,
#expiry-blocked-hint {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 0;
    min-width: 100%;
    margin-top: 0;
}

.expiry-row:has(#expiry-blocked-hint.visible) #expiry-date-hint {
    visibility: hidden;
}

@media (max-width: 600px) {
    .expiry-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .expiry-row > .segmented-control,
    #expires-at {
        grid-column: 1;
    }

    #expiry-date-hint,
    #expiry-blocked-hint {
        grid-row: auto;
        width: auto;
    }
}

/* The form's action sits on the right, as on Export Data, with the "* required" key beside it
   (not stranded on the far side of the page). */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.25rem;
}

.form-actions small {
    margin-top: 0;
}

.segmented-control {
    display: inline-flex;
    align-items: center;
    height: 2.25rem;   /* same height as buttons and inputs, on Submit and Export alike */
    background: var(--surface-2);
    border: 1px solid var(--surface-4);
    padding: 3px;
    border-radius: var(--radius);
    gap: 3px;
    width: max-content;
}

.segmented-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.segmented-option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .375rem .875rem;
    font-size: .875rem;
    font-weight: 550;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    color: var(--fg);
    transition: background .15s ease, color .15s ease;
    user-select: none;
    white-space: nowrap;
}

.segmented-option:hover span {
    background: var(--surface-3);
}

.segmented-option input[type="radio"]:checked + span {
    background: var(--primary);
    color: #000;
}

.segmented-option:has(input[type="radio"]:disabled) {
    cursor: not-allowed;
}

.segmented-option input[type="radio"]:disabled + span {
    opacity: 0.35;
    color: var(--surface-4);
    background: transparent;
    pointer-events: none;
}

/* ==========================================================================
   Export Toolbar — a bordered frame with the filter options on top and the
   export action on its own row below, so the taller Date Range column (it
   carries the date-range inputs under the presets) never shifts the button
   sideways.
   ========================================================================== */

/* Export controls: Application and Status over the first row, Date Range (presets + dates) spanning
   both rows in the middle, and on the second row the option under the dropdowns, one date-input high
   so it shares a line with the date inputs. The action gets a row of its own beneath, at the right edge. */
.export-grid {
    display: grid;
    grid-template-columns: 12rem 12rem auto minmax(0, 1fr);
    column-gap: 1.5rem;
    margin-bottom: 1rem;
}

.export-grid > .field:nth-child(3) {
    grid-column: 3;
    grid-row: 1 / span 2;
}

.export-grid .export-include-notes {
    grid-column: 1 / 3;
    grid-row: 2;
    align-self: end;
}

.export-grid #export-csv {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: end;   /* its own row, on the page's right edge */
    margin-top: 1rem;
}

@media (max-width: 860px) {
    .export-grid {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 1rem;
    }

    .export-grid > .field:nth-child(3),
    .export-grid .export-include-notes,
    .export-grid #export-csv {
        grid-column: 1;
        grid-row: auto;
    }

    .export-grid #export-csv {
        justify-self: end;
    }
}

/* Date Range is one block: the presets stretch to exactly the width of the two date inputs beneath
   them (the inputs, not the presets, set the width), so their left and right edges line up. */
.export-grid .segmented-control {
    display: flex;
    width: auto;
}

.export-grid .segmented-option {
    flex: 1;
}

.export-grid .segmented-option span {
    width: 100%;
}

.date-input-pair {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.date-input-pair input {
    flex: 1;
    min-width: 0;
}

.date-sep {
    opacity: .65;
    font-size: 0.875rem;
}

#export-date-range {
    margin-top: 0.5rem;
}

/* Fine print, not a headline: smaller, quieter and a readable line length, so it does not compete
   with the controls above it. */
.export-hint {
    max-width: 42rem;
    font-size: .75rem;
    opacity: .55;
}

.export-include-notes {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.25rem;
    margin: 0;
    white-space: nowrap;
    cursor: pointer;
}

/* The global `input { width: 100%; padding: .5rem .75rem }` rule would stretch a bare checkbox to
   a text-field width and push its label away. */
.export-include-notes input {
    width: auto;
    padding: 0;
    margin: 0;
    flex: none;
}

/* ==========================================================================
   Admin & Modal Controls
   ========================================================================== */

/* A page heading with its page-level actions on the right (Catalog & Okta sync's "Check Okta
   reviewers" and "Check Okta catalogue"); the actions wrap under the heading on a narrow screen. */
.heading-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;   /* the heading keeps its usual position, whatever the button's height */
    justify-content: space-between;
    gap: 0 1rem;
    /* the h2's own margin, hoisted here: inside a flex row it would not collapse with the tab
       bar's margin the way a plain h2's does, and the heading would sit lower than on other tabs */
    margin: 1.5rem 0 .75rem;
}

.heading-bar h2 {
    margin: 0;
}

/* The 36px button is 6px taller than the 30px heading line; pull it 3px up and 3px down so the
   two share a centre and the bar is exactly as tall as a plain heading, leaving the content below
   at the same height as on every other tab. */
.heading-bar button {
    margin-block: -.1875rem;
}

/* The heading's actions (Check Okta reviewers / Check Okta catalogue) stay together, and wrap together. */
.heading-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
}

/* Result of the last Okta check: full width under the heading, line breaks kept (set in app.js).
   The reviewer roster's status reads the same way. */
#okta-sync-status,
#reviewer-roster-status {
    margin: 0 0 1rem;
    font-size: .875rem;
    opacity: .75;
    overflow-wrap: anywhere;
}

#catalog-manage-controls {
    margin-bottom: 1rem;
}

#catalog-manage-controls table {
    margin-top: .75rem;
    table-layout: fixed;
}

/* Fixed column widths so rows line up whatever the data: name gets the slack, the rest are sized
   to their controls. Controls fill their cell instead of each picking its own width. */
#catalog-manage-controls th:nth-child(2) { width: 15rem; }
#catalog-manage-controls th:nth-child(3) { width: 30%; }
#catalog-manage-controls th:nth-child(4) { width: 10rem; }

#catalog-manage-controls td {
    vertical-align: middle;
    overflow-wrap: anywhere;
}

#catalog-manage-controls td select, #catalog-manage-controls td input {
    width: 100%;
}

/* On a phone each row becomes a stacked block: name, then its two controls with their column
   heading as a label (data-label, set in renderCatalogManageTable()), then the buttons. */
@media (max-width: 720px) {
    #catalog-manage-controls table,
    #catalog-manage-controls tbody,
    #catalog-manage-controls tr,
    #catalog-manage-controls td {
        display: block;
        width: auto;
    }

    #catalog-manage-controls thead {
        display: none;
    }

    #catalog-manage-controls tr {
        margin-bottom: .5rem;
    }

    #catalog-manage-controls td {
        margin-bottom: 2px;
    }

    #catalog-manage-controls td[data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: .25rem;
        font-size: .875rem;
        font-weight: 550;
    }
}

/* Add-application form: a label above each of three fields, the button on a row of its own, the
   hint underneath. Collapses to one column on a narrow screen. */
#catalog-add-form {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) minmax(0, 2fr);
    gap: .75rem 1rem;
    align-items: end;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--divider);
}

#catalog-add-form h3 {
    grid-column: 1 / -1;
    margin: 0;
    font-size: .9375rem;
}

#catalog-add-form .field {
    min-width: 0;
}

#catalog-add-form label {
    margin-bottom: .25rem;
}

#catalog-add-form input, #catalog-add-form select {
    width: 100%;
}

/* Add application gets a row of its own, on the right like the other forms' actions. */
#catalog-add-form button[type="submit"] {
    grid-column: 1 / -1;
    justify-self: end;
}

#catalog-add-form .form-hint {
    grid-column: 1 / -1;
    margin-top: 0;
}

@media (max-width: 720px) {
    #catalog-add-form {
        grid-template-columns: 1fr;
    }
}

#entitlements-list {
    margin-top: .5rem;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

#entitlements-list label {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-weight: 400;
    margin: 0;
}

#entitlements-list input {
    width: auto;
}

.badge {
    display: inline-block;
    padding: .125rem .5rem;
    border-radius: 1rem;
    font-size: .75rem;
    font-weight: 600;
}

.badge-pending { background: var(--warn); color: #000; } /* catalog's "Needs review" badge */
.badge-denied { background: var(--err); color: #fff; }
.badge-none { background: var(--surface-4); }
.badge-revoked { background: var(--err); color: #fff; }
.badge-yes { background: var(--ok); color: #000; }
.badge-no { background: var(--surface-4); }

/* Lifecycle badge (lifecycleBadge() in app.js) — one label folding status, provisioning, and
   expiry-vs-now into where a request actually stands. Colors track urgency: grey (no decision
   yet), amber (an action is waiting on someone), green (settled, nothing pending), teal (settled
   but on a clock), red (needs attention now or is a terminal negative outcome). */
.badge-new { background: var(--surface-4); }
.badge-needs-customer-signoff { background: var(--warn); color: #000; }
.badge-approved-not-granted { background: var(--warn); color: #000; }
.badge-active { background: var(--ok); color: #000; }
.badge-pending-expiry { background: var(--secondary); color: #000; }
.badge-expired-not-revoked { background: var(--err); color: #fff; }
.badge-extension-requested { background: var(--secondary); color: #000; } /* Waiting for a reviewer */

/* The <td> stays a real table cell (so its background fills the row); the buttons flow in an
   inner .actions row that wraps to the column width. */
#requests-body td.row-actions {
    width: 15rem;
}

.row-actions .actions {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem;
}

/* Emails stay on one line and make the column as wide as they need; the application line below
   them may wrap anywhere. */
#requests-body td:first-child {
    min-width: 13rem;
}

/* Wide enough that the lifecycle badges ("Needs Customer Sign-off") stay on one line. Both
   request tables (Manage Requests and My Requests) share this column layout. */
.requests-table td:nth-child(3) {
    min-width: 12rem;
}

/* Two-line cells: a primary line and muted detail lines beneath it. */
.cell-primary {
    font-weight: 550;
    overflow-wrap: break-word;
}

.cell-sub {
    margin-top: .25rem;
    font-size: .75rem;
    opacity: .75;
    overflow-wrap: anywhere;
}

/* The reason is free text and can be one unbroken string (a bare URL, a pasted token): cap its
   column and let it wrap anywhere. It is never truncated (FR-016). */
.requests-table td:nth-child(2) {
    max-width: 24rem;
}

.cell-reason {
    overflow-wrap: anywhere;
}

.cell-label {
    opacity: .75;
}

.row-actions button {
    height: 1.875rem;
    font-size: .8125rem;
    white-space: nowrap;
}

dialog {
    background: var(--surface-1);
    color: var(--fg);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 28rem;
    width: calc(100% - 3rem);
}

dialog::backdrop {
    background: rgba(0,0,0,.5);
}

dialog h3 {
    margin-top: 0;
}

/* The plain-text intro above a dialog's fields, and a checkbox row (box, then its label). */
.dialog-intro {
    margin: 0 0 1rem;
    opacity: .85;
    overflow-wrap: anywhere;
}

#action-dialog-fields input[type="checkbox"] {
    width: auto;
    margin-right: .5rem;
}

.dialog-checkbox-label {
    display: inline;
}

/* The dev login's checkbox sits in its label, so the global `input { width: 100% }` rule would
   stretch it across the form and centre the box above its text. */
#dev-login-form label input[type="checkbox"] {
    width: auto;
    margin: 0 .5rem 0 0;
}

.checkbox-filter {
    display: flex;
    align-items: center;
    gap: .5rem;
    height: 100%;
    white-space: nowrap;
}

/* The global input rule makes every input 100% wide; in a flex row Safari then shrinks the checkbox
   to nothing, where Chromium keeps its own size. */
.filter-count {
    opacity: .75;
}

.checkbox-filter input[type="checkbox"] {
    width: auto;
    flex: none;
    margin: 0;
}

#action-dialog-buttons {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

#history-dialog {
    max-width: 36rem;
}

#history-dialog-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

#history-dialog-list li {
    border-top: 1px solid var(--divider);
    padding: .75rem 0;
}

#history-dialog-list li:first-child {
    border-top: none;
    padding-top: 0;
}

.history-heading {
    font-weight: 550;
}

#history-dialog-close {
    margin-top: 1rem;
}