/* Round 3: the yard gets ground, depth and illustration.
   - Page canvas: poured concrete (warm grey, aggregate speckle, expansion joints) instead of flat light grey.
   - The desktop map is an asphalt yard: painted lanes, zone pads with hatched curbs in the zone colour, a quay-crane
     lattice shadow across the plan, and containers with corner castings, door ends, a second box under them
     (stack depth) and a hard cast shadow.
   - Phones get the same asphalt yard full-bleed under the sticky zone chips.
   - Below the map the five zone colours carry on: segmented zone strips on every panel, mini containers in the picks,
     zone-tinted rows, a zone strip on page heads and the footer.
   Loaded last (after bay.css), so it overrides earlier sheets without touching their markup. */

:root {
  --bg: #e2ded3;
  --bg-2: #d5d0c3;
  --surface: #f7f5ef;
  --line: #cdc7b8;
  --line-2: #b5ae9d;
  --muted: #5e6a6c;
  --paper-3: #cbc5b6;
  --line-soft: #d9d4c8;
  --ground: #cfcabe;
  --ground-2: #c4bfb2;
  --asphalt: #2b343a;
  --asphalt-2: #353f46;
  --safety: #f0b429;
  --paint: rgba(255, 255, 255, 0.7);
  --speckle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .08 0 0 0 0 .1 0 0 0 0 .12 0 0 0 1.1 -.55'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  --zones: linear-gradient(90deg, var(--c-research) 0 20%, var(--c-trading) 20% 40%, var(--c-markets) 40% 60%, var(--c-onchain) 60% 80%, var(--c-content) 80%);
  --zone-ribs: repeating-linear-gradient(90deg, rgba(10, 20, 28, 0.22) 0 2px, transparent 2px 6px);
}

/* ---------- the concrete canvas ---------- */
body { background-color: var(--bg); }
.col {
  background:
    var(--speckle),
    linear-gradient(90deg, rgba(60, 52, 40, 0.07) 1px, transparent 1px) 0 0 / 240px 240px,
    linear-gradient(rgba(60, 52, 40, 0.07) 1px, transparent 1px) 0 0 / 240px 240px,
    radial-gradient(120% 60% at 80% 0%, rgba(255, 255, 255, 0.5), transparent 60%),
    var(--bg);
}
.top { background: rgba(226, 222, 211, 0.9); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 0; box-shadow: 0 2px 0 var(--ink); }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 4px; background: var(--zones); opacity: 0.9; }

/* zone strip under page heads on every other page */
.page-head { border-bottom: 0; }
.page-head::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; border-radius: 1px; background: var(--zone-ribs), var(--zones); }
.page-head::after { bottom: -10px; }

/* ---------- the quay skyline (home header) ---------- */
.quay { position: relative; height: clamp(76px, 10vw, 136px); margin: 0 0 var(--s2); overflow: hidden; border-radius: 3px 3px 0 0; }
.quay svg { display: block; width: 100%; height: 100%; }
.q-sky { fill: none; }
.q-box rect:first-child { fill: var(--zc); }
.q-rib { fill: url(#q-rib); }
.q-door { stroke: rgba(10, 20, 28, 0.35); stroke-width: 1.4; fill: none; }
.z-research { --zc: var(--c-research); } .z-trading { --zc: var(--c-trading); } .z-markets { --zc: var(--c-markets); }
.z-onchain { --zc: var(--c-onchain); } .z-content { --zc: var(--c-content); }
.q-rtg path { stroke: var(--ink-2); stroke-width: 3; fill: none; }
.q-rtg rect { fill: var(--ink-2); } .q-rtg .q-cab { fill: var(--safety); }
.q-leg { stroke: var(--ink); stroke-width: 4; fill: none; stroke-linecap: square; }
.q-truss { color: var(--ink); }
.q-house { fill: var(--ink); }
.q-car { fill: var(--ink); }
.q-cable { stroke: var(--ink); stroke-width: 1.2; }
.q-spread { fill: var(--safety); }
.q-load rect:first-child { fill: var(--buoy); }
.q-quay { fill: var(--ink); }
.q-bollard { stroke: var(--safety); stroke-width: 2; stroke-dasharray: 18 14; }
.q-trolley { animation: q-run 16s cubic-bezier(0.55, 0, 0.35, 1) infinite; }
@keyframes q-run { 0%, 12% { transform: translateX(0); } 44%, 58% { transform: translateX(-250px); } 90%, 100% { transform: translateX(0); } }

/* ---------- the asphalt yard ---------- */
.ym-map.is-canvas {
  border: 0; border-radius: 0 0 4px 4px;
  background: var(--speckle), var(--asphalt);
  box-shadow: inset 0 0 0 1px #000, inset 0 18px 30px -18px rgba(0, 0, 0, 0.6), 0 20px 40px -28px rgba(15, 27, 34, 0.8);
}
.is-canvas .ym-plane {
  background:
    linear-gradient(var(--safety), var(--safety)) 0 18px / 100% 2px no-repeat,
    linear-gradient(var(--safety), var(--safety)) 0 23px / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, var(--paint) 0 28px, transparent 28px 56px) 0 50% / 100% 3px no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0 28px, transparent 28px 56px) 0 calc(100% - 18px) / 100% 2px no-repeat,
    var(--speckle),
    var(--asphalt-2);
}
/* the quay crane's lattice shadow falling across the plan */
.is-canvas .ym-plane::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none; top: -40px; bottom: -40px; left: 58%; width: 120px;
  background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.16) 0 3px, transparent 3px 22px), repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.16) 0 3px, transparent 3px 22px);
  box-shadow: inset 10px 0 0 rgba(0, 0, 0, 0.16), inset -10px 0 0 rgba(0, 0, 0, 0.16);
  transform: skewX(-8deg);
}
/* zone pads: poured concrete, a hatched curb in the zone colour, cast onto the asphalt */
.is-canvas .zone {
  z-index: 1; padding: 26px 18px 18px;
  background: var(--speckle), linear-gradient(180deg, #ddd8cc, #d1ccbf);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25), 8px 10px 0 rgba(0, 0, 0, 0.28);
}
.is-canvas .zone:not(.zone-gate)::before {
  left: 0; right: 0; top: 0; width: auto; height: 10px; border: 0; border-radius: 4px 4px 0 0;
  background: repeating-linear-gradient(-45deg, var(--cat) 0 9px, color-mix(in srgb, var(--cat) 55%, #0b1419) 9px 18px);
}
.is-canvas .zone::after { right: 6px; bottom: 6px; width: 14px; height: 14px; border-color: var(--safety); border-width: 3px; }
.is-canvas .zone-gate { background: var(--speckle), var(--surface); padding-top: 18px; }
.is-canvas .zone-gate::before { border-color: var(--safety); }
.is-canvas .zone-gate::after { border-color: var(--ink); }
.zone-head h2 { color: var(--ink); }
.zone-l { box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }

/* ---------- containers: castings, door end, a box under it, hard shadow ---------- */
.yb:not(.yb-open) {
  padding-right: 26px; background: transparent;
  box-shadow: 0 0 0 1px rgba(8, 16, 22, 0.5), 9px 11px 0 -1px rgba(10, 18, 24, 0.32);
}
.yb:not(.yb-open)::after {
  /* the box underneath in the stack: peeks out lower-right, darker */
  content: ""; position: absolute; z-index: -2; inset: 5px -5px -5px 5px; border-radius: 3px;
  background: var(--zone-ribs), color-mix(in srgb, var(--cat) 58%, #0b1419);
  box-shadow: 0 0 0 1px rgba(8, 16, 22, 0.55);
}
.yb:not(.yb-open)::before {
  /* the door end: darker band with two locking bars */
  content: ""; position: absolute; z-index: 0; top: 4px; bottom: 4px; right: 4px; width: 16px; border-radius: 1px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55)) 4px 0 / 2px 100% no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55)) 10px 0 / 2px 100% no-repeat,
    linear-gradient(rgba(8, 16, 22, 0.6), rgba(8, 16, 22, 0.6)) 0 30% / 100% 3px no-repeat,
    linear-gradient(rgba(8, 16, 22, 0.6), rgba(8, 16, 22, 0.6)) 0 70% / 100% 3px no-repeat,
    rgba(8, 16, 22, 0.28);
}
.yb-roof {
  background:
    /* corner castings */
    linear-gradient(#1b252b, #1b252b) 2px 2px / 8px 8px no-repeat,
    linear-gradient(#1b252b, #1b252b) calc(100% - 2px) 2px / 8px 8px no-repeat,
    linear-gradient(#1b252b, #1b252b) 2px calc(100% - 2px) / 8px 8px no-repeat,
    linear-gradient(#1b252b, #1b252b) calc(100% - 2px) calc(100% - 2px) / 8px 8px no-repeat,
    /* sheen and corrugation */
    linear-gradient(115deg, rgba(255, 255, 255, 0.2), transparent 38%, transparent 70%, rgba(0, 0, 0, 0.1)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 2px, rgba(0, 0, 0, 0.14) 2px 4px, transparent 4px 10px),
    linear-gradient(180deg, transparent 45%, rgba(8, 18, 24, 0.4)),
    var(--cat);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.2), inset 0 2px 0 4px rgba(255, 255, 255, 0.08);
}
.yb-plate, .yb-art, .yb-name, .yb-meta { position: relative; z-index: 1; }
.yb-plate { margin-left: 6px; }
.yb-art { border-radius: 50%; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.22), 0 0 0 5px rgba(255, 255, 255, 0.18); }
.yb:hover { box-shadow: 0 0 0 1px rgba(8, 16, 22, 0.5), 13px 17px 0 -1px rgba(10, 18, 24, 0.28); }
.yb.is-lift { box-shadow: 0 0 0 3px var(--buoy), 16px 22px 0 -2px rgba(10, 18, 24, 0.26); }
.yb:hover::after, .yb.is-lift::after { inset: 8px -8px -8px 8px; }
.yb::after { transition: inset 0.3s var(--ease); }
.yb-open { border-color: rgba(18, 32, 42, 0.35); background: repeating-linear-gradient(-45deg, rgba(18, 32, 42, 0.05) 0 8px, transparent 8px 16px); }

/* ---------- phones: the same asphalt yard, full bleed ---------- */
@media (max-width: 899px) {
  .ym-chips { background: rgba(226, 222, 211, 0.94); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
  .quay { margin: 0 calc(-1 * var(--s3)) 0; border-radius: 0; }
  .ym-map {
    margin: 0 calc(-1 * var(--s3)); padding: 22px var(--s3) 26px;
    background:
      linear-gradient(var(--safety), var(--safety)) 0 8px / 100% 2px no-repeat,
      linear-gradient(var(--safety), var(--safety)) 0 13px / 100% 2px no-repeat,
      var(--speckle), var(--asphalt-2);
  }
  .ym-plane { gap: 28px; }
  .zone { padding: 22px 12px 14px; border-radius: 4px; background: var(--speckle), linear-gradient(180deg, #ddd8cc, #d1ccbf); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25), 6px 8px 0 rgba(0, 0, 0, 0.3); }
  .zone:not(.zone-gate)::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 9px; border-radius: 4px 4px 0 0; background: repeating-linear-gradient(-45deg, var(--cat) 0 9px, color-mix(in srgb, var(--cat) 55%, #0b1419) 9px 18px); }
  .zone + .zone { padding-top: 22px; }
  .zone-boxes { gap: 14px 16px; }
  .zone-gate { background: var(--speckle), var(--surface); padding-top: 14px; }
}
@media (max-width: 520px) {
  .quay { margin: 0 calc(-1 * var(--s2)); }
  .ym-map { margin: 0 calc(-1 * var(--s2)); padding: 22px var(--s2) 24px; }
}
@media (max-width: 899px) and (min-width: 330px) { .yb:not(.yb-open) { padding-right: 24px; } }

/* ---------- the dock office (below the map): zone colours carry on ---------- */
.office { position: relative; }
.of-panel { position: relative; padding-top: calc(var(--s3) + 10px); background: var(--speckle), var(--surface); border-color: var(--line-2); box-shadow: 0 1px 0 rgba(18, 32, 42, 0.08), 8px 10px 0 rgba(30, 36, 34, 0.1); overflow: hidden; }
.of-panel::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--zone-ribs), var(--zones); }
.of-est::before { background: var(--zone-ribs), repeating-linear-gradient(-45deg, var(--ink) 0 10px, var(--safety) 10px 20px); }
.of-row { position: relative; padding: 10px 8px; margin: 0 -8px; border-radius: 3px; transition: background-color 0.2s; }
.of-row:hover { background: color-mix(in srgb, var(--cat) 10%, transparent); }
.of-row { grid-template-columns: auto 34px minmax(0, 1fr) auto auto; }
.of-sw {
  position: relative; width: 34px; height: 26px; border-radius: 2px;
  background:
    linear-gradient(#1b252b, #1b252b) 1px 1px / 4px 4px no-repeat, linear-gradient(#1b252b, #1b252b) calc(100% - 1px) 1px / 4px 4px no-repeat,
    linear-gradient(#1b252b, #1b252b) 1px calc(100% - 1px) / 4px 4px no-repeat, linear-gradient(#1b252b, #1b252b) calc(100% - 1px) calc(100% - 1px) / 4px 4px no-repeat,
    var(--zone-ribs), var(--cat);
  box-shadow: 3px 4px 0 color-mix(in srgb, var(--cat) 45%, #0b1419);
}
.of-name small { color: color-mix(in srgb, var(--cat) 70%, var(--ink)); font-weight: 600; }
.of-pr { padding: 4px 7px; border-radius: 2px; background: color-mix(in srgb, var(--cat) 14%, transparent); color: color-mix(in srgb, var(--cat) 65%, var(--ink)); }
.of-note { box-shadow: inset 6px 0 0 var(--cat); padding-left: 16px; background: color-mix(in srgb, var(--cat) 6%, transparent); border-radius: 0 3px 3px 0; }
.of-est input[type="range"] { accent-color: var(--petrol); }
.of-est .hm-est-total dd > span { color: var(--petrol-ink); }

/* ---------- footer: a row of containers along the quay edge ---------- */
.foot { border-top: 0; padding-top: 10px; background: var(--speckle), var(--bg-2); }
.foot::before { display: block; height: 10px; background: var(--zone-ribs), var(--zones); }

@media (prefers-reduced-motion: reduce) {
  .q-trolley { animation: none; }
  .yb::after, .of-row { transition: none; }
}

/* the plate's sticky offset only belongs to the wide layout; on narrow screens it pushed the plate over the text below */
@media (max-width: 999px) { .bay-plate { top: auto !important; } }

/* the board: each departure board wears a zone colour, ribbed like a container roof */
.bd .bd-board, .bd.bd-few .bd-board, .bd.bd-few .bd-side .bd-board { position: relative; border-top: 8px solid var(--bz, var(--buoy)); box-shadow: 8px 10px 0 rgba(30, 36, 34, 0.14); }
.bd .bd-board::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; background: var(--zone-ribs); pointer-events: none; }
[data-board="lb-week"] { --bz: var(--c-research); } [data-board="lb-all"] { --bz: var(--c-trading); }
[data-board="lb-rated"] { --bz: var(--c-markets); } [data-board="lb-creators"] { --bz: var(--c-onchain); }
