.p3d { position: relative; display: grid; grid-template-rows: 1fr auto auto; gap: 14px; height: min(86vh, 780px); min-height: 520px; }
.p3d-stage { position: relative; min-height: 0; }
.p3d-stage canvas { -webkit-mask: linear-gradient(#000 88%, transparent), linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); -webkit-mask-composite: source-in; mask: linear-gradient(#000 88%, transparent), linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent); mask-composite: intersect; position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; }
.p3d-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.p3d-pill { font: 500 15px/1 Satoshi, system-ui, sans-serif; color: var(--ink); background: transparent; border: 1px solid rgba(31,36,40,.3); border-radius: 999px; padding: 12px 20px; cursor: pointer; transition: background .2s, border-color .2s; }
.p3d-pill:hover { border-color: #1E4FD8; }
.p3d-pill[aria-pressed="true"] { background: #1E4FD8; border-color: #1E4FD8; color: #fff; }
.p3d-pill:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.p3d-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
/* live kitchen ticket: translucent docket on the page, hairline rules, no filled box */
.p3d-ticket { color: var(--ink); width: min(100%, 360px); padding: 14px 2px 12px; border-top: 1px dashed rgba(31,36,40,.34); border-bottom: 1px dashed rgba(31,36,40,.34); font: 500 20px/1.3 Satoshi, system-ui, sans-serif; text-wrap: pretty; }
.tk-head { display: flex; justify-content: space-between; font: 500 13px/1 "Geist Mono", ui-monospace, monospace; letter-spacing: .08em; color: var(--muted); padding-bottom: 12px; }
.tk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; min-height: 28px; }
.tk-list li { display: grid; grid-template-columns: 40px 1fr; }
.tk-list li b { font: 500 19px "Geist Mono", ui-monospace, monospace; color: var(--accent-text); }
.tk-list li.new { animation: tkin .45s ease-out; }
@keyframes tkin { from { opacity: 0; transform: translateY(8px); } }
.tk-foot { margin-top: 14px; font: 500 13px/1 "Geist Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.p3d-ticket[data-state="ended"] .tk-foot { color: var(--accent-text); }
@media (max-width: 820px) { .p3d { height: min(86svh, 700px); min-height: 440px; } .p3d-ticket { width: 100%; padding: 8px 2px; font-size: 16px; } .tk-list { grid-template-columns: 1fr; gap: 4px; } .tk-list li { font-size: 14px; grid-template-columns: 30px 1fr; } .tk-list li b { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .p3d-ticket li.new { animation: none; } }

.p3d-pill { white-space: nowrap; }
@media (max-width: 820px) { .p3d-controls { flex-wrap: nowrap; gap: 8px; } .p3d-pill { padding: 11px 15px; font-size: 14px; } }

.p3d-pill[data-state="paused"] { border-color: #1E4FD8; color: var(--accent-text); }
.p3d-pill.p3d-end { border-color: rgba(255,59,48,.7); }
.p3d-pill.p3d-end:hover { background: rgba(255,59,48,.08); border-color: #FF3B30; }
