:root {
  --ny-blue: #123d6f;
  --ny-blue-deep: #0b2646;
  --ny-gold: #d8a134;
  --ink: #132238;
  --muted: #5f6c7b;
  --line: #d6dce4;
  --paper: #fbfcfe;
  --panel: #f1f5f9;
  --white: #ffffff;
  --chip: #dfe9f5;
  --shadow: 0 18px 40px rgba(10, 28, 54, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(18, 61, 111, 0.06), transparent 34%),
    linear-gradient(135deg, #f6f8fb, #edf3f9 55%, #f7fafc);
}

button,
input,
select {
  font: inherit;
}

a {
  color: var(--ny-blue);
}

.site-header {
  border-bottom: 1px solid rgba(18, 61, 111, 0.15);
  background:
    linear-gradient(120deg, rgba(18, 61, 111, 0.98), rgba(24, 88, 143, 0.92)),
    linear-gradient(0deg, rgba(216, 161, 52, 0.18), rgba(216, 161, 52, 0.18));
  color: var(--white);
}

.header-inner {
  max-width: 1480px;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 1.85rem;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 1.25rem;
  align-items: end;
}

.eyebrow {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  opacity: 0.86;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 3.5vw, 3.35rem);
  line-height: 0.95;
}

.intro {
  max-width: 52rem;
  margin: 0.9rem 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
}

.header-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.header-stats:empty {
  display: none;
}

.stat-tile {
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  backdrop-filter: blur(10px);
}

.stat-tile .kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.76);
}

.stat-tile strong {
  display: block;
  margin-top: 0.28rem;
  font-size: 1.5rem;
}

.top-nav {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0.95rem 1.5rem 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-link {
  border: 1px solid rgba(18, 61, 111, 0.16);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ny-blue-deep);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--ny-blue);
  color: var(--white);
  border-color: var(--ny-blue);
  transform: translateY(-1px);
}

.layout {
  max-width: 1480px;
  margin: 0 auto;
  padding: 1rem 1.5rem 1.75rem;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.sidebar,
.content,
.detail-panel {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(18, 61, 111, 0.1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 1rem;
}

.sidebar {
  padding: 1rem;
}

.content {
  padding: 1rem;
}

.detail-panel {
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff, #f9fbfe);
  border: none;
  box-shadow: none;
}

.panel-title,
.section-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ny-blue);
}

.checkbox-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
}

.year-check {
  position: relative;
  display: inline-flex;
}

.year-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.year-check span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.8rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(18, 61, 111, 0.16);
  border-radius: 999px;
  background: var(--white);
  color: var(--ny-blue-deep);
  font-size: 0.78rem;
  cursor: pointer;
}

.year-check input:checked + span {
  background: var(--ny-blue);
  color: var(--white);
  border-color: var(--ny-blue);
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.3rem;
  width: 100%;
}

.search-row input[type="search"] {
  min-width: 0;
  width: 100%;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: 0.3rem;
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0;
}

.search-row .inline-check {
  justify-self: start;
  align-self: center;
}

.filter-group .inline-check {
  display: inline-flex;
  margin-bottom: 0;
}

.inline-check input {
  width: auto;
  margin: 0;
}

.filter-group {
  margin-bottom: 1rem;
}

.filter-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.filter-group input,
.filter-group select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.chip-row,
.mini-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip,
.mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ny-blue-deep);
  padding: 0.34rem 0.65rem;
  font-size: 0.78rem;
}

.chip button {
  border: none;
  background: none;
  cursor: pointer;
}

.chip-button {
  border: 1px solid rgba(18, 61, 111, 0.14);
  background: var(--white);
  color: var(--ny-blue);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.chip-button:hover {
  border-color: var(--ny-blue);
}

.utility-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.utility-button {
  flex: 1;
  border: 1px solid rgba(18, 61, 111, 0.16);
  background: var(--panel);
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
}

.utility-button:hover {
  background: #e5edf7;
}

.view-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.view-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.view-count {
  margin-left: 0.45rem;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  vertical-align: middle;
}

.view-header p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.summary-card {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f5f8fb);
  border: 1px solid rgba(18, 61, 111, 0.1);
}

.summary-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.summary-card strong {
  display: block;
  margin-top: 0.28rem;
  font-size: 1.55rem;
}

.commitment-list,
.card-list {
  display: grid;
  gap: 0.8rem;
}

.dense-table {
  border: 1px solid rgba(18, 61, 111, 0.12);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.dense-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 2.2fr) minmax(0, 1.05fr) minmax(0, 0.95fr) 82px 72px;
  gap: 0.8rem;
  align-items: center;
  width: 100%;
}

.dense-head {
  padding: 0.72rem 0.9rem;
  background: #eef4fa;
  border-bottom: 1px solid rgba(18, 61, 111, 0.12);
  color: var(--muted);
  font-size: 0.73rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sort-button {
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}

.sort-button:hover {
  color: var(--ny-blue);
}

.dense-button {
  border: none;
  border-bottom: 1px solid rgba(18, 61, 111, 0.08);
  background: transparent;
  padding: 0.48rem 0.9rem;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.dense-button:last-child {
  border-bottom: none;
}

.dense-button:hover,
.dense-button.is-selected {
  background: #f4f8fc;
}

.dense-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.88rem;
}

.dense-button div:not(.dense-title) {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.8rem;
}

.dense-table-agencies .dense-row {
  grid-template-columns: minmax(0, 1fr) 120px;
}

.dense-table-modal .dense-row {
  grid-template-columns: 84px minmax(0, 1.9fr) minmax(0, 1fr);
}

.commitment-card,
.browse-card {
  border: 1px solid rgba(18, 61, 111, 0.12);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  padding: 0.95rem 1rem;
}

.commitment-card {
  cursor: pointer;
}

.commitment-card:hover,
.commitment-card.is-selected,
.browse-card:hover {
  border-color: rgba(18, 61, 111, 0.28);
  transform: translateY(-1px);
}

.commitment-card h3,
.browse-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.06rem;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  background: var(--panel);
  font-size: 0.75rem;
  color: var(--ny-blue-deep);
}

.meta-pill.gold {
  background: rgba(216, 161, 52, 0.16);
}

.meta-pill.blue {
  background: rgba(18, 61, 111, 0.12);
}

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

.detail-empty {
  min-height: 18rem;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.detail-title {
  margin: 0 0 0.7rem;
  font-size: 1.45rem;
  line-height: 1.05;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}

.detail-id {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
}

.modal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.back-button,
.inline-link {
  border: none;
  background: transparent;
  color: var(--ny-blue);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.back-button {
  width: 2.1rem;
  height: 2.1rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(18, 61, 111, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  font-size: 1.15rem;
  text-decoration: none;
}

.back-button:hover,
.inline-link:hover {
  color: var(--ny-blue-deep);
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}

.modal-shell.is-open {
  display: block;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 22, 42, 0.48);
  backdrop-filter: blur(3px);
}

.detail-modal {
  position: relative;
  width: min(760px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 2rem);
  margin: 1rem auto;
  overflow: auto;
  border: 1px solid rgba(18, 61, 111, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 28px 72px rgba(10, 28, 54, 0.28);
}

.detail-modal.is-wide {
  width: min(1080px, calc(100vw - 1.5rem));
}

.modal-close {
  position: sticky;
  top: 0.9rem;
  float: right;
  margin: 0.9rem 0.9rem 0 0;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid rgba(18, 61, 111, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ny-blue-deep);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.modal-close:hover {
  background: var(--panel);
}

.detail-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.detail-block h3 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ny-blue);
}

.blurb-text p {
  margin: 0 0 0.9rem;
  line-height: 1.45;
}

.blurb-text p:last-child {
  margin-bottom: 0;
}

.blurb-text mark {
  background: rgba(216, 161, 52, 0.28);
  color: inherit;
  padding: 0 0.08rem;
  border-radius: 0.18rem;
}

.line-field {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.18rem 0;
}

.line-label {
  color: var(--muted);
}

.subgoal-list {
  margin: 0;
  padding-left: 1.2rem;
}

.subgoal-list li {
  margin-bottom: 0.55rem;
  line-height: 1.4;
}

.subgoal-list li:last-child {
  margin-bottom: 0;
}

.source-line {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.source-sep {
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.detail-grid dl,
.detail-list {
  margin: 0;
}

.detail-grid dt,
.detail-list dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.detail-grid dd,
.detail-list dd {
  margin: 0.2rem 0 0;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.analysis-card {
  border: 1px solid rgba(18, 61, 111, 0.1);
  border-radius: 16px;
  padding: 1rem;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.bar-list {
  display: grid;
  gap: 0.5rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 1fr 3fr auto;
  gap: 0.65rem;
  align-items: center;
}

.bar-track {
  height: 0.6rem;
  border-radius: 999px;
  background: #e6edf6;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ny-blue), #3a79b5);
  border-radius: inherit;
}

.empty-state {
  padding: 1.5rem;
  border-radius: 16px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.site-note {
  position: fixed;
  right: 14px;
  bottom: 10px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.34rem 0.55rem;
  border: 1px solid rgba(18, 61, 111, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(10, 28, 54, 0.1);
  font-size: 0.69rem;
  color: #728094;
}

.site-note strong {
  color: var(--ny-blue-deep);
}

@media (max-width: 1220px) {
  .layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

@media (max-width: 880px) {
  .header-inner {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    position: static;
  }

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

  .dense-row,
  .dense-table-modal .dense-row {
    grid-template-columns: 68px minmax(0, 1.5fr) minmax(0, 0.9fr);
  }

  .dense-head > :nth-child(3),
  .dense-head > :nth-child(4),
  .dense-head > :nth-child(5),
  .dense-head > :nth-child(6),
  .dense-button > :nth-child(3),
  .dense-button > :nth-child(4),
  .dense-button > :nth-child(5),
  .dense-button > :nth-child(6) {
    display: none;
  }

  .dense-table-agencies .dense-head > :nth-child(2),
  .dense-table-agencies .dense-button > :nth-child(2) {
    display: block;
  }

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

  .line-field {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .site-note {
    right: 10px;
    left: 10px;
    bottom: 10px;
    justify-content: center;
    text-align: center;
  }

  .detail-modal {
    width: calc(100vw - 1rem);
    margin: 0.5rem auto;
    max-height: calc(100vh - 1rem);
  }
}
