:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --ink: #161616;
  --muted: #5f6770;
  --accent: #63b9ea;
  --shadow: 0 18px 40px rgba(17, 33, 49, 0.08);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  overflow: hidden;
}

body {
  background: var(--bg);
  overscroll-behavior: none;
  touch-action: pan-x;
}

.app-shell {
  height: 100vh;
  padding:
    calc(14px + var(--safe-top))
    16px
    calc(34px + var(--safe-bottom));
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 6px;
  overflow: hidden;
}

.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  gap: 12px;
  min-height: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.card {
  scroll-snap-align: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0 4px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  overflow: hidden;
}

.barcode-name {
  margin: 0;
  font-weight: 700;
  font-size: clamp(2rem, 9vw, 3.5rem);
  line-height: 0.95;
  text-align: center;
  flex: 0 0 auto;
}

.barcode-panel {
  background: transparent;
  border-radius: 0;
  padding: 0;
  overflow: hidden;
  margin: auto 0;
  min-height: 0;
}

.barcode-svg {
  width: 100%;
  height: auto;
  max-height: calc(100vh - 120px - var(--safe-top) - var(--safe-bottom));
  display: block;
}

.pager {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-bottom: 8px;
  flex: 0 0 auto;
}

.pager button {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: rgba(22, 22, 22, 0.16);
}

.pager button[aria-current="true"] {
  width: 32px;
  background: var(--accent);
}

@media (min-width: 768px) {
  .app-shell {
    padding-left: max(32px, env(safe-area-inset-left, 0px));
    padding-right: max(32px, env(safe-area-inset-right, 0px));
  }

  .card {
    padding: 8px 4px;
  }
}
