/* =====================================================================
   lists.css: long lists, counts, chips that flow, the list window, category icons, logo slots,
   the Where button, panel and tab, and the chosen-area chip.
   ===================================================================== */

/* ---- big lists: more than a handful of options ---- */
.bl-tools {
  position: sticky;
  top: -10px;
  z-index: 3;
  margin: 0 -12px 8px;
  padding: 8px 12px;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.col .bl-tools {
  background: inherit;
}
.bl-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--muted);
}
.bl-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.bl-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bl-row .mini-seg {
  margin: 0;
}
.chipbtn {
  appearance: none;
  cursor: pointer;
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  transition:
    background var(--t1),
    border-color var(--t1),
    color var(--t1),
    transform var(--t1) var(--ease);
}
.chipbtn:active {
  transform: scale(0.95);
}
.chipbtn[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent);
}
.bl-wrap {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.bl-wrap > .bl-lists {
  flex: 1;
  min-width: 0;
}
.letters {
  position: sticky;
  top: 96px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 4px 0;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.letters button {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  width: 22px;
  height: 17px;
  font-size: 10px;
  font-weight: 700;
  color: var(--what);
  display: grid;
  place-items: center;
  border-radius: 4px;
}
.letters button:hover,
.letters button:active {
  background: color-mix(in srgb, var(--what) 14%, #fff);
}
.letters button[disabled] {
  color: #d3d3cc;
  cursor: default;
  background: none;
}
.lt {
  scroll-margin-top: 120px;
}
.grp {
  margin-top: 8px;
}
.grp-h {
  display: flex;
  align-items: stretch;
  min-height: 44px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-radius var(--t2);
}
.grp.open .grp-h {
  border-radius: 12px 12px 0 0;
  border-bottom-color: var(--line);
}
.grp-h .r-main {
  font-weight: 600;
}
.grp-h .tw {
  transition: transform var(--t2) var(--ease);
}
.grp.open .grp-h .tw {
  transform: rotate(90deg);
}
.grp-b {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--t2) var(--ease);
}
.grp.open .grp-b,
.searching .grp-b {
  grid-template-rows: 1fr;
}
.grp-b > div {
  min-height: 0;
  overflow: hidden;
}
.grp-b .list {
  border-top: 0;
  border-radius: 0 0 12px 12px;
}
.searching .grp-h .tw {
  visibility: hidden;
}
.row.hide,
.grp.hide,
.lt-gone {
  display: none;
}
.nohits {
  display: none;
  padding: 14px;
  font-size: 13px;
  color: var(--muted);
}
.nohits.show {
  display: block;
}
.r-num {
  flex: none;
  width: 22px;
  text-align: right;
  font-size: 11px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.stopline {
  position: relative;
}
.col.big {
  width: auto;
  flex: 1 0 520px;
  max-width: 760px;
}
.col.big.ahead {
  flex: 0 0 420px;
}

/* counts: one quiet number before the arrow; the chosen part in the What colour */
.r-count {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: 6px;
}
.r-count:empty {
  display: none;
}
.r-count em,
.bl-count em {
  font-style: normal;
  font-weight: 650;
  color: var(--what);
}
.bl-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-right: 2px;
}
.grp-h .r-count {
  font-weight: 400;
}
.grp {
  scroll-margin-top: 120px;
}
.list.hide,
.lt-gone {
  display: none;
}

/* ---- flowing names: as many per line as fit, still in order ---- */
.list.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  padding: 2px 0 6px;
}
.row.fchip {
  display: inline-flex;
  align-items: stretch;
  min-height: 36px;
  max-width: 100%;
  border: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    background var(--t1),
    border-color var(--t1),
    transform var(--t1) var(--ease);
}
.row.fchip:active {
  transform: scale(0.97);
}
.row.fchip .r-check {
  width: 32px;
}
.row.fchip .r-check .box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}
.row.fchip .r-main {
  flex: 0 1 auto;
  padding: 6px 11px 6px 0;
}
.row.fchip .r-name {
  flex: 0 1 auto;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row.fchip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.row.fchip.on .box {
  background: #fff;
  border-color: #fff;
}
.row.fchip.on .box .ck path {
  stroke: var(--accent);
}
.row.fchip.on .r-main:hover {
  background: rgba(255, 255, 255, 0.12);
}
.fsec {
  margin-top: 4px;
  scroll-margin-top: calc(var(--th, 90px) + 4px);
}
.fsec.hide {
  display: none;
}
.fs-h {
  position: sticky;
  top: var(--th, 90px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin: 0 -2px;
  padding: 2px;
  background: var(--ground);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--muted);
}
.col .fs-h {
  background: var(--ground);
}
.col.curcol .fs-h {
  background: #fbfbf9;
}
.fs-h .r-check {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}
.fs-h .r-check .box {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}
.fs-h.on .box {
  background: var(--accent);
  border-color: var(--accent);
}
.fs-h.letter {
  font-size: 13px;
  color: var(--what);
  padding-left: 4px;
}
.fs-h .r-count {
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
}
.fjump {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 8px;
}
.fjump .chipbtn {
  flex: none;
  height: 28px;
}
.fjump .hide {
  display: none;
}
.ftray {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.ftray:not(:empty) {
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 7%, #fff);
  border: 1px dashed color-mix(in srgb, var(--accent) 35%, #fff);
}
.ftray-t {
  font-size: 12px;
  font-weight: 650;
  color: var(--accent);
  margin-right: 2px;
}
.ftray-t em {
  font-style: normal;
}
.row.fchip.hide {
  display: none;
}

/* ---- a long list opens as its own window ---- */
.lw {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 40;
  visibility: hidden;
  transition: visibility 0s linear var(--t3);
}
.lw.open {
  visibility: visible;
  transition: visibility 0s;
}
.lw-back {
  position: absolute;
  inset: 0;
  background: rgba(22, 24, 26, 0);
  transition: background var(--t2) ease;
}
.lw.open .lw-back {
  background: rgba(22, 24, 26, 0);
}
.lw-card {
  position: absolute;
  inset: 0;
  background: var(--ground);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.08);
  transition:
    transform var(--t3) var(--ease),
    opacity var(--t2) ease;
}
.lw.open .lw-card {
  opacity: 1;
  transform: none;
}
.lw-band {
  flex: none;
  height: 4px;
}
.lw-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 24px;
}
.lw-scroll .bl-tools {
  background: var(--ground);
}
.lw-scroll .fs-h {
  background: var(--ground);
}
.body {
  transition:
    filter var(--t2) ease,
    opacity var(--t2) ease;
}
@container (min-width:900px) {
  .lw-back {
    cursor: pointer;
  }
  .lw.open .lw-back {
    background: rgba(22, 24, 26, 0.28);
  }
  .lw-card {
    inset: 18px max(24px, calc((100% - 1040px) / 2));
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(22, 24, 26, 0.25);
    border: 1px solid var(--line-strong);
  }
  .lw-scroll {
    padding: 14px 22px 28px;
  }
  .lw-scroll .bl-tools {
    margin: 0 -22px 10px;
    padding: 10px 22px;
  }
  .body.behind {
    filter: saturate(0.6);
  }
}
/* the arrow turns into a list symbol just before the window opens */
.r-go {
  position: relative;
}
.r-go .li {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -8px 0 0 -8px;
  opacity: 0;
  transform: scale(0.4) rotate(-20deg);
  transition:
    opacity var(--t1),
    transform var(--t2) var(--spring);
}
.r-go svg:first-child {
  transition:
    opacity var(--t1),
    transform var(--t1);
}
.row.tolist .r-go svg:first-child {
  opacity: 0;
  transform: translateX(6px) scale(0.6);
}
.row.tolist .r-go .li {
  opacity: 1;
  transform: none;
}
.row.tolist {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -8px rgba(22, 24, 26, 0.35);
  position: relative;
  z-index: 1;
}

/* category icons: drawn in the category colour, never on place names */
.ic {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}
.l-head .ic {
  width: 24px;
  height: 24px;
}
.l-head .ic svg {
  width: 22px;
  height: 22px;
}

.lw-close {
  display: none;
}
@container (min-width:900px) {
  .lw-card {
    overflow: visible;
  }
  .lw-band {
    border-radius: 18px 18px 0 0;
  }
  .lw-scroll {
    border-radius: 0 0 18px 18px;
  }
  .lw-close {
    display: grid;
    place-items: center;
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: #fff;
    box-shadow: var(--shadow);
    cursor: pointer;
    color: var(--ink);
  }
  .lw-close:hover {
    background: var(--soft);
  }
}

/* logo slots: same small box everywhere; initials until an official file exists */
.logo {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #fff;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  overflow: hidden;
}
.logo.generic {
  color: var(--muted);
  background: var(--soft);
}
.logo.has {
  padding: 2px;
}
.logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.m-op {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}
.m-op b {
  color: var(--ink);
  font-weight: 600;
}

/* ---- Where: button in the road, chip in long lists ---- */
.path {
  flex: 1;
  min-width: 0;
}
.wtab.nudge {
  animation: nudge 1.1s var(--ease) 2;
}
@keyframes nudge {
  0%,
  100% {
    transform: none;
    box-shadow: var(--shadow);
  }
  30% {
    transform: scale(1.07);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent);
  }
  60% {
    transform: scale(0.98);
  }
}
.bl-top {
  display: flex;
  gap: 6px;
  align-items: center;
}
.bl-top .bl-search {
  flex: 1;
  min-width: 0;
}
.row.zero {
  opacity: 0.42;
}
.linkbtn {
  appearance: none;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

/* ---- Where panel: slides in from the right ---- */
.wp {
  position: absolute;
  inset: 0;
  z-index: 50;
  visibility: hidden;
  transition: visibility 0s linear var(--t3);
}
.wp.open {
  visibility: visible;
  transition: visibility 0s;
}
.wp-back {
  position: absolute;
  inset: 0;
  background: rgba(22, 24, 26, 0.32);
  opacity: 0;
  transition: opacity var(--t2);
}
.wp.open .wp-back {
  opacity: 1;
}
.wp-card {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(92%, 380px);
  background: var(--ground);
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 50px rgba(22, 24, 26, 0.18);
  transform: translateX(104%);
  transition: transform var(--t3) var(--ease);
  border-left: 3px solid var(--accent);
}
.wp.open .wp-card {
  transform: none;
}
.wp-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px 10px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.wp-head > div {
  flex: 1;
}
.wp-head h2 {
  margin: 2px 0 0;
  font-size: 20px;
}
.wp-note {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.35;
}
.wp-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 18px;
}
.wp-body.slidein {
  animation: slidein var(--t2) var(--ease);
}
@keyframes slidein {
  from {
    opacity: 0.2;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.wp-ctx {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.wp-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 8px;
}
.wp-sub h3 {
  flex: 1;
  margin: 0;
  font-size: 17px;
}
.wp-foot {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  background: #fff;
  border-top: 1px solid var(--line);
}
.wp-foot .primary {
  flex: 1;
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  height: 40px;
  cursor: pointer;
}
.wp-foot .clear[disabled] {
  opacity: 0.4;
  cursor: default;
}

/* ---- the peek: a small card from the right edge, then it goes away ---- */
.peek {
  position: absolute;
  right: 10px;
  top: 62px;
  z-index: 45;
  max-width: 290px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(calc(100% + 16px));
  transition:
    transform var(--t3) var(--spring),
    opacity var(--t2);
}
.peek.on {
  pointer-events: auto;
  opacity: 1;
  transform: none;
}
.peek-go {
  appearance: none;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, #fff);
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 12px 30px -10px rgba(22, 24, 26, 0.35);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink);
}
.peek-go svg {
  flex: none;
  color: var(--accent);
  margin-top: 1px;
}
.peek-no {
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 3px 8px;
  font: inherit;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
}

/* ---- list window: make it bigger on a computer ---- */
.lw-max {
  display: none;
}
@container (min-width:900px) {
  .lw-max {
    display: grid;
    place-items: center;
    position: absolute;
    top: -14px;
    right: 26px;
    z-index: 5;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: #fff;
    box-shadow: var(--shadow);
    cursor: pointer;
    color: var(--ink);
  }
  .lw-max:hover {
    background: var(--soft);
  }
  .lw-card {
    transition:
      transform var(--t3) var(--ease),
      opacity var(--t2) ease,
      inset var(--t3) var(--ease);
  }
  .lw.max .lw-card {
    inset: 16px 16px 12px;
  }
  .wp-card {
    width: 380px;
  }
}

.app {
  overflow: clip;
}

/* ---- the Where tab: the panel's handle, sticking out of the right edge ---- */
.wtab {
  position: absolute;
  right: 0;
  bottom: 78px;
  z-index: 46;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 52px;
  min-height: 62px;
  padding: 8px 4px 7px 8px;
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-radius: 31px 0 0 31px;
  background: #fff;
  box-shadow: -6px 4px 18px -8px rgba(22, 24, 26, 0.35);
  cursor: pointer;
  color: var(--accent);
  font: inherit;
  transition:
    background var(--t1),
    color var(--t1),
    width var(--t2) var(--ease);
}
.wtab:active {
  transform: scale(0.96);
}
.wt-pin {
  position: relative;
  display: grid;
  place-items: center;
}
.wt-pin svg {
  width: 20px;
  height: 20px;
}
.wt-badge {
  position: absolute;
  top: -6px;
  right: -9px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #fff;
  color: var(--accent);
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 1.5px var(--accent);
}
.wt-txt {
  max-width: 44px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.1;
  text-align: center;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wtab.set {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.wtab.set .wt-txt {
  color: #fff;
}
.wtab.nudge {
  animation: tabnudge 1s var(--ease) 2;
}
@keyframes tabnudge {
  0%,
  100% {
    transform: none;
  }
  35% {
    transform: translateX(-8px);
    box-shadow:
      -6px 4px 18px -8px rgba(22, 24, 26, 0.35),
      0 0 0 7px color-mix(in srgb, var(--accent) 22%, transparent);
  }
  65% {
    transform: translateX(-2px);
  }
}
.wp.open ~ .wtab {
  opacity: 0;
  pointer-events: none;
}
.peek {
  top: auto;
  bottom: 82px;
  right: 60px;
  transform: translateX(24px);
  align-items: flex-end;
}
.peek.on {
  transform: none;
}
.letters button {
  height: 14px;
}
@container (min-width:900px) {
  .wtab {
    bottom: auto;
    top: 50%;
    margin-top: -66px;
    width: 44px;
    min-height: 132px;
    padding: 12px 4px 12px 7px;
    border-radius: 22px 0 0 22px;
    gap: 8px;
  }
  .wt-txt {
    writing-mode: vertical-rl;
    max-width: none;
    max-height: 86px;
    font-size: 12px;
    letter-spacing: 0.04em;
  }
  .peek {
    bottom: auto;
    top: 50%;
    right: 54px;
    margin-top: -40px;
  }
  .letters button {
    height: 17px;
  }
}
/* chosen area, right under the search of every long list */
.areachip {
  display: inline-flex;
  align-items: stretch;
  align-self: flex-start;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  overflow: hidden;
}
.areachip button {
  appearance: none;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ac-open {
  padding: 4px 4px 4px 10px;
  font-size: 12.5px;
}
.ac-open svg {
  width: 14px;
  height: 14px;
}
.ac-x {
  padding: 0 9px 0 6px;
}
.ac-x svg {
  width: 13px;
  height: 13px;
}
.ac-x:hover {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.layer,
.lw-scroll {
  padding-bottom: 96px;
}

/* ---- Where: sorted, with the empty ones under a line ---- */
.gh-note {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--faint);
}
.wp-list {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.wp-list .row {
  background: var(--surface);
}
.wp-list .row.on {
  background: var(--accent-wash);
}
.wp-divider {
  margin: 0;
  padding: 8px 12px 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 650;
  color: var(--faint);
  background: var(--soft);
  border-top: 1px solid var(--line);
}
.wp-divider.late {
  animation: fadein 0.5s ease 0.35s both;
}
@keyframes fadein {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
