:root {
  --bg: #d9dfd2;
  --bg-soft: #eef2e9;
  --panel: rgba(250, 247, 239, 0.88);
  --panel-strong: rgba(255, 252, 246, 0.97);
  --line: rgba(34, 55, 41, 0.13);
  --line-strong: rgba(19, 40, 28, 0.24);
  --text: #1b2a22;
  --muted: #5c685f;
  --forest: #1f4f3d;
  --forest-strong: #102d22;
  --forest-soft: #708d69;
  --moss: #90a765;
  --soil: #8f613a;
  --accent: #c98b41;
  --sand: #efe3cd;
  --danger: #b8534d;
  --shadow: 0 26px 70px rgba(16, 31, 23, 0.16);
  --shadow-soft: 0 18px 40px rgba(16, 31, 23, 0.1);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font-body: "DM Sans", sans-serif;
  --font-heading: "Space Grotesk", sans-serif;
  --page-header-height: 0px;
  --viewport-gap: 18px;
  --stack-gap: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(circle at 0% 0%, rgba(144, 167, 101, 0.22), transparent 26%),
    radial-gradient(circle at 100% 0%, rgba(201, 139, 65, 0.18), transparent 24%),
    linear-gradient(135deg, #eef3e6 0%, #dde4d5 48%, #cbd3c5 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    radial-gradient(circle at 12% 12%, rgba(16, 45, 34, 0.08), transparent 0 22%),
    radial-gradient(circle at 88% 18%, rgba(143, 97, 58, 0.08), transparent 0 18%),
    radial-gradient(circle at 82% 78%, rgba(144, 167, 101, 0.12), transparent 0 20%);
}

body::after {
  opacity: 0.28;
  background:
    linear-gradient(115deg, transparent 0 46%, rgba(255, 255, 255, 0.55) 46% 47%, transparent 47% 100%),
    repeating-radial-gradient(circle at 18% 26%, rgba(31, 79, 61, 0.08) 0 1px, transparent 1px 15px),
    repeating-radial-gradient(circle at 72% 68%, rgba(31, 79, 61, 0.06) 0 1px, transparent 1px 19px);
}

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

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  width: min(1720px, 100vw);
  height: 100dvh;
  margin: 0 auto;
  padding: 18px;
  position: relative;
  z-index: 1;
}

.menu-overlay {
  display: none;
}

.menu-overlay.is-visible {
  display: block;
}

.sidebar-desktop {
  position: relative;
  min-height: 0;
  z-index: 30;
}

.sidebar-panel,
.glass-panel,
.shell-main {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar-panel {
  height: 100%;
  padding: 18px 22px 24px;
  display: grid;
  gap: 18px;
  align-content: start;
  overflow: auto;
  position: relative;
  border-radius: var(--radius-xl);
  color: rgba(247, 243, 234, 0.92);
  background:
    linear-gradient(180deg, rgba(18, 43, 33, 0.98), rgba(31, 79, 61, 0.98)),
    linear-gradient(135deg, rgba(201, 139, 65, 0.08), transparent 42%);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 28px 70px rgba(8, 22, 16, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.sidebar-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.22;
  background:
    repeating-radial-gradient(circle at 20% 16%, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 18px),
    linear-gradient(150deg, transparent 0 64%, rgba(201, 139, 65, 0.18) 64% 66%, transparent 66% 100%);
}

.sidebar-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  margin: 0 auto;
  padding: 10px 14px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(231, 221, 205, 0.92));
  box-shadow:
    0 16px 30px rgba(5, 15, 11, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 160ms ease, box-shadow 160ms ease;
  text-decoration: none;
  color: var(--forest);
}

.sidebar-logo:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(39, 31, 23, 0.08);
}

.sidebar-logo img {
  display: block;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
}

.sidebar-brand-text {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-align: center;
}

.sidebar-logo:focus-visible,
.sidebar-close:focus-visible,
.modal-close:focus-visible,
.sidebar-link:focus-visible,
.report-nav-link:focus-visible,
.btn-brand:focus-visible,
.btn-soft:focus-visible,
.btn-accent:focus-visible,
.mobile-menu-fab:focus-visible {
  outline: 2px solid rgba(33, 79, 67, 0.42);
  outline-offset: 2px;
}

.sidebar-close {
  position: absolute;
  top: -4px;
  right: -2px;
  width: 38px;
  height: 38px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 247, 235, 0.92);
  font-size: 1.35rem;
  cursor: pointer;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: var(--soil);
}

.sidebar-header h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(2.1rem, 2.7vw, 3rem);
  line-height: 1.06;
}

.hero-text {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.hero-badge {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(201, 139, 65, 0.96), rgba(132, 97, 50, 0.96));
  color: #faf7f1;
}

.badge-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0.84;
}

.sidebar-menu-wrap {
  display: grid;
  gap: 10px;
  align-content: start;
}

.language-switcher {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04)),
    linear-gradient(135deg, rgba(234, 194, 132, 0.08), transparent 70%);
}

.language-switcher-label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(240, 224, 187, 0.9);
}

.language-switcher-select {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(9, 24, 18, 0.52);
  color: #f5efe3;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.language-switcher-select:focus-visible {
  outline: 2px solid rgba(229, 198, 133, 0.45);
  outline-offset: 2px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 14px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(242, 237, 227, 0.72);
  text-align: center;
  display: grid;
  gap: 8px;
}

.sidebar-footer p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.sidebar-footer span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(234, 194, 132, 0.96);
  letter-spacing: 0.04em;
}

.menu-section-label {
  display: block;
  width: 100%;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(234, 194, 132, 0.92);
  text-align: center;
}

.sidebar-menu,
.report-nav {
  display: grid;
  gap: 10px;
}

.sidebar-link,
.report-nav-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 14px 16px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.sidebar-link::before,
.report-nav-link::before,
.report-menu-toggle::before,
.section-head-icon::before,
.validation-launcher-icon .validation-launcher-copy::before,
.info-card h3::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(33, 79, 67, 0.12);
  background: rgba(33, 79, 67, 0.08);
  color: var(--forest);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.sidebar-link {
  border-color: rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    rgba(10, 26, 20, 0.28);
  color: rgba(248, 242, 232, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 24px rgba(3, 10, 7, 0.12);
}

.report-nav-link,
.report-menu-toggle {
  border-color: rgba(30, 56, 42, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(241, 233, 219, 0.9));
  color: var(--forest-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 10px 24px rgba(18, 31, 24, 0.06);
}

.sidebar-link::before {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(234, 194, 132, 0.98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.report-nav-link::before,
.report-menu-toggle::before,
.section-head-icon::before,
.validation-launcher-icon .validation-launcher-copy::before,
.info-card h3::before {
  border-color: rgba(31, 79, 61, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(232, 223, 208, 0.92));
  color: var(--forest);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 6px 16px rgba(16, 31, 23, 0.06);
}

.sidebar-link[data-view-button="overview"]::before {
  content: "◫";
}

.sidebar-link[data-view-button="data"]::before {
  content: "⇪";
}

.sidebar-link[data-view-button="map"]::before {
  content: "⌖";
}

.sidebar-link[data-view-button="reports"]::before {
  content: "▤";
}

.report-nav-link[data-report-view-button="roads"]::before,
.report-menu-toggle[data-report-view-icon="roads"]::before {
  content: "━";
}

.report-nav-link[data-report-view-button="compartments"]::before,
.report-menu-toggle[data-report-view-icon="compartments"]::before {
  content: "▧";
}

.report-nav-link[data-report-view-button="stands"]::before,
.report-menu-toggle[data-report-view-icon="stands"]::before {
  content: "✳";
}

.report-nav-link[data-report-view-button="chiefdom"]::before,
.report-menu-toggle[data-report-view-icon="chiefdom"]::before {
  content: "⬡";
}

.report-nav-link[data-report-view-button="notes"]::before,
.report-menu-toggle[data-report-view-icon="notes"]::before {
  content: "≣";
}

.sidebar-link:hover,
.report-nav-link:hover,
.btn-brand:hover,
.btn-soft:hover,
.btn-accent:hover,
.mobile-menu-fab:hover,
.sidebar-close:hover {
  transform: translateY(-1px);
}

.sidebar-link:hover {
  border-color: rgba(234, 194, 132, 0.28);
  background:
    linear-gradient(135deg, rgba(234, 194, 132, 0.1), rgba(255, 255, 255, 0.04)),
    rgba(10, 26, 20, 0.34);
  color: #fffaf0;
  box-shadow: 0 16px 28px rgba(3, 10, 7, 0.18);
}

.report-nav-link:hover,
.report-menu-toggle:hover {
  border-color: rgba(31, 79, 61, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 1), rgba(237, 229, 215, 0.96));
  box-shadow: 0 14px 28px rgba(18, 31, 24, 0.08);
}

.sidebar-link.active,
.sidebar-link.is-active,
.report-nav-link.is-active {
  color: #f9f6ef;
}

.sidebar-link.active,
.sidebar-link.is-active {
  border-color: rgba(234, 194, 132, 0.4);
  background:
    linear-gradient(135deg, rgba(234, 194, 132, 0.18), rgba(255, 255, 255, 0.06)),
    linear-gradient(180deg, rgba(26, 64, 48, 1), rgba(16, 45, 34, 0.98));
  box-shadow:
    0 18px 34px rgba(8, 22, 16, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.report-nav-link.is-active {
  border-color: rgba(31, 79, 61, 0.2);
  background:
    linear-gradient(135deg, rgba(31, 79, 61, 0.96), rgba(16, 45, 34, 0.98)),
    linear-gradient(135deg, rgba(234, 194, 132, 0.12), transparent);
  box-shadow: 0 18px 34px rgba(18, 31, 24, 0.12);
}

.sidebar-link.active::before,
.sidebar-link.is-active::before,
.report-nav-link.is-active::before {
  background: rgba(255, 255, 255, 0.14);
  color: #f9f6ef;
}

.sidebar-link-copy,
.report-nav-copy {
  display: grid;
  gap: 2px;
}

.sidebar-link-copy strong,
.report-nav-copy strong {
  font-size: 1rem;
}

.sidebar-link-copy small,
.report-nav-copy small {
  font-size: 0.84rem;
  opacity: 0.78;
}

.sidebar-note {
  margin-top: auto;
  padding: 16px 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(215, 154, 89, 0.26);
  background: rgba(215, 154, 89, 0.1);
}

.sidebar-note strong {
  display: block;
  margin-bottom: 6px;
}

.sidebar-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.56;
}

.shell-main {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 24px;
  overflow: auto;
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(240, 232, 219, 0.94)),
    radial-gradient(circle at top right, rgba(201, 139, 65, 0.14), transparent 28%);
  border-color: rgba(31, 79, 61, 0.12);
  box-shadow:
    0 34px 80px rgba(12, 25, 19, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.shell-main::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.48;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.42), transparent 32%),
    repeating-linear-gradient(
      -12deg,
      transparent 0 40px,
      rgba(31, 79, 61, 0.035) 40px 42px,
      transparent 42px 88px
    );
}

.menu-icon {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.menu-icon i {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.section-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.shell-content {
  display: grid;
  gap: 18px;
  min-width: 0;
  min-height: 100%;
  align-content: start;
}

.content-stage {
  min-height: 100%;
  padding: 0;
  display: grid;
  align-content: start;
  gap: 22px;
}

.mobile-menu-fab {
  display: none;
  align-items: center;
  gap: 0;
  justify-self: start;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0;
  background:
    linear-gradient(135deg, rgba(16, 45, 34, 0.98), rgba(31, 79, 61, 0.98));
  color: rgba(248, 242, 232, 0.96);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(8, 22, 16, 0.24);
}

.workspace-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.8fr);
  gap: 24px;
  align-items: end;
  padding: 26px 28px;
  position: relative;
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(135deg, rgba(16, 45, 34, 0.98), rgba(31, 79, 61, 0.96) 58%, rgba(72, 105, 69, 0.96)),
    linear-gradient(180deg, rgba(234, 194, 132, 0.12), transparent 46%);
  color: #f8f3eb;
  box-shadow:
    0 28px 60px rgba(8, 22, 16, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.workspace-hero::before,
.workspace-hero::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.workspace-hero::before {
  inset: auto -40px -70px auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234, 194, 132, 0.28), transparent 62%);
  opacity: 0.85;
}

.workspace-hero::after {
  inset: 0;
  opacity: 0.16;
  background:
    linear-gradient(132deg, transparent 0 58%, rgba(234, 194, 132, 0.95) 58% 59%, transparent 59% 100%),
    repeating-linear-gradient(
      -18deg,
      transparent 0 34px,
      rgba(255, 255, 255, 0.18) 34px 35px,
      transparent 35px 78px
    );
}

.workspace-hero[hidden] {
  display: none !important;
}

.workspace-hero-copy {
  display: grid;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.workspace-hero-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(2.15rem, 3vw, 3.3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--forest-strong);
  text-shadow: 0 8px 20px rgba(255, 255, 255, 0.18);
}

.workspace-hero-text {
  margin: 0;
  max-width: 70ch;
  color: rgba(245, 239, 229, 0.84);
  line-height: 1.72;
}

.workspace-hero-side {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  position: relative;
  z-index: 1;
}

.status-summary-shell {
  display: grid;
  gap: 18px;
}

.status-banner {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(31, 79, 61, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(242, 233, 220, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 12px 26px rgba(18, 31, 24, 0.05);
}

.status-banner strong {
  display: block;
  margin-bottom: 6px;
}

.status-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.status-neutral {
  background: linear-gradient(180deg, rgba(247, 243, 235, 0.96), rgba(234, 227, 214, 0.88));
}

.status-ready {
  background: linear-gradient(180deg, rgba(235, 245, 238, 0.98), rgba(219, 234, 224, 0.92));
  border-color: rgba(33, 79, 67, 0.2);
}

.status-warning {
  background: linear-gradient(180deg, rgba(250, 240, 221, 0.98), rgba(243, 224, 191, 0.9));
  border-color: rgba(201, 139, 65, 0.28);
}

.status-error {
  background: linear-gradient(180deg, rgba(248, 232, 229, 0.98), rgba(241, 214, 210, 0.92));
  border-color: rgba(184, 83, 77, 0.24);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.reports-summary-shell {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.metric-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 15px 16px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(240, 232, 218, 0.92));
  border: 1px solid rgba(31, 79, 61, 0.12);
  box-shadow:
    0 18px 36px rgba(18, 31, 24, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--forest), var(--moss), var(--accent));
}

.metric-card.accent {
  background:
    linear-gradient(180deg, rgba(255, 247, 234, 0.98), rgba(240, 229, 208, 0.94)),
    radial-gradient(circle at top right, rgba(201, 139, 65, 0.18), transparent 34%);
}

.metric-label {
  display: block;
  font-weight: 800;
  font-size: clamp(0.8rem, 0.7vw, 0.92rem);
  line-height: 1.14;
  min-height: auto;
  white-space: nowrap;
  color: rgba(27, 42, 34, 0.78);
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.45rem, 1.55vw, 1.95rem);
  line-height: 1.12;
  color: var(--forest-strong);
  letter-spacing: -0.02em;
}

.metric-support {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.42;
  font-size: 0.84rem;
}

@media (min-width: 1500px) {
  .summary-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) and (max-width: 1499px) {
  .summary-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) and (max-width: 1279px) {
  .summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 700px) and (max-width: 1099px) {
  .summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

.view-panel[data-view-panel="data"].is-active {
  display: grid;
  gap: 22px;
}

.overview-grid,
.data-grid,
.reports-layout {
  display: grid;
  gap: 22px;
}

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

.data-grid {
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  align-items: start;
}

.reports-layout {
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
}

.data-side,
.report-stage {
  display: grid;
  gap: 22px;
}

.report-menu {
  position: sticky;
  top: 0;
  align-self: start;
  background:
    linear-gradient(180deg, rgba(245, 238, 226, 0.96), rgba(234, 224, 208, 0.9));
}

.report-menu-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(33, 79, 67, 0.14);
  border-radius: 18px;
  background: rgba(33, 79, 67, 0.07);
  color: var(--forest);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.report-menu-toggle:hover {
  transform: translateY(-1px);
}

.report-menu-toggle::before {
  margin-right: 2px;
}

.report-menu-toggle-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.report-menu-toggle-copy strong {
  font-size: 1rem;
}

.report-menu-toggle-copy small {
  font-size: 0.84rem;
  opacity: 0.78;
}

.report-menu-toggle-icon {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
  transition: transform 160ms ease;
}

.report-menu.is-open .report-menu-toggle-icon {
  transform: rotate(180deg);
}

.glass-panel {
  padding: 22px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.95), rgba(241, 233, 220, 0.9));
  border-color: rgba(31, 79, 61, 0.1);
  box-shadow:
    0 22px 50px rgba(15, 28, 22, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.46), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(201, 139, 65, 0.1), transparent 28%);
}

.control-panel {
  display: grid;
  gap: 22px;
}

.validation-launcher {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(31, 79, 61, 0.12);
  background:
    linear-gradient(180deg, rgba(247, 243, 235, 0.96), rgba(236, 228, 214, 0.9));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 28px rgba(18, 31, 24, 0.05);
}

.validation-launcher-copy {
  display: grid;
  gap: 4px;
}

.validation-launcher .section-title {
  font-size: 1.04rem;
}

.validation-launcher .btn-soft {
  flex: 0 0 auto;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.section-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--forest-strong);
  letter-spacing: -0.02em;
}

.section-title-context {
  display: inline;
  margin-left: 0.18em;
  font-size: 0.92em;
  font-weight: 500;
  color: var(--forest-soft);
}

.section-head-icon {
  align-items: flex-start;
  gap: 12px;
}

.section-head-icon.icon-upload::before {
  content: "⇪";
}

.section-head-icon.icon-standard::before {
  content: "▣";
}

.validation-launcher-icon .validation-launcher-copy {
  position: relative;
  padding-left: 48px;
}

.validation-launcher-icon .validation-launcher-copy::before {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.buffer-step-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--soil);
  font-size: 0.76rem;
  line-height: 1;
}

.buffer-step-labels span {
  flex: 1 1 0;
  text-align: center;
}

.info-card h3 {
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-card-projection h3::before {
  content: "⌘";
}

.info-card-structure h3::before {
  content: "▥";
}

.info-card-validation h3::before {
  content: "✓";
}

.overview-copy {
  display: grid;
  gap: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.range-label,
.field-list label span {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  margin-top: 12px;
  accent-color: var(--forest);
}

.hint,
.section-head p,
.info-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.field-list {
  display: grid;
  gap: 14px;
}

.field-list label {
  display: grid;
  gap: 8px;
}

input[type="file"] {
  width: 100%;
  padding: 14px 15px;
  border: 1px dashed rgba(31, 79, 61, 0.38);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255, 251, 245, 0.96), rgba(238, 230, 216, 0.88));
  color: var(--forest-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.button-stack {
  display: grid;
  gap: 10px;
}

.btn-brand,
.btn-soft,
.btn-accent {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.btn-brand {
  background:
    linear-gradient(135deg, rgba(16, 45, 34, 1), rgba(31, 79, 61, 0.98));
  color: #faf7f1;
  box-shadow: 0 16px 32px rgba(8, 22, 16, 0.18);
}

.btn-soft {
  background:
    linear-gradient(180deg, rgba(250, 245, 237, 0.98), rgba(235, 226, 212, 0.9));
  color: var(--forest-strong);
  border: 1px solid rgba(31, 79, 61, 0.12);
  box-shadow: 0 12px 24px rgba(18, 31, 24, 0.06);
}

.btn-accent {
  background:
    linear-gradient(135deg, rgba(201, 139, 65, 0.96), rgba(143, 97, 58, 0.96));
  color: #fff8ed;
  box-shadow: 0 16px 32px rgba(110, 70, 31, 0.16);
}

.btn-brand:disabled,
.btn-soft:disabled,
.btn-accent:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.validation-list,
.status-list,
.note-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.68;
}

.validation-list {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 12px;
}

.validation-item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(31, 79, 61, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(239, 231, 217, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 24px rgba(18, 31, 24, 0.04);
}

.validation-item.status-valid {
  border-color: rgba(33, 79, 67, 0.18);
}

.validation-item.status-warning {
  border-color: rgba(215, 154, 89, 0.22);
}

.validation-item.status-error {
  border-color: rgba(184, 83, 77, 0.18);
}

.validation-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(33, 79, 67, 0.08);
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 700;
}

.validation-item.status-warning .status-pill {
  background: rgba(215, 154, 89, 0.14);
  color: #93653c;
}

.validation-item.status-error .status-pill {
  background: rgba(184, 83, 77, 0.12);
  color: #9b433d;
}

.validation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
  font-size: 0.84rem;
}

.validation-package {
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--muted);
}

.validation-message-list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.validation-message-list li + li,
.status-list li + li,
.note-list li + li {
  margin-top: 8px;
}

.app-modal[hidden] {
  display: none;
}

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
}

.app-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 26, 23, 0.48);
  backdrop-filter: blur(8px);
}

.app-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 48px));
  max-height: min(84vh, 920px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 28px;
  border: 1px solid rgba(31, 79, 61, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.99), rgba(239, 231, 217, 0.94));
  box-shadow: 0 36px 90px rgba(8, 22, 16, 0.22);
  overflow: hidden;
}

.app-modal-dialog-wide {
  width: min(1080px, calc(100vw - 48px));
}

.app-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 24px 0;
}

.app-modal-body {
  display: grid;
  gap: 18px;
  padding: 18px 24px 24px;
  overflow: auto;
}

.analysis-progress-summary {
  display: grid;
  gap: 10px;
}

.analysis-progress-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(33, 79, 67, 0.14);
  background: rgba(33, 79, 67, 0.08);
  color: var(--forest);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.analysis-progress-badge.is-ready {
  background: rgba(46, 125, 89, 0.12);
  border-color: rgba(46, 125, 89, 0.18);
  color: #20553d;
}

.analysis-progress-badge.is-warning {
  background: rgba(184, 122, 32, 0.12);
  border-color: rgba(184, 122, 32, 0.18);
  color: #8a5710;
}

.analysis-progress-badge.is-error {
  background: rgba(179, 65, 65, 0.12);
  border-color: rgba(179, 65, 65, 0.18);
  color: #8f2a2a;
}

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

.analysis-progress-item {
  position: relative;
  padding: 12px 14px 12px 36px;
  border-radius: 16px;
  border: 1px solid rgba(31, 79, 61, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(239, 231, 217, 0.9));
  color: var(--text);
  line-height: 1.55;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 10px 22px rgba(18, 31, 24, 0.04);
}

.analysis-progress-item::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 14px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(33, 79, 67, 0.32);
}

.analysis-progress-item.is-ready::before {
  background: #2e7d59;
}

.analysis-progress-item.is-warning::before {
  background: #b87a20;
}

.analysis-progress-item.is-error::before {
  background: #b34141;
}

.analysis-progress-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.modal-close {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(33, 79, 67, 0.14);
  border-radius: 999px;
  background: rgba(33, 79, 67, 0.08);
  color: var(--forest);
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease;
}

.modal-close:hover {
  transform: translateY(-1px);
}

.validation-layer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.validation-layer-chip {
  min-width: 170px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(76, 61, 41, 0.08);
  background: rgba(255, 255, 255, 0.78);
  display: grid;
  gap: 4px;
}

.validation-layer-chip strong {
  color: var(--text);
  font-size: 0.94rem;
}

.validation-layer-chip span {
  color: var(--muted);
  font-size: 0.84rem;
}

.validation-layer-chip.status-valid {
  border-color: rgba(33, 79, 67, 0.18);
}

.validation-layer-chip.status-warning {
  border-color: rgba(215, 154, 89, 0.22);
}

.validation-layer-chip.status-error {
  border-color: rgba(184, 83, 77, 0.18);
}

.validation-modal-list {
  gap: 14px;
}

.validation-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.table-detail-count {
  display: block;
  font-weight: 700;
  color: var(--text);
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.table-sort-button span {
  min-width: 0;
}

.table-sort-button i {
  flex: 0 0 auto;
  font-style: normal;
  color: var(--soil);
  transition: color 140ms ease, transform 140ms ease;
}

.table-sort-button:hover {
  color: inherit;
}

.table-sort-button:hover i,
.table-sort-button.is-active i {
  color: var(--soil);
}

.table-sort-button.is-active {
  color: inherit;
}

.table-sort-button:focus-visible {
  outline: 2px solid rgba(33, 79, 67, 0.42);
  outline-offset: 2px;
  border-radius: 6px;
}

.table-detail-button {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--forest);
  font-weight: 700;
  font-size: 0.84rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.table-detail-button:hover {
  color: var(--forest-strong);
}

.table-detail-button:focus-visible {
  outline: 2px solid rgba(33, 79, 67, 0.42);
  outline-offset: 2px;
  border-radius: 6px;
}

.info-stack {
  display: grid;
  gap: 12px;
}

.info-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(31, 79, 61, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(239, 231, 217, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 24px rgba(18, 31, 24, 0.04);
}

.compact-list {
  margin-top: 0;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(31, 79, 61, 0.1);
  background: rgba(255, 250, 244, 0.78);
  color: var(--forest-strong);
  font-size: 0.86rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  display: inline-block;
}

.legend-swatch.roads {
  background: #dc2626;
}

.legend-swatch.stands {
  background: #22c55e;
}

.legend-swatch.compartments {
  background: #f59e0b;
}

.legend-swatch.chiefdom {
  background: #2563eb;
}

.legend-swatch.buffers {
  background: #ef9f4f;
}

#map {
  min-height: 760px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(31, 79, 61, 0.14);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 18px 40px rgba(18, 31, 24, 0.12);
}

.table-shell {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(31, 79, 61, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.96), rgba(239, 231, 217, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 16px 32px rgba(18, 31, 24, 0.06);
}

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

th,
td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(31, 79, 61, 0.08);
  font-size: 0.92rem;
}

th {
  position: sticky;
  top: 0;
  background:
    linear-gradient(135deg, rgba(16, 45, 34, 0.98), rgba(31, 79, 61, 0.96));
  color: rgba(250, 245, 235, 0.94);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

tbody tr:nth-child(even) {
  background: rgba(31, 79, 61, 0.03);
}

tbody tr:hover {
  background: rgba(201, 139, 65, 0.09);
}

.note-block {
  background:
    linear-gradient(180deg, rgba(242, 235, 223, 0.98), rgba(235, 225, 208, 0.9));
  border-color: rgba(201, 139, 65, 0.18);
}

.popup h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.map-feature-label {
  background: rgba(255, 252, 247, 0.92);
  border: 1px solid rgba(76, 61, 41, 0.14);
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(24, 32, 29, 0.08);
  color: #24312b;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 4px 10px;
  white-space: nowrap;
}

.map-feature-label::before {
  display: none;
}

.map-feature-label-road {
  background: rgba(220, 38, 38, 0.92);
  border-color: rgba(220, 38, 38, 0.95);
  color: #f8f5ef;
}

.map-feature-label-compartment {
  background: rgba(255, 244, 214, 0.94);
  border-color: rgba(245, 158, 11, 0.36);
  color: #8a4b00;
}

.map-feature-label-stand {
  background: rgba(21, 128, 61, 0.9);
  border-color: rgba(21, 128, 61, 0.94);
  color: #f5f7f1;
}

.leaflet-control-layers {
  border: 1px solid rgba(31, 79, 61, 0.16) !important;
  border-radius: 16px !important;
  box-shadow: 0 18px 38px rgba(18, 31, 24, 0.14) !important;
  overflow: hidden;
}

.leaflet-control-layers-expanded {
  min-width: 220px;
  padding: 14px 16px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.99), rgba(239, 231, 217, 0.94));
  color: var(--text);
}

.leaflet-control-layers-base label,
.leaflet-control-layers-overlays label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
}

.leaflet-control-layers-separator {
  margin: 10px 0;
  border-top-color: rgba(76, 61, 41, 0.1);
}

.map-coordinate-control {
  min-width: 240px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(31, 79, 61, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(239, 231, 217, 0.94));
  box-shadow: 0 16px 32px rgba(18, 31, 24, 0.1);
  color: var(--text);
}

.map-coordinate-control strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soil);
}

.map-coordinate-control span {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 1400px) {
  .workspace-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .workspace-hero-side {
    justify-content: flex-start;
  }

  .overview-grid,
  .data-grid,
  .reports-layout {
    grid-template-columns: 1fr;
  }

  .report-menu {
    position: static;
  }

  .legend {
    justify-content: flex-start;
  }

  .validation-launcher {
    align-items: flex-start;
  }
}

@media (max-width: 991px) {
  :root {
    --viewport-gap: 10px;
    --stack-gap: 10px;
  }

  body {
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
  }

  .app-shell {
    grid-template-columns: 1fr;
    width: 100%;
    min-height: 100dvh;
    height: 100dvh;
    padding: 0;
    gap: 0;
  }

  .shell-main {
    margin: 12px 10px 18px;
    padding: 18px;
  }

  .menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(23, 23, 23, 0.34);
    z-index: 39;
  }

  .sidebar-desktop {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(360px, calc(100vw - 24px));
    transform: translateX(calc(-100% - 24px));
    transition: transform 180ms ease;
    z-index: 70;
  }

  .sidebar-desktop.is-open {
    transform: translateX(0);
  }

  .sidebar-panel {
    height: 100%;
    overflow: auto;
    border-radius: 0 24px 24px 0;
  }

  .sidebar-close,
  .mobile-menu-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu-fab {
    position: fixed !important;
    top: calc(14px + env(safe-area-inset-top, 0px)) !important;
    left: calc(14px + env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    z-index: 65;
    justify-self: auto;
    align-self: auto;
    margin-bottom: 0;
    box-shadow: 0 18px 36px rgba(24, 32, 29, 0.16);
  }

  .sidebar-desktop.is-open ~ .mobile-menu-fab {
    opacity: 0;
    pointer-events: none;
  }

  .menu-section-label {
    display: none;
  }

  .shell-content {
    gap: 18px;
  }

  .sidebar-footer {
    padding-bottom: 14px;
  }

  .glass-panel,
  .sidebar-panel,
  .shell-main {
    border-radius: 22px;
  }

  .glass-panel {
    padding: 18px;
  }

  .section-head,
  .validation-head {
    align-items: flex-start;
  }

  #map {
    min-height: 460px;
  }

  .content-stage {
    gap: 18px;
  }

  .shell-content {
    padding: 18px;
  }

  .workspace-hero {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px 18px;
  }

  .workspace-hero-title {
    font-size: clamp(1.85rem, 8vw, 2.7rem);
  }

  .workspace-hero-side {
    justify-content: flex-start;
  }

  .validation-launcher {
    flex-direction: column;
    align-items: stretch;
  }

  .validation-launcher .btn-soft {
    width: 100%;
  }

  .reports-summary-shell {
    gap: 12px;
    margin-bottom: 18px;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .reports-layout {
    gap: 16px;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
  }

  .report-menu {
    position: static;
    padding: 16px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .report-menu-toggle {
    display: flex;
  }

  .report-nav {
    display: none;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    padding-top: 12px;
  }

  .report-menu.is-open .report-nav {
    display: grid;
  }

  .report-nav-link {
    flex: none;
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .report-stage {
    width: 100%;
    gap: 16px;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }

  .report-view-panel {
    padding: 16px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
  }

  .report-view-panel > .section-head,
  .report-view-panel > .analysis-notes,
  .report-view-panel > .note-grid {
    min-width: 0;
    max-width: 100%;
  }

  .table-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .table-shell table {
    min-width: 680px;
  }

  .table-shell.compact table {
    min-width: 560px;
  }

  th,
  td {
    padding: 10px 12px;
  }

  th {
    font-size: 0.74rem;
  }

  td {
    font-size: 0.88rem;
  }

  .app-modal {
    padding: 12px;
  }

  .app-modal-dialog {
    width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: 24px;
  }

  .app-modal-head {
    padding: 20px 18px 0;
  }

  .app-modal-body {
    padding: 16px 18px 18px;
  }

  .analysis-progress-actions {
    justify-content: flex-start;
  }

  .analysis-progress-actions .btn-brand,
  .analysis-progress-actions .btn-soft {
    flex: 1 1 220px;
  }

  .leaflet-control-layers-expanded {
    min-width: 190px;
    padding: 12px 14px;
  }

  .map-coordinate-control {
    min-width: 200px;
  }

  .leaflet-top.leaflet-right .leaflet-control-layers {
    max-width: calc(100vw - 36px);
  }

  .leaflet-control-layers-expanded {
    max-width: min(260px, calc(100vw - 36px));
    max-height: min(52vh, 360px);
    overflow: auto;
  }

  .leaflet-control-layers-list {
    margin-right: 0;
  }
}

@media (max-width: 640px) {
  .reports-summary-shell {
    gap: 12px;
    margin-bottom: 16px;
  }

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

  .reports-layout {
    gap: 14px;
  }

  .report-menu {
    padding: 14px;
  }

  .report-menu-toggle {
    padding: 12px 14px;
  }

  .report-nav-link {
    padding: 12px 14px;
  }

  .report-nav-copy strong {
    font-size: 0.92rem;
  }

  .report-nav-copy small {
    font-size: 0.78rem;
  }

  .report-stage {
    gap: 14px;
  }

  .report-view-panel {
    padding: 14px;
  }

  .table-shell {
    border-radius: 14px;
  }

  .table-shell table {
    min-width: 620px;
  }

  .table-shell.compact table {
    min-width: 520px;
  }

  .sidebar-logo {
    width: auto;
    height: auto;
    gap: 10px;
  }

  .sidebar-logo img {
    width: 44px;
    height: 44px;
  }

  .sidebar-brand-text {
    font-size: 0.98rem;
  }

  .app-modal {
    padding: 0;
  }

  .app-modal-dialog {
    max-height: 100dvh;
    height: 100dvh;
    width: 100vw;
    border-radius: 0;
  }

  .app-modal-head {
    padding: 18px 16px 0;
  }

  .app-modal-body {
    padding: 16px;
  }

  .analysis-progress-actions .btn-brand,
  .analysis-progress-actions .btn-soft {
    width: 100%;
    flex-basis: 100%;
  }

  .validation-layer-list {
    flex-direction: column;
  }

  .validation-layer-chip {
    min-width: 0;
  }

  .map-coordinate-control {
    min-width: 0;
    max-width: calc(100vw - 56px);
    padding: 9px 10px;
  }

  .map-coordinate-control span {
    white-space: normal;
  }
}

.overview-copy {
  max-width: 1100px;
  margin: 0 auto;
}

.overview-copy p {
  margin: 0;
}

.overview-copy p:last-child {
  margin-bottom: 0;
}

.compact-list li + li {
  margin-top: 6px;
}

.workflow-diagram {
  margin: 14px 0;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(240, 232, 218, 0.92));
  border: 1px solid rgba(31, 79, 61, 0.12);
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(18, 31, 24, 0.08);
}

.workflow-diagram img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.workflow-diagram figcaption {
  margin-top: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.workflow-diagram-link {
  margin: 12px auto 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid rgba(31, 79, 61, 0.18);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.92);
  color: var(--forest);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(16, 31, 23, 0.08);
}

.workflow-diagram-link:hover {
  transform: translateY(-1px);
}

.image-modal-dialog {
  width: min(1280px, calc(100vw - 48px));
}

.image-modal-body {
  padding-top: 8px;
}

.image-modal-visual {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid rgba(31, 79, 61, 0.1);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px rgba(16, 31, 23, 0.12);
}
