/* The month-end pile (sections/pile.js). One month plays twice as you scroll: before, each day's invoices land on
   the accountant's pile until month end; now, each night they go straight from the order system into the accounts and no pile forms.
   Example numbers only. Without JS: the caption and the two summary lines. */

.mp { --mp-paper: #fbfbfa; --mp-edge: #d9d9d6; --mp-desk: var(--ui-line); width: min(var(--wall), 100%); margin-top: 4rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mp { --mp-paper: #e9e9e6; --mp-edge: #9a9a96; } }
:root[data-theme="dark"] .mp { --mp-paper: #e9e9e6; --mp-edge: #9a9a96; }

.mp-track { position: relative; }
.mp.live .mp-track { height: 460vh; }
.mp-stage { position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 1.5rem; padding: 1.5rem 0; }
.mp.live .mp-stage { position: sticky; top: 0; height: 100svh; box-sizing: border-box; padding: 5.5rem 0 2rem; }

.mp-head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; flex-wrap: wrap; }
.mp-title { font-size: var(--t-heading); font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; min-height: 2.1em; }
.mp-title b { font-weight: 600; color: var(--muted); }
.mp-count { text-align: right; font-variant-numeric: tabular-nums; }
.mp-count .n { display: block; font-size: var(--t-head); font-weight: 600; letter-spacing: -0.04em; line-height: 0.9; }
.mp-count .l { display: block; margin-top: 0.5rem; font-size: var(--t-small); line-height: 1.3; color: var(--muted); }

/* the desk, seen from above at an angle */
.mp-scene { position: relative; min-height: 0; perspective: 1800px; overflow: hidden; }
.mp-plane {
  position: absolute; left: 50%; top: 64%; width: 1000px; height: 520px; transform-style: preserve-3d;
  transform: translate(-50%, -50%) scale(var(--s, 1)) rotateX(57deg) rotateZ(-24deg);
}
.mp-spot { position: absolute; width: 150px; height: 110px; margin: -55px 0 0 -75px; border-radius: 6px; background: color-mix(in srgb, var(--ink) 5%, transparent); }   /* tiles in a tone step, no outlines */
.mp-spot.desk { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.mp-label {
  position: absolute; left: 0; top: calc(100% + 14px); width: 260px; font: 600 clamp(17px, calc(9.5px / var(--s, 1)), 28px)/1.25 var(--font-sans); letter-spacing: -0.01em;
  color: var(--ink); white-space: nowrap;
}
.mp-label small { display: block; margin-top: 4px; font-size: clamp(14px, calc(7.5px / var(--s, 1)), 21px); color: var(--muted); letter-spacing: 0; font-weight: 500; }
.mp-wire { position: absolute; left: 245px; top: 260px; width: 510px; height: 1px; background: var(--mp-desk); transform-origin: left; }
.mp-run { position: absolute; left: 0; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #ff5a3c; box-shadow: 0 0 0 6px rgba(255, 90, 60, 0.16); opacity: 0; }

.mp-sheet {
  position: absolute; left: 0; top: 0; width: 110px; height: 76px; margin: -38px 0 0 -55px; box-sizing: border-box;
  background: var(--mp-paper); border: 1px solid var(--mp-edge);   /* taste-skill-ignore: the paper's own edge, part of the drawing */
  border-radius: 1px; padding: 9px 10px; opacity: 0;
  
  background-image: linear-gradient(#cfcfcb, #cfcfcb), linear-gradient(#e2e2de, #e2e2de), linear-gradient(#e2e2de, #e2e2de), linear-gradient(#e2e2de, #e2e2de);
  background-size: 34px 2px, 70px 2px, 56px 2px, 22px 2px; background-repeat: no-repeat;
  background-position: 66px 10px, 10px 30px, 10px 40px, 78px 58px;
  backface-visibility: hidden; will-change: transform, opacity;
}

/* the month */
.mp-ghost { background: none; border: 1px dashed var(--muted);   /* taste-skill-ignore: the outline of the pile that never forms */
  opacity: 0; will-change: auto; }
.mp-shadow { position: absolute; left: 0; top: 0; width: 220px; height: 170px; margin: -85px 0 0 -110px; border-radius: 50%; opacity: 0;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--ink) 22%, transparent), transparent); }

.mp-cal { display: grid; grid-template-columns: repeat(31, minmax(0, 1fr)); gap: 3px; }
.mp-cal i {
  position: relative; display: block; height: 30px; border-top: 2px solid var(--ui-line); font-size: 0.8125rem; line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums; font-style: normal;
  color: var(--muted); padding-top: 7px; text-align: center; transition: border-color 200ms, color 200ms;
}
.mp-cal i.on { border-color: var(--ink); color: var(--ink); }
.mp-cal i.run::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #ff5a3c; }
.mp-cal i:nth-child(odd):not(.on) { color: transparent; }

.mp-fallback { margin-top: 1rem; color: var(--muted); }
.mp.live .mp-fallback, .mp.still .mp-fallback { display: none; }

@media (max-width: 700px) {
  .mp.live .mp-stage { padding: 4.25rem 0 1.25rem; gap: 0.75rem; }
  .mp-head { gap: 0.5rem; }
  .mp-title { min-height: 2.2em; }
  .mp-count { display: flex; align-items: baseline; gap: 0.6rem; text-align: left; }
  .mp-count .n { font-size: var(--t-heading); }
  .mp-count .l { margin-top: 0; }
  .mp-plane { top: 63%; left: calc(50% + 8px); }
  .mp-label { font-size: clamp(17px, calc(11px / var(--s, 1)), 30px); }
  .mp-label small { font-size: clamp(14px, calc(8.5px / var(--s, 1)), 24px); }
  .mp-cal { gap: 1px; }
  .mp-cal i { font-size: 0.8125rem; height: 24px; }
  .mp-cal i:not(:first-child):not(:last-child) { color: transparent; }
}
