:root {
  --bg: #f5efe8;
  --ink: #1f1d1a;
  --muted: #6f6257;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --line: rgba(31, 29, 26, 0.09);
  --accent: #f97316;
  --accent-soft: rgba(249, 115, 22, 0.14);
  --accent-ink: #b45309;
  --accent-deep: #c2410c;
  --shadow: 0 22px 60px rgba(64, 35, 14, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  font-family: "Sora", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(249, 115, 22, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 180, 88, 0.16), transparent 24%),
    linear-gradient(180deg, #fff9f2 0%, #f6ede3 48%, #efe3d7 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.34) 1px, transparent 1px);
  background-size: 44px 44px;
  content: "";
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 75%);
}

.app-shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 96px;
}

.hero,
.panel,
.auth-banner {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  padding: 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 12ch;
  margin-bottom: 14px;
  font-size: clamp(2.4rem, 4vw, 4.8rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.lede,
.panel-head p,
.split-head p,
.auth-banner p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-card {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-content: flex-start;
  justify-content: flex-start;
  padding: 24px;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(41, 22, 8, 0.95), rgba(145, 62, 11, 0.88)),
    linear-gradient(180deg, #3b1f0d, #9a3412);
}

.hero-chip {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: #f9fafb;
  font-size: 0.84rem;
  background: rgba(255, 255, 255, 0.06);
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-banner,
.tabs,
.panel {
  margin-top: 20px;
}

.auth-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 26px;
}

.tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.hidden {
  display: none !important;
}

.tab {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font: inherit;
  background: rgba(255, 255, 255, 0.66);
  cursor: pointer;
}

.tab.is-active {
  border-color: transparent;
  color: white;
  background: linear-gradient(135deg, #9a3412, #c2410c);
}

.panel {
  display: none;
  padding: 28px;
}

.panel.is-active,
.tab-panel.is-active {
  display: block;
}

.grid {
  display: grid;
  gap: 18px;
}

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

.grid.compact {
  gap: 14px;
}

.span-2 {
  grid-column: 1 / -1;
}

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

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

input,
select,
textarea {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--panel-strong);
}

textarea,
pre,
.editor {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
}

textarea {
  resize: vertical;
}

.button {
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  color: white;
  font-weight: 600;
  background: linear-gradient(135deg, #f97316, #ea580c);
  cursor: pointer;
}

.button.secondary {
  color: var(--ink);
  background: #edf2f7;
}

.button.ghost {
  color: var(--ink);
  background: transparent;
}

.button.hidden {
  display: none;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.output-card {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(248, 250, 252, 0.8);
}

.import-workflow-card {
  margin-top: 0;
  margin-bottom: 18px;
}

.output-head,
.split-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.helper-text {
  color: var(--muted);
  font-size: 0.82rem;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #d1e4ff;
  background: #0f172a;
  border-radius: 18px;
  padding: 18px;
  line-height: 1.65;
  overflow: auto;
}

.manager-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
}

.file-sidebar,
.editor-panel {
  min-width: 0;
}

.file-tabs {
  display: grid;
  gap: 10px;
}

.file-tab {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.file-tab.is-active {
  border-color: rgba(249, 115, 22, 0.34);
  background: var(--accent-soft);
}

.file-tab strong,
.file-tab span {
  display: block;
}

.file-tab span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.editor-label {
  margin-top: 12px;
}

.editor {
  min-height: 440px;
  margin: 10px 0 16px;
}

.auth-dialog {
  width: min(560px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.auth-dialog::backdrop {
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(4px);
}

.auth-shell {
  padding: 24px;
}

.auth-shell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.auth-footnote {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.auth-error {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid rgba(185, 28, 28, 0.18);
  border-radius: 14px;
  color: #991b1b;
  font-size: 0.84rem;
  font-weight: 600;
  background: rgba(254, 242, 242, 0.95);
}

.auth-debug {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.welcome-note {
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: 16px;
  color: var(--accent-deep);
  font-weight: 600;
  background: rgba(255, 247, 237, 0.9);
}

.marketing-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.marketing-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
}

.marketing-card strong {
  display: block;
  margin-bottom: 10px;
}

.marketing-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.turnstile-shell {
  min-height: 66px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.66);
}

.ticker {
  position: fixed;
  right: 12px;
  bottom: 12px;
  left: 12px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  color: white;
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28);
}

.ticker-track {
  display: inline-flex;
  gap: 42px;
  min-width: 100%;
  padding: 12px 18px;
  white-space: nowrap;
  animation: ticker-scroll 20s linear infinite;
}

@keyframes ticker-scroll {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-45%);
  }
}

@media (max-width: 1080px) {
  .hero,
  .manager-layout,
  .marketing-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 18px, 1380px);
    padding-top: 14px;
  }

  .hero,
  .panel,
  .auth-banner {
    padding: 20px;
  }

  .auth-banner,
  .output-head,
  .split-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .grid.two,
  #apiDynamicFields {
    grid-template-columns: 1fr;
  }
}
