/* Presentation-only mobile counting preview. Every selector is namespaced so
   this screen cannot affect the authenticated counting application. */

.tcp {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  color: #3e2723;
  font-family: 'Open Sans', system-ui, sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.tcp-kicker {
  margin: 0 0 4px;
  color: #806f64;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: left;
}

.tcp-titlerow {
  min-height: 45px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tcp-title-copy {
  min-width: 0;
}

.tcp-title {
  display: -webkit-box;
  overflow: hidden;
  color: #3e2723;
  font-family: 'Montserrat', 'Open Sans', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tcp-sub {
  margin-top: 2px;
  color: #806f64;
  font-size: 0.68rem;
  font-weight: 600;
}

.tcp-motion-toggle {
  min-width: 66px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #8f7a6b;
  border-radius: 6px;
  background: #fffdf9;
  color: #5f4a40;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}

.tcp-phone {
  position: relative;
  width: 100%;
  aspect-ratio: 390 / 844;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid #e0d4c6;
  border-radius: 24px;
  background: #f3ece2;
  box-shadow: 0 9px 24px rgba(67, 44, 31, 0.16);
  transition: opacity 400ms ease;
  container-type: inline-size;
}

.tcp-fading {
  opacity: 0;
}

.tcp-card {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
  background: #f8f2e9;
}

.tcp-scene {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 7px;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto auto auto minmax(190px, 1fr) auto auto;
  gap: 6px;
}

.tcp-card--eop .tcp-scene {
  grid-template-rows: auto auto auto minmax(190px, 1fr) auto auto;
}

.tcp-identity {
  min-width: 0;
  padding: 8px 8px 9px;
  border-radius: 8px;
  background: #fffaf2;
}

.tcp-item-heading {
  min-height: 40px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 4px;
}

.tcp-synced {
  color: #43b65d;
  font-size: 1rem;
  line-height: 1;
  text-align: center;
}

.tcp-item {
  min-width: 0;
  max-height: 2.4em;
  overflow: hidden;
  color: #3e2723;
  font-family: 'Montserrat', 'Open Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tcp-brand-mark {
  width: 28px;
  height: 28px;
  border: 2px solid #8b6549;
  border-radius: 50%;
  color: #8b542b;
  font-family: Georgia, serif;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 26px;
  text-align: center;
}

.tcp-meta-grid {
  margin-top: 7px;
  display: grid;
  grid-template-columns: 0.75fr 1.35fr 1.2fr 0.85fr;
  gap: 5px;
}

.tcp-meta-cell {
  min-width: 0;
  text-align: center;
}

.tcp-meta-label {
  color: #aa9a8f;
  font-size: 0.5rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
}

.tcp-meta-value {
  margin-top: 2px;
  overflow: hidden;
  color: #65564d;
  font-size: 0.63rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tcp-countrow {
  min-height: 82px;
  display: grid;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tcp-countrow--ordering {
  grid-template-columns: 68px 92px 68px;
}

.tcp-countrow--eop {
  grid-template-columns: 96px;
}

.tcp-metric {
  height: 72px;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #3e2723;
}

.tcp-count-tile,
.tcp-need-tile {
  border-radius: 8px;
}

.tcp-count-tile {
  background: #fffaf2;
}

.tcp-need-tile {
  background: #c6603f;
  color: #fff;
}

.tcp-metric-label {
  font-size: 0.5rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.tcp-par-tile .tcp-metric-label,
.tcp-par-tile .tcp-metric-unit {
  color: #938278;
}

.tcp-count-tile .tcp-metric-label,
.tcp-count-tile .tcp-metric-unit {
  color: #a5958a;
}

.tcp-par-value,
.tcp-count-value,
.tcp-need-value {
  max-width: 100%;
  overflow: hidden;
  font-family: 'Montserrat', 'Open Sans', sans-serif;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
}

.tcp-par-value {
  margin-top: 3px;
  font-size: 1.8rem;
}

.tcp-count-value {
  margin-top: 3px;
  color: #3d2518;
  font-size: 2.65rem;
}

.tcp-need-value {
  margin-top: 3px;
  color: #fff;
  font-size: 1.8rem;
}

.tcp-count-value--long {
  font-size: 1.85rem;
}

.tcp-count-value--xlong {
  font-size: 1.4rem;
}

.tcp-metric-unit {
  min-height: 0.8rem;
  margin-top: 2px;
  max-width: 100%;
  overflow: hidden;
  font-size: 0.48rem;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Kept in the accessibility tree and test surface; the visible production
   ordering math is expressed by the PAR and NEED tiles above. */
.tcp-par-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tcp-game-band {
  min-height: 69px;
  padding: 7px 9px 6px;
  box-sizing: border-box;
  border: 1px solid #6b513a;
  border-radius: 8px;
  background: #2f2019;
  color: #fff3dc;
  box-shadow: 0 2px 7px rgba(43, 27, 18, 0.22);
}

.tcp-band-cheer {
  overflow: hidden;
  color: #f2bf70;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tcp-band-stats {
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.tcp-band-stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tcp-band-value {
  color: #fff9f0;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.tcp-band-label {
  margin-top: 2px;
  color: #c6b8af;
  font-size: 0.43rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.tcp-progress {
  margin-top: 5px;
}

.tcp-progress-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.tcp-progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: #5b4a42;
}

.tcp-progress-fill {
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: #d9875b;
  transition: width 220ms ease;
}

.tcp-keypad {
  min-height: 0;
  padding: 7px;
  border-radius: 8px;
  background: #fffdf9;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(40px, 1fr));
  gap: 6px;
}

.tcp-key {
  min-width: 0;
  min-height: 40px;
  padding: 0;
  border: 1px solid #d8c8b8;
  border-radius: 8px;
  background: #fff;
  color: #3e2723;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.tcp-key--pressed {
  border-color: #8b6a58;
  background: #d9c7b7;
  color: #2f1c13;
  box-shadow: inset 0 3px 6px rgba(65, 44, 32, 0.28), 0 0 0 2px rgba(198, 96, 63, 0.18);
  transform: translateY(2px) scale(0.96);
}

.tcp-count-tile--entered {
  border: 1px solid #d8b69f;
  background: #f3e4d8;
  box-shadow: inset 0 0 0 1px rgba(192, 96, 63, 0.08);
}

.tcp-count-value--entered {
  color: #9f4329;
}

.tcp-need-tile--active {
  border: 1px solid #963c25;
  background: #b94e2f;
  box-shadow: 0 2px 7px rgba(114, 48, 29, 0.22);
}

.tcp-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, 42px);
  gap: 6px;
}

.tcp-action {
  min-width: 0;
  padding: 0 5px;
  border: 1px solid #d8c8b8;
  border-radius: 8px;
  background: #fffdf9;
  color: #5d4c43;
  font: inherit;
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.15;
  cursor: pointer;
}

.tcp-action[data-add] span {
  display: block;
}

.tcp-clear {
  color: #c33c4f;
}

.tcp-next {
  border-color: #c6603f;
  background: #c6603f;
  color: #fff;
}

.tcp-next.tcp-pressed {
  background: #a94d31;
  box-shadow: inset 0 2px 4px rgba(58, 28, 17, 0.25);
  transform: translateY(1px);
}

.tcp-done {
  border-color: #f2d6c9;
  background: #f7dfd5;
  color: #b34f30;
}

.tcp-navigation {
  min-width: 0;
  padding: 7px;
  border-radius: 8px;
  background: #fffdf9;
  display: grid;
  gap: 6px;
}

.tcp-item-tape,
.tcp-room-tape {
  min-width: 0;
  display: flex;
  gap: 6px;
}

.tcp-item-tape {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.tcp-item-tape::-webkit-scrollbar {
  display: none;
}

.tcp-room-tape {
  overflow: hidden;
}

.tcp-tape-item {
  width: 82px;
  min-width: 82px;
  height: 55px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid #e0d4c6;
  border-radius: 7px;
  background: #fff;
  color: #66554c;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tcp-tape-item--active {
  border: 2px solid #c6603f;
  background: #fff9f4;
}

.tcp-tape-name {
  height: 2.25em;
  overflow: hidden;
  display: -webkit-box;
  color: #55443b;
  font-size: 0.6rem;
  line-height: 1.12;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tcp-tape-location {
  display: block;
  margin-top: 5px;
  padding-top: 3px;
  overflow: hidden;
  border-top: 1px solid #eadfd3;
  color: #8f8178;
  font-size: 0.5rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tcp-room-chip {
  min-width: 130px;
  height: 39px;
  padding: 0 9px;
  border: 1px solid #d8c8b8;
  border-radius: 8px;
  background: #fffaf4;
  color: #6a584f;
  font: inherit;
  font-size: 0.61rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.tcp-room-chip span {
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e9e1d8;
  color: #74635a;
  font-size: 0.53rem;
  line-height: 18px;
  text-align: center;
}

.tcp-room-chip--active {
  border-color: #6a574c;
  background: #5a493f;
  color: #fff;
}

.tcp-search-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 6px;
}

.tcp-search-shell {
  min-width: 0;
  height: 38px;
  border: 1px solid #d8c8b8;
  border-radius: 8px;
  background: #fff;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) 39px;
  align-items: center;
  overflow: hidden;
}

.tcp-search-icon {
  color: #5d6c77;
  font-size: 1rem;
  text-align: center;
}

.tcp-search {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #685850;
  font: inherit;
  font-size: 0.72rem;
}

.tcp-search::placeholder {
  color: #b3aca7;
  opacity: 1;
}

.tcp-upc {
  height: 100%;
  padding: 0;
  border: 0;
  border-left: 1px solid #eadfd3;
  background: #fff;
  cursor: pointer;
}

.tcp-barcode {
  display: inline-block;
  width: 19px;
  height: 18px;
  background: repeating-linear-gradient(90deg, #4e3c33 0 1px, transparent 1px 3px);
}

.tcp-add-item {
  height: 38px;
  padding: 0 5px;
  border: 1px solid #d8c8b8;
  border-radius: 8px;
  background: #fff;
  color: #58473e;
  font: inherit;
  font-size: 0.67rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.tcp-key:disabled,
.tcp-action:disabled,
.tcp-tape-item:disabled,
.tcp-room-chip:disabled,
.tcp-upc:disabled,
.tcp-add-item:disabled {
  opacity: 1;
  cursor: default;
  pointer-events: none;
}

.tcp-fine {
  margin-top: 6px;
  color: #806f64;
  font-size: 0.61rem;
  font-weight: 600;
  text-align: center;
}

.tcp-empty {
  height: 100%;
  padding: 24px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #6b5a50;
  text-align: center;
}

.tcp-summary {
  position: absolute;
  inset: 0;
  z-index: 5;
  padding: 24px;
  background: rgba(255, 253, 249, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.tcp-hidden {
  display: none;
}

.tcp-summary-line {
  color: #3e2723;
  font-family: 'Montserrat', 'Open Sans', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.tcp-summary-sub {
  color: #806f64;
  font-size: 0.75rem;
  font-weight: 700;
}

.tcp-key:focus-visible,
.tcp-action:focus-visible,
.tcp-tape-item:focus-visible,
.tcp-room-chip:focus-visible,
.tcp-upc:focus-visible,
.tcp-add-item:focus-visible,
.tcp-motion-toggle:focus-visible {
  outline: 3px solid #275d8c;
  outline-offset: 2px;
}

@keyframes tcpSlideExitLeft {
  from { transform: translateX(0); }
  to { transform: translateX(-105%); }
}

@keyframes tcpSlideEnterFromRight {
  from { transform: translateX(105%); }
  to { transform: translateX(0); }
}

.tcp-card.tcp-item-slide-exit .tcp-identity,
.tcp-card.tcp-item-slide-exit .tcp-countrow {
  animation: tcpSlideExitLeft 160ms ease forwards;
}

.tcp-card.tcp-item-slide-enter .tcp-identity,
.tcp-card.tcp-item-slide-enter .tcp-countrow {
  animation: tcpSlideEnterFromRight 160ms ease forwards;
}

@media (max-width: 380px) {
  .tcp-scene {
    padding: 6px;
    gap: 5px;
  }

  .tcp-item {
    font-size: 0.95rem;
  }

  .tcp-meta-value {
    font-size: 0.57rem;
  }

  .tcp-actions {
    gap: 5px;
  }
}

/* The preview can be narrower than the browser viewport when it shares a
   desktop row with templates and signup. Size against the phone itself so the
   complete room/search/UPC footer stays inside a 304px frame too. */
@container (max-width: 380px) {
  .tcp-scene {
    padding: 5px;
    grid-template-rows: auto auto auto minmax(145px, 1fr) auto auto;
    gap: 4px;
  }

  .tcp-identity { padding: 5px 6px 6px; }
  .tcp-item-heading { min-height: 32px; }
  .tcp-item { font-size: 0.93rem; }
  .tcp-meta-grid { margin-top: 4px; gap: 3px; }
  .tcp-meta-label { font-size: 0.5rem; }
  .tcp-meta-value { font-size: 0.6rem; }

  .tcp-countrow { min-height: 62px; gap: 5px; }
  .tcp-countrow--ordering { grid-template-columns: 58px 88px 58px; }
  .tcp-countrow--eop { grid-template-columns: 80px; }
  .tcp-metric { height: 58px; }
  .tcp-par-value,
  .tcp-need-value { font-size: 1.5rem; }
  .tcp-count-value { font-size: 2.2rem; }
  .tcp-count-value--long { font-size: 1.75rem; }
  .tcp-count-value--xlong { font-size: 1.25rem; }

  .tcp-game-band { min-height: 55px; padding: 5px 7px; }
  .tcp-band-cheer { font-size: 0.6rem; }
  .tcp-band-value { font-size: 0.75rem; }
  .tcp-band-label { font-size: 0.48rem; }
  .tcp-progress { margin-top: 4px; }

  .tcp-keypad {
    padding: 5px;
    grid-template-rows: repeat(4, minmax(32px, 1fr));
    gap: 4px;
  }
  .tcp-key { min-height: 32px; font-size: 0.96rem; }

  .tcp-actions {
    grid-template-rows: repeat(2, 38px);
    gap: 4px;
  }
  .tcp-action { font-size: 0.64rem; }

  .tcp-navigation { padding: 5px; gap: 4px; }
  .tcp-item-tape,
  .tcp-room-tape { gap: 4px; }
  .tcp-tape-item { width: 68px; min-width: 68px; height: 48px; padding: 4px; }
  .tcp-tape-name { font-size: 0.57rem; }
  .tcp-tape-location { margin-top: 3px; padding-top: 2px; font-size: 0.48rem; }
  .tcp-room-chip { min-width: 112px; height: 34px; font-size: 0.58rem; }
  .tcp-room-chip span { width: 16px; min-width: 16px; height: 16px; line-height: 16px; }
  .tcp-search-row { grid-template-columns: minmax(0, 1fr) 58px; gap: 4px; }
  .tcp-search-shell,
  .tcp-add-item { height: 34px; }
  .tcp-search { font-size: 0.66rem; }
  .tcp-add-item { font-size: 0.62rem; }
}

@container (max-width: 270px) {
  .tcp-actions { grid-template-rows: repeat(2, 34px); }
  .tcp-tape-item { height: 44px; }
  .tcp-room-chip,
  .tcp-search-shell,
  .tcp-add-item { height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .tcp-card.tcp-item-slide-exit .tcp-identity,
  .tcp-card.tcp-item-slide-exit .tcp-countrow,
  .tcp-card.tcp-item-slide-enter .tcp-identity,
  .tcp-card.tcp-item-slide-enter .tcp-countrow {
    animation: none;
  }

  .tcp-phone,
  .tcp-item-tape,
  .tcp-progress-fill,
  .tcp-key {
    transition: none;
  }

  .tcp-item-tape {
    scroll-behavior: auto;
  }
}
