:root {
  --ink: #241c2f;
  --muted: #6d6475;
  --line: #ded3dc;
  --surface: rgba(255, 250, 251, 0.82);
  --surface-solid: #fffafb;
  --panel: rgba(248, 242, 246, 0.72);
  --control: #fff4df;
  --accent: #9b526d;
  --accent-dark: #6e344b;
  --accent-soft: #f8e8ef;
  --teal: #267b78;
  --teal-soft: #e8f5f3;
  --good: #3d7a5d;
  --warn: #a96f32;
  --combat: #a34b55;
  --qi: #75579b;
  --prod: #3f7a62;
  --diamond: #8a6389;
  --blueprint: #5f6f9a;
  --glass-line: rgba(255, 255, 255, 0.72);
  --shadow: 0 18px 48px rgba(55, 42, 65, 0.14);
  --shadow-soft: 0 8px 28px rgba(55, 42, 65, 0.09);
  --inner-glow: inset 0 1px 0 rgba(255, 255, 255, 0.78), inset 0 -1px 0 rgba(110, 52, 75, 0.05);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(155, 82, 109, 0.1), rgba(38, 123, 120, 0.07) 42%, rgba(255, 244, 223, 0.28)),
    linear-gradient(180deg, #f8f3f6 0%, #efe7ee 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 28% 72%, rgba(255, 255, 255, 0.26)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0 1px, rgba(255, 255, 255, 0) 1px 12px);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 50;
  padding: 8px 10px;
  color: #ffffff;
  background: var(--accent-dark);
  border-radius: 6px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

button,
input,
select,
textarea {
  font: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(155, 82, 109, 0.28);
  outline-offset: 2px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 8;
  padding: 18px 28px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(44, 37, 54, 0.94), rgba(71, 47, 67, 0.9)),
    #2c2536;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow: 0 14px 36px rgba(36, 28, 47, 0.22);
  backdrop-filter: blur(18px) saturate(145%);
}

.app-header h1 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.1;
}

.eyebrow {
  margin: 0;
  color: #ead5df;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.version {
  color: #efe4ea;
  font-size: 13px;
  text-align: right;
}

.layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
}

.controls-panel {
  padding: 18px;
  background: rgba(255, 250, 251, 0.64);
  border-right: 1px solid rgba(202, 184, 197, 0.74);
  box-shadow: var(--inner-glow);
  backdrop-filter: blur(24px) saturate(150%);
  overflow: auto;
}

@media (min-width: 761px) {
  .controls-panel {
    position: sticky;
    top: 76px;
    height: calc(100vh - 76px);
  }
}

.control-section {
  padding: 16px 0;
  border-bottom: 1px solid rgba(222, 211, 220, 0.78);
}

.control-section:first-child {
  padding-top: 0;
}

.collapsible-section summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  margin: 0 0 12px;
  padding: 10px 38px 10px 12px;
  color: var(--ink);
  background: rgba(255, 253, 253, 0.68);
  border: 1px solid rgba(202, 184, 197, 0.76);
  border-radius: 8px;
  box-shadow: var(--inner-glow), var(--shadow-soft);
  backdrop-filter: blur(16px) saturate(145%);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.collapsible-section summary::-webkit-details-marker {
  display: none;
}

.collapsible-section summary:hover {
  color: var(--accent-dark);
  background: rgba(255, 247, 250, 0.82);
  border-color: rgba(186, 143, 162, 0.9);
}

.collapsible-section summary:focus-visible {
  outline: 3px solid rgba(155, 82, 109, 0.28);
  outline-offset: 2px;
}

.collapsible-section summary::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 14px;
  height: 14px;
  color: var(--accent-dark);
  background:
    linear-gradient(var(--accent-dark), var(--accent-dark)) center / 10px 2px no-repeat,
    linear-gradient(var(--accent-dark), var(--accent-dark)) center / 2px 10px no-repeat;
  border-radius: 999px;
  transform: translateY(-52%);
}

.collapsible-section[open] summary::after {
  background: linear-gradient(var(--accent-dark), var(--accent-dark)) center / 10px 2px no-repeat;
}

.collapsible-section summary h2 {
  margin: 0;
}

.collapsible-content > :last-child {
  margin-bottom: 0;
}

.control-section h2,
.table-panel h2,
.compare-panel h2 {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.25;
}

.is-hidden {
  display: none !important;
}

.base-production-controls {
  padding-top: 4px;
}

.base-production-controls h3 {
  margin: 2px 0 10px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

select,
input:not([type="checkbox"]),
textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  color: var(--ink);
  background: rgba(255, 253, 253, 0.74);
  border: 1px solid rgba(202, 184, 197, 0.78);
  border-radius: 8px;
  box-shadow: var(--inner-glow);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

select:hover,
input:not([type="checkbox"]):hover,
textarea:hover {
  background: rgba(255, 253, 253, 0.92);
  border-color: rgba(186, 143, 162, 0.8);
}

select:focus,
input:not([type="checkbox"]):focus,
textarea:focus {
  background: rgba(255, 255, 255, 0.96);
}

textarea {
  resize: vertical;
}

.compact input {
  background: var(--control);
}

.split-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.checkbox-label input[type="checkbox"] {
  appearance: none;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.16)),
    rgba(255, 253, 253, 0.88);
  border: 1px solid rgba(202, 184, 197, 0.86);
  border-radius: 4px;
  box-shadow: var(--inner-glow);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.checkbox-label input[type="checkbox"]:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.2)),
    rgba(255, 247, 250, 0.9);
  border-color: rgba(186, 143, 162, 0.9);
}

.checkbox-label input[type="checkbox"]:checked {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08)),
    linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: rgba(110, 52, 75, 0.76);
}

.checkbox-label input[type="checkbox"]:checked::after {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  margin: 1px auto 0;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.section-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.secondary-button {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--accent-dark);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0.06)),
    var(--accent-soft);
  border: 1px solid rgba(220, 174, 192, 0.9);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--inner-glow), 0 8px 18px rgba(155, 82, 109, 0.12);
  font-weight: 700;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.secondary-button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.08)),
    #f4dce7;
  border-color: #c98aa3;
  box-shadow: var(--inner-glow), 0 10px 22px rgba(155, 82, 109, 0.16);
  transform: translateY(-1px);
}

.secondary-button:active {
  box-shadow: var(--inner-glow), 0 3px 10px rgba(155, 82, 109, 0.13);
  transform: translateY(1px);
}

.custom-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  margin-bottom: 8px;
  background: rgba(248, 242, 246, 0.78);
  border: 1px solid rgba(222, 211, 220, 0.86);
  border-radius: 8px;
  box-shadow: var(--inner-glow);
  font-size: 12px;
}

.custom-summary span {
  color: var(--muted);
}

.custom-summary strong {
  color: var(--ink);
}

.weight-list {
  display: grid;
  gap: 6px;
  max-height: 340px;
  margin-bottom: 10px;
  overflow: auto;
  padding-right: 2px;
}

.weight-row {
  grid-template-columns: minmax(0, 1fr) 74px;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid rgba(238, 227, 234, 0.9);
}

.weight-row span {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
}

.weight-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.weight-row input {
  min-height: 30px;
  padding: 5px 7px;
  text-align: right;
  background: var(--control);
}

.weight-row input:disabled {
  color: var(--muted);
  background: rgba(247, 242, 245, 0.78);
}

.slider-control {
  margin-bottom: 14px;
}

.slider-control div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.slider-control strong {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}

.slider-control output {
  min-width: 92px;
  padding: 2px 7px;
  color: var(--accent-dark);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)),
    var(--accent-soft);
  border: 1px solid rgba(231, 197, 210, 0.95);
  border-radius: 999px;
  box-shadow: var(--inner-glow);
  text-align: center;
  font-weight: 700;
  white-space: normal;
}

.slider-control input {
  padding: 0;
  accent-color: var(--accent);
  box-shadow: none;
}

.content {
  min-width: 0;
  padding: 20px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.tab,
#resetButton,
.close-button {
  min-height: 36px;
  padding: 8px 12px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.3)),
    rgba(255, 253, 253, 0.84);
  border: 1px solid rgba(202, 184, 197, 0.68);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--inner-glow), var(--shadow-soft);
  font-weight: 700;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, color 120ms ease, transform 120ms ease;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab:hover,
#resetButton:hover,
.close-button:hover {
  color: var(--accent-dark);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.18)),
    rgba(255, 247, 250, 0.86);
  border-color: #ba8fa2;
  box-shadow: var(--inner-glow), 0 12px 24px rgba(155, 82, 109, 0.14);
  transform: translateY(-1px);
}

.tab:active,
#resetButton:active,
.close-button:active {
  box-shadow: var(--inner-glow), 0 4px 12px rgba(155, 82, 109, 0.14);
  transform: translateY(1px);
}

.sort-button {
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.sort-button:hover {
  color: var(--accent-dark);
}

.sort-button.active-sort::after {
  content: " ↓";
  color: var(--accent-dark);
}

.sort-button.active-sort[aria-label*="ascending"]::after {
  content: " ↑";
}

.details-button {
  min-height: 28px;
  padding: 4px 9px;
  color: var(--accent-dark);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.04)),
    var(--accent-soft);
  border: 1px solid rgba(220, 174, 192, 0.92);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--inner-glow), 0 6px 14px rgba(155, 82, 109, 0.12);
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.details-button:hover {
  background: #f4dce7;
  border-color: #c98aa3;
  box-shadow: var(--inner-glow), 0 8px 16px rgba(155, 82, 109, 0.16);
  transform: translateY(-1px);
}

.details-button:active {
  box-shadow: var(--inner-glow), 0 3px 10px rgba(155, 82, 109, 0.13);
  transform: translateY(1px);
}

.tab.active {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.1)),
    linear-gradient(135deg, rgba(166, 61, 105, 0.93), rgba(123, 45, 84, 0.9));
  border-color: rgba(155, 82, 109, 0.72);
  box-shadow: var(--inner-glow), 0 10px 22px rgba(155, 82, 109, 0.2);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card,
.table-panel,
.compare-panel {
  background: var(--surface);
  border: 1px solid rgba(222, 211, 220, 0.78);
  border-radius: 8px;
  box-shadow: var(--inner-glow), var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(145%);
}

.summary-card {
  padding: 14px;
  min-width: 0;
  overflow: hidden;
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-card strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.table-panel {
  overflow: hidden;
}

.table-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  background: rgba(255, 250, 251, 0.52);
  border-bottom: 1px solid rgba(222, 211, 220, 0.78);
}

.table-heading p,
.compare-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ranking-description {
  max-width: 760px;
  line-height: 1.35;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  color: #4e4058;
  background: rgba(244, 237, 242, 0.78);
  border: 1px solid rgba(227, 215, 223, 0.9);
  border-radius: 999px;
  box-shadow: var(--inner-glow);
  font-size: 12px;
  font-weight: 700;
}

.muted-chip {
  color: var(--muted);
  background: rgba(255, 250, 250, 0.76);
}

.table-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 190px;
}

.result-meta {
  max-width: 280px;
  text-align: right;
  line-height: 1.35;
}

.table-wrap {
  overflow: auto;
  max-height: 68vh;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 253, 253, 0.78);
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(222, 211, 220, 0.78);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th:first-child,
td:first-child,
th:nth-child(3),
td:nth-child(3),
th:nth-child(4),
td:nth-child(4),
th:nth-child(5),
td:nth-child(5) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

th:nth-child(2),
td:nth-child(2) {
  min-width: 230px;
}

th:nth-child(6),
td:nth-child(6) {
  min-width: 128px;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(241, 232, 238, 0.92);
  color: #493d54;
  font-weight: 700;
  backdrop-filter: blur(16px) saturate(145%);
}

tbody tr {
  cursor: pointer;
  transition: background 120ms ease;
}

tbody tr:hover {
  background: rgba(255, 245, 248, 0.78);
}

.empty-state {
  padding: 28px 16px;
  color: var(--muted);
  background: rgba(255, 253, 253, 0.78);
  border-top: 1px solid rgba(222, 211, 220, 0.78);
  text-align: center;
  font-size: 14px;
}

.rank {
  font-weight: 700;
}

.building-name {
  font-weight: 700;
}

.building-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 8px rgba(55, 42, 65, 0.1);
  font-size: 12px;
  font-weight: 700;
}

.badge.combat { background: #a65548; }
.badge.gbg { background: #b94768; }
.badge.ge { background: #765a8f; }
.badge.qi { background: #7a57a3; }
.badge.fp { background: #2f7c7a; }
.badge.goods { background: #4f7c61; }
.badge.prod { background: #9a7242; }
.badge.diamond { background: #9d5e8f; }
.badge.blueprint { background: #5b75a8; }
.badge.utility { background: #a96f32; }

.compare-panel {
  margin-top: 16px;
  padding: 16px;
}

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

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

.compare-card {
  padding: 12px;
  border: 1px solid rgba(222, 211, 220, 0.82);
  border-radius: 8px;
  background: rgba(248, 242, 246, 0.76);
  box-shadow: var(--inner-glow);
}

.compare-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.metric-list {
  display: grid;
  gap: 6px;
  margin: 0;
}

.metric-list div,
.contribution-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  width: min(760px, 100vw);
  height: 100vh;
  padding: 20px;
  overflow: auto;
  background: rgba(255, 250, 251, 0.82);
  border-left: 1px solid rgba(222, 211, 220, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(150%);
  transform: translateX(105%);
  transition: transform 160ms ease;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(36, 28, 47, 0.28);
  backdrop-filter: blur(4px);
}

.drawer-backdrop[hidden] {
  display: none;
}

.drawer.open {
  transform: translateX(0);
}

.close-button {
  float: right;
  margin-left: 12px;
}

.detail-title {
  margin: 8px 0 4px;
  font-size: 22px;
  line-height: 1.2;
}

.detail-subtitle {
  margin: 0 0 16px;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.detail-stat {
  padding: 10px;
  background: rgba(248, 242, 246, 0.76);
  border: 1px solid rgba(222, 211, 220, 0.84);
  border-radius: 8px;
  box-shadow: var(--inner-glow);
}

.detail-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-stat strong {
  display: block;
  margin-top: 3px;
}

.detail-summary {
  margin: 0 0 14px;
  color: var(--ink);
  line-height: 1.45;
}

.detail-info-list {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.detail-info-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 10px;
  background: rgba(248, 242, 246, 0.62);
  border: 1px solid rgba(222, 211, 220, 0.78);
  border-radius: 8px;
  box-shadow: var(--inner-glow);
}

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

.detail-info-row strong {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.muted-text {
  color: var(--muted);
  font-weight: 500;
}

.contributions {
  display: grid;
  gap: 8px;
}

.contribution-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(222, 211, 220, 0.78);
  font-size: 13px;
}

.attribute-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid rgba(222, 211, 220, 0.82);
  border-radius: 8px;
}

.attribute-table th,
.attribute-table td {
  font-size: 12px;
  white-space: nowrap;
}

.attribute-row {
  cursor: pointer;
}

.attribute-row:hover,
.attribute-row:focus-visible {
  background: rgba(246, 229, 238, 0.72);
  outline: none;
}

.selected-attribute-row {
  background: rgba(224, 239, 237, 0.9);
  box-shadow: inset 3px 0 0 var(--teal);
}

.detail-sort-button {
  min-height: auto;
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.detail-sort-button:hover,
.detail-sort-button:focus-visible {
  color: var(--accent-dark);
  background: transparent;
  box-shadow: none;
  transform: none;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.attribute-table td strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.attribute-table td small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
}

.attribute-table td:first-child {
  min-width: 220px;
  white-space: normal;
}

.signal-table th:nth-child(2),
.signal-table td:nth-child(2),
.signal-table th:nth-child(3),
.signal-table td:nth-child(3),
.signal-table th:nth-child(4),
.signal-table td:nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.signal-table td:first-child {
  min-width: 180px;
  text-align: left;
  white-space: normal;
}

.signal-table th:first-child {
  text-align: left;
}

.report-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(248, 242, 246, 0.76);
  border: 1px solid rgba(222, 211, 220, 0.84);
  border-radius: 8px;
  box-shadow: var(--inner-glow);
}

.report-box label {
  margin: 0;
}

#reportOutput {
  color: var(--muted);
  background: rgba(255, 253, 253, 0.78);
}

@media (min-width: 1180px) {
  .drawer {
    width: min(940px, calc(100vw - 48px));
  }
}

@media (min-width: 1440px) {
  .drawer {
    width: min(1080px, calc(100vw - 72px));
  }
}

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .controls-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .summary-grid,
  .compare-output,
  .compare-inputs,
  .tabs {
    grid-template-columns: 1fr;
  }

  .table-heading,
  .table-actions {
    align-items: stretch;
    justify-items: stretch;
  }

  .table-heading {
    display: grid;
  }

  .result-meta {
    max-width: none;
    text-align: left;
  }

  .collapsible-section {
    padding: 10px 0;
  }

  .collapsible-section summary {
    margin: 0;
  }

  .collapsible-content {
    padding-top: 14px;
  }
}

@media (max-width: 620px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .content {
    padding: 12px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}
