.turn-screen {
  grid-column: 1 / -1;
  border: 1px solid #b6d3dd;
  border-radius: 14px;
  overflow: hidden;
  color: #193742;
  background: #f0f9fc;
}
.turn-screen-bar, .turn-screen-identity, .turn-current-pair {
  display: flex;
  align-items: center;
  gap: 12px;
}
.turn-screen-bar {
  justify-content: space-between;
  background: #fff;
  border-bottom: 3px solid #00a1d1;
  padding: 14px 20px;
}
.turn-brandmark {
  width: 42px;
  height: 42px;
  object-fit: contain;
}
.turn-screen-bar b, .turn-screen-bar small { display: block; }
.turn-screen-bar small { font-size: 12px; }
.turn-clock { text-align: right; }
.turn-clock b { font-variant-numeric: tabular-nums; font-size: 20px; }
.turn-screen-body {
  display: grid;
  grid-template-columns: minmax(146px, .8fr) minmax(0, 1.8fr);
  gap: 12px;
  padding: 14px;
}
.turn-screen h4 { margin: 0 0 8px; font-size: 14px; }
.turn-list { align-self: start; }
.turn-list p, .turn-list table { font-size: 14px; }
.turn-list table { width: 100%; border-spacing: 0; background: white; border-radius: 6px; overflow: hidden; }
.turn-list th, .turn-list td { padding: 6px 9px; text-align: center; }
.turn-list th { background: #00546c; color: white; font-size: 12px; }
.turn-list tbody tr + tr td { border-top: 1px solid #d7e9ee; }
.turn-list tbody tr:first-child { color: #790a36; font-weight: 700; }
.turn-list-name { display: block; font-size: 13px; font-weight: 500; }
.turn-current-name {
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 650;
  margin: 12px 0 0;
  padding-top: 8px;
  border-top: 1px solid #58a6bf;
}
.simbody:has(.patient-turn-card) {
  grid-template-columns: minmax(0,1.15fr) minmax(0,1fr) minmax(145px,.72fr);
  column-gap: 18px;
}
.patient-turn-card small, .turn-card-code, .turn-card-name { display: block; }
.patient-turn-card .turn-card-code {
  color: #00546c;
  font: 700 clamp(26px,3vw,42px)/1.2 Consolas,monospace;
  margin: 9px 0 2px;
}
.turn-card-name { font-size: 21px; line-height: 1.3; }
.patient-turn-card .turn-card-state { color: #7c103c; font-weight: 650; margin: 8px 0; }
.turn-health {
  position: relative;
  grid-column: 3;
  grid-row: 1 / span 2;
  margin: 0;
  min-height: 135px;
  background: #00546c;
  border-radius: 12px;
  overflow: hidden;
}
.turn-health img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.turn-health figcaption {
  position: absolute;
  inset: auto 0 0;
  margin: 0;
  padding: 24px 12px 12px;
  background: linear-gradient(0deg,#003849 0%,#003849d9 50%,transparent 100%);
  color: white;
  font-size: clamp(16px,2vw,24px);
  font-weight: 650;
}
.simbody:has(.patient-turn-card) .turn-screen { grid-column: 1 / 3; }
.turn-current {
  color: white;
  background: #00546c;
  border-radius: 10px;
  padding: clamp(13px, 2vw, 25px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 150px;
}
.turn-current h4 { color: #fff; }
.turn-current-pair { gap: 0; }
.turn-current-pair > div { flex: 1 1 auto; }
.turn-current-pair > div + div { padding-left: 1em; border-left: 1px solid #58a6bf; }
.turn-current small { color: #d0f1fc; }
.turn-current strong { display: block; font: 700 clamp(25px, 4.6vw, 62px)/1.15 Consolas, monospace; letter-spacing: -.05em; }
.turn-ticket-link, .pos-close {
  color: #00546c;
  background: white;
  border: 1px solid #82a9b5;
  border-radius: 7px;
  padding: 7px 12px;
  font: inherit;
}
.pos-preview {
  width: min(420px, 95vw);
  max-height: 92vh;
  color: #193742;
  border: 1px solid #b6d3dd;
  border-radius: 16px;
  padding: 20px;
}
.pos-preview::backdrop { background: rgb(6 35 46 / 65%); }
.pos-preview h3 { margin: 0 0 16px; }
.pos-close { float: right; padding: 4px 10px; }
.pos-paper {
  width: 64mm;
  max-width: 100%;
  margin: 14px auto;
  padding: 12px;
  text-align: center;
  font: 13px/1.35 Consolas, monospace;
  color: black;
  border: 1px dashed #777;
}
.pos-paper.pos-wide { width: 80mm; }
.pos-paper p { margin: 7px 0; }
.pos-paper strong { display: block; font-size: 31px; }
.pos-paper small { font-size: 10px; }
.pos-help { font-size: 13px; }
@media(max-width: 620px) {
  .turn-screen-body { grid-template-columns: 1fr; }
  .turn-current { grid-row: 1; min-height: 118px; }
  .turn-screen-bar { padding: 10px; }
  .turn-screen-identity { gap: 5px; }
  .turn-brandmark { width: 32px; height: 32px; }
}
@media(max-width: 850px) {
  .simbody:has(.patient-turn-card) {
    grid-template-columns: minmax(0,1.55fr) minmax(0,1fr);
    gap: 14px;
  }
  .simbody:has(.patient-turn-card) > :first-child { grid-column: 1 / -1; }
  .turn-health { grid-column: 2; grid-row: 2; }
  .patient-turn-card { grid-column: 1; grid-row: 2; padding: 14px; overflow-wrap: anywhere; }
}
@media print {
  body:has(.pos-preview[open]) { margin: 0; background: white; }
  body:has(.pos-preview[open]) > :not(.pos-preview) { display: none !important; }
  .pos-preview[open] { position: static; width: 100%; max-height: none; border: 0; margin: 0; padding: 0; overflow: visible; }
  .pos-preview::backdrop { display: none; }
  .pos-preview[open] > :not(.pos-paper) { display: none; }
  .pos-paper { box-sizing: border-box; border: 0; width: 100%; max-width: 100%; margin: 0; padding: 2mm; break-inside: avoid; }
  .pos-paper.pos-wide { width: 80mm; max-width: 100%; }
}
