:root {
  color-scheme: dark;
  --bg: #070a12;
  --bg-soft: #0d1220;
  --surface: #121827;
  --surface-2: #171f31;
  --text: #f7f9ff;
  --muted: #aeb9cc;
  --line: rgba(255, 255, 255, 0.1);
  --primary: #4f8cff;
  --cyan: #38d5ff;
  --pink: #ff5fa2;
  --violet: #8f7cff;
  --green: #38d889;
  --amber: #ffc861;
  --danger: #ff6b6b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -10%, rgba(79, 140, 255, 0.22), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(255, 95, 162, 0.16), transparent 28%),
    linear-gradient(180deg, #080b14 0%, #0b1020 42%, #070a12 100%);
  overflow-x: hidden;
}

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

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

button {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 26px;
  padding: 16px clamp(18px, 5vw, 76px);
  background: rgba(7, 10, 18, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 34px;
  border-radius: 8px;
  color: #06101f;
  background: linear-gradient(135deg, var(--cyan), #ffffff);
  font-size: 14px;
  letter-spacing: 0;
}

.nav,
.header-actions,
.hero-actions,
.final-cta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav {
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  padding: 8px 0;
}

.nav a:hover {
  color: #fff;
}

.primary-button,
.secondary-button,
.ghost-button,
.load-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  color: #07101f;
  background: linear-gradient(135deg, #ffffff, var(--cyan));
  box-shadow: 0 12px 28px rgba(56, 213, 255, 0.24);
}

.secondary-button,
.ghost-button,
.load-button,
.mini-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line);
}

.large {
  min-height: 50px;
  padding: 0 24px;
}

.menu-toggle {
  display: none;
}

.model-ribbon {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.ribbon-track {
  display: flex;
  gap: 12px;
  width: max-content;
  padding: 12px 0;
  animation: ribbon 42s linear infinite;
}

.ribbon-track span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #dce7ff;
  background: rgba(255, 255, 255, 0.05);
}

@keyframes ribbon {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  gap: clamp(34px, 6vw, 88px);
  align-items: center;
  min-height: calc(100vh - 116px);
  padding: clamp(58px, 8vw, 112px) clamp(18px, 5vw, 76px) 54px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 900px;
  margin-bottom: 22px;
  font-size: clamp(46px, 7vw, 88px);
  line-height: 1.02;
}

h1 span {
  display: block;
  width: fit-content;
  margin-top: 10px;
  color: transparent;
  background: linear-gradient(135deg, #fff, var(--cyan), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

.hero-lede,
.section-heading p,
.agent-grid p,
.capability-grid p,
.final-cta p,
.modal p,
.payment-guide p {
  color: var(--muted);
  line-height: 1.75;
}

.hero-lede {
  max-width: 760px;
  font-size: 18px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 620px;
  margin: 38px 0 0;
}

.hero-stats div {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.hero-stats dt {
  font-size: 32px;
  font-weight: 950;
}

.hero-stats dd {
  margin: 6px 0 0;
  color: var(--muted);
}

.hero-visual {
  position: relative;
  min-height: 620px;
}

.visual-art {
  position: absolute;
  inset: 40px 22px 70px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 18%),
    radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.95) 0 4%, transparent 4.5%),
    linear-gradient(135deg, rgba(79, 140, 255, 0.75), rgba(255, 95, 162, 0.55)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 1px, transparent 1px 26px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.visual-art::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 50% 50% 42% 42%;
  background:
    linear-gradient(180deg, rgba(7, 10, 18, 0.1), rgba(7, 10, 18, 0.7)),
    radial-gradient(circle at 50% 38%, #f6fbff 0 12%, #9bd7ff 12.5% 14%, transparent 14.5%),
    linear-gradient(135deg, #1c2f66, #d8497d);
  filter: drop-shadow(0 26px 45px rgba(0, 0, 0, 0.35));
}

.visual-art::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 10%;
  height: 30%;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 0 14%, rgba(255,255,255,.2) 14% 15%, transparent 15% 30%, rgba(255,255,255,.2) 30% 31%, transparent 31%),
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.04));
}

.floating-card {
  position: absolute;
  display: grid;
  gap: 8px;
  width: min(330px, 78%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 39, 0.84);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.floating-card span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.floating-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.model-card {
  top: 16px;
  left: 0;
}

.prompt-card {
  right: 0;
  bottom: 28px;
}

.section {
  padding: clamp(68px, 9vw, 118px) clamp(18px, 5vw, 76px);
}

.section-heading {
  max-width: 820px;
  margin-bottom: 34px;
}

.studio-shell,
.auth-panel,
.ops-console,
.pricing-card,
.code-card,
.payment-guide,
.table-shell,
.modal form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 39, 0.78);
  box-shadow: var(--shadow);
}

.studio-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: hidden;
}

.tool-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.tool-tab,
.ops-tab {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  padding: 0 12px;
}

.tool-tab.active,
.tool-tab:hover,
.ops-tab.active,
.ops-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.tool-panel {
  display: none;
  gap: 16px;
  min-height: 380px;
  padding: 24px;
}

.tool-panel.active {
  display: grid;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

input,
select,
textarea {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

option {
  color: #101827;
}

.tool-output,
.generated-preview,
.timeline-preview,
.agent-flow,
.voice-bars {
  min-height: 130px;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #dce7ff;
  background: rgba(255, 255, 255, 0.05);
  white-space: pre-wrap;
}

.generated-preview.done,
.agent-flow.done,
.timeline-preview.done,
.voice-bars.done {
  color: var(--green);
}

.timeline-preview,
.agent-flow,
.voice-bars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.timeline-preview span {
  width: 80px;
  height: 90px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--pink));
}

.agent-flow span {
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.voice-bars span {
  width: 16px;
  border-radius: 999px;
  background: var(--cyan);
}

.voice-bars span:nth-child(1) { height: 42px; }
.voice-bars span:nth-child(2) { height: 86px; }
.voice-bars span:nth-child(3) { height: 56px; }
.voice-bars span:nth-child(4) { height: 104px; }
.voice-bars span:nth-child(5) { height: 64px; }

.agent-grid,
.capability-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.agent-grid article,
.capability-grid article,
.gallery-card,
.metric-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.agent-grid article,
.capability-grid article {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 24px;
}

.agent-grid span {
  color: var(--cyan);
  font-weight: 950;
}

.agent-grid button {
  justify-self: start;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.gallery-card {
  overflow: hidden;
}

.gallery-image {
  height: 230px;
  background: linear-gradient(135deg, #234f9f, #d44883);
}

.style-2 .gallery-image { background: linear-gradient(135deg, #121827, #2bdbff); }
.style-3 .gallery-image { background: linear-gradient(135deg, #d7e7ff, #6b7fff); }
.style-4 .gallery-image { background: linear-gradient(135deg, #ffce7b, #2356b6); }
.style-5 .gallery-image { background: linear-gradient(135deg, #2e1e5e, #ff70b8); }
.style-6 .gallery-image { background: linear-gradient(135deg, #122a28, #46e0a6); }

.gallery-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  padding: 12px 14px 0;
  font-size: 13px;
}

.gallery-card h3 {
  padding: 12px 14px 0;
  font-size: 16px;
}

.gallery-card p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0 14px 16px;
}

.gallery-card p span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #dbe7ff;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
}

.load-button {
  margin: 28px auto 0;
}

.developer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 560px);
  gap: 18px;
  align-items: start;
}

.pricing-card {
  padding: 20px;
}

.model-table-wrap,
.table-shell {
  overflow-x: auto;
}

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

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
}

.code-card {
  position: relative;
  overflow: hidden;
  background: #080d17;
}

.code-tabs {
  display: flex;
  gap: 6px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-width: 78px;
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.tab.active {
  color: #07101f;
  background: var(--cyan);
}

.copy-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

pre {
  min-height: 300px;
  margin: 0;
  padding: 58px 20px 20px;
  overflow-x: auto;
}

code {
  color: #d8e7ff;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.75;
}

.auth-panel {
  max-width: 460px;
}

.auth-modal-card {
  position: relative;
  width: min(430px, 100%);
  margin: 0 auto;
  padding: 30px 26px 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: #15181e;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.auth-modal-card.minimized {
  display: none;
}

.auth-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border: 0;
  color: #9aa2ae;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}

.auth-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border: 1px solid rgba(61, 198, 255, 0.35);
  border-radius: 10px;
  color: #fff;
  background:
    radial-gradient(circle at 35% 15%, rgba(117, 116, 255, 0.95), transparent 34%),
    radial-gradient(circle at 70% 75%, rgba(54, 220, 142, 0.7), transparent 38%),
    #222735;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.auth-logo span {
  color: #bdf5ff;
}

.auth-modal-card h2,
.auth-modal-card > p {
  text-align: center;
}

.auth-modal-card > p {
  margin: 0 0 20px;
  color: var(--muted);
}

.login-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.login-tabs button {
  padding: 0 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #8e96a3;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.login-tabs button.active {
  border-color: #27c5f6;
  color: #50d6ff;
}

.login-panel {
  display: none;
  gap: 14px;
}

.login-panel.active {
  display: grid;
}

.inline-field,
.captcha-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 8px;
}

.outline-button {
  min-height: 42px;
  border: 1px solid rgba(80, 214, 255, 0.35);
  border-radius: 7px;
  color: #50d6ff;
  background: rgba(80, 214, 255, 0.05);
  font-weight: 900;
  cursor: pointer;
}

.captcha-image {
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #191d23;
  overflow: hidden;
  cursor: pointer;
}

.captcha-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.agreement {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.agreement input {
  width: 16px;
  height: 16px;
  min-height: 16px;
}

.agreement a {
  color: #50d6ff;
}

.auth-submit {
  width: 100%;
  min-height: 44px;
}

.third-party {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  color: #8e96a3;
  text-align: center;
}

.third-party > span {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.third-party > span::before,
.third-party > span::after {
  content: "";
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.third-party div {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.third-party button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 900;
  cursor: pointer;
}

.auth-form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.form-actions,
.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.form-message {
  margin: 0;
  color: var(--danger);
}

.ops-console {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 620px;
  overflow: hidden;
}

.ops-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: rgba(0, 0, 0, 0.2);
}

.ops-sidebar strong {
  margin-bottom: 10px;
}

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

.ops-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.ops-topbar > div {
  display: grid;
  gap: 6px;
}

.ops-topbar span {
  color: var(--muted);
}

.ops-view {
  display: none;
}

.ops-view.active {
  display: grid;
  gap: 18px;
}

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

.metric-grid div {
  display: grid;
  gap: 8px;
  padding: 16px;
}

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

.metric-grid b {
  font-size: 24px;
}

.compact-code pre {
  min-height: 170px;
}

.secret-box {
  padding: 14px;
  border: 1px solid rgba(56, 216, 137, 0.3);
  border-radius: 8px;
  color: var(--green);
  background: rgba(56, 216, 137, 0.1);
  overflow-wrap: anywhere;
}

.channel-form,
.model-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 10px;
}

.model-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.model-form button {
  grid-column: span 4;
}

.table-input {
  width: 92px;
}

.table-select {
  min-width: 96px;
}

.profit-good {
  color: var(--green);
  font-weight: 900;
}

.profit-warn {
  color: var(--amber);
  font-weight: 900;
}

.payment-guide {
  padding: 16px;
  box-shadow: none;
}

.dashboard-page {
  padding-top: 92px;
}

.dashboard-hero {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 24px;
  padding: 36px 0 10px;
}

.dashboard-hero h1 {
  max-width: 820px;
  margin: 8px 0 10px;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 1.02;
}

.dashboard-hero p:last-child {
  max-width: 680px;
  color: var(--muted);
}

.dashboard-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 80px;
}

.dashboard-shell .auth-panel {
  margin: 0;
}

.dashboard-shell .ops-console {
  width: 100%;
}

.ops-tab {
  width: 100%;
}

.tester-grid {
  display: grid;
  gap: 14px;
}

.tester-output {
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.26);
  color: #d8e7ff;
  overflow: auto;
}

.mini-button.danger {
  border-color: rgba(255, 91, 110, 0.5);
  color: #ff9aa7;
}

.legal-page {
  width: min(780px, calc(100% - 40px));
  margin: 0 auto;
  padding: 120px 0;
}

.legal-page p {
  color: var(--muted);
  line-height: 1.9;
}

.qr-list {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

.qr-list a {
  display: grid;
  gap: 8px;
  width: 150px;
  color: var(--text);
  font-weight: 700;
}

.qr-list img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.final-cta {
  justify-content: center;
  flex-wrap: wrap;
  padding: clamp(70px, 10vw, 120px) 18px;
  text-align: center;
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.16), rgba(255, 95, 162, 0.1));
}

.final-cta h2,
.final-cta p {
  flex-basis: 100%;
}

.final-cta p {
  margin-bottom: 10px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 28px clamp(18px, 5vw, 76px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer button {
  border: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.modal {
  width: min(460px, calc(100% - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--text);
  background: transparent;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.modal form {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 28px;
  background: #111827;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 22px;
}

.full {
  width: 100%;
}

.hidden {
  display: none !important;
}

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

  .hero-visual {
    min-height: 520px;
  }

  .agent-grid,
  .capability-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: auto auto;
    justify-content: space-between;
  }

  .menu-toggle {
    display: inline-grid;
    gap: 4px;
    width: 40px;
    height: 40px;
    place-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
  }

  .menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
  }

  .nav,
  .header-actions {
    display: none;
  }

  .nav.open,
  .header-actions.open {
    display: flex;
    grid-column: 1 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .studio-shell,
  .ops-console {
    grid-template-columns: 1fr;
  }

  .tool-tabs,
  .ops-sidebar {
    flex-direction: row;
    overflow-x: auto;
  }

  .ops-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .channel-form,
  .model-form {
    grid-template-columns: 1fr;
  }

  .model-form button {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 38px;
    line-height: 1.1;
    word-break: break-word;
  }

  .hero,
  .section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-actions,
  .hero-stats,
  .metric-grid,
  .agent-grid,
  .capability-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-visual {
    min-height: 440px;
  }

  .visual-art {
    inset: 58px 0 58px;
  }

  .floating-card {
    width: 88%;
  }

  .timeline-preview {
    flex-wrap: wrap;
  }

  .timeline-preview span {
    width: 62px;
  }

  .agent-flow {
    flex-wrap: wrap;
  }

  .form-actions,
  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  th,
  td {
    padding: 11px 10px;
  }
}
