:root {
  --bg: #12141a;
  --panel: #1a1d26;
  --panel-2: #21252f;
  --line: #2c313d;
  --text: #e6e8ee;
  --muted: #8d94a5;
  --accent: #c8a35a;
  --accent-dim: #7a6435;
  --good: #57b97a;
  --warn: #d9a441;
  --bad: #d76a6a;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: .75rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: .3px; color: var(--accent); font-size: 1.05rem; }
.topbar nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.topbar nav a { color: var(--text); font-size: .92rem; }

main { max-width: 1080px; margin: 0 auto; padding: 1.75rem 1.5rem 3rem; }
footer { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem 2rem; font-size: .85rem; }

h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 1.8rem 0 .7rem; }
h3 { font-size: 1rem; margin: 0; }

.muted { color: var(--muted); }
.error { color: var(--bad); }
.ok { color: var(--good); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.card.narrow { max-width: 420px; margin: 3rem auto; }
.card.highlight { border-left: 3px solid var(--accent); }
.card.warn { border-left: 3px solid var(--warn); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }

.headline { font-size: 1.05rem; margin: .2rem 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.stars { color: var(--accent); letter-spacing: 2px; white-space: nowrap; }

.stat-row { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
.stat {
  flex: 1 1 120px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .7rem .9rem; display: flex; flex-direction: column;
}
.stat .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.stat .value { font-size: 1.35rem; font-weight: 600; }
.stat-row.tight .stat { padding: .5rem .7rem; }
.stat-row.tight .value { font-size: 1.1rem; }

label .label, p .label {
  display: inline-block; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); margin-right: .4rem;
}

table { width: 100%; border-collapse: collapse; margin: .5rem 0 1.5rem; font-size: .92rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
tbody tr:hover { background: var(--panel); }
.nowrap { white-space: nowrap; }

form.stack label { display: block; margin-bottom: .75rem; }
form.inline { display: inline; }
label { display: block; margin-bottom: .8rem; font-size: .9rem; color: var(--muted); }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem; padding: .5rem .6rem;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; font: inherit;
}
form.inline input { display: inline-block; width: auto; margin: 0; }

button {
  background: var(--accent); color: #1a1508; border: 0; border-radius: 6px;
  padding: .5rem .9rem; font: inherit; font-weight: 600; cursor: pointer;
  margin: .2rem .3rem .2rem 0;
}
button:hover { filter: brightness(1.1); }
button.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
button.link {
  background: none; border: 0; color: var(--accent); padding: 0 .3rem;
  font-weight: 400; text-decoration: underline; cursor: pointer;
}
button.link.tiny { font-size: .8rem; }
.button {
  display: inline-block; background: var(--accent); color: #1a1508;
  padding: .5rem .9rem; border-radius: 6px; font-weight: 600; margin-top: .6rem;
}
.button:hover { text-decoration: none; filter: brightness(1.1); }

.pill {
  display: inline-block; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: .15rem .6rem; margin: .1rem .2rem .1rem 0; font-size: .85rem;
}

.tag {
  display: inline-block; border-radius: 4px; padding: .05rem .45rem;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .5px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}
.tag.done, .tag.ok, .tag.analysed, .tag.admin { color: var(--good); border-color: var(--good); }
.tag.running, .tag.ingesting, .tag.ingested { color: var(--accent); border-color: var(--accent-dim); }
.tag.failed, .tag.high { color: var(--bad); border-color: var(--bad); }
.tag.queued, .tag.discovered, .tag.medium { color: var(--warn); border-color: var(--warn); }

.feedback-list { padding-left: 1.1rem; }
.feedback-list li { margin-bottom: .5rem; }
.feedback-list.good li::marker { color: var(--good); }
.focus li { margin-bottom: .4rem; }

.card.improvement { border-left: 3px solid var(--muted); }
.card.improvement.prio-high { border-left-color: var(--bad); }
.card.improvement.prio-medium { border-left-color: var(--warn); }
.card.improvement.prio-low { border-left-color: var(--muted); }
.card.improvement p { margin: .45rem 0; }

pre.log {
  background: #0d0f14; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; overflow-x: auto; font-size: .85rem; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}
code { background: var(--panel-2); padding: .1rem .35rem; border-radius: 4px; font-size: .88rem; }

@media (max-width: 640px) {
  main { padding: 1.25rem 1rem 2rem; }
  table { font-size: .85rem; }
}

/* --- language switch ---------------------------------------------------- */
.langswitch { display: inline-flex; gap: .35rem; align-items: center; font-size: .85rem; }
.langswitch strong { color: var(--accent); }
.langswitch a { color: var(--muted); }
.langswitch a:hover { color: var(--text); text-decoration: none; }

/* --- wowhead spell links ------------------------------------------------ */
a.spell { color: var(--accent); white-space: nowrap; }
a.spell:hover { text-decoration: underline; }
/* Wowhead injects an <img> icon before the text when iconizeLinks is on. */
a.spell img { vertical-align: -2px; margin-right: .2rem; border-radius: 3px; }

tr.subrow td { border-bottom: 1px solid var(--line); padding-top: 0; font-size: .85rem; }
tr.subrow:hover { background: none; }

/* --- roster selection ---------------------------------------------------- */
table.roster input[type="checkbox"] { width: auto; margin: 0; display: inline-block; }
table.roster tr.is-npc { opacity: .62; }
table.roster tr.is-npc:hover { opacity: 1; }
.button.small { padding: .25rem .6rem; font-size: .85rem; margin: .15rem .25rem .15rem 0; }
.tag.awaiting_selection { color: var(--warn); border-color: var(--warn); }
.tag.confirmed { color: var(--accent); border-color: var(--accent-dim); }

/* --- destructive actions ------------------------------------------------- */
.card.danger { border-left: 3px solid var(--bad); }
button.danger { background: var(--bad); color: #fff; }
button.danger:hover { filter: brightness(1.1); }
button.link.danger-link { color: var(--bad); }
label.check { display: block; margin-bottom: .7rem; color: var(--text); }
label.check input { display: inline-block; width: auto; margin: 0 .4rem 0 0; }
label.check .muted { display: block; margin-left: 1.5rem; font-size: .85rem; }
table.compact { margin: 0; }
table.compact td { padding: .3rem .4rem; border-bottom: 1px solid var(--line); }
table.compact td.num { text-align: right; font-weight: 600; width: 5rem; }
