@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&family=Patrick+Hand&display=swap');

:root {
  --ink: #20313a;
  --ink-soft: #65777b;
  --paper: #f7f3e9;
  --paper-deep: #ebe3d2;
  --line: rgba(32, 49, 58, .13);
  --teal: #1f7475;
  --teal-deep: #155254;
  --teal-wash: #d9eeea;
  --red: #fd3000;
  --red-soft: #f7d7ce;
  --yellow: #fafab3;
  --yellow-soft: #f8edb8;
  --blue: #003a82;
  --blue-soft: #d0e5ed;
  --black: #1e262a;
  --orange: #df8a35;
  --shadow: 0 18px 50px rgba(32, 49, 58, .12);
  --shadow-small: 0 8px 20px rgba(32, 49, 58, .11);
}

* { box-sizing: border-box; }
button { font: inherit; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 8%, rgba(255,255,255,.9), transparent 29rem),
    linear-gradient(120deg, #d9ebe5 0%, #f5ecdb 48%, #dfebe8 100%);
  font-family: Manrope, system-ui, sans-serif;
  font-size: 18px;
  min-width: 320px;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.26'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

.app-shell { position: relative; z-index: 1; max-width: 1820px; margin: 0 auto; padding: 24px 28px 38px; }
.topbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px; margin-bottom: 18px; }
.brand-lockup, .topbar-actions, .section-heading, .waiting-header, .table-footer, .stepper, .queue-meter { display: flex; align-items: center; }
.brand-lockup { gap: 13px; }
.brand-copy { display: grid; gap: 2px; min-width: 0; }
.app-version { color: var(--ink-soft); font: 500 10px/1.2 'DM Mono', monospace; letter-spacing: 0; }
.app-version[hidden] { display: none; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; color: white; background: var(--teal); border-radius: 15px 15px 15px 5px; font-size: 28px; box-shadow: var(--shadow-small); transform: rotate(-4deg); }
.eyebrow { margin: 0 0 5px; color: var(--teal); text-transform: uppercase; letter-spacing: .13em; font: 500 14px/1.2 'DM Mono', monospace; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(23px, 2.3vw, 34px); letter-spacing: -.055em; }
h2 { margin-bottom: 9px; font-size: 30px; letter-spacing: -.04em; }
h3 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.topbar-actions { gap: 10px; }
.pill, .count-badge, .live-dot { border-radius: 999px; font: 500 12px 'DM Mono', monospace; }
.pill { padding: 8px 11px; color: var(--teal-deep); background: var(--teal-wash); }
.discharged-pill { display: inline-flex; align-items: center; min-height: 36px; white-space: nowrap; }
.button { border: 0; border-radius: 11px; padding: 10px 14px; cursor: pointer; font-weight: 700; transition: transform .15s ease, filter .15s ease, background .15s ease; }
.button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.02); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { color: white; background: var(--teal); box-shadow: 0 6px 14px rgba(31,116,117,.23); }
.button-quiet { color: var(--ink); background: rgba(255,255,255,.63); border: 1px solid var(--line); }
.button-danger { color: white; background: #bd514a; }
.button-small { padding: 7px 10px; font-size: 12px; }
.undo-button { display: inline-flex; align-items: center; justify-content: center; min-width: 84px; height: 40px; padding: 0 17px; font-size: 15px; font-weight: 800; white-space: nowrap; }
.reset-button { width: 48px; height: 44px; padding: 0; font-size: 27px; line-height: 1; }
.seed-pill { white-space: nowrap; }
.app-dialog { width: min(520px, calc(100vw - 28px)); max-width: none; padding: 0; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow); }
.app-dialog::backdrop { background: rgba(23, 39, 43, .48); backdrop-filter: blur(2px); }
.dialog-content { display: grid; gap: 14px; padding: 25px; }
.dialog-content h2, .dialog-content p { margin: 0; }
.dialog-content > p:not(.setup-error) { color: var(--ink-soft); font-size: 15px; }
.dialog-label { display: grid; gap: 7px; color: var(--teal-deep); font-size: 14px; font-weight: 800; }
.dialog-input { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; font: 500 15px 'DM Mono', monospace; }
.dialog-input:focus { outline: 3px solid rgba(31, 116, 117, .2); border-color: var(--teal); }
.variant-checkbox { display: flex; align-items: center; gap: 9px; color: var(--teal-deep); font-size: 15px; font-weight: 800; cursor: pointer; }
.variant-checkbox input { width: 18px; height: 18px; margin: 0; accent-color: var(--teal); }
.variant-count[hidden] { display: none; }
.variant-count select { cursor: pointer; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; margin-top: 3px; }
.setup-error:empty { display: none; }
.setup-error { padding: 10px 12px; border-radius: 9px; color: #7d2828; background: #f8dddd; font-size: 13px; overflow-wrap: anywhere; }
#load-setup-button[hidden] { display: none; }

.stepper { display: none; }
.stepper div { display: flex; align-items: center; gap: 7px; white-space: nowrap; padding: 8px 12px; border-radius: 9px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.stepper span { font: 500 10px 'DM Mono', monospace; opacity: .65; }
.stepper div.active { color: var(--teal-deep); background: var(--teal-wash); }
.stepper div.complete { color: var(--teal); }

.top-instructions { min-width: 0; display: flex; align-items: center; gap: 12px; }
.top-banner { min-width: 0; flex: 1; }
.top-banner:empty, .top-primary-action:empty { display: none; }
.top-banner .banner { padding: 9px 12px; font-size: 20px; }
.top-primary-action { display: flex; align-items: center; flex: 0 0 auto; }
.top-primary-action .button { display: inline-flex; align-items: center; justify-content: center; height: 40px; font-size: 15px; white-space: nowrap; }
.board { --table-stack-gap: 24px; --physical-card-width: 123px; --physical-card-height: 164px; position: relative; display: grid; grid-template-columns: 237px minmax(600px, 1fr); grid-template-rows: auto 1fr; align-items: start; gap: 0 29px; width: 100%; max-width: 1627px; margin-inline: auto; padding: 25px 28px 27px; border: 3px solid rgba(66,105,94,.28); border-radius: 30px; background: radial-gradient(circle at 50% 12%, rgba(255,255,255,.3), transparent 34rem), linear-gradient(135deg, #d7e5dc 0%, #c4d8cf 48%, #d9e4d6 100%); box-shadow: 0 20px 40px rgba(32,49,58,.14), inset 0 1px 0 rgba(255,255,255,.55); }
.board::before { content: ''; position: absolute; inset: 10px; pointer-events: none; border: 1px solid rgba(255,255,255,.35); border-radius: 22px; }
.rail { position: relative; z-index: 1; display: grid; gap: 25px; }
.rail-card, .rules-drawer, .table-area { border: 0; box-shadow: none; background: transparent; backdrop-filter: none; }
.rail-card { padding: 0; border-radius: 0; }
.intro-card { background: transparent; }
.intro-card h2 { font-size: 30px; }
.intro-card p:not(.eyebrow), .muted { color: var(--ink-soft); font-size: 17px; line-height: 1.45; }
.intro-card .eyebrow, .intro-card #phase-copy { display: none; }
.intro-card #primary-action { margin-top: 16px; }
.intro-card #primary-action .button { width: 100%; }
.section-heading { justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.count-badge { min-width: 28px; padding: 5px 7px; color: var(--teal-deep); text-align: center; background: var(--teal-wash); }
.live-dot { color: #4f896b; font-size: 10px; }
.live-dot::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #56a375; box-shadow: 0 0 0 4px rgba(86,163,117,.13); }
.left-decks { position: relative; z-index: 1; grid-column: 1; grid-row: 1 / span 2; display: grid; grid-template-rows: var(--physical-card-height, 149px) auto auto; row-gap: var(--table-stack-gap); justify-items: end; align-items: start; min-width: 0; }
.left-decks .deck-card { width: 100%; display: flex; justify-content: flex-end; }
.patient-deck-card { position: relative; }
.patient-deck-card.empty .deck-image { display: none; }
.deck-card { min-height: 0; }
.deck-image { display: block; width: min(var(--physical-card-width, 112px), 100%); aspect-ratio: .75; object-fit: cover; border: 2px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: 4px 5px 0 rgba(32,49,58,.14); }
.deck-count-badge { position: absolute; z-index: 2; top: 8px; right: 8px; min-width: 46px; padding: 5px 7px; border: 2px solid rgba(255,255,255,.9); border-radius: 999px; color: #fff; background: rgba(31,116,117,.94); box-shadow: 0 3px 8px rgba(32,49,58,.28); font: 800 11px/1 Manrope, system-ui, sans-serif; text-align: center; }
.staff-stage { position: relative; z-index: 1; grid-column: 1; grid-row: 1; min-height: var(--physical-card-height, 149px); }
.staff-room { display: flex; align-items: flex-start; gap: 12px; min-height: var(--physical-card-height, 149px); }
.staff-room.hire-pending { flex-direction: column; }
.staff-mini { position: relative; width: min(var(--physical-card-width, 112px), 100%); aspect-ratio: .75; overflow: hidden; border-radius: 14px; border: 2px solid #cfaa5e; background: #f6dfab; box-shadow: 2px 3px 0 rgba(80,58,29,.12); }
.staff-mini img { width: 100%; height: 100%; object-fit: cover; }
.staff-room-cards, .staff-offer-cards { display: flex; align-items: flex-start; gap: 12px; }
.staff-room-cards { flex-wrap: wrap; }
.staff-card-choice { display: grid; justify-items: center; gap: 7px; flex: 0 0 var(--physical-card-width, 112px); min-width: 0; }
.staff-room-continue { margin-top: 8px; }
.hire-discard-actions { margin-top: 0; }
@media (min-width: 941px) { .staff-stage { width: calc(2 * var(--physical-card-width, 112px) + 12px); } }
.staff-mini.selectable { cursor: pointer; outline: 3px solid rgba(31,116,117,.55); outline-offset: 3px; box-shadow: 0 6px 12px rgba(31,116,117,.16); }
.staff-mini.selectable:hover { transform: translateY(-3px); box-shadow: 0 10px 18px rgba(31,116,117,.24); }
.staff-mini.pending { outline: 3px solid var(--orange); outline-offset: 3px; }
.staff-mini.unavailable { opacity: .42; filter: grayscale(.35); cursor: not-allowed; }
.staff-mini.used { filter: grayscale(.8); opacity: .65; }
.staff-mini .used-label { position: absolute; right: 4px; bottom: 4px; padding: 3px 4px; border-radius: 4px; color: white; background: rgba(32,49,58,.8); font: 9px 'DM Mono', monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.log-card { display: none; }
.event-log { display: grid; gap: 8px; max-height: 190px; overflow: auto; }
.log-entry { padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; line-height: 1.4; }
.log-entry:last-child { border: 0; padding-bottom: 0; }
.log-entry strong { color: var(--ink); }

.table-area { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; row-gap: var(--table-stack-gap); grid-column: 2; grid-row: 1 / span 2; min-width: 0; padding: 0; border-radius: 0; }
.rail-right { grid-column: 2; grid-row: 1; justify-self: end; display: grid; grid-template-columns: minmax(0, 1fr) var(--physical-card-height, 149px); align-items: center; gap: 14px; width: calc(100% - var(--physical-card-width, 112px) - var(--physical-card-width, 112px) - 12px); height: var(--physical-card-height, 149px); }
@media (min-width: 941px) {
  /* Keep the full six-die resource rail clear of the Waiting Room. */
  .board { --work-rail-row-height: max(var(--physical-card-height, 149px), 233px); }
  .rail-right { height: auto; min-height: var(--physical-card-height, 149px); }
  .staff-stage { min-height: var(--work-rail-row-height); }
  .left-decks { grid-template-rows: var(--work-rail-row-height) auto auto; }
}
.right-resources { min-width: 0; display: grid; align-content: center; justify-items: center; gap: 14px; }
.right-resources.hire-over-capacity-hidden { visibility: hidden; }
.right-resources > .rail-card { width: max-content; }
.right-resources .dice-tray { min-height: 0; }
.right-resources .cube-supply { min-height: 24px; }
.legal-zone-toggle { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--ink-soft); font-size: 12px; line-height: 1.25; cursor: pointer; }
.legal-zone-toggle input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--teal); cursor: pointer; }
.rail-right .equipment-card { min-width: 0; }
.rail-right .equipment-card-visual { margin-bottom: 0; }
.waiting-stage { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; gap: 24px; min-width: 0; min-height: 520px; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; border-radius: 11px; color: var(--teal-deep); background: var(--teal-wash); font-size: 18px; }
.banner strong { font-weight: 800; }
.banner-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.banner-offer { display: flex; align-items: center; gap: 10px; min-width: 0; }
.banner-offer img { width: 38px; height: 51px; flex: 0 0 auto; object-fit: cover; border: 2px solid rgba(32,49,58,.18); border-radius: 6px; box-shadow: 2px 3px 0 rgba(32,49,58,.1); }
.banner.warn { color: #7b5511; background: var(--yellow-soft); }
.banner.loss { color: #7a302b; background: var(--red-soft); }
.banner.win { color: #276142; background: #d4eedb; }
.local-actions { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.local-actions .button { min-width: 72px; }
.waiting-header { justify-content: space-between; gap: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.waiting-header .eyebrow, .queue-meter { display: none; }
.waiting-header h2 { margin-bottom: 0; font-size: clamp(32px, 3.1vw, 46px); }
.queue-meter { flex-direction: column; align-items: flex-end; color: var(--teal); }
.queue-meter span { font-size: 38px; line-height: .9; font-weight: 800; letter-spacing: -.08em; }
.queue-meter small { color: var(--ink-soft); font: 12px 'DM Mono', monospace; }
.waiting-room { min-height: 0; padding: 0 0 10px; }
.rearrange-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.rearrange-controls strong { color: var(--teal-deep); font-size: 14px; }
.rearrange-controls-actions { display: flex; gap: 6px; }
.repair-thank-you-controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.repair-thank-you-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.repair-choice { min-width: 132px; border: 3px solid rgba(17,25,26,.82); color: #fff; box-shadow: 0 4px 0 rgba(32,49,58,.18); }
.repair-choice.repair-red { background: var(--red); }
.repair-choice.repair-yellow { color: #2f2a16; background: var(--yellow); }
.repair-choice.repair-blue { background: var(--blue); }
.discharge-choices { display: grid; justify-items: center; gap: 10px; margin-top: 18px; }
.discharge-choices > strong { color: var(--teal-deep); font-size: 15px; }
.discharge-choice-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.discharge-choice-option { display: flex; flex-direction: column; align-items: center; gap: 7px; width: 132px; }
.discharge-choice-footer { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 32px; margin-top: auto; }
.discharge-choice-source { justify-self: center; padding: 3px 9px; border: 1px solid #a66d20; border-radius: 999px; color: #70430f; background: #f5dfb1; font: 800 10px/1.1 'DM Mono', monospace; letter-spacing: .05em; text-transform: uppercase; }
.discharge-choice { width: 100%; padding: 0; overflow: hidden; border: 3px solid rgba(17,25,26,.82); border-radius: 12px; color: var(--ink); background: #fff; box-shadow: 0 7px 14px rgba(32,49,58,.18); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.discharge-choice:hover, .discharge-choice:focus-visible { border-color: var(--orange); outline: none; transform: translateY(-4px); box-shadow: 0 12px 20px rgba(32,49,58,.24); }
.discharge-choice-option.reserved .discharge-choice { border-color: #a66d20; border-style: dashed; background: #fffaf0; }
.discharge-choice img { display: block; width: 100%; aspect-ratio: .75; object-fit: cover; }
.discharge-choice span { display: grid; gap: 2px; padding: 7px 8px 8px; }
.discharge-choice b { font-size: 12px; }
.discharge-choice small { color: var(--teal-deep); font: 11px 'DM Mono', monospace; }
.discharge-choice .discharge-choice-thankyou { display: flex; align-items: center; gap: 6px; }
.discharge-choice .discharge-choice-thankyou img { flex: 0 0 24px; width: 24px; height: 24px; aspect-ratio: 1; object-fit: contain; }
.left-decks > #patient-reserve { width: 100%; justify-self: stretch; min-width: 0; }
.patient-reserve-area { display: grid; justify-items: start; align-content: start; gap: 8px; width: 100%; padding-top: 12px; border-top: 1px solid var(--line); }
.patient-reserve-heading h3 { margin: 0; color: var(--teal-deep); font-size: 14px; }
.patient-reserve-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 8px; width: 100%; }
.reserved-patient-option { display: grid; justify-items: stretch; gap: 5px; width: 100%; min-width: 0; }
.reserved-patient-card { position: relative; width: 100%; overflow: hidden; border: 3px solid rgba(17,25,26,.82); border-radius: 12px; background: #fff; box-shadow: 0 7px 14px rgba(32,49,58,.18); }
.reserved-patient-card > img { display: block; width: 100%; aspect-ratio: .75; object-fit: cover; }
.reserved-patient-thankyou { position: absolute; right: 4px; bottom: 4px; left: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 84px; padding: 6px; border: 1px solid rgba(17,25,26,.45); border-radius: 9px; background: rgba(255,253,244,.96); box-shadow: 0 3px 8px rgba(32,49,58,.24); text-align: center; }
.reserved-patient-thankyou > img { flex: 0 0 36px; width: 36px; height: 36px; object-fit: contain; }
.reserved-patient-thankyou > span { display: grid; justify-items: center; gap: 2px; width: 100%; min-width: 0; text-align: center; }
.reserved-patient-thankyou small { color: var(--teal-deep); font: 700 9px/1.1 'DM Mono', monospace; text-transform: uppercase; }
.reserved-patient-thankyou strong { color: var(--ink); font-size: 13px; line-height: 1.15; overflow-wrap: anywhere; }
.waiting-slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: start; column-gap: 5px; row-gap: 10px; }
.patient-slot { min-width: 0; }
.patient-card { container-type: inline-size; position: relative; overflow: hidden; aspect-ratio: .75; border: 2px solid #a8c3c2; border-radius: 14px; background: #d6e9e7; box-shadow: 0 9px 18px rgba(32,49,58,.14); }
.patient-card.interactive, .patient-card.draggable-card { transition: transform .18s ease, box-shadow .18s ease; }
.patient-card.interactive:hover, .patient-card.draggable-card:hover { transform: translateY(-3px); box-shadow: 0 14px 24px rgba(32,49,58,.18); }
.patient-card.rearrange-selectable { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, outline .18s ease; }
.patient-card.rearrange-selectable:hover { transform: translateY(-3px); box-shadow: 0 14px 24px rgba(32,49,58,.18); }
.patient-card.rearrange-selectable { touch-action: none; user-select: none; }
.patient-card.rearrange-drag-source { opacity: .35; }
.patient-card.preview-card { border-color: var(--teal); outline: 3px dashed var(--teal); outline-offset: 3px; box-shadow: 0 0 0 5px rgba(31,116,117,.13); }
.patient-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.patient-card.cured { border-color: #5eab79; box-shadow: 0 0 0 3px rgba(94,171,121,.2), 0 12px 24px rgba(32,49,58,.15); }
.zone-button { position: absolute; z-index: 3; left: var(--zone-center-x); top: var(--zone-center-y); width: var(--zone-size-width); height: var(--zone-size-height); min-width: 0; padding: 0; border: min(8px, 4cqw) solid var(--zone-border, #1b6650); border-radius: var(--zone-radius, 50%); background: transparent; cursor: default; pointer-events: none; overflow: visible; box-sizing: border-box; box-shadow: inset 0 0 0 min(2px, 1cqw) #11191a, 0 0 0 min(2px, 1cqw) #11191a, 0 min(3px, 1.5cqw) min(8px, 4cqw) rgba(32,49,58,.4); transform: translate(-50%, -50%); }
.zone-button.zone-r { --zone-border: #70251f; }
.zone-button.zone-y { --zone-border: #92720b; }
.zone-button.zone-b { --zone-border: #103b55; }
.zone-button.active { outline: none; }
.zone-button.inactive-cube { border-color: transparent; outline: none; box-shadow: none; }
.zone-button.treatable { pointer-events: auto; cursor: pointer; animation: none; }
.zone-button.returnable { pointer-events: auto; cursor: pointer; outline: 3px solid var(--orange); outline-offset: 2px; }
.zone-button.pending-treat { outline: 4px solid var(--orange); outline-offset: 3px; animation: none; }
.zone-button.has-cube::after { content: ''; position: absolute; top: 50%; right: 0; width: 18px; height: 18px; display: block; border: 3px solid #11191a; border-radius: 4px; background: var(--black); box-shadow: 0 2px 8px rgba(32,49,58,.35); transform: translate(50%, -50%); }
.zone-button.c.has-cube::after { right: auto; left: 50%; transform: translate(-50%, -50%); }
.zone-button.tr.has-cube::after, .zone-button.mr.has-cube::after, .zone-button.br.has-cube::after { right: auto; left: 0; transform: translate(-50%, -50%); }
.zone-button.undoable { pointer-events: auto; cursor: pointer; }
.zone-button.nurse-source, .zone-button.nurse-destination { pointer-events: auto; touch-action: none; }
.zone-button.nurse-source { cursor: grab; }
.zone-button.nurse-source::after { border-color: #fff; box-shadow: 0 0 0 4px var(--orange), 0 0 0 7px rgba(255,255,255,.9), 0 5px 12px rgba(32,49,58,.5); animation: nurse-cube-ready 1.15s ease-in-out infinite; }
.zone-button.nurse-source:active { cursor: grabbing; }
.zone-button.nurse-destination { outline: 3px dashed rgba(31,116,117,.9); outline-offset: 3px; }
.zone-button.nurse-over { outline: 4px solid var(--teal); outline-offset: 4px; transform: translate(-50%, -50%) scale(1.08); }
.zone-button.legal-preview { outline: 4px solid rgba(31,116,117,.95); outline-offset: 3px; }
.assignment-die { position: absolute; z-index: 4; left: 50%; top: 50%; width: 28px; height: 28px; display: grid; place-items: center; border: 3px solid rgba(255,255,255,.95); border-radius: 5px; color: #fff; font: 800 18px/1 Manrope, system-ui, sans-serif; box-shadow: 0 2px 6px rgba(32,49,58,.35); transform: translate(-50%, -50%); }
.assignment-die.assigned-r { color: #fff; background: var(--red); }
.assignment-die.assigned-y { color: #4d4315; background: var(--yellow); }
.assignment-die.assigned-b { color: #fff; background: var(--blue); }
.assignment-undo-glyph { position: absolute; z-index: 5; right: -8px; top: -8px; width: 17px; height: 17px; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.95); border-radius: 999px; color: #fff; background: var(--orange); font: 800 12px/1 system-ui, sans-serif; box-shadow: 0 2px 6px rgba(32,49,58,.35); }
.empty-room { align-self: center; justify-self: center; max-width: 310px; padding: 35px 25px; border: 1px dashed rgba(32,49,58,.25); border-radius: 18px; color: var(--ink-soft); text-align: center; }
.empty-room .big-icon { margin-bottom: 9px; color: var(--teal); font-size: 30px; }
.table-footer, .rules-drawer, .equipment-card > .section-heading, .supply-card > .section-heading, .dice-card > .section-heading, .dice-card #dice-hint { display: none; }
.legend-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.bottom-dot { background: var(--blue); } .match-dot { background: var(--teal); }

.dice-tray { display: grid; grid-template-columns: repeat(3, 80px); gap: 9px; min-height: 80px; }
.die-control-wrap { position: relative; width: 80px; height: 80px; min-width: 0; }
.die-control-wrap .die { width: 100%; height: 100%; }
.die { position: relative; display: grid; place-items: center; width: 80px; height: 80px; min-width: 0; padding: 0; border: 0; border-radius: 11px; color: white; cursor: pointer; box-shadow: 0 5px 8px rgba(32,49,58,.2); transition: transform .15s ease, opacity .15s ease, outline .15s ease; }
.die:hover:not(:disabled) { transform: translateY(-3px) rotate(-3deg); }
.die.red { background: var(--red); } .die.yellow { color: #4d4315; background: var(--yellow); } .die.blue { background: var(--blue); }
.die.selected { outline: 3px solid var(--teal); outline-offset: 2px; transform: translateY(-3px); }
.die.staff-selected { outline: 4px solid var(--orange); outline-offset: 3px; transform: translateY(-3px); }
.die.used { opacity: .32; filter: grayscale(.8); cursor: default; }
.die .die-value { display: block; font: 800 64px/1 Manrope, system-ui, sans-serif; transform: translateY(-1px); }
.dice-tray-empty { align-self: center; grid-column: 1 / -1; color: var(--ink-soft); font-size: 13px; }
.work-actions { display: grid; gap: 6px; margin-top: 7px; }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.action-button { padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: rgba(255,255,255,.67); cursor: pointer; text-align: center; font-size: 14px; font-weight: 800; }
.action-button:hover:not(:disabled) { border-color: var(--teal); background: var(--teal-wash); }
.action-button:disabled { opacity: .42; cursor: not-allowed; }
.action-button .action-key { display: block; margin-bottom: 3px; color: var(--teal); font: 13px 'DM Mono', monospace; text-transform: uppercase; }
.action-button.pending { border: 3px solid var(--orange); background: #fff2d4; }
.equipment-card-visual { position: relative; overflow: hidden; width: 100%; aspect-ratio: 1.333333; margin: 0 0 13px; border: 2px solid rgba(32,49,58,.14); border-radius: 13px; background: #dfe7d9; box-shadow: 3px 4px 0 rgba(32,49,58,.11); }
.equipment-card-rotated { position: absolute; top: 50%; left: 50%; width: 73.8%; height: 135.5%; transform: translate(-50%, -50%) rotate(-90deg); transform-origin: center; }
.equipment-card-rotated img { display: block; width: 100%; height: 100%; object-fit: fill; }
.equipment-marker { position: absolute; z-index: 2; top: var(--marker-top); left: var(--marker-left); width: 20px; height: 20px; display: block; border: 3px solid white; border-radius: 50%; background: var(--marker-color); box-shadow: 0 2px 6px rgba(32,49,58,.42); transform: translate(-50%, -50%); pointer-events: none; }
.equipment-marker-yellow { border-color: #000; }
.equipment-marker.ooo { width: 20px; height: 20px; border-radius: 5px; background: var(--black); }
.work-actions p, .setup-offer-note, .supply-card > .muted { display: none; }
.cube-supply { display: flex; flex-wrap: nowrap; justify-content: center; gap: 5px; width: 282px; min-height: 36px; }
.cube { flex: 0 0 36px; width: 36px; height: 36px; border: 3px solid #11191a; border-radius: 5px; background: var(--black); box-shadow: 0 2px 5px rgba(32,49,58,.28); }
.rules-drawer { border-radius: 0; background: transparent; }
.rules-drawer summary { padding: 5px 0; cursor: pointer; color: var(--teal-deep); font-size: 14px; font-weight: 800; }
.rules-copy { padding: 0 15px 12px; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.rules-copy p { margin-bottom: 8px; }

@keyframes pulse { 0%,100% { box-shadow: 0 0 0 2px rgba(31,116,117,.35), inset 0 0 15px rgba(31,116,117,.2); } 50% { box-shadow: 0 0 0 4px rgba(31,116,117,.18), inset 0 0 15px rgba(31,116,117,.4); } }
@keyframes nurse-cube-ready { 0%,100% { box-shadow: 0 0 0 4px var(--orange), 0 0 0 7px rgba(255,255,255,.9), 0 5px 12px rgba(32,49,58,.5); } 50% { box-shadow: 0 0 0 6px #f4a24f, 0 0 0 9px rgba(255,255,255,.98), 0 7px 16px rgba(32,49,58,.58); } }
@media (prefers-reduced-motion: reduce) { .zone-button.nurse-source::after { animation: none; } }
@media (max-width: 1400px) { .board { grid-template-columns: 209px minmax(600px, 1fr); column-gap: 22px; padding-inline: 22px; } .app-shell { padding-inline: 16px; } }
.setup-offer { display: grid; gap: 7px; }
.setup-offer-note { padding: 8px 9px; border-radius: 8px; color: var(--teal-deep); background: var(--teal-wash); font-size: 12px; line-height: 1.35; }
.staff-mini.offer-select { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.staff-mini.offer-select:hover { transform: translateY(-3px); box-shadow: 0 7px 14px rgba(32,49,58,.2); }
.empty-slot { display: grid; place-items: center; aspect-ratio: .75; min-width: 0; border: 2px dashed rgba(32,49,58,.2); border-radius: 14px; color: rgba(32,49,58,.47); background: rgba(255,255,255,.23); font: 16px 'DM Mono', monospace; text-align: center; }
.empty-slot span { display: none; }
.admission-source { display: flex; justify-content: center; min-height: 250px; padding: 8px 0 18px; }
.admission-source:empty { display: none; }
.admission-drawn-card { width: min(209px, 30%); aspect-ratio: .75; overflow: hidden; border: 3px solid #a8c3c2; border-radius: 16px; background: #d6e9e7; box-shadow: 0 14px 24px rgba(32,49,58,.2), 8px 8px 0 rgba(32,49,58,.08); cursor: grab; touch-action: none; user-select: none; transform: rotate(-2deg); transition: transform .15s ease, box-shadow .15s ease; }
.admission-drawn-card:hover { transform: translateY(-5px) rotate(-1deg); box-shadow: 0 20px 30px rgba(32,49,58,.24), 8px 8px 0 rgba(32,49,58,.08); }
.admission-drawn-card:active { cursor: grabbing; }
.admission-drawn-card.dragging { opacity: .9; transform: rotate(2deg) scale(1.04); }
.admission-drawn-card img, .patient-card img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.patient-card[data-admission-drag] { cursor: grab; touch-action: none; user-select: none; }
.patient-card[data-admission-drag]:active { cursor: grabbing; }
.admission-drag-ghost { position: fixed; z-index: 30; left: 0; top: 0; width: min(209px, 30vw); aspect-ratio: .75; overflow: hidden; border: 3px solid #a8c3c2; border-radius: 16px; background: #d6e9e7; box-shadow: 0 18px 30px rgba(32,49,58,.24), 8px 8px 0 rgba(32,49,58,.08); pointer-events: none; transform: translate(-50%, -50%) rotate(-2deg); transition: opacity .1s ease, visibility .1s ease; }
.admission-drag-ghost img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.admission-drag-ghost.snapped { visibility: hidden; }
.patient-deck-preview { max-width: 100%; overflow-x: auto; }
.patient-deck-preview:empty { display: none; }
.patient-deck-preview-layout { display: flex; align-items: center; gap: 10px; width: max-content; max-width: 100%; min-height: 0; }
.patient-deck-preview-row { display: flex; align-items: flex-start; gap: 5px; min-height: 0; }
.patient-deck-edge-label { flex: 0 0 auto; color: var(--teal-deep); font: 800 13px/1 Manrope, system-ui, sans-serif; letter-spacing: .02em; }
.patient-deck-slot { position: relative; width: var(--physical-card-width, 123px); min-width: var(--physical-card-width, 123px); }
.patient-deck-preview-card { width: 100%; cursor: grab; touch-action: none; user-select: none; transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease; }
.patient-deck-preview-card:hover { transform: translateY(-3px); box-shadow: 0 10px 18px rgba(32,49,58,.2); }
.patient-deck-preview-card:active { cursor: grabbing; }
.patient-deck-preview-card img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.patient-deck-drag-source { opacity: .35; }
.patient-deck-preview-actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; flex: 0 0 auto; }
.patient-deck-preview-actions .button { white-space: nowrap; }
.thank-you-drag-ghost { position: fixed; z-index: 40; left: 0; top: 0; overflow: hidden; pointer-events: none; transform: translate(-50%, -50%) rotate(2deg) scale(1.03); border: 3px solid var(--teal); border-radius: 13px; background: #d6e9e7; box-shadow: 0 18px 30px rgba(32,49,58,.28); }
.thank-you-drag-ghost img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.rearrange-drag-ghost { width: min(209px, 24vw); aspect-ratio: .75; }
.patient-deck-drag-ghost { width: 136px; aspect-ratio: .75; }
body.rearrange-dragging, body.patient-deck-dragging { cursor: grabbing; user-select: none; }
.nurse-drag-ghost { position: fixed; z-index: 30; left: 0; top: 0; width: 44px; height: 44px; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.9); border-radius: 9px; background: rgba(48,53,54,.9); box-shadow: 0 10px 20px rgba(32,49,58,.28); pointer-events: none; transform: translate(-50%, -50%) rotate(-4deg); }
.nurse-drag-ghost-cube { width: 30px; height: 30px; border: 3px solid #11191a; border-radius: 5px; background: var(--black); box-shadow: inset 0 0 0 2px rgba(255,255,255,.15); }
body.nurse-dragging { cursor: grabbing; user-select: none; }
.admission-slot-target { position: relative; transition: transform .18s ease, opacity .18s ease, outline .18s ease; }
.admission-slot-target.dragging-target.valid-target { cursor: copy; }
.admission-slot-target.dragging-target.invalid-target { opacity: .34; }
.admission-slot-target.drag-over { z-index: 2; outline: 4px solid var(--teal); outline-offset: 6px; transform: translateY(-6px) scale(1.02); }
.admission-slot-target.preview-slot .patient-card { outline: 4px dashed var(--orange); outline-offset: 5px; box-shadow: 0 0 0 8px rgba(223,138,53,.16), 0 14px 24px rgba(32,49,58,.2); }
@media (max-width: 1400px) { .waiting-slots { column-gap: 3px; } }
@media (max-width: 1400px) { .topbar { grid-template-columns: minmax(0, 1fr) auto; align-items: start; } .top-instructions { grid-column: 1 / -1; grid-row: 2; } .topbar-actions { grid-column: 2; grid-row: 1; flex-wrap: wrap; justify-content: flex-end; } }
@media (max-width: 940px) { .waiting-slots { grid-template-columns: repeat(4, minmax(110px, 1fr)); } }
@media (max-width: 940px) { .board { grid-template-columns: 143px minmax(0, 1fr); grid-template-rows: auto auto auto; row-gap: 20px; } .left-decks { grid-column: 1; grid-row: 1 / span 2; } .table-area { grid-column: 2; grid-row: 1 / span 2; } .reserved-patient-thankyou { gap: 2px; padding: 3px; } .reserved-patient-thankyou > img { flex-basis: 26px; width: 26px; height: 26px; } .reserved-patient-thankyou small { font-size: 8px; } .reserved-patient-thankyou strong { font-size: 11px; } .rail-right { grid-column: 1 / span 2; grid-row: 3; justify-self: stretch; width: auto; height: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } .right-resources { width: auto; } .dice-tray { grid-template-columns: repeat(3, minmax(0, 1fr)); } .die-control-wrap { width: 100%; height: auto; aspect-ratio: 1; } .cube-supply { width: auto; flex-wrap: wrap; } .waiting-slots { grid-template-columns: repeat(4, minmax(90px, 1fr)); } }
@media (max-width: 620px) { .app-shell { padding: 13px 10px 28px; } .topbar { grid-template-columns: 1fr auto; align-items: start; } .top-instructions { grid-column: 1 / -1; grid-row: 2; } .topbar-actions { flex-wrap: wrap; justify-content: flex-end; align-items: flex-end; } .discharged-pill { font-size: 10px; padding: 7px 8px; } .stepper { justify-content: flex-start; } .rail-right { grid-template-columns: 1fr; } .waiting-slots { grid-template-columns: repeat(3, minmax(88px, 1fr)); column-gap: 3px; row-gap: 6px; } .waiting-header h2 { font-size: 34px; } .queue-meter span { font-size: 30px; } }
@media (max-width: 940px) { .topbar { grid-template-columns: minmax(0, 1fr); row-gap: 12px; } .brand-lockup { grid-column: 1; grid-row: 1; } .topbar-actions { grid-column: 1; grid-row: 2; justify-content: flex-start; align-items: center; } .top-instructions { grid-column: 1; grid-row: 3; } }
@media (max-width: 940px) { .right-resources { width: 100%; } .right-resources > .rail-card { width: 100%; } .right-resources .cube-supply { width: 100%; flex-wrap: wrap; } }
