/* Palit customer dashboard (demo). Builds on styles.css tokens. Mobile first. */

.page-app {
  --app-top-h: 98px;
  --fetch: #1c1b19;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.muted {
  color: var(--ink-2);
}
.muted-sm {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}
.opt {
  color: var(--muted);
  font-weight: 400;
}

/* ---------- top bar ---------- */
.app-top {
  position: sticky;
  top: 0;
  z-index: 60;
}
.demo-banner {
  background: var(--ink);
  color: #efe8da;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.demo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.app-header {
  background: rgba(247, 244, 238, 0.88);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.app-nav {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-nav .wordmark {
  margin-right: auto;
}
.app-links {
  display: none;
}
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  flex: none;
}
.icon-btn:hover {
  background: var(--surface);
  border-color: var(--ink);
}
.demo-menu {
  position: relative;
}
.demo-panel {
  position: absolute;
  right: 0;
  top: 52px;
  width: min(320px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  display: grid;
  gap: 8px;
}
.demo-panel[hidden] {
  display: none;
}
.dp-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.dp-label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}
.dp-hint {
  font-size: 12.5px;
  color: var(--muted);
}
.dp-link {
  font-size: 14px;
  color: var(--ink-2);
  text-align: center;
  padding: 6px;
}
.dseg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-tint);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}
.dseg button {
  min-height: 40px;
  border: 0;
  background: transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink-2);
}
.dseg button[aria-pressed='true'] {
  background: var(--ink);
  color: #fff;
}

@media (min-width: 820px) {
  .app-links {
    display: flex;
    gap: 4px;
    margin-right: 8px;
  }
  .app-links a {
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ink-2);
    padding: 8px 14px;
    border-radius: 999px;
  }
  .app-links a:hover,
  .app-links a.is-on {
    color: var(--ink);
    background: rgba(28, 27, 25, 0.06);
  }
  .app-search-btn {
    display: none;
  }
}

/* ---------- layout ---------- */
.app-view {
  padding-top: 28px;
  padding-bottom: 72px;
  min-height: 70vh;
}
.app-view h1:focus {
  outline: none;
}
.app-foot {
  padding-bottom: 40px;
}
.has-addbar .app-foot {
  padding-bottom: 120px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card + .card {
  margin-top: 16px;
}
.card-h {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 10px;
}
.h2s {
  font-family: var(--font-display);
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.03em;
}
.page-h {
  font-size: clamp(32px, 6vw, 48px);
  margin: 6px 0 10px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
}
.back-link:hover {
  color: var(--ink);
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-ink);
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}
.empty-state {
  max-width: 520px;
  margin: 8vh auto;
  text-align: center;
  display: grid;
  gap: 16px;
  justify-items: center;
}
.empty-state h1 {
  font-size: clamp(28px, 5vw, 40px);
}
.empty-state p {
  color: var(--ink-2);
}

/* ---------- status chips ---------- */
.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: var(--bg-tint);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.status-ok {
  background: #e4f0e6;
  color: #2c5e3a;
  border-color: #c9e0ce;
}
.status-accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: #efcdb8;
}

/* ---------- buttons ---------- */
.btn-fetch {
  background: var(--ink);
  color: #fff;
  letter-spacing: 0.14em;
  font-family: var(--font-display);
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}
.btn-fetch:hover {
  background: #000;
}
.btn-fetch.btn-lg {
  min-height: 60px;
  padding: 0 44px;
  font-size: 18px;
}
.btn-fetch.btn-sm {
  letter-spacing: 0.12em;
  box-shadow: none;
}
.btn-accent[disabled] {
  background: #e6dfd2;
  color: var(--muted);
  box-shadow: none;
}
.btn.danger {
  color: #a03418;
  border-color: #e4c5b9;
}
.btn.danger[data-armed] {
  background: #a03418;
  color: #fff;
  border-color: #a03418;
}

/* ---------- forms ---------- */
.f-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.f-field label {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.f-field input,
.f-field select,
.name-input,
.search-form input,
.add-row input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 16px; /* no iOS zoom */
  appearance: none;
  -webkit-appearance: none;
}
.f-field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
}
.f-field input:focus-visible,
.f-field select:focus-visible,
.name-input:focus-visible,
.search-form input:focus-visible,
.add-row input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.f-row {
  display: grid;
  gap: 12px;
}
.f-row.three {
  grid-template-columns: 1.6fr 0.6fr 1fr;
}
.cat-field input[hidden] {
  display: none;
}
.cat-field input {
  margin-top: 0;
}

/* ---------- dashboard ---------- */
.dash-hero {
  padding: 8px 0 32px;
  max-width: 820px;
}
.dash-hero h1 {
  font-size: clamp(36px, 7.5vw, 68px);
  letter-spacing: -0.045em;
  line-height: 0.98;
}
.hero-sub {
  margin-top: 16px;
  font-size: 17px;
  color: var(--ink-2);
  max-width: 56ch;
}
.progress-wrap {
  margin-top: 26px;
  max-width: 560px;
}
.progress {
  height: 12px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.progress-label {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
  font-size: 15px;
}
.progress-label span {
  color: var(--muted);
  font-size: 13.5px;
}
.hero-cta {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}
.hero-cta .btn {
  flex: 1 1 200px;
  max-width: 320px;
}
.hero-cta .btn-fetch {
  flex: 0 1 auto;
}
.hero-hint {
  flex: 1 1 220px;
  font-size: 14px;
  color: var(--muted);
}

.dash-grid {
  display: grid;
  gap: 20px;
}
.pallet-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.pallet-head .card-h {
  margin-bottom: 2px;
}
.dash-stage {
  position: relative;
  aspect-ratio: 1 / 0.92;
  max-height: min(480px, 52vh);
  min-height: 260px;
  width: 100%;
  border-radius: var(--r-md);
  background: radial-gradient(120% 90% at 50% 18%, #fffdf9 0%, #f3eee4 55%, #e9e2d4 100%);
  border: 1px solid var(--line);
  overflow: hidden;
  touch-action: pan-y;
}
.dash-stage .stage-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.dash-stage.no-webgl {
  aspect-ratio: auto;
  min-height: 120px;
  display: grid;
  place-items: center;
}
.stage-note {
  position: absolute;
  left: 12px;
  bottom: 10px;
  font-size: 12.5px;
  color: var(--muted);
  pointer-events: none;
}
.no-webgl .stage-note {
  position: static;
  padding: 24px;
  text-align: center;
}
.stage-pick {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: rgba(255, 253, 249, 0.94);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 8px 6px 16px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.stage-pick[hidden] {
  display: none;
}
.stage-pick span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stage-pick a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  flex: none;
}
.facts {
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.facts dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts dd {
  margin: 2px 0 0;
  font-weight: 500;
  font-size: 15.5px;
}
.facts small {
  color: var(--muted);
  font-weight: 400;
}
.dash-side {
  display: grid;
  gap: 16px;
  align-content: start;
}
.dash-side .card + .card {
  margin-top: 0;
}
.search-form {
  position: relative;
  margin: 4px 0 10px;
}
.search-form svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-form input {
  padding-left: 44px;
}
.search-form.big input {
  min-height: 60px;
  font-size: 18px;
  border-radius: 18px;
}
.search-form.big svg {
  left: 16px;
}
.activity li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
}
.activity li:first-child {
  border-top: 0;
  padding-top: 0;
}
.activity time {
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  padding-top: 2px;
}
.mini-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  padding: 8px 0;
}
.mini-list small {
  display: block;
  color: var(--muted);
}

@media (min-width: 960px) {
  .dash-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }
  .card {
    padding: 24px;
  }
  .pallet-card {
    position: sticky;
    top: calc(var(--app-top-h) + 16px);
  }
}

/* ---------- box grid ---------- */
.boxes-section {
  margin: 8px 0;
}
.section-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 18px;
}
.bcards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
@media (min-width: 520px) {
  .bcards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.box-card {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  min-height: 108px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.box-card:hover,
.box-card:focus-within,
.box-card.is-selected {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.box-card.is-selected {
  background: #fffaf4;
}
.box-card.is-empty {
  background: transparent;
  border-style: dashed;
  border-color: var(--line-strong);
  box-shadow: none;
}
.box-card.is-empty .box-info h3 a {
  color: var(--muted);
  font-weight: 500;
}
.box-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: -0.04em;
  color: var(--accent-ink);
  min-width: 38px;
  line-height: 1.1;
}
.box-num.sm {
  font-size: 15px;
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  display: inline-grid;
  place-items: center;
  flex: none;
  letter-spacing: -0.02em;
}
.box-info {
  min-width: 0;
  flex: 1;
}
.box-info h3 {
  font-size: 17px;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.box-link {
  text-decoration: none;
}
.box-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-md);
}
.box-link:focus-visible {
  outline: none;
}
.box-card:has(.box-link:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.box-info p {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 2px;
}
.box-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.box-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  display: inline-grid;
  place-items: center;
}
.box-check svg {
  width: 14px;
  height: 14px;
}
.box-fetch {
  position: relative;
  z-index: 2;
  margin-left: auto;
  flex: none;
}

/* ---------- box detail ---------- */
.box-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.pn {
  display: flex;
  gap: 8px;
}
.box-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 16px;
  align-items: center;
  margin: 8px 0 24px;
}
.box-badge {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--ink);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.04em;
  display: grid;
  place-items: center;
}
.box-title {
  min-width: 0;
}
.name-input {
  border: 1px solid transparent;
  background: transparent;
  padding: 0 8px;
  margin-left: -8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(24px, 5vw, 36px);
  letter-spacing: -0.03em;
  min-height: 48px;
}
.name-input:hover {
  border-color: var(--line-strong);
}
.name-input::placeholder {
  color: var(--muted);
}
.box-title .muted-sm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.code {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.saved {
  color: var(--ok);
  font-weight: 600;
}
.box-head-cta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.box-head-cta .btn {
  flex: 1 1 200px;
}
.box-cols {
  display: grid;
  gap: 24px;
}
.count {
  color: var(--muted);
  font-weight: 500;
}
.items {
  display: grid;
  gap: 8px;
}
.items-empty {
  display: grid;
  gap: 4px;
  padding: 28px 20px;
  text-align: center;
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--ink-2);
}
.items-empty span {
  font-size: 14.5px;
  color: var(--muted);
}
.item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  scroll-margin: 140px;
}
.item.is-open {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.item.flash {
  animation: flash 1.8s ease-out;
}
@keyframes flash {
  0%,
  40% {
    background: var(--accent-soft);
    border-color: var(--accent);
  }
}
.item-main {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 14px 12px 16px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.item-text strong {
  font-weight: 600;
  font-size: 16px;
}
.item-desc,
.item-note {
  font-size: 13.5px;
  color: var(--muted);
}
.item-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  align-self: flex-start;
}
.item-chev {
  color: var(--muted);
  transition: transform 0.15s ease;
}
.is-open .item-chev {
  transform: rotate(180deg);
}
.tag {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg-tint);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.tag-ghost {
  background: transparent;
}
.item-edit {
  display: grid;
  gap: 12px;
  padding: 4px 16px 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.item-edit[hidden] {
  display: none;
}
.edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.edit-actions .upload-btn {
  margin-right: auto;
}
.box-aside .card + .card {
  margin-top: 16px;
}
.upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.upload-btn {
  cursor: pointer;
}
.upload-btn:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.media-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-tint);
  border: 1px solid var(--line);
}
.media-tile img,
.media-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media-ph {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}
.media-rm {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: rgba(28, 27, 25, 0.78);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* sticky add bar */
.add-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  background: rgba(255, 253, 249, 0.96);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-strong);
  box-shadow: 0 -8px 30px rgba(28, 27, 25, 0.08);
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
}
@media (min-width: 720px) {
  .add-more {
    grid-template-columns: 2fr 1fr 2fr;
    align-items: end;
  }
}
.add-bar > * {
  max-width: 1200px;
  margin-inline: auto;
}
.add-more {
  display: grid;
  gap: 10px;
  padding-bottom: 10px;
  max-height: 46vh;
  overflow: auto;
}
.add-more[hidden] {
  display: none;
}
.add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.add-row input {
  flex: 1;
  min-height: 54px;
}
.add-row .btn {
  min-height: 54px;
  padding: 0 20px;
}
.add-toggle svg {
  transition: transform 0.15s ease;
}
.add-toggle.is-open svg {
  transform: rotate(180deg);
}
.has-addbar .app-view {
  padding-bottom: 140px;
}
.has-addbar .toasts {
  bottom: 96px;
}

@media (min-width: 960px) {
  .box-head {
    grid-template-columns: auto 1fr auto;
  }
  .box-head-cta {
    grid-column: auto;
    flex-wrap: nowrap;
  }
  .box-head-cta .btn {
    flex: none;
  }
  .box-cols {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
  }
  .box-aside {
    position: sticky;
    top: calc(var(--app-top-h) + 16px);
  }
}

/* ---------- label ---------- */
.label-page {
  max-width: 720px;
}
.label-sheet {
  margin-top: 16px;
  background: #fff;
  color: #000;
  border: 2px solid #1c1b19;
  border-radius: 14px;
  padding: 22px;
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
}
.label-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.045em;
}
.label-brand span {
  color: var(--accent);
}
.label-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(88px, 22vw, 150px);
  line-height: 0.9;
  letter-spacing: -0.06em;
  margin-top: 6px;
}
.label-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin-top: 10px;
}
.label-right {
  display: grid;
  gap: 8px;
  justify-items: start;
  align-content: center;
}
.label-qr {
  width: min(220px, 60vw);
}
.label-qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.label-code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.04em;
}
.label-meta {
  font-size: 13px;
  color: #444;
}
.center-left {
  margin-top: 14px;
}
@media (min-width: 560px) {
  .label-sheet {
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
  }
}

@media print {
  @page {
    margin: 0.4in;
  }
  body {
    background: #fff;
  }
  .app-top,
  .app-foot,
  .skip,
  .toasts,
  .no-print,
  .add-bar {
    display: none !important;
  }
  .app-view {
    padding: 0;
    min-height: 0;
  }
  .label-page {
    max-width: none;
  }
  .label-sheet {
    width: 6in;
    min-height: 4in;
    margin: 0;
    border-radius: 0;
    grid-template-columns: 1.1fr 1fr;
    break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .label-num {
    font-size: 110px;
  }
}

/* ---------- search ---------- */
.search-page {
  max-width: 760px;
}
.search-page .search-form {
  margin: 14px 0 22px;
}
.res-count {
  margin-bottom: 10px;
}
.results {
  display: grid;
  gap: 8px;
}
.result {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  min-height: 64px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.result:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.result svg {
  margin-left: auto;
  color: var(--muted);
  flex: none;
}
.res-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.res-text strong {
  font-weight: 600;
  font-size: 16.5px;
}
.res-text small {
  color: var(--muted);
  font-size: 13.5px;
}
.why {
  font-size: 14px;
  color: var(--ink-2);
}
mark {
  background: #f9dcc7;
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}
.search-empty {
  padding: 28px 4px;
  color: var(--ink-2);
}

/* ---------- radios / pickers ---------- */
.radio-list {
  display: grid;
  gap: 10px;
}
.radio-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  min-height: 56px;
}
.radio-card:has(input:checked) {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.radio-card:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.radio-card input {
  margin-top: 4px;
  width: 20px;
  height: 20px;
  accent-color: var(--ink);
  flex: none;
}
.radio-body {
  display: grid;
  gap: 2px;
  font-size: 14.5px;
}
.radio-body strong {
  font-size: 15.5px;
}
.newaddr {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 16px;
  background: var(--bg-tint);
  border-radius: 16px;
}
.newaddr[hidden] {
  display: none;
}

/* ---------- wizard / FETCH ---------- */
.wizard {
  max-width: 760px;
}
.wizard.wide {
  max-width: 1040px;
}
.stepper {
  display: flex;
  gap: 6px;
  margin: 22px 0 26px;
  overflow-x: auto;
}
.stepper li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  flex: 1;
  white-space: nowrap;
}
.stepper li span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  border: 1.5px solid var(--line-strong);
  font-size: 13px;
  flex: none;
}
.stepper li.is-now {
  color: var(--ink);
}
.stepper li.is-now span {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.stepper li.is-done span {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.stepper b {
  font-weight: 600;
}
@media (max-width: 559px) {
  .stepper li:not(.is-now) {
    flex: none;
  }
  .stepper li:not(.is-now) b {
    display: none;
  }
  .stepper li.is-now {
    flex: 1;
  }
}
.stepper svg {
  width: 14px;
  height: 14px;
}
.step-h {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.step-body {
  min-height: 200px;
  padding-bottom: 12px;
}
.pick-list {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}
.pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  min-height: 64px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  cursor: pointer;
}
.pick.is-on {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}
.pick.is-covered {
  opacity: 0.55;
}
.pick:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.pick input {
  width: 22px;
  height: 22px;
  accent-color: var(--ink);
  flex: none;
}
.pick-body {
  display: grid;
  gap: 1px;
}
.pick-body span {
  font-size: 13.5px;
  color: var(--muted);
}
.pick-pallet {
  background: var(--bg-tint);
}
.review-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.review {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}
.review header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.review h3 {
  font-size: 18px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips li {
  font-size: 13.5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg-tint);
  border: 1px solid var(--line);
}
.step-foot {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--bg) 70%, rgba(247, 244, 238, 0));
  padding: 18px 0 calc(16px + env(safe-area-inset-bottom));
  display: grid;
  gap: 12px;
}
.fee-peek {
  font-size: 14.5px;
  color: var(--ink-2);
}
.fee-peek strong {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.step-btns {
  display: flex;
  gap: 10px;
}
.step-btns .btn {
  flex: 1;
}
.step-btns .btn-fetch {
  flex: 2;
  letter-spacing: 0.04em;
  box-shadow: none;
}
.summary {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.card.summary {
  margin-top: 0;
}
.sum-list {
  margin: 0;
  display: grid;
  gap: 12px;
}
.sum-list dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sum-list dd {
  margin: 2px 0 0;
  font-size: 15.5px;
}
.fee-box {
  background: var(--bg-tint);
  border-radius: 16px;
  padding: 16px;
}
.fee-tag {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 10px;
}
.fee-lines li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
  padding: 4px 0;
}
.fee-lines .strike {
  text-decoration: line-through;
  color: var(--muted);
}
.fee-lines .waived {
  color: var(--ok);
  font-weight: 600;
}
.fee-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--line-strong);
  margin-top: 8px;
  padding-top: 10px;
  font-weight: 600;
}
.fee-total strong {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: -0.03em;
}
.warn {
  font-size: 14px;
  background: #fbefe2;
  border: 1px solid #efcdb8;
  color: #6b3412;
  border-radius: 12px;
  padding: 12px 14px;
}

/* tracker */
.track-card {
  margin: 22px 0 18px;
}
.track {
  display: grid;
  gap: 0;
}
.track-step {
  display: flex;
  gap: 14px;
  position: relative;
  padding-bottom: 22px;
}
.track-step:last-child {
  padding-bottom: 0;
}
.track-step::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 2px;
  width: 2px;
  background: var(--line-strong);
}
.track-step:last-child::before {
  display: none;
}
.track-step.is-done::before {
  background: var(--ok);
}
.track-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  flex: none;
  z-index: 1;
}
.track-step.is-done .track-dot {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.track-step.is-now .track-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.track-text {
  display: grid;
  gap: 1px;
  padding-top: 4px;
}
.track-text span {
  font-size: 14px;
  color: var(--muted);
}
.track-step:not(.is-done):not(.is-now) .track-text strong {
  color: var(--muted);
  font-weight: 500;
}
.track-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.track-actions .btn {
  flex: 1 1 200px;
}

/* pickup */
.pk-grid {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}
.pk-main .card + .card {
  margin-top: 16px;
}
.date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin: 8px 0 10px;
}
.date-chip input,
.win-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.date-chip,
.win-chip {
  position: relative;
}
.date-chip span {
  display: grid;
  justify-items: center;
  gap: 0;
  padding: 10px 4px;
  min-height: 78px;
  align-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  line-height: 1.2;
}
.date-chip small {
  font-size: 12px;
  color: var(--muted);
}
.date-chip strong {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.03em;
}
.win-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.win-chip span {
  display: grid;
  place-items: center;
  min-height: 56px;
  padding: 6px;
  text-align: center;
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}
.date-chip input:checked + span,
.win-chip input:checked + span {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
.date-chip input:checked + span small {
  color: #d9d3c5;
}
.date-chip input:focus-visible + span,
.win-chip input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (min-width: 960px) {
  .pk-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
    gap: 28px;
    align-items: start;
  }
  .pk-side {
    position: sticky;
    top: calc(var(--app-top-h) + 16px);
  }
}

/* ---------- toasts ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 90;
  display: grid;
  gap: 8px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 14.5px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.25s ease;
  transition: opacity 0.4s ease;
}
.toast.error {
  background: #8f2e12;
}
.toast.out {
  opacity: 0;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress span,
  .toast,
  .item.flash,
  .item-chev,
  .add-toggle svg {
    animation: none;
    transition: none;
  }
}
