:root {
  --accent: #6d28d9;
  --accent-dark: #5420ad;
  --tint: #f5f3ff;
  --ink: #17131f;
  --muted: #6f6879;
  --line: #e8e4ed;
  --panel: #ffffff;
  --canvas: #f8f7fa;
  --success: #15803d;
  --warning: #a16207;
  --danger: #b42318;
  --shadow: 0 18px 60px rgba(32, 22, 45, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #fff;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.public-page { min-height: 100vh; background: #fff; }
.public-nav { height: 76px; max-width: 1220px; margin: auto; padding: 0 28px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid rgba(232, 228, 237, .8); }
.public-nav nav { display: flex; gap: 30px; }
.public-nav nav a { text-decoration: none; color: #5f5869; font-size: 14px; }
.public-nav nav a:hover { color: var(--ink); }
.public-brand, .app-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-weight: 760; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--accent); box-shadow: 0 7px 18px rgba(109, 40, 217, .23); }
.brand-mark svg { width: 23px; height: 23px; }
.sign-in-link { justify-self: end; padding: 10px 17px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 650; }
.sign-in-link:hover { border-color: #cfc7d8; background: #faf9fb; }

.hero { max-width: 1220px; margin: auto; min-height: 690px; padding: 104px 28px 88px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(440px, .9fr); gap: 82px; align-items: center; }
.hero-content h1 { max-width: 730px; margin: 18px 0 24px; font-size: clamp(49px, 6.3vw, 82px); line-height: .98; letter-spacing: -.065em; font-weight: 720; }
.hero-kicker, .section-kicker, .eyebrow { color: var(--accent); font-size: 12px; line-height: 1; letter-spacing: .14em; text-transform: uppercase; font-weight: 780; }
.hero-copy { max-width: 650px; color: var(--muted); font-size: 19px; line-height: 1.65; }
.hero-actions { display: flex; align-items: center; gap: 14px; margin-top: 34px; }
.primary-action, .secondary-action, .google-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 19px; border-radius: 9px; font-size: 14px; font-weight: 720; text-decoration: none; cursor: pointer; }
.primary-action { color: #fff; border: 1px solid var(--accent); background: var(--accent); box-shadow: 0 8px 20px rgba(109, 40, 217, .18); }
.primary-action:hover { background: var(--accent-dark); }
button.primary-action { appearance: none; }
.secondary-action, .google-button { color: var(--ink); border: 1px solid var(--line); background: #fff; }
.secondary-action:hover, .google-button:hover { border-color: #cec5d7; background: #faf9fb; }
.wide { width: 100%; }
.proof-line { margin-top: 45px; display: flex; flex-wrap: wrap; gap: 20px; color: #746c7d; font-size: 12px; }
.proof-line span::before { content: "✓"; color: var(--accent); margin-right: 7px; font-weight: 800; }

.hero-visual { position: relative; }
.hero-visual::before { content: ""; position: absolute; inset: -65px -55px; z-index: 0; background: radial-gradient(circle, rgba(109, 40, 217, .12), transparent 67%); filter: blur(12px); }
.product-window { position: relative; z-index: 1; min-height: 490px; overflow: hidden; border: 1px solid #ded8e5; border-radius: 20px; background: #fbfafd; box-shadow: 0 30px 90px rgba(39, 24, 58, .15); transform: rotate(1.25deg); }
.canvas-head { height: 57px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); font-size: 13px; font-weight: 670; }
.mini-canvas { position: relative; height: 433px; background-color: #f8f7fa; background-image: radial-gradient(#d8d1df 1px, transparent 1px); background-size: 18px 18px; }
.flow-node { position: absolute; width: 218px; padding: 16px; z-index: 2; border: 1px solid #d8d1e0; border-radius: 13px; background: #fff; box-shadow: 0 10px 28px rgba(38, 25, 52, .09); }
.flow-node strong { display: block; margin: 6px 0; font-size: 14px; }
.flow-node p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.node-kind { color: var(--accent); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.node-start { top: 38px; left: 34px; }
.node-agent { top: 166px; right: 33px; border-color: rgba(109, 40, 217, .4); }
.node-end { left: 62px; bottom: 32px; }
.flow-line { position: absolute; height: 2px; z-index: 1; transform-origin: left center; background: linear-gradient(90deg, var(--accent), #b59add); }
.line-one { width: 175px; top: 132px; left: 194px; transform: rotate(29deg); }
.line-two { width: 170px; top: 285px; left: 207px; transform: rotate(139deg); }

.feature-section { padding: 108px 28px; border-top: 1px solid var(--line); background: #faf9fb; }
.section-intro { max-width: 760px; margin: 0 auto 58px; text-align: center; }
.section-intro h2, .developer-band h2 { margin: 16px 0; font-size: clamp(34px, 4vw, 52px); line-height: 1.08; letter-spacing: -.045em; }
.section-intro p, .developer-band p { color: var(--muted); font-size: 17px; line-height: 1.65; }
.feature-grid { max-width: 1164px; margin: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-grid article { min-height: 260px; padding: 34px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.feature-grid article > span { color: var(--accent); font-size: 12px; font-weight: 800; }
.feature-grid h3 { margin: 52px 0 12px; font-size: 21px; letter-spacing: -.025em; }
.feature-grid p { color: var(--muted); line-height: 1.65; }
.developer-band { max-width: 1164px; margin: 100px auto; padding: 62px; display: grid; grid-template-columns: 1fr auto; gap: 60px; align-items: center; border-radius: 18px; background: var(--tint); }
.developer-band > div { max-width: 720px; }
.public-footer { min-height: 100px; padding: 30px max(28px, calc((100vw - 1164px)/2)); display: flex; justify-content: space-between; align-items: center; gap: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.public-footer a { color: var(--accent); text-decoration: none; }

.auth-page { min-height: 100vh; padding: 28px; display: grid; place-items: center; background: radial-gradient(circle at 50% 10%, var(--tint), #fff 50%); }
.auth-brand { position: fixed; left: 32px; top: 27px; }
.auth-card { width: min(440px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.auth-card h1 { margin: 12px 0 9px; font-size: 31px; letter-spacing: -.04em; }
.auth-card > p { color: var(--muted); line-height: 1.55; }
.auth-card form { display: grid; gap: 15px; }
.auth-card label { display: grid; gap: 7px; color: #514959; font-size: 13px; font-weight: 650; }
.auth-card input { width: 100%; height: 45px; padding: 0 12px; border: 1px solid #d8d1df; border-radius: 8px; background: #fff; color: var(--ink); }
.auth-card input:focus { outline: 3px solid rgba(109, 40, 217, .13); border-color: var(--accent); }
.google-button { width: 100%; margin-top: 22px; }
.auth-divider { margin: 22px 0; display: flex; align-items: center; gap: 12px; color: #978f9f; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.form-error { margin: 0; color: var(--danger) !important; font-size: 13px; }

.app-frame { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); background: var(--canvas); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px 18px; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fff; }
.app-brand { padding: 0 8px 23px; font-size: 16px; }
.nav-links { display: grid; gap: 3px; overflow-y: auto; }
.nav-link { min-height: 39px; padding: 0 12px; display: flex; align-items: center; border-radius: 8px; color: #655d6d; text-decoration: none; font-size: 13px; font-weight: 590; }
.nav-link:hover { color: var(--ink); background: #f7f5f9; }
.nav-link.active { color: var(--accent); background: var(--tint); font-weight: 700; }
.nav-account { margin-top: auto; padding-top: 17px; border-top: 1px solid var(--line); }
.account-line { margin-bottom: 13px; display: grid; grid-template-columns: 32px 1fr; gap: 9px; align-items: center; min-width: 0; }
.account-line > div { min-width: 0; }
.account-line strong, .account-line small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-line strong { font-size: 12px; }
.account-line small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--accent); background: var(--tint); font-size: 12px; font-weight: 800; }
.quiet-button { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; color: #625a6b; background: #fff; cursor: pointer; font-size: 11px; }
.mobile-header { display: none; }
.app-main { width: min(1360px, 100%); margin: 0 auto; padding: 44px 46px 70px; overflow: hidden; }
.page-header { margin-bottom: 30px; display: flex; justify-content: space-between; align-items: end; gap: 24px; }
.page-header h1 { margin: 8px 0 7px; font-size: clamp(30px, 4vw, 42px); letter-spacing: -.045em; line-height: 1.08; }
.page-header p { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.55; }
.page-actions { flex: none; }
.metrics-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric { min-height: 135px; margin: 0; padding: 21px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.metric-label { margin: 0 0 15px; color: var(--muted); font-size: 12px; }
.metric-value { display: block; font-size: 31px; letter-spacing: -.04em; }
.metric-help { margin: 6px 0 0; color: #91899a; font-size: 11px; }
.panel { margin: 0 0 20px; padding: 22px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.section-head { margin-bottom: 18px; display: flex; justify-content: space-between; align-items: center; }
.section-head h2 { margin: 0; font-size: 16px; }
.section-head a { color: var(--accent); text-decoration: none; font-size: 12px; font-weight: 650; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 10px 12px; color: #877f90; background: #faf9fb; text-align: left; text-transform: uppercase; letter-spacing: .06em; font-size: 9px; }
td { padding: 13px 12px; border-top: 1px solid #eeeaf1; color: #5d5565; }
td:first-child { color: var(--ink); font-weight: 650; }
td a { text-decoration: none; }
td a:hover { color: var(--accent); }
.table-action, .text-action { color: var(--accent); font-weight: 680; text-decoration: none; }
.badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; color: #63596c; background: #f1eef4; font-size: 9px; font-weight: 760; text-transform: capitalize; }
.badge-active, .badge-completed, .badge-success, .badge-published { color: var(--success); background: #ecfdf3; }
.badge-draft, .badge-pending, .badge-paused { color: var(--warning); background: #fffbeb; }
.badge-failed, .badge-error, .badge-archived { color: var(--danger); background: #fef3f2; }
.empty-state { min-height: 300px; padding: 50px 24px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-state h2 { margin: 16px 0 8px; font-size: 20px; }
.empty-state p { max-width: 480px; margin: 0 0 20px; color: var(--muted); line-height: 1.6; }
.empty-mark { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 12px; color: var(--accent); background: var(--tint); }
.empty-mark svg { width: 28px; }
.filter-row { margin: -8px 0 20px; display: flex; gap: 7px; }
.filter-chip { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; text-decoration: none; font-size: 11px; }
.filter-chip.active { color: var(--accent); border-color: #cbb7ed; background: var(--tint); font-weight: 700; }
.resource-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.resource-card { min-height: 185px; margin: 0; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.resource-card h3 { margin: 18px 0 8px; font-size: 16px; letter-spacing: -.02em; }
.resource-card p { color: var(--muted); font-size: 12px; line-height: 1.55; }
.card-head { display: flex; justify-content: space-between; align-items: center; }
.card-meta { color: #8a8292; font-size: 9px; letter-spacing: .07em; text-transform: uppercase; }
.provider-count { min-width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; color: var(--accent); background: var(--tint); font-weight: 800; }
.feature-card { border-color: #d2c1ee; box-shadow: inset 0 3px 0 var(--accent); }
.context-strip { margin-bottom: 18px; padding: 13px 15px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: 11px; }
.notice { margin-bottom: 18px; padding: 12px 14px; border: 1px solid #d9cff0; border-radius: 8px; color: #513880; background: var(--tint); font-size: 12px; }
.notice-error { color: var(--danger); border-color: #f2c7c2; background: #fef3f2; }
.notice-success { color: var(--success); border-color: #b7e5c7; background: #ecfdf3; }
.stack-form { display: grid; gap: 17px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; }
.stack-form label, .inline-form label { display: grid; flex: 1 1 210px; gap: 7px; color: #514959; font-size: 12px; font-weight: 680; }
.stack-form input:not([type="checkbox"]), .stack-form select, .stack-form textarea,
.inline-form input:not([type="checkbox"]), .inline-form select, .inline-form textarea {
  width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid #d8d1df; border-radius: 8px; color: var(--ink); background: #fff;
}
.stack-form textarea, .inline-form textarea { resize: vertical; line-height: 1.5; }
.stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus,
.inline-form input:focus, .inline-form select:focus, .inline-form textarea:focus { outline: 3px solid rgba(109, 40, 217, .12); border-color: var(--accent); }
.form-panel h2 { margin-top: 0; font-size: 17px; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 10px; }
.form-actions .quiet-button { width: auto; min-height: 42px; padding-inline: 16px; display: inline-flex; align-items: center; text-decoration: none; }
.checkbox-line { display: flex !important; flex: none !important; grid-template-columns: auto 1fr; align-items: center; gap: 9px !important; }
.checkbox-line input { width: 17px; height: 17px; accent-color: var(--accent); }
.code-editor, pre code, .secret-reveal code { font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
pre { max-width: 100%; overflow: auto; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #faf9fb; }
.secret-reveal { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.secret-reveal code { min-width: 0; flex: 1; overflow-wrap: anywhere; padding: 13px; border-radius: 8px; background: #18131f; color: #f5f3ff; }
.two-column-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.log-entry { margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; }
.log-entry p { margin: 6px 0; color: var(--muted); }
.preview-page { min-height: 100vh; padding: 42px; background: radial-gradient(circle at 80% 15%, var(--tint), #fff 45%); }
.preview-card { width: min(680px, 100%); margin: 12vh auto; padding: 42px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.preview-card h1 { font-size: 42px; letter-spacing: -.045em; }
.preview-card p { color: var(--muted); line-height: 1.7; }
.embed-panel { margin-top: 22px; }

@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr; padding-top: 74px; }
  .hero-content { max-width: 850px; }
  .hero-visual { max-width: 600px; width: 100%; margin: auto; }
  .feature-grid, .resource-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .public-nav { height: 67px; padding: 0 18px; grid-template-columns: 1fr auto; }
  .public-nav nav { display: none; }
  .hero { min-height: auto; padding: 67px 20px 72px; gap: 58px; }
  .hero-content h1 { font-size: 49px; }
  .hero-copy { font-size: 16px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .proof-line { gap: 11px 16px; }
  .product-window { min-height: 430px; }
  .mini-canvas { height: 373px; }
  .flow-node { width: 190px; }
  .node-agent { right: 18px; }
  .feature-section { padding: 75px 20px; }
  .feature-grid, .resource-grid { grid-template-columns: 1fr; }
  .developer-band { margin: 64px 20px; padding: 34px 26px; grid-template-columns: 1fr; gap: 24px; }
  .public-footer { align-items: flex-start; flex-direction: column; }
  .auth-brand { position: static; margin-bottom: 26px; justify-self: start; }
  .auth-page { display: block; padding: 22px 18px; }
  .auth-card { margin: 42px auto; padding: 27px 22px; }
  .app-frame { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; width: 258px; transform: translateX(-105%); box-shadow: var(--shadow); transition: transform .18s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-header { height: 65px; padding: 0 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); background: #fff; }
  .mobile-header .brand-mark { width: 31px; height: 31px; }
  .mobile-menu-button { padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
  .app-main { padding: 31px 18px 55px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .metrics-grid { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 120px; padding: 17px; }
  .metric-value { font-size: 25px; }
  .panel { padding: 15px; }
  .two-column-grid { grid-template-columns: 1fr; }
  .preview-page { padding: 22px; }
}

@media (max-width: 430px) {
  .hero-content h1 { font-size: 42px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .product-window { transform: none; }
  .flow-node { width: 170px; }
  .node-start { left: 18px; }
  .node-end { left: 30px; }
}
