/* Staff order rail: checks hang from rails over the counter at dusk. Read at arm's length. */

body.counter {
  min-height: 100dvh;
  background: var(--night);
  color: var(--ink);
}

/* ---------- sign in ---------- */

.login {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: var(--s-5);
  background: url('/img/dusk.svg') center bottom / cover no-repeat;
}
.login .lifted { width: min(380px, 100%); }
.login-sheet {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: 0 var(--s-6) var(--s-6);
  background: var(--cream);
}
.login-sheet .perf { margin: 0 calc(-1 * var(--s-6)) var(--s-4); }
.login-badge { width: 72px; height: 72px; }
.login-title {
  margin: var(--s-2) 0 var(--s-5);
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1.05;
}
.login-title span { display: block; color: var(--print); }
.login-sheet input {
  min-height: 56px;
  padding: 0 var(--s-2);
  border: 0;
  border-bottom: 2px solid var(--rule-strong);
  background: transparent;
  font-family: var(--script);
  font-size: var(--step-3);
  letter-spacing: 0.3em;
  color: var(--hand);
}
.login-sheet input:focus { outline: none; border-bottom-color: var(--hand); background: var(--hand-soft); }
.login-sheet .btn { margin-top: var(--s-4); min-height: 56px; }
.login-error { color: var(--print); font-weight: 600; }

/* ---------- bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: var(--s-3) var(--s-5);
  padding: var(--s-3) var(--s-5);
  background: rgb(23 13 30 / 0.94);
  border-bottom: 1px solid var(--rule);
}
.bar-name {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--step-1);
  line-height: 1;
  white-space: nowrap;
  color: var(--cream);
}
.bar-name img { width: 40px; height: 40px; }
.bar-name span { color: var(--pink); }
.bar-counts {
  grid-column: 3;
  grid-row: 1;
  font-weight: 650;
  font-stretch: 85%;
  font-size: var(--step-1);
  color: var(--ink-2);
}

/* Coffee or camp store: two wood tabs. */
.boards { display: flex; gap: var(--s-2); }
.board-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 0 var(--s-4);
  border: 1px solid var(--wood-dark);
  border-bottom-width: 3px;
  border-radius: 3px;
  color: var(--cream);
  font-weight: 750;
  font-stretch: 80%;
  font-size: var(--step-1);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.board-tab:hover { filter: brightness(1.18); }
.board-tab[aria-pressed='true'] { box-shadow: var(--neon-pink); }
.tab-count:not(:empty) {
  min-width: 1.6em;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--pink);
  color: var(--on-action);
  text-align: center;
  font-size: var(--step--1);
  line-height: 1.7;
}
.board-tab.flash { animation: flash-tab 900ms var(--ease-out); }
@keyframes flash-tab { 0%, 40% { box-shadow: var(--neon-teal); } }

.bar-tools { grid-column: 4; display: flex; align-items: center; gap: var(--s-2); }
.tool {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-3);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  font-stretch: 85%;
}
.tool:hover { background: var(--night-3); }
.tool[aria-pressed='true'],
.tool[aria-expanded='true'] { background: var(--teal); color: var(--on-action); border-color: var(--teal); }
.conn {
  margin-right: var(--s-2);
  font-size: var(--step--1);
  color: var(--ink-2);
  white-space: nowrap;
}
.conn::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  vertical-align: 1px;
}
.conn.live::before { background: var(--teal); border-color: var(--teal); }
.conn.down { color: var(--pink-hi); }

/* ---------- lanes ---------- */

.floor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}
.lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
  padding: var(--s-5);
}
.lane { min-width: 0; }

/* The rail: a flat wood bar the checks clip onto. */
.rail {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--s-2) var(--s-3) 16px;
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--step-2);
  color: var(--cream);
}
.rail::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  border-radius: 2px;
  background: var(--wood) url('/img/wood.webp') 0 0 / 512px auto;
  border-bottom: 3px solid var(--wood-dark);
}
.rail-count {
  min-width: 2ch;
  font-family: var(--face);
  font-weight: 800;
  font-stretch: 80%;
  text-align: right;
}
.lane[data-status='received'] .rail-count:not(:empty) { color: var(--pink); }
.rail.flash { animation: flash 900ms var(--ease-out); }
@keyframes flash { 0%, 40% { color: var(--teal); } }

.tickets {
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
  margin: 0;
  padding: 0 0 var(--s-6);
  list-style: none;
}
.lane-empty {
  padding: var(--s-5) var(--s-3);
  color: var(--ink-2);
  font-size: var(--step-1);
}

/* ---------- ticket ---------- */

.ticket {
  position: relative;
  padding: 0 var(--s-4) var(--s-4);
  background: var(--cream);
  box-shadow: 0 1px 1px rgb(0 0 0 / 0.3), 0 14px 28px -12px rgb(0 0 0 / 0.8);
  transform-origin: 50% 0;
}
.ticket .perf {
  margin: 0 calc(-1 * var(--s-4));
  background: radial-gradient(circle at 7px 0, var(--night) 3.5px, transparent 4px) 0 0 / 14px 10px repeat-x;
}
.ticket.arrive { animation: arrive 700ms var(--ease-out) both; }
@keyframes arrive {
  0% { transform: translateY(-36px) rotate(-4deg); opacity: 0; }
  55% { transform: translateY(4px) rotate(1deg); opacity: 1; }
  100% { transform: none; }
}

.t-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
  padding-top: var(--s-3);
}
.t-no { font-size: var(--step-3); line-height: 1; }
.t-age {
  font-weight: 650;
  font-stretch: 85%;
  font-size: var(--step-1);
  color: var(--ink-2);
  white-space: nowrap;
}
.t-late {
  display: inline-block;
  margin-top: var(--s-2);
  padding: 2px var(--s-2);
  background: var(--pink-deep);
  color: var(--cream);
  font-weight: 750;
  font-stretch: 75%;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ticket.late { box-shadow: 0 0 0 3px var(--pink), 0 14px 28px -12px rgb(0 0 0 / 0.8); }

.t-when {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-top: var(--s-2);
  font-weight: 750;
  font-stretch: 80%;
  font-size: var(--step-1);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.t-when .icon { color: var(--ink-2); }
.t-name {
  margin-top: var(--s-1);
  font-family: var(--script);
  font-weight: 700;
  font-size: var(--step-2);
  line-height: 1.15;
  color: var(--hand);
  overflow-wrap: anywhere;
}

.t-lines {
  margin: var(--s-3) 0 0;
  padding: 0;
  list-style: none;
  border-top: 3px double var(--rule-strong);
}
.t-line {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: var(--s-2);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--rule);
}
.t-qty {
  font-weight: 800;
  font-stretch: 80%;
  font-size: var(--step-2);
  line-height: 1.1;
  text-align: center;
  border-right: 1px solid var(--rule);
}
.t-qty.many { color: var(--print); }
.t-item { font-weight: 650; font-size: var(--step-1); line-height: 1.25; }
.t-mods { font-size: var(--step-0); color: var(--ink-2); line-height: 1.35; }
.t-note { font-family: var(--script); font-size: var(--step-0); color: var(--hand); }

.t-extra {
  margin-top: var(--s-3);
  padding: var(--s-2) var(--s-3);
  border: 1px dashed var(--rule-strong);
  font-size: var(--step-0);
  overflow-wrap: anywhere;
}
.t-extra .form-label { display: block; }
.t-extra .hand { font-size: var(--step-1); }

.t-actions {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: var(--s-4);
}
.t-actions .btn { width: 100%; min-height: 56px; font-size: var(--step-2); }
.t-track {
  min-height: 48px;
  padding: 0 var(--s-2);
  border: 0;
  border-bottom: 2px solid var(--rule-strong);
  background: transparent;
  font-family: var(--script);
  font-size: var(--step-1);
  color: var(--hand);
}
.t-track::placeholder { color: var(--ink-2); }
.t-track:focus { outline: none; border-bottom-color: var(--hand); background: var(--hand-soft); }
.t-minor { display: flex; justify-content: space-between; gap: var(--s-2); }
.t-minor button {
  min-height: 40px;
  padding: 0 var(--s-2);
  border: 0;
  background: none;
  color: var(--ink-2);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.t-minor button:hover { color: var(--ink); }
.t-minor .arm { color: var(--print); text-decoration-thickness: 2px; }

.ticket.leaving { animation: leave 380ms ease-in forwards; }
@keyframes leave { to { transform: translateX(40px) rotate(3deg); opacity: 0; } }

/* ---------- sold-out list ---------- */

.soldout {
  position: sticky;
  top: 73px;
  width: 360px;
  max-height: calc(100dvh - 73px);
  overflow: auto;
  padding: var(--s-5);
  background: var(--cream);
  box-shadow: -10px 0 30px -10px rgb(0 0 0 / 0.7);
}
.soldout-head { display: flex; align-items: center; justify-content: space-between; }
.soldout-head h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--step-2);
}
.soldout .tool { color: var(--ink); }
.soldout .tool:hover { background: var(--hand-soft); }
.soldout-note { margin: var(--s-2) 0 var(--s-4); color: var(--ink-2); font-size: 0.9375rem; }
.so-section {
  margin: var(--s-5) 0 0;
  padding-bottom: var(--s-1);
  border-bottom: 3px double var(--rule-strong);
  font-weight: 800;
  font-stretch: 70%;
  font-size: var(--step-1);
  text-transform: uppercase;
}
.so-cat { margin: var(--s-4) 0 var(--s-1); }
.so-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  min-height: 48px;
  border-bottom: 1px solid var(--rule);
}
.so-row .tick { font-size: var(--step-0); width: 100%; justify-content: space-between; flex-direction: row-reverse; }
.so-row .tick-text { font-weight: 600; }
.so-row.out .tick-text { text-decoration: line-through; text-decoration-color: var(--print); text-decoration-thickness: 2px; color: var(--ink-2); }
.so-row.out .so-flag { display: inline; }
.so-flag {
  display: none;
  margin-left: var(--s-2);
  color: var(--print);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

/* ---------- done today ---------- */

.done {
  margin: 0 var(--s-5) var(--s-7);
  padding-top: var(--s-2);
  border-top: 1px solid var(--rule);
}
.done summary {
  display: flex;
  align-items: center;
  min-height: 52px;
  cursor: pointer;
  font-weight: 700;
  font-stretch: 80%;
  font-size: var(--step-1);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink-2);
}
.done-list { margin: 0; padding: 0; list-style: none; }
.done-row {
  display: grid;
  grid-template-columns: 80px 1fr auto auto;
  align-items: center;
  gap: var(--s-4);
  min-height: 48px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-2);
}
.done-row .serial { color: var(--pink); font-size: var(--step-1); }
.done-row .gone { font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; }
.done-row button {
  min-height: 40px;
  border: 0;
  background: none;
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (max-width: 1180px) {
  .bar { grid-template-columns: auto 1fr auto; }
  .bar-counts { display: none; }
  .bar-tools { grid-column: 3; }
  .soldout { position: fixed; right: 0; top: 0; bottom: 0; max-height: none; z-index: 20; }
}

@media (max-width: 820px) {
  .bar { grid-template-columns: minmax(0, 1fr) auto; padding: var(--s-2) var(--s-4); gap: var(--s-2); }
  .bar-name { min-width: 0; font-size: var(--step-0); }
  .bar-name span { display: none; }
  .bar-name img { width: 32px; height: 32px; }
  .bar-tools { grid-column: 2; grid-row: 1; }
  .boards { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; min-width: 0; }
  .board-tab { min-width: 0; justify-content: center; padding-inline: var(--s-3); font-size: var(--step-0); }
  .lanes {
    grid-template-columns: repeat(3, minmax(280px, 86vw));
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: var(--s-4);
    gap: var(--s-4);
  }
  .lane { scroll-snap-align: start; }
  .tool-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tool { padding: 0 var(--s-3); }
  .conn { display: none; }
  .soldout { width: min(100vw, 360px); }
  .done { margin: 0 var(--s-4) var(--s-6); }
  .done-row { grid-template-columns: 64px 1fr auto; }
  .done-row .gone { display: none; }
}
