/* ============================================================
   Jobs tab — cork-board with yellow post-it listings.
   ============================================================ */

/* ===== outer stage ===== */
.jb-stage {
  background: transparent;
  border-radius: var(--r-lg);
  overflow: hidden;
}

/* ===== header strip ===== */
.jb-header {
  padding: var(--sp-3) var(--sp-4) var(--sp-2) var(--sp-4);
  background: linear-gradient(180deg, var(--bg-hud-top), var(--bg-hud-bottom));
  border-bottom: 2px solid var(--bg-hud-edge);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.jb-header h2 {
  margin: 0;
  display: inline-block;
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  color: var(--text-strong);
}
.job-count {
  display: inline-block;
  background: rgba(79,195,247,0.18);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px var(--sp-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  margin-left: var(--sp-2);
  vertical-align: middle;
}
.jb-sub {
  color: var(--text-dim);
  font-size: var(--fs-sm);
  margin-top: 4px;
}

/* ===== filter / sort strip ===== */
.jb-filters {
  display: flex;
  gap: var(--sp-5);
  align-items: center;
  flex-wrap: wrap;
  padding: var(--sp-2) var(--sp-4);
  background: rgba(0,0,0,0.30);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.jb-fgroup {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.jb-flabel {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  font-weight: var(--fw-bold);
}
.jb-filters .brand-chip {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px var(--sp-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.jb-filters .brand-chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}
.jb-filters .brand-chip.selected {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent-2);
}
.jb-filters .brand-chip[data-jobs-brand="resmed"]       { border-left: 3px solid #2a8fbd; }
.jb-filters .brand-chip[data-jobs-brand="philips"]      { border-left: 3px solid #5e2ca5; }
.jb-filters .brand-chip[data-jobs-brand="fisherpaykel"] { border-left: 3px solid #d97b3a; }
.jb-filters .brand-chip[data-jobs-brand="bmc"]          { border-left: 3px solid #4a9b6e; }
.jb-filters .brand-chip[data-jobs-brand="lowenstein"]   { border-left: 3px solid #c14a44; }

.risk-filter { display: flex; gap: 4px; }
.risk-chip {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semi);
  cursor: pointer;
}
.risk-chip:hover { background: var(--bg-card-hover); }
.risk-chip.selected.b-good { background: rgba(76,175,80,0.25);  color: var(--good-soft); border-color: var(--good); }
.risk-chip.selected.b-warn { background: rgba(255,170,58,0.25); color: var(--warn-soft); border-color: var(--warn); }
.risk-chip.selected.b-bad  { background: rgba(232,80,58,0.25);  color: var(--bad-soft);  border-color: var(--bad); }
.risk-chip.selected:not(.b-good):not(.b-warn):not(.b-bad) {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent-2);
}

#jobs-sort {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 5px var(--sp-2);
  font-family: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
}
#jobs-sort:focus { outline: 2px solid var(--accent); }

/* ===== cork board — Active Pro Board treatment ===== */
.jb-cork {
  position: relative;
  background-color: #c89766;
  background-image:
    /* dense fleck pattern (cork) — many small dots across the surface */
    radial-gradient(ellipse 2px 2px at 6% 8%,   rgba(80,45,15,0.34) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 14% 16%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 22% 6%,  rgba(80,45,15,0.36) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 32% 14%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 40% 6%,  rgba(80,45,15,0.34) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 48% 18%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 56% 8%,  rgba(80,45,15,0.34) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 64% 16%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 74% 6%,  rgba(80,45,15,0.34) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 82% 14%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 90% 8%,  rgba(80,45,15,0.34) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 5% 28%,  rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 16% 32%, rgba(80,45,15,0.32) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 26% 26%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 38% 30%, rgba(80,45,15,0.34) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 50% 28%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 62% 32%, rgba(80,45,15,0.34) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 74% 26%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 86% 30%, rgba(80,45,15,0.34) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 94% 22%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 8% 44%,  rgba(80,45,15,0.34) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 20% 50%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 32% 46%, rgba(80,45,15,0.32) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 44% 50%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 56% 48%, rgba(80,45,15,0.34) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 68% 50%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 80% 46%, rgba(80,45,15,0.32) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 92% 50%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 6% 64%,  rgba(80,45,15,0.32) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 18% 68%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 30% 64%, rgba(80,45,15,0.34) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 42% 68%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 54% 64%, rgba(80,45,15,0.32) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 66% 68%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 78% 64%, rgba(80,45,15,0.34) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 90% 68%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 4% 82%,  rgba(80,45,15,0.34) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 16% 86%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 28% 82%, rgba(80,45,15,0.32) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 40% 86%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 52% 82%, rgba(80,45,15,0.34) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 64% 86%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 76% 82%, rgba(80,45,15,0.32) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 88% 86%, rgba(80,45,15,0.30) 50%, transparent 60%),
    radial-gradient(ellipse 2px 2px at 96% 82%, rgba(80,45,15,0.34) 50%, transparent 60%),
    /* lighter cork highlight blobs */
    radial-gradient(circle 70px at 28% 30%, rgba(255,235,195,0.16) 0%, transparent 70%),
    radial-gradient(circle 60px at 70% 60%, rgba(255,235,195,0.14) 0%, transparent 70%),
    radial-gradient(circle 50px at 90% 20%, rgba(255,235,195,0.16) 0%, transparent 70%),
    /* base */
    linear-gradient(135deg, #c89766 0%, #ba8855 50%, #c89766 100%);
  border: 14px solid;
  border-image: linear-gradient(180deg, #6a4318, #3d260d) 1;
  padding: var(--sp-5) var(--sp-4);
  min-height: 60vh;
  box-shadow: inset 0 4px 14px rgba(0,0,0,0.25);
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  overflow: hidden;
}
/* light tape residue — two faint diagonal streaks */
.jb-cork::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(110deg, transparent 11%, rgba(255,255,255,0.07) 13%, transparent 17%),
    linear-gradient(110deg, transparent 63%, rgba(255,255,255,0.05) 65%, transparent 69%);
  z-index: 0;
}
/* decoration overlay — calendar, business card, receipt, stray pins,
   pinholes, tape strip. SVG inline, sized to the board. */
.jb-cork::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 800' preserveAspectRatio='xMidYMid slice'>\
<g><circle cx='40' cy='50' r='6' fill='%23ff8b3a' stroke='%23802414' stroke-width='0.6'/><circle cx='40' cy='50' r='2' fill='%23ffd9b8'/>\
<circle cx='870' cy='110' r='6' fill='%232e7fc9' stroke='%231a3c66' stroke-width='0.6'/><circle cx='870' cy='110' r='2' fill='%23bfe2ff'/>\
<circle cx='830' cy='560' r='6' fill='%23f0c63a' stroke='%237a5810' stroke-width='0.6'/><circle cx='830' cy='560' r='2' fill='%23fff5c8'/>\
<circle cx='60' cy='770' r='6' fill='%237b4cb4' stroke='%23391f55' stroke-width='0.6'/><circle cx='60' cy='770' r='2' fill='%23e0c8f5'/>\
<circle cx='860' cy='770' r='6' fill='%233e9a39' stroke='%23244f23' stroke-width='0.6'/><circle cx='860' cy='770' r='2' fill='%23c5f6a3'/>\
<circle cx='80' cy='430' r='6' fill='%23c83737' stroke='%237a1f1f' stroke-width='0.6'/><circle cx='80' cy='430' r='2' fill='%23ff8b8b'/></g>\
<g opacity='0.6'><circle cx='450' cy='35' r='1.5' fill='%23351a05'/><circle cx='200' cy='40' r='1.5' fill='%23351a05'/>\
<circle cx='600' cy='40' r='1.5' fill='%23351a05'/><circle cx='250' cy='770' r='1.5' fill='%23351a05'/><circle cx='560' cy='770' r='1.5' fill='%23351a05'/></g>\
<g transform='translate(20,30) rotate(-3)'><rect width='72' height='54' fill='%23ffffff' stroke='%23a08260' stroke-width='0.5'/>\
<rect width='72' height='14' fill='%23c83737'/>\
<text x='36' y='10' text-anchor='middle' fill='%23ffffff' font-family='Arial' font-size='8' font-weight='bold'>MAY</text>\
<g fill='%23303030' font-family='Arial' font-size='5'>\
<text x='10' y='22'>S</text><text x='18' y='22'>M</text><text x='26' y='22'>T</text><text x='34' y='22'>W</text><text x='42' y='22'>T</text><text x='50' y='22'>F</text><text x='58' y='22'>S</text>\
<text x='10' y='30'>1</text><text x='18' y='30'>2</text><text x='26' y='30'>3</text><text x='34' y='30'>4</text><text x='42' y='30'>5</text><text x='50' y='30'>6</text><text x='58' y='30'>7</text></g>\
<circle cx='36' cy='3' r='3.5' fill='%23c83737'/></g>\
<g transform='translate(770,25) rotate(7)'><rect width='110' height='64' fill='%23f7f4eb' stroke='%23807060' stroke-width='0.5'/>\
<rect x='4' y='4' width='102' height='12' fill='%231a3c66'/>\
<text x='8' y='13' fill='%23ffffff' font-family='Arial' font-size='8' font-weight='bold'>K. MARTINEZ</text>\
<rect x='6' y='22' width='60' height='3' fill='%23404040'/><rect x='6' y='28' width='80' height='3' fill='%23606060'/>\
<rect x='6' y='34' width='70' height='3' fill='%23606060'/><rect x='6' y='42' width='52' height='3' fill='%23606060'/>\
<circle cx='55' cy='4' r='4' fill='%232e7fc9' stroke='%231a3c66' stroke-width='0.5'/></g>\
<g transform='translate(25,640) rotate(-6)'><path d='M0,0 L44,2 L43,82 L2,80 L0,68 L3,52 L0,34 Z' fill='%23ffffff' stroke='%23a0a0a0' stroke-width='0.3'/>\
<text x='22' y='8' text-anchor='middle' fill='%23404040' font-family='Arial' font-size='5' font-weight='bold'>SUPPLY CO</text>\
<line x1='5' y1='14' x2='38' y2='14' stroke='%23606060' stroke-width='0.3'/>\
<line x1='5' y1='20' x2='38' y2='20' stroke='%23606060' stroke-width='0.3'/>\
<text x='22' y='58' text-anchor='middle' fill='%23000000' font-family='Arial' font-size='6' font-weight='bold'>$42.18</text>\
<circle cx='22' cy='3' r='3.5' fill='%23f0c63a'/></g>\
<rect x='320' y='380' width='180' height='18' fill='%23e8e3d2' opacity='0.35' transform='rotate(-3 410 389)'/>\
<rect x='320' y='380' width='180' height='18' fill='%23ffffff' opacity='0.18' transform='rotate(-3 410 389)'/></svg>");
}
/* Lift postit grid + empty-state above the decoration overlay so the
   ::before tape streaks and ::after SVG calendar/business-card stay
   behind the actual listings. */
.jb-cork > .jb-board,
.jb-cork > .jb-empty { position: relative; z-index: 1; }

/* post-it grid */
.jb-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-5) var(--sp-4);
  align-items: start;
}

/* ===== post-it ===== */
.postit {
  position: relative;
  /* Paper grain — tiny darker flecks + a soft diagonal crease + base sheen */
  background-color: #fce96a;
  background-image:
    radial-gradient(circle 0.5px at 8% 12%,  rgba(160,120,30,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 22% 28%, rgba(160,120,30,0.28) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 40% 18%, rgba(160,120,30,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 55% 36%, rgba(160,120,30,0.28) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 70% 22%, rgba(160,120,30,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 85% 30%, rgba(160,120,30,0.28) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 15% 55%, rgba(160,120,30,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 35% 65%, rgba(160,120,30,0.28) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 60% 75%, rgba(160,120,30,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 80% 85%, rgba(160,120,30,0.28) 50%, transparent 51%),
    linear-gradient(118deg, transparent 30%, rgba(255,255,255,0.20) 32%, transparent 36%),
    linear-gradient(135deg, #fef3a3 0%, #fce96a 100%);
  width: 100%;
  max-width: 170px;
  min-height: 140px;
  padding: 14px 12px 12px 12px;
  color: #2a2418;
  font-family: "Segoe UI", sans-serif;
  box-shadow:
    3px 5px 10px rgba(0,0,0,0.40),
    inset 0 1px 0 rgba(255,255,255,0.4);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  outline: none;
}
.postit:focus-visible {
  box-shadow:
    0 0 0 3px rgba(79,195,247,0.55),
    3px 5px 10px rgba(0,0,0,0.40);
}
/* per-position rotation for hand-pinned feel */
.postit:nth-child(6n+1) { transform: rotate(-3deg); }
.postit:nth-child(6n+2) { transform: rotate(2deg); }
.postit:nth-child(6n+3) { transform: rotate(-2deg); }
.postit:nth-child(6n+4) { transform: rotate(3deg); }
.postit:nth-child(6n+5) { transform: rotate(1deg); }
.postit:nth-child(6n+6) { transform: rotate(-1deg); }
.postit:hover {
  /* Gentle sway like the postit is hanging on a thumbtack. The pin is
     a DOM child of the postit, so anything that rotates the postit
     would also drag the pin. To make the pin look truly still, we do
     two things:
       1) Pivot the postit's rotation around the pin itself by setting
          transform-origin to (50%, -11px). The pin's visible center
          on hover sits ~11px above the postit's top edge (top:-6px
          plus translateY(-12px) plus half its 14px height). With the
          origin AT the pin, the pin's anchor doesn't sweep when the
          postit rotates.
       2) Counter-rotate the pin on the same 2.4s loop so the pin's
          own rotation cancels the postit's. -1.5deg parent + 13.5deg
          child = visible 12deg; +1.5deg parent + 10.5deg child =
          visible 12deg. So the pin stays at its hovered 12deg tilt.
     Together: postit swings beneath a perfectly stationary pin. */
  animation: postit-sway 2.4s ease-in-out infinite;
  transform-origin: 50% -11px;
  z-index: 10;
  box-shadow: 4px 8px 18px rgba(0,0,0,0.55);
}
@keyframes postit-sway {
  0%, 100% { transform: scale(1.06) rotate(-1.5deg); }
  50%      { transform: scale(1.06) rotate(1.5deg); }
}
.postit:hover .postit-pin {
  animation: pin-counter-sway 2.4s ease-in-out infinite;
}
@keyframes pin-counter-sway {
  0%, 100% { transform: translateX(-50%) translateY(-12px) rotate(13.5deg) scale(1.08); }
  50%      { transform: translateX(-50%) translateY(-12px) rotate(10.5deg) scale(1.08); }
}
/* corner curl */
.postit::after {
  content: "";
  position: absolute;
  bottom: 0; right: 0;
  width: 14px; height: 14px;
  background: linear-gradient(135deg, transparent 50%, rgba(180,150,30,0.55) 50%);
  pointer-events: none;
}
/* red pushpin — pops out on hover, springs back in on leave.
   The cubic-bezier overshoots near the end of the animation so the
   pin briefly punches past the resting position when re-embedding,
   reading as "stuck back in" rather than a smooth settle. */
.postit-pin {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff7a7a 0%, #c22 65%, #800 100%);
  box-shadow: 0 2px 3px rgba(0,0,0,0.55), inset 0 -2px 3px rgba(0,0,0,0.3);
  z-index: 2;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.32s ease;
}
.postit:hover .postit-pin {
  transform: translateX(-50%) translateY(-12px) rotate(12deg) scale(1.08);
  box-shadow: 0 6px 10px rgba(0,0,0,0.55), inset 0 -2px 3px rgba(0,0,0,0.3);
}

/* content */
.pi-risk {
  position: absolute; top: 8px; right: 8px;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 2px;
}
.pi-risk.low    { background: rgba(76,175,80,0.55); color: #1a3a1a; }
.pi-risk.medium { background: rgba(255,170,58,0.65); color: #5a3a1a; }
.pi-risk.high   { background: rgba(232,80,58,0.65); color: #5a1a1a; }

/* Days-left badge next to the risk badge. Goes amber when 2 days left,
   red+pulsing on the final day. */
.pi-days {
  position: absolute;
  top: 8px;
  right: 44px;        /* sits to the left of .pi-risk */
  font-size: var(--fs-micro);
  letter-spacing: 0.5px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 2px;
  background: rgba(0,0,0,0.18);
  color: #2a2a2a;
}
.pi-days.soon   { background: rgba(255,170,58,0.65); color: #5a3a1a; }
.pi-days.urgent {
  background: rgba(232,80,58,0.75);
  color: #ffeae6;
  animation: pi-days-pulse 0.9s ease-in-out infinite;
}

/* Machine-provenance 2-line history under conditionLabel. Clamped so a
   long sentence pair doesn't blow up the postit height. */
.pi-history {
  font-size: var(--fs-micro);
  font-style: italic;
  color: #4a4030;
  margin-top: 4px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@keyframes pi-days-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,80,58,0.55); }
  50%      { box-shadow: 0 0 0 4px rgba(232,80,58,0); }
}

.pi-name {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  /* Clears the absolutely-positioned risk + days badges (top:8px) so a
     long machine name never wraps underneath them. */
  margin-top: 14px;
  color: #2a2418;
}
.pi-brand-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}
.pi-brand {
  display: inline-block;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 1px 4px;
  border-radius: 2px;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}
.pi-tier {
  font-size: 8px;
  letter-spacing: 0.5px;
  color: #5a513a;
  font-weight: 700;
  text-transform: uppercase;
}
.pi-cond {
  font-size: 9px;
  color: #5a513a;
  margin-top: 4px;
}
/* Seller archetype chip — small uppercase tag drawn from the
   provenance profile's sellerArchetypes pool. Sits between the
   condition headline and the procedural history. */
.pi-seller {
  display: inline-block;
  margin-top: 3px;
  padding: 1px 6px;
  background: rgba(90, 81, 58, 0.12);
  border: 1px dashed rgba(90, 81, 58, 0.35);
  border-radius: 3px;
  font-size: 8px;
  color: #5a513a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.pi-syms {
  font-size: 9px;
  color: #2a2418;
  margin-top: 4px;
  line-height: 1.3;
  opacity: 0.85;
}
.pi-foot {
  border-top: 1px dashed rgba(120,90,20,0.45);
  margin-top: 6px;
  padding-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
}
.pi-price {
  font-size: 16px;
  font-weight: 800;
  color: #2a2418;
}
.pi-profit {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
}
.pi-profit.great { background: rgba(76,175,80,0.35);  color: #1a3a1a; }
.pi-profit.good  { background: rgba(76,175,80,0.22);  color: #1a3a1a; }
.pi-profit.ok    { background: rgba(255,170,58,0.30); color: #5a3a1a; }
.pi-profit.bad   { background: rgba(232,80,58,0.30);  color: #5a1a1a; }

/* BUY rubber stamp */
.pi-buy {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  text-align: center;
  font-family: "Courier New", monospace;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 2px;
  color: #b04e3e;
  background: transparent;
  border: 1.5px solid #b04e3e;
  padding: 3px 6px;
  border-radius: 2px;
  transform: rotate(-2deg);
  opacity: 0.85;
  transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  user-select: none;
}
.postit:hover .pi-buy,
.pi-buy:focus-visible {
  opacity: 1;
  transform: rotate(0deg) scale(1.04);
  color: #fff;
  background: #b04e3e;
}

/* brand badge colors (reused) */
.pi-brand.b-resmed       { background: #2a8fbd; }
.pi-brand.b-philips      { background: #5e2ca5; }
.pi-brand.b-fisherpaykel { background: #d97b3a; }
.pi-brand.b-bmc          { background: #4a9b6e; }
.pi-brand.b-lowenstein   { background: #c14a44; }

/* ===== empty-state index card ===== */
.jb-empty {
  position: relative;
  margin: 60px auto;
  width: 280px;
  background: #fafaf2;
  border: 1px solid #c5bda5;
  border-top: 16px solid #fafaf2;
  border-radius: 2px;
  padding: 32px 18px 18px 18px;
  box-shadow: 3px 5px 10px rgba(0,0,0,0.35);
  text-align: center;
  color: #2a2418;
  font-family: "Segoe UI", sans-serif;
  transform: rotate(-1.5deg);
}
.jb-empty::before {
  content: "";
  position: absolute;
  top: 18px; left: 0; right: 0;
  height: 1px;
  background: rgba(180,120,120,0.45);
}
.jb-empty .postit-pin {
  top: -8px;
  left: 50%;
}
.jb-empty .em-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}
.jb-empty .em-sub {
  font-size: 11px;
  color: #5a513a;
}

/* ===========================================================
   Rare jobs — curated one-off builds with custom parts. Gold
   accent on the postit + ✨ RARE chip + italic epithet subtitle.
   =========================================================== */
.postit.postit-rare {
  box-shadow:
    4px 6px 14px rgba(0,0,0,0.45),
    inset 0 -10px 12px rgba(180,140,30,0.22),
    0 0 0 2px rgba(249,200,80,0.55);
}
.pi-rare-chip {
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(180deg, #f8d36a 0%, #d99b2a 100%);
  color: #3a2a05;
  border-radius: 3px;
  padding: 2px 7px 2px 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.45);
  z-index: 2;
}
/* Event-kind chip — colour-coded per kind, shares the top-left
   position with the rare chip (mutually exclusive per spec). */
.pi-event-chip {
  position: absolute;
  top: 6px;
  left: 6px;
  border-radius: 3px;
  padding: 2px 7px 2px 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow:
    0 1px 2px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.45);
  z-index: 2;
  white-space: nowrap;
}
.pi-event-flash     { background: linear-gradient(180deg, #f6e055 0%, #d9a92a 100%); color: #3a2a05; }
.pi-event-repo      { background: linear-gradient(180deg, #f08770 0%, #c44528 100%); color: #ffffff; }
.pi-event-bundle    { background: linear-gradient(180deg, #80c5f8 0%, #2877c4 100%); color: #ffffff; }
.pi-event-emergency { background: linear-gradient(180deg, #ffb060 0%, #d97020 100%); color: #ffffff; }
.pi-event-repairfee { background: linear-gradient(180deg, #b6e1a7 0%, #4a8a3c 100%); color: #1a2a0d; }

/* Event-kind postit gets a faint outer glow matching its chip colour. */
.postit-event-flash     { box-shadow: 0 4px 14px rgba(217,169,42,0.35); }
.postit-event-repo      { box-shadow: 0 4px 14px rgba(196,69,40,0.35); }
.postit-event-bundle    { box-shadow: 0 4px 14px rgba(40,119,196,0.35); }
.postit-event-emergency { box-shadow: 0 4px 14px rgba(217,112,32,0.40); }
.postit-event-repairfee { box-shadow: 0 4px 14px rgba(74,138,60,0.35); }

/* Repair-fee callout — sits above the foot row showing the target +
   deadline + payout. */
.pi-repair-fee {
  margin-top: 6px;
  padding: 4px 6px;
  background: rgba(74,138,60,0.10);
  border: 1px dashed rgba(74,138,60,0.45);
  border-radius: 3px;
  font-size: 9px;
  color: #2a401a;
  line-height: 1.3;
}
.pi-repair-fee-pay { font-weight: 700; color: #1a2a0d; }
.pi-epithet {
  font-style: italic;
  font-size: 12px;
  color: #6a4718;
  margin-top: 1px;
  margin-bottom: 4px;
}

/* ===== Postit aesthetic variants ===== */
/* Colour packs — postit packs ship in mixed colours. Applied
   deterministically per-job in renderJobCard. Rare/event postits keep
   their own background and don't get a colour-* class. */
.postit.postit-color-pink {
  background-color: #ffd2dd;
  background-image:
    radial-gradient(circle 0.5px at 8% 12%,  rgba(160,80,90,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 40% 18%, rgba(160,80,90,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 70% 22%, rgba(160,80,90,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 35% 65%, rgba(160,80,90,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 80% 85%, rgba(160,80,90,0.30) 50%, transparent 51%),
    linear-gradient(118deg, transparent 30%, rgba(255,255,255,0.22) 32%, transparent 36%),
    linear-gradient(135deg, #ffe2eb 0%, #ffc3d2 100%);
}
.postit.postit-color-mint {
  background-color: #b6e8c8;
  background-image:
    radial-gradient(circle 0.5px at 8% 12%,  rgba(60,140,90,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 40% 18%, rgba(60,140,90,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 70% 22%, rgba(60,140,90,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 35% 65%, rgba(60,140,90,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 80% 85%, rgba(60,140,90,0.30) 50%, transparent 51%),
    linear-gradient(118deg, transparent 30%, rgba(255,255,255,0.22) 32%, transparent 36%),
    linear-gradient(135deg, #d2f0dc 0%, #a5dcb8 100%);
}
.postit.postit-color-blue {
  background-color: #c5dbf5;
  background-image:
    radial-gradient(circle 0.5px at 8% 12%,  rgba(60,90,160,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 40% 18%, rgba(60,90,160,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 70% 22%, rgba(60,90,160,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 35% 65%, rgba(60,90,160,0.30) 50%, transparent 51%),
    radial-gradient(circle 0.5px at 80% 85%, rgba(60,90,160,0.30) 50%, transparent 51%),
    linear-gradient(118deg, transparent 30%, rgba(255,255,255,0.22) 32%, transparent 36%),
    linear-gradient(135deg, #dee9f7 0%, #b8ceeb 100%);
}

/* Pin colour variants — applied to .postit-pin via secondary class. */
.postit-pin.pin-blue   { background: radial-gradient(circle at 35% 35%, #9ad4ff 0%, #2e7fc9 65%, #1a3c66 100%); }
.postit-pin.pin-green  { background: radial-gradient(circle at 35% 35%, #c5f6a3 0%, #3e9a39 65%, #244f23 100%); }
.postit-pin.pin-purple { background: radial-gradient(circle at 35% 35%, #e0c8f5 0%, #7b4cb4 65%, #391f55 100%); }

/* Pin-hole shadow — sits under the pin, gives a "pushed in" effect. */
.postit .pin-hole {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 8px;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.35) 0%, transparent 70%);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

/* Taped variant — replaces the pin with a strip of semi-transparent tape.
   The pin and pin-hole are hidden via the same class. */
.postit.postit-taped .postit-pin,
.postit.postit-taped .pin-hole { display: none; }
.postit.postit-taped::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 42px;
  height: 16px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.45) 50%, rgba(255,255,255,0.10) 100%),
    rgba(220, 215, 195, 0.55);
  border: 1px solid rgba(150, 140, 110, 0.35);
  border-left: 1px dashed rgba(150, 140, 110, 0.5);
  border-right: 1px dashed rgba(150, 140, 110, 0.5);
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  z-index: 3;
  pointer-events: none;
}

/* Coffee ring stain — rare easter egg, applied to ~1 in 12 postits. */
.postit.postit-coffee::before {
  content: "";
  position: absolute;
  top: 55px;
  right: 8px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(80,40,15,0.30);
  background: radial-gradient(circle, transparent 55%, rgba(80,40,15,0.15) 65%, transparent 75%);
  pointer-events: none;
  z-index: 1;
}
/* Coffee + taped together — taped::before wins (the tape strip is more
   important than the stain). Drop the stain on those postits. */
.postit.postit-taped.postit-coffee::before {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.45) 50%, rgba(255,255,255,0.10) 100%),
    rgba(220, 215, 195, 0.55);
  top: -10px;
  right: auto;
  left: 50%;
  width: 42px;
  height: 16px;
  border-radius: 0;
  transform: translateX(-50%) rotate(-2deg);
}

/* Yellow highlighter streak under the HIGH-risk badge. Drawn behind the
   risk label so the text remains crisp. */
.postit .pi-highlight {
  position: absolute;
  top: 6px;
  right: 4px;
  width: 56px;
  height: 16px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255,230,80,0.55) 8%,
    rgba(255,230,80,0.85) 50%,
    rgba(255,230,80,0.50) 92%,
    transparent 100%);
  transform: rotate(-1deg);
  z-index: 1;
  pointer-events: none;
}

/* Circled-in-pen treatment around the asking price — applied to great-
   profit listings so the deal jumps out. The circle is an SVG drawn
   slightly larger than the price span. */
.postit .pi-circled-price {
  position: relative;
  display: inline-block;
}
.postit .pi-circled-price::after {
  content: "";
  position: absolute;
  inset: -4px -8px -2px -6px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 40'>\
<path d='M8,22 Q4,10 18,7 Q40,4 62,8 Q78,12 75,24 Q72,34 50,36 Q22,38 8,30 Q4,28 8,22' \
fill='none' stroke='%231a3c66' stroke-width='1.4' stroke-linecap='round' opacity='0.7' \
transform='rotate(-3 40 20)'/></svg>") center/contain no-repeat;
  pointer-events: none;
}

/* Gold star sticker — applied only to rare units. */
.postit .pi-star-sticker {
  position: absolute;
  top: 70px;
  left: -6px;
  width: 22px;
  height: 22px;
  z-index: 5;
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.4));
  pointer-events: none;
}

/* ============================================================
   Postit fly-off — when the player buys a job, the postit peels
   off the cork board, tumbles upward, and fades. Triggered by
   ui-tabs.js cloning the postit to a body-positioned host (so
   the source can be safely re-rendered out from under us). The
   host carries position/size; the inner .postit-flyoff carries
   the keyframe. ~720ms total — paces with the 520ms tab swap.
   ============================================================ */
.postit-flyoff-host {
  pointer-events: none;
  will-change: transform, opacity;
  perspective: 800px;
}
.postit-flyoff {
  animation: postit-fly 720ms cubic-bezier(.42, 0, .35, 1) forwards;
  transform-origin: center top;
  pointer-events: none;
  /* Suppress the idle sway loop so the keyframe owns the motion. */
  animation-name: postit-fly;
}
.postit-flyoff::before,
.postit-flyoff::after,
.postit-flyoff .postit-pin {
  /* The pin "stays on the board" — fade it out fast so the postit
     reads as having actually been pulled off, not flying with its
     pin still embedded. */
  animation: postit-pin-pop 180ms ease-out forwards;
}
@keyframes postit-fly {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  }
  15% {
    /* Tiny pre-peel jolt — the BUY stamp landed. */
    transform: translate(0, -2px) rotate(1deg) scale(1.03);
    opacity: 1;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
  }
  45% {
    /* Lifted off the cork, tipping forward. */
    transform: translate(-12px, -60px) rotate(-9deg) scale(1.04);
    opacity: 0.95;
    box-shadow: 0 26px 32px rgba(0, 0, 0, 0.3);
  }
  100% {
    /* Tumbles up and away. */
    transform: translate(40px, -220px) rotate(-22deg) scale(0.72);
    opacity: 0;
    box-shadow: 0 60px 60px rgba(0, 0, 0, 0);
  }
}
@keyframes postit-pin-pop {
  0%   { transform: scale(1)   translateY(0);   opacity: 1; }
  100% { transform: scale(1.3) translateY(-4px); opacity: 0; }
}

/* ===== Familiar Machine (returning unit) =====================
   When a previously-sold machine comes back to the job board the
   postit gets a sepia/copper wash + a "↩ FAMILIAR" chip. Reads
   instantly as "you've seen this one before". */
.postit.postit-return {
  background-image: linear-gradient(
    180deg,
    rgba(176, 122, 62, 0.16) 0%,
    rgba(176, 122, 62, 0.06) 50%,
    rgba(176, 122, 62, 0.16) 100%
  );
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4),
              inset 0 0 0 1.5px rgba(176, 122, 62, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.postit.postit-return::after {
  /* Aged-paper edge tint — the postit looks like it's been through
     someone's drawer for a few months. */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(ellipse at top right, rgba(176, 122, 62, 0.18), transparent 55%),
    radial-gradient(ellipse at bottom left, rgba(120, 70, 30, 0.12), transparent 60%);
  z-index: 0;
}
.postit.postit-return > * { position: relative; z-index: 1; }

.pi-return-chip {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, #c08540, #7a4818);
  color: #fff5e6;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid #4a2a0c;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 rgba(255, 220, 180, 0.35);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  cursor: help;
  z-index: 6;
}
