:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17233a;
  background: #f4f6f9;
}

* { box-sizing: border-box; }
body { margin: 0; }
.page-shell { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 48px; }
h1, h2, h3 { color: #132440; line-height: 1.2; }
h1 { margin: 6px 0 20px; font-size: clamp(1.75rem, 4vw, 2.25rem); }
h2 { margin-top: 0; font-size: 1.25rem; }
.context, .muted { color: #5c6c80; }
.context { font-size: .875rem; }
.panel { margin: 16px 0; padding: 20px; border: 1px solid #d7e0eb; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgb(23 35 58 / 4%); }
.selection-form { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; }
.form-field { display: grid; gap: 5px; font-weight: 600; }
input[type="text"] { width: 12rem; padding: .6rem .7rem; border: 1px solid #8e9eaf; border-radius: 5px; font: inherit; }
button, .button-link { min-height: 2.55rem; padding: .55rem 1rem; border: 0; border-radius: 5px; background: #1c5d9f; color: #fff; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
button:hover, .button-link:hover { background: #144b82; }
.check { display: flex; align-items: center; gap: .45rem; min-height: 2.55rem; }
.validation, .error { color: #9d1c22; }
.notice, .warning, .error-panel { border-radius: 7px; padding: .8rem 1rem; }
.notice { background: #eef5ff; border: 1px solid #bdd4f0; }
.warning { background: #fff6de; border: 1px solid #e7cb7e; }
.error-panel { background: #fff0f1; border: 1px solid #e7bcc1; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 28px; }
.summary-grid dt { margin-bottom: .2rem; color: #647386; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.summary-grid dd { margin: 0; overflow-wrap: anywhere; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.scroll { overflow-x: auto; }
table { width: 100%; min-width: 980px; border-collapse: collapse; margin-top: 16px; }
th, td { padding: .7rem .55rem; border-bottom: 1px solid #dde5ee; text-align: left; vertical-align: top; }
th { color: #35465d; background: #f3f6f9; font-size: .8rem; }
td { overflow-wrap: anywhere; }
.notes { min-width: 15rem; max-width: 27rem; white-space: pre-wrap; }
.details { margin-top: .35rem; }
.details summary { cursor: pointer; color: #1c5d9f; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 20px; margin: .7rem 0 0; }
.details-grid dt { color: #647386; font-size: .8rem; }
.details-grid dd { margin: 0 0 .45rem; overflow-wrap: anywhere; }
.deleted { color: #9d1c22; font-weight: 650; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 600px) {
  .page-shell { width: min(100% - 20px, 1240px); padding-top: 16px; }
  .panel { padding: 14px; }
  .selection-form > button { width: 100%; }
}

/* Workstation evidence viewer */
nav { margin-bottom: 1.4rem; }
.ws-filters { display:flex; flex-wrap:wrap; gap:1rem; align-items:end; margin:1.5rem 0; }
.ws-filters label { display:flex; flex-direction:column; gap:.35rem; }
.ws-filters input,.ws-filters select { padding:.55rem; max-width:100%; }
.ws-warning { border-left:3px solid #c58b23; padding:.65rem 1rem; background:#fff6df; color:#493711; }
.ws-timeline { padding-left:1.5rem; }
.ws-timeline li { border-left:4px solid #247d9f; background:#eef5f8; color:#172a3c; padding:.8rem; margin:.5rem 0; }
.ws-timeline span { display:block; margin-top:.3rem; }
.ws-selected, tr:target { background:#fff0b8!important; outline:2px solid #9f7712; }
.table-scroll { overflow-x:auto; }
section { margin-block:1.8rem; }

.ws-queue { max-height:26rem; }
.ws-timeline { max-height:36rem; overflow:auto; }
.ws-queue th { position:sticky; top:0; background:#eef3f8; color:#172a3c; }

.production-banner { background:#8a1c1c; color:#fff; font-weight:700; padding:.6rem 1rem; text-align:center; letter-spacing:.02em; }

/* Project schedule (Gantt). The axis is working time: each day column is one 480-minute shop day. */
.gantt-issues { border-left:4px solid #b7791f; background:#fffaf0; padding:.6rem 1rem; margin-block:.8rem; }
.gantt-issues h3 { margin:0 0 .3rem; font-size:1rem; }
.gantt-issues ul { margin:0; padding-left:1.2rem; }
.gantt-issues a { margin-right:.3rem; }
.gantt-legend { display:flex; flex-wrap:wrap; gap:.4rem 1.2rem; list-style:none; padding:0; margin:.6rem 0; font-size:.85rem; }
.gantt-legend li { display:flex; align-items:center; gap:.35rem; }
.gantt-swatch { display:inline-block; width:1.4rem; height:.75rem; border-radius:2px; }
.gantt-swatch.overlap { background:#fff; outline:2px solid #c53030; outline-offset:-2px; }
.gantt-swatch.marker { width:.75rem; background:#4a5568; transform:rotate(45deg); }
.gantt-swatch.due { width:2px; background:#b7791f; }
.gantt { overflow:auto; max-height:44rem; border:1px solid #d5dde6; background:#fff; }
.gantt-inner { position:relative; }
.gantt-row { display:flex; height:1.75rem; border-bottom:1px solid #edf1f5; }
.gantt-row:target { background:#fff8d6; }
.gantt-label { flex:0 0 var(--gantt-label); width:var(--gantt-label); position:sticky; left:0; z-index:3; display:flex; align-items:center; gap:.4rem;
  padding:0 .5rem; background:#f7f9fb; border-right:1px solid #d5dde6; font-size:.82rem; white-space:nowrap; overflow:hidden; }
.gantt-label a { overflow:hidden; text-overflow:ellipsis; flex:1 1 auto; }
.gantt-order { flex:0 0 3.4rem; color:#5a6b7b; font-variant-numeric:tabular-nums; }
.gantt-order.out-of-sequence { color:#9c4221; font-weight:700; }
.gantt-heading-task { flex:1 1 auto; }
.gantt-legend .gantt-order { flex:0 0 auto; }
.gantt-status { flex:0 0 auto; padding:0 .35rem; border-radius:3px; color:#fff; font-size:.72rem; font-weight:700; }
.gantt-track { position:relative; flex:0 0 auto;
  background-image:linear-gradient(to right, #e3e9ef 1px, transparent 1px); background-size:var(--gantt-day) 100%; }
.gantt-days, .gantt-milestones { position:sticky; z-index:4; background:#eef3f8; font-size:.75rem; font-weight:700; }
.gantt-milestones { top:0; }
.gantt-days { top:1.75rem; }
.gantt-days .gantt-label, .gantt-milestones .gantt-label { background:#eef3f8; z-index:5; }
.gantt-day { position:absolute; top:0; width:var(--gantt-day); line-height:1.75rem; text-align:center; color:#172a3c; overflow:hidden; }
.gantt-day.week-start { border-left:2px solid #8fa3b8; }
.gantt-body { position:relative; }
.gantt-bar { position:absolute; top:.3rem; height:1.15rem; border-radius:3px; box-sizing:border-box; z-index:1; }
.gantt-marker { position:absolute; top:.45rem; width:.8rem !important; height:.8rem; margin-left:-.4rem; transform:rotate(45deg); box-sizing:border-box; z-index:1; }
.status-active { background:#2b6cb0; }
.status-staged { background:#2f855a; }
.status-pending { background:#8795a5; }
.status-closed, .actual { background:#4a5568; }
.gantt-bar.overlap, .gantt-marker.overlap { outline:2px solid #c53030; outline-offset:1px; }
.gantt-due { position:absolute; top:.15rem; width:2px; height:1.45rem; background:#b7791f; }
.gantt-uncharted { position:sticky; left:calc(var(--gantt-label) + .5rem); font-size:.78rem; line-height:1.75rem; }
.gantt-milestone-line { position:absolute; top:0; bottom:0; width:0; border-left:2px dashed; z-index:2; pointer-events:none; }
.gantt-milestone-flag { position:absolute; top:.2rem; transform:translateX(-100%); padding:0 .4rem; border-radius:3px 0 0 3px; color:#fff; line-height:1.35rem; white-space:nowrap; }
.milestone-projectdue { border-color:#805ad5; }
.milestone-estimatedship { border-color:#dd6b20; }
.milestone-shipby { border-color:#c53030; }
.gantt-milestone-flag.milestone-projectdue { background:#805ad5; }
.gantt-milestone-flag.milestone-estimatedship { background:#dd6b20; top:.2rem; }
.gantt-milestone-flag.milestone-shipby { background:#c53030; }
.gantt-milestone-flag.flip { transform:none; border-radius:0 3px 3px 0; }
.gantt-line { flex:0 0 5rem; overflow:hidden; text-overflow:ellipsis; color:#172a3c; font-weight:600; }
.gantt-bar.early, .gantt-marker.early { outline:2px solid #c05621; outline-offset:1px; }
.gantt-swatch.early { background:#fff; outline:2px solid #c05621; outline-offset:-2px; }

/* Vendor invoice review POC. All comparison colors signal evidence to inspect, not approval. */
.page-shell-wide { width:calc(100% - 32px); }
.invoice-heading { margin-bottom:1.2rem; }
.invoice-heading h1 { margin-bottom:.45rem; }
.eyebrow { margin:0; color:#176756; font-size:.78rem; font-weight:750; letter-spacing:.08em; text-transform:uppercase; }
.invoice-upload { display:grid; grid-template-columns:minmax(0, 1fr) auto; align-items:end; gap:1.25rem; }
.invoice-upload form { display:flex; flex-wrap:wrap; align-items:end; justify-content:end; gap:.7rem; }
.file-picker { display:grid; gap:.35rem; color:#35465d; font-weight:650; }
.file-picker input { max-width:100%; }
.invoice-upload #invoice-upload-progress { flex-basis:100%; margin:0; }
.invoice-progress { border-left:4px solid #1c5d9f; }
.invoice-steps { display:flex; flex-wrap:wrap; gap:.8rem 1.4rem; margin:1.1rem 0; color:#5c6c80; }
.invoice-steps .complete { color:#176756; font-weight:700; }
.invoice-steps strong { color:#132440; }
.invoice-review-grid { display:grid; grid-template-columns:minmax(0, 1fr); }
.invoice-details { min-width:0; }
.invoice-summary-grid { margin:1rem 0; }
.invoice-summary-grid > div { min-width:0; }
.invoice-reference-list { margin:.5rem 0 1rem; padding-left:1.3rem; }
.invoice-reference-list code { white-space:pre-wrap; overflow-wrap:anywhere; }
.invoice-po-form { display:flex; flex-wrap:wrap; align-items:end; gap:.7rem; margin:.75rem 0; }
.invoice-po-form label { display:grid; gap:.3rem; color:#35465d; font-weight:650; }
.invoice-po-form input { width:14rem; max-width:100%; padding:.6rem .7rem; border:1px solid #8e9eaf; border-radius:5px; font:inherit; }
.invoice-comparison-summary { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:.75rem; margin:1rem 0; }
.invoice-comparison-summary > div { padding:.8rem; border:1px solid #d7e0eb; border-radius:6px; background:#f8fafc; }
.invoice-comparison-summary p { margin:.45rem 0 0; }
.invoice-lines table { min-width:1120px; }
.invoice-extracted-lines table { min-width:920px; }
.invoice-lines select { width:100%; min-width:15rem; padding:.42rem; font:inherit; }
.line-match { display:block; margin-top:.35rem; }
.delta { color:#9b5c13; font-weight:750; }
.invoice-footer { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-top:1.2rem; padding:.8rem 0; }
.invoice-footer form { margin:0; flex:0 0 auto; }
.button-link.secondary, button.secondary { color:#1c5d9f; border:1px solid #9ab5d0; background:#fff; }
.button-link.secondary:hover, button.secondary:hover { color:#fff; background:#1c5d9f; }

@media (max-width: 900px) {
  .invoice-upload { grid-template-columns:1fr; }
  .invoice-upload form { justify-content:start; }
}

@media (max-width: 600px) {
  .invoice-comparison-summary { grid-template-columns:1fr; }
  .invoice-footer { align-items:flex-start; flex-direction:column; }
  .invoice-po-form > button { width:100%; }
}
/* Workstation Gantt: no milestone row, so the day header sticks to the top. */
.gantt.no-milestones .gantt-days { top:0; }
.gantt-project { flex:0 0 4.2rem; font-variant-numeric:tabular-nums; }
.gantt-label a.gantt-project { flex:0 0 4.2rem; }
.gantt-task-name { flex:1 1 auto; overflow:hidden; text-overflow:ellipsis; }
.gantt-row.ws-selected .gantt-label { background:#fff8d6; }

/* Production week board: stations by day on the 07:00-16:00 wall clock. */
.pw-weeknav { display:flex; align-items:center; gap:1.2rem; margin:.6rem 0; }
.pw-picker { flex:1 1 100%; }
.pw-picker-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(16rem, 1fr)); gap:.1rem .8rem; max-height:14rem; overflow:auto; padding:.4rem 0; }
.pw-scroll { overflow:auto; border:1px solid #d5dde6; background:#fff; }
.pw-grid { display:grid; grid-template-columns:13rem repeat(5, minmax(9.5rem, 1fr)); min-width:62rem; }
.pw-head { position:sticky; top:0; z-index:2; padding:.4rem .5rem; background:#eef3f8; font-size:.8rem; font-weight:700; border-bottom:1px solid #d5dde6; border-left:1px solid #d5dde6; }
.pw-head.pw-corner { border-left:0; left:0; z-index:3; }
.pw-hours { margin-left:.4rem; font-weight:400; color:#5c6c80; }
.pw-station { position:sticky; left:0; z-index:1; display:flex; flex-direction:column; gap:.1rem; padding:.45rem .5rem; background:#fff; border-bottom:1px solid #edf1f5; font-size:.85rem; }
.pw-shared { align-self:flex-start; padding:0 .35rem; border-radius:3px; background:#fff6df; border:1px solid #c58b23; color:#493711; font-size:.7rem; font-weight:700; }
.pw-count { font-size:.75rem; }
.pw-cell { position:relative; height:3rem; border-left:1px solid #d5dde6; border-bottom:1px solid #edf1f5; }
.pw-lunch { position:absolute; top:0; bottom:0; background:repeating-linear-gradient(135deg, #f1f3f6 0 4px, #e6eaef 4px 8px); }
.pw-block { position:absolute; top:.35rem; bottom:.35rem; z-index:1; min-width:3px; overflow:hidden; padding:0 .25rem; border-radius:3px; border:1px solid rgb(255 255 255 / 55%); box-sizing:border-box;
  color:#fff; font-size:.72rem; font-weight:700; line-height:1.9rem; white-space:nowrap; text-decoration:none; }
.pw-block:hover { filter:brightness(1.12); }
.pw-block.early { outline:2px solid #c05621; outline-offset:1px; }
.pw-marker { position:absolute; top:1.05rem; width:.8rem; height:.8rem; margin-left:-.4rem; transform:rotate(45deg); z-index:1; }
.pw-lunch-swatch { display:inline-block; width:1.4rem; height:.75rem; background:repeating-linear-gradient(135deg, #f1f3f6 0 4px, #d5dbe3 4px 8px); border:1px solid #c7ced8; }

/* Hosted schedule app (sign-in, setup, user administration) */
.inline-form { display:inline-flex; gap:.6rem; align-items:center; margin-left:1.2rem; }
.inline-form button { min-height:0; padding:.25rem .7rem; }
.auth-form { display:grid; gap:.8rem; max-width:24rem; }
.auth-form label { display:grid; gap:.25rem; font-weight:600; }
.auth-form input[type="text"], .auth-form input[type="password"], .auth-form input[type="number"] { width:100%; box-sizing:border-box; padding:.6rem .7rem; border:1px solid #8e9eaf; border-radius:5px; font:inherit; }
.secret-link { font-family:ui-monospace,Consolas,monospace; word-break:break-all; padding:.6rem .8rem; background:#f4f6f9; border:1px solid #d7e0eb; border-radius:5px; }

/* ---- Hosted daily WELD board (read-only) --------------------------------------------------- */
/* Ported from BusinessSystem's productionSchedule.css so the board reads like the one the shop
   already uses: TIME vertical on the left, one lane per workstation across. BS's rules lean on
   Bootstrap custom properties; those are mapped to CIAI's own palette here rather than pulling
   Bootstrap in. Class names are kept (.ps-*) so a future BS diff still lines up. */
:root { --ps-hour-px: 56px; --ps-station-min: 116px; --ps-line: #d5dde6; --ps-head: #eef3f8; }

.ps-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 0; padding: .55rem .7rem; border: 1px solid var(--ps-line); border-radius: 8px 8px 0 0; background: var(--ps-head); }
.ps-toolbar label { display: flex; align-items: center; gap: .4rem; font-weight: 600; }
.ps-toolbar input[type="date"] { padding: .35rem .5rem; border: 1px solid #8e9eaf; border-radius: 5px; font: inherit; }
.ps-toolbar button { min-height: 0; padding: .35rem .8rem; }
.ps-toolbar-right { margin-left: auto; font-size: .82rem; }
.ps-viewbtn { padding: .35rem .8rem; border-radius: 5px; background: #1c5d9f; color: #fff; font-weight: 650; }
/* background is NOT optional here. The element rule at the top of this file gives every <button> a
   #1c5d9f background with white text; this class overrides the colour to #1c5d9f but, until the
   background was stated too, left the element rule's blue in place - so a .ps-navbtn BUTTON rendered
   #1c5d9f text on a #1c5d9f background and was invisible until hover restored white text. It went
   unnoticed because the board's own nav uses this class on <a>, which the element rule never
   matches; the reservation editor is the first place it sits on real buttons. button.secondary just
   below does the same thing for the same reason. */
.ps-navbtn { padding: .35rem .7rem; border: 1px solid #9ab5d0; border-radius: 5px; background: #fff; color: #1c5d9f; text-decoration: none; font-weight: 650; }
.ps-navbtn:hover { color: #fff; background: #1c5d9f; }
.ps-navbtn:focus-visible { outline: 2px solid #1c5d9f; outline-offset: 2px; }
/* Disabled has to differ by more than opacity against a white background, or a disabled Save reads
   as merely a paler live one. */
.ps-navbtn:disabled, .ps-navbtn[disabled] { background: #f1f4f8; color: #6b7a8c; border-color: #c9d6e3; cursor: not-allowed; }
.ps-navbtn:disabled:hover, .ps-navbtn[disabled]:hover { background: #f1f4f8; color: #6b7a8c; }

#queue-station { padding: .55rem; border: 1px solid #8e9eaf; border-radius: 5px; font: inherit; max-width: 100%; }
.unreserved-table { min-width: 720px; }
#ed-remove[hidden] { display: none; }

.ps-picker { flex: 1 1 100%; }
.ps-picker summary { cursor: pointer; color: #1c5d9f; font-weight: 650; }
.ps-picker-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .1rem .8rem; max-height: 12rem; overflow: auto; padding: .4rem 0; }
.ps-picker p { margin: .2rem 0 0; font-size: .8rem; }
.ps-board-wrap { overflow: auto; max-height: 78vh; border: 1px solid var(--ps-line); border-radius: 0 0 8px 8px; background: #fff; position: relative; }
.ps-board { display: inline-block; min-width: 100%; }
.ps-days, .ps-schedule { display: grid; grid-template-columns: 74px minmax(var(--ps-lanes-min, calc(var(--ps-stations, 10) * var(--ps-station-min))), 1fr); }
.ps-days { background: var(--ps-head); border-bottom: 1px solid var(--ps-line); position: sticky; top: 0; z-index: 6; }
.ps-corner { font-size: 11px; color: #5c6c80; padding: 14px 8px; display: flex; align-items: flex-end; position: sticky; left: 0; z-index: 7; background: var(--ps-head); }
.ps-dayhead { border-left: 2px solid var(--ps-line); text-align: center; }
.ps-daytitle { padding: 10px 0 8px; font-size: 14px; font-weight: 700; color: #132440; }
.ps-daytitle span { font-weight: 400; color: #5c6c80; margin-left: 5px; }
.ps-stations { display: grid; grid-template-columns: var(--ps-lane-tracks, repeat(var(--ps-stations, 10), 1fr)); border-top: 1px solid var(--ps-line); }
.ps-stationhead { padding: 7px 2px; font-size: 10px; border-left: 1px solid var(--ps-line); line-height: 1.4; color: #5c6c80; text-align: center; }
.ps-stationhead b { display: block; font-size: 12px; color: #132440; }

/* Time runs DOWN. The rail is sticky so it stays beside the lanes when they scroll sideways. */
.ps-timerail { height: calc(var(--ps-hour-px) * var(--ps-hours, 12)); position: sticky; left: 0; z-index: 5; background: var(--ps-head); border-right: 1px solid var(--ps-line); }
.ps-time { position: absolute; left: 8px; font-size: 11px; color: #5c6c80; transform: translateY(-50%); }
.ps-time:first-child { transform: none; }
.ps-daybody { height: calc(var(--ps-hour-px) * var(--ps-hours, 12)); position: relative; display: grid; grid-template-columns: var(--ps-lane-tracks, repeat(var(--ps-stations, 10), 1fr)); border-left: 2px solid var(--ps-line); }
.ps-lane { position: relative; border-left: 1px solid var(--ps-line); background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--ps-hour-px) - 1px), #edf1f5 calc(var(--ps-hour-px) - 1px), #edf1f5 var(--ps-hour-px)); }
.ps-lunch { position: absolute; left: 0; right: 0; z-index: 2; background: repeating-linear-gradient(135deg, rgb(128 128 128 / 9%) 0 4px, transparent 4px 8px); pointer-events: none; }

.ps-job { position: absolute; box-sizing: border-box; left: calc(100% / var(--ps-columns, 1) * var(--ps-column, 0) + 3px); width: calc(100% / var(--ps-columns, 1) - 6px); border: 1px solid #a9c6ef; border-left: 5px solid #1f6fb2; border-radius: 4px; background: #e9f1fd; color: #234f8d; text-align: left; padding: 4px 3px; overflow: hidden; font-size: 10px; line-height: 1.35; z-index: 3; text-decoration: none; }
.ps-job:hover { filter: brightness(.97); z-index: 4; }
.ps-job strong { display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-job .ps-desc { display: block; margin-top: 2px; overflow-wrap: anywhere; }
.ps-job .ps-part { display: block; margin-top: 3px; font-size: 9px; opacity: .85; }
/* Status tint, as on the BS board: planned green, completed grey, attention amber with a red edge. */
.ps-job.ps-st-active { background: #e6f4e7; border-color: #9fd2a3; border-left-color: #2e7d32; color: #1b5e20; }
.ps-job.ps-st-staged { background: #fff0de; border-color: #f3bf80; border-left-color: #e07b00; color: #8a4500; }
.ps-job.ps-history { background: #eceff1; border-color: #cfd8dc; border-left-color: #78909c; color: #546e7a; }
.ps-job.ps-attention { box-shadow: 0 0 0 1px #c05621; }
/* The fill retains lifecycle meaning; a red frame plus words identifies simultaneous capacity. */
.ps-job.ps-overlap { border: 2px solid #c62828; box-shadow: 0 0 0 1px #c62828; }
.ps-overlap-label { display: block; margin-top: 3px; color: #b71c1c; font-weight: 700; }
.gantt-swatch.ps-sw-overlap { background: #fff; border: 2px solid #c62828; }
.gantt-swatch.ps-sw-active { background: #e6f4e7; border: 1px solid #2e7d32; }
.gantt-swatch.ps-sw-history { background: #eceff1; border: 1px solid #78909c; }
.gantt-swatch.ps-sw-attention { background: #fff0de; border: 1px solid #c05621; }

.board-chip { align-self: flex-start; padding: 0 .35rem; border-radius: 3px; font-size: .7rem; font-weight: 700; }
.board-chip.warn { background: #fff6df; border: 1px solid #c58b23; color: #493711; }

/* Every reservation in words, reachable by keyboard and touch: a lane block can be minutes tall, so
   it can never be the only place the task, times and minutes exist. */
.board-list { display: grid; gap: .7rem; margin: .8rem 0 0; padding: 0; list-style: none; }
.board-list-item { border-left: 4px solid #2b6cb0; background: #f8fafc; padding: .75rem .9rem; scroll-margin-top: 1rem; }
.board-list-item:target { background: #fff8d6; outline: 2px solid #9f7712; }
.board-attention-row { border-left-color: #c05621; background: #fffaf4; }
.board-history-row { border-left-color: #6b7a8d; }
.board-list-item h3 { margin: 0; font-size: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.board-state { padding: 0 .4rem; border-radius: 3px; font-size: .72rem; font-weight: 700; border: 1px solid currentcolor; }
.board-list-line { margin: .2rem 0 0; color: #35465d; }
.board-list-facts { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .25rem 1rem; margin: .5rem 0 0; }
.board-list-facts dt { color: #647386; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; line-height: 1.5; }
.board-list-facts dd { margin: 0; font-size: .88rem; }
.board-list-reason { margin: .45rem 0 0; font-weight: 600; color: #7a3b12; }
.board-list-note { margin: .35rem 0 0; color: #5c6c80; font-size: .88rem; }
.board-undrawn { margin: .3rem 0 0; padding-left: 1.2rem; font-size: .85rem; color: #5c6c80; }
.board-freshness { display: flex; flex-wrap: wrap; gap: .3rem 1.6rem; margin: .9rem 0 0; font-size: .8rem; color: #5c6c80; }

@media (max-width: 640px) {
  .ps-toolbar-right { margin-left: 0; flex: 1 1 100%; }
  .board-list-facts { grid-template-columns: 1fr; }
  .board-list-facts dt { margin-top: .35rem; }
  .board-freshness { flex-direction: column; gap: .2rem; }
}

/* ---- Reservation editor popup -------------------------------------------------------------------
   Sized like the BusinessSystem schedule editor (its productionSchedule.css lines 202-209): wide, with
   the form on the left and read-only CI context on the right, collapsing to one column on a narrow
   screen. Built on <dialog>, so the backdrop, focus containment and Escape are the browser's rather
   than ours; only the box is styled here. */
.ps-editor { width: 90vw; max-width: 1100px; border: 1px solid #9ab5d0; border-radius: 8px; padding: 1rem 1.25rem 1.25rem; color: #223; }
.ps-editor::backdrop { background: rgba(16, 32, 52, .45); }
.ps-editor h2 { margin: 0 0 .15rem; font-size: 1.15rem; }
.ps-editor-sub { margin: 0 0 .9rem; color: #4a5a6a; font-size: .9rem; }
.ps-editor-close-form { float: right; margin-left: 1rem; }
.ps-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; }
.ps-editor-form { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .55rem .75rem; align-items: center; min-width: 0; }
.ps-editor-form label { font-weight: 650; font-size: .9rem; }
.ps-editor-form input, .ps-editor-form select { padding: .35rem .5rem; border: 1px solid #9ab5d0; border-radius: 5px; font: inherit; min-width: 0; }
.ps-editor-actions, .ps-editor-form > #ed-confirm { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
/* An id selector outranks [hidden]'s user-agent display:none, so the display:flex above would
   have kept the remove confirmation on screen permanently - visible before it was asked for and
   still visible after Keep it. Restoring it explicitly is the fix; hidden has to win. */
.ps-editor-form > #ed-confirm[hidden] { display: none; }
#ed-overlaps { margin: .4rem 0 0; padding-left: 1.1rem; font-size: .85rem; }
#ed-overlaps li { margin-bottom: .2rem; }
#ed-stale { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid #d7e2ee; font-size: .85rem; }
#ed-stale[hidden] { display: none; }
#ed-stale .ps-editor-actions { margin-top: .4rem; }
.ps-editor-form > #ed-confirm { border-top: 1px solid #d7e2ee; padding-top: .7rem; }
.ps-editor-form > #ed-confirm p { flex: 1 1 100%; margin: 0 0 .3rem; font-size: .9rem; }
.ps-editor-side { border-left: 1px solid #d7e2ee; padding-left: 1.25rem; min-width: 0; font-size: .9rem; }
.ps-editor button[disabled] { opacity: .55; cursor: not-allowed; }
/* Same trap as .ps-navbtn: stating only a colour leaves the element rule's blue background, which is
   how "Remove" rendered dark pink on dark blue. */
.board-danger { border-color: #c08; background: #fff; color: #a0005a; }
.board-danger:hover { background: #a0005a; color: #fff; }
.board-danger:focus-visible { outline: 2px solid #a0005a; outline-offset: 2px; }
/* Status colours differ in lightness as well as hue, so they do not rely on colour alone. */
.ed-ok { color: #11602f; font-weight: 650; }
.ed-warn { color: #8a4b00; font-weight: 650; }
.ed-bad { color: #9a1020; font-weight: 650; }
#ed-result { margin-top: .5rem; }
@media (max-width: 991.98px) {
    .ps-editor { width: auto; max-width: 640px; }
    .ps-editor-grid { grid-template-columns: minmax(0, 1fr); }
    .ps-editor-form { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
    .ps-editor-side { border-left: 0; padding-left: 0; border-top: 1px solid #d7e2ee; padding-top: 1rem; }
}
