/* ------------------------------------------------------- boarding pass --- */
.pass {
  position: relative;
  background: var(--pass);
  background-image: linear-gradient(160deg, var(--pass) 0 62%, var(--pass-2));
  color: var(--pass-ink);
  border: 1px solid var(--pass-rule);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  /* minmax(0,…) not 1fr: the barcode's bars cannot shrink, and an auto
     minimum would let them push the whole card wider than its own box. */
  grid-template-columns: minmax(0, 1fr);
}

/* the airline bar across the top */
.pass-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  padding: 11px clamp(14px, 3.6vw, 26px);
  background: var(--ink);
  color: var(--pass);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.pass-bar .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent);
  flex: 0 0 auto;
}
.pass-bar .grow { margin-left: auto; opacity: .72; letter-spacing: .12em; }

.pass-main { padding: clamp(16px, 4vw, 28px) clamp(14px, 3.6vw, 26px); }

/* OAX ✈ CDG */
.route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(6px, 2vw, 18px);
}
.port { min-width: 0; }
.port.to { text-align: right; }
.port-code {
  font-size: clamp(34px, 12vw, 62px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: .02em;
  margin: 0;
}
.port.from .port-code { color: var(--mx); }
.port.to   .port-code { color: var(--fr); }
/* Flex, not a plain line of text: the flag must be its own item that never
   shrinks, or a longer city name pushes it into the ellipsis and it vanishes. */
.port-city {
  font-size: clamp(11px, 3vw, 14px);
  color: var(--pass-soft);
  margin: 5px 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.port.to .port-city { justify-content: flex-end; }
.cityname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port-flag { flex: 0 0 auto; font-size: clamp(15px, 4vw, 19px); line-height: 1; }

.route-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--pass-soft);
}
.route-line {
  width: clamp(30px, 12vw, 96px);
  height: 1px;
  background: repeating-linear-gradient(90deg,
    currentColor 0 4px, transparent 4px 8px);
  opacity: .5;
}
.route-plane { font-size: clamp(17px, 5vw, 24px); line-height: 1; }
.route-km { font-size: 10px; letter-spacing: .1em; white-space: nowrap; }

/* the countdown */
.count-label {
  margin: clamp(18px, 4vw, 26px) 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--accent);
}
.count {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(4px, 1.6vw, 14px);
}
.unit {
  background: color-mix(in srgb, var(--pass-ink) 5%, transparent);
  border: 1px solid var(--pass-rule);
  border-radius: 9px;
  padding: clamp(7px, 2vw, 12px) 2px clamp(5px, 1.4vw, 9px);
  text-align: center;
  min-width: 0;
}
.unit-num {
  display: block;
  font-size: clamp(25px, 8.6vw, 50px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.01em;
}
.unit-num .d { display: inline-block; }
.unit-num .d.roll { animation: roll 260ms ease-out; }
@keyframes roll {
  0%   { transform: translateY(-42%); opacity: 0; }
  100% { transform: translateY(0);     opacity: 1; }
}
.unit-cap {
  display: block;
  margin-top: 4px;
  font-size: clamp(8px, 2.3vw, 10px);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pass-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pass.landed .unit-num { color: var(--ok); }

/* the printed detail grid */
.details {
  margin-top: clamp(16px, 4vw, 24px);
  padding-top: clamp(12px, 3vw, 18px);
  border-top: 1px dashed var(--pass-rule);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px clamp(10px, 3vw, 26px);
}
@media (min-width: 560px) { .details { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.field { min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field dt {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--pass-soft);
  margin: 0 0 3px;
}
.field dd {
  margin: 0;
  font-size: clamp(14px, 4vw, 17px);
  font-weight: 700;
  letter-spacing: .02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field dd.small { font-size: clamp(12px, 3.4vw, 14px); font-weight: 600; }
.chip-gate {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 5px;
  background: var(--ink);
  color: var(--pass);
  cursor: pointer;
  border: 0;
  font: inherit;
  font-weight: 700;
  touch-action: manipulation;
  min-height: 28px;
}
.chip-status {
  display: inline-block;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--ok);
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  min-height: 28px;
}
.chip-status.warn { color: var(--warn); }

/* the stub, torn off along a perforation */
.pass-stub {
  position: relative;
  min-width: 0;
  border-top: 1px dashed var(--pass-rule);
  padding: clamp(12px, 3vw, 18px) clamp(14px, 3.6vw, 26px);
  display: flex;
  align-items: center;
  gap: clamp(12px, 4vw, 26px);
  background: color-mix(in srgb, var(--pass-ink) 3.5%, transparent);
}
/* the two punched holes at the ends of the tear line */
.pass-stub::before, .pass-stub::after {
  content: "";
  position: absolute;
  top: -9px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--punch);
  border: 1px solid var(--pass-rule);
}
.pass-stub::before { left: -10px; }
.pass-stub::after  { right: -10px; }

.stub-codes { font-size: clamp(15px, 4.4vw, 19px); font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.stub-codes .arrow { color: var(--pass-soft); margin: 0 4px; }
.barcode {
  flex: 1 1 0;          /* the first thing to give way when the card narrows */
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: stretch;
  gap: 2px;
  overflow: hidden;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  touch-action: manipulation;
}
.barcode i { flex: 0 0 auto; background: var(--pass-ink); border-radius: .5px; }
.barcode.scan i { animation: scan 900ms ease-in-out; }
@keyframes scan {
  0%, 100% { opacity: 1; transform: scaleY(1); }
  50%      { opacity: .25; transform: scaleY(.7); }
}

@media (min-width: 720px) {
  .pass { grid-template-columns: minmax(0, 1fr) 220px; }
  .pass-main { grid-column: 1; }
  .pass-stub {
    grid-column: 2;
    grid-row: 2;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    border-top: 0;
    border-left: 1px dashed var(--pass-rule);
  }
  .pass-stub::before { left: -10px; top: -10px; }
  .pass-stub::after  { left: -10px; right: auto; top: auto; bottom: -10px; }
  .barcode { width: 100%; flex: 0 0 auto; height: 56px; }
}

