/*
 * Jump Story module styles.
 *
 * These rules sit on top of styles.css and settingsStyle.css. The component
 * classes are the tech-log ones, so the area is built from parts the team
 * already maintains rather than a second set that has to be kept in step.
 *
 * What IS different is the accent. Jump Story is its own area, and it should be
 * obvious at a glance that you are not in the tech log any more. That is done
 * by overriding three existing custom properties on the area root, so every
 * primary button, active tab and dot control picks the new colour up on its
 * own. There is no second set of button rules to maintain.
 *
 * Status colour is never the only signal. Every state chip and badge carries a
 * word and a character icon as well, so it reads correctly in monochrome, to a
 * colour blind reader, and to a screen reader. Red is reserved for a life limit
 * that has been reached.
 *
 * Everything is responsive from phone width upward. Tables scroll inside their
 * own container so the page body never scrolls sideways.
 */

/* ── The Jump Story accent ──────────────────────────────────────────── */

/*
 * Lime, set on the area root only.
 *
 * .btn-primary, .settings-tab-link.active and .users-dot-filter .dot all read
 * the --color-primary-* properties already, so recolouring the area is a
 * handful of declarations rather than a parallel stylesheet. Nothing outside
 * the area is touched, and a user's chosen palette still supplies every other
 * colour.
 *
 * The accent comes in two weights, and which one to use depends on whether it
 * is a fill or a piece of text:
 *
 *   --js-accent       #a7cc00, the brand lime. Fills only: buttons, dots, the
 *                     area badge. It is a light colour, so text sitting ON it
 *                     must be --js-accent-ink, never white. White on this lime
 *                     measures 1.9:1, which is unreadable in sunlight and fails
 *                     WCAG outright.
 *   --js-accent-text  #5c7300, the same hue taken darker. Used when the accent
 *                     IS the text, such as an active tab label or a dashboard
 *                     figure. Measures 5.4:1 on white, so it passes AA.
 *
 * A drop zone is an outdoor workplace and this gets read on a phone in bright
 * sun, so the contrast is not a formality.
 */
.js-area {
    /* The "Move to Flight Story" link, in the same grey as the tech log's
       "Move to Jump Story" link, so the two bars match. */
    --js-switch-link-ink: #6b7280;
    /* The top bar, in the tech log bar's own colours, so the two products
       look like one application when you move between them. */
    --js-bar-bg: #f4f6f8;
    --js-bar-line: #cccccc;
    --js-bar-ink: #6b7280;
    --js-bar-button-ink: #1e293b;
    --js-bar-button-bg: #ffffff;
    --js-bar-button-line: #d1d5db;
    --js-bar-menu-ink: #1a3a50;
    --js-bar-menu-bg: #e8f0f5;
    --js-bar-menu-line: #a0bece;
    --js-bar-dot-off: #e5e7eb;
    --js-bar-dot-on: #0080b8;
    --js-bar-dot-glow: 0 0 6px 2px rgba(0, 128, 184, 0.5);
    --color-primary-bg: #a7cc00;
    --color-primary-text: #1b2a00;
    --color-primary-border: #8aab00;

    /* Used by the area's own furniture below. */
    --js-accent: #a7cc00;
    --js-accent-strong: #8aab00;
    --js-accent-ink: #1b2a00;
    --js-accent-text: #5c7300;
    --js-accent-soft: #f2f8d9;
    --js-accent-soft-ink: #1b2a00;
    /* Text on a solid danger fill. The fill is deep in this theme and light in
       the dark one, so what reads on it swaps over. */
    --js-on-danger: #ffffff;
    --js-navy: #0b2a4a;
    --js-navy-soft: #eaf1f8;
    /* Equipment value reports: one fill per part, so the columns about the
       container, the canopy and the AAD read as three blocks. */
    --js-report-container-tint: #eaf1f8;
    --js-report-canopy-tint: #eef5e2;
    --js-report-reserve-tint: #fbf1e2;
    --js-report-aad-tint: #f1edf9;

    /*
     * The surfaces, the ink and the lines, in one place.
     *
     * Everything structural in this file reads these rather than naming a
     * colour, which is what lets the whole area turn dark by redefining eight
     * values. A status colour is not structural and is not here: a chip that
     * means "life limit reached" keeps its own pair below.
     */
    --js-page: #f4f6f8;
    --js-surface: #ffffff;
    --js-surface-sunken: #f6f8f9;
    --js-ink: #1f2d3d;
    --js-ink-soft: #53606c;
    --js-ink-muted: #7b8692;
    --js-line: #dce2e7;
    --js-line-soft: #eef1f4;
    --js-shadow: rgba(15, 23, 42, 0.16);

    /* The application's border, pointed at the area's own line, so a shared
       component and a Jump Story row draw the same hairline. Without it the
       device rows and the rig rows were a shade apart in the light theme. */
    --color-border: var(--js-line);
    --color-border-light: var(--js-line-soft);
    /* The area mark. Two files rather than a filter: the mark is black
       silhouettes AND a blue trail with a blue pin, and any filter that turns
       the black white takes the blue with it. The dark file is the same
       drawing with the silhouettes whitened and the blue left exactly as it
       was. */
    --js-logo-source: url('/images/jumpStoryNoLettersLight.png?v=2');

    /* Status pairs. A fill and the ink that has to stay readable on it. */
    --js-ok-bg: #eaf7f1;
    /* A gentle light from above on a raised label (the set tab). */
    --js-sheen: rgba(255, 255, 255, 0.55);
    --js-sheen-edge: rgba(255, 255, 255, 0.6);
    /* Deep enough to stay readable on its own tint as well as on white: the
       same ink now carries the meter chips, which sit on a stronger fill. */
    --js-ok-ink: #14684a;
    --js-warning-bg: #fff4e2;
    --js-warning-ink: #8a5602;
    --js-critical-bg: #fdeaec;
    --js-critical-ink: #ab1f2c;
    --js-info-bg: #e8f1fd;
    --js-info-ink: #1f5cab;
    --js-violet-bg: #f3eefb;
    --js-violet-ink: #62509b;
    --js-quiet-bg: #eef1f5;
    --js-quiet-ink: #5a6472;

    /* Shared app tokens must follow Jump Story light surfaces.
       styles.css dark palettes (phpstorm_classic / phpstorm_teal) set
       --color-surface and --color-text on <body>; without this remap,
       data-js-theme="light" still leaves charcoal panels and pale ink
       from the palette, which is the broken half-light look. */
    --color-text: var(--js-ink);
    --color-text-secondary: var(--js-ink-muted);
    --color-border: var(--js-line);
    --color-border-light: var(--js-line-soft);
    --color-surface: var(--js-surface);
    /* Inputs follow the area's surface, not the application palette, which
       paints them dark navy under the dark palettes. */
    --color-input-bg: var(--js-surface);
    --color-bg-subtle: var(--js-surface-sunken);
    --color-hover: rgba(15, 23, 42, 0.04);
    --color-link: var(--js-navy);
    --color-th-bg: var(--js-surface-sunken);
    --color-th-text: var(--js-ink);
    --color-th-border: var(--js-line);
    --color-neutral-bg: var(--js-quiet-bg);
    --color-neutral-text: var(--js-quiet-ink);
    --color-neutral-border: var(--js-line);
    --color-outline-bg: transparent;
    --color-outline-text: var(--js-ink);
    --color-outline-border: var(--js-line);
}

/*
 * Jump Story's own dark mode.
 *
 * One theme, not a palette: the area has a switch in its top bar and the
 * choice is remembered in the browser. It applies here, and in the two dark
 * application palettes, where the light surfaces were unreadable anyway. An
 * explicit choice of light wins over the palette, so somebody on a dark
 * palette can still read Jump Story the pale way if that is what they want.
 *
 * Only tokens are redefined. Every hover, fill and border rule in this file is
 * written once and works in both themes, so there is no second set of
 * component rules that can drift.
 */
[data-js-theme="dark"] .js-area,
html:not([data-js-theme="light"]) [data-palette="phpstorm_classic"].js-area,
html:not([data-js-theme="light"]) [data-palette="phpstorm_teal"].js-area {
    --js-switch-link-ink: #b8c4dc;
    --js-bar-bg: #1a1d2a;
    --js-bar-line: #4a5470;
    --js-bar-ink: #b8c4dc;
    --js-bar-button-ink: #b8c4dc;
    --js-bar-button-bg: transparent;
    --js-bar-button-line: #82aaff;
    --js-bar-menu-ink: #c8d0ea;
    --js-bar-menu-bg: #2d3250;
    --js-bar-menu-line: #5a6288;
    --js-bar-dot-off: #4a5470;
    --js-bar-dot-on: #4d7ae0;
    --js-bar-dot-glow: 0 0 8px 2px rgba(77, 122, 224, 0.6);
    /* Not black. A dark grey-blue holds a shadow and keeps white text off the
       hard edge of maximum contrast, which is what makes long reading tiring. */
    --js-page: #14181f;
    --js-surface: #1b2029;
    --js-surface-sunken: #232935;
    --js-ink: #e9edf3;
    --js-ink-soft: #c3cbd8;
    --js-ink-muted: #949fb0;
    --js-line: #333c4a;
    --js-line-soft: #2a313d;
    --js-shadow: rgba(0, 0, 0, 0.5);
    --js-logo-source: url('/images/jumpStoryNoLettersDark.png?v=2');

    /* Chart furniture: Y-grid must stay behind the series on a dark panel.
       Light #eef1f4 reads as bright chalk lines here. */
    --js-chart-grid: rgba(233, 237, 243, 0.07);
    --js-chart-baseline: rgba(233, 237, 243, 0.14);
    /* Axis tick ink: series colours lightened for dark surfaces. */
    --js-chart-altitude-ink: #93c5fd;
    --js-chart-rate-ink: #fbbf24;
    --js-chart-gload: #a7cc00;
    --js-chart-gload-ink: #c5e85a;
    /* Turn figures: their own calm ink, never the red an exceedance uses. */
    --js-chart-turn-ink: #c4b5fd;

    /* Chart details tooltip - dark panel / light ink in dark theme. */
    --js-chart-tooltip-bg: #26303c;
    --js-chart-tooltip-ink: #f4f7fb;
    --js-chart-tooltip-muted: #aab6c4;
    --js-chart-tooltip-border: #3a4656;
    --js-chart-tooltip-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    --js-chart-tooltip-divider: rgba(255, 255, 255, 0.14);
    --js-chart-tooltip-breach: #ff8f99;

    /* What the browser itself draws: the date picker, the number spinner, the
       scrollbars, the caret. */
    color-scheme: dark;

    /* A severity colour is read as text as well as drawn as a shape, and the
       deep red and the violet are both too dark to read on this surface. */
    --js-severity-critical: #ff7a86;
    --js-severity-error: #a98ae0;

    /* The lime reads as text only in its bright form on a dark surface. */
    --js-accent-text: #b8e000;
    --js-accent-soft: rgba(167, 204, 0, 0.16);
    --js-accent-soft-ink: var(--js-ink);
    --js-on-danger: #1b2029;
    --js-navy: #9dc6ea;
    --js-navy-soft: rgba(157, 198, 234, 0.16);
    --js-report-container-tint: rgba(157, 198, 234, 0.12);
    --js-report-canopy-tint: rgba(167, 204, 0, 0.10);
    --js-report-reserve-tint: rgba(230, 170, 90, 0.12);
    --js-report-aad-tint: rgba(169, 138, 224, 0.14);

    /* A pastel fill on a dark page glares and turns every chip into a lamp.
       The fill becomes a tint of its own ink and the ink is lifted to carry
       the meaning, so a chip still reads as the colour it always was. */
    --js-ok-bg: rgba(66, 185, 140, 0.18);
    --js-sheen: rgba(255, 255, 255, 0.09);
    --js-sheen-edge: rgba(255, 255, 255, 0.12);
    --js-ok-ink: #6fe0b4;
    --js-warning-bg: rgba(241, 189, 49, 0.18);
    --js-warning-ink: #f3c563;
    --js-critical-bg: rgba(255, 99, 115, 0.18);
    --js-critical-ink: #ff9aa4;
    --js-info-bg: rgba(94, 160, 255, 0.18);
    --js-info-ink: #8fbcff;
    --js-violet-bg: rgba(155, 122, 224, 0.18);
    --js-violet-ink: #c0a6f2;
    --js-quiet-bg: rgba(255, 255, 255, 0.07);
    --js-quiet-ink: #b6bfcc;

    /* The application's own variables, which the shared components in
       styles.css read: buttons, inputs, the table furniture, the cards. They
       are redefined here so a control that was never written for this area
       still lands in the theme rather than staying white. */
    --color-text: var(--js-ink);
    --color-text-secondary: var(--js-ink-muted);
    --color-border: var(--js-line);
    --color-border-light: var(--js-line-soft);
    --color-surface: var(--js-surface);
    /* Inputs follow the area's surface, not the application palette, which
       paints them dark navy under the dark palettes. */
    --color-input-bg: var(--js-surface);
    --color-bg-subtle: var(--js-surface-sunken);
    --color-hover: rgba(255, 255, 255, 0.06);
    --color-link: #8fbcff;
    --color-primary: #8fbcff;
    --color-th-bg: var(--js-surface-sunken);
    --color-th-text: var(--js-ink);
    --color-th-border: var(--js-line);
    --color-neutral-bg: #2b333f;
    --color-neutral-text: #dde3ec;
    --color-neutral-border: #414c5c;
    --color-outline-bg: transparent;
    --color-outline-text: var(--js-ink);
    --color-outline-border: var(--js-line);
    --color-danger-bg: rgba(255, 99, 115, 0.18);
    --color-danger-text: #ff9aa4;
    --color-danger-border: rgba(255, 99, 115, 0.42);
    --color-danger: #ff8c96;
    --color-pdf-bg: rgba(66, 185, 140, 0.18);
    --color-pdf-text: #6fe0b4;
    --color-pdf-border: rgba(66, 185, 140, 0.42);
    --color-warning: #f3c563;
    --color-info: #6fd3e0;
    --color-success: #6fe0b4;
}

/* Explicit light wins over a dark application palette. Same remaps as the
   base .js-area block; specificity beats [data-palette=…] alone. */
[data-js-theme="light"] .js-area {
    --js-switch-link-ink: #6b7280;
    /* The top bar, in the tech log bar's own colours, so the two products
       look like one application when you move between them. */
    --js-bar-bg: #f4f6f8;
    --js-bar-line: #cccccc;
    --js-bar-ink: #6b7280;
    --js-bar-button-ink: #1e293b;
    --js-bar-button-bg: #ffffff;
    --js-bar-button-line: #d1d5db;
    --js-bar-menu-ink: #1a3a50;
    --js-bar-menu-bg: #e8f0f5;
    --js-bar-menu-line: #a0bece;
    --js-bar-dot-off: #e5e7eb;
    --js-bar-dot-on: #0080b8;
    --js-bar-dot-glow: 0 0 6px 2px rgba(0, 128, 184, 0.5);
    --color-text: var(--js-ink);
    --color-text-secondary: var(--js-ink-muted);
    --color-border: var(--js-line);
    --color-border-light: var(--js-line-soft);
    --color-surface: var(--js-surface);
    /* Inputs follow the area's surface, not the application palette, which
       paints them dark navy under the dark palettes. */
    --color-input-bg: var(--js-surface);
    --color-bg-subtle: var(--js-surface-sunken);
    --color-hover: rgba(15, 23, 42, 0.04);
    --color-link: var(--js-navy);
    --color-th-bg: var(--js-surface-sunken);
    --color-th-text: var(--js-ink);
    --color-th-border: var(--js-line);
    --color-neutral-bg: var(--js-quiet-bg);
    --color-neutral-text: var(--js-quiet-ink);
    --color-neutral-border: var(--js-line);
    --color-outline-bg: transparent;
    --color-outline-text: var(--js-ink);
    --color-outline-border: var(--js-line);
}


/* ── The area shell ─────────────────────────────────────────────────── */

/*
 * The page itself, and the bar across the top of it. Both are painted by
 * styles.css in one fixed grey, which is the right grey for the tech log and
 * a hole in the page once Jump Story goes dark. Written with the tokens, so
 * the rule is the same rule in both themes.
 */
.js-area {
    background-color: var(--js-page);
    color: var(--js-ink);
}

.js-area .topbar {
    background: var(--js-bar-bg);
    border-bottom-color: var(--js-bar-line);
}

/* Name, Logout and the dark switch in the tech log bar's colours and weight.
   The dark palettes colour these with !important in styles.css, so they are
   answered with the same weight here. */
.js-area .topbar .topbar-user,
.js-area .topbar .js-theme-switch {
    color: var(--js-bar-ink) !important;
}
.js-area .topbar .js-theme-switch { font-weight: 400; }
.js-area .topbar .logout-link {
    color: var(--js-bar-button-ink) !important;
    background: var(--js-bar-button-bg) !important;
    border-color: var(--js-bar-button-line) !important;
}

/* Dashboard, Settings, Jump Log, Rig Log and Reports in the tech log bar's
   menu colours. The page you are on keeps the area's lime. */
.js-area .topbar .topbar-dropdown-btn:not(.nav-active) {
    color: var(--js-bar-menu-ink) !important;
    background: var(--js-bar-menu-bg) !important;
    border-color: var(--js-bar-menu-line) !important;
}

/* The dark switch's dot, off and on, as the tech log bar draws its own. */
.js-area .topbar .js-theme-switch .dot {
    background: var(--js-bar-dot-off) !important;
    box-shadow: none !important;
}
.js-area .topbar .js-theme-switch .js-theme-switch-input:checked ~ .dot {
    background: var(--js-bar-dot-on) !important;
    box-shadow: var(--js-bar-dot-glow) !important;
}

/*
 * Headings and links, which the application stylesheet paints in fixed values:
 * h2 and h3 are #333 there, and a plain link is left to the browser, which
 * draws it in its own blue. Both are readable on white and neither is readable
 * on a dark surface, so inside this area they follow the theme. A link that is
 * dressed as a button keeps the button's own text colour.
 */
.js-area h1,
.js-area h2,
.js-area h3,
.js-area h4,
.js-area legend {
    color: var(--js-ink);
}

/* :where() so this settles the colour of an ordinary link and nothing else:
   it adds no specificity, so every control that is an anchor with a colour of
   its own - a tab, a menu item, a clickable row - still wins. */
.js-area :where(a:not(.btn)) {
    color: var(--color-link);
}

/*
 * The Settings and Reports dropdowns in the bar. They are the shared menus
 * from styles.css, which paints them white with slate text and has no idea
 * this area can be dark. The panel is given the same surface, border and
 * shadow as the row action menu, so the two menus on a page are one thing.
 *
 * The colour is restated here because these items are links, and the rule
 * above hands an ordinary link the link colour.
 */
.js-area .settingsList,
.js-area .reportsList {
    background: var(--js-surface);
    border-color: var(--js-line);
    box-shadow: 0 8px 24px var(--js-shadow);
}

.js-area .settingsItem,
.js-area .reportsItem {
    color: var(--js-ink);
}

.js-area .settingsItem:hover,
.js-area .settingsItem:focus-visible,
.js-area .reportsItem:hover,
.js-area .reportsItem:focus-visible {
    background: var(--js-surface-sunken);
    color: var(--js-accent-text);
}

/*
 * Form controls. .form-field input and select already read the application's
 * variables, but a textarea has no rule anywhere in the three stylesheets and
 * a plain input outside .form-field has none either, so both were left white.
 * Stated once, for every control the area uses.
 *
 * border-color alone is not enough: the browser keeps its native inset border
 * and square corners, which is the old sunken box. Match .form-field: a soft
 * rounded fill with a single flat stroke.
 */
.js-area textarea,
.js-area input:not([type="checkbox"]):not([type="radio"]),
.js-area select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: var(--color-bg-subtle);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-input, 8px);
    box-shadow: none;
}

.js-area select {
    /* Keep a chevron space; appearance:none strips the native arrow. */
    background-image: linear-gradient(45deg, transparent 50%, var(--js-ink-muted) 50%),
                      linear-gradient(135deg, var(--js-ink-muted) 50%, transparent 50%);
    background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 28px;
}

.js-area ::placeholder {
    color: var(--js-ink-muted);
    opacity: 1;
}

/* ── The dark mode switch ───────────────────────────────────────────── */

/*
 * The application's dot control (.users-dot-filter in settingsStyle.css), so
 * it reads like every other on/off choice. It stays a real checkbox: it is in
 * the tab order, it is operated with the space bar, and a screen reader calls
 * it what it is. The shared rule hides the box with display: none, which would
 * take it out of the tab order, so here it is only moved out of sight.
 */
.js-theme-switch {
    position: relative;
    padding: 4px 6px;
}

.js-theme-switch.users-dot-filter .js-theme-switch-input {
    display: block !important;
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* The focus ring goes on the part somebody can see, because the box that has
   the focus is the one that was moved out of sight. */
.js-theme-switch-input:focus-visible ~ .dot {
    outline: 2px solid var(--color-primary-border, #0080b8);
    outline-offset: 2px;
}


/* Was an inline style on each divider. Inline styles are not allowed, so the
   alignment lives here instead. */
.js-area .topbar-divider {
    align-self: center;
}

/*
 * The area mark. It sits directly left of the JUMP STORY name and is decorative
 * only, so the name carries the meaning and the image needs no alt text. The
 * .brand-mark frame in styles.css sizes and crops it.
 */
.js-area-logo {
    /* Replaces what the img element loaded. The src in the markup stays the
       light file, so the mark is still there if this stylesheet is not. */
    content: var(--js-logo-source);
}

/* The active navigation button is filled with the area's lime, and styles.css
   writes white on it, which measures 2.7:1 and is the one combination the
   accent note at the top of this file warns against. The dark ink is the same
   one the area badge uses. The !important is answering an !important: the
   shared rule sets white that way, and the only thing that can reach it is a
   declaration of the same weight. */
.js-area .topbar-dropdown-btn.nav-active {
    color: var(--js-accent-ink) !important;
}

/* Says which area you are in, next to the way out of it. */
.js-area-name {
    font-weight: 800;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    align-self: center;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--js-accent);
    /* Black, the same ink as the FLIGHT STORY badge. */
    color: #000000;
    white-space: nowrap;
}

/* Settings is a dropdown once you are inside the area, so a Settings page
   names its parent above its own title. */
.js-breadcrumb {
    margin: 0 0 0.15rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

/*
 * The area's typeface.
 *
 * Plus Jakarta Sans, with Nunito Sans and then the system stack behind it, so a
 * blocked or slow font request degrades to something readable rather than to
 * nothing. The font itself is requested by the Jump Story shell, not by the
 * global stylesheet: no tech-log page should pay for a request it does not use.
 *
 * The default weight is light on purpose. This area is mostly dense tables of
 * numbers, and 400 everywhere made every row shout as loudly as its heading.
 * Weight is spent deliberately instead: on headings, on badges, and on the
 * emergency alarm, which sets its own and keeps it.
 */
body.js-area {
    --js-font: "Plus Jakarta Sans", "Nunito Sans", -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, sans-serif;
    font-family: var(--js-font);
    font-weight: 300;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Form controls do not inherit a family on their own. */
.js-area :is(input, select, textarea, button, .btn) {
    font-family: var(--js-font);
}

.js-area :is(h1, h2, h3, h4) { font-weight: 600; letter-spacing: -0.015em; }
.js-area .js-page-title { font-weight: 600; }

/*
 * A status, as a pill.
 *
 * Used for the phase and the outcome on the Jump Log. Both are stored
 * classifications, decided when the jump was ingested; the colour here only
 * shows an answer that already exists and never works one out.
 *
 * Soft tint, dark text. A saturated fill on every row of a long table turns the
 * table into a colour chart, and the point of a badge is that the eye finds the
 * one that is different.
 */
.js-area .js-badge {
    display: inline-flex; align-items: center;
    padding: 3px 9px;
    border: 0;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.005em;
    white-space: nowrap;
}
.js-area .js-badge-ok { background: var(--js-ok-bg); color: var(--js-ok-ink); }
.js-area .js-badge-critical { background: var(--js-critical-bg); color: var(--js-critical-ink); }
.js-area .js-badge-warning { background: var(--js-warning-bg); color: var(--js-warning-ink); }
.js-area .js-badge-live { background: var(--js-info-bg); color: var(--js-info-ink); }
.js-area .js-badge-packer { background: var(--js-violet-bg); color: var(--js-violet-ink); }
.js-area .js-badge-skydiver { background: var(--js-info-bg); color: var(--js-info-ink); }
/* A Dropzone manager runs one site (migration 104). */
.js-area .js-badge-manager { background: var(--js-navy-soft); color: var(--js-navy); }
/* The ordinary answer. Grey, because "nothing happened" must not be decorated
   into something worth looking at. */
.js-area .js-badge-quiet { background: var(--js-quiet-bg); color: var(--js-ink-soft); }
/* Equipment template category: tandem or sport (it sets the jump role). */
.js-area .js-badge-category-tandem { background: var(--js-info-bg); color: var(--js-info-ink); }
.js-area .js-badge-category-sport { background: var(--js-violet-bg); color: var(--js-violet-ink); }
/* Jump type, Jump Log and jump page: same colours as the rig category that sets it. */
.js-area .js-badge-jump-tandem { background: var(--js-info-bg); color: var(--js-info-ink); }
.js-area .js-badge-jump-camera { background: var(--js-violet-bg); color: var(--js-violet-ink); }
/* Not known. Its own colour, never the same as landed: a phase nobody knows
   must not look like a phase somebody does. */
.js-area .js-badge-unknown { background: var(--js-violet-bg); color: var(--js-violet-ink); }
/* A rig the organisation means to sell. Information, not a warning: it still flies. */
.js-area .js-badge-for-sale { background: var(--js-info-bg); color: var(--js-info-ink); }

.js-area .js-person-role-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* ── The action menu ────────────────────────────────────────────────── */

/*
 * One Actions button per row, dropping down everything the row can do.
 *
 * A row used to print every action it had as its own button. Three of them
 * filled the Actions column, pushed the table into a sideways scroll and, on a
 * phone, wrapped into a block taller than the row they belonged to. The column
 * now holds one control whatever the row can do, and a row with a single
 * action keeps that action on the button rather than hiding it behind a menu.
 *
 * Every control in the column is the same width, set by --js-action-width, so
 * the column reads as one straight edge whether the row says Actions or names
 * its one action outright.
 *
 * The panel is a native <details> disclosure, so it opens with no script at
 * all. What the script adds is position: fixed, because the table scrolls
 * inside .js-table-scroll and an absolutely positioned panel is clipped by
 * that container. Until the script says it is running, the panel stays in the
 * flow of the cell, where it is readable rather than cut in half.
 */
.js-area .js-action-menu {
    --js-action-width: 148px;
    display: inline-flex;
    align-items: stretch;
    vertical-align: middle;
}

.js-area .js-action-menu .js-action-menu-form {
    display: inline-flex;
    margin: 0;
}

/* The one action a row has, named on the button rather than hidden in a menu
   that would hold a single line. */
.js-area .js-action-menu .js-action-menu-primary {
    box-sizing: border-box;
    justify-content: center;
    min-width: var(--js-action-width);
    min-height: 30px;
    padding: 4px 12px;
    line-height: 1.2;
    white-space: nowrap;
}

.js-area .js-action-menu-more {
    display: inline-flex;
    position: relative;
    margin: 0;
}

/* The Actions button. Label left, caret right, so a column of them lines up on
   both edges. */
.js-area .js-action-menu-toggle {
    box-sizing: border-box;
    justify-content: space-between;
    gap: 10px;
    min-width: var(--js-action-width);
    min-height: 30px;
    padding: 4px 12px;
    list-style: none;
    cursor: pointer;
    line-height: 1.2;
}

/* The disclosure triangle the browser draws for a <summary> would sit beside
   the caret this control draws itself. */
.js-area .js-action-menu-toggle::-webkit-details-marker,
.js-area .js-action-menu-toggle::marker {
    display: none;
    content: '';
}

.js-area .js-action-menu-caret {
    display: inline-block;
    font-size: 0.8rem;
    line-height: 1;
    transition: transform var(--transition-base, 0.15s ease);
}

.js-area .js-action-menu-more[open] .js-action-menu-caret {
    transform: rotate(180deg);
}

/* The panel. Quiet surface, one action per line, room for a thumb. */
.js-area .js-action-menu-list {
    box-sizing: border-box;
    z-index: 60;
    min-width: 210px;
    max-width: min(280px, calc(100vw - 24px));
    margin-top: 6px;
    padding: 6px;
    border: 1px solid var(--js-line);
    border-radius: 10px;
    background: var(--js-surface);
    box-shadow: 0 14px 34px var(--js-shadow);
    text-align: left;
    white-space: normal;
}

/* With the script running the panel is lifted out of the scrolling table and
   placed against its toggle, which is also what lets it open upward when the
   row is near the bottom of the window. */
[data-js-action-menu="on"] .js-area .js-action-menu-list,
.js-area[data-js-action-menu="on"] .js-action-menu-list {
    position: fixed;
    top: 0;
    left: 0;
    margin-top: 0;
}

.js-area .js-action-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    box-sizing: border-box;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--js-ink);
    font: inherit;
    font-size: 0.8rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.js-area .js-action-menu-item:hover,
.js-area .js-action-menu-item:focus-visible {
    background: var(--js-surface-sunken);
}

/* Destructive lines are named in red rather than filled with it: a panel of
   red blocks makes the ordinary actions hard to find. */
.js-area .js-action-menu-item-danger {
    color: var(--js-critical-ink);
}

.js-area .js-action-menu-item-danger:hover,
.js-area .js-action-menu-item-danger:focus-visible {
    background: var(--js-critical-bg);
}

.js-area .js-action-menu-icon {
    flex: 0 0 auto;
    width: 16px;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.85;
}

/* The panel holds ordinary POST forms, one per line, so each has to fill it. */
.js-area .js-action-menu-list .js-action-menu-form {
    display: block;
    width: 100%;
    margin: 0;
}

/* Inside a table the generic Actions-cell rules further down this file are the
   more specific of the two, so the component states what it needs again from
   inside that context rather than those cell rules being weakened for every
   other table that relies on them. */
.js-area .js-table td.js-actions-cell .js-action-menu .btn,
.js-area .js-table td.js-actions-cell .js-action-menu form,
.js-area .js-table td.js-actions-cell .js-action-menu .js-inline-form {
    margin: 0;
}

/* The cell rules also set a font size and padding on every .btn, which the
   width above is measured against; the width itself has to be restated here or
   the more specific cell rule leaves each button sized by its own label. */
.js-area .js-table td.js-actions-cell .js-action-menu .js-action-menu-toggle,
.js-area .js-table td.js-actions-cell .js-action-menu .js-action-menu-primary {
    min-width: var(--js-action-width);
    padding: 4px 12px;
}

/* A phone needs a target a thumb can hit. The rows of the panel go to 44px and
   the button itself grows with them. */
@media (max-width: 640px) {
    .js-area .js-action-menu-toggle,
    .js-area .js-table td.js-actions-cell .js-action-menu .js-action-menu-toggle {
        min-height: 36px;
        padding: 6px 12px;
    }

    .js-area .js-action-menu .js-action-menu-primary,
    .js-area .js-table td.js-actions-cell .js-action-menu .js-action-menu-primary {
        min-height: 36px;
        padding: 6px 12px;
    }

    .js-area .js-action-menu-item {
        min-height: 44px;
        font-size: 0.85rem;
    }
}

/* Component replacement is a focused maintenance dialog. A form embedded in
   the narrow Actions cell is unreadable and also gets clipped by the table's
   horizontal scroll container. */
.js-area .js-maintenance-dialog {
    box-sizing: border-box;
    width: min(440px, calc(100vw - 32px));
    padding: 20px;
    border: 1px solid var(--js-line);
    border-radius: 10px;
    background: var(--js-surface);
    /* A dialog does not inherit the page's text colour: the browser gives it
       its own, which is black. Anything inside that does not name a colour
       would be black on a dark surface. */
    color: var(--js-ink);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    box-shadow: 0 12px 30px var(--js-shadow);
    text-align: left;
    white-space: normal;
}

/* ── The wide dialog ────────────────────────────────────────────────── */

/*
 * The shell for a form too big for the 440px maintenance dialog: the equipment
 * template, and registering a system from one. Both used to sit at the bottom
 * of their list, so working on one meant a page load, a scroll, and losing
 * sight of the list you were working through.
 *
 * The shell alone is here. What goes inside is each form's own business, and
 * the template's two-pane split is further down under .js-template-form-body.
 */
/* Only when open: display on a dialog overrides the browser's own rule that
   keeps a closed one out of the page, and the form would sit at the bottom of
   the list as a second copy of itself. */
.js-area .js-wide-dialog[open] {
    display: flex;
}

.js-area .js-wide-dialog {
    box-sizing: border-box;
    width: min(1080px, calc(100vw - 32px));
    max-height: min(880px, calc(100vh - 48px));
    padding: 0;
    overflow: hidden;
}

.js-area .js-wide-dialog-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    width: 100%;
    margin: 0;
}

/* The heading and the actions stay put; the form itself scrolls between them,
   so the way to save is never somewhere below the fold. */
.js-area .js-wide-dialog-form .js-dialog-heading {
    flex: 0 0 auto;
    padding: 20px 20px 16px;
    margin: 0;
    border-bottom: 1px solid var(--js-line);
}

.js-area .js-wide-dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
}

.js-area .js-template-form-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-content: start;
}

.js-area .js-template-form-components {
    min-width: 0;
    margin: 0;
}

.js-area .js-wide-dialog-actions {
    flex: 0 0 auto;
    padding: 16px 20px;
    margin: 0;
    border-top: 1px solid var(--js-line);
    background: var(--js-surface-sunken);
}

/* Registering a system asks for a name, a site and a badge per part, so it
   needs less room than the template form beside it. */
.js-area .js-register-dialog {
    width: min(720px, calc(100vw - 32px));
}

/*
 * One badge per part of the rig being registered. Red with a + until its small
 * form is saved, then green with what was entered (jumpStory.js,
 * attachPartBadges). The label above matches a .form-field label.
 */
/* A part's form sits inside the register form, so it drops the wide dialog's
   heading band and keeps the plain heading of a small dialog. */
.js-area .js-wide-dialog-form .js-part-dialog .js-dialog-heading {
    padding: 0;
    margin: 0 0 18px;
    border-bottom: 0;
}

.js-area .js-part-badges-label {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary, var(--js-ink-muted));
}

.js-area .js-part-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.js-area .js-part-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    min-height: 36px;
    max-width: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: var(--js-critical-bg);
    color: var(--js-critical-ink);
    font: inherit;
    font-size: 13px;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

/* Compact on a desk; a full touch target on a phone. */
@media (max-width: 600px) {
    .js-area .js-part-badge {
        align-items: center;
        min-height: 56px;
    }
}

.js-area .js-part-badge:hover {
    filter: brightness(0.97);
}

.js-area .js-part-badge:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.js-area .js-part-badge-done {
    background: var(--js-ok-bg);
    color: var(--js-ok-ink);
}

/* A plain + or tick on the name's own line, no circle round it. */
.js-area .js-part-badge-icon {
    flex: 0 0 auto;
    width: 0.8em;
    font-weight: 700;
    text-align: center;
}

.js-area .js-part-badge-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.js-area .js-part-badge-name {
    font-weight: 600;
}

.js-area .js-part-badge-detail {
    font-size: 12px;
    opacity: 0.85;
    overflow-wrap: anywhere;
}

.js-area .js-part-badge-detail:empty {
    display: none;
}

.js-area .btn[data-register-submit]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/*
 * The template form alone is two panes, because it is two jobs of unequal size.
 * What the model IS is a short column of facts on the left. Its components are
 * the work, and they get the room: the right pane is the wider of the two and
 * each row has its fields side by side.
 */
@media (min-width: 900px) {
    .js-area .js-template-form-body {
        grid-template-columns: minmax(260px, 1fr) minmax(0, 1.9fr);
        gap: 24px;
    }
}

/* Inside the right pane a component row has room for three fields across,
   which is how the row is laid out everywhere else on the page. */
@media (min-width: 1000px) {
    .js-area .js-template-form-body .js-repeat-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.js-area .js-maintenance-dialog::backdrop {
    background: rgba(15, 23, 42, 0.42);
}

.js-area .js-dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.js-area .js-dialog-heading h4,
.js-area .js-dialog-heading p {
    margin: 0;
}

.js-area .js-dialog-heading p {
    margin-top: 5px;
    color: var(--js-ink-muted);
    font-size: 0.85rem;
}

.js-area .js-maintenance-form {
    margin: 0;
}

/*
 * Dialog fields are .form-field, the same wrapper every other form in the
 * application uses, so a control in a dialog is the padded, rounded, focus-ringed
 * thing it is everywhere else. They were bare labels wrapping bare inputs once,
 * which inherited nothing and read as a browser default form from 1998.
 *
 * Only what a dialog adds is here: the stacking, and controls that fill the
 * width they are given rather than sizing themselves to their content.
 */
.js-area .js-maintenance-dialog .form-field {
    margin-bottom: 14px;
}

.js-area .js-maintenance-dialog .aircraft-form-grid .form-field {
    margin-bottom: 0;
}

.js-area .js-maintenance-dialog .form-field input,
.js-area .js-maintenance-dialog .form-field select {
    box-sizing: border-box;
    width: 100%;
}

.js-area .js-maintenance-form .js-form-actions {
    justify-content: flex-end;
    margin-top: 4px;
}

/*
 * The content pane.
 *
 * The width comes from .org-settings-page--tabbed, the same wide container the
 * organisation settings screens use. The default .org-settings-page is capped
 * at 620px, which is far too narrow for the equipment and device tables.
 */
.js-area-content {
    padding: 28px;
}

/*
 * Full width, for the sections read beside the tech log sheet.
 *
 * The sheet renders straight into the body with 20px of padding and no cap at
 * all, so the Jump Log held at 1400px wrapped columns the sheet did not.
 * This matches it: no cap, and the page padding echoes the body padding the
 * sheet uses. Which sections get it is decided in layout.php.
 *
 * The card's own padding goes with the cap. .org-settings-card carries
 * 32px 28px 28px and .js-area-content adds another 28px inside it, so the
 * table was inset 56px from the card edge before it started. One inset, from
 * the content pane, is enough. The settings screens keep both, because they are
 * forms and a form is meant to sit in from the edge.
 */
.js-area-page-wide {
    max-width: none;
    padding: 0 20px;
}

.js-area-page-wide .org-settings-card {
    padding: 0;
}

.js-area-page-wide .js-area-content {
    padding: 20px;
}

@media (max-width: 720px) {
    .js-area-content,
    .js-area-page-wide .js-area-content {
        padding: 16px;
    }

    .js-area-page-wide {
        padding: 0 8px;
    }

    /* On a phone the bar collapses to the hamburger, so these would only crowd
       it. The drawer carries the same navigation. */
    .js-area .js-brand-mark,
    .js-area .js-product-badge-stack {
        display: none;
    }
}

/* ── Sub tabs within a page ─────────────────────────────────────────── */

/*
 * A page with more than one job, such as Equipment, uses the same vertical
 * tabs as the organisation settings screens. The classes are theirs, so the
 * two areas cannot drift apart and the stack-on-a-phone rule at 700px comes
 * free.
 *
 * The only addition is the frame. In organisation settings the tab block sits
 * flush inside a card with no padding of its own; here it sits inside a padded
 * page, so it needs an edge of its own to read as one component rather than as
 * a stray column.
 */
.js-area .settings-tabs-layout {
    border: 1px solid var(--color-border, var(--js-line));
    border-radius: 10px;
    /* Clip, not hidden: it rounds the corners the same, without making a
       scroll box, so a sticky toolbar inside still sticks (.js-list-toolbar). */
    overflow: clip;
}

/* Rig Log views are the page's primary navigation, matching the vertical
   GoTechlog Settings menu. A selected rig's .js-detail-tabs stay horizontal
   inside the content pane for History and Life cycle. */
.js-area .js-riglog-layout {
    margin-top: 0.75rem;
    min-height: 520px;
}

.js-area .js-riglog-layout > .settings-tabs-nav {
    width: 180px;
}

.js-area .js-riglog-layout > .settings-tab-content {
    min-width: 0;
}

/*
 * The selected tab.
 *
 * .settings-tab-link.active colours its label from --color-primary-bg, which is
 * the fill lime and too light to read as text on white. The label is given the
 * darker weight instead, while the marker line keeps the bright lime where it
 * is a block of colour rather than text.
 */
.js-area .settings-tab-link.active {
    color: var(--js-accent-text);
    border-left-color: var(--js-accent);
}

@media (max-width: 700px) {
    .js-area .js-riglog-layout > .settings-tabs-nav {
        width: auto;
    }

    .js-area .settings-tab-link.active {
        border-left-color: transparent;
        border-bottom-color: var(--js-accent);
    }
}

/* ── Dashboard summary tiles ────────────────────────────────────────── */

.js-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.js-summary-tile {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1rem;
    border: 1px solid var(--color-border, var(--js-line));
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.js-summary-tile:hover,
.js-summary-tile:focus-visible {
    border-color: var(--js-accent);
    box-shadow: 0 0 0 3px var(--js-accent-soft);
}

.js-summary-value {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
    /* Text, so the darker weight. The bright lime would not be readable. */
    color: var(--js-accent-text);
}

.js-summary-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.75;
}

/* Equipment at or near its life limit is the one figure worth catching the
   eye. Amber plus the wording, never colour on its own. */
.js-summary-tile-attention {
    border-color: var(--color-warning, #8a5300);
}

.js-summary-tile-attention .js-summary-value {
    color: var(--color-warning, #8a5300);
}

/* ── Page structure ─────────────────────────────────────────────────── *//* ── Page structure ─────────────────────────────────────────────────── */

.js-page-title {
    font-size: 1.4rem;
    margin: 0 0 1rem;
}

/* A page title with the page's New button on the same line, at the right. */
.js-page-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin: 0 0 1rem;
}

.js-page-title-row .js-page-title {
    margin: 0;
}

.js-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border, var(--js-line));
}

.js-section:last-child {
    border-bottom: 0;
}

.js-section-heading {
    font-size: 1.1rem;
    margin: 0 0 0.5rem;
}

.js-subheading {
    font-size: 1rem;
    margin: 0;
}

/* A heading with the control that adds to what it names. They sit on one line
   until the line is too short for both. */
.js-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-bottom: 0.75rem;
}

.js-section-header .js-section-heading {
    margin: 0;
}

.js-subheading-small {
    font-size: 0.9rem;
    margin: 1rem 0 0.5rem;
}

.js-nav-group-heading {
    margin: 1rem 0 0.25rem;
    padding: 0 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

.js-hint {
    font-size: 0.85rem;
    opacity: 0.8;
    margin: 0.25rem 0 0.75rem;
}

.js-muted {
    opacity: 0.6;
}

/* Available to a screen reader, not painted on screen. Used for table
   captions that would repeat a visible heading. */
.js-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Forms ──────────────────────────────────────────────────────────── */

.js-form {
    margin-bottom: 1rem;
}

.js-fieldset {
    border: 1px solid var(--color-border, var(--js-line));
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
}

.js-fieldset legend {
    padding: 0 0.5rem;
    font-weight: 600;
}

/*
 * Role choices use .users-dot-filter, the dot control the rest of the
 * application uses, rather than a plain tick box. This rule only gives the
 * rows room to breathe and a touch target big enough for a gloved hand.
 */
.js-dot-choice {
    min-height: 48px;
    display: flex;
    align-items: center;
    font-size: 0.95rem !important;
    color: var(--color-text, var(--js-ink)) !important;
}

.js-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.js-inline-form {
    display: inline-block;
}
/* Hidden means hidden: the display above, and .btn's, would otherwise
   override the attribute, as on the For sale fallback once script runs. */
.js-inline-form[hidden],
.js-area .btn[hidden] {
    display: none;
}

.js-field-error {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-danger, #b3261e);
}

.js-pairing-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.3rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.js-repeat-rows {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.js-repeat-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--color-border, var(--js-line));
    border-radius: 6px;
}

.js-repeat-row-label {
    margin: 0;
    font-weight: 600;
}

/* Taking a definition off the template. It sits in the row it removes, at the
   end of it and on the baseline of the fields beside it, so it reads as part
   of that row and not as a control for the whole form. .form-field stacks its
   contents in a column, which this keeps: the end of a column is the bottom,
   and its cross axis is what puts the control on the right. */
.js-repeat-row-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
}

.js-repeat-row-remove {
    width: auto;
    white-space: nowrap;
}

@media (min-width: 700px) {
    .js-repeat-row {
        grid-template-columns: repeat(3, 1fr);
        align-items: end;
    }

    .js-repeat-row-label {
        grid-column: 1 / -1;
    }
}

/* ── Alerts ─────────────────────────────────────────────────────────── */

.js-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    /* A uniform hairline, not a thick left edge. A 4px left border on a rounded
       box curves at both ends and reads as a bracket around the text. The
       background tint and the icon already say what state this is. */
    border: 1px solid currentColor;
    background: var(--color-surface-alt, rgba(127, 127, 127, 0.08));
}

.js-alert-icon {
    font-weight: 700;
    flex-shrink: 0;
}

.js-alert-success {
    color: var(--color-success, #1b5e20);
}

.js-alert-error {
    color: var(--color-danger, #b3261e);
}

.js-alert-info {
    color: var(--color-primary, #0072ce);
}

/*
 * Warning alerts keep a cream surface and dark ink in every theme.
 *
 * Why fixed colours rather than --js-ink / --color-text: dark mode and the
 * phpstorm palettes set pale body ink (and force it onto strong with
 * !important). A cream panel that inherits that ink is unreadable. The
 * surface stays amber/cream; the ink stays dark brown on top of it.
 */
.js-area .js-alert-warning {
    color: #5c3b00;
    background: #fff4e2;
    border-color: #c4871a;
}

.js-area .js-alert-warning,
.js-area .js-alert-warning :is(strong, b, a, .js-alert-icon) {
    color: #5c3b00 !important;
}

.js-area .js-alert-warning a {
    font-weight: 600;
    text-decoration: underline;
}

/* ── Empty states ───────────────────────────────────────────────────── */

.js-empty-state {
    padding: 1.5rem;
    border: 1px dashed var(--color-border, var(--js-line));
    border-radius: 6px;
    background: var(--color-surface-alt, rgba(127, 127, 127, 0.05));
}

.js-empty-state p {
    margin: 0 0 0.5rem;
}

.js-empty-state-feature {
    text-align: left;
}

.js-plain-list {
    margin: 0.5rem 0 0.75rem 1.25rem;
    padding: 0;
}

.js-inline-list {
    margin: 0;
    padding-left: 1.1rem;
}

/* ── Tables ─────────────────────────────────────────────────────────── */

/* Wide content scrolls inside its own box so the page body never scrolls
   sideways on a phone. */
.js-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.js-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
}

.js-table th,
.js-table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border, var(--js-line));
    vertical-align: top;
}

.js-table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.75;
}

.js-actions-cell {
    white-space: nowrap;
}

.js-actions-cell .btn,
.js-actions-cell form {
    margin-right: 0.25rem;
}

/* ── Cards ──────────────────────────────────────────────────────────── */

.js-equipment-card {
    border: 1px solid var(--color-border, var(--js-line));
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.js-equipment-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.js-device-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.js-assign-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
}

.js-details {
    margin-top: 0.75rem;
}

/* The toggle reads as a small link, the same language as Jump →. The arrow
   turns down while the section is open. */
.js-details > summary,
.js-area .js-log-details > summary {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    width: max-content;
    max-width: 100%;
    min-height: 32px;
    cursor: pointer;
    list-style: none;
    color: var(--color-link, #0072ce);
    font-size: 0.85rem;
    font-weight: 500;
}
.js-area .js-log-details > summary {
    min-height: 0;
    font-size: inherit;
}
.js-details > summary::-webkit-details-marker,
.js-area .js-log-details > summary::-webkit-details-marker { display: none; }
.js-details > summary::after,
.js-area .js-log-details > summary::after {
    content: '\2192';
    font-size: 0.9em;
    transition: transform 0.15s ease;
}
.js-details[open] > summary::after,
.js-area .js-log-details[open] > summary::after { transform: rotate(90deg); }
.js-details > summary:is(:hover, :focus-visible),
.js-area .js-log-details > summary:is(:hover, :focus-visible) { text-decoration: underline; }

.js-enrolment-result {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--color-border, var(--js-line));
    border-radius: 6px;
}

/* ── Definition lists ───────────────────────────────────────────────── */

.js-detail-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.15rem 1rem;
    margin: 0;
}

.js-detail-list dt {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.7;
    margin-top: 0.5rem;
}

.js-detail-list dd {
    margin: 0;
}

@media (min-width: 640px) {
    .js-detail-list {
        grid-template-columns: 12rem 1fr;
    }

    .js-detail-list dt {
        margin-top: 0.25rem;
    }

    .js-detail-list dd {
        margin-top: 0.25rem;
    }
}

/* ── Badges and life status chips ───────────────────────────────────── */

/* The badge shape is defined once, further up, on .js-area .js-badge. What
   used to be a second .js-badge here only survived on one property: it was
   the source of the border that ringed every badge in the area. The colour
   rules below stay, because they are the only thing this block ever needed
   to say. */

.js-badge-ok {
    color: var(--color-success, #1b5e20);
}

/* Amber, and clearly not the red used for a reached life limit. */
.js-badge-warning {
    color: var(--color-warning, #8a5300);
}

.js-badge-role,
.js-badge-status {
    color: var(--color-text, var(--js-ink));
    opacity: 0.85;
}

.js-status-revoked {
    color: var(--color-danger, #b3261e);
    opacity: 1;
}

.js-life-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    border: 1px solid currentColor;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.js-life-chip-icon {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.js-life-normal {
    color: var(--color-success, #1b5e20);
}

/* Near end of life. Amber plus a distinct icon, so it is never mistaken for
   the reached state even without colour. */
.js-life-warning {
    color: var(--color-warning, #8a5300);
    border-width: 2px;
}

/* Almost out. Red, because the rigger is meant to act now, but distinguished
   from the reached state by a solid fill rather than by colour alone: an item
   with jumps left is still usable and one at its limit is not. */
.js-life-critical {
    color: var(--color-danger, #b3261e);
    border-width: 2px;
    font-weight: 700;
}

/* Life limit reached. The most serious state, so it is the only one that
   inverts: filled rather than outlined, which reads as a stop at a glance and
   still reads as different with no colour at all. */
.js-life-reached {
    color: var(--js-on-danger);
    background: var(--color-danger, #b3261e);
    border-color: var(--color-danger, #b3261e);
    border-width: 2px;
    font-weight: 700;
}

.js-life-unknown {
    color: var(--color-text, var(--js-ink));
    opacity: 0.7;
    border-style: dashed;
}

/* ── Focus visibility ───────────────────────────────────────────────── */

/* Every control must show where the keyboard is. */
.js-section a:focus-visible,
.js-section button:focus-visible,
.js-section input:focus-visible,
.js-section select:focus-visible,
.js-section summary:focus-visible,
.js-area dialog :is(a, button, input, select, summary):focus-visible {
    outline: 3px solid var(--js-accent-strong, #8aab00);
    outline-offset: 2px;
}

/*
 * The device list.
 *
 * Fifty enrolled phones as fifty full cards is a page nobody can scan, so each
 * device is one line and opens on click. A native <details> does the opening,
 * which means the keyboard, the screen reader and the browser's own find all
 * behave without a line of script.
 *
 * The line carries exactly the three facts the list is scanned by: the device
 * name, the code name the tracker app shows, and who is carrying it.
 */
.js-area .js-device-list,
.js-area .js-equipment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.js-area .js-device-row,
.js-area .js-equipment-row,
.js-area .js-battery-phones {
    border: 1px solid var(--color-border, var(--js-line));
    border-radius: 10px;
    background: var(--color-surface, var(--js-surface));
}

/* Open is a state worth seeing at a glance when several rows are expanded. */
.js-area .js-device-row[open],
.js-area .js-equipment-row[open],
.js-area .js-battery-phones[open] {
    border-color: var(--js-navy);
}

.js-area .js-device-summary,
.js-area .js-equipment-summary,
.js-area .js-battery-phones-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.75rem;
    /* A drop zone reads this on a phone, so the row is a full touch target. */
    min-height: 56px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    /* The default triangle is replaced by the caret below, in both engines. */
    list-style: none;
}

.js-area .js-device-summary::-webkit-details-marker,
.js-area .js-equipment-summary::-webkit-details-marker,
.js-area .js-battery-phones-summary::-webkit-details-marker {
    display: none;
}

.js-area .js-device-summary:hover,
.js-area .js-equipment-summary:hover,
.js-area .js-battery-phones-summary:hover {
    background: var(--js-navy-soft);
}

.js-area .js-device-summary:focus-visible,
.js-area .js-equipment-summary:focus-visible,
.js-area .js-battery-phones-summary:focus-visible {
    outline: 3px solid var(--js-accent-strong, #8aab00);
    outline-offset: -3px;
}

/* Pushed to the far right, so every row's caret lines up down the list. */
.js-area .js-device-summary::after,
.js-area .js-equipment-summary::after,
.js-area .js-battery-phones-summary::after,
.js-area .js-collapsible-card > summary::after {
    content: '\25be';
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--color-text-muted, var(--js-ink-muted));
    transition: transform 0.15s ease;
}

.js-area .js-device-row[open] .js-device-summary::after,
.js-area .js-equipment-row[open] .js-equipment-summary::after,
.js-area .js-battery-phones[open] > .js-battery-phones-summary::after,
.js-area .js-collapsible-card[open] > summary::after {
    transform: rotate(180deg);
}

.js-area .js-device-summary-name,
.js-area .js-equipment-summary-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-text, var(--js-ink));
}

/* Navy, the same colour the assignment frame inside the row uses, so the two
   are recognisably the same fact at two levels of detail. */
.js-area .js-device-summary-person {
    font-weight: 600;
    color: var(--js-navy);
}

.js-area .js-device-summary-unassigned {
    color: var(--color-warning, #8a5300);
}

.js-area .js-device-row-body,
.js-area .js-equipment-row-body {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--color-border, var(--js-line));
}

/* The count sits beside the search box, not under it. */
.js-area .js-device-filter-count {
    margin: 0;
    white-space: nowrap;
}

.js-area .js-device-no-matches {
    margin-top: 8px;
}

.js-area .js-device-handover-hint {
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid var(--js-accent);
    background: var(--js-accent-soft);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--js-accent-soft-ink);
}

/*
 * The assignment panel.
 *
 * Who carries the device is the fact the page is read for, so it gets a frame of
 * its own directly under the identity rather than a line in the detail list,
 * where it read as one more specification among six.
 *
 * It is navy rather than lime. The handover hint sitting under it already uses
 * the accent, and two accent frames in a row read as one block instead of two
 * separate facts.
 */
.js-area .js-device-assignment {
    margin: 0 0 12px;
    padding: 10px 14px;
    border: 1px solid var(--js-navy);
    border-radius: 10px;
    background: var(--js-navy-soft);
}

.js-area .js-device-assignment-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--js-navy);
}

.js-area .js-device-assignment-person {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin: 2px 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text, var(--js-ink));
}

.js-area .js-device-assignment-meta {
    margin: 2px 0 0;
    font-size: 0.8rem;
    color: var(--color-text-muted, var(--js-ink-muted));
}

/* Nobody linked yet. A dashed neutral frame says the slot is empty without
   borrowing the accent, which here would read as a completed step. */
.js-area .js-device-assignment-empty {
    border-style: dashed;
    border-color: var(--color-border, var(--js-line));
    background: transparent;
}

.js-area .js-device-assignment-empty .js-device-assignment-label {
    color: var(--color-text-muted, var(--js-ink-muted));
}

.js-area .js-device-assignment-empty .js-device-assignment-person {
    font-weight: 600;
    color: var(--color-text-muted, var(--js-ink-muted));
}

/* The code name the phone in somebody's hand is showing. A badge, in the same
   shape as every other badge in the area: no ring, small radius, and small
   enough that it labels the device rather than outshouting its name. */
.js-area .js-device-friendly-name-inline {
    display: inline-block;
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--js-accent-soft-ink);
    background: var(--js-accent-soft);
    border: 0;
    border-radius: 5px;
    padding: 2px 7px;
    white-space: nowrap;
}

/* The model name under an assignment, kept quiet for the reason above. */
.js-area .js-device-name-secondary {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--color-text-muted, var(--js-ink-muted));
}

/* ── Warning rules ──────────────────────────────────────────────────── */

/*
 * Two number fields side by side, because amber and red are one decision
 * rather than two: the pair only makes sense read together. They stack on a
 * narrow screen like every other form row here.
 */
.js-area .js-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 640px) {
    .js-area .js-form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* A value that cannot be edited on this form, shown where its input would be
   so the layout does not jump between the add and edit states. */
.js-area .js-static-value {
    margin: 0;
    padding: 8px 0;
    font-weight: 600;
}

/*
 * A standing note, not a result of anything the reader just did.
 *
 * Deliberately not styled like the success and error banners: those report
 * what happened, this states how the feature works, and a reader who cannot
 * tell them apart will dismiss one as the other.
 */
.js-area .js-callout {
    margin: 16px 0;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--js-accent-strong);
    background: var(--js-accent-soft);
    color: var(--js-accent-soft-ink);
}

.js-area .js-callout p {
    margin: 0;
}

/* ── Revoked devices ────────────────────────────────────────────────── */

/*
 * A revoked device stays in the list as history, so it has to read as retired
 * at a glance without disappearing.
 *
 * Muted rather than hidden, and never by colour alone: the row also carries a
 * Revoked badge and the card explains itself. Opacity is kept high enough that
 * the text still meets contrast, because this is a record somebody may need to
 * read months later, not decoration.
 *
 * It is marked by having less than the rows around it, not more. A retired
 * device with a coloured edge beside plain live rows reads as the one thing on
 * the page asking to be looked at, which is the opposite of the truth. So the
 * navy edge is given up and only the width kept, which keeps every row's text
 * on the same vertical line.
 */
.js-area .js-device-row-revoked,
/* Opening the card outlines it in navy, which would put the edge back. A
   retired device keeps its plain left side open or closed. */
.js-area .js-device-row-revoked[open] {
    background: var(--color-surface-muted, var(--js-surface-sunken));
}

/* A retired device keeps the pill for alignment and drops the colour, so the
   list stays on one vertical line. */
.js-area .js-device-row-revoked > summary {
    opacity: 0.75;
}

/* The code name loses its emphasis: this one is never being handed to anybody
   again, so it should not compete with the names that are. */
.js-area .js-device-row-revoked .js-device-friendly-name,
.js-area .js-device-row-revoked .js-device-friendly-name-inline {
    color: var(--color-text-muted, var(--js-ink-muted));
    background: none;
    border-color: transparent;
    text-decoration: line-through;
}

/* The explanation of what revoked means. Grey rather than red: nothing is
   wrong here, the device was retired on purpose, and a red panel would read as
   a fault needing attention. */
.js-area .js-callout-revoked {
    border-color: var(--color-text-muted, #6b7280);
    background: var(--color-surface-muted, var(--js-surface-sunken));
    color: var(--color-text, var(--js-ink));
}

.js-area .js-callout-revoked p + p {
    margin-top: 8px;
}

/* A red button always sits hard right, the same as Archive on a person card,
   Retire on a rig and the last button in a table row. */
.js-area .js-danger-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.js-area .js-callout-revoked .js-danger-actions {
    margin-top: 12px;
}

/* A label for a value that is displayed rather than entered. Matches the
   weight and spacing of a real <label> so a read-only field does not look
   like a rendering mistake next to the fields that are editable. */
.js-area .js-field-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: var(--color-text, var(--js-ink));
}

/* Moving a rig to another drop zone. Sits inline under the site value, so the
   card does not grow a whole form's worth of height for a one-field change. */
.js-area .js-site-move-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.js-area .js-site-move-form select {
    width: auto;
    min-width: 12rem;
}

/* ── The equipment list line ────────────────────────────────────────────

   Shares the devices list styling above, because two lists that behave the
   same should look the same. Only the facts on the line differ: a rig is
   scanned for by name, model, where it is kept and how much life is left.
*/

/* The model, quieter than the rig's own name: several rigs share it, so it
   groups rather than identifies. */
.js-area .js-equipment-summary-template {
    color: var(--color-text-muted, var(--js-ink-muted));
    font-size: 0.9rem;
}

/* Navy, matching the way the devices line marks the person, so "which one of
   ours is this" reads the same on both pages. */
.js-area .js-equipment-summary-site {
    font-weight: 600;
    color: var(--js-navy);
}

/* Pushed to sit just before the state chip, because the number and the state
   it produced belong together. */
.js-area .js-equipment-summary-remaining {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    color: var(--color-text, var(--js-ink));
}

/* "9 jumps left on Reserve canopy", coloured by the state of that part rather
   than of the rig. It takes its colour from the js-life-* class beside it, so
   green, amber and red mean the same here as in the chips, and the wording
   carries the part's name so colour is never the only signal. */
.js-area .js-equipment-summary-hint {
    padding: 0.15rem 0.45rem;
    border-radius: 6px;
    font-weight: 700;
}

/* The caret follows the chip, so the remaining figure does not get pushed
   against it. */
.js-area .js-equipment-summary::after {
    margin-left: 0;
}

/* A rig that needs a decision is marked on the closed line, not only inside
   the card. The chip already says which state it is in; this is the edge that
   makes the row findable while scrolling, and it is never the only signal. */
.js-area .js-equipment-row-attention > .js-equipment-summary .js-pill {
    background: var(--js-pill-amber);
}

/* ── The two figures at the top of an opened card ───────────────────────

   Jumps done and jumps left are why the card gets opened, so they are given
   their own tiles above the quieter list of facts. Serial numbers and template
   names are looked up; these two are decided on.

   Colour is not used to rank them: the state chip on the line above already
   carries green, amber and red, and a second colour scheme competing with it
   would make neither readable. Size, weight and the framed tile do the work.
*/
.js-area .js-life-figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.js-area .js-life-figure {
    padding: 8px 12px 10px;
    border: 1px solid var(--color-border, var(--js-line));
    border-radius: 8px;
    background: var(--js-navy-soft);
}

.js-area .js-life-figure dt {
    margin: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.7;
}

.js-area .js-life-figure dd {
    margin: 2px 0 0;
}

.js-area .js-life-figure-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    color: var(--color-text, var(--js-ink));
}

/* "of 2000 jumps" belongs to the figure but is not the figure, so it rides
   along at the size of ordinary text. */
.js-area .js-life-figure-unit {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.75;
}

.js-area .js-life-figure-note {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted, var(--js-ink-muted));
}

/* ── Settings > Limits: the registry driven threshold fields ────────── */
.js-area .js-threshold-group {
    border: 1px solid var(--color-border, var(--js-line));
    border-radius: 8px;
    padding: 0.85rem 1rem 0.4rem;
    margin: 0 0 1rem;
}
.js-area .js-threshold-group legend {
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0 0.4rem;
}
.js-area .js-threshold-field { position: relative; }

/*
 * Settings > Limits: one limit per line. Its name, then a number box sized for
 * a figure of up to five characters with the unit after it, then the
 * provisional badge. A turn rule reads as one sentence on its line. The box
 * keeps the site's input look; only its width is set here.
 */
.js-area .js-limit-rows { display: flex; flex-direction: column; margin: 0 0 1rem; }
.js-area .js-limit-row {
    display: grid;
    /* The name, then the control at its full width (it wraps only when the
       screen is too narrow for it), then the badge straight after it. */
    grid-template-columns: minmax(10rem, 14rem) minmax(0, max-content) 1fr;
    align-items: center;
    column-gap: 16px;
    row-gap: 4px;
    padding: 8px 0;
    border-bottom: 1px solid var(--js-line-soft);
}
.js-area .js-limit-row > .js-badge { justify-self: start; }
.js-area .js-limit-row > .js-field-error { grid-column: 1 / -1; margin: 0; }
.js-area .js-limit-label { font-size: 0.9rem; color: var(--js-ink); }
.js-area .js-limit-control {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--js-ink-soft);
}
/* A fixed width, so the badges after ft/min and ms start at the same place. */
.js-area .js-limit-unit { min-width: 3.5rem; color: var(--js-ink-muted); font-size: 0.85rem; }
.js-area input.js-short-number {
    flex: 0 0 auto;
    width: 7ch;
    min-width: 0;
    padding: 4px 8px;
    text-align: right;
}
/* A line whose field holds addresses rather than a figure: the field takes
   the rest of the line. */
.js-area .js-limit-row.js-limit-row-wide { grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr); }
.js-area .js-limit-row-wide > input { box-sizing: border-box; width: 100%; min-width: 0; padding: 8px 12px; font-size: 14px; }
@media (max-width: 640px) {
    .js-area .js-limit-row,
    .js-area .js-limit-row.js-limit-row-wide { grid-template-columns: 1fr; }
}

/* Settings > Limits > Versions: one block per saved version, what changed in
   a short list, and every value behind "All values" in the limit-row layout. */
.js-area .js-limit-version { padding: 12px 0; border-bottom: 1px solid var(--js-line); }
.js-area .js-limit-version-title {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
    margin: 0 0 6px; font-size: 0.95rem;
}
.js-area .js-limit-version-title .js-hint { margin: 0; font-weight: 400; }
.js-area .js-limit-version-changes { margin: 0 0 6px; padding-left: 1.2rem; font-size: 0.9rem; }
.js-area .js-limit-version-values summary { cursor: pointer; font-size: 0.85rem; color: var(--js-ink-soft); }
.js-area .js-limit-version-group { margin: 12px 0 2px; font-size: 0.8rem; color: var(--js-ink-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* A threshold nobody has set yet says so, in words as well as in colour. */
.js-area .js-threshold-provisional { margin-top: 0.3rem; }

.js-area .js-threshold-explanation {
    margin: 0.3rem 0 0;
    font-size: 0.8rem;
    line-height: 1.35;
}

/* ═════════════════════════════════════════════════════════════════════
   Jump Story UI system: pills, status rhombuses, site cards.

   Taken from jump-story-ui-reference.html. Two decisions in there are
   deliberate and are the reason this block exists.

   THE PILL, NOT THE BRACKET.
   A coloured accent is a separate rounded element sitting beside the
   heading, never a thick coloured border-left on a rounded card. The two
   look similar in a mockup and completely different on screen: a 4px left
   border on a 10px-radius card curves at both ends and reads as a bracket
   wrapped around the content. The reference makes the same correction to
   itself, overriding its own `border-top: 6px` site card accent back to
   1px and moving the colour into `.jr-site-pill`.

   So: card borders are a uniform 1px. Colour lives in a pill.

   THE RHOMBUS, NOT THE DOT.
   A status marker is a rotated rounded square, not a circle. A rhombus is
   distinguishable from a circle at 8px in a way that two similar colours
   are not, which matters because these markers carry severity. Colour is
   never the only signal: every row also carries words.

   The palette is fixed and small. Site colour is chosen from it by key
   rather than stored as free hex, so a site can never be given a colour
   that collides with a severity colour or fails contrast.
   ═════════════════════════════════════════════════════════════════════ */

.js-area {
    /* Accent palette. Keys, not free hex: see the note above. */
    --js-pill-indigo: #6f74dd;
    --js-pill-teal: #38bda0;
    --js-pill-amber: #e4a23c;
    --js-pill-rose: #d9668a;
    --js-pill-slate: #7c8b9c;
    --js-pill-violet: #9b7ae0;

    /* Severity. Used by the rhombus and by the score chip. */
    --js-severity-critical: #d93647;
    --js-severity-warning: #f1bd31;
    --js-severity-error: #7750b8;
    --js-severity-ok: #42b98c;

    --js-seen-warning-bg: var(--js-warning-bg);
    --js-seen-warning-ink: var(--js-warning-ink);
    --js-seen-warning-border: rgba(245, 166, 35, 0.32);
    --js-seen-critical-bg: var(--js-critical-bg);
    --js-seen-critical-ink: var(--js-critical-ink);
    --js-seen-critical-border: rgba(171, 31, 44, 0.22);

    --js-panel-border: var(--js-line);
    --js-panel-divider: var(--js-line-soft);
    --js-ink-label: var(--js-ink-soft);

    /* The three life figures. Jumps and Limit are context and are held back
       so Remaining, which is the number somebody acts on, is the one the eye
       lands on. Remaining takes its colour from the row's severity instead. */
    --js-life-used-ink: var(--js-ink-muted);
    --js-life-limit-ink: #5b6b9e;
}

/* ── The pill ──────────────────────────────────────────────────────── */

.js-area .js-pill {
    flex: 0 0 12px;
    width: 12px;
    height: 38px;
    border-radius: 999px;
    background: var(--js-pill-indigo);
}

.js-area .js-pill-sm { height: 26px; width: 10px; flex-basis: 10px; }

.js-area .js-pill-indigo { background: var(--js-pill-indigo); }
.js-area .js-pill-teal { background: var(--js-pill-teal); }
.js-area .js-pill-amber { background: var(--js-pill-amber); }
.js-area .js-pill-rose { background: var(--js-pill-rose); }
.js-area .js-pill-slate { background: var(--js-pill-slate); }
.js-area .js-pill-violet { background: var(--js-pill-violet); }

/* A site with no colour chosen is not given an invented one. The pill goes
   hollow, and the card says so in words. */
.js-area .js-pill-none {
    background: transparent;
    border: 1px dashed var(--js-panel-border);
}

/* ── The status rhombus ────────────────────────────────────────────── */

.js-area .js-rhombus {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    vertical-align: middle;
}

.js-area .js-rhombus::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 2px;
    width: 13px;
    height: 13px;
    border-radius: 2px;
    transform: rotate(45deg);
}


/* Unknown is not a severity, it is the absence of one. Its colour, like every
   other status colour, is set in the marker block at the end of this file. */
.js-area .js-rhombus-unknown::before {
    border: 0;
}

/* The small inline marker, for use inside a line of text. */
.js-area .js-rhombus-inline {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 8px 1px 2px;
    border-radius: 1px;
    transform: rotate(45deg);
    vertical-align: middle;
}


/* ── Site cards ────────────────────────────────────────────────────── */

.js-area .js-site-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
    gap: 15px;
}

.js-area .js-site-card {
    border: 1px solid var(--js-panel-border);
    border-radius: 12px;
    background: var(--color-surface, var(--js-surface));
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(31, 45, 61, 0.05);
}

.js-area .js-site-card-head {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 15px 16px 12px;
    border-bottom: 1px solid var(--js-line);
}

.js-area .js-site-card-copy { flex: 1; min-width: 0; }
.js-area .js-site-card-copy h2 { margin: 0 0 3px; font-size: 15px; }
.js-area .js-site-card-copy p { margin: 0; font-size: 11px; color: var(--js-ink-muted); }

/* The counters in the header: "Jumps 5", "Batteries 3", "Rigs 0". Shared
   badges (.js-badge, quiet for zero, warning or critical otherwise), so only
   the spacing is set here. The battery counter sits in a slot the 30 second
   poll refreshes; display: contents keeps it one of the row's items. */
.js-area .js-site-counters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}
.js-area .js-site-counter-slot { display: contents; }
.js-area .js-site-counter strong { margin-left: 4px; font-weight: 800; color: inherit; }

/* ── Domains inside a site card ────────────────────────────────────── */

.js-area .js-domain {
    padding: 12px 14px;
    border-bottom: 1px solid var(--js-panel-divider);
}

.js-area .js-domain:last-child { border-bottom: 0; }

.js-area .js-domain-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.js-area .js-domain-title strong {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--js-ink-label);
}

.js-area .js-domain-title span { font-size: 10px; color: var(--js-ink-muted); }

/* ── Status rows ───────────────────────────────────────────────────── */

.js-area .js-status-row {
    display: grid;
    /*
     * minmax(0, 1fr), not 1fr.
     *
     * A bare 1fr carries an automatic minimum of min-content, so the middle
     * column refuses to shrink below its longest unbreakable word and pushes the
     * row wider than its container. That is what produced a horizontal
     * scrollbar. minmax(0, 1fr) lets it shrink, and the wrapping rules below
     * decide what happens to the text instead.
     */
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
    margin: 2px 0;
    padding: 7px 6px;
    border-radius: 7px;
    background: var(--color-surface, var(--js-surface));
    text-align: left;
    font: inherit;
    color: inherit;
    border: 0;
    width: 100%;
    /* With padding and width: 100% together, a content box would overflow its
       own container by the padding. */
    box-sizing: border-box;
}

/*
 * The text column. A grid item's default minimum is its content, so this needs
 * min-width: 0 as well or the column above can still be forced open from the
 * inside.
 */
.js-area .js-status-row > div {
    min-width: 0;
}

/* Long text wraps rather than widening the row. `anywhere` rather than
   `break-word` because a serial number or a device name can be one long token
   with nowhere to break politely. */
.js-area .js-status-row strong,
.js-area .js-status-row small {
    overflow-wrap: anywhere;
}

.js-area a.js-status-row,
.js-area button.js-status-row { cursor: pointer; }

.js-area .js-status-row:is(:hover, :focus-visible) { background: var(--js-surface-sunken); }

/* Already looked at. Dimmed, never hidden: something that was seen is still
   something that happened. */
.js-area .js-status-row-seen { opacity: 0.45; background: var(--js-surface-sunken); }

.js-area .js-status-row strong { display: block; font-size: 11px; }
.js-area .js-status-row small {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    color: var(--js-ink-muted);
}

.js-area .js-status-flag {
    padding: 3px 5px;
    border-radius: 4px;
    background: #b6212f;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.js-area .js-status-flag-error { background: #7443a5; }
.js-area .js-status-flag-equipment { background: #b56d00; }
.js-area .js-status-flag-quiet { background: var(--js-surface-sunken); color: var(--js-ink-soft); }

/* ── Section heads, flat rather than bracketed ─────────────────────── */

.js-area .js-panel {
    border: 1px solid var(--js-panel-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-surface, var(--js-surface));
}

.js-area .js-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--js-line);
}

.js-area .js-panel-head strong { font-size: 13px; }
.js-area .js-panel-head span { font-size: 11px; color: var(--js-ink-muted); }
.js-area .js-panel-body { padding: 12px 14px; }

@media (max-width: 640px) {
    .js-area .js-site-cards { grid-template-columns: 1fr; }
}

/* ── Row accents, now carried by a pill rather than a border ────────── */

/* Default: a device or a rig with nothing to say about it. Grey, so the pill
   still holds the row on one vertical line without claiming a state. */
.js-area .js-device-summary .js-pill,
.js-area .js-equipment-summary .js-pill {
    background: var(--js-pill-slate);
}

/* A rig needing a decision. The chip in the row already says which state it is
   in, so this is a findability aid while scrolling and never the only signal. */
.js-area .js-equipment-row-attention .js-equipment-summary .js-pill {
    background: var(--js-pill-amber);
}

/* A summary is a flex line, so the pill needs to keep its height without being
   stretched by the row. */
.js-area .js-device-summary,
.js-area .js-equipment-summary {
    align-items: center;
}

/* ═════════════════════════════════════════════════════════════════════
   Restored after the live dashboard was removed.

   The global alarm, the jump history table and the alarm animation sat in
   the same block as the live panel and went with it. They are nothing to
   do with live monitoring: the alarm has to work on every page whether or
   not a dashboard is open, which is exactly why it must not live in
   dashboard CSS.
   ═════════════════════════════════════════════════════════════════════ */

/* ── Rhombus sizing per surface ────────────────────────────────────── */

/* Sizing only. The canopy's colours live in one block, at the end of this
   file: see THE JUMP STORY STATUS MARKER. */
.js-area .js-rhombus::before {
    box-shadow: none;
}

/* The Jump Log canopy fills the existing row height for readability.
   Cell padding and line-height stay put; only the glyph grows into the
   space the text already uses. */
.js-area .js-rhombus-tracker {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
}

.js-area .js-rhombus-tracker::before {
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
}

/* The pill for the software error section: red, the area's critical colour,
   so the section reads as errors at a glance in both themes. */
.js-area .js-pill-software { background: var(--js-critical-ink); }

/* ── The global emergency alarm ────────────────────────────────────── */

/*
 * Deliberately dark, and deliberately not themed.
 *
 * Every other surface in the product takes the organisation's palette. This one
 * does not, and must not: it appears about once a year, it has to be the thing
 * on the page that is obviously not a normal part of the page, and an operator
 * must never have to learn what an emergency looks like in their particular
 * colour scheme. Its colours are literals for that reason and not an oversight.
 *
 * Read under pressure, so it is laid out in the order the questions get asked:
 * who, where, what happened, what state, where exactly, who knows.
 */

.js-area .js-global-alarm {
    --js-alarm-surface: #151a23;
    --js-alarm-card: #1c232f;
    --js-alarm-line: #2b3341;
    --js-alarm-header: #8a1c24;
    --js-alarm-ink: #e9edf3;
    --js-alarm-muted: #8b96a8;
    --js-alarm-red: #ff4d5a;
    --js-alarm-green: #4ed69a;
    --js-alarm-amber: #e8b34a;
    --js-alarm-button: #f04350;

    /* Centred and held to a readable measure rather than stretched across the
       page. It is one casualty, not a table: at full width the name sat at the
       far left and the position at the far right, and the eye had to travel the
       whole window to read one incident. */
    width: min(100%, 46rem);
    margin: 0 auto 1.25rem;
    padding: 0;
    border: 1px solid var(--js-alarm-line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--js-alarm-surface);
    color: var(--js-alarm-ink);
    box-shadow: 0 10px 30px rgba(10, 14, 22, 0.22);
}

/* Nothing active. The region stays in the document so the poll has somewhere
   to put the first emergency, but it must take up no room and must not be
   announced, because an empty alarm read aloud is a false alarm. */
.js-area .js-global-alarm-quiet {
    display: none;
}

/* ── The bar ── */

.js-area .js-alarm-bar {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 0.6rem;
    padding: 0.6rem 1.1rem;
    background: var(--js-alarm-header);
    color: #ffe9ea;
}
.js-area .js-alarm-bar-label {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 0.72rem; font-weight: 800;
    letter-spacing: 0.1em; text-transform: uppercase;
}
.js-area .js-alarm-bar-mark { font-size: 0.9rem; }
.js-area .js-alarm-bar-status {
    font-size: 0.72rem; font-weight: 600;
    color: rgba(255, 233, 234, 0.82);
}

/* Flashing means nobody has acknowledged. Solid means somebody has and this
   viewer has not. Only the bar pulses: pulsing the whole panel makes the values
   inside it hard to read, which defeats the point of showing them. */
.js-area .js-global-alarm-flashing .js-alarm-bar {
    animation: jsAlarmPulse 1.1s ease-in-out infinite;
}

/* ── The case ── */

.js-area .js-alarm-case { padding: 1rem 1.1rem 1.05rem; }
.js-area .js-alarm-case + .js-alarm-case { border-top: 1px solid var(--js-alarm-line); }

.js-area .js-alarm-place {
    margin: 0;
    font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--js-alarm-muted);
}

.js-area .js-alarm-identity {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 0.6rem;
    margin-top: 0.35rem;
}
/* WHO. The largest thing on the panel, because it is the first question and
   because a name is what goes out over the radio. */
.js-area .js-alarm-name {
    margin: 0;
    font-size: 1.6rem; font-weight: 700; line-height: 1.1;
    color: #ffffff;
}
.js-area .js-alarm-badges { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; }
.js-area .js-alarm-pill {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    background: var(--js-alarm-card);
    border: 1px solid var(--js-alarm-line);
    font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--js-alarm-muted);
    white-space: nowrap;
}

.js-area .js-alarm-what {
    margin: 0.6rem 0 0;
    font-size: 0.95rem; font-weight: 600;
    color: var(--js-alarm-red);
}

/* ── The four values ── */

.js-area .js-alarm-facts {
    display: grid;
    /* Four across, and they stay four across on anything wider than a tablet.
       These are the values read at a glance, and reflowing them changes which
       one is where between one emergency and the next. */
    grid-template-columns: repeat(4, 1fr);
    gap: 0.55rem;
    margin-top: 0.85rem;
}
/*
 * Three stacked rows: label, value, note.
 *
 * A grid rather than a stack, because the values have to sit on ONE line across
 * the row. Bottom-aligning them looked right until a card had no note, and then
 * its value dropped to where the other cards' notes were. Giving the note its
 * own row, present whether or not it is filled, keeps every value at the same
 * height for the honest reason: they are in the same row.
 */
.js-area .js-alarm-card {
    display: grid;
    grid-template-rows: auto auto 1fr;
    padding: 0.7rem 0.75rem 0.75rem;
    border: 1px solid var(--js-alarm-line);
    border-radius: 10px;
    background: var(--js-alarm-card);
}
.js-area .js-alarm-card-label {
    margin: 0;
    font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--js-alarm-muted);
}
.js-area .js-alarm-card-value {
    margin: 0;
    padding-top: 0.4rem;
    font-size: 1.3rem; font-weight: 700; line-height: 1.1;
    overflow-wrap: anywhere;
}
.js-area .js-alarm-card-note {
    align-self: start;
    margin: 0.3rem 0 0;
    font-size: 0.76rem;
    color: var(--js-alarm-muted);
}

/*
 * With subgrid the three rows are shared by every card rather than being three
 * rows each, so the values stay on one line even if a label wraps at a narrow
 * width. The per-card rows above are the fallback where subgrid is missing, and
 * they already align while every label is a single line.
 */
@supports (grid-template-rows: subgrid) {
    .js-area .js-alarm-facts { grid-template-rows: auto auto 1fr; }
    .js-area .js-alarm-card {
        grid-row: span 3;
        grid-template-rows: subgrid;
    }
}

/* ── Position, and who knows ── */

.js-area .js-alarm-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.8rem 1.5rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--js-alarm-line);
}
.js-area .js-alarm-column-label {
    margin: 0;
    font-size: 0.68rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--js-alarm-muted);
}
.js-area .js-alarm-column-value {
    margin: 0.25rem 0 0;
    font-size: 0.92rem; font-weight: 600; line-height: 1.35;
    overflow-wrap: anywhere;
}
.js-area .js-alarm-column-note {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: var(--js-alarm-muted);
}
/* The age of a fix, when it is too old to be read as current. Amber rather than
   red: the coordinate is real, it is the timestamp that is the problem. */
.js-area .js-alarm-note-warning { color: var(--js-alarm-amber); font-weight: 600; }
/* The notified list. One person per line, and the channel in its own colour so
   the eye separates who from how without reading the whole line. Cool blue on
   purpose: it is metadata, and anything warm here competes with the red that
   means somebody is hurt. */
.js-area .js-alarm-recipients {
    margin: 0.25rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.15rem;
}
.js-area .js-alarm-recipient {
    display: flex; align-items: baseline; gap: 0.45rem;
    font-size: 0.92rem;
}
.js-area .js-alarm-recipient-name { font-weight: 600; color: var(--js-alarm-ink); }
.js-area .js-alarm-recipient-channel {
    font-size: 0.7rem; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: #79b0e0;
}

/* What the phone reported about its calls and SMS, oldest first, one line
   each with the local time, in the notified column. */
.js-area .js-alarm-phone-call-list {
    margin: 0.25rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.15rem;
}
.js-area .js-alarm-phone-call {
    display: flex; align-items: baseline; gap: 0.6rem;
    font-size: 0.86rem;
    color: var(--js-alarm-ink);
}
.js-area .js-alarm-phone-call.js-alarm-note-warning { color: var(--js-alarm-amber); }
.js-area .js-alarm-phone-call-time {
    flex: 0 0 auto;
    color: var(--js-alarm-muted);
    font-variant-numeric: tabular-nums;
}

/* WHICH RIG. Plain ink under the condition: it is a fact to pass on, not a
   warning in itself. */
.js-area .js-alarm-rig {
    margin: 0.3rem 0 0;
    font-size: 0.95rem; font-weight: 600;
    color: var(--js-alarm-ink);
}

/* GO. Green like the coordinate it opens, because it is the one control here
   that sends somebody to the casualty. Large enough to hit while walking. */
.js-area .js-alarm-button.js-alarm-button-directions {
    box-sizing: border-box;
    margin-top: 0.75rem;
    min-height: 56px;
    padding: 0 1.2rem;
    border-color: var(--js-alarm-green);
    background: var(--js-alarm-green);
    color: #062417;
    font-weight: 800;
}
.js-area .js-alarm-button.js-alarm-button-directions:hover,
.js-area .js-alarm-button.js-alarm-button-directions:focus-visible {
    border-color: #39b882;
    background: #39b882;
    color: #062417;
}

/* The coordinate itself opens the same directions when tapped. */
.js-area .js-alarm-position-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Values ── */

/* A value that means trouble. */
.js-area .js-fact-alert { color: var(--js-alarm-red); }
/* A value somebody acts on. Only the position uses it. */
.js-area .js-fact-locate { color: var(--js-alarm-green); }
/* A value nobody can answer. Dimmed, but never blank and never absent: an
   unknown has to be as visible as a no, or it gets read as one. */
.js-area .js-fact-unknown { color: var(--js-alarm-muted); font-weight: 600; }
.js-area .js-fact-plain { color: var(--js-alarm-ink); }

/* ── Acting ── */

.js-area .js-alarm-actions {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem;
    margin-top: 0.9rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--js-alarm-line);
}
.js-area .js-alarm-ack-form { margin: 0; }

/* The panel's own buttons rather than .btn, because .btn is painted for a
   light surface and every one of its states would have to be undone here. */
.js-area .js-alarm-button {
    display: inline-flex; align-items: center; gap: 0.4rem;
    min-height: 40px;
    padding: 0 0.95rem;
    border-radius: 9px;
    border: 1px solid var(--js-alarm-line);
    background: transparent;
    color: var(--js-alarm-ink);
    font: inherit; font-size: 0.9rem; font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.js-area .js-alarm-button:hover,
.js-area .js-alarm-button:focus-visible {
    border-color: #414b5c;
    background: rgba(255, 255, 255, 0.05);
    color: var(--js-alarm-ink);
}
/* The one control anybody is meant to reach for. (Directions, above, uses
   the doubled class so it is not repainted by .js-alarm-button.) */
.js-area .js-alarm-button-loud {
    min-height: 44px;
    padding: 0 1.15rem;
    border-color: var(--js-alarm-button);
    background: var(--js-alarm-button);
    color: #ffffff;
    font-weight: 700;
}
.js-area .js-alarm-button-loud:hover,
.js-area .js-alarm-button-loud:focus-visible {
    border-color: #d8323f;
    background: #d8323f;
    color: #ffffff;
}

@keyframes jsAlarmPulse {
    0%, 100% { background-color: #8a1c24; }
    50% { background-color: #c22733; }
}

/* Two across before they stack, so a tablet does not get four columns barely
   wider than the word they hold. */
@media (max-width: 820px) {
    .js-area .js-alarm-facts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    /* Edge to edge on a phone, so no width goes to a frame around the alarm. */
    .js-area .js-global-alarm { border-radius: 10px; }
    .js-area .js-alarm-case { padding: 0.9rem; }
    .js-area .js-alarm-bar { padding: 0.6rem 0.9rem; }
    .js-area .js-alarm-name { font-size: 1.5rem; }
    /* Two across, not one: four stacked cards pushed the position and who
       was called below the fold. */
    .js-area .js-alarm-facts { grid-template-columns: repeat(2, 1fr); gap: 0.45rem; }
    .js-area .js-alarm-card { padding: 0.55rem 0.6rem 0.6rem; }
    .js-area .js-alarm-card-value { font-size: 1.1rem; }
    .js-area .js-alarm-button.js-alarm-button-directions { width: 100%; justify-content: center; }
    .js-area .js-alarm-actions .js-alarm-button,
    .js-area .js-alarm-ack-form { width: 100%; }
    .js-area .js-alarm-actions .js-alarm-button { justify-content: center; min-height: 56px; }
    .js-area .js-alarm-ack-form .js-alarm-button { width: 100%; min-height: 72px; font-size: 1.05rem; }
}

/* An alarm must never depend on motion to be noticed. */
@media (prefers-reduced-motion: reduce) {
    .js-area .js-global-alarm-flashing .js-alarm-bar { animation: none; }
    .js-area .js-global-alarm-flashing { outline: 3px solid var(--js-alarm-red); }
}

/* ── Jump history table ────────────────────────────────────────────── */

.js-area .js-jump-filter-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.6rem;
}
.js-area .js-jump-filter-toggles {
    display: flex; flex-wrap: wrap; gap: 1rem; margin: 0.7rem 0;
}
.js-area .js-checkbox {
    display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem;
}

/* ── The Jump Log table ────────────────────────────────────────────── */

/*
 * Air, hairlines and one weight.
 *
 * The old table drew a full-strength border under every row and set the whole
 * thing at one size, so a hundred jumps read as a hundred equally important
 * facts. Here the rules are nearly invisible, the header is a quiet label
 * rather than a heading, and the only things carrying weight are the skydiver's
 * name and the two badges.
 *
 * This is now how EVERY table in the area looks, which is why it is attached to
 * .js-table rather than to a class a template has to remember to add. It began
 * as js-jump-table, for the Jump Log alone; the Rig Log's tables were read the
 * same way and were drawn in .js-table's boxed grid, so they looked like a
 * different product, and so did Settings. A table opting IN to the house style
 * is a table that will one day forget to. The jump-specific row tints below
 * keep their own names.
 */
.js-area .js-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}
.js-area .js-table :is(th, td) {
    text-align: left;
    /* Nowrap by default: the Jump Log's value is that a row is one line and the
       columns line up down the page. A cell holding real prose, a list or a row
       of controls says so with js-cell-wrap, rather than every Settings table
       growing a horizontal scrollbar to keep a sentence on one line. */
    white-space: nowrap;
    border: 0;
    /* The shared .js-table aligns to the top for cells that wrap. Nothing wraps
       here, and a badge hanging from the top of a taller row looks dropped. */
    vertical-align: middle;
}
.js-area .js-table thead th {
    padding: 9px 12px;
    border-bottom: 1px solid var(--js-line);
    background: var(--color-surface, var(--js-surface));
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--js-ink-muted);
}
.js-area .js-table td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--js-line-soft);
    font-weight: 300;
    color: var(--js-ink);
    /* Figures in a column have to line up to be compared, which is the only
       reason anybody scans a column of them. */
    font-variant-numeric: tabular-nums;
}
.js-area .js-table tbody tr:last-child td { border-bottom: 0; }

/* The dark palettes in styles.css put a full border on every td in the
   application, !important, which draws vertical lines between the columns.
   Jump Story tables only ever divide rows, so the rule is answered here with
   the same weight and a more specific selector. */
.js-area .js-table :is(th, td) {
    border-left: 0 !important;
    border-right: 0 !important;
}
.js-area .js-table td {
    border-bottom: 1px solid var(--js-line-soft) !important;
}
.js-area .js-table tbody tr:last-child td { border-bottom: 0 !important; }

/* Every Jump Story table is framed the way the audit log is drawn: one
   rounded border round the whole list, rows divided by the soft line and
   nothing else. The frame is the scroll box every table already sits in, so a
   wide table scrolls inside its own border. */
.js-area .js-table-scroll {
    border: 1px solid var(--js-line);
    border-radius: 10px;
    background: var(--js-surface);
}
.js-area .js-table-scroll :is(.js-table, .js-sample-table) :is(th, td):first-child { padding-left: 16px; }
.js-area .js-table-scroll :is(.js-table, .js-sample-table) :is(th, td):last-child { padding-right: 16px; }
/* A category that moves with another sits indented under its set lead. */
.js-area .js-table-scroll .js-table tbody tr.js-set-member-row > th:first-child { padding-left: 32px; }

/* Cells carry no background of their own; the row does. The dark palettes in
   styles.css paint every cell with !important, which striped alternate rows
   and left a highlighted row coloured in its first cell only, where the rule
   does not reach. With the cells clear, the row's own colour, its hover and a
   warning tint cover the whole width again. */
/* tr:nth-child(n) matches every row; it is there for weight only, so this
   outranks the palette's tbody tr:nth-child(even) td. */
.js-area :is(.js-table, .js-sample-table) tbody tr:nth-child(n) > :is(th, td) {
    background-color: transparent !important;
}
/* Header cells keep a solid surface: the samples table pins its header while
   250 rows scroll beneath it. */
.js-area :is(.js-table, .js-sample-table) thead th {
    background-color: var(--js-surface) !important;
}

/* Rows carry the colour, and the dark palettes also force every tr in the
   application to the plain surface with !important. So the row colours are
   declared here with the same weight, every one in this block: the plain row,
   its hover, and the tints that mark a jump or an alert. tr:nth-child(n)
   matches every row and only adds weight. */
.js-area :is(.js-table, .js-sample-table) tbody tr:nth-child(n) {
    background-color: transparent !important;
}
.js-area :is(.js-table, .js-sample-table) tbody tr:nth-child(n):hover {
    background-color: var(--js-surface-sunken) !important;
}
.js-area .js-table tbody tr.js-jump-row-emergency:nth-child(n) { background-color: rgba(255, 48, 69, 0.055) !important; }
.js-area .js-table tbody tr.js-jump-row-critical:nth-child(n) { background-color: rgba(255, 48, 69, 0.03) !important; }
.js-area .js-table tbody tr.js-jump-row-warning:nth-child(n) { background-color: rgba(255, 191, 0, 0.05) !important; }
.js-area .js-table tbody tr.js-jump-row-emergency:nth-child(n):hover { background-color: rgba(255, 48, 69, 0.085) !important; }
.js-area .js-table tbody tr.js-jump-row-critical:nth-child(n):hover { background-color: rgba(255, 48, 69, 0.055) !important; }
.js-area .js-table tbody tr.js-jump-row-warning:nth-child(n):hover { background-color: rgba(255, 191, 0, 0.08) !important; }
.js-area .js-table tbody tr.js-alert-row-critical-packed-jumped:nth-child(n) {
    background-color: var(--js-seen-critical-bg) !important;
}
.js-area .js-table tbody tr.js-alert-row-critical-packed-jumped:nth-child(n):hover {
    background-color: var(--js-critical-bg) !important;
}
.js-area .js-sample-table tbody tr.js-sample-row-warning:nth-child(n) { background-color: rgba(255, 191, 0, 0.08) !important; }
.js-area .js-sample-table tbody tr.js-sample-row-critical:nth-child(n) { background-color: rgba(255, 48, 69, 0.09) !important; }
.js-area .js-sample-table :is(th, td) {
    border-left: 0 !important;
    border-right: 0 !important;
}
.js-area .js-table tbody tr:hover { background: var(--js-surface-sunken); }

/* Figures still line up right where a cell asks for it. The rule above sets
   every cell to the left, and it is the more specific of the two. */
.js-area .js-table :is(th, td).js-numeric { text-align: right; }
.js-area .js-money { font-variant-numeric: tabular-nums; }
.js-area .js-report-subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }

/* Equipment value reports: each heading starts a new block with room above it,
   and a hint keeps a gap from the table it sits beside. */
.js-area .js-equipment-reports .js-subheading { margin: 36px 0 10px; }
.js-area .js-equipment-reports .js-report-subnav + .js-subheading { margin-top: 24px; }
.js-area .js-equipment-reports .js-subheading + .js-hint { margin: 0 0 14px; }
.js-area .js-equipment-reports .js-table-scroll + .js-hint { margin-top: 12px; }
.js-area .js-equipment-reports .js-report-notes {
    margin: 0;
    padding-left: 20px;
    max-width: 52rem;
    font-size: 14px;
    line-height: 1.55;
    color: var(--js-ink-soft);
}
.js-area .js-equipment-reports .js-report-notes li + li { margin-top: 6px; }
.js-area .js-equipment-reports .js-report-notes strong { color: var(--js-ink); font-weight: 600; }

/* A sortable header is a button that looks like the header it replaces, with
   an up-down arrow always beside it so it reads as sortable. The sorted
   column turns to the accent colour and its arrow shows the order. */
.js-area .js-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: -4px -6px;
    padding: 4px 6px;
    border: none;
    border-radius: 6px;
    background: none;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: inherit;
    text-align: inherit;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.js-area th.js-numeric .js-sort-button { flex-direction: row-reverse; }
.js-area .js-sort-button:hover,
.js-area .js-sort-button:focus-visible { color: var(--js-ink); background: var(--js-surface-sunken); }
.js-area .js-sort-indicator { display: inline-block; width: 1em; font-size: 14px; font-weight: 700; line-height: 1; text-align: center; color: var(--js-ink-soft); }
.js-area .js-sort-indicator::after { content: "\21C5"; }
.js-area th[aria-sort] .js-sort-button,
.js-area th[aria-sort] .js-sort-indicator { color: var(--js-accent-text); }
.js-area th[aria-sort="ascending"] .js-sort-indicator::after { content: "\2191"; opacity: 1; }
.js-area th[aria-sort="descending"] .js-sort-indicator::after { content: "\2193"; opacity: 1; }
/* Search on the left, the download on the right, on one line while it fits. */
.js-area .js-report-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    margin: 4px 0 12px;
}
.js-area .js-report-toolbar .js-report-search { flex: 1 1 18rem; margin: 0; }
.js-area .js-report-toolbar [data-report-download] { margin-left: auto; }
.js-area .js-report-toolbar .js-report-serials { display: flex; align-items: center; gap: 8px; margin: 0; }
/* Year and group headings, and their totals, stand out from the rows. */
.js-area table[data-sortable-table] tr[data-sort-fixed] > :is(th, td) { font-weight: 600; }

/* Value. Two figures and two colours, used the same way everywhere: current
   value in the ok green, original price in the info blue. A colour is never
   the only carrier, because each figure also has its word beside it. */
.js-area .js-value-current-text { color: var(--js-ok-ink); }
.js-area .js-value-original-text { color: var(--js-info-ink); }

.js-area .js-value-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}
.js-area .js-value-badge {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
}
.js-area .js-value-badge-label {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.85;
}
.js-area .js-value-badge-current { background: var(--js-ok-bg); color: var(--js-ok-ink); }
.js-area .js-value-badge-original { background: var(--js-info-bg); color: var(--js-info-ink); }
/* Under a component's name in a table, smaller and closer. */
.js-area .js-table .js-value-badges { gap: 6px; margin: 6px 0 0; }
.js-area .js-table .js-value-badge { padding: 2px 8px; font-size: 0.75rem; }

/* A small card per site, with the total for every rig last. */
.js-area .js-value-site-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}
.js-area .js-value-site-card {
    padding: 10px 12px;
    border: 1px solid var(--color-border, var(--js-line));
    border-radius: 8px;
    background: var(--color-surface, var(--js-surface));
}
.js-area .js-value-site-card-total { background: var(--js-surface-sunken); }
.js-area .js-value-site-card-name {
    margin: 0 0 6px;
    overflow: hidden;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--color-text-secondary, var(--js-ink-muted));
}
.js-area .js-value-site-card-lines {
    display: grid;
    gap: 2px;
    margin: 0;
}
.js-area .js-value-site-card-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.js-area .js-value-site-card-line dt {
    font-size: 12px;
    color: var(--color-text-secondary, var(--js-ink-muted));
}
.js-area .js-value-site-card-line dd {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.js-area .js-value-note { margin: 6px 0 0; font-size: 12px; }
.js-area .js-rig-story-head + .js-value-badges { margin: 12px 0 16px; }

/* A template component's money is its own panel inside the row, so it is
   plain that these figures are what every future rig's part will be worth. */
.js-area .js-repeat-row > .form-field[hidden],
.js-area .js-value-fields .form-field[hidden] {
    display: none;
}
.js-area .js-repeat-row > .js-value-fields {
    grid-column: 1 / -1;
    min-width: 0;
    margin: 4px 0 0;
    padding: 12px 14px 14px;
    border: 1px solid var(--color-border, var(--js-line));
    border-radius: 10px;
    background: var(--js-surface-sunken);
}
/* A component template form: fields its type does not use are hidden, which
   the grid's own display rule would otherwise override. Its life span panel
   is framed like the one in a template row. */
.js-area [data-component-template-form] .form-field[hidden] {
    display: none;
}
/* Last inspection, repack and review of a part being added: only what its
   template owes shows (serviceHistoryFields.php). */
.js-area .js-service-history[hidden],
.js-area .js-service-history > .form-field[hidden] {
    display: none;
}
.js-area .aircraft-form-grid + .js-service-history {
    margin-top: 12px;
}
/* A register part dialog stacks its fields, so these stack too. */
.js-area .js-part-dialog .js-service-history:not([hidden]) {
    display: block;
}
.js-area .js-part-dialog .js-service-history > .form-field:not([hidden]) ~ .form-field:not([hidden]) {
    margin-top: 10px;
}
.js-area [data-component-template-form] .js-value-fields {
    min-width: 0;
    margin: 16px 0 0;
    padding: 12px 14px 14px;
    border: 1px solid var(--color-border, var(--js-line));
    border-radius: 10px;
    background: var(--js-surface-sunken);
}
/* The type and maker under a component template's name, on their own line. */
.js-area .js-cell-subline {
    display: block;
}
/* On a spare's card the record row is already the panel, so the fieldset
   adds no second frame inside it. */
.js-area .js-rig-record-input > .js-value-fields {
    min-width: 0;
    margin: 6px 0 0;
    padding: 0;
    border: 0;
    font-weight: 400;
}
/* Two headed groups in one panel: the life span, and the original price that
   wears down over it. Side by side on a wide screen, so the headings share a
   line and the price takes the third column the fields always had. */
.js-area .js-value-fields-groups {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px 12px;
}
.js-area .js-value-fields-group { min-width: 0; }
.js-area .js-value-fields-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--js-ok-ink);
}
.js-area .js-value-fields-heading-price { color: var(--js-info-ink); }
.js-area .js-value-fields-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-items: start;
}
@media (min-width: 700px) {
    .js-area .js-value-fields-groups {
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    }
    .js-area .js-value-fields-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.js-area .js-value-choice-label {
    margin: 0 0 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary, #4b5563);
}
/* The same height as the price input beside it, so the dots sit on its line. */
.js-area .js-value-choice-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 20px;
    min-height: 40px;
}
.js-area .js-value-choice-options .js-dot-choice {
    min-height: 40px;
    margin: 0;
}

/* Remove sits at the foot of the row it removes, on the right. Add sits under
   the last row, on the left, so the two are never read as a pair. */
.js-area .js-repeat-row > .js-repeat-row-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
    padding-top: 2px;
}
/* The inspection pair starts its own line in a component row, so the interval
   and its unit are never split across two. */
@media (min-width: 700px) {
    .js-area .js-repeat-row > .js-repeat-row-new-line { grid-column-start: 1; }
}

/* A spare is on no site, so its line has no site badge column. */
.js-area .js-equipment-summary-compact.js-spare-summary {
    grid-template-columns: minmax(0, 1fr) 14px;
}
.js-area .js-equipment-summary-compact.js-spare-summary .js-equipment-identity {
    grid-column: 1;
}

/* A fitted part's closed line: who it is, how much life is left, and its
   Actions menu, so a part can be replaced or retired without opening it. */
.js-area .js-equipment-summary-compact.js-component-summary {
    grid-template-columns: minmax(0, 1fr) auto auto 14px;
}
.js-area .js-equipment-summary-compact.js-component-summary .js-equipment-identity {
    grid-column: 1;
}
.js-area .js-component-summary-remaining {
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.js-area .js-component-summary-actions {
    cursor: default;
}
/* On a phone the name, the figure and the menu each have a line, as on a
   spare, so a wide Actions menu cannot squeeze the name to one letter. */
@media (max-width: 600px) {
    .js-area .js-equipment-summary-compact.js-component-summary {
        grid-template-columns: minmax(0, 1fr) 14px;
    }
    .js-area .js-equipment-summary-compact.js-component-summary .js-equipment-identity {
        grid-column: 1;
        grid-row: 1;
    }
    .js-area .js-component-summary-remaining {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    .js-area .js-component-summary-actions {
        grid-column: 1 / -1;
        grid-row: 3;
        justify-self: start;
    }
    .js-area .js-equipment-summary-compact.js-component-summary::after {
        grid-column: 2;
        grid-row: 1;
    }
}

/* The date of manufacture on a spare's card, sized like the site Move form. */
.js-area .settings-field .js-inline-form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.js-area .settings-field .js-inline-form input[type="date"] {
    padding: 5px 10px;
}
.js-area .settings-field .js-inline-form .btn {
    padding: 4px 10px;
    font-size: 0.78rem;
}

.js-area .js-repeat-rows-add {
    display: flex;
    margin-top: 12px;
}

.js-area .js-table :is(th, td).js-cell-wrap { white-space: normal; }

/* A cell of controls keeps its buttons on one line and makes them small enough
   to fit. Letting them wrap put a lone Archive button under the other two,
   which reads as a mistake rather than as a layout. */
.js-area .js-table td.js-actions-cell {
    white-space: nowrap;
}

.js-area .js-table td.js-actions-cell .js-inline-form {
    display: inline-flex;
}

.js-area .js-table td.js-actions-cell .btn {
    padding: 4px 10px;
    font-size: 0.75rem;
    line-height: 1.35;
    border-radius: 5px;
    vertical-align: middle;
}

.js-area .js-table td.js-actions-cell .btn + .btn,
.js-area .js-table td.js-actions-cell .js-inline-form {
    margin-left: 6px;
}

/* The controls sit at the end of the row, so the column is only as wide as the
   buttons and the table keeps its width for the content. */
.js-area .js-table :is(th, td).js-actions-cell {
    width: 1%;
    text-align: right;
}

/* A row header is a cell, not a heading.
   styles.css styles every <th> in the application with a grey fill, uppercase
   and bold, which is right for a column header in a thead and wrong for the
   first cell of a body row. The Jump Log never showed it because its rows are
   all <td>; the Rig Log's rows name themselves with <th scope="row">, which is
   worth keeping for a screen reader, so the look is undone here instead of the
   markup being weakened. */
.js-area .js-table tbody th {
    background: transparent;
    color: var(--js-ink);
    font-size: inherit;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 1px solid var(--js-line-soft);
    padding: 11px 12px;
}
.js-area .js-table tbody tr:last-child th { border-bottom: 0; }

/* The name is the row's handle, so it carries the weight the rest gives up. */
.js-area .js-table .js-jump-link {
    font-weight: 500;
    color: var(--color-link, #0072ce);
    text-decoration: none;
}
.js-area .js-table .js-jump-link:is(:hover, :focus-visible) { text-decoration: underline; }

/* Row tints follow the stored classification. The marker and the badge say the
   same thing in shape and in words, so colour is never the only signal, and the
   tints are softer now that the outcome is spelled out in a pill. */
.js-area .js-jump-row-emergency { background: rgba(255, 48, 69, 0.055); }
.js-area .js-jump-row-critical { background: rgba(255, 48, 69, 0.03); }
.js-area .js-jump-row-warning { background: rgba(255, 191, 0, 0.05); }
.js-area .js-jump-row-emergency:hover { background: rgba(255, 48, 69, 0.085); }
.js-area .js-jump-row-critical:hover { background: rgba(255, 48, 69, 0.055); }
.js-area .js-jump-row-warning:hover { background: rgba(255, 191, 0, 0.08); }

/* Alert views: critical packed with no jump. Only the Decision text goes red
   so the flashy critical-packed-jumped row still stands out as ultimate risk.
   Cancelled packing stays off this. */
.js-area .js-table tbody tr.js-alert-row-critical-packed .js-alert-decision {
    color: var(--js-seen-critical-ink);
    font-weight: 600;
}

/* Alert views + packer history: critical + packed + jump happened. Solid
   critical fill; the attention cue is a shadow pulse around the row only.
   Ten one-second pulses (~10s), then the animation stops and the row stays
   solid red. Alert views also sorts these to the top. */
.js-area .js-table tbody tr.js-alert-row-critical-packed-jumped,
.js-area .js-table tbody tr.js-alert-row-critical-packed-jumped > :is(th, td) {
    background: var(--js-seen-critical-bg);
    color: var(--js-seen-critical-ink);
}
.js-area .js-table tbody tr.js-alert-row-critical-packed-jumped {
    position: relative;
    z-index: 1;
    animation: jsAlertCriticalPackedJumpedPulse 1s ease-in-out 10;
}
.js-area .js-table tbody tr.js-alert-row-critical-packed-jumped:hover,
.js-area .js-table tbody tr.js-alert-row-critical-packed-jumped:hover > :is(th, td) {
    background: var(--js-critical-bg);
}
.js-area .js-table tbody tr.js-alert-row-critical-packed-jumped .js-jump-link {
    color: var(--color-link, #0072ce);
}
.js-area .js-table tbody tr.js-alert-row-critical-packed-jumped .js-seen-warning-warning {
    color: var(--js-seen-warning-ink);
}
.js-area .js-table tbody tr.js-alert-row-critical-packed-jumped .js-seen-warning-critical {
    color: var(--js-seen-critical-ink);
}
.js-area .js-table tbody tr.js-alert-row-critical-packed-jumped .js-muted {
    color: rgba(171, 31, 44, 0.55);
}

@keyframes jsAlertCriticalPackedJumpedPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(217, 54, 71, 0);
    }
    50% {
        box-shadow:
            0 0 0 2px rgba(217, 54, 71, 0.7),
            0 0 16px 2px rgba(217, 54, 71, 0.45);
    }
}

@media (prefers-reduced-motion: reduce) {
    .js-area .js-table tbody tr.js-alert-row-critical-packed-jumped {
        animation: none;
        box-shadow:
            0 0 0 2px rgba(217, 54, 71, 0.7),
            0 0 10px 1px rgba(217, 54, 71, 0.35);
    }
}

/* A measurement that was never observed. Deliberately not a zero. */
.js-area .js-value-missing { opacity: 0.5; }
.js-area .js-value-altitude { color: var(--js-chart-altitude-ink, #93c5fd); }
.js-area .js-value-gload { color: var(--js-chart-gload-ink, #c5e85a); }
.js-area .js-value-turn { color: var(--js-chart-turn-ink, #c4b5fd); }
.js-area .js-value-freeFall { color: var(--js-phase-freeFall, #339cff); }
.js-area .js-value-canopy { color: var(--js-phase-canopy, #10b981); }
.js-area .js-cell-unknown { color: var(--js-warning-ink); font-weight: 600; }

/* A value past its configured limit. Red, and only ever set from the stored
   classification, never computed in a template. */
.js-area .js-value-exceeded { color: var(--js-critical-ink); font-weight: 700; }

.js-area .js-pagination {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 0.9rem;
}
.js-area .js-pagination-position { font-size: 0.85rem; opacity: 0.8; }

/* Jump detail journey: Data-tab phase strip plus findings/alerts.
   Same surface tokens as .js-panel so light mode is pale and dark mode stays
   dark. Do not fall back to near-black literals (--js-panel-bg is unused). */
.js-area .js-journey {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--js-panel-border);
    border-radius: 12px;
    background: var(--color-surface, var(--js-surface));
    color: var(--js-ink);
}
.js-area .js-journey .js-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.js-area .js-journey .js-panel-head strong {
    font-size: 0.95rem;
    color: var(--js-ink);
}
.js-area .js-journey .js-panel-head span {
    font-size: 0.8rem;
    color: var(--js-ink-muted);
}
.js-area .js-phase-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}
/* Journey strip cards only: calm pastels of the owner PHASE hues.
   Map track, chart, and header stage chips share --js-phase-* tokens. */
.js-area .js-phase-strip-seg.js-track-key {
    flex: 1 1 5.5rem;
    min-width: 5.5rem;
    height: auto;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    /* Dark ink on light pastel - white fails on yellow/cyan. */
    color: #1e293b;
}
.js-area .js-phase-strip-seg .js-phase-strip-label {
    font-size: 0.8rem;
    font-weight: 600;
}
.js-area .js-phase-strip-seg b {
    font-size: 0.9rem;
    font-weight: 700;
}
.js-area .js-phase-strip-seg.js-track-phase-exit.js-track-key { background: #bfdbfe; }
.js-area .js-phase-strip-seg.js-track-phase-freeFall.js-track-key { background: #a5f3fc; }
.js-area .js-phase-strip-seg.js-track-phase-deployment.js-track-key { background: #f5d0fe; }
.js-area .js-phase-strip-seg.js-track-phase-canopy.js-track-key { background: #bbf7d0; }
.js-area .js-phase-strip-seg.js-track-phase-landed.js-track-key { background: #fef08a; }
.js-area .js-phase-strip-seg.js-track-phase-unknown.js-track-key { background: #e5e7eb; }
.js-area .js-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}
.js-area .js-time-row {
    display: grid;
    grid-template-columns: 6.5rem 1fr 3rem;
    gap: 0.55rem;
    align-items: center;
    font-size: 0.85rem;
}
.js-area .js-time-row span { color: var(--js-ink-soft); }
.js-area .js-time-line {
    height: 0.55rem;
    border-radius: 999px;
    background: var(--js-surface-sunken);
    overflow: hidden;
}
.js-area .js-time-line i {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: inherit;
}
.js-area .js-time-row b {
    text-align: right;
    font-weight: 600;
    color: var(--js-ink-muted);
}
.js-area .js-timeline-events {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.js-area .js-timeline-event {
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}
.js-area .js-timeline-event-body {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    align-items: baseline;
}
.js-area .js-timeline-event-body strong {
    font-size: 0.9rem;
    color: var(--js-ink);
}
.js-area .js-timeline-event-body small {
    color: var(--js-ink-muted);
    font-size: 0.8rem;
}
@media (max-width: 640px) {
    .js-area .js-time-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
    .js-area .js-time-row b { text-align: left; }
    .js-area .js-phase-strip-seg { flex-basis: calc(50% - 0.2rem); }
}

/* ── The attention dashboard ───────────────────────────────────────── */

/* Site sections are full width and stacked, not a grid of tiles. A tile forces
   every list inside it to be short, and the whole point of these lists is that
   they are as long as they need to be. */
.js-area .js-site-card-wide { width: 100%; }
.js-area .js-attention-site { margin-bottom: 1rem; padding-bottom: 0; border-bottom: 0; }
.js-area .js-attention-software { margin-bottom: 1rem; padding-bottom: 0; border-bottom: 0; }

.js-area .js-domain-empty {
    margin: 0; padding: 6px 6px 2px;
    font-size: 0.85rem; color: var(--js-ink-muted, #7b8692);
}

.js-area .js-period-form { margin-bottom: 0.5rem; }
.js-area .js-period-controls {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem;
    font-size: 0.85rem;
}
.js-area .js-period-select,
.js-area .js-period-custom input {
    padding: 7px 8px;
    border: 1px solid var(--js-panel-border);
    border-radius: 8px;
    background: var(--color-surface, var(--js-surface));
    font: inherit;
}
.js-area .js-period-custom {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
}
.js-area .js-period-current { color: var(--js-ink-muted); }

/* ── Filter toggles: a dot and a label, never a filled pill ────────── */

.js-area .js-filter-toggle {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 4px 2px;
    border: 0; background: none;
    font: inherit; color: inherit;
    cursor: pointer;
}

.js-area .js-filter-toggle-dot {
    width: 9px; height: 9px; flex: 0 0 9px;
    border-radius: 50%;
    background: #b8c2cc;
}

.js-area .js-filter-toggle-on .js-filter-toggle-dot { background: #339cff; }
.js-area .js-filter-toggle-on { font-weight: 500; }

@media (max-width: 640px) {
    .js-area .js-period-controls { align-items: stretch; }
}

/* ── The site card body: jumps, phones, equipment ───────────────────── */

/*
 * Three columns, not three stacked blocks.
 *
 * They are read together: "what went wrong here, which phones need a charger,
 * and is the kit still in service". Stacking them pushed the later lists below
 * the fold on any site with more than two or three jump items, which is
 * exactly the site where somebody most needs to see all of them.
 *
 * The three columns are equal, so no list reads as more important than the
 * others; a long jump row wraps within its column.
 */
.js-area .js-site-body-split {
    display: grid;
    /* Jumps | Phones need charging | Equipment, in three equal columns. */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
}

/* The dividers between the columns. A border on the later columns rather than
   a separate element, so it cannot fall out of step with the grid. */
.js-area .js-site-body-split > .js-domain-phones,
.js-area .js-site-body-split > .js-domain-equipment {
    border-left: 1px solid var(--js-panel-divider);
}

/* The domains no longer stack, so the horizontal rule between them goes. */
.js-area .js-site-body-split > .js-domain {
    border-bottom: 0;
    padding: 12px 16px 14px;
}

/* The column headings sit on the same baseline, which is what makes the two
   lists read as one table rather than as two panels that happen to be adjacent. */
.js-area .js-site-body-split .js-domain-title {
    min-height: 18px;
    margin-bottom: 10px;
}

/* An all-clear row states a positive fact, so it is never faded. */
.js-area .js-status-row-clear { opacity: 1; }
.js-area .js-status-row-clear strong { font-weight: var(--font-weight-medium, 500); }


/*
 * On a narrow screen the columns stack and the divider becomes a horizontal
 * rule, because a 1fr column of equipment rows on a phone is unreadable.
 */
@media (max-width: 900px) {
    .js-area .js-site-body-split { grid-template-columns: 1fr; }

    /* Stacked in source order: Jumps, Phones need charging, Equipment. */
    .js-area .js-site-body-split > .js-domain-phones,
    .js-area .js-site-body-split > .js-domain-equipment {
        border-left: 0;
        border-top: 1px solid var(--js-panel-divider);
    }
}

/* ── Fixed-height site cards with a scrollable attention list ───────── */

/*
 * Every site card is the same height whatever it contains.
 *
 * The reason is comparison. A stack of cards that each grow to fit means the
 * site with the most problems is also the tallest, so scanning down the page
 * turns into scrolling past one site to reach the next. Fixed heights keep
 * every site's headline at a predictable place and make the stack readable at
 * a glance.
 *
 * The height is a custom property so it can be tuned in one place, and is set
 * in rem so it follows the reader's text size rather than fighting it.
 */
.js-area {
    /*
     * Sized to show about four attention rows plus the column heading and the
     * "N more" hint. A row is roughly 48px once its two lines of text and
     * padding are counted, the heading and card padding take about 54px, so
     * 17rem leaves room for four and a bit. Four is enough to see whether a
     * site is quiet or busy, which is what the card is for; the rest is one
     * scroll away.
     */
    --js-site-body-height: 17rem;
}

.js-area .js-site-body-split {
    height: var(--js-site-body-height);

    /*
     * These two are what make the scrolling work, and their absence is why it
     * did not.
     *
     * align-items: stretch overrides the `start` set with the two-column layout
     * above. With `start`, each column took its content height, so a column
     * taller than the card simply overflowed and was clipped by the card's
     * overflow: hidden. Nothing ever had a constrained height, so nothing had an
     * overflow to scroll.
     *
     * grid-template-rows: minmax(0, 1fr) pins the single row to the container
     * height. Without it the implicit row is `auto` and grows with its content,
     * which defeats the fixed height in the same way.
     */
    align-items: stretch;
    grid-template-rows: minmax(0, 1fr);
}

/* The column is a flex column: the title stays put and only the rows scroll.
   A scrolling heading would take the one label that says what the list is out
   of view exactly when the list is long enough to need it. */
.js-area .js-site-body-split > .js-domain {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.js-area .js-domain-rows {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    /* Explicit. There is nothing here that should ever be reached sideways: the
       rows wrap, so a horizontal scrollbar could only mean a layout fault. */
    overflow-x: hidden;

    /*
     * Scroll chaining is left ON deliberately.
     *
     * This used to be overscroll-behavior: contain, which was wrong. Contain
     * stops the scroll at the end of this list instead of passing it on, so once
     * a reader reached the bottom of one site's jumps the page stopped moving and
     * they had to physically move the pointer off the card to carry on down to
     * the next site. The card is a panel inside a document, not a separate
     * surface, so reaching its end should continue the page.
     */
    overscroll-behavior: auto;

    /* A visible, thin scrollbar. This is the fallback affordance: even with
       JavaScript unavailable, an overflowing list still shows a scrollbar and
       is still scrollable. The hint below is an enhancement on top. */
    scrollbar-width: thin;
    scrollbar-gutter: stable;
}

/* A keyboard user has to be able to reach the rows below the fold, so the
   container is focusable and says so when focused. */
.js-area .js-domain-rows:focus-visible {
    outline: 2px solid var(--js-accent-strong, #339cff);
    outline-offset: 2px;
    border-radius: 6px;
}

/* WebKit needs its own scrollbar rules, and an always-visible track reads as
   "there is more here" rather than appearing only once you already scrolled. */
.js-area .js-domain-rows::-webkit-scrollbar { width: 10px; }
.js-area .js-domain-rows::-webkit-scrollbar-track {
    background: rgba(31, 45, 61, 0.04);
    border-radius: 999px;
}
.js-area .js-domain-rows::-webkit-scrollbar-thumb {
    background: rgba(31, 45, 61, 0.22);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.js-area .js-domain-rows::-webkit-scrollbar-thumb:hover {
    background: rgba(31, 45, 61, 0.38);
    background-clip: padding-box;
}

/*
 * The overflow affordance, in three parts, because one is not enough.
 *
 * 1. A fade at the bottom edge, so the last visible row is cut rather than
 *    ending cleanly. A clean edge reads as the end of the list.
 * 2. A count of what is below, in words. "4 more" is unambiguous in a way that
 *    a gradient is not.
 * 3. The scrollbar itself, above.
 *
 * All three are driven by a class the script adds only when the list really
 * overflows, so a short list gets none of them and does not pretend to hide
 * anything.
 */
.js-area .js-domain-scrollable {
    position: relative;
}

.js-area .js-domain-scrollable .js-domain-rows {
    /* The fade is painted with a mask so it dims the rows themselves rather
       than laying a coloured band over them, which would have to match the card
       background and would break on a themed palette. */
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2.25rem), transparent 100%);
    mask-image: linear-gradient(to bottom, #000 calc(100% - 2.25rem), transparent 100%);
}

/* Scrolled to the bottom: there is nothing more below, so the fade and the
   count both go. */
.js-area .js-domain-scrolled-end .js-domain-rows {
    -webkit-mask-image: none;
    mask-image: none;
}

.js-area .js-domain-more {
    flex: 0 0 auto;
    margin: 0;
    padding: 4px 6px 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--js-ink-muted);
    pointer-events: none;
}

.js-area .js-domain-more::before {
    content: "\2193\00a0";
    font-weight: 700;
}

@media (prefers-reduced-motion: no-preference) {
    .js-area .js-domain-rows { scroll-behavior: smooth; }
}

/*
 * On a narrow screen the card stops being fixed height. The two columns are
 * already stacked there, and a 15rem box holding both would leave each list two
 * rows tall, which is worse than a taller card on a surface that scrolls
 * anyway.
 */
@media (max-width: 900px) {
    .js-area .js-site-body-split { height: auto; }
    .js-area .js-domain-rows { max-height: 13rem; }
}

/* ═════════════════════════════════════════════════════════════════════
   Equipment rows and life meters.

   Denser and quieter than the jump rows on purpose. A jump needing
   attention is an event somebody has to act on; a rig approaching its
   limit is a standing fact that wants tracking. The equipment list is
   therefore a compact table of figures rather than a list of alerts.
   ═════════════════════════════════════════════════════════════════════ */

.js-area {
    /* Life meters. The fill is the life ALREADY USED, so it grows toward the
       limit and goes red as it gets there. The unfilled remainder is the life
       left, printed as a number beside the bar so the reading never depends on
       judging a length. */
    --js-meter-track: #e2e8f0;
    --js-meter-ok: #10b981;
    --js-meter-warning: #f59e0b;
    --js-meter-critical: #ef4444;
    --js-meter-unknown: #94a3b8;
}

/* ── The site initials badge ───────────────────────────────────────── */

.js-area .js-site-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--js-pill-slate);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    /* Two capitals in a 26px circle sit high without this. */
    line-height: 1;
    user-select: none;
}

.js-area .js-avatar-indigo { background: var(--js-pill-indigo); }
.js-area .js-avatar-teal { background: var(--js-pill-teal); }
.js-area .js-avatar-amber { background: var(--js-pill-amber); }
.js-area .js-avatar-rose { background: var(--js-pill-rose); }
.js-area .js-avatar-slate { background: var(--js-pill-slate); }
.js-area .js-avatar-violet { background: var(--js-pill-violet); }

/* No accent chosen: an outlined badge rather than an invented colour. */
.js-area .js-avatar-none {
    background: transparent;
    border: 1px dashed var(--js-panel-border);
    color: var(--js-ink-muted);
}

/* ── The compact equipment row ─────────────────────────────────────── */

/*
 * Two lines: identity on the first, the two meters side by side on the second.
 *
 * Side by side rather than stacked because the pair is a comparison. The rig has
 * one life and its shortest lived component has another, and the whole point is
 * to see at a glance which of the two is the one that will take the rig out of
 * service. Stacked, that comparison becomes a scroll.
 */
.js-area .js-equipment-row-compact {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 5px;
    align-items: center;
    margin: 1px 0;
    padding: 6px 6px 7px;
    border-radius: 6px;
    background: var(--color-surface, var(--js-surface));
    color: inherit;
    text-decoration: none;
    box-sizing: border-box;
}

.js-area a.js-equipment-row-compact { cursor: pointer; }
.js-area .js-equipment-row-compact:is(:hover, :focus-visible) { background: var(--js-surface-sunken); }

/* Explicit placement, so a row with only one meter does not leave a gap where
   the second would have been. */
.js-area .js-equipment-row-compact > .js-rhombus { grid-row: 1; grid-column: 1; }
.js-area .js-equipment-row-compact > .js-equipment-identity { grid-row: 1; grid-column: 2 / -1; }
.js-area .js-equipment-row-compact > .js-meter-cell:nth-child(3) { grid-row: 2; grid-column: 2; }
.js-area .js-equipment-row-compact > .js-meter-cell:nth-child(4) { grid-row: 2; grid-column: 3; }

/* The marker is smaller here than on a jump row. Equipment is a standing state,
   not an event, so it should not shout as loudly. */
.js-area .js-equipment-row-compact > .js-rhombus {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
}
.js-area .js-equipment-row-compact > .js-rhombus::before {
    top: 2px;
    left: 1px;
    width: 11px;
    height: 11px;
}

.js-area .js-equipment-identity { min-width: 0; }

.js-area .js-equipment-identity strong {
    display: block;
    font-size: 0.86rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

/* The model and serial. These were 9.5px, the smallest text anywhere in the
   area by some way, and the model is exactly what somebody scanning this list
   is matching against. */
.js-area .js-equipment-identity small {
    display: block;
    font-size: 0.76rem;
    line-height: 1.35;
    color: var(--js-ink-muted);
    overflow-wrap: anywhere;
}

/* ── One life meter ────────────────────────────────────────────────── */

.js-area .js-meter-cell {
    display: block;
    min-width: 0;
}

.js-area .js-meter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 3px;
}

/* The part's name, as a quiet tinted label rather than a filled badge. A solid
   badge here would compete with the severity marker at the start of the row. */
.js-area .js-meter-chip {
    flex: 0 1 auto;
    min-width: 0;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(100, 116, 139, 0.12);
    color: var(--js-ink-soft);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.js-area .js-meter-chip-ok { background: rgba(16, 185, 129, 0.14); color: var(--js-ok-ink); }
.js-area .js-meter-chip-warning { background: rgba(245, 158, 11, 0.16); color: var(--js-warning-ink); }
.js-area .js-meter-chip-critical { background: rgba(239, 68, 68, 0.14); color: var(--js-critical-ink); }
.js-area .js-meter-chip-unknown { background: rgba(100, 116, 139, 0.12); color: var(--js-ink-soft); }

/* The number. Tabular figures so a column of them lines up. */
.js-area .js-meter-remaining {
    flex: 0 0 auto;
    font-size: 9.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--js-ink-label);
    white-space: nowrap;
}

/*
 * The bar itself.
 *
 * A real <progress>, so the numbers stay data and the element carries its own
 * meaning for assistive technology. Every engine needs its own pseudo-element,
 * and appearance: none has to come first or the native widget wins.
 */
.js-area progress.js-meter {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    height: 4px;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    /* Firefox and the no-pseudo-element fallback read these two. */
    background: var(--js-meter-track);
    color: var(--js-meter-unknown);
}

.js-area progress.js-meter::-webkit-progress-bar {
    background: var(--js-meter-track);
    border-radius: 999px;
}

.js-area progress.js-meter::-webkit-progress-value {
    background: currentColor;
    border-radius: 999px;
}

.js-area progress.js-meter::-moz-progress-bar {
    background: currentColor;
    border-radius: 999px;
}

/* currentColor carries the severity, so one declaration colours every engine. */
.js-area progress.js-meter-ok { color: var(--js-meter-ok); }
.js-area progress.js-meter-warning { color: var(--js-meter-warning); }
.js-area progress.js-meter-critical { color: var(--js-meter-critical); }
.js-area progress.js-meter-unknown { color: var(--js-meter-unknown); }

/* Keeps the second line's height when a part has no limit recorded, so rows in
   the list stay the same height. */
.js-area .js-meter-absent {
    display: block;
    height: 4px;
    border-radius: 999px;
    background: repeating-linear-gradient(
        90deg,
        var(--js-meter-track) 0 3px,
        transparent 3px 6px
    );
}

@media (max-width: 520px) {
    /* Two meters side by side stop being legible below this, so they stack. */
    .js-area .js-equipment-row-compact { grid-template-columns: 14px minmax(0, 1fr); }
    .js-area .js-equipment-row-compact > .js-meter-cell:nth-child(3) { grid-row: 2; grid-column: 2; }
    .js-area .js-equipment-row-compact > .js-meter-cell:nth-child(4) { grid-row: 3; grid-column: 2; }
}

/* ── Equipment page: compact rows in the dashboard's language ───────── */

/*
 * The registered equipment list is a table of figures, so it reads as one:
 * thinner rows, smaller type, and the two life meters on the same line as the
 * rig they belong to.
 *
 * It deliberately matches the dashboard's equipment column. Somebody who has
 * learnt that a red meter chip on the right means "the reserve is the problem"
 * should not have to learn it a second time on a different page, so both
 * surfaces are built from the same presenter and the same partial.
 */
/*
 * A grid with fixed tracks, not flex.
 *
 * Flex was wrong and the bars showed it. With the identity on flex-grow, the row
 * absorbed every difference in content width, so a row whose status chip read
 * "Life reached" pushed its meters left of a row reading "Normal". The bars ended
 * up at a different x on every line, which destroys the one thing a column of
 * bars is for: comparing them at a glance.
 *
 * Fixed tracks isolate the meters from everything to their left AND to their
 * right. The identity column is the only flexible one, so it absorbs the
 * variation and the bars never move.
 */
.js-area .js-equipment-summary-compact {
    display: grid;
    grid-template-columns:
        22px               /* site badge          */
        minmax(0, 1fr)     /* identity, flexible  */
        14px;              /* the details chevron */
    align-items: center;
    /* Was 56px. A row of two-line meters does not need that much air, and 11
       rigs at 56px each is a page of scrolling before anything is compared. */
    min-height: 42px;
    padding: 7px 12px;
    column-gap: 12px;
    row-gap: 6px;
}

/* The chip is right-aligned in its own fixed track, so chips of different widths
   line up with each other and still cannot move the bars. */
.js-area .js-equipment-summary-compact .js-life-chip {
    justify-self: end;
}

.js-area .js-equipment-summary-compact .js-equipment-identity {
    flex: 1 1 auto;
    min-width: 0;
}

/* A shade larger than in the dashboard column, which is narrower and denser. */
.js-area .js-equipment-summary-compact .js-equipment-identity strong {
    font-size: 12px;
    line-height: 1.35;
}

.js-area .js-equipment-summary-compact .js-equipment-identity small {
    font-size: 10px;
    line-height: 1.35;
    color: var(--color-text-muted, var(--js-ink-muted));
}

/* Fixed width, so every rig's meters start at the same place and the column of
   them can be read down. A flexible width would make each row's bar a different
   length and destroy the comparison the bars exist for. */
/* The cell fills its fixed track. The track is what holds the alignment. */
.js-area .js-equipment-summary-compact .js-meter-cell {
    min-width: 0;
}

/* The smaller avatar for a list row. */
.js-area .js-site-avatar-sm {
    width: 22px;
    height: 22px;
    font-size: 9px;
}

/*
 * Below this the meters cannot hold 152px each beside the name, so the row wraps
 * and they drop to a second line at full width. Thinner rows are not worth a
 * squashed bar.
 */
/*
 * Below this the fixed tracks no longer fit beside the name, so the row becomes
 * two lines: identity on the first, the two meters and the chip on the second.
 * The meters share the width equally, so they still align down the list.
 */
@media (max-width: 820px) {
    .js-area .js-equipment-summary-compact {
        grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 14px;
    }

    .js-area .js-equipment-summary-compact .js-equipment-identity {
        grid-column: 2 / -1;
    }

    .js-area .js-equipment-summary-compact .js-meter-cell:nth-of-type(1) {
        grid-column: 2;
    }

    .js-area .js-equipment-summary-compact .js-meter-cell:nth-of-type(2) {
        grid-column: 3;
    }

    .js-area .js-equipment-summary-compact .js-life-chip {
        grid-column: 2 / -1;
        justify-self: start;
    }
}

/* ═════════════════════════════════════════════════════════════════════
   Jump Log toolbar.

   Replaces a form of stacked labelled selects and native checkboxes. The
   selects remain, because choosing from a known list is what a select is
   for, but they are quieter and on one line. The checkboxes are gone: a
   filter is a different URL, so each quick filter is a link with a dot.
   ═════════════════════════════════════════════════════════════════════ */

.js-area .js-tracker-toolbar {
    display: grid;
    gap: 10px;
    margin: 0 0 10px;
}

.js-area .js-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* The search box leads and takes the room, because it is the control somebody
   reaches for first when they already know who or what they are looking for. */
.js-area .js-toolbar-search {
    flex: 1 1 18rem;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--js-line);
    border-radius: 10px;
    background: var(--color-surface, var(--js-surface));
    font: inherit;
    font-size: 0.87rem;
    font-weight: 400;
    color: var(--color-text, var(--js-ink));
}
.js-area .js-toolbar-search::placeholder { color: #a6aeba; font-weight: 300; }

.js-area .js-toolbar-search:focus-visible {
    outline: 2px solid var(--js-accent-strong, #339cff);
    outline-offset: 1px;
    border-color: transparent;
}

/* The count of narrowing filters. Not a button: it reports, it does not act. */
.js-area .js-toolbar-count {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid var(--js-line);
    border-radius: 10px;
    background: var(--js-surface-sunken);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--js-ink-soft);
    white-space: nowrap;
}

.js-area .js-toolbar-button {
    flex: 0 0 auto;
    padding: 9px 16px;
    border: 1px solid var(--js-line);
    border-radius: 10px;
    background: var(--color-surface, var(--js-surface));
    color: var(--js-ink-soft);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.js-area .js-toolbar-button:is(:hover, :focus-visible) {
    background: var(--js-surface-sunken);
    border-color: var(--js-line);
}

.js-area .js-toolbar-button-primary {
    border-color: transparent;
    background: #1f2d3d;
    color: #fff;
    font-weight: 500;
}

.js-area .js-toolbar-button-primary:is(:hover, :focus-visible) {
    background: #33455a;
    border-color: transparent;
}

.js-area .js-toolbar-results {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--js-ink-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* The selects. One row, each with its label above it, in a panel that reads as
   one control group rather than five loose boxes. */
.js-area .js-toolbar-selects {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 10px 14px;
    padding: 13px 15px;
    border: 1px solid var(--js-line-soft);
    border-radius: 12px;
    background: var(--js-surface-sunken);
}

.js-area .js-toolbar-field { display: grid; gap: 4px; min-width: 0; }

.js-area .js-toolbar-field label {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--js-ink-muted);
}

.js-area .js-toolbar-field select {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--js-line);
    border-radius: 9px;
    background: var(--color-surface, var(--js-surface));
    font: inherit;
    font-size: 0.84rem;
    font-weight: 400;
    color: var(--color-text, var(--js-ink));
}

/* ── The dot toggles ───────────────────────────────────────────────── */

.js-area .js-filter-toggles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
    margin: 0 0 14px;
    padding: 2px 2px 0;
}

/* Already defined further up as a generic control. These are the tracker's
   additions: it is a link here, so it needs its link colours neutralised, and
   the off state has to be legible rather than merely dim. */
.js-area a.js-filter-toggle {
    color: var(--js-ink-muted);
    font-size: 0.84rem;
    font-weight: 400;
    text-decoration: none;
    border-radius: 6px;
}

.js-area a.js-filter-toggle:is(:hover, :focus-visible) {
    color: var(--color-text, var(--js-ink));
    text-decoration: none;
}

.js-area a.js-filter-toggle:focus-visible {
    outline: 2px solid var(--js-accent-strong, #339cff);
    outline-offset: 2px;
}

/* On: a filled blue dot and full-strength text. Off: a hollow grey dot. The
   difference is a colour AND a weight AND a fill, because a colour alone is not
   enough to tell six of these apart at a glance. */
.js-area a.js-filter-toggle-on { color: var(--color-text, var(--js-ink)); font-weight: 500; }

.js-area .js-filter-toggle-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: transparent;
    box-shadow: inset 0 0 0 1.5px #b8c2cc;
}

.js-area .js-filter-toggle-on .js-filter-toggle-dot {
    background: #339cff;
    box-shadow: none;
}

@media (max-width: 640px) {
    .js-area .js-toolbar-results { margin-left: 0; width: 100%; }
    .js-area .js-filter-toggles { gap: 8px 14px; }
}

/* ═════════════════════════════════════════════════════════════════════
   Jump detail: header, tabs, track drawings, sample table.
   ═════════════════════════════════════════════════════════════════════ */

.js-area {
    /* Phase colours. One scale used by both drawings and by the legend, so a
       colour means the same thing wherever it appears on the page. */
    --js-phase-onGround: #94a3b8;
    --js-phase-aircraftClimb: #7c8b9c;
    --js-phase-aircraft: #6f74dd;
    /* Calmer stage palette (readable in light and dark). Exceedance / Critical
       breach colours stay on --js-breach-* and are not these. */
    --js-phase-exit: #9b7ae0;
    --js-phase-freeFall: #339cff;
    --js-phase-deployment: #ea580c;
    --js-phase-canopy: #10b981;
    --js-phase-landed: #475569;
    --js-phase-unknown: #b8c2cc;
    /* Soft fills under phase-coloured altitude segments. */
    --js-phase-exit-soft: color-mix(in srgb, var(--js-phase-exit) 16%, transparent);
    --js-phase-freeFall-soft: color-mix(in srgb, var(--js-phase-freeFall) 14%, transparent);
    --js-phase-deployment-soft: color-mix(in srgb, var(--js-phase-deployment) 14%, transparent);
    --js-phase-canopy-soft: color-mix(in srgb, var(--js-phase-canopy) 14%, transparent);
    --js-phase-landed-soft: color-mix(in srgb, var(--js-phase-landed) 14%, transparent);
    --js-phase-unknown-soft: color-mix(in srgb, var(--js-phase-unknown) 14%, transparent);
}

/* ── The status marker ─────────────────────────────────────────────────
 *
 * ONE definition, used by all four places a status marker appears: the pin on
 * the map, the list beside the map, the dot drawn on the chart, and the
 * chart's key.
 *
 * It used to be four, plus a fifth colour table in jumpTrack.js, and they had
 * drifted apart exactly as you would expect. The same exceedance was #ef4444 in
 * two of them and #ff3045 in the other two. Free fall had no colour at all in
 * the map list, so it fell through to a dark outline while the chart key showed
 * it blue.
 *
 * Now each kind declares its colour once, into --js-marker-colour, and the two
 * renderers below read that property. An HTML disc for the map, the list and the
 * key; an SVG circle for the drawing. Adding a kind is one line, and it cannot
 * come out a different colour in one place than another.
 */
.js-area {
    --js-marker-size: 11px;
    --js-marker-colour: var(--js-phase-freeFall);

    /* Breach colours for anomaly runs and legend swatches. Unchanged by the
       PHASES palette: amber Exceedance, red Critical Exceedance. */
    --js-breach-critical: #ff3045;
    --js-breach-warning: #f59e0b;
}

.js-area .js-marker-exit { --js-marker-colour: var(--js-phase-exit); }
.js-area .js-marker-freeFall { --js-marker-colour: var(--js-phase-freeFall); }
.js-area .js-marker-deployment { --js-marker-colour: var(--js-phase-deployment); }
.js-area .js-marker-canopyOpen { --js-marker-colour: var(--js-phase-canopy); }
.js-area .js-marker-landing { --js-marker-colour: var(--js-phase-landed); }
.js-area .js-marker-exceedance { --js-marker-colour: var(--js-breach-critical); }
/* Solid black on light and dark: theme ink was too light to see on the map. */
.js-area .js-marker-lastKnown { --js-marker-colour: #000000; }

/* Any phase without a mark of its own, which in practice is free fall. */
.js-area .js-marker-phase { --js-marker-colour: var(--js-phase-freeFall); }

/*
 * A filled disc. Status markers used to be rotated squares (rhombuses); they
 * are dots now so the Track legend, map pins and chart plot share one shape.
 * Fill only: no white ring.
 */
.js-area span.js-marker {
    display: block;
    flex: 0 0 var(--js-marker-size);
    width: var(--js-marker-size);
    height: var(--js-marker-size);
    border-radius: 50%;
    transform: none;
    background: var(--js-marker-colour);
    box-shadow: none;
}

/*
 * The same marker drawn into the chart as an SVG circle. Colour still comes
 * from --js-marker-colour via the kind class.
 */
.js-area circle.js-marker {
    fill: var(--js-marker-colour);
    stroke: none;
    stroke-width: 0;
}

/* ── A clickable tracker row ───────────────────────────────────────── */

.js-area .js-jump-row-clickable { cursor: pointer; }
/* The hover colour comes from the row rules with the tables, in both themes. */

.js-area .js-jump-link {
    color: var(--color-link, #0072ce);
    font-weight: 600;
    text-decoration: none;
}
.js-area .js-jump-link:is(:hover, :focus-visible) { text-decoration: underline; }

/* ── Detail header ────────────────────────────────────────────────── */

.js-area .js-detail-back {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--js-ink-muted);
    text-decoration: none;
}
.js-area .js-detail-back:is(:hover, :focus-visible) { color: var(--color-text, var(--js-ink)); }

.js-area .js-detail-shell {
    max-width: var(--page-max-width, 1600px);
    margin: 0 auto;
}

.js-area .js-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
}

.js-area .js-detail-header-compact {
    flex-wrap: wrap;
    gap: 6px 10px;
    padding-bottom: 8px;
    align-items: baseline;
}

.js-area .js-detail-header-compact .js-detail-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}

.js-area .js-detail-sep {
    color: var(--js-ink-muted);
    opacity: 0.7;
}

.js-area .js-detail-meta-item {
    font-size: 0.82rem;
    color: var(--js-ink-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.js-area .js-detail-identity { flex: 1 1 auto; min-width: 0; }
.js-area .js-detail-identity h2 { margin: 0 0 2px; font-size: 1.15rem; }
.js-area .js-detail-identity p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--js-ink-muted);
}
.js-area .js-detail-provenance { font-size: 0.76rem !important; opacity: 0.9; }

.js-area .js-detail-outcome {
    flex: 0 0 auto;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.js-area .js-detail-outcome-ok { background: rgba(16, 185, 129, 0.14); color: var(--js-ok-ink); }
.js-area .js-detail-outcome-warning { background: rgba(245, 158, 11, 0.18); color: var(--js-warning-ink); }
.js-area .js-detail-outcome-critical { background: rgba(239, 68, 68, 0.16); color: var(--js-critical-ink); }

.js-area .js-detail-download {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 0 0 12px;
}
.js-area .js-detail-download .js-hint {
    margin: 0;
    font-size: 0.78rem;
}

/* The summary figures. Tabular numerals so a column of them can be compared. */
/* A column, not a strip. Ten cards across the top cost a fifth of the window
   before the map started; down the side they cost the width of one card. */
.js-area .js-detail-metrics {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

.js-area .js-detail-metric {
    display: grid;
    gap: 1px;
    padding: 8px 10px;
    border: 1px solid var(--js-panel-border);
    border-radius: 9px;
    background: var(--color-surface, var(--js-surface));
}

.js-area .js-detail-metric-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--js-ink-muted);
}

.js-area .js-detail-metric-value {
    font-size: 1.05rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.js-area .js-detail-metric-unit {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--js-ink-muted);
}

.js-area .js-detail-metric-limit {
    font-size: 0.66rem;
    color: var(--js-ink-muted);
}

.js-area .js-detail-findings {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.js-area .js-detail-finding {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid var(--js-panel-border);
    border-radius: 8px;
    background: var(--color-surface, var(--js-surface));
}
.js-area .js-detail-finding strong { font-size: 0.8rem; }
.js-area .js-detail-finding small {
    font-size: 0.7rem;
    color: var(--js-ink-muted);
}

/* ── Tabs (Flight underline style; Jump accent green) ─────────────── */

.js-area .js-detail-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 2px solid var(--js-panel-border, #e5e7eb);
    margin-bottom: 12px;
}

.js-area .js-detail-tab {
    padding: 10px 20px;
    appearance: none;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    margin-bottom: -2px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--js-ink-muted);
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}

.js-area .js-detail-tab:is(:hover, :focus-visible) {
    color: var(--color-text, var(--js-ink));
}

.js-area .js-detail-tab-active {
    color: var(--js-accent-text, #5c7300);
    border-bottom-color: var(--js-accent, #a7cc00);
    background: transparent;
}

/* ── The track drawings ───────────────────────────────────────────── */

.js-area .js-track-svg {
    display: block;
    width: 100%;
    height: auto;
    /* The drawing carries its own meaning through shape, so it must not be the
       only thing on the page: the marker list beside it says the same in words. */
    overflow: visible;
}

.js-area .js-track-profile { max-height: 340px; }
.js-area .js-track-plan { max-height: 560px; }

.js-area .js-track-plan-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 15rem;
    gap: 16px;
    align-items: start;
}

/* Map takes the full panel width - phase legend removed; stages use header colours. */
.js-area .js-track-plan-body-full {
    grid-template-columns: minmax(0, 1fr);
}

.js-area .js-map-view-controls {
    margin-bottom: 0.65rem;
}

.js-area .js-descent-model-host {
    min-width: 0;
}

.js-area .js-descent-model-host .js-descent-canvas,
.js-area .js-track-plan-body-full .js-jump-map {
    min-height: 520px;
}

/* A phase line. Round joins, because a jump track has no corners in reality and
   mitred joins on a noisy GPS trace produce spikes that were never flown. */
.js-area .js-track-line {
    fill: none;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.js-area .js-track-phase-onGround { stroke: var(--js-phase-onGround); }
.js-area .js-track-phase-aircraftClimb { stroke: var(--js-phase-aircraftClimb); }
.js-area .js-track-phase-aircraft { stroke: var(--js-phase-aircraft); }
.js-area .js-track-phase-exit { stroke: var(--js-phase-exit); }
.js-area .js-track-phase-freeFall { stroke: var(--js-phase-freeFall); }
.js-area .js-track-phase-deployment { stroke: var(--js-phase-deployment); stroke-width: 5; }
.js-area .js-track-phase-canopy { stroke: var(--js-phase-canopy); }
.js-area .js-track-phase-landed { stroke: var(--js-phase-landed); }
.js-area .js-track-phase-unknown {
    stroke: var(--js-phase-unknown);
    /* Dashed, because an unknown phase is not a path somebody flew. */
    stroke-dasharray: 6 6;
}

.js-area .js-track-baseline { stroke: #cbd5e1; stroke-width: 1.5; }

.js-area .js-track-reference {
    stroke: #94a3b8;
    stroke-width: 1.5;
    stroke-dasharray: 7 5;
}

/* The hard deck is the one reference line that means somebody could die. */
.js-area .js-track-reference-critical { stroke: #ef4444; stroke-width: 2; }

.js-area .js-track-reference-label {
    fill: #64748b;
    font-size: 13px;
    font-weight: 600;
}

.js-area .js-track-scale-bar { stroke: #64748b; stroke-width: 3; }
.js-area .js-track-scale-label { fill: #64748b; font-size: 15px; font-weight: 700; }

/* ── The side panel beside the plan view ──────────────────────────── */

.js-area .js-track-side { min-width: 0; }

.js-area .js-track-side-heading {
    margin: 0 0 6px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--js-ink-muted);
}

.js-area .js-track-legend,
.js-area .js-track-marker-list,
.js-area .js-track-gap-list {
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 5px;
    font-size: 0.8rem;
}

.js-area .js-track-legend li,
.js-area .js-track-marker-list li {
    display: flex;
    align-items: flex-start;
    gap: 7px;
}

/* The legend swatch is a short line, not a square: it stands for a line on the
   drawing, and a square would read as an area. */
.js-area .js-track-key {
    flex: 0 0 16px;
    height: 3.5px;
    margin-top: 7px;
    border-radius: 999px;
    background: currentColor;
}

.js-area .js-track-phase-onGround.js-track-key { background: var(--js-phase-onGround); }
.js-area .js-track-phase-aircraftClimb.js-track-key { background: var(--js-phase-aircraftClimb); }
.js-area .js-track-phase-aircraft.js-track-key { background: var(--js-phase-aircraft); }
.js-area .js-track-phase-exit.js-track-key { background: var(--js-phase-exit); }
.js-area .js-track-phase-freeFall.js-track-key { background: var(--js-phase-freeFall); }
.js-area .js-track-phase-deployment.js-track-key { background: var(--js-phase-deployment); }
.js-area .js-track-phase-canopy.js-track-key { background: var(--js-phase-canopy); }
.js-area .js-track-phase-landed.js-track-key { background: var(--js-phase-landed); }
.js-area .js-track-phase-unknown.js-track-key { background: var(--js-phase-unknown); }

/* Layout only. The marker's appearance is shared, this just lines it up with
   the first line of a label that may wrap to two. */
.js-area .js-track-marker-list .js-marker { margin-top: 4px; }

.js-area .js-track-marker-text strong { display: block; font-size: 0.78rem; }
.js-area .js-track-marker-text small {
    display: block;
    font-size: 0.7rem;
    color: var(--js-ink-muted);
}

.js-area .js-track-gap-list li {
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.1);
    font-size: 0.75rem;
}
.js-area .js-track-gap-list small {
    display: block;
    color: var(--js-ink-muted);
}

/* ── The sample table ─────────────────────────────────────────────── */

/* Samples sit under the chart inside the same Data panel. Not a second panel. */
.js-area .js-data-under-chart {
    border-top: 2px solid var(--js-panel-border);
    background: var(--color-surface-alt, rgba(127, 127, 127, 0.06));
}
.js-area .js-data-under-chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px 4px;
}
.js-area .js-data-under-chart-head strong {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--color-text, var(--js-ink));
}
.js-area .js-data-under-chart-summary {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--js-ink-muted);
}
.js-area .js-data-under-chart-body {
    padding-top: 4px;
}
.js-area .js-data-under-chart .js-table-scroll {
    border-top: 1px solid var(--js-panel-divider);
}

.js-area .js-filter-group-label {
    margin: 10px 0 5px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--js-ink-muted);
}

.js-area .js-filter-toggle-count {
    font-size: 0.7rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--js-ink-muted);
}

.js-area .js-sample-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.js-area .js-sample-table :is(th, td) {
    padding: 5px 10px;
    border-bottom: 1px solid var(--js-line);
    white-space: nowrap;
}

.js-area .js-sample-table th {
    position: sticky;
    top: 0;
    /* The header stays put through 250 rows of scrolling, which is the only way
       the ninth column is still identifiable at the bottom of the page. */
    background: var(--color-surface, var(--js-surface));
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--js-ink-muted);
}

.js-area .js-sample-cell-end { text-align: right; }
.js-area .js-sample-cell-start { text-align: left; }

.js-area .js-sample-row-warning { background: rgba(255, 191, 0, 0.08); }
.js-area .js-sample-row-critical { background: rgba(255, 48, 69, 0.09); }

@media (max-width: 900px) {
    .js-area .js-track-plan-body { grid-template-columns: 1fr; }
    .js-area .js-track-plan { max-height: 420px; }
}

/* ── Exceedance overlays and the descent rate graph ─────────────────── */

/*
 * A breached run drawn over the phase line.
 *
 * Thicker than the phase line and drawn after it, so it reads as an annotation
 * ON the track rather than as a different track. The phase colour stays visible
 * either side of it, which is what lets somebody see that the breach happened
 * under canopy rather than in free fall.
 *
 * Round caps so a single-sample breach renders as a visible dot rather than a
 * hairline nobody notices.
 */
.js-area .js-track-exceeded {
    stroke-width: 6;
    stroke-linecap: round;
    opacity: 0.92;
}

.js-area .js-track-exceeded-critical { stroke: var(--js-breach-critical); }
.js-area .js-track-exceeded-warning { stroke: var(--js-breach-warning); }

/* The same two colours as swatches in the key. */
.js-area .js-track-key.js-track-exceeded-critical { background: var(--js-breach-critical); height: 5px; }
.js-area .js-track-key.js-track-exceeded-warning { background: var(--js-breach-warning); height: 5px; }

/* A threshold that is a breach when crossed, as opposed to one that is simply a
   reference. Amber rather than red: crossing a review limit wants a look, not an
   alarm. */
.js-area .js-track-reference-warning {
    stroke: var(--js-breach-warning);
    stroke-width: 1.8;
    stroke-dasharray: 7 5;
}

.js-area .js-track-speed { max-height: 240px; }

/* ── The ground track map ──────────────────────────────────────────── */

.js-area .js-jump-map {
    width: 100%;
    height: 520px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--js-surface-sunken);
}

/* Shown until MapLibre replaces it, and left in place if the library never
   arrives. The phases, markers and gaps beside it carry the same information in
   words, so a failed map is a degraded page rather than a broken one. */
.js-area .js-jump-map-fallback {
    margin: 0;
    padding: 16px;
    font-size: 0.85rem;
    color: var(--js-ink-muted);
}

/*
 * A track marker on the map: a rhombus, like every other fixed-event marker.
 *
 * Two elements, not one. MapLibre positions a marker by writing `transform` on
 * the element it is handed, so rotating that element is not possible: the next
 * map move overwrites it. The outer span is MapLibre's to position and the inner
 * one carries the rotation.
 */
.js-area .js-map-marker {
    display: block;
    width: var(--js-marker-size);
    height: var(--js-marker-size);
    cursor: pointer;
}


/* ── The combined altitude and descent rate chart ──────────────────── */

/*
 * The two series colours, defined once.
 *
 * They were six scattered hex values across the line, the area fill, the dot,
 * the tooltip dot, the legend swatch and the axis label, which is exactly how a
 * chart ends up with a legend that does not match its line. Now each series has
 * one token and three derived shades from it.
 *
 * The axis label is darkened and the tooltip dot lightened on purpose: the label
 * is small text on white and needs the contrast, and the dot sits on a dark
 * tooltip where the full-strength colour goes muddy.
 */
.js-area {
    /* Match Flight Story Data tab: blue altitude + fill, orange descent. */
    --js-chart-altitude: #3b82f6;
    --js-chart-altitude-ink: #2563eb;
    --js-chart-altitude-soft: rgba(59, 130, 246, 0.10);
    --js-chart-altitude-light: #60a5fa;

    --js-chart-rate: #f59e0b;
    --js-chart-rate-ink: #d97706;
    --js-chart-rate-light: #fbbf24;

    /* Horizontal grid / baseline. Dark theme overrides these on .js-area. */
    --js-chart-grid: #eef1f4;
    --js-chart-baseline: #cbd5e1;

    /* Phone-measured G-load series (matches Jump Story accent). */
    --js-chart-gload: #a7cc00;
    --js-chart-gload-ink: #6b8500;

    /* Turn figures: their own calm ink, never the red an exceedance uses. */
    --js-chart-turn-ink: #6d28d9;

    /* Chart details tooltip - light panel / dark ink in light theme. */
    --js-chart-tooltip-bg: #ffffff;
    --js-chart-tooltip-ink: #1f2d3d;
    --js-chart-tooltip-muted: #53606c;
    --js-chart-tooltip-border: #d0d7e0;
    --js-chart-tooltip-shadow: 0 6px 18px rgba(31, 45, 61, 0.18);
    --js-chart-tooltip-divider: rgba(31, 45, 61, 0.12);
    --js-chart-tooltip-breach: #ab1f2c;
}

.js-area .js-jump-chart { max-height: 380px; }

.js-area .js-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-bottom: 10px;
    font-size: 0.78rem;
    color: var(--js-ink-label);
}

.js-area .js-chart-legend-entry { display: inline-flex; align-items: center; gap: 6px; }

.js-area .js-chart-swatch {
    width: 14px;
    height: 4px;
    flex: 0 0 14px;
    border-radius: 999px;
}

/* Altitude is solid Flight blue (stage colours live in the header row). */
.js-area .js-chart-swatch-altitude {
    background: var(--js-chart-altitude);
}
.js-area .js-chart-swatch-rate { background: var(--js-chart-rate); }
.js-area .js-chart-swatch-gload { background: var(--js-chart-gload); }
.js-area .js-chart-swatch-critical { background: var(--js-breach-critical); height: 5px; }
.js-area .js-chart-swatch-warning { background: var(--js-breach-warning); height: 5px; }

.js-area .js-chart-grid { stroke: var(--js-chart-grid); stroke-width: 1; }
.js-area .js-chart-baseline { stroke: var(--js-chart-baseline); stroke-width: 1.5; }

.js-area .js-chart-axis-label { fill: #94a3b8; font-size: 16px; font-weight: 600; }
.js-area .js-chart-axis-title {
    fill: #94a3b8;
    font-size: 18px;
    font-weight: 700;
}
/* Each axis label takes the colour of the series it belongs to, because the two
   scales are unrelated and reading a rate off the altitude axis would be wrong. */
.js-area .js-chart-axis-left { fill: var(--js-chart-altitude-ink); }
.js-area .js-chart-axis-right { fill: var(--js-chart-rate-ink); }
.js-area .js-chart-axis-gload { fill: var(--js-chart-gload-ink); }

/* Altitude: filled area under the line (phase soft fills when segmented). */
.js-area .js-chart-altitude-area { fill: var(--js-chart-altitude-soft); stroke: none; }
.js-area .js-chart-altitude-area.js-track-phase-exit { fill: var(--js-phase-exit-soft); }
.js-area .js-chart-altitude-area.js-track-phase-freeFall { fill: var(--js-phase-freeFall-soft); }
.js-area .js-chart-altitude-area.js-track-phase-deployment { fill: var(--js-phase-deployment-soft); }
.js-area .js-chart-altitude-area.js-track-phase-canopy { fill: var(--js-phase-canopy-soft); }
.js-area .js-chart-altitude-area.js-track-phase-landed { fill: var(--js-phase-landed-soft); }
.js-area .js-chart-altitude-area.js-track-phase-unknown { fill: var(--js-phase-unknown-soft); }

.js-area .js-chart-altitude-line {
    fill: none;
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}
/* Fallback stroke only when the line is not split into stage segments. */
.js-area .js-chart-altitude-line:not(.js-chart-phase-line) {
    stroke: var(--js-chart-altitude);
}
/* Chart stage segments reuse map phase stroke tokens; keep chart weight even.
   butt caps so shared stage vertices do not read as colourful discs. */
.js-area .js-jump-chart .js-chart-phase-line {
    fill: none;
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: butt;
}
.js-area .js-jump-chart .js-chart-phase-line.js-track-phase-deployment {
    stroke-width: 2.5;
}

/* Chart stage legend uses the same short line swatches as the Track key. */
.js-area .js-chart-legend-markers .js-track-key {
    margin-top: 0;
    align-self: center;
}

/* Descent rate: a line only. Filling both would make one hide the other. */
.js-area .js-chart-rate-line {
    fill: none;
    stroke: var(--js-chart-rate);
    stroke-width: 2;
    stroke-linejoin: round;
}

.js-area .js-chart-reference { stroke: #94a3b8; stroke-width: 1.5; stroke-dasharray: 7 5; }
.js-area .js-chart-reference-critical { stroke: #ef4444; stroke-width: 2; }
.js-area .js-chart-reference-warning { stroke: var(--js-breach-warning); stroke-width: 1.8; stroke-dasharray: 7 5; }
.js-area .js-chart-reference-limit {
    stroke: #c084fc;
    stroke-width: 2;
    stroke-dasharray: 2 5;
}

@media (max-width: 900px) {
    .js-area .js-jump-map { height: 380px; }
}

/* ── The chart readout that follows the pointer ─────────────────────── */

/* A positioned frame, so the HTML readout can sit over the SVG. */
.js-area .js-chart-frame { position: relative; }

/* The vertical guide at the sample under the pointer. */
.js-area .js-chart-guide {
    stroke: #94a3b8;
    stroke-width: 1;
    stroke-dasharray: 4 4;
    pointer-events: none;
}

/* Series readout dots (hover). Smaller and shinier than flat status markers. */
.js-area .js-chart-dot {
    stroke: rgba(255, 255, 255, 0.95);
    stroke-width: 1.25;
    paint-order: stroke;
    pointer-events: none;
    filter:
        drop-shadow(0 1px 1.5px rgba(15, 23, 42, 0.45))
        drop-shadow(0 0 2px rgba(255, 255, 255, 0.65));
}

.js-area .js-chart-dot-altitude { fill: var(--js-chart-altitude); }
.js-area .js-chart-dot-rate { fill: var(--js-chart-rate); }
.js-area .js-chart-dot-gload { fill: var(--js-chart-gload); }

/* SVG UA styles do not always honour [hidden]; keep idle dots/guides off-plot. */
.js-area .js-jump-chart .js-chart-dot[hidden],
.js-area .js-jump-chart .js-chart-guide[hidden] {
    display: none !important;
}

/*
 * The readout.
 *
 * Theme tokens: light mode uses a light panel with dark ink (readable values);
 * dark mode uses a dark panel with light ink. Position is set in JS next to the
 * pointer / active panel so stacked graphs keep the shared details on-screen.
 *
 * pointer-events: none matters: without it the readout would sit under the
 * cursor, take the pointer events itself, and the chart would stop updating the
 * moment the tooltip caught up with the mouse.
 */
.js-area .js-chart-tooltip {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    min-width: 11rem;
    max-width: min(22rem, calc(100% - 16px));
    padding: 9px 12px;
    border-radius: 9px;
    border: 1px solid var(--js-chart-tooltip-border);
    background: var(--js-chart-tooltip-bg);
    color: var(--js-chart-tooltip-ink);
    font-size: 0.8rem;
    line-height: 1.45;
    box-shadow: var(--js-chart-tooltip-shadow);
    pointer-events: none;
}

.js-area .js-chart-tooltip p { margin: 0; color: inherit; }

.js-area .js-chart-tooltip-time {
    margin-bottom: 4px !important;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--js-chart-tooltip-ink);
}

.js-area .js-chart-tooltip-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-variant-numeric: tabular-nums;
    color: var(--js-chart-tooltip-ink);
}

/* Larger here than on the drawing: the readout is being read, the drawing is
   being scanned. */
.js-area .js-chart-tooltip-dot {
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    border-radius: 50%;
}

.js-area .js-chart-tooltip-dot-altitude { background: var(--js-chart-altitude); }
.js-area .js-chart-tooltip-dot-rate { background: var(--js-chart-rate); }
.js-area .js-chart-tooltip-dot-gload { background: var(--js-chart-gload); }

.js-area .js-chart-tooltip-phase {
    margin-top: 4px !important;
    font-size: 0.72rem;
    color: var(--js-chart-tooltip-muted);
}

/* Tooltip border follows the inspected sample's exceedance severity. */
.js-area .js-chart-tooltip-warning {
    box-shadow: 0 0 0 2px var(--js-breach-warning), var(--js-chart-tooltip-shadow);
}
.js-area .js-chart-tooltip-critical {
    box-shadow: 0 0 0 2px var(--js-breach-critical), var(--js-chart-tooltip-shadow);
}
.js-area .js-chart-tooltip-warning .js-chart-tooltip-phase,
.js-area .js-chart-tooltip-warning .js-chart-tooltip-exceedance {
    color: var(--js-breach-warning);
}
.js-area .js-chart-tooltip-critical .js-chart-tooltip-phase,
.js-area .js-chart-tooltip-critical .js-chart-tooltip-exceedance {
    color: var(--js-chart-tooltip-breach);
}

/* The chart takes pointer events; everything drawn on it does not, so the
   nearest-sample lookup is never interrupted by the furniture it just moved. */
.js-area .js-jump-chart { cursor: crosshair; }
.js-area .js-jump-chart polyline,
.js-area .js-jump-chart polygon,
.js-area .js-jump-chart line,
.js-area .js-jump-chart circle,
.js-area .js-jump-chart text { pointer-events: none; }

/* ── Chart sizing for the wider canvas ─────────────────────────────── */

/*
 * Everything inside the SVG is in viewBox units, so widening the canvas from
 * 1000 to 1800 shrank every label and dot by the same factor. These sizes are
 * scaled back up to land at roughly the same rendered size as before.
 *
 * The panel also gives up its side padding here: the chart is the widest thing
 * on the page and 13px of gutter each side is 26px of horizontal room a four
 * minute descent can use.
 */
.js-area .js-panel-body-chart { padding-left: 4px; padding-right: 4px; }

.js-area .js-jump-chart {
    /* Was capped at 380px, which fought the wider aspect and letterboxed it. */
    max-height: none;
}

.js-area .js-chart-axis-label { font-size: 16px; }
.js-area .js-chart-axis-label-major { font-size: 17px; font-weight: 700; fill: #64748b; }
.js-area .js-chart-axis-title { font-size: 18px; font-weight: 700; }
.js-area .js-jump-chart .js-track-reference-label {
    font-size: 15px;
    /* A halo in the card colour so a label stays legible where a series crosses it. */
    paint-order: stroke;
    stroke: var(--js-surface);
    stroke-width: 5px;
    stroke-linejoin: round;
}
.js-area .js-jump-chart .js-track-reference-label-critical { fill: #ef4444; }
.js-area .js-jump-chart .js-track-reference-label-warning { fill: var(--js-breach-warning); }
.js-area .js-jump-chart .js-track-reference-label-limit { fill: #d8b4fe; font-weight: 700; }
[data-js-theme="dark"] .js-area .js-jump-chart .js-track-reference-label:not(.js-track-reference-label-critical):not(.js-track-reference-label-warning),
html:not([data-js-theme="light"]) .js-area .js-jump-chart .js-track-reference-label:not(.js-track-reference-label-critical):not(.js-track-reference-label-warning) {
    fill: var(--js-ink-soft);
}
[data-js-theme="dark"] .js-area .js-chart-axis-label-major,
html:not([data-js-theme="light"]) .js-area .js-chart-axis-label-major {
    fill: #c3cbd8;
}

.js-area .js-chart-tick { stroke: #cbd5e1; stroke-width: 1.5; }
.js-area .js-chart-tick-major { stroke: #94a3b8; stroke-width: 2; }

/* ── Chart markers: filled, not hollow ─────────────────────────────── */

/*
 * They were white-filled rings with a coloured edge, which at this scale read as
 * empty holes punched in the line: the shape they were annotating showed through
 * the middle of each one.
 *
 * Filled with the marker's own colour and ringed in white instead. The ring is
 * what separates the marker from the line underneath, and the fill is what makes
 * it look like a deliberate mark rather than a gap.
 */
/* The key sits tight against the series legend above it. */
.js-area .js-chart-legend-markers { margin-top: -4px; }

/*
 * Pointer dots glide between samples and contract while moving.
 * Resting radius is set in the SVG (smaller than status marker discs).
 */
.js-area .js-chart-dot {
    transform-box: fill-box;
    transform-origin: center;
    transition: cx 90ms linear, cy 90ms linear;
}

.js-area .js-chart-dot-pop { animation: jsChartDotSettle 220ms ease-out; }

@keyframes jsChartDotSettle {
    /* Small on arrival, then eased back out to the resting size. */
    0% { transform: scale(0.55); }
    70% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

/* No motion means no glide and no pop. The dots still track the pointer, they
   just arrive instantly. */
@media (prefers-reduced-motion: reduce) {
    .js-area .js-chart-dot { transition: none; }
    .js-area .js-chart-dot-pop { animation: none; }
}


/* The named limit in the chart readout. Its own line, in the critical tint, so
   it reads as the exceptional thing on the card rather than as more context. */
.js-area .js-chart-tooltip-exceedance {
    margin-top: 5px !important;
    padding-top: 5px;
    border-top: 1px solid var(--js-chart-tooltip-divider);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--js-chart-tooltip-breach);
}

/* ── The emergency audit on a jump ──────────────────────────────────── */

/*
 * Where an emergency is read back after the fact, because the alarm itself is
 * dismissed by whoever acknowledges it.
 *
 * Quiet, unlike the alarm. Nothing here is happening now, and styling a record
 * of a past incident as urgently as a live one teaches people to ignore the
 * live one.
 */
.js-area .js-emergency-audit {
    margin: 0.6rem 0 0;
    padding: 0;
    border: 1px solid rgba(164, 22, 26, 0.28);
    border-radius: 8px;
    background: rgba(164, 22, 26, 0.04);
}
.js-area .js-emergency-audit-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    padding: 7px 12px;
    cursor: pointer;
    list-style: none;
    font-size: 0.85rem;
    line-height: 1.35;
}
.js-area .js-emergency-audit-summary::-webkit-details-marker { display: none; }
.js-area .js-emergency-audit-summary::marker { content: ''; }
.js-area .js-emergency-audit-summary::before {
    content: '▸';
    color: var(--js-ink-muted);
    font-size: 0.75rem;
}
.js-area .js-emergency-audit[open] > .js-emergency-audit-summary::before { content: '▾'; }
.js-area .js-emergency-audit-summary-meta {
    color: var(--js-ink-muted);
    font-size: 0.78rem;
    flex: 1 1 14rem;
    min-width: 0;
}
.js-area .js-emergency-audit[open] .js-emergency-audit-grid {
    padding: 0 12px 10px;
}
.js-area .js-emergency-audit-title {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem;
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
}
.js-area .js-emergency-audit-status {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.65;
}
.js-area .js-emergency-audit-line { margin: 0.2rem 0 0; font-size: 0.85rem; }
.js-area .js-emergency-audit-headline { font-weight: 700; }

.js-area .js-emergency-audit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.8rem;
    margin-top: 0.4rem;
}
.js-area .js-emergency-audit-list-title {
    margin: 0 0 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    opacity: 0.65;
}
.js-area .js-emergency-audit-empty { margin: 0; font-size: 0.82rem; opacity: 0.6; }
.js-area .js-emergency-audit-rows {
    margin: 0; padding: 0; list-style: none;
    display: grid; gap: 0.35rem;
}
.js-area .js-emergency-audit-rows li { font-size: 0.82rem; }
.js-area .js-emergency-audit-rows strong { display: block; }
.js-area .js-emergency-audit-rows span { opacity: 0.7; }

/* ───────────────────────────────────────────────────────────────────
   Rig Log

   The equipment counterpart of the Jump Log. Every colour, marker and
   badge here already existed: the rhombus, the pills, the life chips and
   the meters are the shared ones, so a severity looks the same on this
   page as it does on the dashboard and the Equipment page.

   What is new is only layout, because a rig's story is a vertical list of
   events and nothing else in the area renders one.
   ─────────────────────────────────────────────────────────────────── */

/* The identity line of a list row: the rig name and its state badge, side by
   side and wrapping together.

   The badge sits INSIDE the identity block rather than in a column of its own,
   because js-equipment-row-compact places its children by :nth-child and
   expects exactly marker, identity, meter, meter. An extra child pushes both
   meters into the wrong cells. */
.js-area .js-rig-identity-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* The header of one rig's story: state, life and status side by side. */
.js-area .js-rig-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

/* ── Restrictions ─────────────────────────────────────────────────── */

.js-area .js-restriction-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 4px 0 12px;
}

.js-area .js-restriction {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--js-surface-sunken);
    /* The severity is carried by a left edge as well as by the marker, so
       the difference between a warning and a refusal survives a
       monochrome screen and a colour blind reader. */
    border-left: 3px solid var(--js-severity-warning, #ffbf00);
}

.js-area .js-restriction-critical {
    border-left-color: var(--js-severity-critical, #ff3045);
    background: var(--js-critical-bg);
}

.js-area .js-restriction-information {
    border-left-color: var(--js-pill-slate, #7c8b9c);
}

.js-area .js-restriction small {
    display: block;
    margin-top: 2px;
    color: var(--js-ink-soft);
    font-size: 12px;
}

/* ── Filters ──────────────────────────────────────────────────────── */

.js-area .js-story-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.js-area .js-story-filter {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--js-line);
    background: var(--js-surface);
    color: var(--js-ink-soft);
    font-size: 13px;
    text-decoration: none;
}

.js-area .js-story-filter:hover { border-color: var(--js-line); }

.js-area .js-story-filter-on {
    /* The chosen filter is the page's ink, inverted. A fixed near-black chip
       disappeared into a dark page. */
    background: var(--js-ink);
    border-color: var(--js-ink);
    color: var(--js-surface);
    font-weight: 500;
}

/* ── The story itself ─────────────────────────────────────────────── */

.js-area .js-story-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.js-area .js-story-entry {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--js-line);
}

.js-area .js-story-entry:last-child { border-bottom: none; }

.js-area .js-story-entry > .js-rhombus { margin-top: 4px; }

.js-area .js-story-entry-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.js-area .js-story-entry-head { margin: 0; font-size: 14px; }

.js-area .js-story-entry-who,
.js-area .js-story-entry-detail,
.js-area .js-story-entry-delay {
    margin: 0;
    font-size: 12.5px;
    color: var(--js-ink-soft);
    /* A long reason wraps rather than pushing the page sideways. */
    overflow-wrap: anywhere;
}

/* A delayed upload is a fact the reader needs, so it is marked rather than
   left to look like an ordinary line. */
.js-area .js-story-entry-delay {
    color: var(--js-warning-ink);
}

/* Only a row that actually moved a count carries this. */
.js-area .js-story-delta {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--js-info-bg);
    color: var(--js-info-ink);
    font-size: 12px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.js-area .js-story-pagination {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--js-ink-soft);
}

/* A tag identifier is transcribed and read aloud, so it gets a monospace
   face where digits and letters cannot be confused. */
.js-area .js-mono {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 13px;
}

@media (max-width: 700px) {
    .js-area .js-rig-state { min-width: 0; }
    .js-area .js-story-entry { grid-template-columns: 14px 1fr; gap: 9px; }
}

/* The marker on a rig's own page is larger: it is the page's own status
   rather than one of a column of them. */
.js-area .js-rig-header .js-rhombus {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
}

.js-area .js-rig-header .js-rhombus::before {
    top: 1px;
    left: 1px;
    width: 24px;
    height: 24px;
}

/* ── Rig Log list row ──────────────────────────────────────────────
   Its own grid rather than js-equipment-row-compact, because that one
   places children by :nth-child and expects exactly marker, identity,
   meter, meter. This row carries more: the site, the model, what is
   fitted, and two figures. Sharing the class would have meant fighting
   its placement rules on every change.

   Everything inside is still the shared vocabulary: the site avatar, the
   rhombus, the badges and the life meter are all the existing ones.
   ────────────────────────────────────────────────────────────────── */

.js-area .js-rig-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* One line. It was a four column grid holding a marker, badges, a component
   strip, two figures and a progress bar, and the effect of putting everything
   that was true on every row was that nothing stood out. A flex line in reading
   order, with the only urgent thing pushed to the end, does the job the list
   exists for. An open take keeps an assigned-to badge on the card; opening
   the card goes straight to history (Not jumped lives on that history row). */
.js-area a.js-rig-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--color-surface, var(--js-surface));
    border: 1px solid var(--js-line);
    color: inherit;
    text-decoration: none;
}

.js-area a.js-rig-row:is(:hover, :focus-visible) {
    background: var(--js-surface-sunken);
}

.js-area .js-rig-row:is(:hover, :focus-visible) {
    background: var(--js-surface-sunken);
    border-color: var(--js-line);
}

/* Not jumped sits in the Jump cell of an open take on the rig history. */
.js-area .js-history-not-jumped {
    display: inline-flex;
    margin: 0;
}

/* A take this skydiver lost when another skydiver tapped the same open
   unused packing. Kept in their history as evidence, struck through so it
   does not look like they still hold the rig. */
.js-area tr.js-history-row-superseded td,
.js-area tr.js-history-row-superseded th {
    color: var(--color-text-muted, var(--js-ink-muted));
    text-decoration: line-through;
}

.js-area .js-rig-row-retired,
.js-area .js-rig-row-retired:is(:hover, :focus-visible) {
    background: var(--js-surface-sunken);
    border-color: var(--js-line);
    color: var(--js-ink-muted);
}

.js-area .js-rig-row-retired .js-site-avatar {
    filter: grayscale(0.8);
    opacity: 0.7;
}

.js-area :is(.js-rig-row-retired, .js-equipment-row-retired) :is(
    .js-rig-remaining,
    .js-rig-attention-item,
    .js-fitted-yes,
    .js-fitted-no
) {
    color: var(--js-ink-muted);
}

.js-area .js-equipment-row-retired {
    background: var(--js-surface-sunken);
    border-color: var(--js-line);
}

.js-area .js-equipment-row-retired > .js-equipment-summary {
    color: var(--js-ink-muted);
}

.js-area .js-equipment-row-retired > .js-equipment-summary .js-site-avatar {
    filter: grayscale(0.8);
    opacity: 0.7;
}

.js-area .js-equipment-title-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.js-area .js-equipment-title-line > strong {
    display: inline;
}

.js-area .js-rig-retire-action,
.js-area .js-rig-pane-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 20px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--js-line);
}

.js-area .js-rig-retire-action p,
.js-area .js-rig-pane-action p {
    margin: 3px 0 0;
    color: var(--js-ink-muted);
    font-size: 0.85rem;
}

/* Where the rig lives, read first. A rigger is looking for the kit at
   their own drop zone before anything else about it. */
/* The site column: the badge alone. The name under it repeated down the whole
   list and was the widest thing in the narrowest column, so the column no
   longer has to be wide enough for a drop zone's full name. */
.js-area .js-rig-site {
    display: flex;
    align-items: center;
    justify-content: center;
}

.js-area .js-rig-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.js-area .js-rig-identity-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* The model name. Templates are shared across many rigs, so this groups
   them at a glance. Outlined rather than filled, because it is an
   attribute and not a state: a filled badge beside a state badge would
   read as though both were saying something is wrong. */
.js-area .js-template-badge {
    display: inline-block;
    padding: 2px 8px;
    border: 0;
    border-radius: 5px;
    background: var(--js-quiet-bg);
    color: var(--js-ink-soft);
    font-size: 11.5px;
    font-weight: 500;
    white-space: nowrap;
}

/* What is physically on the rig. Yes and no rather than a tick, because a
   missing tick is indistinguishable from a tick nobody rendered. */
.js-area .js-rig-fitted {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 11.5px;
    color: var(--js-ink-soft);
}

.js-area .js-rig-fitted-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.03em;
}


/* Jumps flown, the bar, jumps left. The bar is kept because a proportion is
   read faster than two numbers subtracted, and the figures bracket it so the
   bar is never a shape without a scale. */
.js-area .js-rig-life {
    display: grid;
    grid-template-columns: auto minmax(70px, 130px) auto;
    align-items: center;
    gap: 10px;
}

.js-area .js-rig-life > .js-meter,
.js-area .js-rig-life > progress {
    width: 100%;
    height: 7px;
}

.js-area .js-rig-meter-absent {
    height: 7px;
    border-radius: 4px;
    background: repeating-linear-gradient(90deg, var(--js-surface-sunken) 0 4px, transparent 4px 8px);
}

.js-area .js-rig-figure {
    display: flex;
    flex-direction: column;
    min-width: 46px;
}

.js-area .js-rig-figure-done { align-items: flex-end; }
.js-area .js-rig-figure-left { align-items: flex-start; }

.js-area .js-rig-figure-value {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.js-area .js-rig-figure-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--js-ink-muted);
}

/* The life cycle figures, told apart by colour.
   Three numbers sat in the same ink and the one that matters had to be
   counted across. Jumps is what has been used and Limit is a fixed ceiling:
   both are background, so both are quietened, and Limit takes a hue of its
   own so a glance can tell the two apart without reading the headers.
   Remaining keeps the severity colour at normal table size and weight. */
.js-area .js-table td.js-life-used { color: var(--js-life-used-ink); }
.js-area .js-table td.js-life-limit { color: var(--js-life-limit-ink); }

/* Severity has to be spelled out against the cell, not left to .js-figure-*.
   `.js-area .js-table td` sets a flat ink at (0,2,1) and the figure classes
   are (0,2,0), so the severity colour on this column has never been winning:
   every Remaining figure rendered the same dark grey whatever the state.
   Size and weight stay the table defaults - only the ink changes. */
.js-area .js-table td.js-life-remaining.js-figure-ok {
    color: var(--js-severity-ok, #42b98c);
}

.js-area .js-table td.js-life-remaining.js-figure-warning {
    color: var(--js-seen-warning-ink);
}

.js-area .js-table td.js-life-remaining.js-figure-critical {
    color: var(--js-severity-critical, #d93647);
}

.js-area .js-table td.js-life-remaining.js-figure-unknown {
    color: var(--js-ink-muted);
}

/* The remaining figure takes the rig's own severity, so the number and
   the marker beside the name cannot disagree. */
/* Jumps left: green OK, amber near end, red ended / almost out. */
.js-area .js-figure-critical { color: var(--js-severity-critical, #d93647); }
.js-area .js-figure-warning { color: var(--js-seen-warning-ink); }
.js-area .js-figure-ok { color: var(--js-severity-ok, #42b98c); }
.js-area .js-figure-unknown { color: var(--js-ink-muted); }

.js-area .js-story-back { margin: 0 0 12px; }


/* The marker on a rig's own page is larger: it is the page's own status
   rather than one of a column of them. */
.js-area .js-rig-header .js-rhombus {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
}

.js-area .js-rig-header .js-rhombus::before {
    top: 1px;
    left: 1px;
    width: 24px;
    height: 24px;
}

/* ── Rig Log list row ──────────────────────────────────────────────
   Its own grid rather than js-equipment-row-compact, because that one
   places children by :nth-child and expects exactly marker, identity,
   meter, meter. This row carries more: the site, the model, what is
   fitted, and two figures. Sharing the class would have meant fighting
   its placement rules on every change.

   Everything inside is still the shared vocabulary: the site avatar, the
   rhombus, the badges and the life meter are all the existing ones.
   ────────────────────────────────────────────────────────────────── */

.js-area .js-rig-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}



.js-area .js-rig-row:is(:hover, :focus-visible) {
    background: var(--js-surface-sunken);
    border-color: var(--js-line);
}

/* Where the rig lives, read first. A rigger is looking for the kit at
   their own drop zone before anything else about it. */

.js-area .js-rig-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.js-area .js-rig-identity-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* The model name. Templates are shared across many rigs, so this groups
   them at a glance. Outlined rather than filled, because it is an
   attribute and not a state: a filled badge beside a state badge would
   read as though both were saying something is wrong. */

/* What is physically on the rig. Yes and no rather than a tick, because a
   missing tick is indistinguishable from a tick nobody rendered. */
.js-area .js-rig-fitted {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 11.5px;
    color: var(--js-ink-soft);
}

.js-area .js-rig-fitted-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.03em;
}


/* Jumps flown, the bar, jumps left. The bar is kept because a proportion is
   read faster than two numbers subtracted, and the figures bracket it so the
   bar is never a shape without a scale. */
.js-area .js-rig-life {
    display: grid;
    grid-template-columns: auto minmax(70px, 130px) auto;
    align-items: center;
    gap: 10px;
}

.js-area .js-rig-life > .js-meter,
.js-area .js-rig-life > progress {
    width: 100%;
    height: 7px;
}

.js-area .js-rig-meter-absent {
    height: 7px;
    border-radius: 4px;
    background: repeating-linear-gradient(90deg, var(--js-surface-sunken) 0 4px, transparent 4px 8px);
}

.js-area .js-rig-figure {
    display: flex;
    flex-direction: column;
    min-width: 46px;
}

.js-area .js-rig-figure-done { align-items: flex-end; }
.js-area .js-rig-figure-left { align-items: flex-start; }

.js-area .js-rig-figure-value {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.js-area .js-rig-figure-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--js-ink-muted);
}

/* The remaining figure takes the rig's own severity, so the number and
   the marker beside the name cannot disagree. */

.js-area .js-story-back { margin: 0 0 12px; }




/* ── Every component, on the compact row ───────────────────────────
   A rig carries a container, a main, lines, a reserve and often an AAD.
   Showing only the shortest lived of them hid the other four, so all of
   them get a chip and each carries its own colour.
   ────────────────────────────────────────────────────────────────── */

.js-area .js-rig-components {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-content: center;
}

.js-area .js-component-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 4px;
    border: 0;
    font-size: 11px;
    line-height: 1.3;
    white-space: nowrap;
}

.js-area .js-component-chip-type {
    font-weight: 600;
    letter-spacing: 0.04em;
    opacity: 0.75;
}

.js-area .js-component-chip-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

/* The same severity palette as the parachute marker and the meters, so a
   part reads the same wherever it appears. */
.js-area .js-component-chip-ok {
    background: var(--js-ok-bg); color: var(--js-ok-ink);
}
.js-area .js-component-chip-warning {
    background: var(--js-warning-bg); color: var(--js-warning-ink);
}
.js-area .js-component-chip-critical {
    background: var(--js-critical-bg); color: var(--js-critical-ink);
}
.js-area .js-component-chip-unknown {
    background: var(--js-violet-bg); color: var(--js-violet-ink);
}

/* ── Tag and GPS ───────────────────────────────────────────────────
   Essential facts, not footnotes. A rig with no tag cannot be tapped at
   all, so this is sized to be read at a glance rather than hunted for.
   YES and NO in words, because a missing tick is indistinguishable from a
   tick nobody rendered.
   ────────────────────────────────────────────────────────────────── */

.js-area .js-rig-fitted {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
}

.js-area .js-rig-fitted-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid var(--js-line);
    background: var(--js-surface-sunken);
    color: var(--js-ink-soft);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Fitted or not, in one place.
   Green for fitted, amber for not. Amber and not red, because a rig with no tag
   is a job for somebody rather than a rig that cannot fly, and red on this row
   belongs to the thing that actually grounds it. Grey, which is what "no" used
   to be in two of the three copies of this rule, read as "not applicable". */
.js-area .js-fitted-yes {
    color: var(--js-ok-ink);
    font-weight: 600;
}

.js-area .js-fitted-no {
    color: var(--js-warning-ink);
    font-weight: 600;
}

/* The site cell on the Jump Log: the avatar the Rig Log uses, and the name
   beside it. Consistency is the point, so the avatar is the same element
   and the same palette rather than a second, similar one. */
/* Just the badge now. The site name that used to sit beside it repeated the
   same words down every row of a long table, and the badge already carries the
   site's colour and initials, with the full name on hover for anybody who does
   not know them yet. */
.js-area .js-site-cell {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}


/* ══════════════════════════════════════════════════════════════════
   THE JUMP STORY STATUS MARKER

   One canopy, defined once, coloured in one place, used everywhere in
   this area.

   Why a CSS mask and not an inline SVG in each template
   ----------------------------------------------------
   The marker appears on the dashboard, the Jump Log, the jump detail,
   the Rig Log and the rig story. An inline SVG in each of those is five
   copies of the same artwork that drift apart the first time one is
   touched, and it puts drawing instructions inside templates that should
   only be printing.

   So the shape lives here, once, as a mask, and every colour it can take
   lives directly below it. The element stays the plain
   <i class="js-rhombus js-rhombus-critical"> that every one of those
   pages already renders, and the colour comes from background. Nothing in
   any template changed, and nothing carries an inline style.

   Colour used to be stated in three places: once against the severity
   tokens, once again as raw hex further down the file that quietly won on
   source order, and once more for the software marker. The visible colours
   were therefore not the ones the tokens named. All of it is now the
   palette below, and nothing outside this section colours a marker.

   The class is still called js-rhombus. Renaming it would touch every
   template for no behavioural gain, and the name is the marker's ROLE in
   the layout rather than its shape.

   Scoped to .js-area throughout, so nothing outside Jump Story is
   affected.
   ══════════════════════════════════════════════════════════════════ */

.js-area {
    /* The one definition of the shape. Everything below points at this. */
    --js-canopy: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath fill-rule=%22evenodd%22 d=%22M5.16 0.4 6.53 0.4 7.27 0.72 8.53 0.82 9.0 1.14 9.37 1.14 10.0 1.4 10.37 1.77 11.47 2.03 12.11 2.61 12.42 2.61 13.1 2.87 13.95 3.61 14.89 3.82 15.52 4.29 15.95 4.82 16.79 5.29 17.42 5.98 17.84 6.77 18.84 7.77 19.1 8.24 19.26 8.82 20.21 9.97 20.52 10.97 21.26 12.13 21.52 12.97 21.57 13.66 21.94 14.45 22.0 15.97 22.26 16.81 22.21 17.71 21.84 18.81 21.52 19.44 21.1 19.92 17.58 20.18 16.47 20.39 15.68 20.65 15.21 20.65 15.05 20.55 7.53 23.55 7.27 23.6 7.16 23.49 4.42 9.55 3.37 4.71 3.27 4.45 2.74 4.08 2.06 3.4 1.74 2.66 1.74 2.29 1.9 1.87 2.64 1.19 3.69 0.72 5.16 0.4ZM8.0 5.61 8.58 5.77 9.58 6.24 10.26 6.71 10.84 7.34 10.95 7.29 11.26 7.61 12.05 9.45 12.47 10.66 12.47 10.92 9.69 17.34 8.69 19.86 7.79 21.76 7.58 22.55 7.95 22.81 7.84 22.86 7.48 22.55 7.42 22.07 8.0 5.61ZM3.69 4.66 5.32 5.4 6.21 5.08 6.69 5.08 7.58 5.45 7.27 12.87 7.05 21.18 4.9 10.03 3.69 4.66ZM12.63 11.5 12.74 12.13 13.1 13.13 13.1 14.08 13.42 15.29 13.42 15.5 13.32 15.6 13.47 15.76 13.53 17.02 13.79 18.18 8.58 22.28 8.32 21.97 8.05 22.23 8.26 22.44 8.21 22.55 8.0 22.34 8.05 22.18 9.37 19.29 12.63 11.5ZM14.0 18.5 14.47 18.81 14.84 20.29 8.58 22.71 14.0 18.5Z%22/%3E%3C/svg%3E");
}

/* ── The canopy palette ────────────────────────────────────────────────
   Every colour the canopy can take, and the only place any of them is
   written. A status is added by adding a token and the one rule that
   uses it, not by hunting for the four surfaces that draw a marker.

   These are deliberately not --js-severity-*. Those are the chip and
   meter colours, which sit on a tinted background and are muted to suit
   it. The canopy is a small solid shape on white and needs more
   saturation to read at 12px, which is why the two sets differ. Changing
   a chip should not silently restyle every marker in the area.
   ─────────────────────────────────────────────────────────────────── */

.js-area {
    --js-canopy-critical: #ff3045;
    --js-canopy-warning: #ffbf00;
    --js-canopy-ok: #20d99a;
    --js-canopy-error: #7750b8;
    --js-canopy-unknown: var(--js-ink-muted);

    /* Unknown is the absence of a status, not a status. It is the one
       canopy that is deliberately quieter than the rest. */
    --js-canopy-unknown-opacity: 0.55;
}

/* The marker in its ::before form, used everywhere except inline. */
.js-area .js-rhombus::before { background: var(--js-canopy-warning); }
.js-area .js-rhombus-critical::before { background: var(--js-canopy-critical); }
.js-area .js-rhombus-warning::before { background: var(--js-canopy-warning); }
.js-area .js-rhombus-ok::before { background: var(--js-canopy-ok); }

/* A software fault is not a skydiver in trouble, so it never borrows the
   critical red. */
.js-area .js-rhombus-error::before,
.js-area .js-rhombus-software::before { background: var(--js-canopy-error); }

.js-area .js-rhombus-unknown::before {
    background: var(--js-canopy-unknown);
    opacity: var(--js-canopy-unknown-opacity);
}

/* The inline marker carries the mask itself, so it is coloured directly
   rather than through ::before. Same tokens, so the two can never drift. */
.js-area .js-rhombus-inline { background: var(--js-canopy-warning); }
.js-area .js-rhombus-inline.js-rhombus-critical { background: var(--js-canopy-critical); }
.js-area .js-rhombus-inline.js-rhombus-warning { background: var(--js-canopy-warning); }
.js-area .js-rhombus-inline.js-rhombus-ok { background: var(--js-canopy-ok); }
.js-area .js-rhombus-inline.js-rhombus-error,
.js-area .js-rhombus-inline.js-rhombus-software { background: var(--js-canopy-error); }

.js-area .js-rhombus-inline.js-rhombus-unknown {
    background: var(--js-canopy-unknown);
    opacity: var(--js-canopy-unknown-opacity);
}

/* The marker itself. The rotated square is replaced by the canopy, and
   every existing js-rhombus-* colour rule keeps working untouched because
   the colour is still a background. */
.js-area .js-rhombus::before {
    border-radius: 0;
    transform: none;
    top: 1px;
    left: 1px;
    width: 16px;
    height: 16px;
    -webkit-mask-image: var(--js-canopy);
    mask-image: var(--js-canopy);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
}


/* The inline marker has no ::before to mask, so it takes the shape
   itself. Sized up from the 8px diamond, because a canopy at 8px is a
   smudge and this one sits beside a line of text. */
.js-area .js-rhombus-inline {
    width: 13px;
    height: 13px;
    border-radius: 0;
    transform: none;
    margin: 0 7px 2px 0;
    -webkit-mask-image: var(--js-canopy);
    mask-image: var(--js-canopy);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
}

/* Same 16px fill as the sizing block above. Kept here so the canopy
   mask rules that follow cannot shrink the Jump Log glyph back down. */
.js-area .js-rhombus-tracker::before {
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
}


/* Older browsers with no mask support fall back to the rotated square
   they had before, rather than to an invisible marker. A missing status
   marker is the one outcome worth avoiding. */
@supports not ((mask-image: none) or (-webkit-mask-image: none)) {
    .js-area .js-rhombus::before {
        border-radius: 2px;
        transform: rotate(45deg);
        top: 3px;
        left: 2px;
        width: 13px;
        height: 13px;
    }
    .js-area .js-rhombus-inline {
        border-radius: 1px;
        transform: rotate(45deg);
        width: 8px;
        height: 8px;
    }
}


/* ═════════════════════════════════════════════════════════════════════
   THE RIG LOG DETAIL

   A log answers what HAPPENED to a rig. What the rig IS lives on Settings,
   Equipment, so nothing here repeats a serial number or a starting count.
   The page is a name, a site, and two tabs, and the tabs reuse the jump
   detail's own tab classes so the two detail pages in this area behave
   identically.
   ═════════════════════════════════════════════════════════════════════ */

.js-area .js-rig-story-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.js-area .js-rig-story-head .js-section-heading {
    margin: 0;
}

.js-area .js-rig-retired-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin: 0 0 12px;
}

/* Where the rig lives, beside its name. Quiet, because the name is what is
   being looked for and the site is what confirms it. */
.js-area .js-rig-story-site {
    color: var(--js-ink-muted);
    font-size: 0.9rem;
}

/* How much life is left, in words, immediately after the name. This replaced a
   banner: a red bar across the page said one thing loudly and pushed the tabs
   down. It sits next to the name rather than pushed to the far edge, because a
   figure separated from its subject by the width of a monitor is read as
   belonging to whatever it happens to be beside. */
.js-area .js-rig-story-life,
.js-area .js-rig-remaining {
    font-size: 0.9rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* The history filters. A row on a desktop, a stack on a phone, which the
   auto-fit does without a breakpoint of its own. */
.js-area .js-history-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    align-items: end;
    gap: 12px;
    margin-bottom: 14px;
}

.js-area .js-history-filters .form-field {
    margin: 0;
}

.js-area .js-history-filter-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Figures line up under each other, so two rows can be compared without
   reading them. */
.js-area .js-numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}


/* ── The Rig Log row, plainer ──────────────────────────────────────────
   Site, name, model, what is fitted, and then only what is wrong. Every
   colour on this row now means "somebody has to do something about this",
   which is only possible because nothing else on it is coloured.
   ─────────────────────────────────────────────────────────────────── */

.js-area .js-rig-name {
    font-weight: 600;
    color: var(--color-text, var(--js-ink));
}

/* Name plus the tandem/camera chip on Rig Log skydiver rows (and the detail
   heading). Reuses .js-badge-skydiver so the wording matches Settings > Users
   and the tint follows light/dark theme tokens. */
.js-area .js-rig-name-with-role {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.js-area .js-rig-name-with-role .js-rig-name {
    min-width: 0;
}

/* Jump Log: the jump type stays on the skydiver's line. */
.js-area td > .js-rig-name-with-role {
    flex-wrap: nowrap;
    white-space: nowrap;
}

.js-area h2.js-rig-name-with-role {
    gap: 10px;
}

/* What is physically on the rig. Read in passing, so it is the quietest
   thing on the line: text, not badges. A badge asks to be looked at. */
.js-area .js-rig-fitted {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--js-ink-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.js-area .js-rig-fitted-sep {
    opacity: 0.5;
}

/* The only urgent thing on the row, and the only coloured one. Pushed to the
   end so the eye can run down the right-hand edge of the list and find the
   rigs that need somebody without reading any of the rest. */
.js-area .js-rig-attention {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-left: auto;
    font-size: 0.82rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.js-area .js-rig-attention-item {
    white-space: nowrap;
}

@media (max-width: 700px) {
    /* On a phone the line wraps, and an attention note pushed to the far right
       of its own wrapped row reads as belonging to nothing. */
    .js-area .js-rig-attention {
        margin-left: 0;
        width: 100%;
    }
}


/* ── Setup tabs inside an opened rig ───────────────────────────────────
   The same tab strip the jump detail and the Rig Log use, so a tab looks and
   behaves the same wherever the area shows one. Here they are buttons rather
   than links: the card is inside a <details>, and navigating would close it.
   ─────────────────────────────────────────────────────────────────── */

.js-area .js-rig-tabs {
    margin-top: 14px;
}

.js-area .js-detail-tabs button.js-detail-tab {
    /* The family only. `font: inherit` here is a shorthand and reset the weight
       and size the shared rule sets, which is why a tab rendered as a button
       looked lighter than the same tab rendered as a link. */
    font-family: inherit;
    cursor: pointer;
}

.js-area .js-rig-tab-pane {
    padding-top: 14px;
}


/* ── The device row, compact ───────────────────────────────────────────
   The same line as a rig on the Equipment page: identity, then the facts
   that decide whether the device can be handed to somebody, then the
   chevron. It used to be a 56px row led by a coloured pill that existed
   nowhere else in the area, with the name at 1rem and a ringed nickname
   badge; twenty of those is a page of scrolling before anything is found.
   ─────────────────────────────────────────────────────────────────── */

.js-area .js-device-summary-compact {
    display: grid;
    grid-template-columns:
        minmax(0, 1fr)     /* name and code name  */
        minmax(0, 110px)   /* barometer           */
        minmax(0, 240px)   /* SIM                 */
        auto               /* enrolment status    */
        14px;              /* the details chevron */
    align-items: center;
    min-height: 40px;
    padding: 6px 12px;
    column-gap: 12px;
    row-gap: 4px;
}

/* The same closed line as a device, with the facts a person list is scanned by. */
.js-area .js-person-summary-compact {
    display: grid;
    grid-template-columns:
        minmax(0, 1.2fr)   /* name                */
        minmax(0, 180px)   /* roles               */
        minmax(0, 140px)   /* base site           */
        max-content        /* unlock code         */
        14px;              /* the details chevron */
    align-items: center;
    min-height: 40px;
    padding: 6px 12px;
    column-gap: 12px;
    row-gap: 4px;
}

/* The same closed line again, with the facts a site list is scanned by. */
.js-area .js-site-row-summary {
    display: grid;
    grid-template-columns:
        minmax(0, 1.2fr)   /* name and short code */
        minmax(0, 200px)   /* position            */
        minmax(0, 90px)    /* people based here   */
        max-content        /* status              */
        14px;              /* the details chevron */
    align-items: center;
    min-height: 40px;
    padding: 6px 12px;
    column-gap: 12px;
    row-gap: 4px;
}

.js-area .js-site-row-position,
.js-area .js-site-row-people,
.js-area .js-site-row-status {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.js-area .js-site-row-position {
    font-variant-numeric: tabular-nums;
}

.js-area .js-person-summary-roles,
.js-area .js-person-summary-site,
.js-area .js-person-summary-code {
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.js-area .js-person-summary-roles {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.js-area .js-device-identity {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.js-area .js-device-identity strong {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--color-text, var(--js-ink));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.js-area .js-device-summary-compact .js-device-summary-person {
    font-size: 0.8rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Whether a barometer is fitted, in the same words and the same two colours
   the Rig Log uses for a tag: green fitted, amber not. */
.js-area .js-device-fitted {
    font-size: 0.8rem;
    color: var(--js-ink-muted);
    white-space: nowrap;
}

.js-area .js-device-summary-compact .js-badge {
    justify-self: start;
}

@media (max-width: 860px) {
    /* On a phone the row stacks: the name keeps the first line to itself and
       the facts wrap underneath rather than being crushed into slivers. */
    .js-area .js-device-summary-compact,
    .js-area .js-person-summary-compact,
    .js-area .js-site-row-summary {
        grid-template-columns: minmax(0, 1fr) 14px;
    }
    .js-area .js-device-summary-compact > :not(.js-device-identity):not(:last-child),
    .js-area .js-person-summary-compact > :not(.js-device-identity),
    .js-area .js-site-row-summary > :not(.js-device-identity) {
        grid-column: 1;
    }
}

.js-area .js-unlock-code-input {
    width: 7.5rem;
    max-width: 8rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border, var(--js-line));
    border-radius: var(--radius-btn, 8px);
    font-size: var(--font-btn, 0.875rem);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.12em;
    background: var(--color-bg-subtle, var(--js-surface));
    color: var(--color-text, var(--js-ink));
}

.js-area .js-unlock-code-input:focus {
    outline: none;
    border-color: var(--color-primary-bg, var(--js-accent));
    box-shadow: 0 0 0 3px var(--js-accent-soft);
}

/* Master key: reuse .js-unlock-code-line (input + Save tight); hint under the line. */
.js-area .js-master-key-form {
    margin-bottom: 0;
}

.js-area .js-master-key-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
}

.js-area .js-master-key-hint {
    margin: 0;
    max-width: 36rem;
}

/* The code on a closed person card, readable without opening it. */
.js-area .js-person-summary-code {
    overflow: visible;
}

.js-area .js-person-code-badge {
    background: var(--js-surface-sunken);
    color: var(--js-ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    font-weight: 600;
    font-size: 0.78rem;
}

/* Dice beside the unlock field. Save stays the first submit button. */
.js-area .js-person-form {
    display: flex;
    flex-direction: column;
}

.js-area .js-person-form > .js-form-actions {
    order: 1;
}

.js-area .js-unlock-code-line {
    display: flex;
    align-items: center;
    gap: 4px;
}


.js-area .js-pick-random-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--color-border, var(--js-line));
    border-radius: 8px;
    background: var(--color-bg-subtle, var(--js-surface));
    color: var(--js-ink-soft);
    cursor: pointer;
    flex-shrink: 0;
}

.js-area .js-pick-random-code:hover,
.js-area .js-pick-random-code:focus-visible {
    color: var(--js-accent-text);
    border-color: var(--js-accent-strong);
}

.js-area .js-pick-random-code:focus-visible {
    outline: 3px solid var(--js-accent-strong);
    outline-offset: 2px;
}

.js-area .js-pick-random-code-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.js-area .js-unlock-code-save {
    padding: 0.25rem 0.625rem;
    font-size: var(--font-btn);
    line-height: 1.2;
    min-height: 2rem;
    border-radius: var(--radius-btn);
    flex-shrink: 0;
}


/* ── The setup facts on an opened rig ──────────────────────────────────
   Four short facts and a link, on one line. They were a definition list at
   body size, which spent a third of the card saying four things and pushed
   the tabs under the fold.
   ─────────────────────────────────────────────────────────────────── */

/*
 * Expanded card bodies reuse Flight Story Aircrafts field cards
 * (settings-field-grid / settings-field from settingsStyle.css).
 * Keep Jump Story value weight and site-move controls tidy inside those cards.
 */
.js-area .js-device-row-body > .settings-field-grid,
.js-area .js-equipment-row-body > .settings-field-grid {
    margin-top: 0;
    margin-bottom: 12px;
}

.js-area .settings-field-value strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text, var(--js-ink));
    line-height: 1.35;
}

.js-area .settings-field .js-site-move-form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.js-area .settings-field .js-site-move-form .btn {
    padding: 4px 10px;
    font-size: 0.78rem;
}

/* ── Equipment sets (docs/equipment-sets.md) ──────────────────────────── */

/* The set a fitted part belongs to, on its closed line. */
.js-area .js-set-tag {
    color: var(--js-ink-muted);
}

/* A rig missing a set, or with an incomplete one, under its prices: a warning, in amber. */
.js-area .js-set-gap {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    width: fit-content;
    max-width: 100%;
    margin: -6px 0 10px;
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--js-warning-bg);
    color: var(--js-warning-ink);
    font-size: 0.86rem;
    font-weight: 600;
}

.js-area .js-set-gap .js-rig-log-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/*
 * A set as a small tree: the lead card (the main, the harness) full width,
 * its parts set in under it like tabs, and a line from the lead down their
 * left side with an arrow into each part. On Spares and on a rig's
 * Components; the cards themselves are ordinary cards.
 */
.js-area .js-set-join {
    /* The cards' own border colour, so the branches read as part of them. */
    --set-join-ink: var(--color-border, var(--js-line));
    --set-join-indent: 28px;
    display: grid;
    gap: 6px;
}

.js-area .js-set-join > .js-equipment-row {
    position: relative;
}

.js-area .js-set-join > .js-equipment-row:not(:first-of-type) {
    margin-left: var(--set-join-indent);
}

/*
 * Each part's branch is one shape: a line down from the card above that
 * turns in a rounded corner into this card, drawn as one border so the
 * curve and the line are the same stroke. A part with another below it
 * also carries the line on down. --set-join-branch is the middle of a closed
 * card, so the branches stay put when a card is opened.
 */
.js-area .js-set-join {
    --set-join-branch: 27px;
}

.js-area .js-set-join > .js-equipment-row:not(:first-of-type)::before {
    content: "";
    position: absolute;
    top: -8px;
    left: -17px;
    width: 13px;
    height: calc(var(--set-join-branch) + 8px);
    border-left: 1.5px solid var(--set-join-ink);
    border-bottom: 1.5px solid var(--set-join-ink);
    border-bottom-left-radius: 9px;
    box-sizing: border-box;
    pointer-events: none;
}

.js-area .js-set-join > .js-equipment-row:not(:first-of-type):not(:last-of-type)::after {
    content: "";
    position: absolute;
    top: calc(var(--set-join-branch) - 10px);
    bottom: -10px;
    left: -17px;
    border-left: 1.5px solid var(--set-join-ink);
    pointer-events: none;
}

/* The arrowhead, on the end of the branch, drawn with the same stroke. */
.js-area .js-set-join > .js-equipment-row:not(:first-of-type) > summary {
    position: relative;
}

.js-area .js-set-join > .js-equipment-row:not(:first-of-type) > summary::before {
    content: "";
    position: absolute;
    top: calc(var(--set-join-branch) - 4.25px);
    left: -9.5px;
    width: 6px;
    height: 6px;
    border-top: 1.5px solid var(--set-join-ink);
    border-right: 1.5px solid var(--set-join-ink);
    border-top-right-radius: 1px;
    transform: rotate(45deg);
    pointer-events: none;
}

.js-area .js-set-join[hidden] {
    display: none;
}

/* The set's name and value: a small tab on top of the lead card, in the
   soft green with a gentle sheen, touching the card below it. */
.js-area .js-set-join-caption {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    justify-self: start;
    margin: 6px 0 -7px 12px;
    padding: 4px 12px 5px;
    border: 1px solid color-mix(in srgb, var(--js-ok-ink) 22%, transparent);
    border-bottom: 0;
    border-radius: 9px 9px 0 0;
    background: linear-gradient(180deg, var(--js-sheen) 0%, transparent 70%), var(--js-ok-bg);
    box-shadow: inset 0 1px 0 var(--js-sheen-edge);
    color: var(--js-ok-ink);
    font-size: 12px;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.js-area .js-set-join-caption .js-value-current-text {
    color: inherit;
    font-weight: 700;
}


/* Drag a spare onto another to join them: the card it can join lights up. */
.js-area [data-spare-drag] > summary {
    cursor: grab;
}

.js-area [data-spare-drag].js-drag-source {
    opacity: 0.5;
}

.js-area [data-spare-drag].js-drop-target {
    outline: 2px dashed var(--js-navy);
    outline-offset: 2px;
}

/* Move set: each step a short block, the review a plain list. */
.js-area .js-move-set-body {
    gap: 18px;
}

.js-area .js-move-set-step {
    display: grid;
    gap: 8px;
}

.js-area .js-move-set-step-label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary, var(--js-ink-muted));
}

.js-area .js-move-set-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
}

.js-area .js-move-set-new-part {
    margin: 0;
    padding: 10px 12px 12px;
    border: 1px solid var(--js-line);
    border-radius: 8px;
}

.js-area .js-move-set-new-part legend {
    padding: 0 4px;
    font-size: 13px;
    font-weight: 600;
}

.js-area .js-move-set-review {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 18px;
    font-size: 0.9rem;
}

/* The prices of an open rig, with See Rig Log beside them as a plain link. */
.js-area .js-rig-value-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0 0 14px;
}

.js-area .js-rig-value-line .js-value-badges {
    margin: 0;
}

.js-area .js-rig-log-link {
    color: var(--js-accent-text);
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.js-area .js-rig-log-link:is(:hover, :focus-visible) {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* A rig's closed line carries what sets its risk: overdue inspections, the
   part with the fewest jumps left, and the current value. */
.js-area summary.js-equipment-summary-compact.js-rig-summary {
    grid-template-columns: 22px minmax(0, 1fr) auto auto 14px;
}

.js-area .js-rig-summary-figures {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    justify-self: end;
    min-width: 0;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.js-area .js-rig-summary-shortest {
    display: inline-flex;
    gap: 6px;
    min-width: 0;
}

/* Red only and Green only beside the rig search: the site's badges, as
   toggles. The chosen one is outlined in its own ink. */
.js-area .js-health-filters {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.js-area .js-health-filter {
    min-height: 30px;
    padding: 4px 12px;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px transparent;
}

.js-area .js-health-filter[aria-pressed="true"] {
    box-shadow: inset 0 0 0 2px currentColor;
}

.js-area .js-health-filter:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.js-area .js-rig-summary-value {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* The sort arrow beside jumps left and value: the table header's arrow, as a
   small button of its own (jumpStory.js, attachRigSort). */
.js-area .js-rig-sort {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    min-height: 22px;
    padding: 0;
    border: none;
    border-radius: 5px;
    background: none;
    cursor: pointer;
}

.js-area .js-rig-sort:is(:hover, :focus-visible) {
    background: var(--js-surface-sunken);
}

.js-area .js-rig-sort[data-sort-direction] .js-sort-indicator {
    color: var(--js-accent-text);
}

.js-area .js-rig-sort[data-sort-direction="ascending"] .js-sort-indicator::after { content: "\2191"; }
.js-area .js-rig-sort[data-sort-direction="descending"] .js-sort-indicator::after { content: "\2193"; }

.js-area .js-rig-summary-part {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-text-muted, var(--js-ink-muted));
    font-weight: 600;
}

/* Below this the figures take a line of their own under the name. */
@media (max-width: 820px) {
    .js-area summary.js-equipment-summary-compact.js-rig-summary {
        grid-template-columns: 22px minmax(0, 1fr) auto 14px;
    }
    .js-area .js-equipment-summary-compact.js-rig-summary .js-equipment-identity {
        grid-column: 2;
        grid-row: 1;
    }
    .js-area .js-rig-summary > .js-summary-actions {
        grid-column: 3;
        grid-row: 1;
    }
    .js-area .js-equipment-summary-compact.js-rig-summary::after {
        grid-column: 4;
        grid-row: 1;
    }
    .js-area .js-rig-summary-figures {
        grid-column: 2 / -1;
        grid-row: 2;
        justify-self: start;
        flex-wrap: wrap;
        row-gap: 4px;
        white-space: normal;
    }
}

/* On a phone the menu takes its own line too, so it cannot squeeze the name. */
@media (max-width: 600px) {
    .js-area summary.js-equipment-summary-compact.js-rig-summary {
        grid-template-columns: 22px minmax(0, 1fr) 14px;
    }
    .js-area .js-equipment-summary-compact.js-rig-summary::after {
        grid-column: 3;
        grid-row: 1;
    }
    .js-area .js-rig-summary > .js-summary-actions {
        grid-column: 2 / -1;
        grid-row: 3;
        justify-self: start;
    }
}

/* A fact the phone has not reported, so it cannot be relied on.
   Still used on the collapsed SIM chip and expanded SIM value. */
.js-area .js-device-fact-critical {
    color: var(--js-critical-ink);
    font-weight: 600;
}

/* "Ready · EE · mobile signal" can outgrow its column, so the closed line cuts
   it short rather than wrapping. The full text is in the title. */
.js-area .js-device-sim {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The controls under the facts, sized to the card rather than to a form on a
   page of its own. */
.js-area .js-device-card-actions .btn {
    padding: 4px 12px;
    font-size: 0.78rem;
}

/* The person picker, and the three buttons beside it, on one line.
 *
 * A select is as wide as its widest option, and one of the options can carry
 * the reason somebody is not eligible. That made the picker as wide as the
 * card on some devices and short on others, so the buttons wrapped on one card
 * and sat in a row on the next. The width is fixed here instead: the closed
 * control shows the chosen person, and the list still opens at full width. */
.js-area .js-device-card-actions select {
    font-size: 0.82rem;
    /* A width, not a flex basis on the field around it: the field's natural
       width is measured from the select, so a basis wider than the control
       leaves the row too narrow for the button and wraps it under. */
    width: 260px;
    max-width: 100%;
}

.js-area .js-device-card-actions .form-field {
    flex: 0 1 auto;
    min-width: 0;
}


/* ── A rig's record ────────────────────────────────────────────────────
   The values, each with a pencil. It began as a form of six always-open
   inputs, which is a form to fill in rather than a record to read: the
   ordinary visit to this tab is to check a serial, not to change one.
   ─────────────────────────────────────────────────────────────────── */

/* Same 2-column field-card grid as Aircrafts (settings-field-*). */
.js-area .js-rig-record-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    margin: 0;
    max-width: none;
    width: 100%;
}

.js-area .js-rig-record-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--color-border, var(--js-line));
    background: var(--color-bg-subtle, var(--js-surface-sunken));
}

.js-area .js-rig-record-row--full {
    grid-column: 1 / -1;
}

.js-area .js-rig-record-label {
    color: var(--color-text-secondary, var(--js-ink-muted));
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.js-area .js-rig-record-value {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    min-width: 0;
    color: var(--color-text, var(--js-ink));
    line-height: 1.35;
}

@media (max-width: 720px) {
    .js-area .js-rig-record-list {
        grid-template-columns: 1fr;
    }
}

/* Inside a rig's or a part's card the record is a dense grid: as many short
   cells across as fit, so a rig and an open part no longer fill the page. */
.js-area .js-equipment-row .js-rig-record-list {
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 6px;
}

.js-area .js-equipment-row .js-rig-record-row {
    gap: 1px;
    padding: 6px 10px;
    border-radius: 8px;
}

.js-area .js-equipment-row .js-rig-record-label {
    font-size: 10px;
}

.js-area .js-equipment-row .js-rig-record-value {
    font-size: 0.86rem;
    font-weight: 600;
}

.js-area .js-equipment-row .js-rig-record-value .js-badge {
    padding: 1px 7px;
}

/* A long value (a part's name, the site picker and its Move button) takes two
   cells rather than truncating or stacking; the Rig log link needs no more. */
.js-area .js-equipment-row .js-rig-record-row--wide,
.js-area .js-equipment-row .js-rig-record-row--full {
    grid-column: span 2;
}

.js-area .js-equipment-row .js-site-move-form {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.js-area .js-equipment-row .js-site-move-form select,
.js-area .js-equipment-row .js-site-move-form .btn {
    padding-top: 3px;
    padding-bottom: 3px;
}

/* The site picker shrinks beside its button rather than wrapping under it. */
.js-area .js-equipment-row .js-site-move-form select {
    flex: 1 1 auto;
    min-width: 0;
}

@media (max-width: 720px) {
    /* Two cells across where they fit, one where they do not; a wide cell
       always takes the whole line. */
    .js-area .js-equipment-row .js-rig-record-list {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    .js-area .js-equipment-row .js-rig-record-row--wide,
    .js-area .js-equipment-row .js-rig-record-row--full {
        grid-column: 1 / -1;
    }
}

/* The value and its pencil on one line.
   Which of the two states shows is driven by a class on the row, not by the
   hidden attribute: [hidden] only sets display:none as a default, and the
   display:flex below out-specifies it, so hiding the value silently did
   nothing and the input opened underneath it instead of in its place. */
.js-area .js-rig-record-read {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.js-area .js-rig-record-row.js-rig-record-editing .js-rig-record-read {
    display: none;
}

.js-area .js-rig-record-input {
    display: none;
}

.js-area .js-rig-record-row.js-rig-record-editing .js-rig-record-input {
    display: block;
}

.js-area .js-rig-record-read > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Always visible. It was revealed on hover, which keeps a record looking like a
   record but hides the only clue that any of it can be changed: an affordance
   nobody can see is not one. Resting state stays quieter than hover, but the
   ink must follow the theme: .e-icon-link defaults to #555, which vanishes on
   a dark surface. */
.js-area .e-icon-link {
    color: var(--js-ink-soft);
    opacity: 1;
    transition: color 0.12s ease, opacity 0.12s ease;
}

.js-area .e-icon-link:is(:hover, :focus-visible, :active) {
    color: var(--js-ink);
    opacity: 1;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.js-area .js-rig-record-read .e-icon-link {
    opacity: 0.92;
    color: var(--js-ink-soft);
}

.js-area .js-rig-record-row:hover .e-icon-link,
.js-area .js-rig-record-read .e-icon-link:is(:hover, :focus-visible) {
    opacity: 1;
    color: var(--js-ink);
}

/* .form-field's display would otherwise beat [hidden]. */
.js-area .form-field[data-identifier-field][hidden] {
    display: none;
}

/* Name row: the template's name stays as text and only the identifier after
   it is an input, so the row reads "Sigma 360 reserve [ 2 ]". */
.js-area .js-rig-record-row.js-rig-record-editing .js-identifier-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.js-area .js-identifier-field .js-identifier-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.js-area .js-identifier-field input.js-identifier-input {
    flex: 0 0 auto;
    width: 9ch;
}

/* The input stands where the value stood, at the value's size. A field that
   grows a full-width box on being opened moves everything around it. */
.js-area .js-rig-record-input {
    min-width: 0;
    max-width: 100%;
}

/* min-width:0 kills the browser's content-sized min on long values (emails),
   which otherwise blows the grid cell and overlaps the next field. */
.js-area .js-rig-record-input :is(input, select) {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    font-size: 0.86rem;
    padding: 6px 10px;
    line-height: 1.4;
    border-radius: var(--radius-input, 8px);
}

.js-area .js-rig-record-value,
.js-area .js-rig-record-row {
    overflow: hidden;
}

/* The browser's own message for a field. Shown only when it has something to
   say, which is a rule about content rather than a hidden attribute something
   else can override. Used by the rig record and by the template's component
   rows, because both refuse the same thing for the same reason. */
.js-area .js-field-message {
    display: none;
    margin-top: 3px;
    font-size: 0.75rem;
    color: var(--js-critical-ink);
}

.js-area .js-field-message:not(:empty) {
    display: block;
}

/* The control the message is about, so the eye lands on it and not only on the
   sentence under it. Marked directly rather than through the row: a component
   row holds five controls and only one of them is the problem. */
.js-area .js-field-invalid {
    border-color: #c02434;
}

.js-area .js-rig-record-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

/* display:flex above would otherwise beat [hidden] and leave Save on every card. */
.js-area .js-rig-record-actions[hidden] {
    display: none !important;
}


/* ── The jump detail: figures beside the track ─────────────────────────
   The figures are read while looking at the track, not before it, so they
   sit alongside rather than above. Below 1000px they go back to a wrapping
   strip: on a phone a fixed side column would leave the map a sliver.
   ─────────────────────────────────────────────────────────────────── */

.js-area .js-detail-layout {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.js-area .js-detail-figures {
    position: sticky;
    /* Stays put while a long sample table scrolls past it, so a figure can be
       checked against a row without scrolling back up. */
    top: 12px;
    min-width: 0;
}

.js-area .js-detail-main {
    min-width: 0;
}

/* The cards are narrower here, so the value and its unit share a line and the
   label above it does not need to compete with them. */
.js-area .js-detail-figures .js-detail-metric {
    padding: 6px 9px;
}

.js-area .js-detail-figures .js-detail-metric-value {
    font-size: 0.95rem;
}

@media (max-width: 1000px) {
    .js-area .js-detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .js-area .js-detail-figures {
        position: static;
    }

    .js-area .js-detail-figures .js-detail-metrics {
        grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
    }
}


/* ── The Rig Log search ────────────────────────────────────────────────
   One control above the tabs, filtering whichever compact list is open.
   ─────────────────────────────────────────────────────────────────── */

.js-area .js-riglog-search {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
}

.js-area .js-riglog-search .users-search-input {
    max-width: 22rem;
}

.js-area .js-riglog-search-count {
    margin: 0;
    color: var(--js-ink-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* A filtered-out row must actually disappear.
   .js-rig-row is display:flex, and [hidden] only sets display:none as a
   default, so the flex rule wins and hiding a row does nothing. This is the
   same trap the rig record's inline editing hit; stated once here for the
   rows the search touches. */
.js-area .js-rig-row[hidden],
.js-area a.js-rig-row[hidden] {
    display: none;
}

.js-area .js-riglog-no-matches {
    margin: 10px 0 0;
    color: var(--js-ink-muted);
    font-size: 0.85rem;
}


/* The way from a rig's log to where that rig is set up. A link that looks like
   a link and says where it goes: the name styled as a heading looked like a
   heading, and a link nobody can see is not one. Pushed to the end of the title
   row, away from the figures. */
/* The Life log: the part's name wraps so the value badges fit beside it. */
.js-area .js-components-life-table tbody th[scope="row"] { white-space: normal; min-width: 11rem; }
.js-area .js-components-life-table td { white-space: nowrap; }

/* A rigger review's note in the Inspections log, and its file below it. */
.js-area .js-review-note { max-width: 28rem; white-space: pre-line; }
.js-area .js-review-attachment { display: block; margin-top: 4px; font-size: 0.85rem; }

/* A part's serial in the Rig Log, "SN 111222444" or "SN -": quiet, on one
   line, with even figures so serials line up down a column. */
.js-area .js-serial {
    margin-left: 4px;
    font-size: 0.78rem;
    color: var(--js-ink-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* A rig or a part named in the Rig Log, linking to its card in Settings.
   It reads as the name it is, with a dotted underline to say it opens. */
.js-area .js-settings-link {
    color: inherit;
    text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent);
    text-underline-offset: 3px;
}
.js-area .js-settings-link:is(:hover, :focus-visible) {
    color: var(--js-accent-text);
    text-decoration-color: currentColor;
}

/* A character the field will not take.

   Flashed rather than reported in text, because the character is dropped as
   it is typed and there is nowhere for a message to go that would be read in
   time. The flash says "that was rejected", where silence reads as a broken
   keyboard.

   Colour is not the only signal: the character visibly fails to appear, and
   the field's own hint says what is accepted. */
@keyframes js-input-reject-flash {
    0%   { background-color: var(--js-critical-bg); border-color: var(--js-severity-critical, #d93647); }
    100% { background-color: transparent; }
}

.js-area .js-input-rejected {
    animation: js-input-reject-flash 420ms ease-out;
}

/* Somebody who has asked for less motion still needs to know the character
   was refused, so the flash becomes a steady edge instead of an animation. */
@media (prefers-reduced-motion: reduce) {
    .js-area .js-input-rejected {
        animation: none;
        border-color: var(--js-severity-critical, #d93647);
    }
}


/* Acknowledgement audit on Rig Log packer / rig detail */
.js-area .js-subsection-heading {
    margin: 18px 0 6px;
    font-size: 15px;
    font-weight: 700;
}

.js-area .js-story-log {
    list-style: none;
    margin: 0;
    padding: 0;
}

.js-area .js-figure-warning {
    color: var(--js-seen-warning-ink);
}

.js-area .js-figure-critical {
    color: var(--js-severity-critical, #d93647);
}

.js-area .js-figure-ok {
    color: var(--js-severity-ok, #42b98c);
}

.js-area .js-figure-notice {
    color: var(--js-ink-soft);
}

/* Seen warning: Alerts-column text links (open Seen warning modal).
   Same language as Jump →: coloured text + arrow, no pill. */
.js-area .js-seen-warning-cell {
    white-space: nowrap;
}

.js-area .js-seen-warning {
    display: inline;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
    cursor: pointer;
    text-decoration: none;
    color: var(--js-seen-warning-ink);
    transition: color 0.12s ease, text-decoration-color 0.12s ease;
}

.js-area .js-seen-warning-warning {
    color: var(--js-seen-warning-ink);
}

.js-area .js-seen-warning-critical {
    color: var(--js-seen-critical-ink);
}

/* Existing Jump Story canopy mask (parachute), tinted via background. */
.js-area .js-seen-warning-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    background: currentColor;
    -webkit-mask-image: var(--js-canopy);
    mask-image: var(--js-canopy);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
}

.js-area .js-seen-warning:hover,
.js-area .js-seen-warning:focus-visible {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.js-area .js-seen-warning:focus {
    outline: none;
}

.js-area .js-seen-warning:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 3px;
}

.js-area .js-seen-warning:active {
    filter: brightness(0.92);
}

/* ── Seen warning dialog: compact severity cards ───────────────────── */

.js-area .js-seen-warning-dialog {
    border: 1px solid var(--js-panel-border);
    border-radius: 12px;
    padding: 0;
    max-width: min(26rem, calc(100vw - 2rem));
    width: 100%;
    color: var(--color-text, var(--js-ink));
    background: var(--js-surface-sunken);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.js-area .js-seen-warning-dialog::backdrop {
    background: rgba(11, 42, 74, 0.42);
}

.js-area .js-seen-warning-dialog-form {
    margin: 0;
}

.js-area .js-seen-warning-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--js-panel-divider);
    background: var(--color-surface, var(--js-surface));
}

.js-area .js-seen-warning-dialog-head .js-subheading {
    margin: 0;
    font-size: 0.95rem;
}

.js-area .js-seen-warning-dialog-body {
    padding: 10px 12px 12px;
    max-height: min(70vh, 28rem);
    overflow: auto;
}

.js-area .js-seen-warning-entries {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.js-area .js-seen-warning-card {
    margin: 0;
    padding: 0;
    border: 1px solid var(--js-panel-border);
    border-radius: 10px;
    background: var(--color-surface, var(--js-surface));
    overflow: hidden;
}

.js-area .js-seen-warning-card-head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--js-panel-divider);
}

.js-area .js-seen-warning-card-warning .js-seen-warning-card-head {
    background: var(--js-seen-warning-bg);
    color: var(--js-seen-warning-ink);
}

.js-area .js-seen-warning-card-critical .js-seen-warning-card-head {
    background: var(--js-seen-critical-bg);
    color: var(--js-seen-critical-ink);
}

.js-area .js-seen-warning-card-software .js-seen-warning-card-head {
    background: var(--js-violet-bg);
    color: var(--js-violet-ink);
}

.js-area .js-seen-warning-card-head .js-seen-warning-icon {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
    margin-top: 2px;
}

.js-area .js-seen-warning-card-title {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.js-area .js-seen-warning-card-title strong {
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.25;
}

.js-area .js-seen-warning-card-time {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--js-ink-muted);
}

.js-area .js-seen-warning-facts {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 6px 10px;
}

.js-area .js-seen-warning-fact {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: 8px;
    align-items: baseline;
    padding: 4px 0;
    border-bottom: 1px solid var(--js-line-soft);
    font-size: 0.78rem;
    line-height: 1.35;
}

.js-area .js-seen-warning-fact:last-child {
    border-bottom: 0;
}

.js-area .js-seen-warning-fact dt {
    margin: 0;
    color: var(--js-ink-label);
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.js-area .js-seen-warning-fact dd {
    margin: 0;
    color: var(--color-text, var(--js-ink));
    font-weight: 500;
    min-width: 0;
    overflow-wrap: anywhere;
}

.js-area .js-seen-warning-explanation {
    margin: 0.65rem 0.85rem 0;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--js-ink, #1d2730);
    font-size: 0.92rem;
    line-height: 1.35;
    font-weight: 600;
}

.js-area .js-seen-warning-card-critical .js-seen-warning-explanation {
    background: rgba(171, 31, 44, 0.08);
    color: var(--js-seen-critical-ink);
}

.js-area .js-seen-warning-card-warning .js-seen-warning-explanation {
    background: rgba(245, 166, 35, 0.12);
    color: var(--js-seen-warning-ink);
}

.js-area .js-seen-warning-message {
    margin: 0 10px 8px;
    padding: 7px 9px;
    border-radius: 7px;
    background: var(--js-surface-sunken);
    border: 1px solid var(--js-panel-divider);
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--color-text, var(--js-ink));
    font-weight: 500;
}

.js-area .js-seen-warning-code-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0 10px 8px;
    padding: 0;
}

.js-area .js-seen-warning-code-chip {
    display: inline-block;
    margin: 0;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--js-surface-sunken);
    color: var(--js-ink-soft);
    font-size: 0.68rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.js-area .js-seen-warning-card-warning .js-seen-warning-code-chip {
    background: rgba(245, 166, 35, 0.14);
    color: var(--js-seen-warning-ink);
}

.js-area .js-seen-warning-card-critical .js-seen-warning-code-chip {
    background: rgba(171, 31, 44, 0.1);
    color: var(--js-seen-critical-ink);
}


/* A packing that was flown after a critical alert on the rig was read.
   The one thing in the area that reports a decision rather than a condition,
   so it is the one thing that carries a fill rather than only a colour: an
   amber word among amber words would not be found. */
.js-area .js-attention-critical {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    border-radius: 5px;
    background: var(--js-critical-bg);
    color: var(--js-critical-ink);
    font-weight: 700;
}

/* The marker, so the state is not carried by colour alone. */
.js-area .js-attention-critical::before {
    content: "";
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    background: var(--js-canopy-critical);
    -webkit-mask-image: var(--js-canopy);
    mask-image: var(--js-canopy);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
}


/* New user dialog: compact roles, no giant empty role stack. */
.js-area #jumpStoryNewUserDialog .js-new-user-grid,
.js-area #jumpStoryAddEmergencyContactDialog .js-new-user-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.js-area #jumpStoryNewUserDialog .js-new-user-grid .form-field:nth-child(3),
.js-area #jumpStoryNewUserDialog .js-new-user-grid .form-field:nth-child(4),
.js-area #jumpStoryNewUserDialog .js-new-user-grid .form-field:nth-child(5),
.js-area #jumpStoryAddEmergencyContactDialog .js-new-user-grid .form-field:nth-child(3),
.js-area #jumpStoryAddEmergencyContactDialog .js-new-user-grid .form-field:nth-child(4),
.js-area #jumpStoryAddEmergencyContactDialog .js-new-user-grid .form-field:nth-child(5) {
    grid-column: 1 / -1;
}

@media (max-width: 560px) {
    .js-area #jumpStoryNewUserDialog .js-new-user-grid,
    .js-area #jumpStoryAddEmergencyContactDialog .js-new-user-grid {
        grid-template-columns: 1fr;
    }
}

.js-area #jumpStoryNewUserDialog .js-new-user-roles {
    margin: 0.75rem 0 0;
    padding: 0.75rem 1rem;
}

.js-area #jumpStoryNewUserDialog .js-new-user-role-row,
.js-area .js-rig-record-input .js-new-user-role-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    align-items: center;
}

.js-area #jumpStoryNewUserDialog .js-dot-choice,
.js-area .js-rig-record-input .js-dot-choice,
.js-area .js-for-sale-choice {
    min-height: 36px;
}
/* The same weight on a rig card and inside a spare's record, whose values are bold. */
.js-area .js-rig-record-value .js-for-sale-choice { font-weight: 400; }

.js-area #jumpStoryNewUserDialog .js-form-actions {
    margin-top: 0.75rem;
    justify-content: flex-end;
}

.js-area #jumpStoryNewUserDialog .js-hint {
    margin-top: 0.35rem;
    margin-bottom: 0;
}


/* Person / contact / site details share the Aircrafts 2-column field cards. */
.js-area .js-person-record .js-rig-record-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    max-width: none;
    width: 100%;
}

@media (max-width: 720px) {
    .js-area .js-person-record .js-rig-record-list {
        grid-template-columns: 1fr;
    }
}

/* Save left, Archive hard-right on the same full-width row.
   Grid keeps Archive in column 2 even when Save is hidden. */
.js-area .js-person-card-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 12px;
    width: 100%;
    margin-top: 14px;
}

.js-area .js-person-card-actions .js-rig-record-actions {
    margin-top: 0;
    justify-self: start;
}

.js-area .js-person-card-actions .js-person-archive {
    grid-column: 2;
    justify-self: end;
    margin: 0;
}

/* Flash messages clear themselves after data-auto-dismiss ms. */
.js-area .js-alert[data-auto-dismiss] {
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.js-area .js-alert.js-alert-dismissing {
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
}


/* People details: read values only until a pencil opens the row. */
.js-area .js-person-record .js-rig-record-input {
    display: none;
}

.js-area .js-person-record .js-rig-record-row.js-rig-record-editing .js-rig-record-input {
    display: block;
}

.js-area .js-person-record .js-rig-record-row.js-rig-record-editing .js-rig-record-read {
    display: none;
}

/* ══ THE LOGS: error log (dashboard) and audit log (Settings) ═══════════
   One look for both. A severity chip, a type or area chip, one line of what
   happened, one line of who, where and when, and a Details disclosure with
   the rest. Colours come from the area's tokens, so both read in the light
   and the dark theme. */

/* A card that folds away, remembered per browser (jumpStory.js). */
.js-area .js-collapsible-card > summary {
    list-style: none;
    cursor: pointer;
}
.js-area .js-collapsible-card > summary::-webkit-details-marker { display: none; }
.js-area .js-collapsible-card:not([open]) > summary { border-bottom: 0; }
/* The fold indicator is the shared small ▾ (see .js-equipment-summary::after),
   drawn on the summary itself, so every folding card on the dashboard (the
   site cards, the unsited and unallocated cards, Software errors) matches the
   "All phones" fold and the Settings rows. */
.js-area .js-collapsible-card > summary:hover { background: var(--js-navy-soft); }
.js-area .js-collapsible-card > summary:focus-visible {
    outline: 2px solid var(--js-accent-strong);
    outline-offset: -2px;
}

.js-area .js-log-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 12px 16px 4px;
}
.js-area .js-log-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    border-radius: 999px;
    background: var(--js-surface-sunken);
}
.js-area .js-log-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--js-ink-soft);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.js-area .js-log-tab.is-active {
    background: var(--js-surface);
    color: var(--js-ink);
    box-shadow: 0 1px 2px var(--js-shadow);
}
.js-area .js-log-tab:focus-visible { outline: 2px solid var(--js-accent-strong); outline-offset: 1px; }
.js-area .js-log-tab-count {
    min-width: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--js-quiet-bg);
    color: var(--js-quiet-ink);
    font-size: 11px;
    text-align: center;
}
.js-area .js-log-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 260px;
    max-width: 460px;
    margin: 0;
}
.js-area .js-log-search .users-search-input { flex: 1; }
.js-area .js-log-search-status {
    margin: 0;
    font-size: 12px;
    color: var(--js-ink-muted);
    white-space: nowrap;
}
.js-area .is-searching .users-search-input { opacity: 0.7; }

/* Error rows: the dashboard row, with room for chips and the disclosure. */
.js-area .js-error-row { align-items: start; }
.js-area .js-error-row-body { min-width: 0; }
.js-area .js-error-row-body small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.js-area .js-error-row-body .js-error-row-times { display: block; margin-top: 2px; font-variant-numeric: tabular-nums; }

.js-area .js-log-chip {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--js-quiet-bg);
    color: var(--js-quiet-ink);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
}
.js-area .js-log-chip-info { background: var(--js-info-bg); color: var(--js-info-ink); }
.js-area .js-log-chip-info { background: var(--js-quiet-bg); color: var(--js-ink-soft); }
.js-area .js-log-chip-warning { background: var(--js-warning-bg); color: var(--js-warning-ink); }
.js-area .js-log-chip-error,
.js-area .js-log-chip-critical { background: var(--js-critical-bg); color: var(--js-critical-ink); }

.js-area .js-log-details { margin-top: 6px; font-size: 12px; }

.js-area .js-log-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 3px 12px;
    margin: 8px 0 0;
}
.js-area .js-log-facts dt { color: var(--js-ink-muted); }
.js-area .js-log-facts dd { margin: 0; overflow-wrap: anywhere; }
.js-area .js-log-trace {
    margin: 8px 0 0;
    padding: 8px 10px;
    border-radius: 6px;
    background: var(--js-surface-sunken);
    color: var(--js-ink-soft);
    font-size: 11px;
    line-height: 1.5;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* The audit log page. */
.js-area .js-page-intro { margin: 0 0 14px; color: var(--js-ink-muted); font-size: 13px; }

.js-area .js-audit-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px 12px;
    margin: 0 0 16px;
}
.js-area .js-audit-filter-search { flex: 1 1 280px; }
.js-area .js-audit-filter-search .users-search-input { width: 100%; }
.js-area .js-audit-filter {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    color: var(--js-ink-muted);
}
.js-area .js-audit-filters .js-log-search-status { flex-basis: 100%; }
/* The same height as the search box beside them, so the row reads as one. */
.js-area .js-audit-filter :is(select, input) {
    box-sizing: border-box;
    height: 38px;
    padding: 6px 10px;
    border: 1px solid var(--js-line);
    border-radius: 8px;
    /* The colour only: the app draws the dropdown arrow as a background image. */
    background-color: var(--color-input-bg, var(--js-surface));
    color: var(--js-ink);
    font: inherit;
    font-size: 13px;
}

.js-area .js-audit-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--js-line);
    border-radius: 10px;
    background: var(--js-surface);
    overflow: hidden;
}
.js-area .js-audit-list:empty { display: none; }
.js-area .js-audit-entry {
    padding: 0 14px;
    border-bottom: 1px solid var(--js-line-soft);
    border-left: 3px solid transparent;
}
.js-area .js-audit-entry:last-child { border-bottom: 0; }
.js-area .js-audit-entry-warning { border-left-color: var(--js-warning-ink); }
.js-area .js-audit-entry-critical { border-left-color: var(--js-critical-ink); }

/* One thin line: time, severity, area, what happened (takes the room and
   shortens with an ellipsis, the full text is in its title), who, Details. */
.js-area .js-audit-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    font-size: 13px;
}
.js-area .js-audit-time {
    flex: 0 0 auto;
    width: 118px;
    color: var(--js-ink-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.js-area .js-audit-line .js-log-chip { flex: 0 0 auto; }
.js-area .js-audit-summary {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--js-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.js-area .js-audit-actor {
    flex: 0 1 auto;
    max-width: 30%;
    color: var(--js-ink-muted);
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* A line with details is a button across the whole row. The button resets
   keep it looking like the plain lines around it. */
.js-area .js-audit-line-expandable {
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.js-area .js-audit-line-expandable:hover .js-audit-summary { text-decoration: underline; }
/* Audit Log > Emergencies: the line opens like any audit line, and the jump
   link (or "No jump") sits at its end, outside the button, in a fixed column
   so the rows line up. */
.js-area .js-emergency-audit-line {
    display: flex;
    align-items: center;
    gap: 12px;
}
.js-area .js-emergency-audit-line .js-audit-line-expandable {
    flex: 1 1 auto;
    min-width: 0;
}
.js-area .js-emergency-audit-jump {
    flex: 0 0 104px;
    font-size: 13px;
    text-align: right;
}
.js-area .js-emergency-audit-no-jump { color: var(--js-ink-muted); }
.js-area .js-audit-line-expandable:focus-visible { outline: 2px solid var(--js-accent-strong); outline-offset: -2px; }

/* The same caret as the equipment and device cards (.js-equipment-summary):
   a small triangle at the far right, turned over when open. Lines with
   nothing to open keep its space but draw nothing. */
.js-area .js-audit-chevron {
    flex: 0 0 14px;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1;
    color: var(--color-text-muted, var(--js-ink-muted));
    transition: transform 0.15s ease;
}
.js-area .js-audit-line-expandable .js-audit-chevron::after { content: '\25be'; }
.js-area .js-audit-line-expandable[aria-expanded="true"] .js-audit-chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
    .js-area .js-audit-chevron { transition: none; }
}
.js-area .js-audit-detail-lines {
    margin: 0 0 10px 128px;
    padding: 8px 12px 8px 26px;
    border-radius: 6px;
    background: var(--js-surface-sunken);
    color: var(--js-ink-soft);
    font-size: 12px;
}
.js-area .js-audit-detail-lines li { overflow-wrap: anywhere; }
.js-area .js-audit-more-row { margin: 14px 0 0; text-align: center; }

@media (max-width: 640px) {
    /* On a phone the line wraps rather than cutting the sentence short. */
    .js-area .js-audit-line { flex-wrap: wrap; gap: 4px 8px; padding: 8px 0; }
    .js-area .js-audit-time { width: auto; }
    .js-area .js-audit-summary { flex-basis: 100%; order: 5; white-space: normal; }
    .js-area .js-audit-actor { order: 6; max-width: none; flex: 1 1 auto; }
    .js-area .js-audit-chevron { order: 7; }
    .js-area .js-audit-detail-lines { margin-left: 0; }
    .js-area .js-log-search { max-width: none; }
}


/* ══ THE AREA BADGE: mark, name and the way back ════════════════════════
   Jump Story's own copies of the pieces the tech log bar also has, so the
   area keeps its look when it moves into a repository of its own. */

/* The home mark is a small drawing in a large square: the frame crops the
   margin, and the image is laid out at twice the frame rather than zoomed,
   because a transform would blur it. */
.js-area .js-brand-mark {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 8px;
    align-self: center;
}
.js-area .js-brand-mark img {
    position: absolute;
    left: -51%;
    top: -54.5%;
    width: 200%;
    height: 200%;
    max-width: none;
}
.js-area .js-brand-mark-topbar {
    width: 36px;
    height: 36px;
    margin-right: 6px;
}

/* The O of STORY as a GPS pin, as in the wordmark. It takes the text colour. */
.js-area .js-story-pin {
    display: inline-block;
    width: 0.6em;
    height: 0.6em;
    margin: 0 0.14em 0 0.06em;
    border-radius: 50% 50% 50% 0;
    background: radial-gradient(circle, transparent 0 0.12em, currentColor 0.135em);
    transform: rotate(-45deg);
    vertical-align: 0.12em;
}

/* The badge with the way back beneath it. */
.js-area .js-product-badge-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    align-self: center;
    gap: 2px;
    margin-right: 4px;
}
.js-area .js-product-switch-link {
    font-size: 11px;
    line-height: 1.2;
    color: var(--js-switch-link-ink);
    /* The area sets its text light (300); the tech log's link is 400, and the
       same colour looks dimmer in the thinner weight. */
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
}
/* The same blue as the tech log link's hover. */
.js-area .js-product-switch-link:hover,
.js-area .js-product-switch-link:focus-visible {
    color: #0072ce;
    text-decoration: underline;
}

/* Laptops: the compact bar, so it stays on one line. */
@media (min-width: 1281px) and (max-width: 1600px) {
    .js-area .js-area-name { font-size: 0.72rem; padding: 3px 8px; }
    .js-area .js-brand-mark-topbar { width: 30px; height: 30px; margin-right: 4px; }
}

/* Big screens: the badge, mark, way back and dark switch grow with the
   bar, in the same two steps. */
@media (min-width: 1800px) {
    .js-area .js-area-name { font-size: 0.92rem; padding: 5px 12px; }
    .js-area .js-brand-mark-topbar { width: 42px; height: 42px; }
    .js-area .js-product-switch-link { font-size: 12.5px; }
    .js-area .js-theme-switch { font-size: 0.9rem; }
}
@media (min-width: 2400px) {
    .js-area .js-area-name { font-size: 1.05rem; padding: 6px 14px; }
    .js-area .js-brand-mark-topbar { width: 48px; height: 48px; }
    .js-area .js-product-switch-link { font-size: 14px; }
    .js-area .js-theme-switch { font-size: 1rem; }
}

/* ── Phone batteries (dashboard, one section per site card) ──────────
   A full-width domain below the jumps and equipment columns of each site
   card. "Needs attention" lists only the phones that are getting low or low
   and not charging; "All phones" is a folded disclosure (the shared
   .js-collapsible-card pattern) with one line of counts and, when opened,
   small tiles coloured by battery level alone.

   Every colour is a token both themes define: the area status pairs
   (--js-ok-*, --js-warning-*, --js-critical-*), the canopy marker colours
   and the --color-* surface and text tokens. No dark-mode rules needed.
   ─────────────────────────────────────────────────────────────────── */

.js-area {
    /* The charging bolt, drawn once as a mask so it takes the text colour. */
    --js-battery-bolt: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 24%22%3E%3Cpath d=%22M13 2 3 14h7l-1 8 10-12h-7l1-8z%22/%3E%3C/svg%3E");
    --js-battery-tile-min: 8.5rem;
}

/* Below the three fixed-height columns, so it needs the rule they do not draw. */
.js-area .js-site-body-split + .js-domain-battery {
    border-top: 1px solid var(--js-panel-divider);
    padding: 10px 16px 12px;
}

.js-area .js-domain-battery .js-domain-title { margin-bottom: 6px; }

/* "Phones need charging" is the middle column of the site card and is styled
   by the column rules above (.js-site-body-split > .js-domain, .js-domain-rows).
   In the "Phones not at a site" card it stands alone on its row, so it takes
   the column padding and heading rhythm here instead. */
.js-area .js-site-body > .js-domain-phones { padding: 12px 16px 14px; }
.js-area .js-site-body > .js-domain-phones .js-domain-title {
    min-height: 18px;
    margin-bottom: 10px;
}
.js-area .js-site-body > .js-domain-phones + .js-domain-battery { padding: 10px 16px 12px; }

.js-area .js-battery-attention-row { align-items: center; }

/* Site cards fold on their header (the whole card is a <details>); the ▾ and
   the hover are the .js-collapsible-card rules. The counters may wrap on a
   narrow screen. */
.js-area .js-site-summary { flex-wrap: wrap; row-gap: 8px; }

/* The folded list is the same card and the same small triangle as the rows
   on Settings, Equipment and Devices: .js-battery-phones and
   .js-battery-phones-summary are added to those shared rules
   (.js-equipment-row, .js-equipment-summary), not restyled here. Not the
   .js-equipment-row class itself, because that one also closes on any click
   outside it, which a panel left open on the dashboard must not do. */
.js-area .js-battery-phones-summary {
    font-size: 11px;
    /* One line of counts, so the compact row height of a device or person row
       rather than the 56px of a Settings row. */
    min-height: 34px;
    padding: 6px 12px;
}

.js-area .js-battery-phones-label { font-weight: 600; color: var(--color-text, var(--js-ink)); }

.js-area .js-battery-counts {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.js-area .js-battery-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-text, var(--js-ink));
}

.js-area .js-battery-count::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--js-canopy-ok);
}

.js-area .js-battery-count-amber::before { background: var(--js-canopy-warning); }
.js-area .js-battery-count-red::before { background: var(--js-canopy-critical); }

/* The tiles. A list, so a screen reader announces how many phones there are. */
.js-area .js-battery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--js-battery-tile-min), 1fr));
    gap: 6px;
    margin: 0;
    padding: 0 14px 14px;
    list-style: none;
}

.js-area .js-battery-tile {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    padding: 6px 8px;
    border-left: 3px solid var(--js-canopy-ok);
    border-radius: 6px;
    background: var(--js-ok-bg);
    box-sizing: border-box;
}

.js-area .js-battery-tile-amber { border-left-color: var(--js-canopy-warning); background: var(--js-warning-bg); }
.js-area .js-battery-tile-red { border-left-color: var(--js-canopy-critical); background: var(--js-critical-bg); }

.js-area .js-battery-tile-name,
.js-area .js-battery-tile-holder {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.js-area .js-battery-tile-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text, var(--js-ink));
}

.js-area .js-battery-tile-level {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    color: var(--js-ok-ink);
}

.js-area .js-battery-tile-amber .js-battery-tile-level { color: var(--js-warning-ink); }
.js-area .js-battery-tile-red .js-battery-tile-level { color: var(--js-critical-ink); }

.js-area .js-battery-tile-holder {
    font-size: 10px;
    color: var(--color-text-secondary, var(--js-ink-muted));
}

.js-area .js-battery-bolt {
    display: inline-block;
    width: 0.7em;
    height: 0.85em;
    background: currentColor;
    -webkit-mask: var(--js-battery-bolt) center / contain no-repeat;
    mask: var(--js-battery-bolt) center / contain no-repeat;
}

/* The tiny temperature mark, only when the battery is hot. Not a warning. */
.js-area .js-battery-hot {
    margin-left: auto;
    font-size: 10px;
    font-weight: 700;
    color: var(--js-critical-ink);
}

/* ── Settings > Emergency first point of contact ─────────────────────────
   Built from the other Settings pages' components (device rows, the People
   record with its pencils, the audit log list in the "All phones" fold,
   .js-alert, .js-callout, .js-enrolment-result, the maintenance dialog), so
   only two things are styled here: a button that cannot be pressed now, and
   the QR code, which has no other use in the app. */

/* A button that cannot be pressed now (Test call before the contact agreed,
   or while a test is waiting for the phone). */
.js-area .btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

/* A QR code is read by a camera, so it stays dark on white in both themes.
   An inverted code is not read by every phone. */
.js-area .js-enrol-qr {
    --js-qr-paper: #ffffff;
    --js-qr-ink: #111111;
    display: block;
    width: 148px;
    height: auto;
    margin: 8px 0;
    padding: 4px;
    border-radius: 6px;
    background: var(--js-qr-paper);
    color: var(--js-qr-ink);
}

/* History in a contact row is the "All phones" fold at the size it had
   before: the compact row height and padding of .js-device-summary-compact
   and .js-person-summary-compact (40px, 6px 12px), a smaller label, and the
   audit lines straight inside the fold instead of a second framed card. The
   compact classes themselves cannot be put on this summary: they are grids
   with a column per device or person fact. */
.js-area .js-device-row-body .js-battery-phones {
    margin-top: 12px;
    border-radius: 8px;
}

.js-area .js-device-row-body .js-battery-phones-summary {
    min-height: 40px;
    padding: 6px 12px;
    border-radius: 8px;
}

.js-area .js-device-row-body .js-battery-phones .js-audit-list {
    margin: 0;
    border: 0;
    border-top: 1px solid var(--js-line-soft);
    border-radius: 0;
    background: transparent;
}

.js-area .js-device-row-body .js-battery-phones .js-audit-line {
    min-height: 32px;
    font-size: 0.82rem;
}

.js-area .js-device-row-body .js-battery-phones > :is(.js-hint, .js-empty-state) {
    margin: 6px 12px 8px;
}

/* Get NFC tag data: listening controls above the provision fields. */
.js-area .js-nfc-capture {
    margin: 0 0 12px;
}

.js-area .js-nfc-capture-actions {
    margin: 0;
    justify-content: flex-start;
}

.js-area .js-nfc-capture-status {
    margin: 8px 0 0;
}

.js-area .js-pairing-capture-status {
    margin: 0 0 12px;
}

/*
 * Soft green shine on fields just filled from a Tracker probe.
 * Uses the area's ok tokens so light and dark both read as success, not a
 * harsh ring. Fades after a few seconds (class removed in jumpStory.js).
 */
.js-area input.js-nfc-probe-shine {
    border-color: var(--js-ok-ink);
    box-shadow:
        0 0 0 3px var(--js-ok-bg),
        0 0 18px rgba(66, 185, 140, 0.45);
    animation: js-nfc-probe-shine-fade 4.5s ease forwards;
}

@keyframes js-nfc-probe-shine-fade {
    0%,
    55% {
        box-shadow:
            0 0 0 3px var(--js-ok-bg),
            0 0 18px rgba(66, 185, 140, 0.45);
    }
    100% {
        box-shadow: 0 0 0 0 transparent;
        border-color: var(--color-border, var(--js-line));
    }
}

@media (prefers-reduced-motion: reduce) {
    .js-area input.js-nfc-probe-shine {
        animation: none;
    }
}

/* One Nobody-agreed warning above the dashboard site cards. */
.js-area .js-emergency-no-agreed {
    margin-bottom: 0;
}

/* ── The public agreement page (emergency-enrol.php) ─────────────────────
   Built on the sign-in pages' card (.auth-body, .auth-card, .auth-title,
   .auth-alert, .actions in styles.css) with the Devices page's
   .js-detail-list. The sign-in card centres its few short lines; this page
   has paragraphs and a list to read, so they are left-aligned. */
.auth-card .js-enrol-body {
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
}

/* After agree: save Tracker MSISDNs as one address-book contact. */
.auth-card .auth-alert a {
    color: inherit;
    font-weight: 600;
    text-decoration: underline;
}

.auth-card .js-enrol-save-numbers {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border, #d8d8d8);
}

.auth-card .js-enrol-save-numbers .actions {
    margin: 1rem 0 0.5rem;
}

.auth-card .js-enrol-save-numbers .actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    text-decoration: none;
}

/* Compact stage row (replaces Journey + colourful legend). */
.js-area .js-stage-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    align-items: baseline;
    padding: 4px 0 10px;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}
.js-area .js-stage-chip {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    align-items: baseline;
    font-weight: 600;
}
.js-area .js-stage-chip-label { font-weight: 700; }
.js-area .js-stage-chip-first,
.js-area .js-stage-chip-duration { font-weight: 500; opacity: 0.92; }
.js-area .js-stage-chip.js-track-phase-exit { color: var(--js-phase-exit); }
.js-area .js-stage-chip.js-track-phase-freeFall { color: var(--js-phase-freeFall); }
.js-area .js-stage-chip.js-track-phase-deployment { color: var(--js-phase-deployment); }
.js-area .js-stage-chip.js-track-phase-canopy { color: var(--js-phase-canopy); }
.js-area .js-stage-chip.js-track-phase-landed { color: var(--js-phase-landed); }
.js-area .js-stage-chip.js-track-phase-unknown { color: var(--js-phase-unknown); }
/* Dark panels: slightly brighter landed slate for contrast on charcoal. */
[data-js-theme="dark"] .js-area .js-stage-chip.js-track-phase-landed,
html:not([data-js-theme="light"]) .js-area .js-stage-chip.js-track-phase-landed { color: #94a3b8; }

/* Jump chart controls: Flight-style dots, three stacked lines. */
.js-chart-controls { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.js-chart-controls[hidden] { display: none; }
.js-chart-controls label { display: flex; gap: .5rem; align-items: center; }
.js-chart-controls select { min-height: 56px; padding: .5rem; font: inherit; }
.js-chart-controls > span { flex-basis: 100%; }
.js-area .js-chart-controls-dots {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    border: 0;
}
/* On a jump's page every tab's controls sit in a row under the tab bar rather
   than in the figures column, so the figures start at the top. Position only:
   the dots, buttons and notes keep the look they have everywhere else. */
.js-area .js-detail-main .js-chart-controls-dots {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 24px;
}
.js-area .js-detail-main .js-chart-controls-dots .js-chart-control-line {
    flex: 0 1 auto;
}
.js-area .js-detail-main .js-chart-controls-dots .js-chart-control-note,
.js-area .js-detail-main .js-chart-controls-dots .js-chart-zoom-note {
    flex-basis: 100%;
}
.js-area .js-chart-control-line {
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}
.js-area .js-chart-control-line legend {
    float: left;
    width: 100%;
    margin: 0 0 2px;
    padding: 0;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--js-ink-muted);
}
.js-area .js-chart-dot-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--color-text, var(--js-ink));
    user-select: none;
}
.js-area .js-chart-dot-option input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.js-area .js-chart-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--js-panel-border, #d1d5db);
    flex-shrink: 0;
    transition: background 0.15s, box-shadow 0.15s;
}
.js-area .js-chart-dot-option input:checked + .js-chart-dot {
    background: var(--js-accent, #a7cc00);
    box-shadow: none;
}
.js-area .js-chart-dot-option input:focus-visible + .js-chart-dot {
    outline: 2px solid var(--js-accent-text, #5c7300);
    outline-offset: 2px;
}
.js-area .js-chart-control-note,
.js-area .js-chart-zoom-note {
    margin: 0;
    font-size: 0.7rem;
    color: var(--js-ink-muted, #64748b);
    line-height: 1.35;
}
.js-chart-zoom-note { color: var(--js-ink-muted, #64748b); }
.js-chart-altitude-caption,
.js-chart-gload-summary {
    margin: 0 0 .5rem;
    color: var(--js-ink-muted, #64748b);
    font-size: .85rem;
}
.js-chart-event-marker { fill: #f59e0b; stroke: currentColor; }
.js-chart-readout { min-height: 3rem; overflow-wrap: anywhere; }

.js-chart-event-critical { fill: #ef4444; }

.js-area .js-chart-phase-marker { fill: var(--js-chart-altitude); stroke: white; stroke-width: 1; }
.js-area .js-chart-gload-line {
    fill: none;
    stroke: var(--js-chart-gload);
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.js-area .js-chart-reference-g1 {
    stroke: #94a3b8;
    stroke-dasharray: 6 4;
}
.js-area .js-chart-frame .js-jump-chart + .js-jump-chart {
    margin-top: 1rem;
}
.js-area .js-chart-controls select { background: var(--js-surface, white); color: var(--js-ink, #172033); border: 1px solid var(--js-border, #cbd5e1); border-radius: 6px; }

@media (max-width: 720px) {
    .js-area .js-panel-body-chart .js-jump-chart {
        min-height: 280px;
    }
    .js-area .js-chart-controls label {
        flex: 1 1 100%;
    }
}

/*
 * The 3D tab. The canvas is MapLibre plus a deck.gl overlay; the toolbar,
 * scrubber and legends are ordinary controls so they work with a keyboard
 * and read correctly without the canvas.
 */
.js-area .js-descent-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: end;
    margin-bottom: 12px;
}

.js-area .js-descent-control {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--js-ink-muted);
}

.js-area .js-descent-check {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    color: var(--js-ink);
}

.js-area .js-descent-button {
    padding: 6px 12px;
    border: 1px solid var(--js-line);
    border-radius: 6px;
    background: transparent;
    color: var(--js-ink);
    font: inherit;
    cursor: pointer;
}

.js-area .js-descent-button:is(:hover, :focus-visible) {
    border-color: var(--js-ink-muted);
}

.js-area .js-descent-canvas {
    position: relative;
    width: 100%;
    height: 620px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--js-surface-sunken);
}

.js-area .js-descent-scrubber {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.js-area .js-descent-scrubber input[type="range"] {
    width: 100%;
    accent-color: var(--js-accent-strong);
}

.js-area .js-descent-readout {
    font-size: 0.85rem;
    color: var(--js-ink);
    font-variant-numeric: tabular-nums;
    min-height: 1.3em;
}

.js-area .js-descent-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--js-ink-soft);
}

.js-area .js-descent-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.js-area .js-descent-legend li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.js-area .js-descent-swatch {
    display: inline-block;
    width: 18px;
    height: 5px;
    border-radius: 3px;
}

.js-area .js-descent-swatch-measured { background: var(--js-ink-soft); }
.js-area .js-descent-swatch-estimated { background: var(--js-ink-soft); opacity: 0.35; }

.js-area .js-descent-stats {
    flex-basis: 100%;
    margin: 0;
    color: var(--js-ink-muted);
}

@media (max-width: 720px) {
    .js-area .js-descent-canvas { height: 440px; }
}

/* ── Open emergencies on the dashboard (migration 104) ─────────────────── */

/*
 * The emergencies this viewer acknowledged that are still open. The alarm no
 * longer shows them to this person, so they sit at the top of the dashboard in
 * the alarm's own dark colours: an open emergency must never look like an
 * ordinary card. Directions is the widest control, because on a phone the
 * person reading this is usually the one who has to go.
 */
.js-area .js-open-emergencies {
    --js-alarm-surface: #151a23;
    --js-alarm-line: #2b3341;
    --js-alarm-ink: #e9edf3;
    --js-alarm-muted: #8b96a8;
    --js-alarm-red: #ff4d5a;
    --js-alarm-green: #4ed69a;
    --js-alarm-amber: #e8b34a;
    width: min(100%, 46rem);
    margin: 0 auto 1.25rem;
}
.js-area .js-open-emergencies-heading {
    margin: 0 0 0.5rem;
    font-size: 0.8rem; font-weight: 800;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--js-critical-ink);
}
.js-area .js-open-emergency-card {
    padding: 0.9rem 1rem 1rem;
    border: 1px solid var(--js-alarm-line);
    border-left: 6px solid var(--js-alarm-red);
    border-radius: 12px;
    background: var(--js-alarm-surface);
    color: var(--js-alarm-ink);
}
.js-area .js-open-emergency-card + .js-open-emergency-card { margin-top: 0.6rem; }
.js-area .js-open-emergency-place {
    margin: 0;
    font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--js-alarm-muted);
}
.js-area .js-open-emergency-name {
    margin: 0.3rem 0 0;
    font-size: 1.4rem; font-weight: 700; line-height: 1.15;
    color: #ffffff;
}
.js-area .js-open-emergency-rig {
    margin: 0.25rem 0 0;
    font-size: 0.95rem; font-weight: 600;
}
.js-area .js-open-emergency-what {
    margin: 0.35rem 0 0;
    font-size: 0.95rem; font-weight: 600;
    color: var(--js-alarm-red);
}
.js-area .js-open-emergency-status,
.js-area .js-open-emergency-position {
    margin: 0.35rem 0 0;
    font-size: 0.86rem;
    color: var(--js-alarm-muted);
    overflow-wrap: anywhere;
}
.js-area .js-open-emergency-note { display: block; color: var(--js-alarm-amber); }
.js-area .js-open-emergency-actions {
    display: flex; flex-wrap: wrap; gap: 0.55rem;
    margin-top: 0.8rem;
}
.js-area .js-open-emergency-button {
    box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    min-height: 56px;
    padding: 0 1.1rem;
    border: 1px solid var(--js-alarm-line);
    border-radius: 10px;
    color: var(--js-alarm-ink);
    font-weight: 700;
    text-decoration: none;
}
.js-area .js-open-emergency-button-directions {
    border-color: var(--js-alarm-green);
    background: var(--js-alarm-green);
    color: #062417;
}
/* "Stop showing": a button styled as the card's quiet action, never as loud as directions. */
.js-area .js-open-emergency-hide-form { display: contents; }
.js-area .js-open-emergency-button-hide {
    background: transparent;
    color: var(--js-alarm-muted);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    margin-left: auto;
}

@media (max-width: 640px) {
    .js-area .js-open-emergency-button { flex: 1 1 100%; }
    .js-area .js-open-emergency-button-hide { margin-left: 0; }
}

/* ── Jump Story sign-in on Settings > Users (migration 104) ────────────── */

.js-area .js-person-access {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--js-line-soft);
}
.js-area .js-person-access-line { margin: 0; font-size: 0.9rem; color: var(--js-ink-soft); }
.js-area .js-person-access-link-label { font-size: 0.8rem; color: var(--js-ink-muted); }
.js-area .js-person-access-link {
    width: 100%;
    min-height: 44px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
}

/* The role of a Jump Story only session, beside their name in the bar. */
.js-area .js-topbar-role {
    margin-left: 0.35rem;
    font-size: 0.75rem;
    color: var(--js-ink-muted);
}

/* ── The Jump Story sign-in pages ──────────────────────────────────────── */

/* Full width and tall on a phone: these pages are opened from an email on one. */
.auth-body .js-auth-submit { min-height: 56px; width: 100%; }
.auth-body .js-auth-note { margin-top: 1rem; }

/* A save's message shown inside the card it came from (showMessagesInTheirCard). */
.js-alert.js-alert-in-card {
    margin: 12px 16px 0;
}

/* Settings > Equipment: archiving a rig sits apart at the foot of its card. */
.js-details.js-rig-archive {
    margin: 16px 16px 12px;
}
.js-details.js-rig-archive .js-alert {
    margin: 8px 0;
}
.js-rig-archive-warning {
    margin: 0;
}
/* The parts that would be retired, listed under the warning in a smaller size. */
.js-rig-archive-parts {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.5;
}

/*
 * Settings > Equipment > Forecast: number boxes inside a table. A fixed width
 * keeps one box per site, the total and the action on screen; the shared input
 * look is unchanged.
 */
.js-area .js-forecast-table td input {
    width: 6.5rem;
    text-align: right;
}
.js-area .js-forecast-table td input.js-forecast-year-input {
    width: 7.5rem;
    text-align: left;
}
/* Rigs under a site name, and jumps per rig under each box: smaller and
   quieter than the figure they belong to. */
.js-area .js-forecast-table .js-forecast-subline {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    color: var(--js-ink-muted);
}
.js-area .js-forecast-table thead .js-forecast-subline { margin-top: 2px; }
.js-area .js-forecast-jumps-table tbody :is(th, td) { vertical-align: top; padding-top: 12px; padding-bottom: 12px; }
.js-area .js-forecast-table :is(.js-forecast-year, .js-forecast-total) {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    font-weight: 600;
}
/* The row that adds a year is set apart from the years already saved. */
.js-area .js-forecast-table tr.js-forecast-new-row > td { border-top: 1px dashed var(--js-line); }

/* A small red cross that removes the thing beside it, the Jump Story form of
   the app's inline remove buttons (training courses, CAMO contacts). */
.js-area .js-icon-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: none;
    color: var(--js-critical-ink);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease;
}
.js-area .js-icon-remove:hover,
.js-area .js-icon-remove:focus-visible { background: var(--js-critical-bg); }

/*
 * Equipment value reports. Columns about the same part share one fill, and a
 * figure that needs attention is amber or red, from the same life, age and
 * repack answers as the equipment page. Table cells are cleared with
 * !important so rows carry the colour (see "Cells carry no background"), so
 * the fills match that weight and outrank it; the table's own td colour is
 * (0,2,1), so the figure classes are scoped to win too.
 */
.js-area .js-report-table tbody tr:nth-child(n) > :is(th, td).js-report-group-container,
.js-area .js-report-table thead th.js-report-group-container { background-color: var(--js-report-container-tint) !important; }
.js-area .js-report-table tbody tr:nth-child(n) > :is(th, td).js-report-group-canopy,
.js-area .js-report-table thead th.js-report-group-canopy { background-color: var(--js-report-canopy-tint) !important; }
.js-area .js-report-table tbody tr:nth-child(n) > :is(th, td).js-report-group-reserve,
.js-area .js-report-table thead th.js-report-group-reserve { background-color: var(--js-report-reserve-tint) !important; }
.js-area .js-report-table tbody tr:nth-child(n) > :is(th, td).js-report-group-aad,
.js-area .js-report-table thead th.js-report-group-aad { background-color: var(--js-report-aad-tint) !important; }
/* Value reports: a title over each part's columns, and column titles a word
   to a line, so a column is as wide as its figures and not its title. */
.js-area .js-report-table thead th { white-space: normal; vertical-align: bottom; }
.js-area .js-report-table .js-report-heading { display: inline-block; width: min-content; }
.js-area .js-report-table .js-report-group-titles th { text-align: center; border-bottom: 0; padding-bottom: 2px; }
/* Every figure and title centred, and a thick line before each part's
   columns (owner request 19.11.2026), as in the Excel download. */
.js-area .js-report-table :is(th, td),
.js-area .js-report-table :is(th, td).js-numeric { text-align: center; }
.js-area .js-report-table th .js-sort-button { justify-content: center; }
/* Answered at the !important weight the table rule above uses to remove
   vertical lines, with a more specific selector. */
.js-area .js-table.js-report-table :is(th, td).js-report-group-start { border-left: 2px solid var(--js-ink) !important; }
.js-area .js-report-table td.js-figure-warning { color: var(--js-seen-warning-ink); font-weight: 600; }
.js-area .js-report-table td.js-figure-critical { color: var(--js-severity-critical, #d93647); font-weight: 600; }

/* ── Templates: main tabs over sub-tabs ───────────────────────────── */

/* Templates and Categories are the main tabs; Rigs and Components sit under
   them. Weight and size tell the two rows apart; the look is otherwise the
   site's tab. */
.js-area .js-templates-main-tabs .js-detail-tab {
    font-weight: 700;
    font-size: 0.95rem;
}
.js-area .js-templates-sub-tabs .js-detail-tab {
    font-weight: 500;
    font-size: 0.84rem;
}

/*
 * Settings > Equipment > Replacement, Rules: a grid of number boxes. Even
 * columns under a quiet Limits and Stock heading, figures right-aligned under
 * their headings, and parts with no rule yet dimmed. The boxes keep the
 * site's input look; only their size and alignment are set here.
 */
/* One faint tint per column group, so Limits, Inspect and Stock read as three
   blocks: blue, violet and green, mixed down to a wash that works in both
   themes. Set on the <col>, so every cell of the group carries it. */
.js-area .js-replacement-table .js-rule-group-limits { background: color-mix(in srgb, var(--js-info-ink) 10%, transparent); }
.js-area .js-replacement-table .js-rule-group-inspect { background: color-mix(in srgb, var(--js-violet-ink) 10%, transparent); }
.js-area .js-replacement-table .js-rule-group-stock { background: color-mix(in srgb, var(--js-ok-ink) 10%, transparent); }
/* The group headings take the hue of their columns in their text. */
.js-area .js-replacement-table th.js-rule-group-limits { color: var(--js-info-ink); }
.js-area .js-replacement-table th.js-rule-group-inspect { color: var(--js-violet-ink); }
.js-area .js-replacement-table th.js-rule-group-stock { color: var(--js-ok-ink); }

/* Fixed widths that add up to the table's, so the part's name always keeps
   its column and a narrow screen scrolls the table sideways instead. */
.js-area .js-replacement-table { table-layout: fixed; width: 100%; min-width: 74rem; }
.js-area .js-replacement-table .js-replacement-col-part { width: 12rem; }
.js-area .js-replacement-table .js-replacement-col-unit { width: 6.5rem; }
.js-area .js-replacement-table .js-replacement-col-limit { width: 7.25rem; }
.js-area .js-replacement-table .js-replacement-col-stock { width: 6.25rem; }
/* Inspect every: the number and jumps or days, side by side. */
.js-area .js-replacement-table .js-replacement-col-inspect { width: 10.5rem; }
.js-area .js-replacement-table .js-replacement-inspect { display: flex; gap: 4px; align-items: center; }
.js-area .js-replacement-table .js-replacement-inspect input { flex: 1 1 auto; min-width: 0; }
.js-area .js-replacement-table .js-replacement-inspect select { flex: 0 0 4.9rem; width: 4.9rem; padding: 2px 6px; }
.js-area .js-replacement-table :is(th, td) { padding: 7px 8px; vertical-align: middle; }
.js-area .js-replacement-table thead tr:last-child th {
    vertical-align: bottom;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: normal;
}
.js-area .js-replacement-table thead tr:last-child th.js-numeric { text-align: right; padding-right: 12px; }
.js-area .js-replacement-table td :is(input, select) {
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    height: 30px;
    min-height: 0;
    padding: 2px 10px;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
}
.js-area .js-replacement-table td input { text-align: right; }
.js-area .js-replacement-table td input::placeholder { color: var(--js-ink-muted); opacity: 0.55; }
.js-area .js-replacement-table tbody tr:hover > :is(th, td) {
    background: color-mix(in srgb, var(--js-accent) 4%, transparent);
}
.js-area .js-replacement-table td.js-numeric { font-variant-numeric: tabular-nums; }
/* Limits and Stock over their columns: small, muted, with a hairline. */
.js-area .js-replacement-table .js-replacement-groups > * {
    padding-bottom: 2px;
    border-bottom: 0;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    color: var(--js-ink-muted);
}
.js-area .js-replacement-table .js-replacement-groups > th {
    background-image: linear-gradient(var(--js-line), var(--js-line));
    background-size: calc(100% - 16px) 1px;
    background-position: center bottom;
    background-repeat: no-repeat;
}
.js-area .js-replacement-table tr.js-replacement-unset > th { color: var(--js-ink-muted); font-weight: 400; }
.js-area .js-replacement-table tr.js-replacement-unset :is(input, select) { opacity: 0.6; }
.js-area .js-replacement-table tr.js-replacement-unset :is(input, select):focus { opacity: 1; }

/* Rig Log, Components Log: the third row, one tab per kind of part. Smaller
   and quieter than the two rows above, and it scrolls sideways on a phone
   rather than wrapping into a block of tabs. */
.js-area .js-component-kind-tabs {
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    padding: 6px 0;
    border-bottom: 0;
}
.js-area .js-component-kind-tabs::-webkit-scrollbar { display: none; }
.js-area .js-component-kind-tabs .js-detail-tab {
    padding: 4px 12px;
    margin-bottom: 0;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}
/* The chosen kind: a soft pill in the same lime as the tab outline above. */
.js-area .js-component-kind-tabs .js-detail-tab-active {
    background: color-mix(in srgb, var(--js-accent) 8%, transparent);
    border-color: color-mix(in srgb, var(--js-accent) 38%, transparent);
}

/* The chosen main tab and the chosen sub-tab share one outline with a soft
   shine, drawn by jumpStory.js (attachTabPairs) round both and the step
   between them, so the pair reads as one choice. Behind the tab text. */
.js-area .js-tab-pair {
    position: relative;
    margin-bottom: 12px;
}
.js-area .js-tab-pair > .js-detail-tabs {
    position: relative;
    z-index: 1;
    margin-bottom: 0;
}
.js-area .js-tab-pair > .js-templates-main-tabs { margin-bottom: 4px; }
.js-area .js-tab-pair-outline {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
    z-index: 0;
}
.js-area .js-tab-pair-outline path {
    fill: color-mix(in srgb, var(--js-accent) 5%, transparent);
    stroke: color-mix(in srgb, var(--js-accent) 38%, transparent);
    stroke-width: 1;
    filter: drop-shadow(0 0 3px color-mix(in srgb, var(--js-accent) 28%, transparent));
}
/* The outline marks the chosen pair, so its tabs need no underline. A tab
   with no sub-tab under it keeps the underline, as no outline is drawn. */
.js-area .js-tab-pair.js-tab-pair-drawn .js-detail-tab-active { border-bottom-color: transparent; }

/* ── Component templates grouped by category ─────────────────────── */

/* One faint tint per component category, on the component templates list and
   in the Component Costs report (CategoryTint). Hues far apart, so neighbouring
   categories never look alike: one blue, one pink, one red. Mixed with
   transparent, so the same tint sits lightly on the light and the dark
   background; the greys and browns are a little stronger to show at all.
   :nth-child(n) and !important answer the striping the dark palettes put on
   table rows, as the jump rows do. */
.js-area {
    --js-category-tint-1: color-mix(in srgb, #3b82f6 16%, transparent);
    --js-category-tint-2: color-mix(in srgb, #a855f7 16%, transparent);
    --js-category-tint-3: color-mix(in srgb, #14b8a6 16%, transparent);
    --js-category-tint-4: color-mix(in srgb, #facc15 20%, transparent);
    --js-category-tint-5: color-mix(in srgb, #ef4444 14%, transparent);
    --js-category-tint-6: color-mix(in srgb, #22c55e 16%, transparent);
    --js-category-tint-7: color-mix(in srgb, #fb923c 22%, transparent);
    --js-category-tint-8: color-mix(in srgb, #64748b 20%, transparent);
    --js-category-tint-9: color-mix(in srgb, #f472b6 18%, transparent);
    --js-category-tint-10: color-mix(in srgb, #92400e 18%, transparent);
}
.js-area .js-table tbody tr.js-category-tint-1:nth-child(n),
.js-area .js-report-table tbody tr:nth-child(n) > :is(th, td).js-report-group-category-tint-1 { background-color: var(--js-category-tint-1) !important; }
.js-area .js-table tbody tr.js-category-tint-2:nth-child(n),
.js-area .js-report-table tbody tr:nth-child(n) > :is(th, td).js-report-group-category-tint-2 { background-color: var(--js-category-tint-2) !important; }
.js-area .js-table tbody tr.js-category-tint-3:nth-child(n),
.js-area .js-report-table tbody tr:nth-child(n) > :is(th, td).js-report-group-category-tint-3 { background-color: var(--js-category-tint-3) !important; }
.js-area .js-table tbody tr.js-category-tint-4:nth-child(n),
.js-area .js-report-table tbody tr:nth-child(n) > :is(th, td).js-report-group-category-tint-4 { background-color: var(--js-category-tint-4) !important; }
.js-area .js-table tbody tr.js-category-tint-5:nth-child(n),
.js-area .js-report-table tbody tr:nth-child(n) > :is(th, td).js-report-group-category-tint-5 { background-color: var(--js-category-tint-5) !important; }
.js-area .js-table tbody tr.js-category-tint-6:nth-child(n),
.js-area .js-report-table tbody tr:nth-child(n) > :is(th, td).js-report-group-category-tint-6 { background-color: var(--js-category-tint-6) !important; }
.js-area .js-table tbody tr.js-category-tint-7:nth-child(n),
.js-area .js-report-table tbody tr:nth-child(n) > :is(th, td).js-report-group-category-tint-7 { background-color: var(--js-category-tint-7) !important; }
.js-area .js-table tbody tr.js-category-tint-8:nth-child(n),
.js-area .js-report-table tbody tr:nth-child(n) > :is(th, td).js-report-group-category-tint-8 { background-color: var(--js-category-tint-8) !important; }
.js-area .js-table tbody tr.js-category-tint-9:nth-child(n),
.js-area .js-report-table tbody tr:nth-child(n) > :is(th, td).js-report-group-category-tint-9 { background-color: var(--js-category-tint-9) !important; }
.js-area .js-table tbody tr.js-category-tint-10:nth-child(n),
.js-area .js-report-table tbody tr:nth-child(n) > :is(th, td).js-report-group-category-tint-10 { background-color: var(--js-category-tint-10) !important; }

/* ── A card's Actions menu on its closed line ─────────────────────── */

/* People, sites, devices, emergency contacts, rigs and spares put their
   actions in one menu at the right of the closed line, as a fitted part does.
   The grids gain an auto track before the chevron for it. The panel is placed
   against its button by jumpStory.js, so a small card cannot cut it off. */
.js-area .js-summary-actions {
    justify-self: end;
    cursor: default;
}
.js-area .js-person-summary-compact.js-has-summary-actions {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 180px) minmax(0, 140px) max-content auto 14px;
}
.js-area .js-site-row-summary.js-has-summary-actions {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 200px) minmax(0, 90px) max-content auto 14px;
}
.js-area .js-device-summary-compact.js-has-summary-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 110px) minmax(0, 240px) auto auto 14px;
}
.js-area .js-equipment-summary-compact.js-has-summary-actions {
    grid-template-columns: 22px minmax(0, 1fr) auto 14px;
}
.js-area .js-equipment-summary-compact.js-spare-summary.js-has-summary-actions {
    grid-template-columns: minmax(0, 1fr) auto auto 14px;
}
/* A spare's jumps and price on its closed line, in the fitted part's figure style. */
.js-area .js-spare-summary-figures {
    display: inline-flex;
    gap: 14px;
    justify-self: end;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
@media (max-width: 600px) {
    .js-area .js-equipment-summary-compact.js-spare-summary.js-has-summary-actions {
        grid-template-columns: minmax(0, 1fr) auto 14px;
    }
    /* The name, the figures and the menu each have a line, so a wide Actions
       menu cannot squeeze the name or the figures to a letter. */
    .js-area .js-equipment-summary-compact.js-spare-summary .js-equipment-identity {
        grid-column: 1 / 3;
        grid-row: 1;
    }
    .js-area .js-equipment-summary-compact.js-spare-summary::after {
        grid-column: 3;
        grid-row: 1;
    }
    .js-area .js-spare-summary-figures {
        grid-column: 1 / 4;
        grid-row: 2;
        justify-self: start;
    }
    .js-area .js-spare-summary .js-summary-actions {
        grid-column: 1 / 4;
        grid-row: 3;
        justify-self: start;
    }
}
@media (max-width: 860px) {
    /* On a phone the facts stack under the name; the menu keeps to the right
       of the first line, beside the chevron. */
    .js-area summary.js-device-summary.js-has-summary-actions {
        grid-template-columns: minmax(0, 1fr) auto 14px;
    }
    .js-area summary.js-device-summary.js-has-summary-actions > span.js-summary-actions[data-summary-actions] {
        grid-column: 2;
        grid-row: 1;
    }
}

/* A save reloading the page stays hidden until it is back where the reader was (jumpStory.js, restoreKeptScroll). */
html[data-js-restoring] body {
    visibility: hidden;
}

/*
 * Several rigs or spares at once (partials/bulkBar.php). The bar sits under
 * the search; its Actions menu shows once a line is ticked. The tick is the
 * site's dot, in the closed line's own left padding, so the line's grid is
 * unchanged; a line that cannot be ticked keeps the padding and lines up.
 */
.js-area .js-bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 16px;
    margin: 0 0 8px;
}
.js-area .js-bulk-bar .js-bulk-all {
    padding-left: 13px;
}
.js-area .js-bulk-bar .js-bulk-count {
    margin: 0;
}
.js-area summary.js-has-bulk-pick {
    position: relative;
    padding-left: 40px;
}
.js-area summary.js-has-bulk-pick > .js-bulk-pick {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 40px;
    min-height: 0;
    justify-content: center;
}

/*
 * A save's message at the top centre, where it is seen, so the page does not
 * move to show it (jumpStory.js, showToast). The page's own alert, on a
 * solid surface.
 */
.js-area .js-toast-stack {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: grid;
    justify-items: center;
    gap: 8px;
    width: max-content;
    max-width: min(520px, calc(100vw - 32px));
    pointer-events: none;
}
.js-area .js-toast-stack > .js-alert {
    margin: 0;
    align-items: center;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    background: var(--color-surface, var(--js-surface));
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.16);
    pointer-events: auto;
    transition: opacity 0.3s, transform 0.3s;
}


/*
 * Registered systems and Spares: the search and the bulk bar stick to the
 * top while the list scrolls, so the Actions menu is in reach after ticking
 * a rig at the foot of a long list.
 */
.js-area .js-list-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: 0 -8px 8px;
    padding: 8px 8px 0;
    background: var(--color-surface, var(--js-surface));
    border-bottom: 1px solid transparent;
}
.js-area .js-list-toolbar .js-bulk-bar {
    margin-bottom: 0;
    padding-bottom: 8px;
}

/* ── Jump comments (jumpStoryComments.js) ─────────────────────────────
   The speech bubble on a Jump Log row and on the jump page, the hover
   preview, and the comment panel. A soft card with a shadow; avatars are
   initials on a quiet tone; a mention is a light pill. Colours come from the
   theme variables, so both themes work. On a phone the panel is a sheet. */
.js-area .js-comment-cell { width: 1%; white-space: nowrap; }
.js-area .js-comment-button {
    display: inline-flex; align-items: center; gap: 4px;
    min-height: 32px; padding: 4px 8px;
    border: 0; border-radius: 999px;
    background: transparent; color: var(--js-ink-muted);
    font-size: 0.8rem; font-weight: 600; cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.js-area .js-comment-button:hover,
.js-area .js-comment-button[aria-expanded="true"] {
    background: var(--js-surface-sunken); color: var(--js-ink);
}
.js-area .js-comment-button:focus-visible { outline: 2px solid var(--js-accent); outline-offset: 2px; }
.js-area .js-comment-button-has { color: var(--js-info-ink); }
.js-area .js-comment-count:empty { display: none; }

.js-comment-pop {
    position: absolute; z-index: 1000;
    width: min(380px, calc(100vw - 16px));
    background: var(--js-surface, #fff); color: var(--js-ink, #1d2433);
    border: 1px solid var(--js-line, #e3e7ee);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.06);
    font-size: 0.875rem;
    animation: jsCommentIn 0.14s ease-out;
}
@keyframes jsCommentIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.js-comment-preview { padding: 12px 14px 8px; pointer-events: auto; }
.js-comment-preview-foot { margin: 6px 0 0; font-size: 0.75rem; color: var(--js-ink-muted, #6b7385); }
.js-comment-panel { display: flex; flex-direction: column; max-height: min(560px, calc(100vh - 32px)); }
.js-comment-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--js-line-soft, #eef1f5);
}
.js-comment-title { margin: 0; font-size: 0.95rem; font-weight: 600; }
.js-comment-close {
    width: 30px; height: 30px; border: 0; border-radius: 50%;
    background: transparent; color: var(--js-ink-muted, #6b7385); font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.js-comment-close:hover { background: var(--js-surface-sunken, #f3f5f8); color: var(--js-ink, #1d2433); }
.js-comment-list { display: flex; flex-direction: column; gap: 14px; }
.js-comment-list-scroll { padding: 14px; overflow-y: auto; min-height: 60px; }
.js-comment-empty { margin: 4px 0; color: var(--js-ink-muted, #6b7385); }
.js-comment-thread { display: flex; flex-direction: column; gap: 10px; }
/* Replies sit beside a thin rounded pill, the app's way of grouping, never a
   coloured left border. */
.js-comment-replies {
    position: relative;
    display: flex; flex-direction: column; gap: 10px;
    margin-left: 14px; padding-left: 18px;
}
.js-comment-replies::before {
    content: ""; position: absolute; left: 0; top: 2px; bottom: 2px;
    width: 4px; border-radius: 2px; background: var(--js-line, #e3e7ee);
}
.js-comment { display: flex; gap: 10px; align-items: flex-start; }
.js-comment-main { flex: 1; min-width: 0; }
.js-comment-meta { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.js-comment-author { font-weight: 600; }
.js-comment-time { font-size: 0.75rem; color: var(--js-ink-muted, #6b7385); }
.js-comment-text { margin: 2px 0 0; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.js-comment-deleted .js-comment-text { font-style: italic; color: var(--js-ink-muted, #6b7385); }
.js-comment-mention {
    padding: 0 4px; border-radius: 6px;
    background: color-mix(in srgb, var(--js-info-ink, #1f5cab) 12%, transparent);
    color: var(--js-info-ink, #1f5cab); font-weight: 600;
}
.js-comment-reply-count { margin: 0 0 0 40px; font-size: 0.75rem; color: var(--js-ink-muted, #6b7385); }
.js-comment-actions { display: flex; gap: 12px; margin-top: 4px; }
.js-comment-link {
    padding: 0; border: 0; background: none; cursor: pointer;
    font-size: 0.75rem; font-weight: 600; color: var(--js-ink-muted, #6b7385);
}
.js-comment-link:hover { color: var(--js-ink, #1d2433); text-decoration: underline; }
.js-comment-link-danger { color: var(--js-critical-ink, #b42318); }
.js-comment-delete { display: inline-flex; gap: 8px; align-items: baseline; }
.js-comment-confirm { font-size: 0.75rem; color: var(--js-ink-soft, #4a5263); }

.js-comment-avatar {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 50%;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em;
}
.js-comment-avatar-small { width: 24px; height: 24px; font-size: 0.62rem; }
.js-comment-avatar-tone-0 { background: color-mix(in srgb, var(--js-info-ink, #1f5cab) 16%, transparent); color: var(--js-info-ink, #1f5cab); }
.js-comment-avatar-tone-1 { background: color-mix(in srgb, var(--js-violet-ink, #62509b) 16%, transparent); color: var(--js-violet-ink, #62509b); }
.js-comment-avatar-tone-2 { background: color-mix(in srgb, var(--js-ok-ink, #14684a) 16%, transparent); color: var(--js-ok-ink, #14684a); }
.js-comment-avatar-tone-3 { background: color-mix(in srgb, var(--js-warning-ink, #8a5602) 16%, transparent); color: var(--js-warning-ink, #8a5602); }
.js-comment-avatar-tone-4 { background: color-mix(in srgb, var(--js-critical-ink, #b42318) 13%, transparent); color: var(--js-critical-ink, #b42318); }
.js-comment-avatar-tone-5 { background: var(--js-surface-sunken, #f3f5f8); color: var(--js-ink-soft, #4a5263); }

.js-comment-composer { position: relative; padding: 10px 14px 12px; border-top: 1px solid var(--js-line-soft, #eef1f5); }
.js-comment-reply-chip {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin-bottom: 6px; font-size: 0.75rem; color: var(--js-ink-soft, #4a5263);
}
.js-comment-input-row {
    display: flex; align-items: flex-end; gap: 6px;
    padding: 4px 4px 4px 12px;
    border: 1px solid var(--js-line, #e3e7ee); border-radius: 18px;
    background: var(--js-surface-sunken, #f6f7fa);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.js-comment-input-row:focus-within { border-color: var(--js-ink-muted, #6b7385); }
.js-area .js-comment-input-row .js-comment-input,
.js-area .js-comment-input-row .js-comment-input:focus,
.js-area .js-comment-input-row .js-comment-input:focus-visible,
.js-comment-input-row .js-comment-input {
    flex: 1; min-width: 0; min-height: 22px; max-height: 160px;
    padding: 6px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none;
    resize: none; font: inherit; color: inherit; outline: none;
}
/* Just the paper plane: no disc behind it. */
.js-comment-send {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
    background: transparent; color: var(--js-ink-muted, #6b7385); cursor: pointer;
    transition: color 0.15s;
}
.js-comment-send:hover,
.js-comment-send:focus-visible { color: var(--js-ink, #1d2433); }
.js-comment-send:disabled { opacity: 0.4; cursor: default; }
.js-comment-hint { margin: 6px 0 0 12px; font-size: 0.7rem; color: var(--js-ink-muted, #6b7385); }
.js-comment-error { margin: 6px 0 0; font-size: 0.8rem; color: var(--js-critical-ink, #b42318); }

.js-comment-mention-menu {
    position: absolute; left: 14px; right: 14px; bottom: calc(100% - 6px);
    max-height: 260px; overflow-y: auto;
    margin: 0; padding: 6px; list-style: none;
    background: var(--js-surface, #fff); border: 1px solid var(--js-line, #e3e7ee); border-radius: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}
.js-comment-mention-option {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px; border-radius: 8px; cursor: pointer;
}
.js-comment-mention-active,
.js-comment-mention-option:hover { background: var(--js-surface-sunken, #f3f5f8); }
.js-comment-mention-name { font-weight: 600; }
.js-comment-mention-role { margin-left: auto; font-size: 0.72rem; color: var(--js-ink-muted, #6b7385); }

@media (max-width: 640px) {
    /* A sheet from the bottom of the screen, whatever the button's position. */
    .js-comment-panel {
        position: fixed; left: 0 !important; right: 0; bottom: 0; top: auto !important;
        width: 100%; max-height: 85vh; border-radius: 16px 16px 0 0;
    }
    .js-comment-send { width: 44px; height: 44px; }
}
