/* Sheet list grids: spells, inventory, attacks (sheet step only) */

.sheet-list {
  font-size: 13px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sheet-list-entry {
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 42%, transparent);
  min-width: 0;
  max-width: 100%;
  margin-bottom: 6px;
}

.sheet-card .sheet-list-entry:nth-child(even of .sheet-list-entry),
.sheet-list > .sheet-list-entry:nth-child(even of .sheet-list-entry) {
  background: color-mix(in srgb, var(--ink) 5%, transparent);
}

.sheet-card .sheet-list-entry:nth-child(odd of .sheet-list-entry),
.sheet-list > .sheet-list-entry:nth-child(odd of .sheet-list-entry) {
  background: color-mix(in srgb, var(--panel) 42%, transparent);
}

.sheet-list .sheet-list-entry {
  margin-bottom: 0;
}

.sheet-list-entry .sc-d {
  padding: 0 10px 10px;
}

.sheet-list-entry .sc-h.sheet-list-row-head,
.sheet-list-entry .sc-h:not(.sheet-list-row-head) {
  padding: 8px 10px;
  border-bottom: none;
}

.sheet-list-entry .aspire-fivetools-entry-btn {
  margin-top: 8px;
}

.inv-res-item.sheet-list-entry .inv-res-row {
  border-bottom: none;
  padding: 8px 10px;
}

.inv-res-item.sheet-list-entry .inv-desc {
  border-top: none;
  margin: 0 10px 10px;
  padding: 0 0 8px;
}

.sheet-list-cols {
  display: grid;
  align-items: start;
  gap: 8px 10px;
  min-width: 0;
}

.sheet-list-head {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--line);
}

.sheet-list-spells .sheet-list-entry {
  container-type: inline-size;
  container-name: spell-row;
}

.sheet-list-spells .sheet-spell-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.sheet-list-spells .sheet-spell-row > .sc-chev {
  margin-left: 0;
  grid-column: 3;
}

.sl-row-name {
  grid-column: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.sl-row-chips {
  grid-column: 2;
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  flex-wrap: nowrap;
  justify-content: flex-end;
  overflow: hidden;
}

.sl-chip {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  flex: 0 0 auto;
}

.sl-lvl-chip {
  text-transform: lowercase;
  font-size: 10px;
}

.sl-comp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 4px;
  border: 1px solid var(--line2);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: var(--secondary-ink);
  line-height: 1.35;
}

.sl-detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--secondary-ink);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line2);
}

.sl-detail-k {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.35px;
  color: var(--muted);
  margin-right: 4px;
}

.sheet-list-spells .sc-item.open .sc-d {
  display: block;
}

@container spell-row (max-width: 520px) {
  .sheet-list-spells .sl-comp-badge {
    display: none;
  }
}

@container spell-row (max-width: 440px) {
  .sheet-list-spells .sl-chip.sl-range {
    display: none;
  }
}

@container spell-row (max-width: 380px) {
  .sheet-list-spells .sl-chip.sl-time {
    display: none;
  }
}

@container spell-row (max-width: 320px) {
  .sheet-list-spells .sl-chip.sl-school,
  .sheet-list-spells .sl-chip.sl-lvl-chip {
    display: none;
  }
}

.sheet-list-inv .sheet-list-cols {
  grid-template-columns: minmax(0, 3fr) minmax(2.25em, 0.55fr) minmax(3em, 0.7fr) minmax(4.5em, 1fr);
}

.sheet-list-inv .inv-list-head,
.sheet-list-inv .inv-list-row {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 8px 10px;
  margin-bottom: 0;
}

.sheet-list-inv .inv-list-head .sl-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-list-atk .sheet-list-cols {
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 0.75fr) minmax(0, 1fr) minmax(0, 1.1fr);
}

.sheet-list-row,
.sheet-list-row-head {
  padding: 7px 8px;
  border-bottom: none;
  cursor: default;
  min-width: 0;
}

.sheet-list-entry:last-child .sheet-list-row,
.sheet-list-entry:last-child .sheet-list-row-head {
  border-bottom: none;
}

.sheet-list-entry .sc-h.sheet-list-row {
  cursor: pointer;
  font-weight: 700;
  user-select: none;
}

.sheet-list-entry .sc-h.sheet-list-row:hover {
  color: var(--accent);
}

.sl-cell {
  min-width: 0;
  overflow-wrap: anywhere;
}

.sl-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  min-width: 0;
  overflow: hidden;
}

.sl-lvl {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.sl-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
  margin-left: 4px;
  vertical-align: middle;
}

.sl-tag-ico {
  color: var(--muted);
}

.sl-duration .sl-tag {
  margin-left: 0;
}

.sheet-list-phone-meta {
  display: none;
}

.combat-action-tags {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--line2);
  line-height: 1.6;
}

.combat-action-tags .tag-ref {
  margin-right: 4px;
}

.equip-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.equip-icon-btn:hover {
  color: var(--ink);
  border-color: var(--line);
}

.equip-icon-btn.on {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--head);
}

.equip-icon-btn.on .equip-ico {
  fill: currentColor;
  stroke: currentColor;
}

.inv-list-row .ctrl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.inv-item .inv-row {
  border: none;
  background: none;
  margin: 0;
}

.inv-item.sheet-list-entry {
  margin-bottom: 0;
  container-type: inline-size;
  container-name: inv-item;
}

.inv-item.sheet-list-entry.open .inv-desc {
  border-top: 1px solid var(--line2);
  margin: 0;
  padding: 8px 10px 10px;
}

.inv-meta-inline {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@container inv-item (max-width: 340px) {
  .inv-meta-inline {
    display: none;
  }
}

.inv-list-row {
  align-items: center;
}

.sheet-list-atk .atk-row {
  border-bottom: none;
}

.sheet-list-atk .atk-row:last-child {
  border-bottom: none;
}

.sheet-list-atk .atk-row.has-desc .atk-list-row {
  cursor: pointer;
}

.sheet-list-atk .atk-row.has-desc .atk-list-row:hover .atk-name {
  color: var(--accent);
}

.sheet-list-atk .atk-row .sc-d,
.sheet-list-atk .atk-row .atk-desc-in {
  display: none;
  font-size: 12px;
  color: var(--secondary-ink);
  border-left: none;
  padding: 0 10px 10px;
  margin: 0;
}

.sheet-list-atk .atk-row.open .sc-d,
.sheet-list-atk .atk-row.open .atk-desc-in {
  display: block;
}

.atk-row.has-desc .atk-chev {
  display: inline-block;
  color: var(--muted);
  font-size: 10px;
  transition: transform 0.15s;
}

.atk-row.has-desc.open .atk-chev {
  transform: rotate(180deg);
}

.sl-phone-range {
  display: none;
}

@media (max-width: 600px) {
  .sheet-list-head {
    display: none;
  }

  .sheet-list-atk .atk-list-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .sheet-list-atk .atk-list-row .sl-cell:not(.sl-name) {
    display: none;
  }

  .sheet-list-inv .inv-list-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px 8px;
  }

  .sheet-list-inv .inv-list-row .sl-name {
    grid-column: 1 / -1;
  }

  .sheet-list-inv .inv-list-row .sl-cell.sl-qty,
  .sheet-list-inv .inv-list-row .sl-cell.sl-weight {
    display: block;
  }

  .sheet-list-inv .inv-list-row .sl-cell:not(.sl-name):not(.sl-qty):not(.sl-weight) {
    display: none;
  }

  .sheet-list-phone-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px 8px;
    width: 100%;
    font-size: 11px;
    margin-top: 4px;
  }

  .sheet-list-inv .inv-list-row .sl-qty::before,
  .sheet-list-inv .inv-list-row .sl-weight::before {
    display: block;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    color: var(--muted);
    margin-bottom: 2px;
  }

  .sheet-list-inv .inv-list-row .sl-qty::before {
    content: "Qty";
  }

  .sheet-list-inv .inv-list-row .sl-weight::before {
    content: "Weight";
  }

  .sl-phone-k {
    display: block;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.35px;
    color: var(--muted);
  }

  .sl-phone-v {
    display: block;
    color: var(--secondary-ink);
    font-weight: 600;
  }

  .sl-phone-range {
    display: block;
    width: 100%;
    font-size: 11px;
    color: var(--muted);
  }
}
