:root {
  --paper: #f3f1eb;
  --panel: #fffdf8;
  --ink: #25312b;
  --muted: #69736d;
  --line: #d7d1c5;
  --green: #3f7654;
  --green-soft: #e6efe8;
  --blue: #477b9d;
  --blue-soft: #e7f0f5;
  --gold: #b97820;
  --gold-soft: #f5ead8;
  --wine: #914f5a;
  --wine-soft: #f4e5e8;
  --gray-soft: #ebe9e3;
  --shadow: 0 12px 32px rgba(47, 43, 34, 0.09);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(71, 123, 157, 0.35);
  outline-offset: 2px;
}

a {
  color: var(--blue);
  text-decoration: none;
}

h1,
h2,
h3,
p,
blockquote {
  margin: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.topbar h1 {
  font-size: 1.45rem;
}

.topbar > div > p:last-child {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.eyebrow,
.section-kicker {
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.topbar-actions a,
.focus-band > a {
  display: grid;
  min-height: 42px;
  padding: 9px 13px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.78rem;
  font-weight: 800;
}

.music-intro {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--wine);
  background: var(--wine-soft);
}

.music-note-mark {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--wine);
  color: white;
  font-size: 1.35rem;
}

.music-intro p,
.music-version-card p,
.orchestration-note p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.music-version-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.music-version-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
}

.music-version-card.current {
  border-color: rgba(63, 118, 84, 0.55);
  box-shadow: inset 0 4px 0 var(--green);
}

.music-version-card.citrus-current {
  border-color: rgba(185, 120, 32, 0.62);
  box-shadow: inset 0 4px 0 var(--gold);
  background: #fffdf5;
}

.music-version-card.source-recording {
  border-color: rgba(145, 79, 90, 0.48);
  box-shadow: inset 0 4px 0 var(--wine);
  background: #fffafa;
}

.music-version-card.rejected-experiment {
  border-style: dashed;
  background: #f7f5f0;
}

.music-version-card.rejected-experiment header span {
  color: #8a5b50;
}

.music-version-card header {
  display: grid;
  gap: 4px;
}

.music-version-card header span,
.music-version-card footer,
.orchestration-note small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.music-version-card audio {
  width: 100%;
  min-height: 42px;
}

.music-version-card footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.orchestration-note {
  margin-top: 14px;
  padding: 16px;
  border-top: 4px solid var(--green);
  background: var(--green-soft);
}

.score-sheet {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f1;
}

.score-sheet > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.score-sheet > header div {
  display: grid;
  gap: 3px;
}

.score-sheet > header span,
.score-sheet > header a {
  color: var(--wine);
  font-size: 0.7rem;
  font-weight: 900;
}

.score-sheet > p {
  margin: 10px 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.numbered-score {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.numbered-score section {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 12px;
  background: white;
}

.numbered-score b {
  color: var(--green);
  font-size: 0.76rem;
}

.numbered-score span {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
}

.orchestration-note > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.orchestration-note > div span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 0.75rem;
  font-weight: 900;
}

.orchestration-note ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 13px 0;
  padding: 0;
  list-style: none;
}

.orchestration-note li {
  display: grid;
  gap: 2px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.58);
}

.orchestration-note li span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .music-version-grid,
  .orchestration-note ul {
    grid-template-columns: 1fr;
  }

  .score-sheet > header,
  .music-version-card footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .numbered-score section {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}

.primary-link {
  border-color: var(--green) !important;
  background: var(--green);
  color: white;
}

.workspace {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  width: min(1240px, calc(100% - 32px));
  margin: 20px auto 40px;
  gap: 16px;
  align-items: start;
}

.view-tabs {
  position: sticky;
  top: 16px;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.view-tabs button {
  min-height: 48px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 0.82rem;
  font-weight: 800;
}

.view-tabs button:last-child {
  border-bottom: 0;
}

.view-tabs button.active {
  box-shadow: inset 4px 0 0 var(--green);
  background: var(--green-soft);
  color: var(--green);
}

main {
  min-width: 0;
}

.view-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.section-heading h2 {
  margin-top: 3px;
  font-size: 1.12rem;
}

.section-heading.compact {
  align-items: center;
  margin-bottom: 12px;
}

.section-heading.compact span,
.section-heading a {
  color: var(--muted);
  font-size: 0.75rem;
}

.phase-badge,
.status-tag {
  padding: 5px 8px;
  border-radius: 5px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 900;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.status-grid article {
  display: grid;
  gap: 3px;
  min-height: 78px;
  padding: 14px;
  border-right: 1px solid var(--line);
  align-content: center;
}

.status-grid article:last-child {
  border-right: 0;
}

.status-grid strong {
  font-size: 1.35rem;
}

.status-grid span {
  color: var(--muted);
  font-size: 0.72rem;
}

.focus-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 14px 0;
  padding: 16px;
  border-left: 5px solid var(--gold);
  background: var(--gold-soft);
}

.focus-band h3 {
  margin: 4px 0 5px;
  font-size: 0.94rem;
}

.focus-band p:last-child {
  color: #6c5b42;
  font-size: 0.78rem;
  line-height: 1.45;
}

.focus-band > a {
  flex: 0 0 auto;
  border-color: rgba(185, 120, 32, 0.45);
  color: #775019;
}

.overview-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 14px;
}

.overview-columns > section {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

blockquote {
  padding: 12px;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
  font-size: 0.84rem;
  line-height: 1.5;
}

.principle-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.principle-list li {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 9px;
  font-size: 0.76rem;
}

.principle-list span,
.doc-list span {
  color: var(--muted);
}

.doc-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.doc-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 0.76rem;
}

.library-note {
  color: var(--muted);
  font-size: 0.74rem;
}

.document-library {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 22px;
}

.library-group {
  min-width: 0;
  border-top: 3px solid var(--green);
}

.library-group:nth-child(2) {
  grid-row: span 2;
  border-top-color: var(--gold);
}

.library-group:nth-child(3) {
  border-top-color: var(--blue);
}

.library-group:nth-child(4) {
  border-top-color: var(--wine);
}

.library-group header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 2px 8px;
  border-bottom: 1px solid var(--line);
}

.library-group header strong {
  font-size: 0.86rem;
}

.library-group header span {
  color: var(--muted);
  font-size: 0.68rem;
}

.library-group > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.library-group > a:hover strong,
.library-group > a:focus-visible strong {
  color: var(--green);
}

.library-group > a > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.library-group > a strong {
  font-size: 0.78rem;
}

.library-group > a small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-group > a b {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 0.67rem;
}

.roadmap-filters,
.research-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.roadmap-filters button,
.research-filters button {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.roadmap-filters button.active,
.research-filters button.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.roadmap-list,
.research-list {
  display: grid;
  gap: 7px;
}

.roadmap-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 130px;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.roadmap-item h3 {
  font-size: 0.82rem;
}

.roadmap-item p {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.roadmap-item .status-tag {
  justify-self: end;
}

.status-tag.current {
  background: var(--green-soft);
  color: var(--green);
}

.status-tag.later {
  background: var(--blue-soft);
  color: var(--blue);
}

.status-tag.explore {
  background: var(--gold-soft);
  color: var(--gold);
}

.status-tag.deferred {
  background: var(--gray-soft);
  color: #686862;
}

.status-tag.no {
  background: var(--wine-soft);
  color: var(--wine);
}

.research-total {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.research-total strong {
  font-size: 1.2rem;
}

.research-total span {
  color: var(--muted);
  font-size: 0.72rem;
}

.research-progress {
  height: 8px;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--gray-soft);
}

.research-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 180ms ease;
}

.research-item {
  display: grid;
  grid-template-columns: 28px 34px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.research-item.completed {
  background: var(--green-soft);
}

.research-item input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.priority-mark {
  display: grid;
  width: 28px;
  height: 24px;
  place-items: center;
  border-radius: 5px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 900;
}

.research-copy {
  display: grid;
  gap: 3px;
}

.research-copy strong {
  font-size: 0.8rem;
}

.research-copy span {
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.4;
}

.research-item > a {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
}

.research-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
}

.research-footer button {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--wine);
  font-size: 0.72rem;
  font-weight: 800;
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-entry {
  display: grid;
  grid-template-columns: 105px 16px minmax(0, 1fr);
  gap: 11px;
}

.timeline-date {
  padding-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.timeline-rail {
  position: relative;
  min-height: 100%;
  border-left: 2px solid var(--line);
}

.timeline-rail::before {
  content: "";
  position: absolute;
  top: 2px;
  left: -6px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.timeline-copy {
  padding: 0 0 22px;
}

.timeline-copy h3 {
  margin-bottom: 5px;
  font-size: 0.86rem;
}

.timeline-copy p {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

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

  .view-tabs {
    position: static;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .view-tabs button {
    border-right: 1px solid var(--line);
    border-bottom: 0;
    text-align: center;
  }

  .view-tabs button.active {
    box-shadow: inset 0 -4px 0 var(--green);
  }

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

  .document-library {
    grid-template-columns: 1fr;
  }

  .library-group:nth-child(2) {
    grid-row: auto;
  }

  .roadmap-item {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .roadmap-item .status-tag {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 600px) {
  .topbar,
  .section-heading,
  .focus-band,
  .research-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    padding: 16px;
  }

  .workspace {
    width: calc(100% - 18px);
    margin-top: 10px;
  }

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

  .view-tabs button {
    border-bottom: 1px solid var(--line);
  }

  .view-panel {
    padding: 14px;
  }

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

  .status-grid article:nth-child(2) {
    border-right: 0;
  }

  .status-grid article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .roadmap-item,
  .research-item,
  .timeline-entry {
    grid-template-columns: 1fr;
  }

  .research-item {
    position: relative;
    padding-left: 44px;
  }

  .research-item input {
    position: absolute;
    top: 12px;
    left: 12px;
  }

  .timeline-rail {
    display: none;
  }
}
