/* BhuBharati Explorer — visual system */

:root {
  --ink: #12241f;
  --ink-soft: #3f5650;
  --ink-faint: #6d827c;
  --paper: #f7f5ee;
  --paper-raised: #ffffff;
  --line: #e2ddcd;
  --line-soft: #ece8d9;

  --brand: #123c35;
  --brand-dark: #0b2a25;
  --brand-light: #1c5148;
  --brand-tint: #e7f0ed;

  --accent: #f6c874;
  --accent-dark: #d98d27;
  --accent-tint: #f8ecda;

  --danger: #b3452f;
  --danger-tint: #fbe9e4;

  --content-width: min(96vw, 1760px);
  --radius-lg: 12px;
  --radius-md: 9px;
  --radius-sm: 7px;
  --shadow-card:
    0 1px 2px rgba(18, 36, 31, 0.06), 0 12px 32px -16px rgba(18, 36, 31, 0.18);
  --shadow-pop: 0 20px 60px -20px rgba(11, 42, 37, 0.45);

  --font-display: "Fraunces", "Iowan Old Style", serif;
  --font-body:
    "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--brand-dark);
  margin: 0;
  line-height: 1.15;
}

p {
  margin: 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--brand);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

/* ── Header ───────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 245, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--brand-dark);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #f7f5ee;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.brand small {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-faint);
  font-weight: 500;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.header-nav a {
  text-decoration: none;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
}

.header-nav a:hover {
  background: var(--brand-tint);
  color: var(--brand-dark);
}

.nav-button {
  background: none;
  border: none;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
}

.nav-button:hover {
  background: var(--brand-tint);
  color: var(--brand-dark);
}

.api-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin-left: 0.35rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.api-status[data-status="online"] .status-dot {
  background: #2f8f5b;
}

.api-status[data-status="online"] {
  color: #2f8f5b;
  border-color: #cfe8da;
}

.api-status[data-status="offline"] .status-dot {
  background: var(--danger);
}

.api-status[data-status="offline"] {
  color: var(--danger);
  border-color: #edcfc6;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #f2efe4;
}

.hero-grid {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-copy .eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cddad4;
  margin-bottom: 0.9rem;
}

.hero-copy .eyebrow span {
  width: 22px;
  height: 1px;
  background: #cddad4;
}

.hero-copy h1 {
  color: #faf8f0;
  font-size: clamp(2.1rem, 3.6vw, 3.7rem);
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-copy h1 em {
  font-style: italic;
  color: var(--accent);
}

.hero-lead {
  font-size: 1rem;
  color: #d9e2dd;
  max-width: 46ch;
  margin-bottom: 1.6rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
}

.hero-note {
  background: rgba(247, 245, 238, 0.08);
  border: 1px solid rgba(247, 245, 238, 0.16);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
}

.hero-note .note-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #b9c7c1;
  margin-bottom: 0.9rem;
}

.hero-note ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.hero-note li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(247, 245, 238, 0.14);
}

.hero-note li:first-child {
  padding-top: 0;
}

.hero-note li:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.hero-note li span {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--accent);
}

.hero-note li strong {
  display: block;
  font-size: 1.15rem;
  color: #faf8f0;
}

.hero-note li small {
  display: block;
  font-size: 0.78rem;
  color: #b9c7c1;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

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

.button-primary {
  background: var(--accent);
  color: var(--brand-dark);
}

.button-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -12px rgba(217, 141, 39, 0.6);
}

.button-primary:disabled {
  background: #d8d2bf;
  color: #8b8571;
  cursor: not-allowed;
}

.button-danger {
  background: var(--danger-tint);
  color: var(--danger);
  border-color: #edcfc6;
}

.button-danger:hover {
  background: #f6ddd4;
}

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

.button-outline:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.button-dark {
  background: var(--brand-dark);
  color: #f7f5ee;
}

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

/* ── Trust strip ──────────────────────────────────────────────────────── */

.trust-strip {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.4rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.trust-strip div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-left: 1.5rem;
  border-left: 1px solid var(--line);
}

.trust-strip div:first-child {
  padding-left: 0;
  border-left: none;
}

.trust-strip strong {
  font-size: 0.85rem;
  color: var(--brand-dark);
}

.trust-strip span {
  font-size: 0.78rem;
  color: var(--ink-faint);
}

/* ── Workspace / explorer panel ───────────────────────────────────────── */

.workspace {
  max-width: var(--content-width);
  margin: 0 auto;
  padding-top: 1.6rem;
}

.explorer-panel {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.8rem;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.panel-heading h2 {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
}

.panel-heading p:not(.section-label) {
  font-size: 0.85rem;
  color: var(--ink-faint);
  max-width: 48ch;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.icon-button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Stepper ──────────────────────────────────────────────────────────── */

.stepper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.6rem;
  overflow-x: auto;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.step span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--line-soft);
  color: var(--ink-faint);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.step small {
  font-size: 0.82rem;
  color: var(--ink-faint);
  font-weight: 600;
}

.step.is-complete span {
  background: var(--accent-dark);
  color: #fff8ec;
}

.step.is-active span {
  background: var(--brand);
  color: #f7f5ee;
}

.step.is-active small,
.step.is-complete small {
  color: var(--brand-dark);
}

.stepper i {
  flex: 1;
  min-width: 20px;
  height: 2px;
  background: var(--line);
  font-style: normal;
  transition: background 0.15s ease;
}

.step.is-complete + i {
  background: var(--accent-dark);
}

/* ── Location form ────────────────────────────────────────────────────── */

.location-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.location-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.location-form span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  font-weight: 700;
}

.location-form select {
  appearance: none;
  background: var(--paper)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233f5650' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 0.85rem center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.65rem 2.2rem 0.65rem 0.85rem;
  font-size: 0.88rem;
  color: var(--ink);
  min-width: 0;
  transition:
    border-color 0.15s ease,
    background-color 0.4s ease;
}

.location-form select:disabled {
  color: var(--ink-faint);
  cursor: not-allowed;
}

.location-form select.is-loading {
  color: transparent;
  background-image: none;
  background-color: var(--line-soft);
  background-size: 200% 100%;
  background-image: linear-gradient(
    90deg,
    var(--line-soft) 0%,
    #f8f6ec 50%,
    var(--line-soft) 100%
  );
  animation: select-shimmer 1.3s ease-in-out infinite;
}

.location-form select.is-error {
  border-color: #e3b6a6;
  color: var(--danger);
  background-color: var(--danger-tint);
}

@keyframes select-shimmer {
  0% {
    background-position: 160% 0;
  }
  100% {
    background-position: -60% 0;
  }
}

.location-form select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.location-form small {
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.form-action {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

#fetch-hint {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

/* ── Progress card ────────────────────────────────────────────────────── */

.progress-card {
  animation: panel-in 0.35s ease both;
  margin-top: 1.4rem;
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-md);
  background: var(--brand-tint);
  scroll-margin-top: 5.5rem;
  border: 1px solid #cfe0da;
}

.progress-card.is-error {
  background: var(--danger-tint);
  border-color: #edcfc6;
}

.progress-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}

.progress-heading > div {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.progress-heading strong {
  font-size: 0.88rem;
  color: var(--brand-dark);
}

.progress-card.is-error .progress-heading strong {
  color: var(--danger);
}

.progress-heading b {
  font-size: 0.88rem;
  color: var(--brand-dark);
}

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #cfe0da;
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.progress-card.is-complete .spinner,
.progress-card.is-error .spinner {
  animation: none;
  border-color: transparent;
}

.progress-card.is-complete .spinner {
  background: var(--brand);
  mask: none;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: #d8e6e0;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-track span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-card.is-error .progress-track span {
  background: var(--danger);
}

.progress-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.progress-metrics b {
  color: var(--brand-dark);
}

/* ── Welcome state ────────────────────────────────────────────────────── */

.welcome-state {
  animation: panel-in 0.3s ease both;
  margin-top: 1.6rem;
  padding: 2.4rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 22rem;
}

@media (min-width: 860px) {
  .welcome-state {
    min-height: 65vh;
  }
}

.contour-art {
  width: 180px;
  margin: 0 auto 1rem;
  opacity: 0.55;
}

.contour-art svg {
  width: 100%;
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.4;
}

.contour-art circle {
  fill: var(--accent-dark);
  stroke: none;
}

.welcome-state h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.welcome-state p {
  font-size: 0.85rem;
  color: var(--ink-faint);
  max-width: 40ch;
  margin: 0 auto;
}

/* ── Results ──────────────────────────────────────────────────────────── */

.results {
  animation: panel-in 0.4s ease both;
  margin-top: 1.8rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

.results-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.results-heading h3 {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

#results-breadcrumb {
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.export-menu {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.9rem;
  margin-bottom: 1.3rem;
}

.stats-grid article {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stats-grid span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  font-weight: 700;
}

.stats-grid strong {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--brand-dark);
}

.stats-grid small {
  font-size: 0.75rem;
  color: var(--ink-faint);
}

/* ── Toolbar ──────────────────────────────────────────────────────────── */

.results-toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.7rem;
  margin-bottom: 0.4rem;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field svg {
  position: absolute;
  left: 0.8rem;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 2;
  pointer-events: none;
}

.search-field input {
  width: 100%;
  padding: 0.6rem 0.85rem 0.6rem 2.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper-raised);
}

.search-field input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.compact-field select {
  appearance: none;
  background: var(--paper-raised)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%233f5650' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    no-repeat right 0.7rem center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem 2rem 0.6rem 0.85rem;
  font-size: 0.85rem;
  color: var(--ink);
}

.search-help {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin-bottom: 1rem;
}

/* ── Table ────────────────────────────────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  min-height: 80rem;
}
@media (max-width: 768px) {
  .table-wrap {
    border: none;
    border-radius: 0;
  }
  .explorer-panel {
    padding: 1.2rem;
  }
  .compact-field select {
    width: 100%;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 760px;
}

thead th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  background: var(--paper);
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
}

tbody td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--ink-soft);
}

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

tbody tr:hover {
  background: var(--brand-tint);
}

.mono {
  font-variant-numeric: tabular-nums;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.8rem;
}

.owner-cell strong {
  display: block;
  font-size: 0.85rem;
  color: var(--ink);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-cell small {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-faint);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--brand-tint);
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-text {
  font-size: 0.78rem;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 220px;
}

.record-action {
  text-align: right;
}

.view-record {
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-dark);
}

.view-record:hover {
  border-color: var(--brand);
  background: var(--brand-tint);
}

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

.no-results {
  padding: 2rem;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.88rem;
}

/* ── Pagination ───────────────────────────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--ink-faint);
}

.pagination > div {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.page-button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper-raised);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
}

.page-button:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.page-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Utility ──────────────────────────────────────────────────────────── */

.is-hidden {
  display: none !important;
}

/* ── Footer ───────────────────────────────────────────────────────────── */

/* ── SEO / About & FAQ ────────────────────────────────────────────────── */

.seo-content {
  margin-top: 15px;
  margin-bottom: 15px;
  border-top: 1px solid var(--line);
  background: var(--paper-raised);
}

.seo-inner {
  max-width: 1700px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3.5rem;
}

.seo-inner h2 {
  font-size: 1.4rem;
  margin-bottom: 0.6rem;
}

.seo-inner > p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.faq-list {
  margin-top: 2.5rem;
  display: grid;
  gap: 0.75rem;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  background: var(--paper);
}

.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand-dark);
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  float: right;
  color: var(--ink-faint);
}

.faq-list details[open] summary::after {
  content: "\2212";
}

.faq-list details p {
  margin-top: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

footer {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  border-top: 1px solid var(--line);
}

footer strong {
  display: block;
  font-family: var(--font-display);
  color: var(--brand-dark);
  margin-bottom: 0.3rem;
}

footer p {
  font-size: 0.8rem;
  color: var(--ink-faint);
  max-width: 44ch;
}

footer > div:last-child {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

footer a,
footer button {
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--line);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}

footer a:hover,
footer button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

/* ── Dialogs ──────────────────────────────────────────────────────────── */

dialog.modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  width: min(640px, 92vw);
  max-height: 82vh;
  overflow-y: auto;
  box-shadow: var(--shadow-pop);
  color: var(--ink);
}

dialog.modal::backdrop {
  background: rgba(11, 42, 37, 0.55);
  backdrop-filter: blur(2px);
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.modal-heading h2 {
  font-size: 1.15rem;
}

.close-button {
  background: var(--paper);
  border: 1px solid var(--line);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
  color: var(--ink-soft);
  flex-shrink: 0;
}

.close-button:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.record-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.2rem;
}

.record-detail-grid div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.record-detail-grid div:last-child {
  border-bottom: none;
}

@media (min-width: 640px) {
  .record-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .record-detail-grid div {
    border-right: 1px solid var(--line-soft);
  }

  .record-detail-grid div:nth-child(2n) {
    border-right: none;
  }

  .record-detail-grid div:nth-last-child(-n + 2) {
    border-bottom: none;
  }
}

.record-detail-grid dt {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  font-weight: 700;
}

.record-detail-grid dd {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink);
}

.modal-note {
  font-size: 0.78rem;
  color: var(--ink-faint);
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft);
}

.info-modal h3 {
  font-size: 0.95rem;
  margin: 1rem 0 0.4rem;
  color: var(--brand-dark);
}

.info-modal p {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.info-modal code {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-size: 0.8rem;
}

.info-modal pre {
  background: var(--brand-dark);
  color: #dcece6;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  overflow-x: auto;
}

.modal-subnote {
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-bottom: 1rem;
}

.landholder-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 50vh;
  overflow-y: auto;
}

.landholder-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}

.landholder-list li.is-top {
  border-color: var(--accent-dark);
  background: var(--accent-tint);
}

.landholder-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.landholder-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.landholder-name strong {
  font-size: 0.85rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.landholder-name small {
  font-size: 0.75rem;
  color: var(--ink-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.landholder-extent {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.landholder-extent strong {
  font-size: 0.85rem;
  color: var(--brand-dark);
  white-space: nowrap;
}

.landholder-extent small {
  font-size: 0.72rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.landholder-empty {
  text-align: center;
  padding: 1.5rem;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

/* ── Toast ────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  transform: translateY(12px);
  background: var(--brand-dark);
  color: #f2efe4;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-pop);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  z-index: 80;
  max-width: min(90vw, 460px);
}

.toast span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7fd6ab;
  flex-shrink: 0;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .location-form {
    grid-template-columns: 1fr;
  }

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

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

  .stats-grid span {
    font-size: 0.66rem;
    letter-spacing: 0.02em;
  }

  .results-toolbar {
    grid-template-columns: 1fr;
  }

  .record-detail-grid {
    grid-template-columns: 1fr;
  }

  .header-nav a,
  .header-nav .nav-button {
    display: none;
  }

  .header-nav .api-status {
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  .table-wrap {
    min-height: 0;
  }

  table,
  thead,
  tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0.85rem;
    background: var(--paper-raised);
  }

  tbody td {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
  }
  tbody td:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-faint);
    font-weight: 700;
  }

  .owner-cell,
  td[data-label="Land status"],
  .record-action {
    grid-column: 1 / -1;
  }

  .owner-cell strong,
  .owner-cell small {
    max-width: 100%;
  }

  .record-action {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-bottom: none;
  }

  .view-record {
    display: inline-flex;
    flex-direction: row;
    width: auto;
    height: auto;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.75rem;
    gap: 0.3rem;
  }

  .view-record .view-label {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
  }
}

/* ── Documentation / policy pages ────────────────────────────────────── */

.doc-hero {
  border-bottom: 1px solid var(--line);
  background: var(--brand-tint);
}

.doc-hero-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3.2rem 1.5rem 2.4rem;
}

.doc-hero .section-label {
  color: var(--brand-dark);
}

.doc-hero h1 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin: 0.3rem 0 0.7rem;
}

.doc-hero p {
  color: var(--ink-soft);
  max-width: 62ch;
  font-size: 1rem;
}

.doc-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
}

.doc-shell {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2.8rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.doc-toc {
  position: sticky;
  top: 1.5rem;
  display: grid;
  gap: 0.15rem;
  font-size: 0.85rem;
}

.doc-toc p {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}

.doc-toc a {
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.35rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.7rem;
}

.doc-toc a:hover {
  color: var(--brand-dark);
  border-left-color: var(--accent-dark);
}

.doc-content {
  min-width: 0;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.65;
}

.doc-content section {
  margin-bottom: 2.4rem;
  scroll-margin-top: 1.5rem;
}

.doc-content h2 {
  font-size: 1.25rem;
  margin-bottom: 0.7rem;
}

.doc-content h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  margin: 1.3rem 0 0.5rem;
}

.doc-content p {
  color: var(--ink-soft);
  margin-bottom: 0.85rem;
}

.doc-content ul,
.doc-content ol {
  color: var(--ink-soft);
  margin: 0 0 0.9rem;
  padding-left: 1.3rem;
  display: grid;
  gap: 0.4rem;
}

.doc-content li strong {
  color: var(--ink);
}

.doc-content a {
  color: var(--brand-dark);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.doc-content a:hover {
  text-decoration-color: var(--brand-dark);
}

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1.2rem;
  font-size: 0.9rem;
}

.doc-content th,
.doc-content td {
  text-align: left;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  vertical-align: top;
}

.doc-content th {
  background: var(--paper-raised);
  color: var(--brand-dark);
  font-weight: 700;
}

.doc-content td {
  color: var(--ink-soft);
}

.doc-callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-dark);
  background: var(--paper-raised);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  margin: 0 0 1.2rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.doc-callout strong {
  color: var(--ink);
}

.doc-cross-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.doc-cross-links a {
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}

.doc-cross-links a:hover {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.footer-legal {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.5rem 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
}

.footer-legal a {
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--ink-faint);
}

.footer-legal a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

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

  .doc-toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1rem;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1rem;
  }

  .doc-toc a {
    border-left: none;
    padding-left: 0;
  }
}
