:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111;
  background: #f4f4f2;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 64px; }
.auth-card { width: min(440px, 100%); margin: 10vh auto 0; background: #fff; border: 1px solid #d8d8d4; padding: 32px; }
.app { display: block; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 24px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -0.04em; margin-bottom: 6px; }
h2 { font-size: 22px; letter-spacing: -0.025em; margin-bottom: 0; }
h3 { font-size: 18px; margin-bottom: 0; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .14em; color: #666; margin-bottom: 8px; }
.muted { color: #666; }
.small { font-size: 13px; line-height: 1.5; }
.layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 20px; align-items: start; }
.panel { background: #fff; border: 1px solid #d8d8d4; padding: 24px; }
.generator-panel { min-height: 620px; }
.section-head, .result-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.stack { display: grid; gap: 15px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid #c9c9c4; background: #fff; color: #111; padding: 12px 13px; border-radius: 5px; outline: none; }
textarea { resize: vertical; min-height: 132px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: #111; box-shadow: 0 0 0 2px rgba(0,0,0,.08); }
button { border: 1px solid #111; background: #111; color: #fff; padding: 11px 15px; border-radius: 5px; font-weight: 800; }
button:hover { opacity: .86; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary { background: #fff; color: #111; }
button.ghost { background: transparent; color: #333; border-color: #c9c9c4; }
button.compact { padding: 7px 10px; font-size: 12px; }
.pill { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border: 1px solid #c9c9c4; border-radius: 999px; color: #555; font-size: 11px; font-weight: 800; white-space: nowrap; }
.pill.good { border-color: #8ca58e; color: #285d31; background: #f4faf5; }
.pill.warn { border-color: #d6b77d; color: #7a4a00; background: #fffaf0; }
.pill.bad, .error { color: #a32929; }
.error { min-height: 18px; margin: 0; font-size: 13px; }
.hint { color: #74746f; font-weight: 500; font-size: 12px; }
.result { border-top: 1px solid #e1e1dd; margin-top: 24px; padding-top: 22px; }
.result video, .result img { width: 100%; max-height: 480px; object-fit: contain; background: #111; margin-top: 10px; }
.result audio { width: 100%; margin-top: 10px; }
.download-link { display: inline-flex; margin-top: 12px; color: #111; font-weight: 800; text-underline-offset: 3px; }
.jobs-list { display: grid; gap: 10px; }
.job-card { border-top: 1px solid #e1e1dd; padding-top: 12px; }
.job-card:first-child { border-top: 0; padding-top: 0; }
.job-card strong { display: block; font-size: 13px; margin-bottom: 4px; }
.job-meta { display: flex; justify-content: space-between; gap: 8px; color: #74746f; font-size: 11px; }
.job-prompt { color: #555; font-size: 12px; line-height: 1.45; margin: 6px 0 0; overflow-wrap: anywhere; }
.empty { color: #777; font-size: 13px; padding: 12px 0; }
@media (max-width: 840px) {
  .shell { width: min(100% - 20px, 700px); padding-top: 24px; }
  .layout { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; }
  .top-actions button { flex: 1; }
}

@media (max-width: 520px) {
  .panel, .auth-card { padding: 18px; }
  .field-grid { grid-template-columns: 1fr; }
  .section-head { align-items: flex-start; }
}

@media (prefers-color-scheme: dark) {
  :root { color: #f2f2ef; background: #111; }
  .panel, .auth-card { background: #181818; border-color: #383838; }
  input, select, textarea { background: #111; color: #f2f2ef; border-color: #4d4d4d; }
  button.secondary, button.ghost { background: #181818; color: #f2f2ef; border-color: #4d4d4d; }
  .muted, .hint, .job-prompt { color: #aaa; }
  .download-link { color: #f2f2ef; }
  .result, .job-card { border-color: #333; }
}
