:root {
  color-scheme: light;
  --bg: #f5f0e8;
  --card: #fffdf9;
  --ink: #1f2933;
  --muted: #52606d;
  --accent: #b44d2f;
  --accent-dark: #8f3a21;
  --border: #dccfc0;
  --shadow: rgba(76, 49, 35, 0.08);
  --surface: #f9f4ee;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, #f8dfcb 0, transparent 30%),
    linear-gradient(180deg, #f7f2eb 0%, var(--bg) 100%);
}

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

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

.auth-page {
  max-width: 960px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 14px 28px var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

.hero-card {
  padding-bottom: 28px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.auth-grid form > button[type="submit"] {
  margin-top: 10px;
}

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

.topbar,
.integration-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.integration-card-stacked {
  align-items: stretch;
  display: block;
}

.integration-card-stacked > :first-child {
  flex: initial;
  max-width: 780px;
}

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

.topbar-menu {
  position: relative;
  flex-shrink: 0;
}

.topbar-menu summary {
  list-style: none;
}

.topbar-menu summary::-webkit-details-marker {
  display: none;
}

.topbar-menu summary::after {
  content: "v";
  margin-left: 8px;
  font-size: 0.8rem;
}

.topbar-menu[open] summary::after {
  content: "^";
}

.topbar-menu-list {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 10;
  min-width: 220px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 18px 32px var(--shadow);
}

.topbar-menu-list a,
.topbar-menu-list button {
  width: 100%;
  justify-content: flex-start;
  border-radius: 12px;
  padding: 10px 12px;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}

.topbar-menu-list a:hover,
.topbar-menu-list button:hover {
  background: var(--surface);
}

.workspace-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
}

.workspace-switcher {
  min-width: 280px;
}

.pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  background: #fce4da;
  color: var(--accent-dark);
  font-weight: 600;
  text-transform: capitalize;
}

.pill-muted {
  background: var(--surface);
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin-top: 0;
  font-family: Georgia, "Times New Roman", serif;
}

.intro,
.status {
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.stack-list {
  display: grid;
  gap: 12px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.list-item p {
  margin-bottom: 0;
}

.full-width {
  grid-column: 1 / -1;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

textarea {
  resize: vertical;
}

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

.integration-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
  max-width: 780px;
}

.salesforce-actions-row {
  justify-content: flex-start;
  align-items: center;
  margin-top: 24px;
  max-width: 780px;
}

.integration-card > :first-child {
  flex: 1;
  min-width: 0;
}

.integration-actions {
  flex-wrap: nowrap;
  flex-shrink: 0;
  gap: 16px;
  justify-content: flex-end;
  align-content: center;
}

.member-actions {
  margin-top: 0;
  justify-content: flex-end;
}

.docs-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: start;
}

.docs-grid,
.roadmap-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.summary-card,
.roadmap-item,
.flow-step {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
}

.summary-card {
  padding: 18px;
}

.summary-card h3,
.flow-step h3,
.roadmap-item h4 {
  margin: 0 0 10px;
}

.summary-card p:last-child,
.flow-step p:last-child,
.roadmap-item p:last-child {
  margin-bottom: 0;
}

.flow-list {
  display: grid;
  gap: 14px;
}

.flow-step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  padding: 18px;
}

.flow-step-index {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #fce4da;
  color: var(--accent-dark);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 700;
}

.flow-step-copy {
  min-width: 0;
}

.flow-step-heading,
.roadmap-item-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.state-complete,
.state-ready {
  background: #dff5e7;
  color: #205b39;
}

.state-owner_action,
.state-upcoming {
  background: #fce4da;
  color: var(--accent-dark);
}

.state-blocked {
  background: #f0ebe4;
  color: var(--muted);
}

.roadmap-item {
  padding: 18px;
}

button,
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 16px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.button-secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
}

.button-disabled {
  pointer-events: none;
  opacity: 0.55;
}

button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

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

.result-grid div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.result-grid span {
  display: block;
  margin-top: 8px;
  font-size: 1.5rem;
}

.error-box {
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  background: #2d1f1b;
  color: #ffe7dc;
  overflow-x: auto;
  white-space: pre-wrap;
}

.hidden {
  display: none;
}

@media (max-width: 720px) {
  .topbar,
  .integration-card,
  .workspace-bar,
  .docs-hero,
  .section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .actions,
  .topbar-actions {
    flex-direction: column;
  }

  .topbar-menu-list {
    left: 0;
    right: auto;
    width: 100%;
  }

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

  .flow-step {
    grid-template-columns: 1fr;
  }

  .flow-step-heading,
  .roadmap-item-footer {
    align-items: start;
    flex-direction: column;
  }
}
