/* teams.css: team list, team editor, and the species / item / move pickers. Everything is prefixed .tb- and built on base.css + tokens. */

/* ---------- type colour hook shared by dots and chips ---------- */
.tb-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--dc, var(--t-unknown)); }
.tb-dot.off { opacity: .18; }
.tb-dot[data-type="Normal"], .tb-chip[data-type="Normal"] { --dc: var(--t-normal); }
.tb-dot[data-type="Fire"], .tb-chip[data-type="Fire"] { --dc: var(--t-fire); }
.tb-dot[data-type="Water"], .tb-chip[data-type="Water"] { --dc: var(--t-water); }
.tb-dot[data-type="Electric"], .tb-chip[data-type="Electric"] { --dc: var(--t-electric); }
.tb-dot[data-type="Grass"], .tb-chip[data-type="Grass"] { --dc: var(--t-grass); }
.tb-dot[data-type="Ice"], .tb-chip[data-type="Ice"] { --dc: var(--t-ice); }
.tb-dot[data-type="Fighting"], .tb-chip[data-type="Fighting"] { --dc: var(--t-fighting); }
.tb-dot[data-type="Poison"], .tb-chip[data-type="Poison"] { --dc: var(--t-poison); }
.tb-dot[data-type="Ground"], .tb-chip[data-type="Ground"] { --dc: var(--t-ground); }
.tb-dot[data-type="Flying"], .tb-chip[data-type="Flying"] { --dc: var(--t-flying); }
.tb-dot[data-type="Psychic"], .tb-chip[data-type="Psychic"] { --dc: var(--t-psychic); }
.tb-dot[data-type="Bug"], .tb-chip[data-type="Bug"] { --dc: var(--t-bug); }
.tb-dot[data-type="Rock"], .tb-chip[data-type="Rock"] { --dc: var(--t-rock); }
.tb-dot[data-type="Ghost"], .tb-chip[data-type="Ghost"] { --dc: var(--t-ghost); }
.tb-dot[data-type="Dragon"], .tb-chip[data-type="Dragon"] { --dc: var(--t-dragon); }
.tb-dot[data-type="Dark"], .tb-chip[data-type="Dark"] { --dc: var(--t-dark); }
.tb-dot[data-type="Steel"], .tb-chip[data-type="Steel"] { --dc: var(--t-steel); }
.tb-dot[data-type="Fairy"], .tb-chip[data-type="Fairy"] { --dc: var(--t-fairy); }

/* ---------- shared bits ---------- */
.tb-textarea { min-height: 260px; resize: vertical; line-height: 1.45; white-space: pre; overflow: auto; }
.tb-pillbtn { cursor: pointer; }
.tb-pillbtn:hover { background: var(--panel-3); }
.tb-plist { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--danger); }
.tb-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tb-cat { height: 18px; width: auto; flex: none; }
.tb-stab { font-size: 10px; padding: 0 6px; line-height: 16px; }

/* ---------- combobox / picker shell ---------- */
.tb-pop {
  position: fixed; z-index: 90; display: flex; flex-direction: column; padding: var(--s3);
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow); animation: pop .15s var(--ease);
}
.tb-combo { display: flex; flex-direction: column; gap: var(--s2); min-height: 0; flex: 1; }
.tb-list {
  list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; min-height: 120px; max-height: min(52vh, 460px);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); overscroll-behavior: contain;
}
.tb-pop .tb-list { max-height: none; }
.tb-opt { padding: 6px 10px; cursor: pointer; border-bottom: 1px solid var(--line); }
.tb-opt:last-child { border-bottom: 0; }
.tb-opt.active { background: var(--panel-3); box-shadow: inset 3px 0 0 var(--blue); }
.tb-opt[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.tb-more, .tb-none { padding: var(--s3); text-align: center; color: var(--text-dim); }
.tb-row { display: flex; align-items: center; gap: var(--s3); min-height: 44px; }
.tb-mini { width: 44px; height: 44px; object-fit: contain; flex: none; }
.tb-pickbtn .tb-mini { width: 32px; height: 32px; margin: -4px 0; }
.tb-rmain { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tb-rname { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font: 600 14px var(--font-display); }
.tb-rsub { color: var(--text-dim); font-size: 12px; }
.tb-rtypes { display: flex; gap: 4px; flex: none; }
.tb-bst { width: 34px; flex: none; text-align: right; font: 700 13px var(--font-display); color: var(--text-dim); }
.tb-cur { font-size: 10px; padding: 0 6px; line-height: 16px; }

.tb-pickbar { display: flex; align-items: flex-start; gap: var(--s2); }
.tb-chips-wrap { flex: 1; min-width: 0; }
.tb-pickbar .tb-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tb-pickbar .tb-chip { flex: none; }
.tb-viewtoggle { display: flex; flex: none; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); }
.tb-viewbtn { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 10px; border: 0; border-radius: 999px; background: transparent; color: var(--text-dim); cursor: pointer; font: 600 12px var(--font-display); }
.tb-viewbtn svg { width: 14px; height: 14px; }
.tb-viewbtn[aria-pressed="true"] { background: var(--panel-3); color: var(--text); box-shadow: inset 0 -2px 0 var(--red); }
.tb-list.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px; padding: 4px; align-content: start; }
.tb-list.grid .tb-opt { border: 1px solid transparent; border-radius: var(--radius); padding: 6px 4px; }
.tb-list.grid .tb-opt.active { border-color: var(--blue); box-shadow: none; }
.tb-list.grid .tb-more, .tb-list.grid .tb-none { grid-column: 1 / -1; }
.tb-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0; }
.tb-cellimg { width: 64px; height: 64px; object-fit: contain; }
.tb-cellname { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 12px var(--font-display); }
.tb-celltypes { display: flex; gap: 3px; min-height: 10px; }
.tb-cellcur { position: absolute; top: 0; right: 2px; color: var(--green); font-weight: 800; }
.tb-vthumb { width: 24px; height: 24px; object-fit: contain; margin-right: 4px; }
.tb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tb-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: transparent; color: var(--text-dim); font: 600 12px var(--font-display);
}
.tb-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--dc, var(--t-unknown)); }
.tb-chip:hover { color: var(--text); background: var(--panel-2); }
.tb-chip[aria-pressed="true"] { color: var(--text); background: var(--panel-3); border-color: var(--dc, var(--line-2)); box-shadow: inset 0 -3px 0 var(--dc, var(--line-2)); }

/* ---------- move picker ---------- */
.tb-mp { display: flex; flex-direction: column; gap: var(--s3); min-height: 0; }
.tb-mp-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.tb-chosen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s2); }
.tb-chosen-item { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 2px 4px 2px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.tb-chosen-item.empty { border-style: dashed; background: transparent; }
.tb-chosen-item[data-hl] { border-color: var(--blue); }
.tb-chosen-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 13px var(--font-display); }
.tb-mp-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s2); align-items: center; }
.tb-mp-note { margin: 0; }
.tb-mp-head, .tb-mvrow { display: grid; grid-template-columns: minmax(140px, 1.1fr) 96px 52px 56px 40px minmax(0, 2fr); gap: var(--s2); align-items: center; }
.tb-mp-head { padding: 0 10px; font: 600 11px var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.tb-mv-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.tb-mv-tags { display: flex; align-items: center; gap: 6px; }
.tb-num { text-align: right; font: 600 13px var(--font-display); font-variant-numeric: tabular-nums; }
.tb-mp-head .tb-num { text-align: right; }
.tb-lab { display: none; color: var(--text-dim); font-weight: 500; }
.tb-mv-desc { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12px; color: var(--text-dim); }
.tb-se { display: inline-flex; align-items: center; gap: 3px; }
.tb-se-lab { margin-right: 2px; font: 700 10px var(--font-display); letter-spacing: .06em; color: var(--text-dim); }
.tb-se-more { font: 600 10px var(--font-display); color: var(--text-dim); }

/* ---------- editor layout ---------- */
.tb-head h1 { font-size: 24px; margin-right: auto; min-width: 0; overflow-wrap: anywhere; }
.tb-saved.flash { animation: tb-flash .7s var(--ease); }
@keyframes tb-flash { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 70%, transparent); } to { box-shadow: 0 0 0 10px transparent; } }
.tb-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: var(--s4); align-items: start; }
.tb-rail { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.tb-main { min-width: 0; }
.tb-main-wrap { display: flex; flex-direction: column; gap: var(--s4); }

/* team slots */
.tb-slots { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s3); }
.tb-slots:empty { display: none; }
.tb-slot { display: flex; align-items: center; gap: 2px; padding-right: 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.tb-slot.sel { border-color: var(--blue); box-shadow: inset 3px 0 0 var(--blue); background: var(--panel-3); }
.tb-slot.bad:not(.sel) { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }
.tb-slot.drop { outline: 2px dashed var(--blue); outline-offset: 2px; }
.tb-slot.drag { opacity: .45; }
.tb-slot-main { position: relative; flex: 1; min-width: 0; min-height: 56px; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 0; border-radius: var(--radius); background: none; text-align: left; cursor: pointer; }
.tb-slot-main:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.tb-slot-sprite { width: 44px; height: 44px; object-fit: contain; flex: none; }
.tb-slot-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.tb-slot-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 14px var(--font-display); }
.tb-slot-types { display: flex; gap: 4px; flex-wrap: wrap; }
.tb-slot-tools { display: flex; gap: 2px; flex: none; }
.tb-add { margin-top: 0; }

/* matchup chart */
.tb-mx-wrap { overflow-x: auto; }
.tb-mx { width: 100%; border-collapse: separate; border-spacing: 0 2px; font: 600 12px var(--font-display); }
.tb-mx th, .tb-mx td { padding: 1px 0; text-align: center; }
.tb-mx tbody th { text-align: left; font-weight: 400; padding-right: 6px; }
.tb-mx td.num, .tb-mx th.num { width: 34px; }
.tb-mx-sprite { width: 26px; height: 26px; object-fit: contain; vertical-align: middle; }
.tb-mx td { min-width: 22px; border-radius: 4px; }
.m-w4 { background: color-mix(in srgb, var(--danger) 60%, transparent); color: var(--text); }
.m-w2 { background: color-mix(in srgb, var(--danger) 30%, transparent); }
.m-r2 { background: color-mix(in srgb, var(--green) 24%, transparent); }
.m-r4 { background: color-mix(in srgb, var(--green) 42%, transparent); }
.m-imm { background: color-mix(in srgb, var(--blue) 32%, transparent); }
.tb-mx tr.hot th, .tb-mx tr.hot td.num { box-shadow: none; }
.tb-mx td.hot-n { color: var(--danger); font-size: 14px; }
.tb-mx td.w-n { color: var(--yellow); }
.tb-mx td.r-n { color: var(--green); }
.tb-mx td.zero { color: var(--text-faint); font-weight: 400; }
.tb-mx tr.hot { outline: 1px solid color-mix(in srgb, var(--danger) 70%, transparent); outline-offset: -1px; border-radius: 4px; }

.tb-vgroup { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tb-vgroup .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

/* ---------- member editor ---------- */
.tb-member { display: flex; flex-direction: column; gap: var(--s4); }
.tb-banner { align-items: flex-start; }
.tb-banner .tb-plist { flex-basis: 100%; }
.tb-ident { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: var(--s4); }
.tb-ident-art { display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; }
.tb-bigsprite { width: 140px; height: 140px; object-fit: contain; border-radius: var(--radius); background: radial-gradient(circle at 50% 75%, var(--panel-3), transparent 68%); }
.tb-types { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; min-height: 20px; }
.tb-ident-tools { display: flex; gap: var(--s2); justify-content: flex-end; flex-wrap: wrap; margin-bottom: var(--s3); }
.tb-ident-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); align-items: end; }
.tb-f-species { grid-column: span 2; }
.tb-pickbtn { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; min-width: 0; }
.tb-pickbtn[disabled] { opacity: .6; cursor: not-allowed; }
.tb-sp-name, .tb-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-sp-num { color: var(--text-dim); font-size: 12px; flex: none; }
.tb-dir-up, .tb-dir-down { font-size: 14px; line-height: 1; }
.tb-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }

/* moves */
.tb-moves { display: flex; flex-direction: column; gap: var(--s2); }
.tb-moves-note:empty { display: none; }
.tb-move { display: flex; align-items: stretch; border: 1px solid var(--line); border-left: 4px solid var(--tc, var(--line-2)); border-radius: var(--radius); background: var(--panel-2); }
.tb-move-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; border-radius: var(--radius); }
.tb-move-main:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.tb-move-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.tb-move-name { font: 700 15px var(--font-display); }
.tb-move-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font: 600 12px var(--font-display); color: var(--text-dim); }
.tb-move-desc { font-size: 12px; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tb-move-x { align-self: flex-start; margin: 6px 6px 0 0; }
.tb-move-empty { width: 100%; min-height: 64px; align-items: center; justify-content: center; gap: 8px; border: 2px dashed var(--line-2); background: transparent; color: var(--text-dim); cursor: pointer; font: 600 14px var(--font-display); }
.tb-move-empty:hover { color: var(--text); background: var(--panel-2); }
.tb-move-empty svg { width: 16px; height: 16px; }

/* stats */
.tb-st-list { display: flex; flex-direction: column; gap: 6px; }
.tb-st-row { display: grid; grid-template-columns: 46px minmax(60px, 1fr) 54px 46px 40px; gap: 6px; align-items: center; }
.tb-st-head { font: 600 11px var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 2px; }
.tb-c { text-align: center; }
.tb-st-name { display: flex; align-items: center; gap: 2px; font: 700 13px var(--font-display); }
.tb-nat { font-size: 10px; }
.tb-nat[data-dir="up"] { color: var(--yellow); }
.tb-nat[data-dir="down"] { color: var(--blue); }
.tb-st-mid { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tb-base { display: flex; align-items: center; gap: 8px; }
.tb-bar { flex: 1; height: 8px; border-radius: 999px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.tb-bar-fill { display: block; height: 100%; background: var(--bt, var(--red)); transition: width .25s var(--ease); }
.tb-bar[data-tier="1"] { --bt: var(--red); } .tb-bar[data-tier="2"] { --bt: var(--t-fire); } .tb-bar[data-tier="3"] { --bt: var(--yellow); }
.tb-bar[data-tier="4"] { --bt: var(--green); } .tb-bar[data-tier="5"] { --bt: var(--blue); }
.tb-base-num { width: 26px; text-align: right; font: 700 13px var(--font-display); font-variant-numeric: tabular-nums; }
.tb-slider { height: 20px; margin: 0; }
.tb-num-in { min-height: 36px; padding: 4px 2px; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.tb-num-in::-webkit-inner-spin-button, .tb-num-in::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.tb-final { text-align: center; font: 800 16px var(--font-display); }

/* ---------- team list ---------- */
.tb-grid { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.tb-card { display: flex; flex-direction: column; gap: var(--s3); }
.tb-chead { display: flex; align-items: center; gap: var(--s2); }
.tb-cname { margin-right: auto; min-width: 0; }
.tb-cname a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.tb-csprites { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.tb-cslot { aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-2); }
.tb-cslot.empty { border: 2px dashed var(--line); background: transparent; }
.tb-cardsprite { width: 88%; height: 88%; object-fit: contain; }
.tb-cmeta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s2); min-height: 28px; }
.tb-cov { display: inline-flex; align-items: center; gap: 8px; }
.tb-dots { display: grid; grid-template-columns: repeat(9, 10px); gap: 4px; }
.tb-cov-n, .tb-cov-none { font-size: 12px; }
.tb-cactions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto; }
.tb-empty { margin-top: var(--s2); }

/* ---------- phones and small tablets ---------- */
@media (max-width: 1180px) {
  .tb-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .tb-layout { grid-template-columns: minmax(0, 1fr); }
  .tb-rail { display: contents; }
  .tb-slotcard { order: 1; } .tb-main { order: 2; } .tb-info { order: 3; } .tb-summary { order: 4; } .tb-valcard { order: 5; }
  .tb-slots { flex-direction: row; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
  .tb-slot { flex: none; width: 108px; padding: 0; scroll-snap-align: start; }
  .tb-slot-main { flex-direction: column; justify-content: flex-start; gap: 4px; padding: 6px 4px; min-height: 100px; text-align: center; }
  .tb-slot-text { align-items: center; max-width: 100%; }
  .tb-slot-name { max-width: 96px; }
  .tb-slot-types { justify-content: center; }
  .tb-slot-tools { display: none; }
  .tb-slot-warn { position: absolute; top: 2px; right: 2px; }
}
@media (max-width: 720px) {
  .modal-backdrop:has(.tb-sheet) { padding: 0; align-items: stretch; }
  .modal.tb-sheet { width: 100%; max-height: none; height: 100dvh; border-radius: 0; display: flex; flex-direction: column; border: 0; }
  .tb-sheet .modal-head { padding-top: calc(var(--s4) + env(safe-area-inset-top)); }
  .tb-sheet .modal-body { flex: 1; min-height: 0; overflow: hidden; padding-bottom: calc(var(--s4) + env(safe-area-inset-bottom)); }
  .tb-sheet .tb-mp, .tb-sheet .tb-mp-body, .tb-sheet .tb-combo { flex: 1; min-height: 0; }
  .tb-sheet .tb-list { max-height: none; }
  .tb-chip { min-height: 36px; }
  .tb-pickbar { flex-direction: column-reverse; align-items: stretch; }
  .tb-viewtoggle { align-self: flex-end; }
  .tb-list.grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .tb-chosen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tb-mp-head { display: none; }
  .tb-mvrow { display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .tb-mv-name { flex: 1 1 55%; }
  .tb-mv-tags { flex: none; }
  .tb-mvrow .tb-num { text-align: left; }
  .tb-lab { display: inline; }
  .tb-mv-desc { flex: 1 1 100%; }
  .tb-ident { grid-template-columns: minmax(0, 1fr); }
  .tb-ident-art { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .tb-bigsprite { width: 112px; height: 112px; }
  .tb-f-species { grid-column: 1 / -1; }
  .tb-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- tiers, point costs, budget ---------- */
.tb-tier {
  --tc: var(--text-dim);
  display: inline-block; padding: 0 6px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--tc) 70%, transparent);
  background: color-mix(in srgb, var(--tc) 16%, transparent); color: var(--tc);
  font: 800 10px/16px var(--font-display); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; cursor: help;
}
.tb-tier[data-tier="uber"] { --tc: var(--red); }
.tb-tier[data-tier="ou"] { --tc: var(--yellow); }
.tb-tier[data-tier="uu"] { --tc: var(--blue); }
.tb-tier[data-tier="ru"] { --tc: var(--green); }
.tb-tier[data-tier="nu"] { --tc: var(--t-grass); }
.tb-tier[data-tier="low"] { --tc: var(--text-dim); }
.tb-tier[data-tier="lc"] { --tc: var(--t-flying); }
.tb-tier.mini { padding: 0 4px; font-size: 9px; line-height: 14px; }
.tb-cost {
  display: inline-block; padding: 0 6px; border-radius: 4px; border: 1px solid var(--line-2); background: var(--panel-3); color: var(--yellow);
  font: 700 10px/16px var(--font-display); letter-spacing: .04em; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.tb-cost.mini { padding: 0 4px; font-size: 9px; line-height: 14px; }
.tb-rtags { display: flex; align-items: center; gap: 4px; flex: none; }
.tb-cellmeta { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; min-height: 14px; }
.tb-row.over, .tb-cell.over { opacity: .55; }
.tb-pickrow { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); }
.tb-sel { min-height: 32px; padding: 2px 28px 2px 10px; font-size: 13px; width: auto; flex: 0 1 auto; }
.tb-budgetline { margin-left: auto; font: 700 12px var(--font-display); color: var(--yellow); }
.tb-budgetline.bad { color: var(--danger); }
.tb-cslot { position: relative; }
.tb-cslot .tb-tier { position: absolute; left: 2px; bottom: 2px; }
.tb-overbudget { color: var(--danger); font-weight: 600; }
.tb-vthumb + * { vertical-align: middle; }

.tb-budget { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s3); }
.tb-meter { height: 10px; border-radius: 999px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.tb-meter-fill { display: block; height: 100%; background: var(--yellow); transition: width .25s var(--ease), background .2s; }
.tb-meter[data-over="1"] .tb-meter-fill { background: var(--danger); }
.tb-budget.over strong { color: var(--danger); }
.tb-budget p { margin: 0; }
.tb-fmtnote { border-color: var(--yellow); background: color-mix(in srgb, var(--yellow) 8%, var(--panel)); }
