:root {
  --bg: #f5f6f1;
  --surface: #ffffff;
  --surface-muted: #eef1eb;
  --ink: #18201d;
  --muted: #65716b;
  --line: #d8ded4;
  --line-strong: #b9c3b3;
  --teal: #007f78;
  --blue: #355cc9;
  --amber: #a35d00;
  --red: #b33232;
  --green: #2c7d45;
  --purple: #7652a6;
  --shadow: 0 12px 32px rgba(35, 43, 38, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 96px;
  padding: 20px 28px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcf8;
}

.brand-block {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2.6vw, 2.45rem);
  line-height: 1.05;
  font-weight: 780;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.05rem;
}

h3 {
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.icon-button,
.icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
}

.icon-button:hover,
.icon-link:hover,
.text-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

.icon-button svg,
.icon-link svg,
.text-button svg,
.search-wrap svg,
.empty-detail svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr) minmax(300px, 380px);
  gap: 18px;
  padding: 18px;
}

.filters-panel,
.detail-panel {
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.filters-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.filter-section {
  margin-top: 18px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.segmented button,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  color: var(--ink);
  text-align: left;
}

.segmented button.active,
.chip.active {
  border-color: #4f827d;
  background: #e4f2ee;
  color: #073d38;
}

.chip-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chip-list.compact {
  gap: 5px;
}

.chip-count {
  color: var(--muted);
  font-size: 0.78rem;
}

.content-panel {
  min-width: 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric-value {
  margin-bottom: 8px;
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 800;
}

.metric-label {
  color: var(--muted);
  font-size: 0.8rem;
}

.visual-band,
.insight-section,
.xrpl-section,
.project-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.visual-band,
.insight-section,
.xrpl-section {
  margin-bottom: 14px;
  overflow: hidden;
}

.band-header,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.band-header p,
.section-heading p,
.xrpl-lede p,
.pod-item p,
.xrpl-card p {
  line-height: 1.45;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  color: var(--ink);
  white-space: nowrap;
}

.viz-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 0.8fr);
  gap: 0;
}

.chart-panel {
  min-height: 220px;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.chart-panel:last-child {
  border-right: 0;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(74px, 112px) 1fr 28px;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  font-size: 0.78rem;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--teal);
}

.capability-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.capability-tile {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.capability-tile strong {
  display: block;
  margin-bottom: 7px;
  font-size: 0.8rem;
}

.capability-tile span {
  color: var(--muted);
  font-size: 0.78rem;
}

.sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.sort-wrap select {
  min-height: 34px;
  max-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  color: var(--ink);
}

.view-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(78px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.view-tabs button {
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
}

.view-tabs button.active {
  background: var(--ink);
  color: #ffffff;
}

.signal-content {
  padding: 14px;
}

.xrpl-content {
  padding: 14px;
}

.xrpl-summary {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.xrpl-lede {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.xrpl-lede p {
  margin-bottom: 14px;
  color: #39433d;
  font-size: 0.9rem;
}

.xrpl-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.xrpl-stats span {
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.76rem;
}

.xrpl-stats strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 1.18rem;
}

.pod-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pod-item,
.xrpl-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.pod-item {
  min-height: 150px;
  padding: 12px;
}

.pod-item h3,
.xrpl-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.pod-item p {
  margin: 8px 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.xrpl-workstream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.xrpl-card {
  display: flex;
  flex-direction: column;
  min-height: 330px;
  padding: 13px;
}

.xrpl-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.xrpl-card h3 {
  font-size: 0.98rem;
  line-height: 1.2;
}

.fit-pill {
  flex: 0 0 auto;
  max-width: 120px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #e4f2ee;
  color: #073d38;
  font-size: 0.7rem;
  font-weight: 760;
  text-align: center;
}

.xrpl-need {
  margin-bottom: 12px;
  color: #39433d;
  font-size: 0.84rem;
}

.detail-block {
  margin-top: 10px;
}

.detail-block strong {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.xrpl-caveat {
  margin: auto 0 0;
  padding-top: 12px;
  color: var(--amber);
  font-size: 0.78rem;
}

.people-grid,
.release-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.person-card,
.release-card,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.person-card,
.release-card {
  min-height: 146px;
  padding: 12px;
}

.person-top,
.release-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.person-name,
.release-name {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.mini-stat {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #e4f2ee;
  color: #073d38;
  font-size: 0.72rem;
  font-weight: 750;
}

.person-meta,
.release-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

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

.timeline-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 12px;
}

.timeline-date {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.timeline-title {
  margin: 0 0 5px;
  font-size: 0.92rem;
}

.timeline-text {
  margin: 0;
  color: #39433d;
  font-size: 0.82rem;
  line-height: 1.4;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
  padding: 14px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 286px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  text-align: left;
}

.project-card:hover,
.project-card.active {
  border-color: #4f827d;
  box-shadow: var(--shadow);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.project-title {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1.02rem;
  line-height: 1.2;
}

.status-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.high,
.status-dot.live {
  background: var(--green);
}

.status-dot.medium-high,
.status-dot.public {
  background: var(--blue);
}

.status-dot.medium,
.status-dot.partial {
  background: var(--amber);
}

.status-dot.low-medium,
.status-dot.internal {
  background: var(--red);
}

.meta-line {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.summary {
  display: -webkit-box;
  flex: 1;
  margin-bottom: 12px;
  overflow: hidden;
  color: #39433d;
  font-size: 0.86rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: #39433d;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.detail-panel {
  min-height: calc(100vh - 36px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.empty-detail {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-detail p {
  max-width: 260px;
  margin-bottom: 0;
  line-height: 1.45;
}

.detail-content {
  padding: 16px;
}

.detail-content.hidden,
.hidden {
  display: none;
}

.detail-kicker {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.detail-content h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
}

.detail-summary {
  color: #39433d;
  font-size: 0.92rem;
  line-height: 1.48;
}

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

.detail-section ul {
  margin: 0;
  padding-left: 18px;
}

.detail-section li {
  margin-bottom: 7px;
  color: #39433d;
  font-size: 0.86rem;
  line-height: 1.42;
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.source-link {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  color: var(--ink);
  font-size: 0.8rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.source-link:hover {
  border-color: var(--line-strong);
}

.repo-table {
  display: grid;
  gap: 8px;
}

.repo-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.repo-row a {
  font-size: 0.82rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.repo-row span {
  color: var(--muted);
  font-size: 0.75rem;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(24, 32, 29, 0.32);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.dialog-head h2 {
  margin: 0;
}

.gaps-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.gap-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.gap-item h3 {
  margin-bottom: 6px;
}

.gap-item p {
  margin-bottom: 8px;
  color: #39433d;
  font-size: 0.86rem;
  line-height: 1.45;
}

.gap-severity {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 0.74rem;
  font-weight: 750;
  text-transform: uppercase;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  }

  .detail-panel {
    position: static;
    grid-column: 1 / -1;
    min-height: 0;
    max-height: none;
  }
}

@media (max-width: 860px) {
  .topbar {
    padding: 16px;
  }

  .workspace {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .filters-panel {
    position: static;
    max-height: none;
  }

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

  .chip-list,
  .chip-list.compact {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .chip {
    width: auto;
    max-width: 100%;
  }

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

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

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

  .chart-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chart-panel:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 560px) {
  .topbar {
    align-items: flex-start;
  }

  .band-header,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .view-tabs {
    width: 100%;
  }

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

  .capability-map {
    grid-template-columns: 1fr;
  }

  .pod-list,
  .xrpl-stats,
  .xrpl-workstream-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }
}
