:root {
  --ink: #102321;
  --muted: #60706d;
  --paper: #f1f5f3;
  --white: #ffffff;
  --line: #d4dfdc;
  --teal: #078c83;
  --teal-dark: #05665f;
  --teal-soft: #dff3ef;
  --coral: #dc6656;
  --coral-soft: #f9e6e2;
  --yellow: #f7ca4f;
  --yellow-soft: #fff4ce;
  --error: #b83b32;
  --error-soft: #fae9e6;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.d-none {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  border: 0;
  margin: -1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.customer-main {
  width: min(calc(100% - 32px), 620px);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin: 0 auto;
  padding: 28px 0 56px;
}

.customer-ticket {
  width: 100%;
  overflow: hidden;
  border: 1px solid #c8d5d1;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 28px 70px rgba(14, 49, 45, 0.14);
}

.pp-header {
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}

.pp-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.store-fallback {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--white);
  background: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.pp-brand img {
  display: none;
  width: auto;
  max-width: 112px;
  height: 44px;
  object-fit: contain;
  background: transparent;
}

.pp-brand-copy {
  min-width: 0;
}

.pp-brand-copy span,
.pp-brand-copy strong {
  display: block;
}

.pp-brand-copy span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pp-brand-copy strong {
  overflow: hidden;
  margin-top: 3px;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-pill {
  padding: 5px 7px;
  border: 1px solid #a8c4bf;
  border-radius: 3px;
  color: var(--teal-dark);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.pp-body {
  padding: 26px;
}

.all-orders-btn {
  min-height: 38px;
  margin: -7px 0 15px;
  padding: 0;
  border: 0;
  color: var(--teal-dark);
  background: transparent;
  font-size: 12px;
  font-weight: 820;
}

.all-orders-btn:hover,
.all-orders-btn:focus-visible {
  color: var(--ink);
  text-decoration: underline;
}

.system-message {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #f7f9f8;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.system-message.is-error {
  border-color: #e8aaa3;
  color: var(--error);
  background: var(--error-soft);
}

.loading-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
  background: var(--teal);
  animation: loading-pulse 1.2s ease-in-out infinite;
}

@keyframes loading-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.ticket-number {
  padding: 8px 0 24px;
  text-align: center;
}

.ticket-number span,
.ticket-number strong {
  display: block;
}

.ticket-number span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.ticket-number strong {
  margin-top: 5px;
  font-size: 86px;
  font-weight: 880;
  line-height: 1;
  letter-spacing: 0;
}

.ticket-status {
  min-height: 68px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #efd582;
  border-radius: 6px;
  background: var(--yellow-soft);
}

.ticket-status[data-state="preparing"],
.ticket-status[data-state="ready"] {
  border-color: #9bcfc8;
  background: var(--teal-soft);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c89917;
}

[data-state="preparing"] .status-dot,
[data-state="ready"] .status-dot {
  background: var(--teal);
}

.ticket-status strong,
.ticket-status small {
  display: block;
}

.ticket-status strong {
  font-size: 14px;
}

.ticket-status small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.ticket-progress {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.ticket-progress li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  color: #899491;
}

.ticket-progress li > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid #c9d4d1;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 850;
}

.ticket-progress strong,
.ticket-progress small {
  display: block;
}

.ticket-progress strong {
  font-size: 12px;
}

.ticket-progress small {
  margin-top: 2px;
  font-size: 10px;
}

.ticket-progress li.is-done,
.ticket-progress li.is-active {
  color: var(--ink);
}

.ticket-progress li.is-done > span {
  border-color: var(--teal);
  color: var(--white);
  background: var(--teal);
}

.ticket-progress li.is-active > span {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 0 3px rgba(7, 140, 131, 0.12);
}

.ticket-note {
  margin: 19px 8px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  text-align: center;
}

.order-list-view {
  display: block;
}

.order-list-heading {
  margin-bottom: 18px;
}

.order-list-heading strong,
.order-list-heading span {
  display: block;
}

.order-list-heading strong {
  font-size: 21px;
}

.order-list-heading span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.order-list {
  border-top: 1px solid var(--line);
}

.order-list-row {
  --swipe-x: 0px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #b42318;
}

.order-list-row.is-open {
  --swipe-x: -88px;
}

.order-list-row.is-removing {
  max-height: 0;
  opacity: 0;
  transition: max-height 180ms ease, opacity 140ms ease;
}

.order-list-delete {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  width: 88px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: #b42318;
  font-size: 11px;
  font-weight: 850;
}

.order-list-delete:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -5px;
}

.order-list-delete:disabled {
  cursor: wait;
  opacity: .72;
}

.order-list-item {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 4px;
  border: 0;
  color: var(--ink);
  background: var(--white);
  text-align: left;
  touch-action: pan-y;
  transform: translateX(var(--swipe-x));
  transition: transform 180ms ease;
}

.order-list-row.is-dragging .order-list-item {
  transition: none;
}

.order-list-item:hover,
.order-list-item:focus-visible {
  background: #f7f9f8;
}

.order-list-item[data-state="ready"] {
  background: var(--teal-soft);
}

.order-list-item[data-state="completed"] {
  background: #f7f9f8;
}

.order-list-logo,
.order-list-fallback {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  object-fit: contain;
  color: var(--white);
  background: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.order-list-copy {
  min-width: 0;
}

.order-list-store,
.order-list-code {
  display: block;
}

.order-list-store {
  overflow: hidden;
  font-size: 12px;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-list-code {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 900;
}

.order-list-date {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.order-list-status {
  max-width: 108px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.35;
  text-align: right;
}

[data-state="ready"] .order-list-status {
  color: var(--teal-dark);
}

.order-list-feedback {
  min-height: 0;
  color: var(--error);
  font-size: 10px;
  line-height: 1.4;
}

.order-list-feedback:not(:empty) {
  min-height: 28px;
  padding: 8px 0;
}

@media (prefers-reduced-motion: reduce) {
  .order-list-item,
  .order-list-row.is-removing {
    transition: none;
  }
}

.push-controls {
  margin-bottom: 22px;
  padding: 17px;
  border: 1px solid #b7d9d4;
  border-left: 4px solid var(--teal);
  border-radius: 6px;
  background: #f7f9f8;
}

.push-heading strong,
.push-heading span {
  display: block;
}

.push-heading strong {
  font-size: 13px;
}

.push-heading span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

#enablePushBtn,
#submitOrderNumber {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  padding: 0 18px;
  border: 1px solid var(--teal);
  border-radius: 5px;
  color: var(--white);
  background: var(--teal);
  font-weight: 820;
  transition: background-color 160ms ease, transform 160ms ease;
}

#enablePushBtn:hover,
#enablePushBtn:focus-visible,
#submitOrderNumber:hover,
#submitOrderNumber:focus-visible {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

#enablePushBtn:disabled,
#submitOrderNumber:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

#pushStatus {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

#pushStatus:empty {
  display: none;
}

#pushStatus[data-state="success"] {
  color: var(--teal-dark);
}

#pushStatus[data-state="error"] {
  color: var(--error);
}

#pushStatus[data-state="loading"] {
  color: #75610e;
}

.order-number-form {
  padding: 4px 0 2px;
}

.form-heading {
  margin-bottom: 22px;
  text-align: center;
}

.form-heading strong,
.form-heading span {
  display: block;
}

.form-heading strong {
  font-size: 21px;
}

.form-heading span {
  max-width: 360px;
  margin: 7px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.order-number-form label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 800;
}

#customerOrderNumber {
  width: 100%;
  height: 58px;
  padding: 0 14px;
  border: 1px solid #b9c9c5;
  border-radius: 5px;
  outline: none;
  color: var(--ink);
  background: var(--white);
  font-size: 25px;
  font-weight: 800;
  text-align: center;
}

#customerOrderNumber:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(7, 140, 131, 0.14);
}

#orderNumberError {
  min-height: 20px;
  margin-top: 8px;
  color: var(--error);
  font-size: 11px;
  text-align: center;
}

.pickup-message {
  margin: 20px 0 0;
  padding: 14px;
  border-left: 4px solid var(--teal);
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: 13px;
  font-weight: 800;
}

.ready-pickup {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.ready-pickup span {
  font-size: 10px;
  text-transform: uppercase;
}

.ready-pickup strong {
  font-size: 13px;
  text-align: right;
}

.ready-meta {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.ready-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.ready-label {
  color: var(--muted);
  font-size: 11px;
}

.ready-value {
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.ready-hint {
  margin: 16px 0 0;
  color: var(--error);
  font-size: 11px;
  text-align: center;
}

.ready-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 20px;
}

.ready-orders-btn {
  min-height: 46px;
  border-radius: 5px;
  padding: 0 12px;
  font-weight: 820;
}

.ready-orders-btn {
  border: 1px solid #a8c4bf;
  color: var(--teal-dark);
  background: var(--white);
}

.ticket-footer {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 18px;
  border-top: 1px solid var(--line);
  color: #71807d;
  font-size: 9px;
  font-weight: 750;
}

.ticket-footer img {
  width: 22px;
  height: 22px;
  border-radius: 4px;
}

@media (max-width: 520px) {
  .customer-main {
    width: calc(100% - 24px);
  }

  .customer-main {
    padding: 12px 0 36px;
  }

  .pp-header {
    padding: 14px 16px;
  }

  .pp-body {
    padding: 22px 18px;
  }

  .ticket-number strong {
    font-size: 76px;
  }

  .pp-brand img {
    max-width: 86px;
  }

  .order-list-item {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .order-list-logo,
  .order-list-fallback {
    width: 38px;
    height: 38px;
  }

  .ready-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 350px) {
  .pp-body {
    padding: 20px 14px;
  }

  .ticket-number strong {
    font-size: 68px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
