:root {
  color-scheme: light;
  --background: 0 0% 100%;
  --foreground: 222 14% 13%;
  --card: 0 0% 100%;
  --card-foreground: 222 14% 13%;
  --popover: 0 0% 100%;
  --popover-foreground: 222 14% 13%;
  --muted: 220 14% 96%;
  --muted-foreground: 220 9% 46%;
  --secondary: 220 14% 96%;
  --secondary-foreground: 222 14% 13%;
  --accent: 220 14% 96%;
  --accent-foreground: 222 14% 13%;
  --border: 220 13% 91%;
  --input: 220 13% 91%;
  --primary: 221 83% 53%;
  --primary-foreground: 0 0% 100%;
  --primary-hover: 221 83% 45%;
  --accent-soft: 221 70% 96%;
  --ring: 221 83% 53%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 100%;
  --radius: 0.625rem;
  --shadow: 0 18px 60px hsl(var(--foreground) / 0.11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

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

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar,
.workspace,
.pane-heading,
.button-row,
.runtime-header,
.tabs,
.record-actions,
.form-actions,
.metric-grid,
.field-row,
.detail-line {
  display: flex;
}

.topbar {
  align-items: flex-start;
  gap: 14px;
  padding: 10px 0 22px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: hsl(var(--foreground));
  color: white;
  font-weight: 800;
}

.hero-copy h1,
.pane-heading h2,
.runtime-header h2,
.section-heading h2,
.concierge-band h2 {
  margin: 0;
  letter-spacing: 0;
}

.hero-copy h1 {
  max-width: 760px;
  font-size: clamp(2.2rem, 7vw, 5.4rem);
  line-height: 0.94;
}

.hero-subhead {
  max-width: 660px;
  margin: 14px 0 0;
  color: hsl(var(--muted-foreground));
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.45;
}

.section-heading h2,
.concierge-band h2 {
  max-width: 760px;
  font-size: clamp(1.45rem, 3.5vw, 2.8rem);
  line-height: 1.08;
}

.eyebrow {
  margin: 0 0 3px;
  color: hsl(var(--muted-foreground));
  font-size: 0.74rem;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button,
.share-button,
.primary-button,
.secondary-button,
.text-button {
  min-height: 44px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
}

.icon-button {
  margin-left: auto;
  width: 42px;
  font-size: 1.35rem;
}

.workspace {
  align-items: stretch;
  gap: 18px;
}

.builder-pane,
.preview-pane {
  min-width: 0;
}

.builder-pane {
  flex: 0 0 390px;
  padding: 18px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  box-shadow: var(--shadow);
}

.preview-pane {
  flex: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
}

.pane-heading,
.runtime-header {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pane-heading h2,
.runtime-header h2 {
  font-size: 1.05rem;
}

.compact {
  margin-bottom: 12px;
}

.status-pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: hsl(var(--accent-soft));
  color: hsl(var(--primary));
  font-size: 0.78rem;
  font-weight: 760;
  white-space: nowrap;
}

.prompt-label {
  display: block;
  margin: 18px 0 8px;
  color: hsl(var(--muted-foreground));
  font-size: 0.86rem;
  font-weight: 760;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

textarea {
  resize: vertical;
  min-height: 138px;
  padding: 12px;
  line-height: 1.45;
}

.button-row {
  gap: 10px;
  margin: 12px 0 18px;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.workflow-chip {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--secondary));
  color: hsl(var(--foreground));
  font-size: 0.82rem;
  font-weight: 760;
}

.workflow-chip:hover,
.workflow-chip:focus-visible {
  border-color: hsl(var(--primary));
  background: hsl(var(--accent-soft));
  color: hsl(var(--primary));
}

.transform-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--secondary));
}

.transform-strip span {
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 6px;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.75rem;
  font-weight: 760;
  text-align: center;
}

.transform-strip strong {
  color: hsl(var(--muted-foreground));
}

.proof-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: -4px 0 18px;
}

.proof-panel span {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--accent-soft));
  color: hsl(var(--primary));
  font-size: 0.76rem;
  font-weight: 780;
  text-align: center;
}

.primary-button,
.secondary-button,
.share-button,
.text-button {
  padding: 0 14px;
  font-weight: 780;
}

.primary-button {
  flex: 1;
  border-color: hsl(var(--primary));
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.primary-button:hover {
  background: hsl(var(--primary-hover));
}

.secondary-button {
  flex: 1;
}

.text-button {
  min-height: 44px;
  color: hsl(var(--primary));
}

.schema-panel {
  padding-top: 16px;
  border-top: 1px solid hsl(var(--border));
}

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

.field-row {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--secondary));
}

.field-row strong,
.field-row span {
  display: block;
}

.field-row span {
  margin-top: 2px;
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
}

.field-row select {
  width: 126px;
  min-height: 44px;
  padding: 0 8px;
}

.phone-frame {
  width: min(438px, 100%);
  min-height: 760px;
  padding: 12px;
  border: 1px solid hsl(var(--border));
  border-radius: 26px;
  background: hsl(var(--foreground));
  box-shadow: var(--shadow);
}

.app-runtime {
  min-height: 736px;
  overflow: hidden;
  border-radius: 18px;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

.runtime-header {
  padding: 18px 16px 12px;
}

.runtime-header > div {
  min-width: 0;
}

.runtime-header h2 {
  overflow-wrap: anywhere;
}

.share-button {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.tabs {
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  padding: 0 12px 12px;
  overflow-x: auto;
}

.tab-button {
  flex: 0 0 auto;
  min-width: 86px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  font-weight: 780;
}

.tab-button[aria-selected="true"] {
  border-color: hsl(var(--primary));
  background: hsl(var(--accent-soft));
  color: hsl(var(--primary));
}

.runtime-view {
  padding: 14px;
}

.metric-grid {
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  flex: 1;
  min-height: 86px;
  padding: 12px;
  border-radius: 8px;
  background: hsl(var(--accent-soft));
}

.metric:nth-child(2) {
  background: hsl(41 75% 92%);
}

.metric:nth-child(3) {
  background: hsl(11 47% 93%);
}

.metric span {
  display: block;
  color: hsl(var(--muted-foreground));
  font-size: 0.78rem;
  font-weight: 740;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.45rem;
}

.search-input {
  min-height: 44px;
  margin-bottom: 12px;
  padding: 0 12px;
}

.record-list {
  display: grid;
  gap: 10px;
}

.record-item {
  width: 100%;
  padding: 12px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  text-align: left;
}

.record-item strong,
.record-item span {
  display: block;
}

.record-item span {
  margin-top: 4px;
  color: hsl(var(--muted-foreground));
  font-size: 0.86rem;
}

.record-actions,
.form-actions {
  gap: 10px;
  margin-top: 14px;
}

.record-actions button,
.form-actions button {
  flex: 1;
  min-height: 44px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  font-weight: 780;
}

.form-actions button:first-child {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.detail-line {
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid hsl(var(--border));
}

.detail-line span {
  color: hsl(var(--muted-foreground));
}

.runtime-form {
  display: grid;
  gap: 12px;
}

.runtime-form label {
  display: grid;
  gap: 6px;
  color: hsl(var(--muted-foreground));
  font-size: 0.84rem;
  font-weight: 760;
}

.runtime-form input,
.runtime-form select,
.runtime-form textarea {
  min-height: 44px;
  padding: 0 10px;
  color: hsl(var(--foreground));
  font-weight: 500;
}

.runtime-form textarea {
  min-height: 90px;
  padding-top: 10px;
}

.runtime-form .form-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin: 10px -14px -14px;
  padding: 12px 14px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--background) / 0.96);
}

.empty-state {
  padding: 26px 14px;
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius);
  color: hsl(var(--muted-foreground));
  text-align: center;
}

.landing-band,
.concierge-band {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  box-shadow: 0 10px 34px hsl(var(--foreground) / 0.06);
}

.section-heading {
  margin-bottom: 16px;
}

.info-grid,
.use-case-grid {
  display: grid;
  gap: 10px;
}

.info-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.info-grid article {
  min-height: 150px;
  padding: 14px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--secondary));
}

.info-grid h3 {
  margin: 10px 0 6px;
  font-size: 1rem;
}

.info-grid p,
.concierge-band p {
  margin: 0;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}

.step-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 820;
}

.use-case-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.use-case-grid span {
  min-height: 58px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--secondary));
  font-weight: 780;
  text-align: center;
}

.concierge-band {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}

.concierge-band .eyebrow,
.concierge-band p {
  color: hsl(var(--background) / 0.74);
}

.concierge-band .primary-button {
  min-width: 220px;
  border-color: hsl(var(--background));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

@media (max-width: 850px) {
  .shell {
    padding: 14px;
  }

  .workspace {
    display: grid;
  }

  .builder-pane {
    flex-basis: auto;
    width: 100%;
  }

  .preview-pane {
    padding: 6px 0 20px;
  }

  .phone-frame {
    width: min(438px, calc(100vw - 28px));
    min-height: 680px;
  }

  .app-runtime {
    min-height: 656px;
  }

  .info-grid.three,
  .info-grid.two,
  .use-case-grid,
  .concierge-band {
    grid-template-columns: 1fr;
  }

  .concierge-band .primary-button {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .hero-copy h1 {
    font-size: 2.35rem;
  }

  .button-row,
  .metric-grid,
  .proof-panel {
    display: grid;
  }

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

  .transform-strip {
    grid-template-columns: 1fr;
  }

  .transform-strip strong {
    display: none;
  }

  .field-row {
    align-items: stretch;
    display: grid;
  }

  .field-row select {
    width: 100%;
  }
}
