:root {
  color-scheme: light;
  --paper: #f2eedf;
  --paper-deep: #e7e0cd;
  --ink: #171713;
  --muted: #625f55;
  --rule: #27271f;
  --red: #b62c24;
  --red-dark: #852018;
  --green: #1e5f45;
  --white: #fffdf5;
  --shadow: 0.35rem 0.35rem 0 var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(rgba(23, 23, 19, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 1.75rem;
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 0.2rem solid #146fc2;
  outline-offset: 0.15rem;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1rem clamp(1rem, 4vw, 4rem);
  border-bottom: 0.15rem solid var(--ink);
  background: var(--paper);
}

.identity {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: inherit;
  text-decoration: none;
}

.identity-mark {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 0.16rem solid var(--ink);
  border-radius: 50%;
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  transform: rotate(-6deg);
}

.identity strong,
.identity small {
  display: block;
}

.identity strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.identity small {
  margin-top: 0.12rem;
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.registry-meta {
  display: flex;
  gap: 2rem;
  margin: 0;
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.registry-meta div {
  min-width: 8rem;
}

.registry-meta dt {
  color: var(--muted);
}

.registry-meta dd {
  margin: 0.2rem 0 0;
  font-weight: 700;
}

main {
  width: min(74rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 6rem) 0 4rem;
}

.objection-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(20rem, 1.14fr);
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(1.4rem, 4vw, 3.25rem);
  border: 0.15rem solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
}

.form-number {
  position: absolute;
  top: -0.85rem;
  left: 1.25rem;
  padding: 0.3rem 0.55rem;
  border: 0.12rem solid var(--ink);
  background: var(--paper);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--red-dark);
  font-family: "Courier New", monospace;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1,
h2,
.docket-word {
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  max-width: 12ch;
  margin-bottom: 1rem;
  font-size: clamp(2.4rem, 6vw, 5.5rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.lede {
  max-width: 36rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.word-search {
  align-self: center;
}

.word-search label {
  display: block;
  margin-bottom: 0.55rem;
  font-family: "Courier New", monospace;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-row {
  display: flex;
  align-items: stretch;
}

.search-row input {
  min-width: 0;
  flex: 1 1 auto;
  padding: 1rem 1.05rem;
  border: 0.15rem solid var(--ink);
  border-right: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.search-row button,
.primary-action,
.secondary-action {
  border: 0.15rem solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.search-row button,
.primary-action {
  padding: 0.9rem 1.15rem;
  background: var(--ink);
  color: var(--white);
}

.search-row button:hover,
.primary-action:hover {
  background: var(--red-dark);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.field-note {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.4;
}

.status-message,
.word-docket {
  grid-column: 1 / -1;
}

.status-message {
  margin-top: -1rem;
  padding: 0.8rem 1rem;
  border-left: 0.3rem solid var(--red);
  background: #f6ddd7;
  line-height: 1.45;
}

.word-docket {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 2rem;
  align-items: end;
  padding-top: 2rem;
  border-top: 0.12rem solid var(--ink);
}

.docket-label {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docket-word {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(2.8rem, 8vw, 6rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.docket-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.83rem;
}

.docket-meta a {
  color: inherit;
}

.docket-count {
  min-width: 11rem;
  text-align: right;
}

.docket-count strong {
  display: block;
  font-family: "Courier New", monospace;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
}

.docket-count span {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.docket-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.6rem;
}

.primary-action {
  min-height: 3.25rem;
  background: var(--red);
}

.primary-action[aria-pressed="true"] {
  background: var(--green);
}

.action-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.register {
  margin-top: clamp(4rem, 8vw, 7rem);
}

.register-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 1.3rem;
  border-bottom: 0.2rem solid var(--ink);
}

.register-stats {
  display: flex;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}

.register-stats div {
  text-align: right;
}

.register-stats span,
.register-stats small {
  display: block;
}

.register-stats span {
  font-family: "Courier New", monospace;
  font-size: 1.45rem;
  font-weight: 800;
}

.register-stats small {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(242, 238, 223, 0.86);
}

th,
td {
  padding: 1rem 0.75rem;
  border-bottom: 0.08rem solid rgba(23, 23, 19, 0.48);
  text-align: left;
}

th {
  color: var(--muted);
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td:first-child,
th:first-child {
  width: 5rem;
}

td:nth-child(3),
th:nth-child(3) {
  width: 11rem;
  text-align: right;
}

td:last-child,
th:last-child {
  width: 7rem;
  text-align: right;
}

.rank {
  font-family: "Courier New", monospace;
  font-size: 0.8rem;
}

.word-cell strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 500;
}

.word-cell small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.count-cell {
  font-family: "Courier New", monospace;
  font-size: 1rem;
  font-weight: 700;
}

.open-record {
  padding: 0.55rem 0.7rem;
  border: 0.1rem solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: "Courier New", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.open-record:hover {
  background: var(--ink);
  color: var(--white);
}

.loading-row td,
.empty-row td {
  padding: 2.5rem 0.75rem;
  color: var(--muted);
  text-align: center;
}

.register-note {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 1rem;
  margin-top: 2rem;
  padding: 1rem 0;
  border-top: 0.08rem solid var(--ink);
  border-bottom: 0.08rem solid var(--ink);
  font-size: 0.86rem;
  line-height: 1.5;
}

.register-note strong {
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.register-note p {
  margin: 0;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem clamp(1rem, 4vw, 4rem);
  background: var(--ink);
  color: var(--paper);
  font-family: "Courier New", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

footer a {
  color: inherit;
  text-underline-offset: 0.2rem;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.privacy-page {
  max-width: 52rem;
}

.privacy-sheet {
  padding: clamp(1.5rem, 5vw, 3.5rem);
  border: 0.15rem solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow);
}

.privacy-sheet h1 {
  max-width: none;
  margin-bottom: 0.75rem;
}

.privacy-sheet h2 {
  margin: 2rem 0 0.5rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.privacy-sheet p,
.privacy-sheet li {
  line-height: 1.65;
}

.privacy-sheet ul {
  padding-left: 1.25rem;
}

.privacy-sheet a {
  color: var(--red-dark);
  text-underline-offset: 0.2rem;
}

.contact-form {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.contact-form > label:first-of-type {
  font-family: "Courier New", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contact-form textarea {
  min-height: 14rem;
  resize: vertical;
  border: 0.15rem solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  padding: 0.9rem;
}

.confirmation {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
}

.confirmation input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--red-dark);
}

.contact-form button {
  justify-self: start;
  min-width: 10rem;
  padding: 0.9rem 1.25rem;
  border: 0.15rem solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--white);
  font-family: "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .masthead,
  .register-heading,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .registry-meta {
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
  }

  .registry-meta div {
    min-width: 0;
  }

  main {
    width: min(100% - 1.25rem, 74rem);
    padding-top: 2.5rem;
  }

  .objection-panel {
    grid-template-columns: 1fr;
    gap: 2rem;
    box-shadow: 0.22rem 0.22rem 0 var(--ink);
  }

  h1 {
    font-size: clamp(2.6rem, 14vw, 4.6rem);
  }

  .search-row {
    flex-direction: column;
  }

  .search-row input {
    border-right: 0.15rem solid var(--ink);
    border-bottom: 0;
  }

  .search-row button {
    min-height: 3.2rem;
  }

  .word-docket {
    grid-template-columns: 1fr;
  }

  .docket-count {
    min-width: 0;
    text-align: left;
  }

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

  .register-heading {
    align-items: stretch;
  }

  .register-stats {
    justify-content: space-between;
  }

  .register-stats div {
    text-align: left;
  }

  td:first-child,
  th:first-child {
    width: 3.5rem;
  }

  td:nth-child(3),
  th:nth-child(3) {
    width: 7rem;
  }

  td:last-child,
  th:last-child {
    width: 5rem;
  }

  th,
  td {
    padding: 0.85rem 0.45rem;
  }

  .register-note {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

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