:root {
  --ink: #171614;
  --paper: #f0eee6;
  --sheet: #fbfaf4;
  --shade: #d7d1c2;
  --line: #171614;
  --soft-line: #9b9588;
  --red: #b51f16;
  --green: #214f3f;
  --blue: #173247;
  --yellow: #d6a328;
  --white: #fffdf6;
  --rail: #111412;
  --focus: rgba(214, 163, 40, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(23, 22, 20, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(23, 22, 20, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 44px 44px, 44px 44px, auto;
  color: var(--ink);
  font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.48;
  letter-spacing: 0;
}

a {
  color: inherit;
}

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

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.skip-link {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: 50;
  padding: 10px 14px;
  background: var(--red);
  color: var(--white);
}

.skip-link:focus {
  top: 16px;
}

.app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100svh;
}

.case-index {
  position: sticky;
  top: 0;
  height: 100svh;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 22px;
  padding: 22px 18px;
  overflow: auto;
  background: var(--rail);
  color: var(--white);
  border-right: 4px solid var(--red);
}

.party-mark {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}

.party-mark img {
  display: block;
  width: 76px;
  height: 76px;
  background: var(--white);
  border: 2px solid var(--white);
}

.party-mark b {
  display: block;
  font-size: 1.18rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.party-mark small {
  display: block;
  margin-top: 7px;
  color: rgba(255, 253, 246, 0.72);
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
  line-height: 1.25;
}

.index-nav {
  display: grid;
  border-top: 1px solid rgba(255, 253, 246, 0.25);
}

.index-nav a {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  border-bottom: 1px solid rgba(255, 253, 246, 0.25);
  color: var(--white);
  text-decoration: none;
}

.index-nav span,
.file-label,
.side-ledger p,
.dossier-topline,
.dossier-note span,
caption,
th,
.doc-index,
.protocol-list > li > span {
  font-family: Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
  text-transform: uppercase;
}

.index-nav span {
  color: var(--yellow);
  font-size: 0.82rem;
}

.index-nav a:hover,
.index-nav a:focus-visible,
.side-download:hover,
.side-telegram:hover,
.side-download:focus-visible,
.side-telegram:focus-visible,
.action:hover,
.action:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.side-ledger {
  align-self: start;
  border: 1px solid rgba(255, 253, 246, 0.32);
}

.side-ledger p {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 253, 246, 0.32);
  color: var(--yellow);
  font-size: 0.76rem;
}

.side-ledger dl {
  display: grid;
  margin: 0;
}

.side-ledger div {
  display: grid;
  grid-template-columns: 72px 1fr;
  border-bottom: 1px solid rgba(255, 253, 246, 0.18);
}

.side-ledger div:last-child {
  border-bottom: 0;
}

.side-ledger dt,
.side-ledger dd {
  margin: 0;
  padding: 10px 12px;
}

.side-ledger dt {
  color: var(--white);
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 1.2rem;
  font-weight: 800;
  white-space: nowrap;
}

.side-ledger dd {
  color: rgba(255, 253, 246, 0.7);
}

.side-download,
.side-telegram,
.action {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 14px;
  border: 2px solid currentColor;
  border-radius: 0;
  background: var(--sheet);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.side-download,
.side-telegram {
  width: 100%;
  background: transparent;
  color: var(--white);
}

.side-telegram {
  border-color: var(--red);
  background: var(--red);
}

.action-primary {
  background: var(--red);
  color: var(--white);
}

.case-file {
  min-width: 0;
}

.cover {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.75fr);
  gap: 0;
  min-height: 620px;
  border-bottom: 4px solid var(--line);
  background: var(--sheet);
}

.cover-copy {
  display: grid;
  align-content: center;
  padding: clamp(38px, 7vw, 90px);
  border-right: 2px solid var(--line);
}

.file-label {
  margin: 0 0 13px;
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.cover h1 {
  margin: 0;
  max-width: 720px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 8rem;
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.cover-lede {
  max-width: 680px;
  margin: 28px 0 0;
  font-size: 1.38rem;
  line-height: 1.34;
}

.cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.cover-dossier {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 22px;
  min-height: 100%;
  padding: 30px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(23, 22, 20, 0.08) 1px, transparent 1px),
    var(--shade);
  background-size: 18px 18px, auto;
}

.cover-dossier::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 2px solid var(--line);
  pointer-events: none;
}

.dossier-topline {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 12px;
  font-size: 0.82rem;
}

.dossier-stamp {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  width: min(260px, 72%);
  transform: rotate(-5deg);
  mix-blend-mode: multiply;
}

.dossier-note {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 2px solid var(--line);
  background: var(--sheet);
}

.dossier-note b {
  font-size: 1.2rem;
}

.dossier-photo {
  position: relative;
  z-index: 1;
  height: 130px;
  overflow: hidden;
  border: 2px solid var(--line);
  filter: saturate(0.8) contrast(1.08);
}

.dossier-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 74% 45%;
}

.ledger-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 4px solid var(--line);
  background: var(--blue);
  color: var(--white);
}

.ledger-band div {
  min-height: 104px;
  padding: 20px 26px;
  border-right: 2px solid rgba(255, 253, 246, 0.45);
}

.ledger-band div:last-child {
  border-right: 0;
}

.ledger-band span {
  display: block;
  color: var(--yellow);
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.ledger-band strong {
  display: block;
  margin-top: 7px;
  font-size: 1.25rem;
  line-height: 1.18;
}

.section {
  padding: clamp(42px, 6vw, 78px);
  border-bottom: 4px solid var(--line);
  background: var(--paper);
}

.section:nth-of-type(even) {
  background: var(--sheet);
}

.section-head {
  max-width: 880px;
  margin-bottom: 28px;
}

.section-head-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  max-width: none;
}

.section h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3.6rem;
  line-height: 0.98;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.section-head p:not(.file-label) {
  margin: 16px 0 0;
  max-width: 780px;
  font-size: 1.08rem;
}

.repeal-ledger,
.doc-register {
  overflow-x: auto;
  border: 2px solid var(--line);
  background: var(--sheet);
}

.action-scheme {
  border: 2px solid var(--line);
  background: var(--sheet);
}

.action-scheme h3 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 2px solid var(--line);
  background: var(--ink);
  color: var(--white);
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  text-transform: uppercase;
}

.action-scheme ol {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: scheme;
}

.action-scheme li {
  counter-increment: scheme;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 62px;
  border-bottom: 1px solid var(--soft-line);
  background: var(--sheet);
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  padding-right: 16px;
}

.action-scheme li:last-child {
  border-bottom: 0;
}

.action-scheme li::before {
  content: counter(scheme, decimal-leading-zero);
  display: grid;
  place-items: center;
  border-right: 2px solid var(--line);
  background: rgba(181, 31, 22, 0.09);
  color: var(--red);
  font-family: Consolas, "Liberation Mono", monospace;
  font-weight: 900;
  height: 100%;
}

.action-scheme li:nth-child(even) {
  background: rgba(33, 79, 63, 0.07);
}

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

caption {
  padding: 12px 14px;
  border-bottom: 2px solid var(--line);
  background: var(--ink);
  color: var(--white);
  text-align: left;
  font-size: 0.82rem;
  font-weight: 900;
}

th,
td {
  padding: 13px 14px;
  border-right: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
  vertical-align: top;
  text-align: left;
}

th:last-child,
td:last-child {
  border-right: 0;
}

thead th {
  background: #e4dfd1;
  color: var(--ink);
  font-size: 0.78rem;
}

tbody tr:nth-child(even) {
  background: rgba(33, 79, 63, 0.07);
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  border: 2px solid var(--line);
  background: var(--sheet);
}

.principles article {
  min-height: 190px;
  padding: 20px;
  border-right: 2px solid var(--line);
}

.principles article:last-child {
  border-right: 0;
}

.principles span {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--red);
  color: var(--red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  font-weight: 900;
}

.principles h3,
.next-action h3,
.protocol-list h3,
.source-register h3 {
  margin: 14px 0 0;
  font-size: 1.25rem;
  line-height: 1.15;
}

.principles p,
.protocol-list p {
  margin: 10px 0 0;
}

.readiness-desk {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.readiness-form,
.next-action,
.join-form,
.source-register {
  border: 2px solid var(--line);
  background: var(--sheet);
}

.status-strip {
  display: grid;
  grid-template-columns: auto 120px;
  gap: 10px 16px;
  align-items: center;
  padding: 18px;
  border-bottom: 2px solid var(--line);
  background: var(--ink);
  color: var(--white);
}

.status-strip span {
  font-family: Consolas, "Liberation Mono", monospace;
  text-transform: uppercase;
}

.status-strip strong {
  justify-self: end;
  color: var(--yellow);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3rem;
  line-height: 1;
}

.meter {
  grid-column: 1 / -1;
  height: 16px;
  border: 2px solid var(--white);
  background: transparent;
}

.meter div {
  width: 0;
  height: 100%;
  background: var(--yellow);
  transition: width 180ms ease;
}

#readiness-verdict {
  grid-column: 1 / -1;
  margin: 0;
}

fieldset {
  margin: 0;
  border: 0;
  padding: 18px;
}

fieldset + fieldset {
  border-top: 2px solid var(--line);
}

legend {
  padding: 0 0 10px;
  font-family: Consolas, "Liberation Mono", monospace;
  font-weight: 900;
  text-transform: uppercase;
}

.number-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.number-board legend,
.check-board legend {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

label span {
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
}

input,
select {
  min-height: 43px;
  padding: 8px 10px;
}

textarea {
  min-height: 170px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid var(--focus);
  outline-offset: 1px;
}

.check-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}

.check-board label {
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: start;
  font-weight: 700;
}

.check-board input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--red);
}

.next-action {
  padding: 18px;
}

.risk-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.risk-list li {
  padding: 11px 12px;
  border: 2px solid var(--red);
  background: #fff4ed;
}

.risk-list li.ok {
  border-color: var(--green);
  background: #eef7ee;
}

.doc-register .action {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 0.92rem;
  white-space: nowrap;
}

.doc-index {
  color: var(--red);
  font-weight: 900;
}

.protocol-list {
  display: grid;
  margin: 0;
  padding: 0;
  border: 2px solid var(--line);
  background: var(--sheet);
  list-style: none;
}

.protocol-list > li {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  border-bottom: 2px solid var(--line);
}

.protocol-list > li:last-child {
  border-bottom: 0;
}

.protocol-list > li > span {
  display: grid;
  place-items: center;
  border-right: 2px solid var(--line);
  background: var(--red);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 900;
}

.protocol-list div {
  padding: 18px;
}

.protocol-list h3 {
  margin-top: 0;
}

.source-register {
  margin-top: 18px;
  padding: 18px;
}

.source-register h3 {
  margin-top: 0;
}

.source-register ul {
  columns: 2;
  gap: 28px;
  margin: 14px 0 0;
  padding-left: 18px;
}

.source-register li {
  break-inside: avoid;
  margin-bottom: 9px;
}

.source-register a {
  color: var(--blue);
  font-weight: 800;
}

.join-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
}

.join-form .action {
  align-self: end;
}

.join-form textarea {
  grid-column: 1 / -1;
}

.case-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 26px clamp(24px, 6vw, 78px);
  background: var(--rail);
  color: rgba(255, 253, 246, 0.78);
}

.case-footer p {
  margin: 0;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .case-index {
    position: static;
    height: auto;
    grid-template-columns: 1fr;
  }

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

  .cover h1 {
    font-size: 5.8rem;
  }

  .cover-lede {
    font-size: 1.22rem;
  }

  .section h2 {
    font-size: 3rem;
  }

  .cover-copy {
    border-right: 0;
    border-bottom: 2px solid var(--line);
  }

  .cover-dossier {
    min-height: 420px;
  }

  .readiness-desk,
  .section-head-split {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .case-index {
    padding: 16px 14px;
  }

  .party-mark {
    grid-template-columns: 56px 1fr;
  }

  .party-mark img {
    width: 56px;
    height: 56px;
  }

  .index-nav a {
    grid-template-columns: 34px 1fr;
  }

  .side-ledger {
    display: none;
  }

  .cover-copy,
  .section {
    padding: 28px 18px;
  }

  .cover {
    min-height: auto;
  }

  .cover h1 {
    font-size: 3.28rem;
    line-height: 0.92;
  }

  .cover-lede {
    font-size: 1.04rem;
  }

  .section h2 {
    font-size: 2.15rem;
  }

  .cover-actions,
  .ledger-band,
  .principles,
  .number-board,
  .check-board,
  .join-form,
  .case-footer {
    grid-template-columns: 1fr;
  }

  .cover-actions,
  .section-head-split {
    align-items: stretch;
  }

  .action {
    width: 100%;
  }

  .ledger-band div,
  .principles article {
    border-right: 0;
    border-bottom: 2px solid var(--line);
  }

  .ledger-band div:last-child,
  .principles article:last-child {
    border-bottom: 0;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .status-strip strong {
    justify-self: start;
  }

  .protocol-list > li {
    grid-template-columns: 54px 1fr;
  }

  .source-register ul {
    columns: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
