:root {
  color-scheme: light dark;
  --background: #f7f6f1;
  --surface: #ffffff;
  --surface-subtle: #f0eee7;
  --foreground: #1e2521;
  --muted-foreground: #5c6963;
  --border: #e4e2d9;
  --border-strong: #c7c4b6;
  --primary: #155f58;
  --primary-hover: #0f4a44;
  --primary-foreground: #ffffff;
  --accent: #e5efeb;
  --accent-foreground: #114a44;
  --destructive: #a8463b;
  --destructive-surface: #f9e9e5;
  --success: #2e7d54;
  --success-surface: #e3f0e8;
  --focus: #155f58;
  --chart-positive: #c96f3a;
  --chart-negative: #2f7ca6;
  --chart-zero: #f7f6f1;
  --chart-od-spectrum: #0e7a6d;
  --chart-dt-spectrum: #ad4f70;
  --chart-od-kinetics: #9a7a1f;
  --chart-dt-kinetics: #6a5aa8;
  --shadow: 0 1px 2px rgb(30 37 33 / 0.04), 0 14px 34px -14px rgb(30 37 33 / 0.14);
  --shadow-lift: 0 2px 4px rgb(30 37 33 / 0.05), 0 18px 40px -14px rgb(30 37 33 / 0.18);
  --radius-small: 10px;
  --radius-medium: 16px;
  --page-width: 1480px;
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: var(--font-sans);
  font-size: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #131715;
    --surface: #1a201d;
    --surface-subtle: #222a26;
    --foreground: #e9ede8;
    --muted-foreground: #9daaa2;
    --border: #2d3733;
    --border-strong: #47544d;
    --primary: #6cb8ad;
    --primary-hover: #86c9bf;
    --primary-foreground: #0d211d;
    --accent: #243c36;
    --accent-foreground: #d5efe8;
    --destructive: #e8897d;
    --destructive-surface: #3d2420;
    --success: #7cc79c;
    --success-surface: #1c3527;
    --focus: #6cb8ad;
    --chart-positive: #e88a58;
    --chart-negative: #5ea8cf;
    --chart-zero: #161b18;
    --chart-od-spectrum: #67bfb4;
    --chart-dt-spectrum: #d986a4;
    --chart-od-kinetics: #d0b558;
    --chart-dt-kinetics: #a79adf;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.2), 0 16px 40px -14px rgb(0 0 0 / 0.5);
    --shadow-lift: 0 2px 4px rgb(0 0 0 / 0.24), 0 22px 48px -14px rgb(0 0 0 / 0.55);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--foreground);
  background: var(--background);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: color-mix(in srgb, var(--primary) 22%, transparent);
}

button,
input,
select {
  font: inherit;
}

button,
select {
  accent-color: var(--primary);
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2.5px solid color-mix(in srgb, var(--focus) 60%, transparent);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: 0.01em;
}

h3 {
  line-height: 1.3;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 0.7rem;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
}

h2 {
  margin-bottom: 0.55rem;
  font-size: clamp(1.4rem, 2vw, 1.75rem);
}

h3 {
  margin-bottom: 0.6rem;
  font-size: 1rem;
  font-weight: 600;
}

code {
  padding: 0.08em 0.35em;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-subtle);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

[hidden] {
  display: none !important;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-small);
  color: var(--primary-foreground);
  background: var(--primary);
  transform: translateY(-180%);
}

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

.site-header {
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(52rem 22rem at 88% -30%, color-mix(in srgb, var(--accent) 78%, transparent), transparent 70%),
    radial-gradient(38rem 18rem at -8% 120%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%),
    var(--background);
}

.site-header::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary),
    color-mix(in srgb, var(--primary) 55%, var(--background)) 55%,
    transparent
  );
}

.site-header__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  width: min(100% - 2rem, var(--page-width));
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3.4rem);
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 1.15rem;
  min-width: 0;
}

.brand__mark {
  display: grid;
  flex: 0 0 auto;
  width: 3.4rem;
  margin-top: 0.4rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 14px;
  background: var(--primary);
  box-shadow: var(--shadow);
}

.brand__mark svg {
  display: block;
  width: 62%;
  height: 62%;
}

.site-intro {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted-foreground);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
}

.eyebrow,
.section-kicker {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before,
.section-kicker::before {
  content: "";
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1px;
  background: var(--primary);
  opacity: 0.55;
}

.privacy-note {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.35rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-foreground);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  box-shadow: 0 1px 2px rgb(30 37 33 / 0.04);
  font-size: 0.82rem;
}

.privacy-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 16%, transparent);
}

.page-shell {
  width: min(100% - 2rem, var(--page-width));
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 0 4rem;
}

.upload-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(360px, 1.35fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: rise 420ms ease both;
}

.upload-panel__copy p:last-child {
  max-width: 440px;
  margin-bottom: 0;
  color: var(--muted-foreground);
}

.drop-zone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem 1.25rem;
  align-items: center;
  min-height: 180px;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-small);
  background: var(--surface-subtle);
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.drop-zone:hover {
  border-color: color-mix(in srgb, var(--primary) 65%, var(--border-strong));
}

.drop-zone.is-dragging {
  border-style: solid;
  border-color: var(--primary);
  background: var(--accent);
  transform: scale(1.006);
}

.drop-zone strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.08rem;
  font-weight: 600;
}

.drop-zone p {
  margin-bottom: 0;
  color: var(--muted-foreground);
  font-size: 0.88rem;
}

.drop-zone__mark {
  display: grid;
  place-items: center;
  width: 4rem;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: 12px;
  color: var(--accent-foreground);
  background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--surface)));
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.upload-actions,
.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.upload-actions {
  grid-column: 1 / -1;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.6rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
  color: var(--foreground);
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(20 26 23 / 0.05);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease,
    box-shadow 140ms ease, transform 140ms ease;
}

.button:hover {
  border-color: var(--primary);
  color: var(--accent-foreground);
  background: var(--accent);
  box-shadow: 0 4px 10px -4px rgb(20 26 23 / 0.18);
  transform: translateY(-1px);
}

.button:active {
  box-shadow: 0 1px 2px rgb(20 26 23 / 0.08);
  transform: translateY(0);
}

.button--primary {
  border-color: var(--primary);
  color: var(--primary-foreground);
  background: var(--primary);
  box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--primary) 75%, transparent);
}

.button--primary:hover {
  border-color: var(--primary-hover);
  color: var(--primary-foreground);
  background: var(--primary-hover);
  box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--primary) 80%, transparent);
}

.button__icon {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
}

.processing,
.message-area {
  margin-top: 1rem;
  padding: 0.95rem 1.1rem;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius-small);
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(30 37 33 / 0.04);
}

.processing {
  border-left-color: var(--primary);
}

.processing p {
  margin: 0.55rem 0 0;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

.processing__bar {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-subtle);
}

.processing__bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 60%, var(--success)));
  transition: width 160ms ease;
}

.message-area:not([hidden]) {
  animation: rise 280ms ease both;
}

.message-area[data-tone="success"] {
  border-color: color-mix(in srgb, var(--success) 42%, var(--border));
  border-left-color: var(--success);
  background: var(--success-surface);
}

.message-area[data-tone="error"] {
  border-color: color-mix(in srgb, var(--destructive) 48%, var(--border));
  border-left-color: var(--destructive);
  background: var(--destructive-surface);
}

.message-area strong {
  display: block;
  margin-bottom: 0.25rem;
}

.message-area p,
.message-area ul {
  margin-bottom: 0;
}

.message-area ul {
  padding-left: 1.25rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
  align-items: start;
}

.workspace:not([hidden]) {
  animation: rise 420ms ease both;
}

.file-panel,
.analysis-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.file-panel {
  position: sticky;
  top: 1rem;
  overflow: hidden;
}

.file-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-subtle) 45%, var(--surface));
}

.file-panel__header h2 {
  margin-bottom: 0;
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 600;
}

.file-panel__header .section-kicker {
  margin-bottom: 0.25rem;
}

.count-badge {
  display: inline-grid;
  min-width: 1.9rem;
  min-height: 1.9rem;
  padding: 0 0.45rem;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 999px;
  color: var(--accent-foreground);
  background: var(--accent);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.file-list {
  display: grid;
  gap: 1px;
  max-height: min(70vh, 760px);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  background: var(--border);
}

.file-list::-webkit-scrollbar {
  width: 8px;
}

.file-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--border-strong);
}

.file-list button {
  display: grid;
  width: 100%;
  gap: 0.2rem;
  padding: 0.8rem 1.1rem;
  border: 0;
  color: var(--foreground);
  text-align: left;
  background: var(--surface);
  cursor: pointer;
  transition: background-color 120ms ease;
}

.file-list button:hover {
  background: var(--surface-subtle);
}

.file-list button[aria-current="true"] {
  color: var(--accent-foreground);
  background: var(--accent);
  box-shadow: inset 3px 0 0 var(--primary);
}

.file-name {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 500;
}

.file-result {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.analysis-panel {
  min-width: 0;
  overflow: hidden;
}

.analysis-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border-bottom: 1px solid var(--border);
}

.analysis-header__title {
  min-width: 0;
}

.analysis-header h2 {
  margin-bottom: 0.4rem;
  overflow-wrap: anywhere;
}

.dataset-meta {
  margin-bottom: 0;
  color: var(--muted-foreground);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.download-actions {
  flex: 0 0 auto;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-subtle) 35%, var(--surface));
}

.summary-grid > div {
  min-width: 0;
  padding: 1.05rem clamp(0.8rem, 2vw, 1.4rem);
  border-right: 1px solid var(--border);
}

.summary-grid > div:last-child {
  border-right: 0;
}

.summary-grid dt {
  margin-bottom: 0.35rem;
  color: var(--muted-foreground);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
}

.summary-grid dd {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.visualization {
  padding: clamp(1rem, 3vw, 2rem);
}

.chart-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr)) minmax(180px, 0.45fr);
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.5rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--border);
}

.chart-controls label {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
  color: var(--muted-foreground);
  font-size: 0.8rem;
  font-weight: 500;
}

.chart-controls label > span {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
}

.chart-controls output {
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.chart-controls input[type="range"] {
  width: 100%;
  min-height: 1.8rem;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.chart-controls input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
}

.chart-controls input[type="range"]::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  margin-top: -6.5px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  appearance: none;
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(20 26 23 / 0.22);
  transition: transform 120ms ease;
}

.chart-controls input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
}

.chart-controls input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid var(--primary);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(20 26 23 / 0.22);
  transition: transform 120ms ease;
}

.chart-controls input[type="range"]:hover::-webkit-slider-thumb,
.chart-controls input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

.chart-controls input[type="range"]:hover::-moz-range-thumb,
.chart-controls input[type="range"]:active::-moz-range-thumb {
  transform: scale(1.15);
}

.chart-controls select {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.5rem 2.1rem 0.5rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
  appearance: none;
  color: var(--foreground);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%238a938c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  box-shadow: 0 1px 2px rgb(20 26 23 / 0.05);
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 140ms ease;
}

.chart-controls select:hover {
  border-color: var(--primary);
}

.heatmap-figure,
.chart-grid figure {
  margin: 0;
}

.figure-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
}

.figure-heading h3,
.figure-heading .section-kicker {
  margin-bottom: 0;
}

.figure-heading .section-kicker {
  margin-bottom: 0.3rem;
}

.figure-heading h3 {
  font-family: var(--font-serif);
  font-size: 1.12rem;
}

.color-legend {
  width: min(180px, 42vw);
  flex: 0 0 auto;
}

.color-legend__ramp {
  height: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--chart-negative), var(--chart-zero), var(--chart-positive));
}

.color-legend__labels {
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.3rem;
  color: var(--muted-foreground);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.canvas-wrap {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
}

canvas {
  display: block;
  width: 100%;
}

.heatmap-canvas {
  height: 440px;
  cursor: crosshair;
}

.line-canvas {
  height: 285px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  max-width: 240px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
  color: var(--foreground);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-lift);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  white-space: pre-line;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.selected-point {
  min-height: 1.4rem;
  margin-top: 0.7rem;
  color: var(--muted-foreground);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.6rem;
}

.chart-grid figure {
  min-width: 0;
  padding: 0.95rem 1rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(30 37 33 / 0.04);
}

.chart-grid h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  color: var(--muted-foreground);
  font-size: 0.84rem;
  font-weight: 500;
}

.chart-grid h3::before {
  content: "";
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--border-strong);
}

#od-spectrum-title::before {
  background: var(--chart-od-spectrum);
}

#dt-spectrum-title::before {
  background: var(--chart-dt-spectrum);
}

#od-kinetics-title::before {
  background: var(--chart-od-kinetics);
}

#dt-kinetics-title::before {
  background: var(--chart-dt-kinetics);
}

.cleaning-details {
  margin: 0 clamp(1rem, 3vw, 2rem) clamp(1rem, 3vw, 2rem);
  border-top: 1px solid var(--border);
}

.cleaning-details summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 0;
  color: var(--foreground);
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  transition: color 120ms ease;
}

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

.cleaning-details summary::before {
  content: "";
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: -0.15rem;
  border-right: 1.6px solid var(--muted-foreground);
  border-bottom: 1.6px solid var(--muted-foreground);
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}

.cleaning-details[open] summary::before {
  transform: rotate(45deg);
}

.cleaning-details summary:hover {
  color: var(--primary);
}

.cleaning-details__content {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(300px, 1.3fr);
  gap: 2rem;
  padding: 0.25rem 0 1rem;
}

.rule-list,
.cleaning-actions {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted-foreground);
  font-size: 0.84rem;
}

.rule-list li,
.cleaning-actions li {
  margin-bottom: 0.55rem;
}

.cleaning-actions strong {
  color: var(--foreground);
  font-weight: 500;
}

.cleaning-actions .action-meta {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.noscript-message {
  padding: 1rem;
  border: 1px solid var(--destructive);
  border-radius: var(--radius-small);
  color: var(--destructive);
  background: var(--destructive-surface);
}

.site-footer {
  width: min(100% - 2rem, var(--page-width));
  margin: 0 auto;
  padding: 1.4rem 0 2.75rem;
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

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

  .file-panel {
    position: static;
  }

  .file-list {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    max-height: none;
  }

  .chart-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-controls label:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .site-header__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand__mark {
    width: 2.9rem;
    border-radius: 12px;
  }

  .privacy-note {
    margin: 0;
  }

  .upload-panel {
    grid-template-columns: 1fr;
  }

  .analysis-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .download-actions {
    width: 100%;
  }

  .download-actions .button {
    flex: 1 1 210px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-grid > div:nth-child(2) {
    border-right: 0;
  }

  .summary-grid > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }

  .chart-grid,
  .cleaning-details__content {
    grid-template-columns: 1fr;
  }

  .heatmap-canvas {
    height: 380px;
  }
}

@media (max-width: 560px) {
  .site-header__inner,
  .page-shell,
  .site-footer {
    width: min(100% - 1.25rem, var(--page-width));
  }

  .brand {
    gap: 0.85rem;
  }

  .drop-zone {
    grid-template-columns: 1fr;
  }

  .drop-zone__mark {
    width: 3.4rem;
  }

  .upload-actions,
  .upload-actions .button {
    width: 100%;
  }

  .chart-controls {
    grid-template-columns: 1fr;
  }

  .chart-controls label:last-child {
    grid-column: auto;
  }

  .figure-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .color-legend {
    width: 100%;
  }

  .heatmap-canvas {
    height: 330px;
  }

  .line-canvas {
    height: 255px;
  }
}
