/* ── Gigs — "The Shift Board" ──────────────────────────────────────────────
   Warm day-job / analog-planner identity, deliberately opposite the cool-blue
   trading floor around it. Every selector is scoped under #panel-gigs so
   nothing leaks into the rest of the app. */

#panel-gigs {
  /* Warm tokens, scoped to this panel. */
  --w-bg: #191310;
  --w-panel: #1e1710;
  --w-panel-2: #271d13;
  --w-card: #231a12;
  --w-border: #3a2b1b;
  --w-border-2: #4c3a25;
  --w-text: #f1e6d0;
  --w-muted: #b59a78;
  --w-accent: #ffb454;
  --w-ember: #ff8c42;
  --w-gold: #ffd479;
  --w-buff: #ff7a45;
  --w-ready: #7fd08a;

  background:
    radial-gradient(620px 220px at 50% -10%, rgba(255, 150, 60, 0.07), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 3px),
    var(--w-bg);
  border-color: var(--w-border);
  color: var(--w-text);
}

/* ── Header ─────────────────────────────────────────────────────────────── */
#panel-gigs .gigs-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
/* The refresh sits on its own row beneath the aptitude meter, right-aligned,
   so it never crowds the title / cap / apt line. */
#panel-gigs .gigs-head-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
#panel-gigs h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--w-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}
#panel-gigs h2::before {
  content: '';
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--w-gold);
}
#panel-gigs .gigs-cap {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--w-muted);
  border: 1px solid var(--w-border);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
#panel-gigs .gigs-cap.is-full {
  color: var(--w-buff);
  border-color: rgba(255, 122, 69, 0.5);
}
#panel-gigs .gigs-refresh {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--w-border);
  border-radius: 8px;
  color: var(--w-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
#panel-gigs .gigs-refresh:hover {
  color: var(--w-accent);
  border-color: var(--w-accent);
}
#panel-gigs .gigs-refresh.is-spinning { animation: gig-spin 0.7s linear; }
@keyframes gig-spin { to { transform: rotate(360deg); } }

/* ── Aptitude meter (migration 008) ──────────────────────────────────────── */
#panel-gigs .gigs-apt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--w-border);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
#panel-gigs .gigs-apt-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--w-muted);
}
#panel-gigs .gigs-apt-meter {
  width: 54px;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--w-border);
  overflow: hidden;
}
#panel-gigs .gigs-apt-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--w-gold), var(--w-ember));
  transition: width 0.4s ease;
}
#panel-gigs .gigs-apt-level {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--w-gold);
  min-width: 16px;
  text-align: center;
}
#panel-gigs .gigs-ledger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--w-border);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}
#panel-gigs .gigs-ledger-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--w-muted);
}
#panel-gigs .gigs-ledger-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--w-gold);
}
#panel-gigs .gigs-ledger.is-full .gigs-ledger-count { color: var(--w-ready); }

/* ── Section labels ─────────────────────────────────────────────────────── */
#panel-gigs .gigs-section-label {
  display: flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--w-muted);
  margin: 0 0 8px;
}
#panel-gigs .gigs-on-shift .gigs-section-label::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--w-ready);
  margin-right: 7px;
  animation: gig-pulse 1.6s infinite;
}
@keyframes gig-pulse {
  0% { box-shadow: 0 0 0 0 rgba(127, 208, 138, 0.5); }
  70% { box-shadow: 0 0 0 6px rgba(127, 208, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(127, 208, 138, 0); }
}

/* ── On-shift strip ─────────────────────────────────────────────────────── */
#panel-gigs .gigs-on-shift {
  margin-bottom: 16px;
  border: 1px solid var(--w-border-2);
  border-radius: 10px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 180, 84, 0.05) 0 8px, transparent 8px 16px),
    var(--w-panel);
  padding: 10px 12px 12px;
}
#panel-gigs .gigs-on-shift-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#panel-gigs .shift-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--w-border);
  border-radius: 8px;
}
#panel-gigs .shift-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
#panel-gigs .shift-item-main { min-width: 0; }
#panel-gigs .shift-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--w-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#panel-gigs .shift-employer {
  font-size: 11px;
  color: var(--w-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#panel-gigs .shift-item-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}
#panel-gigs .shift-countdown {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--w-text);
  min-width: 86px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
#panel-gigs .shift-countdown.is-ready {
  color: var(--w-ready);
  animation: gig-ready-blink 1s steps(2) infinite;
}
@keyframes gig-ready-blink { 50% { opacity: 0.55; } }

/* ── The desk — a started shift's scenario chain (§5.90) ──────────────────── */
/* The chain reads as TWO stacked surfaces under the shift header: a bounded,
   SCROLLABLE case card — step head pinned, opener + scene + figures scrolling
   inside, so long copy never pushes the board — and, OUTSIDE the card beneath
   it, the decisions as their own quiet section (always on-screen, never
   scrolls away with the scene). The whole desk-stage cross-fades when a choice
   advances the case. Money stays on the aptitude roll at Collect — these
   choices steer how the CASE lands on the employer. No timer, no reflex. */
#panel-gigs .desk-stage {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  transition: opacity 140ms ease, transform 140ms ease;
}
#panel-gigs .desk-stage.is-fading { opacity: 0; transform: translateY(-3px); }
#panel-gigs .desk-stage.is-arriving { animation: desk-arrive 200ms ease-out; }
@keyframes desk-arrive { from { opacity: 0; transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) {
  #panel-gigs .desk-stage { transition: none; }
  #panel-gigs .desk-stage.is-arriving { animation: none; }
}

#panel-gigs .desk-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--w-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}
#panel-gigs .desk-card.is-resolved {
  border-color: rgba(127, 208, 138, 0.32);
  background:
    repeating-linear-gradient(135deg, rgba(127, 208, 138, 0.05) 0 8px, transparent 8px 16px),
    rgba(0, 0, 0, 0.2);
}
#panel-gigs .desk-card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 0 0 auto;
  padding: 4px 9px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--w-muted);
  border-bottom: 1px dashed var(--w-border);
}
#panel-gigs .desk-step { color: var(--w-gold); font-weight: 700; }
#panel-gigs .desk-answered { color: var(--w-muted); }
#panel-gigs .desk-body {
  max-height: 136px;
  overflow-y: auto;
  padding: 6px 9px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--w-border-2) transparent;
}
#panel-gigs .desk-body::-webkit-scrollbar { width: 8px; }
#panel-gigs .desk-body::-webkit-scrollbar-thumb {
  background: var(--w-border-2);
  border-radius: 4px;
}
#panel-gigs .desk-opener {
  font-size: 12px;
  line-height: 1.45;
  color: var(--w-buff);
  font-style: italic;
}
#panel-gigs .desk-scene {
  margin-top: 5px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--w-text);
}
#panel-gigs .desk-figs {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
#panel-gigs .desk-figs li {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--w-muted);
  background: var(--w-panel-2);
  border: 1px solid var(--w-border);
  border-radius: 4px;
  padding: 2px 6px;
}
#panel-gigs .desk-decisions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding-top: 6px;
  border-top: 1px dashed var(--w-border);
}
#panel-gigs .desk-opt {
  text-align: left;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--w-text);
  background: var(--w-panel-2);
  border: 1px solid var(--w-border);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}
#panel-gigs .desk-opt:hover:not(:disabled) { border-color: var(--w-gold); color: var(--w-gold); }
#panel-gigs .desk-opt:disabled { opacity: 0.45; cursor: default; }
#panel-gigs .desk-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px 4px;
}
#panel-gigs .desk-sev-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--w-ready);
  border: 1px solid rgba(127, 208, 138, 0.4);
  border-radius: 3px;
  padding: 1px 5px;
}
#panel-gigs .desk-sev-word { font-size: 11px; color: var(--w-muted); }
#panel-gigs .desk-finale {
  font-size: 12px;
  line-height: 1.5;
  font-style: italic;
  color: var(--w-buff);
}

/* ── Board (scrollable pinboard) ────────────────────────────────────────── */
#panel-gigs .gigs-board {
  max-height: 560px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--w-border-2) transparent;
}
#panel-gigs .gigs-board::-webkit-scrollbar { width: 8px; }
#panel-gigs .gigs-board::-webkit-scrollbar-thumb {
  background: var(--w-border-2);
  border-radius: 4px;
}
#panel-gigs .gigs-board::-webkit-scrollbar-track { background: transparent; }

/* ── Day rail ───────────────────────────────────────────────────────────── */
#panel-gigs .day-group + .day-group { margin-top: 4px; }
#panel-gigs .day-rail {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--w-bg);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--w-text);
  border-bottom: 2px dashed var(--w-border-2);
  padding: 8px 2px 6px;
}
#panel-gigs .day-rail::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--w-bg);
  border: 1px solid var(--w-border-2);
  flex: 0 0 auto;
}
#panel-gigs .day-group.is-today .day-rail { color: var(--w-gold); }
#panel-gigs .day-date {
  color: var(--w-muted);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 11px;
  margin-left: auto;
}

#panel-gigs .day-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* ── Shift card ─────────────────────────────────────────────────────────── */
#panel-gigs .gig-card {
  position: relative;
  background: linear-gradient(180deg, var(--w-panel-2), var(--w-panel));
  border: 1px solid var(--w-border);
  border-radius: 10px;
  padding: 12px 14px 12px 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 3px 0 0 var(--w-border-2);
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
#panel-gigs .gig-card:hover {
  transform: translateY(-1px);
  border-color: var(--w-border-2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 3px 0 0 var(--w-ember);
}
/* Little strip of tape holding the card to the board. */
#panel-gigs .gig-card::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  width: 46px;
  height: 13px;
  transform: translateX(-50%) rotate(-1.5deg);
  background: linear-gradient(180deg, rgba(255, 212, 121, 0.32), rgba(255, 212, 121, 0.13));
  border-left: 1px dashed rgba(255, 212, 121, 0.3);
  border-right: 1px dashed rgba(255, 212, 121, 0.3);
  pointer-events: none;
}
#panel-gigs .gig-card.is-started { border-color: rgba(127, 208, 138, 0.4); }

/* Locked (tier-gated) treatment. */
#panel-gigs .gig-card.is-locked { filter: saturate(0.35) brightness(0.82); }
#panel-gigs .gig-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1px 4px;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
  font-family: var(--mono);
  opacity: 0.4;
  pointer-events: none;
  z-index: 1;
}

#panel-gigs .gig-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#panel-gigs .gig-employer { color: var(--w-muted); font-weight: 600; }
#panel-gigs .gig-type {
  color: var(--w-muted);
  border: 1px solid var(--w-border);
  border-radius: 999px;
  padding: 1px 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
#panel-gigs .gig-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--w-text);
  margin-top: 3px;
}
#panel-gigs .gig-desc {
  font-size: 12px;
  color: var(--w-muted);
  margin-top: 1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#panel-gigs .gig-task {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--w-muted);
  margin: 6px 0 10px;
}

/* Ledger Files concept line — one lesson per gig type, folds out on click. */
#panel-gigs .gig-concept {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 8px;
  margin: 5px 0 1px;
  padding: 4px 8px;
  border: 1px dashed var(--w-border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  font-size: 11px;
  line-height: 1.35;
  transition: border-color 0.15s;
}
#panel-gigs .gig-concept:hover { border-color: var(--w-gold); }
#panel-gigs .gig-concept-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--w-gold);
}
#panel-gigs .gig-concept-name { color: var(--w-text); font-weight: 600; }
#panel-gigs .gig-concept-side {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--w-gold);
  line-height: 1;
}
#panel-gigs .gig-concept-lesson {
  display: none;
  flex-basis: 100%;
  font-size: 11px;
  color: var(--w-muted);
  padding-top: 3px;
  margin-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
#panel-gigs .gig-concept.is-open .gig-concept-lesson { display: block; }
/* Seen (repeat): dimmed, one-word label — no re-reading, no nagging. */
#panel-gigs .gig-concept.is-seen {
  opacity: 0.55;
  filter: saturate(0.6);
}
#panel-gigs .gig-concept.is-seen .gig-concept-side {
  color: var(--w-muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
#panel-gigs .gig-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
#panel-gigs .gig-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Payout callout chip. */
#panel-gigs .gig-payout {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  color: var(--w-gold);
  background: linear-gradient(180deg, rgba(255, 212, 121, 0.14), rgba(255, 140, 66, 0.1));
  border: 1px solid rgba(255, 180, 84, 0.4);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
#panel-gigs .gig-base {
  color: var(--w-muted);
  text-decoration: line-through;
  font-size: 11px;
  margin-right: 5px;
  opacity: 0.85;
}
/* "+25% buff" burst. */
#panel-gigs .gig-buff {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  padding: 1px 6px 1px 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #331205;
  background: linear-gradient(180deg, var(--w-gold), var(--w-buff));
  border-radius: 999px;
  animation: gig-buff-pop 0.45s ease;
}
#panel-gigs .gig-burst {
  width: 12px;
  height: 12px;
  color: #331205;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35));
}
@keyframes gig-buff-pop {
  0% { transform: scale(0.2) rotate(-30deg); opacity: 0; }
  60% { transform: scale(1.25) rotate(8deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ── Difficulty meter + success chance (migration 008) ───────────────────── */
#panel-gigs .gig-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 10px;
}
#panel-gigs .gig-diff {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#panel-gigs .gig-diff-dots { display: inline-flex; gap: 3px; }
#panel-gigs .gig-diff-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--w-border);
}
#panel-gigs .gig-diff.is-low .gig-diff-dot.on { background: #3f8f5f; border-color: #3f8f5f; }
#panel-gigs .gig-diff.is-mid .gig-diff-dot.on { background: #c98a2c; border-color: #c98a2c; }
#panel-gigs .gig-diff.is-high .gig-diff-dot.on { background: #c94f4f; border-color: #c94f4f; }
#panel-gigs .gig-diff-num {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--w-muted);
}
#panel-gigs .gig-chance {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--w-border);
}
#panel-gigs .gig-chance.is-high { color: #7fd08a; border-color: rgba(127, 208, 138, 0.4); }
#panel-gigs .gig-chance.is-mid { color: var(--w-gold); border-color: rgba(255, 212, 121, 0.4); }
#panel-gigs .gig-chance.is-low { color: #e08a8a; border-color: rgba(224, 138, 138, 0.4); }

/* Reason tag + buttons. */
#panel-gigs .gig-reason {
  font-size: 10px;
  color: var(--w-muted);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--w-border);
  border-radius: 6px;
  padding: 3px 7px;
  white-space: nowrap;
}
#panel-gigs .gig-btn {
  font: inherit;
  font-weight: 700;
  font-size: 12px;
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  border: 1px solid var(--w-border-2);
  background: var(--w-panel-2);
  color: var(--w-text);
  white-space: nowrap;
  transition: transform 0.06s ease, box-shadow 0.15s ease, border-color 0.15s ease,
    background-color 0.15s ease, opacity 0.15s ease;
}
#panel-gigs .gig-btn:hover:not(:disabled) {
  border-color: var(--w-accent);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}
#panel-gigs .gig-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#panel-gigs .gig-btn-start {
  background: linear-gradient(180deg, var(--w-accent), var(--w-ember));
  color: #2a1204;
  border-color: transparent;
}
#panel-gigs .gig-btn-start:disabled {
  background: var(--w-panel-2);
  color: var(--w-muted);
  border-color: var(--w-border);
}
#panel-gigs .gig-btn-start.is-busy:disabled {
  background: linear-gradient(180deg, var(--w-accent), var(--w-ember));
  color: #2a1204;
  opacity: 0.65;
  cursor: progress;
}
#panel-gigs .gig-btn-collect {
  background: linear-gradient(180deg, #7fd08a, #3f8f5f);
  color: #06140a;
  border-color: transparent;
}
#panel-gigs .gig-btn-done {
  background: transparent;
  border-style: dashed;
  color: var(--w-ready);
  cursor: default;
}

/* ── Payout log ─────────────────────────────────────────────────────────── */
#panel-gigs .gigs-log { margin-top: 20px; }
#panel-gigs .gigs-log-list { display: flex; flex-direction: column; }
#panel-gigs .log-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 2px;
  border-bottom: 1px dashed var(--w-border);
  font-size: 12px;
}
#panel-gigs .log-row:last-child { border-bottom: none; }
#panel-gigs .log-when {
  font-family: var(--mono);
  color: var(--w-muted);
  font-size: 11px;
  min-width: 96px;
  flex: 0 0 auto;
}
#panel-gigs .log-who {
  color: var(--w-text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#panel-gigs .log-pay {
  font-family: var(--mono);
  color: var(--w-ready);
  font-weight: 700;
  flex: 0 0 auto;
}

/* ── Loading / empty ────────────────────────────────────────────────────── */
#panel-gigs .gigs-loading,
#panel-gigs .gigs-empty {
  color: var(--w-muted);
  font-size: 13px;
  padding: 14px 2px;
}

/* Shift-cap notice — board replaced when the 3-concurrent-gig cap is reached. */
#panel-gigs .gigs-capped { padding: 22px 2px; text-align: center; }
#panel-gigs .gigs-capped-title {
  color: var(--w-accent);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 5px;
}
#panel-gigs .gigs-capped-sub { color: var(--w-muted); font-size: 12px; line-height: 1.5; }

/* ── Settlement result-card modal (migration 008) ────────────────────────
   Appended to document.body, so styled un-scoped. Carries its own warm tokens
   so it reads as the same analog-planner identity as the board behind it.
   The settlement-routing minigame was removed 09-02 — this card is the
   read-only result of a direct POST. */
.gig-modal-overlay {
  --w-panel: #1e1710;
  --w-panel-2: #271d13;
  --w-border: #3a2b1b;
  --w-border-2: #4c3a25;
  --w-text: #f1e6d0;
  --w-muted: #b59a78;
  --w-accent: #ffb454;
  --w-gold: #ffd479;
  --w-ready: #7fd08a;
  --w-fail: #e06a6a;

  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 3, 2, 0.72);
}
.gig-modal {
  position: relative;
  width: min(430px, calc(100vw - 32px));
  background:
    radial-gradient(420px 200px at 50% -12%, rgba(255, 150, 60, 0.08), transparent 70%),
    var(--w-panel);
  border: 1px solid var(--w-border-2);
  border-radius: 12px;
  padding: 20px 22px;
  color: var(--w-text);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}
.gig-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--w-border);
  border-radius: 6px;
  color: var(--w-muted);
  cursor: pointer;
}
.gig-modal-close:hover { color: var(--w-accent); border-color: var(--w-accent); }
.gig-modal-kicker {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--w-muted);
}
.gig-modal-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--w-gold);
  margin: 3px 0 2px;
  letter-spacing: 0.02em;
}
.gig-result {
  margin-top: 6px;
  border: 1px solid var(--w-border-2);
  border-radius: 10px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.18);
}
.gig-result.is-success { border-color: rgba(127, 208, 138, 0.45); }
.gig-result.is-fail { border-color: rgba(224, 106, 106, 0.45); }
.gig-result-verdict {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.gig-result.is-success .gig-result-verdict { color: var(--w-ready); }
.gig-result.is-fail .gig-result-verdict { color: var(--w-fail); }
.gig-result-story {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--w-text);
  margin-bottom: 6px;
}
.gig-result-story b { color: var(--w-gold); }
.gig-result-line { font-size: 12px; color: var(--w-muted); margin-top: 3px; }
.gig-result-line b { color: var(--w-text); font-family: var(--mono); }
.gig-result-note { color: var(--w-muted); font-size: 10px; font-style: italic; }
/* The case line (§5.90) — how the walk landed reads gold against the money. */
.gig-result-scn b { color: var(--w-gold); }

/* Ledger Files debrief on the settlement result. */
.gig-result-concept {
  margin-top: 8px;
  padding: 6px 8px;
  border: 1px dashed var(--w-border);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--w-muted);
}
.gig-result-concept.is-new {
  border-color: var(--w-gold);
  background: rgba(212, 175, 55, 0.06);
}
.gig-result-concept.is-seen { opacity: 0.6; }
.gig-result-concept-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--w-gold);
  margin-right: 4px;
}
.gig-result-concept b { color: var(--w-text); font-family: var(--mono); }
.gig-result-concept-lesson { margin-top: 2px; }
.gig-result-bonus {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--w-ready);
}

/* Market note — rotating extra teaching on every completion, after the Ledger
   File is collected (2026-08-26). Content-only; distinct brass-left-rail shell
   so it reads as a footnote to the gold Ledger File card above it. */
.gig-result-fact {
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid var(--w-border);
  border-left: 2px solid var(--w-brass);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--w-muted);
}
.gig-result-fact-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--w-brass);
  margin-right: 4px;
}
.gig-result-fact b { color: var(--w-text); font-family: var(--mono); }
.gig-result-fact-lesson { margin-top: 2px; }

/* ── Text overflow guards: no section inside the Shift Board may overflow horizontally ── */
#panel-gigs .gig-card, #panel-gigs .day-group, #panel-gigs .day-rail,
#panel-gigs .day-date, #panel-gigs .gig-top, #panel-gigs .gig-employer,
#panel-gigs .gig-type, #panel-gigs .gig-title, #panel-gigs .gig-desc,
#panel-gigs .gig-task, #panel-gigs .gig-bottom, #panel-gigs .gig-payout,
#panel-gigs .gig-reason, #panel-gigs .gig-btn, #panel-gigs .shift-item,
#panel-gigs .shift-head, #panel-gigs .desk-stage, #panel-gigs .desk-card,
#panel-gigs .desk-card-head, #panel-gigs .desk-body, #panel-gigs .desk-decisions,
#panel-gigs .desk-step, #panel-gigs .desk-answered, #panel-gigs .desk-opener,
#panel-gigs .desk-scene, #panel-gigs .desk-figs,
#panel-gigs .desk-opt, #panel-gigs .desk-banner, #panel-gigs .desk-sev-tag,
#panel-gigs .desk-sev-word, #panel-gigs .desk-finale,
#panel-gigs .shift-title, #panel-gigs .shift-employer, #panel-gigs .shift-item-side,
#panel-gigs .shift-countdown, #panel-gigs .gigs-cap, #panel-gigs .gigs-section-label,
#panel-gigs .gigs-loading, #panel-gigs .gigs-empty, #panel-gigs .log-row,
#panel-gigs .log-when, #panel-gigs .log-who, #panel-gigs .log-pay,
#panel-gigs .gigs-apt, #panel-gigs .gigs-apt-meter, #panel-gigs .gigs-apt-fill,
#panel-gigs .gigs-apt-level, #panel-gigs .gig-stats, #panel-gigs .gig-diff,
#panel-gigs .gig-diff-dots, #panel-gigs .gig-diff-num, #panel-gigs .gig-chance,
#panel-gigs .gigs-ledger, #panel-gigs .gig-concept, #panel-gigs .gig-concept-name,
#panel-gigs .gig-concept-lesson {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ── Casual rail overrides (body[data-ui-mode="casual"]) ─────────────────────
   The casual layer places #panel-gigs in a 252px left rail. These overrides
   keep the Shift Board a clean, compact queue there without touching the wide
   Immersive layout (every rule below is scoped to the casual skin, so
   immersive keeps exactly the geometry it had before). */

/* The "N shifts full" pill is decorative in a 252px rail and starves the
   header title of width — drop it so the h2 keeps its single-line "GIGS". */
body[data-ui-mode="casual"] #panel-gigs .gigs-cap { display: none; }
body[data-ui-mode="casual"] #panel-gigs .gigs-head { flex-wrap: wrap; }
body[data-ui-mode="casual"] #panel-gigs h2 {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* On-shift rows keep ONE line even in the 252px rail — title + countdown + the
   "Collect" button all share the head row. No-stacking rule (09-04): when the
   rail is tight the TITLE shrinks/ellipsizes (flex 1 + min-width 0 + nowrap on
   the title) and countdown/button compact instead of wrapping the chrome onto
   stacked lines. The .shift-item column holds the head + the chain desk. */
body[data-ui-mode="casual"] #panel-gigs .shift-item { gap: 6px; }
body[data-ui-mode="casual"] #panel-gigs .shift-head {
  flex-wrap: nowrap;
  gap: 6px 10px;
}
body[data-ui-mode="casual"] #panel-gigs .shift-item-main {
  flex: 1 1 auto;
  min-width: 0;
}
body[data-ui-mode="casual"] #panel-gigs .shift-item-side { display: contents; }
body[data-ui-mode="casual"] #panel-gigs .shift-countdown {
  flex: 0 0 auto;
  min-width: 0;
  font-size: 12px;
  white-space: nowrap;
}
body[data-ui-mode="casual"] #panel-gigs .shift-item .gig-btn {
  flex: 0 0 auto;
  padding: 4px 9px;
  font-size: 11px;
  white-space: nowrap;
}

/* Shift cards: let the payout pill and the action cluster wrap internally
   instead of overflowing the narrow content box. */
body[data-ui-mode="casual"] #panel-gigs .gig-bottom { row-gap: 6px; }
body[data-ui-mode="casual"] #panel-gigs .gig-payout {
  flex-wrap: wrap;
  row-gap: 2px;
  padding: 3px 8px;
}
body[data-ui-mode="casual"] #panel-gigs .gig-actions {
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 4px;
}

/* ── Phones: the head row (title + apt + refresh) must never overflow ────────
   On a narrow screen the "N shifts full" pill beside the title is decorative
   and starves the h2 of width — hide it (same call the casual rail already
   makes) and let the apt meter + refresh wrap under the title. */
@media (max-width: 640px) {
  #panel-gigs .gigs-head { flex-wrap: wrap; }
  #panel-gigs h2 { flex: 0 0 auto; white-space: nowrap; }
  #panel-gigs .gigs-cap { display: none; }
}
