/* =================================================================
   Jobs - the Job Center (/ops/job-center), My jobs (/jobs, /myjobs)
   and one job (/jobs/{id}, /myjobs/{id}), in the new frame
   (portal-look-and-feel.md 3.18 - the third center, one PR per center).
   -----------------------------------------------------------------
   Every class here is jc- prefixed and owned by this file alone
   (Tests/ConversationBuilderCssOwnershipTests). The shared pieces come
   from components.css (the KPI tile, the code chip, the count, the
   segmented control, empty states, skeletons, the meter), pages.css
   (tabs, the page action menu) and wf.css (cards, buttons, forms, the
   house dialog); this file only lays them out.

   TOKENS ONLY, the whole file (Tests/ShellTokensOnlyTests): no hex, no
   rgb() / hsl(), no colour keyword - every colour reads a --wf-*,
   --theme-* or --conv-* token (the state ink rides --jc-st below).

   NOTHING SCROLLS SIDEWAYS: the board is four lanes, two on a narrower
   page, one on a phone (@container page - the page area is the size
   container); every name ellipsises or wraps inside its card
   (design/portal/job-center/sweep.sh measures 320-1600, rail open and
   folded). The one sticky rule is the job's panel, held at the BOTTOM
   of the sheet (no top - the shell bar's --wf-sticky-top rule does not
   apply), at z 20 (page stickies stay below 30).
   ================================================================= */

/* ---- The page: cards on the 8px rhythm (16-20 between cards) ---- */
.jc-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.jc-page > .wf-page-header,
.jc-page > .wf-page-header.has-tabs { margin-bottom: 4px; }
.jc-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.jc-ellipsis { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.jc-iconbtn { min-width: 32px; padding-left: 8px; padding-right: 8px; justify-content: center; }
.jc-menu-text { display: flex; flex-direction: column; padding: 6px 0; line-height: 1.3; white-space: normal; }
.jc-menu-text > b { font-weight: 500; }
.jc-menu-text > small { color: var(--theme-text-muted); font-size: 11.5px; }
.jc-more-list { min-width: min(17rem, calc(100vw - 32px)); max-width: min(20rem, calc(100vw - 32px)); }

/* A state, as an ink (the words carry the meaning; this is only their tone - the colour grammar, 3.3): not sent yet /
   Sent / not started / waiting are neutral, in progress is the brand, completed is success, cancelled / expired /
   skipped / stopped early are warning, an errored run is danger. */
:where(.jc-page, .jc-send-modal) .is-new { --jc-st: var(--theme-text-secondary); --jc-st-soft: var(--wf-neutral-soft); }
:where(.jc-page, .jc-send-modal) .is-live { --jc-st: var(--wf-primary-ink); --jc-st-soft: var(--wf-primary-soft); }
:where(.jc-page, .jc-send-modal) .is-done { --jc-st: var(--wf-success-ink); --jc-st-soft: var(--wf-success-soft); }
:where(.jc-page, .jc-send-modal) .is-quit { --jc-st: var(--wf-warning-ink); --jc-st-soft: var(--wf-warning-soft); }
:where(.jc-page, .jc-send-modal) .is-error { --jc-st: var(--wf-danger-ink); --jc-st-soft: var(--wf-danger-soft); }
.jc-state { display: inline-flex; align-items: center; gap: 6px; color: var(--jc-st, var(--theme-text-secondary)); font-size: 12px; font-weight: 600; white-space: nowrap; }
.jc-dot { display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--jc-st, var(--theme-text-muted)); }

/* ---- Notes, inline alerts, the calm failure ---- */
.jc-failed { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 16px 18px; }
.jc-failed-text { flex: 1 1 18rem; min-width: 0; margin: 0; color: var(--theme-text-secondary); font-size: 13.5px; }
.jc-unavailable { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 16px 20px 20px; }
.jc-first { padding: 12px 0; overflow: visible; }
.jc-inline-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 14px;
    border-radius: var(--wf-radius-md);
    background: var(--wf-inset);
    color: var(--theme-text-secondary);
    font-size: 13px;
}
.jc-inline-note > .bi { color: var(--wf-primary-ink); }
.jc-inline-note-text { flex: 1 1 14rem; min-width: 0; }
.jc-inline-note.is-ok { background: var(--wf-success-soft); color: var(--theme-text-emphasis); }
.jc-inline-note.is-ok > .bi { color: var(--wf-success-ink); }
.jc-inline-note.is-error { background: var(--wf-danger-soft); color: var(--theme-text-emphasis); }
.jc-inline-note.is-error > .bi { color: var(--wf-danger-ink); }
.jc-inline-note.is-failed > .bi { color: var(--theme-text-muted); }
.jc-inline-note.is-viewing { background: var(--wf-primary-soft); color: var(--theme-text-emphasis); }

/* ---- Skeletons in the shape of what is coming ---- */
.jc-skel-kpi { height: 66px; }
.jc-skel-lanehead { width: 45%; height: 14px; }
.jc-skel-card { height: 118px; }
.jc-skel-card.is-tall { height: 172px; }
.jc-skel-rows { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 8px; }
.jc-card-panel > .jc-skel-rows { padding: 16px 20px 20px; }
.jc-skel-row { height: 44px; }
.jc-skel-field { height: 40px; }
.jc-skel-title { width: min(28rem, 70%); height: 26px; margin: 8px 0 4px; }
.jc-skel-world { height: 260px; margin: 18px 20px; }

/* ---- The numbers (the shared KPI tile, components.css) ----
   One row of tiles on a wide page (four or five - the late tile shows only when an open job carries a promise); on a
   narrower one two columns, the odd last tile spanning the row - never a dangling tile. */
.jc-kpis { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); margin: 0; }

/* ---- The board's toolbar: the two filters the board always had, what they leave ---- */
.jc-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; min-width: 0; }
.jc-select { width: auto; min-width: 11rem; max-width: 18rem; }
.jc-count { color: var(--theme-text-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.jc-filter-label { color: var(--theme-text-secondary); font-size: 13px; font-weight: 600; }

/* =================================================================
   THE BOARD - four lanes on the sheet, each a quiet well whose job
   cards sit on it with real elevation.
   ================================================================= */
.jc-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: start; }
.jc-lane {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-lg);
    background: var(--wf-inset);
    scroll-margin-top: 12px;
}
.jc-lane.is-focus { border-color: var(--wf-primary-ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--wf-primary-ink) 28%, transparent); }
.jc-lane-head { display: flex; align-items: center; gap: 8px; margin: 0; padding: 2px 4px; color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 650; }
.jc-lane-head > .bi { color: var(--wf-primary-ink); }
.jc-lane-title { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.jc-lane-cards { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.jc-lane-empty { margin: 0; padding: 14px 6px; color: var(--theme-text-muted); font-size: 12.5px; text-align: center; }
.jc-lane-empty.is-panel { padding: 18px 20px 22px; text-align: left; }
.jc-lane-more { align-self: center; }

/* ---- One job as a card: the board's (a button) and My jobs' (a link) ---- */
.jc-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-md);
    background: var(--wf-card);
    box-shadow: var(--wf-elev-1);
    color: var(--theme-text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: border-color var(--wf-motion), box-shadow var(--wf-motion), transform var(--wf-motion);
}
.jc-card:hover { border-color: color-mix(in srgb, var(--wf-primary-ink) 45%, var(--wf-line)); box-shadow: var(--wf-elev-2); transform: translateY(-1px); color: var(--theme-text); text-decoration: none; }
.jc-card:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: 2px; }
.jc-card.is-selected { border-color: var(--wf-primary-ink); background: var(--wf-primary-soft); box-shadow: 0 0 0 1px var(--wf-primary-ink), var(--wf-elev-1); }
.jc-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; min-width: 0; }
.jc-card-title {
    display: -webkit-box;
    overflow: hidden;
    color: var(--theme-text-emphasis);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.35;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}
.jc-card-line { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--theme-text-secondary); font-size: 12.5px; }
.jc-card-line > .bi { flex: none; color: var(--wf-primary-ink); }
.jc-card-progress { display: flex; align-items: center; gap: 10px; min-width: 0; margin-top: 2px; }
.jc-meter { flex: 1 1 auto; min-width: 2.5rem; }
.jc-card-progress-text { flex: none; color: var(--theme-text-secondary); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.jc-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.jc-meta { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-width: 0; color: var(--theme-text-secondary); font-size: 12px; }
.jc-meta > .bi { flex: none; color: var(--theme-text-muted); }
.jc-meta.is-nobody { color: var(--theme-text-muted); font-style: italic; }
.jc-meta.is-late, .jc-facts > li.is-late { color: var(--wf-warning-ink); font-weight: 600; }
.jc-meta.is-late > .bi, .jc-facts > li.is-late > .bi { color: var(--wf-warning-ink); }
.jc-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--wf-line); color: var(--wf-primary-ink); font-size: 12.5px; font-weight: 600; }

/* =================================================================
   THE JOB'S PANEL - held at the bottom of the sheet while the board
   scrolls (sticky inside the sheet, never over the rail; at the end of
   the board it settles in place, so every card above it is reachable).
   The float surface, radius xl, elevation 3.
   ================================================================= */
.jc-drill {
    position: sticky;
    bottom: 8px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    max-height: min(70vh, 44rem);
    margin-top: 4px;
    border: 1px solid var(--wf-line);
    border-radius: var(--wf-radius-xl);
    background: var(--theme-background-float);
    box-shadow: var(--wf-elev-3);
}
.jc-drill-head { position: relative; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 16px; padding: 16px 60px 12px 20px; border-bottom: 1px solid var(--wf-line); }
/* Close sits in the head's top-right corner at every width (it never wraps onto a line of its own). */
.jc-drill-close { position: absolute; top: 12px; right: 12px; }
.jc-drill-words { flex: 1 1 18rem; min-width: 0; }
.jc-drill-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.jc-drill-title { margin: 6px 0 4px; overflow: hidden; color: var(--theme-text-emphasis); font-size: var(--wf-text-h2); font-weight: 650; letter-spacing: -0.012em; white-space: nowrap; text-overflow: ellipsis; }
.jc-drill-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; }
.jc-drill-tools > .jc-select { min-width: 9rem; }
/* The panel sits at the bottom of the screen: its menu opens UPWARD, over the board. */
.jc-drill .wf-action-menu-list { top: auto; bottom: calc(100% + 6px); }
.jc-drill > .jc-confirm, .jc-drill > .jc-inline-note { margin: 12px 20px 0; }
.jc-drill-body { min-height: 0; padding: 12px 20px 18px; overflow-y: auto; }
.jc-drill-sub { margin: 0 0 8px; color: var(--theme-text-secondary); font-size: 12.5px; font-weight: 600; }

/* The job's facts, a wrapping row (the panel and one job's page). */
.jc-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0; padding: 0; color: var(--theme-text-secondary); font-size: 12.5px; list-style: none; }
.jc-facts > li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.jc-facts > li > .bi { flex: none; color: var(--wf-primary-ink); }
.jc-facts > li.is-nobody { color: var(--theme-text-muted); font-style: italic; }
.jc-facts.is-page { margin-top: -8px; font-size: 13px; }

/* A confirm step (Cancel job, Decline): a warning-soft bar in the flow - the solid danger button is its second click. */
.jc-confirm {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 14px;
    border-radius: var(--wf-radius-md);
    background: var(--wf-warning-soft);
    color: var(--theme-text-emphasis);
    font-size: 13px;
}
.jc-confirm > .bi { color: var(--wf-warning-ink); }
.jc-confirm-text { flex: 1 1 16rem; min-width: 0; }
.jc-confirm-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; }
/* A conversation's Decline confirm: the sentence on its own line, then the note (it grows) and the two buttons. */
.jc-confirm.is-row { grid-column: 1 / -1; margin-top: 4px; }
.jc-confirm.is-row > .jc-confirm-text { flex-basis: 100%; }
.jc-confirm.is-row > .jc-confirm-actions { flex: 1 1 100%; margin-left: 0; }
.jc-decline-note { flex: 1 1 12rem; width: auto; min-width: 0; }

/* ---- A job's conversations (the panel's list and one job's The work) ---- */
.jc-stages { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.jc-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 14px;
    padding: 10px 0;
    border-top: 1px solid var(--wf-line);
}
.jc-stage:first-child { border-top: 0; }
.jc-stages.is-work { padding: 4px 20px 12px; }
.jc-stages.is-work > .jc-stage { grid-template-columns: auto minmax(0, 1fr) auto; }
.jc-stage.is-waiting .jc-stage-name { color: var(--theme-text-secondary); }
.jc-stage-glyph { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--wf-radius-tile); background: var(--jc-st-soft, var(--wf-neutral-soft)); color: var(--jc-st, var(--theme-text-secondary)); font-size: 15px; }
.jc-stage-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.jc-stage-name { overflow: hidden; color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.jc-stage-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; }
.jc-stage-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.jc-stage-tools > .jc-select { min-width: 9rem; }
.jc-ready { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: var(--wf-radius-pill); background: var(--wf-success-soft); color: var(--wf-success-ink); font-size: 11.5px; font-weight: 600; }

/* =================================================================
   CARDS WITH A HEAD (the Reminders tab, one job's world and its work)
   ================================================================= */
.jc-card-panel { min-width: 0; overflow: visible; }
.jc-panel-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; padding: 18px 20px 6px; }
.jc-panel-words { flex: 1 1 16rem; min-width: 0; }
.jc-panel-title { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--theme-text-emphasis); font-size: var(--wf-text-h3); font-weight: 650; letter-spacing: -0.005em; }
.jc-panel-title > .bi { color: var(--wf-primary-ink); }
.jc-panel-sub { max-width: 68ch; margin: 3px 0 0; color: var(--theme-text-secondary); font-size: 13px; line-height: 1.45; }
.jc-panel-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.jc-card-panel > .wf-empty { padding-bottom: 28px; }

/* ---- Reminders ---- */
.jc-nudges { margin: 0; padding: 4px 8px 10px; list-style: none; }
.jc-nudge {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 14px;
    padding: 10px 12px;
    border-radius: var(--wf-radius-md);
    color: var(--theme-text);
    text-decoration: none;
}
.jc-nudge:hover { background: var(--wf-card-hover); color: var(--theme-text); text-decoration: none; }
.jc-nudge:focus-visible { outline: 2px solid var(--wf-primary-ink); outline-offset: -2px; }
.jc-nudge-words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.jc-nudge-text { color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.jc-nudge-sub { color: var(--theme-text-muted); font-size: 12.5px; overflow-wrap: anywhere; }
.jc-nudge-due { color: var(--theme-text-secondary); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* =================================================================
   MY JOBS - the person's own list: a segmented control and a grid of
   the same job cards, each a link.
   ================================================================= */
.jc-seg { flex-wrap: wrap; max-width: 100%; }
.jc-seg > button { display: inline-flex; align-items: center; gap: 6px; }
.jc-seg-count { color: var(--theme-text-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.jc-mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 14px; align-items: start; }
.jc-mine-grid > .jc-card { height: 100%; }

/* =================================================================
   ONE JOB - the world beside the work; a back link only where the
   shell bar (and its trail) is hidden.
   ================================================================= */
.jc-back { display: none; align-items: center; gap: 6px; align-self: flex-start; color: var(--wf-primary-ink); font-size: 13px; font-weight: 600; text-decoration: none; }
/* The work comes FIRST in the page (what to do - and what a screen reader meets first); on a wide page it sits in the
   right-hand column beside the world, on a narrower one above it. */
.jc-job-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: start; }
.jc-job-grid > .jc-work { grid-column: 2; grid-row: 1; }
.jc-job-grid > .jc-job-col { grid-column: 1; grid-row: 1; }
.jc-job-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.jc-map-card { padding: 12px 12px 0; overflow: hidden; }
.jc-world { display: flex; flex-direction: column; padding: 4px 20px 16px; }
.jc-slot { min-width: 0; padding: 14px 0; border-top: 1px solid var(--wf-line); }
.jc-slot:first-child { border-top: 0; }
.jc-slot-title { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--theme-text-emphasis); font-size: 13.5px; font-weight: 650; }
.jc-slot-title > .bi { color: var(--wf-primary-ink); }
.jc-kv { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 0 16px; margin: 0; }
.jc-kv-row { display: contents; }
.jc-kv-row > dt { padding: 5px 0; overflow-wrap: anywhere; color: var(--theme-text-secondary); font-size: 12.5px; font-weight: 500; }
.jc-kv-row > dd { margin: 0; padding: 5px 0; overflow-wrap: anywhere; color: var(--theme-text-emphasis); font-size: 13px; }
.jc-slot-table { width: 100%; margin: 0; table-layout: fixed; }
.jc-slot-table td, .jc-slot-table th { overflow-wrap: anywhere; }

/* =================================================================
   SEND A NEW JOB (the house dialog - wf.css .modal*)
   ================================================================= */
.jc-send-dialog { max-width: min(36rem, calc(100vw - 32px)); }
.jc-send-title { display: flex; align-items: center; gap: 10px; font-size: 1.0625rem; }
.jc-send-body { display: flex; flex-direction: column; gap: 16px; }
.jc-send-intro { margin: 0; color: var(--theme-text-secondary); font-size: 13.5px; }
.jc-field { display: flex; flex-direction: column; min-width: 0; }
.jc-field > .form-label { margin-bottom: 6px; }
.jc-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.jc-fieldset > legend { float: none; width: auto; margin-bottom: 8px; padding: 0; }
.jc-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.jc-sublabel { font-weight: 500; color: var(--theme-text-secondary); }
.jc-hint { margin-top: 6px; }

/* =================================================================
   NARROWER PAGES (the page area is the size container - .wf-page-area)
   ================================================================= */
@container page (max-width: 980px) {
    .jc-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .jc-job-grid { grid-template-columns: minmax(0, 1fr); }
    .jc-job-grid > .jc-work, .jc-job-grid > .jc-job-col { grid-column: auto; grid-row: auto; }
}

/* Two balanced rows: five tiles are three over two (a six-column grid), four are two over two. */
@container page (max-width: 860px) {
    .jc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .jc-kpis:has(> .wf-kpi:nth-child(5)) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .jc-kpis:has(> .wf-kpi:nth-child(5)) > .wf-kpi { grid-column: span 2; }
    .jc-kpis:has(> .wf-kpi:nth-child(5)) > .wf-kpi:nth-child(n+4) { grid-column: span 3; }
}

/* A phone: two columns, the odd last tile spanning the row. */
@container page (max-width: 560px) {
    .jc-kpis,
    .jc-kpis:has(> .wf-kpi:nth-child(5)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .jc-kpis:has(> .wf-kpi:nth-child(5)) > .wf-kpi,
    .jc-kpis:has(> .wf-kpi:nth-child(5)) > .wf-kpi:nth-child(n+4) { grid-column: auto; }
    .jc-kpis > .wf-kpi:last-child:nth-child(odd),
    .jc-kpis:has(> .wf-kpi:nth-child(5)) > .wf-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@container page (max-width: 640px) {
    .jc-board { grid-template-columns: minmax(0, 1fr); }
    .jc-select { flex: 1 1 100%; max-width: none; }
    .jc-drill { max-height: 78vh; }
    .jc-drill-head { padding-left: 16px; padding-right: 56px; }
    .jc-drill-close { top: 10px; right: 8px; }
    .jc-drill-body { padding-left: 16px; padding-right: 16px; }
    .jc-drill > .jc-confirm, .jc-drill > .jc-inline-note { margin-left: 16px; margin-right: 16px; }
    .jc-drill-tools { justify-content: flex-start; margin-left: 0; }
    .jc-drill-tools > .jc-select { flex: 1 1 10rem; }
    .jc-stage, .jc-stages.is-work > .jc-stage { grid-template-columns: minmax(0, 1fr); }
    .jc-stages.is-work > .jc-stage > .jc-stage-glyph { display: none; }
    .jc-stage-tools { justify-content: flex-start; }
    .jc-stage-tools > .jc-select { flex: 1 1 10rem; }
    .jc-stages.is-work { padding-left: 16px; padding-right: 16px; }
    .jc-panel-head { padding: 16px 16px 6px; }
    .jc-world { padding: 4px 16px 14px; }
    .jc-kv { grid-template-columns: minmax(0, 1fr); }
    .jc-kv-row > dt { padding-bottom: 0; }
    .jc-kv-row > dd { padding-top: 1px; }
    .jc-nudge { grid-template-columns: auto minmax(0, 1fr); }
    .jc-nudge-due { grid-column: 2; white-space: normal; }
    .jc-mine-grid { grid-template-columns: minmax(0, 1fr); }
    .jc-seg { width: 100%; }
    .jc-seg > button { flex: 1 1 auto; justify-content: center; }
    .jc-field-row { grid-template-columns: minmax(0, 1fr); }
    /* A list slot's table becomes a stacked card per row: each value under its column's name. */
    .jc-slot-table, .jc-slot-table > tbody { display: block; width: 100%; }
    .jc-slot-table > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .jc-slot-table > tbody > tr { display: block; padding: 8px 0; border-top: 1px solid var(--wf-line); }
    .jc-slot-table > tbody > tr:first-child { border-top: 0; }
    .jc-slot-table > tbody > tr > td { display: flex; flex-direction: column; padding: 2px 0; border: 0; }
    .jc-slot-table > tbody > tr > td::before { content: attr(data-label); color: var(--theme-text-muted); font-size: 11.5px; font-weight: 600; }
    .jc-slot-table > tbody > tr > td:empty { display: none; }
}

/* Where the shell bar is hidden (a phone - nav-side.css hides it under 768px of viewport), the trail goes with it: one
   job's page shows its own way back to My jobs. And where the page header puts its actions at the LEFT, the More menu
   opens from its start, inward. */
@media (max-width: 767.98px) {
    .jc-back { display: inline-flex; }
    .jc-more .wf-action-menu-list[role="menu"] { right: auto; left: 0; }
}

/* A TOUCH SCREEN (portal-look-and-feel 3.17): 44px targets and 16px inputs. wf.css raises the regular controls; the
   page raises its small ones. */
@media (pointer: coarse) {
    .jc-page .btn-sm, .jc-send-modal .btn-sm, .jc-iconbtn { min-width: 44px; min-height: 44px; }
    .jc-page .form-select-sm, .jc-page .form-control-sm { min-height: 44px; font-size: 16px; }
    .jc-page .wf-tab { min-height: 44px; }
    .jc-seg > button { min-height: 44px; }
    .jc-page .wf-action-menu-item { min-height: 44px; }
    .jc-send-modal .btn-close { min-width: 44px; min-height: 44px; }
    .jc-nudge { min-height: 44px; }
    .jc-back { min-height: 44px; }
    /* The map's address link (no map position - the shared MiniMap draws a plain link): a whole-row target here. */
    .jc-map-card .wf-minimap__fallback { display: inline-flex; align-items: center; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    .jc-card { transition: none; }
    .jc-card:hover { transform: none; }
}

/* Who made the job - the drill panel's "Open the rule" (dispatch batch S). */
.jc-origin-open { margin-left: 0.5rem; padding: 0 0.375rem; }
