/*
  21-map-levels.css — v41.44 chart levels.

  Two surfaces, two token sets:
   - the level bar sits on the dark hull chrome of the chart viewer, between
     the top bar and the marker legend, so it uses --brass-bright and the
     light chart-viewer ink (#f4edcf) that the bar and legend already use.
   - the level manager lives in a modal on light parchment, so it uses
     --ink / --ink-soft / --muted / --line.
  Mixing the two fails AA, so nothing is shared between the blocks below.
*/

/* ---------- level switcher (dark hull) ---------- */
.map-level-bar {
  display: flex;
  gap: 6px;
  padding: 7px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #2a1e14, #241a10);
  border-bottom: 1px solid rgba(255, 226, 154, .16);
}
.map-level-bar::-webkit-scrollbar { display: none; }

.map-level-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 226, 154, .3);
  background: rgba(255, 226, 154, .07);
  color: #f4edcf;
  font: inherit;
  font-size: .88rem;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
}
.map-level-chip:active { transform: translateY(1px); }

/* The active level is spelled out three ways — a tick, a filled chip, and
   aria-pressed — so colour is never the only signal. */
.map-level-chip.is-active {
  background: var(--brass-bright);
  border-color: var(--brass-bright);
  color: #241a10;
}
.map-level-tick {
  display: inline-block;
  min-width: 0;
  font-weight: 800;
}
.map-level-chip.is-active .map-level-tick { min-width: .8em; }
.map-level-name { white-space: nowrap; }
.map-level-count {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 226, 154, .16);
  color: #f4edcf;
  font-size: .78rem;
  font-weight: 700;
}
.map-level-chip.is-active .map-level-count {
  background: rgba(36, 26, 16, .22);
  color: #241a10;
}

/* ---------- level manager (light parchment) ---------- */
.map-levels-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.map-levels-row .row-sub { margin-top: 2px; }

.map-level-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.map-level-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--chart-2);
}
.map-level-row.is-default { border-color: var(--brass); }

.map-level-thumb {
  flex: 0 0 auto;
  width: 56px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background-color: var(--chart);
  background-size: cover;
  background-position: center;
}
.map-level-thumb.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-weight: 700;
}

.map-level-row-body {
  flex: 1 1 130px;
  min-width: 0;
}
.map-level-row-name {
  color: var(--ink);
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-level-row-sub {
  /* --muted (#6e5b40) measures 4.34:1 on the inset --chart-2 surface — just
     under AA. --ink-soft is the correct token for secondary text on this
     surface; --muted is only safe on the lighter --chart. */
  color: var(--ink-soft);
  font-size: .82rem;
}
.map-level-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.map-level-default-chip { white-space: nowrap; }

/* ---------- reorder controls (v41.46, light parchment) ---------- */
.map-level-order {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex-basis: 100%;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}
.map-level-pos {
  color: var(--ink-soft);
  font-size: .8rem;
  font-weight: 650;
}
