/* The warehouse map (stations.js): the floor as a plan - three lines of doors and 核对 under them, the five books below.
 * Each line has its colour; a door not built yet is dashed and carries the step that builds it. */
:root {
  --mp-in: #1766a8; --mp-in-soft: #dbe9f5; --mp-stock: #8a5a1f; --mp-stock-soft: #f1e6d4;
  --mp-out: #13794d; --mp-out-soft: #d9eee2; --mp-check: #5b3fa8; --mp-check-soft: #e7e1f5;
  --mp-tape: #f4be1a; --mp-tape-ink: #1c1a10;
}
@media (prefers-color-scheme: dark) {
  :root {
    --mp-in: #74b7ee; --mp-in-soft: #1b3347; --mp-stock: #ddaa6a; --mp-stock-soft: #3a2c19;
    --mp-out: #62cf9e; --mp-out-soft: #143427; --mp-check: #bba9f2; --mp-check-soft: #2c2548;
  }
}

.mp { display: grid; gap: 18px; }
.mp-head { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: flex-end; justify-content: space-between; }
.mp-head h1 { margin: 0; font-size: 26px; }
.mp-head p { margin: 2px 0 0; }
.mp-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); }
.mp-seg button { border: 0; background: none; color: var(--text-2); font: inherit; font-size: 14px; padding: 5px 14px; border-radius: 7px; cursor: pointer; }
.mp-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgb(20 24 34 / .16); }
.mp-alert { padding: 10px 14px; border-radius: var(--radius); background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.mp-alert span { display: block; font-weight: 400; font-size: 13px; }

.mp-floor { display: grid; grid-template-columns: 56px repeat(5, minmax(0, 1fr)); gap: 20px 16px; padding: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.mp-lane { grid-column: 1; display: flex; align-items: center; justify-content: center; writing-mode: vertical-rl;
  font-size: 14px; font-weight: 800; letter-spacing: .14em; border-radius: 8px; }
.mp-lane.in { background: var(--mp-in-soft); color: var(--mp-in); }
.mp-lane.stock { background: var(--mp-stock-soft); color: var(--mp-stock); }
.mp-lane.out { background: var(--mp-out-soft); color: var(--mp-out); }
.mp-lane.check { background: var(--mp-check-soft); color: var(--mp-check); }
.mp-note { align-self: center; font-size: 13px; color: var(--text-3); }

.mp-door { --c: var(--mp-in); --cs: var(--mp-in-soft); position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px;
  align-content: start; min-height: 136px; min-width: 0; padding: 12px; text-align: left; font: inherit; color: var(--text); text-decoration: none;
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s; }
.mp-door.stock { --c: var(--mp-stock); --cs: var(--mp-stock-soft); }
.mp-door.out { --c: var(--mp-out); --cs: var(--mp-out-soft); }
.mp-door.check { --c: var(--mp-check); --cs: var(--mp-check-soft); }
a.mp-door:hover { transform: translateY(-2px); border-color: var(--c); box-shadow: 0 8px 22px rgb(20 24 34 / .12); }
a.mp-door:active { transform: scale(.985); }
.mp-door:focus-visible { outline: 3px solid var(--c); outline-offset: 2px; }
.mp-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--cs); color: var(--c); }
.mp-ic svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.mp-num { justify-self: end; text-align: right; line-height: 1.1; }
.mp-num b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.mp-num span { font-size: 12px; color: var(--text-3); }
.mp-name { grid-column: 1 / -1; margin-top: 6px; font-size: 19px; font-weight: 800; line-height: 1.25; }
.mp-name i { font-style: normal; font-weight: 400; font-size: 13px; color: var(--text-3); margin-left: 3px; }
.mp-one { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-3); line-height: 1.4; }
.mp-flags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mp-flags em { font-style: normal; font-size: 12px; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 6px; }
.mp-flags .late { background: var(--bad-soft); color: var(--bad); }
.mp-flags .problem { background: var(--warn-soft); color: var(--warn); }
.mp-flags .info { background: none; padding: 4px 0; font-weight: 400; color: var(--text-3); }
.mp-door.soon { background: transparent; border-style: dashed; cursor: help; }
.mp-door.soon .mp-ic { background: var(--surface-2); color: var(--text-3); }
.mp-door.soon .mp-name { color: var(--text-2); }
.mp-door.soon:hover { border-color: var(--text-3); }
.mp-door[aria-expanded="true"] { border-color: var(--mp-tape); border-style: solid; }
.mp-step { font-style: normal; justify-self: end; font-size: 11.5px; font-weight: 700; line-height: 1; padding: 4px 7px; border-radius: 6px;
  background: var(--mp-tape); color: var(--mp-tape-ink); }
.mp-door.wide { grid-column: 2 / -1; min-height: 0; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; }
.mp-door.wide .mp-name, .mp-door.wide .mp-one, .mp-door.wide .mp-flags { grid-column: auto; margin: 0; }
.mp-soon { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 16px; border-radius: 10px;
  border: 1.5px solid var(--mp-tape); background: var(--surface); }
.mp-soon b { font-size: 15px; }
.mp-soon span { color: var(--text-2); flex: 1 1 260px; }

.mp-books { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.mp-books h2 { grid-column: 1 / -1; margin: 6px 0 0; font-size: 17px; }
.mp-book { display: grid; gap: 6px; align-content: start; min-width: 0; padding: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.mp-book b { font-size: 16px; }
.mp-book p { margin: 0; font-size: 13px; color: var(--text-3); }
.mp-book nav { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13.5px; }
.mp-book a { color: var(--accent); text-decoration: none; font-weight: 600; }
.mp-book a:hover { text-decoration: underline; }

@media (max-width: 860px) { .mp-books { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mp-books .mp-book:last-child { grid-column: 1 / -1; } }
@media (max-width: 720px) {
  .mp-floor { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; }
  .mp-floor > * { grid-column: auto !important; grid-row: auto !important; }
  .mp-floor > .mp-lane { grid-column: 1 / -1 !important; writing-mode: horizontal-tb; padding: 3px; font-size: 13px; margin-top: 4px; }
  .mp-note, .mp-one { display: none; }
  .mp-door { min-height: 0; padding: 9px 8px; }
  .mp-ic { width: 32px; height: 32px; }
  .mp-num b { font-size: 20px; }
  .mp-num span { display: none; }
  .mp-name { font-size: 16px; }
  .mp-door.wide { grid-column: 1 / -1 !important; grid-template-columns: auto auto minmax(0, 1fr) auto; }
}
@media (prefers-reduced-motion: reduce) { .mp-door { transition: none; } a.mp-door:hover { transform: none; } }
