:root {
  --bg: #f6f5ef;
  --bg-alt: #fcfbf6;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --surface-muted: rgba(255, 255, 255, 0.66);
  --text: #142033;
  --muted: #5a6678;
  --accent: #1f6fff;
  --accent-strong: #0d53ca;
  --accent-soft: rgba(31, 111, 255, 0.12);
  --accent-soft-strong: rgba(31, 111, 255, 0.2);
  --warm: #ec8a22;
  --success: #118861;
  --danger: #c2403c;
  --danger-soft: rgba(194, 64, 60, 0.12);
  --success-soft: rgba(17, 136, 97, 0.14);
  --changed-soft: rgba(236, 138, 34, 0.16);
  --warning: #b77012;
  --border: rgba(20, 32, 51, 0.1);
  --border-strong: rgba(20, 32, 51, 0.16);
  --shadow: 0 28px 64px rgba(26, 37, 58, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --container: 1180px;
}

:root[data-theme="dark"] {
  --bg: #0c111b;
  --bg-alt: #111827;
  --surface: rgba(17, 24, 39, 0.82);
  --surface-strong: #161f33;
  --surface-muted: rgba(18, 28, 46, 0.72);
  --text: #f3f7ff;
  --muted: #a9b4c8;
  --accent: #5aa5ff;
  --accent-strong: #8fc3ff;
  --accent-soft: rgba(90, 165, 255, 0.14);
  --accent-soft-strong: rgba(90, 165, 255, 0.22);
  --warm: #ffb35a;
  --success: #53d3a5;
  --danger: #ff837a;
  --danger-soft: rgba(255, 131, 122, 0.14);
  --success-soft: rgba(83, 211, 165, 0.14);
  --changed-soft: rgba(255, 179, 90, 0.16);
  --warning: #ffc66d;
  --border: rgba(243, 247, 255, 0.08);
  --border-strong: rgba(243, 247, 255, 0.14);
  --shadow: 0 28px 64px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(31, 111, 255, 0.16), transparent 24rem),
    radial-gradient(circle at top right, rgba(236, 138, 34, 0.14), transparent 26rem),
    linear-gradient(180deg, var(--bg-alt), var(--bg));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.54), transparent 84%);
  opacity: 0.22;
}

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

a:hover {
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  border-bottom: 1px solid var(--border);
}

.nav-shell,
.footer-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--warm));
  box-shadow: 0 14px 28px rgba(31, 111, 255, 0.24);
}

.site-nav,
.footer-nav,
.header-actions,
.hero-points,
.tool-actions,
.legend {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.site-nav a,
.footer-nav a {
  color: var(--muted);
  font-size: 0.95rem;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

.theme-toggle,
.button,
.select-input {
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.theme-toggle {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.8rem 1rem;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
}

.theme-toggle:hover,
.button:hover,
.select-input:hover {
  transform: translateY(-1px);
  border-color: var(--accent-soft-strong);
}

.hero,
.article-shell {
  padding: 4.5rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 1.5rem;
  align-items: stretch;
}

.eyebrow,
.section-label {
  margin: 0 0 0.75rem;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h1,
h2 {
  font-family: "Sora", "IBM Plex Sans", sans-serif;
}

h1 {
  max-width: 11ch;
  font-size: clamp(2.8rem, 5vw, 4.8rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
}

h3 {
  font-size: 1.05rem;
}

.hero-text,
.article-lead,
.article-text,
.footer-copy,
.panel-note,
.drop-help,
.progress-text,
.helper-text,
.prose p,
.prose li,
.pane-note {
  color: var(--muted);
  line-height: 1.72;
  font-size: 1rem;
}

.hero-copy,
.hero-panel,
.card,
.site-footer {
  animation: fade-up 480ms ease both;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-text,
.article-lead {
  margin: 1.25rem 0 1.5rem;
  max-width: 60ch;
}

.hero-points span,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.5rem 0.85rem;
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.88rem;
}

.chip-quiet {
  color: var(--muted);
}

.chip-added {
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
  background: var(--success-soft);
}

.chip-removed {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--border));
  background: var(--danger-soft);
}

.chip-changed {
  border-color: color-mix(in srgb, var(--warm) 38%, var(--border));
  background: var(--changed-soft);
}

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 18rem);
}

.hero-panel,
.tool-grid section,
.summary-card,
.table-card,
.diff-card,
.article-hero,
.article-grid .card {
  padding: 1.5rem;
}

.hero-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.hero-metric {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.hero-metric strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-family: "Sora", "IBM Plex Sans", sans-serif;
}

.tool-shell {
  display: grid;
  gap: 1.5rem;
  padding-bottom: 2rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 1.5rem;
}

.section-head,
.panel-head,
.pane-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.upload-columns,
.comparison-grid,
.article-grid {
  display: grid;
  gap: 1.5rem;
}

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

.upload-pane {
  display: grid;
  gap: 1rem;
}

.pane-note {
  margin: 0;
  font-size: 0.92rem;
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0.5rem;
  min-height: 214px;
  padding: 1.4rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top, rgba(31, 111, 255, 0.12), transparent 13rem),
    linear-gradient(180deg, var(--surface-strong), var(--surface-muted));
  cursor: pointer;
  text-align: center;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.drop-zone:hover,
.drop-zone.drag-over {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 20px 32px rgba(31, 111, 255, 0.12);
}

.drop-icon {
  display: inline-grid;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--warm));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.drop-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.button {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.85rem 1.15rem;
  cursor: pointer;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 16px 30px rgba(31, 111, 255, 0.2);
}

.button.secondary {
  background: var(--surface-strong);
  color: var(--text);
}

.button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.inline-actions {
  justify-content: flex-start;
}

.controls-grid,
.stats-grid {
  display: grid;
  gap: 1rem;
}

.controls-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1rem 0 1.25rem;
}

.stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 1.25rem;
}

.field {
  display: grid;
  gap: 0.45rem;
  align-content: start;
}

.field-label {
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.select-input,
.static-field {
  min-height: 3.6rem;
  padding: 0.92rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
}

.static-field strong {
  font-size: 1rem;
}

.file-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0;
}

.file-meta div,
.stat-card,
.panel,
.link-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
}

.file-meta div {
  padding: 0.95rem 1rem;
}

.file-meta dt,
.stat-label {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.file-meta dd {
  margin: 0;
  font-weight: 600;
}

.stat-card {
  padding: 1rem;
}

.stat-value {
  display: block;
  font-size: 1.8rem;
  font-family: "Sora", "IBM Plex Sans", sans-serif;
}

.panel {
  padding: 1rem;
}

.issue-list {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.issue-list li + li {
  margin-top: 0.55rem;
}

.issue-empty {
  color: var(--muted);
}

.progress-block {
  margin-top: 1rem;
}

.progress-track {
  width: 100%;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  overflow: hidden;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--warm));
}

.table-wrap {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-strong);
}

th,
td {
  padding: 0.82rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 0.95rem;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--surface-strong) 88%, var(--bg));
  color: var(--text);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.table-card td,
.diff-card td,
.table-card th,
.diff-card th {
  min-width: 110px;
}

.col-meta {
  width: 132px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-added {
  background: var(--success-soft);
  color: var(--success);
}

.status-removed {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-changed {
  background: var(--changed-soft);
  color: var(--warning);
}

.status-unchanged {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.row-added td {
  background: color-mix(in srgb, var(--success-soft) 78%, transparent);
}

.row-removed td {
  background: color-mix(in srgb, var(--danger-soft) 78%, transparent);
}

.row-changed td {
  background: color-mix(in srgb, var(--changed-soft) 42%, transparent);
}

.cell-changed {
  background: color-mix(in srgb, var(--warm) 24%, var(--surface-strong)) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warm) 50%, transparent);
}

.row-empty td {
  color: var(--muted);
  font-style: italic;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 1.4rem;
}

.article-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  align-items: start;
}

.article-hero {
  margin-bottom: 1.5rem;
}

.prose h2,
.prose h3 {
  margin-top: 0;
}

.prose h2 + p,
.prose h3 + p,
.prose h2 + ul,
.prose h3 + ul,
.prose pre + p {
  margin-top: 0.85rem;
}

.prose h2:not(:first-child),
.prose h3:not(:first-child) {
  margin-top: 1.7rem;
}

.examples-list {
  margin: 0;
  padding-left: 1.2rem;
}

.snippet {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: #0b1220;
  color: #e7efff;
  font-family: "IBM Plex Sans", monospace;
  font-size: 0.92rem;
  line-height: 1.6;
}

.link-stack {
  display: grid;
  gap: 0.9rem;
}

.link-card {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
}

.link-card strong {
  color: var(--text);
}

.link-card span {
  color: var(--muted);
}

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
}

.footer-copy {
  margin: 0.8rem 0 0;
  max-width: 44ch;
}

.footer-nav {
  justify-content: flex-end;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

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

@media (max-width: 1080px) {
  .tool-grid,
  .hero-grid,
  .article-grid,
  .upload-columns,
  .comparison-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 820px) {
  .nav-shell,
  .footer-shell {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    max-width: none;
  }

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

  .file-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(var(--container), calc(100% - 1rem));
  }

  .hero,
  .article-shell {
    padding-top: 3rem;
  }

  .hero-panel,
  .tool-grid section,
  .summary-card,
  .table-card,
  .diff-card,
  .article-hero,
  .article-grid .card {
    padding: 1.15rem;
  }

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

  .button,
  .theme-toggle,
  .select-input {
    width: 100%;
  }

  .tool-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
