:root {
  color-scheme: dark;
  --bg: #050506;
  --surface: #101114;
  --surface-soft: #1a1b20;
  --field: #15161a;
  --ink: #f5f6f8;
  --muted: #9aa0ad;
  --line: #2a2c33;
  --accent: #ff4f7b;
  --accent-dark: #e23863;
  --green: #36d399;
  --warn: #f2b84b;
  --danger: #ff6b5f;
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.52);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 79, 123, 0.18), transparent 34%),
    linear-gradient(180deg, #111216 0%, var(--bg) 48%, #030303 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.app {
  width: min(1220px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 22px;
  align-items: start;
}

.workspace,
.panel {
  background: rgba(16, 17, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.workspace {
  min-height: calc(100vh - 68px);
  padding: 30px;
}

.topbar,
.panel-header,
.dialog-actions,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 8px;
  font-size: clamp(38px, 5.8vw, 72px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-top: 4px;
  font-size: 20px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.dialog-content p,
.notice,
.meta {
  color: var(--muted);
}

.generator {
  margin-top: 36px;
  display: grid;
  gap: 18px;
}

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

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

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  outline: none;
}

textarea::placeholder,
input::placeholder {
  color: #6f7480;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(233, 79, 111, 0.13);
}

textarea {
  min-height: 300px;
  padding: 18px;
  line-height: 1.6;
  resize: vertical;
  font-size: 18px;
}

input,
select {
  height: 46px;
  padding: 0 12px;
}

.control-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.2fr 0.7fr 1fr;
  gap: 14px;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

button:active {
  transform: translateY(1px);
}

.primary {
  min-height: 48px;
  padding: 0 22px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(233, 79, 111, 0.26);
}

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

.secondary,
.icon-button {
  min-height: 40px;
  padding: 0 14px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 750;
}

.secondary:hover,
.icon-button:hover {
  background: #23252d;
}

.icon-button {
  min-width: 44px;
}

.actions {
  min-height: 50px;
}

.panel {
  padding: 20px;
  position: sticky;
  top: 24px;
}

.task-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.task {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
  background: #14151a;
}

.sample-task {
  gap: 12px;
}

.task-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-title strong {
  font-size: 13px;
}

.status {
  min-width: 78px;
  border-radius: 999px;
  padding: 5px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  background: #242730;
}

.status.running,
.status.pending {
  background: rgba(242, 184, 75, 0.16);
  color: var(--warn);
}

.status.succeeded {
  background: rgba(54, 211, 153, 0.16);
  color: var(--green);
}

.status.failed {
  background: rgba(255, 107, 95, 0.16);
  color: var(--danger);
}

.prompt-preview {
  color: var(--ink);
  line-height: 1.45;
  word-break: break-word;
}

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

.sample-image-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #070708;
}

.images a {
  display: block;
}

.images img,
.sample-image-wrap img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #1b1d23;
  display: block;
}

.images img {
  border-radius: 8px;
  border: 1px solid var(--line);
}

.error {
  color: var(--danger);
  word-break: break-word;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  width: min(420px, calc(100% - 32px));
  background: var(--surface);
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

.dialog-content {
  padding: 22px;
  display: grid;
  gap: 14px;
}

@media (max-width: 940px) {
  .app {
    grid-template-columns: 1fr;
  }

  .workspace {
    min-height: auto;
  }

  .panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .app {
    width: min(100% - 20px, 1220px);
    padding: 10px 0;
  }

  .workspace,
  .panel {
    padding: 16px;
  }

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

  .topbar {
    align-items: flex-start;
  }

  textarea {
    min-height: 230px;
    font-size: 16px;
  }

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