/* BAHAMUT COMMERCE — Cold-Crate Dispatch Board */

.page-support.a29-cd {
  background: var(--a29-cream);
}

/* —— Dock hero —— */
.a29-cd-dock {
  position: relative;
  padding: 0 0 3.5rem;
  background: var(--a29-ink);
  color: var(--a29-white);
  overflow: hidden;
}

.a29-cd-dock-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
  padding: 0.55rem 1rem;
  background: var(--a29-emerald-dark);
  border-bottom: 2px solid var(--a29-mustard);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.a29-cd-dock-bar span:nth-child(odd) {
  color: var(--a29-mustard);
}

.a29-cd-dock-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 2.5rem;
  align-items: center;
  padding-top: 2.5rem;
}

.a29-cd-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--a29-mustard);
}

.a29-cd-title {
  margin: 0 0 0.75rem;
  font-family: var(--a29-font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.05;
  max-width: 14ch;
}

.a29-cd-title em {
  font-style: italic;
  color: var(--a29-mustard);
}

.a29-cd-lede {
  margin: 0 0 1.25rem;
  max-width: 44ch;
  font-size: 0.92rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.78);
}

.a29-cd-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.a29-cd-signals li span {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

/* Gauge */
.a29-cd-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.a29-cd-gauge-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 0.5rem;
}

.a29-cd-gauge-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.a29-cd-gauge-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 6;
}

.a29-cd-gauge-fill {
  fill: none;
  stroke: var(--a29-emerald-light);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: calc(327 - (327 * var(--a29-cd-step, 0) / 4));
  transition: stroke-dashoffset 0.6s ease;
}

.a29-cd-gauge.is-miss .a29-cd-gauge-fill {
  stroke: var(--a29-tomato);
  stroke-dashoffset: calc(327 - 82);
}

.a29-cd-gauge.is-idle .a29-cd-gauge-fill {
  stroke: rgba(255, 255, 255, 0.25);
  stroke-dashoffset: 327;
}

.a29-cd-gauge-tick {
  position: absolute;
  inset: 38%;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.2);
}

.a29-cd-gauge-temp {
  font-family: var(--a29-font-display);
  font-size: 1.75rem;
  line-height: 1;
  color: var(--a29-mustard);
}

.a29-cd-gauge-label {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.a29-cd-gauge-code {
  margin-top: 0.35rem;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.45);
}

.a29-cd-barcode {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  opacity: 0.35;
  background:
    repeating-linear-gradient(
      90deg,
      var(--a29-white) 0,
      var(--a29-white) 2px,
      transparent 2px,
      transparent 4px,
      var(--a29-white) 4px,
      var(--a29-white) 5px,
      transparent 5px,
      transparent 9px
    );
  mask-image: linear-gradient(to top, black, transparent);
}

/* —— Board —— */
.a29-cd-board {
  padding: 2rem 0 3rem;
  margin-top: -1.5rem;
  position: relative;
  z-index: 2;
}

.a29-cd-board-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

/* Scanner terminal */
.a29-cd-scanner {
  background: #0a1210;
  border: 2px solid var(--a29-emerald-dark);
  box-shadow: 8px 8px 0 rgba(20, 20, 20, 0.12);
  position: sticky;
  top: 130px;
}

.a29-cd-scanner-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--a29-emerald-dark);
  color: var(--a29-white);
}

.a29-cd-scanner-head strong {
  display: block;
  font-size: 0.82rem;
}

.a29-cd-scanner-head small {
  font-size: 0.65rem;
  opacity: 0.72;
  letter-spacing: 0.06em;
}

.a29-cd-scanner-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--a29-mustard);
  box-shadow: 0 0 8px var(--a29-mustard);
  animation: a29-cd-pulse 2s ease infinite;
}

@keyframes a29-cd-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.a29-cd-scanner-screen {
  position: relative;
  padding: 1.25rem 1rem 1rem;
  overflow: hidden;
}

.a29-cd-scanner-lines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(11, 110, 79, 0.04) 3px,
    rgba(11, 110, 79, 0.04) 4px
  );
  pointer-events: none;
}

.a29-cd-scanner-prompt {
  position: relative;
  margin: 0 0 1rem;
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.72rem;
  line-height: 1.5;
  color: rgba(18, 138, 101, 0.85);
}

.a29-cd-form {
  position: relative;
  display: grid;
  gap: 0.85rem;
}

.a29-cd-field label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
}

.a29-cd-field label span {
  padding: 0.1rem 0.35rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--a29-emerald);
  color: var(--a29-white);
}

.a29-cd-field input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid rgba(18, 138, 101, 0.45);
  background: rgba(0, 0, 0, 0.35);
  color: var(--a29-white);
  font-family: ui-monospace, 'Cascadia Code', monospace;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.a29-cd-field input::placeholder {
  color: rgba(255, 255, 255, 0.28);
}

.a29-cd-field input:focus {
  border-color: var(--a29-mustard);
  box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}

.a29-cd-submit {
  width: 100%;
  justify-content: center;
  margin-top: 0.25rem;
}

.a29-cd-scanner-error {
  position: relative;
  margin: 1rem 0 0;
  padding: 0.65rem 0.75rem;
  font-size: 0.75rem;
  color: #ffb4a8;
  background: rgba(228, 87, 46, 0.15);
  border-left: 3px solid var(--a29-tomato);
}

.a29-cd-scanner-foot {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Chain wrap */
.a29-cd-chain-wrap {
  background: var(--a29-white);
  border: 1px solid var(--a29-linen);
  box-shadow: var(--a29-shadow);
  padding: 1.5rem 1.5rem 1.75rem;
  min-height: 480px;
}

.a29-cd-chain-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px dashed var(--a29-linen);
}

.a29-cd-chain-head h2 {
  margin: 0;
  font-family: var(--a29-font-display);
  font-size: 1.35rem;
  color: var(--a29-emerald-dark);
}

.a29-cd-chain-state {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  background: var(--a29-linen);
  color: var(--a29-muted);
}

.a29-cd-chain-state.is-found {
  background: var(--a29-emerald);
  color: var(--a29-white);
}

.a29-cd-chain-state.is-miss {
  background: var(--a29-tomato);
  color: var(--a29-white);
}

/* Vertical crate chain */
.a29-cd-chain {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.25rem;
  padding-left: 2.5rem;
  --a29-cd-step: 0;
}

.a29-cd-hose {
  position: absolute;
  left: 1.15rem;
  top: 1.5rem;
  bottom: 1.5rem;
  width: 4px;
  background: var(--a29-linen);
  border-radius: 4px;
}

.a29-cd-hose::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: calc(var(--a29-cd-step) / 4 * 100%);
  background: linear-gradient(180deg, var(--a29-emerald), var(--a29-mustard));
  border-radius: 4px;
  transition: height 0.55s ease;
}

.a29-cd-crate {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 88px;
}

.a29-cd-crate-face {
  flex: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 0.1rem 0.65rem;
  padding: 0.85rem 1rem;
  background: var(--a29-cream);
  border: 2px solid var(--a29-linen);
  border-left: 4px solid var(--a29-emerald);
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}

.a29-cd-crate-code {
  grid-row: 1 / -1;
  align-self: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--a29-muted);
}

.a29-cd-crate-face strong {
  font-size: 0.92rem;
  color: var(--a29-ink);
}

.a29-cd-crate-face small {
  font-size: 0.72rem;
  color: var(--a29-muted);
}

.a29-cd-crate-face em {
  grid-column: 2;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--a29-emerald);
}

.a29-cd-crate-slot {
  position: absolute;
  left: -2.05rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--a29-white);
  border: 3px solid var(--a29-linen);
  z-index: 1;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}

.a29-cd-crate.is-done .a29-cd-crate-face {
  background: rgba(11, 110, 79, 0.06);
  border-left-color: var(--a29-emerald);
}

.a29-cd-crate.is-done .a29-cd-crate-slot {
  background: var(--a29-emerald);
  border-color: var(--a29-emerald);
}

.a29-cd-crate.is-active .a29-cd-crate-face {
  background: var(--a29-white);
  border-color: var(--a29-mustard);
  border-left-color: var(--a29-mustard);
  transform: translateX(6px);
  box-shadow: var(--a29-shadow);
}

.a29-cd-crate.is-active .a29-cd-crate-slot {
  background: var(--a29-mustard);
  border-color: var(--a29-mustard);
  box-shadow: 0 0 0 4px rgba(255, 193, 7, 0.25);
}

.a29-cd-crate.is-ghost .a29-cd-crate-face {
  opacity: 0.45;
  border-style: dashed;
}

.a29-cd-crate.is-ghost .a29-cd-crate-slot {
  opacity: 0.5;
}

/* Thermal receipt */
.a29-cd-receipt {
  margin-top: 1.5rem;
  max-width: 340px;
  margin-left: auto;
  background: #f4f0e8;
  border: 1px solid #d8d0c4;
  padding: 0 1.15rem 1.15rem;
  transform: rotate(1deg);
  box-shadow: 3px 4px 0 rgba(20, 20, 20, 0.08);
}

.a29-cd-receipt-tear {
  height: 8px;
  margin: 0 -1.15rem 1rem;
  background:
    radial-gradient(circle at 6px 0, transparent 5px, #f4f0e8 5px) 0 0 / 12px 8px repeat-x;
}

.a29-cd-receipt-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px dashed #c4baa8;
}

.a29-cd-receipt-head span {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--a29-muted);
}

.a29-cd-receipt-head strong {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  word-break: break-all;
  text-align: right;
}

.a29-cd-receipt-rows {
  margin: 0 0 0.85rem;
  display: grid;
  gap: 0.35rem;
}

.a29-cd-receipt-rows div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.78rem;
}

.a29-cd-receipt-rows dt {
  color: var(--a29-muted);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}

.a29-cd-receipt-rows dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.a29-cd-receipt-bar {
  height: 36px;
  margin-bottom: 0.85rem;
  background:
    repeating-linear-gradient(
      90deg,
      var(--a29-ink) 0,
      var(--a29-ink) 1px,
      transparent 1px,
      transparent 3px
    );
  opacity: 0.65;
}

.a29-cd-receipt-btn {
  width: 100%;
  justify-content: center;
  font-size: 0.72rem;
}

/* Empty states */
.a29-cd-empty {
  text-align: center;
  padding: 1.5rem 1rem 0.5rem;
}

.a29-cd-empty.is-idle {
  margin-top: 0.5rem;
  padding-top: 0;
}

.a29-cd-empty-icon {
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: 2px dashed var(--a29-linen);
  color: var(--a29-emerald);
}

.a29-cd-empty-stamp {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--a29-tomato);
  border: 3px double var(--a29-tomato);
  transform: rotate(-8deg);
  opacity: 0.85;
}

.a29-cd-empty h3 {
  margin: 0 0 0.45rem;
  font-family: var(--a29-font-display);
  font-size: 1.15rem;
  color: var(--a29-emerald-dark);
}

.a29-cd-empty p {
  margin: 0 auto;
  max-width: 36ch;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--a29-muted);
}

.a29-cd-empty-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--a29-emerald);
}

/* Bento shortcuts */
.a29-cd-bento {
  padding: 0 0 4rem;
}

.a29-cd-bento-head {
  text-align: center;
  margin-bottom: 1.5rem;
}

.a29-cd-bento-head h2 {
  margin: 0 0 0.35rem;
  font-family: var(--a29-font-display);
  font-size: 1.5rem;
  color: var(--a29-emerald-dark);
}

.a29-cd-bento-head p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--a29-muted);
}

.a29-cd-bento-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}

.a29-cd-bento-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1rem 0.85rem;
  background: var(--a29-white);
  border: 1px solid var(--a29-linen);
  border-top: 3px solid var(--a29-emerald);
  transition: transform 0.2s, box-shadow 0.2s, border-top-color 0.2s;
}

.a29-cd-bento-card:nth-child(2) { border-top-color: var(--a29-mustard); }
.a29-cd-bento-card:nth-child(3) { border-top-color: var(--a29-tomato); }
.a29-cd-bento-card:nth-child(4) { border-top-color: var(--a29-emerald-dark); }
.a29-cd-bento-card:nth-child(5) { border-top-color: var(--a29-muted); }
.a29-cd-bento-card:nth-child(6) { border-top-color: var(--a29-emerald-light); }

.a29-cd-bento-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--a29-shadow);
}

.a29-cd-bento-code {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 0.15rem 0.4rem;
  background: var(--a29-linen);
  color: var(--a29-ink);
}

.a29-cd-bento-card strong {
  font-size: 0.82rem;
  color: var(--a29-ink);
}

/* —— Responsive —— */
@media (max-width: 1024px) {
  .a29-cd-dock-grid {
    grid-template-columns: 1fr;
  }

  .a29-cd-gauge {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    text-align: left;
  }

  .a29-cd-gauge-ring {
    margin-bottom: 0;
  }

  .a29-cd-board-grid {
    grid-template-columns: 1fr;
  }

  .a29-cd-scanner {
    position: static;
  }

  .a29-cd-bento-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .a29-cd-chain {
    grid-template-columns: 1fr;
    padding-left: 2rem;
  }

  .a29-cd-receipt {
    max-width: none;
    transform: none;
  }

  .a29-cd-bento-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .a29-cd-dock-bar {
    gap: 0.35rem 0.85rem;
    letter-spacing: 0.16em;
  }
}
