/* Meridians, every width (owner, 2026-11-29: the phone layout on desktop too). Phones: phone.css moves the circles into
   the sheet at the foot; wider screens: the channel row itself (#rail) becomes the circles at the stage's foot. */
/* A picked channel's points: a rail of codes down the body's free edge (phone-rail.js mirrors the sheet's buttons, which
   hide), on a line in the channel's colour; it scrolls on long channels and stops above the sheet or a point's card. */
.app.mer #merPanel .pts { display: none; }
.stage > .prail { position: absolute; z-index: 4; top: 64px; bottom: calc(var(--shr-b, 12px) - 2px); inset-inline-start: 6px; width: 66px; margin: 0;
  display: flex; flex-direction: column; flex-wrap: nowrap; align-items: center; gap: 6px; padding: 14px 0 40px; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none; transition: bottom .2s; mask-image: linear-gradient(#0000, #000 14px, #000 calc(100% - 26px), #0000); }
.stage > .prail::-webkit-scrollbar { display: none; }
.stage > .prail[hidden], .app:not(.mer) .stage > .prail, .stage:has(.flow-in) > .prail { display: none; }
.stage > .mer-pill[hidden], .stage:has(.flow-in) > .mer-pill { display: none; }
@media (max-width: 1024px) { .stage > .mer-pill { display: none; } } /* phones fold the sheet into their own pill (phone-pill.js) */
.stage > .prail::before { content: ""; position: absolute; z-index: -1; top: 0; left: 50%; translate: -50%; width: 3px; height: var(--rail-h, 100%); background: var(--c); opacity: .55; }
.stage > .prail button { flex: none; min-width: 54px; min-height: 32px; padding: 0 6px; border: 2px solid var(--c); border-radius: 10px; background: #141a30e0;
  color: #eef0fa; font-size: 11.5px; box-shadow: 0 2px 8px #0007; }
.stage > .prail button.on { background: #00c76a; border-color: #fff; color: #141826; box-shadow: 0 0 0 3px #00c76a55; }
/* The codes swell and whiten in turn with the body's points (phone-rail.js; explorer.js skips it with reduced motion). */
.stage > .prail button.sweep { animation: prail-sweep var(--sw-ms, 320ms) ease-in-out var(--sw-d, 0ms) both; }
@keyframes prail-sweep {
  50% { scale: 1.18; background: color-mix(in srgb, var(--c) 35%, #fff); color: #141826; border-color: #fff; box-shadow: 0 0 12px 2px var(--c); }
}

/* A line from the picked code on the rail to its point on the body (phone-rail.js). */
/* case.css has its own .pline (a card row): its padding, border and margin are reset or the line lands 11px right, 9px low. */
.stage > .pline { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; pointer-events: none; overflow: visible; display: block; margin: 0; padding: 0; border: 0; }
.stage > .pline line { stroke: var(--c); stroke-width: 2; stroke-dasharray: 5 4; stroke-linecap: round; filter: drop-shadow(0 1px 2px #000a); }
.stage > .pline circle { fill: var(--c); stroke: #fff; stroke-width: 1.5; }

@media (min-width: 1025px) {
  /* No points card or "SP · 21 points" button: the rail lists the points, the magnifier searches. The flow film keeps both. */
  .app.app.mer:not(:has(.stage .flow-in)) > aside, .app.mer .stage:not(:has(.flow-in)) > #merList { display: none; }
  .stage > .prail { top: 16px; bottom: 150px; inset-inline-start: 14px; width: 74px; }
  /* A point's card runs along the foot, centred, in the circles' place (as on phones); the body is drawn above it. */
  .app.mer .stage > #pfloat[data-at="foot"] { top: 52%; bottom: 16px; left: 50%; right: auto; translate: -50% 0; width: min(640px, calc(100% - 220px)); max-height: none; }
  .app.mer .stage > #pfloat.pf-min[data-at="foot"] { top: auto; }
  .app.app.mer:has(#pfloat:not([hidden]):not(.pf-min)) > .rail { display: none; }
  /* ...and a pill names the picked channel instead (mer-pill.js), at the foot of the part the card leaves free; a tap folds the card. */
  .stage > .mer-pill { position: absolute; z-index: 5; bottom: 16px; inset-inline-start: calc(var(--card-w, min(400px, 42%)) + (100% - var(--card-w, min(400px, 42%))) / 2); translate: -50% 0;
    display: flex; align-items: center; gap: 10px; max-width: calc(100% - var(--card-w, min(400px, 42%)) - 120px); height: 46px; min-height: 0; padding: 0 14px 0 8px;
    border: 1px solid #ffffff30; border-radius: 999px; background: #141a30cc; backdrop-filter: blur(12px); box-shadow: 0 6px 20px #0006; color: #fff;
    font: 700 14.5px "Plus Jakarta Sans", Heebo, system-ui, sans-serif; cursor: pointer; }
  [dir="rtl"] .stage > .mer-pill { translate: 50% 0; }
  .stage > .mer-pill:hover { background: #141a30f0; }
  .stage > .mer-pill .mp-n { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; font-size: 11px; font-weight: 800; }
  .stage > .mer-pill .mp-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stage > .mer-pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
  /* Meridians on a computer (owner, 2026-11-30): a point's card is a dock down the start side, the points rail beside
     it and the body drawn in the space left (d-orbit.html split). Folded, only its title bar stays at the top. */
  .app.app.mer .stage > #pfloat { top: 0; bottom: 0; inset-inline-start: 0; left: auto; right: auto; inset-inline-end: auto; translate: none;
    width: var(--card-w, min(400px, 42%)); max-width: 70%; max-height: none; border-radius: 0; border-width: 0; border-inline-end: 1px solid var(--line, #dde1e8); box-shadow: 4px 0 24px #0003; overflow-y: auto; }
  [dir="rtl"] .app.app.mer .stage > #pfloat { box-shadow: -4px 0 24px #0003; }
  /* Its inner edge widens or narrows it (card-resize.js sets --card-w on the stage). */
  .app.app.mer .stage > #pfloat.pf-edge, .app.app.mer .stage > #pfloat.pf-resizing { cursor: ew-resize; border-inline-end: 3px solid var(--indigo, #4b5bdc); }
  .app.app.mer .stage > #pfloat.pf-resizing { user-select: none; }
  .app.app.mer .stage > #pfloat.pf-min { top: 0; bottom: auto; } /* top too: the foot rule's top: auto left it below the stage */
  .app.mer .stage:has(> #pfloat:not([hidden]):not(.pf-min)) > .prail { inset-inline-start: calc(var(--card-w, min(400px, 42%)) + 14px); }
  .stage > .prail button { min-width: 60px; min-height: 34px; font-size: 12px; }

  /* The channels: circles ringed in their colour, two rows of seven at the foot, each yin above its yang partner; the
     pregnancy toggle, Hide meridians and Reset on a row under them. */
  .app.app.mer > .rail { align-self: end; justify-self: center; display: grid; grid-template-columns: repeat(7, 40px); justify-content: center; gap: 8px 14px;
    width: auto; margin: 0 0 16px; padding: 0; }
  .app.app.mer > .rail > :not(button[style], .preg-t, [data-mer="threads"], [data-mer="clear"]) { display: none; }
  .app.app.mer > .rail button[style] { display: grid; place-items: center; width: 40px; height: 40px; min-height: 0; padding: 0; border: 2px solid var(--c);
    border-radius: 50%; background: #141a30cc; box-shadow: 0 2px 8px #0008; color: #f2f4fb; opacity: 1; }
  .app.app.mer > .rail button[style] > :is(i, span) { display: none; }
  .app.app.mer > .rail button[style] b { font: 700 11px "Plus Jakarta Sans", system-ui, sans-serif; color: inherit; }
  .app.app.mer > .rail button[style] b { min-width: 0; text-align: center; line-height: 1; text-box: trim-both cap alphabetic; } /* the capitals in the middle whatever font the device draws */
  .app.app.mer > .rail button[style]:hover { background: #141a30f0; }
  .app.app.mer > .rail button[style].on { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 2px 8px #0008; }
  .app.app.mer > .rail button[style].on[aria-current] { box-shadow: 0 0 0 2px #fff, 0 2px 8px #0008; }
  .app.app.mer > .rail:has(button.on) button[style]:not(.on) { opacity: .8; }
  .app.app.mer > .rail > :is(.preg-t, [data-mer="threads"], [data-mer="clear"]) { order: 15; grid-row: 3; height: 32px; min-height: 0; background: #141a30cc; }
  .app.app.mer > .rail > .preg-t { grid-column: 1 / 4; justify-self: start; border: 1px dashed #f08a2499; background: #f08a2414; color: #ffd28a; }
  .app.app.mer > .rail > .preg-t[aria-pressed="true"] { border-style: solid; border-color: #f08a24; background: #f08a24; color: #1a1206; }
  .app.app.mer > .rail > [data-mer="threads"] { grid-column: 4; justify-self: center; }
  .app.app.mer > .rail > [data-mer="clear"] { order: 16; grid-column: 7; justify-self: center; width: 32px; padding: 0; border-radius: 50%; }
  .app.app.mer > .rail [data-mer="LU"] { order: 1; } .app.app.mer > .rail [data-mer="SP"] { order: 2; } .app.app.mer > .rail [data-mer="HT"] { order: 3; }
  .app.app.mer > .rail [data-mer="KI"] { order: 4; } .app.app.mer > .rail [data-mer="PC"] { order: 5; } .app.app.mer > .rail [data-mer="LR"] { order: 6; }
  .app.app.mer > .rail [data-mer="CV"] { order: 7; } .app.app.mer > .rail [data-mer="LI"] { order: 8; } .app.app.mer > .rail [data-mer="ST"] { order: 9; }
  .app.app.mer > .rail [data-mer="SI"] { order: 10; } .app.app.mer > .rail [data-mer="BL"] { order: 11; } .app.app.mer > .rail [data-mer="TW"] { order: 12; }
  .app.app.mer > .rail [data-mer="GB"] { order: 13; } .app.app.mer > .rail [data-mer="GV"] { order: 14; }
  .app.app.mer:has(.stage .flow-in) > .rail { display: none; } /* the film's controls list the channels */
}
