/* ============================================================
   PR226 — Main Schedule Rebuild
   TradeRail Field Portal
   ============================================================ */

/* ---- Root / token overrides for schedule zone ---- */
.p226-root {
  --p226-card-h: 90px;
  --p226-rail-w: 200px;
  --p226-rail-collapsed-w: 40px;
  --p226-col-gap: 0px;
  --p226-cap-bar-h: 4px;
  --p226-popover-w: 320px;
  --p226-drawer-peek: 48px;
  --p226-info-delay: 400ms;
  --p226-border-radius: 6px;
  --p226-shadow: 0 2px 8px rgba(0,0,0,.12);
  --p226-orange: #FF6B00;
  --p226-green: #22c55e;
  --p226-amber: #f59e0b;
  --p226-red: #ef4444;
  --p226-blue: #3b82f6;
  --p226-purple: #8b5cf6;
}

/* ============================================================
   LAYOUT — board shell
   ============================================================ */
.p226-board-shell {
  display: flex;
  height: calc(100vh - 120px);
  overflow: hidden;
  position: relative;
  background: var(--bg, #fff);
}

/* Body row: rail + board side by side */
.p226-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.p226-board-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  background: var(--bg, #fff);
}

/* Rail toggle wrap */
.p226-rail-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 4px 0;
  flex-shrink: 0;
}

/* ============================================================
   WORKER RAIL — TABLE variant (matches JS output)
   ============================================================ */
.p226-rail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.p226-rail-table thead tr {
  border-bottom: 1px solid var(--bd, #cbd5e1);
}

.p226-rail-th {
  padding: 4px 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--tx-md, #475569);
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.p226-rail-th.p226-rail-name-hdr {
  text-align: left;
  padding-left: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
}

.p226-rail-th.p226-rail-day-active {
  color: var(--p226-orange);
}

.p226-rail-row {
  border-bottom: 1px solid var(--bd-lt, #eef2f7);
}

.p226-rail-row:hover {
  background: var(--bg-lt, #f8fafc);
}

.p226-rail-name-cell {
  padding: 6px 6px;
  vertical-align: middle;
  white-space: nowrap;
}

.p226-worker-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bd, #cbd5e1);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tx, #0f172a);
  flex-shrink: 0;
  vertical-align: middle;
}

.p226-worker-info {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  margin-left: 6px;
  max-width: 120px;
  overflow: hidden;
}

.p226-worker-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.p226-worker-role {
  font-size: 10px;
  color: var(--tx-lt, #94a3b8);
  white-space: nowrap;
  line-height: 1.2;
  text-transform: capitalize;
}

.p226-furlough-btn {
  margin-top: 3px;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--bd, #cbd5e1);
  background: #fff;
  color: var(--tx-md, #475569);
  cursor: pointer;
  white-space: nowrap;
  align-self: flex-start;
}

.p226-furlough-btn:hover {
  border-color: var(--p226-orange);
  color: var(--p226-orange);
}

/* Rail day cells (td in table) */
.p226-rail-cell {
  width: 28px;
  height: 28px;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  transition: background .12s;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  color: var(--tx-md, #475569);
  position: relative;
  padding: 0;
}

.p226-cell-dot {
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.p226-rail-cell.p226-cell-available {
  background: #f0fdf4;
  color: transparent;
}

.p226-rail-cell.p226-cell-available[draggable='true']:hover {
  background: #dcfce7;
  cursor: grab;
}

.p226-rail-cell.p226-cell-assigned {
  background: #dbeafe;
  color: #1e40af;
}

.p226-rail-cell.p226-cell-assigned-linked {
  background: #ede9fe;
  color: #5b21b6;
}

.p226-rail-cell.p226-cell-conflict {
  background: #fee2e2;
  color: #991b1b;
  font-size: 11px;
}

.p226-rail-cell.p226-cell-off {
  background: var(--bd-lt, #eef2f7);
  color: var(--tx-lt, #94a3b8);
  font-style: italic;
}

.p226-rail-cell.p226-cell-active-day {
  outline: 2px solid var(--p226-orange);
  outline-offset: -2px;
}

/* Collapsed rail — hide name info + day cells text */
.p226-rail.p226-rail-collapsed .p226-worker-info,
.p226-rail.p226-rail-collapsed .p226-rail-name-hdr {
  display: none;
}

.p226-rail.p226-rail-collapsed .p226-rail-name-cell {
  text-align: center;
  padding: 4px 2px;
}

/* ============================================================
   WORKER RAIL — left side
   ============================================================ */
.p226-rail {
  width: var(--p226-rail-w);
  min-width: var(--p226-rail-w);
  flex-shrink: 0;
  background: var(--bg-lt, #f8fafc);
  border-right: 1px solid var(--bd, #cbd5e1);
  display: flex;
  flex-direction: column;
  transition: width 0.2s ease, min-width 0.2s ease;
  overflow: hidden;
  z-index: 10;
}

.p226-rail.collapsed {
  width: var(--p226-rail-collapsed-w);
  min-width: var(--p226-rail-collapsed-w);
}

.p226-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--bd, #cbd5e1);
  font-size: 11px;
  font-weight: 600;
  color: var(--tx-md, #475569);
  text-transform: uppercase;
  letter-spacing: .04em;
  flex-shrink: 0;
}

.p226-rail-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  color: var(--tx-lt, #94a3b8);
  font-size: 14px;
  line-height: 1;
}

.p226-rail-toggle:hover {
  color: var(--tx, #0f172a);
}

.p226-rail-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Worker row in rail */
.p226-rail-worker {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--bd-lt, #eef2f7);
}

.p226-rail-worker-name {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p226-rail-worker-name .p226-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bd, #cbd5e1);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tx, #0f172a);
  flex-shrink: 0;
}

/* Day grid in rail — 7 cells per worker */
.p226-rail-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 0 6px 6px;
}

.p226-rail-day-cell {
  height: 20px;
  border-radius: 3px;
  background: var(--bd-lt, #eef2f7);
  cursor: pointer;
  position: relative;
  transition: background .15s;
}

.p226-rail-day-cell:hover {
  background: var(--bd, #cbd5e1);
}

/* Assigned = colored dot */
.p226-rail-day-cell.has-job {
  background: #dbeafe;
}

.p226-rail-day-cell.has-job::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 2px;
  background: var(--p226-blue);
  opacity: .6;
}

/* Current highlighted day */
.p226-rail-day-cell.rail-day-highlight {
  outline: 2px solid var(--p226-orange);
  outline-offset: -2px;
}

/* Available (draggable target) */
.p226-rail-day-cell.available {
  background: #f0fdf4;
}

.p226-rail-day-cell[data-draggable="true"] {
  cursor: grab;
}

/* Furlough button */
.p226-rail-furlough-btn {
  margin: 2px 6px 4px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--bd, #cbd5e1);
  background: #fff;
  color: var(--tx-md, #475569);
  cursor: pointer;
  white-space: nowrap;
}

.p226-rail-furlough-btn:hover {
  border-color: var(--p226-orange);
  color: var(--p226-orange);
}

/* Collapsed rail — icon strip */
.p226-rail.collapsed .p226-rail-worker-name span,
.p226-rail.collapsed .p226-rail-days,
.p226-rail.collapsed .p226-rail-furlough-btn,
.p226-rail.collapsed .p226-rail-header .p226-label {
  display: none;
}

.p226-rail.collapsed .p226-rail-worker-name {
  justify-content: center;
  padding: 6px 4px;
}

/* ============================================================
   BOARD — right of rail
   ============================================================ */
.p226-board {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ============================================================
   TOOLBAR / TOP BAR
   ============================================================ */
.p226-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--bd, #cbd5e1);
  flex-shrink: 0;
  background: var(--bg, #fff);
  flex-wrap: wrap;
}

.p226-view-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 6px;
  overflow: hidden;
}

.p226-view-tab {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--tx-md, #475569);
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.p226-view-tab:not(:last-child) {
  border-right: 1px solid var(--bd, #cbd5e1);
}

.p226-view-tab.active {
  background: var(--p226-orange);
  color: #fff;
}

.p226-view-tab:hover:not(.active) {
  background: var(--bg-lt, #f8fafc);
}

/* Week navigator */
.p226-week-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.p226-week-nav button {
  background: none;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 5px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--tx-md, #475569);
  line-height: 1;
}

.p226-week-nav button:hover {
  background: var(--bg-lt, #f8fafc);
}

.p226-week-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx, #0f172a);
  min-width: 130px;
  text-align: center;
}

/* Filter / toolbar controls */
.p226-toolbar-spacer {
  flex: 1;
}

.p226-filter-select,
.p226-search-input {
  height: 30px;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 5px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--tx, #0f172a);
  background: #fff;
}

.p226-filter-select:focus,
.p226-search-input:focus {
  outline: 2px solid var(--p226-orange);
  outline-offset: -1px;
}

.p226-toolbar-btn {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 5px;
  font-size: 12px;
  background: #fff;
  cursor: pointer;
  color: var(--tx-md, #475569);
  white-space: nowrap;
}

.p226-toolbar-btn:hover {
  background: var(--bg-lt, #f8fafc);
  border-color: var(--tx-md, #475569);
}

.p226-toolbar-btn.primary {
  background: var(--p226-orange);
  color: #fff;
  border-color: var(--p226-orange);
}

.p226-toolbar-btn.primary:hover {
  background: #D95A00;
}

/* Gear button */
.p226-gear-btn {
  height: 30px;
  width: 30px;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--tx-md, #475569);
  position: relative;
}

.p226-gear-btn:hover {
  background: var(--bg-lt, #f8fafc);
}

/* ============================================================
   CAPACITY BAR + COLUMN HEADERS
   ============================================================ */
.p226-col-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--bd, #cbd5e1);
  flex-shrink: 0;
  background: var(--bg-lt, #f8fafc);
}

.p226-col-header {
  padding: 6px 8px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  border-right: 1px solid var(--bd-lt, #eef2f7);
  position: relative;
}

.p226-col-header:last-child {
  border-right: none;
}

.p226-col-header:hover .p226-cap-bar {
  opacity: .8;
}

.p226-col-day-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--tx-lt, #94a3b8);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.p226-col-day-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--tx, #0f172a);
  line-height: 1;
}

.p226-col-header.today .p226-col-day-num {
  background: var(--p226-orange);
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Capacity bar (4px colored strip) */
.p226-cap-bar {
  height: var(--p226-cap-bar-h);
  width: 100%;
  border-radius: 2px;
  margin-top: 3px;
  transition: background .3s;
}

.p226-cap-bar.green  { background: var(--p226-green); }
.p226-cap-bar.amber  { background: var(--p226-amber); }
.p226-cap-bar.red    { background: var(--p226-red); }
.p226-cap-bar.empty  { background: var(--bd-lt, #eef2f7); }

/* ============================================================
   BOARD GRID — scrollable job area
   ============================================================ */
.p226-grid-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.p226-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--p226-col-gap);
  min-height: 100%;
}

.p226-day-col {
  border-right: 1px solid var(--bd-lt, #eef2f7);
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 200px;
  transition: background .15s;
}

.p226-day-col:last-child {
  border-right: none;
}

/* Drop target highlight */
.p226-day-col.drag-over {
  background: #fff7ed;
  border-color: var(--p226-orange);
}

/* ============================================================
   JOB CARD — 72px uniform
   ============================================================ */
.p226-card {
  height: var(--p226-card-h);
  min-height: var(--p226-card-h);
  max-height: var(--p226-card-h);
  border-radius: var(--p226-border-radius);
  border: 1px solid var(--bd-lt, #eef2f7);
  background: #fff;
  border-left: 4px solid var(--p226-blue);
  display: flex;
  align-items: stretch;
  cursor: grab;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: box-shadow .15s, transform .15s;
  overflow: visible;
}

.p226-card:hover {
  box-shadow: var(--p226-shadow);
  z-index: 5;
}

.p226-card:active {
  cursor: grabbing;
  transform: scale(1.01);
}

/* Job type border colors */
.p226-card[data-type="service"]       { border-left-color: var(--p226-blue); }
.p226-card[data-type="construction"]  { border-left-color: var(--p226-orange); }
.p226-card[data-type="maintenance"]   { border-left-color: var(--p226-green); }
.p226-card[data-type="warranty"]      { border-left-color: var(--p226-purple); }
.p226-card[data-type="internal"]      { border-left-color: var(--tx-lt, #94a3b8); }
.p226-card[data-type="inspection"]    { border-left-color: var(--p226-amber); }
.p226-card[data-type="meeting"]       { border-left-color: #ec4899; }

/* Card dragging state */
.p226-card.dragging {
  opacity: .5;
  cursor: grabbing;
}

/* Multi-day continuation pill */
.p226-card.continuation {
  opacity: .75;
  border-style: dashed;
}

/* Card body */
.p226-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 8px;
  overflow: hidden;
  min-width: 0;
}

/* Line 1: project name + address */
.p226-card-line1 {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* Line 2: workers + time + stage */
.p226-card-line2 {
  font-size: 11px;
  color: var(--tx-md, #475569);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 4px;
}

.p226-card-stage-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bd-lt, #eef2f7);
  color: var(--tx-md, #475569);
  flex-shrink: 0;
}

/* Stage badge colors */
.p226-card[data-billing="non_billable"] .p226-card-stage-badge {
  background: #f1f5f9;
  color: var(--tx-lt, #94a3b8);
}

.p226-card[data-billing="billable"] .p226-card-stage-badge {
  background: #ecfdf5;
  color: #16a34a;
}

/* Card action buttons — right side */
.p226-card-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  padding: 4px 3px;
  gap: 2px;
  flex-shrink: 0;
}

.p226-card-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--tx-lt, #94a3b8);
  transition: background .12s, color .12s;
  flex-shrink: 0;
}

.p226-card-btn:hover {
  background: var(--bg-lt, #f8fafc);
  color: var(--tx, #0f172a);
}

.p226-card-btn.info-btn:hover {
  color: var(--p226-blue);
}

.p226-card-btn.action-menu-btn:hover {
  color: var(--p226-orange);
}

/* ============================================================
   INFO POPOVER
   ============================================================ */
.p226-popover {
  position: absolute;
  z-index: 200;
  width: var(--p226-popover-w);
  background: #fff;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
  padding: 12px 14px;
  font-size: 12px;
  color: var(--tx, #0f172a);
  pointer-events: auto;
}

.p226-popover[hidden] { display: none; }

.p226-popover-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx, #0f172a);
  margin-bottom: 4px;
}

.p226-popover-addr {
  font-size: 11px;
  color: var(--tx-md, #475569);
  margin-bottom: 6px;
}

.p226-popover-addr a {
  color: var(--p226-blue);
  text-decoration: none;
}

.p226-popover-addr a:hover {
  text-decoration: underline;
}

.p226-popover-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.p226-chip {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 6px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.p226-chip.ack       { background: #ecfdf5; color: #16a34a; border-color: #bbf7d0; }
.p226-chip.blocked   { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.p226-chip.co        { background: #fffbeb; color: #d97706; border-color: #fde68a; }
.p226-chip.recurring { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.p226-chip.billable  { background: #ecfdf5; color: #16a34a; border-color: #bbf7d0; }
.p226-chip.non-bill  { background: #f8fafc; color: var(--tx-lt, #94a3b8); border-color: var(--bd-lt, #eef2f7); }
.p226-chip.gps       { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.p226-chip.meeting   { background: #fdf4ff; color: #7e22ce; border-color: #e9d5ff; }

.p226-popover-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 3px 0;
  border-top: 1px solid var(--bd-lt, #eef2f7);
  gap: 8px;
}

.p226-popover-row:first-of-type {
  border-top: none;
}

.p226-popover-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tx-lt, #94a3b8);
  flex-shrink: 0;
}

.p226-popover-val {
  font-size: 11px;
  color: var(--tx, #0f172a);
  text-align: right;
}

.p226-popover-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bd-lt, #eef2f7);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.p226-popover-footer button {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid var(--bd, #cbd5e1);
  background: #fff;
  cursor: pointer;
  color: var(--tx-md, #475569);
}

.p226-popover-footer button:hover {
  background: var(--bg-lt, #f8fafc);
}

/* ============================================================
   ACTION MENU (... dropdown)
   ============================================================ */
.p226-action-menu {
  position: absolute;
  z-index: 300;
  background: #fff;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 7px;
  box-shadow: 0 6px 20px rgba(0,0,0,.14);
  padding: 4px 0;
  min-width: 160px;
}

.p226-action-menu[hidden] { display: none; }

.p226-action-item {
  display: block;
  width: 100%;
  padding: 7px 14px;
  font-size: 12px;
  color: var(--tx, #0f172a);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background .12s;
  white-space: nowrap;
}

.p226-action-item:hover {
  background: var(--bg-lt, #f8fafc);
}

.p226-action-item.danger {
  color: var(--p226-red);
}

.p226-action-item.danger:hover {
  background: #fef2f2;
}

.p226-action-item.perm-hidden {
  display: none;
}

/* ============================================================
   +DAY REASON MODAL
   ============================================================ */
.p226-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.p226-modal-backdrop[hidden] { display: none; }

.p226-modal {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,.2);
  width: 400px;
  max-width: calc(100vw - 32px);
  padding: 20px 24px;
}

.p226-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--tx, #0f172a);
  margin-bottom: 12px;
}

.p226-modal-reason-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.p226-modal-reason-btn {
  padding: 10px 14px;
  border-radius: 7px;
  border: 1.5px solid var(--bd, #cbd5e1);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  color: var(--tx, #0f172a);
  transition: border-color .15s, background .15s;
}

.p226-modal-reason-btn:hover {
  border-color: var(--p226-orange);
  background: #fff7ed;
}

.p226-modal-reason-btn.selected {
  border-color: var(--p226-orange);
  background: #fff7ed;
  font-weight: 600;
}

.p226-modal-reason-btn .reason-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-left: 8px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bd-lt, #eef2f7);
  color: var(--tx-lt, #94a3b8);
}

.p226-modal-reason-btn.blocked-reason .reason-tag {
  background: #fef2f2;
  color: #dc2626;
}

.p226-modal-reason-btn.co-reason .reason-tag {
  background: #fffbeb;
  color: #d97706;
}

.p226-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.p226-modal-footer button {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.p226-modal-cancel {
  border: 1px solid var(--bd, #cbd5e1);
  background: #fff;
  color: var(--tx-md, #475569);
}

.p226-modal-cancel:hover {
  background: var(--bg-lt, #f8fafc);
}

.p226-modal-confirm {
  border: none;
  background: var(--p226-orange);
  color: #fff;
}

.p226-modal-confirm:hover {
  background: #D95A00;
}

.p226-modal-confirm:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ============================================================
   REQUEST QUEUE — bottom pull-up drawer
   ============================================================ */
/* p226-req-drawer: SUPERSEDED — see PR226 POLISH ROUND 3 block at end of file */
.p226-req-drawer-REMOVED { display: none; }

.p226-req-drawer-handle {
  height: var(--p226-drawer-peek);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  cursor: pointer;
  user-select: none;
}

.p226-req-drawer-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--tx, #0f172a);
  display: flex;
  align-items: center;
  gap: 8px;
}

.p226-req-badge {
  background: var(--p226-orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}

.p226-req-drawer-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 16px 16px;
}

/* Request card in drawer */
.p226-req-card {
  border: 1px solid var(--bd-lt, #eef2f7);
  border-radius: 7px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--bg-lt, #f8fafc);
}

.p226-req-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx, #0f172a);
  margin-bottom: 4px;
}

.p226-req-card-meta {
  font-size: 11px;
  color: var(--tx-md, #475569);
  margin-bottom: 8px;
}

.p226-req-card-actions {
  display: flex;
  gap: 6px;
}

.p226-req-approve-btn {
  padding: 5px 10px;
  border-radius: 5px;
  border: none;
  background: #16a34a;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.p226-req-approve-btn:hover { background: #15803d; }

.p226-req-modify-btn {
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid var(--bd, #cbd5e1);
  background: #fff;
  color: var(--tx-md, #475569);
  font-size: 11px;
  cursor: pointer;
}

.p226-req-modify-btn:hover { background: var(--bg-lt, #f8fafc); }

.p226-req-reject-btn {
  padding: 5px 10px;
  border-radius: 5px;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}

.p226-req-reject-btn:hover { background: #dc2626; }

/* ============================================================
   GEAR POPOVER (Scheduler Suggestions)
   ============================================================ */
.p226-gear-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 250;
  width: 280px;
  background: #fff;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  padding: 12px;
}

.p226-gear-popover[hidden] { display: none; }

.p226-gear-popover-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--tx-lt, #94a3b8);
  margin-bottom: 8px;
}

.p226-gear-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--bd-lt, #eef2f7);
}

.p226-gear-item:first-of-type { border-top: none; }

.p226-gear-item-text {
  flex: 1;
  font-size: 11px;
  color: var(--tx, #0f172a);
}

.p226-gear-item-action {
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--bd, #cbd5e1);
  background: #fff;
  cursor: pointer;
  color: var(--tx-md, #475569);
  flex-shrink: 0;
}

.p226-gear-item-action:hover {
  background: var(--bg-lt, #f8fafc);
}

/* ============================================================
   MONTH VIEW
   ============================================================ */
.p226-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--bd-lt, #eef2f7);
  flex: 1;
  overflow-y: auto;
}

.p226-month-cell {
  background: #fff;
  padding: 4px 6px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.p226-month-cell-date {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx-md, #475569);
  margin-bottom: 2px;
}

.p226-month-cell.today .p226-month-cell-date {
  color: var(--p226-orange);
}

.p226-month-cell.other-month {
  background: var(--bg-lt, #f8fafc);
}

.p226-month-cell.other-month .p226-month-cell-date {
  color: var(--tx-lt, #94a3b8);
}

/* Mini card in month view */
.p226-month-mini-card {
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid var(--p226-blue);
  background: #f0f9ff;
  color: var(--tx, #0f172a);
}

.p226-month-more {
  font-size: 10px;
  color: var(--tx-lt, #94a3b8);
  cursor: pointer;
  padding: 1px 4px;
}

.p226-month-more:hover { color: var(--p226-orange); }

/* ============================================================
   DAY VIEW
   ============================================================ */
.p226-day-timeline {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.p226-day-hour-row {
  display: flex;
  align-items: flex-start;
  border-top: 1px solid var(--bd-lt, #eef2f7);
  min-height: 48px;
}

.p226-day-hour-label {
  width: 48px;
  flex-shrink: 0;
  font-size: 10px;
  color: var(--tx-lt, #94a3b8);
  padding: 4px 8px;
  font-weight: 600;
}

.p226-day-hour-body {
  flex: 1;
  padding: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ============================================================
   DUAL WEEK VIEW
   ============================================================ */
.p226-dual-week {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

.p226-dual-week-half {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-bottom: 2px solid var(--bd, #cbd5e1);
}

.p226-dual-week-half:last-child { border-bottom: none; }

.p226-dual-week-label {
  padding: 4px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--tx-lt, #94a3b8);
  background: var(--bg-lt, #f8fafc);
  border-bottom: 1px solid var(--bd-lt, #eef2f7);
}

/* ============================================================
   UNSCHEDULED JOBS PANEL (Today / This Week)
   ============================================================ */
.p226-unscheduled-panel {
  border-bottom: 1px solid var(--bd, #cbd5e1);
  background: var(--bg-lt, #f8fafc);
  padding: 6px 12px 8px;
  flex-shrink: 0;
}

.p226-unscheduled-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  user-select: none;
}

.p226-unscheduled-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx-md, #475569);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.p226-unscheduled-count {
  font-size: 10px;
  font-weight: 700;
  background: var(--bd, #cbd5e1);
  color: var(--tx-md, #475569);
  padding: 1px 6px;
  border-radius: 8px;
}

.p226-unscheduled-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.p226-unscheduled-chip {
  flex-shrink: 0;
  background: #fff;
  border: 1.5px dashed var(--bd, #cbd5e1);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--tx, #0f172a);
  cursor: grab;
  white-space: nowrap;
}

.p226-unscheduled-chip:hover {
  border-color: var(--p226-orange);
  background: #fff7ed;
}

/* ============================================================
   MY WEEK VIEW (Field Worker — zero dollar amounts)
   ============================================================ */
.p226-my-week {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.p226-my-week-card {
  border: 1px solid var(--bd-lt, #eef2f7);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  border-left: 4px solid var(--p226-blue);
}

.p226-my-week-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx, #0f172a);
  margin-bottom: 4px;
}

.p226-my-week-card-addr {
  font-size: 11px;
  color: var(--tx-md, #475569);
  margin-bottom: 6px;
}

.p226-my-week-card-meta {
  font-size: 11px;
  color: var(--tx-md, #475569);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* NEVER show dollar amounts — belt + suspenders */
.p226-my-week [data-dollar],
.p226-my-week .dollar-amount,
.p226-my-week .rate-value,
.p226-my-week .billable-rate,
.p226-my-week .cost-field {
  display: none !important;
}

/* ============================================================
   CONFLICT NOTIFICATION ALERTS
   ============================================================ */
.p226-conflict-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 11px;
  color: #92400e;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 12px;
}

.p226-conflict-banner.critical {
  background: #fef2f2;
  border-color: #fecaca;
  color: #7f1d1d;
}

.p226-conflict-dismiss {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: inherit;
  opacity: .6;
  line-height: 1;
}

.p226-conflict-dismiss:hover { opacity: 1; }

/* ============================================================
   UNSCHEDULED TODAY / BOARD view labels
   ============================================================ */
.p226-view-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--tx-lt, #94a3b8);
  padding: 6px 12px 2px;
}

/* ============================================================
   MOBILE — hide sidebar entirely below 768px
   ============================================================ */
@media (max-width: 767px) {
  /* Sidebar is DESKTOP-ONLY */
  .sidebar,
  #sidebar,
  [id*="sidebar"],
  .nav-sidebar {
    display: none !important;
  }

  .p226-rail {
    display: none;
  }

  .p226-board-shell {
    height: calc(100vh - 60px);
  }

  .p226-toolbar {
    padding: 6px 8px;
    gap: 4px;
  }

  .p226-view-tab {
    padding: 4px 8px;
    font-size: 11px;
  }

  .p226-week-label {
    font-size: 11px;
    min-width: 100px;
  }

  .p226-col-header {
    padding: 4px 4px 2px;
  }

  .p226-col-day-num {
    font-size: 12px;
  }

  .p226-card {
    height: 60px;
    min-height: 60px;
    max-height: 60px;
  }

  .p226-card-line1 {
    font-size: 11px;
  }

  .p226-card-line2 {
    font-size: 10px;
  }

  /* No bottom tab bar */
  .bottom-tab-bar,
  .mobile-tab-bar,
  [class*="bottom-nav"],
  [class*="tab-bar"] {
    display: none !important;
  }
}

/* ============================================================
   TRIPWIRE — D-tripwire for PR226 files
   ============================================================ */
[data-pr226-tripwire] {
  /* marker class — intentionally empty */
}

/* ============================================================
   DRAG GHOST
   ============================================================ */
.p226-drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  opacity: .85;
  transform: rotate(2deg) scale(1.02);
}

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
.p226-grid-scroll::-webkit-scrollbar,
.p226-rail-body::-webkit-scrollbar,
.p226-req-drawer-body::-webkit-scrollbar {
  width: 5px;
}

.p226-grid-scroll::-webkit-scrollbar-track,
.p226-rail-body::-webkit-scrollbar-track,
.p226-req-drawer-body::-webkit-scrollbar-track {
  background: transparent;
}

.p226-grid-scroll::-webkit-scrollbar-thumb,
.p226-rail-body::-webkit-scrollbar-thumb,
.p226-req-drawer-body::-webkit-scrollbar-thumb {
  background: var(--bd, #cbd5e1);
  border-radius: 3px;
}

/* ============================================================
   DARK MODE SUPPORT
   ============================================================ */
@media (prefers-color-scheme: dark) {
  .p226-root {
    --bg: #1a1916;
    --tx: #f1f5f9;
    --tx-md: #94a3b8;
    --tx-lt: #475569;
    --bd: #334155;
    --bd-lt: #1e293b;
    --bg-lt: #141310;
  }

  .p226-card,
  .p226-popover,
  .p226-action-menu,
  .p226-modal,
  .p226-req-drawer,
  .p226-gear-popover {
    background: #1e293b;
    border-color: #334155;
  }

  .p226-req-card {
    background: #141310;
  }

  .p226-month-cell {
    background: #1e293b;
  }

  .p226-month-cell.other-month {
    background: #141310;
  }
}

/* ============================================================
   PR226 VISUAL FIX — Restore old sch-card tile design + new layout
   ============================================================ */

/* ---- Controls bar (single row) ---- */
.p226-controls-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--bd, #cbd5e1);
  background: var(--bg, #fff);
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.p226-view-pills {
  display: flex;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
}

.p226-pill {
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--tx-md, #475569);
  transition: background .15s, color .15s;
  white-space: nowrap;
  font-family: inherit;
}

.p226-pill:not(:last-child) {
  border-right: 1px solid var(--bd, #cbd5e1);
}

.p226-pill.on {
  background: var(--brand, #FF6B00);
  color: #fff;
}

.p226-pill:hover:not(.on) {
  background: var(--bg-lt, #f8fafc);
}

.p226-week-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.p226-nav-btn {
  background: none;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 5px;
  padding: 4px 9px;
  cursor: pointer;
  font-size: 14px;
  color: var(--tx-md, #475569);
  line-height: 1;
  font-family: inherit;
}

.p226-nav-btn:hover { background: var(--bg-lt, #f8fafc); }

.p226-week-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx, #0f172a);
  min-width: 110px;
  text-align: center;
}

.p226-today-btn {
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  color: var(--tx-md, #475569);
  font-family: inherit;
  flex-shrink: 0;
}

.p226-today-btn:hover { background: var(--bg-lt, #f8fafc); }

.p226-icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tx-md, #475569);
  position: relative;
  flex-shrink: 0;
}

.p226-icon-btn:hover { background: var(--bg-lt, #f8fafc); }

.p226-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: var(--brand, #FF6B00);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  padding: 1px 4px;
  min-width: 14px;
  text-align: center;
  line-height: 1.4;
}

/* ---- Lily ribbon slot ---- */
.p226-lily-slot {
  flex-shrink: 0;
}

/* ---- Board body layout ---- */
.p226-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.p226-board-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: auto;
  min-width: 0;
  background: var(--bg, #fff);
}

/* ---- Week block headers (This Week / Next Week) ---- */
.p226-week-block {
  margin-bottom: 0;
}

.p226-week-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-lt, #f8fafc);
  border-top: 1px solid var(--bd, #cbd5e1);
  border-bottom: 1px solid var(--bd, #cbd5e1);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--tx-md, #475569);
  text-transform: uppercase;
  letter-spacing: .04em;
  user-select: none;
}

.p226-week-hdr:hover { background: #f1f5f9; }
.p226-week-chevron { font-size: 11px; color: var(--tx-lt, #94a3b8); }

.p226-week-body { overflow: hidden; transition: max-height .2s ease; }
.p226-week-collapsed .p226-week-body { max-height: 0; }

/* ---- Week table (day columns) ---- */
.p226-week-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.p226-col-hdr {
  padding: 6px 4px 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--tx-md, #475569);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-right: 1px solid var(--bd-lt, #eef2f7);
  background: var(--bg-lt, #f8fafc);
  white-space: nowrap;
  vertical-align: bottom;
}

.p226-col-hdr:last-child { border-right: none; }

/* Header top row — day label left, + button right */
.p226-col-hdr-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.p226-col-hdr-label {
  display: block;
  cursor: pointer;
  padding-bottom: 3px;
  flex: 1;
}

.p226-col-hdr-label:hover { color: var(--brand, #FF6B00); }

/* Always-visible + button in column header */
.p226-hdr-add-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--bd, #cbd5e1);
  background: #fff;
  color: var(--tx-lt, #94a3b8);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .12s, color .12s, border-color .12s;
  font-family: inherit;
  margin-bottom: 3px;
}
.p226-hdr-add-btn:hover {
  background: var(--brand, #FF6B00);
  color: #fff;
  border-color: var(--brand, #FF6B00);
}

.p226-col-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--tx, #0f172a);
}

.p226-col-hdr.p226-col-today {
  color: var(--brand, #FF6B00);
}

.p226-col-hdr.p226-col-today .p226-col-date {
  background: var(--brand, #FF6B00);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.p226-col-hdr.p226-col-selected { background: #fff7ed; }

/* Capacity bar — 4px strip below column header */
.p226-cap-bar {
  height: 4px;
  width: calc(100% + 8px);
  margin: 3px -4px 0;
  border-radius: 0;
  background: var(--bd-lt, #eef2f7);
  overflow: hidden;
  position: relative;
}

.p226-cap-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s ease, background .3s ease;
}

/* Day column body */
.p226-col-body {
  padding: 4px 3px;
  vertical-align: top;
  border-right: 1px solid var(--bd-lt, #eef2f7);
  min-height: 160px;
  width: calc(100% / 5);
}

.p226-col-body:last-child { border-right: none; }

.p226-col-body.drag-over {
  background: #fff7ed;
  outline: 2px dashed var(--brand, #FF6B00);
  outline-offset: -2px;
}

/* ---- sch-card tiles — restored from old approved design ---- */
.sch-card {
  border-radius: 9px;
  padding: 7px 9px 5px;
  margin-bottom: 5px;
  cursor: grab;
  transition: box-shadow .15s, transform .15s;
  position: relative;
  background: var(--brand-lt, #fff3e8);
  border: 1px solid var(--brand-md, #ffb366);
  /* Uniform 72px height */
  min-height: 90px;
  max-height: 90px;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sch-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
  z-index: 5;
  transform: translateY(-1px);
}

.sch-card:active { cursor: grabbing; }

.sch-card.crew { background: #eef3ff; border-color: #b8c7f5; }
.sch-card.split { background: #fff9e6; border-color: #f0d060; }
.sch-card.invoice-needed { border-top: 3px solid var(--amber, #f39c12); }
.sch-card.p226-card-conflict { background: #fff4f4; border-color: #fca5a5; }

/* Card project name — bold, navy, truncated */
.sch-card-proj {
  font-weight: 700;
  color: var(--navy, #1a2332);
  font-size: 12px;
  line-height: 1.25;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Time line — brand condensed */
.sch-card-time {
  font-family: 'Barlow Condensed', 'Barlow', sans-serif;
  font-size: 11px;
  color: var(--brand-dk, #cc5500);
  font-weight: 700;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Crew/workers line */
.sch-card-crew {
  font-size: 11px;
  color: var(--tx-md, #475569);
  margin-bottom: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Task/stage line */
.sch-card-task {
  font-size: 11px;
  color: var(--tx-lt, #94a3b8);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Footer — badges + status */
.sch-card-foot {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: nowrap;
  overflow: hidden;
  margin-top: 2px;
}

/* Badges (old sch-badge system) */
.sch-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 1px 5px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sch-badge-ind    { background: #e0f2fe; color: #0369a1; }
.sch-badge-crew   { background: #ede9fe; color: #5b21b6; }
.sch-badge-split  { background: #fef9c3; color: #854d0e; }
.sch-badge-pub    { background: #dcfce7; color: #15803d; }
.sch-badge-ack    { background: #d1fae5; color: #065f46; }
.sch-badge-invoice { background: #fef3c7; color: #92400e; }
.sch-badge-linked { background: #ede9fe; color: #6d28d9; }
.sch-badge-clock  { background: #fee2e2; color: #dc2626; }

/* Card action button group */
.p226-card-btns {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.p226-info-btn,
.p226-menu-btn,
.p226-day-btn {
  width: 20px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--bd, #cbd5e1);
  background: #fff;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  color: var(--tx-md, #475569);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  font-family: inherit;
  transition: background .12s, color .12s, border-color .12s;
  flex-shrink: 0;
}

.p226-info-btn:hover { background: #eff6ff; color: var(--brand, #FF6B00); border-color: var(--brand, #FF6B00); }
.p226-menu-btn:hover { background: #fff7ed; color: var(--brand, #FF6B00); border-color: var(--brand, #FF6B00); }
.p226-day-btn:hover  { background: var(--brand-lt, #fff3e8); color: var(--brand-dk, #cc5500); }

/* Add button */
.p226-add-btn {
  margin-top: 4px;
  width: 100%;
  padding: 5px 0;
  font-size: 11px;
  font-weight: 600;
  border: 1px dashed var(--bd, #cbd5e1);
  border-radius: 6px;
  background: none;
  cursor: pointer;
  color: var(--tx-lt, #94a3b8);
  font-family: inherit;
  transition: background .12s, color .12s, border-color .12s;
  display: none; /* hidden — replaced by header + button */
}

.p226-add-btn:hover {
  background: var(--brand-lt, #fff3e8);
  color: var(--brand-dk, #cc5500);
  border-color: var(--brand, #FF6B00);
}

/* Row-lock board: each <td> holds exactly one card or an empty placeholder */
.p226-col-body-row {
  padding: 3px 4px;
  vertical-align: top;
}
.p226-col-body-row .sch-card,
.p226-col-body-row .p226-card {
  margin-bottom: 0;
}
/* Empty slot — keeps the row height consistent with filled cells */
.p226-row-empty-cell {
  min-height: 88px;
  border-radius: 6px;
  border: 1.5px dashed transparent;
}
/* Hover empty cell to reveal drop target on drag */
.p226-board-row td.p226-col-body-row:hover .p226-row-empty-cell {
  border-color: var(--bd, #cbd5e1);
  background: var(--bg-lt, #f8fafc);
}

/* ---- Rail chips — fix from raw numbers to styled pills ---- */
.p226-rail-cell.p226-cell-assigned .p226-cell-dot {
  display: inline-block;
  background: var(--brand, #FF6B00);
  color: #fff;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
}

.p226-rail-cell.p226-cell-assigned-linked .p226-cell-dot {
  display: inline-block;
  background: #a78bfa;
  color: #fff;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 9px;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
}

.p226-rail-cell.p226-cell-conflict .p226-cell-dot {
  display: inline-block;
  background: #ef4444;
  color: #fff;
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 9px;
  font-weight: 700;
}

.p226-rail-cell.p226-cell-off .p226-cell-dot {
  display: inline-block;
  background: var(--bd-lt, #eef2f7);
  color: var(--tx-lt, #94a3b8);
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 9px;
}

.p226-rail-cell.p226-cell-available .p226-cell-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--bd, #cbd5e1);
  background: transparent;
}

/* ---- Available worker strip (between board and request drawer) ---- */
.swf-unsched-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px 12px;
  background: var(--bg-lt, #f8fafc);
  border-top: 1px solid var(--bd, #cbd5e1);
  font-size: 12px;
  flex-shrink: 0;
}

.swf-unsched-hd {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx-lt, #94a3b8);
  text-transform: uppercase;
  letter-spacing: .04em;
  flex-shrink: 0;
  margin-right: 4px;
}

.swf-unsched-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--white, #fff);
  border: 1px solid var(--bd-lt, #eef2f7);
  border-radius: 20px;
  padding: 3px 10px 3px 6px;
  font-size: 11px;
  color: var(--tx, #0f172a);
}

.swf-unsched-pill.swf-unsched-off {
  background: #f8fafc;
  color: var(--tx-lt, #94a3b8);
}

.swf-unsched-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-lt, #fff3e8);
  color: var(--brand-dk, #cc5500);
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.swf-worker-role-tag {
  font-size: 10px;
  color: var(--tx-lt, #94a3b8);
}

.swf-off-tag {
  font-size: 10px;
  color: var(--tx-lt, #94a3b8);
  font-style: italic;
}

.swf-mini-btn {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--bd, #cbd5e1);
  background: #fff;
  cursor: pointer;
  color: var(--tx-md, #475569);
  font-family: inherit;
}

.swf-mini-btn:hover { border-color: var(--brand, #FF6B00); color: var(--brand, #FF6B00); }

/* old request drawer — superseded by PR226 POLISH ROUND 2 */

/* ---- Root layout ---- */
.p226-root {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* === end PR226 visual fix (superseded) ===


/* ============================================================
   PR226 POLISH ROUND 2 — Worker drawer, request drawer, card height,
   drag affordance, controls baseline, active pill orange
   ============================================================ */

/* ---- Controls bar — baseline alignment ---- */
.p226-controls-bar {
  display: flex !important;
  align-items: center !important;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-lt, #f8fafc);
  border-bottom: 1px solid var(--bd, #cbd5e1);
  flex-shrink: 0;
  min-height: 52px;
}

.p226-view-pills {
  display: flex;
  align-items: center;
  gap: 2px;
}

.p226-week-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---- Active view pill: orange ---- */
.p226-pill.on {
  background: #FF6B00 !important;
  color: #fff !important;
  border-color: #FF6B00 !important;
}

/* ---- sch-card: 90px height, bigger text ---- */
.sch-card {
  min-height: 90px !important;
  max-height: 90px !important;
  overflow: hidden;
}

.sch-card-proj {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: var(--navy, #1e3a5f) !important;
}

.sch-card-time {
  font-size: 10px !important;
  color: var(--brand-dk, #cc5500) !important;
  font-weight: 600 !important;
}

.sch-card-crew {
  font-size: 10px !important;
  color: var(--tx-md, #475569) !important;
}

.sch-card-task {
  font-size: 10px !important;
  color: var(--tx-md, #475569) !important;
}

/* ---- Drag affordance ---- */
.sch-card[draggable="true"],
[data-drag-worker] {
  cursor: grab !important;
}

.sch-card[draggable="true"]:active,
[data-drag-worker]:active { cursor: grabbing !important; }

.p226-dragging {
  opacity: 0.55;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18) !important;
}

.p226-drop-zone-active {
  background: #fff3e8 !important;
  outline: 2px dashed var(--brand, #FF6B00) !important;
  outline-offset: -2px;
}

/* ---- Body layout — row for right drawer ---- */
.p226-body {
  display: flex !important;
  flex-direction: row !important;
  flex: 1 !important;
  overflow: hidden !important;
  min-height: 0 !important;
  position: relative;
}

.p226-board-wrap {
  flex: 1 !important;
  min-width: 0 !important;
  overflow-y: auto;
  overflow-x: auto;
}

/* ---- Right worker drawer ---- */
.p226-worker-drawer {
  position: relative;
  width: 0;
  min-width: 0;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-lt, #f8fafc);
  border-left: 1px solid var(--bd, #cbd5e1);
  display: flex;
  flex-direction: column;
  transition: width 0.22s cubic-bezier(0.4,0,0.2,1);
  z-index: 50;
}

.p226-worker-drawer.p226-worker-drawer-open {
  width: 260px;
  min-width: 260px;
}

@media (max-width: 767px) {
  .p226-worker-drawer,
  .p226-worker-drawer.p226-worker-drawer-open {
    display: none !important;
  }
}

.p226-worker-drawer-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--bd, #cbd5e1);
  flex-shrink: 0;
  background: #fff;
}

.p226-worker-drawer-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy, #1e3a5f);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}

.p226-worker-drawer-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--tx-lt, #94a3b8);
  padding: 0 2px;
  line-height: 1;
}

.p226-worker-drawer-close:hover { color: var(--navy, #1e3a5f); }

.p226-worker-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---- Worker cards ---- */
.swf-worker-card {
  background: #fff;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 10px;
  padding: 10px 10px 8px;
  cursor: grab;
  transition: box-shadow .12s, border-color .12s;
  user-select: none;
}

.swf-worker-card:hover {
  box-shadow: 0 2px 10px rgba(0,0,0,0.10);
  border-color: var(--brand, #FF6B00);
}

.swf-worker-card:active { cursor: grabbing; }

.swf-worker-card-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.swf-worker-avatar-lg {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy, #1e3a5f);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.swf-worker-card-info { flex: 1; min-width: 0; }

.swf-worker-card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy, #1e3a5f);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.swf-worker-card-role {
  font-size: 10px;
  color: var(--tx-lt, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.swf-drag-handle {
  font-size: 14px;
  color: var(--tx-lt, #94a3b8);
  cursor: grab;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}

.swf-drag-handle:hover { background: var(--bg-lt, #f8fafc); color: var(--tx-md, #475569); }

.swf-worker-status {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.swf-status-available { background: #dcfce7; color: #166534; }
.swf-status-assigned  { background: #dbeafe; color: #1e40af; }
.swf-status-off       { background: #fef9c3; color: #854d0e; }
.swf-status-conflict  { background: #fee2e2; color: #991b1b; }

.swf-worker-job {
  font-size: 10px;
  color: var(--tx-md, #475569);
  padding: 3px 0;
  border-top: 1px solid var(--bd-lt, #eef2f7);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.swf-worker-job-none { color: var(--tx-lt, #94a3b8); font-style: italic; }

.swf-worker-bal { display: flex; gap: 4px; margin: 4px 0; }

.swf-bal-chip {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 6px;
  font-weight: 600;
}

.swf-bal-vac  { background: #eff6ff; color: #1d4ed8; }
.swf-bal-sick { background: #fef9c3; color: #854d0e; }
.swf-bal-fur  { background: #f0fdf4; color: #166534; }

.swf-worker-card-actions { display: flex; gap: 4px; margin-top: 4px; }

.swf-btn-sm {
  flex: 1;
  padding: 4px 0;
  font-size: 10px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--bd, #cbd5e1);
  background: #fff;
  cursor: pointer;
  color: var(--tx-md, #475569);
  font-family: inherit;
  text-align: center;
}

.swf-btn-sm:hover { background: var(--brand-lt, #fff3e8); border-color: var(--brand, #FF6B00); color: var(--brand-dk, #cc5500); }

.swf-add-worker-btn {
  width: 100%;
  padding: 8px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px dashed var(--bd, #cbd5e1);
  background: #fff;
  cursor: pointer;
  color: var(--tx-md, #475569);
  font-family: inherit;
  text-align: center;
}

.swf-add-worker-btn:hover { background: var(--brand-lt, #fff3e8); border-color: var(--brand, #FF6B00); color: var(--brand-dk, #cc5500); }

/* ---- Worker drawer toggle icon button active state ---- */
.p226-icon-btn-active {
  color: #FF6B00 !important;
}
.p226-icon-btn-active svg {
  stroke: #FF6B00 !important;
}

/* ---- Pull-up request drawer ---- */
.p226-req-drawer {
  flex-shrink: 0;
  background: #fff;
  border-top: 2px solid var(--bd, #cbd5e1);
  transition: max-height 0.25s cubic-bezier(0.4,0,0.2,1);
  max-height: 54px;
  overflow: hidden;
  position: relative;
  z-index: 40;
}

.p226-req-drawer.p226-req-drawer-open {
  max-height: 300px;
}

.p226-req-tab {
  display: flex !important;
  align-items: center !important;
  gap: 8px;
  padding: 0 14px;
  height: 52px;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy, #1e3a5f);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .05em;
  user-select: none;
  background: #fff;
}

.p226-req-tab:hover { background: var(--bg-lt, #f8fafc); }

.p226-req-tab-label { flex: 1; }

.p226-req-tab-count {
  background: #FF6B00;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.p226-req-tab-chevron {
  font-size: 10px;
  color: var(--tx-lt, #94a3b8);
}

.p226-req-scroll {
  overflow-y: auto;
  max-height: 240px;
  padding: 0 10px 10px;
}

.p226-req-cards {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 8px 0 4px;
  overflow-x: auto;
}

.p226-req-card {
  background: #fff;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 10px;
  padding: 10px 12px;
  min-width: 240px;
  max-width: 280px;
  flex-shrink: 0;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.p226-req-card-ext { border-left: 3px solid var(--brand, #FF6B00); }

.p226-req-card-hdr {
  display: flex;
  align-items: baseline;
  gap: 6px;
  justify-content: space-between;
}

.p226-req-card-proj {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy, #1e3a5f);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p226-req-card-window {
  font-size: 10px;
  font-weight: 600;
  color: #FF6B00;
  white-space: nowrap;
  flex-shrink: 0;
}

.p226-req-card-by,
.p226-req-card-addr {
  font-size: 10px;
  color: var(--tx-lt, #94a3b8);
}

.p226-req-card-notes {
  font-size: 11px;
  color: var(--tx-md, #475569);
  font-style: italic;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.p226-req-ext-badge {
  font-size: 10px;
  background: var(--brand-lt, #fff3e8);
  color: var(--brand-dk, #cc5500);
  border-radius: 10px;
  padding: 2px 8px;
  font-weight: 600;
  display: inline-block;
  align-self: flex-start;
}

.p226-req-card-actions { display: flex; gap: 5px; margin-top: 6px; }

.p226-req-btn-primary {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  border: none;
  background: var(--brand, #FF6B00);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
}
.p226-req-btn-primary:hover { background: var(--brand-dk, #cc5500); }

.p226-req-btn-ghost {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--bd, #cbd5e1);
  background: #fff;
  color: var(--tx-md, #475569);
  cursor: pointer;
  font-family: inherit;
}
.p226-req-btn-ghost:hover { background: var(--bg-lt, #f8fafc); }

.p226-req-btn-warn {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #fbbf24;
  background: #fffbeb;
  color: #92400e;
  cursor: pointer;
  font-family: inherit;
}

.p226-req-btn-danger {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #dc2626;
  cursor: pointer;
  font-family: inherit;
}

.p226-req-empty {
  font-size: 12px;
  color: var(--tx-lt, #94a3b8);
  text-align: center;
  padding: 18px 0;
  width: 100%;
}

/* ============================================================
   END PR226 POLISH ROUND 2
   ============================================================ */

/* ============================================================
   PR226 POLISH ROUND 3 — Two-line card, request drawer fix,
   Lily ribbon, rail collapse, unscheduled strip
   ============================================================ */

/* ---- Two-line card layout ---- */
.p226-card-line1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 26px;
  padding: 6px 6px 0;
}

.p226-card-proj-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy, #1e3a5f);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}

.p226-card-line2 {
  font-size: 10px;
  color: var(--tx-md, #475569);
  padding: 2px 6px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* Card buttons — right side of line 1 */
.p226-card-btns {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  margin-left: 2px;
}

.p226-info-btn,
.p226-menu-btn,
.p226-day-btn {
  width: 20px !important;
  height: 20px !important;
  border-radius: 4px;
  border: 1px solid var(--bd, #cbd5e1);
  background: rgba(255,255,255,0.9);
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  color: var(--tx-md, #475569);
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  font-family: inherit;
  transition: background .12s, color .12s, border-color .12s;
  flex-shrink: 0;
}

.p226-info-btn:hover { background: #eff6ff; color: var(--brand, #FF6B00); border-color: var(--brand, #FF6B00); }
.p226-menu-btn:hover { background: #fff7ed; color: var(--navy, #1e3a5f); border-color: var(--navy, #1e3a5f); }
.p226-day-btn:hover  { background: var(--brand-lt, #fff3e8); color: var(--brand-dk, #cc5500); border-color: var(--brand, #FF6B00); }

/* Badge row hidden on card face (data still in DOM for tests/billing) */
.p226-card-foot-hidden {
  display: none !important;
}

/* Card: no fixed height override — let content breathe within min/max */
.sch-card,
.p226-card {
  min-height: 72px !important;
  max-height: none !important;
  overflow: hidden;
  cursor: grab;
}

/* ---- Corrected request drawer (in-flow, not fixed) ---- */
/* Override everything from the old CSS at line 1115 */
.p226-req-drawer {
  position: static !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  flex-shrink: 0 !important;
  background: #fff;
  border-top: 2px solid var(--bd, #cbd5e1);
  transition: max-height 0.25s cubic-bezier(0.4,0,0.2,1) !important;
  max-height: 54px !important;
  overflow: hidden !important;
  z-index: 40 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.p226-req-drawer.p226-req-drawer-open {
  max-height: 300px !important;
  transform: none !important;
}

/* Also handle the old `.open` class if it still gets applied */
.p226-req-drawer.open {
  max-height: 300px !important;
  transform: none !important;
}

.p226-req-tab {
  display: flex !important;
  align-items: center !important;
  gap: 8px;
  padding: 0 14px;
  height: 52px !important;
  font-size: 12px;
  font-weight: 700;
  color: var(--navy, #1e3a5f);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .05em;
  user-select: none;
  background: #fff;
}

.p226-req-tab:hover { background: var(--bg-lt, #f8fafc); }

/* ---- Rail collapse — ensure toggle works ---- */
/* The toggle button sits at the top of the rail */
.p226-rail-toggle-wrap {
  display: flex;
  justify-content: flex-end;
  padding: 4px 4px 0;
  flex-shrink: 0;
}

.p226-rail {
  width: var(--p226-rail-w);
  min-width: var(--p226-rail-w);
  flex-shrink: 0;
  transition: width 0.2s ease, min-width 0.2s ease;
  overflow: hidden;
}

.p226-rail.p226-rail-collapsed {
  width: var(--p226-rail-collapsed-w) !important;
  min-width: var(--p226-rail-collapsed-w) !important;
}

/* Hide text labels in collapsed rail */
.p226-rail.p226-rail-collapsed .p226-rail-worker-name span,
.p226-rail.p226-rail-collapsed .p226-rail-days,
.p226-rail.p226-rail-collapsed .p226-rail-furlough-btn,
.p226-rail.p226-rail-collapsed .p226-rail-header .p226-label,
.p226-rail.p226-rail-collapsed .p226-worker-info,
.p226-rail.p226-rail-collapsed .p226-rail-name-hdr {
  display: none !important;
}

/* ---- Lily ribbon slot ---- */
.p226-lily-slot {
  flex-shrink: 0;
  min-height: 0;
}

/* When Lily inserts sr8-ribbon-stack, give it appropriate sizing */
.p226-lily-slot .sr8-ribbon-stack {
  width: 100%;
}

/* ---- Unscheduled strip ---- */
.swf-unsched-strip {
  flex-shrink: 0;
  border-top: 1px solid var(--bd-lt, #eef2f7);
  background: var(--bg-lt, #f8fafc);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
}

.swf-unsched-hd {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx-lt, #94a3b8);
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  margin-right: 4px;
}

.swf-unsched-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 20px;
  padding: 3px 8px 3px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--navy, #1e3a5f);
  white-space: nowrap;
}

.swf-unsched-pill.swf-unsched-off {
  background: #fef9c3;
  border-color: #fde68a;
  color: #854d0e;
}

.swf-unsched-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--navy, #1e3a5f);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.swf-off-tag {
  font-size: 9px;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  border-radius: 8px;
  padding: 1px 5px;
}

/* ---- Root layout: column flex so strips stack properly ---- */
.p226-root {
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

/* ---- Mini btn (in strips) ---- */
.swf-worker-role-tag {
  font-size: 9px;
  color: var(--tx-lt, #94a3b8);
  font-weight: 400;
}

/* ============================================================
   END PR226 POLISH ROUND 3
   ============================================================ */


/* ══════════════════════════════════════════════════════════════════
   PR226 Round 4 — Workflow Color System + Card Fix + Drag
   ══════════════════════════════════════════════════════════════════ */

/* ── Card: hover-reveal button overlay ──────────────────────────── */
.p226-card {
  position: relative !important;
  min-height: 90px;
}

/* State pill — visible at rest */
.p226-state-pill {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 8px;
  opacity: 0.85;
  pointer-events: none;
  transition: opacity .15s;
  z-index: 1;
}
.p226-card:hover .p226-state-pill { opacity: 0; }

.p226-state-unassigned  { background: #FFE8D6; color: #a33d00; }
.p226-state-assigned    { background: #FFE8D6; color: #a33d00; }
.p226-state-notified    { background: #fef3c7; color: #92400e; }
.p226-state-acknowledged{ background: #dcfce7; color: #166534; }
.p226-state-active      { background: #d1fae5; color: #065f46; }
.p226-state-conflict    { background: #fee2e2; color: #991b1b; }
.p226-state-emergency   { background: #fee2e2; color: #991b1b; }

/* Button overlay — appears on hover */
.p226-card-btn-overlay {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 3px;
  opacity: 0;
  transition: opacity .15s;
  z-index: 2;
}
.p226-card:hover .p226-card-btn-overlay {
  opacity: 1;
}

/* Ensure overlay buttons look right */
.p226-card-btn-overlay .p226-info-btn,
.p226-card-btn-overlay .p226-menu-btn,
.p226-card-btn-overlay .p226-day-btn {
  width: 22px;
  height: 22px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,.15);
  background: rgba(255,255,255,.92);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.p226-card-btn-overlay .p226-info-btn:hover { background: #e8f4fd; border-color: #0ea5e9; color: #0369a1; }
.p226-card-btn-overlay .p226-menu-btn:hover { background: #f3f4f6; }
.p226-card-btn-overlay .p226-day-btn:hover  { background: #e8f4fd; }

/* Card line 1: full-width project name (no button inline) */
.p226-card-line1 {
  width: 100%;
  padding-right: 0;  /* buttons are overlay now */
  min-height: 18px;
}
.p226-card-proj-name {
  display: block;
  width: 100%;
  font-size: 13px;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  padding-right: 28px; /* room for state pill at rest */
  margin-bottom: 3px;
}
/* Remove old .p226-card-btns span if still rendered (safety) */
.p226-card-btns { display: none !important; }

/* Line 2: crew · time · span · stage */
.p226-card-line2 {
  font-size: 11px;
  color: #555;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}

/* Color state left-border pulse for Active */
.p226-card-state-active {
  animation: p226-active-pulse 2s ease-in-out infinite;
}
@keyframes p226-active-pulse {
  0%, 100% { box-shadow: -4px 0 0 #FF6B00 inset; }
  50%       { box-shadow: -4px 0 0 #0fa884 inset, 0 0 8px rgba(26,188,156,.25); }
}

/* Conflict: flash */
.p226-card-state-conflict {
  animation: p226-conflict-flash 1.4s ease-in-out infinite;
}
@keyframes p226-conflict-flash {
  0%, 100% { opacity: 1; }
  50%       { opacity: .82; }
}

/* Drag affordance: ghost while dragging */
.p226-card.p226-dragging { opacity: .45; }
.p226-req-card.p226-dragging { opacity: .45; transform: rotate(2deg); }

/* Drop zone highlight */
.p226-col-body.p226-drop-zone-active,
.p226-nw-row.p226-drop-zone-active {
  background: rgba(255,107,0,.07) !important;
  outline: 2px dashed #FF6B00;
  outline-offset: -2px;
}
.p226-col-body.p226-drop-target,
.p226-nw-row.p226-drop-target {
  background: rgba(255,107,0,.13) !important;
  outline: 2px solid #FF6B00;
  outline-offset: -2px;
}
/* Worker drop onto job card */
.p226-card.p226-drop-zone-active {
  outline: 2px dashed #16a34a;
  outline-offset: 1px;
}
.p226-card.p226-drop-target {
  outline: 2px solid #16a34a;
  background: #f0fff4 !important;
}

/* ── Next Week compact list rows ────────────────────────────────── */
.p226-nw-body {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.p226-nw-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f9f9f9;
  border: 1px solid #eee;
  min-height: 36px;
  transition: background .1s;
}
.p226-nw-row:hover { background: #f3f4f6; }
.p226-nw-day-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 36px;
  flex-shrink: 0;
}
.p226-nw-dow {
  font-size: 10px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.p226-nw-date {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.1;
}
.p226-nw-today .p226-nw-dow { color: #FF6B00; }
.p226-nw-today .p226-nw-date {
  background: #FF6B00;
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.p226-nw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.p226-nw-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #222;
  cursor: grab;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: box-shadow .1s;
}
.p226-nw-chip:hover { box-shadow: 0 2px 6px rgba(0,0,0,.12); border-color: #FF6B00; }
.p226-nw-chip:active { cursor: grabbing; }
.p226-nw-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.p226-nw-initials {
  font-size: 10px;
  font-weight: 500;
  color: #666;
  background: #f0f0f0;
  border-radius: 3px;
  padding: 0 3px;
}
.p226-nw-time {
  font-size: 10px;
  color: #888;
}
.p226-nw-empty {
  font-size: 11px;
  color: #bbb;
  font-style: italic;
}
.p226-nw-add {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #fff;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.p226-nw-add:hover { background: #FF6B00; color: #fff; border-color: #FF6B00; }

/* ── Request card — draggable cursor ────────────────────────────── */
.p226-req-card[draggable="true"] {
  cursor: grab;
}
.p226-req-card[draggable="true"]:active {
  cursor: grabbing;
}

/* ── Unassigned card: dashed left border ────────────────────────── */
.p226-card-state-unassigned {
  border-left-style: dashed !important;
}


/* ══════════════════════════════════════════════════════════════════
   PR226 Round 5 — Board Polish Fixes
   ══════════════════════════════════════════════════════════════════ */

/* ── Card: enforce overflow:visible so hover overlay shows above column ── */
.p226-card {
  overflow: visible !important;
  position: relative !important;
}
.p226-col-body {
  overflow: visible !important;
  position: relative;
}
.p226-week-table {
  overflow: visible !important;
}
.p226-week-body {
  overflow: visible !important;
}

/* ── Card button overlay: always in DOM, visible on hover ────────── */
.p226-card-btn-overlay {
  position: absolute !important;
  top: 4px !important;
  right: 4px !important;
  display: flex !important;
  gap: 3px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity .12s ease !important;
  z-index: 20 !important;
}
.p226-card:hover .p226-card-btn-overlay {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Override any old button size rules inside overlay */
.p226-card-btn-overlay .p226-info-btn,
.p226-card-btn-overlay .p226-menu-btn,
.p226-card-btn-overlay .p226-day-btn {
  width: 22px !important;
  height: 22px !important;
  font-size: 11px !important;
  border-radius: 4px !important;
  border: 1px solid rgba(0,0,0,.18) !important;
  background: rgba(255,255,255,.95) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  color: #333 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.15) !important;
}
.p226-card-btn-overlay .p226-info-btn:hover { background: #e8f4fd !important; color: #0369a1 !important; }
.p226-card-btn-overlay .p226-menu-btn:hover { background: #f3f4f6 !important; }
.p226-card-btn-overlay .p226-day-btn:hover  { background: #fff3e8 !important; }

/* ── State pill: hide on hover to expose overlay buttons ─────────── */
.p226-state-pill {
  transition: opacity .12s ease !important;
}
.p226-card:hover .p226-state-pill {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── Next Week compact card ──────────────────────────────────────── */
.p226-card-compact {
  min-height: 52px !important;
  max-height: none !important;
  height: auto !important;
  padding: 5px 6px 4px !important;
  cursor: grab;
}
.p226-cc-top {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
}
.p226-cc-name {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: #1a1a1a;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  min-width: 0;
}
.p226-cc-btns {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .12s ease;
}
.p226-card-compact:hover .p226-cc-btns {
  opacity: 1;
}
.p226-cc-btns .p226-crd-btn {
  width: 20px !important;
  height: 20px !important;
  font-size: 10px !important;
  border-radius: 3px !important;
  border: 1px solid rgba(0,0,0,.15) !important;
  background: rgba(255,255,255,.95) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  color: #444 !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.12) !important;
}
.p226-cc-btns .p226-crd-btn:hover { background: #e8f4fd !important; }
.p226-cc-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 3px;
}
.p226-cc-initials {
  font-size: 10px;
  font-weight: 600;
  color: #555;
  background: rgba(0,0,0,.06);
  border-radius: 3px;
  padding: 1px 4px;
}
.p226-cc-time {
  font-size: 10px;
  color: #888;
}

/* Next Week column: smaller min-height so compact cards breathe */
.p226-col-body-next {
  vertical-align: top;
  padding: 4px 3px !important;
}
.p226-week-block-next .p226-col-hdr {
  background: #f9f9f9;
}
.p226-week-table-next {
  font-size: 12px;
}

/* ── Worker rail collapse: fix button click area ─────────────────── */
.p226-rail-toggle-wrap {
  position: absolute;
  right: -14px;
  top: 12px;
  z-index: 30;
}
.p226-rail-toggle {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  background: #fff !important;
  border: 1px solid #ddd !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 10px !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.15) !important;
  transition: background .12s !important;
}
.p226-rail-toggle:hover { background: #FF6B00 !important; color: #fff !important; border-color: #FF6B00 !important; }
.p226-rail {
  position: relative;
  overflow: visible !important;
}

/* ── Worker drawer: drag hint label ─────────────────────────────── */
.swf-drag-hint {
  font-size: 10px;
  color: #999;
  text-align: center;
  padding: 4px 8px;
  border-bottom: 1px solid #eee;
  margin-bottom: 4px;
}

/* ══════════════════════════════════════════════════════════════════
   PR226 Round 5b — Always-clickable buttons (bypass overflow clip)
   Buttons are slightly visible at rest so they're always clickable
   even when the card is inside an overflow:hidden scroll container.
   ══════════════════════════════════════════════════════════════════ */

/* Full-card cards (This Week): buttons always present at low opacity */
.p226-card-btn-overlay {
  opacity: .28 !important;
  pointer-events: auto !important;
}
.p226-card:hover .p226-card-btn-overlay {
  opacity: 1 !important;
}

/* Compact cards (Next Week): same */
.p226-cc-btns {
  opacity: .28 !important;
}
.p226-card-compact:hover .p226-cc-btns {
  opacity: 1 !important;
}

/* State pill: always visible unless hovered */
.p226-state-pill {
  opacity: .7;
}
.p226-card:hover .p226-state-pill {
  opacity: 0 !important;
}

/* Rail: allow toggle button to overflow outside its container */
.p226-rail {
  overflow: visible !important;
}
.p226-rail-table {
  overflow: visible !important;
}


/* ══════════════════════════════════════════════════════════════════
   PR226 Round 6 — Fixed Layout + Req Drawer + Crew Panel
   ══════════════════════════════════════════════════════════════════ */

/* Root: full-screen fixed overlay (standalone) or fills VillaShell panel */
.p226-root {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 9000 !important;
  display: flex !important;
  flex-direction: column !important;
  background: #fff !important;
  overflow: hidden !important;
}

/* Inside VillaShell, the panel already provides the fixed frame.
   Override position:fixed so we don't break the shell's scroll. */
#vsFullPanel .p226-root,
#vsFullPanel #p226Root {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  height: 100% !important;
  z-index: auto !important;
}

/* Controls bar: never scrolls */
.p226-controls-bar {
  flex-shrink: 0 !important;
  z-index: 100 !important;
  position: relative !important;
}

/* Lily ribbon slot: never scrolls */
.p226-lily-slot {
  flex-shrink: 0 !important;
}

/* Body row: all available space, scrollable per column */
.p226-body {
  flex: 1 !important;
  display: flex !important;
  flex-direction: row !important;
  overflow: hidden !important;   /* rail and drawer handle their own scroll */
  min-height: 0 !important;
  position: relative !important;
}

/* Board wrap: scrolls vertically (this is where the board lives) */
.p226-board-wrap {
  flex: 1 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  min-width: 0 !important;
  padding-bottom: 8px !important;
}

/* Available worker strip below board */
.p226-avail-strip {
  flex-shrink: 0 !important;
}

/* ── Request drawer: fixed to bottom of p226-root ────────────────── */
/* The drawer is a direct child of p226-root (flex-column last item).
   It slides up by changing max-height. It never clips because it's
   the last flex child — the body above it shrinks to make room. */
.p226-req-drawer {
  flex-shrink: 0 !important;
  position: relative !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  background: #fff !important;
  border-top: 2px solid #e2e8f0 !important;
  max-height: 56px !important;
  transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1) !important;
  overflow: hidden !important;
  z-index: 200 !important;
  box-shadow: 0 -2px 8px rgba(0,0,0,.08) !important;
}
.p226-req-drawer.p226-req-drawer-open {
  max-height: 320px !important;
}

.p226-req-tab {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 0 16px !important;
  height: 54px !important;
  cursor: pointer !important;
  user-select: none !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
  color: #1e3a5f !important;
  background: #fff !important;
}
.p226-req-tab:hover {
  background: #f8fafc !important;
}
.p226-req-tab-label { flex: 1 !important; }
.p226-req-tab-count {
  background: #FF6B00 !important;
  color: #fff !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  padding: 2px 8px !important;
  border-radius: 10px !important;
}
.p226-req-tab-chevron {
  font-size: 11px !important;
  color: #94a3b8 !important;
  transition: transform .2s !important;
}
.p226-req-drawer.p226-req-drawer-open .p226-req-tab-chevron {
  transform: rotate(180deg) !important;
}
.p226-req-scroll {
  overflow-y: hidden !important;
  overflow-x: auto !important;
  padding: 0 12px 12px !important;
  max-height: 260px !important;
}
.p226-req-cards {
  display: flex !important;
  flex-direction: row !important;
  gap: 10px !important;
  padding: 6px 0 !important;
  flex-wrap: nowrap !important;
}

/* ── Right-side crew drawer: matches left rail visual language ───── */
.p226-worker-drawer {
  position: relative !important;
  width: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  background: var(--bg-lt, #f8fafc) !important;
  border-left: 1px solid #e2e8f0 !important;
  display: flex !important;
  flex-direction: column !important;
  transition: width 0.22s cubic-bezier(0.4,0,0.2,1) !important;
  z-index: 50 !important;
}
.p226-worker-drawer.p226-worker-drawer-open {
  width: 240px !important;
  min-width: 240px !important;
}

/* Toggle button — mirrored from left rail toggle */
.p226-worker-drawer-toggle {
  position: absolute !important;
  left: -14px !important;
  top: 14px !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  background: #fff !important;
  border: 1px solid #ddd !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 10px !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.15) !important;
  z-index: 60 !important;
  transition: background .12s !important;
  overflow: visible !important;
}
.p226-worker-drawer.p226-worker-drawer-open .p226-worker-drawer-toggle {
  left: -14px !important;
}
.p226-worker-drawer-toggle:hover {
  background: #FF6B00 !important;
  color: #fff !important;
  border-color: #FF6B00 !important;
}

/* Header */
.p226-worker-drawer-hdr {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 12px 8px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  flex-shrink: 0 !important;
  background: #fff !important;
  white-space: nowrap !important;
}
.p226-worker-drawer-title {
  font-size: 11px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: .06em !important;
  color: #1e3a5f !important;
}
.p226-worker-drawer-close {
  background: none !important;
  border: none !important;
  font-size: 16px !important;
  cursor: pointer !important;
  color: #94a3b8 !important;
  padding: 0 !important;
  line-height: 1 !important;
}

/* ── Worker drawer toggle button in controls bar ─────────────────── */
/* Make it clearly labeled */
.p226-worker-drawer-btn {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
}
.p226-worker-drawer-btn::after {
  content: 'Crew' !important;
  font-size: 11px !important;
}

/* ── Column board: cards use visible overflow for hover overlay ───── */
.p226-week-table {
  table-layout: fixed !important;
  overflow: visible !important;
}
.p226-col-body {
  overflow: visible !important;
  vertical-align: top !important;
  padding: 4px 4px !important;
}
.p226-card {
  overflow: visible !important;
  position: relative !important;
}

/* ── Left rail: fix overflow for toggle button ───────────────────── */
.p226-rail {
  overflow: visible !important;
  position: relative !important;
  flex-shrink: 0 !important;
}
.p226-rail-toggle-wrap {
  position: absolute !important;
  right: -14px !important;
  top: 14px !important;
  z-index: 60 !important;
}

/* ══════════════════════════════════════════════════════════════════
   PR226 Round 6b — VillaShell vs-body integration fix
   ══════════════════════════════════════════════════════════════════ */

/* vs-body wraps p226-root — strip its padding and turn it into a
   flex column so p226-root fills the full available area */
.vs-body:has(#p226Root),
.vs-body:has(.p226-root) {
  padding: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

/* p226-root inside vs-body: fill it exactly */
.vs-body .p226-root,
.vs-body #p226Root {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  flex: 1 !important;
  height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  z-index: auto !important;
}

/* Board wrap: the ONLY scroll region — fills remaining space */
.vs-body .p226-board-wrap {
  flex: 1 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  min-height: 0 !important;
}

/* Req drawer inside vs-body: last flex child, slides up cleanly */
.vs-body .p226-req-drawer {
  flex-shrink: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  max-height: 56px !important;
  transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1) !important;
}
.vs-body .p226-req-drawer.p226-req-drawer-open {
  max-height: 320px !important;
}

/* Ensure vs-panel itself doesn't double-scroll */
#vsFullPanel {
  overflow: hidden !important;
}

/* ══════════════════════════════════════════════════════════════════
   PR226 Round 6c — Single scroll, sticky req drawer
   ══════════════════════════════════════════════════════════════════ */

/* p226-root is a flex column filling vs-body.
   board-wrap does NOT have its own scrollbar — the root handles scroll.
   req drawer sticks to the bottom via sticky positioning. */

/* The root is overflow:hidden (set by JS in mount).
   board-wrap fills remaining space and scrolls. */
.p226-root .p226-board-wrap {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  min-height: 0 !important;
  /* No fixed height — grows to fill flex space */
}

/* Req drawer: last flex child, always visible at bottom */
.p226-root .p226-req-drawer {
  flex-shrink: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  max-height: 56px !important;
  transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1) !important;
  z-index: 100 !important;
  border-top: 2px solid #e2e8f0 !important;
  background: #fff !important;
}
.p226-root .p226-req-drawer.p226-req-drawer-open {
  max-height: 320px !important;
}

/* Available worker strip: don't push req drawer off screen */
.p226-root .p226-avail-strip {
  flex-shrink: 0 !important;
  max-height: 80px !important;
  overflow: hidden !important;
}


/* ══════════════════════════════════════════════════════════════════
   PR226 Round 7 — Crew drawer day-context + scroll fix + card names
   ══════════════════════════════════════════════════════════════════ */

/* ── Layout: no left rail, board takes full width ─────────────── */
.p226-root .p226-rail,
.p226-root #p226Rail {
  display: none !important;
}

/* ── Scroll architecture: ONE scroll region ───────────────────── */
/* vs-body is already set to flex-column overflow:hidden by mount() JS.
   p226-root fills it and is also flex-column overflow:hidden.
   p226-body is flex:1 overflow:hidden — contains board + drawer.
   p226-board-wrap is the single scrollable region.
   p226-req-drawer is flex-shrink:0 pinned at bottom.           */

.p226-root {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  overflow: hidden !important;
}

.p226-root .p226-body {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: row !important;
}

.p226-root .p226-board-wrap {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  /* Custom scrollbar — thin and subtle */
  scrollbar-width: thin !important;
  scrollbar-color: #d1d5db transparent !important;
}
.p226-root .p226-board-wrap::-webkit-scrollbar { width: 4px; }
.p226-root .p226-board-wrap::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
.p226-root .p226-board-wrap::-webkit-scrollbar-track { background: transparent; }

/* Right drawer: no visible scrollbar, scrolls silently */
.p226-root .p226-worker-drawer {
  overflow: hidden !important; /* collapsed: no scroll */
}
.p226-root .p226-worker-drawer.p226-worker-drawer-open .p226-worker-drawer-body {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}
.p226-root .p226-worker-drawer.p226-worker-drawer-open .p226-worker-drawer-body::-webkit-scrollbar {
  display: none !important;
}

/* Req drawer pinned to bottom */
.p226-root .p226-req-drawer {
  flex-shrink: 0 !important;
  z-index: 100 !important;
  border-top: 2px solid #e2e8f0 !important;
  background: #fff !important;
  overflow: hidden !important;
  max-height: 56px !important;
  transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1) !important;
}
.p226-root .p226-req-drawer.p226-req-drawer-open {
  max-height: 320px !important;
}

/* ── Card: worker first-names row ─────────────────────────────── */
.p226-card-names {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  padding: 0 2px;
}
.p226-card-fname {
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
  background: rgba(0,0,0,0.06);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

/* ── Info popover: crew section ───────────────────────────────── */
.p226-pop-crew {
  margin: 8px 0 4px;
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
}
.p226-pop-crew-hdr {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 4px;
}
.p226-pop-crew-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
}
.p226-pop-crew-name {
  font-size: 13px;
  color: #1e293b;
}
.p226-pop-remove-worker {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  border-radius: 4px;
  transition: background 0.15s;
}
.p226-pop-remove-worker:hover {
  background: #fee2e2;
}
.p226-pop-crew-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* ── Crew drawer: day-dot row ─────────────────────────────────── */
.p226-drawer-dots {
  display: flex;
  gap: 4px;
  margin: 6px 0 4px;
  align-items: center;
}
.p226-day-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  cursor: default;
  user-select: none;
}
.p226-dot-avail    { background: #dcfce7; color: #16a34a; }
.p226-dot-assigned { background: #dbeafe; color: #1d4ed8; }
.p226-dot-conflict { background: #fee2e2; color: #dc2626; }
.p226-dot-off      { background: #f1f5f9; color: #94a3b8; }
.p226-dot-active-day {
  outline: 2px solid #FF6B00;
  outline-offset: 1px;
}

/* Drawer section headers */
.p226-drawer-section-hdr {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  padding: 8px 0 4px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 4px;
}
.p226-drawer-section-empty {
  color: #94a3b8;
}
.p226-drawer-section-assigned {
  color: #94a3b8;
  margin-top: 12px;
}

/* Assigned workers in drawer: muted, not draggable */
.swf-card-assigned {
  opacity: 0.55;
}
/* Conflict workers: red border, shown at top */
.swf-card-conflict {
  border: 1px solid #fca5a5 !important;
  background: #fff4f4 !important;
}


/* ═══════════════════════════════════════════════════════════════════
   TradeRailPR226 Round 8 — Lily FAB + Dot Popover + Skill Filter
   G3 over-capacity · G4 day-dot popover · G5 skill filter
   G12 standby dot · G13 empty ribbon · Lily FAB chat
   ═══════════════════════════════════════════════════════════════════ */

/* ── G12 Standby dot ─────────────────────────────────────────────── */
.p226-dot-standby {
  background: repeating-linear-gradient(
    45deg,
    #9ca3af 0px, #9ca3af 2px,
    #e5e7eb 2px, #e5e7eb 5px
  );
  border: 1.5px solid #9ca3af !important;
  color: #6b7280;
  font-size: 9px;
}
.swf-status-standby {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
  display: inline-block;
  margin-top: 3px;
}

/* ── G4 Day-dot wrap + popover ───────────────────────────────────── */
.p226-day-dot-wrap {
  position: relative;
  display: inline-block;
}
.p226-dot-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  padding: 10px 10px 8px;
  z-index: 9999;
  min-width: 156px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: p226FadeIn 0.12s ease;
}
.p226-dotp-hdr {
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  text-align: center;
  padding-bottom: 6px;
  margin-bottom: 2px;
  border-bottom: 1px solid #f3f4f6;
}
.p226-dotp-btn {
  width: 100%;
  padding: 6px 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, border-color 0.1s;
}
.p226-dotp-btn:hover { background: #f3f4f6; border-color: #d1d5db; }
.p226-dotp-btn-active { border-color: #FF6B00 !important; background: #fff7f0 !important; color: #FF6B00 !important; font-weight: 700 !important; }
.p226-dotp-avail.p226-dotp-btn-active  { border-color: #16a34a !important; background: #f0fff4 !important; color: #16a34a !important; }
.p226-dotp-sick.p226-dotp-btn-active   { border-color: #dc2626 !important; background: #fef2f2 !important; color: #dc2626 !important; }
.p226-dotp-vacation.p226-dotp-btn-active { border-color: #7c3aed !important; background: #faf5ff !important; color: #7c3aed !important; }
.p226-dotp-standby.p226-dotp-btn-active  { border-color: #9ca3af !important; background: #f3f4f6 !important; color: #6b7280 !important; }
.p226-dotp-close {
  position: absolute;
  top: 5px;
  right: 8px;
  background: none;
  border: none;
  font-size: 15px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.p226-dotp-close:hover { color: #374151; }

/* ── G5 Skill filter bar ─────────────────────────────────────────── */
.p226-skill-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 10px 5px;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 4px;
}
.p226-skill-chip {
  padding: 3px 10px;
  border-radius: 20px;
  border: 1.5px solid #e5e7eb;
  background: #f9fafb;
  color: #6b7280;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
  line-height: 1.4;
}
.p226-skill-chip:hover { border-color: #FF6B00; color: #FF6B00; background: #fff7f0; }
.p226-skill-chip-active { border-color: #FF6B00 !important; background: #FF6B00 !important; color: #fff !important; font-weight: 700; }
.p226-skill-chip-clear {
  padding: 3px 10px;
  border-radius: 20px;
  border: 1.5px solid #e5e7eb;
  background: none;
  color: #9ca3af;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.12s;
  line-height: 1.4;
}
.p226-skill-chip-clear:hover { color: #374151; border-color: #9ca3af; }

/* ── G3 Over-capacity chip ───────────────────────────────────────── */
.p226-overcap-chip {
  display: inline-block;
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  margin: 3px 0 1px;
  letter-spacing: 0.01em;
}

/* ── G13 Empty board Lily ribbon ─────────────────────────────────── */
.p226-lily-empty-ribbon {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg,#fff7f0 0%,#fff 100%);
  border: 1.5px dashed #FF6B00;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 0 0 14px 0;
  animation: p226FadeIn 0.2s ease;
}
.p226-lily-empty-icon { font-size: 18px; flex-shrink: 0; color: #FF6B00; }
.p226-lily-empty-msg  { flex: 1; font-size: 12.5px; color: #6b7280; line-height: 1.5; }
.p226-lily-empty-btn  {
  padding: 6px 14px;
  background: #FF6B00;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.p226-lily-empty-btn:hover { background: #e55f00; }

/* ── Lily FAB ────────────────────────────────────────────────────── */
#p226Root { position: relative; }
.p226-lily-fab-wrap {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 8000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}
.p226-lily-fab {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: transparent;
  border: none;
  box-shadow: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: visible;
  position: relative;
  pointer-events: all;
  transition: transform 0.15s;
}
.p226-lily-fab:hover { transform: scale(1.08); }
.p226-trai-img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; display: block; pointer-events: none; }
.p226-lily-fab-icon { line-height: 1; pointer-events: none; }
.p226-lily-fab-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  pointer-events: none;
}
@keyframes p226FabPulse {
  0%,100% { box-shadow: 0 4px 16px rgba(255,107,0,0.35); }
  50%      { box-shadow: 0 4px 28px rgba(231,76,60,0.6),0 0 0 6px rgba(231,76,60,0.15); }
}
.p226-lily-fab-pulse { animation: p226FabPulse 1.4s ease-in-out infinite; background: #e74c3c !important; }

/* ── Lily FAB chat window ─────────────────────────────────────────── */
.p226-lily-chat {
  width: 300px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: p226FadeIn 0.15s ease;
  pointer-events: all;
  max-height: 400px;
}
.p226-lily-chat-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #FF6B00;
  color: #fff;
  flex-shrink: 0;
}
.p226-lily-chat-title { font-size: 13px; font-weight: 700; }
.p226-lily-chat-close {
  background: none; border: none; color: #fff;
  font-size: 16px; cursor: pointer; line-height: 1;
  padding: 0 2px; opacity: 0.85;
}
.p226-lily-chat-close:hover { opacity: 1; }
.p226-lily-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
  max-height: 260px;
}
.p226-lily-msg {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  max-width: 92%;
}
.p226-lily-msg-lily {
  background: #fff7f0;
  border: 1px solid #ffe4cc;
  color: #374151;
  align-self: flex-start;
}
.p226-lily-msg-user {
  background: #FF6B00;
  color: #fff;
  align-self: flex-end;
  border: none;
}
.p226-lily-chat-input-row {
  display: flex;
  border-top: 1px solid #f3f4f6;
  padding: 8px 10px;
  gap: 6px;
  flex-shrink: 0;
}
.p226-lily-chat-input {
  flex: 1;
  border: 1.5px solid #e5e7eb;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
  background: #fafafa;
}
.p226-lily-chat-input:focus { border-color: #FF6B00; background: #fff; }
.p226-lily-chat-send {
  padding: 6px 12px;
  background: #FF6B00;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s;
  white-space: nowrap;
}
.p226-lily-chat-send:hover { background: #e55f00; }

/* ============================================================
   PR226 R9 — Month View: calendar grid
   ============================================================ */
.p226-month-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: var(--bg-lt, #f8fafc);
}

/* Month nav bar */
.p226-month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 8px;
  background: #fff;
  border-bottom: 1px solid var(--bd-lt, #eef2f7);
  flex-shrink: 0;
}
.p226-month-nav-title {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy, #1e3a5f);
}
.p226-month-nav-btn {
  background: none;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--tx-md, #475569);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, border-color 0.1s;
}
.p226-month-nav-btn:hover {
  background: var(--bg-lt, #f8fafc);
  border-color: var(--p226-orange, #FF6B00);
  color: var(--p226-orange, #FF6B00);
}

/* Day-of-week header */
.p226-mcal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #fff;
  border-bottom: 1px solid var(--bd-lt, #eef2f7);
  flex-shrink: 0;
}
.p226-mcal-dow {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tx-lt, #94a3b8);
  padding: 5px 2px;
}

/* Calendar grid */
.p226-mcal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--bd-lt, #eef2f7);
  flex: 1;
  overflow-y: auto;
}
.p226-mcal-cell {
  background: #fff;
  padding: 5px 5px 4px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.p226-mcal-cell:hover { background: #fafafa; }
.p226-mcal-blank {
  background: var(--bg-lt, #f8fafc);
  cursor: default;
}
.p226-mcal-blank:hover { background: var(--bg-lt, #f8fafc); }
.p226-mcal-weekend { background: #f9fafb; }
.p226-mcal-weekend:hover { background: #f3f4f6; }

/* Date number row */
.p226-mcal-date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}
.p226-mcal-date-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--tx-md, #475569);
  line-height: 1;
}
.p226-mcal-today .p226-mcal-date-num {
  background: var(--p226-orange, #FF6B00);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.p226-mcal-selected {
  outline: 2px solid var(--p226-orange, #FF6B00);
  outline-offset: -2px;
}
.p226-mcal-cap-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Job chips */
.p226-mcal-chip {
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid var(--p226-orange, #FF6B00);
  background: #fff4ed;
  color: var(--tx, #0f172a);
  cursor: pointer;
  transition: filter 0.1s;
}
.p226-mcal-chip:hover { filter: brightness(0.95); }
.p226-mcal-more {
  font-size: 10px;
  color: var(--tx-lt, #94a3b8);
  cursor: pointer;
  padding: 1px 4px;
}
.p226-mcal-more:hover { color: var(--p226-orange, #FF6B00); }

/* ============================================================
   PR226 R9 — Day View: hourly time-block layout
   ============================================================ */
.p226-day-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  background: var(--bg-lt, #f8fafc);
}

/* Day nav bar */
.p226-day-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 8px;
  background: #fff;
  border-bottom: 1px solid var(--bd-lt, #eef2f7);
  flex-shrink: 0;
}
.p226-day-nav-title {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy, #1e3a5f);
}
.p226-day-nav-btn {
  background: none;
  border: 1px solid var(--bd, #cbd5e1);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--tx-md, #475569);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, border-color 0.1s;
}
.p226-day-nav-btn:hover {
  background: var(--bg-lt, #f8fafc);
  border-color: var(--p226-orange, #FF6B00);
  color: var(--p226-orange, #FF6B00);
}
.p226-day-add-btn {
  font-size: 12px;
  padding: 4px 10px;
  height: 28px;
}

/* Timeline scroll area */
.p226-day-timeline {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Hour rows */
.p226-day-hour-row {
  display: flex;
  align-items: flex-start;
  border-top: 1px solid var(--bd-lt, #eef2f7);
  min-height: 56px;
  background: #fff;
  transition: background 0.1s;
}
.p226-day-hour-row:hover { background: #fafbff; }
.p226-day-hour-current {
  background: #fffbeb;
  border-top-color: var(--p226-orange, #FF6B00);
}
.p226-day-hour-label {
  width: 52px;
  flex-shrink: 0;
  font-size: 10px;
  color: var(--tx-lt, #94a3b8);
  padding: 6px 8px 0;
  font-weight: 600;
  text-align: right;
  border-right: 1px solid var(--bd-lt, #eef2f7);
}
.p226-day-hour-body {
  flex: 1;
  padding: 5px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.p226-day-hour-empty {
  width: 100%;
  min-height: 44px;
}

/* Job blocks inside hour rows */
.p226-day-job-block {
  border-left: 4px solid var(--p226-orange, #FF6B00);
  background: #fff;
  border-radius: 0 5px 5px 0;
  padding: 6px 10px 6px 8px;
  min-width: 160px;
  max-width: 280px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.p226-day-job-block:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}
.p226-day-job-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy, #1e3a5f);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p226-day-job-crew {
  font-size: 10px;
  color: var(--tx-md, #475569);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p226-day-job-dur {
  font-size: 10px;
  color: var(--tx-lt, #94a3b8);
}
.p226-day-job-state {
  font-size: 9px;
  margin-top: 2px;
  align-self: flex-start;
  text-transform: capitalize;
}

/* Unscheduled section */
.p226-day-unsched {
  padding: 10px 14px;
  background: var(--bg-lt, #f8fafc);
  border-top: 2px dashed var(--bd-lt, #eef2f7);
  flex-shrink: 0;
}
.p226-day-unsched-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tx-lt, #94a3b8);
  margin-bottom: 6px;
}


/* ============================================================
   PR226 R10 — Info popover chip colors + linked clone + pop rows
   ============================================================ */

/* BLOCKED chip */
.p226-chip-blocked {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

/* CHANGE ORDER chip */
.p226-chip-co {
  background: #ede9fe;
  color: #4c1d95;
  border: 1px solid #c4b5fd;
}

/* Billing status chips */
.p226-chip-bq-pending {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fcd34d;
}
.p226-chip-bq-ready {
  background: #f0fdf4;
  color: #14532d;
  border: 1px solid #86efac;
}
.p226-chip-nonbill {
  background: #f8fafc;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* Active clock-in row */
.p226-pop-row-active {
  background: #fff3e8;
  border-radius: 4px;
  padding: 3px 6px;
  color: #0f5132;
  font-weight: 600;
}
.p226-pop-row-active b { color: #FF6B00; }

/* BLOCKED warning row */
.p226-pop-row-warn {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 3px 6px;
  border-radius: 0 4px 4px 0;
  color: #78350f;
  font-size: 11px;
}

/* Change order row */
.p226-pop-row-co {
  background: #ede9fe;
  border-left: 3px solid #7c3aed;
  padding: 3px 6px;
  border-radius: 0 4px 4px 0;
  color: #4c1d95;
  font-size: 11px;
}

/* Maps link hint */
.p226-pop-maps-hint {
  font-size: 10px;
  color: var(--p226-orange, #FF6B00);
  text-decoration: underline;
}

/* Linked clone card — subtle visual distinction */
.p226-card-linked-clone {
  opacity: 0.88;
}
.p226-card-linked-clone .p226-card-proj-name {
  color: #475569;
}
.p226-card-linked-clone::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 10px 10px 0;
  border-color: transparent var(--bd, #cbd5e1) transparent transparent;
}

/* PR349 additions */

/* Lily insight bar */
.tr303-lily-bar.p226-lily-insight-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 7px 16px; background: #fff8f0;
  border-left: 4px solid #FF6B00; border-bottom: 1px solid #ffe0c0;
  font-size: 12px; color: #1A1A2E; min-height: 32px;
}
.p226-lily-insight-prefix { font-weight: 700; color: #FF6B00; margin-right: 4px; flex-shrink: 0; }
.p226-lily-insight-item { cursor: default; }
.p226-lily-insight-item:hover { text-decoration: underline; }
.p226-lily-insight-sep { color: #FF6B00; opacity: 0.5; }
.p226-lily-insight-more { background: none; border: 1px solid #FF6B00; color: #FF6B00; border-radius: 4px; padding: 1px 8px; font-size: 11px; cursor: pointer; margin-left: 8px; }
.p226-lily-insight-disclaimer { font-size: 10px; color: #94a3b8; margin-left: auto; flex-shrink: 0; }

/* Worker picker popover */
.p226-worker-picker-panel {
  position: fixed; top: 0; right: 0; width: 380px; height: 100vh;
  background: #fff; border-left: 1px solid #e5e7eb; box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  display: flex; flex-direction: column; z-index: 1200;
}
.p226-picker-hdr { display: flex; align-items: center; justify-content: space-between; padding: 16px; border-bottom: 1px solid #e5e7eb; }
.p226-picker-title { font-weight: 700; font-size: 14px; color: #1A1A2E; }
.p226-picker-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #6b7280; padding: 0 4px; }
.p226-picker-search-wrap { padding: 10px 16px; border-bottom: 1px solid #f3f4f6; }
.p226-picker-search { width: 100%; box-sizing: border-box; padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }
.p226-picker-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.p226-picker-section-hdr { font-size: 11px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; padding: 8px 16px 4px; }
.p226-picker-section-other { color: #d97706; }
.p226-picker-section-off { color: #9ca3af; }
.p226-picker-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid #f9fafb; }
.p226-picker-row-assigned { background: #f0fff4; }
.p226-picker-avatar { width: 36px; height: 36px; border-radius: 50%; background: #1A1A2E; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.p226-picker-info { flex: 1; min-width: 0; }
.p226-picker-name { display: block; font-weight: 600; font-size: 13px; color: #1A1A2E; }
.p226-picker-role { display: block; font-size: 11px; color: #6b7280; }
.p226-picker-cert { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; margin-top: 2px; }
.p226-picker-cert-red { background: #fef2f2; color: #b91c1c; }
.p226-picker-cert-yellow { background: #fffbeb; color: #92400e; }
.p226-picker-ot { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; margin-top: 2px; background: #fffbeb; color: #92400e; margin-left: 4px; }
.p226-picker-add { background: #FF6B00; color: #fff; border: none; border-radius: 5px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.p226-picker-add:disabled { background: #d1d5db; color: #9ca3af; cursor: not-allowed; }
.p226-picker-remove { background: #fef2f2; color: #b91c1c; border: 1px solid #fca5a5; border-radius: 5px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.p226-picker-empty { padding: 24px 16px; color: #9ca3af; font-size: 13px; text-align: center; }

/* PTO / Holiday cell striping */
.p226-col-pto { background-image: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(255,107,0,0.08) 4px, rgba(255,107,0,0.08) 8px); }
.p226-col-holiday { background-image: repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(107,114,128,0.1) 4px, rgba(107,114,128,0.1) 8px); cursor: not-allowed; }
.p226-col-holiday-label { font-size: 10px; color: #6b7280; text-align: center; padding: 2px 0; }

/* OT badge on worker card */
.p226-ot-badge { display: inline-block; font-size: 10px; font-weight: 700; background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; border-radius: 3px; padding: 1px 5px; margin-left: 4px; }
.p226-cert-badge-red { display: inline-block; font-size: 10px; font-weight: 700; background: #fef2f2; color: #b91c1c; border-radius: 3px; padding: 1px 5px; margin-left: 4px; }
.p226-cert-badge-yellow { display: inline-block; font-size: 10px; font-weight: 700; background: #fffbeb; color: #92400e; border-radius: 3px; padding: 1px 5px; margin-left: 4px; }
.p226-materials-flag { display: inline-block; font-size: 10px; font-weight: 700; background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; border-radius: 3px; padding: 1px 6px; margin-top: 3px; }

/* Undo toast */
.p226-undo-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #1A1A2E; color: #fff; border-radius: 8px; padding: 10px 20px;
  display: flex; align-items: center; gap: 12px; z-index: 3000; box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  font-size: 13px;
}
.p226-undo-toast button { background: #FF6B00; color: #fff; border: none; border-radius: 5px; padding: 4px 12px; font-size: 12px; font-weight: 700; cursor: pointer; }

/* Drag drop zone highlight */
.p226-drop-zone-active { outline: 2px dashed #FF6B00 !important; outline-offset: -2px; }
.p226-drop-target { background: rgba(255,107,0,0.08) !important; outline: 2px solid #FF6B00 !important; outline-offset: -2px; animation: p226-pulse 0.7s ease-in-out infinite alternate; }
@keyframes p226-pulse { from { outline-color: #FF6B00; } to { outline-color: #ffaa70; } }

/* Photo prompt */
.p226-photo-prompt {
  position: fixed; bottom: 16px; right: 16px; background: #fff; border: 1px solid #e5e7eb;
  border-radius: 10px; padding: 14px 18px; box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  display: flex; align-items: center; gap: 10px; z-index: 2500; font-size: 13px;
}
.p226-photo-prompt button { background: #FF6B00; color: #fff; border: none; border-radius: 5px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.p226-photo-prompt button:last-child { background: #f3f4f6; color: #374151; }

/* Briefing gate */
.p226-briefing-gate {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 4000;
  display: flex; align-items: center; justify-content: center;
}
.p226-briefing-gate-box {
  background: #fff; border-radius: 12px; padding: 28px 32px; max-width: 380px;
  text-align: center; box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}
.p226-briefing-gate-title { font-size: 18px; font-weight: 700; color: #1A1A2E; margin-bottom: 10px; }
.p226-briefing-gate-msg { font-size: 14px; color: #374151; margin-bottom: 20px; }
.p226-briefing-gate-box button { display: block; width: 100%; padding: 10px; border-radius: 7px; font-size: 14px; font-weight: 600; cursor: pointer; margin-bottom: 8px; border: none; }
.p226-briefing-gate-box button:first-of-type { background: #1A1A2E; color: #fff; }
.p226-briefing-gate-box button:last-of-type { background: #f3f4f6; color: #374151; }

/* Dispatch tab */
.p226-dispatch-tab-wrap { padding: 16px; flex: 1; overflow: auto; }
.p226-dispatch-stub { padding: 40px; text-align: center; color: #9ca3af; font-size: 14px; }

/* ══════════════════════════════════════════════════════════════════
   PR349b Fix — Info/Action popovers use position:fixed so they
   are not clipped by overflow:hidden on vs-body / p226-root.
   The JS positions them via top/left set in bindBoard().
   ══════════════════════════════════════════════════════════════════ */
.p226-popover,
#p226InfoPop,
#p226ActionMenu,
#p226AddDayPrompt.p226-addday-visible,
#p226SubDayPrompt.p226-addday-visible,
#p226MovePrompt.p226-addday-visible {
  position: fixed !important;
  z-index: 9999 !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
  box-shadow: 0 12px 40px rgba(0,0,0,.22) !important;
}

/* AddDay prompt — centered modal style */
#p226AddDayPrompt.p226-addday-visible,
#p226SubDayPrompt.p226-addday-visible,
#p226MovePrompt.p226-addday-visible {
  width: min(340px, 90vw) !important;
}

/* ── +Day reason modal — full styling ───────────────────────────── */
#p226AddDayPrompt.p226-addday-visible,
#p226SubDayPrompt.p226-addday-visible,
#p226MovePrompt.p226-addday-visible {
  display: block !important;
  background: #fff;
  border-radius: 12px;
  padding: 0;
  width: min(360px, 92vw) !important;
  overflow: hidden !important;
}
.p226-addday-header {
  background: #1A1A2E;
  padding: 16px 20px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.p226-addday-icon {
  width: 32px;
  height: 32px;
  background: #FF6B00;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.p226-addday-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
}
.p226-addday-sub {
  color: #94a3b8;
  font-size: 11px;
  margin-top: 1px;
}
.p226-addday-body {
  padding: 18px 20px 20px;
}
.p226-addday-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}
.p226-addday-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.p226-addday-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #1A1A2E;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.p226-addday-btn:hover {
  border-color: #FF6B00;
  background: #fff7f0;
  color: #FF6B00;
}
.p226-addday-btn[data-reason="continues"]:before { content: "\25B6"; color: #16a34a; font-size: 11px; }
.p226-addday-btn[data-reason="blocked"]:before   { content: "\26A0"; color: #e74c3c; font-size: 13px; }
.p226-addday-btn[data-reason="co"]:before        { content: "\1F4CB"; font-size: 13px; }
.p226-addday-cancel {
  display: block;
  width: 100%;
  padding: 10px;
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  color: #64748b;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, color .15s;
}
.p226-addday-cancel:hover {
  border-color: #94a3b8;
  color: #1A1A2E;
}

/* Overlay backdrop when popover is open */
.p226-popover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,.45);
}

/* Action menu (p226-menu-pop) — also fixed so it's not clipped */
#p226MenuPop {
  position: fixed !important;
  z-index: 9999 !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  background: #fff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.18) !important;
  padding: 4px 0 !important;
  min-width: 200px !important;
  display: none;
}
#p226MenuPop.p226-menu-visible {
  display: block !important;
}
.p226-menu-item {
  display: block;
  width: 100%;
  padding: 9px 16px;
  font-size: 13px;
  color: #0f172a;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background .1s;
}
.p226-menu-item:hover { background: #f8fafc; }
.p226-menu-item-danger { color: #ef4444 !important; }
.p226-menu-item-danger:hover { background: #fef2f2 !important; }
.p226-menu-item-ready { color: #16a34a !important; font-weight: 600; }
.p226-menu-item-ar    { color: #0369a1 !important; font-weight: 600; }
.p226-menu-billing-status {
  padding: 4px 16px;
  font-size: 11px;
  color: #64748b;
}
.p226-menu-in-ar { color: #0369a1; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════════
   PR352 — New Item Modal (.p226-nim-*)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Backdrop / Overlay */
.p226-nim-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
}
.p226-nim-backdrop.p226-nim-hidden {
  display: none;
}

/* Modal shell */
.p226-nim-modal {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  font-family: inherit;
}

/* Header */
.p226-nim-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f1f5f9;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.p226-nim-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.p226-nim-title {
  font-size: 17px;
  font-weight: 700;
  color: #1A1A2E;
}
.p226-nim-subtitle {
  font-size: 11px;
  color: #94a3b8;
  letter-spacing: 0.04em;
}
.p226-nim-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.p226-nim-close:hover {
  background: #f1f5f9;
  color: #1A1A2E;
}

/* Body */
.p226-nim-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Section */
.p226-nim-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.p226-nim-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #94a3b8;
  padding-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}

/* Field rows */
.p226-nim-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.p226-nim-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.p226-nim-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.p226-nim-req {
  color: #ef4444;
  margin-left: 2px;
}
.p226-nim-input,
.p226-nim-select,
.p226-nim-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
  font-family: inherit;
}
.p226-nim-input:focus,
.p226-nim-select:focus,
.p226-nim-textarea:focus {
  border-color: #FF6B00;
  box-shadow: 0 0 0 3px rgba(255,107,0,0.10);
}
.p226-nim-textarea {
  min-height: 72px;
  resize: vertical;
}
.p226-nim-err {
  font-size: 11px;
  color: #ef4444;
  min-height: 14px;
}

/* End date label */
.p226-nim-enddate-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.p226-nim-enddate {
  font-size: 12px;
  color: #64748b;
}

/* Calendar picker */
.p226-nim-cal {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  padding: 12px;
  margin-top: 6px;
  display: none;
}
.p226-nim-cal.p226-nim-cal-open {
  display: block;
}
.p226-nim-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.p226-nim-cal-arrow {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #64748b;
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1;
}
.p226-nim-cal-arrow:hover {
  background: #f1f5f9;
  color: #1A1A2E;
}
.p226-nim-cal-month {
  font-size: 14px;
  font-weight: 700;
  color: #1A1A2E;
}
.p226-nim-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.p226-nim-cal-dow {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  padding: 2px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.p226-nim-cal-day {
  text-align: center;
  padding: 6px 2px;
  font-size: 13px;
  color: #1e293b;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
}
.p226-nim-cal-day:hover {
  background: #fff5ed;
  color: #FF6B00;
}
.p226-nim-cal-today {
  font-weight: 700;
  color: #FF6B00;
}
.p226-nim-cal-selected {
  background: #FF6B00;
  color: #fff;
  font-weight: 700;
}
.p226-nim-cal-selected:hover {
  background: #e55e00;
}
.p226-nim-cal-empty {
  visibility: hidden;
  cursor: default;
}
.p226-nim-cal-past {
  color: #cbd5e1;
  cursor: default;
}
.p226-nim-cal-past:hover {
  background: none;
  color: #cbd5e1;
}
.p226-nim-cal-range {
  background: #fff5ed;
}
.p226-nim-cal-dot {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #FF6B00;
  margin: 1px auto 0;
}

/* Toggle (invoice needed, etc.) */
.p226-nim-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.p226-nim-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: #e2e8f0;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  border: none;
  outline: none;
  flex-shrink: 0;
}
.p226-nim-toggle:checked {
  background: #FF6B00;
}
.p226-nim-toggle-slider {
  pointer-events: none;
}
.p226-nim-toggle:before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.p226-nim-toggle:checked:before {
  transform: translateX(16px);
}

/* Worker list */
.p226-nim-worker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  padding: 8px;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
}
.p226-nim-worker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 5px;
}
.p226-nim-worker-row:hover {
  background: #f8fafc;
}
.p226-nim-worker-cb {
  accent-color: #FF6B00;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.p226-nim-worker-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
}
.p226-nim-worker-role {
  font-size: 11px;
  color: #94a3b8;
}

/* Overlap warning */
.p226-nim-overlap-warn {
  font-size: 12px;
  color: #d97706;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 5px;
  padding: 6px 10px;
  margin-top: 4px;
}

/* Notes note */
.p226-nim-note {
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  border-radius: 5px;
  padding: 6px 10px;
  margin-top: 4px;
}

/* Footer */
.p226-nim-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid #f1f5f9;
  position: sticky;
  bottom: 0;
  background: #fff;
}
.p226-nim-cancel {
  padding: 9px 22px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  background: #f1f5f9;
  color: #475569;
}
.p226-nim-cancel:hover {
  background: #e2e8f0;
}
.p226-nim-save {
  padding: 9px 22px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  background: #FF6B00;
  color: #fff;
}
.p226-nim-save:hover {
  background: #e55e00;
}
.p226-nim-save:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Lily Approve chip in insight bar */
.p226-lily-chip-approve {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.p226-lily-chip-approve .p226-chip-meta {
  font-size: 12px;
  color: #475569;
}
.p226-lily-chip-approve .p226-chip-val-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.p226-lily-chip-val {
  width: 88px;
  padding: 5px 8px;
  border: 1.5px solid #e2e8f0;
  border-radius: 5px;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
  outline: none;
}
.p226-lily-chip-val:focus {
  border-color: #FF6B00;
  box-shadow: 0 0 0 2px rgba(255,107,0,0.10);
}
.p226-lily-chip-btn {
  padding: 5px 13px;
  border-radius: 5px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.p226-lily-chip-btn-approve {
  background: #16a34a;
  color: #fff;
}
.p226-lily-chip-btn-approve:hover { background: #15803d; }
.p226-lily-chip-btn-hold {
  background: #f59e0b;
  color: #fff;
}
.p226-lily-chip-btn-hold:hover { background: #d97706; }
.p226-lily-chip-btn-confirm {
  background: #dc2626;
  color: #fff;
}
.p226-lily-chip-btn-confirm:hover { background: #b91c1c; }
.p226-lily-chip-btn-cancel-hold {
  background: #f1f5f9;
  color: #475569;
}
.p226-lily-chip-btn-cancel-hold:hover { background: #e2e8f0; }

/* Mobile: full-width modal below 640px */
@media (max-width: 640px) {
  .p226-nim-modal {
    max-width: 100%;
    max-height: 96vh;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
  }
  .p226-nim-backdrop {
    align-items: flex-end;
  }
  .p226-nim-row2 {
    grid-template-columns: 1fr;
  }
  .p226-nim-cal {
    width: auto;
  }
}

/* PR352 fix — date input wrap with calendar toggle button */
.p226-nim-date-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.p226-nim-date-wrap .p226-nim-input {
  padding-right: 38px;
  cursor: pointer;
}
.p226-nim-cal-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: #94a3b8;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}
.p226-nim-cal-btn:hover {
  color: #FF6B00;
  background: #fff5ed;
}

/* PR352 fix — dollar prefix on Estimated Value */
.p226-nim-dollar-wrap {
  display: flex;
  align-items: center;
  gap: 0;
}
.p226-nim-dollar-sign {
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  padding: 9px 0 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-right: none;
  border-radius: 7px 0 0 7px;
  background: #f8fafc;
  line-height: 1;
  flex-shrink: 0;
}
.p226-nim-input-dollar {
  border-radius: 0 7px 7px 0 !important;
  border-left: 1px solid #e2e8f0 !important;
}
.p226-nim-input-dollar:focus {
  border-color: #FF6B00 !important;
  box-shadow: 0 0 0 3px rgba(255,107,0,0.10) !important;
}
.p226-nim-dollar-wrap .p226-nim-dollar-sign:has(+ .p226-nim-input-dollar:focus) {
  border-color: #FF6B00;
}

/* ── PR354 — Week-Jump Picker ─────────────────────────────── */

/* Label chip — clickable button replacing plain span */
.p226-week-label-btn {
  position: relative;
  font-size: 13px;
  font-weight: 700;
  color: var(--tx, #0f172a);
  min-width: 110px;
  text-align: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 10px;
  font-family: inherit;
  transition: background .15s, border-color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.p226-week-label-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* Orange dot when viewing a non-current week */
.p226-week-offset-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FF6B00;
  flex-shrink: 0;
  margin-left: 2px;
}

/* Picker dropdown */
.p226-week-picker {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  width: 220px;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px 0 8px;
}

.p226-week-picker-header {
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 4px 14px 6px;
}

.p226-week-picker-month {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  padding: 8px 14px 4px;
  border-top: 1px solid #f1f5f9;
  margin-top: 4px;
}
.p226-week-picker-month:first-of-type {
  border-top: none;
  margin-top: 0;
}

.p226-week-picker-row {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 7px 14px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  gap: 6px;
  border-radius: 0;
  transition: background .1s;
}
.p226-week-picker-row:hover {
  background: #f8fafc;
}

/* Currently viewing */
.p226-wpr-active {
  background: #fff7ed !important;
}
.p226-wpr-active .p226-wpr-label {
  color: #FF6B00 !important;
  font-weight: 700;
}

/* Current real week — "you are here" */
.p226-wpr-today .p226-wpr-label {
  font-weight: 700;
  color: #0f172a;
}

.p226-wpr-label {
  font-size: 13px;
  color: #334155;
  flex: 1;
}

.p226-wpr-badge {
  font-size: 9px;
  font-weight: 700;
  background: #1A1A2E;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.p226-wpr-badge-cur {
  background: #FF6B00;
}

/* Ensure the controls bar is position:relative so picker can anchor */
.p226-controls-bar {
  position: relative;
}

/* PR354 — anchor week-nav so picker dropdown positions correctly */
.p226-week-nav {
  position: relative;
}
