/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[10].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-2: #eef0f4;
  --fg: #111318;
  --muted: #6b7280;
  --line: #e2e5ea;
  --accent: #4f46e5;
  --accent-fg: #ffffff;
  --ok: #157f3d;
  --bad: #b42318;
  --warn: #b45309;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f13;
    --surface: #14171d;
    --surface-2: #1c2029;
    --fg: #e6e8ec;
    --muted: #98a0ad;
    --line: #262b35;
    --accent: #7c74ff;
    --accent-fg: #0d0f13;
    --ok: #4ade80;
    --bad: #f87171;
    --warn: #fbbf24;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans KR",
    sans-serif;
  line-height: 1.6;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, monospace;
  font-size: 0.85em;
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  padding: 0.5rem 0.9rem;
  transition: filter 0.12s ease;
}
button:hover:not(:disabled) {
  filter: brightness(1.08);
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
button.primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: transparent;
  font-weight: 600;
}
button.danger {
  color: var(--bad);
}
button.ghost {
  background: transparent;
}

input,
select,
textarea {
  font: inherit;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
}
textarea {
  resize: vertical;
  min-height: 5rem;
  line-height: 1.5;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  font-size: 1.25rem;
  margin: 0;
}
.topbar .sub {
  color: var(--muted);
  font-size: 0.85rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
}

.row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  grid-gap: 0.75rem;
  gap: 0.75rem;
}
.stack > * + * {
  margin-top: 0.85rem;
}

.notice {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  padding: 0.7rem 0.9rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.87rem;
  color: var(--muted);
}
.error {
  border-left-color: var(--bad);
  color: var(--bad);
}

/* ── 드롭존 ─────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  background: var(--bg);
  transition:
    border-color 0.12s ease,
    background 0.12s ease;
  cursor: pointer;
}
.dropzone.over {
  border-color: var(--accent);
  background: var(--surface-2);
  color: var(--fg);
}
.dropzone.has-file {
  border-style: solid;
  border-color: var(--accent);
  color: var(--fg);
}

.progress {
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress > div {
  height: 100%;
  background: var(--accent);
  transition: width 0.15s ease;
}

/* ── 갤러리 ─────────────────────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  grid-gap: 1rem;
  gap: 1rem;
}
.tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  text-align: left;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.tile .thumb {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}
.tile .thumb-placeholder {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.8rem;
  grid-gap: 0.4rem;
  gap: 0.4rem;
}
.tile .body {
  padding: 0.7rem 0.8rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1;
}
.tile .prompt {
  font-size: 0.87rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile .meta {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
}
.badge.queued,
.badge.processing,
.badge.submitted {
  color: var(--warn);
}
.badge.failed,
.badge.cancelled {
  color: var(--bad);
}
.badge.succeeded {
  color: var(--ok);
}

/* ── 모달 ───────────────────────────────────────────────── */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  padding: 1.25rem;
  z-index: 50;
}
.modal {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 1.25rem;
}
.modal video {
  width: 100%;
  border-radius: 8px;
  background: #000;
  display: block;
}

.kv {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  grid-gap: 0.3rem 0.75rem;
  gap: 0.3rem 0.75rem;
  font-size: 0.85rem;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  word-break: break-word;
}

.center {
  min-height: 70vh;
  display: grid;
  place-items: center;
}
.login {
  width: min(360px, 100%);
}

/* ── 안내 페이지 ────────────────────────────────────────── */
.guide section {
  margin-top: 2.25rem;
}
.guide h2 {
  font-size: 1.05rem;
  margin: 0;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}
.guide h3 {
  font-size: 0.95rem;
  margin: 0;
}
.guide p {
  margin: 0;
  font-size: 0.92rem;
}
.guide ol {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.92rem;
}
.guide ol li + li {
  margin-top: 0.5rem;
}
.guide code {
  background: var(--surface-2);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.guide .kv {
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: 0.9rem 1.25rem;
  font-size: 0.9rem;
}
.guide .kv dt {
  font-weight: 600;
  color: var(--fg);
}
.guide .kv dd {
  color: var(--muted);
}

.flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  grid-gap: 0.75rem;
  gap: 0.75rem;
}
.flow-step {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
}
.flow-step p {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.flow-num {
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── 장면 에디터 ────────────────────────────────────────── */
.scene-body {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  grid-gap: 1rem;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 640px) {
  .scene-body {
    grid-template-columns: 1fr;
  }
}
.scene-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);
  display: block;
}
.scene-thumb.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  border: 1px dashed var(--line);
}
.scene-text textarea {
  min-height: 6rem;
}
.hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.35rem;
}
.subpanel {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
}
.stock-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  grid-gap: 0.5rem;
  gap: 0.5rem;
}
.stock-item {
  padding: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.stock-item img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
}
details.card summary::marker {
  color: var(--muted);
}

/* ── 숏츠 추출 ──────────────────────────────────────────── */
.scene.picked {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.pick-box {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}
.pick-box input {
  width: auto;
  margin: 0;
}
.shorts-bar {
  position: -webkit-sticky;
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.18);
}

