:root {
  --ink: #17202a;
  --muted: #667085;
  --line: #dfe5ea;
  --paper: #f4f7f8;
  --white: #ffffff;
  --blue: #0a65ff;
  --blue-dark: #004ac7;
  --mint: #9ff3d2;
  --night: #102027;
  --serif: Georgia, "Times New Roman", serif;
}

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

.site-shell { min-height: 100vh; overflow: hidden; }
.topnav {
  width: min(1180px, calc(100% - 40px));
  height: 78px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(23, 32, 42, .1);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.03em; font-size: 19px; width: max-content; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--night); color: white; font: 700 18px/1 var(--serif); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.version-pill { color: #4a5660; background: #e5ebed; border-radius: 999px; padding: 3px 7px; font-size: 10px; letter-spacing: .06em; }
.topnav nav { display: flex; align-items: center; gap: 30px; }
.nav-link { color: #66717a; font-size: 14px; text-decoration: none; font-weight: 700; position: relative; }
.nav-link:hover, .nav-link.active { color: var(--ink); }
.nav-link.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -27px; height: 2px; background: var(--blue); }
.nav-cta { justify-self: end; display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--night); color: white; border-radius: 999px; padding: 11px 17px; font-size: 12px; font-weight: 800; cursor: pointer; }
.nav-cta i { width: 7px; height: 7px; border-radius: 50%; background: #8e9ca3; box-shadow: 0 0 0 4px rgba(255,255,255,.06); }
.nav-cta.connected i { background: #35da99; }

.hero { width: min(980px, calc(100% - 40px)); margin: 88px auto 56px; text-align: center; position: relative; }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; filter: blur(1px); opacity: .9; }
.hero::before { width: 170px; height: 170px; left: -180px; top: 20px; background: radial-gradient(circle, rgba(159,243,210,.65), rgba(159,243,210,0) 68%); }
.hero::after { width: 220px; height: 220px; right: -210px; top: 0; background: radial-gradient(circle, rgba(10,101,255,.18), rgba(10,101,255,0) 68%); }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; color: #43515b; font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #29c486; box-shadow: 0 0 0 5px rgba(41,196,134,.12); }
.hero h1 { margin: 25px auto 23px; max-width: 850px; font: 500 clamp(52px, 7vw, 86px)/.97 var(--serif); letter-spacing: -.055em; }
.hero h1 span { color: var(--blue); font-style: italic; }
.hero > p { max-width: 670px; margin: 0 auto; color: var(--muted); font-size: 18px; line-height: 1.65; }
.hero-proof { display: flex; justify-content: center; gap: 36px; margin-top: 34px; color: #65727c; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.hero-proof span { display: flex; align-items: baseline; gap: 6px; }
.hero-proof b { color: var(--ink); font: 600 20px var(--serif); }

.studio-wrap { width: min(1040px, calc(100% - 40px)); margin: 0 auto 80px; }
.studio-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 19px; }
.section-kicker, .sheet-kicker { display: block; color: var(--blue); font-size: 10px; font-weight: 900; letter-spacing: .17em; margin-bottom: 7px; }
.studio-heading h2 { margin: 0; font: 500 26px/1.2 var(--serif); letter-spacing: -.025em; }
.mode-switch { display: inline-flex; background: #e6ebed; padding: 4px; border-radius: 10px; }
.mode-switch button { border: 0; background: transparent; color: #65717a; padding: 8px 14px; border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 800; }
.mode-switch button.selected { background: white; color: var(--ink); box-shadow: 0 1px 4px rgba(20,32,40,.1); }
.studio-card { background: var(--white); border: 1px solid #dbe2e6; border-radius: 22px; box-shadow: 0 22px 70px rgba(23,41,54,.1); overflow: hidden; }
.prompt-picker { display: grid; grid-template-columns: 200px 1fr; gap: 4px 22px; align-items: center; padding: 20px 24px; background: #f8fafb; border-bottom: 1px solid #e2e7ea; }
.prompt-picker label { grid-row: 1 / 3; font: 600 16px var(--serif); }
.prompt-picker p { margin: 0; color: #77838b; font-size: 11px; }
.select-wrap { position: relative; }
.select-wrap::after { content: "⌄"; position: absolute; right: 13px; top: 50%; transform: translateY(-55%); color: var(--blue); pointer-events: none; }
.prompt-picker select { appearance: none; width: 100%; border: 1px solid #d6dde2; background: white; border-radius: 10px; color: var(--ink); font-weight: 700; padding: 10px 38px 10px 12px; outline: none; }
.prompt-picker select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,101,255,.12); }
.prompt-stage { padding: 34px 38px 30px; }
.prompt-line { display: grid; grid-template-columns: 30px 1fr; gap: 13px; color: #293640; font: 400 19px/1.85 var(--serif); min-height: 150px; }
.prompt-icon { width: 28px; height: 28px; display: grid; place-items: center; color: var(--blue); background: #eaf2ff; border-radius: 50%; font: 700 14px Arial; margin-top: 3px; }
.token-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; border: 0; border-radius: 6px; margin: 0 2px; padding: 1px 5px 2px; background: #e9f2ff; color: var(--blue-dark); font: 700 17px/1.45 var(--serif); cursor: pointer; box-shadow: inset 0 -1px 0 rgba(10,101,255,.18); transition: transform .15s, background .15s; }
.token-chip:hover { background: #d8eaff; transform: translateY(-1px); }
.token-chip:focus-visible { outline: 3px solid rgba(10,101,255,.28); outline-offset: 2px; }
.token-chip span { color: #6d9bd2; font: 700 13px Arial; }
.prompt-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 30px 0 2px 43px; padding-top: 22px; border-top: 1px solid #edf0f2; }
.primary-action, .secondary-action, .ai-action, .run-action { min-height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9px; padding: 0 15px; border: 1px solid transparent; font-size: 12px; font-weight: 800; text-decoration: none; cursor: pointer; }
.primary-action { background: var(--blue); color: white; }
.primary-action:hover { background: var(--blue-dark); }
.secondary-action { background: white; color: var(--ink); border-color: #dce2e6; }
.ai-action { background: var(--night); color: white; }
.run-action { margin-left: auto; background: #eaf2ff; color: var(--blue-dark); border-color: #cfe1ff; }
.run-action:hover { background: #dbeaff; }
.run-action:disabled { cursor: wait; opacity: .72; }
.mini-spinner { width: 13px; height: 13px; border: 2px solid rgba(0,74,199,.22); border-top-color: var(--blue-dark); border-radius: 50%; animation: spin .75s linear infinite; }
.studio-status { height: 40px; display: flex; justify-content: space-between; align-items: center; padding: 0 24px; background: #f8fafb; border-top: 1px solid #e2e7ea; color: #7b878e; font-size: 10px; letter-spacing: .04em; }
.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #24c887; margin-right: 6px; }

.result-panel { margin: 25px 0 3px 43px; border: 1px solid #d5e1e7; border-radius: 13px; background: #f8fbfc; overflow: hidden; }
.result-panel.has-error { border-color: #f0c6c6; background: #fffafa; }
.result-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 52px; padding: 0 16px; border-bottom: 1px solid #e1e7ea; }
.result-heading > div { display: flex; align-items: center; gap: 9px; }
.result-heading strong { font: 600 15px var(--serif); }
.result-heading button { border: 0; background: transparent; color: var(--blue); font-size: 11px; font-weight: 800; cursor: pointer; }
.result-orb { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--night); color: white; font-size: 11px; }
.result-copy { max-height: 420px; overflow: auto; padding: 18px; color: #34434c; font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }

.template-stage { padding: 28px; }
.template-toolbar, .template-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.template-toolbar > div { display: flex; flex-direction: column; gap: 4px; }
.template-toolbar strong { font: 600 17px var(--serif); }
.template-toolbar span, .template-footer { color: #7b878e; font-size: 11px; }
.template-toolbar > .template-toolbar-actions { display: flex; flex-direction: row; align-items: center; gap: 7px; }
.form-title-field { display:grid; grid-template-columns:110px 1fr; align-items:center; gap:5px 14px; margin-top:18px; color:#4c5b63; font-size:10px; font-weight:900; letter-spacing:.08em; text-transform:uppercase; }
.form-title-field input { width:100%; height:42px; border:1px solid #d8e0e4; border-radius:9px; background:#fbfcfd; padding:0 12px; color:#26353e; font-size:13px; font-weight:700; letter-spacing:0; text-transform:none; outline:none; }
.form-title-field input:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(10,101,255,.1); }
.form-title-field small { grid-column:2; color:#879198; font-size:9px; font-weight:600; letter-spacing:0; text-transform:none; }
.open-builder-button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; border: 1px solid #cfe0ff; border-radius: 9px; background: #edf4ff; color: var(--blue-dark); padding: 0 13px; font-size: 12px; font-weight: 800; cursor: pointer; }
.open-builder-button:hover { background: #dfeaff; }
.open-builder-button span { color: var(--blue); font-size: 16px; }
.edit-builder-button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; border: 1px solid #d8e0e4; border-radius: 9px; background: white; color: #43525b; padding: 0 11px; font-size: 11px; font-weight: 800; cursor: pointer; }
.edit-builder-button:hover { border-color: #b9d1fb; background: #f7faff; color: var(--blue-dark); }
.edit-builder-button span { color: var(--blue); font-size: 14px; }
.template-notice { margin-top: -5px; border: 1px solid #f0d7a2; border-radius: 8px; background: #fff8e8; padding: 9px 11px; color: #765a1e; font-size: 10px; line-height: 1.45; }
.template-stage textarea { width: 100%; min-height: 250px; resize: vertical; margin: 17px 0 12px; border: 1px solid #d8e0e4; border-radius: 12px; padding: 18px; background: #fbfcfd; color: #26353e; font: 13px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; outline: none; }
.template-stage textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,101,255,.1); }
.template-footer button { border: 0; background: transparent; color: var(--blue); font-weight: 800; cursor: pointer; }

.why-grid { width: min(1040px, calc(100% - 40px)); margin: 0 auto 95px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #dbe2e5; border: 1px solid #dbe2e5; border-radius: 18px; overflow: hidden; }
.why-grid article { background: #f8faf9; padding: 30px; }
.why-grid article > span { color: var(--blue); font: italic 500 16px var(--serif); }
.why-grid h3 { margin: 25px 0 9px; font: 600 20px var(--serif); }
.why-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

footer { width: min(1180px, calc(100% - 40px)); min-height: 100px; margin: 0 auto; border-top: 1px solid rgba(23,32,42,.12); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; color: #718087; font-size: 12px; }
.footer-brand { font-size: 15px; color: var(--ink); }
.footer-brand .brand-mark { width: 27px; height: 27px; font-size: 15px; }
footer p { margin: 0; }
footer > a { justify-self: end; color: var(--blue); text-decoration: none; font-weight: 800; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(10,21,27,.45); backdrop-filter: blur(5px); display: flex; justify-content: flex-end; animation: fade-in .18s ease; }
.token-sheet { width: min(460px, 94vw); height: 100%; overflow-y: auto; background: #f8faf9; box-shadow: -24px 0 80px rgba(11,26,34,.25); padding: 52px 42px 34px; position: relative; animation: slide-in .23s ease; }
.sheet-close { position: absolute; top: 22px; right: 22px; width: 35px; height: 35px; border: 1px solid #d9e0e3; background: white; border-radius: 50%; color: #52606a; cursor: pointer; font-size: 22px; line-height: 1; }
.token-sheet h2 { margin: 0 0 8px; font: 500 36px/1.05 var(--serif); letter-spacing: -.03em; }
.token-sheet > p { margin: 0 0 30px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.option-list { display: grid; gap: 9px; }
.option-list label { display: grid; grid-template-columns: 1fr 24px; align-items: center; min-height: 53px; padding: 0 16px; border: 1px solid #dce3e6; border-radius: 10px; background: white; cursor: pointer; font-size: 14px; font-weight: 700; transition: border-color .15s, background .15s; }
.option-list input { position: absolute; opacity: 0; pointer-events: none; }
.option-list i { display: none; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: white; font-size: 11px; font-style: normal; }
.option-list label.checked { border-color: var(--blue); background: #edf4ff; color: var(--blue-dark); }
.option-list label.checked i { display: grid; }
.option-list.multi i { border-radius: 6px; }
.text-field { display: grid; gap: 8px; color: #44515a; font-size: 12px; font-weight: 800; }
.text-field textarea { width: 100%; resize: vertical; border: 1px solid #d8e0e4; border-radius: 11px; padding: 13px; background: white; color: var(--ink); line-height: 1.55; outline: none; }
.text-field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,101,255,.1); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 28px; padding-top: 22px; border-top: 1px solid #dfe5e8; }
.field-modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(10,21,27,.48); backdrop-filter: blur(5px); animation: fade-in .16s ease; }
.field-modal { position: relative; width: min(480px, 100%); max-height: min(720px, calc(100vh - 40px)); overflow-y: auto; padding: 36px; border: 1px solid rgba(255,255,255,.7); border-radius: 19px; background: #f8faf9; box-shadow: 0 28px 100px rgba(8,25,34,.3); animation: modal-in .2s ease; }
.field-modal-close { position: absolute; top: 18px; right: 18px; width: 35px; height: 35px; border: 1px solid #d9e0e3; background: white; border-radius: 50%; color: #52606a; cursor: pointer; font-size: 22px; line-height: 1; }
.field-modal h2 { margin: 0 42px 8px 0; font: 500 34px/1.05 var(--serif); letter-spacing: -.03em; }
.field-modal > p { margin: 0 0 24px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.sync-note { display: flex; align-items: center; gap: 9px; margin: -8px 0 20px; padding: 10px 12px; border: 1px solid #d4e7df; border-radius: 9px; background: #eef9f5; color: #426256; font-size: 10px; line-height: 1.45; }
.sync-note span { width: 22px; height: 22px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #d4f3e6; font-size: 14px; }
.quick-options { max-height: 390px; overflow-y: auto; padding: 2px; }
.instant-select-field { display: grid; gap: 9px; color: #44515a; font-size: 11px; font-weight: 800; }
.instant-select-field select { width: 100%; height: 56px; appearance: auto; border: 1px solid #cfd9de; border-radius: 11px; background: white; padding: 0 13px; color: var(--ink); font-size: 17px; font-weight: 700; outline: none; cursor: pointer; }
.instant-select-field select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(10,101,255,.1); }
.instant-select-field small { color: #7d898f; font-size: 10px; font-weight: 600; }
.field-modal-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; padding-top: 19px; border-top: 1px solid #dfe5e8; }
.field-modal-actions > span { color: #7c888f; font-size: 9px; }
.connection-sheet > p { margin-bottom: 22px; }
.privacy-note { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 14px; margin: 0 0 24px; border: 1px solid #d7e4df; border-radius: 10px; background: #eff9f5; color: #36594c; }
.privacy-note > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #d5f4e7; font-size: 18px; }
.privacy-note strong { font-size: 12px; }
.privacy-note p { margin: 4px 0 0; font-size: 10px; line-height: 1.55; }
.connection-field { display: grid; gap: 7px; margin-bottom: 16px; color: #42515a; font-size: 11px; font-weight: 800; }
.connection-field input { width: 100%; height: 45px; border: 1px solid #d5dee2; border-radius: 9px; background: white; padding: 0 12px; color: var(--ink); outline: none; }
.connection-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,101,255,.1); }
.connection-grid { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.key-link { display: inline-flex; gap: 6px; color: var(--blue); font-size: 11px; font-weight: 800; text-decoration: none; }
.danger-action { margin-right: auto; color: #b23c3c; }
.primary-action:disabled { opacity: .48; cursor: not-allowed; }

.builder-backdrop { z-index: 70; }
.builder-modal { width: min(860px, 100%); max-height: min(900px, calc(100vh - 32px)); padding: 34px; }
.builder-modal > p { margin-bottom: 19px; }
.builder-type-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.builder-type-grid > button { min-width: 0; min-height: 67px; display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 8px; border: 1px solid #dce3e7; border-radius: 11px; background: white; padding: 9px; color: var(--ink); text-align: left; cursor: pointer; }
.builder-type-grid > button:hover { border-color: #b9d1fb; }
.builder-type-grid > button.selected { border-color: var(--blue); background: #edf4ff; box-shadow: 0 0 0 2px rgba(10,101,255,.07); }
.builder-type-grid b { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 8px; background: #eef2f4; color: #56656d; font: 700 12px var(--serif); }
.builder-type-grid button.selected b { background: var(--blue); color: white; }
.builder-type-grid span { min-width: 0; display: grid; gap: 3px; }
.builder-type-grid strong { font-size: 10px; }
.builder-type-grid small { overflow: hidden; color: #819098; font-size: 8px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.builder-workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(230px, .65fr); gap: 18px; align-items: start; }
.builder-form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.builder-field { display: grid; gap: 7px; color: #45535c; font-size: 10px; font-weight: 800; }
.builder-field.wide, .builder-options, .builder-note, .numeric-builder { grid-column: 1 / -1; }
.builder-field > span { display: flex; justify-content: space-between; gap: 8px; }
.builder-field > span small { color: #919da3; font-size: 8px; font-weight: 700; }
.builder-field > input, .builder-field > textarea { width: 100%; border: 1px solid #d5dee2; border-radius: 9px; background: white; padding: 0 11px; color: var(--ink); outline: none; }
.builder-field > input { height: 43px; }
.builder-field > textarea { min-height: 78px; padding-top: 10px; resize: vertical; line-height: 1.45; }
.builder-field > input:focus, .builder-field > textarea:focus, .builder-option > input[type="text"]:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,101,255,.09); }
.builder-field > small { color: #89969d; font-size: 8px; font-weight: 500; }
.builder-field code { color: var(--blue-dark); }
.builder-note { display: grid; grid-template-columns: 25px 1fr; gap: 10px; padding: 10px 12px; border: 1px solid #d7e3ea; border-radius: 9px; background: #f3f8fb; color: #4b6370; }
.builder-note > span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #dfeeff; color: var(--blue); font-size: 12px; }
.builder-note strong { font-size: 9px; }
.builder-note p { margin: 3px 0 0; font-size: 8px; line-height: 1.45; }
.builder-note.sync { border-color: #d4e7df; background: #eef9f5; color: #426256; }
.builder-note.sync > span { background: #d4f3e6; color: #22865f; }
.builder-options { min-width: 0; margin: 0; padding: 0; border: 0; }
.builder-options legend { width: 100%; display: flex; justify-content: space-between; margin-bottom: 7px; color: #45535c; font-size: 10px; font-weight: 800; }
.builder-options legend small { color: #919da3; font-size: 8px; }
.builder-option-list { display: grid; gap: 7px; }
.builder-option { display: grid; grid-template-columns: 18px 1fr 31px; align-items: center; gap: 8px; }
.builder-option > input[type="checkbox"], .builder-option > input[type="radio"] { width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.builder-option > input:not([type="checkbox"]):not([type="radio"]) { width: 100%; height: 39px; border: 1px solid #d5dee2; border-radius: 8px; background: white; padding: 0 10px; color: var(--ink); font-size: 10px; outline: none; }
.builder-option > button { width: 31px; height: 31px; border: 1px solid #dce3e6; border-radius: 8px; background: white; color: #78858c; cursor: pointer; }
.builder-option > button:hover { border-color: #e5bcbc; color: #b23c3c; }
.add-option { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px; border: 0; background: transparent; color: var(--blue); padding: 4px 0; font-size: 9px; font-weight: 800; cursor: pointer; }
.numeric-builder { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.builder-preview { position: sticky; top: 0; overflow: hidden; border: 1px solid #d9e1e5; border-radius: 13px; background: white; }
.builder-preview > span, .builder-code > span { display: block; color: #87949b; font-size: 7px; font-weight: 900; letter-spacing: .14em; }
.builder-preview > span { padding: 14px 15px 0; }
.builder-preview-control { min-height: 92px; display: grid; place-items: center; padding: 17px 15px; }
.builder-preview-control > button { max-width: 100%; display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 7px; background: #e9f2ff; color: var(--blue-dark); padding: 7px 9px; font: 700 14px/1.35 var(--serif); }
.builder-preview-control.kind-e > button { border-radius: 8px; background: var(--blue); color: white; font: 800 10px Arial, sans-serif; }
.builder-preview-control.kind-h { display: flex; align-items: center; justify-content: center; gap: 7px; color: #7c898f; font-size: 9px; }
.builder-code { display: grid; gap: 9px; padding: 14px 15px; background: var(--night); }
.builder-code code { overflow-wrap: anywhere; color: #baf7df; font: 9px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.builder-preview > p { margin: 0; padding: 12px 15px 14px; color: #7d898f; font-size: 8px; line-height: 1.45; }
.builder-preview q { color: #3f5360; }
.builder-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; padding-top: 17px; border-top: 1px solid #dfe5e8; }

.guide-back { justify-self: end; color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: none; }
.guide-hero { width: min(900px, calc(100% - 40px)); margin: 82px auto 88px; text-align: center; }
.guide-hero h1 { margin: 13px 0 20px; font: 500 clamp(54px, 7vw, 84px)/.95 var(--serif); letter-spacing: -.055em; }
.guide-hero h1 em { color: var(--blue); font-weight: 400; }
.guide-hero > p { max-width: 580px; margin: 0 auto; color: var(--muted); font-size: 16px; line-height: 1.6; }
.anatomy { max-width: 660px; margin: 40px auto 0; padding: 24px 28px 18px; border: 1px solid #d9e1e5; border-radius: 16px; background: white; box-shadow: 0 18px 55px rgba(23,41,54,.08); }
.anatomy > code { color: #18384b; font: 700 clamp(14px, 2.3vw, 21px)/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.anatomy > div { display: grid; grid-template-columns: .7fr 1.8fr 2fr 1fr; gap: 8px; margin-top: 13px; color: #839099; font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.builder-section, .resource-demo-section, .range-section, .type-section, .embed-section, .event-section { width: min(1040px, calc(100% - 40px)); margin: 0 auto 90px; }
.builder-section { display: grid; grid-template-columns: .75fr 1.25fr; align-items: center; gap: 60px; }
.builder-intro h2, .type-heading h2, .embed-section h2, .event-section h2 { margin: 0; font: 500 38px/1.08 var(--serif); letter-spacing: -.035em; }
.builder-intro p, .embed-section p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.builder-card { overflow: hidden; border: 1px solid #dbe2e6; border-radius: 17px; background: white; box-shadow: 0 18px 55px rgba(23,41,54,.08); }
.builder-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 24px; }
.builder-fields label { display: grid; gap: 7px; color: #45525a; font-size: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.builder-fields label.wide { grid-column: 1 / -1; }
.builder-fields small { color: #89949a; font-size: 8px; }
.builder-fields .destination-status { display:block; padding:8px 10px; border-radius:7px; background:#f0f4f5; color:#5c6c72; font-size:9px; font-weight:800; letter-spacing:0; text-transform:none; }
.builder-fields .destination-status[data-method="email"] { background:#eaf7f1; color:#246249; }
.builder-fields .destination-status[data-method="post"] { background:#eaf2ff; color:#245a99; }
.builder-fields input, .builder-fields select { width: 100%; height: 43px; border: 1px solid #d7dfe3; border-radius: 8px; background: #fbfcfd; padding: 0 11px; color: var(--ink); font-size: 12px; text-transform: none; outline: none; }
.builder-fields input:focus, .builder-fields select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10,101,255,.09); }
.shortcode-output { min-height: 92px; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 22px; background: var(--night); color: white; }
.shortcode-output > div { min-width: 0; display: grid; gap: 8px; }
.shortcode-output span { color: #87a0ac; font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.shortcode-output code { overflow-wrap: anywhere; color: #baf7df; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.shortcode-output button { flex: 0 0 auto; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: rgba(255,255,255,.08); color: white; padding: 9px 11px; font-size: 10px; font-weight: 800; cursor: pointer; }
.resource-demo-section { display:grid; grid-template-columns:.78fr 1.22fr; gap:48px; align-items:center; padding:45px; border-radius:22px; background:#e7eeef; }
.resource-demo-copy h2 { margin:8px 0 14px; font:500 40px/1.06 var(--serif); letter-spacing:-.04em; }
.resource-demo-copy p { margin:0; color:var(--muted); font-size:13px; line-height:1.65; }
.resource-demo-copy ul { display:grid; gap:7px; margin:18px 0 0; padding:0; list-style:none; }
.resource-demo-copy li { color:#40525c; font-size:11px; }
.resource-demo-copy li::before { content:"✓"; margin-right:8px; color:#159769; font-weight:900; }
.resource-demo-card { min-width:0; padding:25px; border:1px solid #d5dfe3; border-radius:17px; background:#fff; box-shadow:0 18px 50px rgba(23,41,54,.08); }
.resource-demo-card > span { display:block; margin-bottom:14px; color:#78868d; font-size:8px; font-weight:900; letter-spacing:.14em; }
.resource-demo-card .pi2-line { font-size:17px; line-height:1.8; }
.resource-demo-card .pi2-actions .pi2-edit { margin-left:0; }
.range-heading { max-width: 620px; margin-bottom: 24px; }
.range-heading h2 { margin: 0; font: 500 38px/1.08 var(--serif); letter-spacing: -.035em; }
.range-heading p { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.range-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.range-grid article { padding: 24px; border: 1px solid #d9e1e5; border-radius: 14px; background: white; }
.range-grid article > span { color: var(--blue); font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.range-grid code { display: block; margin: 20px 0 11px; color: #24495d; font: 700 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.range-grid p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.type-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 25px; }
.type-list { border-top: 1px solid #d8e0e4; }
.type-list article { display: grid; grid-template-columns: 50px 1fr minmax(300px, .8fr) 35px; align-items: center; gap: 20px; min-height: 105px; border-bottom: 1px solid #d8e0e4; }
.type-letter { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: #e8f1ff; color: var(--blue); font: 700 16px var(--serif); }
.type-list h3 { margin: 0 0 5px; font: 600 18px var(--serif); }
.type-list p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.type-list code { color: #315267; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.type-list button { width: 34px; height: 34px; border: 1px solid #d8e0e4; border-radius: 8px; background: white; color: var(--blue); cursor: pointer; }
.embed-section { display: grid; grid-template-columns: .85fr 1.15fr; gap: 55px; align-items: center; padding: 48px; border-radius: 22px; background: #e9eef0; }
.embed-section > div > code { padding: 1px 4px; border-radius: 4px; background: #dbe3e6; font-size: 11px; }
.embed-links { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 21px; }
.embed-links a { color: var(--blue); font-size: 10px; font-weight: 900; text-decoration: none; }
.embed-section pre, .event-section pre { margin: 0; overflow-x: auto; border-radius: 13px; background: var(--night); padding: 23px; color: #c8f7e6; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.embed-section pre code, .event-section pre code { font: 11px/1.8 ui-monospace, SFMono-Regular, Menlo, monospace; }
.event-section { text-align: center; }
.event-section > p { max-width:720px; margin:15px auto 0; color:var(--muted); font-size:13px; line-height:1.65; }
.event-section > p a { color:var(--blue); font-weight:800; text-decoration:none; }
.event-section pre { max-width: 670px; margin: 24px auto 0; text-align: left; }

.endpoint-hero { margin-bottom: 64px; }
.endpoint-route-grid, .endpoint-lab-intro, .endpoint-lab-grid, .endpoint-teaching-strip, .payload-section, .endpoint-code-section, .production-section { width:min(1120px,calc(100% - 40px)); margin:0 auto 88px; }
.endpoint-route-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.endpoint-route-grid article { position:relative; overflow:hidden; padding:34px; border:1px solid #d8e1e5; border-radius:19px; background:#fff; box-shadow:0 18px 55px rgba(23,41,54,.07); }
.endpoint-route-grid article::after { content:""; position:absolute; width:170px; height:170px; right:-90px; top:-90px; border-radius:50%; background:rgba(10,101,255,.07); }
.route-icon { display:grid; place-items:center; width:42px; height:42px; margin-bottom:22px; border-radius:12px; background:#e8f1ff; color:var(--blue); font-size:20px; font-weight:900; }
.endpoint-route-grid small { color:var(--blue); font-size:9px; font-weight:900; letter-spacing:.15em; }
.endpoint-route-grid h2, .endpoint-lab-intro h2, .endpoint-lab-card h2, .payload-section h2, .endpoint-code-section h2, .production-section h2 { margin:8px 0 12px; font:500 38px/1.07 var(--serif); letter-spacing:-.035em; }
.endpoint-route-grid p, .endpoint-lab-intro p, .endpoint-lab-card p, .payload-section p, .endpoint-code-section p, .production-section p { margin:0; color:var(--muted); font-size:13px; line-height:1.65; }
.copy-row { display:flex; align-items:center; gap:10px; margin-top:24px; padding:11px 11px 11px 14px; border-radius:10px; background:#f2f6f7; }
.copy-row code { min-width:0; flex:1; overflow-wrap:anywhere; color:#284e61; font:10px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; }
.copy-row button, .endpoint-code-heading button { flex:0 0 auto; border:0; border-radius:8px; background:var(--night); color:#fff; padding:9px 12px; font-size:9px; font-weight:900; cursor:pointer; }
.endpoint-lab-intro { max-width:780px; margin-bottom:34px; text-align:center; }
.endpoint-lab-intro h2 { margin-top:10px; font-size:46px; }
.endpoint-lab-intro p { max-width:720px; margin:0 auto; font-size:14px; }
.endpoint-lab-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; margin-bottom:22px; }
.endpoint-lab-card { min-width:0; padding:28px; border:1px solid #d8e1e5; border-radius:22px; background:#fff; box-shadow:0 22px 65px rgba(23,41,54,.08); }
.endpoint-lab-header { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:23px; }
.endpoint-lab-header > div { display:flex; align-items:flex-start; gap:13px; }
.route-number { display:grid; place-items:center; flex:0 0 auto; width:38px; height:38px; border-radius:11px; background:var(--night); color:#fff; font-size:10px; font-weight:900; }
.endpoint-lab-header small { color:var(--blue); font-size:8px; font-weight:900; letter-spacing:.14em; }
.endpoint-lab-header h2 { margin:4px 0 0; font-size:29px; }
.route-status { flex:0 0 auto; padding:8px 10px; border-radius:999px; background:#e9f7f1; color:#226148; font-size:8px; font-weight:900; white-space:nowrap; }
.route-status[data-method="post"] { background:#e9f2ff; color:#1956a7; }
.route-status[data-method="invalid"] { background:#fff2df; color:#8b5a0e; }
.endpoint-lab-settings { display:grid; gap:10px; margin-bottom:16px; padding:15px; border-radius:14px; background:#f1f5f6; }
.endpoint-lab-settings label { display:grid; grid-template-columns:150px 1fr; align-items:center; gap:13px; color:#31434d; font-size:10px; font-weight:900; }
.endpoint-lab-settings label span small { display:block; margin-top:3px; color:#7a8990; font-size:8px; font-weight:650; }
.endpoint-lab-settings input { min-width:0; width:100%; height:39px; border:1px solid #cdd8dd; border-radius:8px; background:#fff; padding:0 10px; color:var(--night); font:600 11px/1.2 var(--sans); outline:none; }
.endpoint-lab-settings input:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(10,101,255,.11); }
.endpoint-lab-settings input[aria-invalid="true"] { border-color:#d6952f; box-shadow:0 0 0 3px rgba(214,149,47,.1); }
.endpoint-live-preview { min-height:208px; padding:20px; border:1px solid #d9e2e5; border-radius:15px; background:#fbfcfc; }
.endpoint-preview-label { display:block; margin-bottom:13px; color:#7b8b92; font-size:8px; font-weight:900; letter-spacing:.13em; }
.endpoint-live-preview .pi2-line { font-size:16px; line-height:1.75; }
.endpoint-live-preview .pi2-actions { margin-top:16px; }
.endpoint-live-preview .pi2-actions .pi2-edit { margin-left:0; }
.endpoint-result-note { min-height:62px; margin:13px 0; padding:12px 14px; border-left:3px solid #55c99a; border-radius:0 9px 9px 0; background:#edf8f4; color:#476059; font-size:10px; line-height:1.55; }
.endpoint-live-code { overflow:hidden; border-radius:13px; background:var(--night); color:#c8f7e6; }
.endpoint-live-code > div { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border-bottom:1px solid rgba(255,255,255,.09); }
.endpoint-live-code > div span { color:#8ca0a9; font-size:8px; font-weight:900; letter-spacing:.13em; }
.endpoint-live-code button { border:1px solid rgba(255,255,255,.13); border-radius:7px; background:rgba(255,255,255,.07); color:#fff; padding:7px 9px; font-size:8px; font-weight:900; cursor:pointer; }
.endpoint-live-code pre { min-height:163px; max-height:240px; margin:0; overflow:auto; padding:15px; }
.endpoint-live-code code { color:#c8f7e6; white-space:pre-wrap; overflow-wrap:anywhere; font:9px/1.65 ui-monospace,SFMono-Regular,Menlo,monospace; }
.endpoint-privacy { margin-top:13px !important; padding-left:12px; border-left:3px solid #55c99a; font-size:10px !important; }
.endpoint-teaching-strip { display:grid; grid-template-columns:repeat(3,1fr); gap:1px; overflow:hidden; margin-bottom:88px; border:1px solid #d8e1e5; border-radius:17px; background:#d8e1e5; }
.endpoint-teaching-strip article { display:flex; gap:13px; padding:20px; background:#fff; }
.endpoint-teaching-strip b { display:grid; place-items:center; flex:0 0 auto; width:27px; height:27px; border-radius:50%; background:#e8f1ff; color:var(--blue); font-size:9px; }
.endpoint-teaching-strip h3 { margin:1px 0 5px; font:600 16px var(--serif); }
.endpoint-teaching-strip p { margin:0; color:var(--muted); font-size:10px; line-height:1.55; }
.payload-section { display:grid; grid-template-columns:.75fr 1.25fr; gap:60px; align-items:center; }
.payload-table { overflow:hidden; border:1px solid #d8e1e5; border-radius:16px; background:#fff; }
.payload-table > div { display:grid; grid-template-columns:155px 1fr; align-items:center; gap:18px; padding:18px 20px; border-bottom:1px solid #e3e8eb; }
.payload-table > div:last-child { border-bottom:0; }
.payload-table code { width:max-content; max-width:100%; padding:5px 8px; border-radius:6px; background:#eaf2ff; color:#1859aa; font:700 11px ui-monospace,SFMono-Regular,Menlo,monospace; }
.payload-table span { color:#596a73; font-size:12px; line-height:1.5; }
.endpoint-code-section { overflow:hidden; border-radius:22px; background:var(--night); color:#fff; box-shadow:0 25px 75px rgba(16,32,39,.18); }
.endpoint-code-heading { display:flex; align-items:end; justify-content:space-between; gap:26px; padding:37px 40px 25px; }
.endpoint-code-heading h2 { margin-top:5px; }
.endpoint-code-heading p { max-width:620px; color:#9fb0b7; }
.endpoint-code-heading button { border:1px solid rgba(255,255,255,.17); background:rgba(255,255,255,.08); }
.endpoint-code-section pre { max-height:570px; margin:0; overflow:auto; padding:28px 40px; border-top:1px solid rgba(255,255,255,.09); border-bottom:1px solid rgba(255,255,255,.09); background:#0b191f; color:#c8f7e6; }
.endpoint-code-section pre code { font:11px/1.72 ui-monospace,SFMono-Regular,Menlo,monospace; }
.endpoint-code-actions { display:flex; gap:22px; flex-wrap:wrap; padding:20px 40px 24px; }
.endpoint-code-actions a { color:var(--mint); font-size:10px; font-weight:900; text-decoration:none; }
.production-section > div:first-child { display:flex; align-items:end; justify-content:space-between; margin-bottom:24px; }
.production-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:13px; }
.production-grid article { padding:27px; border:1px solid #d8e1e5; border-radius:15px; background:#fff; }
.production-grid b { color:var(--blue); font-size:10px; letter-spacing:.14em; }
.production-grid h3 { margin:13px 0 8px; font:600 21px var(--serif); }

@keyframes fade-in { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(30px); opacity: .6; } }
@keyframes modal-in { from { transform: translateY(12px) scale(.985); opacity: .7; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .topnav { grid-template-columns: 1fr auto; }
  .topnav nav { display: none; }
  .nav-cta { font-size: 0; padding: 12px; }
  .hero { margin-top: 64px; }
  .hero h1 { font-size: clamp(44px, 13vw, 66px); }
  .hero-proof { gap: 16px; flex-wrap: wrap; }
  .studio-heading { align-items: start; flex-direction: column; }
  .prompt-picker { grid-template-columns: 1fr; }
  .prompt-picker label { grid-row: auto; }
  .prompt-stage { padding: 26px 20px 22px; }
  .prompt-line { grid-template-columns: 1fr; font-size: 18px; }
  .prompt-icon { display: none; }
  .prompt-actions { margin-left: 0; }
  .run-action { margin-left: 0; }
  .result-panel { margin-left: 0; }
  .why-grid { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr; padding: 28px 0; text-align: center; justify-items: center; }
  footer > a { justify-self: center; }
  .token-sheet { padding: 52px 25px 28px; }
  .field-modal-backdrop { align-items: end; padding: 10px; }
  .field-modal { width: 100%; max-height: calc(100vh - 20px); padding: 31px 22px 23px; border-radius: 18px 18px 12px 12px; }
  .builder-modal { padding: 27px 18px 20px; }
  .builder-type-grid { grid-template-columns: repeat(2, 1fr); }
  .builder-workspace { grid-template-columns: 1fr; }
  .builder-form { grid-template-columns: 1fr; }
  .builder-field.wide, .builder-options, .builder-note, .numeric-builder { grid-column: auto; }
  .numeric-builder { grid-template-columns: 1fr 1fr; }
  .builder-preview { position: static; }
  .builder-actions { position: sticky; bottom: -23px; margin: 18px -22px -23px; padding: 13px 22px; background: rgba(248,250,249,.97); box-shadow: 0 -9px 30px rgba(16,32,39,.08); }
  .template-toolbar { align-items: flex-start; }
  .form-title-field { grid-template-columns:1fr; }
  .form-title-field small { grid-column:1; }
  .template-toolbar > .template-toolbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .guide-back { font-size: 0; }
  .guide-back span { font-size: 16px; }
  .guide-hero { margin-top: 60px; }
  .anatomy { overflow-x: auto; text-align: left; }
  .anatomy > div { min-width: 490px; }
  .anatomy > code { white-space: nowrap; }
  .builder-section, .resource-demo-section, .embed-section { grid-template-columns: 1fr; gap: 28px; }
  .range-grid { grid-template-columns: 1fr; }
  .builder-fields { grid-template-columns: 1fr; }
  .builder-fields label.wide { grid-column: auto; }
  .type-list article { grid-template-columns: 44px 1fr 34px; padding: 18px 0; gap: 12px; }
  .type-list code { grid-column: 2 / -1; grid-row: 2; }
  .type-list button { grid-column: 3; grid-row: 1; }
  .embed-section { padding: 28px 20px; }
  .resource-demo-section { padding:28px 20px; }
  .endpoint-route-grid, .endpoint-lab-grid, .endpoint-teaching-strip, .payload-section, .production-grid { grid-template-columns:1fr; }
  .endpoint-lab-intro h2 { font-size:38px; }
  .endpoint-lab-card { padding:22px 18px; }
  .endpoint-lab-header { flex-direction:column; }
  .endpoint-lab-settings label { grid-template-columns:1fr; gap:7px; }
  .endpoint-teaching-strip { gap:1px; }
  .payload-section { gap:27px; }
  .endpoint-code-heading { align-items:flex-start; flex-direction:column; padding:28px 22px 22px; }
  .endpoint-code-section pre { padding:23px 22px; }
  .endpoint-code-actions { padding:18px 22px 22px; }
  .payload-table > div { grid-template-columns:1fr; gap:8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Static/PHP Studio integration */
[hidden] { display: none !important; }
#prompt-mount { min-width: 0; }
.prompt-line #prompt-mount.pi2 { font-family: inherit; }
.prompt-line .pi2-line { font: inherit; }
.prompt-line .pi2-token { font-size: 17px; line-height: 1.45; }
.prompt-actions .primary-action b { font: inherit; }
.connection-sheet .sheet-actions { align-items: center; }
.connection-sheet .danger-action[hidden] { display: none !important; }
.static-note { color: var(--muted); font-size: 11px; line-height: 1.55; }
