:root { --success: #8fc68e; }

button:disabled { cursor: wait; opacity: 0.65; }

.hero { padding: 0 4px 24px; }

.hero-title { display: flex; align-items: center; gap: 12px; }
.hero-title img { flex: none; object-fit: contain; image-rendering: pixelated; }

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.lede {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.results-panel {
  margin-top: 22px;
  padding: 22px 0 0;
  overflow: hidden;
}

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

.results-heading { padding: 0 22px; }
.section-heading h2 { margin: 0; font-size: 1.45rem; }
.section-heading p { margin: 4px 0 0; color: var(--muted); line-height: 1.45; }

.counter {
  white-space: nowrap;
  border: 1px solid var(--border-soft);
  padding: 5px 9px;
  color: var(--muted);
  font-size: 0.82rem;
}

textarea {
  display: block;
  width: 100%;
  min-height: 205px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 0;
  background: #11100d;
  color: var(--text);
  padding: 14px;
  line-height: 1.45;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(213, 170, 87, 0.15);
}

.customize-panel {
  margin-top: 16px;
  border: 1px solid var(--border-soft);
  background: rgba(17, 16, 13, 0.58);
  padding: 16px;
}

.customize-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.customize-heading h2 {
  margin: 0;
  font-size: 1.15rem;
}

.customize-heading p,
.custom-options-intro {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.regular-options {
  display: grid;
  justify-items: start;
  gap: 9px;
  margin-top: 14px;
}

.regular-option {
  width: fit-content;
  margin: 0;
  color: var(--text);
}

.tooltip-target {
  position: relative;
  cursor: help;
  outline: none;
}

.tooltip-target::after {
  position: absolute;
  left: 0;
  bottom: calc(100% + 9px);
  z-index: 15;
  width: min(520px, 76vw);
  content: attr(data-tooltip);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  border: 1px solid var(--border);
  background: #171510;
  box-shadow: var(--shadow);
  padding: 9px 11px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
  line-height: 1.4;
  transition: opacity 120ms ease-out;
}

.tooltip-target:hover::after,
.tooltip-target:focus::after {
  opacity: 1;
  visibility: visible;
}

.custom-options {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.custom-options-intro { margin: 0 0 12px; }

.stat-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat-group {
  min-width: 0;
  border: 1px solid var(--border-soft);
  background: rgba(17, 16, 13, 0.68);
  padding: 12px;
}

.stat-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.stat-group h3 {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.group-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
}

.group-toggle input {
  margin: 0;
  accent-color: var(--accent);
}

.skill-stat-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 6px 16px;
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
}

.skill-stat-row {
  display: grid;
  grid-template-columns: 108px auto auto;
  align-items: center;
  justify-content: start;
  column-gap: 10px;
  min-height: 28px;
}

.skill-stat-name {
  color: var(--muted);
  font-size: 0.82rem;
}

.skill-stat-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
}

.skill-stat-checkbox input {
  margin: 0;
  accent-color: var(--accent);
}

.stat-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 6px 10px;
  max-height: 330px;
  overflow: auto;
  padding-right: 4px;
}

.stat-option {
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.controls, .toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.controls { margin-top: 16px; }
.toolbar { padding: 0 22px 14px; }

button {
  min-height: 40px;
  border-radius: 0;
  padding: 8px 14px;
  font-weight: 750;
}

button.primary {
  border: 1px solid var(--accent-strong);
  background: var(--accent);
  color: #17130c;
}

button.primary:hover:not(:disabled) { background: var(--accent-strong); }

button.secondary {
  border: 1px solid var(--border);
  background: #171510;
  color: var(--text);
}

button.secondary:hover:not(:disabled) { border-color: var(--accent); }

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.toggle-checkbox {
  flex: 0 0 auto;
  margin: 1px 0 0;
}

.checkbox input { accent-color: var(--accent); }

.progress-wrap { margin-top: 16px; }

.progress-track {
  height: 11px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: #100f0c;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 160ms ease-out;
}

.progress-text { margin: 7px 0 0; color: var(--muted); font-size: 0.84rem; }

.notice {
  margin-top: 14px;
  border-left: 3px solid var(--accent);
  background: rgba(213, 170, 87, 0.08);
  padding: 10px 12px;
  color: var(--muted);
  line-height: 1.45;
}

.notice.error {
  border-left-color: var(--danger);
  background: rgba(226, 135, 120, 0.08);
}

.table-wrap {
  max-height: 70vh;
  overflow: auto;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #13110e;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}

th, td {
  min-width: 105px;
  padding: 8px 10px;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
  text-align: right;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #29241b;
  color: var(--accent-strong);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

th:first-child, td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 150px;
  text-align: left;
  background: #1b1813;
}

th:first-child { z-index: 3; background: #29241b; }

td:nth-child(2), th:nth-child(2) {
  text-align: left;
}

tr:hover td { background-color: rgba(213, 170, 87, 0.045); }
tr:hover td:first-child { background-color: #211d16; }

.table-help {
  margin: 0;
  padding: 12px 22px 16px;
  color: var(--muted);
  font-size: 0.82rem;
}

@container toolkit-page (max-width: 900px) {
  .stat-groups { grid-template-columns: 1fr; }
}

@container toolkit-page (max-width: 760px) {
  .section-heading, .customize-heading { align-items: stretch; flex-direction: column; }
  .checkbox { width: 100%; margin: 2px 0 0; }
  .regular-options { justify-items: stretch; }
  .regular-option { width: 100%; margin: 0; }
  .results-heading { padding: 0 14px; }
  .toolbar, .table-help { padding-left: 14px; padding-right: 14px; }
}

@container toolkit-page (max-width: 760px) {
  .regular-options { position: relative; }
  .tooltip-target { position: static; }
  .tooltip-target::after { width: 100%; }
}

.result-link {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.result-link:hover {
  color: var(--text);
}
