:root {
  --bg: #070909;
  --surface: #101414;
  --surface-2: #171c1b;
  --surface-3: #202725;
  --ink: #fff7e8;
  --muted: #aaa99f;
  --dim: #747a76;
  --line: rgba(255, 240, 204, 0.16);
  --line-strong: rgba(255, 224, 143, 0.34);
  --gold: #ffd15b;
  --amber: #ff9f3d;
  --coral: #ff5b4f;
  --jade: #2ed6a1;
  --cyan: #42c8f5;
  --danger: #ff655b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(118deg, rgba(255, 91, 79, 0.09), transparent 22%),
    linear-gradient(298deg, rgba(66, 200, 245, 0.07), transparent 25%),
    #070909;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 247, 232, 0.026), transparent 34%),
    repeating-linear-gradient(90deg, transparent 0 118px, rgba(255, 247, 232, 0.022) 119px, transparent 120px);
  mask-image: linear-gradient(to bottom, #000 0 48%, transparent 100%);
  opacity: 0.72;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(255, 209, 91, 0.5);
  outline-offset: 3px;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.grid-sheet {
  position: absolute;
  top: 58px;
  left: 8%;
  width: 84%;
  height: 54px;
  background:
    radial-gradient(ellipse at 24% 0%, rgba(255, 209, 91, 0.13), transparent 56%),
    radial-gradient(ellipse at 74% 10%, rgba(66, 200, 245, 0.11), transparent 60%);
  filter: blur(18px);
  opacity: 0.55;
}

.laser {
  position: absolute;
  width: 340px;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0.34;
  transform-origin: center;
}

.laser-a {
  top: 28%;
  left: -90px;
  color: var(--coral);
  transform: rotate(52deg);
}

.laser-b {
  right: -100px;
  top: 64%;
  color: var(--cyan);
  transform: rotate(-42deg);
}

.app-shell {
  position: relative;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

.site-head {
  position: relative;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 0;
}

.site-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 247, 232, 0.1), transparent);
  opacity: 0.45;
}

.top-queue-live {
  min-height: 54px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px 11px;
  margin-top: 14px;
  padding: 15px 17px 13px;
  color: var(--muted);
  background: rgba(13, 17, 16, 0.96);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.top-queue-dot {
  width: 9px;
  height: 9px;
  background: var(--dim);
  border-radius: 50%;
}

.top-queue-live strong {
  color: var(--ink);
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 25px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.top-queue-live em {
  padding: 4px 8px;
  color: #07100d;
  background: var(--gold);
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.top-queue-live small {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 2px;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.top-queue-channels {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 9px;
}

.top-queue-channels span {
  min-width: 0;
  display: flex;
  min-height: 86px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 15px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-top: 3px solid var(--cyan);
  border-radius: 6px;
  font-size: 12px;
}

.top-queue-channels span[data-channel="vip"] {
  background: linear-gradient(145deg, rgba(255, 209, 91, 0.13), rgba(255, 159, 61, 0.035));
  border-top-color: var(--gold);
}

.top-queue-channels span[data-channel="upi"] {
  background: linear-gradient(145deg, rgba(255, 91, 79, 0.11), rgba(255, 91, 79, 0.025));
  border-top-color: var(--coral);
}

.top-queue-channels span[data-channel="ideal"] {
  background: linear-gradient(145deg, rgba(66, 200, 245, 0.11), rgba(66, 200, 245, 0.025));
  border-top-color: var(--cyan);
}

.top-queue-channels b {
  align-self: flex-start;
  padding-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.top-queue-channels strong {
  flex: 0 0 auto;
  margin: 0;
  color: var(--ink);
  font: 900 42px/0.88 Consolas, monospace;
}

.top-queue-channels .channel-loading {
  grid-column: 1 / -1;
  justify-content: center;
}

.top-queue-live.working {
  background: rgba(13, 17, 16, 0.97);
  border-color: rgba(255, 224, 143, 0.25);
  box-shadow: inset 4px 0 0 rgba(255, 209, 91, 0.72);
}

.top-queue-live.working .top-queue-dot {
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(255, 209, 91, 0.55);
  animation: queue-pulse 1.5s infinite;
}

.top-queue-live.success {
  background: linear-gradient(95deg, rgba(46, 214, 161, 0.14), rgba(66, 200, 245, 0.07));
  border-color: rgba(46, 214, 161, 0.34);
  box-shadow: inset 4px 0 0 var(--jade);
}

.top-queue-live.success .top-queue-dot {
  background: var(--jade);
  box-shadow: 0 0 12px var(--jade);
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}

.brand-seal {
  position: relative;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  color: #180d08;
  background: linear-gradient(145deg, #fff0a6, var(--gold) 36%, var(--coral));
  border: 1px solid #fff1b9;
  border-radius: 6px;
  box-shadow: 8px 8px 0 rgba(255, 91, 79, 0.18);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 30px;
  font-weight: 900;
  transform: rotate(-4deg);
}

.brand-seal::after {
  content: "+";
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: #05130f;
  background: var(--jade);
  border: 2px solid var(--bg);
  border-radius: 50%;
  font: 900 14px/1 Arial, sans-serif;
}

.brand strong,
.brand small {
  display: block;
  overflow-wrap: anywhere;
}

.brand strong {
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.head-status {
  display: flex;
  align-items: center;
  gap: 9px;
}

.service-pill,
.quiet-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
}

.quiet-button {
  cursor: pointer;
}

.service-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 8px;
  background: var(--dim);
  border-radius: 50%;
}

.service-pill.live {
  color: #c9ffeb;
  border-color: rgba(46, 214, 161, 0.36);
}

.service-pill.live::before {
  background: var(--jade);
  box-shadow: 0 0 13px var(--jade);
}

.service-pill.down {
  color: #ffd1cd;
  border-color: rgba(255, 91, 79, 0.45);
}

.service-pill.down::before {
  background: var(--danger);
}

.counter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
  margin-top: 20px;
}

.work-panel,
.receipt-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.035), transparent 42%), var(--surface);
  box-shadow: var(--shadow);
}

.work-panel::before,
.receipt-panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 18px;
  width: 84px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--coral));
}

.work-panel {
  min-height: 590px;
  display: grid;
  align-content: start;
  gap: 17px;
  padding: 26px;
}

.counter-title p,
.receipt-top p,
.queue-head p {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

.counter-title h1 {
  max-width: 690px;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 35px;
  line-height: 1.16;
  font-weight: 900;
  text-wrap: balance;
}

.counter-title > span,
.queue-head > div > span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.flow-rail {
  display: grid;
  grid-template-columns: minmax(82px, auto) 1fr minmax(96px, auto) 1fr minmax(96px, auto);
  align-items: center;
  gap: 9px;
  padding: 4px 0;
}

.rail-step {
  min-width: 0;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: var(--dim);
  background: #111515;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.rail-step.active {
  color: #1b1005;
  background: linear-gradient(135deg, var(--gold), var(--amber));
  border-color: var(--gold);
  box-shadow: 5px 5px 0 rgba(255, 159, 61, 0.14);
}

.rail-step.done {
  color: #04140f;
  background: var(--jade);
  border-color: var(--jade);
}

.rail-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.desk-form {
  position: relative;
  display: grid;
  gap: 13px;
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.desk-form.active {
  border-color: rgba(255, 209, 91, 0.46);
  box-shadow: inset 4px 0 0 var(--gold);
}

.desk-form.locked {
  opacity: 0.46;
  filter: saturate(0.5);
}

.batch-form {
  background:
    linear-gradient(135deg, rgba(66, 200, 245, 0.08), transparent 42%),
    var(--surface-2);
  border-color: rgba(66, 200, 245, 0.22);
}

.batch-form::after {
  content: "BATCH";
  position: absolute;
  right: 14px;
  top: 10px;
  color: rgba(255, 255, 255, 0.045);
  font: 900 34px/1 Arial, sans-serif;
  pointer-events: none;
}

.batch-submit {
  min-width: 120px;
  color: #07100d;
  background: linear-gradient(135deg, var(--jade), var(--cyan));
  border-color: rgba(66, 200, 245, 0.58);
}

.form-head,
.command-line,
.submit-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-head small {
  display: block;
  margin-bottom: 4px;
  color: var(--amber);
  font-size: 11px;
  font-weight: 900;
}

label {
  display: block;
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 24px;
  font-weight: 900;
}

.symbol-button {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  color: var(--gold);
  background: rgba(255, 209, 91, 0.07);
  border: 1px solid rgba(255, 209, 91, 0.25);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 900;
}

input,
textarea {
  width: 100%;
  color: var(--ink);
  background: #0a0d0d;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  font-family: Consolas, "SFMono-Regular", monospace;
  letter-spacing: 0;
}

input::placeholder,
textarea::placeholder {
  color: #626864;
}

input {
  min-width: 0;
  min-height: 54px;
  padding: 0 15px;
}

textarea {
  min-height: 130px;
  padding: 14px 15px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
textarea:focus {
  border-color: rgba(255, 209, 91, 0.6);
  box-shadow: inset 0 -2px 0 var(--gold);
}

input:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
}

button:disabled {
  opacity: 0.38;
  filter: saturate(0.3);
  box-shadow: none !important;
}

.gold-button,
.red-button,
.line-button,
.table-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 900;
  white-space: nowrap;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.gold-button {
  min-width: 126px;
  color: #1d1105;
  background: linear-gradient(135deg, #ffe797, var(--gold) 48%, var(--amber));
  border-color: var(--gold);
  box-shadow: 6px 6px 0 rgba(255, 159, 61, 0.13);
}

.red-button {
  min-width: 132px;
  color: white;
  background: linear-gradient(135deg, #ff796b, var(--coral));
  border-color: #ff8a7e;
  box-shadow: 6px 6px 0 rgba(255, 91, 79, 0.15);
}

.line-button,
.table-action {
  color: var(--ink);
  background: var(--surface-3);
}

.line-button.danger {
  color: #ffd0cb;
  border-color: rgba(255, 91, 79, 0.38);
}

.gold-button:hover:not(:disabled),
.red-button:hover:not(:disabled),
.line-button:hover:not(:disabled),
.table-action:hover:not(:disabled),
.quiet-button:hover:not(:disabled),
.symbol-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(255, 209, 91, 0.62);
  box-shadow: 0 12px 28px rgba(255, 159, 61, 0.13);
}

.hint {
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.session-help {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  background: rgba(66, 200, 245, 0.055);
  border-left: 3px solid var(--cyan);
}

.session-help p {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  margin: 0;
  font-size: 12px;
}

.session-help span {
  color: var(--cyan);
  font-weight: 900;
}

.session-help a {
  min-width: 0;
  color: #a8eaff;
  overflow-wrap: anywhere;
}

.session-help small {
  color: #b8c8c3;
  font-size: 12px;
}

.receipt-panel {
  position: sticky;
  top: 16px;
  align-self: start;
  padding: 23px;
  overflow: hidden;
}

.receipt-panel::before {
  background: linear-gradient(90deg, var(--jade), var(--cyan));
}

.receipt-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.receipt-top > div {
  min-width: 0;
}

.receipt-top h2,
.queue-head h2 {
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 30px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.stamp {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  color: #7b817d;
  background: rgba(255, 255, 255, 0.025);
  border: 3px double currentColor;
  border-radius: 50%;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 20px;
  font-weight: 900;
  transform: rotate(-10deg);
}

.stamp.ready,
.stamp.success {
  color: var(--jade);
  animation: stamp-in 180ms ease-out;
}

.stamp.working {
  color: var(--gold);
}

.stamp.danger {
  color: var(--danger);
}

@keyframes stamp-in {
  from { transform: rotate(-10deg) scale(1.14); opacity: 0.5; }
  to { transform: rotate(-10deg) scale(1); opacity: 1; }
}

.receipt-message {
  margin: 17px 0 0;
  padding: 13px 0 15px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.queue-live {
  position: relative;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  margin: 0 -23px 17px;
  padding: 16px 23px;
  background: rgba(255, 255, 255, 0.035);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.queue-live::after {
  content: "LIVE";
  position: absolute;
  right: 22px;
  bottom: 6px;
  color: rgba(255, 255, 255, 0.045);
  font: 900 34px/1 Arial, sans-serif;
  pointer-events: none;
}

.queue-live-dot {
  width: 11px;
  height: 11px;
  margin-top: 5px;
  background: var(--dim);
  border-radius: 50%;
}

.queue-live small,
.queue-live strong,
.queue-live em,
.queue-live p {
  display: block;
  position: relative;
  z-index: 1;
  overflow-wrap: anywhere;
}

.queue-live small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.queue-live-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 3px;
}

.queue-live strong {
  margin-top: 3px;
  color: var(--ink);
  font-family: "STKaiti", "KaiTi", "Songti SC", serif;
  font-size: 26px;
  line-height: 1.18;
}

.queue-live-head strong {
  margin-top: 0;
}

.queue-live em {
  padding: 3px 7px;
  color: #07100d;
  background: var(--gold);
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.25;
}

.queue-live p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.queue-live time {
  position: relative;
  z-index: 1;
  color: var(--dim);
  font: 11px/1.4 Consolas, monospace;
}

.queue-live.working {
  background: linear-gradient(100deg, rgba(255, 209, 91, 0.19), rgba(255, 91, 79, 0.11));
  border-color: rgba(255, 209, 91, 0.4);
  box-shadow: inset 4px 0 0 var(--gold);
}

.queue-live.working .queue-live-dot {
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(255, 209, 91, 0.55);
  animation: queue-pulse 1.5s infinite;
}

.queue-live.working strong {
  color: #fff0b9;
}

.queue-live.ready,
.queue-live.success {
  background: linear-gradient(100deg, rgba(46, 214, 161, 0.15), rgba(66, 200, 245, 0.08));
  border-color: rgba(46, 214, 161, 0.34);
  box-shadow: inset 4px 0 0 var(--jade);
}

.queue-live.ready .queue-live-dot,
.queue-live.success .queue-live-dot {
  background: var(--jade);
  box-shadow: 0 0 12px var(--jade);
}

.queue-live.danger {
  background: rgba(255, 91, 79, 0.13);
  border-color: rgba(255, 91, 79, 0.4);
  box-shadow: inset 4px 0 0 var(--danger);
}

.queue-live.danger .queue-live-dot {
  background: var(--danger);
  box-shadow: 0 0 12px var(--danger);
}

@keyframes queue-pulse {
  70% { box-shadow: 0 0 0 9px rgba(255, 209, 91, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 209, 91, 0); }
}

.ledger {
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ledger div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  min-height: 42px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.075);
}

.ledger div:last-child {
  border-bottom: 0;
}

dt,
dd {
  min-width: 0;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 8px 11px;
}

dt {
  color: var(--dim);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
  font-weight: 900;
}

dd {
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 800;
}

.status-badge {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.receipt-panel .status-badge {
  max-width: 100%;
}

.status-badge.ready,
.status-badge.success {
  color: #baffea;
  border-color: rgba(46, 214, 161, 0.42);
}

.status-badge.working {
  color: #ffe9a5;
  border-color: rgba(255, 209, 91, 0.45);
}

.status-badge.danger {
  color: #ffc5c0;
  border-color: rgba(255, 91, 79, 0.45);
}

.receipt-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 15px;
}

.refresh-note {
  margin: 11px 0 0;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.refresh-note strong {
  color: var(--jade);
}

.queue-section {
  position: relative;
  margin-top: 20px;
  padding: 24px;
  background: rgba(13, 17, 16, 0.95);
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line);
}

.queue-section::before {
  content: "";
  position: absolute;
  top: -1px;
  right: 24px;
  width: 132px;
  height: 3px;
  background: linear-gradient(90deg, var(--coral), var(--cyan));
}

.queue-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 15px;
}

.queue-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(84px, 1fr));
  gap: 8px;
}

.queue-metrics span {
  min-width: 84px;
  padding: 10px 11px;
  color: var(--dim);
  background: var(--surface-2);
  border-left: 3px solid var(--gold);
  font-size: 11px;
}

.queue-metrics span:nth-child(2) {
  border-left-color: var(--jade);
}

.queue-metrics span:nth-child(3) {
  border-left-color: var(--coral);
}

.queue-metrics strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}

.queue-notice {
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.queue-notice.warn {
  color: #ffc6c1;
}

.record-toolbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 11px;
  padding: 8px 10px;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.025);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.record-toolbar .quiet-button {
  min-height: 32px;
}

.record-grid {
  display: grid;
  gap: 10px;
}

.record-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(390px, 1fr);
  gap: 10px 16px;
  padding: 13px 14px;
  background: #0b0e0e;
  border: 1px solid var(--line);
  border-left: 4px solid var(--dim);
  border-radius: 7px;
}

.record-card.active {
  border-left-color: var(--gold);
  background: linear-gradient(100deg, rgba(255, 209, 91, 0.075), transparent 36%), #0b0e0e;
}

.record-main,
.record-status-line,
.record-id-line,
.record-foot,
.record-buttons {
  min-width: 0;
  display: flex;
  align-items: center;
}

.record-main {
  align-items: flex-start;
  flex-direction: column;
  gap: 7px;
}

.record-meta-line {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: var(--dim);
  font-size: 10px;
  font-weight: 800;
}

.record-meta-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.record-id-line,
.record-status-line {
  flex-wrap: wrap;
  gap: 8px;
}

.record-id-line code {
  color: var(--ink);
  font: 800 13px/1.4 Consolas, monospace;
  overflow-wrap: anywhere;
}

.channel-chip {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  color: #bfffee;
  background: rgba(46, 214, 161, 0.08);
  border: 1px solid rgba(46, 214, 161, 0.3);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.channel-chip.vip {
  color: #fff1b9;
  background: rgba(255, 209, 91, 0.1);
  border-color: rgba(255, 209, 91, 0.4);
}

.channel-chip.upi {
  color: #ffd0cb;
  background: rgba(255, 91, 79, 0.09);
  border-color: rgba(255, 91, 79, 0.38);
}

.channel-chip.ideal {
  color: #bfeeff;
  background: rgba(66, 200, 245, 0.09);
  border-color: rgba(66, 200, 245, 0.38);
}

.record-status-line > span:last-child {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.record-queue-metrics {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 1fr));
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.record-queue-metrics span {
  min-width: 0;
  padding: 7px 9px;
  border-right: 1px solid var(--line);
}

.record-queue-metrics span:last-child {
  border-right: 0;
}

.record-queue-metrics small,
.record-queue-metrics strong {
  display: block;
  overflow-wrap: anywhere;
}

.record-queue-metrics small {
  color: var(--dim);
  font-size: 9px;
  font-weight: 900;
}

.record-queue-metrics strong {
  margin-top: 4px;
  color: var(--ink);
  font-size: 12px;
}

.progress-box {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 5px;
}

.progress-box.compact {
  margin-top: 4px;
}

.progress-track {
  position: relative;
  height: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
}

.progress-fill {
  display: block;
  height: 100%;
  min-width: 7px;
  background: linear-gradient(90deg, var(--gold), var(--jade));
  border-radius: inherit;
  box-shadow: 0 0 14px rgba(46, 214, 161, 0.25);
}

.progress-track.indeterminate .progress-fill {
  width: 34% !important;
  animation: progress-scan 1.4s ease-in-out infinite;
}

.progress-value {
  min-width: 0;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

@keyframes progress-scan {
  0% { transform: translateX(-90%); }
  55% { transform: translateX(130%); }
  100% { transform: translateX(130%); }
}

.record-foot {
  grid-column: 1 / -1;
  justify-content: space-between;
  gap: 12px;
  padding-top: 8px;
  color: var(--dim);
  border-top: 1px dashed var(--line);
  font-size: 10px;
}

.record-times {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.record-times span {
  min-width: 112px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
}

.record-times small,
.record-times strong {
  display: block;
  overflow-wrap: anywhere;
}

.record-times small {
  margin-bottom: 3px;
  color: var(--dim);
  font-size: 9px;
  font-weight: 900;
}

.record-times strong {
  color: var(--ink);
  font-size: 10px;
}

.record-buttons {
  flex: 0 0 auto;
  gap: 7px;
}

.table-action.danger {
  color: #ffc5c0;
  border-color: rgba(255, 91, 79, 0.42);
}

.empty-row {
  height: 76px;
  color: var(--dim);
  text-align: center !important;
}

.table-action {
  min-height: 32px;
  padding: 0 11px;
  font-size: 11px;
}

.record-actions {
  display: flex;
  justify-content: center;
  margin-top: 13px;
}

.record-actions .line-button {
  min-width: 210px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  max-width: min(540px, calc(100% - 28px));
  padding: 12px 16px;
  color: var(--ink);
  background: #161b1a;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.46);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 170ms ease, transform 170ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.success {
  border-color: rgba(46, 214, 161, 0.56);
  box-shadow: inset 4px 0 0 var(--jade), 0 18px 48px rgba(0, 0, 0, 0.46);
}

.toast.danger {
  border-color: rgba(255, 91, 79, 0.56);
  box-shadow: inset 4px 0 0 var(--danger), 0 18px 48px rgba(0, 0, 0, 0.46);
}

.busy {
  opacity: 0.76;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 980px) {
  .counter {
    grid-template-columns: 1fr;
  }

  .receipt-panel {
    position: relative;
    top: auto;
  }

  .queue-head {
    align-items: stretch;
    flex-direction: column;
  }

  .queue-metrics {
    width: 100%;
  }

  .record-card {
    grid-template-columns: 1fr;
  }

  .record-foot {
    grid-column: auto;
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 18px, 560px);
    padding-top: 10px;
  }

  .site-head {
    align-items: stretch;
    flex-direction: column;
  }

  .head-status {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .top-queue-live {
    grid-template-columns: 9px minmax(0, 1fr) auto;
    align-items: start;
    padding: 13px;
  }

  .top-queue-live small {
    grid-column: 1 / -1;
  }

  .top-queue-channels {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .top-queue-channels span {
    min-height: 74px;
    align-items: flex-start;
    flex-direction: column;
    padding: 10px 9px;
  }

  .top-queue-channels b {
    font-size: 10px;
  }

  .top-queue-channels strong {
    font-size: 31px;
  }

  .brand strong {
    font-size: 24px;
  }

  .brand small {
    font-size: 11px;
  }

  .counter-title h1 {
    font-size: 32px;
  }

  .work-panel,
  .receipt-panel {
    padding: 18px;
  }

  .work-panel {
    gap: 14px;
  }

  .flow-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .rail-step {
    min-height: 40px;
    padding: 4px 5px;
    white-space: normal;
    text-align: center;
  }

  .rail-line {
    display: none;
  }

  .desk-form {
    padding: 15px;
  }

  .command-line,
  .submit-line {
    align-items: stretch;
    flex-direction: column;
  }

  .gold-button,
  .red-button,
  .submit-line .red-button {
    width: 100%;
  }

  .queue-live {
    margin-right: -18px;
    margin-left: -18px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .queue-live time {
    display: none;
  }

  .ledger div {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .queue-section {
    margin-right: -9px;
    margin-left: -9px;
    padding: 18px 9px;
  }

  .queue-head {
    padding: 0 9px;
  }

  .queue-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .queue-metrics span {
    min-width: 0;
    padding: 9px 8px;
  }

  .queue-notice {
    padding: 0 9px;
  }

  .record-toolbar {
    align-items: stretch;
    flex-direction: column;
    margin-right: 9px;
    margin-left: 9px;
  }

  .record-toolbar .quiet-button {
    width: 100%;
  }

  .record-card {
    gap: 12px;
    padding: 13px;
  }

  .record-queue-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-queue-metrics span {
    padding: 8px 6px;
  }

  .record-queue-metrics strong {
    font-size: 11px;
  }

  .record-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .record-times {
    display: grid;
    grid-template-columns: 1fr;
  }

  .record-times span {
    min-width: 0;
  }

  .record-buttons {
    width: 100%;
  }

  .record-buttons .table-action {
    flex: 1;
  }
}

@media (max-width: 390px) {
  .brand-seal {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    font-size: 25px;
  }

  .brand strong {
    font-size: 21px;
  }

  .brand small {
    max-width: 235px;
  }

  .counter-title h1 {
    font-size: 29px;
  }

  .receipt-top h2,
  .queue-head h2 {
    font-size: 27px;
  }

  .stamp {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
    font-size: 18px;
  }
}
