:root {
  color-scheme: dark;
  --bg: #05070b;
  --panel: #0d141d;
  --panel-2: #111c28;
  --line: #203040;
  --text: #edf7ff;
  --muted: #91a5b8;
  --blue: #38d7ff;
  --blue-2: #1d79ff;
  --violet: #8a68ff;
  --danger: #ff6d7a;
}

* {
  box-sizing: border-box;
}

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

body.plain-paper-light {
  color-scheme: light;
  --bg: #f5f7f2;
  --panel: #ffffff;
  --panel-2: #f7fbff;
  --line: #d7dfdc;
  --text: #17222b;
  --muted: #62727d;
  --blue: #0b7fa4;
  --blue-2: #2e6eea;
  --violet: #6673dc;
  background:
    linear-gradient(180deg, rgba(236, 248, 250, 0.86), rgba(250, 249, 243, 0.96) 42%, #f5f7f2),
    var(--bg);
}

body.plain-paper-light {
  height: 100vh;
  overflow: hidden;
}

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

button,
input {
  font: inherit;
}

.public-login {
  background:
    radial-gradient(circle at 50% 15%, rgba(36, 190, 255, 0.14), transparent 32rem),
    #030509;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(380px, 100%);
  border: 1px solid rgba(73, 218, 255, 0.28);
  background: rgba(7, 13, 22, 0.9);
  padding: 28px;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.login-mark {
  width: 74px;
  height: 74px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  margin-bottom: 20px;
}

.login-panel h1 {
  font-size: 38px;
  margin: 0;
}

.login-panel p {
  margin: 6px 0 24px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.login-form input {
  width: 100%;
  border: 1px solid var(--line);
  background: #070b11;
  color: var(--text);
  padding: 12px;
  border-radius: 6px;
}

.login-form button,
.topbar button {
  border: 0;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #001018;
  font-weight: 700;
  padding: 11px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.flash {
  border: 1px solid rgba(255, 109, 122, 0.45);
  background: rgba(255, 109, 122, 0.09);
  color: #ffd8dd;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 14px;
}

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 11, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.topbar form {
  margin: 0;
}

.topbar button {
  padding: 8px 10px;
}

.plain-paper-light .topbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(37, 51, 60, 0.08);
}

.plain-paper-light .topbar button {
  color: #ffffff;
}

.team-app-frame {
  height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  overflow: hidden;
}

.team-sidebar {
  min-height: 0;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  box-shadow: 18px 0 48px rgba(37, 51, 60, 0.08);
}

.team-sidebar-head {
  padding: 22px 20px 16px;
  border-bottom: 1px solid var(--line);
}

.team-sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  font-size: 20px;
}

.team-sidebar-brand img,
.team-person-link img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
  flex: 0 0 auto;
}

.team-sidebar-head p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.team-nav {
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px 24px;
}

.team-nav-section {
  display: grid;
  gap: 7px;
  margin-bottom: 22px;
}

.team-nav-section h2 {
  margin: 0 0 3px;
  padding: 0 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.team-nav-link,
.team-person-link {
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
}

.team-nav-link {
  display: block;
  padding: 9px 10px;
  font-size: 14px;
}

.team-nav-link:hover,
.team-person-link:hover,
.team-person-link.active {
  border-color: var(--line);
  background: rgba(246, 251, 255, 0.95);
  color: var(--text);
}

.team-person-link {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 7px;
}

.team-person-link strong,
.team-person-link small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-person-link strong {
  color: var(--text);
  font-size: 14px;
}

.team-person-link small,
.team-nav-empty {
  color: var(--muted);
  font-size: 12px;
}

.team-nav-empty {
  margin: 0;
  padding: 8px;
}

.team-sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.team-sidebar-foot a {
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
}

.team-sidebar-foot form {
  margin: 0;
}

.team-sidebar-foot button {
  border: 0;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  color: #ffffff;
  font-weight: 800;
  padding: 9px 11px;
  border-radius: 6px;
  cursor: pointer;
}

.team-main-scroll {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 38px clamp(24px, 5vw, 70px) 72px;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 70px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 28px;
}

.plain-paper-light .page-head,
.plain-paper-light .section {
  scroll-margin-top: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  font-size: 42px;
  margin: 0;
}

h2 {
  font-size: 22px;
  margin: 0;
}

h3 {
  margin: 0;
}

.lede {
  color: var(--muted);
  max-width: 680px;
  line-height: 1.55;
}

.user-chip {
  border: 1px solid var(--line);
  padding: 8px 11px;
  border-radius: 6px;
  color: var(--muted);
}

.wordmark {
  width: 150px;
  height: 70px;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
  opacity: 0.9;
}

.plain-paper-light .wordmark {
  opacity: 0.72;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}

.metric,
.note-panel,
.doc-item,
.person-card,
.team-row,
.detail-grid section {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 28, 40, 0.96), rgba(10, 15, 22, 0.96));
  border-radius: 8px;
}

.plain-paper-light .metric,
.plain-paper-light .note-panel,
.plain-paper-light .doc-item,
.plain-paper-light .person-card,
.plain-paper-light .team-row,
.plain-paper-light .detail-grid section {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 16px 40px rgba(37, 51, 60, 0.08);
}

.metric {
  padding: 18px;
}

.metric span,
.doc-item span,
.role {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: 28px;
  margin-top: 8px;
}

.section {
  margin-top: 30px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 14px;
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.team-list,
.doc-list {
  display: grid;
  gap: 12px;
}

.team-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
}

.team-row p,
.person-card p,
.doc-item p,
.note-panel p,
.detail-grid p {
  color: var(--muted);
  line-height: 1.5;
}

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

.person-card {
  min-height: 210px;
  overflow: hidden;
  padding: 0;
  display: grid;
  align-content: start;
  gap: 0;
}

.person-card > div {
  padding: 16px;
}

.person-avatar {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  display: block;
  object-fit: cover;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}

.avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: #030509;
  font-weight: 900;
}

.avatar.large {
  width: 86px;
  height: 86px;
  font-size: 38px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.75fr);
  gap: 18px;
}

.doc-item,
.note-panel {
  padding: 18px;
}

.member-detail {
  max-width: 860px;
}

.back-link {
  display: inline-block;
  color: var(--muted);
  margin-bottom: 24px;
}

.member-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.member-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(37, 51, 60, 0.14);
  flex: 0 0 auto;
}

.detail-grid {
  display: grid;
  gap: 14px;
}

.detail-grid section,
.empty-state {
  padding: 22px;
}

.sprint-room {
  display: grid;
  gap: 24px;
}

.sprint-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 20px;
  align-items: start;
}

.sprint-status-panel,
.sprint-metrics article,
.activity-item,
.task-card,
.agent-status {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(37, 51, 60, 0.08);
}

.sprint-status-panel {
  padding: 18px;
  display: grid;
  gap: 7px;
}

.sprint-status-panel span,
.sprint-status-panel small,
.sprint-metrics span,
.activity-item span,
.task-card span {
  color: var(--muted);
  font-size: 12px;
}

.sprint-status-panel strong {
  font-size: 26px;
  text-transform: capitalize;
}

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

.sprint-metrics article {
  padding: 15px;
}

.sprint-metrics strong {
  display: block;
  font-size: 30px;
  margin-top: 6px;
}

.sprint-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.sprint-grid.lower {
  margin-top: 2px;
}

.sprint-column {
  min-width: 0;
}

.section-head.compact {
  align-items: center;
  margin-bottom: 10px;
}

.activity-feed,
.task-board,
.agent-status-list,
.artifact-stream,
.review-list,
.decision-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}

.activity-item,
.task-card,
.agent-status {
  padding: 14px;
}

.activity-item h3,
.task-card h3,
.agent-status h3 {
  font-size: 16px;
}

.task-card {
  border-left-width: 5px;
}

.task-card.open {
  border-left-color: #0b7fa4;
}

.task-card.claimed {
  border-left-color: #d58b25;
}

.task-card.complete {
  border-left-color: #3a9d67;
}

.agent-status {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.agent-status img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 50%;
}

.agent-status p,
.task-card p,
.activity-item p {
  color: var(--muted);
  margin: 5px 0 0;
}

.agent-status span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.empty-state {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
}

@media (max-width: 860px) {
  body.plain-paper-light {
    height: auto;
    overflow: auto;
  }

  .team-app-frame {
    min-height: 100vh;
    height: auto;
    display: block;
    overflow: visible;
  }

  .team-sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: block;
    max-height: 58vh;
    overflow-y: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .team-sidebar-head {
    padding: 16px;
  }

  .team-nav {
    overflow: visible;
    padding: 12px;
  }

  .team-nav-section {
    margin-bottom: 14px;
  }

  .team-sidebar-foot {
    position: sticky;
    bottom: 0;
  }

  .team-main-scroll {
    height: auto;
    overflow: visible;
    padding: 28px 20px 60px;
  }

  .topbar {
    height: auto;
    padding: 16px;
    align-items: flex-start;
    gap: 14px;
  }

  .topbar nav {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .page-head,
  .section-head,
  .team-row {
    display: grid;
  }

  .status-grid,
  .people-grid,
  .two-col,
  .sprint-hero,
  .sprint-grid {
    grid-template-columns: 1fr;
  }

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

  .member-hero {
    display: grid;
  }

  .member-photo {
    width: min(240px, 100%);
    height: auto;
    aspect-ratio: 1;
  }

  h1 {
    font-size: 34px;
  }
}
