:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-warm: #fbfaf7;
  --text: #17212b;
  --text-soft: #344452;
  --muted: #667482;
  --muted-strong: #52616e;
  --line: #e2e7eb;
  --line-strong: #cbd4dc;
  --accent: #153f54;
  --accent-hover: #0f3446;
  --focus: rgba(21, 63, 84, 0.22);

  --submitted-text: #526776;
  --submitted-fill: #f2f5f7;
  --submitted-line: #c7d1d8;
  --blue-text: #164b68;
  --blue-fill: #edf5f8;
  --blue-line: #9dbdca;
  --teal-text: #226251;
  --teal-fill: #eef7f3;
  --teal-line: #a4c9bd;
  --neutral-text: #5a6671;
  --neutral-fill: #f2f4f5;
  --neutral-line: #cbd2d8;
  --correction-text: #805331;
  --correction-fill: #faf3ec;
  --correction-line: #d9b89a;

  --status-submitted: #b65314;
  --status-under-review: #b65314;
  --status-approved: #2b5fa6;
  --status-issued: #2b5fa6;
  --status-corrections: #b53d32;
  --status-closed: #7b858e;
  --status-neutral: #667482;

  --phase-early-text: #795515;
  --phase-early-fill: #fff7e6;
  --phase-early-line: #dfbd72;
  --phase-pre-text: #8f4d1f;
  --phase-pre-fill: #fff2e9;
  --phase-pre-line: #e2a47e;
  --phase-ready-text: #285f42;
  --phase-ready-fill: #edf7f1;
  --phase-ready-line: #99c4aa;
  --verified-text: #2f6a4a;
  --lifecycle-current-text: #246a66;
  --lifecycle-current-fill: #edf8f6;
  --lifecycle-current-line: #9bc8c2;
  --lifecycle-aging-text: #835813;
  --lifecycle-aging-fill: #fff7e6;
  --lifecycle-aging-line: #dfbd72;
  --lifecycle-historical-text: #5f6b75;
  --lifecycle-historical-fill: #f1f3f5;
  --lifecycle-historical-line: #cbd2d8;
  --location-fill: #faf7f1;
  --location-line: #eadfce;

  --shadow-selected: 0 12px 30px rgba(28, 42, 52, 0.08);
  --shadow-float: 0 8px 24px rgba(28, 42, 52, 0.10);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 64px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; }
a { color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }

.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;
}

.app-header {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-7);
  padding: var(--space-4) var(--space-6);
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 30;
}
.header-identity { min-width: 350px; display: flex; align-items: center; gap: 18px; }
.brand-block { min-width: 270px; display: block; color: inherit; text-decoration: none; }
.home-control {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
}
.home-control:hover { background: var(--surface-warm); border-color: #aebac3; }
.home-control svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-kicker,
.eyebrow {
  font-size: 0.70rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.brand-name {
  margin-top: var(--space-1);
  font-size: 1.08rem;
  line-height: 1.15;
  font-weight: 790;
  letter-spacing: -0.02em;
}

.search-bar {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto;
  gap: var(--space-2);
  flex: 1;
  max-width: 720px;
}
.search-bar input,
.search-bar select,
.search-bar button {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 0 13px;
  color: var(--text);
}
.search-bar input::placeholder { color: #7d8891; }
.search-bar input:hover,
.search-bar select:hover { border-color: #aebac3; }
.search-bar button {
  width: auto;
  padding: 0 20px;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 760;
  cursor: pointer;
  transition: background-color 140ms ease, transform 140ms ease;
}
.search-bar button:hover { background: var(--accent-hover); }

.search-field { position: relative; }
.search-field input { padding-right: 42px; }
.search-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: var(--radius-pill) !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-size: 1.15rem;
  line-height: 1;
}
.search-clear:hover { background: var(--neutral-fill) !important; color: var(--text-soft) !important; }
.search-clear[hidden] { display: none; }
.search-field input::-webkit-search-cancel-button,
.search-field input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.discovery-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.discovery-bar label { min-width: 0; }
.discovery-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.075em;
}
.discovery-bar select {
  width: 100%;
  min-height: 40px;
  padding: 0 34px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  appearance: none;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2352616e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 7px;
  color: var(--text-soft);
  font-size: 0.80rem;
  font-weight: 650;
}
.discovery-bar select:hover { border-color: #aebac3; }

.mobile-feed-tools { display: none; }
.desktop-feed-tools {
  display: none;
  flex: 0 0 auto;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 7px var(--space-6) 9px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.desktop-feed-tools.is-visible { display: flex; }
.desktop-feed-tools button,
.mobile-feed-tools button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 760;
  cursor: pointer;
}
.desktop-feed-tools button:hover,
.mobile-feed-tools button:hover { background: var(--surface-warm); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.app-shell {
  height: calc(100vh - 84px);
  display: grid;
  grid-template-columns: minmax(390px, 39%) minmax(0, 1fr);
}
.app-shell:has(.feed-pane .empty-state) { grid-template-columns: 1fr; }
.app-shell:has(.feed-pane .empty-state) .feed-pane { border-right: 0; }
.app-shell:has(.feed-pane .empty-state) .detail-pane { display: none; }
.feed-pane,
.detail-pane {
  min-width: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.feed-pane {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.feed-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: var(--space-6);
}
.detail-pane {
  overflow-y: auto;
  padding: var(--space-7) clamp(28px, 4vw, 64px) var(--space-10);
  background: var(--surface);
}

.feed-heading {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: var(--space-4);
  margin-bottom: 15px;
}
.feed-result-heading {
  margin: 7px 0 0;
  font-size: 0.98rem;
  line-height: 1.2;
  letter-spacing: -0.014em;
  font-weight: 650;
}

.feed-list { display: grid; gap: var(--space-3); }
.feed-card {
  position: relative;
  display: block;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 18px 17px;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}
.feed-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}
.feed-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--surface);
}
.feed-card.is-selected {
  background: var(--surface);
  border-color: #b8c7cf;
  box-shadow: var(--shadow-selected);
}
.feed-card.is-selected::before { background: var(--accent); }

.feed-card-topline,
.detail-badges,
.feed-location,
.project-meta,
.feed-facts,
.record-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.feed-card-topline,
.detail-badges { gap: var(--space-2); }
.feed-location,
.project-meta { gap: var(--space-2) var(--space-3); }
.feed-facts { gap: 7px; }
.record-meta { gap: var(--space-1) var(--space-3); }

.feed-card h2 {
  margin: var(--space-3) 0 var(--space-1);
  font-size: 1.08rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
}
.feed-location,
.project-meta,
.record-meta {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.feed-community-plan {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #edf0f2;
}
.feed-community-plan-label,
.identity-community-plan-label {
  display: block;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.25;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.feed-summary {
  margin: var(--space-3) 0 0;
  color: var(--text-soft);
  font-size: 0.91rem;
  line-height: 1.48;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-facts { margin-top: var(--space-3); }
.feed-facts span {
  padding: 4px 7px;
  border-radius: 6px;
  background: #f1f4f5;
  color: var(--muted-strong);
  font-size: 0.70rem;
  line-height: 1.25;
  font-weight: 710;
}

.status-marker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  color: var(--status-neutral);
  font-size: 0.71rem;
  line-height: 1.15;
  font-weight: 740;
  white-space: nowrap;
}
.status-marker::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: currentColor;
}
.status-submitted { color: var(--status-submitted); }
.status-submitted::before { background: transparent; }
.status-under-review { color: var(--status-under-review); }
.status-approved,
.status-ready-to-issue { color: var(--status-approved); }
.status-approved::before,
.status-ready-to-issue::before { background: transparent; }
.status-issued { color: var(--status-issued); }
.status-corrections { color: var(--status-corrections); }
.status-closed,
.status-unconfirmed,
.status-neutral { color: var(--status-closed); }

.phase-badge,
.lifecycle-badge,
.record-kind {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.70rem;
  line-height: 1.15;
  font-weight: 790;
  white-space: nowrap;
}
.phase-badge,
.lifecycle-badge { border: 1px solid; }
.phase-early-lead { color: var(--phase-early-text); background: var(--phase-early-fill); border-color: var(--phase-early-line); }
.phase-pre-construction { color: var(--phase-pre-text); background: var(--phase-pre-fill); border-color: var(--phase-pre-line); }
.phase-construction-ready { color: var(--phase-ready-text); background: var(--phase-ready-fill); border-color: var(--phase-ready-line); }
.phase-completed,
.phase-inactive,
.phase-unconfirmed,
.phase-neutral { color: var(--neutral-text); background: var(--neutral-fill); border-color: var(--neutral-line); }
.lifecycle-current { color: var(--lifecycle-current-text); background: var(--lifecycle-current-fill); border-color: var(--lifecycle-current-line); }
.lifecycle-aging { color: var(--lifecycle-aging-text); background: var(--lifecycle-aging-fill); border-color: var(--lifecycle-aging-line); }
.lifecycle-historical,
.lifecycle-neutral { color: var(--lifecycle-historical-text); background: var(--lifecycle-historical-fill); border-color: var(--lifecycle-historical-line); }
.history-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  color: var(--muted-strong);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}
.history-toggle { grid-column: 1 / -1; justify-self: start; }
.history-toggle input { accent-color: var(--accent); }

.feed-more-wrap { display: flex; justify-content: center; padding: var(--space-5) 0 var(--space-2); }
.load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 760;
  cursor: pointer;
}
.load-more:hover { border-color: #aab7c0; background: #fbfcfc; }
.load-more.is-loading { opacity: 0.58; pointer-events: none; }
.project-detail-card { max-width: 940px; margin: 0 auto; }
.mobile-back { display: none; }
.detail-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}
.detail-section:last-child { border-bottom: 0; }
.project-identity { padding-top: var(--space-2); padding-bottom: 28px; }
.project-identity .detail-badges { margin-bottom: 12px; }
.project-identity h1 {
  margin: 0;
  max-width: none;
  font-size: clamp(1.9rem, 2.35vw, 2.32rem);
  line-height: 1.04;
  letter-spacing: -0.042em;
  font-weight: 800;
  text-wrap: balance;
  overflow-wrap: break-word;
}
.project-location-line {
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  font-weight: 500;
}
.identity-community-plan {
  max-width: 100%;
  margin-top: 12px;
}
.feed-community-plan-value,
.identity-community-plan-value {
  display: block;
  margin-top: 3px;
  color: var(--muted-strong);
  font-size: 0.78rem;
  line-height: 1.4;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.identity-community-plan-value { font-size: 0.82rem; }
.project-meta { margin-top: var(--space-2); }

.narrative-section .eyebrow,
.detail-section > .eyebrow { margin-bottom: var(--space-3); }
.project-overview,
.latest-activity {
  margin: 0;
  max-width: 68ch;
  font-size: 1.03rem;
  line-height: 1.58;
  letter-spacing: -0.01em;
  font-weight: 450;
  color: var(--text);
}
.latest-activity-date {
  display: block;
  margin: -2px 0 5px;
  color: var(--text-soft);
  font-size: 0.80rem;
  line-height: 1.3;
  font-weight: 760;
}
.filing-appendix { padding-bottom: var(--space-5); }
.filing-details { margin-top: 0; }
.filing-details summary {
  width: max-content;
  max-width: 100%;
  color: var(--accent);
  font-size: 0.80rem;
  font-weight: 760;
  cursor: pointer;
  list-style: none;
}
.filing-details summary::-webkit-details-marker { display: none; }
.filing-details summary::before { content: "▸"; display: inline-block; width: 1.1em; }
.filing-details[open] summary::before { content: "▾"; }
.filing-context {
  margin-bottom: var(--space-3);
  color: var(--muted-strong);
  font-size: 0.76rem;
  line-height: 1.35;
  font-weight: 720;
}
.filing-details-body {
  margin-top: var(--space-4);
  max-width: 72ch;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}
.filing-detail-label {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.filing-description p,
.filing-provenance p { margin: var(--space-2) 0 0; color: var(--text-soft); font-size: 0.86rem; line-height: 1.55; }
.filing-provenance + .filing-description { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.filing-terms { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.filing-terms dl { margin: var(--space-3) 0 0; display: grid; gap: var(--space-2); }
.filing-terms dl > div { display: grid; grid-template-columns: 72px 1fr; gap: var(--space-3); }
.filing-terms dt { font-size: 0.78rem; font-weight: 800; }
.filing-terms dd { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.45; }

.fact-grid-primary {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}
.fact-item-primary {
  min-width: 0;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid #edf0f2;
}
.fact-item-permit {
  grid-column: 1 / -1;
  padding: 11px 16px;
}
.fact-item-permit dd {
  overflow-wrap: anywhere;
}
.fact-secondary dt {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.075em;
}
.fact-item-primary dt {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  white-space: nowrap;
}
.fact-item-primary dd {
  margin: 6px 0 0;
  font-size: 1.02rem;
  line-height: 1.2;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.fact-list-secondary {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3) var(--space-5);
}
.fact-secondary { min-width: 0; }
.fact-secondary-wide { grid-column: 1 / -1; }
.fact-secondary dd {
  margin: 5px 0 0;
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.35;
  font-weight: 690;
  overflow-wrap: anywhere;
}

.team-list,
.record-list { display: grid; }
.team-row {
  display: grid;
  grid-template-columns: minmax(0, 30%) minmax(0, 1fr) 190px;
  align-items: start;
  gap: var(--space-6);
  padding: 16px 0;
}
.record-row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(190px, 0.85fr);
  align-items: start;
  gap: var(--space-6);
  padding: 16px 0;
}
.team-row + .team-row,
.record-row + .record-row { border-top: 1px solid var(--line); }
.team-identity,
.record-identity { min-width: 0; }
.team-role,
.verification-note {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}
.team-identity strong,
.record-identity strong {
  display: block;
  margin-top: 3px;
  font-size: 0.94rem;
  line-height: 1.35;
  overflow-wrap: normal;
  word-break: normal;
}
.verification-note { margin-top: 2px; font-size: 0.71rem; color: var(--verified-text); font-weight: 740; }
.team-contacts {
  min-width: 0;
  display: grid;
  gap: 10px;
}
.team-contact-field { min-width: 0; }
.team-contact-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.3;
  font-weight: 650;
}
.team-contact-value {
  display: block;
  max-width: 100%;
  color: var(--text);
  text-decoration: none;
  font-size: 0.83rem;
  line-height: 1.45;
  font-weight: 700;
  overflow-wrap: normal;
  word-break: normal;
}
a.team-contact-value:hover { text-decoration: underline; text-underline-offset: 3px; }
.business-address-line { display: block; }
.team-contact-main-office-phone .team-contact-value,
.lifecycle-event time { font-variant-numeric: tabular-nums; }
.team-contact-main-office-phone .team-contact-value { font-weight: 760; }
.team-actions {
  width: 190px;
  min-width: 0;
  align-self: start;
  display: grid;
  justify-items: end;
  gap: 3px;
  text-align: right;
}
.team-actions-label {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.3;
  font-weight: 650;
}
.team-action-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 2px 14px;
}
.team-action,
.record-source-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.80rem;
  font-weight: 770;
}
.team-action { white-space: nowrap; }
.team-action:hover,
.record-source-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.record-detail {
  display: grid;
  justify-items: end;
  gap: var(--space-3);
  min-width: 0;
}
.record-kind {
  width: max-content;
  margin-bottom: 5px;
  padding: 3px 8px;
  color: var(--neutral-text);
  background: var(--neutral-fill);
  border: 1px solid var(--neutral-line);
}
.record-meta { justify-content: flex-end; text-align: right; }
.record-lifecycle {
  display: grid;
  gap: 9px;
  color: var(--muted-strong);
  font-weight: 650;
}
.lifecycle-event {
  display: block;
  line-height: 1.3;
  text-align: right;
}
.lifecycle-event span,
.lifecycle-event time { display: block; }
.lifecycle-event span { color: var(--muted); font-size: 0.70rem; font-weight: 650; }
.lifecycle-event time { margin-top: 2px; white-space: nowrap; color: var(--text); font-size: 0.82rem; font-weight: 760; }

.detail-end { display: flex; padding-top: var(--space-5); }
.detail-top-action {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 780;
}
.detail-top-action:hover { background: #f1f5f6; }

.detail-skeleton { max-width: 940px; margin: 0 auto; padding-top: var(--space-3); }
.skeleton-line,
.skeleton-pill,
.skeleton-block {
  background: linear-gradient(90deg, #f0f3f4 25%, #f7f9fa 50%, #f0f3f4 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}
.skeleton-pill { width: 96px; height: 26px; border-radius: var(--radius-pill); }
.skeleton-line { height: 18px; border-radius: 5px; margin-top: var(--space-3); }
.skeleton-line.title { width: 66%; height: 52px; margin-top: var(--space-5); }
.skeleton-line.short { width: 36%; }
.skeleton-block { height: 116px; margin-top: var(--space-8); border-radius: var(--radius-md); }
@keyframes skeleton-pulse { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.empty-state,
.unavailable {
  max-width: 560px;
  margin: var(--space-10) auto;
  padding: var(--space-7);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  text-align: center;
}
.empty-state h2,
.unavailable h1,
.unavailable h2 { margin: 0; }
.empty-state p,
.unavailable p { margin: var(--space-2) 0 0; color: var(--muted); line-height: 1.5; }
.empty-state-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: var(--space-4);
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 760;
}
.empty-state-action:hover { background: #fbfcfc; }
.unavailable-page { margin-top: 12vh; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: minmax(350px, 42%) minmax(0, 1fr); }
  .fact-grid-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact-list-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-row { grid-template-columns: minmax(180px, 0.9fr) minmax(0, 1.3fr); gap: var(--space-4); }
  .team-actions {
    grid-column: 2;
    width: 100%;
    justify-items: start;
    text-align: left;
  }
  .team-action-links { justify-content: flex-start; }
}

@media (max-width: 1000px) {
  .app-header { align-items: flex-start; flex-direction: column; gap: var(--space-3); }
  .header-identity, .brand-block { min-width: 0; }
  .search-bar { width: 100%; max-width: none; }
  .app-shell { height: calc(100vh - 145px); }
}

@media (max-width: 820px) {
  html, body { height: auto; min-height: 100%; }
  body { overflow: auto; min-height: 100vh; }
  .app-header {
    position: relative;
    top: auto;
    min-height: 0;
    padding: 12px 14px;
    box-shadow: 0 1px 0 var(--line);
  }
  .brand-kicker { display: none; }
  .header-identity { width: 100%; justify-content: space-between; }
  .brand-block { text-align: right; min-width: 0; }
  .brand-name { font-size: 1rem; }
  .home-control { width: 32px; height: 32px; flex-basis: 32px; }
  .search-bar { grid-template-columns: 1fr auto; width: 100%; }
  .search-bar button.search-submit { width: auto; min-height: 44px; }
  .desktop-feed-tools { display: none !important; }
  .mobile-feed-tools {
    flex: 0 0 auto;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 6px 14px 8px;
    border-top: 1px solid var(--line);
    background: var(--bg);
    box-shadow: 0 -5px 16px rgba(28, 42, 52, 0.04);
  }
  body.mobile-feed-tools-visible:not(.show-detail-mobile) .mobile-feed-tools { display: flex; }
  .mobile-feed-tools button {
    min-height: 36px;
    padding: 0 16px;
    font-size: 0.78rem;
    font-weight: 770;
  }
  body:not(.show-detail-mobile) {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body:not(.show-detail-mobile) .app-header { flex: 0 0 auto; }
  .app-shell { height: auto; min-height: 0; grid-template-columns: 1fr; }
  body:not(.show-detail-mobile) .app-shell { flex: 1 1 auto; }
  .feed-pane,
  .detail-pane { border: 0; scrollbar-gutter: auto; }
  .feed-pane { min-height: 0; }
  .feed-scroll { padding: var(--space-4); }
  body.show-detail-mobile .feed-scroll { overflow: visible; }
  .detail-pane { display: none; padding: var(--space-4) var(--space-4) 32px; }
  body.show-detail-mobile { overflow: auto; min-height: 100vh; }
  body.show-detail-mobile .feed-pane { display: none; }
  body.show-detail-mobile .detail-pane { display: block; overflow: visible; }
  body.show-detail-mobile .search-bar { display: none; }
  body.show-detail-mobile .app-header { position: relative; top: auto; z-index: 30; }
  body.show-detail-mobile .brand-block { min-height: 24px; display: flex; align-items: center; }
  .mobile-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0 0 4px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 780;
    cursor: pointer;
  }
  .project-identity { padding-top: 0; padding-bottom: 20px; }
  .project-identity .detail-badges { margin: 0 0 10px; }
  .project-identity h1 { max-width: none; font-size: clamp(1.65rem, 7.2vw, 2.05rem); line-height: 1.04; }
  .detail-section { padding: 20px 0; }
  .fact-grid-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact-list-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact-secondary-wide { grid-column: 1 / -1; }
  .fact-grid-primary .fact-item-primary:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .fact-item-permit { grid-column: 1 / -1; padding: 11px 14px; }
  .fact-item-primary { padding: 13px 14px; }
  .fact-item-primary dt { white-space: normal; }
  .team-row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
    padding: 12px 0;
  }
  .team-identity,
  .team-contacts,
  .team-actions { grid-column: 1; width: 100%; min-width: 0; }
  .team-actions {
    grid-column: 1;
    width: 100%;
    justify-items: start;
    text-align: left;
    align-self: start;
  }
  .team-action-links { justify-content: flex-start; }
  .team-contact-value,
  .team-identity strong { max-width: 100%; }
  .record-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .record-detail { justify-items: start; }
  .record-meta { justify-content: flex-start; text-align: left; }
  .lifecycle-event { text-align: left; }
  .filing-details-body { padding: 14px; }
  body.show-detail-mobile .detail-end {
    margin: var(--space-4) calc(-1 * var(--space-4)) -32px;
    padding: 6px 14px 8px;
    border-top: 1px solid var(--line);
    background: var(--bg);
    box-shadow: 0 -5px 16px rgba(28, 42, 52, 0.04);
    justify-content: center;
  }
  body.show-detail-mobile .detail-top-action {
    width: auto;
    min-height: 36px;
    padding: 0 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 0.78rem;
    font-weight: 770;
  }
  body.show-detail-mobile .detail-top-action:hover { background: var(--surface-warm); }
  .detail-section.filing-appendix { border-bottom: 0; }
}

@media (max-width: 520px) {
  .app-header { gap: 10px; }
  .search-bar { grid-template-columns: 1fr; }
  .search-bar button.search-submit { width: 100%; }
  .discovery-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .discovery-label { font-size: 0.61rem; }
  .discovery-bar select { font-size: 0.76rem; padding: 0 30px 0 8px; background-position: right 10px center; }
  .feed-card { padding: 16px; border-radius: 15px; }
  .feed-heading { margin-bottom: 15px; }
  .feed-result-heading { font-size: 0.98rem; }
  .fact-grid-primary,
  .fact-list-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact-secondary-wide { grid-column: 1 / -1; }
  .fact-item-primary dd { font-size: 0.95rem; }
  .team-row { grid-template-columns: minmax(0, 1fr); }
  .filing-terms dl > div { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


.session-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.72rem;
}
.session-user {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-control button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 760;
  cursor: pointer;
}
.session-control button:hover { background: var(--surface-warm); }

body.login-page {
  min-height: 100%;
  height: auto;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-shell {
  width: min(100%, 420px);
}
.login-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}
.login-brand {
  margin-bottom: 24px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 820;
  letter-spacing: 0.03em;
}
.login-card h1 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.1;
}
.login-intro {
  margin: 10px 0 22px;
  color: var(--muted);
  line-height: 1.5;
}
.login-error {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #d9b2ad;
  border-radius: 9px;
  background: #fff3f1;
  color: #8a332b;
  font-size: 0.82rem;
}
.login-form {
  display: grid;
  gap: 16px;
}
.login-form label {
  display: grid;
  gap: 7px;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 720;
}
.login-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
}
.login-form input:focus {
  outline: 3px solid var(--focus);
  border-color: var(--accent);
}
.login-form button {
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-weight: 780;
  cursor: pointer;
}
.login-form button:hover { background: var(--accent-hover); }

@media (max-width: 820px) {
  .session-user { display: none; }
  .session-control { margin-left: 0; }
}

@media (max-width: 520px) {
  body.login-page { padding: 16px; }
  .login-card { padding: 24px 20px; }
}
