/* ==========================================================================
   Trade dashboard, round 3 (src/features/trade/yard.js,
   public/assets/js/trade-yard.js): "Latest arrivals" and the container
   yard. Purple and white: ink text on paper, purple tints for the marks.
   ========================================================================== */

/* ---- Latest arrivals ---- */
.ab { margin: 0 0 var(--s-4); padding-bottom: var(--s-4); border-bottom: 1px solid var(--line); }
.ab-frame { position: relative; }
.ab-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; margin-bottom: var(--s-2); }
.ab-kicker { margin: 0; font-size: 0.84rem; color: var(--muted); }
.ab-clock { margin: 0 0 0 auto; font-size: 0.9rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ab-table { display: grid; border-top: 2px solid var(--ink); font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.ab-row { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) 6.5rem 6.5rem; gap: 0.75rem; align-items: baseline; padding: 0.5rem 0.25rem; border-bottom: 1px solid var(--line); }
.ab-colhead { padding-top: 0.55rem; padding-bottom: 0.45rem; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ab-num { text-align: right; }
.ab-sub { display: block; padding: 0.9rem 0.25rem 0.4rem; border-bottom: 1px solid var(--line); font-size: 0.8rem; font-weight: 600; color: var(--accent-dark); }
.ab-cell { display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); }
.ab-c-what { white-space: normal; }
.ab-c-code { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; color: var(--accent-dark); }
.ab-c-when { color: var(--muted); }
.ab-c-num { text-align: right; font-weight: 600; color: var(--ink); }
.ab-row.is-in, .ab-row.is-out { background: var(--mist); }
.ab-row.is-in .ab-c-num, .ab-row.is-out .ab-c-num { font-size: 1.05rem; }
.ab-clock .ab-cell { color: inherit; }
/* JS splits a cell into characters: digits roll, the rest fade in. */
.ab-cell.is-split { text-overflow: clip; }
.ab-f { display: inline; transition: opacity 0.3s ease; }
.ab-f.is-wait { opacity: 0; }
.ab-note { margin: 0.7rem 0 0; font-size: 0.78rem; line-height: 1.5; color: var(--muted); }
@media (max-width: 640px) {
  .ab-row { grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: 0.2rem 0.6rem; }
  .ab-row > .ab-c-when, .ab-colhead span:nth-child(3) { display: none; }
  .ab-row > .ab-c-what { white-space: normal; }
}

/* ---- Container yard (a light panel in both themes) ---- */
.yd { margin: 0 0 var(--s-4); padding-bottom: var(--s-4); border-bottom: 1px solid var(--line); }
.yd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 2.5vw, 2rem); }
.yd-panel { margin: 0; min-width: 0; overflow: hidden; background: #FFFFFF; color: #2A1B45; border: 1px solid #E4E1EA; border-top: 2px solid #2A1B45; }
.yd-panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 1rem; padding: 0.85rem 1rem 0.2rem; }
.yd-panel-head strong { font-family: var(--font-serif); font-weight: 500; font-size: 1.2rem; color: #2A1B45; }
.yd-panel-head span { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #5A3689; align-self: center; }
.yd-svg { display: block; width: 100%; height: auto; aspect-ratio: 360 / 300; background: linear-gradient(180deg, #FFFFFF 0%, #F6F2FB 100%); }
.yd-crane path { fill: none; stroke: #9C8AB8; stroke-width: 2; stroke-linecap: round; }
.yd-trolley { fill: #6E42A6; }
.yd-cable { stroke: #6E42A6; stroke-width: 1; }
.yd-crane .yd-trolley, .yd-crane .yd-cable { transform: translateX(var(--yd-tx, 180px)); transition: transform .35s cubic-bezier(.3,.7,.3,1); }
.yd-quay { fill: #2A1B45; }
.yd-box rect:first-child { stroke: rgba(42, 27, 69, 0.35); stroke-width: 0.8; }
.yd-ghost { fill: none; stroke: #9C8AB8; stroke-dasharray: 3 3; }
.yd-bayno { font: 600 11px var(--font); fill: #FFFFFF; }
.yd-box { transition: transform .5s cubic-bezier(.34,1.2,.5,1), opacity .2s; }
.yd.is-armed .yd-box:not(.is-down) { transform: translateY(-300px); opacity: 0; }
.yd-legend { list-style: none; margin: 0; padding: 0.5rem 1rem 0; counter-reset: yd; }
.yd-legend li { counter-increment: yd; display: grid; grid-template-columns: auto 1fr auto; gap: 0.6rem; align-items: baseline; padding: 0.4rem 0; border-top: 1px solid #ECE8F1; font-size: 0.88rem; }
.yd-chip { width: 1.4rem; height: 0.95rem; border-radius: 1px; align-self: center; font-size: 0.65rem; box-shadow: inset 0 0 0 1px rgba(42, 27, 69, 0.3); }
.yd-chip::before { content: counter(yd); display: block; text-align: center; line-height: 0.95rem; color: #FFFFFF; font-weight: 700; }
.yd-chip.is-light::before { color: #2A1B45; }
.yd-name { min-width: 0; color: #1C1C19; }
.yd-val { text-align: right; font-weight: 600; color: #2A1B45; font-variant-numeric: tabular-nums; white-space: nowrap; }
.yd-val small { display: block; font-weight: 400; font-size: 0.74rem; color: #5D5B54; }
.yd-foot { margin: 0; padding: 0.6rem 1rem 1rem; font-size: 0.78rem; color: #5D5B54; }
@media (max-width: 760px) { .yd-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) {
  .yd-box, .yd-crane .yd-trolley, .yd-crane .yd-cable, .ab-f { transition: none; }
}
