:root {
  --bg: #fff8f2;
  --bg-accent: #fde7d2;
  --surface: rgba(255, 250, 246, 0.88);
  --surface-strong: #fffdfb;
  --text: #221410;
  --text-soft: #6c4d44;
  --line: rgba(90, 52, 38, 0.12);
  --brand: #e85d38;
  --brand-dark: #b63f21;
  --brand-soft: #ffd8cb;
  --success: #155b45;
  --success-bg: #d9f8ee;
  --error: #8d2b1a;
  --error-bg: #ffe0d7;
  --shadow: 0 24px 60px rgba(80, 37, 20, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Avenir Next", "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(232, 93, 56, 0.18), transparent 34%),
    radial-gradient(circle at 85% 20%, rgba(255, 212, 180, 0.45), transparent 26%),
    linear-gradient(180deg, #fff9f3 0%, #fff4eb 100%);
}

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

code,
textarea,
.inline-code {
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  z-index: 10;
  overflow: visible;
  margin-bottom: 24px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 252, 248, 0.86);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 42px rgba(80, 37, 20, 0.08);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(21, 137, 189, 0.22);
  flex-shrink: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 11;
  overflow: visible;
  color: var(--text-soft);
}

.account-menu {
  position: relative;
  z-index: 12;
}

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

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

.account-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 216, 203, 0.5);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.account-menu[open] .account-menu-trigger,
.account-menu-trigger:hover {
  background: rgba(255, 216, 203, 0.78);
}

.account-menu-caret {
  color: var(--brand-dark);
  font-size: 0.85rem;
}

.account-menu-name {
  max-width: min(28vw, 220px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 30;
  width: min(320px, calc(100vw - 28px));
  padding: 18px;
  border: 1px solid rgba(90, 52, 38, 0.12);
  border-radius: 20px;
  background: rgba(255, 253, 251, 0.96);
  box-shadow: 0 24px 50px rgba(80, 37, 20, 0.14);
}

.account-menu-eyebrow {
  margin: 0 0 8px;
  color: var(--brand-dark);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.account-menu-title {
  display: block;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.account-menu-copy {
  margin: 6px 0 0;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.account-menu-meta {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(90, 52, 38, 0.08);
}

.account-menu-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin-top: 16px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff8f2;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(232, 93, 56, 0.24);
}

.button:hover {
  background: var(--brand-dark);
  color: #fff8f2;
}

.button:disabled,
.button:disabled:hover {
  background: rgba(108, 77, 68, 0.26);
  color: rgba(45, 24, 17, 0.64);
  cursor: not-allowed;
  box-shadow: none;
}

.button-small {
  min-height: 40px;
}

.button-secondary {
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: none;
}

.flash {
  margin-bottom: 22px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.flash-success {
  background: var(--success-bg);
  color: var(--success);
}

.flash-error {
  background: var(--error-bg);
  color: var(--error);
}

.hero,
.dashboard-grid {
  display: grid;
  gap: 24px;
}

.hero {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: stretch;
  min-height: 540px;
}

.hero-copy,
.hero-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 42px;
}

.hero-card {
  padding: 28px;
}

.hero h1,
.dashboard h1,
.error-page h1 {
  margin: 0 0 16px;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--brand-dark);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.lede,
.panel-copy,
.feature-card p,
.stat-card p,
.callout,
.plain-list,
.field small {
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 30px 0;
}

.callout {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 216, 203, 0.8), rgba(255, 243, 233, 0.92));
}

.callout-title {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.card-grid,
.feature-grid {
  display: grid;
  gap: 16px;
}

.card-grid {
  height: 100%;
  grid-template-rows: repeat(3, 1fr);
}

.stat-card,
.feature-card {
  padding: 22px;
  border-radius: 22px;
  background: var(--surface-strong);
  border: 1px solid rgba(90, 52, 38, 0.08);
}

.stat-label,
.meta-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section {
  margin-top: 42px;
}

.section-header {
  margin-bottom: 20px;
}

.section h2,
.panel h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.feature-grid {
  grid-template-columns: repeat(3, 1fr);
}

.dashboard {
  display: grid;
  gap: 24px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-header-copy {
  min-width: 0;
}

.panel-header form {
  margin: 0;
  flex-shrink: 0;
}

.panel-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 12px;
}

.panel-header-action {
  flex-shrink: 0;
}

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

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

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

.panel-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 999px;
  background: var(--brand-soft);
  cursor: pointer;
}

.panel-menu[open] .panel-menu-trigger,
.panel-menu-trigger:hover {
  background: rgba(255, 216, 203, 0.85);
}

.panel-menu-icon {
  display: inline-flex;
  gap: 3px;
}

.panel-menu-icon span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: var(--brand-dark);
}

.panel-menu-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  min-width: 180px;
  padding: 10px;
  border: 1px solid rgba(90, 52, 38, 0.12);
  border-radius: 18px;
  background: rgba(255, 253, 251, 0.98);
  box-shadow: 0 24px 50px rgba(80, 37, 20, 0.14);
}

.panel-menu-action {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.panel-menu-action:hover {
  background: rgba(255, 216, 203, 0.45);
}

.panel-menu-action-danger {
  color: #a13a3a;
}

.panel-menu-action-danger:hover {
  background: #fce8e8;
  color: #8c2f2f;
}

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

.panel-actions form {
  margin: 0;
}

.panel {
  padding: 28px;
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.dashboard-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-sidebar {
  display: grid;
  gap: 24px;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.dashboard-callout .plain-list {
  margin-top: 0;
}

.settings-groups {
  display: grid;
  gap: 16px;
}

.settings-group {
  border: 1px solid rgba(90, 52, 38, 0.12);
  border-radius: 22px;
  background: rgba(255, 253, 251, 0.88);
  overflow: hidden;
}

.settings-group summary {
  list-style: none;
}

.settings-group summary::-webkit-details-marker {
  display: none;
}

.settings-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  cursor: pointer;
}

.settings-group-copy {
  display: grid;
  gap: 4px;
}

.settings-group-kicker {
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.settings-group-title {
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.settings-group-description {
  color: var(--text-soft);
  line-height: 1.55;
}

.settings-group-chevron {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--brand-dark);
  border-bottom: 2px solid var(--brand-dark);
  transform: rotate(45deg);
  transition: transform 180ms ease;
  flex-shrink: 0;
}

.settings-group[open] .settings-group-chevron {
  transform: rotate(225deg);
}

.settings-group-content {
  display: grid;
  gap: 16px;
  padding: 0 22px 22px;
}

.field {
  display: grid;
  gap: 8px;
}

.checkbox-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid rgba(90, 52, 38, 0.12);
  border-radius: 18px;
  background: rgba(255, 253, 251, 0.92);
  color: var(--text);
  font-weight: 600;
  line-height: 1.55;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--brand);
}

.field span {
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.code-block {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(90, 52, 38, 0.14);
  border-radius: 16px;
  background: #fffefc;
  color: var(--text);
  font-size: 0.98rem;
}

.code-block:disabled {
  background: #f8f3ef;
  color: var(--text-soft);
}

.field select {
  appearance: none;
  padding-right: 56px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M4.5 6.75L9 11.25L13.5 6.75' stroke='%236c4d44' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 20px center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
}

.field textarea {
  resize: vertical;
  min-height: 92px;
}

.code-block {
  resize: vertical;
  min-height: 200px;
  margin: 0 0 16px;
  line-height: 1.55;
}

.code-block-compact {
  min-height: 132px;
}

.demo-inline-meta {
  margin-top: 24px;
}

.inline-code {
  padding: 16px 18px;
  border-radius: 16px;
  background: #2d1811;
  color: #ffefe3;
  overflow-wrap: anywhere;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
}

.error-page {
  display: grid;
  place-items: center;
  min-height: 60vh;
}

.error-panel {
  max-width: 640px;
  text-align: center;
}

.demo-stage {
  display: grid;
  gap: 22px;
}

.call-page-grid {
  grid-template-columns: 1.1fr 0.9fr;
}

.call-detail-list {
  display: grid;
  gap: 16px;
}

.call-detail-card {
  padding: 20px 22px;
  border-radius: 20px;
  background: var(--surface-strong);
  border: 1px solid rgba(90, 52, 38, 0.08);
}

.call-detail-card strong {
  display: block;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.demo-stage-copy {
  max-width: 720px;
}

.demo-feature-grid {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 900px) {
  .hero,
  .dashboard-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .page-shell {
    padding: 16px 14px 48px;
  }

  .topbar,
  .panel-header,
  .nav,
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .account-menu-name {
    max-width: none;
  }

  .account-menu-popover {
    position: static;
    width: 100%;
    margin-top: 12px;
  }

  .hero-copy,
  .hero-card,
  .panel {
    padding: 22px;
  }
}
