:root {
  --ink: #17211d;
  --muted: #63706a;
  --line: #dce6e0;
  --paper: #f7faf8;
  --panel: #ffffff;
  --green: #2f8f5b;
  --teal: #16868a;
  --blue: #4568dc;
  --yellow: #d9961f;
  --red: #c94747;
  --violet: #7a4cc2;
  --shadow: 0 18px 45px rgba(23, 33, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(47, 143, 91, 0.14), transparent 34%),
    linear-gradient(315deg, rgba(69, 104, 220, 0.12), transparent 38%),
    var(--paper);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.public-hero {
  padding: 22px 24px 30px;
}

.public-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto 28px;
}

.public-brand,
.public-links,
.hero-actions,
.value-row {
  display: flex;
  align-items: center;
}

.public-brand {
  gap: 10px;
  font-weight: 900;
  color: var(--ink);
}

.public-brand img {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  object-position: center 35%;
  background: white;
}

.public-links {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--muted);
  font-weight: 800;
}

.public-links a {
  border-radius: 8px;
  padding: 9px 11px;
}

.public-links .nav-cta {
  color: white;
  background: var(--ink);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: 34px;
  align-items: center;
  max-width: 1440px;
  margin: 0 auto;
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 96px);
  line-height: 0.95;
  letter-spacing: 0;
  color: #061341;
}

.hero-subtitle {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

.hero-actions {
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.primary-link {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 11px 15px;
  color: white;
  background: var(--green);
  font-weight: 900;
}

.value-row {
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.value-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--ink);
  background: white;
  font-weight: 800;
}

.hero-logo-card {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
  box-shadow: var(--shadow);
}

.hero-logo-card img {
  width: min(100%, 380px);
  aspect-ratio: 1;
  object-fit: contain;
}

.demo-section {
  padding: 0 24px 28px;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  max-width: 1440px;
  min-height: 860px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  overflow: auto;
}

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

.brand-logo {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  object-position: center 35%;
  background: white;
}

.brand h1,
.topbar h2,
.section-head h3,
.report-header h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand h1 {
  font-size: 22px;
}

.brand p,
.topbar p,
.section-head p,
.report-header p,
.completion-note {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.language-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf4f0;
}

.lang-btn,
.tab {
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  padding: 9px 12px;
  font-weight: 700;
}

.lang-btn.active,
.tab.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 6px 16px rgba(23, 33, 29, 0.08);
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 28px rgba(23, 33, 29, 0.06);
}

.sidebar .panel {
  padding: 16px;
}

.panel-title,
.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.panel-title {
  margin-bottom: 14px;
  font-weight: 800;
}

.panel-title small {
  color: var(--teal);
  font-size: 12px;
}

.member-list,
.risk-list,
.role-library,
.signal-list,
.activity-list,
.completion-list,
.task-board,
.report-content {
  display: grid;
  gap: 10px;
}

.member-card,
.risk-card,
.signal-card,
.task-card,
.activity-card,
.completion-card,
.report-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.member-card {
  padding: 12px;
}

.member-top,
.task-top,
.activity-top,
.completion-card,
.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: white;
  font-weight: 800;
}

.person {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.person strong,
.task-top strong {
  display: block;
  overflow-wrap: anywhere;
}

.role-tag,
.status-tag,
.risk-tag {
  border-radius: 999px;
  padding: 5px 8px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.role-tag.leader { background: var(--green); }
.role-tag.foil { background: var(--red); }
.role-tag.expert { background: var(--blue); }
.role-tag.wildcard { background: var(--yellow); color: #3a2700; }
.role-tag.heart { background: #d85b8c; }
.role-tag.diplomat { background: var(--teal); }
.role-tag.skeptic { background: var(--violet); }
.role-tag.builder { background: #4d7f33; }
.role-tag.passive { background: #7b8580; }

.score-bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eee9;
  margin-top: 10px;
}

.score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--teal));
}

.role-metrics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.role-metrics span {
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  background: #eef4f1;
  font-size: 11px;
  font-weight: 700;
}

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

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

.topbar h2 {
  font-size: clamp(24px, 3vw, 36px);
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-btn,
.ghost-btn,
.dark-btn,
.send-btn,
.icon-btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
}

.primary-btn {
  color: white;
  background: var(--green);
}

.ghost-btn {
  color: var(--ink);
  border: 1px solid var(--line);
  background: white;
}

.dark-btn {
  color: white;
  background: var(--ink);
}

.grid {
  display: grid;
  grid-template-columns: minmax(460px, 1.15fr) minmax(380px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.chat-column,
.insight-column {
  min-width: 0;
}

.chat-column {
  display: grid;
  grid-template-rows: auto minmax(520px, calc(100vh - 210px)) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 28px rgba(23, 33, 29, 0.08);
  overflow: hidden;
}

.public-section {
  max-width: 1440px;
  margin: 0 auto;
  padding: 34px 24px 44px;
}

.section-copy {
  max-width: 760px;
  margin-bottom: 18px;
}

.section-copy h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

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

.public-cards article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: white;
  box-shadow: 0 12px 28px rgba(23, 33, 29, 0.06);
}

.public-cards strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.public-cards p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.public-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 24px 34px;
  color: var(--muted);
  font-weight: 800;
}

.section-head {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.section-head.compact {
  padding: 16px 16px 8px;
  border-bottom: 0;
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--teal);
  background: #eaf7f4;
  font-weight: 800;
  white-space: nowrap;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 6px rgba(22, 134, 138, 0.16);
}

.chat-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  padding: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='120' viewBox='0 0 180 120'%3E%3Cg fill='none' stroke='%23dce6e0' stroke-width='1'%3E%3Cpath d='M20 22h58v28H20zM102 18h42v42h-42zM32 78h72v20H32zM124 82h28v18h-28z'/%3E%3Cpath d='M78 36h24M104 88h20M62 50v28'/%3E%3C/g%3E%3C/svg%3E");
}

.message {
  display: flex;
  gap: 10px;
  max-width: 88%;
}

.message.self {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.bubble {
  padding: 12px 14px;
  border-radius: 8px;
  background: #edf4f0;
  line-height: 1.45;
}

.message.self .bubble {
  color: white;
  background: var(--green);
}

.message.ai {
  max-width: 94%;
}

.message.ai .bubble {
  border: 1px solid rgba(22, 134, 138, 0.26);
  color: #113f3f;
  background: #e9f8f6;
}

.meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 800;
}

.chat-form {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 90px;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: white;
}

.chat-form select,
.chat-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: white;
}

.send-btn {
  color: white;
  background: var(--blue);
}

.insight-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.task-panel,
.signal-panel,
.activity-panel {
  padding-bottom: 16px;
}

.task-board,
.signal-list,
.activity-list,
.completion-list {
  padding: 0 16px;
  max-height: 310px;
  overflow: auto;
}

.activity-list {
  max-height: 360px;
}

.task-card,
.signal-card,
.activity-card,
.risk-card,
.completion-card,
.report-card,
.empty-state {
  padding: 12px;
}

.task-card {
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.task-card.is-done {
  border-color: rgba(47, 143, 91, 0.42);
  background: #f1faf5;
}

.task-card p,
.signal-card p,
.activity-card p,
.risk-card p,
.report-card p,
.empty-state p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.empty-state {
  border-style: dashed;
  background: #f7faf8;
}

.empty-state p {
  margin: 0;
}

.chat-empty {
  align-self: center;
  justify-self: center;
  width: min(420px, 100%);
  text-align: center;
}

.status-tag.done { background: var(--green); }
.status-tag.progress { background: var(--yellow); color: #3a2700; }
.status-tag.open { background: var(--red); }

.task-check {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

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

.task-check span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 2px solid #aab8b1;
  border-radius: 6px;
  background: white;
  transition: all 160ms ease;
}

.task-check span::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg) scale(0);
  transition: transform 160ms ease;
}

.task-check input:checked + span {
  border-color: var(--green);
  background: var(--green);
}

.task-check input:checked + span::after {
  transform: rotate(-45deg) scale(1);
}

.task-check input:checked ~ strong {
  color: var(--green);
}

.fireworks {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  border: 1px solid rgba(47, 143, 91, 0.35);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  color: #185936;
  background: linear-gradient(135deg, #effaf4, #eef7ff);
}

.fireworks strong {
  position: relative;
  z-index: 1;
  display: block;
  line-height: 1.4;
}

.burst {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: firework 1100ms ease-out infinite;
}

.burst::before,
.burst::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--green) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 20%, var(--yellow) 0 2px, transparent 3px),
    radial-gradient(circle at 20% 80%, var(--blue) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 80%, #d85b8c 0 2px, transparent 3px);
}

.b1 { left: 18%; top: 24%; }
.b2 { right: 20%; top: 30%; animation-delay: 180ms; }
.b3 { left: 50%; top: 18%; animation-delay: 360ms; }

@keyframes firework {
  0% { transform: scale(0.3); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: scale(1.45); opacity: 0; }
}

.risk-card {
  border-color: rgba(201, 71, 71, 0.26);
  background: #fff8f7;
}

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

.role-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.risk-tag {
  display: inline-block;
  margin-bottom: 7px;
  background: var(--red);
}

.signal-card {
  display: grid;
  gap: 8px;
}

.signal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.signal-tag {
  border-radius: 999px;
  padding: 5px 8px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  background: var(--blue);
  white-space: nowrap;
}

.signal-tag.support { background: #d85b8c; }
.signal-tag.idea { background: var(--teal); }
.signal-tag.task { background: var(--green); }
.signal-tag.mention { background: #7b8580; }
.signal-tag.complete { background: var(--green); }
.signal-tag.deadline { background: var(--yellow); color: #3a2700; }
.signal-tag.risk,
.signal-tag.accountability,
.signal-tag.blocker { background: var(--red); }
.signal-tag.ai { background: var(--violet); }

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 16px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf4f0;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
}

.upload-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 0 16px 14px;
}

.file-drop {
  display: grid;
  place-items: center;
  min-height: 46px;
  border: 1px dashed var(--teal);
  border-radius: 8px;
  color: var(--teal);
  background: #effaf8;
  font-weight: 800;
}

.file-drop input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.metric-row {
  margin-top: 8px;
}

.metric {
  display: grid;
  gap: 2px;
}

.metric strong {
  font-size: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.completion-card button {
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  color: white;
  background: var(--green);
  font-weight: 800;
}

.completion-note {
  padding: 0 16px 12px;
}

.report-dialog {
  width: min(1080px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.import-dialog {
  width: min(780px, calc(100vw - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

.import-dialog::backdrop {
  background: rgba(23, 33, 29, 0.45);
  backdrop-filter: blur(4px);
}

.import-body {
  display: grid;
  gap: 14px;
  padding: 18px 22px 22px;
}

.import-body textarea {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: #fbfdfc;
}

.import-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.report-dialog::backdrop {
  background: rgba(23, 33, 29, 0.45);
  backdrop-filter: blur(4px);
}

.report-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}

.icon-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 24px;
  background: #edf4f0;
}

.report-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 22px;
  background: #f6faf8;
}

.report-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
}

.report-summary p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.report-content {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 20px 22px 24px;
}

.report-card h3 {
  margin: 0 0 8px;
}

.report-card ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 1050px) {
  .hero-grid,
  .app-shell,
  .grid,
  .public-cards {
    grid-template-columns: 1fr;
  }

  .hero-logo-card {
    order: -1;
  }

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .public-hero,
  .demo-section,
  .public-section,
  .public-footer,
  .workspace,
  .sidebar {
    padding: 14px;
  }

  .public-nav,
  .public-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-links {
    justify-content: flex-start;
  }

  .chat-column {
    grid-template-rows: auto minmax(440px, 58vh) auto;
  }

  .chat-form,
  .upload-row,
  .report-summary,
  .report-content {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 100%;
  }

  .status-pill {
    display: none;
  }
}
