/* ============================================================================
   Shared week/time-entry grid surfaces (Nacos.TimeSurfaces) — AppDevGuidance §94.
   Moved MOVE-ONLY from NM002M.Shared/wwwroot/app.css (2026-08-20 modularization
   plan, unit C1): the .ts-* grid families (.tsf-orders / .tsf-all / .tsf-exempt
   scopes, .ts-scroll, status columns, entry-grid + display-table treatments),
   the .nm-tablecard / .nm-iconbtn chrome, the .nm-entrygrid border model, and
   the ≤640px .nm-mobile-clock-grid phone layer. Selector text and declarations
   are verbatim; only the file moved. Internal order preserved — several rules
   here rely on source order against their equal-specificity siblings (the
   single-side .nm-entrygrid border model most of all), so append, never reorder.

   Hosts load this sheet BEFORE their own stylesheet (App.razor stamps ?v= on it
   like every head asset) so host rules keep final say on any future override.
   The weekly-matrix phone layers (.nm-mobile-week-grid/-dp-/-de-) and the orders
   template's payroll-summary rules stay host-side in app.css — they belong to
   templates/surfaces that have not moved. The .tsf-all payroll-summary first-column
   rules moved here beside the shared WeekPayrollSummary (T3.1c slice B, 2026-09-24).
   ========================================================================== */

/* ── Bootstrap independence (T3.1c slice B, spec 2026-09-23-shared-week-editor-model §8.2 item 3, 2026-09-24).
   The shared components emit these Bootstrap classes; NM loads Bootstrap, Partner and the constructed portal
   do not. Each rule repeats Bootstrap 5.3's own declarations (light theme, resolved to literals) at Bootstrap's
   own specificity, and the block OPENS the sheet so that in NM's document it sits where Bootstrap sits: after
   Bootstrap's identical originals and before every rule of this sheet and of the hosts' that already overrides
   them by order (the .btn-primary / .btn-outline-primary palette, a .btn-link, the .srm-step-action geometry,
   Home's .badge retints). NM computes the same values from either copy; Partner and the candidate get NM's look.
   `body` carries the reboot's inherited base, line-height 1.5 and colour #212529 (T3.1d, finding F2).
   TimeSurfacesStylesheetIndependenceGuardTests pins the set and the values. ── */
body { line-height: 1.5; color: #212529; }
.btn { display: inline-block; padding: .375rem .75rem; font-size: 1rem; font-weight: 400; line-height: 1.5; color: #212529; text-align: center; text-decoration: none; vertical-align: middle; cursor: pointer; user-select: none; border: 1px solid transparent; border-radius: .375rem; background-color: transparent; transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out; }
.btn:disabled { pointer-events: none; opacity: .65; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
.btn-primary { color: #fff; background-color: #0d6efd; border-color: #0d6efd; }
.btn-primary:hover { color: #fff; background-color: #0b5ed7; border-color: #0a58ca; }
.btn-primary:focus-visible { color: #fff; background-color: #0b5ed7; border-color: #0a58ca; outline: 0; box-shadow: 0 0 0 .25rem rgba(49, 132, 253, .5); }
.btn-primary:disabled { color: #fff; background-color: #0d6efd; border-color: #0d6efd; }
.btn-outline-primary { color: #0d6efd; border-color: #0d6efd; }
.btn-outline-primary:hover { color: #fff; background-color: #0d6efd; border-color: #0d6efd; }
.btn-outline-primary:focus-visible { color: #fff; background-color: #0d6efd; border-color: #0d6efd; outline: 0; box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .5); }
.btn-outline-primary:disabled { color: #0d6efd; background-color: transparent; border-color: #0d6efd; }
.btn-link { font-weight: 400; color: #0d6efd; text-decoration: underline; }
.btn-link:hover { color: #0a58ca; }
.btn-link:disabled { color: #6c757d; }
.btn-sm { padding: .25rem .5rem; font-size: .875rem; border-radius: .25rem; }
.btn-close { box-sizing: content-box; width: 1em; height: 1em; padding: .25em .25em; color: #000; background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat; border: 0; border-radius: .375rem; opacity: .5; }
.btn-close:hover { color: #000; text-decoration: none; opacity: .75; }
.btn-close:focus { outline: 0; box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25); opacity: 1; }
.btn-close:disabled { pointer-events: none; user-select: none; opacity: .25; }
.alert { position: relative; padding: 1rem 1rem; margin-bottom: 1rem; color: inherit; background-color: transparent; border: 1px solid transparent; border-radius: .375rem; }
.alert-danger { color: #58151c; background-color: #f8d7da; border-color: #f1aeb5; }
.alert-warning { color: #664d03; background-color: #fff3cd; border-color: #ffe69c; }
.alert-success { color: #0a3622; background-color: #d1e7dd; border-color: #a3cfbb; }
.alert-info { color: #055160; background-color: #cff4fc; border-color: #9eeaf9; }
.alert-dismissible { padding-right: 3rem; }
.alert-dismissible .btn-close { position: absolute; top: 0; right: 0; z-index: 2; padding: 1.25rem 1rem; }
.badge { display: inline-block; padding: .35em .65em; font-size: .75em; font-weight: 700; line-height: 1; color: #fff; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: .375rem; }
.badge:empty { display: none; }
.bg-secondary { background-color: rgba(108, 117, 125, 1) !important; }
.spinner-border { display: inline-block; width: 2rem; height: 2rem; vertical-align: -.125em; border: .25em solid currentcolor; border-right-color: transparent; border-radius: 50%; animation: .75s linear infinite spinner-border; }
.spinner-border-sm { width: 1rem; height: 1rem; border-width: .2em; }
@keyframes spinner-border { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner-border { animation-duration: 1.5s; } }
.text-danger { color: rgba(220, 53, 69, 1) !important; }
.text-success { color: rgba(25, 135, 84, 1) !important; }
.py-1 { padding-top: .25rem !important; padding-bottom: .25rem !important; }
.px-2 { padding-right: .5rem !important; padding-left: .5rem !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }

/* ── Tokens and page base (program unit 1.9 correction 1, 2026-09-14), moved verbatim from both
   hosts' app.css on the review's ruling G1
   (docs/handoffs/results/2026-09-14-app-css-ownership-split-review.md §4): the --nm-* design
   tokens, the page base (html, body), the link colour (a, .btn-link) and the phone-width token
   overrides. This sheet and time-portal-chrome.css read these tokens throughout, the signed-out
   card included, and defined none of them. They open the sheet, so every later rule here and in
   each host's own sheet still loads after them, as it did. NM's --nm-static-cache-coherence
   sentinel is a host fact and stays in NM's app.css. ── */

/* ============================================================================
   NM design tokens (2026-06-11, AppDevGuidance §49). Components consume these
   variables — never hex/px literals. Hard floors: no text below 0.7rem
   (--nm-font-small), no interactive target below 24px (--nm-control-h).
   ========================================================================== */
:root {
    /* palette */
    --nm-red: #ED1C24;          /* NACOS red — errors/flags */
    --nm-amber: #f59e0b;        /* soft attention — "did you forget?", non-blocking (vs red errors) */
    --nm-blue: #0d4f8a;         /* primary action blue */
    /* Stage 5 (2026-06-11): grid header + line colors moved from the Excel
       blue-grey pastiche to the Tailwind kit's zinc neutrals so the grids
       match the chrome. ONE-LINE REVERT if the blue is missed:
       --nm-hdr-bg: #D6E4F0;  --nm-border: #b4c6d8; */
    --nm-hdr-bg: #f4f4f5;       /* grid header (was Excel-blue #D6E4F0) */
    --nm-calc-bg: #fafafa;      /* calculated/read-only cells — zinc-50
                                   (tan #EEECE1 retired; revert by setting
                                   #EEECE1 here) */
    --nm-border: #d4d4d8;       /* grid lines, zinc-300 (was blue-grey #b4c6d8) */
    /* typography
       Data surfaces use the kit's sans too — same
       family everywhere; digit alignment is preserved because every data
       surface declares font-variant-numeric: tabular-nums (equal-width
       digits), which Segoe UI supports. The shipped Cascadia Code stays
       available via --nm-font-truemono if real monospace is ever wanted.
       ONE-LINE REVERT: --nm-font-mono: var(--nm-font-truemono); */
    --nm-font-truemono: 'Cascadia Code', 'Consolas', 'Courier New', monospace;
    --nm-font-mono: 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
    --nm-font-grid: 0.8rem;     /* grid body text */
    --nm-font-ui: 0.85rem;      /* chrome: buttons, inputs, pickers */
    --nm-font-small: 0.7rem;    /* FLOOR — badges, sub-labels; nothing smaller */
    /* metrics */
    --nm-control-h: 24px;       /* FLOOR — min height of any interactive target */
    --nm-radius: 4px;
    --nm-sp-1: 2px;
    --nm-sp-2: 4px;
    --nm-sp-3: 8px;

    /* ── Chrome layer (Stage 2, 2026-06-11) — extracted from the licensed
       Tailwind Plus Catalyst kit: zinc neutral scale, hairline rings,
       8/12px radii, soft shadows, sans chrome around the mono grid. */
    --nm-z50: #fafafa;  --nm-z100: #f4f4f5; --nm-z200: #e4e4e7; --nm-z300: #d4d4d8;
    --nm-z400: #a1a1aa; --nm-z500: #71717a; --nm-z600: #52525b; --nm-z700: #3f3f46;
    --nm-z900: #18181b; --nm-z950: #09090b;
    --nm-font-sans: 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
    --nm-ring: rgba(9, 9, 11, 0.10);          /* Catalyst border-zinc-950/10 */
    --nm-ring-strong: rgba(9, 9, 11, 0.15);
    --nm-radius-lg: 8px;
    --nm-radius-xl: 12px;
    --nm-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --nm-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.05);
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--nm-z100);
}

a, .btn-link {
    color: #006bb7;
}

/* Phone-width overrides of the tokens above (NM002M's phone layout layer). */
@media (max-width: 640px) {
    :root {
        --nm-font-grid: 0.95rem;    /* grid body text (0.8rem on desktop) */
        --nm-font-ui: 1rem;         /* chrome: buttons, inputs, pickers (0.85rem) */
        --nm-font-small: 0.78rem;   /* badges, sub-labels (0.7rem) */
        --nm-control-h: 32px;       /* interactive-target floor (24px) */
    }
}

/* Rounded table card (Stage 4, 2026-06-11): HTML tables can't round their own
   corners under border-collapse, so each grid is wrapped in this clipping
   shell — inline-block shrink-wraps to the table's content width (the
   pan-don't-squish philosophy stays), overflow:hidden rounds the corners of
   the table's own outer borders, shadow-sm gives the card depth. */
.nm-tablecard {
    display: inline-block;
    border: 1px solid var(--nm-z200);  /* anchors header to body on white pages */
    border-radius: var(--nm-radius-lg);
    overflow: hidden;
    box-shadow: var(--nm-shadow-sm);
    vertical-align: top;
    /* No max-width: the wrapper shrink-wraps and may exceed the viewport —
       the user pans the page (the documented content-width philosophy).
       ⚠ DESKTOP ONLY since 2026-07-25: at ≤640px the phone layout layer (end of
       this file) inverts this — cards clamp to the viewport and wide tables
       scroll INSIDE, because shrink-wrapping past the viewport is what made
       iOS scale the whole page down to unreadable. */
}
.nm-tablecard > table { margin: 0 !important; }

/* Entry-grid variant: overflow stays VISIBLE because OrderAutocomplete's
   suggestion dropdown is an absolutely-positioned descendant — overflow:hidden
   would clip it at the card edge (z-index cannot escape clipping). Corners are
   rounded on the corner CELLS instead; bottom corners stay square (white rows,
   not noticeable) to avoid per-section :last-child artifacts. */
.nm-tablecard-open { overflow: visible; }
.nm-tablecard-open > table > thead > tr:first-child > *:first-child,
.nm-tablecard-open > table > tbody:first-child > tr:first-child > *:first-child { border-top-left-radius: var(--nm-radius-lg); }
.nm-tablecard-open > table > thead > tr:first-child > *:last-child,
.nm-tablecard-open > table > tbody:first-child > tr:first-child > *:last-child { border-top-right-radius: var(--nm-radius-lg); }

/* Circular soft icon buttons (Stage 5, 2026-06-11) — the kit's
   circular-button pattern in its soft tints, sized for dense grid rows.
   Used for the per-day add (+) and remove (x) row actions. */
.nm-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* relative so the drawn +/x bars (absolute, below) anchor to this circle. */
    position: relative;
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    /* Keep the inline-flex button centered in its table cell regardless of that row's
       height (rowspan day cell, .ts-err rows) — default baseline alignment shifted it. */
    vertical-align: middle;
    cursor: pointer;
    padding: 0;
    font-family: var(--nm-font-sans);
}
.nm-iconbtn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.nm-iconbtn-add { background: rgba(59, 130, 246, 0.15); color: #1d4ed8; }
.nm-iconbtn-add:hover { background: rgba(59, 130, 246, 0.25); }
.nm-iconbtn-del { background: rgba(239, 68, 68, 0.12); color: #b91c1c; }
.nm-iconbtn-del:hover { background: rgba(239, 68, 68, 0.22); }

/* Draw the + and × as CSS shapes instead of the ✚/✕ dingbat glyphs — the glyphs sat
   off-center in the circles, worse on some rows. Font glyphs are placed by the font's
   baseline/ascent metrics, which no amount of line-height fully centers and which the
   fallback symbol font renders inconsistently. Two absolutely-positioned bars,
   translate(-50%,-50%)-centered, are font-independent and pixel-perfect on every row.
   The text glyph is hidden via font-size:0 on add/del; the swap button keeps its glyph. */
.nm-iconbtn-add, .nm-iconbtn-del { font-size: 0; }
.nm-iconbtn-add::before, .nm-iconbtn-add::after,
.nm-iconbtn-del::before, .nm-iconbtn-del::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: currentColor;
    border-radius: 1px;
}
.nm-iconbtn-add::before { width: 10px; height: 2px;  transform: translate(-50%, -50%); }
.nm-iconbtn-add::after  { width: 2px;  height: 10px; transform: translate(-50%, -50%); }
.nm-iconbtn-del::before { width: 11px; height: 2px;  transform: translate(-50%, -50%) rotate(45deg); }
.nm-iconbtn-del::after  { width: 11px; height: 2px;  transform: translate(-50%, -50%) rotate(-45deg); }
/* Mode-swap (hours ⇄ times) — soft indigo so it reads as "transform", not add/delete. */
.nm-iconbtn-swap { background: rgba(99, 102, 241, 0.15); color: #4338ca; }
.nm-iconbtn-swap:hover { background: rgba(99, 102, 241, 0.25); }

/* The engineer grids' per-row Cancel checkbox (nm-cancel-check, hourly-times-orders/-all) has
   the IDENTICAL baseline problem in its .ts-table cells (Erik 2026-07-25, second report: "the
   cancel checkbox still is off center… slightly higher") — same block fix. The header select-all
   sits on its own line under the "Cancel" label and was never off. */
.ts-table td input.nm-cancel-check { display: block; margin: 0 auto; }

/* Horizontal scroll box around each timesheet entry grid. width/max-width pin it
   to the surrounding card so the grid's min-width columns scroll inside this box
   on a narrow viewport rather than stretching the card past the window edge. */
.ts-scroll { width: 100%; max-width: 100%; overflow-x: auto; }

/* ── hourly-times-orders grid (.tsf-orders) ── */
/* Full content width — the table stretches to fill its container (matching the
   Approval Dashboard panel). The time-entry columns keep their fixed widths; the
   Optional Note column carries no width so it flexes to consume the remaining width
   and the table reaches the full page width. A narrow screen pans/zooms the fixed
   columns instead of squishing the Order text. */
.tsf-orders .ts-table { font-size: var(--nm-font-grid); border-collapse: collapse; width: 100%;
            font-family: var(--nm-font-mono); font-variant-numeric: tabular-nums; }
.tsf-orders .ts-table th, .tsf-orders .ts-table td { border: 1px solid var(--nm-border); padding: var(--nm-sp-1) var(--nm-sp-2); vertical-align: middle; line-height: 1.3; }

/* Excel light-blue header */
.tsf-orders .ts-hdr { background-color: var(--nm-hdr-bg); color: #1a1a1a; font-weight: normal; text-align: center; font-size: var(--nm-font-grid); }
.tsf-orders .ts-hdr-bold { background-color: var(--nm-hdr-bg); color: #1a1a1a; font-weight: bold; text-align: center; font-size: var(--nm-font-grid); }

/* Excel light-tan calculated cells */
.tsf-orders .ts-calc { background-color: var(--nm-calc-bg); text-align: center; font-size: var(--nm-font-grid); }
/* th defaults to bold — Site/Prep/Wait/Trvl headers read lighter at normal weight. */
.tsf-orders thead th.ts-calc { font-weight: normal; }

/* Acted-on per-segment rows (#128): the per-status row tint (set inline) carries through the
   Site/Prep/Wait/Trvl cells (no tan override), and the disabled time boxes read in solid black —
   not the browser's faded disabled grey — so the whole row is legible with only the Status chip
   carrying colour. */
.tsf-orders .ts-segrow td.ts-calc,
.tsf-all    .ts-segrow td.ts-calc { background: transparent; color: #1a1a1a; }
.tsf-orders .ts-segrow input.ts-time:disabled,
.tsf-all    .ts-segrow input.ts-time:disabled {
    color: #1a1a1a; -webkit-text-fill-color: #1a1a1a; opacity: 1;
    /* The bubble keeps its outline but its fill is the row tint (transparent → the tinted <tr>
       shows through), so an acted-on box reads as part of its coloured row, not a white inset. */
    background: transparent;
}
/* Conflict outline — ONLY the specific time box(es) whose span overlaps other time on the same day:
   the editable row's two span-defining boxes (first + last entered time) and the acted-on segment's
   boxes. Outline only — the box interior keeps its normal fill — so a clash points at the exact cells,
   not the whole row. */
/* The error ring (Erik 2026-07-24, v2): a 2px RED outer border with a 1px BLACK inner ring drawn as
   an inset box-shadow flush against it. box-shadow (not outline) so it isn't clipped by the card's
   overflow:hidden and follows the border radius. This is the one error language for every input
   bubble (time boxes here; OrderAutocomplete / EmployeeAutocomplete IsError and the Mehrarbeit
   .mn-invalid boxes carry the same ring). */
.tsf-orders input.ts-time.ts-conflict,
.tsf-all    input.ts-time.ts-conflict {
    border: 2px solid var(--nm-red) !important;
    box-shadow: inset 0 0 0 1px #000 !important;
}

/* FYI (Returned / Cancelled) rows ghost ONLY the time-data columns — the S/P/W word, the time inputs and
   the Site/Prep/Wait/Trvl calc cells (the data that doesn't drive payroll). The Date, Order and the status
   badge stay legible. !important beats the disabled-input colour, the segment-row calc colour and the
   inline S/P/W word colour. -webkit-text-fill-color is ESSENTIAL: the acted-on rule above forces the
   disabled time boxes to solid black via -webkit-text-fill-color, and in WebKit/Chromium that property
   wins over `color` for the actual glyph fill — so ghosting `color` alone left the times black in Chrome.
   Overriding -webkit-text-fill-color too is what actually greys the time values. */
.ts-table tr.ts-fyi-ghost td.ts-calc,
.ts-table tr.ts-fyi-ghost input.ts-time,
.ts-table tr.ts-fyi-ghost .ts-pw-word {
    color: #a7b0bb !important;
    -webkit-text-fill-color: #a7b0bb !important;
}

/* Desktop hourly Status columns hug the widest pill actually present. width:1% asks automatic
   table layout for the column's intrinsic minimum instead of reserving the old 92px lane. The
   pill stays intrinsic/one-line here, so it supplies that minimum; 0.25px per side plus the 1px
   grid edge measured 74.05px around the 72.55px Submitted pill (2.07% allowance). Phone clock
   grids keep their separate 92px trailing status rail and the universal wrapping contract. */
@media (min-width: 641px) {
.ts-table .ts-status-col {
  width: 1%;
  min-width: 0;
  padding-inline: 0.25px !important;
  white-space: nowrap !important;
}
.ts-table .ts-status-col .nm-status-pill {
  max-width: none !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
}
}

/* Day label — calculated metadata (not user-entered), so it shares the
   tan .ts-calc tint. Same treatment as the right-hand Site/Prep/Wait/Trvl
   columns so "brown = system-generated" reads consistently across the row.
   The side borders are suppressed (no left/right rules) but the bottom gets
   a 2px black line directly — the ts-day cell is a rowspan cell anchored
   in the first row of its day group, so `.ts-day-last .ts-day` never matches
   it and the standard ts-day-last td rule wouldn't draw the divider under
   the day label. Declaring border-bottom here instead fires at the bottom
   of the spanned range, so every day group closes with a black line across
   the whole row. (Exception: SUNDAY's label — tagged ts-day-bl — gets
   border-bottom:0 in the .nm-entrygrid block below, because the table's
   bottom edge is now the wrapper's rounded border.) */
.tsf-orders .ts-day { font-weight: bold; font-size: var(--nm-font-grid); border: none; border-bottom: 2px solid #000; background-color: var(--nm-calc-bg);
          font-family: var(--nm-font-mono); font-variant-numeric: tabular-nums; }
.tsf-orders .ts-day-weekend { font-weight: bold; font-size: var(--nm-font-grid); border: none; border-bottom: 2px solid #000; background-color: var(--nm-calc-bg);
                  font-family: var(--nm-font-mono); font-variant-numeric: tabular-nums; }

/* Inputs — Excel-tight */
.tsf-orders .ts-table input[type=text], .tsf-orders .ts-table select {
    border: 1px solid var(--nm-z300); border-radius: var(--nm-radius); padding: 0 var(--nm-sp-1);
    font-size: var(--nm-font-grid); background: #fff; height: var(--nm-control-h);
}
.tsf-orders .ts-table input.ts-time { width: 52px; box-sizing: border-box; text-align: center; font-family: var(--nm-font-mono); }
/* Non-time text inputs (Order, Optional Note) fill their column with
   left-aligned text. Time inputs (.ts-time) stay fixed + centered. */
.tsf-orders .ts-table input.ts-order { width: 100%; text-align: left; box-sizing: border-box; }
/* Center the time-input cells so the 46px input sits in the middle of
   the wider (48px+) column rather than left-glued. */
.tsf-orders .ts-table td:has(> input.ts-time) { text-align: center; }

/* S/P/W toggle buttons — compact.
   Each of the three states has a matching color that also tints the middle two time
   cells on the same row so the interval shape is visually tagged:
     S (On-Site) → #00E8C3 teal
     P (Prep)    → #F5FB3C yellow
     W (Wait)    → #FBDA00 gold */
.tsf-orders .ts-pw-group { display: inline-flex; gap: 0; border: 1px solid var(--nm-border); border-radius: var(--nm-radius); overflow: hidden; }
.tsf-orders .ts-pw-btn { border: none; background: #fff; padding: 0 var(--nm-sp-2); font-size: var(--nm-font-grid); cursor: pointer;
             color: #999; line-height: 1.3; border-right: 1px solid #d0d0d0; height: var(--nm-control-h); }
.tsf-orders .ts-pw-btn:last-child { border-right: none; }
.tsf-orders .ts-pw-btn:hover { background: #e0e0e0; }
/* Neutral active (used for S when the middle time cells aren't both filled yet — keeps
   the old pre-color-change look so the teal doesn't appear until both From-pair
   times are present). */
.tsf-orders .ts-pw-btn.active     { background: #d0d0d0; color: #1a1a1a; font-weight: bold; }
.tsf-orders .ts-pw-btn.active-s   { background: #00E8C3; color: #1a1a1a; font-weight: bold; }
.tsf-orders .ts-pw-btn.active-p   { background: #F5FB3C; color: #1a1a1a; font-weight: bold; }
.tsf-orders .ts-pw-btn.active-w   { background: #FBDA00; color: #1a1a1a; font-weight: bold; }

/* Middle time cells get the same color as the active S/P/W button. */
.tsf-orders .ts-cell-site { background: #00E8C3; }
.tsf-orders .ts-cell-prep { background: #F5FB3C; }
.tsf-orders .ts-cell-wait { background: #FBDA00; }

/* Remove button — visuals now come from the global .nm-iconbtn/.nm-iconbtn-del
   helpers (app.css); the old .ts-rm rule carried no layout, so it's gone. */

/* No-entry row */
.tsf-orders .ts-empty td { text-align: center; color: #aaa; font-size: var(--nm-font-small); opacity: 0.5; }

/* Day group border — black, and continues across the day-label column so the
   divider reads as a single horizontal line from edge to edge. Single-side
   border model (see the .nm-entrygrid block at the end of this style block):
   each divider is drawn ONLY as the closing row's border-BOTTOM. The old
   matching border-TOP rules on .ts-day-first are gone — under
   border-collapse:separate adjacent borders abut instead of merging, so
   keeping both sides would stack into a double-thickness line. The boundary above Monday
   is covered by the thead's own 2px black border-bottom. !important: the
   .nm-entrygrid single-side rule below has higher specificity (0,2,1) and
   would otherwise repaint these bottoms as the 1px gray grid line.
   (The .ts-day-first class stays on the rows — harmless, and it keeps the
   markup self-describing.) */
.tsf-orders .ts-day-last td { border-bottom: 2px solid #000 !important; }
.tsf-orders .ts-day-last .ts-day { border-bottom: 2px solid #000 !important; }
/* The old "tbody tr:last-child always closes with black" belt+suspenders rules
   are gone: the table's bottom edge is now the .nm-tablecard wrapper's own
   border, and the .nm-entrygrid last-row rules below zero the cell bottoms
   there so the frame isn't doubled. */

/* Force the day-label cell's bottom border to black on EVERY day group.
   The `.ts-day` rule above sets `border-bottom: 2px solid #000`, but the base
   `.ts-table td { border: 1px solid #b4c6d8 }` at the top has higher specificity
   (0,1,1 vs 0,1,0) and overrides it on all four sides. When Sunday rowspans down
   and the `.ts-day-last td` !important rule targets a *different* row (the last
   entry row, which has no `.ts-day` cell), the rowspanned day-label keeps the
   light blue border and the black divider below Sunday disappears. This selector
   (specificity 0,2,1) wins over the base and locks the black bottom in place. */
.tsf-orders .ts-table td.ts-day { border-bottom: 2px solid #000 !important; }

/* Strong black rule under the column-header row too. */
.tsf-orders .ts-table thead th { border-bottom: 2px solid #000; }

/* Invalid / conflicting row — the offending TIME boxes get a red outline per-box via .ts-conflict, so
   only the span-defining cells light up. The Order box is NOT reddened by a time conflict — it only
   reds via OrderAutocomplete's own validation (missing / invalid cost object). No full-row fill, so the
   Status chip and Optional Note read uncoloured. */

/* CA OT / CA DT headers used to drop to a proportional font so the space was
   narrower — that made them read thinner than the surrounding monospace headers.
   Keep them in the shared monospace stack so all column titles match visually. */

/* Every row of the SAP Entries preview is app-generated — no user input touches
   these cells directly — so the whole table reads as "calculated" via the same
   tan background the Site/Prep/Wait/Trvl columns use. */
.tsf-orders .ts-sap-entries tbody td { background-color: var(--nm-calc-bg); }

/* ─── Tailwind Plus "condensed content" treatment for the read-only display
   tables (Week Payroll Summary + Time Entries preview), tagged nm-displaytable.
   Horizontal hairlines only — no vertical separators — white surface, gray data
   text with a dark first column. !important is required on the border channels:
   the .summary-v-sep border-right rule above is itself !important.
   Backgrounds win on plain specificity
   ((0,2,1)+ beats .ts-calc/.ts-hdr/.ts-sap-entries), so the tan calc tint and
   the blue header go white here without touching the entry grid. Font stays
   the .ts-table mono stack — it's data. */
.tsf-orders .ts-table.nm-displaytable th,
.tsf-orders .ts-table.nm-displaytable td {
    border: 0 !important;
    border-bottom: 1px solid var(--nm-z200) !important;
    padding: 3px 10px;
    background: #fff;
}
.tsf-orders .ts-table.nm-displaytable thead th {
    /* z50, not white — a white header band reads as detached from its
       (colorless) table. The faint gray ties the header to the data rows. */
    background: var(--nm-z50);
    font-weight: 600;
    color: var(--nm-z950);
    border-bottom: 1px solid var(--nm-z300) !important;
}
.tsf-orders .ts-table.nm-displaytable tbody td { color: var(--nm-z500); }
.tsf-orders .ts-table.nm-displaytable tbody td:first-child { color: var(--nm-z950); }
/* Last body row: no bottom hairline — the rounded .nm-tablecard edge closes
   the table. */
.tsf-orders .ts-table.nm-displaytable tbody tr:last-child td { border-bottom: 0 !important; }
/* Total row (payroll summary) */
.tsf-orders .ts-table.nm-displaytable tr.nm-total-row td {
    font-weight: 600;
    color: var(--nm-z950);
    border-top: 1px solid var(--nm-z300) !important;
    border-bottom: 0 !important;
}

/* ─── Rounded main entry grid (Tailwind-kit rollout) ───
   border-collapse:collapse IGNORES border-radius, so the grid's square
   corners poke past the .nm-tablecard wrapper's rounded edge. The main
   entry grid switches to border-collapse:separate with a SINGLE-SIDE
   border model (scoped to .nm-entrygrid — the display tables share
   .ts-table and keep their own hairline model):
     interior verticals   → each cell's border-RIGHT only
     interior horizontals → each cell's border-BOTTOM only
     outer frame          → the wrapper's own 1px var(--nm-z200) border;
                            cells on the table's outer edges carry no
                            border there, so the frame is never doubled.
   Corner radii are calc(var(--nm-radius-lg) - 1px) so the cell corners
   nest just inside the wrapper's 1px border. Keep this block LAST in the
   style element: the single-side rule relies on source order to beat the
   equal-or-lower-specificity legacy border rules above. */
.tsf-orders .ts-table.nm-entrygrid { border-collapse: separate; border-spacing: 0;
                         border-radius: calc(var(--nm-radius-lg) - 1px); }
.tsf-orders .ts-table.nm-entrygrid th, .tsf-orders .ts-table.nm-entrygrid td {
    border: 0;
    border-right: 1px solid var(--nm-border);
    border-bottom: 1px solid var(--nm-border);
}
/* The single-side rule above is (0,2,1) and outguns the (0,1,2)
   `.ts-table thead th` divider — restate the 2px black header underline. */
.tsf-orders .ts-table.nm-entrygrid thead th { border-bottom: 2px solid #000; }
/* Outer right + bottom edges: the wrapper closes the frame. !important on
   the bottom rules so the 2px-black `.ts-day-last td` / `.ts-table td.ts-day`
   !important dividers can't repaint a second line just inside the wrapper
   border on the table's last row. */
.tsf-orders .ts-table.nm-entrygrid tr > *:last-child { border-right: 0; }
.tsf-orders .ts-table.nm-entrygrid tbody tr:last-child td { border-bottom: 0 !important; }
/* Corner CELLS round their own backgrounds (hdr-bg / tan ts-day) so they
   don't overshoot the wrapper's rounded edge. */
.tsf-orders .ts-table.nm-entrygrid thead tr:first-child th:first-child { border-top-left-radius: calc(var(--nm-radius-lg) - 1px); }
.tsf-orders .ts-table.nm-entrygrid thead tr:first-child th:last-child { border-top-right-radius: calc(var(--nm-radius-lg) - 1px); }
.tsf-orders .ts-table.nm-entrygrid tbody tr:last-child > *:last-child { border-bottom-right-radius: calc(var(--nm-radius-lg) - 1px); }
/* Bottom-LEFT corner is NOT tr:last-child's first cell: Sunday's day-label
   is a rowspan cell anchored rows above, and its box reaches the table's
   bottom edge. The shared DayLabelCell tags it ts-day-bl (dayIndex == 6 at
   every day-cell call site; the form's legacy nm-corner-bl spelling lost
   its last emitter in the E1 re-seat and its selector leg was removed by
   unit E4, 2026-08-20). (0,4,1) + !important beats the (0,2,2) !important
   black-bottom rule on `.ts-table td.ts-day`. */
.tsf-orders .ts-table.nm-entrygrid td.ts-day.ts-day-bl { border-bottom: 0 !important;
                                         border-bottom-left-radius: calc(var(--nm-radius-lg) - 1px); }

/* Date labels are LETTER grids ("MON JUN 8" / "WED JUN 10") — proportional
   sans staggers them (tabular-nums only fixes digits). True mono for the
   day-label column + the display tables' date column. */
.tsf-orders .ts-table .ts-day, .tsf-orders .ts-table .ts-day-weekend { font-family: var(--nm-font-truemono); }
/* ⚠ The DISPLAY tables deliberately do NOT get that truemono date column (Erik 2026-08-03:
   "the font is different across the time entries table"). In the entry GRID the day label is a
   rowspanned column of its own, so Cascadia there reads as a deliberate gutter; in Time Entries
   the date sits INLINE beside sans text, so the row mixed a code face with the UI face on every
   line. Note --nm-font-mono is itself SANS (Segoe UI) since the Tailwind-kit rollout — only the
   name is historical — so the whole display table now renders one family, with tabular-nums
   keeping the digits aligned. Restore the override only if a date column's raggedness is ever
   worse than the mismatch was. */

/* ── hourly-times-all grid (.tsf-all) ── */
/* Full content width — the table stretches to fill its container (matching the
   Approval Dashboard panel). The time-entry columns keep their fixed widths; the
   Optional Note column carries no width so it flexes to consume the remaining width
   and the table reaches the full page width. On a narrow screen the fixed columns
   pan/zoom instead of being squished (which clipped the Order text). */
.tsf-all .ts-table { font-size: var(--nm-font-grid); border-collapse: collapse; width: 100%;
            font-family: var(--nm-font-mono); font-variant-numeric: tabular-nums; }
.tsf-all .ts-table th, .tsf-all .ts-table td { border: 1px solid var(--nm-border); padding: var(--nm-sp-1) var(--nm-sp-2); vertical-align: middle; line-height: 1.3; }

/* Excel light-blue header */
.tsf-all .ts-hdr { background-color: var(--nm-hdr-bg); color: #1a1a1a; font-weight: normal; text-align: center; font-size: var(--nm-font-grid); }
.tsf-all .ts-hdr-bold { background-color: var(--nm-hdr-bg); color: #1a1a1a; font-weight: bold; text-align: center; font-size: var(--nm-font-grid); }

/* Excel light-tan calculated cells */
.tsf-all .ts-calc { background-color: var(--nm-calc-bg); text-align: center; font-size: var(--nm-font-grid); }
/* th defaults to bold — Site/Prep/Wait/Trvl headers read lighter with normal weight. */
.tsf-all thead th.ts-calc { font-weight: normal; }

/* Day label — calculated metadata (not user-entered), so it shares the
   tan .ts-calc tint. Same treatment as the right-hand Site/Prep/Wait/Trvl
   columns so "brown = system-generated" reads consistently across the row.
   The side borders are suppressed (no left/right rules) but the bottom gets
   a 2px black line directly — the ts-day cell is a rowspan cell anchored
   in the first row of its day group, so `.ts-day-last .ts-day` never matches
   it and the standard ts-day-last td rule wouldn't draw the divider under
   the day label. Declaring border-bottom here instead fires at the bottom
   of the spanned range, so every day group (including Sunday) closes with
   a black line across the whole row. */
.tsf-all .ts-day { font-weight: bold; font-size: var(--nm-font-grid); border: none; border-bottom: 2px solid #000; background-color: var(--nm-calc-bg);
          font-family: var(--nm-font-mono); font-variant-numeric: tabular-nums; }
.tsf-all .ts-day-weekend { font-weight: bold; font-size: var(--nm-font-grid); border: none; border-bottom: 2px solid #000; background-color: var(--nm-calc-bg);
                  font-family: var(--nm-font-mono); font-variant-numeric: tabular-nums; }

/* Inputs — Excel-tight */
.tsf-all .ts-table input[type=text], .tsf-all .ts-table select {
    border: 1px solid var(--nm-z300); border-radius: var(--nm-radius); padding: 0 var(--nm-sp-1);
    font-size: var(--nm-font-grid); background: #fff; height: var(--nm-control-h);
}
.tsf-all .ts-table input.ts-time { width: 52px; box-sizing: border-box; text-align: center; font-family: var(--nm-font-mono); }
/* Non-time text inputs (Order, Optional Note) fill their column with
   left-aligned text. Time inputs (.ts-time) stay fixed + centered. */
.tsf-all .ts-table input.ts-order { width: 100%; text-align: left; box-sizing: border-box; }
/* Center the time-input cells so the 46px input sits in the middle of
   the wider (48px+) column rather than left-glued. */
.tsf-all .ts-table td:has(> input.ts-time) { text-align: center; }

/* S/P/W toggle buttons — compact.
   Each of the three states has a matching color that also tints the middle two time
   cells on the same row so the interval shape is visually tagged:
     S (On-Site) → #00E8C3 teal
     P (Prep)    → #F5FB3C yellow
     W (Wait)    → #FBDA00 gold */
.tsf-all .ts-pw-group { display: inline-flex; gap: 0; border: 1px solid var(--nm-border); border-radius: 2px; overflow: hidden; }
.tsf-all .ts-pw-btn { border: none; background: #fff; padding: 0 var(--nm-sp-2); font-size: var(--nm-font-grid); cursor: pointer;
             color: #999; line-height: 1.3; border-right: 1px solid #d0d0d0; height: var(--nm-control-h); }
.tsf-all .ts-pw-btn:last-child { border-right: none; }
.tsf-all .ts-pw-btn:hover { background: #e0e0e0; }
/* Neutral active (used for S when the middle time cells aren't both filled yet — keeps
   the old pre-color-change look so the teal doesn't appear until both From-pair
   times are present). */
.tsf-all .ts-pw-btn.active     { background: #d0d0d0; color: #1a1a1a; font-weight: bold; }
.tsf-all .ts-pw-btn.active-s   { background: #00E8C3; color: #1a1a1a; font-weight: bold; }
.tsf-all .ts-pw-btn.active-p   { background: #F5FB3C; color: #1a1a1a; font-weight: bold; }
.tsf-all .ts-pw-btn.active-w   { background: #FBDA00; color: #1a1a1a; font-weight: bold; }

/* Middle time cells get the same color as the active S/P/W button. */
.tsf-all .ts-cell-site { background: #00E8C3; }
.tsf-all .ts-cell-prep { background: #F5FB3C; }
.tsf-all .ts-cell-wait { background: #FBDA00; }

/* Remove button — visual styling now comes from the global
   .nm-iconbtn / .nm-iconbtn-del helpers in app.css; the old .ts-rm
   rule carried no layout properties, so it was deleted outright. */

/* No-entry row */
.tsf-all .ts-empty td { text-align: center; color: #aaa; font-size: var(--nm-font-small); opacity: 0.5; }

/* Day group border — black, and continues across the day-label column so the
   divider reads as a single horizontal line from edge to edge. !important on
   every rule: the cell border rules (1px light blue) sit in the same cascade
   bucket and were visibly winning on the last Sunday row. Forcing it here is
   the cheapest way to guarantee the day-group divider renders under every
   row that ends a day.
   Single-side border model (see the .nm-entrygrid block at the bottom of this
   style element): day dividers are BOTTOM-driven only. The old
   `.ts-day-first { border-top: 2px }` twins were deleted — under
   border-collapse:separate a row's top border no longer merges with the
   previous row's bottom border; the pair would stack into a double-thickness line.
   Monday's top divider comes from the header row's 2px black border-bottom. */
.tsf-all .ts-day-last td { border-bottom: 2px solid #000 !important; }
.tsf-all .ts-day-last .ts-day { border-bottom: 2px solid #000 !important; }
/* Belt + suspenders — the very last row in the body always closes with black, so
   adding a row to Sunday can't leave it without a bottom divider. (For the main
   entry grid the .nm-entrygrid rules below override this back to 0 at the
   table's bottom edge — the wrapper's own border closes the frame there.) */
.tsf-all .ts-table tbody tr:last-child td { border-bottom: 2px solid #000 !important; }
.tsf-all .ts-table tbody tr:last-child .ts-day { border-bottom: 2px solid #000 !important; }

/* Force the day-label cell's bottom border to black on EVERY day group.
   The `.ts-day` rule above sets `border-bottom: 2px solid #000`, but the base
   `.ts-table td { border: 1px solid var(--nm-border) }` at the top has higher specificity
   (0,1,1 vs 0,1,0) and overrides it on all four sides. When Sunday rowspans down
   and the `.ts-day-last td` !important rule targets a *different* row (the last
   entry row, which has no `.ts-day` cell), the rowspanned day-label keeps the
   light blue border and the black divider below Sunday disappears. This selector
   (specificity 0,2,1) wins over the base and locks the black bottom in place. */
.tsf-all .ts-table td.ts-day { border-bottom: 2px solid #000 !important; }

/* Strong black rule under the column-header row too. */
.tsf-all .ts-table thead th { border-bottom: 2px solid #000; }

/* Invalid / conflicting row — the offending TIME boxes get a red outline per-box via .ts-conflict, so
   only the span-defining cells light up. The Order box is NOT reddened by a time conflict — it only
   reds via OrderAutocomplete's own validation (missing / invalid cost object). No full-row fill, so the
   Status chip and Optional Note read uncoloured. */

/* CA OT / CA DT headers used to drop to a proportional font so the space was
   narrower — that made them read thinner than the surrounding monospace headers.
   Keep them in the shared monospace stack so all column titles match visually. */

/* Every row of the SAP Entries preview is app-generated — no user input touches
   these cells directly — so the whole table reads as "calculated" via the same
   tan background the Site/Prep/Wait/Trvl columns use. */
.tsf-all .ts-sap-entries tbody td { background-color: var(--nm-calc-bg); }

/* ── Tailwind Plus "condensed content" treatment for the read-only DISPLAY
   tables (Week Payroll Summary + Time Entries preview). Scoped under
   .ts-table.nm-displaytable so these rules outrank the base grid rules
   above while leaving the main entry grid's Excel gridlines untouched.
   Horizontal hairlines only: border-right needs !important to counter
   .summary-v-sep's !important vertical separators, and the last-row
   border-bottom needs !important to counter the entry grid's
   "tbody tr:last-child → 2px black" day-divider rule. Backgrounds go
   white — everything in these tables is calculated, so the tan
   "calculated" tint carries no distinction here. ── */
.tsf-all .ts-table.nm-displaytable th,
.tsf-all .ts-table.nm-displaytable td {
    border: 0;
    border-right: 0 !important;
    border-bottom: 1px solid var(--nm-z200);
    padding: 3px 10px;
}
.tsf-all .ts-table.nm-displaytable thead th {
    /* z50 band instead of plain white so the header reads visually attached
       to its table rather than floating detached against a colorless background. */
    background: var(--nm-z50);
    font-weight: 600;
    color: var(--nm-z950);
    border-bottom: 1px solid var(--nm-z300);
}
.tsf-all .ts-table.nm-displaytable tbody td { background: #fff; color: var(--nm-z500); }
.tsf-all .ts-table.nm-displaytable tbody td:first-child { color: var(--nm-z950); }
.tsf-all .ts-table.nm-displaytable tbody tr:last-child td { border-bottom: 1px solid var(--nm-z200) !important; }
/* Total row (payroll summary only — the SAP preview has no totals row). */
.tsf-all .ts-table.nm-displaytable:not(.ts-sap-entries) tbody tr:last-child td {
    font-weight: 600;
    color: var(--nm-z950);
    border-top: 1px solid var(--nm-z300);
    border-bottom: 0 !important;
}
/* Week Payroll Summary first column (T3.1c slice B, 2026-09-24: moved MOVE-ONLY from NM002M.Shared/app.css
   beside the shared WeekPayrollSummary emitter; the .tsf-orders twins stay in app.css with NM's orders form).
   The Date HEADER is centered with the other headings; the date values and the Total label stay flush-left so
   their data edge remains straight — and in TRUE MONO, like the entry grid's day-label column (Erik
   2026-08-17: "I don't want this staggered dates text in the payroll summary — make it more the dates column,
   which is perfect, everything aligned"). tabular-nums alone is NOT enough and was measured as a no-op: these
   are LETTER grids, and the weekday stems are what vary (MON/TUE/WED), not the digits. Scoped to the first
   column only — Erik's 2026-08-03 ruling stands for the Time Entries display table, where the date sits
   INLINE beside sans text. Both rules outrank .tsf-all .ts-calc's centering on specificity, not order. */
.tsf-all .nm-payroll-summary th:first-child { text-align: center; }
.tsf-all .nm-payroll-summary td:first-child { text-align: left; }
.tsf-all .nm-payroll-summary td:first-child {
    font-family: var(--nm-font-truemono);
    font-variant-numeric: tabular-nums;
}

/* ── Separate-border model for the MAIN ENTRY GRID only (.nm-entrygrid) ──
   border-collapse:collapse ignores border-radius entirely, so the square
   table corners poked past the rounded .nm-tablecard wrapper shadow. The
   main grid switches to separate borders with a SINGLE-SIDE model: every
   cell draws only its RIGHT + BOTTOM edge; the wrapper's own 1px
   var(--nm-z200) border supplies the outer frame (top/left always, and
   right/bottom where the last column / last row zero theirs below).
   Interior lines stay single-width because no cell ever draws left/top.
   Scoped to .nm-entrygrid so the read-only display tables — which share
   .ts-table — keep border-collapse:collapse and their own rules.
   This block sits LAST in the style element on purpose: the single-side
   cell rule ties the base `.ts-table th/td` rule on specificity (0,1,1)
   and must win on source order. */
.tsf-all table.nm-entrygrid {
    border-collapse: separate;
    border-spacing: 0;
    /* -1px nests the table's rounding inside the wrapper's 1px border. */
    border-radius: calc(var(--nm-radius-lg) - 1px);
}
.tsf-all .nm-entrygrid th, .tsf-all .nm-entrygrid td {
    border: 0;
    border-right: 1px solid var(--nm-border);
    border-bottom: 1px solid var(--nm-border);
}
/* Outer right edge comes from the wrapper, not the last column. */
.tsf-all .nm-entrygrid tr > *:last-child { border-right: 0; }
/* Outer bottom edge comes from the wrapper too — this also neutralizes the
   "tbody tr:last-child → 2px black" belt-+-suspenders day-divider rule above
   (same !important bucket; this selector is more specific and later). */
.tsf-all .ts-table.nm-entrygrid tbody tr:last-child td { border-bottom: 0 !important; }
/* Corner CELLS round their own backgrounds so the header-blue / calc-tan
   fills don't overshoot the table's radius (with separate borders, the
   table's border-radius does not clip cell backgrounds). The bottom-left
   corner is Sunday's day-label cell, which is usually a rowspan cell
   anchored rows ABOVE tr:last-child — no pure structural selector can
   reach it, hence the dedicated .ts-day-bl class stamped on it in markup. */
.tsf-all .nm-entrygrid thead tr:first-child th:first-child { border-top-left-radius: calc(var(--nm-radius-lg) - 1px); }
.tsf-all .nm-entrygrid thead tr:first-child th:last-child { border-top-right-radius: calc(var(--nm-radius-lg) - 1px); }
.tsf-all .nm-entrygrid tbody tr:last-child td:last-child { border-bottom-right-radius: calc(var(--nm-radius-lg) - 1px); }
.tsf-all .ts-table.nm-entrygrid tbody td.ts-day.ts-day-bl {
    /* Wrapper closes the frame under the (possibly rowspanned) Sunday
       label — beats the 2px-black `.ts-table td.ts-day` divider rule. */
    border-bottom: 0 !important;
    border-bottom-left-radius: calc(var(--nm-radius-lg) - 1px);
}

/* Date labels are LETTER grids ("MON JUN 8" / "WED JUN 10") — proportional
   sans staggers them (tabular-nums only fixes digits). True mono is applied to
   the day-label column and the display tables' date column for even alignment. */
.tsf-all .ts-table .ts-day, .tsf-all .ts-table .ts-day-weekend { font-family: var(--nm-font-truemono); }
/* Display tables keep ONE family across the row — see the .tsf-orders note above (Erik 2026-08-03). */

/* ── exempt-times-all grid (.tsf-exempt) ── */
/* Full content width — the table stretches to fill its container (matching the
   Approval Dashboard panel). The time-entry columns keep their fixed widths; the
   Optional Note column carries no width so it flexes to consume the remaining width
   and the table reaches the full page width. On a narrow screen the fixed columns
   pan/zoom instead of being squished (which clipped the Order text). */
.tsf-exempt .ts-table { font-size: var(--nm-font-grid); border-collapse: collapse; width: 100%;
            font-family: var(--nm-font-mono); font-variant-numeric: tabular-nums; }
.tsf-exempt .ts-table th, .tsf-exempt .ts-table td { border: 1px solid var(--nm-border); padding: var(--nm-sp-1) var(--nm-sp-2); vertical-align: middle; line-height: 1.3; }

/* Excel light-blue header */
.tsf-exempt .ts-hdr { background-color: var(--nm-hdr-bg); color: #1a1a1a; font-weight: normal; text-align: center; font-size: var(--nm-font-grid); }
.tsf-exempt .ts-hdr-bold { background-color: var(--nm-hdr-bg); color: #1a1a1a; font-weight: bold; text-align: center; font-size: var(--nm-font-grid); }

/* Excel light-tan calculated cells */
.tsf-exempt .ts-calc { background-color: var(--nm-calc-bg); text-align: center; font-size: var(--nm-font-grid); }
/* th defaults to bold — Site/Prep/Wait/Trvl headers render lighter (font-weight:normal). */
.tsf-exempt thead th.ts-calc { font-weight: normal; }

/* Day label — calculated metadata (not user-entered), so it shares the
   tan .ts-calc tint. Same treatment as the right-hand Site/Prep/Wait/Trvl
   columns so "brown = system-generated" reads consistently across the row.
   The side borders are suppressed (no left/right rules) but the bottom gets
   a 2px black line directly — the ts-day cell is a rowspan cell anchored
   in the first row of its day group, so `.ts-day-last .ts-day` never matches
   it and the standard ts-day-last td rule wouldn't draw the divider under
   the day label. Declaring border-bottom here instead fires at the bottom
   of the spanned range, so every day group (including Sunday) closes with
   a black line across the whole row. */
.tsf-exempt .ts-day { font-weight: bold; font-size: var(--nm-font-grid); border: none; border-bottom: 2px solid #000; background-color: var(--nm-calc-bg);
          font-family: var(--nm-font-mono); font-variant-numeric: tabular-nums; }
.tsf-exempt .ts-day-weekend { font-weight: bold; font-size: var(--nm-font-grid); border: none; border-bottom: 2px solid #000; background-color: var(--nm-calc-bg);
                  font-family: var(--nm-font-mono); font-variant-numeric: tabular-nums; }

/* Inputs — Excel-tight */
.tsf-exempt .ts-table input[type=text], .tsf-exempt .ts-table select {
    border: 1px solid var(--nm-z300); border-radius: var(--nm-radius); padding: 0 2px;
    font-size: var(--nm-font-grid); background: #fff; height: var(--nm-control-h);
}
.tsf-exempt .ts-table input.ts-time { width: 52px; box-sizing: border-box; text-align: center; font-family: var(--nm-font-mono); }
/* Non-time text inputs (Order, Optional Note) fill their column with
   left-aligned text. Time inputs (.ts-time) stay fixed + centered. */
.tsf-exempt .ts-table input.ts-order { width: 100%; text-align: left; box-sizing: border-box; }
/* Center the time-input cells so the 46px input sits in the middle of
   the wider (48px+) column rather than left-glued. */
.tsf-exempt .ts-table td:has(> input.ts-time) { text-align: center; }

/* Mobile clock-time fit. At small viewports the day Start / End inputs (.ts-time,
   "HH:MM" = 5 glyphs) clipped the last digit: the 52px border-box width left a
   46px content area that the centered text overflowed once the cell's own
   horizontal padding was added. Widen the input and trim the cell padding so the
   full HH:MM is always visible (the grid stays horizontally scrollable via
   .ts-scroll, so the extra width never breaks the layout). Covers all three
   clock-time grids (.tsf-orders / .tsf-all / .tsf-exempt). */
@media (max-width: 480px) {
    .tsf-orders .ts-table input.ts-time,
    .tsf-all .ts-table input.ts-time,
    .tsf-exempt .ts-table input.ts-time { width: 58px; }
    .tsf-orders .ts-table td:has(> input.ts-time),
    .tsf-all .ts-table td:has(> input.ts-time),
    .tsf-exempt .ts-table td:has(> input.ts-time) { padding-left: 1px; padding-right: 1px; }
}

/* S/P/W toggle buttons — compact.
   Each of the three states has a matching color that also tints the middle two time
   cells on the same row so the interval shape is visually tagged:
     S (On-Site) → #00E8C3 teal
     P (Prep)    → #F5FB3C yellow
     W (Wait)    → #FBDA00 gold */
.tsf-exempt .ts-pw-group { display: inline-flex; gap: 0; border: 1px solid var(--nm-border); border-radius: 2px; overflow: hidden; }
.tsf-exempt .ts-pw-btn { border: none; background: #fff; padding: 0 4px; font-size: var(--nm-font-grid); cursor: pointer;
             color: #999; line-height: 1.3; border-right: 1px solid #d0d0d0; height: var(--nm-control-h); }
.tsf-exempt .ts-pw-btn:last-child { border-right: none; }
.tsf-exempt .ts-pw-btn:hover { background: #e0e0e0; }
/* Neutral active (used for S when the middle time cells aren't both filled yet — keeps
   the old pre-color-change look so the teal doesn't appear until both From-pair
   times are present). */
.tsf-exempt .ts-pw-btn.active     { background: #d0d0d0; color: #1a1a1a; font-weight: bold; }
.tsf-exempt .ts-pw-btn.active-s   { background: #00E8C3; color: #1a1a1a; font-weight: bold; }
.tsf-exempt .ts-pw-btn.active-p   { background: #F5FB3C; color: #1a1a1a; font-weight: bold; }
.tsf-exempt .ts-pw-btn.active-w   { background: #FBDA00; color: #1a1a1a; font-weight: bold; }

/* Middle time cells get the same color as the active S/P/W button. */
.tsf-exempt .ts-cell-site { background: #00E8C3; }
.tsf-exempt .ts-cell-prep { background: #F5FB3C; }
.tsf-exempt .ts-cell-wait { background: #FBDA00; }

/* Remove button — now the global .nm-iconbtn-del circle (app.css). */

/* No-entry row */
.tsf-exempt .ts-empty td { text-align: center; color: #aaa; font-size: var(--nm-font-small); opacity: 0.5; }

/* Day group border — black, and continues across the day-label column so the
   divider reads as a single horizontal line from edge to edge. !important on
   every rule: the base .ts-table td border shorthand (1px light blue on all
   sides) has equal specificity and was visibly winning on the last Sunday
   row because "border-bottom" overrides via `border:` shorthand come from
   the same bucket. Forcing it here is the cheapest way to guarantee the
   day-group divider renders under every row that ends a day.
   BOTTOM-ONLY under the rounded-corner model: the entry grid now runs
   border-collapse:separate (see the .nm-entrygrid block below), where
   adjacent borders abut instead of collapsing — the old .ts-day-first
   border-TOP rules would stack onto the preceding day's 2px bottom and
   render a double-thickness divider, so they're gone. Each day's divider is drawn
   solely by the row that ENDS the day (plus td.ts-day below for the
   rowspanned label cell). The old "very last row closes with black"
   belt-and-suspenders rules are retired too: the rounded .nm-tablecard
   wrapper border now frames the table bottom, and a black 2px line
   there would double up against it (zeroed in the .nm-entrygrid block). */
.tsf-exempt .ts-day-last td { border-bottom: 2px solid #000 !important; }
.tsf-exempt .ts-day-last .ts-day { border-bottom: 2px solid #000 !important; }

/* Force the day-label cell's bottom border to black on EVERY day group.
   The `.ts-day` rule above sets `border-bottom: 2px solid #000`, but the base
   `.ts-table td { border: 1px solid var(--nm-border) }` at the top has higher specificity
   (0,1,1 vs 0,1,0) and overrides it on all four sides. When Sunday rowspans down
   and the `.ts-day-last td` !important rule targets a *different* row (the last
   entry row, which has no `.ts-day` cell), the rowspanned day-label keeps the
   light blue border and the black divider below Sunday disappears. This selector
   (specificity 0,2,1) wins over the base and locks the black bottom in place. */
.tsf-exempt .ts-table td.ts-day { border-bottom: 2px solid #000 !important; }

/* Strong black rule under the column-header row too. */
.tsf-exempt .ts-table thead th { border-bottom: 2px solid #000; }

/* Error row — NACOS red wins over the informational P/W colors on the same row.
   Text stays dark so any content inside an invalid row remains readable.
   The note/comment cell is explicitly exempted: a comment never causes the
   validation error, so tinting it red would point the user at the wrong field. */
.tsf-exempt .ts-err { background-color: var(--nm-red); color: #1a1a1a; }
.tsf-exempt .ts-err td.ts-cell-site,
.tsf-exempt .ts-err td.ts-cell-prep,
.tsf-exempt .ts-err td.ts-cell-wait { background: var(--nm-red); color: #1a1a1a; }
.tsf-exempt .ts-err input { background: var(--nm-red); color: #1a1a1a; }
.tsf-exempt .ts-err td.ts-note-cell { background: #ffffff; color: #1a1a1a; }
.tsf-exempt .ts-err td.ts-note-cell input { background: #ffffff; color: #1a1a1a; }
/* The + / x action-button cell can never itself contain bad data — tinting
   it red just visually noisy-s the row. Keep it white so the buttons stay
   legible even when the entry's times are invalid. */
.tsf-exempt .ts-err td.ts-action-cell { background: #ffffff; }

/* CA OT / CA DT headers used to drop to a proportional font so the space was
   narrower — that made them read thinner than the surrounding monospace headers.
   Keep them in the shared monospace stack so all column titles match visually. */

/* Tailwind Plus condensed display-table treatment — read-only tables only
   (Time Entries / SAP-entries preview). No vertical cell borders, light z200
   row dividers, white surface everywhere (every cell here is app-generated,
   so the tan "calculated" tint carries no signal and is dropped). !important
   on the border declarations is required to out-rank the .summary-v-sep
   border-right, which is itself !important. (The entry grid's 2px-black
   day-divider rules key off .ts-day-last/.ts-day classes that never appear
   in display-table rows.) Mono font + font-size inherit from .ts-table. */
.tsf-exempt .ts-table.nm-displaytable th,
.tsf-exempt .ts-table.nm-displaytable td {
    border: 0 !important;
    border-bottom: 1px solid var(--nm-z200) !important;
    padding: 3px 10px;
}
.tsf-exempt .ts-table.nm-displaytable thead th {
    /* z50, not white — a white header band reads as detached from the table
       body. The faint fill ties it to its rows. */
    background: var(--nm-z50);
    font-weight: 600;
    color: var(--nm-z950);
    border-bottom: 1px solid var(--nm-z300) !important;
}
.tsf-exempt .ts-table.nm-displaytable tbody td { background: #fff; color: var(--nm-z500); }
.tsf-exempt .ts-table.nm-displaytable tbody td:first-child { color: var(--nm-z950); }
/* Last display row keeps the standard z200 divider — kept explicit as a
   guard so no future last-row override in the entry-grid rules can leak
   a heavier border into the read-only tables. */
.tsf-exempt .ts-table.nm-displaytable tbody tr:last-child td { border-bottom: 1px solid var(--nm-z200) !important; }
.tsf-exempt .ts-table.nm-displaytable tfoot td {
    font-weight: 600;
    color: var(--nm-z950);
    border-top: 1px solid var(--nm-z300) !important;
    border-bottom: 0 !important;
}

/* ── Rounded-corner border model — MAIN ENTRY GRID ONLY (.nm-entrygrid) ──
   border-collapse:collapse ignores border-radius entirely, so the square
   table corners poked past the rounded .nm-tablecard wrapper shadow.
   The grid switches to separate + a single-side
   border model: every cell draws only its RIGHT and BOTTOM edge, and the
   wrapper's own 1px z200 border (global .nm-tablecard) supplies the
   OUTER frame on all four sides — last column drops border-right, last
   row drops border-bottom so nothing doubles up against the wrapper.
   Reasoned cell-by-cell: interior vertical line = one right border,
   interior horizontal line = one bottom border, outer frame = wrapper.
   Scoped to .nm-entrygrid so the read-only .nm-displaytable tables keep
   their own border model untouched. */
.tsf-exempt .ts-table.nm-entrygrid {
    border-collapse: separate;
    border-spacing: 0;
    /* -1px nests the table's radius just inside the wrapper's 1px border */
    border-radius: calc(var(--nm-radius-lg) - 1px);
}
.tsf-exempt .ts-table.nm-entrygrid th,
.tsf-exempt .ts-table.nm-entrygrid td {
    border: 0;
    border-right: 1px solid var(--nm-border);
    border-bottom: 1px solid var(--nm-border);
}
/* Restate the strong black header underline — the single-side rule above
   out-specifies the earlier `.ts-table thead th` declaration. */
.tsf-exempt .ts-table.nm-entrygrid thead th { border-bottom: 2px solid #000; }
/* Outer right edge comes from the wrapper. */
.tsf-exempt .ts-table.nm-entrygrid tr > *:last-child { border-right: 0; }
/* Outer bottom edge comes from the wrapper — !important to out-rank the
   2px-black day-divider rules above (themselves !important), which would
   otherwise stack a black line directly on top of the wrapper border. */
.tsf-exempt .ts-table.nm-entrygrid tbody:last-child tr:last-child > th,
.tsf-exempt .ts-table.nm-entrygrid tbody:last-child tr:last-child > td { border-bottom: 0 !important; }
/* Sunday's rowspanned day-label cell bottoms out at the table's last row
   but is anchored in an earlier tr, so tr:last-child can't reach it —
   the shared DayLabelCell stamps ts-day-bl on the day cell whenever
   dayIndex == 6 (the form's legacy ts-corner-bl spelling lost its last
   emitter in the E2 re-seat; its selector legs were removed by unit E4,
   2026-08-20). */
.tsf-exempt .ts-table.nm-entrygrid td.ts-day.ts-day-bl { border-bottom: 0 !important; }
/* Corner CELLS round their backgrounds (header blue / calc tan) so the
   fills don't overshoot the wrapper's rounded corners. Same -1px radius
   as the table so the curves nest inside the wrapper's 1px border. */
.tsf-exempt .ts-table.nm-entrygrid thead tr:first-child > th:first-child { border-top-left-radius: calc(var(--nm-radius-lg) - 1px); }
.tsf-exempt .ts-table.nm-entrygrid thead tr:first-child > th:last-child { border-top-right-radius: calc(var(--nm-radius-lg) - 1px); }
.tsf-exempt .ts-table.nm-entrygrid td.ts-day.ts-day-bl { border-bottom-left-radius: calc(var(--nm-radius-lg) - 1px); }
.tsf-exempt .ts-table.nm-entrygrid tbody:last-child tr:last-child > td:last-child { border-bottom-right-radius: calc(var(--nm-radius-lg) - 1px); }

/* Date labels are LETTER grids ("MON JUN 8" / "WED JUN 10") — proportional
   sans staggers them (tabular-nums only fixes digits). True mono is used for the
   day-label column + the display tables' date column. */
.tsf-exempt .ts-table .ts-day, .tsf-exempt .ts-table .ts-day-weekend { font-family: var(--nm-font-truemono); }
/* Display tables keep ONE family across the row — see the .tsf-orders note above (Erik 2026-08-03). */

/* ── Optional-note reading surface, phone width — the .ts-scroll widen arm only.
   The note-input focus rules stay host-side in app.css with NoteInput. ── */
@media (max-width: 640px) {
    .ts-scroll:has(.nm-mobile-clock-grid),
    .ts-scroll:has(.nm-mobile-week-grid) {
        width: calc(100% + 24px);
        max-width: calc(100% + 24px);
        margin-left: -12px;
    }
}

/* Preview-card width containment covers portrait and landscape. The host constrains
   the app card at the same breakpoint; employee phone-row layouts remain at ≤640px. */
@media (max-width: 1024px) {
    /* Preview / summary cards: stop shrink-wrapping past the viewport — wide tables
       scroll inside the card. The entry-grid variant (-open) is excluded: it needs
       overflow visible for the autocomplete dropdown and already sits in .ts-scroll. */
    .nm-tablecard:not(.nm-tablecard-open) {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }
}

@media (max-width: 640px) {
    /* Calculated columns yield to INPUT columns (Erik IMG_1610: "Site prep wait trvl and
       status columns can all be width 0 when there is no space as they're just
       calculated — you need to be able to see the input fields primarily"). Entry grids
       only — the read-only preview tables keep their calculated cells. Covers the clock
       templates' Site/Prep/Wait/Trvl/Holiday/ST-split cells (.ts-calc) and the Status
       chip column (.ts-status-col). DP's per-row totals use dp-calc and stay. */
    .nm-entrygrid .ts-calc,
    .nm-entrygrid:not(.nm-mobile-clock-grid) .ts-status-col { display: none; }
}

/* ── Employee entry grids on phones (2026-08-12) — the .nm-mobile-clock-grid layer
   plus the shared cost-object focus surface. The weekly-matrix layers
   (.nm-mobile-week-grid/-dp-/-de-) stay host-side with their templates. ── */
@media (max-width: 640px) {
    .ts-scroll > .nm-tablecard-open:has(> .nm-mobile-clock-grid),
    .ts-scroll > .nm-tablecard-open:has(> .nm-mobile-week-grid) {
        display: block;
        width: 100% !important;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }
    /* Clock templates: two editable rows in the visible width, followed by a status rail. */
    .nm-mobile-clock-grid {
        display: block;
        width: 100% !important;
        min-width: 0;
    }
    .nm-mobile-clock-grid thead { display: none; }
    .nm-mobile-clock-grid tbody { display: block; width: 100%; }
    .nm-mobile-clock-grid tbody > tr {
        display: grid;
        position: relative;
        grid-template-columns: 26px 72px repeat(4, minmax(0, 1fr)) 28px;
        grid-template-rows: minmax(36px, auto) minmax(36px, auto);
        align-items: stretch;
        width: 100%;
        min-width: 100%;
        box-sizing: border-box;
    }
    .nm-mobile-clock-grid tbody > tr:has(> .nm-entry-status):not(:has(> .nm-entry-cancel)) {
        grid-template-columns: 26px 72px repeat(4, minmax(0, 1fr)) 28px 92px;
        width: calc(100% + 92px);
    }
    .nm-mobile-clock-grid tbody > tr:has(> .nm-entry-cancel) {
        grid-template-columns: 26px 72px repeat(4, minmax(0, 1fr)) 28px 92px 52px;
        width: calc(100% + 144px);
    }
    .nm-mobile-clock-grid tbody > tr > td {
        min-width: 0;
        box-sizing: border-box;
    }
    .nm-mobile-clock-grid.nm-entrygrid tbody > tr > .nm-entry-day {
        grid-column: 1;
        grid-row: 1 / span 2;
        position: absolute;
        inset: 0 auto auto 0;
        display: flex;
        align-items: center;
        justify-content: center;
        height: var(--nm-mobile-day-span-height, 100%);
        width: 26px;
        min-width: 26px;
        max-width: 26px;
        padding: 2px !important;
        font-size: 0 !important;
        white-space: normal !important;
        text-align: center;
        background: var(--nm-calc-bg);
        border-right: 1px solid var(--nm-border) !important;
        border-bottom: 0 !important;
        z-index: 1;
    }
    .nm-mobile-clock-grid.nm-entrygrid tbody > tr > .nm-entry-day::before {
        content: attr(data-mobile-day);
        color: #1a1a1a;
        font-size: var(--nm-font-grid);
        line-height: 1;
    }
    /* Only the first physical row owns the real rowspan cell. JS measures that row through the
       final row in the HTML rowspan and lets the cell cover the whole day group, so its label is
       vertically centered even when an individual status row grows taller. Continuation rows
       retain a blank column-one grid item behind the spanning cell, but never draw same-day
       horizontal rules there; the light right edge is the only internal day-gutter divider. */
    .nm-mobile-clock-grid tbody > tr:not(:has(> .nm-entry-day))::before {
        content: "";
        grid-column: 1;
        grid-row: 1 / span 2;
        display: block;
        box-sizing: border-box;
        background: var(--nm-calc-bg);
        border-right: 1px solid var(--nm-border);
    }
    /* Desktop's `ts-day-last td` rule paints a bottom border on every cell. In this two-track
       phone grid that puts the action/cost border halfway down the row. Normalize the cells to
       hairlines, then let one full-grid overlay draw the day separator at the true row bottom. */
    .nm-mobile-clock-grid tbody > tr.ts-day-last > td {
        border-bottom: 1px solid var(--nm-border) !important;
    }
    .nm-mobile-clock-grid tbody > tr.ts-day-last::after {
        content: "";
        grid-column: 1 / -1;
        grid-row: 2;
        align-self: end;
        z-index: 2;
        pointer-events: none;
        border-bottom: 2px solid #000;
    }
    .nm-mobile-clock-grid .nm-entry-day .nm-daywarn { display: none; }
    .nm-mobile-clock-grid .nm-entry-actions {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 1px !important;
    }
    .nm-mobile-clock-grid .nm-entry-cost {
        grid-column: 3 / 8;
        grid-row: 1;
        min-width: 0 !important;
        min-height: 36px;
        overflow: visible;
        padding: 2px !important;
    }
    .nm-mobile-clock-grid .nm-entry-cost > .ts-order {
        display: block !important;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .nm-mobile-clock-grid .nm-entry-cost input.nm-cost-object-input,
    .nm-mobile-week-grid .nm-entry-cost input.nm-cost-object-input {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .nm-mobile-clock-grid .nm-entry-kind {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        padding: 1px !important;
    }
    .nm-mobile-clock-grid .nm-entry-kind .ts-pw-group { width: 72px; }
    .nm-mobile-clock-grid .nm-entry-kind .ts-pw-btn {
        width: 24px;
        min-width: 24px;
        padding: 0 !important;
    }
    .nm-mobile-clock-grid .nm-entry-time {
        grid-row: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 24px;
        padding: 1px !important;
    }
    .nm-mobile-clock-grid .nm-entry-time-e { grid-column: 3; }
    .nm-mobile-clock-grid .nm-entry-time-f { grid-column: 4; }
    .nm-mobile-clock-grid .nm-entry-time-g { grid-column: 5; }
    .nm-mobile-clock-grid .nm-entry-time-h { grid-column: 6; }
    .nm-mobile-clock-grid input.ts-time {
        width: 100% !important;
        min-width: 0;
        max-width: none;
        box-sizing: border-box;
        height: var(--nm-control-h);
        padding-inline: 1px !important;
        font-size: 16px !important;
    }
    .nm-mobile-clock-grid input.ts-time:focus { width: 100% !important; }
    .nm-mobile-clock-grid .nm-entry-hours {
        grid-column: 3 / 7;
        grid-row: 2;
        min-width: 0;
    }
    .nm-mobile-clock-grid .nm-entry-note {
        grid-column: 7;
        grid-row: 2;
        min-width: 24px;
        padding: 2px !important;
    }
    .nm-mobile-clock-grid .nm-entry-note input { width: 100%; min-width: 0; box-sizing: border-box; }
    /* Locked notes are plain text, not the compact editable input. Give them a
       reading line below the clocks so long words cannot cover the status rail. */
    .nm-mobile-clock-grid .ts-segrow > .nm-entry-note:not(:empty) {
        grid-column: 2 / 8;
        grid-row: 3;
        min-width: 0;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
    }
    .nm-mobile-clock-grid tbody > tr.ts-segrow:has(> .nm-entry-note:not(:empty)) > .nm-entry-day,
    .nm-mobile-clock-grid tbody > tr.ts-segrow:has(> .nm-entry-note:not(:empty))::before {
        grid-row: 1 / span 3;
    }
    .nm-mobile-clock-grid tbody > tr.ts-segrow.ts-day-last:has(> .nm-entry-note:not(:empty))::after {
        grid-row: 3;
    }
    .nm-mobile-clock-grid .nm-entry-status {
        display: flex !important;
        grid-column: 8;
        grid-row: 1 / span 2;
        align-items: center;
        justify-content: center;
        min-width: 92px;
        padding: 2px 4px !important;
    }
    .nm-mobile-clock-grid .nm-entry-cancel {
        grid-column: 9;
        grid-row: 1 / span 2;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 52px;
    }
    .nm-mobile-clock-grid .nm-entry-holiday-fill { display: none; }
    .nm-mobile-clock-grid .nm-entry-empty {
        grid-column: 3 / 8;
        grid-row: 1 / span 2;
    }
    .nm-mobile-clock-grid .ts-calc { display: none !important; }

    /* Cost-object selection gets the same in-place reading surface as Optional Note. */
    td.nm-entry-cost:has(input.nm-cost-object-input:focus) {
        position: relative;
        min-height: var(--nm-control-h);
    }
    .nm-entry-cost input.nm-cost-object-input:focus {
        position: absolute;
        right: 2px;
        top: 50%;
        transform: translateY(-50%);
        width: min(calc(100vw - 40px), 640px) !important;
        z-index: 31;
        font-size: 16px !important;
        padding: 8px 10px !important;
        border: 2px solid #2e7d32 !important;
        border-radius: 8px !important;
        background: #fff;
        color: #1b2b38;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }
}

/* ── Week-toolbar chrome (P4.2, moved from Home.razor's style block for the Partner host) ──
   Custom up/down stepper for the Week input. The native <input type=number> spinner in
   Chromium clips at small heights / with vertical padding (the top arrow gets shaved by the
   input's top border) — no combination of height, padding, or box-sizing reliably stops it.
   We hide the native spinner and stack two flat buttons next to the input to guarantee
   unclipped rendering.
   Cascade note: no other head sheet styles wk-*, and the surviving host overrides
   (.dla .wk-* in DpLedgerAdminView, .nm-mono .wk-step in Home's phone layer) win on
   specificity, so this sheet's earlier position changes nothing. */
.wk-wrap { display:inline-flex; align-items:stretch; gap:0; }
.wk-input::-webkit-inner-spin-button,
.wk-input::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
.wk-input { -moz-appearance:textfield; border-radius:0 !important; margin:0 -1px; position:relative; }
/* Full-height week stepper buttons — easily clickable (≥24px targets). */
.wk-step { border:1px solid var(--nm-ring-strong); background:#fff; cursor:pointer;
           width:26px; height:28px; padding:0;
           font-size:10px; /* ◀/▶ arrow glyph, not text — exempt from the 0.7rem floor */
           color:var(--nm-z600); font-family:inherit;
           display:inline-flex; align-items:center; justify-content:center;
           box-shadow:var(--nm-shadow-sm); }
.wk-step:hover { background:var(--nm-z100); }
.wk-step-prev { border-radius:var(--nm-radius-lg) 0 0 var(--nm-radius-lg); }
.wk-step-next { border-radius:0 var(--nm-radius-lg) var(--nm-radius-lg) 0; }

@media (max-width: 640px) {
    /* Phone-width stepper targets (moved with the family; base rule above, so file order
       keeps the override exactly as Home.razor's block ordered it). */
    .wk-step { width:32px; height:34px; font-size:12px; }
}

/* WEEK-badge sizing (#124) — scoped to the form-header own-week badge and the approver-tile /
   roster week badges ONLY, so small lifecycle status chips are not enlarged. A week label is
   bounded, generated metadata: give it its full intrinsic width and NEVER let a narrow table
   squeeze it into stacked letters. Phone roster tables already live in a horizontal swipe box.
   Cascade note (P4.2): this sheet loads BEFORE app.css, whose .nm-badge containment contract
   uses !important on the same properties — between two !important declarations order decides,
   so the move compounds the selector to .nm-badge.nm-week-chip: higher specificity beats
   .nm-badge regardless of sheet order. WeekChip always emits both classes together. */
.nm-badge.nm-week-chip { display:inline-flex; align-items:center; gap:4px; border-radius:6px;
                padding:4px 10px; min-height:24px; height:auto; line-height:1.15;
                font-size:13px; font-weight:700; box-sizing:border-box;
                flex:0 0 auto;
                width:max-content !important; min-width:max-content !important; max-width:none !important;
                flex-wrap:nowrap !important; white-space:nowrap !important;
                overflow-wrap:normal !important; }
.nm-week-chip-own      { background:#2563eb; color:#fff; }   /* OWN week — solid blue + bold white */
.nm-week-chip-approval { background:#52525b; color:#fff; }   /* APPROVAL week — solid grey + bold white */

/* NM's page-wide time-entry typeface contract. Keeping it with the shared form means every host
   gets the same S/P/W, clock, status and toolbar typography instead of relying on Home.razor's
   inline copy. The chrome-specific rules below deliberately override portions with the sans face. */
.nm-mono,
.nm-mono h1, .nm-mono h2, .nm-mono h3, .nm-mono h4, .nm-mono h5, .nm-mono h6,
.nm-mono p, .nm-mono span, .nm-mono div,
.nm-mono input, .nm-mono select, .nm-mono button, .nm-mono textarea,
.nm-mono table, .nm-mono th, .nm-mono td,
.nm-mono .alert, .nm-mono .badge {
    font-family:var(--nm-font-mono);
    font-variant-numeric:tabular-nums;
}
.hdr-mono { font-family:var(--nm-font-mono); font-variant-numeric:tabular-nums; }

/* Draft/Saved badge beside the own-week chip. These are the exact computed NM source-badge
   colors, component-owned so Bootstrap load order cannot make Partner bright yellow/dark gray.
   Draft is visually subordinate to the 24px week chip; Saved uses the neutral zinc tint
   (green remains reserved for Approved/Final). */
.nm-badge.nm-week-work-state-badge {
    display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box;
    border-radius:.375rem; font-family:var(--nm-font-mono); font-weight:700;
    flex:0 0 auto; width:max-content !important; min-width:max-content !important;
    max-width:none !important; flex-wrap:nowrap !important; white-space:nowrap !important;
    overflow-wrap:normal !important;
}
/* The badge shape Home.razor's inline block set (T3.1d, move-only, finding F3). It must still beat the work-state badge
   above at equal specificity (0,2,0), as the inline block did from after every sheet, so it follows it here. */
.nm-mono .badge { border-radius:6px; font-weight:500; }
.nm-week-work-state-draft {
    min-height:19px; padding:0 8px; font-size:.7rem; line-height:1;
    background:rgba(251,191,36,.25)!important; color:#92400e!important;
}
.nm-week-work-state-saved {
    padding:.35em .65em; font-size:.75em; line-height:1;
    background:rgba(82,82,91,.10)!important; color:var(--nm-z700)!important;
}

/* ── NoteInput touch CSS (unit C3a, moved from app.css in P4.3 for the Partner host) ─────
   Note inputs on touch devices (Erik 2026-07-25/26): v1.3.321 lifted the FOCUSED note input
   to a fixed bar at the top of the viewport; Erik (IMG_1609): it teleported over the
   environment bar and out of context — "instead, move the viewport over the input box
   selected, at the left side of the screen." That scroll behavior lives in the host's
   focusin handler (nm002m-ui.js). Here only the iOS zoom guard remains: 16px on the input
   at REST — Safari makes the zoom decision from the size at focus time, so a :focus-only
   bump is too late.
   Cascade note: only this sheet styles input.nm-note-input; the clock forms' (0,3,1)
   input rules win on specificity and the widen rule's !important wins on importance, so
   leaving app.css (a LATER sheet) for this earlier one changes no computed value. */
@media (pointer: coarse) {
    input.nm-note-input { font-size: 16px; }
}

/* ── Optional Note touch focus widen-in-place (Erik 2026-07-29: "I wanted it to widen to
   the width of the page in place" — v1.3.362's fixed-top overlay hid under the
   environment banner). On touch devices the FOCUSED note input grows LEFTWARD from its
   own cell to (almost) the viewport width, staying on its row: absolute within the cell,
   anchored to the cell's right edge, vertically centered on the row. No fixed
   positioning, so nothing overlays it and it scrolls with its row. CSS-only: the §54
   freeze, the events and the DOM shape are untouched. 16px font so iOS doesn't zoom.
   PHONE-WIDTH ONLY (Erik: "this only needs to apply for the phone width view") — the same
   ≤640px breakpoint as the phone layout layer, so tablets/desktops keep the plain cell. */
@media (max-width: 640px) {
    td:has(input.nm-note-input:focus) {
        position: relative;
        min-width: 90px;   /* hold the cell's footprint while the input floats */
    }
    input.nm-note-input:focus {
        position: absolute;
        right: 2px;
        top: 50%;
        transform: translateY(-50%);
        /* !important on width + visuals: every clock form carries its own higher-specificity
           input rules — e.g. `.tsf-all .ts-table input.ts-order` sets width:100% at (0,3,1),
           beating this rule's (0,2,1), and 100% of the ANCHOR CELL is ~90px, so the input
           floated but never widened (Erik 2026-07-29: "completely unreadable… it should
           take up the width of the window but it isn't"). Same war over border / padding /
           font-size (the 16px is the iOS zoom guard — 15.2px re-zooms). Verified in a live
           harness: without !important the focused input is ~160px, with it ~92vw. */
        width: min(92vw, 640px) !important;
        z-index: 30;
        font-size: 16px !important;
        padding: 10px 12px !important;
        border: 2px solid #2e7d32 !important;
        border-radius: 8px !important;
        background: #fff;
        color: #1b2b38;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }
}

/* ── SWR slice CSS (P4.5, moved from ServiceReportModal's style block / app.css for the
   Partner host). Three families, each cascade-analyzed as the sole definer of its
   selectors; the phone variants replicate the modal's exact media condition and internal
   order, so every computed value is unchanged in NM002M while the Partner SWR editor can
   now consume the same slices. Host wrappers keep supplying --srm-label-font /
   --srm-area-font (the modal's .srm-modal token line; the Partner editor sets its own). */

/* Shared full-screen SWR workspace. The frame used to live only inside NM's large modal, which
   let Partner compose the same inner fields inside an unrelated card/tab shell. Both hosts now
   mount SwrWorkspaceShell and consume these exact rules. */
.srm-backdrop {
    position: fixed;
    inset: var(--nm-envbar-h, 0px) 0 0 0;
    z-index: 2000;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    /* clip, not hidden: an overflow:hidden box is still a scroll container, so focus() or
       scrollIntoView on ANY descendant whose containing block is this backdrop (an absolutely
       positioned visually-hidden file input, for one) scrolls the whole modal out of the viewport
       and the report reads as a blank white page (Erik 2026-09-09, AppDevGuidance §104). A clip
       box can never scroll; hidden stays above it as the fallback for old engines. */
    overflow: clip;
    padding: 0;
    background: #fff;
    --srm-horizontal-scrollbar-clearance: 18px;
}
.srm-backdrop.srm-hidden { display: none; }
.srm-modal,
.srm-modal.srm-compact {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    color: var(--nm-z950);
    font-family: var(--nm-font-sans);
    --srm-area-font: 18px;
    --nm-area-font: var(--srm-area-font);
    --srm-label-font: 14px;
    --srm-control-font: 15px;
}
.srm-head {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 10px 14px;
    border-bottom: 1px solid var(--nm-ring);
    border-radius: 0;
    background: #fff;
}
.srm-title-group {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}
.srm-title {
    flex: 0 1 auto;
    min-width: 0;
    color: var(--nm-z950);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.srm-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    min-height: 32px;
    padding: 0 4px;
    border: 0;
    border-radius: var(--nm-radius);
    background: transparent;
    color: var(--nm-z500);
    font-size: 1.05rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}
.srm-x:hover { color: var(--nm-z950); background: var(--nm-z100); }
.srm-body {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
    padding: 14px;
    font-size: var(--nm-font-ui);
}
.srm-foot {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    box-sizing: border-box;
    min-height: 0;
    max-height: calc(100% - 44px);
    overflow-x: auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px) + var(--srm-horizontal-scrollbar-clearance, 18px));
    border-top: 1px solid var(--nm-ring);
    border-radius: 0;
    background: var(--nm-z50);
}
.srm-foot-empty { display: none; }
.srm-save-action { display:inline-flex; align-items:center; }

/* The cloud-sync banner (2026-09-07): one dismissible strip above the form for "saved on this
   device", "syncing", "synced", "failed" and "sign in again". It never lives in the header
   action row, so a verdict cannot shove Reload/Preview sideways on a phone. */
.srm-sync-notice { display:flex; align-items:center; gap:8px; margin:0 0 12px; padding:7px 10px;
                   border-radius:var(--nm-radius); font-size:0.8rem; line-height:1.35;
                   background:#eef2ff; border-left:3px solid #4f46e5; color:#3730a3; }
.srm-sync-icon { flex:0 0 auto; font-size:0.95rem; line-height:1; }
.srm-sync-body { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:1px; }
.srm-sync-text { font-weight:600; }
.srm-sync-detail { font-size:0.74rem; opacity:.85; }
.srm-sync-action { flex:0 0 auto; font:inherit; font-size:0.76rem; font-weight:600; padding:4px 9px;
                   border-radius:6px; border:1px solid currentColor; background:#fff; color:inherit;
                   cursor:pointer; }
.srm-sync-dismiss { flex:0 0 auto; font:inherit; font-size:0.85rem; line-height:1; padding:4px 6px;
                    border:0; background:transparent; color:inherit; opacity:.7; cursor:pointer; }
.srm-sync-dismiss:hover, .srm-sync-dismiss:focus-visible { opacity:1; }
.srm-sync-syncing .srm-sync-icon { display:inline-block; animation:srm-sync-spin 1.1s linear infinite; }
@keyframes srm-sync-spin { to { transform:rotate(360deg); } }
.srm-sync-synced { background:#ecfdf5; border-left-color:#059669; color:#065f46; }
.srm-sync-failed { background:#fffbeb; border-left-color:#d97706; color:#92400e; }
.srm-sync-sign-in-required { background:#fef2f2; border-left-color:#dc2626; color:#991b1b; }
/* Top-of-page placement (beside the environment/connectivity banners): a full-width strip with
   the same left rule, so the instruction is visible on any tab without opening a menu. */
.srm-sync-page { margin:0 0 4px; border-radius:0; border-left-width:4px; font-size:0.78rem; }
/* Under the SWR header row: a non-scrolling strip so the Save verdict is visible when Save is
   pressed, however far the form is scrolled. Collapses to nothing when empty. */
.srm-head-notice { flex-shrink:0; min-width:0; padding:6px 14px 0; background:#fff; }
.srm-head-notice:empty { display:none; }
.srm-head-notice .srm-sync-notice { margin:0 0 6px; }
@media (prefers-reduced-motion: reduce) { .srm-sync-syncing .srm-sync-icon { animation:none; } }
.srm-status { margin-right: auto; margin-left: 0; color: var(--nm-z600); font-size: 0.78rem; }
.srm-photo-intake { display:grid; gap:10px; margin:0 0 10px; }
.srm-photo-progress { display:grid; gap:8px; padding:12px 14px; border:1px solid var(--nm-ring);
    border-radius:var(--nm-radius, 8px); background:var(--nm-z50); min-width:0; }
.srm-photo-progress-label { display:flex; justify-content:space-between; gap:12px;
    font-size:.85rem; font-weight:600; color:var(--nm-z800); }
.srm-photo-progress-track { height:10px; overflow:hidden; border-radius:999px; background:var(--nm-z200, #e5e7eb); }
.srm-photo-progress-fill { height:100%; border-radius:inherit; background:var(--nm-primary, #0d4f8a); }
.srm-photo-progress-track.is-indeterminate .srm-photo-progress-fill { width:30%;
    animation:srm-photo-progress-pulse 1.4s ease-in-out infinite alternate; }
.srm-photo-progress-hint { font-size:.78rem; color:var(--nm-z600, #4b5563); }
@keyframes srm-photo-progress-pulse { from { transform:translateX(0); } to { transform:translateX(233%); } }
@media (prefers-reduced-motion:reduce) {
    .srm-photo-progress-track.is-indeterminate .srm-photo-progress-fill { animation:none; width:100%; opacity:.55; }
}
/* position:relative is load-bearing: the visually-hidden native inputs below are absolutely
   positioned, and without a positioned parent their containing block is the fixed .srm-backdrop.
   Focusing one (the label click) then scrolled that backdrop to the input's static position far
   below the fold and the whole modal left the viewport (Erik 2026-09-09, AppDevGuidance §104). */
.srm-photo-actions { position:relative; display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
/* Visually hidden but still focusable (it is the label's for= target). Its PARENT must be
   positioned — .srm-photo-actions and .srm-await-upload are — or the containing block is the
   fixed backdrop and focus scrolls the overlay (§104). */
.srm-photo-native-input { position:absolute !important; width:1px !important; height:1px !important;
    padding:0 !important; margin:-1px !important; overflow:hidden !important; clip:rect(0,0,0,0) !important;
    white-space:nowrap !important; border:0 !important; opacity:0 !important; }
.srm-photo-action { display:inline-flex; align-items:center; justify-content:center; gap:7px;
    min-height:40px; box-sizing:border-box; padding:7px 12px; border:1px solid var(--nm-ring);
    border-radius:6px; background:#fff; color:var(--nm-z900); font-size:.84rem; font-weight:600;
    line-height:1.2; cursor:pointer; box-shadow:var(--nm-shadow-sm); }
.srm-photo-action:hover { border-color:#2563eb; background:#eff6ff; }
.srm-photo-native-input:focus-visible + .srm-photo-action,
.srm-photo-action:focus-visible { outline:2px solid #2563eb; outline-offset:2px; }
.srm-photo-action.is-disabled, .srm-photo-action:disabled { opacity:.5; cursor:default; pointer-events:none; }
.srm-photo-action[hidden], .swr-camera-choices[hidden], .swr-camera-choices button[hidden] { display:none; }
.swr-camera-menu { display:flex; align-items:center; }
.swr-camera-menu summary { cursor:pointer; list-style:none; }
.swr-camera-menu summary::-webkit-details-marker { display:none; }
.swr-camera-choices { display:inline-flex; gap:6px; align-items:center; padding:4px; border:1px solid #cbd5e1; border-radius:6px; }
.swr-camera-menu[open] .swr-camera-choices { margin-top:4px; }
.swr-video-online-notice { display:flex; align-items:center; gap:12px; padding:10px 12px; margin:8px 0; border:1px solid #bfdbfe; border-radius:6px; background:#eff6ff; color:#1e3a5f; }
.swr-video-online-notice span { flex:1; }
.swr-video-online-notice button { min-height:36px; padding:5px 10px; border:1px solid #94a3b8; border-radius:5px; background:white; color:inherit; cursor:pointer; }
.srm-photo-paste-group { display:grid; gap:5px; max-width:640px; }
.srm-photo-paste-label { color:var(--nm-z800); font-size:.82rem; font-weight:600; }
.srm-photo-paste { min-height:88px; box-sizing:border-box; padding:10px 12px; overflow:auto;
    border:2px dashed var(--nm-z500); border-radius:8px; background:#fff; color:transparent;
    font-size:16px; line-height:1.4; cursor:text; outline:none; }
.srm-photo-paste:empty::before { content:"Paste image(s) from the clipboard"; color:var(--nm-z500);
    pointer-events:none; }
.srm-photo-paste:focus { border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.2); }
.srm-photo-paste.is-disabled { background:var(--nm-z100); opacity:.6; cursor:default; }
.srm-photos-ctl { display:flex; align-items:center; gap:10px; flex-wrap:wrap; flex:1 1 auto; min-width:0; }
.srm-photos-note { font-size:0.74rem; color:var(--nm-z500); }
.srm-photos-warn { color:#b45309; }
.srm-photos { display:flex; flex-wrap:wrap; gap:10px; margin:4px 0 10px; }
.srm-photo { display:flex; flex-direction:column; gap:4px; width:170px; padding:6px;
    border:1px solid var(--nm-ring); border-radius:var(--nm-radius); background:var(--nm-z50);
    position:relative; box-sizing:border-box; }
.srm-photo img { width:100%; height:110px; object-fit:cover; border-radius:3px; }
.srm-photo-pending { width:100%; height:110px; border-radius:3px; display:flex;
    align-items:center; justify-content:center; text-align:center; font-size:0.74rem;
    color:var(--nm-z500); background:repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 8px,
    #e5e7eb 8px, #e5e7eb 16px); border:1px dashed var(--nm-ring, #d1d5db); padding:4px;
    box-sizing:border-box; }
.srm-photo .srm-photo-cap { width:100%; box-sizing:border-box; font-size:0.74rem; }
.srm-photo .srm-rowx { position:absolute; top:2px; right:2px; background:rgba(255,255,255,0.85);
    border-radius:3px; }
.srm-edit-actions { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.srm-edit-actions > .hdr-btn { box-sizing:border-box; height:28px; min-height:28px; }
.srm-foot-checks {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    color: var(--nm-z600);
    font-size: 0.82rem;
}
.srm-foot-checks label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.srm-foot-checks input[type="checkbox"] { margin:0; flex:0 0 auto; }
.srm-foot .srm-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 0;
}


@media (max-width:640px) {
    .srm-photo-actions { display:grid; grid-template-columns:1fr; }
    .srm-photo-action { justify-content:flex-start; min-height:46px; font-size:15px; }
    .srm-photo-paste-group { max-width:none; }
    .srm-photo-paste { min-height:104px; }
}

/* Shared NM-shaped SWR body blocks used by the Partner adapter as well as the NM editor. */
.srm-note {
    margin: 0 0 12px;
    padding: 7px 11px;
    border-left: 3px solid #4f46e5;
    border-radius: var(--nm-radius);
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.78rem;
    line-height: 1.4;
}
.srm-prefill {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
    padding: 8px 10px;
    border: 1px solid var(--nm-ring);
    border-radius: var(--nm-radius);
    background: var(--nm-z50);
}
.srm-prefill.srm-prefill-archive { padding: 0; border: 0; border-radius: 0; background: transparent; }
.srm-prefill-label { color: var(--nm-z700); font-size: 12.5px; font-weight: 600; }
.srm-prefill-picker { flex: 1 1 240px; min-width: 0; }
.srm-prefill-picker > select,
.srm-prefill-picker > input { width: 100%; box-sizing: border-box; }
.srm-prefill-loading { color: var(--nm-z500); font-size: 0.75rem; font-style: italic; }
.srm-prefill-hint { flex-basis: 100%; margin: 0; color: var(--nm-z500); font-size: 0.72rem; }
.srm-section {
    margin: 16px 0 7px;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--nm-ring);
    color: var(--nm-z500);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.srm-section:first-of-type { margin-top: 0; }
.srm-area {
    flex: 1 1 260px;
    box-sizing: border-box;
    min-width: 0;
    min-height: calc(2.4em + 10px);
    resize: vertical;
    font-family: var(--nm-font-sans);
}
.nm-mono.srm-modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.nm-mono.srm-modal select { font-size: var(--srm-control-font); }
.srm-modal textarea.srm-area { font-size: var(--srm-area-font); }
.srm-vessel {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin: 0 0 12px;
    padding: 8px 11px;
    border-left: 3px solid #0284c7;
    border-radius: var(--nm-radius);
    background: #f0f9ff;
}
.srm-vessel-name { color: #0c4a6e; font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.srm-vessel-sub { overflow-wrap: anywhere; color: var(--nm-z600); font-size: 0.75rem; }
.srm-version-grid {
    display: grid;
    grid-template-columns: 165px 11rem 165px 5.5rem;
    align-items: center;
    gap: 6px 8px;
    margin-bottom: 6px;
}
.srm-version-grid > label { color: var(--nm-z600); font-size: var(--srm-label-font); }
.srm-version-grid > input { min-width: 0; }
.srm-ts-hint { margin: 6px 0 10px; color: var(--nm-z600); font-size: 0.78rem; }
.srm-loading { display: flex; align-items: center; gap: 10px; padding: 26px 4px; color: var(--nm-z600); font-size: 0.9rem; }
.srm-spin {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--nm-z200, #e4e4e7);
    border-top-color: var(--nm-z600, #52525b);
    border-radius: 50%;
    animation: srm-shared-spin 0.7s linear infinite;
}
@keyframes srm-shared-spin { to { transform: rotate(360deg); } }
.srm-empty { padding: 16px 2px; color: var(--nm-z500); font-size: 0.78rem; font-style: italic; }
.srm-myrep-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.srm-myrep-text { flex: 1 1 180px; min-width: 140px; box-sizing: border-box; }
.srm-hist { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 8px; }
/* The card states its own box model. Partner loads no Bootstrap, so a content-box card was its list's width plus its
   padding and border: 396 px in a 370 px list, 16 px past a 390 px screen (Partner 1.0.181 staging, finding F2).
   NM's global border-box hid it. Pinned by SwrArchiveRowLayoutGuardTests and archive-row-fit.test.cjs. */
.srm-hist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--nm-ring);
    border-radius: var(--nm-radius);
    background: #fff;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.srm-hist-row:hover { background: var(--nm-z100); }
/* Busy-on-the-thing-you-tapped (Erik 2026-08-29, AppDevGuidance §98): opening a report used to
   paint "Opening <ship>…" in a banner ABOVE the list, in a different section from the row that
   was tapped — it read as unrelated chrome and the row itself looked dead. The row now carries
   its own centred spinner and stops taking clicks while it opens. ::before dims the row's own
   content, ::after is the spinner, so no extra markup is needed inside six row branches. */
.srm-hist-row.srm-hist-opening { position: relative; pointer-events: none; }
.srm-hist-row.srm-hist-opening::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.66);
    z-index: 1;
}
.srm-hist-row.srm-hist-opening::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--nm-z200, #e4e4e7);
    border-top-color: var(--nm-z600, #52525b);
    border-radius: 50%;
    animation: srm-shared-spin 0.7s linear infinite;
    z-index: 2;
}
.srm-hist-main { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
.srm-hist-vessel { overflow: hidden; font-size: 0.85rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.srm-hist-sub { overflow: hidden; color: var(--nm-z500); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
/* The work description under the subtitle (Erik 2026-10-15): one line here, two on a phone. */
.srm-hist-desc { overflow: hidden; color: var(--nm-z600, #52525b); font-size: 0.72rem; text-overflow: ellipsis; white-space: nowrap; }
.srm-hist-chip {
    flex: 0 0 auto;
    padding: 2px 8px;
    border: 1px solid var(--nm-ring);
    border-radius: 999px;
    background: var(--nm-z100);
    color: var(--nm-z600);
    font-size: 0.68rem;
    font-weight: 600;
}
.srm-hist-chip.srm-hist-signed { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.srm-hist-chip.srm-hist-final { border-color: #bbf7d0; background: #f0fdf4; color: #15803d; }
/* Spec R5: a badge with a detail sheet is a real button (a phone has no hover). It keeps the chip's
   look and adds an affordance: a dotted underline and a pointer. */
button.srm-hist-chip.srm-hist-chip-action {
    font-family: inherit;
    line-height: inherit;
    cursor: pointer;
    text-decoration: underline dotted;
    text-underline-offset: 2px;
    -webkit-appearance: none;
    appearance: none;
}
button.srm-hist-chip.srm-hist-chip-action:focus-visible { outline: 2px solid var(--nm-z700, #3f3f46); outline-offset: 2px; }
.srm-badge-detail-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 2px 10px; margin: 0; font-size: 13px; }
.srm-badge-detail-facts dt { color: var(--nm-z600, #52525b); font-weight: 600; }
.srm-badge-detail-facts dd { margin: 0; overflow-wrap: break-word; }
.srm-badge-detail-text { white-space: pre-line; overflow-wrap: break-word; }
.srm-badge-detail-reason { color: var(--nm-z700, #3f3f46); font-style: italic; }
.srm-badge-detail-action { display: inline-flex; align-items: center; gap: 6px; }

@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
    .srm-head {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) 44px;
        grid-template-areas: "back title-actions close";
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
    }
    .srm-head > .srm-back { grid-area: back; min-height: 44px; }
    .srm-title-group { grid-area: title-actions; min-width: 0; }
    .srm-title-group .srm-edit-actions { flex:1 1 100%; flex-wrap:wrap; min-width:0; }
    .srm-title-group .srm-edit-actions > .hdr-btn { height:36px; min-height:36px;
                                                    box-sizing:border-box; }
    .srm-title { font-size: 18px; }
    .srm-x { grid-area: close; min-width: 44px; min-height: 44px; }
    .srm-body { padding: 12px; overscroll-behavior: contain; }
    .srm-photos { flex-direction:column; }
    .srm-photo { width:100%; padding:8px; }
    .srm-photo img { height:auto; max-height:240px; }
    .srm-photo .srm-rowx { min-width:44px; min-height:44px; font-size:20px; }
    .srm-foot {
        flex-wrap: wrap;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    }
    .srm-foot .srm-status { flex: 1 0 100%; margin: 0; font-size: 15px; line-height: 1.35; }
    .srm-foot .srm-foot-checks { flex: 1 0 100%; align-items: flex-start; gap: 8px; font-size: 15px; }
    .srm-foot-checks input[type="checkbox"] { width: 22px; height: 22px; }
    .srm-foot .btn,
    .srm-foot .hdr-btn { min-height: 44px; height: auto; padding: 8px 14px; font-size: 16px; }
    .srm-foot .srm-step-action { min-height: 48px; flex: 1 1 210px; padding: 10px 14px; }
    .srm-prefill { flex-direction: column; align-items: stretch; gap: 6px; padding: 12px; }
    .srm-prefill.srm-prefill-archive { padding: 0; }
    .srm-prefill-label { color: var(--nm-z900); font-size: 15px; line-height: 1.3; }
    .srm-prefill-picker { flex: none; width: 100%; }
    .srm-section { margin: 18px 0 9px; padding-bottom: 5px; font-size: 15px; line-height: 1.3; }
    .srm-version-grid { grid-template-columns: minmax(0, 1fr); gap: 5px; margin-bottom: 14px; }
    .srm-version-grid > label { color: var(--nm-z900); font-size: 15px; font-weight: 700; line-height: 1.3; }
    .srm-version-grid > input { width: 100%; max-width: 100%; }
    .srm-ts-hint { font-size: 15px; line-height: 1.45; }
    .srm-myrep-bar { display: grid; grid-template-columns: minmax(0, 1fr); }
    .srm-myrep-text { width: 100%; min-width: 0; }
    .srm-hist { gap: 10px; }
    /* Erik 2026-09-17, "the way the word offline is vertical … shouldn't happen": fixed grid columns
       collapsed the first chip's track to 0 px whenever a long badge shared the row, stacking "offline"
       letter by letter. The chips now wrap as whole words on their own lines instead. */
    .srm-hist-row { display: flex; flex-wrap: wrap; align-items: center; min-height: 44px; }
    .srm-hist-main { flex: 1 0 100%; gap: 3px; }
    .srm-hist-row .srm-rowx { margin-left: auto; }
    .srm-hist-vessel { overflow: visible; font-size: 16px; text-overflow: clip; white-space: normal; }
    .srm-hist-sub { overflow: visible; font-size: 15px; text-overflow: clip; white-space: normal; }
    .srm-hist-desc { display: -webkit-box; overflow: hidden; font-size: 15px; white-space: normal;
        -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
    .srm-hist-chip { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; }
    .srm-vessel-name { font-size: 19px; }
    .srm-vessel-sub { font-size: 15px; line-height: 1.35; }
}

/* SwrNarrativeField's row shape (srm-row + the required-label pair). Later host rules that
   touch row CHILDREN (.srm-input widths, .srm-checkrow direction) stay host-side and keep
   winning by their own position - no srm-row rule remains in any host block. */
.srm-row { display:flex; align-items:flex-start; gap:8px; margin-bottom:6px; flex-wrap:wrap; }
.srm-row > label { flex:0 0 165px; font-size:var(--srm-label-font, 14px); color:var(--nm-z600); padding-top:5px; }
.srm-req { color:#dc2626; margin:0 3px 0 0; font-weight:600; }
.srm-reqlabel { font-weight:600; }

/* Host-neutral Rev3 authoring geometry. These selectors formerly lived only inside NM's
   ServiceReportModal, so Partner could reuse the class names without receiving the layout. */
.srm-input { flex:1 1 220px; box-sizing:border-box; min-width:0; }
.nm-mono.srm-modal input.srm-workdesc { font-size:var(--srm-area-font) !important; }
.srm-fieldset { min-width:0; margin:0; padding:0; border:0; }
.srm-mat-add { max-width:560px; margin:2px 0 10px; }
.srm-table { width:100%; border-collapse:collapse; font-size:var(--nm-font-grid); }
.srm-table th, .srm-table td { padding:3px 6px; border:1px solid var(--nm-border); text-align:left; vertical-align:middle; }
.srm-table th { background:var(--nm-hdr-bg); color:var(--nm-z950); font-weight:600; }
.srm-table td input { box-sizing:border-box; width:100%; }
/* Qty and Serial # were sized as generic inputs. Trimming them to the width their content needs
   frees the row for the spelled-out condition/disposition words (Erik 2026-09-09). */
.srm-table .srm-col-qty { width:60px; }
.srm-table .srm-col-sn { width:130px; }
/* The internal note (2026-09-14) takes its share of the row on desktop; on a phone card it is one
   more labeled block, like Qty and Serial #. */
.srm-table .srm-col-note { min-width:160px; width:22%; }
.srm-table .srm-col-x { width:34px; text-align:center; }
.srm-rowx { padding:0 4px; border:0; background:transparent; color:var(--nm-z500); font-size:1rem; line-height:1; cursor:pointer; }
.srm-rowx:hover { color:#b91c1c; }
.srm-more-details { margin:16px 0 4px; border-top:1px solid var(--nm-ring); }
.srm-more { padding:8px 0; color:var(--nm-z600); font-size:12.5px; font-weight:600; cursor:pointer;
            list-style-position:inside; user-select:none; }
.srm-more:hover { color:var(--nm-z950); }
.srm-invalid { border-color:#dc2626 !important; }
.srm-fieldnote { flex-basis:100%; margin:0 0 4px 173px; color:#b91c1c; font-size:0.72rem; }
.srm-loc { position:relative; display:flex; flex:1 1 auto; flex-wrap:wrap; gap:6px; min-width:0; }
.srm-loc > input { flex:1 1 auto; min-width:0; }
.srm-loc > .srm-locbtn { position:absolute; right:calc(100% + 4px); }
.srm-loc-inline { flex:0 0 auto; align-self:center; color:var(--nm-z600); font-size:var(--srm-label-font); }
.srm-loc-derived { flex:0 0 auto; align-self:center; color:var(--nm-z700, #3f3f46);
                   font-size:var(--srm-label-font); white-space:nowrap; }
.srm-loc-country-label { margin-inline-start:4px; }
.srm-loc-country { flex:0 1 11rem; min-width:4.5rem; }
.srm-locbtn { flex:0 0 auto; height:28px; padding:0 7px; border:1px solid var(--nm-z200, #e4e4e7);
              border-radius:6px; background:var(--nm-z50, #fafafa); color:var(--nm-z950, #09090b);
              font-size:0.78rem; font-weight:600; white-space:nowrap; cursor:pointer; }
.srm-locbtn:hover:not(:disabled) { background:var(--nm-z100, #f4f4f5); }
.srm-locbtn:disabled { opacity:0.55; cursor:not-allowed; }
.srm-locnote { flex-basis:100%; margin:0 0 4px 173px; color:var(--nm-z500, #71717a); font-size:0.72rem; }
/* Shrink-to-fit: width:1% + nowrap makes a table cell exactly as wide as its content, so the word
   buttons decide the column and every leftover pixel goes to Name. A fixed 120px could not hold
   "Defective" or "Installed" (Erik 2026-09-09). */
.srm-col-cond, .srm-col-disp { width:1%; white-space:nowrap; }
.srm-col-cond select, .srm-col-disp select { box-sizing:border-box; width:100%; }
.srm-freetext { padding:1px 6px; border-radius:9px; background:var(--nm-z100, #f4f4f5);
                color:var(--nm-z600, #52525b); font-size:0.65rem; letter-spacing:0.03em;
                text-transform:uppercase; cursor:help; }
.srm-tagbox { display:flex; flex:1 1 auto; align-items:center; flex-wrap:wrap; gap:5px; box-sizing:border-box;
              min-width:0; min-height:30px; padding:4px 6px; border:1px solid var(--nm-z300);
              border-radius:8px; background:#fff; }
.srm-tagbox:focus-within { border-color:#2e7d32; box-shadow:0 0 0 1px #2e7d3233; }
.srm-tagbox .emp-picker { flex:1 1 190px; min-width:190px; }
.srm-tagbox .emp-picker > input { border:none !important; outline:none; background:transparent; box-shadow:none !important; }
.srm-engineer-stack { display:flex; flex:1 1 auto; flex-direction:column; gap:6px; min-width:0; }
.srm-engineer-stack > .srm-tagbox { box-sizing:border-box; width:100%; }
.srm-chip { display:inline-flex; align-items:center; gap:5px; padding:2px 6px 2px 9px; border-radius:12px;
            background:var(--nm-z100, #f4f4f5); color:var(--nm-z700, #3f3f46); font-size:0.78rem; }
.srm-chip.is-custom { background:#fef3c7; color:#92400e; }
.srm-chip > em { opacity:0.75; font-size:0.62rem; font-style:normal; letter-spacing:0.03em; text-transform:uppercase; }
.srm-chipx { min-width:0; padding:0 2px; border:0; background:transparent; color:inherit; line-height:1; opacity:0.6; cursor:pointer; }
.srm-chipx:hover { opacity:1; }
/* The required legend sits directly under the heading, on the left (Erik 2026-09-16). */
.srm-section-with-note { display:flex; flex-direction:column; align-items:flex-start; gap:1px; }
.srm-section-note { color:var(--nm-z500, #71717a); font-size:0.72rem; font-weight:400;
                    letter-spacing:0; text-transform:none; }
.srm-required { border-color:#f0b429 !important; background:#fff; }
.srm-num { box-sizing:border-box; width:5.5rem; text-align:right; }
.srm-distance-inputs { display:inline-flex; align-items:center; gap:6px; min-width:0; }
.srm-distance-inputs > .srm-num { width:7rem; text-align:right; }
.srm-distance-unit { width:4.5rem; }
.srm-ver { box-sizing:border-box; width:11rem; }
.srm-seq { box-sizing:border-box; width:5.5rem; }
.srm-checkrow { align-items:center; }
.srm-modal input.srm-check {
    flex:0 0 16px; box-sizing:border-box;
    width:16px !important; min-width:16px; max-width:16px;
    height:16px !important; min-height:16px; max-height:16px;
    margin:0; padding:0; border-radius:2px; box-shadow:none; cursor:pointer;
}
/* Erik 2026-08-29, AppDevGuidance §99: the generic row-label rule adds 5px of top
   padding to align ordinary labels with their controls. A checkbox row has no taller
   control to align with, so retaining that padding makes the box ride above its words.
   Cancel it here; flex then centres the checkbox and the label's real line box. */
.srm-checkrow > label { cursor:pointer; display:inline-flex; align-items:center;
                        line-height:1.25; margin:0; padding-top:0; }
.srm-modal input.srm-check { align-self:center; vertical-align:middle; }
/* The native Windows checkbox paints its visible square slightly above the input element's
   geometric centre. The flex boxes therefore measured centred while the PAINTED square still
   shared the text's bottom edge (Erik's 2026-08-30 screenshot). Move that paint down by one CSS
   pixel at the checkbox boundary; ordinary labels and every horizontal form edge stay untouched. */
.srm-row.srm-checkrow > input.srm-check { transform:translateY(1px); }
.srm-subsection { flex-basis:100%; margin:10px 0 6px; color:var(--nm-z600, #52525b);
                  font-size:0.78rem; font-weight:600; }
.srm-seg { display:inline-flex; gap:0; overflow:hidden; border:1px solid var(--nm-border, #d4d4d8); border-radius:4px; }
.srm-seg .ts-pw-btn { padding:0 7px; border:0; border-right:1px solid #d0d0d0; background:#fff;
                      color:#999; font-size:0.75rem; line-height:1.9; cursor:pointer; }
.srm-seg .ts-pw-btn:last-child { border-right:0; }
.srm-seg .ts-pw-btn:hover { background:#e0e0e0; }
.srm-seg .ts-pw-btn.active { background:#00E8C3; color:#1a1a1a; font-weight:bold; }
.srm-seg-word { display:none; }
/* Every segmented button carries both labels. Desktop reads the word, the phone layer the letter. */
.srm-seg-abbr { display:none; }
.srm-seg-long { display:inline; }
.srm-repair-planned { display:inline-flex; align-items:center; gap:4px; margin-left:8px; cursor:pointer; }

/* SwrSegmentPickTable's table family (P3.1's srm-ts-*). */
.srm-ts-table { width:100%; max-width:760px; border-collapse:collapse; font-size:var(--nm-font-grid); }
.srm-ts-table th, .srm-ts-table td { border:1px solid var(--nm-border); padding:4px 6px; text-align:left; }
.srm-ts-table th { background:var(--nm-hdr-bg); font-weight:600; color:var(--nm-z950); }
.srm-ts-table tbody tr:hover { background:var(--nm-z50); }
.srm-ts-include { width:48px; box-sizing:border-box; text-align:center !important; }
.srm-ts-include input { width:24px; height:24px; margin:0; accent-color:#2563eb; cursor:pointer; vertical-align:middle; }
.srm-ts-summary { display:none; }
.srm-ts-end-cell { min-width:172px; }
.srm-ts-end-edit { display:flex; flex-direction:column; align-items:flex-start; gap:3px; margin:0; }
.srm-ts-end-select { min-width:88px; height:32px; box-sizing:border-box; border:2px solid #2563eb;
                     border-radius:5px; padding:2px 24px 2px 7px; background:#fff;
                     color:var(--nm-z950, #09090b); font:600 var(--nm-font-grid) var(--nm-font-mono);
                     font-variant-numeric:tabular-nums; cursor:pointer; }
.srm-ts-end-select:focus-visible { outline:2px solid rgba(37,99,235,.32); outline-offset:2px; }
.srm-ts-end-select:disabled { cursor:wait; opacity:.65; }
.srm-ts-end-edit small { max-width:190px; color:#1d4ed8; font-size:0.7rem; font-weight:600; line-height:1.25; }
.srm-ts-end-edit-label { display:none; }
/* Spec 2026-10-01 R6: the comment the report prints for a segment; its own line breaks are kept. */
.srm-ts-table .srm-ts-comment { white-space:pre-line; overflow-wrap:anywhere; min-width:140px; }
/* Erik 2026-10-01, "A for offline hours": hours logged on the device with no Dynamics line yet sit under one
   note row, greyed, and their box cannot be ticked. */
.srm-ts-table .srm-ts-not-synced-note td { background:var(--nm-z50); color:var(--nm-z700); font-weight:600; }
.srm-ts-table .srm-ts-not-synced td { color:var(--nm-z600); font-style:italic; }
.srm-ts-table .srm-ts-not-synced .srm-ts-include input { cursor:not-allowed; }

@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
    /* Phone-layer srm-row, BOTH layered variants verbatim and in order (the later wins for
       conflicting properties, exactly as the modal's single media block ordered them).
       CRITICAL history note kept with the rules: kill the desktop flex-basis on the
       children - in a COLUMN container a `flex:0 0 165px` / `flex:1 1 220px` basis becomes
       a 165-220px HEIGHT (the giant gaps of IMG_1498/1499). The label rule must repeat
       flex:none itself: `.srm-row > label` (0,1,1) outranks `.srm-row > *` (0,1,0). */
    .srm-row { flex-direction:column; align-items:stretch; gap:3px; margin-bottom:12px; }
    .srm-row > * { flex:none; max-width:100%; min-width:0; }
    .srm-row > label { flex:none; width:auto; font-size:0.92rem; font-weight:600;
                       color:var(--nm-z800, #27272a); padding-top:0; }
    .srm-row { flex-direction:column; align-items:stretch; gap:5px; margin-bottom:14px; }
    .srm-row > * { flex:none; max-width:100%; min-width:0; }
    .srm-row > label { flex:none; width:auto; font-size:15px; line-height:1.3; font-weight:700;
                       color:var(--nm-z900); padding-top:0; }

    .srm-input, .srm-area, .srm-loc { box-sizing:border-box; width:100%; }
    /* The `.srm-row > *` flex:none above lost its fight the day P4.5 (2026-08-20) moved this block
       ABOVE the host copies of `.srm-input { flex:1 1 220px }` and `.srm-area { flex:1 1 260px }`:
       same specificity, later position wins, so in this COLUMN row every plain input was 220 px and
       every textarea 260 px tall again (the giant gaps of IMG_1498/1499, back since then; measured on
       NM 1.3.784 staging, 2026-09-17). (0,2,0) outranks both copies wherever they sit. */
    .srm-row > .srm-input, .srm-row > .srm-area { flex:none; }
    /* The rich-text narrative root (SwrNarrativeField's RichTextArea) lost the same fight: 260 px
       tall while a blank narrative's writing room is 400 px, so the root clipped the bottom band, and
       typing there scrolled the root (the toolbar left the box) and the SWR window, putting the typed
       line at the bottom edge (NM 1.3.784 staging, 2026-09-17). overflow:clip makes the root no
       scroll container, so a caret can only scroll the report itself. height:auto !important drops
       the inline height a DESKTOP grip drag stamps on the root (this layout never had the grip; a box
       dragged smaller than its writing room and then narrowed to phone width would otherwise keep a
       hidden band that nothing can reach). The desktop root keeps overflow:hidden: its resize grip
       needs a scroll container, and in this column row a flex basis made that grip inert anyway. The
       full-screen writing room's own !important height (later in this file) still wins here. */
    .srm-row > .nm-richtext { flex:none; height:auto !important; overflow:hidden; overflow:clip; }
    .srm-distance-inputs { display:flex; width:100%; }
    .srm-distance-inputs > .srm-num { flex:1 1 auto; width:auto; }
    .srm-checkrow { flex-direction:row; align-items:center; gap:10px; }
    .srm-checkrow > label { flex:1 1 auto; }
    .srm-modal input.srm-check {
        flex:0 0 28px; width:28px !important; min-width:28px; max-width:28px;
        height:28px !important; min-height:28px; max-height:28px;
    }
    .srm-section-with-note { flex-wrap:wrap; }
    .srm-subsection { font-size:15px; line-height:1.4; }
    .srm-loc > .srm-locbtn { position:static; }
    .srm-fieldnote, .srm-locnote { margin-left:0; font-size:15px; line-height:1.45; }
    .srm-table thead { display:none; }
    .srm-table, .srm-table tbody, .srm-table tr, .srm-table td { display:block; box-sizing:border-box; width:100%; }
    .srm-table tr { position:relative; margin:0 0 12px; padding:10px 12px 8px; border:1px solid var(--nm-ring);
                    border-radius:10px; background:var(--nm-z50); }
    .srm-table td { padding:4px 0; border:0; font-size:16px; line-height:1.35; overflow-wrap:anywhere; }
    .srm-table td[data-label]::before { display:block; margin-bottom:2px; color:var(--nm-z600);
                                        font-size:14px; font-weight:700; line-height:1.2;
                                        text-transform:uppercase; content:attr(data-label); }
    .srm-table .srm-col-qty, .srm-table .srm-col-sn,
    .srm-table .srm-col-cond, .srm-table .srm-col-disp { width:100%; }
    .srm-table .srm-col-note { width:100%; min-width:0; }
    .srm-table .srm-col-x { position:absolute; top:4px; right:4px; width:auto; padding:0; }
    .srm-table .srm-col-x .srm-rowx { display:inline-flex; align-items:center; justify-content:center;
                                     min-width:44px; min-height:44px; font-size:20px; }
    .srm-seg { max-width:100%; }
    .srm-seg .ts-pw-btn { min-width:44px; min-height:44px; padding:7px 11px; font-size:15px; }
    /* 44px touch targets in a stacked card leave no room for words. */
    .srm-seg-long { display:none; }
    .srm-seg-abbr { display:inline; }
    .srm-seg-word { display:inline-block; margin-left:8px; color:var(--nm-z700); font-size:15px; vertical-align:middle; }
    .srm-chip { min-height:36px; padding:5px 8px 5px 11px; font-size:14px; }
    .srm-chipx { min-width:32px; min-height:32px; font-size:18px; }
    .srm-more { min-height:44px; padding:12px 0; font-size:15px; line-height:1.35; }

    /* Phone-layer srm-ts-*: the mobile summary column replaces the six desktop columns. */
    .srm-ts-table { width:100%; max-width:none; table-layout:fixed; }
    .srm-ts-table th, .srm-ts-table td { padding:9px 8px; vertical-align:middle; line-height:1.4; }
    .srm-ts-table th { position:sticky; top:0; z-index:2; background:var(--nm-hdr-bg);
                       font-size:13px; line-height:1.25; }
    .srm-ts-table td { font-size:15px; overflow-wrap:anywhere; }
    .srm-ts-table .srm-ts-desktop { display:none; }
    .srm-ts-table .srm-ts-summary { display:table-cell; }
    .srm-ts-table .srm-ts-include { width:52px; }
    .srm-ts-include input { width:28px; height:28px; }
    .srm-ts-end-edit-mobile { margin-top:8px; padding-top:8px; border-top:1px solid var(--nm-border); }
    .srm-ts-end-edit-label { display:block; color:var(--nm-z700); font-size:14px; font-weight:700; }
    .srm-ts-end-select { min-width:116px; min-height:44px; font-size:16px; }
    .srm-ts-end-edit small { max-width:none; font-size:14px; line-height:1.35; }
}

/* ── Constrained rich-text field (B2's RichTextArea; moved from app.css in P4.5) ─────────
   The editable subtree is JS-owned while focused (AppDevGuidance §54). Styling lives here so
   the reusable component has the same behavior in the Server circuit, the offline WASM
   shell, and the Partner host. */
.nm-richtext {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--nm-border, #a1a1aa);
    border-radius: 4px;
}
.nm-richtext:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
}
.nm-richtext-toolbar {
    display: flex;
    position: relative;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    padding: 4px;
    background: var(--nm-z50, #fafafa);
    border-bottom: 1px solid var(--nm-ring, #e4e4e7);
}
.nm-richtext-format-actions {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    min-width: 0;
}
.nm-richtext-toolbar button {
    min-width: 32px;
    min-height: 30px;
    padding: 3px 7px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--nm-z800, #27272a);
    line-height: 1;
}
.nm-richtext-toolbar button:hover:not(:disabled),
.nm-richtext-toolbar button.is-active {
    border-color: var(--nm-ring-strong, #a1a1aa);
    background: #fff;
}
.nm-richtext-toolbar-separator {
    width: 1px;
    height: 22px;
    margin: 0 2px;
    background: var(--nm-ring, #e4e4e7);
}
/* Text-size buttons (Erik 2026-08-28): the two "A" glyphs differ only in scale. */
.nm-richtext-size-glyph { font-weight: 600; }
.nm-richtext-size-glyph-down { font-size: 0.72em; }
.nm-richtext-size-glyph-up { font-size: 1.15em; }
/* The editor's size ladder rides legacy <font size> markers (execCommand-managed); these
   override the UA font sizing with the model's exact factors — Small ×0.85, Large ×1.25,
   Extra large ×1.5 — and neutralize any other pasted size value to normal, matching the
   serializer. The factors mirror RichTextDocument.ScalePoints for document parity. */
.nm-richtext-editor font { font-size: 1em; }
.nm-richtext-editor font[size="1"] { font-size: 0.85em; }
.nm-richtext-editor font[size="5"] { font-size: 1.25em; }
.nm-richtext-editor font[size="6"] { font-size: 1.5em; }
/* An intake verdict under the editor (a file the browser could not decode), 2026-09-16. */
.nm-richtext-note { margin: 4px 0 0; font-size: 0.85em; color: #b45309; }

.nm-richtext-editor {
    /* Fill the container: a hand-resized box (resize:vertical stamps an inline height on the
       root) keeps every white pixel inside the border editable — no dead strip below the text
       (Kenneth 2026-08-27; spec 2026-08-27 §2.2). In the normal un-dragged state the container
       heights from content, so this distributes nothing and rendering is unchanged. */
    flex: 1 1 auto;
    min-height: calc(2.4em + 10px);
    padding: 7px 9px;
    overflow: auto;
    outline: none;
    color: var(--nm-z950, #09090b);
    background: #fff;
    font-family: var(--nm-font-sans, sans-serif);
    font-size: var(--nm-area-font, 18px);
    line-height: 1.35;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.nm-richtext-editor[data-rich-text-empty="true"]::before {
    content: attr(data-placeholder);
    color: var(--nm-z400, #a1a1aa);
    pointer-events: none;
}
/* Blank narrative fields open a useful writing area in the report. The JS-owned marker
   persists while typing and across re-renders; only Expand enters full-screen writing. */
.nm-richtext[data-nm-richtext-inline-room]:not([data-nm-richtext-max]) .nm-richtext-editor {
    min-height: min(400px, 55dvh);
}
.nm-richtext-editor p,
.nm-richtext-editor h3,
.nm-richtext-editor ul,
.nm-richtext-editor ol { margin: 0 0 0.45em; }
.nm-richtext-editor > :last-child { margin-bottom: 0; }
.nm-richtext-editor h3 { font-size: 1.12em; line-height: 1.25; }
.nm-richtext-editor ul,
.nm-richtext-editor ol { padding-left: 1.55em; }
.nm-richtext.is-readonly { background: var(--nm-z50, #fafafa); }
.nm-richtext.is-readonly .nm-richtext-toolbar { display: none; }
.nm-richtext.is-readonly .nm-richtext-editor { cursor: default; }

/* ── Inline photo figures (2026-08-27 inline-photo spec §5.3) ─────────────────────────
   An anchor renders as an atomic contenteditable=false figure: thumb + caption from
   host-pushed display state, width = the engineer's stored percent of available width
   (default 100%). Tap selects (phone path) and shows direct Crop/Remove controls; there is
   no second-level photo menu. */
.nm-richtext-figure {
    position: relative;
    display: block;
    margin: 6px auto 10px;
    max-width: 100%;
    border: 1px solid var(--nm-ring, #e4e4e7);
    border-radius: 4px;
    padding: 4px;
    background: var(--nm-z50, #fafafa);
    user-select: none;
    -webkit-user-select: none;
}
.nm-richtext-figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 2px;
    -webkit-touch-callout: none;   /* Keep figure selection/actions in-app on iOS. */
    pointer-events: none;          /* clicks land on the figure = select, not the image */
}
.nm-richtext-figure-caption {
    padding: 4px 2px 0;
    font-size: 0.85em;
    line-height: 1.3;
    color: var(--nm-z600, #52525b);
}
/* The figcaption carries only the pending/processing placeholder wording; a resolved inline photo's
   optional caption is the field below it (Erik 2026-09-16), and it prints under the figure. */
.nm-richtext-figure:not(.nm-richtext-figure-pending) .nm-richtext-figure-caption { display: none; }
.nm-richtext-figure-caption-input {
    box-sizing: border-box;
    width: 100%;
    margin-top: 4px;
    padding: 3px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--nm-z700, #3f3f46);
    font: inherit;
    font-size: 0.85em;
    text-align: center;
    user-select: text;
    -webkit-user-select: text;
}
.nm-richtext-figure-caption-input::placeholder { color: var(--nm-z400, #a1a1aa); }
.nm-richtext-figure-caption-input:hover:not(:disabled),
.nm-richtext-figure-caption-input:focus { border-color: var(--nm-ring-strong, #a1a1aa); background: #fff; outline: none; }
.nm-richtext-figure-caption-input:disabled::placeholder { color: transparent; }
.nm-richtext-figure-pending .nm-richtext-figure-caption-input { display: none; }
.nm-richtext-figure-pending {
    min-height: 64px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border-style: dashed;
}
.nm-richtext-figure-pending img { display: none; }
.nm-richtext-figure.nm-richtext-figure-selected { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16); }
/* A photo inside a drag selection shows the selection tint: Delete removes it (2026-09-16). */
.nm-richtext-figure.nm-richtext-figure-in-selection { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35); }
.nm-richtext-figure.nm-richtext-figure-in-selection img { opacity: 0.55; }
.nm-richtext-figure-tools {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none;
    gap: 4px;
    max-width: calc(100% - 12px);
    flex-wrap: wrap;
    justify-content: flex-end;
    padding: 2px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--nm-ring-strong, #a1a1aa);
    border-radius: 6px;
}
.nm-richtext-figure:hover .nm-richtext-figure-tools,
.nm-richtext-figure.nm-richtext-figure-selected .nm-richtext-figure-tools { display: inline-flex; }
/* PowerPoint-style proportional corner grip (Erik 2026-08-27). touch-action:none keeps a
   touch drag resizing instead of scrolling. */
.nm-richtext-figure-resize {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 18px;
    height: 18px;
    display: none;
    cursor: nwse-resize;
    border-right: 3px solid #2563eb;
    border-bottom: 3px solid #2563eb;
    border-bottom-right-radius: 4px;
    touch-action: none;
}
.nm-richtext-figure:hover .nm-richtext-figure-resize,
.nm-richtext-figure.nm-richtext-figure-selected .nm-richtext-figure-resize { display: block; }
.nm-richtext-figure-tools button {
    min-width: 0;
    min-height: 30px;
    padding: 4px 8px;
    border: 1px solid var(--nm-ring-strong, #a1a1aa);
    border-radius: 4px;
    background: transparent;
    color: var(--nm-z800, #27272a);
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}
.nm-richtext-figure-tools button:hover { border-color: var(--nm-ring-strong, #a1a1aa); background: #fff; }
.nm-richtext-file { display: none; }
/* A text-only field's pointer to where photos go (Erik 2026-10-06). Description of work has no photo
   buttons (1.3.877), and opening its empty writing room pushes the Conclusions buttons below out of
   view, so its strip names where photos go. Plain text after the tools; on a narrow desktop toolbar it
   wraps as a whole onto the next line. */
.nm-richtext-media-note {
    flex: 0 1 auto;
    min-width: 0;
    margin: 0 4px;
    color: var(--nm-z600, #52525b);
    font-size: 13px;
    line-height: 1.3;
}
/* Full-screen writing centres the field title over the toolbar (from 900px) and hides the report
   behind the overlay; the note would run under the title there, so it steps aside. */
.nm-richtext[data-nm-richtext-max] .nm-richtext-media-note { display: none; }

/* Full-screen writing mode (spec 2026-08-27 §4.4). State is the JS-owned data-nm-richtext-max
   root attribute — the survives-a-Blazor-re-render pattern of data-rich-text-empty and the
   fitted inline styles. The overlay starts below the environment bar and sits above the SWR
   modal backdrop (z 2000); fitEditor stands down while it is on, so CSS owns the geometry. */
.nm-richtext-toolbar .nm-richtext-maximize {
    margin-left: auto;
    border-color: var(--nm-ring-strong, #a1a1aa);
    background: #fff;
    box-shadow: 0 1px 2px rgba(9, 9, 11, 0.12);
    font-weight: 600;
    cursor: pointer;
}
.nm-richtext-toolbar .nm-richtext-maximize:hover:not(:disabled) {
    border-color: var(--nm-z600, #52525b);
    background: var(--nm-z100, #f4f4f5);
}
.nm-richtext .nm-richtext-max-close { display: none; }
/* Undo/Redo show only in full-screen writing (Erik 2026-08-27); inline keeps the lean bar. */
.nm-richtext .nm-richtext-fullscreen-only { display: none; }
.nm-richtext[data-nm-richtext-max] .nm-richtext-fullscreen-only { display: inline-flex; align-items: center; justify-content: center; }
/* The which-field-am-I-in title: hidden inline. In a roomy full-screen toolbar it is centered
   against the viewport, not merely centered in the leftover space. At constrained widths it
   returns to normal flow beside the exit control so formatting/photo controls cannot overlap it. */
.nm-richtext .nm-richtext-max-title { display: none; }
.nm-richtext[data-nm-richtext-max] .nm-richtext-max-title {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    padding: 0 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--nm-z700, #3f3f46);
    white-space: nowrap;
    pointer-events: none;
}
@media (min-width: 900px) {
    .nm-richtext[data-nm-richtext-max] .nm-richtext-max-title {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin-left: 0;
    }
}
/* Back remains the final, right-aligned toolbar action independently of the centered title.
   On a wrapped narrow toolbar its auto margin still pushes it to the right of its flex line. */
.nm-richtext[data-nm-richtext-max] .nm-richtext-maximize { margin-left: auto; }
.nm-richtext[data-nm-richtext-max] {
    position: fixed;
    top: var(--nm-richtext-vv-top, var(--nm-envbar-h, 0px));
    left: var(--nm-richtext-vv-left, 0px);
    right: auto;
    bottom: auto;
    width: var(--nm-richtext-vv-width, 100dvw) !important; /* beat hand-dragged inline size */
    height: var(--nm-richtext-vv-height, calc(100dvh - var(--nm-envbar-h, 0px))) !important;
    min-height: 0;
    overflow: hidden;
    overflow: clip; /* never a scroll container: focus/scrollIntoView cannot shove the writing room off-screen (§104) */
    z-index: 2600;
    border-radius: 0;
    resize: none;
}
.nm-richtext[data-nm-richtext-max] .nm-richtext-editor {
    flex: 1 1 auto;
    height: auto !important;  /* CSS owns the geometry here; the fit pass cleared its stamp */
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.srm-modal:has(.nm-richtext[data-nm-richtext-max]),
.srm-body:has(.nm-richtext[data-nm-richtext-max]) {
    overflow: hidden !important;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
}
.nm-richtext[data-nm-richtext-max] .nm-richtext-max-open { display: none; }
.nm-richtext[data-nm-richtext-max] .nm-richtext-max-close { display: inline; }

@media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
    .nm-richtext-editor { font-size: max(16px, var(--nm-area-font, 18px)); }
    .nm-richtext-toolbar button { min-width: 44px; min-height: 44px; font-size: 16px; }
}
/* Shared host chrome. Both NM Timesheet and NM Partner consume these primitives so the brand,
   session-action reachability, week-toolbar geometry, tab treatment, timezone note, core time
   selector typography, version placement, and save action cannot drift by host. Dense workspaces
   deliberately grow past the desktop viewport. Keep the session bar pinned to the viewport's
   horizontal edge and clamp its painted width so Enable offline mode, signature, and sign-out
   never travel off-screen with that wide content. */
.nm-mono .nm-toolbar {
    margin: 0 -10px 8px;
    padding: 8px 14px 10px;
    border-bottom: 1px solid var(--nm-ring);
    background: var(--nm-z50);
}
.nm-mono .nm-week-status-row {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}
.nm-mono .nm-home-tabs {
    display: flex;
    gap: 4px;
    margin: 4px 0 2px;
    border-bottom: 1px solid #d4dde6;
}
.nm-mono .nm-home-tab {
    margin-bottom: -1px;
    padding: 6px 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--nm-z500);
    font-family: var(--nm-font-sans);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
}
.nm-mono .nm-home-tab:hover { color: var(--nm-z950); }
.nm-mono .nm-home-tab-active { border-bottom-color: #4f46e5; color: #1b3a52; }
.nm-mono .nm-home-tab:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.nm-mono .nm-btngroup { display: inline-flex; flex: 0 0 auto; }
/* This rule must outrank the generic .nm-mono .hdr-btn rule further down this sheet (moved there
   from the hosts' app.css in program unit 1.9): the shared component owns the joined geometry,
   while generic host buttons legitimately remain rounded. It wins on specificity, not order. */
.nm-mono .nm-btngroup .hdr-btn { margin-left: -1px; border-radius: 0; box-shadow: none; }
.nm-mono .nm-btngroup .hdr-btn:first-child {
    margin-left: 0;
    border-radius: var(--nm-radius-lg) 0 0 var(--nm-radius-lg);
}
.nm-mono .nm-btngroup .hdr-btn:last-child {
    border-radius: 0 var(--nm-radius-lg) var(--nm-radius-lg) 0;
}
.nm-mono .nm-btngroup .hdr-btn:only-child { border-radius: var(--nm-radius-lg); }
/* A management link rendered as an anchor in the shared session row (Partner's admin pointer) keeps the
   button look without the anchor's underline (T3.1c slice B; was Partner's .partner-admin-link). */
.nm-session-link { text-decoration: none; }
.nm-mono .nm-tz-note {
    margin: 0 4px 4px;
    color: var(--nm-z500);
    font-size: var(--nm-font-small);
    font-style: italic;
}
@media (max-width: 640px) {
    .nm-mono .nm-btngroup {
        min-width: 0;
        max-width: 100%;
        flex: 1 1 auto;
        flex-wrap: wrap;
    }
}
.nm-mono .nm-appbar,
.nm-mono .nm-appbar span {
    font-family: var(--nm-font-sans);
}
.nm-mono .nm-appbar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 9px 14px;
    border-bottom: 1px solid var(--nm-ring);
    margin: 0 -10px;
    border-radius: var(--nm-radius-xl) var(--nm-radius-xl) 0 0;
    position: sticky;
    left: 0;
    max-width: 100vw;
    box-sizing: border-box;
}
/* An overlay that hangs from the bar (Partner's Manage Offline sessions panel, OfflineDeviceControls.razor.css)
   has to paint above the page under it. position:sticky makes the bar a stacking context, so the panel's own
   z-index only orders it INSIDE the bar, and positioned content later in the document (the version pill, sticky
   table heads at 2, .srm-head at 12, picker lists at 40) painted over the open panel. The bar is raised only
   while a panel is open inside it: above every page surface (at most 40), below the overlays (500 and up).
   NM renders its panel below the bar and never matches. Rendered proof:
   tools/offline-header-tests/manage-panel-under-bar.test.cjs. */
.nm-mono .nm-appbar:has(.device-panel) { z-index: 50; }
.nm-mono .nm-appbar-logo {
    width: 22px;
    height: 22px;
}
/* The bar is clamped with max-width:100vw, and 100vw COUNTS the classic vertical scrollbar, so
   the bar's right edge sits ~15px outside the visible content edge (36px while the page is
   scrolled fully left, since the bar only pins to left:0 once it scrolls). That put Sign out
   under the scrollbar. Sticky-right gives the action cluster the same right-edge tracking the
   dashboard's Refresh button gets from .nm-stick-right: the group's right edge lands on the
   scrollport's content edge, which excludes the scrollbar, and it is a no-op once the row fits
   (Erik 2026-09-09). Applied to the CLUSTER, not the last button, so the actions move together
   instead of sliding over each other. */
.nm-mono .nm-appbar-actions {
    margin-left: auto;
    min-width: 0;
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    position: sticky;
    right: 0;
}
/* Offline-session action states. The removal ceremony replaces its own button so the row keeps
   one slot: an indeterminate spinner while it runs (section 22.4 -- no measurable progress to
   show), then the ended confirmation, which the next document paints once. Both are status
   text, not controls, so they carry .hdr-btn geometry without its affordances. */
.nm-mono .offline-sync-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: default;
}
/* Erik 2026-10-06: while the ceremony runs the Disable button keeps its own size and shows the spinner in its
   middle; it does not shrink to "Syncing…" and spring back. The label, the spinner and the status text share one
   grid cell: the label still takes its width and height but is not painted, the spinner is centred over it, and
   the status text is for assistive technology only (the button is aria-busy). Partner and NM share this rule. */
.nm-mono .hdr-btn.offline-sync-busy {
    display: inline-grid;
    grid-template-areas: "slot";
    place-items: center;
    opacity: 1;
    cursor: progress;
}
.nm-mono .hdr-btn.offline-sync-busy > * { grid-area: slot; }
.nm-mono .hdr-btn.offline-sync-busy .offline-sync-label { visibility: hidden; }
.nm-mono .hdr-btn.offline-sync-busy .offline-sync-text {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.offline-sync-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    opacity: .75;
    animation: nm-offline-sync-spin .7s linear infinite;
}
@keyframes nm-offline-sync-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .offline-sync-spinner { animation-duration: 2.4s; }
}
.nm-mono .offline-session-ended,
.nm-mono .offline-exit-explanation {
    align-self: center;
    max-width: 100%;
    color: var(--nm-z500);
    font-family: var(--nm-font-sans);
    font-size: var(--nm-font-small);
}
/* Erik 2026-09-18: "make that message go to the left of the buttons, not in-between buttons". OfflineModeAction
   renders the ended notice right after its own action, in the middle of the group, and Partner mounts it inside the
   offline island at that slot (an island adds no wrapper), so no DOM move can put it first on both hosts. The group
   orders it first instead: tools/offline-header-tests measures it under both hosts' sheets at 1280 and 390 px, and
   AppSessionBarRenderTests + PartnerAppSessionBarRenderTests pin that it stays a direct child. */
.nm-mono .nm-appbar-actions > .offline-session-ended {
    order: -1;
}
.nm-app-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    font-family: var(--nm-font-sans);
}
.nm-mono .nm-app-brand .nm-appbar-title {
    font-family: var(--nm-font-sans);
    font-weight: 600;
    font-size: 15px;
    color: var(--nm-z950);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 640px) {
    .nm-mono .nm-appbar {
        flex-wrap: wrap;
        gap: 6px 8px;
        padding: 6px 8px;
    }
    .nm-mono .nm-app-brand { flex: 1 1 0; }
    .nm-mono .nm-appbar-title { font-size: 16px; }
    /* Session controls need their own row: shrinking a nowrap action group below its
       buttons' content width painted Disable offline access over the connection badge. */
    .nm-mono .nm-appbar-actions {
        flex: 1 0 100%;
        margin-left: 0;
        flex-wrap: wrap;
        gap: 6px;
    }
    .nm-mono .nm-appbar-actions > * { flex-shrink: 0; max-width: 100%; }
    .nm-mono .nm-appbar-actions .hdr-btn { min-height: 36px; padding-inline: 8px; }
    /* The full source label remains the badge's accessible name/title. Its compact phone paint
       keeps the brand-trailing status visible above the wrapping session controls. Both
       NM and Partner use this same class and wording contract. */
    .nm-mono .nm-badge.nm-week-chip.nm-data-source-badge {
        flex: 0 0 auto;
        width: auto !important;
        min-width: 0 !important;
        max-width: 112px !important;
        padding: 3px 5px;
        overflow: hidden;
        font-size: 0;
    }
    .nm-mono .nm-data-source-badge::after {
        content: attr(data-compact-label);
        overflow: hidden;
        font-size: 11px;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
    .nm-mono .nm-appbar { flex-wrap: wrap; }
}
/* Right-edge tracking (Erik 2026-09-02). The dense workspaces grow the card past the viewport
   (article.nm-article min-width:fit-content), so a right-docked control at the far end of a
   content-width row — the version pill, the approval dashboard's Refresh button and data-age
   label, the directory-sync note — left the screen as the window narrowed and only came back
   once the phone layer clamped the card at 640px. The appbar's session actions never did,
   because that bar is pinned to the viewport edge above. Sticky-right gives one element the same
   behaviour: it never travels past the viewport's right edge, it stays inside its own row, and it
   is a no-op whenever the row already fits. Hosts opt a control in with .nm-stick-right; the
   shared version pill carries it itself. */
.nm-stick-right {
    position: sticky;
    right: 0;
}
.nm-app-version-pill {
    position: sticky;
    right: 0;
    margin-left: auto;
    padding: 1px 4px;
    border: 1px solid #c8c8c8;
    border-radius: 3px;
    background: #e8e8e8;
    color: #555;
    font-size: .7rem;
    line-height: normal;
}
.nm-mono .nm-time-chrome .hdr-label {
    font-family: var(--nm-font-sans);
    font-size: 14px;
}
.nm-mono .nm-time-chrome .hdr-input,
.nm-mono .nm-time-chrome select.hdr-input {
    font-family: var(--nm-font-sans);
    font-size: 16px;
    height: 34px;
}
.nm-mono .nm-time-chrome .hdr-btn {
    box-sizing: border-box;
    height: 34px;
    min-height: 34px;
}
/* The week control is one joined unit: its arrows must be exactly as tall as the
   taller shared time-chrome input. Keep the numeric field only a little wider
   than two tabular digits and center its value. Scoping this to nm-time-chrome
   leaves the independent DP-ledger week controls unchanged. */
.nm-mono .nm-time-chrome .wk-step {
    height: 34px;
}
.nm-mono .nm-time-chrome .wk-input {
    box-sizing: border-box;
    width: 38px;
    padding-inline: 4px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.nm-time-save-shell {
    display: inline-block;
    margin-top: 4px;
    margin-right: 8px;
}
.nm-time-save-button {
    /* TimeSaveButton must not inherit its geometry accidentally from one host's Bootstrap
       import. These are Bootstrap's btn + btn-sm metrics, which are the canonical NM shape. */
    display: inline-block;
    box-sizing: border-box;
    width: 120px;
    min-height: 31px;
    padding: .25rem .5rem;
    border: 1px solid;
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    user-select: none;
}
/* Canonical destructive action for cancelling selected persisted time. NM Timesheet imports
   Bootstrap and used to get this red outline accidentally; Partner does not import Bootstrap,
   so the same class names fell back to a plain browser button. Own the complete appearance in
   the shared surface instead. This changes presentation only: each host still decides which
   lifecycle state is cancellable. */
.nm-time-cancel-button {
    display: inline-block;
    box-sizing: border-box;
    width: auto;
    min-height: 31px;
    padding: .25rem .5rem;
    border: 1px solid #dc3545;
    border-radius: .25rem;
    color: #dc3545;
    background: #fff;
    font-family: var(--nm-font-sans, sans-serif);
    font-size: .875rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    cursor: pointer;
}
.nm-time-cancel-button:hover:not(:disabled) {
    color: #fff;
    background: #dc3545;
    border-color: #dc3545;
}
.nm-time-cancel-button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(220, 53, 69, .25);
}
.nm-time-cancel-button:disabled {
    color: #dc3545;
    background: #fff;
    opacity: .65;
    cursor: default;
}

/* Canonical NM Rev3 SWR host styles.
   Moved intact from ServiceReportModal on 2026-08-27 so NM Timesheet and NM Partner
   cannot receive different geometry, typography, mobile behavior, or field-state styling.
   Selectors for host-only pickers are inert in the other host and remain presentation-only. */

    /* Starts BELOW the environment bar (--nm-envbar-h, published by App.razor; 0 where no bar
       renders): the bar is sticky at z-index 10000 and used to paint over the modal header. */
    .srm-backdrop { position:fixed; inset:var(--nm-envbar-h, 0px) 0 0 0; background:#fff;
                    display:flex; align-items:stretch; justify-content:stretch; z-index:2000;
                    overflow:hidden; overflow:clip; padding:0; --srm-horizontal-scrollbar-clearance:18px; }
    .srm-backdrop.srm-hidden { display:none; }
    .srm-modal { background:#fff; border:0; border-radius:0;
                 width:100%; max-width:none;
                 height:100%; max-height:100%; overflow:hidden;
                 min-height:0;
                 display:flex; flex-direction:column; box-sizing:border-box; min-width:0;
                 box-shadow:none;
                 font-family:var(--nm-font-sans); color:var(--nm-z950); }
    /* My Reports and the editor are one full-screen SWR workspace, matching the routed Receive
       Report experience. The historical srm-compact class remains markup-compatible but no longer
       shrinks the archive into a floating tile. */
    .srm-modal.srm-compact { width:100%; max-width:none;
                             height:100%; max-height:100%; min-height:0; }
    .srm-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-shrink:0; min-width:0;
                padding:10px 14px; background:#fff; border-bottom:1px solid var(--nm-ring);
                border-radius:0; }
    .srm-title-group { flex:1 1 auto; min-width:0; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
    .srm-title { flex:0 1 auto; min-width:0; font-weight:600; font-size:15px; color:var(--nm-z950); letter-spacing:-0.01em; }
    .srm-x { background:transparent; border:none; color:var(--nm-z500); font-size:1.05rem;
             line-height:1; cursor:pointer; min-width:32px; min-height:32px; padding:0 4px;
             display:inline-flex; align-items:center; justify-content:center; border-radius:var(--nm-radius); }
    .srm-x:hover { color:var(--nm-z950); background:var(--nm-z100); }
    .srm-body { overflow-x:hidden; padding:14px; overflow-y:auto; min-width:0; min-height:0;
                font-size:var(--nm-font-ui); flex:1 1 auto; }
    .srm-foot { display:flex; align-items:center; gap:8px; justify-content:flex-end; flex-shrink:0;
                box-sizing:border-box; min-height:0;
                max-height:calc(100% - 44px); overflow-x:hidden; overflow-y:auto;
                overscroll-behavior:contain; scrollbar-gutter:stable;
                padding:10px 14px calc(10px + env(safe-area-inset-bottom, 0px) + var(--srm-horizontal-scrollbar-clearance, 18px));
                border-top:1px solid var(--nm-ring); background:var(--nm-z50);
                border-radius:0; }
    .srm-foot-empty { display:none; }
    .srm-status { margin-right:auto; margin-left:0; font-size:0.78rem; color:var(--nm-z600); }
    .srm-edit-actions { display:inline-flex; align-items:center; gap:6px; flex:0 0 auto; }
    .srm-phone-only { display:none; }
    /* The signing toggles stack right-aligned immediately left of the action button
       (Erik 2026-08-16) — deliberately NOT .srm-step-note, whose margin-right:auto would
       push them to the footer's far left. */
    /* Erik 2026-08-28: stretch (not flex-end) so both boxes share one left edge - the block
   still sits at the right of the footer, but the checkboxes line up with each other. */
.srm-foot-checks { display:flex; flex-direction:column; align-items:stretch; gap:4px;
                       font-size:0.82rem; color:var(--nm-z600); }
    .srm-foot-checks label { display:inline-flex; align-items:center; gap:5px; cursor:pointer; }

    .srm-note { margin:0 0 12px; padding:7px 11px; border-radius:var(--nm-radius); font-size:0.78rem;
                line-height:1.4; background:#eef2ff; border-left:3px solid #4f46e5; color:#3730a3; }

    .srm-prefill { display:flex; align-items:center; gap:8px; margin:0 0 12px; padding:8px 10px;
                   background:var(--nm-z50); border:1px solid var(--nm-ring); border-radius:var(--nm-radius);
                   flex-wrap:wrap; }
    .srm-prefill-label { font-size:12.5px; font-weight:600; color:var(--nm-z700); }
    .srm-prefill-picker { flex:1 1 240px; min-width:0; }
    .srm-prefill-loading { font-size:0.75rem; color:var(--nm-z500); font-style:italic; }
    .srm-prefill-hint { flex-basis:100%; margin:0; font-size:0.72rem; color:var(--nm-z500); }
    /* On the archive landing surface this is the page's create control, not a nested card. */
    .srm-prefill.srm-prefill-archive { padding:0; background:transparent; border:0; border-radius:0; }

    .srm-section { font-weight:600; font-size:11.5px; text-transform:uppercase; letter-spacing:0.04em;
                   color:var(--nm-z500); margin:16px 0 7px; padding-bottom:3px;
                   border-bottom:1px solid var(--nm-ring); }
    .srm-section:first-of-type { margin-top:0; }
    /* .srm-row / .srm-row > label moved to time-surfaces.css beside SwrNarrativeField (P4.5);
       the modal wrapper still supplies --srm-label-font and every later modal rule that
       touches row children keeps winning by its own position/specificity. */
    .srm-input { flex:1 1 220px; box-sizing:border-box; min-width:0; }
    /* The free-text areas start DELIBERATELY LARGE (Erik 2026-07-24: "initially have the font be
       pretty big… then as more is typed and the height gets to a certain size, then start to
       shrink the font"). ONE knob: nm002m.ui.armAutosize reads the COMPUTED size as its starting
       point and only steps down from here once the text outgrows the modal body.
       ⚠ SPECIFICITY, the whole reason these read tiny today: these boxes carry `hdr-input`, and
       app.css's `.nm-mono .hdr-input` (0,2,0) pins font-size:13px — a bare `.srm-area` (0,1,0)
       silently loses that fight, so the selector below must out-rank it (0,2,1). Same trap the
       phone rule further down documents. */
    /* --nm-area-font is the token the shared RichTextArea editor reads (time-surfaces.css);
       mapping it here keeps the modal's ONE area-size knob true for the rich fields too —
       before 2026-08-27 they only agreed with --srm-area-font by both happening to be 18px. */
    .srm-modal { --srm-area-font:18px; --nm-area-font:var(--srm-area-font);
                 --srm-label-font:14px; --srm-control-font:15px; }
    .nm-mono.srm-modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
    .nm-mono.srm-modal select { font-size:var(--srm-control-font); }
    .srm-modal textarea.srm-area { font-size:var(--srm-area-font); }
    .nm-mono.srm-modal input.srm-workdesc { font-size:var(--srm-area-font) !important; }
    .srm-area { flex:1 1 260px; box-sizing:border-box; min-width:0; resize:vertical;
                min-height:calc(2.4em + 10px);        /* ~2 lines of whatever the base is */
                font-family:var(--nm-font-sans); }

    /* Follow-up details use progressive disclosure: the checkbox is the compact entry point. */
    .srm-fieldset { border:0; padding:0; margin:0; min-width:0; }

    .srm-mat-add { margin:2px 0 10px; max-width:560px; }
    .srm-table { width:100%; border-collapse:collapse; font-size:var(--nm-font-grid); }
    .srm-table th, .srm-table td { border:1px solid var(--nm-border); padding:3px 6px; text-align:left;
                                   vertical-align:middle; }
    .srm-table th { background:var(--nm-hdr-bg); font-weight:600; color:var(--nm-z950); }
    .srm-table td input { width:100%; box-sizing:border-box; }
    .srm-table .srm-col-qty { width:60px; }
    .srm-table .srm-col-sn { width:130px; }
    .srm-table .srm-col-x { width:34px; text-align:center; }
    .srm-rowx { background:transparent; border:none; color:var(--nm-z500); font-size:1rem;
                line-height:1; cursor:pointer; padding:0 4px; }
    .srm-rowx:hover { color:#b91c1c; }
    .srm-empty { color:var(--nm-z500); font-size:0.78rem; font-style:italic; padding:16px 2px; }
    .srm-sig-ok { font-size:0.8rem; font-weight:600; color:#166534; }
    .srm-signote { font-size:0.72rem; color:#b45309; font-weight:600; }
    .srm-step-note { margin-right:auto; color:var(--nm-z600); font-size:0.82rem; }
    /* Own the complete desktop geometry here. NM happens to load Bootstrap's .btn/.btn-sm;
       Partner deliberately does not, so relying on those host classes made the same shared
       two-line action five pixels taller in NM. Phone rules below continue to use height:auto. */
    .srm-step-action { box-sizing:border-box; height:44px; min-height:44px;
                       padding:4px 10px; border:1px solid; font-size:14px;
                       text-align:center; line-height:1.2; }
    .srm-locked { max-width:720px; margin:8px auto; padding:22px; border:1px solid var(--nm-ring-strong);
                  border-radius:var(--nm-radius-xl); background:var(--nm-z50); text-align:center; }
    .srm-locked-mark { width:50px; height:50px; margin:0 auto 10px; display:flex; align-items:center;
                       justify-content:center; border-radius:50%; background:#dcfce7; color:#166534;
                       font-size:27px; font-weight:700; }
    .srm-locked h3 { margin:0 0 8px; font-size:19px; }
    .srm-locked p { margin:6px 0; color:var(--nm-z600); line-height:1.45; }
    .srm-locked-signers { margin-top:12px !important; color:var(--nm-z900) !important; }
    .srm-return-travel { margin-top:18px; padding-top:12px; border-top:1px solid var(--nm-border); text-align:left; }
    .srm-return-travel > summary { cursor:pointer; font-weight:600; padding:6px 0; }
    .srm-return-travel .srm-ts-table { margin:10px 0; }

    /* Awaiting-signature actions: review and reopen share the top context; the send action leads
       with its address beside it; and the paper route remains an explicit "Or" alternative. */
    .srm-await-top-actions { display:flex; align-items:center; justify-content:center; gap:8px;
                             flex-wrap:wrap; margin:6px 0 0; }
    .srm-await-send, .srm-await-upload { position:relative; display:flex; align-items:center; justify-content:center;
                                         gap:10px; flex-wrap:wrap; margin:12px 0 0; }
    .srm-await-action { min-height:42px; font-size:15px; font-weight:600; white-space:nowrap;
                        display:inline-flex; align-items:center; justify-content:center;
                        padding:9px 18px; border-radius:var(--nm-radius-lg, 8px); cursor:pointer; }
    /* Erik 2026-09-16: a visible gap between a busy spinner and its label. */
    .srm-busy-spinner { margin-right:6px; vertical-align:-0.125em; flex:none; }
    .srm-await-action.srm-await-send-action { box-sizing:border-box; width:133px; min-height:42px;
                                              padding:3px 12px; white-space:normal; line-height:1.15; }
    .srm-await-email { font-size:16px; min-height:42px; max-width:340px; flex:1 1 240px; }
    /* Erik 2026-09-02: the signing request takes the same tag-box as "Send Reports to" — every
       address is a removable chip and the add-input sits inside the bordered field, so all the
       recipients are visible at once. Wider than the single box was; the chips wrap inside it. */
    .srm-await-recipients { display:flex; flex:1 1 320px; max-width:min(100%, 560px);
                            min-height:0; padding:0; border:0; text-align:left; }
    .srm-await-recipients .srm-tagbox { width:100%; min-height:42px; }
    .srm-await-recipients .srm-tagbox .emp-picker > input { font-size:16px; min-height:30px; }
    /* Erik 2026-09-04: one line when it fits, centred on the Revoke button; a wrap only when the
       row is genuinely too narrow, and then never inside a date or time (.srm-await-stamp). */
    .srm-await-result { display:flex; align-items:center; justify-content:center; gap:10px;
                        width:min(100%, 680px); margin:10px auto 0; text-align:left; }
    .srm-await-result-copy { flex:1 1 auto; min-width:0; }
    /* Erik 2026-09-02: the receipt is ONE bold line — "Link [copy] sent … to … expires …". */
    .srm-locked .srm-await-sent { margin:0; color:var(--nm-z900, #18181b); font-size:0.9rem;
                                  font-weight:700; line-height:1.5; overflow-wrap:anywhere; }
    .srm-await-sent a { overflow-wrap:anywhere; word-break:break-word; }
    .srm-await-stamp { white-space:nowrap; }
    .srm-await-copy { display:inline-flex; align-items:center; gap:4px; vertical-align:-3px;
                      margin:0 4px 0 2px; padding:2px 5px; border:1px solid var(--nm-z300, #d4d4d8);
                      border-radius:6px; background:#fff; color:var(--nm-z700, #3f3f46);
                      cursor:pointer; line-height:1; font-size:0.72rem; font-weight:600; }
    .srm-await-copy:hover { background:var(--nm-z100, #f4f4f5); }
    .srm-await-copy:focus-visible { outline:2px solid #3b82f6; outline-offset:2px; }
    .srm-await-copy svg { width:14px; height:14px; display:block; }
    .srm-await-copied { color:#166534; }
    .srm-locked .srm-await-history { margin:4px 0 0; color:var(--nm-z600);
                                     font-size:0.76rem; line-height:1.4; }
    .srm-await-revoke { flex:0 0 auto; min-height:42px; white-space:nowrap; }
    .srm-await-or { margin:12px 0 0; font-size:15px; font-weight:600; color:var(--nm-z600); }

    /* Shared signed/stamped-copy attestation dialog, moved from NM's awaiting-signature lane. */
    .srm-rp-backdrop { position:fixed; inset:0; z-index:2999; background:rgba(0,0,0,.18); }
    .srm-rp-panel { position:fixed; top:50%; left:50%; transform:translate(-50%,-50%);
                    z-index:3000; width:min(92vw, 420px); max-height:70vh; overflow-y:auto;
                    background:#fff; border:1px solid var(--nm-ring, #d1d5db); border-radius:10px;
                    box-shadow:0 8px 28px rgba(0,0,0,.28); padding:12px; display:flex;
                    flex-direction:column; gap:8px; }
    .srm-rp-head { font-size:15px; font-weight:600; padding-right:28px; }
    .srm-rp-note { font-size:13px; margin:0; }
    .srm-rp-actions { display:flex; gap:8px; justify-content:flex-end; }
    .srm-rp-input { font-size:16px; padding:8px 10px; border-radius:6px;
                    border:1px solid var(--nm-ring, #d1d5db); width:100%; box-sizing:border-box; }
    .srm-rp-close { position:absolute; top:8px; right:8px; border:0; background:transparent;
                    font-size:16px; line-height:1; cursor:pointer; padding:4px 6px; color:#6b7280; }
    .srm-rp-close:hover { color:#111827; }

    /* The SWR PDF-upload backfill dialog (spec 2026-09-23): a taller rp panel. No transform here: a transformed ancestor
       becomes the containing block of its pickers' pinned (position:fixed) dropdowns (AppDevGuidance §84). */
    .srm-rp-panel.srm-upr-panel { transform:none; top:4vh; left:0; right:0; margin:0 auto;
                                  width:min(96vw, 640px); max-height:92vh; gap:6px; }
    .srm-upr-label { font-weight:600; margin-top:6px; }
    .srm-upr-file { display:flex; align-items:center; gap:8px; flex-wrap:wrap; position:relative; }
    .srm-upr-file-name { font-size:13px; overflow-wrap:anywhere; min-width:0; }
    .srm-upr-picked { color:var(--nm-z600, #4b5563); overflow-wrap:anywhere; }
    .srm-upr-date { max-width:200px; }
    .srm-upr-choice { display:flex; gap:16px; font-size:14px; }
    .srm-upr-segments { max-width:100%; overflow-x:auto; }
    .srm-upr-attest { font-weight:400; display:flex; gap:8px; align-items:flex-start; }
    .srm-upr-lines { margin:0; padding-left:18px; font-size:14px; line-height:1.45; overflow-wrap:anywhere; }
    .srm-upr-receipt-title { font-weight:600; margin:0 0 4px; }
    .srm-upr-summary { resize:vertical; }
    /* The dialog has no label column. The composer indents its field notes by that column and hangs Use GPS in it
       (.srm-loc > .srm-locbtn, absolute, left of the city box); in this panel the button hung outside the panel's edge
       and was clipped (staging, 2026-09-24). Here both sit in the flow, as on a phone. (0,2,0) and (0,3,0) outrank the
       composer's rules at every width and wherever these lines sit. */
    .srm-upr-panel .srm-fieldnote { margin-left:0; }
    .srm-upr-panel .srm-loc > .srm-locbtn { position:static; }
    /* Red is for what refuses (the role="alert" lines). A line that informs, or says what is still missing, is neutral:
       the ceiling, the engineer rule, the copies, the segment note, the not-ready line. */
    .srm-upr-note { margin:0; color:var(--nm-z600, #52525b); font-size:0.75rem; line-height:1.4; }
    .srm-upload-report { margin:6px 0 2px; white-space:normal; text-align:left; height:auto; min-height:28px; }
    @media (max-width: 560px) {
        .srm-rp-panel.srm-upr-panel { top:0; bottom:0; width:100vw; max-height:none; border-radius:0; }
        .srm-rp-panel.srm-upr-panel .hdr-btn { min-height:44px; padding:8px 14px; font-size:16px; }
        .srm-rp-panel.srm-upr-panel .srm-rp-close { min-width:44px; min-height:44px; top:2px; right:2px; font-size:20px; }
        .nm-mono .hdr-btn.srm-upload-report { height:auto; min-height:44px; font-size:15px; }
    }
    /* On a phone the dialog's notes read at the size the composer's notes do there. */
    @media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
        .srm-upr-note { font-size:15px; line-height:1.45; }
    }

    @media (max-width: 560px) {
        .srm-await-send, .srm-await-upload { flex-direction:column; align-items:stretch; }
        .srm-await-action.srm-await-send-action { width:100%; }
        .srm-await-email { max-width:none; }
        .srm-await-recipients { flex-basis:auto; }
        .srm-await-result { flex-direction:column; align-items:stretch; }
        .srm-await-revoke { align-self:flex-end; }
    }

    /* Photos: thumbnail cards with a caption box + remove. */
    .srm-photos-ctl { display:flex; align-items:center; gap:10px; flex-wrap:wrap; flex:1 1 auto; min-width:0; }
    .srm-photos-note { font-size:0.74rem; color:var(--nm-z500); }
    .srm-photos-warn { color:#b45309; }
    .srm-photos { display:flex; flex-wrap:wrap; gap:10px; margin:4px 0 10px; }
    .srm-photo { display:flex; flex-direction:column; gap:4px; width:170px; padding:6px;
                 border:1px solid var(--nm-ring); border-radius:var(--nm-radius); background:var(--nm-z50);
                 position:relative; }
    .srm-photo img { width:100%; height:110px; object-fit:cover; border-radius:3px; }
    .srm-photo-pending { width:100%; height:110px; border-radius:3px; display:flex;
        align-items:center; justify-content:center; text-align:center; font-size:0.74rem;
        color:var(--nm-z500); background:repeating-linear-gradient(45deg, #f3f4f6, #f3f4f6 8px,
        #e5e7eb 8px, #e5e7eb 16px); border:1px dashed var(--nm-ring, #d1d5db); padding:4px;
        box-sizing:border-box; }
    .srm-photo .srm-photo-cap { width:100%; box-sizing:border-box; font-size:0.74rem; }
    .srm-photo .srm-rowx { position:absolute; top:2px; right:2px; background:rgba(255,255,255,0.85);
                           border-radius:3px; }
    /* Print size on the report (2026-10-05 photo-size spec): readout + number, then the presets. */
    .srm-photo-size { display:flex; flex-wrap:wrap; align-items:center; gap:4px; font-size:0.74rem; }
    .srm-photo-size-label { flex:1 1 auto; min-width:0; color:var(--nm-z500); white-space:nowrap; }
    .srm-photo .srm-photo-size-input { width:4.4em; flex:0 0 auto; box-sizing:border-box; font-size:0.74rem; }
    .srm-photo-size-presets { display:flex; gap:3px; flex:1 1 100%; min-width:0; }
    .srm-photo-size-presets > .srm-photo-size-preset { flex:1 1 0; min-width:0; padding:1px 0;
                                                       font-size:0.7rem; }
    .srm-photo-size-presets > .srm-photo-size-preset.is-active { background:var(--nm-z100, #f3f4f6);
                                                                 font-weight:600; border-color:var(--nm-z500, #6b7280); }
    /* The picked vessel, front and centre (phone feedback: the WO text is long; the ship must pop). */
    .srm-vessel { display:flex; flex-direction:column; gap:1px; margin:0 0 12px; padding:8px 11px;
                  background:#f0f9ff; border-left:3px solid #0284c7; border-radius:var(--nm-radius); }
    .srm-vessel-name { font-size:1.05rem; font-weight:700; color:#0c4a6e; letter-spacing:-0.01em; }
    .srm-vessel-sub { font-size:0.75rem; color:var(--nm-z600); overflow-wrap:anywhere; }

    /* Collapsible "More fields" — a native details/summary element so expanding is instant client-side. */
    .srm-more-details { margin:16px 0 4px; border-top:1px solid var(--nm-ring); }
    .srm-more { padding:8px 0; color:var(--nm-z600); font-size:12.5px; font-weight:600; cursor:pointer;
                list-style-position:inside; user-select:none; }
    .srm-more:hover { color:var(--nm-z950); }

    /* WO-load spinner (shown until the picked work order's prefill returns). */
    .srm-loading { display:flex; align-items:center; gap:10px; padding:26px 4px; color:var(--nm-z600); font-size:0.9rem; }
    .srm-spin { width:18px; height:18px; border:2px solid var(--nm-z200, #e4e4e7); border-top-color:var(--nm-z600, #52525b);
                border-radius:50%; display:inline-block; animation:srm-spin 0.7s linear infinite; }
    @keyframes srm-spin { to { transform:rotate(360deg); } }
    /* Inline mini-spinner (vessel banner + More fields summary) while the picked WO's Dynamics
       reads land in the background — the form itself renders and stays interactive throughout. */
    .srm-spin-inline { width:12px; height:12px; border-width:2px; display:inline-block;
                       vertical-align:-1px; margin-left:7px; }
    /* Invalid input (e.g. a bad Send-to email). */
    .srm-invalid { border-color:#dc2626 !important; }
    .srm-fieldnote { flex-basis:100%; margin:0 0 4px 173px; font-size:0.72rem; color:#b91c1c; }
    /* Four aligned columns prevent the Arrival/New fields from shifting with label length. */
    .srm-version-grid { display:grid; grid-template-columns:165px 11rem 165px 5.5rem;
                        align-items:center; gap:6px 8px; margin-bottom:6px; }
    .srm-version-grid > label { font-size:var(--srm-label-font); color:var(--nm-z600); }
    .srm-version-grid > input { min-width:0; }
    /* Main service City: editable city/port plus GPS, then derived region + searchable Country.
       Country remains editable because it narrows city suggestions; its shared autocomplete owns
       the country-alias list and §54 typing freeze (Erik 2026-08-14). */
    .srm-loc { flex:1 1 auto; display:flex; gap:6px; min-width:0; flex-wrap:wrap; position:relative; }
    .srm-loc > input { flex:1 1 auto; min-width:0; }
    /* Use GPS sits OUTSIDE the input, anchored in the label gutter — the same geometry as the
       date field's calendar button (DateBox PickerButtonOutsideLeft) — so the location input
       starts where every other input starts (Erik 2026-08-16). */
    .srm-loc > .srm-locbtn { position:absolute; right:calc(100% + 4px); }
    .srm-loc-inline { flex:0 0 auto; align-self:center; font-size:var(--srm-label-font); color:var(--nm-z600); }
    .srm-loc-derived { flex:0 0 auto; align-self:center; font-size:var(--srm-label-font);
                       color:var(--nm-z700, #3f3f46); white-space:nowrap; }
    .srm-loc-country-label { margin-inline-start:4px; }
    .srm-loc-country { flex:0 1 11rem; min-width:4.5rem; }
    /* Reads as a CONTROL, not a hint (Erik 2026-08-16): same height as .hdr-input (28px,
       app.css), black bold label. */
    .srm-locbtn { flex:0 0 auto; height:28px; padding:0 7px; font-size:0.78rem; font-weight:600;
                  white-space:nowrap; cursor:pointer;
                  border:1px solid var(--nm-z200, #e4e4e7); border-radius:6px; background:var(--nm-z50, #fafafa);
                  color:var(--nm-z950, #09090b); }
    .srm-locbtn:hover:not(:disabled) { background:var(--nm-z100, #f4f4f5); }
    .srm-locbtn:disabled { opacity:0.55; cursor:not-allowed; }
    /* Neutral counterpart to .srm-fieldnote, which is styled as an error. */
    .srm-locnote { flex-basis:100%; margin:0 0 4px 173px; font-size:0.72rem; color:var(--nm-z500, #71717a); }

    /* GPS-denied "Use other device?" slider (Erik 2026-08-16, batch 2): the EmployeeAdmin
       ea-toggle geometry in an affirmative green — YES hands the location to the signing
       phone; it is an offer, not a warning state. */
    .srm-toggle { position:relative; display:inline-flex; align-items:center; gap:6px;
                  cursor:pointer; align-self:center; }
    .srm-toggle input { position:absolute; opacity:0; width:0; height:0; }
    .srm-toggle-track { display:inline-block; position:relative; width:34px; height:18px;
                        background:var(--nm-z300); border-radius:999px; transition:background .15s; }
    .srm-toggle-thumb { position:absolute; top:2px; left:2px; width:14px; height:14px; background:#fff;
                        border-radius:50%; box-shadow:var(--nm-shadow-sm); transition:transform .15s; }
    .srm-toggle input:checked + .srm-toggle-track { background:#2e7d32; }
    .srm-toggle input:checked + .srm-toggle-track .srm-toggle-thumb { transform:translateX(16px); }
    .srm-toggle-state { font-size:var(--srm-label-font); font-weight:600; color:var(--nm-z700); min-width:2em; }

    /* Prefill state: greyed while a field still holds what Dynamics gave it; marked once overridden. */
    .srm-prefilled { background:var(--nm-z50, #fafafa); color:var(--nm-z600, #52525b); }
    .srm-prefill-changed { border-color:#d97706 !important; background:#fffbeb; }
    .srm-pip { flex:0 0 auto; margin-left:6px; padding:1px 6px; border-radius:9px; font-size:0.65rem;
               text-transform:uppercase; letter-spacing:0.03em; background:#fef3c7; color:#92400e; cursor:help; }

    /* Materials: condition + location selectors, and the free-text badge. */
    .srm-col-cond, .srm-col-disp { width:1%; white-space:nowrap; }
    .srm-col-cond select, .srm-col-disp select { width:100%; box-sizing:border-box; }
    .srm-freetext { padding:1px 6px; border-radius:9px; font-size:0.65rem; text-transform:uppercase;
                    letter-spacing:0.03em; background:var(--nm-z100, #f4f4f5); color:var(--nm-z600, #52525b); cursor:help; }

    /* "Send Reports to" is ONE master tag-box (Erik 2026-08-16, batch 2): chips AND the
       add-input share the same bordered field — the EmployeeAdmin ea-tagbox shape, drawn with
       this modal's tokens. The input goes borderless inside; the box carries the focus ring. */
    .srm-tagbox { flex:1 1 auto; min-width:0; display:flex; flex-wrap:wrap; gap:5px;
                  align-items:center; padding:4px 6px; border:1px solid var(--nm-z300);
                  border-radius:8px; background:#fff; min-height:30px; }
    .srm-tagbox:focus-within { border-color:#2e7d32; box-shadow:0 0 0 1px #2e7d3233; }
    .srm-tagbox .emp-picker { flex:1 1 190px; min-width:190px; }
    .srm-tagbox .emp-picker > input { border:none !important; box-shadow:none !important;
                                      background:transparent; outline:none; }
    .srm-engineer-stack { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:6px; }
    .srm-engineer-stack > .srm-tagbox { width:100%; box-sizing:border-box; }

    /* Recipient and engineer chips inside their shared tag-boxes. */
    .srm-chip { display:inline-flex; align-items:center; gap:5px; padding:2px 6px 2px 9px; border-radius:12px;
                font-size:0.78rem; background:var(--nm-z100, #f4f4f5); color:var(--nm-z700, #3f3f46); }
    .srm-chip.is-custom { background:#fef3c7; color:#92400e; }
    .srm-chip > em { font-style:normal; font-size:0.62rem; text-transform:uppercase; letter-spacing:0.03em; opacity:0.75; }
    .srm-chipx { border:0; background:transparent; cursor:pointer; line-height:1; color:inherit; opacity:0.6; padding:0 2px; }
    .srm-chipx:hover { opacity:1; }

    /* Unified current-WO timesheet: one semantic table, compact positional summary on phones. */
    .srm-ts-hint { margin:6px 0 10px; font-size:0.78rem; color:var(--nm-z600); }
    /* The srm-ts-* table family moved to time-surfaces.css beside SwrSegmentPickTable (P4.5). */
    .srm-ts-remarks { width:100%; box-sizing:border-box; resize:vertical; min-height:72px;
                      padding:9px 10px; font-family:var(--nm-font-sans); color:var(--nm-z950);
                      background:#fff; border:2px solid var(--nm-z500); border-radius:var(--nm-radius-lg); }
    .srm-ts-remarks:focus { border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.22); outline:none; }

    /* Required fields: an asterisk on the label, a tinted edge while the box is still empty. */
    /* .srm-req / .srm-reqlabel moved to time-surfaces.css beside SwrNarrativeField (P4.5). */
    .srm-section-with-note { display:flex; flex-direction:column; align-items:flex-start; gap:1px; }
    .srm-section-note { font-size:0.72rem; font-weight:400; text-transform:none; letter-spacing:0;
                        color:var(--nm-z500, #71717a); }
    .srm-required { border-color:#f0b429 !important; background:#fff; }

    /* Numeric distance box: sized snugly for an 8-digit value, never the whole row
       (Erik 2026-07-14: the old 7.5rem was about double what the content needs). */
    .srm-num { width:5.5rem; box-sizing:border-box; text-align:right; }
    /* Software-version / database-sequence boxes (Erik 2026-07-14): short fixed widths that fit
       their real content — a version is ≤20 chars, a sequence ≤6. */
    .srm-ver { width:11rem; box-sizing:border-box; }
    .srm-seq { width:5.5rem; box-sizing:border-box; }
    /* Fixed-width identifier boxes — sized to the value, so a 7-digit IMO doesn't sit in a 600px field. */
    .srm-w4  { width:5rem;  box-sizing:border-box; }
    .srm-w9  { width:8.5rem; box-sizing:border-box; }
    .srm-w16 { width:13rem; box-sizing:border-box; }

    /* Follow-up. */
    .srm-checkrow { align-items:center; }
    .srm-modal input.srm-check {
        flex:0 0 16px; box-sizing:border-box;
        width:16px !important; min-width:16px; max-width:16px;
        height:16px !important; min-height:16px; max-height:16px;
        margin:0; padding:0; border-radius:2px; box-shadow:none; cursor:pointer;
    }
    .srm-checkrow > label { cursor:pointer; }
    .srm-subsection { flex-basis:100%; margin:10px 0 6px; font-size:0.78rem; font-weight:600;
                      color:var(--nm-z600, #52525b); }

    /* Condition / location segmented buttons — the timesheet's S/P/W control, reused verbatim. */
    .srm-seg { display:inline-flex; gap:0; border:1px solid var(--nm-border, #d4d4d8); border-radius:4px; overflow:hidden; }
    .srm-seg .ts-pw-btn { border:none; background:#fff; padding:0 7px; font-size:0.75rem; cursor:pointer;
                          color:#999; line-height:1.9; border-right:1px solid #d0d0d0; }
    .srm-seg .ts-pw-btn:last-child { border-right:none; }
    .srm-seg .ts-pw-btn:hover { background:#e0e0e0; }
    .srm-seg .ts-pw-btn.active { background:#00E8C3; color:#1a1a1a; font-weight:bold; }
    /* The selected condition/location spelled out as a WORD beside the letter buttons — on a phone
       there's no hover, so N/U/D + I/P/L alone were a riddle (Erik, IMG_1506). Desktop keeps the
       title tooltips and hides the word. */
    .srm-seg-word { display:none; }
    .srm-seg-abbr { display:none; }
    .srm-seg-long { display:inline; }

    /* On-device report history (compact view): one row per draft/report, status chip on the right. */
    .srm-hist { display:flex; flex-direction:column; gap:6px; margin:4px 0 8px; }
    .srm-hist-row { display:flex; align-items:center; gap:10px; padding:8px 10px; cursor:pointer;
                    border:1px solid var(--nm-ring); border-radius:var(--nm-radius); background:var(--nm-z50); }
    .srm-hist-row:hover { background:var(--nm-z100); }
    .srm-hist-main { display:flex; flex-direction:column; min-width:0; flex:1 1 auto; }
    .srm-hist-vessel { font-weight:600; font-size:0.85rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .srm-hist-sub { font-size:0.72rem; color:var(--nm-z500); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .srm-hist-desc { font-size:0.72rem; color:var(--nm-z600, #52525b); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .srm-hist-chip { flex:0 0 auto; font-size:0.68rem; font-weight:600; padding:2px 8px; border-radius:999px;
                     background:#eff6ff; color:#1d4ed8; border:1px solid #bfdbfe; }
    .srm-hist-chip.srm-hist-final { background:#f0fdf4; color:#15803d; border-color:#bbf7d0; }
    /* A2 archive chips: a live-Dynamics search hit (tap = download), and the "available
       offline on this device" marker (= the model blob exists, spec D2). */
    .srm-hist-chip.srm-hist-dyn { background:#fdf4ff; color:#a21caf; border-color:#f5d0fe; }
    .srm-hist-chip.srm-hist-off { background:var(--nm-z100); color:var(--nm-z500); border-color:var(--nm-ring); }
    .srm-hist-foot { display:flex; align-items:center; justify-content:space-between; gap:10px;
                     margin-top:10px; flex-wrap:wrap; }
    /* The removal question, asked in the page inside the tile or under the footer that asked (AppDevGuidance §49:
       an installed PWA answers window.confirm with false and never shows it). */
    .srm-confirm { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:8px;
                   margin:0; padding:8px 10px; border:1px solid var(--nm-amber);
                   border-radius:var(--nm-radius); background:#fffbeb; color:var(--nm-z900); }
    .srm-confirm-text { flex:1 1 220px; margin:0; font-size:0.8rem; line-height:1.4; }
    .srm-confirm-actions { display:flex; flex:0 0 auto; gap:8px; }
    .srm-hist-foot + .srm-confirm { margin-top:8px; }
    .srm-confirm.srm-confirm-top { margin:2px 0 8px; }
    /* A row's question lives INSIDE its tile (Erik 2026-09-21: "the message needs to be inside the report tile"; a
       strip under the row sat between two HANZE GENDT tiles with the same WO and date and read as either one's). The
       asking tile wraps and the question takes a full-width line under the title and badges. The report line keeps
       the widths it had: with the title column's basis at 0 a long title still ellipsizes beside its chips instead of
       pushing them onto a line of their own. The strip states border-box (§49.6): Partner loads no global border-box,
       and a 100% basis plus padding and border would run past the tile there. It resets the tile's pointer cursor. */
    .srm-hist-row.srm-hist-asking { flex-wrap:wrap; }
    .srm-hist-asking > .srm-hist-main { flex-basis:0; }
    .srm-hist-row > .srm-confirm { flex:1 0 100%; box-sizing:border-box; min-width:0; cursor:auto; }
    .srm-myrep-bar { display:flex; gap:6px; flex-wrap:wrap; align-items:center; margin:4px 0 8px; }
    .srm-myrep-text { flex:1 1 180px; min-width:140px; box-sizing:border-box; }
    .srm-myrep-filter { display:inline-flex; align-items:center; gap:4px; font-size:0.78rem; color:var(--nm-z600); }
    .srm-myrep-date { flex:0 1 140px; min-width:120px; box-sizing:border-box; }
    /* The date control's wrapper. Everywhere except the phone layer it generates NO box, so the control
       stays the bar's own flex item exactly as before. The phone layer below makes it the visible field. */
    .srm-myrep-datebox { display:contents; }

    /* Employee-name picker — same shape as the material picker's dropdown. */
    .emp-picker { position:relative; flex:1 1 auto; min-width:0; }
    .emp-picker > input { width:100%; box-sizing:border-box; }
    .emp-picker-list { position:absolute; z-index:20; left:0; right:0; top:100%; margin:2px 0 0; padding:0;
                       list-style:none; max-height:220px; overflow-y:auto; background:#fff;
                       border:1px solid var(--nm-z200, #e4e4e7); border-radius:6px;
                       box-shadow:0 6px 18px rgba(0,0,0,0.08); }
    .emp-picker-item { padding:6px 10px; cursor:pointer; font-size:0.85rem; }
    .emp-picker-item.is-active, .emp-picker-item:hover { background:var(--nm-z100, #f4f4f5); }

    /* ── Phone layout (≤640px): plain CSS media query — no JS viewport detection needed. Labels move
       ABOVE their inputs (full-width, bigger), fixed-width boxes stretch, the modal goes edge-to-edge,
       and inputs hold 16px font so iOS doesn't zoom-jump on focus. The pattern to copy for other views. */
    @media (max-width: 640px), (max-width: 1024px) and (pointer: coarse) {
        /* The phone layer restates overflow on its own, so it must clip too (§104): on the live
           1.3.724 page this override still computed as hidden. */
        .srm-backdrop { padding:0; overflow:hidden; overflow:clip; }
        .srm-modal, .srm-modal.srm-compact { width:100%; max-width:none; height:100%; max-height:100%;
                                             min-height:0; border:0; border-radius:0; font-size:16px; }
        .srm-seg-word { display:inline-block; margin-left:8px; font-size:0.85rem; color:var(--nm-z700, #3f3f46);
                        vertical-align:middle; }
        .srm-head, .srm-foot { border-radius:0; }
        .srm-body { overflow-x:hidden; }   /* nothing may force sideways scrolling on a phone */
        /* The phone-layer .srm-row rules (both layered variants) moved to time-surfaces.css
           with the family (P4.5) — same media condition, same internal order. */
        .srm-input, .srm-area, .srm-loc { width:100%; box-sizing:border-box; }
        .srm-checkrow { flex-direction:row; align-items:center; }
        .srm-checkrow > label { flex:1 1 auto; }
        /* 16px inputs stop iOS's zoom-on-focus (the zoom that shoved fields off-screen). The compound
           .nm-mono.srm-modal (0,2,x) outranks the app-wide `.nm-mono .hdr-input` 13px rule — a bare
           `.hdr-input` here silently loses that fight (measured: computed stayed 13px). */
        .nm-mono.srm-modal input, .nm-mono.srm-modal textarea, .nm-mono.srm-modal select { font-size:16px; }
        /* …except the free-text areas, which keep the deliberately large start size. Still well
           above 16px, so the iOS-zoom guard above holds; the autosize shrinks them as the text
           grows and floors AT 16px on phones (nm002m-ui.js) so the zoom guard survives that too.
           (0,3,1) — it has to out-rank the 16px rule right above, which is (0,2,1). */
        .nm-mono.srm-modal textarea.srm-area { font-size:var(--srm-area-font); }
        /* Short fixed-width boxes (Miles/IMO/hull/BU) KEEP their natural width — a full-width box for a
           3-digit number reads wrong (Erik, IMG_1500). They fit a 375px column comfortably. */

        /* Materials table → stacked cards: one bordered island per material, each field on its own line
           with a small heading (the desktop 7-column table can't fit a phone; the Qty box was unusable). */
        .srm-table thead { display:none; }
        .srm-table, .srm-table tbody, .srm-table tr, .srm-table td { display:block; width:100%; box-sizing:border-box; }
        .srm-table tr { border:1px solid var(--nm-ring); border-radius:8px; margin:0 0 10px;
                        padding:8px 10px 6px; background:var(--nm-z50); position:relative; }
        .srm-table td { border:none; padding:3px 0; }
        .srm-table td[data-label]::before { content:attr(data-label); display:block; font-size:0.72rem;
                                            font-weight:600; color:var(--nm-z600); margin-bottom:1px; }
        .srm-table .srm-col-qty, .srm-table .srm-col-sn, .srm-table .srm-col-cond, .srm-table .srm-col-disp { width:100%; }
        .srm-table .srm-col-note { width:100%; min-width:0; }
        .srm-table .srm-col-x { position:absolute; top:4px; right:4px; width:auto; padding:0; }
        .srm-prefill { flex-direction:column; align-items:stretch; }
        .srm-prefill-picker { flex:none; }
        .srm-vessel-name { font-size:1.2rem; }
        .srm-vessel-sub { overflow-wrap:anywhere; }
        /* Keep Back and Close anchored while title + edit history share the center cell. */
        .srm-head { display:grid; grid-template-columns:auto minmax(0, 1fr) 44px;
                    grid-template-areas:"back title-actions close";
                    gap:10px; align-items:center; min-height:56px; padding:6px 12px;
                    box-sizing:border-box; }
        .srm-title-group { grid-area:title-actions; gap:6px; }
        .srm-title { font-size:18px; line-height:1.25; min-width:0; }
        .srm-title-group .hdr-btn { min-height:36px; height:auto; padding:5px 9px; font-size:14px; }
        .srm-x { grid-area:close; min-width:44px; min-height:44px; padding:0; font-size:20px; }
        .srm-back { grid-area:back; min-height:44px; height:auto; padding:8px 12px; font-size:15px; }

        .srm-body { overflow-x:hidden; min-width:0; padding:12px; overscroll-behavior:contain;
                    -webkit-overflow-scrolling:touch; }
        .srm-section { font-size:15px; line-height:1.3; margin:18px 0 9px; padding-bottom:5px; }
        .srm-note, .srm-locnote, .srm-fieldnote, .srm-prefill-hint, .srm-prefill-loading,
        .srm-empty, .srm-photos-note, .srm-signote, .srm-section-note {
            font-size:15px; line-height:1.45;
        }
        .srm-fieldnote, .srm-locnote { margin-left:0; }

        /* Blank boxes must read as controls before focus. The 16px floor also stops iOS from
           zooming the page when a field receives focus. */
        .nm-mono.srm-modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
        .nm-mono.srm-modal textarea,
        .nm-mono.srm-modal select {
            min-height:48px; padding:10px 12px; font-size:16px; color:var(--nm-z950);
            background:#fff; border:2px solid var(--nm-z500); border-radius:8px;
            box-sizing:border-box; box-shadow:var(--nm-shadow-sm); outline:none;
        }
        .nm-mono.srm-modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):focus,
        .nm-mono.srm-modal textarea:focus,
        .nm-mono.srm-modal select:focus {
            border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.22);
        }
        .nm-mono.srm-modal textarea.srm-area { font-size:var(--srm-area-font); }

        /* (second layered .srm-row phone variant moved with the family — P4.5) */
        .srm-input, .srm-area, .srm-loc { width:100%; box-sizing:border-box; }
        .srm-checkrow { flex-direction:row; align-items:center; gap:10px; }
        .srm-checkrow > label { flex:1 1 auto; }
        .srm-modal input.srm-check {
            flex:0 0 28px; width:28px !important; min-width:28px; max-width:28px;
            height:28px !important; min-height:28px; max-height:28px;
        }
        .srm-version-grid { grid-template-columns:minmax(0, 1fr); gap:5px; margin-bottom:14px; }
        .srm-version-grid > label { font-size:15px; line-height:1.3; font-weight:700; color:var(--nm-z900); }
        .srm-version-grid > input { width:100%; max-width:100%; }
        .srm-section-with-note { flex-wrap:wrap; }
        .srm-subsection, .srm-sig-ok { font-size:15px; line-height:1.4; }
        .srm-body .btn, .srm-body .hdr-btn { min-height:44px; height:auto;
                                            padding:8px 12px; font-size:15px; }
        .srm-locbtn { min-height:44px; height:auto; padding:8px 5px; font-size:15px; }
        /* Narrow/touch layouts keep the GPS button in-flow, exactly like the datebox fallback. */
        .srm-loc > .srm-locbtn { position:static; }

        /* Work-order picker results use the full width and wrap instead of hiding their useful text. */
        .srm-prefill { flex-direction:column; align-items:stretch; gap:6px; padding:12px; }
        .srm-prefill-label { font-size:15px; line-height:1.3; color:var(--nm-z900); }
        .srm-prefill-picker { flex:none; width:100%; }
        .srm-prefill-picker .coa { width:100%; }
        .nm-mono.srm-modal .coa-row { min-height:44px; padding:9px 11px; box-sizing:border-box;
                                      flex-direction:column; align-items:flex-start; gap:2px; font-size:15px; }
        .nm-mono.srm-modal .coa-id { white-space:normal; overflow:visible; text-overflow:clip;
                                     overflow-wrap:anywhere; }
        .nm-mono.srm-modal .coa-cust { max-width:none; font-size:14px; white-space:normal;
                                       overflow:visible; text-overflow:clip; }
        .nm-mono.srm-modal .coa-empty { min-height:44px; padding:10px 12px; box-sizing:border-box;
                                        font-size:15px; }

        /* My Reports is a full-screen archive, with visible filters and non-ellipsized report cards.
           One filter per row, each the full width of the list (Erik 2026-09-18, iPhone).

           A NATIVE iOS DATE CONTROL IS SIZED AS content-box (AppDevGuidance §85). Measured on Erik's Brave
           screenshot of a 402 px screen: the search box ran 10.0-391.7, both date boxes started at 10.0 and
           had no right border on the screen at all, and the centred date text put their right edge at about
           413.7 — each box was its row plus 22 px, and 22 = 2 x 9 px horizontal padding + 2 x 2 px border,
           the two values the phone control rules below give every field. So `width:100%` became the CONTENT
           width and the padding and border were added outside it. (The same behaviour is what kept the
           control at about 197 px in the earlier two-column layout.)

           The fix puts the visible box on a WRAPPER and strips the control inside it: with padding 0 and
           border 0 content-box and border-box give the same width, so it does not depend on WebKit honouring
           appearance:none. The wrapper carries the search box's own border, radius, background, shadow,
           horizontal padding and height at both phone layers, and its focus treatment through :focus-within.
           Chromium sizes date controls as border-box and never showed any of this; the rendered check models
           both measured behaviours (tools/swr-offline-save-tests/myrep-date-filters-fit.test.cjs). */
        .srm-myrep-bar { display:grid; grid-template-columns:minmax(0, 1fr);
                         gap:10px; align-items:stretch; margin:8px 0 12px; }
        .srm-myrep-text { grid-column:1 / -1; width:100%; min-width:0; }
        .srm-myrep-filter { display:flex; flex-direction:column; align-items:stretch; gap:4px;
                            font-size:15px; line-height:1.3; font-weight:700; color:var(--nm-z900); }
        .srm-myrep-date { flex:none; width:100%; min-width:0; }
        /* Let the label/grid item shrink too and cap the control to its row where the browser allows it;
           iOS still keeps the content width, which a full-width row always has room for. */
        .srm-myrep-filter { min-width:0; width:100%; }
        /* (0,3,0). The `padding-inline:6px` this rule used to carry never applied — the phone control rule
           below is (0,6,1) and won — which is why the arithmetic above reads 9 px. The padding now belongs
           to the wrapper, and the control's own padding is set to 0 by a rule that CAN win. */
        .nm-mono.srm-modal .srm-myrep-date { width:100%; max-width:100%; min-width:0; }
        .srm-myrep-datebox { display:block; box-sizing:border-box; width:100%; min-width:0; overflow:hidden;
                             min-height:48px; padding:10px 12px; background:#fff;
                             border:2px solid var(--nm-z500); border-radius:8px;
                             box-shadow:var(--nm-shadow-sm); }
        .srm-myrep-datebox:focus-within { border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.22); }
        /* (0,7,1) — it HAS to out-rank the phone control rule's (0,6,1), in this layer and in the narrower
           one further down, or the control keeps the padding and border that caused the overflow. */
        .nm-mono.srm-modal .srm-myrep-datebox
            input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]) {
            -webkit-appearance:none; appearance:none; display:block;
            /* min-height, not 0: with appearance:none iOS gives an EMPTY date control no content height, and the
               picker's Clear empties it, which would leave nothing to tap. 1.25em of 16 px is 20 px, inside the
               22 px the 40 px wrapper has for content (40 - 2 x 7 padding - 2 x 2 border), so the wrapper keeps
               the search box's height. Padding and border stay 0, so this cannot widen the control. */
            width:100%; max-width:100%; min-width:0; height:auto; min-height:1.25em;
            margin:0; padding:0; border:0; border-radius:0;
            background:transparent; box-shadow:none; font-size:16px;
        }
        /* Its own rule, never in a selector list: an engine that does not know this pseudo-element would
           throw the whole grouped rule away. */
        .srm-myrep-date::-webkit-date-and-time-value { text-align:left; }
        .srm-myrep-bar > .srm-locnote { grid-column:1 / -1; }
        .srm-hist { gap:10px; }
        /* A wrapping row, not fixed grid columns (Erik 2026-09-17: a three-chip row stacked "offline"
           letter by letter and pushed ✕ off the card). Chips keep flex:0 0 auto, so a short chip is never
           narrower than its word; a long one takes its own line and wraps between words. */
        .srm-hist-row { display:flex; flex-wrap:wrap; align-items:center;
                        gap:8px; min-height:88px; padding:11px 12px; }
        .srm-hist-main { flex:1 0 100%; gap:3px; }
        .srm-hist-vessel { font-size:16px; white-space:normal; overflow:visible; text-overflow:clip;
                           line-height:1.35; overflow-wrap:anywhere; }
        .srm-hist-sub { font-size:15px; white-space:normal; overflow:visible; text-overflow:clip;
                        line-height:1.4; overflow-wrap:anywhere; }
        .srm-hist-chip { min-height:32px; display:inline-flex; align-items:center; justify-content:center;
                         justify-self:start; box-sizing:border-box; padding:5px 9px; font-size:14px;
                         line-height:1.2; white-space:normal; text-align:center; }
        .srm-hist-row .srm-rowx { min-width:44px; min-height:44px; display:inline-flex;
                                  align-items:center; justify-content:center; margin-left:auto; font-size:20px; }
        .srm-hist-row button.srm-hist-chip-action { min-height:44px; }
        /* Spec R5: the Email ⚠ sheet is read on a phone with no hover. Phone-size type and 44 px targets, winning
           over the later .nm-mono .hdr-btn density rule by specificity (0,3,0), measured in a 390 px harness. */
        .srm-rp-panel.srm-badge-detail .srm-rp-head { font-size:17px; line-height:1.3; }
        .srm-rp-panel.srm-badge-detail .srm-rp-note,
        .srm-rp-panel.srm-badge-detail .srm-badge-detail-facts { font-size:15px; line-height:1.4; }
        .srm-rp-panel.srm-badge-detail .hdr-btn { min-height:44px; padding:8px 14px; font-size:16px; }
        .srm-rp-panel.srm-badge-detail .srm-rp-close { min-width:44px; min-height:44px; top:2px; right:2px;
                                                       font-size:20px; }
        .srm-hist-foot { font-size:15px; }
        /* The removal question reads at list size; Cancel and Continue share one full-width row at the touch height
           of the other in-page confirmation (.ts-confirm-actions). (0,3,0) on purpose: `.nm-mono .hdr-btn`
           ({ flex:0 0 auto; height:28px }) sits later in this file at (0,2,0) and won the first version of this rule
           (measured: 61 px and 76 px buttons at the left of a 370 px strip). */
        .srm-confirm-text { flex-basis:100%; font-size:15px; line-height:1.35; }
        .srm-confirm-actions { flex:1 1 100%; }
        .srm-confirm .srm-confirm-actions > .hdr-btn { flex:1 1 0; justify-content:center; min-height:44px;
                                                       height:auto; font-size:15px; }
        /* The asking tile's report text keeps its own first line here, as in every other tile. At (0,3,0) this
           outranks the desktop zero basis of the asking title column (0,2,0) wherever either rule sits. */
        .srm-hist-row.srm-hist-asking > .srm-hist-main { flex:1 0 100%; }

        /* Material rows remain stacked cards, now with readable values, labels and controls. */
        .srm-table tr { border-radius:10px; margin-bottom:12px; padding:10px 12px 8px; }
        .srm-table td { padding:4px 0; font-size:16px; line-height:1.35; overflow-wrap:anywhere; }
        .srm-table td[data-label]::before { font-size:14px; line-height:1.2; font-weight:700;
                                            margin-bottom:2px; text-transform:uppercase; }
        .srm-table .srm-col-x .srm-rowx { min-width:44px; min-height:44px; display:inline-flex;
                                         align-items:center; justify-content:center; font-size:20px; }
        .srm-seg { max-width:100%; }
        .srm-seg .ts-pw-btn { min-width:44px; min-height:44px; padding:7px 11px; font-size:15px; }
        .srm-seg-long { display:none; }
        .srm-seg-abbr { display:inline; }
        .srm-seg-word { display:inline-block; margin-left:8px; font-size:15px;
                        color:var(--nm-z700); vertical-align:middle; }

        .nm-mono.srm-modal .material-picker-item { min-height:48px; padding:10px 12px;
                                                   grid-template-columns:1fr; gap:2px; font-size:15px; }
        .nm-mono.srm-modal .material-picker-item .mp-desc { white-space:normal; overflow:visible;
                                                            text-overflow:clip; overflow-wrap:anywhere; }
        .nm-mono.srm-modal .material-picker-empty { padding:10px 12px; font-size:15px; line-height:1.4; }
        .nm-mono.srm-modal .material-picker-custom { min-height:44px; padding:8px 10px; font-size:15px; }
        .nm-mono.srm-modal .material-picker-pager { min-height:48px; padding:6px 8px; font-size:14px; }
        .nm-mono.srm-modal .material-picker-pager button { min-height:44px; padding:7px 10px; font-size:14px; }
        .nm-mono.srm-modal .material-picker-typed { height:48px; padding:0 12px; font-size:15px; line-height:47px; }
        .nm-mono.srm-modal .material-picker-pager.mp-above-typed { bottom:48px; }
        .emp-picker-item { min-height:44px; padding:10px 12px; box-sizing:border-box; font-size:15px; }

        .srm-chip { min-height:36px; padding:5px 8px 5px 11px; font-size:14px; }
        .srm-chipx { min-width:32px; min-height:32px; font-size:18px; }
        .srm-ts-hint { font-size:15px; line-height:1.45; }
        /* (phone-layer srm-ts-* table rules moved with the family — P4.5) */
        .nm-mono.srm-modal textarea.srm-ts-remarks { min-height:96px; padding:10px 12px; font-size:16px; }
        .srm-vessel-name { font-size:19px; }
        .srm-vessel-sub { font-size:15px; line-height:1.35; overflow-wrap:anywhere; }
        .srm-photos { flex-direction:column; }
        .srm-photo { width:100%; box-sizing:border-box; padding:8px; }
        .srm-photo img { height:auto; max-height:240px; }
        .srm-photo .srm-rowx { min-width:44px; min-height:44px; font-size:20px; }
        /* Phone: 16px keeps iOS from zooming the field; the presets are full tap targets. */
        .srm-photo-size { font-size:15px; }
        .srm-photo .srm-photo-size-input { width:5em; min-height:44px; font-size:16px; }
        .srm-photo-size-presets > .srm-photo-size-preset { min-height:44px; font-size:15px; }

        .srm-foot { flex-wrap:wrap;
                    padding:10px 12px calc(10px + env(safe-area-inset-bottom, 0px) + var(--srm-horizontal-scrollbar-clearance, 18px)); }
        .srm-foot .srm-status { flex:1 0 100%; margin:0; font-size:15px; line-height:1.35; }
        /* On a phone the stacked toggles take their own full-width row above the button. */
        .srm-foot .srm-foot-checks { flex:1 0 100%; align-items:flex-start; gap:8px;
                                     font-size:15px; }
        .srm-foot-checks input[type="checkbox"] { width:22px; height:22px; }
        .srm-foot .btn, .srm-foot .hdr-btn { min-height:44px; height:auto; padding:8px 14px; font-size:16px; }
        .srm-foot .srm-step-note { flex:1 0 100%; margin:0; font-size:15px; line-height:1.35; }
        .srm-foot .srm-step-action { min-height:48px; flex:1 1 210px; padding:10px 14px;
                                     font-size:16px; white-space:normal; line-height:1.25; }
        .srm-locked { margin:0; padding:18px 14px; }
        .srm-more { min-height:44px; padding:12px 0; font-size:15px; line-height:1.35; }
    }

/* Phone SWR workspace repair (2026-08-31): portrait width or a shallow landscape viewport.
   Roomy tablets retain the layout above. The modal is the one bounded scroller, so the footer
   follows the final field instead of permanently consuming the writing viewport. Explicit
   field-container hints fall through to this scroll owner in time-surfaces.js. */
@media (max-width: 640px), (max-width: 960px) and (max-height: 500px) {
    .srm-modal, .srm-modal.srm-compact {
        overflow-x:hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
    .srm-head {
        position: sticky;
        top: 0;
        z-index: 12;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) 32px;
        grid-template-areas:
            "back title close"
            "actions actions actions";
        gap: 4px 6px;
        min-height: 0;
        padding: 5px 8px 6px;
    }
    .srm-head:not(:has(> .srm-back)) {
        grid-template-columns: minmax(0, 1fr) 32px;
        grid-template-areas:
            "title close"
            "actions actions";
    }
    .srm-title-group { display: contents; }
    .srm-title { grid-area: title; font-size: 16px; line-height: 1.2; }
    .srm-title-group .srm-edit-actions {
        grid-area: actions;
        display: flex;
        flex: none;
        flex-wrap: nowrap;
        gap: 4px;
        min-width: 0;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: thin;
    }
    .srm-title-group .srm-edit-actions > .hdr-btn {
        flex: 0 0 auto;
        width: auto;
        height: 30px;
        min-height: 30px;
        padding: 3px 7px;
        font-size: 13px;
        line-height: 1;
        white-space: nowrap;
    }
    .srm-back {
        grid-area: back;
        min-height: 34px;
        height: 34px;
        padding: 4px 8px;
        font-size: 14px;
        white-space: nowrap;
    }
    .srm-head > .srm-back { min-height: 34px; height: 34px; }
    .srm-x {
        grid-area: close;
        min-width: 32px;
        min-height: 32px;
        width: 32px;
        height: 32px;
        padding: 0;
        font-size: 17px;
    }
    .srm-phone-only { display: inline; }
    .srm-phone-hide, .srm-action-wide { display: none; }

    .srm-body {
        flex: none;
        overflow: visible;
        min-height: 0;
        padding: 10px;
        overscroll-behavior: auto;
        -webkit-overflow-scrolling: auto;
    }
    .srm-row { gap: 3px; margin-bottom: 9px; }
    .srm-row > label { font-size: 14px; line-height: 1.25; font-weight: 600; }
    .srm-section { margin: 12px 0 6px; padding-bottom: 4px; font-size: 14px; }
    .nm-mono.srm-modal input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
    .nm-mono.srm-modal textarea,
    .nm-mono.srm-modal select {
        min-height: 40px;
        padding: 7px 9px;
        font-size: 16px;
    }
    /* The date filters' wrapper is the visible field here too, so it follows the box this layer gives every
       other control. Where the wrapper is display:contents (no phone layer above) these have no effect. */
    .srm-myrep-datebox { min-height: 40px; padding: 7px 9px; }
    .srm-body .btn, .srm-body .hdr-btn,
    .srm-locbtn { min-height: 36px; padding: 6px 9px; font-size: 14px; }

    .srm-foot {
        position: static;
        flex: none;
        max-height: none;
        overflow: visible;
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
        scrollbar-gutter: auto;
    }
    .srm-foot .srm-status,
    .srm-foot .srm-step-note { flex: 1 0 100%; margin: 0; font-size: 14px; line-height: 1.3; }
    .srm-foot .srm-foot-checks { flex: 1 0 100%; align-items: flex-start; gap: 4px; font-size: 14px; }
    .srm-foot-checks input[type="checkbox"] { width: 20px; height: 20px; }
    .srm-foot .btn, .srm-foot .hdr-btn { min-height: 36px; height: auto; padding: 6px 10px; font-size: 14px; }
    .srm-foot .srm-step-action {
        flex: 1 1 145px;
        min-width: 0;
        min-height: 40px;
        padding: 6px 10px;
        font-size: 15px;
        line-height: 1.2;
    }
    .srm-foot .report-actions { flex: 1 1 100%; width: 100%; gap: 6px; }
    .srm-foot .report-actions > .hdr-btn { flex: 1 1 145px; min-width: 0; }

    /* A pinned Expand/Back control remains reachable while formatting tools use one compact,
       touch-scrollable strip. Full-screen adds a field-title row above the strip. */
    .nm-richtext-toolbar { flex-wrap: nowrap; gap: 3px; padding: 3px; }
    .nm-richtext-format-actions {
        flex: 1 1 auto;
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .nm-richtext-toolbar button { min-width: 32px; min-height: 32px; padding: 3px 6px; font-size: 14px; }
    .nm-richtext-toolbar .nm-richtext-maximize { flex: 0 0 auto; min-width: 58px; margin-left: 0; }
    /* The text-only note ends the strip on one line; shrinking it would wrap it word by word and
       make the strip taller than the photo fields' strips. */
    .nm-richtext-media-note { flex: 0 0 auto; white-space: nowrap; }
    .nm-richtext[data-nm-richtext-max] .nm-richtext-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "field exit" "tools tools";
    }
    .nm-richtext[data-nm-richtext-max] .nm-richtext-max-title {
        grid-area: field;
        display: block;
        min-width: 0;
        margin: 0;
        padding: 0 6px;
        overflow: hidden;
        font-size: 14px;
        line-height: 32px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .nm-richtext[data-nm-richtext-max] .nm-richtext-maximize { grid-area: exit; }
    .nm-richtext[data-nm-richtext-max] .nm-richtext-format-actions { grid-area: tools; }
}

/* ── Shared Create-JSA workflow. NM is the interaction oracle; both hosts mount the same
   modal, ordered questionnaire, decline control, and bottom-right Create action. ── */
.jsa-backdrop {
    position: fixed;
    inset: var(--nm-envbar-h, 0px) 0 0 0;
    z-index: 3100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    background: rgba(24, 32, 44, .5);
}
.jsa-modal {
    position: relative;
    box-sizing: border-box;
    width: min(560px, 96vw);
    max-height: calc(92vh - var(--nm-envbar-h, 0px));
    overflow-y: auto;
    padding: 16px 18px;
    border: 1px solid var(--nm-ring, #d4d4d8);
    border-radius: 10px;
    background: #fff;
    color: var(--nm-z950, #18181b);
    font-family: var(--nm-font-sans, system-ui, sans-serif);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.jsa-modal h2 { margin: 0 28px 2px 0; font-size: 1rem; }
.jsa-sub { margin: 0 28px 14px 0; color: var(--nm-z600, #52525b); font-size: .85rem;
           overflow-wrap: anywhere; }
.jsa-close {
    position: absolute;
    top: 8px;
    right: 10px;
    min-width: 28px;
    min-height: 28px;
    padding: 2px 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--nm-z500, #71717a);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}
.jsa-close:hover:not(:disabled) { background: var(--nm-z50, #fafafa); color: var(--nm-z950, #18181b); }
.jsa-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.jsa-row > label { flex: 0 0 240px; color: var(--nm-z700, #3f3f46); font-size: .85rem; }
.jsa-row select,
.jsa-row input[type=date] { padding: 3px 8px; border: 1px solid var(--nm-ring-strong, #a1a1aa);
                            border-radius: 6px; background: #fff; color: inherit; }
.jsa-row-wide { flex-wrap: wrap; }
.jsa-row-wide > .jsa-textarea { flex: 1 1 100%; width: 100%; box-sizing: border-box;
                                border: 1px solid var(--nm-ring-strong, #a1a1aa);
                                border-radius: 6px; padding: 4px 8px; font: inherit; }
.jsa-fixed { font-size: .9rem; }
/* CE's hazard-list checklist (JsaQuestionnaire V2): hazard checkboxes, section titles, warning. */
.jsa-hazards { gap: 4px 14px; margin: 10px 0 6px; padding: 0; border: 0; }
.jsa-hazards > legend { flex: 1 1 100%; margin-bottom: 4px; padding: 0; color: var(--nm-z700, #3f3f46); font-size: .85rem; }
.jsa-hazards > .jsa-check { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 calc(50% - 7px);
                            color: inherit; font-size: .85rem; }
.jsa-row input[type=text] { flex: 1 1 auto; padding: 3px 8px; border: 1px solid var(--nm-ring-strong, #a1a1aa);
                            border-radius: 6px; background: #fff; color: inherit; font: inherit; }
.jsa-section { margin: 16px 0 4px; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase;
               color: var(--nm-z700, #3f3f46); }
.jsa-note { margin: 4px 0 8px; padding: 4px 10px; border-left: 4px solid #f1bbbc; background: #fdf6f6;
            font-size: .82rem; line-height: 1.45; }
.jsa-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.jsa-btn { min-height: 34px; padding: 6px 14px; border: 1px solid var(--nm-ring, #d4d4d8);
           border-radius: 8px; background: #fff; color: inherit; cursor: pointer; }
.jsa-btn-primary { border-color: transparent; background: #2563eb; color: #fff; }
.jsa-btn:disabled, .jsa-close:disabled { cursor: default; opacity: .6; }
.jsa-error { margin-right: auto; color: var(--nm-red, #b91c1c); font-size: .82rem; }

@media (max-width: 640px) {
    .jsa-row { flex-direction: column; align-items: stretch; gap: 2px; }
    .jsa-row > label { flex: none; }
    .jsa-hazards > .jsa-check { flex: 1 1 100%; }
    .jsa-modal input, .jsa-modal select, .jsa-modal textarea { min-height: 44px; font-size: 16px; }
    .jsa-modal input[type=checkbox] { min-height: 0; width: 22px; height: 22px; }
    .jsa-btn { min-height: 44px; font-size: 16px; }
}

/* ── Centered destructive-action confirm (cancel-signed-time warning, Erik 2026-08-28).
   A pop-up modal in the CENTER of the viewport — deliberately not an inline banner — used
   by both hosts before cancelling time that sits on an unsettled signed report. Sits above
   the full-screen SWR workspace (z-index 2000). ── */
.ts-confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, .45);
}
.ts-confirm-modal {
    box-sizing: border-box;
    width: 100%;
    max-width: 440px;
    padding: 20px;
    border-radius: 10px;
    background: #fff;
    color: var(--nm-z950, #1a1a1a);
    font-family: var(--nm-font-sans, system-ui, sans-serif);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.ts-confirm-modal h3 { margin: 0 0 8px; font-size: 17px; }
.ts-confirm-modal p { margin: 0; font-size: 15px; line-height: 1.45; }
.ts-confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ts-confirm-actions .hdr-btn { min-height: 44px; height: auto; padding: 8px 14px;
                               font-size: 15px; white-space: normal; line-height: 1.25; }

/* Keep every Camera/Upload action at one height after all responsive layers. The compact
   View/Reopen utility buttons deliberately retain their header-control geometry. */
.srm-body .srm-await-page-action { min-height: 42px; height: 42px; box-sizing: border-box; }
/* Multi-page fork: each capture group leads with which paper it collects. */
.srm-await-uplabel { font-size: 0.85rem; font-weight: 600; color: var(--nm-z900); }
/* Collected signed pages, in the order they will be appended to the report. */
.srm-rp-pages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.srm-rp-pages li { display: flex; align-items: center; justify-content: space-between; gap: 8px;
                   font-size: 13px; }

/* Shared SWR material picker. This lives in the RCL static asset (not CSS isolation) because
   Partner's server and offline-WASM roots must render the exact same compiled picker. */
.material-picker {
    position: relative;
    width: 100%;
}
.material-picker-free {
    display: flex;
    align-items: center;
    gap: 6px;
}
.material-picker-input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: .4rem .55rem;
    border: 1px solid var(--nm-ring, #b9c0c9);
    border-radius: 4px;
    background: #fff;
    color: var(--nm-z900, #1a1a1a);
    font: inherit;
}
.material-picker-input:focus {
    border-color: var(--nm-primary, #2b6cb0);
    outline: none;
    box-shadow: 0 0 0 2px rgb(43 108 176 / 20%);
}
.material-picker-add { flex: 0 0 auto; }
.material-picker-list {
    position: absolute;
    z-index: 40;
    top: calc(100% + 2px);
    right: 0;
    left: 0;
    max-height: 18rem;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    border: 1px solid var(--nm-ring, #b9c0c9);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 6px 18px rgb(0 0 0 / 14%);
    list-style: none;
}
.material-picker-item {
    display: grid;
    grid-template-columns: minmax(6rem, auto) 1fr;
    align-items: baseline;
    gap: .6rem;
    padding: .35rem .6rem;
    border-bottom: 1px solid var(--nm-z100, #eef1f4);
    cursor: pointer;
}
.material-picker-item:last-child { border-bottom: none; }
.material-picker-item.is-active,
.material-picker-item:hover { background: #eef4fb; }
.mp-num {
    color: var(--nm-primary, #2b6cb0);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.mp-desc {
    overflow: hidden;
    color: var(--nm-z800, #333);
    text-overflow: ellipsis;
    white-space: nowrap;
}
.material-picker-empty {
    position: absolute;
    z-index: 40;
    top: calc(100% + 2px);
    right: 0;
    left: 0;
    padding: .45rem .6rem;
    border: 1px solid var(--nm-ring, #b9c0c9);
    border-radius: 4px;
    background: #fff;
    color: var(--nm-z500, #777);
    font-style: italic;
    box-shadow: 0 6px 18px rgb(0 0 0 / 14%);
}
.material-picker-spin {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 13px;
    height: 13px;
    margin-top: -7px;
    border: 2px solid var(--nm-z300, #d4d4d8);
    border-top-color: var(--nm-z600, #52525b);
    border-radius: 50%;
    animation: material-picker-spin .7s linear infinite;
    pointer-events: none;
}
@keyframes material-picker-spin { to { transform: rotate(360deg); } }
.material-picker-custom {
    display: block;
    width: 100%;
    margin-top: .35rem;
    padding: .25rem .5rem;
    border: 1px dashed var(--nm-ring, #b9c0c9);
    border-radius: 4px;
    background: transparent;
    color: #1d4ed8;
    font-size: .8rem;
    font-style: normal;
    text-align: left;
    cursor: pointer;
}
.material-picker-custom:hover { background: var(--nm-z100, #f4f4f5); }
.material-picker-pager {
    position: sticky;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px;
    border-top: 1px solid var(--nm-ring, #d1d5db);
    background: var(--nm-z50, #fafafa);
    color: var(--nm-z600, #52525b);
    font-size: .72rem;
    list-style: none;
}
.material-picker-pager button {
    padding: 2px 10px;
    border: 1px solid var(--nm-ring, #d1d5db);
    border-radius: 4px;
    background: #fff;
    font-size: .72rem;
    cursor: pointer;
}
.material-picker-pager button:disabled { opacity: .4; cursor: default; }
/* "Add “…” as free text", the last option under the matches (Andreas Pohl, 2026-10-06). It sticks to
   the list's bottom edge so it shows without scrolling. One fixed-height line, so the sticky pager can
   sit exactly one offer above it (.mp-above-typed); change each height and its pager bottom together. */
.material-picker-typed {
    position: sticky;
    bottom: 0;
    box-sizing: border-box;
    height: 2rem;
    padding: 0 .6rem;
    overflow: hidden;
    border-top: 1px dashed var(--nm-ring, #b9c0c9);
    background: #fff;
    color: #1d4ed8;
    line-height: calc(2rem - 1px);
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}
.material-picker-typed.is-active,
.material-picker-typed:hover { background: #eef4fb; }
.material-picker-pager.mp-above-typed { bottom: 2rem; }
@media (max-width: 640px) {
    .material-picker-item { min-height: 48px; padding: 10px 12px; }
    .material-picker-item .mp-desc {
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }
    .material-picker-typed { height: 48px; padding: 0 12px; font-size: 15px; line-height: 47px; }
    .material-picker-pager.mp-above-typed { bottom: 48px; }
    .material-picker-empty { padding: 10px 12px; font-size: 15px; line-height: 1.4; }
    .material-picker-custom,
    .material-picker-add { min-height: 44px; }
}

/* ── Shared control chrome (program unit 1.9, 2026-09-14), moved verbatim from both hosts'
   app.css in its original order: the no-time day pill (DayLabelCell), the display-table header
   band (TimeEntriesPreviewTable), the solid and outline button overrides (the SWR actions,
   TimeSaveButton, HourlyTimesAllWorkflow), the .nm-mono header inputs and buttons, the button
   focus ring, the status pill (StatusPill), the badge containment contract (every badge emitter)
   and the summary column separators (TimeEntriesPreviewTable), then, from correction 1, the
   AutoGrowTextArea base (textarea.nm-autogrow). One block here rather than beside each
   component: in app.css these rules loaded after every rule above, and this position keeps
   them after all of those. It stays above the signed-out card, whose rules and everything after
   them must carry no importance flag (SignInCardGuardTests). ── */

/* Soft attention pill — a working weekday (Mon–Fri, non-holiday) with zero
   hours entered. Amber, not --nm-red: "did you forget?", not an error, never
   blocks Submit. Used in the per-day date cell of the time-entry forms only
   (autnav/hourly/exempt-times); grid templates legitimately charge zero-work
   days to PTO/holiday columns so they don't carry this. */
.nm-daywarn {
    display: inline-block;
    margin-left: 6px;
    padding: 0 5px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #1a1a1a;
    background: var(--nm-amber);
    border-radius: 999px;
    vertical-align: middle;
    white-space: nowrap;
}

/* Centered card-header band for display tables ("Time Entries" etc.) —
   lives INSIDE the .nm-tablecard so the title is attached to (and exactly
   as wide as) its table. */
.nm-tablehdr {
    display: block;
    text-align: center;
    background: var(--nm-z50);
    padding: 4px 10px;
    font-family: var(--nm-font-sans);
    font-size: 13px;
    font-weight: 600;
    color: var(--nm-z950);
    border-bottom: 1px solid var(--nm-z300);
}

/* Primary action — Catalyst solid dark/zinc button (Stage 2, 2026-06-11):
   zinc-900 body, near-black border, inner top highlight, 8px radius. */
.btn-primary {
    color: #fff;
    background-color: var(--nm-z900);
    border-color: rgba(9, 9, 11, 0.9);
    border-radius: var(--nm-radius-lg);
    font-family: var(--nm-font-sans);
    font-weight: 600;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.15), var(--nm-shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background-color: #2c2c30; /* zinc-900 + white/10 overlay */
    border-color: rgba(9, 9, 11, 0.9);
}

.btn-primary:disabled {
    /* Catalyst disabled = 50% opacity of the solid button — visually distinct
       from active without inventing a new hue. */
    background-color: var(--nm-z900);
    border-color: rgba(9, 9, 11, 0.9);
    color: #fff;
    opacity: 0.5;
    box-shadow: none;
}

/* Secondary action — the per-form Save button (only consumer of .btn-outline-primary
   in this app). SAME zinc palette as the solid .btn-primary above, just outlined:
   white body, zinc-900 text + border. Submit (solid) and Save (outline) now read as
   one color family — primary↔secondary — instead of grey-vs-blue. Bootstrap's default
   .btn-outline-primary is blue, which is why Save clashed before this override. */
.btn-outline-primary {
    color: var(--nm-z900);
    background-color: #fff;
    border-color: var(--nm-z900);
    border-radius: var(--nm-radius-lg);
    font-family: var(--nm-font-sans);
    font-weight: 600;
    box-shadow: var(--nm-shadow-sm);
}

.btn-outline-primary:hover:not(:disabled) {
    color: #fff;
    background-color: var(--nm-z900);
    border-color: var(--nm-z900);
}

.btn-outline-primary:disabled {
    color: var(--nm-z900);
    background-color: #fff;
    border-color: var(--nm-z900);
    opacity: 0.5;
    box-shadow: none;
}

/* ── Shared chrome classes (Catalyst, 2026-06-17) — promoted to the global
   stylesheet so they're available on EVERY page, not just Home. The Employee
   Admin page and the Create-timesheet modal (which reuses .hdr-btn /
   .hdr-input) live outside Home, so without these here their chrome would fall
   back to the un-themed browser default. Home.razor's identical copy was deleted
   in T3.1d so the phone sizes after these rules apply there too; this is the only
   copy. Scoped under .nm-mono to match how Home declared them (the wrapper marks
   the surface as "app chrome"). */
.nm-mono .hdr-input, .nm-mono select.hdr-input {
    font-family: var(--nm-font-sans); font-size: 13px; color: var(--nm-z950); background: #fff;
    border: 1px solid var(--nm-ring-strong); border-radius: var(--nm-radius-lg);
    height: 28px; padding: 0 8px; box-shadow: var(--nm-shadow-sm); outline: none;
}
.nm-mono .hdr-input:focus { outline: 2px solid #3b82f6; outline-offset: -1px; }

.nm-mono .hdr-btn {
    font-family: var(--nm-font-sans); font-size: 13px; font-weight: 600; color: var(--nm-z950);
    background: #fff; border: 1px solid var(--nm-ring); border-radius: var(--nm-radius-lg);
    height: 28px; padding: 0 10px; display: inline-flex; align-items: center; gap: 4px;
    box-shadow: var(--nm-shadow-sm); cursor: pointer;
    /* At TRUE phone width (nothing wide stretching the layout — e.g. the offline Approve tab)
       the header's flex rows used to squeeze these until labels broke mid-word; whole buttons
       wrap to the next row instead (Erik 2026-07-16). */
    white-space: nowrap; flex: 0 0 auto;
}
.nm-mono .hdr-btn:hover:not(:disabled) { background: rgba(9,9,11,.03); border-color: var(--nm-ring-strong); }
.nm-mono .hdr-btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.nm-mono .hdr-btn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }

/* The header label ("Email:", "Week:", "Date:") beside the controls above: moved from Home.razor's inline block (T3.1c,
   move-only; the generated portal renders the same labels and never had Home's block). No other rule in NM's cascade
   targets .hdr-label, so NM's computed labels are unchanged; the phone size follows the desktop rule as it did there. */
.nm-mono .hdr-label {
    font-family: var(--nm-font-sans); font-weight: 500; font-size: 12.5px;
    color: var(--nm-z500); margin: 0; white-space: nowrap; flex: 0 0 auto;
}
@media (max-width: 640px) {
    .nm-mono .hdr-label { font-size: 14px; }
}

/* Home's phone chrome (≤640px, Erik 2026-07-25), moved from Home.razor's inline block in T3.1d (move-only, finding F3).
   It follows the desktop rules above, which it overrides at equal specificity, and precedes the signed-out card's
   `button.nm-auth-btn` and `.nm-auth-card button`. 16px inputs also stop iOS focus auto-zoom. Two rules stay in Home:
   the orders template's .hdr-time-input width, and the generic `.nm-mono button` floor (Erik's F2/F3 ruling (a),
   2026-09-25). Here the generic rule reached every page inside .nm-mono and beat their single-class buttons: Partner's
   Signature➞QR went from 44 to 28px, and NM File⬌QR's Close from 42 to 28px. */
@media (max-width: 640px) {
    .nm-mono .hdr-input, .nm-mono select.hdr-input { height: 34px; font-size: 16px; }
    .nm-mono .nm-iconbtn, .nm-mono .wk-step { padding: 0; }
    .nm-mono .hdr-btn { height: 30px; font-size: 14px; padding: 2px 6px; white-space: nowrap; }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Status pill (Submitted / Approved / Returned / Cancelled / Saved / Draft). Keep a uniform
   single-line minimum height while allowing long or localized text to grow instead of escaping
   the painted pill. Colours + border-style come inline per status. */
.nm-status-pill {
  display: inline-flex; align-items: center; box-sizing: border-box; min-height: 20px;
  padding: 0 8px; border-radius: 10px; font-size: 0.72rem; font-weight: 600; line-height: 1;
  border: 1px solid transparent; vertical-align: middle;
}

/* Universal badge/chip/pill containment contract. Badge-like text must remain inside its
   painted background at every viewport size and in every locale: the badge wraps and grows;
   it must never clip, hide, or let text escape. All badge emitters include nm-badge. */
.nm-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  /* Deliberately authoritative: Blazor component-scoped selectors are more specific. */
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto !important;
  flex-wrap: wrap !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal;
  text-align: center;
}

/* 1px black vertical separators between columns of the Weekly Payroll Summary
   + SAP Entries tables. Overrides the default .ts-table light-blue border on
   the right edge of every cell so column breaks read clearly. */
.tsf-all .summary-v-sep th, .tsf-all .summary-v-sep td { border-right: 1px solid #000 !important; }

/* 1px black vertical separators between columns of the Weekly Summary + SAP Entries
   tables below the main grid. Overrides the default .dp-table light-blue 1px border
   on the right edge of every cell so column breaks are easier to follow. */
.summary-v-sep th, .summary-v-sep td { border-right: 1px solid #000 !important; }

/* ── AutoGrowTextArea base (Erik 2026-07-25) ─────────────────────────────────────────────
   EVERY multi-line box starts at the SWR reading size (the --srm-area-font convention) and
   shrinks only past ~15 lines (nm002m-ui.js fitTextarea). The min-height floors the box at
   least as tall as a standard single-line input, so a pre-layout fit can never leave it
   squashed (the 3px Week-notes bug). CSS min-height beats the JS's inline height, so the
   floor holds even against a stale measurement.
   Start size: 18px. It opened at 18pt (= 24px) when v1.3.304 unified the boxes; Erik read
   that as too big on a real report and asked for 18 (2026-07-25). ONE value — the shrink
   logic reads whatever the CSS says. */
textarea.nm-autogrow {
    font-size: var(--nm-area-font, 18px);
    min-height: 2.4rem;
    line-height: 1.35;
}

/* ── Signed-out auth card (SignInCard.razor). Until 2026-09-05 NM's AuthGuard carried these rules in
   an inline style block and Partner's styles.css carried a copy; this is their union. Tokens come
   from the :root block at the top of this sheet. The doubled button selectors keep the card's
   action above the hosts' generic button chrome; the anchor variant (NM signs in through a plain
   navigation) needs the inline-block + no-underline pair. ── */
.nm-auth-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--nm-envbar-h, 0px));
    /* Center below an environment bar, within the phone browser's visible viewport. */
    min-height: calc(100dvh - var(--nm-envbar-h, 0px));
    background: var(--nm-z100);
    font-family: var(--nm-font-sans);
}

.nm-auth-wrap[hidden] { display: none; }

/* The startup card stays in the same place while runtime and authentication hand off. */
.nm-app-loading {
    position: fixed;
    top: var(--nm-envbar-h, 0px);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 500;
    background: var(--nm-z100, #f4f4f5);
}

.nm-app-loading > .nm-auth-wrap {
    height: 100%;
    min-height: 0;
}

.nm-app-loading-label {
    font-size: 14px;
    color: var(--nm-z500);
    margin-bottom: 14px;
}

.nm-app-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--nm-z200);
    border-top-color: var(--nm-z700);
    border-radius: 50%;
    animation: nm-app-loading-spin .8s linear infinite;
}

@keyframes nm-app-loading-spin { to { transform: rotate(360deg); } }

/* The card sets its own type instead of inheriting the host page's. NM Timesheet also loads
   Bootstrap (16px body, line-height 1.5, headings 1.2), which made its title 2.4px shorter and its
   Sign in button 2px taller than NM Partner's. 14px and the normal line height are what Partner and
   CIP inherit, so all three portals draw the same card (Erik, 2026-09-15). */
.nm-auth-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    border: 1px solid var(--nm-ring);
    border-radius: var(--nm-radius-xl);
    box-shadow: var(--nm-shadow-card);
    padding: 36px 44px 32px;
    max-width: 400px;
    margin: 0 16px;
    font-size: 14px;
    line-height: normal;
}

.nm-auth-card img {
    width: 40px;
    height: 40px;
    margin-bottom: 14px;
}

.nm-auth-card h2 {
    font-size: 18px;
    line-height: normal;
    font-weight: 600;
    color: var(--nm-z950);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

/* Public title actions are in the shared sheet so the cold offline shell loads them too. */
.nm-auth-heading {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 16px;
}

.nm-auth-heading h2 { margin: 0; }
.nm-auth-heading-actions { flex: 0 0 auto; }
.nm-auth-heading-actions a {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid var(--nm-ring, #d1d5db);
    border-radius: 6px;
    background: white;
    color: var(--nm-z950, #111827);
    font: 600 14px/1.4 var(--nm-font-sans, system-ui, sans-serif);
    text-decoration: none;
}
.nm-auth-heading-actions a:hover { background: var(--nm-z100, #f4f4f5); }
.nm-auth-heading-actions a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Public file transfer sits under the primary action. Shared sheet, so the cold
   offline shell paints it too; a heading-only rule would leave it unstyled there. */
.nm-auth-secondary { margin-top: 14px; }
.nm-auth-secondary a {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid var(--nm-ring, #d1d5db);
    border-radius: 6px;
    background: white;
    color: var(--nm-z950, #111827);
    font: 600 14px/1.4 var(--nm-font-sans, system-ui, sans-serif);
    text-decoration: none;
}
.nm-auth-secondary a:hover { background: var(--nm-z100, #f4f4f5); }
.nm-auth-secondary a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* .hdr-btn is shaped like a button but sets no text-decoration, so an <a> wearing it keeps
   the UA underline. The File QR back link is an anchor by design (it must work with no
   circuit), so it drops the underline explicitly rather than by changing every .hdr-btn. */
/* Erik, 2026-09-09: 3px of air so the button's top border does not sit on the tile border. */
.file-qr-back { text-decoration: none; margin-top: 3px; }

.nm-auth-card p {
    color: var(--nm-z500);
    margin: 0 0 20px;
    font-size: 13.5px;
    line-height: 1.45;
}

.nm-auth-btn,
button.nm-auth-btn {
    background: var(--nm-z900);
    color: #fff;
    border: 1px solid rgba(9, 9, 11, .9);
    border-radius: var(--nm-radius-lg);
    padding: 9px 22px;
    min-height: 0;
    font-size: 14px;
    line-height: normal;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-top: 6px;
    box-shadow: inset 0 1px rgba(255, 255, 255, .15), var(--nm-shadow-sm);
}

.nm-auth-btn:hover:not(:disabled),
button.nm-auth-btn:hover:not(:disabled) {
    background: #2c2c30;
    border-color: rgba(9, 9, 11, .9);
    color: #fff;
}

/* Wins over .nm-auth-card p by specificity, so no importance flag is needed. */
.nm-auth-card .nm-auth-err {
    color: #b91c1c;
    margin: 14px 0 0;
    font-size: 12.5px;
}

/* Touch targets on narrow screens (moved from Partner styles.css with the card). */
@media (max-width: 640px) {
    .nm-auth-card button { min-height: 38px; }
}

/* Shared Expenses receipt capture: NM employee claims and Partner PO evidence. */
.expense-receipt-capture { border-top:1px solid var(--nm-z200, #e4e4e7); padding-top:12px; margin-top:12px; }
.expense-receipt-capture .exp-step-title { font-size:0.95rem; margin:0 0 8px; }
.expense-receipt-capture .exp-muted { color:var(--nm-z500, #71717a); font-size:0.85rem; }
.expense-receipt-capture .exp-note { background:var(--nm-z100, #f4f4f5); border-radius:var(--nm-radius-lg, 8px); padding:10px 12px; margin:8px 0; font-size:0.9rem; }
.expense-receipt-capture .exp-pending { border:1px dashed var(--nm-ring-strong, #d4d4d8); border-radius:var(--nm-radius-lg, 8px); padding:10px; margin-top:8px; }
.expense-receipt-capture .exp-page-previews { display:flex; gap:12px; flex-wrap:wrap; margin:12px 0; }
.expense-receipt-capture .exp-page-preview { max-width:100%; max-height:360px; object-fit:contain; background:#fff; border:1px solid var(--nm-ring-strong, #d4d4d8); }

/* Receipt capture uses one field tree at every width. */
.expense-receipt-capture [hidden] { display:none; }
.expense-receipt-walk { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; }
.expense-receipt-walk-view, .expense-receipt-walk-fields { min-width:0; }
.expense-receipt-viewer-stage { height:min(45vh,360px); display:flex; align-items:center; justify-content:center; overflow:hidden; background:#f1f3f5; border:1px solid #d4d4d8; border-radius:8px; touch-action:none; user-select:none; }
.expense-receipt-viewer-layer { position:relative; max-width:100%; flex-shrink:0; transform-origin:center; will-change:transform; }
.expense-receipt-viewer-layer img { display:block; max-width:100%; max-height:min(45vh,360px); width:auto; height:auto; pointer-events:none; }
.expense-receipt-highlight { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.expense-receipt-highlight polygon { fill:rgba(255,194,0,.22); stroke:#b27900; stroke-width:.003; }
.expense-receipt-page-controls, .expense-walk-navigation, .expense-receipt-save-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:10px 0; }
.expense-receipt-page-controls span { flex:1; text-align:center; white-space:nowrap; }
.expense-receipt-zoom-controls { display:flex; align-items:center; gap:8px; margin:10px 0; }
.expense-receipt-zoom-controls button { min-width:40px; min-height:40px; }
.expense-receipt-zoom-controls span { font-size:.8rem; color:var(--nm-z500,#71717a); }
.expense-facts-details .expense-facts-grid { grid-template-columns:minmax(0,1fr); }
.expense-facts-details [data-walk-field="Total"] { order:0; }
.expense-facts-details [data-walk-field="CurrencyCode"] { order:1; }
.expense-facts-details [data-walk-field="Tax"] { order:2; }
.expense-facts-details [data-walk-field="ReceiptDate"] { order:3; }
.expense-facts-details [data-walk-field="Merchant"] { order:4; }
.expense-facts-details [data-walk-field="Note"] { order:5; }
.expense-facts-details [data-suggested="true"] input { color:#5b6470; background:#f3f6f8; font-style:italic; }
.expense-receipt-more { margin:12px 0; }
.expense-receipt-more > summary { cursor:pointer; padding:8px 0; font-weight:600; }
.expense-receipt-confirmed { display:grid; grid-template-columns:auto minmax(0,1fr); gap:6px 12px; }
.expense-receipt-confirmed dd { margin:0; overflow-wrap:anywhere; }
.expense-receipt-allocation { font-weight:600; }
.expense-receipt-reading { color:#52525b; }
.expense-facts-walk .expense-facts-grid { grid-template-columns:minmax(0,1fr); }
.expense-facts-walk [data-walk-field="Total"] { order:0; }
.expense-facts-walk [data-walk-field="CurrencyCode"] { order:1; }
.expense-facts-walk [data-walk-field="Tax"] { order:2; }
.expense-facts-walk [data-walk-field="ReceiptDate"] { order:3; }
.expense-facts-walk [data-walk-field="Merchant"] { order:4; }
.expense-facts-walk [data-walk-field="Country"] { order:5; }
.expense-facts-walk [data-walk-field="Note"] { order:6; }
.expense-facts-walk [data-walk-included="false"], .expense-facts-walk [data-walk-active="false"] { display:none; }
.expense-facts-walk [data-walk-active="true"] { outline:2px solid #16658a; outline-offset:5px; border-radius:2px; }
.expense-facts-walk [data-suggested="true"] > input, .expense-facts-walk input[data-suggested="true"], .expense-facts-walk [data-suggested="true"] .expense-currency-picker input, .expense-facts-walk [data-suggested="true"] .swr-country-picker input { color:#5b6470; background:#f3f6f8; font-style:italic; }
.expense-receipt-capture input, .expense-receipt-capture textarea, .expense-receipt-capture select { font-size:16px; }
.expense-receipt-summary .expense-facts-walk [data-walk-included="true"] { display:flex; outline:none; }
.expense-receipt-summary .expense-walk-navigation { display:none; }
@media (min-width:1024px) {
    .expense-receipt-walk { grid-template-columns:minmax(280px,1fr) minmax(320px,1fr); align-items:start; }
    .expense-receipt-walk-view { position:sticky; top:16px; }
    .expense-facts-walk [data-walk-included="true"] { display:flex; }
}

/* Issued video QR evidence never enters the photo crop/resize/JPEG path. */
.nm-richtext-media { padding:10px; border-bottom:1px solid #c7ced6; background:#f6f8fa; }
.nm-richtext-media[hidden] { display:none; }
.nm-richtext-media button { min-height:40px; margin:0 8px 8px 0; padding:7px 12px; font:inherit; }
.nm-richtext-media [data-inline-media-paste] { min-height:44px; padding:10px; border:1px dashed #64748b; border-radius:6px; font-size:16px; }
.nm-richtext-media .nm-richtext-note:empty { display:none; }
.srm-video-card { margin:0; max-width:22rem; }
.srm-video-card img, .nm-richtext-video img { display:block; width:16rem; max-width:100%; height:auto; margin:0 auto; background:#fff; image-rendering:pixelated; }
.nm-richtext-video figcaption { margin-top:8px; white-space:pre-wrap; overflow-wrap:anywhere; color:#17212b; font-size:14px; line-height:1.4; }
/* The gallery card's caption takes the card's own text (see "Report videos" below). */
.srm-video-card figcaption { margin-top:8px; white-space:pre-wrap; overflow-wrap:anywhere; }
.srm-video-expired { margin:6px 0 0; color:#735013; font-size:13px; }
.nm-richtext-figure.nm-richtext-video { box-sizing:border-box; width:min(100%, 22rem); padding:12px; background:#fff; }
.nm-richtext-video a { display:block; }
/* Shared Insert media video review lives in the native dialog top layer. Its scrollable body
   keeps Cancel/Confirm reachable with phone keyboards and avoids ancestor clipping. */
.nm-video-review { box-sizing:border-box; width:min(760px, calc(100vw - 24px)); max-height:calc(100dvh - 24px);
    padding:0; border:1px solid #cbd5e1; border-radius:12px; color:#172033; background:#fff;
    font-family:var(--nm-font-sans, system-ui); }
.nm-video-review[open] { display:flex; flex-direction:column; }
.nm-video-review::backdrop { background:rgb(15 23 42 / 65%); }
/* Non-modal review must stay above the report workspace (2000), while leaving its text editable. */
.nm-video-review.is-background { position:fixed; inset:auto 12px 12px auto; margin:0; width:min(340px, calc(100vw - 24px)); z-index:2001; }
.nm-video-review.is-background .nm-video-review-body > :not([data-video-note]):not([data-video-upload-notice]):not([data-video-progress]):not([data-video-error]),
.nm-video-review.is-background [data-video-confirm] { display:none; }
.nm-video-review [hidden] { display:none !important; }
.nm-video-review header, .nm-video-review footer { flex:0 0 auto; padding:12px 16px; background:#f1f5f9; }
.nm-video-review h2 { margin:0; font-size:1.1rem; }
.nm-video-review header p { margin:5px 0 0; overflow-wrap:anywhere; font-size:.85rem; }
.nm-video-review-body { overflow:auto; min-height:0; padding:12px 16px; }
.nm-video-review video { display:block; position:sticky; top:0; z-index:4; background:#111827; width:100%; max-height:34dvh; object-fit:contain; }
.nm-video-review fieldset { margin:12px 0; border:1px solid #cbd5e1; padding:10px; display:grid; grid-template-columns:1fr 9rem; gap:10px; }
.nm-video-review fieldset[hidden] { display:none; }
.nm-video-review label { display:block; }
.nm-video-review input[type=range] { display:block; width:100%; min-height:32px; }
.nm-video-review input[type=number], .nm-video-review textarea { box-sizing:border-box; width:100%; padding:8px; font:inherit; }
.nm-video-review .nm-video-trim-toggle, .nm-video-review .nm-video-description { margin:12px 0; }
.nm-video-review output { float:right; font-variant-numeric:tabular-nums; }
.nm-video-review button { min-height:40px; padding:8px 12px; border:1px solid #94a3b8; border-radius:6px; font:inherit; cursor:pointer; }
.nm-video-review button:disabled { opacity:.55; cursor:default; }
.nm-video-review [data-video-confirm] { color:#fff; background:#1d4ed8; border-color:#1d4ed8; }
.nm-video-review footer { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:10px; }
.nm-video-review [data-video-error] { color:#a21b1b; overflow-wrap:anywhere; }
.nm-video-review .nm-video-expiry-note { font-size:.85rem; color:#475569; }
.nm-video-upload-notice { padding:8px 10px; border-left:3px solid #b45309; background:#fffbeb; color:#78350f; font-size:.85rem; overflow-wrap:anywhere; }
.nm-video-review [data-video-note] { overflow-wrap:anywhere; font-variant-numeric:tabular-nums; }
.nm-video-review progress { width:100%; }
.nm-video-review .nm-video-editor { display:block; min-width:0; padding:12px; border-radius:10px; }
.nm-video-editor-heading { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:.9rem; }
.nm-video-editor-heading strong { color:#075985; font-variant-numeric:tabular-nums; }
.nm-video-editor-heading strong.is-over-limit { color:#b91c1c; }
.nm-video-editor-help, [data-video-selection-message] { color:#475569; font-size:.85rem; }
.nm-video-timeline { position:relative; height:72px; margin:18px 12px 8px; border-radius:6px; background:#0f172a; touch-action:none; }
.nm-video-thumbnails { display:flex; width:100%; height:100%; overflow:hidden; border-radius:6px; opacity:.4; }
.nm-video-thumbnails canvas { flex:1 1 0; width:0; min-width:0; height:100%; object-fit:contain; }
.nm-video-section-overlays { position:absolute; inset:0; pointer-events:none; }
.nm-video-kept-section { position:absolute; top:0; bottom:0; box-sizing:border-box; border:2px solid #67e8f9;
    background:rgb(14 165 233 / 30%); pointer-events:auto; }
.nm-video-kept-section.is-selected { border-color:#fbbf24; background:rgb(251 191 36 / 20%); z-index:1; }
.nm-video-review .nm-video-kept-section [data-section-select] { width:100%; height:100%; min-width:0; padding:0;
    border:0; border-radius:0; background:transparent; color:white; text-shadow:0 1px 3px #000; overflow:hidden; }
.nm-video-review .nm-video-section-handle { position:absolute; top:-5px; bottom:-5px; width:24px; min-height:44px;
    padding:0; border:2px solid #0c4a6e; border-radius:5px; color:#082f49; background:#67e8f9; touch-action:none; z-index:2; }
.nm-video-section-handle[data-section-edge=start] { left:-12px; cursor:ew-resize; }
.nm-video-section-handle[data-section-edge=end] { right:-12px; cursor:ew-resize; }
.nm-video-review .is-selected .nm-video-section-handle { background:#fbbf24; border-color:#92400e; color:#451a03; }
.nm-video-playhead { position:absolute; top:-8px; bottom:-8px; width:2px; background:#fff; box-shadow:0 0 0 1px #0f172a;
    pointer-events:none; z-index:3; }
.nm-video-review .nm-video-scrub-label { margin-top:12px; font-size:.85rem; font-variant-numeric:tabular-nums; }
.nm-video-timeline-times { display:flex; justify-content:space-between; color:#64748b; font-size:.8rem; }
.nm-video-editor-actions, .nm-video-section-list { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
.nm-video-review .nm-video-section-list button { font-size:.85rem; min-height:44px; background:#fff; }
.nm-video-review .nm-video-section-list button[aria-pressed=true] { background:#e0f2fe; color:#075985; border-color:#0284c7; }
.nm-video-section-bounds { display:grid; grid-template-columns:1fr 1fr; align-items:end; gap:10px; margin-top:12px; }
.nm-video-section-bounds[hidden] { display:none; }
.nm-video-section-bounds label { min-width:0; font-size:.85rem; }
.nm-video-review .nm-video-section-bounds button { grid-column:1 / -1; justify-self:start; color:#9f1239; background:#fff; }
.nm-video-review button:focus-visible, .nm-video-review input:focus-visible { outline:3px solid #2563eb; outline-offset:3px; }
@media(max-width:480px) { .nm-video-review fieldset { grid-template-columns:1fr; } .nm-video-review video { max-height:28dvh; } }

.srm-video-card .srm-video-play-label { display:block; margin-top:8px; text-align:center; font-weight:600; text-decoration:underline; }

/* Report videos stay visible beside their saved preparation/upload state. Erik, 2026-10-15: the cards "should match the
   rest of NM Timesheet's buttons and formatting", so they use NM's hairline ring, zinc ink and the SWR body's text size,
   and every action is an .hdr-btn (the markup carries the class; these rules only size it for a card). */
.srm-video-cards { display:grid; gap:12px; margin-block:14px; }
.srm-video-cards h3 { margin:0; color:var(--nm-z900); font-size:var(--nm-font-ui); font-weight:600; line-height:1.4; }
.srm-video-card { min-width:0; padding:12px; border:1px solid var(--nm-ring); border-radius:var(--nm-radius-lg); background:#fff;
    box-shadow:var(--nm-shadow-sm); color:var(--nm-z900); font-size:var(--nm-font-ui); line-height:1.4; overflow-wrap:anywhere; }
/* The gallery QR card's 22rem would wrap a card's three actions onto two rows at desktop width. */
.srm-video-cards .srm-video-card { max-width:32rem; }
/* Bootstrap's 1rem paragraph gap is too loose for a card; :where() lets the expiry and awaiting notes keep their own. */
:where(.srm-video-card) p { margin:0 0 8px; }
.srm-video-card > p:first-child, .srm-video-card-name { font-weight:600; }
/* The desktop floor is the hdr-btn's own 28px; :where() keeps it below the SWR body's phone (36px) and touch (44px) floors. */
:where(.srm-video-card, .srm-video-recovery) .hdr-btn { min-height:28px; }
/* A long label on a narrow phone wraps inside the card instead of running past its edge. */
.srm-video-card .hdr-btn, .srm-video-recovery .hdr-btn { box-sizing:border-box; max-width:100%; height:auto; margin:4px 6px 4px 0;
    white-space:normal; text-align:left; }
.srm-video-card-status { padding:12px; border:1px solid var(--nm-ring); border-radius:var(--nm-radius-lg); background:var(--nm-z50); overflow-wrap:anywhere; }
.srm-video-card .srm-video-card-status { margin-top:10px; }
.srm-video-card-status progress { width:min(100%, 240px); margin-right:8px; }
.srm-video-card-status p { margin:0 0 8px; }
/* The QR inside its own "Report videos" tile (Erik, 2026-10-20: "Tile only"): no second frame, left-aligned under the caption. */
.srm-video-cards .srm-video-card.srm-video-card-embedded { max-width:16rem; margin:0 0 8px; padding:0; border:0; border-radius:0;
    background:none; box-shadow:none; }
.srm-video-card-embedded img { margin:0; }
/* Step 4c Handoff chooser (SwrHandoffChooser): the same pane as NM's QR hand-off states (nm-hop-*), shared so Partner's
   later step reuses it. A gated action stays visible and disabled with its reason beside it (Erik, 2026-09-16). */
.swr-hop-pane { position:fixed; right:16px; bottom:96px; z-index:3000; width:min(440px,calc(100vw - 24px));
    box-sizing:border-box; background:#fff; border:1px solid var(--nm-ring,#d1d5db); border-radius:10px;
    box-shadow:0 8px 28px rgba(0,0,0,.28); padding:12px; display:flex; flex-direction:column; gap:10px; }
.swr-hop-head { font-size:15px; font-weight:600; }
.swr-hop-choice { display:flex; flex-direction:column; gap:4px; }
.swr-hop-help, .swr-hop-note, .swr-hop-reason { font-size:13px; line-height:1.4; margin:0; overflow-wrap:anywhere; }
.swr-hop-help { color:#4b5563; }
.swr-hop-reason { color:#92400e; }
.swr-hop-label { font-size:13px; font-weight:600; }
.swr-hop-actions { display:flex; justify-content:flex-end; gap:8px; }
.swr-hop-button { font:inherit; min-height:44px; padding:8px 12px; border-radius:6px; text-align:left;
    border:1px solid var(--nm-ring,#d1d5db); background:#fff; color:#111827; }
.swr-hop-button.swr-hop-primary { background:#1f3a5f; border-color:#1f3a5f; color:#fff; }
.swr-hop-button:disabled { background:#f3f4f6; border-color:#d1d5db; color:#9ca3af; cursor:not-allowed; }
/* Step 4c: the shared archive's optional filter chips ("Received"). */
.srm-myrep-chips { display:flex; flex-wrap:wrap; gap:6px; margin:2px 0 8px; }
.srm-myrep-chip { font:inherit; font-size:13px; min-height:36px; padding:4px 12px; border-radius:999px;
    border:1px solid var(--nm-ring,#d1d5db); background:#fff; color:#111827; }
.srm-myrep-chip.is-selected { background:#1f3a5f; border-color:#1f3a5f; color:#fff; }
/* Step 4c §3.4: "Video awaiting upload from the original device" on a handoff copy (gallery card and inline figure). */
.srm-video-awaiting, .nm-richtext-video-awaiting { display:block; margin:6px 0 0; font-size:13px; color:#92400e; }
.nm-richtext-video-awaiting[hidden] { display:none; }
