/* Map picker: providers x time. Pills morph into cards (morph-pill-card port);
   the weights switch is a glass lens (glass-tabs port). */

.mpk { position: fixed; inset: 0; z-index: 200; background: #000b; backdrop-filter: blur(6px); display: flex; padding: 20px; animation: mpk-in .18s ease; }
@keyframes mpk-in { from { opacity: 0; } }
.mpk-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--ln2); border-radius: 18px; overflow: hidden; box-shadow: 0 40px 120px #000; }

/* ---- header ---- */
.mpk-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 18px 14px 22px; background: var(--s1); border-bottom: 1px solid var(--ln); }
.mpk-titles { margin-right: auto; min-width: 0; }
.mpk-titles h2 { margin: 0; display: flex; align-items: center; gap: .55rem; font: 800 1.9rem/1 var(--display); text-transform: uppercase; letter-spacing: -.005em; }
.mpk-side { display: inline-grid; place-items: center; width: 1.15em; height: 1.15em; border-radius: 50%; background: var(--side); color: #140d07; font-size: .7em; }
.mpk-titles p { margin: .35rem 0 0; color: var(--tx2); font-size: .86rem; }
.mpk-search { position: relative; display: flex; align-items: center; flex: 0 1 300px; min-width: 200px; }
.mpk-search svg { position: absolute; left: 12px; width: 17px; height: 17px; fill: none; stroke: var(--tx2); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.mpk-search input { width: 100%; height: 44px; padding: 0 12px 0 38px; border-radius: 999px; border: 1px solid var(--ln2); background: var(--bg); color: var(--tx); font: 500 .95rem Inter, sans-serif; }
.mpk-search input::placeholder { color: var(--tx2); }
.mpk-search input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 22%, transparent); }
.mpk-search input::-webkit-search-cancel-button { filter: invert(.7); }
.mpk-search kbd { position: absolute; right: 14px; font: 600 .68rem var(--mono); color: var(--tx2); opacity: 0; transition: opacity .15s; pointer-events: none; }
.mpk-search input:not(:placeholder-shown) ~ kbd { opacity: 1; }
.mpk-search input:not(:placeholder-shown) { padding-right: 132px; }
.mpk-tabs { flex: none; }
.mpk-ran { display: inline-flex; align-items: center; gap: .55rem; height: 44px; padding: 0 1rem 0 .6rem; border-radius: 999px; border: 1px solid var(--ln2); background: var(--bg); color: var(--tx2); font-size: .86rem; font-weight: 550; white-space: nowrap; transition: border-color .15s, color .15s; }
.mpk-ran b { color: var(--tx); font-weight: 650; }
.mpk-ran:hover { border-color: var(--tx2); color: var(--tx); }
.mpk-ran .sw { position: relative; width: 30px; height: 18px; border-radius: 999px; background: var(--s3); box-shadow: inset 0 0 0 1px var(--ln2); transition: background .2s; }
.mpk-ran .sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--tx2); transition: translate .2s var(--mp-spring), background .2s; }
.mpk-ran[aria-pressed="true"] { border-color: var(--acc); color: var(--tx); }
.mpk-ran[aria-pressed="true"] .sw { background: var(--acc); }
.mpk-ran[aria-pressed="true"] .sw::after { translate: 12px 0; background: var(--acc-ink); }
.mpk-x { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--ln2); background: var(--bg); }
.mpk-x:hover { border-color: var(--tx2); background: var(--s2); }
.mpk-x svg { width: 18px; height: 18px; stroke: var(--tx); stroke-width: 2.2; stroke-linecap: round; fill: none; }

.mpk-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 9px 22px; border-bottom: 1px solid var(--ln); background: var(--s1); color: var(--tx2); font-size: .76rem; }
.mpk-legend > span { display: inline-flex; align-items: center; gap: .4rem; }
.mpk-legend .dot { width: .5rem; height: .5rem; color: inherit; background: currentColor; }
.mpk-legend .dot[class*="v-"] { background: none; }
.mpk-legend .dot.v-positive { background: var(--pos); } .mpk-legend .dot.v-mixed { background: var(--mix); } .mpk-legend .dot.v-negative { background: var(--neg); }
.mpk-legend .dot.v-neutral { background: var(--neu); } .mpk-legend .dot.v-unknown { background: var(--unk); }
.lg { width: 22px; height: 11px; border-radius: 999px; display: inline-block; }
.lg-open { background: #e9dfd2; }
.lg-closed { box-shadow: inset 0 0 0 1.5px var(--tx2); }
.lg-keys { margin-left: auto; }

/* ---- glass tabs ---- */
.gt { position: relative; flex-shrink: 0; user-select: none; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.gt canvas { position: absolute; pointer-events: none; }
.gt-tab { position: absolute; top: 0; height: 100%; border: 0; border-radius: 999px; background: none; color: transparent; font-weight: 600; white-space: nowrap; padding: 0; }
.gt-tab:focus-visible { outline: 2px solid var(--acc); outline-offset: -5px; }
.gt-lens { display: none; }
.gt-fallback { border-radius: 999px; background: #0006; box-shadow: inset 0 3px 8px #000a, 0 1px 0 #fff1; }
.gt-fallback canvas { display: none; }
.gt-fallback .gt-lens { display: block; position: absolute; border-radius: 999px; background: #f2eadf; box-shadow: inset 0 0 0 1px #fff, inset 0 -6px 14px #0002, 0 6px 16px #0006; transition: left .35s cubic-bezier(.3, 1.4, .5, 1), width .35s cubic-bezier(.3, 1.4, .5, 1); }
.gt-fallback .gt-tab { color: var(--tx2); }
.gt-fallback .gt-tab[aria-selected="true"] { color: var(--acc-ink); }

/* ---- map grid ---- */
.mpk-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; --lab: 178px; scrollbar-color: var(--ln2) transparent; }
.mpk-content { position: relative; width: calc(var(--lab) + var(--tw, 2000px)); padding-bottom: 260px; min-height: 100%;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(var(--mw) - 1px), color-mix(in srgb, var(--ln) 55%, transparent) calc(var(--mw) - 1px) var(--mw));
  background-position: var(--lab) 0; background-size: calc(100% - var(--lab)) 100%; background-repeat: no-repeat; }
.mpk-axis { position: sticky; top: 0; z-index: 12; display: flex; height: 34px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ln); }
.mpk-corner { position: sticky; left: 0; z-index: 2; width: var(--lab); flex: none; padding: 9px 0 0 22px; background: var(--bg); border-right: 1px solid var(--ln); color: var(--tx2); font: 600 .72rem var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.mpk-months { position: relative; flex: none; width: var(--tw); }
.mpk-months span { position: absolute; top: 0; height: 100%; padding: 10px 0 0 6px; border-left: 1px solid var(--ln); color: var(--tx2); font: 500 .7rem var(--mono); white-space: nowrap; }
.mpk-months span.yr { border-left: 1px solid var(--ln2); color: var(--tx); }
.mpk-months b { margin-right: .35rem; color: var(--acc); font-weight: 700; }

.mrow { display: flex; border-bottom: 1px solid var(--ln); }
.mrow:nth-child(odd of .mrow) .mlab { background: var(--s1); }
.mlab { position: sticky; left: 0; z-index: 6; width: var(--lab); flex: none; padding: 12px 14px 12px 22px; background: var(--bg); border-right: 1px solid var(--ln); }
.mlab b { display: block; font: 800 1.12rem/1.05 var(--display); text-transform: uppercase; letter-spacing: .005em; }
.mlab small { color: var(--tx2); font-size: .74rem; }
.mpk-expand { display: block; margin-top: 6px; padding: .3rem .65rem; border-radius: 999px; border: 1px solid var(--ln2); background: var(--s2); font-size: .74rem; font-weight: 600; }
.mpk-expand:hover { border-color: var(--acc); color: var(--acc); }
.mtrack { position: relative; flex: none; width: var(--tw); height: var(--h, 50px); }

/* ---- morph pill card ---- */
.mp { --t: .42s var(--mp-spring); --mp-ph: 30px; --mp-avatar: 22px; --mp-line: 18px;
  --mp-title-x0: 33px; --mp-title-y0: 6px; --mp-dx: 0px; --mp-dy: 0px;
  position: absolute; left: var(--x); top: var(--y); width: var(--mp-pw); height: var(--mp-ph); font-size: 13px; color: var(--tx); text-align: left; transition: opacity .2s, filter .2s; }
.mp.is-open { z-index: 30; }
.mp__surface { position: absolute; left: 0; top: 0; width: var(--mp-pw); height: var(--mp-ph); overflow: hidden; border-radius: calc(var(--mp-ph) / 2);
  background: #e9dfd2; color: #1a120b; box-shadow: 0 1px 0 #fff3 inset, 0 2px 6px #0006; outline: none; cursor: pointer;
  translate: 0 0; transition: width var(--t), height var(--t), border-radius var(--t), translate var(--t), background-color .25s, color .25s, box-shadow .2s; }
.mp.is-outline .mp__surface { background: var(--bg); color: var(--tx); box-shadow: inset 0 0 0 1.5px var(--ln2), 0 2px 6px #0006; }
.mp:hover .mp__surface { box-shadow: inset 0 0 0 1.5px var(--acc), 0 4px 14px #000a; }
.mp__surface:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--acc) !important; }
.mp.is-open .mp__surface { width: var(--mp-cw); height: var(--mp-ch); border-radius: 20px; translate: var(--mp-dx) var(--mp-dy);
  background: var(--s2); color: var(--tx); box-shadow: inset 0 0 0 1px var(--ln2), 0 28px 70px #000e, 0 0 0 1px #000; }
.mp.is-open.is-filled .mp__surface { box-shadow: inset 0 0 0 1px color-mix(in srgb, #e9dfd2 40%, transparent), 0 28px 70px #000e, 0 0 0 1px #000; }

.mp__img { position: absolute; left: 4px; top: 4px; width: var(--mp-avatar); height: var(--mp-avatar); object-fit: cover; border-radius: calc(var(--mp-avatar) / 2); background: var(--s3);
  transition: width var(--t), height var(--t), border-radius var(--t); }
.mp__ph { display: grid; place-items: center; font: 800 .8rem var(--display); color: var(--tx2); }
.mp.is-open .mp__img { width: var(--mp-img-w); height: calc(var(--mp-ch) - 8px); border-radius: 16px; }
.mp__dot { position: absolute; left: 19px; top: 18px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px #e9dfd2; transition: opacity .1s; }
.mp.is-outline .mp__dot { box-shadow: 0 0 0 2px var(--bg); }
.mp__dot.v-positive { background: var(--pos); } .mp__dot.v-mixed { background: var(--mix); } .mp__dot.v-negative { background: var(--neg); }
.mp__dot.v-neutral { background: var(--neu); } .mp__dot.v-unknown { background: var(--unk); }
.mp.is-open .mp__dot { opacity: 0; }
.mp__title { position: absolute; left: var(--mp-title-x0); top: var(--mp-title-y0); width: var(--mp-title-w); line-height: var(--mp-line); white-space: nowrap; font-weight: 650;
  transition: left var(--t), top var(--t); }
.mp.is-open .mp__title { left: var(--mp-body-x); top: 14px; width: var(--mp-body-w); white-space: normal; font: 800 1.45rem/1.02 var(--display); text-transform: uppercase; }
.mp__tag { position: absolute; right: 8px; top: 7px; padding: 0 .4rem; border-radius: 999px; background: var(--b); color: #0b1430; font: 700 .62rem/16px Inter, sans-serif; letter-spacing: .02em; transition: opacity .1s; }
.mp__tag--cur { background: var(--side); color: #140d07; }
.mp.is-open .mp__tag { opacity: 0; }

/* Card-only content: in late once the surface is mostly open, out at once. */
.mp__body { position: absolute; left: var(--mp-body-x); top: 14px; bottom: 14px; width: var(--mp-body-w); display: flex; flex-direction: column;
  opacity: 0; translate: 0 4px; pointer-events: none; transition: opacity .12s ease, translate .12s ease; }
.mp.is-open .mp__body { opacity: 1; translate: 0 0; pointer-events: auto;
  transition: opacity .3s ease calc(.42s * .35), translate .4s cubic-bezier(.2, .7, .2, 1) calc(.42s * .35); }
.mp__title-space { height: var(--mp-title-h, 26px); flex: none; }
.mp__card-title { display: block; font: 800 1.45rem/1.02 var(--display); text-transform: uppercase; }
.mp__sub { margin-top: 6px; font-size: .78rem; line-height: 1.45; color: var(--tx2); }
.mp__sub p { margin: 0; }
.mp__sub p:first-child { color: var(--tx); font-weight: 600; }
.mp__rows { margin: 8px 0 0; padding: 0; list-style: none; font-size: .76rem; line-height: 1.4; display: grid; gap: 5px; }
.mp__rows li { display: flex; align-items: center; gap: .45em; color: var(--tx); }
.mp__rows .pill { font-size: .7rem; padding: .1rem .5rem; }
.mp__rev { color: var(--tx2); }
.mp__rows .ran { color: var(--pos); font-weight: 600; }
.mp__rows .not-ran { color: var(--tx2); }
.mp__icon { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mp__foot { margin-top: auto; padding-top: 12px; }
.mp__button { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .95rem; border: 0; border-radius: 999px; background: var(--acc); color: var(--acc-ink); font: 700 .82rem Inter, sans-serif; cursor: pointer; transition: filter .2s, gap .2s; }
.mp__button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mp__button:hover { filter: brightness(1.08); gap: .65rem; }
.mp__button.is-off { background: var(--s3); color: var(--tx2); cursor: not-allowed; }
.mp__measure { position: absolute; left: 0; top: 0; visibility: hidden; pointer-events: none; }
/* inline-block, not inline: inline boxes can't be measured reliably. */
.mp__title-measure { display: inline-block; white-space: nowrap; line-height: var(--mp-line); font-weight: 650; }
.mp__body-measure { width: var(--mp-body-w, 240px); display: flex; flex-direction: column; }

/* States */
.mp.is-dim { opacity: .16; filter: grayscale(1); }
.mp.is-dim .mp__surface { cursor: default; }
.mp.is-hit:not(.is-open) .mp__surface { box-shadow: inset 0 0 0 2px var(--acc), 0 0 18px color-mix(in srgb, var(--acc) 40%, transparent); }
.mp.is-top:not(.is-open) .mp__surface { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--acc), 0 0 24px color-mix(in srgb, var(--acc) 55%, transparent); }
.mp.is-taken:not(.is-open) .mp__surface { background: repeating-linear-gradient(-45deg, var(--s1) 0 5px, var(--s2) 5px 10px); color: var(--tx2); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--b) 60%, transparent); cursor: not-allowed; }
.mp.is-taken .mp__img { filter: grayscale(1) brightness(.7); }
.mp.is-current:not(.is-open) .mp__surface { box-shadow: inset 0 0 0 2px var(--side), 0 2px 6px #0006; }
.mp.is-shake .mp__surface { animation: mp-shake .35s; }
@keyframes mp-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* ---- phone: stacked per-provider list ---- */
.mpk.is-phone { padding: 0; }
.mpk.is-phone .mpk-panel { border-radius: 0; border: 0; }
.is-phone .mpk-head { padding: 12px 12px 12px 16px; gap: 10px; }
.is-phone .mpk-titles { flex: 1 1 calc(100% - 60px); }
.is-phone .mpk-titles h2 { font-size: 1.5rem; }
.is-phone .mpk-titles p { font-size: .78rem; }
.is-phone .mpk-x { order: -1; position: absolute; right: 12px; top: 12px; }
.is-phone .mpk-head { position: relative; }
.is-phone .mpk-search { flex: 1 1 100%; }
.is-phone .mpk-tabs { flex: 1 1 100%; display: flex; justify-content: center; }
.is-phone .mpk-ran { flex: 1 1 100%; justify-content: flex-start; }
.is-phone .mpk-legend { display: none; }
.is-phone .mpk-content { width: auto; background: none; padding-bottom: 300px; }
.is-phone .mpk-axis { display: none; }
.is-phone .mrow { display: block; }
.is-phone .mlab { position: sticky; top: 0; width: auto; display: flex; align-items: baseline; gap: .6rem; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--ln); z-index: 6; }
.is-phone .mlab .mpk-expand { margin: 0 0 0 auto; }
.is-phone .mtrack { width: auto; height: auto; display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 14px; }
.is-phone .mp { position: relative; left: auto; top: auto; }
.is-phone .mp.is-dim { display: none; }

@media (prefers-reduced-motion: reduce) {
  .mpk { animation: none; }
  .mp__surface, .mp__img, .mp__title, .mp__body, .mp.is-open .mp__body, .mp, .mpk-ran .sw::after { transition: none !important; }
  .mp.is-shake .mp__surface { animation: none; }
}
.mpk.is-reduced .mp__surface, .mpk.is-reduced .mp__img, .mpk.is-reduced .mp__title, .mpk.is-reduced .mp__body { transition: none !important; }

/* Inline on the Models page: the map is part of the page, not a modal. */
.mpk.is-inline { position: static; inset: auto; z-index: auto; display: flex; height: min(80vh, 940px); min-height: 560px; padding: 0; background: none; backdrop-filter: none; animation: none; }
.mpk.is-inline .mpk-panel { box-shadow: none; border-radius: 14px; }
@media (max-width: 700px) { .mpk.is-inline { height: 78vh; min-height: 480px; } }
