:root {
  --bg: #0d1015;
  --bg-soft: #141822;
  --panel: #171c26;
  --panel-2: #1d2330;
  --line: #262d3b;
  --text: #e8ecf3;
  --muted: #8b94a7;
  --gold: #e6b34a;
  --gold-soft: #3a2f14;
  --green: #54c98a;
  --red: #e06c75;
  --blue: #6aa6f5;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 10% -10%, #1a2130 0%, var(--bg) 55%);
  color: var(--text);
  font: 14px/1.45 "Segoe UI", Roboto, system-ui, sans-serif;
  min-height: 100%;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
}

h1 {
  font-size: 18px;
  letter-spacing: 0.2px;
}

h2 {
  font-size: 16px;
}

h3 {
  font-size: 14px;
  color: var(--gold);
}

p {
  margin: 0;
}

.muted {
  color: var(--muted);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 16, 21, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, #3b2f13, #1d2330);
  color: var(--gold);
  font-size: 20px;
  border: 1px solid #4a3a15;
}

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

button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 8px 14px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

button:hover {
  background: #232b3a;
}

button:active {
  transform: translateY(1px);
}

button.primary {
  background: linear-gradient(180deg, #d9a63e, #b9872d);
  border-color: #8f6a1f;
  color: #1a1405;
  font-weight: 650;
}

button.primary:hover {
  background: linear-gradient(180deg, #e9b64c, #c6932f);
}

button.ghost {
  background: transparent;
}

button.small {
  padding: 5px 10px;
  font-size: 12px;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 22px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab {
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--muted);
  border-radius: 8px 8px 0 0;
  padding: 9px 16px;
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.tab.active {
  color: var(--gold);
  background: var(--panel);
  border-color: var(--line);
}

main {
  padding: 18px 22px 80px;
  max-width: 1680px;
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.panel.sub {
  background: var(--bg-soft);
  margin-top: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 150px;
}

.field.grow {
  flex: 1;
  min-width: 220px;
}

.field span {
  font-size: 12px;
  color: var(--muted);
}

.field.inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.field.inline span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.field.inline select {
  padding: 7px 8px;
}

input,
select {
  font: inherit;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(230, 179, 74, 0.12);
}

.hint {
  color: var(--muted);
  font-size: 12px;
  padding-bottom: 8px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.stat {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 13px;
  min-width: 120px;
}

.stat b {
  display: block;
  font-size: 17px;
  color: var(--gold);
}

.stat span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  max-height: 70vh;
}

tr.data-row {
  cursor: pointer;
}

tr.data-row td:first-child::before {
  content: '▸ ';
  color: var(--muted);
}

tr.data-row.open td:first-child::before {
  content: '▾ ';
  color: var(--gold);
}

tr.details > td {
  background: #10141c;
  padding: 12px 14px 16px;
  white-space: normal;
}

.detail {
  display: grid;
  gap: 9px;
}

.detail-meta {
  color: var(--muted);
  font-size: 12px;
}

.detail-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
}

.detail-summary b {
  color: var(--gold);
}

.detail-summary .pos {
  color: var(--green);
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: normal;
}

.detail-table th {
  position: static;
  background: transparent;
  cursor: default;
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
}

.detail-table td {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(38, 45, 59, 0.5);
}

.detail-warn {
  color: var(--gold);
  font-size: 12px;
}

.detail-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel-2);
  color: var(--muted);
  text-align: left;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 9px 11px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--line);
}

thead th:hover {
  color: var(--text);
}

thead th .arrow {
  color: var(--gold);
  margin-left: 4px;
}

tbody td {
  padding: 7px 11px;
  border-bottom: 1px solid rgba(38, 45, 59, 0.6);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

tbody tr:last-child td {
  border-bottom: none;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td.name {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pos {
  color: var(--green);
}

.neg {
  color: var(--red);
}

.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
}

.tag.pos {
  color: var(--green);
  border-color: #2c5a41;
}

.tag.neg {
  color: var(--red);
  border-color: #5a2c31;
}

.tag.type-vendor {
  color: var(--green);
  border-color: #2c5a41;
}
.tag.type-de {
  color: var(--blue);
  border-color: #2b4568;
}
.tag.type-resale {
  color: var(--gold);
  border-color: #5a4618;
}
.tag.type-craft {
  color: #b76bf0;
  border-color: #4c2f63;
}
.tag.type-craftVendor {
  color: #4fd1c5;
  border-color: #235c55;
}
.tag.type-combo {
  color: #ff9b2f;
  border-color: #6a4416;
}
.tag.type-comboVendor {
  color: #f0a6c8;
  border-color: #633b4c;
}

.tag.src-trainer {
  color: var(--gold);
  border-color: #5a4618;
}
.tag.src-drop {
  color: var(--red);
  border-color: #5a2c31;
}
.tag.src-vendor {
  color: var(--blue);
  border-color: #2b4568;
}
.tag.src-quest {
  color: #b76bf0;
  border-color: #4c2f63;
}

.stale {
  color: #ff6b6b;
  font-weight: 600;
}

.pager {
  margin-top: 10px;
}

.segment {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
}

.segment button {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 8px 12px;
  font-size: 13px;
}

.segment button.active {
  background: var(--gold-soft);
  color: var(--gold);
}

.leveling-professions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 14px;
}

.prof-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 12px;
  min-width: 160px;
  text-align: left;
}

.prof-btn b {
  font-size: 15px;
  color: var(--gold);
}

.prof-btn b.pos {
  color: var(--green);
}

.prof-btn span {
  font-size: 11.5px;
  color: var(--muted);
}

.prof-btn.active {
  border-color: var(--gold);
  background: var(--gold-soft);
}

#panel-leveling h3 {
  margin-top: 18px;
}

.fold {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.fold > summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  font-weight: 650;
  color: var(--gold);
}
.fold > summary::-webkit-details-marker {
  display: none;
}
.fold > summary::before {
  content: '▸';
  font-size: 12px;
  color: var(--muted);
}
.fold[open] > summary::before {
  content: '▾';
}
.fold > summary:hover {
  color: #f0c568;
}
.fold[open] > summary {
  margin-bottom: 8px;
}

.q-UNCOMMON {
  color: #3fd66a;
}
.q-RARE {
  color: #4f9bf0;
}
.q-EPIC {
  color: #b76bf0;
}
.q-LEGENDARY {
  color: #ff9b2f;
}
.q-COMMON {
  color: #d8dde6;
}
.q-POOR {
  color: #9aa0aa;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
}

.card h4 {
  margin: 0 0 6px;
  font-size: 13.5px;
  color: var(--text);
}

.card .big {
  font-size: 18px;
  color: var(--gold);
  font-weight: 650;
}

.card .sub {
  font-size: 11.5px;
  color: var(--muted);
}

.note {
  color: var(--muted);
  font-size: 12.5px;
  margin: 10px 0;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.about-grid article {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
}

.about-grid p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.row {
  display: flex;
  align-items: center;
}

.gap {
  gap: 10px;
  flex-wrap: wrap;
}

.house-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 12px 0 16px;
}

.house-group {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  background: var(--bg-soft);
  min-width: 230px;
}

.scan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.scan-col {
  min-width: 0;
}

.identify {
  border-left: 1px solid var(--line);
  padding-left: 22px;
}

.verdict {
  border: 1px solid var(--line);
  border-left: 3px solid var(--muted);
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.45;
}

.verdict.ok {
  border-left-color: var(--green);
}

.verdict.maybe {
  border-left-color: var(--gold);
}

.verdict.bad {
  border-left-color: var(--red);
}

#identify-table tr.best td {
  background: rgba(230, 179, 74, 0.1);
}

#identify-table tr.best td:first-child {
  box-shadow: inset 3px 0 0 var(--gold);
  font-weight: 650;
}

#identify-table td:last-child {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .scan-layout {
    grid-template-columns: 1fr;
  }
  .identify {
    border-left: none;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 16px;
  }
}

.house-group h4 {
  margin: 0 0 7px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.house-group label {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 13px;
  padding: 2px 0;
}

.progress {
  margin-top: 14px;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #b9872d, #e6b34a);
  transition: width 0.3s ease;
}

.log {
  margin-top: 12px;
  max-height: 220px;
  overflow: auto;
  background: #0a0d12;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-size: 11.5px;
  color: #9fb0c9;
  white-space: pre-wrap;
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 22px;
  border-top: 1px solid var(--line);
  background: rgba(13, 16, 21, 0.92);
  backdrop-filter: blur(8px);
  font-size: 12px;
  z-index: 15;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 62px;
  max-width: 420px;
  background: #241d0c;
  border: 1px solid #5a4618;
  color: #f0d79a;
  padding: 11px 15px;
  border-radius: 9px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  z-index: 40;
}

.empty {
  padding: 26px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 720px) {
  main {
    padding: 12px 10px 72px;
  }
  .topbar {
    padding: 10px 12px;
  }
  .filters {
    gap: 8px;
  }
  .field {
    min-width: 130px;
  }
}

/* ------------------------------------------------- пороги навыка и иконки Wowhead */

.thr {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.thr-orange {
  color: #ff9d45;
}
.thr-yellow {
  color: #ffd75e;
}
.thr-green {
  color: #63d76f;
}
.thr-gray {
  color: #98a2b3;
}
.thr-none {
  color: var(--muted);
  font-weight: 400;
}
.thr-sep {
  color: var(--muted);
  opacity: 0.5;
  padding: 0 2px;
}
.thr-cell {
  white-space: nowrap;
}

.item-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  vertical-align: -4px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.item-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.item-icon img:not([src]) {
  visibility: hidden;
}
.item-icon.empty {
  visibility: hidden;
}
.item-link {
  color: inherit;
  text-decoration: none;
}
.item-link:hover {
  color: var(--gold);
}

/* ------------------------------------------------------------- пароль на вход */

.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(900px 500px at 50% -10%, #1a2130 0%, var(--bg) 60%),
    var(--bg);
}
.gate[hidden] {
  display: none;
}
.gate-card {
  width: min(360px, 100%);
  display: grid;
  gap: 12px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.gate-card .brand-mark {
  font-size: 26px;
  line-height: 1;
}
.gate-card h1 {
  font-size: 20px;
}
.gate-card .field {
  display: grid;
  gap: 6px;
}
.gate-error {
  min-height: 1.2em;
  margin: 0;
  color: var(--red);
  font-size: 12.5px;
}
.gate-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
}
