/* Controls shared by the desktop table, portrait cards and compact landscape view. */
.theme-toggle .icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}
.theme-toggle .theme-sun,
[data-theme='dark'] .theme-toggle .theme-moon {
  display: none;
}
[data-theme='dark'] .theme-toggle .theme-sun {
  display: block;
}
#themeToggle {
  margin-left: auto;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
#themeToggle + #dbState {
  margin-left: 0;
}
.group-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 3px 0;
  width: 100%;
}
.group-toggle .icon:last-child {
  margin-left: auto;
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}
.group-toggle[aria-expanded='false'] .icon:last-child {
  transform: rotate(-90deg);
}
.group-toggle .band-title {
  min-width: 0;
}
.drag-handle {
  touch-action: none;
  position: absolute;
  right: 4px;
  bottom: 3px;
  z-index: 2;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border-radius: 6px;
}
.drag-handle .icon {
  width: 15px;
  height: 15px;
  stroke-width: 3.4;
  stroke-linecap: round;
}
.drag-handle:active,
.reordering * {
  cursor: grabbing;
}
.reordering .drag-origin .ship-card {
  opacity: 0.65;
}
th.drop-before,
th.drop-after {
  position: relative;
}
th.drop-before::after,
th.drop-after::after {
  content: '';
  position: absolute;
  background: #de9252;
  width: 4px;
  inset: 0 auto 0 0;
  z-index: 7;
  pointer-events: none;
}
th.drop-after::after {
  left: auto;
  right: 0;
}
.order-list {
  display: grid;
  gap: 5px;
}
.order-place {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: left;
  color: var(--ink);
}
.order-place b {
  font-variant-numeric: tabular-nums;
  color: var(--teal);
}
.order-place small {
  margin-left: auto;
}
.order-place:disabled {
  opacity: 0.5;
}
.filter-polarity {
  margin: 16px 0 5px;
}
.chip.sel[data-g='excluded'] {
  color: #954b40;
  background: #fae9df;
  border-style: dashed;
  border-color: #bd8373;
}
.chip.sel[data-g='excluded']::before {
  content: '−';
  font-weight: 750;
}
.chip.other-filter {
  border-style: dashed;
}
[data-theme='dark'] .chip.sel[data-g='excluded'] {
  color: #f1b6a3;
  background: #412e2d;
  border-color: #b97b60;
}
.card-section > summary {
  cursor: pointer;
  font-weight: 650;
}
.card-section > summary:hover,
.group-toggle:hover {
  color: var(--teal);
}
#detail .card-section > summary {
  display: list-item;
  list-style: disclosure-closed;
}
#detail .card-section[open] > summary {
  list-style: disclosure-open;
  margin-bottom: 8px;
}
#detail .card-section:not([open]) {
  padding-top: 9px;
  padding-bottom: 9px;
}
.ship-cell .weapons-strip {
  max-width: 100%;
}
#detail .card-section + .card-section {
  margin-block-start: 0;
}
@media (max-width: 600px) {
  .mast-inner {
    column-gap: 4px;
  }
  #themeToggle {
    width: 29px;
    height: 29px;
  }
  .group-toggle {
    gap: 2px;
  }
  .drag-handle {
    height: 24px;
    width: 24px;
    bottom: 1px;
    right: 1px;
  }
  .group-toggle .icon:first-child {
    display: none;
  }
  .viewtabs {
    min-width: 0;
  }
  .viewtabs button {
    white-space: nowrap;
    padding-inline: 4px;
  }
  .viewtabs button .icon {
    width: 12px;
  }
  .quiet[data-bookmark] {
    padding-inline: 3px;
  }
}
.comp-table .sticky > .stat-symbol,
.detail-sec .kv > span > .stat-symbol {
  margin-inline-end: 5px;
}
.ship-cell > .ship-symbols {
  padding: 4px 6px;
  align-content: flex-start;
}
.ship-cell {
  vertical-align: top;
}
@media (max-width: 610px), (orientation: landscape) and (max-height: 550px) {
  .ship-cell > .ship-symbols {
    padding: 2px 3px;
    gap: 2px 3px;
    --symbol-size: 19px;
  }
  .ship-cell .ship-symbols__weapons,
  .ship-cell .ship-symbols__gear,
  .ship-cell .ship-symbols__slot {
    display: contents;
  }
  .ship-cell .ship-symbols__or {
    font-size: 9px;
  }
}
.filter-shortcuts{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0 0}
.filter-shortcuts .chip .icon{width:13px;height:13px}
.ship-cell .country {display:inline-flex;align-items:center;gap:4px}
.ship-meta .acq-mark,.tile-rank .acq-mark {font-size:12px;gap:3px}
.ship-meta .acq-mark img,.tile-rank .acq-mark img {width:21px;height:17px;background:#35433d;border-radius:3px;padding:1px}
.tile-rank{position:absolute;top:8px;left:8px;display:inline-flex;align-items:center;padding:3px 5px;color:var(--ink);background:var(--surface-glass);border-radius:4px;border:1px solid var(--line)}
.tile-meta .acq-flag,.detail-summary b>.acq-flag,.listitem .acq-flag{margin-inline-end:3px}
@media(max-width:695px) {
 .quiet[data-bookmark] span{display:none}
 .quiet[data-bookmark]{width:28px;min-width:28px;flex:none}
 .viewtabs{gap:1px}
 .ship-meta{padding-right:40px}
 .ship-meta .ship-class{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .ship-meta .acq-mark,.tile-rank .acq-mark {font-size:10px}
 .ship-meta .acq-mark img{width:16px;height:13px}
 .comp-table .sticky[scope="row"]{overflow-wrap:anywhere;hyphens:auto}
}
@media(max-width:350px){.viewtabs button{font-size:10px;gap:3px}}
@media(orientation:landscape) and (max-height:550px){
 .ship-cell .country{display:none}
}
@media(max-width:480px) {
  .viewline {display:grid;grid-template-columns:minmax(0,1fr) 28px;gap:4px;align-items:center}
  .viewtabs{display:flex;justify-content:flex-start;gap:2px;min-width:0}
  .viewtabs button {padding:7px 5px;font-size:12px;min-width:0}
  .viewline .viewtabs button .icon {display:none}
  .viewline .quiet[data-bookmark]{justify-self:end}
}
