:root {
  --ink: #17211d;
  --muted: #64706a;
  --line: #d9dfdc;
  --paper: #f7f8f6;
  --surface: #ffffff;
  --source: #c25e08;
  --source-soft: #fff3df;
  --filled: #0c7658;
  --filled-soft: #e3f6ef;
  --shadow: 0 8px 24px rgb(21 35 29 / 10%);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-width: 900px;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 18px 24px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.intro {
  max-width: 820px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.privacy-card {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  gap: 10px;
  max-width: 330px;
  padding: 11px 14px;
  border: 1px solid #b9ded1;
  border-radius: 10px;
  background: var(--filled-soft);
  font-size: 12px;
}

.privacy-card strong,
.privacy-card span {
  display: block;
}

.privacy-card span {
  margin-top: 2px;
  color: #3e6256;
}

.privacy-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--filled);
  box-shadow: 0 0 0 4px rgb(12 118 88 / 12%);
}

.controls {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  padding: 7px 24px;
  background: #f1f4f2;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.sync-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}

.sync-control input {
  width: 16px;
  height: 16px;
  accent-color: var(--filled);
}

.status {
  color: var(--muted);
}

.download-links {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.download-links a {
  padding: 6px 10px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #cfd7d3;
  border-radius: 7px;
  font-weight: 650;
  text-decoration: none;
}

.download-links a:hover,
.download-links a:focus-visible {
  border-color: #87968f;
  outline: none;
}

.legend {
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.legend summary {
  padding: 9px 0;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  padding: 0 0 10px;
}

.legend-item {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbf9;
}

.legend-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11px;
  font-weight: 800;
}

.legend-number {
  display: inline-grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #37443e;
  font-size: 10px;
}

.legend-summary {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  min-height: 0;
  padding: 12px;
  gap: 0;
}

.divider {
  background: #bfc9c4;
}

.document-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: var(--surface);
}

.source-panel {
  border-radius: 10px 0 0 10px;
}

.filled-panel {
  border-radius: 0 10px 10px 0;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 0;
  font-size: 16px;
}

.color-key {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
}

.source-key {
  color: #814006;
  background: var(--source-soft);
}

.filled-key {
  color: #07543f;
  background: var(--filled-soft);
}

.document-scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  background: #e9eeeb;
  scrollbar-gutter: stable;
}

.document-scroll:focus-visible {
  outline: 3px solid rgb(12 118 88 / 35%);
  outline-offset: -3px;
}

.pdf-page {
  display: block;
  width: min(100%, 850px);
  height: auto;
  margin: 0 auto 18px;
  background: #fff;
  border: 1px solid #cbd2ce;
  box-shadow: var(--shadow);
}

.page-caption {
  width: min(100%, 850px);
  margin: -10px auto 18px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.loading,
.error,
.noscript {
  margin: 24px;
  padding: 14px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
}

.error {
  color: #8f1d1d;
  border: 1px solid #e0b7b7;
}

@media (max-height: 800px) {
  .site-header {
    padding-top: 10px;
    padding-bottom: 9px;
  }

  .intro {
    display: none;
  }

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

  .legend-summary {
    display: none;
  }
}

@media (max-width: 1200px) {
  .legend-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
