/* =====================================================================
   panels.css: Picks cards, then the one panel system: What (left), top panel, Where (right).
   Open panels take their own room; nothing overlaps or moves by itself. Also motion, hover and landing.
   ===================================================================== */

/* ---- case cards ---- */
.cards-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.cards-h .gh {
  flex: 1;
  margin: 0;
}
.season {
  margin: 0;
}
.season button {
  height: 26px;
  font-size: 11.5px;
  padding: 0 9px;
}
.cards {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 8px -12px 12px;
  padding: 2px 12px 4px;
  scroll-snap-type: x proximity;
  scroll-padding: 0 12px;
}
.ccard {
  position: relative;
  flex: none;
  scroll-snap-align: start;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  box-shadow: var(--shadow);
  transition:
    transform var(--t1) var(--ease),
    background var(--t2),
    border-color var(--t2);
}
.ccard:active {
  transform: scale(0.97);
}
.cc-main {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  width: 100%;
  padding: 9px 10px;
}
.cc-ic {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--cc);
  background: color-mix(in srgb, var(--cc) 12%, #fff);
}
.cc-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cc-txt b {
  font-size: 13.5px;
  line-height: 1.2;
}
.cc-n {
  font-size: 11px;
  color: var(--muted);
}
.cc-line {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}
.ccard .box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  align-self: flex-start;
}
.cc-info {
  position: absolute;
  right: 7px;
  bottom: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}
.cc-info:hover {
  color: var(--ink);
}
.ccard.on {
  background: color-mix(in srgb, var(--cc) 8%, #fff);
  border-color: var(--cc);
}
.ccard.part {
  border-color: color-mix(in srgb, var(--cc) 45%, #fff);
}
/* phone carousel: about two and a half cards in view */
.ccard.mini {
  width: 122px;
}
.ccard.mini .cc-main {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 9px 10px 9px;
  min-height: 94px;
}
.ccard.mini .cc-txt b {
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ccard.mini .box {
  position: absolute;
  right: 8px;
  top: 9px;
}
.ccard.mini .cc-info {
  bottom: 7px;
  right: 7px;
}
/* computer: a shelf across the top, above all the columns */
.shelf {
  display: none;
}
@container (min-width:900px) {
  .shelf {
    display: block;
    flex: none;
    padding: 8px 16px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    transition: padding var(--t2) var(--ease);
  }
  .sh-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
  }
  .sh-head .gh {
    margin: 0;
    flex: 1;
  }
  .sh-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
  }
  .ccard.full .cc-main {
    align-items: flex-start;
    padding: 10px 34px 10px 10px;
    min-height: 84px;
  }
  .ccard.full .box {
    position: absolute;
    right: 9px;
    top: 9px;
  }
  .shelf.folded {
    padding: 6px 16px;
  }
  .shelf.folded .sh-head {
    margin: 0 0 0;
    display: inline-flex;
    vertical-align: middle;
  }
  .shelf.folded {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .shelf.folded .sh-head .gh {
    flex: none;
  }
  .shelf.folded .sh-cards {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
    order: 2;
  }
  .shelf.folded .sh-head {
    order: 1;
  }
  .ccard.chip {
    border-radius: 999px;
  }
  .ccard.chip .cc-main {
    padding: 3px 12px 3px 4px;
    gap: 6px;
  }
  .ccard.chip .cc-ic {
    width: 24px;
    height: 24px;
    border-radius: 50%;
  }
  .ccard.chip b {
    font-size: 12.5px;
    white-space: nowrap;
  }
}
/* boxes fill in one after another when a card is used */
.row.filled .box {
  animation: fillin 420ms var(--spring) var(--d, 0ms) both;
}
.row.filled {
  animation: rowglow 900ms ease var(--d, 0ms) both;
}
@keyframes fillin {
  0% {
    transform: scale(0.3);
  }
  60% {
    transform: scale(1.2);
  }
  100% {
    transform: none;
  }
}
@keyframes rowglow {
  0% {
    background: color-mix(in srgb, var(--accent) 16%, #fff);
  }
  100% {
  }
}

/* =====================================================================
   One panel system: What (left), Picks (top), Where (right).
   Open panels take their own room; nothing overlaps, nothing moves by itself.
   ===================================================================== */
.app {
  display: block;
  --spr: cubic-bezier(0.32, 1.2, 0.6, 1);
}
.mid {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: var(--fh, 56px);
  background: var(--ground) radial-gradient(circle at 1px 1px, rgba(22, 24, 26, 0.07) 1px, transparent 0) 0 0/18px 18px;
}
.pnl-back {
  display: none;
}
.pnl {
  position: absolute;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
}
.pt .shelf {
  display: block;
}

/* ---- phone: Picks pushes the page down; What and Where take turns ---- */
.pt {
  top: 0;
  left: 0;
  right: 0;
  z-index: 31;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  transition: transform 420ms var(--spr);
}
.pt.closed {
  transform: translateY(-104%);
  pointer-events: none;
}
.pl {
  top: var(--topH, 0px);
  left: 0;
  bottom: var(--fh, 56px);
  width: 100%;
  background: var(--ground);
  z-index: 30;
  transition:
    transform 460ms var(--spr),
    top 420ms var(--spr),
    width var(--t3) var(--ease);
}
.pl.closed,
.app.r-open .pl {
  transform: translateX(-102%);
  pointer-events: none;
}
.pl .body {
  flex: 1;
  min-height: 0;
}
.road {
  padding-top: 16px;
}
.wp.docked {
  inset: auto;
  top: var(--topH, 0px);
  right: 0;
  bottom: var(--fh, 56px);
  left: 0;
  pointer-events: none;
  visibility: visible;
  transition: top 420ms var(--spr);
}
.wp.docked .wp-back {
  display: none;
}
.wp.docked .wp-card {
  top: 0;
  bottom: 0;
  width: 100%;
  border-left: 0;
  box-shadow: none;
  transform: translateX(102%);
  pointer-events: none;
  transition: transform 460ms var(--spr);
}
.wp.docked.open .wp-card {
  transform: none;
  pointer-events: auto;
}

/* handles: they sit on their panel's outer edge and flip their arrow */
.hdl {
  position: absolute;
  z-index: 46;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--what);
  cursor: pointer;
  font: inherit;
  box-shadow: 0 6px 18px -8px rgba(22, 24, 26, 0.35);
  transition:
    transform 460ms var(--spr),
    left 460ms var(--spr),
    top 420ms var(--spr),
    opacity var(--t2);
}
.hdl span {
  font-size: 10px;
  font-weight: 650;
  color: var(--ink);
}
.hdl .arr,
.wtab .arr {
  font-style: normal;
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
  font-weight: 700;
}
.hdl-l {
  left: 0;
  bottom: 78px;
  flex-direction: column;
  width: 52px;
  min-height: 70px;
  border-left: 0;
  border-radius: 0 31px 31px 0;
  padding: 8px 8px 7px 4px;
}
.app.l-open .hdl-l {
  opacity: 0;
  pointer-events: none;
} /* phone: What is the page itself; swipe left or use Where to leave it */
.hdl-t {
  top: var(--topH, 0px);
  left: 50%;
  transform: translateX(-50%);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  padding: 3px 12px 5px;
  gap: 5px;
}
.hdl-t svg {
  width: 14px;
  height: 14px;
}
.wtab {
  transition:
    right 460ms var(--spr),
    transform 460ms var(--spr),
    background var(--t1);
}
.wtab .arr {
  margin-top: 1px;
}
.app.r-open .wtab {
  right: auto;
  left: 0;
  border-radius: 0 31px 31px 0;
  border: 1px solid var(--line-strong);
  border-left: 0;
}
.wp.open ~ .wtab {
  opacity: 1;
  pointer-events: auto;
}
.shelf.phone {
  padding: 16px 12px 10px;
}
.shelf.phone .sh-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.shelf.phone .sh-head .gh {
  flex: 1;
  margin: 0;
}
.shelf .sh-tools {
  display: none;
}
.shelf.phone .cards {
  margin: 10px -12px 2px;
}
.season button svg {
  margin-right: 5px;
  vertical-align: -3px;
}

/* path that fits: smaller text first, then fold the middle */
.path.s1 .seg-c {
  font-size: 12px;
  padding: 0 8px;
}
.path.s2 .seg-c {
  font-size: 11px;
  padding: 0 6px;
}
.seg-c.folded,
.sep.folded {
  display: none;
}
.sep.dots {
  padding: 0 2px;
}

/* ---- computer: What | middle | Where, Picks across the middle ---- */
@container (min-width:900px) {
  .pl {
    top: 0;
    width: var(--plw, 100%);
    border-right: 1px solid var(--line);
  }
  .pl.closed {
    transform: translateX(-101%);
  }
  .app.r-open .pl:not(.closed) {
    transform: none;
    pointer-events: auto;
  }
  .road {
    padding-top: 10px;
  }
  .pt {
    left: var(--tl, 0);
    right: var(--tr, 0);
    z-index: 29;
    border-radius: 0;
    box-shadow: none;
    transition:
      transform 420ms var(--spr),
      left 460ms var(--spr),
      right 460ms var(--spr);
  }
  .wp.docked {
    top: 0;
    left: auto;
    width: var(--rw, 0px);
    right: 0;
    overflow: visible;
    transition: width 460ms var(--spr);
  }
  .wp.docked .wp-card {
    width: 380px;
    left: auto;
    right: 0;
    border-left: 1px solid var(--line);
    transform: translateX(101%);
  }
  .wp.docked.open .wp-card {
    transform: none;
  }
  .wp.docked:not(.open) {
    width: 0;
  }
  /* handles ride on the outer edge of their panel */
  .hdl-l {
    bottom: auto;
    top: 50%;
    margin-top: -66px;
    left: var(--plw, 0px);
    width: 44px;
    min-height: 132px;
    border-radius: 0 22px 22px 0;
    gap: 8px;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .app:not(.l-open) .hdl-l {
    left: 0;
  }
  .hdl-l span {
    writing-mode: vertical-rl;
    font-size: 12px;
    letter-spacing: 0.04em;
  }
  .hdl-t {
    top: var(--ptH, 0px);
    left: calc(var(--tl, 0px) + (100% - var(--tl, 0px) - var(--tr, 0px)) / 2);
  }
  .wtab {
    right: var(--rw, 0px);
  }
  .app.r-open .wtab {
    left: auto;
    right: var(--rw, 0px);
    border-radius: 22px 0 0 22px;
    border-right: 0;
    border-left: 1px solid var(--line-strong);
  }
  .peek {
    right: calc(var(--rw, 0px) + 54px);
  }
  .shelf {
    border-bottom: 0;
  }
  /* one-line footer */
  .foot {
    padding: 8px 16px;
  }
  .sum {
    display: flex;
    align-items: baseline;
    gap: 12px;
  }
  .sum b {
    flex: none;
  }
  .sum span {
    flex: 1;
    min-width: 0;
  }
}

/* ---- more motion (all of it follows the Motion setting) ---- */
.arrive .list > .row {
  animation: rowin 360ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 24ms);
}
@keyframes rowin {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.flydot {
  position: absolute;
  z-index: 70;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 6px 14px rgba(22, 24, 26, 0.3);
}
.r-count.rolling {
  color: var(--accent);
  font-weight: 600;
}
.wp-card {
  transition: transform 460ms var(--spr);
}
.modal .m-back,
.lw.open .lw-back {
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
@media (hover: hover) {
  .row:not(.zero) .r-main:hover {
    background: color-mix(in srgb, var(--what) 5%, #fff);
  }
  .ccard:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px -12px rgba(22, 24, 26, 0.35);
  }
  .row.fchip:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px -8px rgba(22, 24, 26, 0.3);
  }
  .hdl:hover {
    box-shadow: 0 8px 22px -8px rgba(22, 24, 26, 0.45);
  }
}
.nomotion .flydot {
  display: none;
}
.wtab {
  z-index: 52;
}

/* ---- tighter name buttons, and a soft chosen state ---- */
.row.fchip {
  min-height: 30px;
  border-radius: 9px;
}
.row.fchip .r-check {
  width: 24px;
}
.row.fchip .r-check .box {
  width: 15px;
  height: 15px;
  border-radius: 4px;
}
.row.fchip .r-check .box svg {
  width: 10px;
  height: 10px;
}
.row.fchip .r-main {
  padding: 4px 8px 4px 0;
}
.row.fchip .r-name {
  font-size: 13.5px;
}
.row.fchip.on {
  background: color-mix(in srgb, var(--accent) 8%, #fff);
  border-color: color-mix(in srgb, var(--accent) 38%, #fff);
  color: var(--ink);
}
.row.fchip.on .box {
  background: var(--accent);
  border-color: var(--accent);
}
.row.fchip.on .box .ck path {
  stroke: #fff;
}
.row.fchip.on .r-main:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

/* ---- the What and Picks handles step aside while a list window is open ---- */
.app.lw-open .hdl {
  opacity: 0;
  pointer-events: none;
}
.app.lw-open .wtab {
  width: 44px;
}
@container (min-width:900px) {
  .lw-card {
    right: max(60px, calc((100% - 1040px) / 2));
  }
}

/* ---- hover (computers only) ---- */
@media (hover: hover) {
  .row .ic svg,
  .l-head .ic svg {
    transition: transform 260ms var(--spring);
  }
  .row:hover .ic svg {
    transform: translateY(-1px) rotate(-7deg) scale(1.08);
  }
  .row.fchip {
    transition:
      transform var(--t1) var(--ease),
      box-shadow var(--t1),
      border-color var(--t1),
      background var(--t1);
  }
  .row.fchip:hover {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--line-strong));
  }
  .hdl .arr,
  .wtab .arr {
    display: inline-block;
    transition: transform 260ms var(--spring);
  }
  .hdl-l:hover .arr {
    transform: translateX(3px);
  }
  .app.l-open .hdl-l:hover .arr {
    transform: translateX(-3px);
  }
  .hdl-t:hover .arr {
    transform: translateY(2px);
  }
  .app.t-open .hdl-t:hover .arr {
    transform: translateY(-2px);
  }
  .wtab:hover .arr {
    transform: translateX(-3px);
  }
  .app.r-open .wtab:hover .arr {
    transform: translateX(3px);
  }
  .chipbtn:hover,
  .pbtn:hover,
  .clear:hover,
  .allbtn:hover {
    border-color: color-mix(in srgb, var(--what) 35%, var(--line-strong));
  }
  .seg-c:not(.cur):hover {
    background: color-mix(in srgb, var(--what) 8%, #fff);
  }
}
button:active {
  transition-duration: 80ms;
}
.chipbtn:active,
.allbtn:active,
.clear:active,
.seg-c:active,
.cc-main:active {
  transform: scale(0.96);
}

/* ---- landing: once on first view, and when things arrive ---- */
.landing .pl {
  animation: inL 620ms var(--spr) both;
}
.landing .pt:not(.closed) {
  animation: inT 620ms var(--spr) 120ms both;
}
.landing .wtab {
  animation: popIn 480ms var(--spring) 420ms both;
}
.landing .hdl {
  animation: popIn 480ms var(--spring) 360ms both;
}
.landing .foot {
  animation: inB 520ms var(--ease) 80ms both;
}
@keyframes inL {
  from {
    transform: translateX(-24px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes inT {
  from {
    transform: translateY(-16px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes inB {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes popIn {
  0% {
    opacity: 0;
    scale: 0.6;
  }
  70% {
    opacity: 1;
    scale: 1.06;
  }
  100% {
    opacity: 1;
    scale: 1;
  }
}
/* icons draw themselves just after their row arrives */
.arrive .list > .row .ic svg * {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 620ms var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 24ms + 140ms);
}
.arrive .list > .row.nolanding .ic svg * {
  animation: none;
  stroke-dashoffset: 0;
}
.arrive .l-head .ic svg * {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 700ms var(--ease) 60ms forwards;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
/* name buttons: only the first few land, the rest just appear */
.arrive .list.flow > .row.fchip:nth-child(-n + 15) {
  animation: rowin 320ms var(--ease) both;
}
.arrive .list.flow > .row.fchip:nth-child(n + 16) {
  animation: none;
}
/* cards pop in one after another when Picks opens */
.pt-arrive .ccard,
.landing .ccard {
  animation: cardin 460ms var(--spring) both;
  animation-delay: calc(var(--k, 0) * 55ms + 80ms);
}
@keyframes cardin {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.nomotion .arrive .ic svg * {
  stroke-dashoffset: 0 !important;
  animation: none !important;
}
.app.lw-open .hdl-l,
.app.lw-open .hdl-t {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ---- Picks floats over everything; nothing underneath moves or resizes ---- */
.pt {
  z-index: 55;
  left: 0 !important;
  right: 0 !important;
  border-radius: 0 0 18px 18px !important;
  box-shadow: 0 18px 40px -16px rgba(22, 24, 26, 0.38) !important;
  border-bottom: 1px solid var(--line-strong);
}
.pl {
  top: 0;
}
.wp.docked {
  top: 0;
}
.hdl-t {
  z-index: 56;
  top: var(--ptH, 0px) !important;
  left: 50% !important;
}
.app.t-open .hdl-t {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%);
}
.hdl-t.bounce {
  animation: tuckbounce 700ms var(--spring) 380ms;
}
@keyframes tuckbounce {
  0% {
    transform: translateX(-50%);
  }
  35% {
    transform: translateX(-50%) translateY(6px) scale(1.08);
  }
  65% {
    transform: translateX(-50%) translateY(-1px);
  }
  100% {
    transform: translateX(-50%);
  }
}
.app.lw-open .hdl-t {
  opacity: 0 !important;
  pointer-events: none !important;
}
@container (min-width:900px) {
  .pt .shelf {
    padding: 10px 18px 14px;
  }
  .sh-cards {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
