:root {
  color-scheme: dark;
  --bg: #171717;
  --panel: #202020;
  --panel-soft: #262626;
  --panel-strong: #2d2d2d;
  --ink: #f1f1f1;
  --muted: #b6b6b6;
  --line: #3a3a3a;
  --accent: #47b987;
  --accent-strong: #63d6a1;
  --accent-ink: #07150f;
  --gold: #d7a84f;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.4;
}

button,
input,
select {
  font: inherit;
}

.panel h2,
.panel h3 {
  margin: 0;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button {
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--accent-strong);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 28vw);
  gap: 16px;
  padding: 16px;
  max-width: 1760px;
  height: 100vh;
  margin: 0 auto;
  overflow: hidden;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.settings-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  scrollbar-color: var(--line) transparent;
}

.results-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
}

.results-scroll {
  display: grid;
  align-content: start;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 12px;
  scrollbar-gutter: stable;
  scrollbar-color: var(--line) transparent;
}

.results-section-toggles {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.results-section-toggle {
  appearance: none;
  border: 1px solid rgba(185, 195, 215, 0.16);
  border-radius: 999px;
  background: rgba(12, 12, 13, 0.55);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 5px 6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.results-section-toggle:hover,
.results-section-toggle:focus-visible {
  border-color: rgba(97, 211, 148, 0.5);
  color: #f1f5f9;
  outline: none;
}

.results-section-toggle--active {
  border-color: rgba(97, 211, 148, 0.5);
  background: rgba(97, 211, 148, 0.14);
  color: #61d394;
}

.result-section-hidden {
  display: none !important;
}

.results-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(185, 195, 215, 0.16);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-subtitle {
  color: var(--muted);
  margin: 4px 0 0;
}

.subsection-title {
  margin-top: 18px;
}

.tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  margin: 0 -16px;
  padding: 0 16px;
  background: var(--panel);
}

.tab-button {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
}

.tab-button:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

.tab-button.is-active {
  background: var(--panel-soft);
  border-color: var(--line);
  color: var(--accent-strong);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  margin-left: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 6px;
  background: #151515;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.tab-button.is-active .tab-badge {
  color: var(--accent-strong);
}

.tab-panels {
  flex: 1 1 auto;
  display: grid;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  padding-top: 16px;
  scrollbar-color: var(--line) transparent;
}

.tab-panel {
  min-height: 0;
  overflow: hidden;
}

.tab-panel.is-active {
  height: 100%;
}

.tab-panel[hidden] {
  display: none;
}

#panelBuffs.is-active {
  overflow-y: auto;
  padding-right: 8px;
  overscroll-behavior: contain;
  scrollbar-color: var(--line) transparent;
}

#panelFight.is-active {
  overflow-y: auto;
  padding-right: 8px;
  overscroll-behavior: contain;
  scrollbar-color: var(--line) transparent;
}

#panelRotation.is-active {
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-color: var(--line) transparent;
}

.compact-field {
  display: grid;
  gap: 5px;
  min-width: 210px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  background: #171717;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid rgba(71, 185, 135, 0.28);
  border-color: var(--accent);
}

select option {
  background: #171717;
  color: var(--ink);
}

.slot-grid {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.gear-selection-layout {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

.stat-weights-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  border: 1px solid #2f2f2f;
  border-radius: 8px;
  background: #191919;
  padding: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 10px;
  scrollbar-gutter: stable;
  scrollbar-color: var(--line) transparent;
}

.gear-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.stat-weights-panel h3 {
  color: var(--ink);
  font-size: 1rem;
}

.gear-character-controls {
  display: grid;
  gap: 10px;
}

.gear-tools {
  display: grid;
  gap: 8px;
}

.gear-tool-button {
  min-height: 32px;
  border-color: rgba(71, 185, 135, 0.65);
  background: rgba(71, 185, 135, 0.12);
  color: #69e2a8;
  font-size: 0.74rem;
  font-weight: 900;
}

.gear-tool-button:hover {
  border-color: var(--green);
  background: rgba(71, 185, 135, 0.2);
}

.gear-tool-button:disabled {
  color: var(--muted);
  border-color: #343434;
  background: #141414;
  cursor: wait;
}

.gear-optimizer-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(1px);
}

.gear-optimizer-modal__panel {
  display: grid;
  gap: 12px;
  width: min(420px, calc(100vw - 40px));
  border: 1px solid rgba(71, 185, 135, 0.65);
  border-radius: 8px;
  background: #141414;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  padding: 20px;
}

.gear-optimizer-modal__panel h2 {
  color: var(--ink);
  font-size: 1.1rem;
}

.gear-optimizer-modal__panel p {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.gear-optimizer-modal__track {
  height: 10px;
  overflow: hidden;
  border: 1px solid #343434;
  border-radius: 999px;
  background: #0d0d0d;
}

.gear-optimizer-modal__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #47b987, #69e2a8);
  transition: width 120ms ease;
}

.gear-character-control {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.gear-character-control select {
  min-height: 32px;
  border-color: #343434;
  background-color: #141414;
  color: #d7dde8;
  font-weight: 800;
}

.gear-character-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.1;
  user-select: none;
  -webkit-user-select: none;
}

.gear-stat-weight-lock-row {
  justify-content: flex-start;
  margin-top: -5px;
}

.gear-character-checkbox input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--green);
}

.gear-character-checkbox input:focus {
  outline: none;
}

.gear-character-checkbox input:focus-visible {
  outline: 1px solid rgba(71, 185, 135, 0.7);
  outline-offset: 1px;
}

.stat-weights-list {
  display: grid;
  gap: 10px;
}

.stat-weight-row {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.stat-weight-row input {
  min-height: 32px;
  border-color: #343434;
  background: #141414;
  color: #d7dde8;
  font-weight: 800;
}

.stat-weight-row input:disabled {
  color: var(--muted);
  opacity: 0.85;
}

.stat-weights-divider {
  height: 1px;
  margin: 4px 0;
  background: #303030;
}

.gear-tools-divider,
.gear-stat-weights-divider {
  display: none;
}

.gear-settings-heading,
.gear-stat-weights-heading {
  margin-top: 4px;
  padding-top: 18px;
  border-top: 2px solid #4a4a4a;
}

.gear-set-shelf {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px max-content;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid #2f2f2f;
  border-radius: 8px;
  background: #191919;
  padding: 10px 12px;
}

.gear-set-list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 6px;
  align-items: center;
  align-content: center;
  min-height: 0;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.gear-set-list::-webkit-scrollbar {
  display: none;
}

.gear-set-scroll-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 32px;
  min-height: 0;
  border: 1px solid #343434;
  border-radius: 5px;
  background: #141414;
  color: var(--muted);
  padding: 0 0 2px;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.gear-set-scroll-button:hover {
  border-color: var(--accent);
  background: #1d2420;
  color: var(--accent-strong);
}

.gear-set-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.gear-set-row {
  display: grid;
  grid-template-columns: max-content 22px 18px;
  gap: 0;
  align-items: center;
  width: max-content;
  max-width: 210px;
  padding-right: 8px;
  border: 1px solid #343434;
  border-radius: 5px;
  background: #141414;
}

.gear-set-row.is-active {
  border-color: rgba(100, 224, 162, 0.56);
  background: #1d2420;
}

.gear-set-row:hover {
  border-color: var(--accent);
  background: var(--accent-strong);
}

.gear-set-button {
  justify-content: start;
  min-height: 32px;
  min-width: 0;
  max-width: 148px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #d7dde8;
  padding: 6px 8px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gear-set-row.is-active .gear-set-button {
  color: #64e0a2;
}

.gear-set-row:hover .gear-set-button {
  color: #050805;
}

.gear-set-row:hover .gear-set-icon-button {
  color: #050805;
}

.gear-set-button:hover {
  background: transparent;
}

.gear-set-icon-button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 26px;
  min-height: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #9aa6bb;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 900;
}

.gear-set-icon-button:hover {
  background: transparent;
  color: #050805;
}

.gear-set-delete-button:hover {
  color: #651111;
}

.gear-actions {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  min-width: 0;
}

.gear-save-button {
  min-height: 38px;
  border-color: #3d4a43;
  border-radius: 5px;
  background: #1d2420;
  color: #8ef0bc;
  padding: 0 14px;
  font-weight: 900;
}

.gear-save-button:hover {
  border-color: #64e0a2;
  background: #243229;
  color: #ffffff;
}

.gear-completion-status {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid #343434;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.88);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.tab-button .gear-completion-status {
  margin-left: 7px;
  vertical-align: middle;
}

.gear-completion-status.is-warning {
  border-color: rgba(215, 168, 79, 0.58);
  color: #ffd465;
}

.gear-completion-status.is-complete {
  border-color: rgba(100, 224, 162, 0.56);
  color: #64e0a2;
}

.buff-calculation-status.is-disabled {
  border-color: rgba(235, 96, 96, 0.62);
  color: #ff6f6f;
}

.buff-calculation-status {
  cursor: pointer;
}

.gear-average-ilvl {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  border: 1px solid #343434;
  border-radius: 5px;
  background: rgba(20, 20, 20, 0.88);
  color: var(--muted);
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 800;
}

.gear-average-ilvl strong {
  color: #d7dde8;
  font-size: 0.95rem;
}

.gear-set-dialog[hidden] {
  display: none;
}

.gear-set-dialog {
  position: fixed;
  inset: 0;
  z-index: 100003;
  display: grid;
  place-items: center;
  background: rgba(9, 9, 11, 0.74);
}

.gear-checker-dialog {
  align-items: center;
  justify-items: center;
}

.gear-set-dialog__panel {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid #3d4351;
  border-radius: 8px;
  background: #15171d;
  box-shadow: 0 18px 80px rgba(0, 0, 0, 0.52);
  padding: 16px;
}

.gear-set-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.gear-set-dialog__header h2 {
  font-size: 1rem;
}

.gear-set-dialog__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  min-height: 0;
  border: 0;
  background: transparent;
  color: #bac6e3;
  padding: 0;
  font-size: 1.2rem;
}

.gear-set-dialog__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.gear-set-dialog__form,
.gear-set-dialog__form label {
  display: grid;
  gap: 10px;
}

.gear-set-dialog__form label span {
  color: #aeb8d1;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.gear-set-dialog__form input,
.gear-set-dialog__form textarea {
  min-height: 42px;
  border-color: #374056;
  background: #202635;
  color: #f0e6d2;
  font-weight: 800;
}

.gear-set-dialog__form textarea {
  resize: vertical;
}

.gear-set-dialog__body {
  color: #d7dde8;
  font-weight: 800;
}

.gear-set-dialog__body p {
  margin: 0 0 16px;
}

.gear-set-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.gear-set-dialog__cancel,
.gear-set-dialog__submit {
  min-height: 36px;
  border-radius: 5px;
  padding: 0 12px;
  font-weight: 900;
}

.gear-set-dialog__cancel {
  border-color: #40485d;
  background: #202635;
  color: #d7dde8;
}

.gear-set-dialog__submit {
  border-color: #3d4a43;
  background: #1d2420;
  color: #8ef0bc;
}

.gear-set-dialog__submit.is-danger {
  border-color: #684047;
  background: #331b20;
  color: #ff9a9a;
}

.gear-checker-dialog__panel {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  height: fit-content;
  max-height: calc(100vh - 32px);
  padding: 20px 26px;
  overflow: hidden;
}

.gear-checker-dialog__header {
  display: contents;
}

.gear-checker-dialog__header .gear-set-dialog__close {
  position: absolute;
  top: 8px;
  right: 10px;
}

.gear-checker-report {
  display: grid;
  gap: 30px;
  max-height: calc(100vh - 72px);
  overflow: auto;
  padding: 0 42px 0 0;
}

.gear-checker-summary {
  margin: 0;
}

.gear-checker-summary.is-complete {
  color: #64e0a2;
}

.gear-checker-summary.is-warning {
  color: #ffd465;
}

.gear-checker-success {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #64e0a2;
  font-weight: 900;
}

.gear-checker-success span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(100, 224, 162, 0.56);
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1;
}

.gear-checker-group {
  display: grid;
  gap: 0;
}

.gear-checker-group h3 {
  color: #aeb8d1;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gear-checker-group ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.gear-checker-group li {
  color: #d7dde8;
  line-height: 1.35;
}

.gear-compare-dialog__panel {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: hidden;
}

.gear-compare-dialog__body {
  display: grid;
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  overflow: auto;
}

.gear-compare-picker {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  border: 1px solid rgba(185, 195, 215, 0.13);
  border-radius: 6px;
  background: rgba(12, 12, 13, 0.48);
  padding: 14px;
}

.gear-compare-picker label {
  display: grid;
  gap: 7px;
}

.gear-compare-picker span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.gear-compare-picker select {
  width: 100%;
  min-width: 0;
}

.gear-compare-picker p {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.35;
}

.gear-compare-results {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.gear-paperdoll {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(260px, 34%) minmax(150px, 1fr) minmax(260px, 34%);
  gap: 14px;
  min-height: 0;
  overflow: hidden;
  border: 1px solid #2f2f2f;
  border-radius: 8px;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(20, 20, 20, 0.82), rgba(20, 20, 20, 0.5) 45%, rgba(20, 20, 20, 0.82)),
    radial-gradient(circle at 50% 32%, rgba(122, 70, 61, 0.18), transparent 42%), #191919;
}

@media (max-height: 940px) {
  .gear-paperdoll {
    gap: 10px;
    padding: 14px;
  }

  .gear-column {
    gap: 6px;
  }

  .gear-column-weapons {
    margin-top: 28px;
  }

  .gear-slot {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 7px;
    min-height: 54px;
  }

  .gear-slot-right {
    grid-template-columns: minmax(0, 1fr) 54px;
  }

  .item-icon,
  .gear-slot-icon {
    width: 52px;
    height: 52px;
  }

  .gear-item-name {
    font-size: 0.9rem;
  }

  .gear-slot-detail,
  .gear-slot-enchant {
    font-size: 0.7rem;
  }
}

.gear-side {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.gear-side-left {
  justify-content: flex-start;
  gap: 12px;
}

.gear-column {
  display: grid;
  gap: 10px;
}

.gear-column-weapons {
  margin-top: 0;
}

.gear-avatar {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  opacity: 0.5;
}

.gear-avatar__halo {
  position: absolute;
  width: min(420px, 100%);
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 36%, rgba(215, 168, 79, 0.2), transparent 24%),
    radial-gradient(circle at 50% 55%, rgba(95, 95, 95, 0.2), transparent 52%);
  filter: blur(2px);
}

.gear-avatar__body {
  position: relative;
  width: min(250px, 90%);
  aspect-ratio: 0.58;
}

.gear-avatar__body span {
  position: absolute;
  display: block;
  background: linear-gradient(145deg, rgba(121, 121, 121, 0.18), rgba(45, 45, 45, 0.1));
  border: 1px solid rgba(150, 150, 150, 0.12);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.gear-avatar__body span:nth-child(1) {
  top: 2%;
  left: 34%;
  width: 32%;
  aspect-ratio: 1;
  border-radius: 999px;
}

.gear-avatar__body span:nth-child(2) {
  top: 19%;
  left: 13%;
  width: 74%;
  height: 44%;
  clip-path: polygon(50% 0, 100% 18%, 82% 100%, 18% 100%, 0 18%);
}

.gear-avatar__body span:nth-child(3) {
  top: 58%;
  left: 25%;
  width: 50%;
  height: 40%;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
}

.gear-slot {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 62px;
  border: 0;
  border-radius: 6px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.gear-slot:hover {
  background: rgba(255, 255, 255, 0.045);
}

.gear-slot-right {
  grid-template-columns: minmax(0, 1fr) 62px;
  text-align: right;
}

.gear-slot-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.gear-slot-label {
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 700;
}

.gear-item-name {
  overflow: hidden;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gear-slot-detail,
.gear-slot-enchant {
  overflow: hidden;
  color: #38f02d;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gear-slot-enchant {
  color: #1eff00;
  cursor: pointer;
}

.gear-slot-enchant:hover {
  text-decoration: underline;
}

.item-icon,
.gear-slot-icon {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 58px;
  height: 58px;
  border: 1px solid #6d7783;
  border-radius: 2px;
  background: linear-gradient(145deg, rgba(82, 82, 82, 0.35), rgba(9, 9, 9, 0.96)), #111111;
  box-shadow: inset 0 0 0 1px #0e0e0e;
  flex: 0 0 auto;
}

.item-icon img,
.gear-slot-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-icon.is-empty,
.gear-slot-icon.is-empty {
  opacity: 0.72;
  filter: grayscale(1);
}

.item-icon-glyph {
  color: #bcbcbc;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
}

.item-level {
  position: absolute;
  top: 2px;
  left: 2px;
  z-index: 2;
  min-width: 2ch;
  padding: 2px 4px 3px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.78);
  color: #f4f1e8;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 0.9;
  text-align: center;
  text-shadow: 0 1px 1px #000000;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 2px 5px rgba(0, 0, 0, 0.55);
}

.gear-slot-gems {
  position: absolute;
  left: 50%;
  bottom: 2px;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 2px;
  max-width: calc(100% - 4px);
  pointer-events: auto;
  transform: translateX(-50%);
}

.gear-slot-gem {
  display: block;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 2px;
  background: #050505;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  cursor: pointer;
}

.gear-slot-gem.is-empty {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 55%), #050505;
}

.gear-slot-gem.is-empty.socket-meta {
  border-color: #d6d6d6;
}

.gear-slot-gem.is-empty.socket-red {
  border-color: #d74f4f;
}

.gear-slot-gem.is-empty.socket-yellow {
  border-color: #d7b84f;
}

.gear-slot-gem.is-empty.socket-blue {
  border-color: #4f8ed7;
}

.gear-slot-gem:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.34),
    0 2px 5px rgba(0, 0, 0, 0.75);
}

.gear-slot-gem-icon {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.gear-slot-gem-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quality-epic {
  color: #a335ee;
}

.quality-rare {
  color: #0070dd;
}

.quality-uncommon {
  color: #1eff00;
}

.quality-common {
  color: #ffffff;
}

.gear-modal[hidden] {
  display: none;
}

.gear-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  background: rgba(9, 9, 11, 0.74);
}

.gear-modal__panel {
  display: flex;
  flex-direction: column;
  width: min(68vw, 1280px);
  height: min(78vh, calc(100vh - 48px));
  min-height: 0;
  border: 1px solid #3d4351;
  border-radius: 6px;
  background: #15171d;
  box-shadow: 0 18px 80px rgba(0, 0, 0, 0.52);
}

.gear-modal__header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 4px;
}

.gear-modal__header h2 {
  font-size: 1.1rem;
}

.gear-modal__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gear-modal__unequip {
  min-height: 34px;
  border-color: #40485d;
  border-radius: 4px;
  background: #202635;
  color: #d7dde8;
  padding: 0 12px;
  font-weight: 800;
}

.gear-modal__unequip:hover:not(:disabled) {
  background: #2b3242;
  color: #ffffff;
}

.gear-modal__unequip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gear-modal__close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 0;
  border: 0;
  background: transparent;
  color: #bac6e3;
  padding: 0;
  font-size: 1.5rem;
}

.gear-modal__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.gear-modal__tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid #687080;
  margin: 0 18px;
}

.gear-picker-tab {
  min-height: 40px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #aeb8d1;
  padding: 8px 10px;
  font-weight: 800;
}

.gear-picker-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.gear-picker-tab.is-active {
  border-bottom-color: #ffffff;
  color: #ffffff;
}

.gear-modal__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.gear-picker {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.gear-picker-toolbar {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) auto;
  gap: 9px;
  align-items: end;
  padding: 14px 18px 12px;
}

.gear-picker-toolbar label {
  display: grid;
  gap: 5px;
  color: #aeb8d1;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.gear-picker-toolbar input,
.gear-picker-toolbar select {
  height: 44px;
  min-height: 44px;
  border-color: #374056;
  border-radius: 0;
  background: #202635;
  padding: 0 12px;
  line-height: 1;
}

.gear-picker-toolbar input[type="search"] {
  appearance: none;
}

.gear-search-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #374056;
  border-radius: 3px;
  background: #202635;
  padding: 5px 8px;
}

.gear-search-box input[type="search"] {
  flex: 1 1 180px;
  min-width: 110px;
  height: 32px;
  min-height: 32px;
  border: 0;
  background: transparent;
  padding: 0 4px;
}

.gear-search-box input[type="search"]:focus {
  outline: none;
  box-shadow: none;
}

.gear-search-chips {
  display: contents;
}

.gear-search-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(104, 224, 138, 0.45);
  border-radius: 999px;
  background: rgba(104, 224, 138, 0.12);
  color: #baf7cd;
  font-size: 0.76rem;
  font-weight: 800;
  overflow: hidden;
}

.gear-search-chip button {
  min-height: 24px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
}

.gear-search-chip button:hover {
  background: transparent;
  color: #ffffff;
}

.gear-search-chip__edit {
  padding-left: 8px !important;
  padding-right: 4px !important;
}

.gear-search-chip__remove {
  min-width: 22px;
  padding-right: 7px !important;
}

.gear-search-chip.is-negated {
  border-color: rgba(243, 200, 75, 0.48);
  background: rgba(243, 200, 75, 0.12);
  color: #f0d98b;
}

.gear-search-chip:hover {
  background: rgba(104, 224, 138, 0.22);
  color: #ffffff;
}

.gear-search-chip.is-negated:hover {
  background: rgba(243, 200, 75, 0.22);
}

.gear-picker-clear {
  height: 44px;
  min-height: 44px;
  border-color: #40485d;
  border-radius: 4px;
  background: #202635;
  color: #d7dde8;
  padding: 0 12px;
  font-weight: 800;
}

.gear-picker-clear:hover:not(:disabled) {
  background: #2b3242;
  color: #ffffff;
}

.gear-picker-clear:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gear-picker-filter-summary {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  color: #9aa6bb;
  font-size: 0.78rem;
  font-weight: 800;
}

.gear-picker-filter-note {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid #384153;
  border-radius: 999px;
  background: #202635;
  color: #d7dde8;
  padding: 0 8px;
}

.gear-picker-filter-note {
  border-color: rgba(243, 200, 75, 0.42);
  color: #f0d98b;
}

.gem-picker-toolbar input[type="search"],
.enchant-picker-toolbar input[type="search"] {
  min-width: 0;
}

.gear-picker-table {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 18px 16px;
}

.gear-picker-head,
.gear-picker-row {
  display: grid;
  grid-template-columns: 58px 20px minmax(180px, 0.62fr) minmax(92px, 0.16fr) 66px minmax(220px, 0.78fr);
  align-items: center;
  column-gap: 6px;
  row-gap: 9px;
  padding-left: 10px;
  padding-right: 10px;
}

.enchant-picker-head,
.enchant-picker-row,
.gem-picker-head,
.gem-picker-row {
  grid-template-columns: minmax(120px, 0.32fr) minmax(92px, 0.16fr) 66px minmax(220px, 0.78fr);
}

.enchant-picker-head,
.gem-picker-head {
  padding-left: 12px;
}

.enchant-picker-head,
.enchant-picker-row,
.gem-picker-head,
.gem-picker-row {
  gap: 9px;
  padding-left: 10px;
  padding-right: 10px;
}

.enchant-picker-head span:nth-child(2),
.enchant-picker-row .gear-picker-delta,
.gem-picker-head span:nth-child(2),
.gem-picker-row .gear-picker-delta {
  text-align: left;
}

.gear-picker-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #15171d;
  color: var(--ink);
  padding-top: 7px;
  padding-bottom: 7px;
  font-weight: 800;
}

.gear-picker-head > span {
  justify-self: start;
  min-width: 0;
  text-align: left;
}

.gear-picker-head > :nth-child(6) {
  padding-left: 34px;
}

.enchant-picker-head > :nth-child(4),
.gem-picker-head > :nth-child(4) {
  padding-left: 34px;
}

.gear-picker-sort {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  font-weight: 800;
}

.gear-picker-sort:hover,
.gear-picker-sort.is-active {
  background: transparent;
  color: #ffffff;
}

.gear-picker-sort-arrow {
  width: 1ch;
  color: currentColor;
  font-size: 0.8rem;
  line-height: 1;
}

.gear-picker-row {
  width: 100%;
  min-height: 68px;
  border: 0;
  border-radius: 0;
  padding-top: 8px;
  padding-bottom: 8px;
  background: #181b22;
  color: var(--ink);
  text-align: left;
}

.gear-picker-row:nth-child(odd) {
  background: #24272f;
}

.gear-picker-row:hover,
.gear-picker-row.is-selected {
  background: #30333d;
}

.gear-picker-row:focus-visible {
  outline: 2px solid rgba(104, 224, 138, 0.72);
  outline-offset: -2px;
}

.gear-picker-row.is-pinned {
  border-top: 1px solid rgba(243, 200, 75, 0.28);
  border-bottom: 1px solid rgba(243, 200, 75, 0.18);
  background: #242532;
}

.gear-picker-row.is-selected .picker-item-icon {
  border-color: #1eff00;
  box-shadow: 0 0 0 2px rgba(30, 255, 0, 0.86);
}

.gear-picker-ilvl {
  display: inline-flex;
  justify-content: flex-start;
  color: #ffffff;
  font-weight: 700;
  text-align: left;
}

.gear-picker-warning-cell {
  display: grid;
  justify-items: start;
  align-items: center;
  min-width: 0;
}

.gear-picker-item {
  display: flex;
  align-items: center;
  justify-self: start;
  justify-content: flex-start;
  gap: 8px;
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
}

.gear-picker-item-text {
  display: grid;
  justify-items: start;
  gap: 3px;
  min-width: 0;
}

.gear-picker-row-note {
  color: #f0d98b;
  font-size: 0.72rem;
  font-weight: 800;
}

.gear-picker-warning {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #f3c84b;
  color: #16130a;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 14px rgba(243, 200, 75, 0.25);
  flex: 0 0 auto;
}

.picker-item-icon {
  width: 46px;
  height: 46px;
}

.gear-picker-source {
  display: flex;
  align-items: center;
  justify-self: stretch;
  gap: 8px;
  min-width: 0;
  text-align: left;
  padding-left: 34px;
  color: #aeb8d1;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.25;
}

.gear-picker-source-badge {
  display: inline-flex;
  flex: 0 0 auto;
  width: fit-content;
  min-width: 52px;
  justify-content: center;
  border: 1px solid rgba(174, 184, 209, 0.26);
  border-radius: 4px;
  background: rgba(174, 184, 209, 0.08);
  color: #d8dfef;
  padding: 2px 6px;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.gear-picker-source-detail {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #9faac0;
}

.gear-picker-delta {
  display: flex;
  flex-wrap: wrap;
  justify-self: start;
  justify-content: flex-start;
  gap: 4px 8px;
  min-width: 0;
  text-align: left;
  color: #9aa6bb;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.25;
}

.gear-picker-delta [data-comparison-deltas] {
  display: inline-flex;
  width: fit-content;
}

.gear-picker-delta .is-positive {
  color: #68e08a;
}

.gear-picker-delta .is-negative {
  color: #ff7d7d;
}

.gear-picker-favorite-cell {
  display: flex;
  justify-content: flex-start;
  min-width: 0;
}

.gear-picker-favorite {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: rgba(215, 168, 79, 0.55);
  padding: 0;
  font-size: 1.15rem;
  line-height: 1;
}

.gear-picker-favorite:hover,
.gear-picker-favorite:focus-visible {
  background: rgba(215, 168, 79, 0.12);
  color: #f3c84b;
}

.gear-picker-favorite.is-favorite {
  color: #f3c84b;
  text-shadow: 0 0 10px rgba(243, 200, 75, 0.32);
}

.gear-picker-equipped,
.gear-picker-no-delta {
  color: #8996ae;
}

.gear-picker-equipped {
  text-transform: uppercase;
}

.gear-picker-empty,
.gear-picker-unavailable {
  display: grid;
  place-items: center;
  min-height: 130px;
  border: 1px dashed rgba(174, 184, 209, 0.22);
  border-radius: 6px;
  margin-top: 8px;
  padding: 24px 20px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.input-grid label,
.fight-field-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.item-meta {
  min-height: 20px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.82rem;
}

.toast-stack {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 100001;
  display: grid;
  gap: 8px;
  width: min(320px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border: 1px solid #43506a;
  border-radius: 6px;
  background: #151923;
  color: #f0e6d2;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48);
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.3;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #5b6678;
  background: #090b10;
  color: #d7dde8;
  font-size: 0.72rem;
  font-weight: 900;
  overflow: hidden;
}

.toast__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.toast__message {
  min-width: 0;
}

.toast.is-hiding {
  opacity: 0;
  transform: translateY(6px);
}

.comparison-tooltip {
  position: fixed;
  z-index: 2147483647;
  min-width: 190px;
  max-width: 270px;
  border: 1px solid #4b5567;
  border-radius: 6px;
  background: #090b10;
  color: #f0e6d2;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 9px 10px;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.35;
  pointer-events: none;
}

.comparison-tooltip[hidden] {
  display: none;
}

.comparison-tooltip .is-positive {
  color: #68e08a;
}

.comparison-tooltip .is-negative {
  color: #ff7d7d;
}

.text-tooltip {
  position: fixed;
  z-index: 2147483647;
  width: max-content;
  max-width: 240px;
  border: 1px solid #4b5567;
  border-radius: 6px;
  background: #090b10;
  color: #f0e6d2;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 7px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  pointer-events: none;
  text-align: left;
}

.text-tooltip[hidden] {
  display: none;
}

.talent-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 10px;
  align-items: start;
}

.talent-tree {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: radial-gradient(circle at 50% 36%, rgba(215, 168, 79, 0.08), transparent 45%), #171717;
  overflow: visible;
  padding: 0 10px 12px;
}

.talent-tree h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 -10px 12px;
  padding: 10px 12px;
  background: #101010;
  border-bottom: 1px solid #272727;
  font-size: 1rem;
}

.tree-points {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tree-points span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 400;
}

.tree-reset {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #e05243;
  padding: 0;
  font-size: 1.05rem;
  line-height: 1;
}

.tree-reset:hover {
  background: rgba(224, 82, 67, 0.16);
  color: #ff7669;
}

.tree-reset:disabled {
  cursor: not-allowed;
  background: transparent;
  color: #666666;
}

.talent-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 74px);
  grid-template-rows: repeat(9, 70px);
  justify-content: center;
  justify-items: center;
  align-items: start;
  gap: 2px 18px;
}

.talent-connector {
  border-radius: 999px;
  background: linear-gradient(90deg, #5a5a5a, #9a9a9a 50%, #424242);
  box-shadow:
    0 0 0 1px #121212,
    inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  pointer-events: none;
  z-index: 0;
}

.talent-connector-vertical {
  align-self: stretch;
  justify-self: center;
  width: 10px;
  margin-top: 48px;
  margin-bottom: 42px;
}

.talent-connector-horizontal {
  align-self: start;
  justify-self: stretch;
  height: 10px;
  margin-top: 20px;
  margin-left: 52px;
  margin-right: 52px;
}

.talent-connector-horizontal[data-span="2"] {
  margin-left: 56px;
  margin-right: 56px;
}

.talent-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  gap: 5px;
  width: 58px;
  min-height: 58px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: center;
  line-height: 1.15;
  z-index: 1;
}

.talent-node:hover {
  background: transparent;
  color: var(--accent-strong);
  z-index: 40;
}

.talent-node[aria-disabled="true"] {
  cursor: not-allowed;
  background: transparent;
  color: var(--muted);
}

.talent-node[aria-disabled="true"] .talent-icon {
  filter: grayscale(1) brightness(0.42);
}

.talent-node[aria-disabled="true"] .talent-rank {
  color: #6b5a2a;
}

.talent-node[data-rank="0"] {
  color: var(--muted);
}

.talent-node:not([data-rank="0"]) {
  color: var(--ink);
}

.talent-icon {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 50px;
  height: 50px;
  border: 2px solid #515151;
  border-radius: 6px;
  background: linear-gradient(145deg, #343434, #181818);
  box-shadow: inset 0 0 0 1px #101010;
  color: #d8d8d8;
  font-size: 0.72rem;
  font-weight: 800;
}

.talent-icon:empty::after {
  content: attr(data-fallback);
}

.talent-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.talent-node:not([data-rank="0"]) .talent-icon {
  border-color: var(--gold);
  box-shadow:
    0 0 0 1px rgba(215, 168, 79, 0.25),
    inset 0 0 0 1px #101010;
  color: var(--gold);
}

.talent-rank {
  position: absolute;
  top: 38px;
  left: calc(50% + 6px);
  border-radius: 999px;
  background: #101010;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
}

.talent-tooltip {
  position: fixed;
  z-index: 2147483647;
  max-width: 292px;
  border: 1px solid #565656;
  border-radius: 6px;
  background: #111111;
  color: var(--ink);
  box-shadow: var(--shadow);
  padding: 9px 10px;
  text-align: left;
  white-space: pre-line;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.35;
  pointer-events: none;
}

.item-tooltip {
  position: fixed;
  z-index: 2147483647;
  width: max-content;
  max-width: 340px;
  border: 1px solid #4b5567;
  border-radius: 6px;
  background: #090b10;
  color: #f0e6d2;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.62);
  padding: 11px 12px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.38;
  pointer-events: none;
}

.item-tooltip__name {
  margin-bottom: 4px;
  font-size: 0.92rem;
  font-weight: 800;
}

.item-tooltip__meta,
.item-tooltip__source,
.item-tooltip__type-row,
.item-tooltip__meta-block,
.item-tooltip__armor {
  color: #b9c3d7;
}

.item-tooltip__type-row,
.item-tooltip__meta-block {
  display: flex;
  justify-content: space-between;
  gap: 36px;
}

.item-tooltip__meta-right {
  text-align: right;
  white-space: nowrap;
}

.item-tooltip__section {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(185, 195, 215, 0.14);
}

.item-tooltip__effect {
  color: #1eff00;
}

.item-tooltip__socket-line {
  white-space: nowrap;
}

.item-tooltip__socket-red {
  color: #ff6b6b;
}

.item-tooltip__socket-yellow {
  color: #ffd166;
}

.item-tooltip__socket-blue {
  color: #61a5ff;
}

.item-tooltip__socket-purple {
  color: #d8b4fe;
}

.item-tooltip__socket-orange {
  color: #f7a84b;
}

.item-tooltip__socket-green {
  color: #7dd87d;
}

.item-tooltip__socket-meta {
  color: #d99cff;
}

.item-tooltip__socket-value.is-active,
.item-tooltip__socket-bonus.is-active {
  color: #ffffff;
}

.item-tooltip__socket-value.is-empty,
.item-tooltip__socket-value.is-inactive,
.item-tooltip__socket-bonus.is-inactive {
  color: #8b94a6;
}

.item-tooltip__meta-requirement.is-met {
  color: #5fe08b;
}

.item-tooltip__meta-requirement.is-unmet {
  color: #ff6b6b;
}

.item-tooltip__comparison-line.is-positive {
  color: #5fe08b;
}

.item-tooltip__comparison-line.is-negative {
  color: #ff6b6b;
}

.item-tooltip__source {
  margin-top: 9px;
  color: #8996ae;
}

.item-tooltip__class {
  font-weight: 700;
}

.item-tooltip__set {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(185, 195, 215, 0.14);
  color: #9ca3af;
}

.item-tooltip__set-name,
.item-tooltip__set-piece.is-active,
.item-tooltip__set-bonus.is-active {
  color: #fff3a3;
}

.item-tooltip__set-pieces {
  margin-left: 13px;
}

.item-tooltip__set-bonuses {
  margin-top: 8px;
}

.item-tooltip__set-bonus + .item-tooltip__set-bonus {
  margin-top: 2px;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
}

.input-with-unit {
  display: grid;
  grid-template-columns: 1fr 44px;
  align-items: center;
  gap: 6px;
}

.input-with-unit span {
  color: var(--muted);
  font-weight: 700;
}

.duration-fields {
  display: flex;
  align-items: center;
  gap: 10px;
}

#fightDurationMinutes,
#fightDurationSeconds {
  width: 72px;
}

.input-with-unit:has(#fightDurationMinutes),
.input-with-unit:has(#fightDurationSeconds) {
  grid-template-columns: max-content max-content;
}

.external-cooldown-timelines {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.external-cooldown-timeline {
  display: grid;
  gap: 8px;
}

.external-cooldown-timeline__header {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.external-cooldown-lane {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
  gap: 10px;
}

.external-cooldown-count {
  width: 64px;
  min-height: 46px;
  text-align: center;
}

.external-cooldown-slider {
  position: relative;
  height: 46px;
  overflow: hidden;
  border: 1px solid rgba(185, 195, 215, 0.18);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 10% 100%,
    rgba(8, 9, 12, 0.55);
}

.external-cooldown-slider::before {
  content: "";
  position: absolute;
  inset: 21px 0 auto;
  height: 2px;
  background: rgba(185, 195, 215, 0.18);
}

.external-cooldown-window {
  position: absolute;
  top: 7px;
  bottom: 7px;
  display: grid;
  place-items: center;
  min-width: 16px;
  overflow: visible;
  padding: 0;
  cursor: grab;
  border: 1px solid rgba(111, 231, 166, 0.72);
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(111, 231, 166, 0.72), rgba(54, 171, 124, 0.72));
  box-shadow: 0 0 18px rgba(111, 231, 166, 0.14);
  color: #05140f;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
}

.external-cooldown-window-drumsOfBattle {
  border-color: rgba(215, 168, 79, 0.76);
  background: linear-gradient(180deg, rgba(239, 193, 88, 0.72), rgba(189, 126, 48, 0.72));
  box-shadow: 0 0 18px rgba(215, 168, 79, 0.14);
  color: #1d1204;
}

.external-cooldown-window-powerInfusion {
  border-color: rgba(177, 137, 255, 0.78);
  background: linear-gradient(180deg, rgba(177, 137, 255, 0.72), rgba(116, 81, 204, 0.72));
  box-shadow: 0 0 18px rgba(177, 137, 255, 0.14);
  color: #0d071a;
}

.external-cooldown-window-manaTideTotem {
  border-color: rgba(103, 210, 235, 0.78);
  background: linear-gradient(180deg, rgba(103, 210, 235, 0.72), rgba(42, 137, 176, 0.72));
  box-shadow: 0 0 18px rgba(103, 210, 235, 0.14);
  color: #041119;
}

.external-cooldown-window-innervate {
  border-color: hsl(var(--external-window-hue, 110) 70% 62% / 0.78);
  background: linear-gradient(
    180deg,
    hsl(var(--external-window-hue, 110) 70% 62% / 0.72),
    hsl(var(--external-window-hue, 110) 58% 42% / 0.72)
  );
  box-shadow: 0 0 18px hsl(var(--external-window-hue, 110) 70% 62% / 0.14);
  color: #050805;
}

.external-cooldown-window:active {
  cursor: grabbing;
}

.external-cooldown-window__label {
  position: absolute;
  left: 50%;
  top: 50%;
  display: block;
  min-width: max-content;
  padding: 0 4px;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  text-align: center;
}

.external-cooldown-window.is-label-hidden .external-cooldown-window__label {
  display: none;
}

.buffs,
.settings-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 14px 0;
  padding: 12px;
}

.buffs legend,
.settings-box legend {
  color: var(--muted);
  font-weight: 700;
  padding: 0 4px;
}

.buffs label,
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.buffs input,
.check-row input {
  width: 16px;
  min-height: 16px;
}

.settings-box .check-row {
  grid-column: 1 / -1;
}

.buff-sections {
  display: grid;
  gap: 14px;
}

.fight-sections {
  display: grid;
  gap: 14px;
}

.fight-section {
  min-height: 78px;
}

.on-use-consumes {
  display: grid;
  gap: 16px;
  justify-content: start;
}

.buff-section {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 0;
  padding: 14px;
}

.buff-section legend {
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  padding: 0 6px;
}

.buff-options {
  align-items: start;
  display: grid;
  gap: clamp(48px, 8vw, 140px);
  grid-template-columns: repeat(2, max-content);
  justify-content: center;
}

.fight-general-settings.buff-options {
  grid-template-columns: repeat(2, max-content);
  justify-content: start;
}

.buff-column {
  align-content: start;
  display: grid;
  gap: 16px;
}

.buff-toggle {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(170px, max-content) auto;
  justify-content: start;
  min-height: 48px;
  padding: 6px 4px;
}

.buff-toggle-controls {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}

.buff-toggle select {
  min-height: 34px;
  min-width: 150px;
  width: 100%;
}

.buff-toggle select:disabled {
  opacity: 0.45;
}

.buff-modifier {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 800;
  min-height: 30px;
  padding: 0 10px;
  position: relative;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    opacity 0.16s ease;
  white-space: nowrap;
}

.buff-modifier input {
  height: 100%;
  inset: 0;
  margin: 0;
  opacity: 0;
  position: absolute;
  width: 100%;
}

.buff-modifier:has(input:checked) {
  background: var(--accent);
  border-color: var(--accent);
  color: #07120d;
}

.buff-modifier:has(input:disabled) {
  cursor: default;
  opacity: 0.45;
}

.buff-modifier:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.buff-toggle span {
  color: var(--text);
  font-weight: 700;
  min-width: 0;
}

.buff-toggle .buff-modifier span {
  color: inherit;
  font-size: 0.76rem;
  font-weight: 800;
}

.buff-section-consumes .buff-options {
  gap: clamp(44px, 6vw, 96px);
}

.buff-section-consumes .buff-toggle {
  grid-template-columns: minmax(130px, max-content) auto;
}

.buff-section-consumes .buff-toggle select {
  min-width: 170px;
}

.buff-switch {
  cursor: pointer;
  display: inline-flex;
  position: relative;
}

.buff-switch input {
  height: 100%;
  inset: 0;
  opacity: 0;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.buff-switch-track {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: block;
  height: 30px;
  position: relative;
  transition:
    background 0.16s ease,
    border-color 0.16s ease;
  width: 54px;
}

.buff-switch-knob {
  background: var(--muted);
  border-radius: 999px;
  height: 22px;
  left: 3px;
  position: absolute;
  top: 3px;
  transition:
    background 0.16s ease,
    transform 0.16s ease;
  width: 22px;
}

.buff-switch input:checked + .buff-switch-track {
  background: var(--accent);
  border-color: var(--accent);
}

.buff-switch input:checked + .buff-switch-track .buff-switch-knob {
  background: #07120d;
  transform: translateX(24px);
}

.buff-switch input:focus-visible + .buff-switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.buff-section-empty {
  color: var(--muted);
  font-weight: 700;
  margin: 0;
}

.rotation-planner {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(185, 195, 215, 0.16);
  border-radius: 8px;
  background: #171717;
}

.rotation-editor-scroll {
  display: grid;
  flex: 1 1 auto;
  gap: 18px;
  align-content: start;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  scrollbar-color: var(--line) transparent;
}

.rotation-editor-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid rgba(185, 195, 215, 0.14);
  background: #111111;
  padding: 12px 16px;
}

.rotation-editor-save {
  min-height: 34px;
  border-color: rgba(100, 224, 162, 0.38);
  background: rgba(100, 224, 162, 0.14);
  color: #c9f7db;
  padding: 7px 15px;
  font-size: 0.8rem;
}

.rotation-editor-save:hover {
  background: var(--accent-strong);
  color: var(--accent-ink);
}

.rotation-layout {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  gap: 16px;
  height: 100%;
  min-height: 0;
  align-items: stretch;
}

.priority-list-panel {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(185, 195, 215, 0.16);
  border-radius: 8px;
  background: #171717;
  padding: 14px 12px;
}

.priority-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.priority-list-panel h3 {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 900;
}

.priority-list {
  display: grid;
  gap: 6px;
  align-content: start;
  grid-auto-rows: max-content;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: var(--line) transparent;
}

.priority-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px 20px;
  gap: 2px;
  align-items: center;
  padding: 3px 6px 3px 3px;
  border: 1px solid rgba(185, 195, 215, 0.14);
  border-radius: 6px;
  background: #141414;
}

.priority-list-row-template {
  grid-template-columns: minmax(0, 1fr) 20px;
}

.priority-list-row.is-active {
  border-color: rgba(100, 224, 162, 0.56);
  background: rgba(100, 224, 162, 0.08);
}

.priority-list-row:hover {
  border-color: var(--accent);
  background: var(--accent-strong);
}

.priority-list-row:hover .priority-list-button,
.priority-list-row:hover .priority-list-icon-button,
.priority-list-row:hover .priority-list-readonly-indicator {
  color: #050805;
}

.priority-list-button {
  display: grid;
  gap: 2px;
  justify-content: start;
  min-height: 34px;
  min-width: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #d7dde8;
  padding: 7px 8px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 800;
}

.priority-list-button span,
.priority-list-button small {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-list-button small {
  color: #8f98a8;
  font-size: 0.62rem;
  font-weight: 750;
}

.priority-list-row.is-active .priority-list-button span {
  color: #64e0a2;
}

.priority-list-row:hover .priority-list-button span,
.priority-list-row:hover .priority-list-button small {
  color: #050805;
}

.priority-list-button:hover {
  background: transparent;
}

.priority-list-icon-button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 26px;
  min-height: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #9aa6bb;
  padding: 0;
  font-size: 0.9rem;
  font-weight: 900;
}

.priority-list-icon-button:hover {
  background: transparent;
  color: #050805;
}

.priority-list-readonly-indicator {
  cursor: default;
  font-size: 0.76rem;
}

.priority-list-lock-icon {
  width: 0.9rem;
  height: 0.9rem;
  color: #f87171;
}

.priority-list-lock-icon rect {
  fill: currentColor;
  stroke: currentColor;
}

.priority-list-lock-icon path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.priority-list-row:hover .priority-list-lock-icon {
  color: #f87171;
}

.priority-list-delete-button:hover {
  color: #651111;
}

.priority-list-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.rotation-insights {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.rotation-insight-card {
  display: grid;
  gap: 5px;
  align-content: start;
  min-width: 0;
  border: 1px solid rgba(185, 195, 215, 0.14);
  border-radius: 6px;
  background: #141414;
  padding: 10px 12px;
}

.rotation-insight-label {
  color: #8f98a8;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rotation-insight-card strong {
  min-width: 0;
  color: #f1f5f9;
  font-size: 0.82rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rotation-check-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 16px;
  color: #dce4ef;
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.35;
}

.rotation-check-list li::marker {
  color: #eac45d;
}

.rotation-check-info::marker {
  color: #8fb5ff;
}

.rotation-check-empty {
  margin: 0;
  color: #87d8a9;
  font-size: 0.72rem;
  font-weight: 800;
}

.rotation-section {
  display: grid;
  gap: 10px;
}

.rotation-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
}

.rotation-section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.rotation-section-header h3 {
  color: #f1f5f9;
  font-size: 1.05rem;
  font-weight: 900;
}

.rotation-section-count {
  color: #8f98a8;
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.rotation-list {
  display: grid;
  gap: 8px;
}

.rotation-list.is-sorting {
  cursor: grabbing;
}

.rotation-row {
  display: grid;
  gap: 0;
  align-items: stretch;
  padding: 0;
  border: 1px solid rgba(185, 195, 215, 0.14);
  border-radius: 6px;
  background: #131313;
  overflow: hidden;
  box-shadow: inset 3px 0 0 rgba(100, 224, 162, 0.28);
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease,
    opacity 0.12s ease,
    background 0.12s ease;
}

.rotation-row:has(.rotation-enabled input:not(:checked)) {
  opacity: 0.62;
  box-shadow: inset 3px 0 0 rgba(154, 166, 187, 0.2);
}

.rotation-row.is-expanded {
  border-color: rgba(100, 224, 162, 0.36);
  background: #171a18;
  box-shadow: inset 3px 0 0 rgba(100, 224, 162, 0.78);
}

.rotation-row-summary {
  display: grid;
  grid-template-columns: 22px 22px minmax(0, 1fr) auto 30px;
  gap: 7px;
  align-items: center;
  min-height: 46px;
  padding: 7px 9px 7px 11px;
}

.rotation-row.is-dragging {
  position: fixed;
  z-index: 1200;
  opacity: 0.94;
  border-color: rgba(100, 224, 162, 0.52);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.48),
    inset 3px 0 0 rgba(100, 224, 162, 0.92);
  pointer-events: none;
}

.rotation-row.is-drag-over {
  border-color: rgba(100, 224, 162, 0.7);
  box-shadow:
    inset 3px 0 0 rgba(100, 224, 162, 0.92),
    inset 0 0 0 1px rgba(100, 224, 162, 0.32);
}

.rotation-row-handle {
  display: grid;
  place-items: center;
  width: 22px;
  min-height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #778191;
  cursor: grab;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: -0.08em;
  padding: 0;
  touch-action: none;
  user-select: none;
}

.rotation-row-handle:hover,
.rotation-row-handle:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  color: #d2d8e4;
}

.rotation-row-handle:active {
  cursor: grabbing;
}

.rotation-row-placeholder {
  border: 1px dashed rgba(100, 224, 162, 0.58);
  border-radius: 6px;
  background: rgba(100, 224, 162, 0.08);
}

.rotation-drag-active {
  cursor: grabbing;
  user-select: none;
}

.rotation-summary-main {
  display: grid;
  gap: 2px;
  justify-items: start;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #f3f6fb;
  padding: 4px 6px;
  text-align: left;
}

.rotation-summary-main:hover {
  background: rgba(255, 255, 255, 0.04);
}

.rotation-summary-title,
.rotation-summary-meta {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rotation-summary-title {
  color: #f4f7fb;
  font-size: 0.88rem;
  font-weight: 900;
}

.rotation-summary-meta {
  color: #9da4ae;
  font-size: 0.66rem;
  font-weight: 800;
}

.rotation-icon-button {
  display: grid;
  place-items: center;
  width: max-content;
  min-height: 28px;
  border-color: rgba(185, 195, 215, 0.14);
  background: #1f1f1f;
  color: var(--muted);
  padding: 0 7px;
  font-size: 0.66rem;
  font-weight: 900;
}

.rotation-icon-button:hover {
  color: var(--accent-ink);
}

.rotation-row-details {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  border-top: 1px solid rgba(185, 195, 215, 0.14);
  max-width: 100%;
  overflow-x: auto;
  padding: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.rotation-row-details > * {
  min-width: 0;
}

.rotation-row-details[hidden] {
  display: none;
}

.rotation-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.rotation-row input,
.rotation-row select {
  box-sizing: border-box;
  width: 100%;
  min-height: 34px;
  border-color: rgba(185, 195, 215, 0.16);
  border-radius: 5px;
  background: #111111;
  font-size: 0.78rem;
  font-weight: 800;
}

.rotation-select-shell {
  display: block;
  width: var(--rotation-select-width, max-content);
}

.rotation-row input:focus,
.rotation-row select:focus {
  border-color: rgba(100, 224, 162, 0.62);
  box-shadow: 0 0 0 2px rgba(100, 224, 162, 0.12);
}

.rotation-row input[type="number"] {
  width: 7ch;
}

.rotation-enabled {
  align-self: center;
}

.rotation-enabled input {
  min-height: 0;
  accent-color: var(--accent);
}

.rotation-condition {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.rotation-row-priority .rotation-condition {
  display: flex;
}

.rotation-condition:has(label + label) {
  display: flex;
}

.rotation-spell-picker {
  display: contents;
}

.rotation-static {
  display: flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(185, 195, 215, 0.16);
  border-radius: 5px;
  padding: 7px 9px;
  background: #111111;
  color: var(--muted);
}

.rotation-remove {
  display: grid;
  place-items: center;
  width: 30px;
  min-height: 30px;
  border-color: rgba(185, 195, 215, 0.14);
  background: #1f1f1f;
  color: var(--muted);
  padding: 0;
  font-size: 0.9rem;
}

.rotation-remove:hover {
  color: var(--accent-ink);
}

.rotation-add {
  justify-self: start;
  min-height: 34px;
  padding: 7px 12px;
  border-color: rgba(100, 224, 162, 0.38);
  background: rgba(100, 224, 162, 0.14);
  color: #c9f7db;
  font-size: 0.78rem;
}

.rotation-add:hover {
  background: var(--accent-strong);
  color: var(--accent-ink);
}

.rotation-section-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: end;
}

.rotation-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.calculated-stats {
  display: grid;
  gap: 16px;
  margin: 16px 0 0;
}

.calculated-stat {
  display: grid;
  gap: 8px;
}

.calculated-stat dt {
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 900;
}

.calculated-stat dd {
  min-height: 54px;
  margin: 0;
  border: 1px solid #3d3d3d;
  border-radius: 8px;
  background: #171717;
  color: #dfe6f1;
  padding: 11px 14px;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.45;
}

.primary-stats {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 22px;
  row-gap: 7px;
  padding: 2px 0 14px;
  border-bottom: 1px solid rgba(185, 195, 215, 0.14);
}

.primary-stats::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(185, 195, 215, 0.16);
  transform: translateX(-50%);
}

.primary-stat {
  display: grid;
  grid-template-columns: minmax(76px, max-content) minmax(42px, max-content);
  align-items: baseline;
  gap: 8px;
  min-height: 24px;
  color: #dfe6f1;
  font-size: 0.86rem;
  font-weight: 850;
}

.primary-stat:nth-child(odd) {
  justify-content: end;
  padding-right: 14px;
}

.primary-stat:nth-child(even) {
  justify-content: start;
  padding-left: 14px;
}

.primary-stat__label {
  min-width: 0;
  color: var(--muted);
  text-align: left;
}

.primary-stat__value {
  color: #f1f5f9;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.secondary-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.secondary-stat {
  min-width: 0;
  border: 1px solid rgba(185, 195, 215, 0.13);
  border-radius: 6px;
  background: rgba(12, 12, 13, 0.72);
  padding: 8px;
}

.secondary-stat__label {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 850;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secondary-stat__value {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #f1f5f9;
  font-size: 0.8rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resistance-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 12px 0;
  border-top: 1px solid rgba(185, 195, 215, 0.14);
  border-bottom: 1px solid rgba(185, 195, 215, 0.14);
}

.resistance-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(185, 195, 215, 0.13);
  border-radius: 6px;
  background: rgba(12, 12, 13, 0.72);
  padding: 6px 5px;
}

.resistance-stat__icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid #4a4a4a;
  border-radius: 4px;
  object-fit: cover;
}

.resistance-stat__value {
  color: #f1f5f9;
  font-size: 0.82rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.engine-results {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.engine-copy-button {
  border: 1px solid rgba(97, 211, 148, 0.45);
  border-radius: 6px;
  background: rgba(97, 211, 148, 0.16);
  color: #dffcec;
  cursor: pointer;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
  padding: 8px 10px;
}

.engine-copy-button:hover,
.engine-copy-button:focus-visible {
  background: #61d394;
  color: #07110c;
  outline: none;
}

.engine-summary-section {
  display: grid;
  gap: 7px;
}

.engine-summary-subsection {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.engine-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.engine-summary--semantic-columns {
  align-items: start;
}

.engine-summary-column {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.engine-metric-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(185, 195, 215, 0.13);
  border-radius: 6px;
  background: rgba(185, 195, 215, 0.12);
}

.engine-metric-matrix__cell {
  min-width: 0;
  background: rgba(12, 12, 13, 0.78);
  padding: 7px 8px;
}

.engine-metric-matrix__label {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-metric-matrix__value {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-metric-matrix__cell--good .engine-metric-matrix__value {
  color: #61d394;
}

.engine-metric-matrix__cell--bad .engine-metric-matrix__value {
  color: #f87171;
}

.engine-summary-chart {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin-top: 2px;
}

.engine-summary-stat {
  min-width: 0;
  border: 1px solid rgba(185, 195, 215, 0.13);
  border-radius: 6px;
  background: rgba(12, 12, 13, 0.72);
  padding: 7px 8px;
}

.engine-summary-stat__label {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-summary-stat__value {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-summary-stat--good .engine-summary-stat__value {
  color: #61d394;
}

.engine-summary-stat--bad .engine-summary-stat__value {
  color: #f87171;
}

.engine-spell-list {
  display: grid;
  gap: 6px;
}

.engine-spell-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(185, 195, 215, 0.13);
  border-radius: 6px;
  background: rgba(12, 12, 13, 0.72);
  padding: 7px 8px;
}

.engine-spell-row__name {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.engine-spell-row__name span:first-child {
  overflow: hidden;
  color: #f1f5f9;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-spell-row__name span:last-child {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 850;
  line-height: 1.1;
  text-transform: uppercase;
}

.engine-spell-row__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  min-width: 0;
}

.engine-spell-row__stats > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.engine-spell-row__stats span span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.56rem;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.engine-spell-row__stats strong {
  overflow: hidden;
  color: #f1f5f9;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-detail-grid {
  display: grid;
  gap: 8px;
}

.engine-detail-section {
  display: grid;
  gap: 6px;
}

.engine-detail-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(185, 195, 215, 0.13);
  border-radius: 6px;
  background: rgba(12, 12, 13, 0.72);
  padding: 8px;
}

.engine-results-heading {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.engine-view-tabs {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.engine-view-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 0;
  text-transform: uppercase;
}

.engine-view-tab:hover,
.engine-view-tab:focus-visible {
  color: #f1f5f9;
}

.engine-view-tab--active {
  color: #61d394;
}

.engine-uptime-panel {
  min-width: 0;
}

.engine-detail-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(185, 195, 215, 0.1);
  border-radius: 5px;
}

.engine-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content max-content;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  background: rgba(20, 20, 20, 0.78);
  color: #f1f5f9;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 7px;
}

.engine-detail-row span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-detail-row span:not(:first-child) {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.engine-detail-row--effect {
  grid-template-columns: minmax(0, 1fr) max-content max-content;
}

.engine-detail-row--metric {
  grid-template-columns: max-content minmax(0, 1fr);
}

.engine-detail-row--metric span:not(:first-child) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-detail-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.engine-plan-warnings {
  display: grid;
  gap: 4px;
  margin: 0;
  border: 1px solid rgba(215, 168, 79, 0.25);
  border-radius: 5px;
  background: rgba(215, 168, 79, 0.08);
  color: #f5d48c;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.3;
  padding: 7px 7px 7px 22px;
}

.engine-mana-chart {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.engine-mana-chart__actions {
  display: flex;
  justify-content: flex-end;
  min-height: 20px;
}

.engine-mana-chart__actions:empty {
  display: none;
}

.engine-chart-reset {
  border: 1px solid rgba(185, 195, 215, 0.24);
  border-radius: 5px;
  background: rgba(16, 19, 27, 0.9);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.58rem;
  font-weight: 850;
  line-height: 1;
  padding: 5px 7px;
}

.engine-chart-reset:hover,
.engine-chart-reset:focus-visible {
  border-color: rgba(97, 211, 148, 0.72);
  color: var(--text);
}

.engine-mana-chart__plot {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  position: relative;
}

.engine-mana-chart__scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  height: 150px;
  padding: 10px 0 24px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
}

.engine-mana-chart__svg {
  display: block;
  width: 100%;
  height: 150px;
  cursor: crosshair;
  overflow: visible;
  touch-action: none;
  user-select: none;
}

.engine-mana-chart__grid {
  stroke: rgba(185, 195, 215, 0.22);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.engine-mana-chart__grid--muted {
  stroke: rgba(185, 195, 215, 0.09);
}

.engine-mana-chart__line {
  fill: none;
  stroke: #60a5fa;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
}

.engine-mana-chart__point {
  fill: #dbeafe;
  stroke: #60a5fa;
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
}

.engine-mana-chart__hover-line {
  stroke: rgba(219, 234, 254, 0.55);
  stroke-dasharray: 4 4;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.engine-mana-chart__hover-point {
  fill: #dbeafe;
  stroke: #60a5fa;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.engine-mana-chart__selection {
  fill: rgba(96, 165, 250, 0.18);
  pointer-events: none;
  stroke: rgba(147, 197, 253, 0.72);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.engine-mana-chart__tooltip {
  background: rgba(6, 10, 18, 0.96);
  border: 1px solid rgba(185, 195, 215, 0.32);
  border-radius: 5px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36);
  color: var(--text);
  font-size: 0.64rem;
  font-weight: 850;
  left: 0;
  line-height: 1;
  padding: 7px 8px;
  pointer-events: none;
  position: absolute;
  top: 0;
  white-space: nowrap;
  z-index: 30;
}

.engine-mana-chart--green .engine-mana-chart__line {
  stroke: #61d394;
}

.engine-mana-chart--green .engine-mana-chart__point {
  fill: #dcfce7;
  stroke: #61d394;
}

.engine-mana-chart--green .engine-mana-chart__hover-line {
  stroke: rgba(97, 211, 148, 0.55);
}

.engine-mana-chart--green .engine-mana-chart__hover-point {
  fill: #dcfce7;
  stroke: #61d394;
}

.engine-mana-chart--yellow .engine-mana-chart__line {
  stroke: #f3d77a;
}

.engine-mana-chart--yellow .engine-mana-chart__point {
  fill: #fff4bf;
  stroke: #f3d77a;
}

.engine-mana-chart--yellow .engine-mana-chart__hover-line {
  stroke: rgba(243, 215, 122, 0.62);
}

.engine-mana-chart--yellow .engine-mana-chart__hover-point {
  fill: #fff4bf;
  stroke: #f3d77a;
}

.engine-mana-chart__line--red {
  stroke: #f87171;
}

.engine-mana-chart__line--amber {
  stroke: #fbbf24;
}

.engine-mana-chart__labels {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-top: -20px;
}

.engine-mana-chart__time-labels {
  display: flex;
  justify-content: space-between;
  min-width: 0;
  padding-left: 6px;
}

.engine-mana-chart__scale-spacer {
  visibility: hidden;
}

.engine-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 850;
  line-height: 1.1;
}

.engine-chart-legend--spacer {
  visibility: hidden;
}

.engine-chart-legend__item {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.engine-chart-legend__swatch {
  width: 16px;
  height: 3px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.engine-chart-legend__swatch--red {
  background: #f87171;
}

.engine-chart-legend__swatch--amber {
  background: #fbbf24;
}

.engine-timeline-list {
  display: grid;
  gap: 1px;
  max-height: 220px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(185, 195, 215, 0.1);
  border-radius: 5px;
  padding-right: 4px;
}

.engine-timeline-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) max-content;
  gap: 9px;
  align-items: center;
  min-height: 28px;
  background: rgba(20, 20, 20, 0.78);
  color: #f1f5f9;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 5px 7px;
}

.engine-timeline-row__time,
.engine-timeline-row__value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.engine-timeline-row__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.engine-timeline-row__value {
  text-align: right;
}

.engine-timeline-row__value--good {
  color: #61d394;
}

.engine-timeline-row__value--bad {
  color: #f87171;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px 7px;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

tbody tr:hover {
  background: rgba(215, 168, 79, 0.08);
}

@media (min-width: 1101px) {
  body {
    overflow: hidden;
  }
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .settings-panel {
    overflow: visible;
  }

  .tab-panels {
    overflow: visible;
  }

  .results-panel {
    height: auto;
    overflow: visible;
  }

  .gear-paperdoll {
    grid-template-columns: minmax(220px, 1fr) minmax(110px, 0.5fr) minmax(220px, 1fr);
    min-height: 650px;
  }

  .gear-picker-toolbar {
    grid-template-columns: minmax(170px, 320px);
  }
}

@media (max-width: 680px) {
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: start;
  }

  .slot-grid,
  .input-grid,
  .buffs,
  .talent-list {
    grid-template-columns: 1fr;
  }

  .buff-options {
    gap: 16px;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .buff-toggle {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .buff-toggle-controls {
    justify-content: stretch;
  }

  .buff-toggle select {
    min-width: 0;
  }

  .rotation-section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .rotation-layout {
    grid-template-columns: 1fr;
  }

  .rotation-insights {
    grid-template-columns: 1fr;
  }

  .rotation-row {
    grid-template-columns: 1fr;
  }

  .gear-selection-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .gear-compare-dialog__body {
    grid-template-columns: 1fr;
  }

  .stat-weights-panel {
    max-height: none;
  }

  .gear-set-shelf {
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    align-items: stretch;
  }

  .gear-set-shelf .gear-save-button {
    grid-column: 1 / -1;
  }

  .gear-set-list {
    grid-auto-columns: minmax(150px, 1fr);
  }

  .gear-paperdoll {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 12px;
  }

  .gear-avatar {
    display: none;
  }

  .gear-side,
  .gear-column {
    gap: 10px;
  }

  .gear-column-weapons {
    margin-top: 10px;
  }

  .gear-slot-right {
    grid-template-columns: 62px minmax(0, 1fr);
    text-align: left;
  }

  .gear-slot-right .gear-slot-text {
    order: 2;
  }

  .gear-slot-right .gear-slot-icon {
    order: 1;
  }

  .gear-modal__panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
  }

  .gear-picker-toolbar {
    grid-template-columns: 1fr;
  }

  .gear-picker-head,
  .gear-picker-row {
    grid-template-columns: 44px 20px minmax(0, 1fr) minmax(70px, 0.42fr) 34px;
  }

  .gear-picker-head > :nth-child(6),
  .gear-picker-source {
    display: none;
  }
}
