:root {
  --bg: #f6f4ef;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #232524;
  --muted: #67706c;
  --line: #d9d5ca;
  --green: #2f7d68;
  --green-soft: #dcebe5;
  --blue: #2d5f91;
  --blue-soft: #dbe7f2;
  --rust: #a9552b;
  --rust-soft: #f1dfd4;
  --gold: #8c6f20;
  --gold-soft: #efe6bf;
  --shadow: 0 18px 50px rgba(35, 37, 36, 0.10);
}

* { box-sizing: border-box; }

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

body.legal-page {
  padding: 32px 18px;
}

.home-page {
  background: #f7f3ea;
}

.home-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(35, 37, 36, 0.14);
  background: rgba(247, 243, 234, 0.94);
  backdrop-filter: blur(14px);
}

.home-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 780;
  text-decoration: none;
}

.home-links {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.94rem;
}

.home-links a {
  color: #3d4642;
  text-decoration: none;
}

.home-links a:hover {
  color: var(--ink);
}

.nav-action {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
}

.home-hero {
  position: relative;
  min-height: calc(100vh - 210px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  align-items: center;
  gap: clamp(28px, 6vw, 82px);
  padding: clamp(36px, 6vw, 78px) clamp(18px, 5vw, 64px) 36px;
  overflow: hidden;
  border-bottom: 1px solid rgba(35, 37, 36, 0.12);
}

.home-hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.home-kicker {
  margin-bottom: 12px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-hero h1 {
  margin: 0;
  font-size: clamp(3.7rem, 10vw, 6.7rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.home-hero-content > p:not(.home-kicker) {
  max-width: 630px;
  margin-top: 24px;
  color: #3d4642;
  font-size: clamp(1.08rem, 1.7vw, 1.24rem);
  line-height: 1.45;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.home-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 720;
  text-decoration: none;
}

.home-button.primary {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.home-summary {
  position: relative;
  z-index: 1;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.summary-mark {
  width: 72px;
  height: 72px;
  display: block;
  margin-bottom: 24px;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(35, 37, 36, 0.18);
}

.home-summary dl {
  display: grid;
  gap: 18px;
  margin: 0;
}

.home-summary div {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.home-summary dt {
  margin-bottom: 6px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 780;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-summary dd {
  margin: 0;
  color: #3d4642;
  line-height: 1.45;
}

.home-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(54px, 8vw, 90px) clamp(18px, 5vw, 34px);
}

.section-copy {
  max-width: 780px;
  margin-bottom: 28px;
}

.section-copy h2 {
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1;
}

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

.feature-grid article {
  min-height: 190px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.feature-grid h3 {
  margin-bottom: 14px;
  font-size: 1.22rem;
}

.feature-grid p,
.setup-list li {
  color: var(--muted);
  line-height: 1.55;
}

.setup-section {
  border-top: 1px solid rgba(35, 37, 36, 0.12);
}

.setup-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: setup;
}

.setup-list li {
  position: relative;
  min-height: 96px;
  padding: 22px 22px 22px 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  counter-increment: setup;
}

.setup-list li::before {
  content: counter(setup);
  position: absolute;
  left: 22px;
  top: 22px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 780;
}

.setup-list strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.install-actions {
  margin-top: 22px;
}

.link-band {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 28px;
  border-top: 1px solid rgba(35, 37, 36, 0.12);
}

.link-band a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--ink);
  text-decoration: none;
}

.legal-document {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.legal-document h1 {
  margin: 0 0 18px;
  font-size: 2rem;
}

.legal-document h2 {
  margin: 28px 0 8px;
  font-size: 1.1rem;
}

.legal-document p,
.legal-document li {
  color: var(--muted);
  line-height: 1.55;
}

button, select, input { font: inherit; }

button, .file-control span {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  min-height: 38px;
  padding: 0 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

button:hover, .file-control:hover span {
  border-color: #a9afa9;
  transform: translateY(-1px);
}

button.primary {
  border-color: var(--green);
  background: var(--green);
  color: white;
  min-width: 82px;
}

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

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

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

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(35, 37, 36, 0.16);
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 760;
  letter-spacing: 0;
}

.brand-block h1 span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74em;
  font-weight: 680;
}

.zoom-diagnostics {
  margin-top: 4px;
  color: #8c6f20;
  font-size: 11px;
  line-height: 1.35;
}

.topbar-menu {
  position: relative;
}

.menu-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.controls-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 15;
  width: 220px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.controls-menu[hidden] {
  display: none;
}

.controls-menu button,
.controls-menu .file-control span {
  width: 100%;
  justify-content: center;
}

.rtms-control-status {
  margin: 0;
  padding: 2px 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
  text-align: center;
}

.file-control input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.file-control span {
  display: inline-flex;
  align-items: center;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(470px, 1fr) 360px;
  gap: 14px;
  align-items: stretch;
  height: calc(100vh - 104px);
}

.panel, .board {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-header, .board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.panel-header.compact { min-height: 78px; }

.eyebrow {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

h2 {
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: 0;
}

.timer, .queue-count {
  min-width: 58px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #f0eee7;
  color: var(--ink);
  font-weight: 700;
}

.progress-track {
  height: 4px;
  background: #ebe8df;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--green);
}

.playback-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

select {
  min-width: 88px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: 7px 8px;
}

.transcript-list, .agent-queue {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.transcript-cue {
  border-left: 3px solid transparent;
  padding: 10px 10px 10px 12px;
  border-radius: 6px;
  background: transparent;
  color: #4d5652;
}

.transcript-cue.active {
  border-left-color: var(--blue);
  background: var(--blue-soft);
  color: var(--ink);
}

.transcript-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.transcript-text {
  font-size: 13px;
  line-height: 1.35;
}

.board {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.board-header {
  min-height: 86px;
}

.board-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.board-status {
  flex: 0 0 auto;
}

.meeting-context {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 13px;
}

.meeting-context strong {
  color: var(--ink);
}

.meeting-link {
  display: flex;
  justify-content: flex-end;
}

.dashboard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.dashboard-actions button:last-child {
  border-color: var(--green);
  background: var(--green);
  color: white;
}

.decision-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  padding: 14px;
  min-height: 216px;
  max-height: 300px;
  border-bottom: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.decision-card, .board-section, .agent-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.decision-card {
  padding: 14px;
  min-height: 160px;
  height: fit-content;
}

.decision-card h3 {
  font-size: 18px;
  line-height: 1.2;
  margin: 9px 0 9px;
}

.decision-card p {
  color: #4b5551;
  font-size: 14px;
  line-height: 1.45;
}

.status-pill, .priority-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.status-pill.forming { background: var(--blue-soft); color: var(--blue); }
.status-pill.pending { background: var(--gold-soft); color: var(--gold); }
.status-pill.accepted { background: var(--green-soft); color: var(--green); }
.status-pill.rejected { background: var(--rust-soft); color: var(--rust); }
.status-pill.action { background: var(--blue-soft); color: var(--blue); }

.empty-state {
  display: flex;
  flex-direction: column;
  justify-content: center;
  grid-column: 1 / -1;
  color: var(--muted);
}

.board-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 14px 14px 10px;
  min-height: 0;
  flex: 1;
}

.board-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.section-title-row {
  min-height: 48px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.section-title-row h3 {
  font-size: 15px;
}

.section-title-row span {
  min-width: 28px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #f0eee7;
  font-size: 12px;
  font-weight: 760;
}

.stack-list {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.stack-item {
  padding: 11px 0;
  border-bottom: 1px solid #ebe8df;
}

.stack-item:last-child { border-bottom: 0; }

.stack-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.stack-item p {
  color: #53605b;
  font-size: 13px;
  line-height: 1.35;
}


.audit-section {
  margin: 0 14px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  overflow: hidden;
}

.audit-list {
  max-height: 126px;
  overflow: auto;
  padding: 8px 12px;
}

.audit-item {
  padding: 9px 0;
  border-bottom: 1px solid #ebe8df;
}

.audit-item:last-child { border-bottom: 0; }

.audit-item div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.audit-item strong {
  font-size: 12px;
}

.audit-item span,
.audit-empty {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.audit-item p {
  color: #53605b;
  font-size: 12px;
  line-height: 1.3;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
  transform: none;
}

.agent-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.agent-filter {
  min-height: 34px;
  padding: 0 8px;
  font-size: 13px;
}

.agent-filter.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fffaf0;
}

.agent-card {
  padding: 13px;
  margin-bottom: 10px;
}

.agent-card.discussed { opacity: 0.66; }

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

.agent-name {
  font-size: 14px;
  font-weight: 800;
}

.priority-pill.high { background: var(--rust-soft); color: var(--rust); }
.priority-pill.medium { background: var(--gold-soft); color: var(--gold); }
.priority-pill.low { background: var(--blue-soft); color: var(--blue); }

.agent-card p {
  color: #47514d;
  font-size: 13px;
  line-height: 1.38;
}

.agent-evidence {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.agent-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.agent-actions button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

@media (min-width: 901px) {
  body { min-width: 1120px; }
}

@media (min-width: 901px) and (max-width: 1180px) {
  body { min-width: 980px; }
  .workspace { grid-template-columns: 290px minmax(420px, 1fr) 320px; }
  .decision-strip { grid-template-columns: 1fr; }
}

.workspace.transcript-hidden {
  grid-template-columns: minmax(620px, 1fr) 380px;
}

.workspace.transcript-hidden .transcript-panel {
  display: none;
}

@media (max-width: 900px) {
  body { min-width: 0; }

  .home-nav {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 18px;
  }

  .home-links {
    width: 100%;
    flex-wrap: wrap;
    gap: 10px;
  }

  .home-links a {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
  }

  .home-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 48px 18px 34px;
  }

  .home-hero-content {
    max-width: none;
  }

  .home-hero h1 {
    font-size: clamp(3.2rem, 19vw, 5.2rem);
  }

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

  .setup-list li {
    padding-left: 64px;
  }

  .app-shell {
    padding: 12px;
  }

  .topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 12px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  h1 {
    font-size: 20px;
  }

  .topbar-menu {
    position: absolute;
    top: 12px;
    right: 12px;
  }

  .controls-menu {
    width: min(220px, calc(100vw - 24px));
  }

  .workspace,
  .workspace.transcript-hidden {
    height: auto;
    display: flex;
    flex-direction: column;
  }

  .board {
    order: 1;
  }

  .transcript-panel {
    order: 2;
    max-height: 70vh;
  }

  .agents-panel {
    order: 3;
    max-height: 70vh;
  }

  .board-header,
  .panel-header {
    padding: 14px;
  }

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

  .meeting-link {
    width: 100%;
  }

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

  .decision-strip,
  .board-grid {
    grid-template-columns: 1fr;
  }

  .decision-strip {
    min-height: 0;
    max-height: none;
  }

  .board-grid {
    min-height: 0;
  }
}

.interactive-card,
.stack-item.interactive,
.agent-card,
.audit-item.interactive {
  cursor: pointer;
}

.interactive-card:hover,
.stack-item.interactive:hover,
.agent-card:hover,
.audit-item.interactive:hover {
  border-color: #a9afa9;
  background: #fffefa;
}

.stack-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.remove-item,
.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  min-height: 28px;
  min-width: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 18px;
  line-height: 1;
}

.remove-item:hover,
.modal-close:hover {
  background: #f0eee7;
  color: var(--ink);
  transform: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(35, 37, 36, 0.42);
  z-index: 20;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  position: relative;
  width: min(680px, 100%);
  max-height: min(720px, calc(100vh - 56px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: 0 28px 80px rgba(35, 37, 36, 0.22);
  padding: 24px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.modal h2 {
  margin-right: 34px;
  font-size: 24px;
}

.modal-summary {
  margin-top: 10px;
  color: #47514d;
  font-size: 15px;
  line-height: 1.45;
}

.modal-body {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.modal-body h3 {
  margin-top: 8px;
  font-size: 14px;
}

.modal-body p,
.modal-body li {
  color: #47514d;
  font-size: 14px;
  line-height: 1.45;
}

.modal-body ul {
  margin: 0;
  padding-left: 19px;
}

.modal-transcript {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f5ee;
  color: #3f4743;
  white-space: pre-line;
}

.agent-auto-note {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 0 0 8px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modal-agent-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.modal-agent-actions[hidden] {
  display: none;
}

.modal-agent-actions button:first-child {
  border-color: var(--green);
  background: var(--green);
  color: white;
}
