:root {
  --bg: #f6f1e8;
  --panel: #fffaf2;
  --panel-strong: #ffffff;
  --line: #ddd1c1;
  --text: #1f1a17;
  --muted: #6d6258;
  --accent: #1f8d68;
  --accent-dark: #17684d;
  --accent-soft: #e2f2ec;
  --shadow: 0 18px 40px rgba(39, 31, 24, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(31, 141, 104, 0.08), transparent 24%),
    linear-gradient(180deg, #f8f4ed 0%, #f2ebdf 100%);
  color: var(--text);
  font-family: "Space Grotesk", "Avenir Next", sans-serif;
}

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

h1,
h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: -0.03em;
}

p {
  margin: 0;
}

.shell {
  width: min(940px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.topbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.heading-block h1 {
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: 0.95;
  margin-bottom: 12px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.intro,
.muted-copy,
.beta-note,
.output-line,
.job-card p {
  color: var(--muted);
  line-height: 1.65;
}

.intro {
  max-width: 38rem;
  font-size: 1.04rem;
}

.engine-badge {
  flex-shrink: 0;
  padding: 12px 16px;
  border: 1px solid #b7d8cb;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
}

.account-panel {
  width: min(100%, 330px);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 250, 242, 0.76);
  box-shadow: 0 10px 28px rgba(39, 31, 24, 0.06);
}

.account-summary {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.login-form,
.credit-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.login-form input {
  min-width: 0;
  flex: 1 1 150px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-strong);
  padding: 9px 10px;
}

.consent-field {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

.consent-field input {
  width: auto;
  margin: 0.16rem 0 0;
  accent-color: var(--green);
}

.consent-field a {
  color: var(--green-deep);
  font-weight: 700;
}

.secondary-button,
.credit-button,
.text-button {
  border: 0;
  border-radius: 10px;
  padding: 9px 11px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

.secondary-button,
.credit-button {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.credit-button {
  flex: 1 1 95px;
}

.text-button {
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
}

.credit-cost {
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.console-card,
.panel,
.job-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.console-card,
.panel {
  padding: 24px;
}

.video-form {
  display: grid;
  gap: 20px;
}

.option-row,
.status-grid,
.summary-list {
  display: grid;
  gap: 14px;
}

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

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

.field span,
.prompt-field span {
  font-size: 0.95rem;
  font-weight: 700;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
}

select {
  min-height: 52px;
}

textarea {
  min-height: 176px;
  resize: vertical;
  line-height: 1.6;
}

select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(31, 141, 104, 0.12);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.create-button {
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  padding: 14px 24px;
  font-weight: 700;
  cursor: pointer;
}

.create-button:hover {
  background: var(--accent-dark);
}

.create-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.beta-note {
  font-size: 0.92rem;
}

.status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.summary-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0 20px;
}

.summary-item {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-strong);
}

.summary-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-item strong {
  font-size: 1rem;
}

.prompt-preview {
  padding: 16px;
  border-radius: var(--radius-md);
  background: #fbf7ef;
  border: 1px solid var(--line);
}

.prompt-preview strong {
  display: block;
  margin-bottom: 10px;
}

.prompt-preview p {
  color: var(--muted);
  line-height: 1.7;
}

.progress-track {
  width: 100%;
  height: 12px;
  margin: 18px 0 14px;
  border-radius: 999px;
  background: #ebe2d6;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #54c59d);
  transition: width 240ms ease;
}

.output-line {
  font-size: 0.94rem;
}

.jobs-panel {
  margin-top: 18px;
}

.preview-panel {
  margin-top: 18px;
}

.preview-empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: #fbf7ef;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.video-player {
  width: 100%;
  margin-top: 14px;
  border-radius: var(--radius-md);
  background: #111;
}

.preview-panel .muted-copy {
  margin-top: 14px;
}

.jobs-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.job-card {
  padding: 18px;
}

.job-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.job-top h3 {
  margin: 0;
  font-size: 1.05rem;
  font-family: "Space Grotesk", "Avenir Next", sans-serif;
}

.status-pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 700;
}

.job-meta {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

.job-prompt {
  font-size: 0.93rem;
}

@media (max-width: 780px) {
  .topbar,
  .action-row,
  .job-top {
    flex-direction: column;
    align-items: stretch;
  }

  .option-row,
  .status-grid,
  .summary-list {
    grid-template-columns: 1fr;
  }

  .engine-badge {
    align-self: flex-start;
  }

  .topbar-actions {
    justify-items: stretch;
  }

  .account-panel {
    width: 100%;
  }
}
