:root {
  --bg: oklch(98% 0.005 250);
  --surface: oklch(100% 0 0);
  --surface-alt: oklch(96.5% 0.006 250);
  --fg: oklch(22% 0.02 240);
  --muted: oklch(50% 0.018 240);
  --border: oklch(90% 0.008 240);
  --accent: oklch(58% 0.16 145);
  --domain: oklch(54% 0.14 232);
  --success: oklch(56% 0.15 145);
  --warn: oklch(66% 0.14 82);
  --danger: oklch(57% 0.18 28);
  --ink-soft: oklch(31% 0.025 240);
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 18px 45px rgba(27, 40, 58, 0.09);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--fg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), transparent 420px),
    var(--bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

button {
  cursor: pointer;
}

svg {
  display: block;
}

.page-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid color-mix(in oklch, var(--border), transparent 18%);
  background: color-mix(in oklch, var(--surface), transparent 8%);
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--fg);
  color: white;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.topnav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
  letter-spacing: 0.02em;
}

.topnav a.active,
.topnav a:hover {
  color: var(--fg);
  background: var(--surface-alt);
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}

.sidebar {
  border-right: 1px solid var(--border);
  background: color-mix(in oklch, var(--surface), transparent 28%);
  padding: 22px;
}

.sidebar-section + .sidebar-section {
  margin-top: 28px;
}

.sidebar-label,
.kicker,
.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 540;
}

.side-link.active,
.side-link:hover {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.main {
  min-width: 0;
  padding: 34px;
}

.container {
  width: min(1180px, calc(100vw - 48px));
  margin: 0 auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.7fr);
  gap: 22px;
  align-items: stretch;
  padding: 34px 0;
}

.hero-panel {
  min-height: 450px;
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-title,
.screen-title {
  max-width: 12ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.screen-title {
  max-width: 15ch;
  font-size: clamp(34px, 4vw, 50px);
}

.lead {
  max-width: 62ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.62;
}

.hero-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(27, 40, 58, 0.08);
}

.btn.primary {
  border-color: transparent;
  background: var(--accent);
  color: white;
}

.btn.dark {
  border-color: transparent;
  background: var(--fg);
  color: white;
}

.btn.ghost {
  background: transparent;
}

.btn.icon-only {
  width: 42px;
  padding: 0;
}

.btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

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

.card,
.panel,
.metric-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card {
  min-height: 172px;
  padding: 18px;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in oklch, var(--domain), var(--border) 60%);
}

.card h2,
.card h3,
.panel h2,
.panel h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.card p,
.panel p {
  margin: 10px 0 0;
  color: var(--muted);
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.panel {
  padding: 22px;
}

.panel + .panel {
  margin-top: 16px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.section-head p {
  max-width: 65ch;
  margin: 8px 0 0;
  color: var(--muted);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 16px;
}

.metric-value {
  display: block;
  font-family: var(--font-mono);
  font-size: 24px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 16px;
}

.workflow {
  display: grid;
  gap: 10px;
}

.step {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.step-index {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.step strong {
  display: block;
  font-size: 14px;
  letter-spacing: 0;
}

.step span {
  color: var(--muted);
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status.success {
  background: color-mix(in oklch, var(--success), white 84%);
  color: color-mix(in oklch, var(--success), black 25%);
}

.status.warn {
  background: color-mix(in oklch, var(--warn), white 82%);
  color: color-mix(in oklch, var(--warn), black 35%);
}

.status.danger {
  background: color-mix(in oklch, var(--danger), white 84%);
  color: color-mix(in oklch, var(--danger), black 26%);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.field label,
.control-label {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 620;
  letter-spacing: 0.02em;
}

.input,
.textarea,
.select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--fg);
  padding: 10px 12px;
  outline: none;
}

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

.input:focus,
.textarea:focus,
.select:focus {
  border-color: color-mix(in oklch, var(--domain), var(--border) 40%);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--domain), transparent 84%);
}

.check-list,
.project-list,
.version-list {
  display: grid;
  gap: 10px;
}

.check-row,
.project-row,
.version-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.upload-box {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 118px;
  padding: 16px;
  border: 1px dashed color-mix(in oklch, var(--domain), var(--border) 42%);
  border-radius: 14px;
  background: color-mix(in oklch, var(--domain), white 94%);
  cursor: pointer;
}

.upload-box input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.upload-box strong,
.upload-box span span {
  display: block;
}

.upload-box strong {
  font-weight: 640;
}

.upload-box span span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.upload-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
  color: color-mix(in oklch, var(--domain), black 18%);
  box-shadow: inset 0 0 0 1px var(--border);
}

.upload-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.upload-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.upload-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.row-title {
  margin: 0;
  font-weight: 620;
}

.row-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.segmented,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented {
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-alt);
}

.segmented button,
.chip {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 620;
  letter-spacing: 0.02em;
}

.segmented button.active,
.chip.active {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--border);
}

.chip {
  border-color: var(--border);
  background: var(--surface);
}

.chip[data-selectable].active {
  color: color-mix(in oklch, var(--domain), black 20%);
  border-color: color-mix(in oklch, var(--domain), var(--border) 45%);
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-alt);
}

.progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--domain);
}

.editor-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  gap: 16px;
}

.question-item {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--fg);
}

.question-item.active {
  border-color: color-mix(in oklch, var(--domain), var(--border) 40%);
  background: color-mix(in oklch, var(--domain), white 94%);
}

.output-box {
  min-height: 320px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in oklch, var(--surface), var(--surface-alt) 35%);
}

.output-box[contenteditable="true"]:focus {
  outline: 3px solid color-mix(in oklch, var(--domain), transparent 82%);
}

.output-box p {
  margin: 0 0 14px;
  max-width: 68ch;
}

.version-row {
  grid-template-columns: minmax(0, 1fr) auto;
  cursor: pointer;
}

.version-row.active {
  border-color: color-mix(in oklch, var(--domain), var(--border) 42%);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(15, 22, 32, 0.28);
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  width: min(560px, 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 26px 80px rgba(14, 22, 34, 0.22);
  padding: 22px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
}

.timeline-dot {
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--border);
}

.timeline-dot.on {
  background: var(--success);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table td {
  font-size: 14px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.mobile-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at top left, color-mix(in oklch, var(--domain), transparent 86%), transparent 360px),
    var(--bg);
}

.phone-shell {
  width: min(430px, calc(100vw - 28px));
  border: 10px solid oklch(16% 0.01 240);
  border-radius: 42px;
  background: oklch(16% 0.01 240);
  box-shadow: 0 30px 80px rgba(15, 22, 32, 0.25);
}

.phone-screen {
  min-height: 820px;
  overflow: hidden;
  border-radius: 32px;
  background: var(--bg);
  position: relative;
}

.ios-island {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 118px;
  height: 34px;
  border-radius: 999px;
  background: oklch(12% 0.01 240);
  z-index: 4;
}

.statusbar {
  height: 58px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 22px 10px;
  color: var(--fg);
  font-size: 12px;
  font-weight: 650;
}

.mobile-content {
  padding: 12px 18px 96px;
}

.mobile-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.mobile-card {
  margin-top: 14px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.bottom-tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 10px 14px 18px;
  border-top: 1px solid var(--border);
  background: color-mix(in oklch, var(--surface), transparent 4%);
}

.bottom-tabs button {
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
}

.bottom-tabs button.active {
  color: var(--fg);
  background: var(--surface-alt);
}

.home-indicator {
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  width: 132px;
  height: 5px;
  border-radius: 999px;
  background: color-mix(in oklch, var(--fg), transparent 60%);
}

.android-frame {
  border-radius: 30px;
}

.android-topbar {
  height: 64px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 18px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.fab {
  position: absolute;
  right: 22px;
  bottom: 92px;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 18px;
  background: var(--accent);
  color: white;
  box-shadow: 0 16px 34px color-mix(in oklch, var(--accent), transparent 62%);
}

.android-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 9px 10px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.android-nav button {
  min-height: 54px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
}

.android-nav button.active {
  color: color-mix(in oklch, var(--domain), black 20%);
  background: color-mix(in oklch, var(--domain), white 92%);
}

.sheet {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 78px;
  display: none;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(15, 22, 32, 0.18);
}

.sheet.open {
  display: block;
}

.screen-note {
  margin: 18px auto 0;
  max-width: 430px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 1160px) {
  .editor-grid,
  .split,
  .hero-grid {
    grid-template-columns: 1fr;
  }

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

  .sidebar {
    display: none;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .main,
  .container {
    width: 100%;
    padding: 18px;
  }

  .hero-grid {
    padding-top: 10px;
  }

  .hero-panel {
    min-height: auto;
    padding: 22px;
  }

  .card-grid,
  .metric-row,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .screen-title,
  .hero-title {
    max-width: none;
  }
}
