/* ─── TOKENS ──────────────────────────────────────────────────────── */
:root {
  --bg: #f3f6fa;
  --bg-2: #e9eff6;
  --bg-3: #dde6f0;
  --surface: #ffffff;
  --panel: #f4f7fb;
  --panel-alt: rgba(236, 242, 248, 0.88);
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #7b8ba1;
  --accent: #0f5c91;
  --accent-hover: #0b4b76;
  --accent-soft: rgba(15, 92, 145, 0.1);
  --accent-text: #0b4b76;
  --success: #0f766e;
  --font-sans: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-display: "IBM Plex Sans", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08), 0 4px 14px rgba(15, 23, 42, 0.04);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.page-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at top left, rgba(15, 92, 145, 0.1), transparent 34%),
    radial-gradient(circle at 85% 18%, rgba(14, 116, 144, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(243, 246, 250, 0.96), rgba(255, 255, 255, 0.98));
  transition: opacity 0.35s ease;
}

body[data-page="home"] {
  background:
    radial-gradient(circle at top left, rgba(15, 92, 145, 0.06), transparent 34%),
    linear-gradient(180deg, #f4f7fb 0%, #ffffff 38%);
}

body[data-page="home"] .page-backdrop {
  opacity: 1;
}

body[data-page="full"] {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
}

body[data-page="full"] .page-backdrop {
  opacity: 0.72;
}

/* ─── ACCESSIBILITY ───────────────────────────────────────────────── */

.skip-link {
  position: absolute;
  left: 14px;
  top: -120px;
  z-index: 1000;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
}

.skip-link:focus-visible {
  top: 14px;
}

/* ─── HEADER ──────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px clamp(16px, 3vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-logo {
  flex-shrink: 0;
  color: var(--accent, #0f5c91);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.86rem;
  transition: color 0.15s ease;
}

.site-nav a:hover {
  color: var(--accent-text);
}

.site-cta {
  min-height: 32px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.9);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.site-cta:hover {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.22);
}

.site-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.auth-slot {
  display: flex;
  align-items: center;
  min-height: 32px;
}

.user-profile-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-display-name {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dashboard-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-3);
  text-decoration: none;
  white-space: nowrap;
}
.user-dashboard-link:hover { color: var(--accent); }

.auth-sign-in-btn {
  cursor: pointer;
  font: inherit;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
}

.auth-modal-card {
  position: relative;
  width: min(480px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  margin: 16px auto;
  padding: 18px;
  border-radius: 24px;
  background: var(--surface, #ffffff);
  box-shadow: var(--shadow);
  border: 1px solid var(--border, rgba(15, 23, 42, 0.08));
}

.auth-modal-title {
  margin: 0 0 14px;
  font-size: 1.1rem;
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border-strong, rgba(15, 23, 42, 0.16));
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text, #0f172a);
  cursor: pointer;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
}

.auth-modal-open {
  overflow: hidden;
}

/* ─── HERO ────────────────────────────────────────────────────────── */

.home-hero {
  padding: clamp(34px, 5vw, 68px) 0 clamp(40px, 6vw, 80px);
  color: var(--text);
}

.home-hero-contained {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: clamp(16px, 4vw, 56px);
  padding-right: clamp(16px, 4vw, 56px);
  padding-bottom: clamp(32px, 5vw, 56px);
}

.front-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(20px, 3vw, 32px);
}

.hero-diagram-band {
  width: 100%;
  padding: clamp(20px, 4vw, 36px) clamp(12px, 3vw, 40px);
  margin-bottom: clamp(40px, 6vw, 72px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(241, 245, 249, 0.55) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.hero-diagram-inner {
  max-width: min(980px, 94vw);
  margin: 0 auto;
}

.home-hero-marketing {
  padding-bottom: clamp(8px, 2vw, 16px);
}

.front-kicker {
  margin: 0;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--accent-text);
  font-weight: 600;
}

.jump-link {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.82rem;
  border: 1px solid var(--border-strong);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.jump-link:hover {
  color: var(--text);
  background: #ffffff;
  border-color: rgba(17, 17, 19, 0.16);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 92, 145, 0.16);
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero-message h1 {
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.45rem, 4.2vw, 3.9rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.03em;
  color: var(--text);
  max-width: 22ch;
}

.hero-message p {
  margin: 22px 0 0;
  max-width: 54ch;
  color: var(--text-2);
  font-size: 1.06rem;
  line-height: 1.78;
}

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

.hero-cta,
.hero-ghost {
  min-height: 52px;
  min-width: 196px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 0 28px;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.hero-cta {
  color: #fff;
  background: var(--accent);
  border: none;
  box-shadow: 0 14px 30px rgba(15, 92, 145, 0.2);
}

.hero-cta:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(15, 92, 145, 0.24);
}

.hero-ghost {
  color: var(--text);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.86);
}

.hero-ghost:hover {
  background: #ffffff;
  transform: translateY(-2px);
}

.home-hero-marketing .hero-metrics {
  margin-top: 0;
  margin-bottom: clamp(8px, 2vw, 16px);
}

.hero-metrics {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.hero-metric {
  padding: 16px 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(17, 17, 19, 0.08);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.hero-metric strong {
  display: block;
  font-size: 0.86rem;
  letter-spacing: -0.01em;
}

.hero-metric span {
  display: block;
  margin-top: 8px;
  color: var(--text-2);
  font-size: 0.8rem;
  line-height: 1.6;
}

/* Home: supported diagram types */
.diagram-types-deck {
  margin-top: clamp(40px, 7vw, 72px);
  padding: clamp(28px, 5vw, 44px) clamp(20px, 4vw, 36px) clamp(32px, 5vw, 48px);
  border-radius: 22px;
  border: 1px solid rgba(15, 92, 145, 0.12);
  background:
    radial-gradient(ellipse 85% 60% at 12% 0%, rgba(15, 92, 145, 0.09), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(14, 116, 144, 0.07), transparent 45%),
    linear-gradient(165deg, rgba(255, 255, 255, 0.97) 0%, rgba(248, 250, 252, 0.92) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 22px 48px rgba(15, 23, 42, 0.07);
}

.diagram-types {
  margin: 0;
  padding: 0;
  border: none;
}

.diagram-types-intro {
  max-width: 720px;
}

.diagram-types-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.diagram-types-headline {
  margin: 12px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.2vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--text);
  max-width: 22ch;
}

.diagram-types-lede {
  margin: 14px 0 0;
  max-width: 62ch;
  color: var(--text-2);
  font-size: 1.02rem;
  line-height: 1.72;
}

.diagram-types-chips {
  margin: 20px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.diagram-types-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(15, 92, 145, 0.14);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.diagram-types-grid {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 16px;
}

.diagram-type-card {
  --card-accent: var(--accent);
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  row-gap: 6px;
  align-items: start;
  padding: 18px 18px 20px 16px;
  border-radius: 18px;
  border: 1px solid rgba(17, 17, 19, 0.07);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease;
}

.diagram-type-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--card-accent);
  opacity: 0.35;
  transition: opacity 0.22s ease, top 0.22s ease, bottom 0.22s ease;
}

.diagram-type-card:hover {
  transform: translateY(-3px);
  border-color: rgba(15, 92, 145, 0.2);
  background: #fff;
  box-shadow: 0 16px 36px rgba(15, 92, 145, 0.1);
}

.diagram-type-card:hover::before {
  opacity: 1;
  top: 10px;
  bottom: 10px;
}

.diagram-type-card--flow { --card-accent: #0f5c91; }
.diagram-type-card--seq { --card-accent: #0369a1; }
.diagram-type-card--erd { --card-accent: #7c3aed; }
.diagram-type-card--class { --card-accent: #0d9488; }
.diagram-type-card--state { --card-accent: #c2410c; }
.diagram-type-card--activity { --card-accent: #15803d; }
.diagram-type-card--bpmn { --card-accent: #b45309; }

.diagram-type-glyph {
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--card-accent);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(241, 245, 249, 0.9));
  border: 1px solid rgba(15, 92, 145, 0.12);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.diagram-type-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  grid-column: 2;
}

.diagram-type-desc {
  grid-column: 2;
  font-size: 0.82rem;
  line-height: 1.58;
  color: var(--text-2);
}

/* ── Hero Diagram Slider ─────────────────────────────────────────────────── */

.hero-slider {
  position: relative;
  height: 560px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.hs-slides {
  position: absolute;
  inset: 0;
  bottom: 44px;
}

.hs-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease;
  cursor: pointer;
}

.hs-slide--active {
  opacity: 1;
  pointer-events: auto;
}

.hs-mount {
  flex: 1;
  min-height: 0;
  position: relative;
}

/* React Flow nodes in the hero preview should not be interactive */
.hs-mount .react-flow__node { pointer-events: none; }
.hs-mount .react-flow__pane  { pointer-events: none; }

/* ── Chat bubble overlay ── */
.hs-chat-bubble {
  position: absolute;
  bottom: 56px; /* sit just above the footer bar */
  left: 16px;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  max-width: min(360px, calc(100% - 32px));
  pointer-events: none;
}

.hs-chat-avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(15, 92, 145, 0.3);
}

.hs-chat-body {
  position: relative;
  background: #ffffff;
  border-radius: 16px 16px 16px 4px; /* iMessage-style: square bottom-left */
  padding: 9px 13px 10px;
  box-shadow:
    0 4px 16px rgba(15, 23, 42, 0.13),
    0 1px 4px rgba(15, 23, 42, 0.07);
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.hs-chat-sender {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--accent-text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.hs-chat-text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text);
  font-style: italic;
}

.hs-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.9);
}

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

.hs-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.hs-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hs-cta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.hs-slide--active:hover .hs-cta { opacity: 1; }

.hs-dots {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-top: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.9);
}

.hs-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.18);
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hs-dot--active {
  background: var(--accent);
  transform: scale(1.25);
}

.hs-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}


/* ─── MARKETING SECTIONS ─────────────────────────────────────────── */

.mkt-section {
  padding: clamp(80px, 11vw, 140px) clamp(16px, 4vw, 56px);
  position: relative;
  border-top: 1px solid var(--border);
}

.mkt-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.mkt-label {
  margin: 0 0 20px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-text);
  font-weight: 600;
}

.mkt-headline {
  margin: 0 0 52px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.028em;
  color: var(--text);
  max-width: 18ch;
}

.mkt-headline-center {
  max-width: none;
  text-align: center;
}

/* HOW IT WORKS */

.mkt-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.mkt-step {
  padding: 48px 40px;
  border-right: 1px solid var(--border);
  background: var(--bg-2);
  transition: background 0.2s ease;
}

.mkt-step:last-child {
  border-right: none;
}

.mkt-step:hover {
  background: var(--bg-3);
}

.mkt-step-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(15, 92, 145, 0.24);
  margin-bottom: 20px;
  letter-spacing: -0.03em;
}

.mkt-step-body h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.mkt-step-body p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.75;
}

/* WHY IT'S DIFFERENT */

.mkt-built {
  background: var(--bg-2);
}

.mkt-built-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.mkt-built-lead .mkt-headline {
  margin-bottom: 24px;
}

.mkt-body-text {
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.82;
  margin: 0;
  max-width: 44ch;
}

.mkt-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.mkt-feature-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  transition: background 0.18s ease;
}

.mkt-feature-item:last-child {
  border-bottom: none;
}

.mkt-feature-item:hover {
  background: var(--bg-3);
}

.mkt-feat-icon {
  font-size: 1.2rem;
  line-height: 1;
  margin-top: 1px;
  flex-shrink: 0;
}

.mkt-feature-item h3 {
  margin: 0 0 5px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.mkt-feature-item p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.84rem;
  line-height: 1.65;
}

/* WHO IT'S FOR */

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

.mkt-persona {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 36px;
  background: var(--bg-2);
  transition: border-color 0.22s ease, transform 0.22s ease, background 0.22s ease;
}

.mkt-persona:hover {
  border-color: rgba(15, 92, 145, 0.24);
  transform: translateY(-4px);
  background: var(--bg-3);
}

.mkt-persona-role {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.mkt-persona p:not(.mkt-persona-role) {
  margin: 0;
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.78;
}

/* CLOSING CTA */

.mkt-cta {
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(15, 92, 145, 0.07) 0%, transparent 65%);
}

.mkt-cta-inner {
  max-width: 640px;
  margin: 0 auto;
}

.mkt-cta-headline {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.2vw, 2.8rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.12;
  letter-spacing: -0.028em;
}

.mkt-cta-sub {
  margin: 0 0 44px;
  color: var(--text-2);
  font-size: 1.05rem;
  line-height: 1.72;
}

.mkt-cta-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ─── WORKSPACE SHELL ─────────────────────────────────────────────── */

.workspace-wrap {
  padding: 0 clamp(10px, 2vw, 24px) 24px;
}

.studio-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.full-page-workspace {
  padding-top: 10px;
}

.quick-shell {
  min-height: 72vh;
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(250, 252, 255, 0.92);
  box-shadow: var(--shadow);
}

.app-shell {
  min-height: 92vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 400px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow);
}

/* Full-page studio: lock entire UI to viewport height, no page scroll */
body[data-page="full"] {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body[data-page="full"] .site-header {
  flex-shrink: 0;
}

body[data-page="full"] .site-header-inner {
  padding-top: 7px;
  padding-bottom: 7px;
}

body[data-page="full"] .workspace-wrap {
  flex: 1;
  min-height: 0;
  padding: 6px clamp(10px, 2vw, 24px) 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

body[data-page="full"] .app-shell {
  flex: 1;
  min-height: 0;
  height: auto;
}

body[data-page="full"] .site-footer {
  display: none;
}

/* ─── LEFT RAIL ───────────────────────────────────────────────────── */

.left-rail {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px;
  background: var(--panel-alt);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.rail-top {
  padding: 2px 6px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.rail-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.rail-brand-meta {
  min-width: 0;
}

.rail-logo {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.03em;
}

.rail-subtitle {
  margin: 4px 0 0;
  color: var(--text-3);
  font-size: 0.72rem;
}

.rail-collapse-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rail-collapse-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.24);
}

.rail-collapse-icon {
  font-size: 1rem;
  line-height: 1;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-item {
  width: 100%;
  min-height: 36px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.rail-item:hover {
  background: var(--bg-3);
  color: var(--text);
}

.rail-item.active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.rail-item-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.rail-panels {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rail-panel,
.rail-footer {
  border-top: 1px solid var(--border);
  padding: 12px 6px;
  margin-top: 4px;
}

.rail-panel {
  min-height: 0;
}

.rail-panel.active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rail-panel-copy {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 0.76rem;
  line-height: 1.55;
}

@media (min-width: 981px) {
  body.rail-collapsed .app-shell {
    grid-template-columns: 68px minmax(0, 1fr) 400px;
  }

  body.rail-collapsed .left-rail {
    padding-inline: 8px;
  }

  body.rail-collapsed .rail-brand-meta,
  body.rail-collapsed .rail-item-label,
  body.rail-collapsed .rail-panel,
  body.rail-collapsed .rail-footer {
    display: none;
  }

  body.rail-collapsed .rail-top {
    padding-bottom: 8px;
  }

  body.rail-collapsed .rail-top-row,
  body.rail-collapsed .rail-nav {
    align-items: center;
  }

  body.rail-collapsed .rail-item {
    justify-content: center;
    padding-inline: 0;
  }
}

.rail-history-title {
  margin: 0;
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rail-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.settings-grid {
  display: grid;
  gap: 10px;
  padding: 8px 0 0;
}

.toolbar-label {
  display: grid;
  gap: 5px;
  color: var(--text-2);
  font-size: 0.74rem;
  font-weight: 500;
}

.toolbar-select {
  min-height: 32px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.toolbar-select:hover {
  border-color: rgba(15, 23, 42, 0.24);
}

.history-list {
  display: grid;
  gap: 2px;
  max-height: min(48vh, 440px);
  overflow-y: auto;
}

.history-item {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 6px 8px;
  cursor: pointer;
  text-align: left;
  min-height: 36px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.history-item:hover {
  background: var(--bg-3);
  border-color: var(--border);
}

.history-title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  margin: 1px 0 0;
  font-size: 0.63rem;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-empty {
  margin: 0;
  color: var(--text-3);
  font-size: 0.72rem;
}

.usage-label,
.usage-meta {
  margin: 0;
  font-size: 0.7rem;
  color: var(--text-3);
}

.usage-track {
  height: 4px;
  border-radius: 999px;
  background: var(--bg-3);
  margin: 8px 0 5px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.usage-fill {
  display: block;
  width: 60%;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

/* ─── CANVAS AREA ─────────────────────────────────────────────────── */

.workspace-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  gap: 10px;
  background: color-mix(in srgb, var(--panel) 86%, transparent);
}

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

.canvas-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.03em;
}

.canvas-subtitle {
  margin: 2px 0 0;
  font-size: 0.69rem;
  color: var(--text-3);
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.toolbar-btn {
  min-height: 30px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.toolbar-btn:hover {
  background: rgba(237, 243, 249, 0.96);
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.22);
}

.toolbar-btn.active {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: rgba(15, 92, 145, 0.24);
}

.toolbar-btn-danger {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.22);
  background: rgba(255, 247, 237, 0.96);
}

.toolbar-btn-danger:hover {
  color: #92400e;
  border-color: rgba(146, 64, 14, 0.28);
  background: rgba(255, 237, 213, 0.98);
}

.toolbar-btn.icon-only {
  min-width: 30px;
  padding: 0;
}

.toolbar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.toolbar-divider {
  width: 1px;
  height: 16px;
  background: var(--border-strong);
  margin: 0 2px;
}

.clear-history-btn {
  min-height: 22px;
  padding: 0 6px;
  font-size: 0.66rem;
}

/* Canvas card — sits on the light workspace background */
.canvas-panel {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.render-container {
  flex: 1;
  min-height: 0;
  padding: 16px;
  display: flex;
  background: var(--surface);
  position: relative;
}

.render-surface {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1;
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  position: relative;
  border: 1px solid transparent;
}

.render-surface--empty {
  border: 1px dashed var(--border-strong);
  background: transparent;
}

.render-surface svg:not(.sequence-svg) {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
}

.sequence-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.reactflow-mount,
.bpmn-mount,
.sequence-mount {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
}

.render-surface[data-renderer="react-flow"] {
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--accent) 12%, transparent), transparent 28%),
    color-mix(in srgb, var(--surface) 92%, #fbfdff);
}

.react-flow__renderer,
.react-flow__container,
.react-flow {
  width: 100%;
  height: 100%;
}

.react-flow__controls,
.react-flow__minimap {
  border: 1px solid var(--border);
  box-shadow: none;
}

.react-flow__edge,
.react-flow__connection {
  z-index: 8 !important;
}

.react-flow__edgelabel-renderer {
  z-index: 9 !important;
}

.rf-bpmn-edge-label {
  position: absolute;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.react-flow__nodes {
  z-index: 6;
}

.rf-diagram-node {
  min-width: 170px;
  max-width: 280px;
  border: 1px solid var(--node-border, rgba(15, 23, 42, 0.12));
  border-radius: 16px;
  background: var(--node-surface, #ffffff);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
  padding: 14px 16px;
  color: var(--node-text, var(--text));
}

.rf-diagram-node--task,
.rf-diagram-node--userTask,
.rf-diagram-node--serviceTask,
.rf-diagram-node--manualTask,
.rf-diagram-node--scriptTask {
  min-width: 160px;
  max-width: 260px;
}

/* BPMN nodes: compact padding, no banner kicker. Task type is shown via a
   small corner glyph (BPMN spec), not via redundant "USER TASK" text. */
.rf-diagram-node--bpmn {
  padding: 11px 12px 10px 22px;
  position: relative;
}

.rf-diagram-node--bpmn .rf-node-kicker {
  display: none;
}

.rf-diagram-node--bpmn .rf-node-title {
  font-size: 0.92rem;
  line-height: 1.3;
}

/* Small BPMN task-type marker in the top-left corner (closer to BPMN spec
   which draws a tiny symbol there for user/service/script/manual tasks). */
.rf-diagram-node--bpmn.rf-diagram-node--userTask::before,
.rf-diagram-node--bpmn.rf-diagram-node--serviceTask::before,
.rf-diagram-node--bpmn.rf-diagram-node--scriptTask::before,
.rf-diagram-node--bpmn.rf-diagram-node--manualTask::before {
  position: absolute;
  top: 5px;
  left: 7px;
  font-size: 0.78rem;
  line-height: 1;
  opacity: 0.55;
  pointer-events: none;
}

.rf-diagram-node--bpmn.rf-diagram-node--userTask::before { content: "👤"; }
.rf-diagram-node--bpmn.rf-diagram-node--serviceTask::before { content: "⚙"; }
.rf-diagram-node--bpmn.rf-diagram-node--scriptTask::before { content: "📜"; }
.rf-diagram-node--bpmn.rf-diagram-node--manualTask::before { content: "✋"; }

.rf-diagram-node--decision {
  border-color: rgba(15, 92, 145, 0.24);
}

/* Technical diagram nodes — strict rectangular borders */
.rf-diagram-node--class,
.rf-diagram-node--interface,
.rf-diagram-node--entity,
.rf-diagram-node--group {
  border-radius: 0;
  border-width: 1.5px;
}

.rf-diagram-node--state {
  border-radius: 14px;
  border-width: 2px;
}

.rf-diagram-node--state .rf-node-kicker {
  font-size: 0.58rem;
  margin-bottom: 4px;
  opacity: 0.6;
}

.rf-diagram-node--state .rf-node-description {
  border-top: 1px solid var(--node-border, rgba(15, 23, 42, 0.12));
  margin-top: 6px;
  padding-top: 6px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--node-muted, var(--text-2));
}

/* Divider between title and lists for class/entity nodes */
.rf-diagram-node--class .rf-node-list,
.rf-diagram-node--interface .rf-node-list,
.rf-diagram-node--entity .rf-node-list {
  border-top: 1px solid var(--node-border, rgba(15, 23, 42, 0.12));
  margin-top: 8px;
  padding-top: 6px;
}

/* ERD column rows with PK/FK badges */
.rf-node-list--cols {
  gap: 4px;
}

.rf-col-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 0.74rem;
  line-height: 1.4;
}

.rf-col-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
  line-height: 1.5;
}

.rf-col-badge--pk {
  background: rgba(15, 92, 145, 0.12);
  color: var(--accent-text, #0b4b76);
}

.rf-col-badge--fk {
  background: rgba(100, 116, 139, 0.12);
  color: var(--text-2, #475569);
}

.rf-col-row--pk > span:last-child {
  font-weight: 600;
  color: var(--node-text, var(--text));
}

.rf-col-row--fk > span:last-child {
  font-style: italic;
  color: var(--node-muted, var(--text-2));
}

/* ERD relationship edge label */
.rf-erd-edge-label {
  position: absolute;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--text-2, #475569);
  font-size: 0.72rem;
  font-weight: 500;
  font-style: italic;
  line-height: 1;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
}

.rf-diagram-node--start,
.rf-diagram-node--end {
  border-radius: 999px;
  min-width: 80px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rf-diagram-node--start .rf-node-title,
.rf-diagram-node--end .rf-node-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.03em;
}

/* BPMN events: fixed-diameter circles with label floating BELOW the circle
   (per BPMN spec). The outer node box is the circle; .rf-node-title is
   absolutely positioned beneath it via overflow: visible. */
.rf-diagram-node--startEvent,
.rf-diagram-node--endEvent,
.rf-diagram-node--intermediateCatchEvent {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 999px;
  display: block;
  text-align: center;
  box-sizing: border-box;
  overflow: visible;
  position: relative;
}

/* Spec: start = thin single circle (default). End = thick single.
   Intermediate = double (inner outline). */
.rf-diagram-node--endEvent {
  border-width: 3px;
}

.rf-diagram-node--intermediateCatchEvent {
  outline: 2px solid var(--node-border, rgba(15, 23, 42, 0.22));
  outline-offset: -4px;
}

/* Hide the "START EVENT" banner kicker — BPMN events don't need a text type label. */
.rf-diagram-node--startEvent .rf-node-kicker,
.rf-diagram-node--endEvent .rf-node-kicker,
.rf-diagram-node--intermediateCatchEvent .rf-node-kicker {
  display: none;
}

/* Event label: sits below the circle, wraps to ~2 lines if needed. */
.rf-diagram-node--startEvent .rf-node-title,
.rf-diagram-node--endEvent .rf-node-title,
.rf-diagram-node--intermediateCatchEvent .rf-node-title {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  max-width: 150px;
  white-space: normal;
  color: var(--node-text, var(--text));
}

/* BPMN Gateway nodes — outer div is NOT rotated so React Flow places handles
   at the natural midpoints of the bounding box, which are the diamond tips.
   The visual diamond is a ::before pseudo-element: an inner square rotated 45°. */
/* Gateway bounding box: strict 90×90 square so React Flow places handles
   at the natural midpoints — which are also the diamond tips.
   overflow: visible lets the label float below without expanding the box. */
.rf-diagram-node--exclusiveGateway,
.rf-diagram-node--parallelGateway {
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  max-width: 80px;
  max-height: 80px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  position: relative;
  overflow: visible;
  box-sizing: border-box;
}

/* Diamond: inner 70%×70% square (63×63) rotated 45°.
   center-to-corner = 63×√2/2 ≈ 44.5px ≈ 45px = midpoint of 90px edge → tips at handles. */
.rf-diagram-node--exclusiveGateway::before,
.rf-diagram-node--parallelGateway::before {
  content: '';
  position: absolute;
  width: 70%;
  height: 70%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--node-surface, #ffffff);
  border: 1.5px solid var(--node-border, rgba(15, 23, 42, 0.2));
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  z-index: 0;
}

/* Symbol: absolutely centered inside the diamond */
.rf-diagram-node--exclusiveGateway .rf-node-kicker,
.rf-diagram-node--parallelGateway .rf-node-kicker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  font-size: 0;
  margin: 0;
  line-height: 1;
}

.rf-diagram-node--exclusiveGateway .rf-node-kicker::before {
  content: "✕";
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--node-accent, var(--accent));
  line-height: 1;
}

.rf-diagram-node--parallelGateway .rf-node-kicker::before {
  content: "+";
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--node-accent, var(--accent));
  line-height: 1;
}

/* Label: floats below the diamond, centered on the node's x-axis */
.rf-diagram-node--exclusiveGateway .rf-node-title,
.rf-diagram-node--parallelGateway .rf-node-title {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  font-size: 0.76rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--node-text, var(--text));
}

.rf-diagram-node .react-flow__handle-top,
.rf-diagram-node .react-flow__handle-bottom,
.rf-diagram-node .react-flow__handle-left,
.rf-diagram-node .react-flow__handle-right {
  width: 8px;
  height: 8px;
}

.rf-diagram-node--startEvent .react-flow__handle,
.rf-diagram-node--endEvent .react-flow__handle,
.rf-diagram-node--intermediateCatchEvent .react-flow__handle,
.rf-diagram-node--task .react-flow__handle,
.rf-diagram-node--userTask .react-flow__handle,
.rf-diagram-node--serviceTask .react-flow__handle,
.rf-diagram-node--manualTask .react-flow__handle,
.rf-diagram-node--scriptTask .react-flow__handle,
.rf-diagram-node--exclusiveGateway .react-flow__handle,
.rf-diagram-node--parallelGateway .react-flow__handle {
  opacity: 0;
}

.rf-bpmn-lane {
  width: 100%;
  height: 100%;
  border: 1.5px solid var(--lane-border, rgba(15, 23, 42, 0.18));
  border-radius: 6px;
  position: relative;
  overflow: visible;
  background:
    linear-gradient(
      90deg,
      var(--lane-surface, rgba(218, 228, 240, 0.72)) 0 72px,
      var(--lane-fill, rgba(236, 242, 249, 0.38)) 72px 100%
    );
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.rf-bpmn-lane__label {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lane-text, var(--text));
  opacity: 0.88;
  border-right: 1.5px solid var(--lane-border, rgba(15, 23, 42, 0.14));
  padding: 8px 0;
}

/* ─── GROUP / REGION CONTAINERS ─────────────────────────────────────────────── */

.rf-group-node {
  width: 100%;
  height: 100%;
  border: 1.5px solid var(--group-border, rgba(15, 23, 42, 0.10));
  border-radius: 14px;
  background: var(--group-surface, rgba(218, 228, 240, 0.22));
  position: relative;
}

.rf-group-node__label {
  position: absolute;
  top: 10px;
  left: 16px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--group-text, #475569);
  opacity: 0.62;
}

.rf-group-node__resize {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  opacity: 0;
  transition: opacity 120ms ease;
  border-radius: 4px;
  background:
    linear-gradient(135deg, transparent 50%, var(--group-border, rgba(15, 23, 42, 0.28)) 50%, var(--group-border, rgba(15, 23, 42, 0.28)) 60%, transparent 60%, transparent 70%, var(--group-border, rgba(15, 23, 42, 0.28)) 70%, var(--group-border, rgba(15, 23, 42, 0.28)) 80%, transparent 80%);
  pointer-events: all;
  z-index: 2;
}
.rf-group-node:hover .rf-group-node__resize,
.rf-group-node__resize:hover {
  opacity: 0.85;
}
.rf-group-node__resize:hover {
  opacity: 1;
}

.rf-node-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--node-muted, var(--text-3));
  margin-bottom: 6px;
}

.rf-node-title {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.rf-node-description {
  margin-top: 8px;
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--node-muted, var(--text-2));
}

.rf-node-list {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--node-muted, var(--text-2));
  display: grid;
  gap: 3px;
}

.rf-node-placeholder {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--node-muted, var(--text-3));
}

.react-flow__handle {
  width: 8px;
  height: 8px;
  border: 1px solid #fff;
  background: var(--accent);
}


.render-surface pre {
  margin: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* empty state visual handled by #canvas-empty — no pseudo-element needed */

/* ─── GENERATING ANIMATION ───────────────────────────────────────── */

.render-surface--generating {
  pointer-events: none;
}

.render-surface--generating::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(2px);
  animation: genFadeIn 0.3s ease-out both;
}

.render-surface--generating::after {
  content: "Generating your diagram…";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 101;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.02em;
  animation: genFadeIn 0.4s ease-out 0.1s both;
}

.render-surface--generating .react-flow,
.render-surface--generating .sequence-svg {
  filter: blur(2px) saturate(0.6);
  transition: filter 0.3s ease-out;
}

@keyframes genFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── EMPTY STATE ─────────────────────────────────────────────────── */

:root {
  --empty-node-fill: rgba(15, 92, 145, 0.06);
  --empty-node-stroke: rgba(15, 92, 145, 0.18);
  --empty-node-bar: rgba(15, 92, 145, 0.18);
  --empty-node-bar2: rgba(15, 92, 145, 0.1);
  --empty-accent-fill: rgba(15, 92, 145, 0.12);
  --empty-accent-stroke: rgba(15, 92, 145, 0.32);
  --empty-accent-bar: rgba(15, 92, 145, 0.3);
  --empty-accent-bar2: rgba(15, 92, 145, 0.16);
  --empty-edge: rgba(15, 92, 145, 0.2);
}

.canvas-empty {
  position: absolute;
  inset: 16px;
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 32px 24px;
  pointer-events: none;
  animation: emptyFadeIn 0.4s ease-out both;
  z-index: 1;
}

.canvas-empty.hidden {
  display: none;
}

@keyframes emptyFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* mini diagram illustration */
.canvas-empty-graphic {
  margin-bottom: 8px;
}

.empty-diagram-svg {
  width: 260px;
  height: auto;
  display: block;
}

/* staggered node entrance */
.empty-node {
  animation: nodeFloat 3.6s ease-in-out infinite;
  transform-origin: center;
}
.empty-node-1 { animation-delay: 0s; }
.empty-node-2 { animation-delay: 0.25s; }
.empty-node-3 { animation-delay: 0.5s; }
.empty-node-4 { animation-delay: 0.15s; }
.empty-node-5 { animation-delay: 0.4s; }

.empty-edge {
  animation: edgePulse 3.6s ease-in-out infinite;
}

@keyframes nodeFloat {
  0%, 100% { opacity: 0.7; transform: translateY(0); }
  50%       { opacity: 1;   transform: translateY(-2px); }
}

@keyframes edgePulse {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

/* text */
.canvas-empty-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.01em;
}

.canvas-empty-sub {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--text-3);
  text-align: center;
}

/* hint cards */
.canvas-empty-hints {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 560px;
}

.canvas-empty-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-width: 160px;
  max-width: 200px;
  flex: 1;
}

.hint-icon {
  font-size: 1rem;
  color: var(--accent);
  line-height: 1.4;
  flex-shrink: 0;
}

.hint-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hint-body strong {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.hint-body span {
  font-size: 0.72rem;
  color: var(--text-3);
  line-height: 1.4;
}

.hint-body em {
  font-style: normal;
  font-weight: 500;
  color: var(--accent-text);
}

@keyframes genDot {
  0%, 100% { opacity: 0.15; transform: scale(0.7); }
  50%      { opacity: 1;    transform: scale(1);    }
}

.gen-dots {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 102;
  width: 280px;
  height: 80px;
  pointer-events: none;
  animation: genFadeIn 0.3s ease-out both;
}

.gen-dot {
  fill: var(--accent, #3b82f6);
  opacity: 0.15;
  animation: genDot 1.8s ease-in-out infinite;
}

.gen-dot:nth-child(1) { animation-delay: 0s; }
.gen-dot:nth-child(2) { animation-delay: 0.25s; }
.gen-dot:nth-child(3) { animation-delay: 0.5s; }
.gen-dot:nth-child(4) { animation-delay: 0.75s; }
.gen-dot:nth-child(5) { animation-delay: 1.0s; }
.gen-dot:nth-child(6) { animation-delay: 1.25s; }

.gen-path {
  fill: none;
  stroke: var(--accent, #3b82f6);
  stroke-width: 1.5;
  stroke-dasharray: 6 10;
  stroke-linecap: round;
  opacity: 0.18;
  animation: genPathFlow 2s linear infinite;
}

@keyframes genPathFlow {
  to { stroke-dashoffset: -32; }
}

.status-text {
  margin: 0;
  min-height: 24px;
  padding: 2px 12px 8px;
  font-size: 0.72rem;
  color: var(--text-3);
}

/* ─── FOOTER ──────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(236, 242, 248, 0.88);
}

.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px clamp(16px, 3vw, 44px) 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-footer-inner p {
  margin: 0;
  color: var(--text-3);
  font-size: 0.76rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-links a {
  color: var(--text-3);
  text-decoration: none;
  font-size: 0.76rem;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--text-2);
}

/* ─── LEGAL PAGES ──────────────────────────────────────────────────── */

.legal-page {
  padding: clamp(60px, 8vw, 100px) clamp(16px, 4vw, 56px) clamp(80px, 10vw, 120px);
}

.legal-inner {
  max-width: 720px;
  margin: 0 auto;
}

.legal-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 8px;
}

.legal-date {
  font-size: 0.82rem;
  color: var(--text-3);
  margin: 0 0 48px;
}

.legal-body h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 40px 0 10px;
  letter-spacing: -0.01em;
}

.legal-body h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-2);
  margin: 24px 0 8px;
}

.legal-body p {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-2);
  margin: 0 0 16px;
}

.legal-body ul {
  margin: 0 0 16px;
  padding-left: 20px;
}

.legal-body ul li {
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--text-2);
  margin-bottom: 6px;
}

.legal-body a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-body code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--bg-2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ─── RIGHT STACK ─────────────────────────────────────────────────── */

.right-stack {
  border-left: 1px solid var(--border);
  background: var(--panel-alt);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.panel-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  min-height: 0;
}

.chat-section {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.code-panel {
  flex-shrink: 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
}

.section-head.clickable {
  cursor: pointer;
  user-select: none;
}

.section-title {
  margin: 0;
  font-size: 0.67rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.chat-history {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-message {
  font-size: 0.82rem;
  line-height: 1.5;
  border-radius: var(--radius);
  padding: 9px 12px;
  max-width: 96%;
  word-wrap: break-word;
}

.chat-message.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
}

.chat-message.assistant {
  align-self: flex-start;
  background: rgba(239, 244, 249, 0.92);
  color: var(--text);
  border: 1px solid var(--border);
}

.chat-message.system {
  align-self: center;
  font-size: 0.73rem;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid rgba(15, 92, 145, 0.18);
}

.chat-type-bar {
  padding: 8px 10px 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 1px solid var(--border);
}

.chat-type-bar .type-picker-row {
  margin: 0;
  gap: 5px;
}

.chat-type-bar .type-chip {
  padding: 3px 9px;
  font-size: 0.72rem;
}

.type-hint {
  font-size: 0.7rem;
  color: var(--text-3);
  padding-left: 2px;
}

.chat-compose {
  border-top: 1px solid var(--border);
  padding: 10px;
  display: flex;
  gap: 8px;
}

#chatInput {
  flex: 1;
  min-height: 68px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.5;
  resize: none;
  outline: none;
  padding: 10px;
  transition: border-color 0.15s ease;
}

#chatInput:focus {
  border-color: rgba(15, 92, 145, 0.38);
}

#chatInput::placeholder {
  color: var(--text-3);
}

.send-btn {
  min-width: 68px;
  min-height: 44px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.send-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.suggestions {
  border-top: 1px solid var(--border);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.example-chip {
  width: 100%;
  min-height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-2);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 5px 10px;
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.example-chip:hover {
  color: var(--text);
  background: rgba(237, 243, 249, 0.96);
  border-color: rgba(15, 23, 42, 0.22);
}

/* ─── CODE PANEL ──────────────────────────────────────────────────── */

.code-section summary {
  list-style: none;
}

.code-section summary::-webkit-details-marker {
  display: none;
}

.code-block {
  margin: 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-2);
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  line-height: 1.5;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.code-block:empty::after {
  content: "Diagram source will appear here";
  color: var(--text-3);
}

/* ─── FOCUS STATES ────────────────────────────────────────────────── */

.toolbar-btn:focus-visible,
.jump-link:focus-visible,
.site-nav a:focus-visible,
.site-cta:focus-visible,
.brand-mark:focus-visible,
.footer-links a:focus-visible,
.hero-cta:focus-visible,
.hero-ghost:focus-visible,
.rail-item:focus-visible,
.example-chip:focus-visible,
.send-btn:focus-visible,
.type-chip:focus-visible,
.paywall-close:focus-visible,
.auth-modal-close:focus-visible,
#chatInput:focus-visible,
.toolbar-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── ANIMATION ───────────────────────────────────────────────────── */

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── PAGE TRANSITIONS ────────────────────────────────────────────── */

body[data-page="home"].page-transitioning {
  overflow: hidden;
}

body[data-page="home"].page-transitioning .site-header,
body[data-page="home"].page-transitioning .mkt-section,
body[data-page="home"].page-transitioning .site-footer {
  opacity: 0.18;
  transform: translateY(10px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

body[data-page="home"].page-transitioning .hero-message,
body[data-page="home"].page-transitioning .hero-diagram-band {
  opacity: 0.3;
  transform: translateY(14px);
}


body[data-page="full"].app-pre-enter .app-shell,
body[data-page="full"].app-pre-enter .studio-topbar,
body[data-page="full"].app-pre-enter .site-footer,
body[data-page="full"].app-pre-enter .site-header {
  opacity: 0;
}

body[data-page="full"].app-pre-enter .app-shell {
  transform: translateY(22px) scale(0.985);
}

body[data-page="full"].app-pre-enter .left-rail {
  transform: translateX(-20px);
}

body[data-page="full"].app-pre-enter .right-stack {
  transform: translateX(20px);
}

body[data-page="full"] .app-shell,
body[data-page="full"] .studio-topbar,
body[data-page="full"] .site-footer,
body[data-page="full"] .site-header,
body[data-page="full"] .left-rail,
body[data-page="full"] .right-stack {
  transition: opacity 0.42s ease, transform 0.52s ease;
}

body[data-page="full"].app-enter-active .app-shell,
body[data-page="full"].app-enter-active .studio-topbar,
body[data-page="full"].app-enter-active .site-footer,
body[data-page="full"].app-enter-active .site-header,
body[data-page="full"].app-enter-active .left-rail,
body[data-page="full"].app-enter-active .right-stack {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* ─── RESPONSIVE ──────────────────────────────────────────────────── */

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr) 360px;
  }
}

@media (max-width: 980px) {
  .site-nav {
    display: none;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .hero-slider {
    height: 480px;
  }

  .mkt-steps {
    grid-template-columns: 1fr;
  }

  .mkt-step {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 36px 28px;
  }

  .mkt-step:last-child {
    border-bottom: none;
  }

  .mkt-built-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .mkt-persona-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mkt-persona {
    padding: 36px 28px;
  }

  .quick-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 90vh;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 110vh;
  }

  .left-rail {
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .rail-top,
  .rail-nav,
  .rail-settings,
  .rail-history,
  .rail-footer {
    min-width: 200px;
  }

  .rail-nav {
    flex-direction: row;
  }

  .right-stack {
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .chat-section {
    min-height: 420px;
  }

  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .front-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .hero-message h1 {
    max-width: 16ch;
    font-size: clamp(2.35rem, 14vw, 3.4rem);
  }

  .diagram-types-grid {
    grid-template-columns: 1fr;
  }

  .diagram-types-deck {
    padding: 22px 16px 28px;
    border-radius: 18px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-cta,
  .hero-ghost {
    width: 100%;
    min-width: 0;
  }

  .hero-slider {
    height: 420px;
  }
}

/* ── Sequence Canvas ─────────────────────────────────────────────────────── */

.sequence-canvas-wrap {
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
}

.sequence-canvas-wrap:active {
  cursor: grabbing;
}

.sequence-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── Type Picker Chips ───────────────────────────────────────────────────── */

.type-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 4px;
}

.type-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong, rgba(15, 23, 42, 0.16));
  background: transparent;
  color: var(--text-2, #475569);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.13s, color 0.13s, border-color 0.13s;
  white-space: nowrap;
}

.type-chip:hover {
  border-color: var(--accent, #0f5c91);
  color: var(--accent, #0f5c91);
  background: var(--accent-soft, rgba(15, 92, 145, 0.08));
}

.type-chip.active {
  background: var(--accent, #0f5c91);
  border-color: var(--accent, #0f5c91);
  color: #fff;
}

/* ── Template Gallery ────────────────────────────────────────────────────── */

.template-section {
  margin-top: 16px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.template-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3, #7b8ba1);
  margin: 0 0 10px;
}

.template-gallery {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.template-gallery::-webkit-scrollbar {
  width: 4px;
}

.template-gallery::-webkit-scrollbar-thumb {
  background: var(--border-strong, rgba(15, 23, 42, 0.16));
  border-radius: 4px;
}

.template-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border, rgba(15, 23, 42, 0.08));
  background: var(--panel, #f4f7fb);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.14s, background 0.14s, box-shadow 0.14s;
  width: 100%;
}

.template-card:hover {
  border-color: var(--accent, #0f5c91);
  background: var(--accent-soft, rgba(15, 92, 145, 0.06));
  box-shadow: 0 2px 8px rgba(15, 92, 145, 0.08);
}

.template-type-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft, rgba(15, 92, 145, 0.12));
  color: var(--accent, #0f5c91);
}

.template-type-badge--bpmn { background: rgba(127, 86, 217, 0.12); color: #7f56d9; }
.template-type-badge--sequence { background: rgba(16, 152, 139, 0.12); color: #10988b; }
.template-type-badge--erd { background: rgba(217, 119, 6, 0.12); color: #d97706; }
.template-type-badge--class { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.template-type-badge--state { background: rgba(220, 38, 38, 0.12); color: #dc2626; }
.template-type-badge--flowchart { background: rgba(15, 92, 145, 0.12); color: #0f5c91; }

.template-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text, #0f172a);
  line-height: 1.3;
}

.template-card-desc {
  font-size: 0.72rem;
  color: var(--text-3, #7b8ba1);
  line-height: 1.4;
}

.diagram-examples-home-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.examples-shell,
.example-detail-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 20px 72px;
}

.examples-hero {
  margin-bottom: 28px;
}

.examples-hero h1,
.example-detail-header h1 {
  margin: 10px 0 12px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.examples-hero-copy,
.example-detail-description {
  max-width: 760px;
  margin: 0;
  color: var(--text-2, #475569);
  font-size: 1rem;
  line-height: 1.7;
}

.diagram-example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.diagram-example-grid-home {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.diagram-example-card,
.diagram-example-empty,
.example-detail-header,
.example-detail-stage {
  border: 1px solid var(--border, rgba(15, 23, 42, 0.08));
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow, 0 18px 40px rgba(15, 23, 42, 0.08));
  backdrop-filter: blur(12px);
}

.diagram-example-card,
.diagram-example-empty {
  border-radius: 24px;
  padding: 22px;
}

.diagram-example-card h2,
.diagram-example-card h3,
.diagram-example-empty h2,
.diagram-example-empty h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.2;
}

.diagram-example-card p,
.diagram-example-empty p {
  margin: 0;
  color: var(--text-2, #475569);
  line-height: 1.65;
}

.diagram-example-card a {
  color: inherit;
  text-decoration: none;
}

.diagram-example-card a:hover {
  color: var(--accent, #0f5c91);
}

.diagram-example-card-head,
.example-detail-meta,
.diagram-example-stats,
.diagram-example-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.diagram-example-card-head,
.example-detail-meta {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.diagram-example-type,
.diagram-example-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--accent-soft, rgba(15, 92, 145, 0.12));
  color: var(--accent-text, #0b4b76);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.diagram-example-date,
.diagram-example-stats {
  color: var(--text-3, #7b8ba1);
  font-size: 0.82rem;
}

.diagram-example-tag-row {
  margin-top: 16px;
}

.diagram-example-stats {
  margin-top: 18px;
}

.example-detail-shell {
  display: grid;
  gap: 18px;
}

.example-related-section {
  display: grid;
  gap: 18px;
}

.example-related-head h2 {
  margin: 8px 0 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.example-detail-header,
.example-detail-stage {
  border-radius: 28px;
  padding: 28px;
}

.diagram-example-card--related h3 {
  margin: 0 0 10px;
}

.example-render-surface {
  min-height: 640px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.74);
}

@media (max-width: 900px) {
  .diagram-examples-home-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .example-render-surface {
    min-height: 460px;
  }
}

/* ─── PAYWALL MODAL ───────────────────────────────────────────────── */

.paywall-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

.paywall-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: paywallFadeIn 0.2s ease-out both;
}

.paywall-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px 36px 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
  animation: paywallSlideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.paywall-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}
.paywall-close:hover { color: var(--text); background: var(--panel); }

.paywall-icon {
  color: var(--accent);
  margin-bottom: 4px;
}

.paywall-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.paywall-body {
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0;
  max-width: 320px;
}

.paywall-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.paywall-cta {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
  font-family: var(--font-sans);
}
.paywall-cta:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(15, 92, 145, 0.3); }

.paywall-link {
  font-size: 0.82rem;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
}
.paywall-link:hover { color: var(--accent-text); }

@keyframes paywallFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes paywallSlideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── USAGE INDICATOR BAR ────────────────────────────────────────── */

.usage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  gap: 8px;
  margin-bottom: 4px;
}

.usage-bar[hidden] {
  display: none;
}

.usage-bar[data-urgency="low"] {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.usage-bar[data-urgency="empty"] {
  background: rgba(220, 38, 38, 0.07);
  border: 1px solid rgba(220, 38, 38, 0.2);
}

.usage-label {
  color: var(--text-2);
  font-weight: 500;
}

.usage-bar[data-urgency="empty"] .usage-label {
  color: #b91c1c;
}

.usage-upgrade-link {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent-text);
  text-decoration: none;
  white-space: nowrap;
}
.usage-upgrade-link:hover { text-decoration: underline; }
