:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
  color: #1f2937;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.header {
  margin-bottom: 20px;
}

.header h1 {
  margin: 0;
  font-size: 32px;
}

.header p {
  margin-top: 8px;
  color: #6b7280;
}

.status-bar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-pill {
  display: inline-block;
  font-size: 13px;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 6px 12px;
}

.grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

.card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.08);
  backdrop-filter: blur(4px);
}

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

h2 {
  margin-top: 0;
}

button {
  border: 1px solid #4f46e5;
  border-radius: 10px;
  background: #4f46e5;
  color: #fff;
  padding: 8px 14px;
  cursor: pointer;
  transition: 0.2s ease;
}

button:hover {
  background: #4338ca;
  transform: translateY(-1px);
}

pre {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  white-space: pre-wrap;
  word-break: break-word;
}

label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
  color: #4b5563;
}

textarea,
input[type="text"],
input[type="number"],
select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  padding: 10px;
  font-size: 14px;
}

textarea:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
input[type="file"]:focus {
  outline: 2px solid #c7d2fe;
  border-color: #6366f1;
}

textarea {
  resize: vertical;
}

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.inline-label {
  margin: 0;
}

#maxLineLength {
  width: 96px;
}

#processMode {
  width: 220px;
}

.check-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

#historyList {
  margin-top: 12px;
  padding-left: 20px;
}

#historyList li {
  margin-bottom: 8px;
}

#historyList button {
  margin-left: 8px;
  padding: 4px 10px;
  background: #0ea5e9;
}

#pipelineStatus {
  margin-top: 16px;
}

.hidden {
  display: none;
}

#consolePanel {
  margin-top: 12px;
  max-height: 260px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
  background: #0b1020;
  color: #e5e7eb;
}

.muted {
  color: #6b7280;
  font-size: 13px;
}

.file-hint {
  margin-top: 8px;
  color: #4b5563;
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-panel {
  position: relative;
  width: min(620px, calc(100vw - 32px));
  margin: 8vh auto 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.25);
}

.modal-panel h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.ideas-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.idea-card {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 10px;
  padding: 10px;
}

.idea-cover {
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 6px;
}

.idea-title {
  font-size: 13px;
  margin-bottom: 6px;
  color: #1f2937;
}

.idea-reason {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 8px;
}

.storyboard-list {
  display: grid;
  gap: 12px;
}

.storyboard-card {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 12px;
  padding: 10px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 10px;
}

.storyboard-title {
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 8px;
}

.storyboard-image {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.storyboard-preview {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.storyboard-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  border: 1px dashed #93c5fd;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: #f0f9ff;
}

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

  .storyboard-card {
    grid-template-columns: 1fr;
  }
}
