.compact-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  width: 100%;
}

.compact-table th,
.compact-table td {
  border-bottom: 1px solid var(--color-line);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
}

.compact-table th {
  background: var(--color-surface-2);
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 700;
}

.compact-table th.is-sortable {
  cursor: pointer;
  padding-right: 22px;
  user-select: none;
  white-space: nowrap;
}

.compact-table th.is-sortable::after {
  background: currentColor;
  content: "";
  display: block;
  height: 12px;
  mask: url("../assets/icons/sort.svg") center / contain no-repeat;
  opacity: 0.7;
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  -webkit-mask: url("../assets/icons/sort.svg") center / contain no-repeat;
  width: 12px;
}

.compact-table th.is-sortable:hover,
.compact-table th.is-sortable:focus {
  color: var(--color-text);
}

.compact-table th.is-sorted-asc::after {
  mask-image: url("../assets/icons/up.svg");
  opacity: 1;
  -webkit-mask-image: url("../assets/icons/up.svg");
}

.compact-table th.is-sorted-desc::after {
  mask-image: url("../assets/icons/down.svg");
  opacity: 1;
  -webkit-mask-image: url("../assets/icons/down.svg");
}

.compact-table thead th,
.compact-table thead th.is-sortable {
  position: sticky;
  top: var(--section-heading-height);
  z-index: 3;
}

.compact-table thead th::before {
  background: var(--color-line);
  bottom: -1px;
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  right: 0;
}

.compact-table.roll-history-table thead th,
.compact-table.roll-history-table thead th.is-sortable {
  position: static;
  top: auto;
  z-index: auto;
}

.compact-table.roll-history-table thead th::before {
  display: none;
}

.compact-table td.number,
.compact-table th.number {
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}

.compact-table td.table-center,
.compact-table th.table-center {
  text-align: center;
}

.skills-table th.skills-table__status,
.skills-table td.skills-table__status {
  padding-left: var(--space-2);
  padding-right: var(--space-1);
  text-align: center;
  vertical-align: middle;
  width: 18px;
}

.proficiency-icon {
  background: currentColor;
  color: var(--color-muted);
  cursor: help;
  display: inline-block;
  height: 12px;
  mask: var(--proficiency-icon) center / contain no-repeat;
  -webkit-mask: var(--proficiency-icon) center / contain no-repeat;
  vertical-align: -1px;
  width: 12px;
}

.proficiency-icon--none {
  --proficiency-icon: url("../assets/icons/proficiency-none.svg");
  color: var(--color-subtle);
}

.proficiency-icon--half {
  --proficiency-icon: url("../assets/icons/proficiency-half.svg");
}

.proficiency-icon--full {
  --proficiency-icon: url("../assets/icons/proficiency-full.svg");
  color: var(--color-text);
}

.proficiency-icon--expertise {
  --proficiency-icon: url("../assets/icons/proficiency-expertise.svg");
  color: var(--color-good);
}

.inventory-table th.inventory-table__equipped,
.inventory-table td.inventory-table__equipped {
  padding-left: var(--space-2);
  padding-right: var(--space-1);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  width: 18px;
}

.inventory-equipped-toggle {
  align-items: center;
  background: transparent;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  color: var(--color-good);
  cursor: pointer;
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  height: 14px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 14px;
}

.inventory-equipped-toggle.is-active {
  background: var(--color-surface-2);
  border-color: var(--color-line-strong);
}

.inventory-equipped-toggle:disabled {
  cursor: default;
}

.inventory-attunement-icon {
  align-items: center;
  border: 1px solid var(--color-line-strong);
  border-radius: 50%;
  color: #6b4fa3;
  cursor: help;
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  height: 14px;
  justify-content: center;
  line-height: 1;
  margin-left: var(--space-2);
  vertical-align: 1px;
  width: 14px;
}

.inventory-table th.inventory-table__value,
.inventory-table td.inventory-table__value {
  text-align: center;
  white-space: nowrap;
}

.inventory-table th.inventory-table__type,
.inventory-table td.inventory-table__type {
  padding-left: var(--space-1);
  padding-right: var(--space-1);
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  width: 22px;
}

.inventory-type-icon {
  --inventory-type-icon: url("../assets/icons/inventory-other.svg");
  background: currentColor;
  color: var(--color-muted);
  cursor: help;
  display: inline-block;
  height: 16px;
  mask: var(--inventory-type-icon) center / contain no-repeat;
  -webkit-mask: var(--inventory-type-icon) center / contain no-repeat;
  vertical-align: -3px;
  width: 16px;
}

.inventory-type-icon--weapon {
  --inventory-type-icon: url("../assets/icons/inventory-weapon.svg");
  color: #5f4a2f;
}

.inventory-type-icon--wondrous {
  --inventory-type-icon: url("../assets/icons/inventory-wondrous.svg");
  color: #6b4fa3;
}

.inventory-type-icon--ring {
  --inventory-type-icon: url("../assets/icons/inventory-ring.svg");
  color: #9a6a00;
}

.inventory-type-icon--tools {
  --inventory-type-icon: url("../assets/icons/inventory-tools.svg");
  color: #5b6874;
}

.inventory-type-icon--gear {
  --inventory-type-icon: url("../assets/icons/inventory-gear.svg");
  color: #526c7a;
}

.inventory-type-icon--armor {
  --inventory-type-icon: url("../assets/icons/inventory-armor.svg");
  color: #4f6270;
}

.inventory-type-icon--potion {
  --inventory-type-icon: url("../assets/icons/inventory-potion.svg");
  color: #8f3f2f;
}

.inventory-type-icon--focus {
  --inventory-type-icon: url("../assets/icons/inventory-focus.svg");
  color: #1d6fb8;
}

.inventory-type-icon--scroll {
  --inventory-type-icon: url("../assets/icons/inventory-scroll.svg");
  color: #7a5c35;
}

.inventory-type-icon--book {
  --inventory-type-icon: url("../assets/icons/inventory-book.svg");
  color: #3f5f53;
}

.inventory-value__amount {
  font-family: var(--font-mono);
  margin-right: var(--space-1);
}

.coin-marker {
  background: currentColor;
  cursor: help;
  display: inline-block;
  height: 10px;
  mask: url("../assets/icons/proficiency-full.svg") center / contain no-repeat;
  -webkit-mask: url("../assets/icons/proficiency-full.svg") center / contain no-repeat;
  vertical-align: -1px;
  width: 10px;
}

.coin-marker--cp {
  color: #b87333;
}

.coin-marker--sp {
  color: #a8b0b8;
}

.coin-marker--ep {
  color: #c7b36a;
}

.coin-marker--gp {
  color: #d8a92d;
}

.coin-marker--pp {
  color: #8faec4;
}

.action-table th:nth-child(1),
.action-table th:nth-child(2),
.action-table th:nth-child(3),
.action-table td:nth-child(1),
.action-table td:nth-child(2),
.action-table td:nth-child(3) {
  white-space: nowrap;
}

.concentration-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: #1d6fb8;
  cursor: pointer;
  display: inline-flex;
  height: 14px;
  justify-content: center;
  padding: 0;
  vertical-align: middle;
  width: 14px;
}

.concentration-toggle:disabled {
  cursor: default;
}

.concentration-toggle:focus-visible {
  outline: 2px solid #1d6fb8;
  outline-offset: 2px;
}

.concentration-icon {
  background: currentColor;
  display: inline-block;
  height: 12px;
  mask: url("../assets/icons/proficiency-full.svg") center / contain no-repeat;
  -webkit-mask: url("../assets/icons/proficiency-full.svg") center / contain no-repeat;
  vertical-align: -1px;
  width: 12px;
}

.spell-table__row--concentrating,
.spell-table__row--concentrating > td {
  background: rgb(29 111 184 / 12%);
}

.spell-table__row--concentrating .spell-name {
  font-weight: 700;
}

.action-table__weapon {
  position: relative;
}

.action-table__weapon-title {
  align-items: center;
  display: inline-flex;
  gap: var(--space-2);
}

.action-table__weapon-name {
  border-bottom: 1px dotted transparent;
  display: inline-block;
  font-weight: 700;
}

.action-table__weapon--has-notes .action-table__weapon-name {
  border-bottom-color: var(--color-muted);
  cursor: help;
}

.action-table__weapon-range {
  color: var(--color-muted);
  display: block;
  font-size: 11px;
  font-weight: 400;
  margin-top: 1px;
}

.action-table__notes-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgb(15 23 42 / 18%);
  color: var(--color-text);
  display: none;
  font-size: 12px;
  left: 0;
  line-height: 1.35;
  max-width: min(280px, 70vw);
  padding: var(--space-3);
  position: absolute;
  top: calc(100% + 4px);
  white-space: normal;
  z-index: 25;
}

.action-table__weapon:hover .action-table__notes-card,
.action-table__weapon:focus-within .action-table__notes-card {
  display: block;
}

.action-kind-icon {
  background: currentColor;
  display: inline-block;
  height: 16px;
  mask: var(--action-kind-icon) center / contain no-repeat;
  -webkit-mask: var(--action-kind-icon) center / contain no-repeat;
  vertical-align: -3px;
  width: 16px;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.spell-slots {
  display: grid;
  gap: var(--space-2);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.spell-table th.spell-table__prepared,
.spell-table td.spell-table__prepared {
  color: var(--color-good);
  font-weight: 700;
  padding-left: var(--space-2);
  padding-right: var(--space-1);
  text-align: center;
  vertical-align: middle;
  width: 18px;
}

.spell-table th.spell-table__concentration,
.spell-table td.spell-table__concentration {
  padding-left: var(--space-1);
  padding-right: var(--space-1);
  text-align: center;
  vertical-align: middle;
  width: 16px;
}

.spell-table th.spell-table__level,
.spell-table td.spell-table__level {
  padding-left: var(--space-1);
  padding-right: var(--space-1);
  text-align: center;
  width: 22px;
}

.spell-table th.spell-table__level.is-sortable {
  padding-right: 16px;
}

.spell-table th.spell-table__level.is-sortable::after {
  right: 2px;
}

.spell-name--srd {
  border-bottom: 1px dotted var(--color-muted);
  cursor: help;
}

.spell-name-cell {
  position: relative;
}

.spell-component-cost {
  align-items: center;
  color: var(--color-muted);
  display: inline-flex;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  gap: 2px;
  margin-left: var(--space-2);
  white-space: nowrap;
}

.spell-component-cost__coin {
  cursor: help;
  height: 9px;
  width: 9px;
}

.srd-hover-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgb(15 23 42 / 18%);
  color: var(--color-text);
  display: none;
  font-size: 12px;
  left: 0;
  line-height: 1.35;
  max-height: 340px;
  overflow: auto;
  padding: var(--space-4);
  position: absolute;
  top: calc(100% + 4px);
  width: min(320px, 70vw);
  z-index: 20;
}

.srd-hover-card--floating {
  left: 0;
  position: fixed;
  top: 0;
  z-index: 1000;
}

.srd-hover-card.is-visible {
  display: block;
}

.srd-hover-card__header {
  align-items: start;
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
}

.srd-hover-card__close {
  align-items: center;
  background: var(--color-surface-2);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  color: var(--color-muted);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  height: 22px;
  justify-content: center;
  line-height: 1;
  margin: calc(var(--space-2) * -1) calc(var(--space-2) * -1) 0 0;
  padding: 0;
  width: 22px;
}

.srd-hover-card__close:hover,
.srd-hover-card__close:focus {
  border-color: var(--color-line-strong);
  color: var(--color-text);
}

.spell-name-cell:hover .srd-hover-card,
.spell-name-cell:focus-within .srd-hover-card,
.spell-name-cell.is-card-pinned .srd-hover-card {
  display: block;
}

.srd-hover-card__title {
  font-size: 13px;
  font-weight: 700;
}

.srd-hover-card__subtitle {
  color: var(--color-muted);
  font-size: 11px;
  margin-top: 1px;
}

.srd-hover-card__facts {
  display: grid;
  gap: var(--space-2) var(--space-3);
  grid-template-columns: max-content minmax(0, 1fr);
  margin: var(--space-3) 0;
}

.srd-hover-card__facts dt {
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 700;
}

.srd-hover-card__facts dd {
  margin: 0;
}

.srd-hover-card__description {
  display: grid;
  gap: var(--space-3);
}

.srd-hover-card__description p {
  margin: 0;
}

.srd-hover-card__more {
  color: var(--color-muted);
  font-size: 11px;
}
