:root {
  --bg: #f4f7fa;
  --surface: #fff;
  --surface-soft: #eef4f6;
  --ink: #17212b;
  --muted: #657383;
  --line: #dbe3ea;
  --line-strong: #c4d0da;
  --teal: #087f8c;
  --teal-soft: #e4f4f5;
  --amber: #b66a12;
  --amber-soft: #fff3df;
  --green: #2d8a5b;
  --blue: #316f9d;
  --red: #a33c35;
  --shadow: 0 18px 45px rgba(23, 33, 43, 0.08);
  --radius: 8px;
  --sidebar: 248px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

h1 {
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
  font-weight: 780;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
  font-weight: 760;
}

h3 {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 760;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 640;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-button {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  color: var(--ink);
  background: var(--surface-soft);
}

.sidebar-panel,
.section,
.card,
.reader,
.split-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(23, 33, 43, 0.02);
}

.sidebar-panel {
  margin-top: auto;
  padding: 14px;
}

.source-list,
.tag-row,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-list {
  margin-top: 12px;
}

.source-list span,
.tag,
.status,
.trend {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 8px;
  white-space: nowrap;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.eyebrow,
.label {
  margin: 0;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.select-wrap select,
.field,
.search-wrap input,
textarea {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 11px;
  outline: none;
}

textarea.field {
  min-height: 86px;
  padding: 10px 11px;
  resize: vertical;
}

.select-wrap select:focus,
.field:focus,
.search-wrap input:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 127, 140, 0.12);
}

.search-wrap {
  min-width: min(330px, 100%);
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}

.search-wrap input {
  width: 100%;
  min-height: auto;
  border: 0;
  padding: 0;
  box-shadow: none;
}

.button {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 780;
  white-space: nowrap;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(23, 33, 43, 0.08);
}

.button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.button.secondary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.button.ghost {
  color: var(--teal);
}

.page-root {
  display: grid;
  gap: 16px;
}

.section {
  padding: 18px;
  min-width: 0;
}

.section.compact {
  padding: 16px;
}

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

.section-heading h2 {
  margin-top: 5px;
}

.lead {
  max-width: 780px;
  color: #394755;
  font-size: 18px;
  line-height: 1.55;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.value-panel,
.whiteboard-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
}

.value-panel {
  min-height: 258px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.whiteboard-card {
  padding: 10px;
}

.whiteboard-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: block;
}

.whiteboard-card div {
  padding: 12px 2px 0;
}

.pipeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) 34px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.pipeline > div {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fafcfd;
  padding: 13px;
}

.pipe-label {
  display: block;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}

.pipe-arrow {
  position: relative;
  height: 1px;
  background: var(--line-strong);
}

.pipe-arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -4px;
  width: 8px;
  height: 8px;
  border-right: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
  transform: rotate(45deg);
}

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

.metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
  min-height: 126px;
}

.metric-top,
.item-head,
.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.metric-icon {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: grid;
  place-items: center;
}

.metric-icon.teal {
  background: var(--teal-soft);
  color: var(--teal);
}

.metric-icon.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.metric-value {
  display: block;
  margin: 16px 0 6px;
  font-size: 30px;
  line-height: 1;
  font-weight: 820;
}

.muted,
.metric-card p,
.card p,
.reader p,
.timeline p,
.team-member p,
.owner-row span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.stack,
.right-rail,
.list,
.form-stack {
  display: grid;
  gap: 12px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.team-hero,
.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: stretch;
}

.team-hero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
}

.profile-layout {
  grid-template-columns: 380px minmax(0, 1fr);
}

.team-hero > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.team-hero img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.card,
.reader,
.split-panel {
  padding: 14px;
  min-width: 0;
}

.click-card {
  cursor: pointer;
  transition: 140ms ease;
}

.click-card:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(23, 33, 43, 0.07);
}

.type-pill {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.type-release,
.type-feature {
  background: var(--teal-soft);
  color: var(--teal);
}

.type-fix {
  background: #eef2ff;
  color: var(--blue);
}

.type-spike,
.type-wissen {
  background: var(--amber-soft);
  color: var(--amber);
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 13px;
}

.segmented {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fafb;
  padding: 3px;
}

.segment-button {
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.segment-button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 5px rgba(23, 33, 43, 0.08);
}

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

.chart-panel {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 14px;
  min-height: 250px;
}

.chart-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 18px;
}

.bar-chart {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.bar-track,
.progress-track {
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.bar-track {
  height: 12px;
}

.progress-track {
  height: 7px;
}

.bar-fill,
.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #59aeb6);
}

.line-chart {
  width: 100%;
  height: 210px;
}

.grid-line {
  stroke: #edf1f4;
  stroke-width: 1;
}

.line-path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.muted-line {
  stroke: #bdc9d4;
  stroke-dasharray: 6 6;
}

.active-line {
  stroke: var(--teal);
}

.line-chart circle {
  fill: var(--teal);
}

.note-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.note {
  min-height: 124px;
  border: 1px solid rgba(182, 106, 18, 0.28);
  border-radius: 7px;
  background: #fff8e9;
  padding: 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 8px 18px rgba(182, 106, 18, 0.08);
}

.note:nth-child(2n) {
  background: #eaf8f8;
  border-color: rgba(8, 127, 140, 0.22);
}

.note p {
  font-size: 14px;
  line-height: 1.45;
}

.note small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.form-inline {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.team-member {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 820;
  background: var(--avatar-bg, var(--teal));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.avatar-photo,
.profile-avatar {
  background-color: var(--avatar-bg, var(--teal));
  background-image: url("/assets/team-avatars-gpt.png");
  background-size: 400% 200%;
  background-position: var(--avatar-pos, 0% 0%);
  background-repeat: no-repeat;
}

.avatar-photo span,
.profile-avatar span {
  opacity: 0;
}

.credits {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.profile-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.profile-card p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.profile-avatar {
  width: 148px;
  height: 148px;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

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

.owner-row {
  display: grid;
  gap: 8px;
}

.reader {
  min-height: 420px;
}

.reader-body {
  display: grid;
  gap: 18px;
}

.reader-section {
  display: grid;
  gap: 8px;
}

.reader-section ul {
  margin: 0;
  padding-left: 20px;
  color: #394755;
  line-height: 1.6;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  padding: 18px;
  color: var(--muted);
  background: #fbfcfd;
}

.icon {
  width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 17px;
}

.icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  transform: translateY(120px);
  opacity: 0;
  transition: 180ms ease;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  padding: 11px 13px;
  font-size: 13px;
  font-weight: 760;
  box-shadow: var(--shadow);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 1180px) {
  .content-grid,
  .hero-grid,
  .two-col,
  .team-hero,
  .profile-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    justify-content: stretch;
  }

  .toolbar > *,
  .button,
  .search-wrap {
    width: 100%;
  }

  .metric-grid,
  .three-col,
  .charts-grid,
  .note-board,
  .right-rail {
    grid-template-columns: 1fr;
  }

  .form-inline,
  .pipeline,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .pipe-arrow {
    display: none;
  }
}

@media (max-width: 560px) {
  .main,
  .sidebar {
    padding: 16px;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
