:root {
  color-scheme: dark;
  --page: #15131c;
  --panel: #211e2b;
  --raised: #2d2838;
  --line: #494255;
  --ink: #fff5f1;
  --muted: #c9bdce;
  --accent: #ffb39e;
  --review: #ffe09f;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--page); }
main { width: min(1280px, 100%); margin: auto; padding: clamp(1.1rem, 4vw, 3.5rem); }
.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  position: relative; overflow: hidden; min-height: 12rem; padding: clamp(1.3rem, 4vw, 3rem);
  background: radial-gradient(ellipse at 95% 18%, #71454e 0%, #482f42 42%, #282235 75%);
  border: 1px solid #674a60; border-radius: 1.15rem; margin-bottom: 1.2rem;
}
.hero > div:first-child { max-width: 42rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.3rem, 6vw, 4.4rem); line-height: 1.02; letter-spacing: -.055em; font-weight: 750; }
h2 { font-size: 1.3rem; line-height: 1.15; }
p, small { color: var(--muted); }
.hero p { margin-top: .7rem; font-size: 1.05rem; color: #eedde9; }
.wave { display: flex; align-items: center; gap: .43rem; height: 7rem; flex: none; color: var(--accent); }
.wave i { width: .33rem; height: 30%; background: currentColor; border-radius: .2rem; }
.wave i:nth-child(2n) { height: 52%; }
.wave i:nth-child(3n) { height: 35%; }
.wave i:nth-child(4n) { height: 68%; }
.wave i:nth-child(5n) { height: 92%; }
.wave i:nth-child(7n) { height: 100%; }
.wave i:first-child, .wave i:last-child { height: 13%; }
.panel { border: 1px solid var(--line); border-radius: .9rem; background: var(--panel); padding: clamp(1rem, 3vw, 1.6rem); margin: 0 0 1rem; }
.fields { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1rem; margin-top: 1rem; }
label { display: grid; gap: .28rem; min-width: 0; font-weight: 620; }
input, select, button { font: inherit; }
input[type=file], input[type=number], select {
  width: 100%; min-width: 0; padding: .55rem .7rem; color: var(--ink);
  background: var(--page); border: 1px solid var(--line); border-radius: .45rem;
}
input[type=file]::file-selector-button {
  border: 1px solid var(--line); border-radius: .35rem; background: var(--raised);
  color: var(--ink); padding: .2rem .55rem; margin-right: .6rem; cursor: pointer;
}
input[type=checkbox] { width: 1rem; height: 1rem; accent-color: var(--accent); }
small { font-weight: 400; }
.unit { display: flex; align-items: center; gap: .5rem; max-width: 13rem; }
.unit > span { color: var(--muted); min-width: 2.6rem; font-weight: 500; }
fieldset { border: 1px solid var(--line); border-radius: .55rem; margin: 1.2rem 0; padding: .7rem 1rem 1rem; min-width: 0; }
legend { padding: 0 .35rem; color: var(--muted); }
.check { display: flex; align-items: center; gap: .4rem; width: max-content; max-width: 100%; }
.silence-fields { grid-template-columns: repeat(2, minmax(0, 13rem)); margin-top: .6rem; }
.actions, .result-head, .filters { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
button {
  width: fit-content; border: 1px solid transparent; border-radius: .48rem;
  padding: .57rem .95rem; background: var(--accent); color: #231720; font-weight: 720; cursor: pointer;
}
button.secondary { border-color: var(--line); background: var(--raised); color: var(--ink); }
button:hover { filter: brightness(1.09); }
button:disabled, input:disabled { opacity: .5; cursor: wait; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#status:not(:empty) { margin-top: .65rem; }
.result-head { justify-content: space-between; }
#source { margin-top: .4rem; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin: 1.15rem 0; }
.totals div { padding: .65rem .8rem; background: var(--raised); border-radius: .55rem; }
.totals dt { font-size: .82rem; color: var(--muted); }
.totals dd { margin: .1rem 0 0; font-size: 1.55rem; font-weight: 750; }
.filters { margin-bottom: .8rem; }
.filters label { display: flex; align-items: center; gap: .45rem; }
.filters select { max-width: 18rem; }
.scroll { overflow: auto; max-height: 29rem; border: 1px solid var(--line); border-radius: .45rem; }
table { width: 100%; min-width: 1030px; text-align: left; border-collapse: collapse; font-size: .88rem; }
th, td { padding: .48rem .52rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--raised); color: var(--muted); position: sticky; top: 0; }
td { font-variant-numeric: tabular-nums; }
td:first-child, td:nth-child(2) { overflow-wrap: anywhere; max-width: 13rem; }
th:first-child { min-width: 6.3rem; }
th:nth-child(2) { min-width: 4rem; }
td:nth-child(3), td:nth-child(4), td:nth-child(5), td:nth-child(6), td:nth-child(7), td:nth-child(8), td:nth-child(10) { white-space: nowrap; }
td:last-child { min-width: 11rem; }
tbody tr:last-child td { border-bottom: 0; }
tr.review td:last-child { color: var(--review); }
#no-rows { padding-top: .6rem; }
summary { font-weight: 650; cursor: pointer; }
details ul { color: var(--muted); padding-left: 1.25rem; margin-bottom: 0; }
details li + li { margin-top: .4rem; }
footer { font-size: .86rem; color: var(--muted); }
@media (max-width: 670px) {
  .hero { min-height: auto; }
  .wave { display: none; }
  .fields:not(.silence-fields) { grid-template-columns: 1fr; }
  .filters select { max-width: 11rem; }
}
.demo-banner { padding: .55rem 1rem; text-align: center; font-size: .9rem; color: var(--ink); background: var(--raised); border-bottom: 1px solid var(--line); }
.demo-banner a { color: var(--accent); font-weight: 600; }
dialog { max-width: 30rem; padding: 1.4rem; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
dialog p { margin: .7rem 0 1.1rem; }
a.button { display: inline-block; padding: .62rem 1rem; border-radius: .6rem; background: var(--accent); color: #2a1b1f; font-weight: 650; text-decoration: none; }
a.button:hover { filter: brightness(1.09); }
.pack-summary { margin-bottom: .8rem; }
.pack-summary p + p { margin-top: .25rem; }
#compare-note { color: var(--review); }
