/* =============================================================================
 * spine3-kit.css — OPSV4-SPINE-003 · styles for the shared step-panel kit
 * =============================================================================
 *
 * Pairs with web/js/ops-v4/kit/spine3-kit.js. Owned by the Integrator; a lane
 * files a request rather than editing it, so five panels cannot drift into five
 * slightly different Gantts.
 *
 * ⚠ ZERO RAW COLOURS. tools/palette-guard/check-palette.mjs freezes each file's
 * colour set and a file with no ledger entry has a frozen set of NOTHING, so
 * this file is tokens-only from its first line — one `#aabbcc` fails the whole
 * web job. Every colour is a var(--v3-*) from css/lres-v3-tokens.css, which is
 * the only file permitted to mint one. The guard strips block comments but NOT
 * `//` ones; this file uses block comments throughout.
 *
 * Everything is namespaced `ov4k3-`, so it cannot collide with the A0 kit's
 * classes or with jobcard.css.
 * ========================================================================== */

/* ── the dashed "lands here" outline, used by every empty state ───────────── */
.ov4k3-dash {
    border: 2px dashed var(--v3-ov4-dash);
    background: var(--v3-snow);
    border-radius: 10px;
}

/* ── empty shell ──────────────────────────────────────────────────────────── */
.ov4k3-empty {
    display: flex;
    flex-direction: column;
    gap: var(--v3-gap-2);
    padding: var(--v3-gap-4);
    border-radius: 12px;
    background: var(--v3-ov4-idle-bed);
    border: 1px solid var(--v3-mist);
}
.ov4k3-empty-line {
    margin: 0;
    font-size: var(--v3-s-md);
    font-weight: 700;
    color: var(--v3-ink);
}
/* "Fed by step 6" — quieter than the headline, because it is context and not
   the message. */
.ov4k3-empty-fed {
    margin: 0;
    font-size: var(--v3-s-sm);
    color: var(--v3-slate);
}
.ov4k3-empty-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--v3-gap-2);
    margin-top: var(--v3-gap-1);
}

/* ── buttons ──────────────────────────────────────────────────────────────── */
/* 44px floor: 002 §C measured a 38px input on a 1366px laptop and it failed the
   touch-target rule. Nothing in this kit goes under it. */
.ov4k3-btn {
    min-height: 44px;
    padding: 0 var(--v3-gap-3);
    border: 1px solid var(--v3-mist);
    border-radius: 10px;
    background: var(--v3-snow);
    color: var(--v3-ink);
    font-family: inherit;
    font-size: var(--v3-s-sm);
    font-weight: 800;
    cursor: pointer;
}
.ov4k3-btn:hover { border-color: var(--v3-steel); }
.ov4k3-btn-go {
    border: none;
    background: var(--v3-ov4-ok);
    color: var(--v3-snow);
}
.ov4k3-btn:focus-visible,
.ov4k3-shelf button:focus-visible {
    outline: 3px solid var(--v3-green);
    outline-offset: 2px;
}

/* ── KPI tile ─────────────────────────────────────────────────────────────── */
.ov4k3-kpi {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--v3-gap-3);
    box-sizing: border-box;
}
.ov4k3-kpi-k {
    font-size: var(--v3-s-xs);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--v3-slate);
}
.ov4k3-kpi-v {
    font-size: var(--v3-s-lg);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--v3-ink);
}

/* ── generic dashed row ───────────────────────────────────────────────────── */
.ov4k3-row {
    display: grid;
    grid-template-columns: repeat(var(--ov4k3-cols, 4), minmax(0, 1fr));
    gap: var(--v3-gap-2);
}
.ov4k3-row .ov4k3-cell { height: 22px; }

/* ── datedGantt ───────────────────────────────────────────────────────────── */
.ov4k3-gantt {
    display: flex;
    flex-direction: column;
    gap: var(--v3-gap-2);
    min-width: 0;   /* lets the scroller actually shrink inside a grid parent */
}

/* THE CONTAINMENT RULE. The grid scrolls sideways INSIDE this box and the page
   never does. 002 §C found tiles cutting titles mid-line because a wide grid
   escaped its container; `min-width: 0` on the flex/grid ancestors is what
   makes `overflow-x` bite, and `overscroll-behavior-x: contain` stops a
   trackpad swipe at the end of the grid turning into a page-level back
   gesture. */
.ov4k3-gantt-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    min-width: 0;
    padding-bottom: var(--v3-gap-1);
}

/* One column per REAL DATE. 170px sticky name column, then `total` columns that
   are at least 46px and share any slack. No fixed day count anywhere. */
.ov4k3-gantt-inner {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: min-content;
}
.ov4k3-gantt-head,
.ov4k3-gantt-row {
    display: grid;
    grid-template-columns: 170px repeat(var(--ov4k3-cols), minmax(46px, 1fr));
    gap: 3px;
    align-items: center;
}
.ov4k3-gantt-bandwrap {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 3px;
}
.ov4k3-gantt-bands {
    display: grid;
    grid-template-columns: repeat(var(--ov4k3-cols), minmax(46px, 1fr));
    gap: 3px;
}
.ov4k3-band {
    font-size: var(--v3-s-xs);
    font-weight: 800;
    color: var(--v3-night);
    padding: 2px 4px;
    border-left: 2px solid var(--v3-mist);
    white-space: nowrap;
    overflow: hidden;
}

/* The name column is STICKY, so scrolling 28 columns sideways never loses track
   of whose row it is. */
.ov4k3-gantt-name {
    position: sticky;
    left: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 2px var(--v3-gap-2) 2px 0;
    background: var(--v3-snow);
    min-width: 0;
}
.ov4k3-gantt-name b {
    font-size: var(--v3-s-sm);
    color: var(--v3-ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ov4k3-gantt-name small {
    font-size: var(--v3-s-xs);
    color: var(--v3-steel);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ov4k3-col {
    font-size: var(--v3-s-xs);
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    color: var(--v3-slate);
}
/* A weekend reads quieter; a GRACE column (outside the job's own dates, on the
   hire Gantt) reads as amber so it is visibly not part of the job. */
.ov4k3-col.is-weekend { color: var(--v3-steel); }
.ov4k3-col.is-outside { color: var(--v3-ov4-warn); }

.ov4k3-gcell {
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--v3-s-xs);
    font-weight: 800;
    background: var(--v3-ov4-idle-bed);
    color: var(--v3-steel);
}

/* The shared cell vocabulary. A panel picks a class per cell via `cellClass`;
   these are the ones more than one panel needs. Colour is never the only
   carrier — every cell also takes text or an aria-label from the caller. */
.ov4k3-gcell.is-day     { background: var(--v3-ov4-ok);     color: var(--v3-snow); }
.ov4k3-gcell.is-night   { background: var(--v3-night);      color: var(--v3-snow); }
.ov4k3-gcell.is-rest    { background: var(--v3-ov4-idle-bed); color: var(--v3-steel); }
.ov4k3-gcell.is-ok      { background: var(--v3-ov4-ok-bed);  color: var(--v3-green-deep); }
.ov4k3-gcell.is-warn    { background: var(--v3-ov4-warn-bed); color: var(--v3-ov4-warn); }
.ov4k3-gcell.is-bad     { background: var(--v3-ov4-bad);     color: var(--v3-snow); }
.ov4k3-gcell.is-gap     { background: var(--v3-ov4-bad-bed); color: var(--v3-ov4-bad); }
.ov4k3-gcell.is-scope   { background: var(--v3-change);      color: var(--v3-snow); }
.ov4k3-gcell.is-empty   { border: 2px dashed var(--v3-ov4-dash); background: var(--v3-snow); }

.ov4k3-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--v3-gap-3);
    font-size: var(--v3-s-xs);
    color: var(--v3-slate);
}
.ov4k3-legend-item { display: inline-flex; align-items: center; gap: var(--v3-gap-1); }
.ov4k3-legend-sw { width: 14px; height: 14px; border-radius: 4px; background: var(--v3-ov4-idle-bed); }
.ov4k3-legend-sw.is-day   { background: var(--v3-ov4-ok); }
.ov4k3-legend-sw.is-night { background: var(--v3-night); }
.ov4k3-legend-sw.is-gap   { background: var(--v3-ov4-bad-bed); }
.ov4k3-legend-sw.is-scope { background: var(--v3-change); }
.ov4k3-legend-sw.is-empty { border: 2px dashed var(--v3-ov4-dash); background: var(--v3-snow); }

/* ── shelf ────────────────────────────────────────────────────────────────── */
.ov4k3-shelf {
    display: grid;
    grid-template-columns: repeat(var(--ov4k3-per, 4), minmax(0, 1fr));
    gap: var(--v3-gap-3);
}
.ov4k3-slot {
    min-height: 78px;
    box-sizing: border-box;
    padding: var(--v3-gap-3);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
    font-family: inherit;
    border: 2px solid var(--v3-mist);
    background: var(--v3-ov4-idle-bed);
}
.ov4k3-slot.is-ok   { border-color: var(--v3-ov4-ok);   background: var(--v3-ov4-ok-bed); }
.ov4k3-slot.is-warn { border-color: var(--v3-amber);    background: var(--v3-ov4-warn-bed); }
.ov4k3-slot.is-bad  { border-color: var(--v3-ov4-bad);  background: var(--v3-ov4-bad-bed); }
.ov4k3-slot-k   { font-size: var(--v3-s-xs); font-weight: 800; color: var(--v3-slate); }
.ov4k3-slot-v   { font-size: var(--v3-s-md); font-weight: 800; color: var(--v3-ink); }
.ov4k3-slot-sub { font-size: var(--v3-s-xs); color: var(--v3-steel); }

/* ── checklist ────────────────────────────────────────────────────────────── */
.ov4k3-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--v3-gap-2); }
.ov4k3-check { display: flex; align-items: center; gap: var(--v3-gap-2); font-size: var(--v3-s-sm); }
.ov4k3-check-dot {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    box-sizing: border-box;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--v3-s-xs);
    font-weight: 800;
    /* An unticked item is DASHED, not an empty circle: "still to come" rather
       than "something failed to render". */
    border: 2px dashed var(--v3-ov4-dash);
    color: var(--v3-snow);
}
.ov4k3-check.is-done .ov4k3-check-dot { border: none; background: var(--v3-ov4-ok); }
.ov4k3-check-k { flex-grow: 1; color: var(--v3-ink); }
.ov4k3-check-v { color: var(--v3-steel); font-variant-numeric: tabular-nums; }

/* ── thread ───────────────────────────────────────────────────────────────── */
.ov4k3-thread {
    display: flex;
    flex-direction: column;
    gap: var(--v3-gap-2);
    padding: var(--v3-gap-3);
    border-radius: 12px;
    background: var(--v3-ov4-idle-bed);
}
.ov4k3-bubble {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: var(--v3-gap-2) var(--v3-gap-3);
    border-radius: 12px;
    max-width: 82%;
    font-size: var(--v3-s-sm);
}
.ov4k3-bubble.is-us    { align-self: flex-end;   background: var(--v3-ov4-ok-bed); color: var(--v3-ink); }
.ov4k3-bubble.is-them  { align-self: flex-start; background: var(--v3-night-bed);  color: var(--v3-ink); }
/* A generated line is centred, full width and muted, so it can never be
   mistaken for something a person typed. */
.ov4k3-bubble.is-platform {
    align-self: center;
    max-width: 100%;
    background: var(--v3-snow);
    border: 1px solid var(--v3-mist);
    color: var(--v3-slate);
    text-align: center;
}
.ov4k3-bubble-meta { font-size: var(--v3-s-xs); font-weight: 800; color: var(--v3-steel); }
.ov4k3-bubble-text { white-space: pre-wrap; }

/* ── changeBanner ─────────────────────────────────────────────────────────── */
.ov4k3-change {
    display: flex;
    flex-direction: column;
    gap: var(--v3-gap-3);
    padding: var(--v3-gap-4);
    border-radius: 12px;
    background: var(--v3-night-bed);
    border: 1px solid var(--v3-change);
}
.ov4k3-change-head { display: flex; flex-direction: column; gap: 2px; color: var(--v3-night); }
.ov4k3-change-head b { font-size: var(--v3-s-md); }
.ov4k3-change-sub { font-size: var(--v3-s-sm); color: var(--v3-slate); }

.ov4k3-change-rows { display: flex; flex-direction: column; gap: var(--v3-gap-1); }
.ov4k3-change-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 20px minmax(0, 1fr) auto;
    gap: var(--v3-gap-2);
    align-items: center;
    font-size: var(--v3-s-sm);
    padding: var(--v3-gap-2);
    border-radius: 8px;
    background: var(--v3-snow);
}
.ov4k3-change-k { font-weight: 700; color: var(--v3-ink); }
/* The "before" column is always in the DOM and hidden by a class, never
   re-fetched — a before that is looked up again could have moved since. */
.ov4k3-change-before,
.ov4k3-change-arrow { display: none; color: var(--v3-steel); }
.ov4k3-change.is-showing-before .ov4k3-change-before,
.ov4k3-change.is-showing-before .ov4k3-change-arrow { display: inline; }
.ov4k3-change-now { font-weight: 700; color: var(--v3-ink); font-variant-numeric: tabular-nums; }
.ov4k3-change-toggle { align-self: flex-start; }

.ov4k3-tag {
    font-size: var(--v3-s-xs);
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--v3-change);
    color: var(--v3-snow);
    white-space: nowrap;
}

.ov4k3-change-notes {
    margin: 0;
    padding-left: var(--v3-gap-4);
    font-size: var(--v3-s-sm);
    color: var(--v3-slate);
    display: flex;
    flex-direction: column;
    gap: var(--v3-gap-1);
}

/* ── laptop sizing ────────────────────────────────────────────────────────────
   002 §C measured the popout at 1350px and the page card at 1160px from the
   SAME 1440px screen, which is why these are container queries and not media
   queries: the panel must respond to the box it is in, not to the screen. */
@container (max-width: 900px) {
    .ov4k3-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ov4k3-change-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .ov4k3-change-arrow { display: none; }
}
