:root {
  color-scheme: dark;
  --bg: #030303;
  --panel: #111111;
  --panel-2: #181818;
  --line: #2b2b2b;
  --text: #f6f6f6;
  --muted: #a9a9a9;
  --soft: #777777;
  --accent: #f2f2f2;
  --good: #58d68d;
  --warn: #f4c95d;
  --danger: #ff6b6b;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.kiosk-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.kiosk-shell {
  width: min(92vw, 820px);
  min-height: min(92vh, 780px);
  display: grid;
  place-items: center;
  position: relative;
}

.kiosk-card {
  width: 100%;
  display: grid;
  gap: 28px;
  text-align: center;
}

.brand-logo {
  justify-self: center;
  width: min(52vw, 340px);
  max-height: 150px;
  object-fit: contain;
  margin-bottom: 10px;
}

.kiosk-card h1 {
  margin: 0;
  font-size: clamp(44px, 5rem, 96px);
  line-height: 0.96;
  font-weight: 780;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

#name-form {
  display: grid;
  gap: 18px;
}

.form-field {
  display: grid;
}

#name-input,
#number-input,
#size-select,
#design-select,
#garment-color-select,
#print-location-select {
  width: 100%;
  border: 2px solid #ffffff;
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  text-align: center;
  font-size: clamp(32px, 6vw, 64px);
  line-height: 1;
  font-weight: 760;
  outline: none;
  padding: 0 24px;
}

#name-input {
  height: 92px;
}

#number-input {
  height: 92px;
}

#size-select,
#design-select,
#garment-color-select,
#print-location-select {
  height: 78px;
  appearance: none;
  font-size: clamp(24px, 4vw, 42px);
  background-image:
    linear-gradient(45deg, transparent 50%, #000000 50%),
    linear-gradient(135deg, #000000 50%, transparent 50%);
  background-position:
    calc(100% - 32px) 35px,
    calc(100% - 22px) 35px;
  background-size: 10px 10px, 10px 10px;
  background-repeat: no-repeat;
}

#size-select:disabled,
#design-select:disabled,
#garment-color-select:disabled,
#print-location-select:disabled {
  opacity: 0.58;
}

.design-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.design-choice-card {
  min-height: 172px;
  display: grid;
  gap: 8px;
  align-content: start;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 10px;
  cursor: pointer;
}

.design-choice-card.is-selected {
  border-color: #ffffff;
  background: #ffffff;
  color: #000000;
}

.design-choice-card img,
.design-choice-empty {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: #ffffff;
}

.design-choice-card img {
  object-fit: contain;
}

.design-choice-empty {
  display: grid;
  place-items: center;
  color: #555555;
  font-size: 16px;
  font-weight: 800;
}

.design-choice-card strong {
  font-size: 18px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

#name-input::placeholder,
#number-input::placeholder {
  color: #6f6f6f;
}

#name-input:disabled,
#number-input:disabled {
  border-color: #747474;
  background: #d2d2d2;
  color: #666666;
  cursor: not-allowed;
  opacity: 0.62;
}

.mode-helper {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2.3vw, 22px);
  line-height: 1.25;
  font-weight: 700;
}

#name-input:focus,
#number-input:focus,
#size-select:focus,
#design-select:focus,
#garment-color-select:focus,
#print-location-select:focus {
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.22);
}

#name-form > button,
.primary-button,
.pause-button,
.ghost-button,
.item-button {
  border: 1px solid #ffffff;
  border-radius: 8px;
  cursor: pointer;
  min-height: 48px;
  padding: 0 20px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}

#name-form > button {
  height: 78px;
  background: #ffffff;
  color: #000000;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 780;
}

#name-form > button:active,
.primary-button:active,
.pause-button:active,
.ghost-button:active,
.item-button:active {
  transform: translateY(1px);
}

.status-message {
  min-height: 28px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.status-message.error {
  color: var(--danger);
}

.thanks-panel {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--bg);
}

.thanks-panel h2 {
  margin: 0 0 12px;
  font-size: clamp(64px, 10vw, 132px);
  line-height: 0.92;
}

.thanks-panel p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(22px, 3vw, 34px);
}

.worker-page {
  min-height: 100vh;
  padding: 22px;
}

.worker-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.worker-header h1,
.worker-header p {
  margin: 0;
}

.worker-header h1 {
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1;
  font-weight: 800;
}

.worker-header p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ghost-button {
  min-height: 42px;
  background: transparent;
  color: var(--text);
  border-color: var(--line);
  font-size: 14px;
  font-weight: 700;
}

.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.danger-button {
  border-color: rgba(255, 107, 107, 0.7);
  color: #ff9a9a;
}

.worker-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  padding-top: 18px;
}

.station-tabs {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.station-tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  min-height: 72px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.station-tab[aria-selected="true"] {
  border-color: #ffffff;
  background: #ffffff;
  color: #000000;
}

.station-tab strong {
  display: block;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.1;
}

.station-tab span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: inherit;
  opacity: 0.72;
}

.station-board,
.all-queues {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.station-board {
  min-width: 0;
  padding: 18px;
}

.all-queues {
  padding: 16px;
  align-self: start;
}

.stock-panel {
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  padding-bottom: 14px;
}

.stock-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #2a2a2a;
}

#stock-meter-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--good);
  transition: width 160ms ease, background 160ms ease;
}

#stock-meter-fill.is-over {
  background: var(--warn);
}

.stock-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.stock-stats div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--panel-2);
}

.stock-stats strong,
.stock-stats span {
  display: block;
}

.stock-stats strong {
  font-size: 24px;
  line-height: 1;
}

.stock-stats span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.billable-stat strong {
  color: var(--warn);
}

.stock-status {
  min-height: 36px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.station-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.utility-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  text-transform: uppercase;
}

.station-board-header h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 0.96;
}

.pause-button {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
  font-weight: 800;
  white-space: nowrap;
}

.pause-button.is-paused {
  border-color: var(--warn);
  color: #000000;
  background: var(--warn);
}

.next-panel {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: 18px;
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
}

.next-panel.is-over-stock {
  box-shadow: inset 0 0 0 5px var(--warn);
}

.next-panel .utility-label {
  color: #555555;
}

.next-name {
  min-height: 92px;
  display: flex;
  align-items: center;
  font-size: clamp(52px, 8vw, 112px);
  line-height: 0.94;
  font-weight: 840;
  overflow-wrap: anywhere;
}

.next-size {
  width: fit-content;
  border: 2px solid #000000;
  border-radius: 8px;
  padding: 8px 12px;
  color: #000000;
  font-size: clamp(20px, 3vw, 32px);
  line-height: 1;
  font-weight: 860;
}

.next-panel.is-over-stock .next-size {
  background: var(--warn);
}

.primary-button {
  width: fit-content;
  background: #000000;
  color: #ffffff;
  border-color: #000000;
  font-size: 18px;
  font-weight: 800;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.queue-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.queue-column {
  min-width: 0;
}

.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.list-heading h3 {
  margin: 0;
  font-size: 18px;
}

.list-heading span {
  color: var(--muted);
  font-weight: 800;
}

.name-list {
  display: grid;
  gap: 8px;
}

.name-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px 10px 10px 14px;
}

.name-row.done .name-text {
  color: var(--soft);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.name-row.over-stock {
  border-color: rgba(244, 201, 93, 0.9);
}

.name-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.name-text {
  display: block;
  margin-top: 2px;
  font-size: clamp(20px, 3vw, 32px);
  line-height: 1;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.item-button {
  min-height: 38px;
  border-color: var(--line);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.item-button.done-button {
  border-color: var(--good);
  color: var(--good);
}

.item-button.undo-button {
  border-color: var(--warn);
  color: var(--warn);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.78);
}

.modal-panel {
  width: min(92vw, 480px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
}

.modal-panel h2,
.modal-panel p {
  margin: 0;
}

.modal-panel h2 {
  font-size: clamp(32px, 6vw, 48px);
  line-height: 1;
}

.settings-panel {
  width: min(94vw, 760px);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.settings-control {
  display: grid;
  gap: 8px;
}

.settings-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-control input,
.settings-control select,
.design-option-control input[type="text"],
.garment-color-control input[type="text"],
.print-location-control input[type="text"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  padding: 0 12px;
  font-weight: 800;
}

.design-settings {
  margin-top: 18px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#design-settings-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

#garment-color-settings-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.design-option-control,
.garment-color-control {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) 88px auto auto auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px;
}

.garment-color-control,
.print-location-control {
  grid-template-columns: auto minmax(180px, 1fr) auto;
}

.design-option-enable {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.design-option-control input[type="checkbox"],
.garment-color-control input[type="checkbox"],
.print-location-control input[type="checkbox"],
.checkbox-control input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--good);
}

.checkbox-control {
  align-content: start;
}

.checkbox-control input[type="checkbox"] {
  margin: 6px 0 0;
}

.design-art-preview {
  width: 88px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #555555;
  font-size: 12px;
  font-weight: 800;
}

.design-art-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.design-art-file-control {
  min-width: 116px;
  margin-top: 0;
  padding: 0 12px;
  white-space: nowrap;
}

.design-art-clear-button {
  min-width: 104px;
  white-space: nowrap;
}

.remove-option-button {
  min-width: 84px;
  white-space: nowrap;
}

.modal-panel > p:not(.utility-label) {
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.modal-panel > p.danger-copy {
  color: #ffb0b0;
  font-weight: 800;
}

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

.danger-solid-button {
  min-height: 48px;
  border: 1px solid var(--danger);
  border-radius: 8px;
  background: var(--danger);
  color: #000000;
  cursor: pointer;
  font-weight: 850;
}

.danger-solid-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.logo-preview-frame {
  min-height: 132px;
  display: grid;
  place-items: center;
  margin-top: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #555555;
  padding: 18px;
}

.logo-preview-frame img {
  max-width: 100%;
  max-height: 116px;
  object-fit: contain;
}

.file-control {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

.single-action {
  grid-template-columns: 1fr;
}

.size-toggle-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.size-toggle {
  min-height: 52px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  padding: 10px 12px;
  cursor: pointer;
}

.size-toggle input {
  width: 24px;
  height: 24px;
  accent-color: var(--good);
}

.size-toggle span {
  font-size: 17px;
  font-weight: 800;
}

.size-toggle small {
  color: var(--good);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.size-toggle.unavailable {
  opacity: 0.66;
}

.size-toggle.unavailable small {
  color: var(--danger);
}

.empty-state {
  min-height: 58px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 15px;
}

.summary-row {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.summary-row:first-child {
  border-top: 0;
}

.summary-row strong,
.summary-row span {
  display: block;
}

.summary-row strong {
  font-size: 17px;
}

.summary-row span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.summary-row.paused strong::after {
  content: " paused";
  color: var(--warn);
  font-size: 12px;
  text-transform: uppercase;
  margin-left: 8px;
}

@media (max-width: 900px) {
  .worker-page {
    padding: 14px;
  }

  .worker-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: stretch;
  }

  .ghost-button {
    flex: 1;
  }

  .worker-shell {
    grid-template-columns: 1fr;
  }

  .station-tabs {
    grid-template-columns: 1fr;
  }

  .station-board-header,
  .queue-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .pause-button {
    width: 100%;
  }

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

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

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .design-option-control,
  .garment-color-control,
  .print-location-control {
    grid-template-columns: 1fr;
  }

  .design-option-enable {
    justify-content: start;
  }

  .design-art-preview {
    width: 100%;
    max-width: 160px;
  }
}

@media (max-height: 820px) {
  .kiosk-page {
    align-items: start;
  }

  .kiosk-shell {
    min-height: auto;
    padding: 24px 0;
    place-items: start center;
  }
}

@media (max-width: 520px) {
  .kiosk-page {
    align-items: start;
  }

  .kiosk-shell {
    min-height: auto;
    padding: 20px 0;
    place-items: start center;
  }

  .kiosk-card h1 {
    width: 100%;
    max-width: 100%;
    font-size: 34px;
    line-height: 1.08;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
