:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4f7;
  --ink: #16212b;
  --muted: #637083;
  --accent: #126c62;
  --accent-dark: #0a4b44;
  --line: #d9e1e8;
  --danger: #9d2f2f;
  --shadow: 0 18px 44px rgba(24, 38, 53, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", sans-serif;
  background: var(--bg);
}

a {
  color: var(--accent-dark);
}

.container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 20px;
}

.brand {
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  gap: 18px;
}

nav a {
  text-decoration: none;
}

.hero,
.detail-hero {
  padding: 42px 0 22px;
}

.detail-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  margin: 0 0 14px;
  max-width: 920px;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
  margin: 0 0 16px;
}

.panel,
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 18px 0;
  padding: 24px;
}

.section-title h2 {
  margin-bottom: 18px;
}

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

label {
  color: var(--muted);
  display: grid;
  font-size: 14px;
  gap: 8px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
  background: #fffdf8;
}

.form-actions {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.button {
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  font: inherit;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  background: var(--accent-dark);
}

.button.secondary {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--ink);
}

.button.secondary:hover {
  background: #dfe9ee;
}

.button.small {
  min-height: 36px;
  padding: 8px 12px;
}

.results-head,
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 12px;
}

.results-head p {
  color: var(--muted);
  margin: -8px 0 0;
}

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

.table-wrap.embedded {
  box-shadow: none;
  margin: 0;
}

table {
  border-collapse: collapse;
  min-width: 980px;
  width: 100%;
}

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

th {
  background: var(--surface-soft);
  font-size: 13px;
}

.results-table td:nth-child(3),
.results-table td:nth-child(4) {
  min-width: 180px;
}

.results-table th.details-column,
.results-table td.details-column {
  min-width: 160px;
  text-align: center;
  white-space: nowrap;
  width: 160px;
}

.results-table td.details-column .button {
  display: inline-flex;
  max-width: none;
  min-width: 104px;
  overflow: visible;
  white-space: nowrap;
}

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

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  margin: 18px 0;
  padding: 28px;
  text-align: center;
}

.empty-state h2 {
  color: var(--ink);
}

.alert {
  background: #fff0ee;
  border: 1px solid #e9b9b3;
  border-radius: 8px;
  color: var(--danger);
  margin: 18px 0;
  padding: 16px 18px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
}

.sign-card img {
  display: block;
  max-height: 360px;
  max-width: 100%;
  width: 100%;
  object-fit: contain;
}

.word-mark {
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: clamp(26px, 5vw, 52px);
  overflow-wrap: anywhere;
  padding: 42px 24px;
  text-align: center;
}

.facts {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) 1fr;
  gap: 12px 18px;
  margin: 0;
}

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

.facts dd {
  margin: 0;
}

.nice-list {
  display: grid;
  gap: 12px;
}

.nice-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.detail-actions {
  display: flex;
  gap: 10px;
}

.pagination {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.pagination.single-page {
  color: var(--muted);
}

.pagination-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.pagination a,
.pagination span {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 36px;
  padding: 8px 11px;
  text-decoration: none;
}

.pagination a:hover,
.pagination .current {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.pagination span:not(.current) {
  color: var(--muted);
}

@media (max-width: 860px) {
  .header-inner,
  .detail-hero,
  .results-head,
  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-actions,
  .form-actions,
  .pagination-links {
    width: 100%;
  }

  .form-actions .button,
  .detail-actions .button {
    flex: 1;
  }

  .pagination-links {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1200px);
  }

  .header-inner {
    gap: 12px;
    padding: 12px 0;
  }

  .brand {
    font-size: 18px;
  }

  nav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .hero,
  .detail-hero {
    padding: 30px 0 14px;
  }

  .panel {
    padding: 18px;
  }

  .search-grid,
  .facts {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .detail-actions {
    flex-direction: column;
  }

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

  .results-table {
    min-width: 0;
  }

  .results-table thead {
    display: none;
  }

  .results-table,
  .results-table tbody,
  .results-table tr,
  .results-table td {
    display: block;
    width: 100%;
  }

  .results-table tr {
    border-bottom: 8px solid var(--bg);
    padding: 12px 0;
  }

  .results-table td {
    border-bottom: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(112px, 42%) 1fr;
    padding: 8px 14px;
  }

  .results-table td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 13px;
    font-weight: 700;
  }

  .results-table td.details-column {
    display: block;
    min-width: 0;
    text-align: left;
    white-space: normal;
    width: 100%;
  }

  .results-table td.details-column .button {
    display: flex;
    min-width: 0;
    white-space: nowrap;
    width: 100%;
  }

  table {
    min-width: 720px;
  }

  .sign-card img {
    max-height: 280px;
  }
}

@media print {
  .site-header,
  .print-button {
    display: none;
  }

  body {
    background: white;
  }
}

/* Results details button sizing */
.results-table th.details-column,
.results-table td.details-column {
  min-width: 160px !important;
  white-space: nowrap !important;
  overflow: visible !important;
  width: 160px !important;
}

.results-table td.details-column .button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
  min-width: 104px !important;
  max-width: none !important;
  overflow: visible !important;
}

@media (max-width: 768px) {
  table.results-table {
    min-width: 0 !important;
    width: 100% !important;
  }

  .results-table td.details-column {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    text-align: left !important;
  }

  .results-table td.details-column .button {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    white-space: nowrap !important;
  }
}

/* Disabled nav link */
.nav-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  user-select: none;
}
