/* ===== 기본 ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Malgun Gothic", "맑은 고딕",
               "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: #1f2430;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* ===== 로그인 2열 ===== */
.login-body { background: #0f1220; }
.login-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
/* 1열: 브랜드 */
.login-brand {
  display: flex; align-items: center; justify-content: center;
  padding: 48px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #db2777 100%);
  color: #fff;
}
.brand-inner { max-width: 420px; }
.brand-logo {
  width: 64px; height: 64px; border-radius: 16px;
  background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; margin-bottom: 28px;
}
.login-brand h1 { font-size: 34px; margin: 0 0 16px; letter-spacing: -.5px; }
.login-brand p { font-size: 16px; line-height: 1.7; opacity: .9; margin: 0; }

/* 2열: 폼 */
.login-form-col {
  display: flex; align-items: center; justify-content: center;
  background: #f5f6fa; padding: 48px;
}
.login-form-inner { width: 100%; max-width: 380px; }
.login-form-inner h2 { font-size: 26px; margin: 0 0 6px; }
.login-sub { color: #8a90a2; margin: 0 0 28px; font-size: 14px; }

.field { display: block; margin-bottom: 18px; }
.field span { display: block; font-size: 13px; color: #556; margin-bottom: 8px; font-weight: 600; }
.field input {
  width: 100%; padding: 13px 14px; font-size: 15px;
  border: 1px solid #d7dae3; border-radius: 10px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  outline: none; border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.btn-primary {
  width: 100%; padding: 14px; font-size: 15px; font-weight: 700;
  color: #fff; background: #4f46e5; border: 0; border-radius: 10px;
  cursor: pointer; transition: background .15s;
}
.btn-primary:hover { background: #4338ca; }
.login-hint { text-align: center; color: #9aa0b0; font-size: 13px; margin-top: 22px; }
.alert-error {
  background: #fde8e8; color: #c0392b; border: 1px solid #f5c6c6;
  padding: 11px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 20px;
}

@media (max-width: 820px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { padding: 40px 28px; }
  .login-brand h1 { font-size: 28px; }
}

/* ===== 앱 레이아웃 ===== */
.app-body { background: #eef0f5; display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.app-header {
  height: 58px; flex: 0 0 58px;
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px; background: #121533; color: #fff;
  box-shadow: 0 1px 8px rgba(0,0,0,.15); z-index: 20;
}
.app-logo { font-weight: 700; font-size: 17px; letter-spacing: -.3px; }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-badge {
  background: rgba(255,255,255,.12); padding: 5px 12px; border-radius: 20px; font-size: 13px;
}
.icon-btn {
  background: transparent; border: 0; color: #fff; font-size: 20px; cursor: pointer;
  width: 34px; height: 34px; border-radius: 8px;
}
.icon-btn:hover { background: rgba(255,255,255,.1); }
.btn-ghost {
  border: 1px solid rgba(255,255,255,.3); padding: 6px 12px;
  border-radius: 8px; font-size: 13px; color: #fff;
}
.btn-ghost:hover { background: rgba(255,255,255,.1); }

.app-shell { flex: 1; display: flex; min-height: 0; }

/* 사이드 메뉴 */
.app-side {
  width: 240px; flex: 0 0 240px; background: #fff;
  border-right: 1px solid #e2e5ee; overflow-y: auto; padding: 16px 12px;
  transition: margin-left .2s;
}
.app-side.collapsed { margin-left: -240px; }
.side-title {
  font-size: 11px; font-weight: 700; color: #9aa0b0; text-transform: uppercase;
  letter-spacing: .5px; padding: 14px 12px 6px;
}
.nav-item {
  display: block; padding: 10px 12px; border-radius: 9px;
  font-size: 14px; color: #3a4055; margin-bottom: 2px; cursor: pointer;
}
.nav-item:hover { background: #f1f2f7; }
.nav-item.active { background: #eceafe; color: #4f46e5; font-weight: 700; }
.folder-list .folder-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; border-radius: 9px; font-size: 13px; color: #3a4055; cursor: pointer;
}
.folder-list .folder-item:hover { background: #f1f2f7; }
.folder-list .folder-item.active { background: #eceafe; color: #4f46e5; font-weight: 700; }
.folder-item .cnt { font-size: 11px; color: #9aa0b0; background: #f1f2f7; padding: 1px 7px; border-radius: 10px; }

/* 컨텐츠: 100% 폭 */
.app-content {
  flex: 1; width: 100%; min-width: 0;
  display: flex; flex-direction: column; padding: 18px 22px; min-height: 0;
}
.content-bar {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.view-title { font-size: 19px; font-weight: 700; }
.view-title .muted { font-size: 13px; font-weight: 400; color: #9aa0b0; margin-left: 8px; }

/* 변환 진행 패널 */
.job-panel {
  background: #fff; border: 1px solid #e2e5ee; border-left: 4px solid #4f46e5;
  border-radius: 12px; padding: 16px 18px; margin-bottom: 18px;
}
.job-panel.ok { border-left-color: #16a34a; }
.job-panel.err { border-left-color: #d97706; }
.job-title {
  font-weight: 700; font-size: 15px; line-height: 1.5;
  word-break: break-all; margin-bottom: 14px;
}
.job-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 0; }
.content-meta { display: flex; align-items: center; gap: 14px; }
.counter { font-size: 14px; color: #6b7280; }
.counter b { color: #4f46e5; }

/* 그리드 뷰어: 1행 2개 + 스크롤 */
.grid-area { flex: 1; min-height: 0; position: relative; overflow-y: auto; border-radius: 14px; }
.img-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 4px 4px 8px;
}
.img-card {
  position: relative; background: #12131c; border-radius: 12px; overflow: hidden;
  border: 3px solid transparent; transition: border-color .12s, transform .12s;
  margin: 0;
}
.img-card:hover { transform: translateY(-2px); }
.card-img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.img-card .card-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2; pointer-events: none;
  background: rgba(0,0,0,.6); color: #fff; padding: 4px 11px;
  border-radius: 16px; font-size: 12px; backdrop-filter: blur(4px);
  max-width: calc(100% - 66px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 우측 상단 체크 버튼 = 선택 토글 */
.check-form { position: absolute; top: 8px; right: 8px; z-index: 3; margin: 0; }
.img-card .check {
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; padding: 0;
  background: rgba(255,255,255,.9); color: #9aa0b0; border: 2px solid rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; transition: all .12s; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.img-card .check:hover { color: #16a34a; border-color: #16a34a; transform: scale(1.08); }
/* 선택됨 */
.img-card.selected { border-color: #16a34a; }
.img-card.selected .check { background: #16a34a; color: #fff; border-color: #16a34a; }
.img-card.selected::after {
  content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 9999px rgba(22,163,74,.10);
  pointer-events: none;
}

/* 우측 상단 하트 버튼 = 좋아요 토글 (사진 아카이브/AI) */
.img-card .like {
  position: absolute; top: 8px; right: 8px; z-index: 3; padding: 0;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.9); color: #c9ccd6; border: 2px solid rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1; transition: all .12s; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.img-card .like:hover { color: #e0245e; border-color: #e0245e; transform: scale(1.08); }
.img-card .like:disabled { opacity: .6; cursor: default; }
/* 좋아요됨 */
.img-card.liked { border-color: #e0245e; }
.img-card.liked .like { background: #e0245e; color: #fff; border-color: #e0245e; }
.img-card.liked::after {
  content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 9999px rgba(224,36,94,.10);
  pointer-events: none;
}

/* 1행 1장 보기 전환 버튼 */
.view-toggle {
  padding: 7px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
  border: 1px solid #d7dae3; background: #fff; color: #3a4055; border-radius: 8px;
  white-space: nowrap; transition: all .12s;
}
.view-toggle:hover { border-color: #4f46e5; color: #4f46e5; }
.view-toggle.active { background: #4f46e5; border-color: #4f46e5; color: #fff; }

/* 1행 1장 모드: 한 장씩 크게, 가운데 정렬 */
.img-grid.one-col { grid-template-columns: 1fr; max-width: 960px; margin: 0 auto; }

/* 원본 1장씩 보기 — 컨텐츠 폭 100% */
.one-area { overflow-y: auto; }
.one-wrap { width: 100%; max-width: none; margin: 0; padding: 0 0 12px; }
.one-bar {
  display: flex; align-items: center; gap: 14px; margin-bottom: 12px;
  background: #fff; border: 1px solid #e2e5ee; border-radius: 12px; padding: 10px 14px;
}
.one-info { flex: 1; min-width: 0; text-align: center; }
.one-info b { display: block; font-size: 15px; word-break: break-all; }
.crop-done {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  background: #0ea5e9; color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 12px;
}
.one-info span { font-size: 12px; color: #6b7280; }
.one-nav {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1; background: #f1f2f7; color: #3a4055;
}
.one-nav:hover { background: #4f46e5; color: #fff; }
/* 크롭 도구 막대 */
.one-tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff; border: 1px solid #e2e5ee; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 10px;
}
.one-tools .ct-label { font-size: 13px; font-weight: 700; color: #556; margin-right: 2px; }
.rbtn {
  padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid #d7dae3; background: #fff; color: #3a4055; border-radius: 8px;
}
.rbtn:hover { border-color: #4f46e5; color: #4f46e5; }
.rbtn.active { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.one-tools .btn-upload { padding: 7px 16px; font-size: 13px; margin-left: 6px; }
.ct-info { font-size: 12px; color: #6b7280; margin-left: auto; }
.ct-info a { color: #4f46e5; font-weight: 700; }

/* 이미지는 뷰포트를 넘지 않게. 높이 한도는 JS 가 --one-max-h 로 넣어준다 */
.one-stage { display: flex; justify-content: center; }
.one-card {
  border-radius: 12px; position: relative;
  display: inline-block; line-height: 0; max-width: 100%;
}
.one-imgwrap { position: relative; display: inline-block; line-height: 0; }
.one-img {
  display: block; width: auto; height: auto;
  max-width: 100%; max-height: var(--one-max-h, 70vh);
  cursor: crosshair; user-select: none;
}
.one-cropsel {
  position: absolute; z-index: 4; pointer-events: none;   /* 클릭은 이미지가 받는다 */
  border: 2px dashed #0ea5e9; background: rgba(14,165,233,.18);
  box-shadow: 0 0 0 9999px rgba(0,0,0,.42);
  cursor: move;
}
/* 박스 모서리 표시 — 잡아 옮길 수 있다는 힌트 */
.one-cropsel::after {
  content: ""; position: absolute; inset: 50% auto auto 50%;
  width: 22px; height: 22px; transform: translate(-50%, -50%);
  border: 2px solid rgba(255,255,255,.85); border-radius: 50%;
  background: rgba(14,165,233,.55);
}
.one-cropsel[hidden] { display: none; }
.one-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 10px; flex-wrap: wrap;
}
.one-foot .muted { font-size: 12px; color: #9aa0b0; }

/* 얼굴 사진 그리드: 원본이 작으므로 확대 없이 작은 타일로 */
.face-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  padding: 4px 4px 8px;
}
.face-card { background: #12131c; }
.face-card .card-img {
  width: 100%; height: 260px; object-fit: contain; background: #12131c;
}
/* 얼굴 선택(★) 버튼 */
.face-card .fsel {
  position: absolute; top: 8px; right: 8px; z-index: 3; padding: 0;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.9); color: #c9ccd6; border: 2px solid rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1; transition: all .12s; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.face-card .fsel:hover { color: #f59e0b; border-color: #f59e0b; transform: scale(1.08); }
.face-card .fsel:disabled { opacity: .6; cursor: default; }
.face-card.face-sel { border-color: #f59e0b; }
.face-card.face-sel .fsel { background: #f59e0b; color: #fff; border-color: #f59e0b; }

/* 이미지 상세 레이어 */
.detail-layer {
  position: fixed; inset: 0; z-index: 100; background: rgba(10,11,18,.92);
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.detail-layer[hidden] { display: none; }
.detail-layer img {
  max-width: 92vw; max-height: 88vh; object-fit: contain;
  border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
.detail-caption {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: #e6e8f0; font-size: 14px; background: rgba(0,0,0,.5);
  padding: 6px 16px; border-radius: 20px; backdrop-filter: blur(4px); white-space: nowrap;
}
.detail-orig {
  position: absolute; bottom: 22px; right: 22px; z-index: 3;
  background: rgba(255,255,255,.14); color: #e6e8f0; font-size: 13px; font-weight: 600;
  padding: 7px 14px; border-radius: 18px; backdrop-filter: blur(4px); cursor: pointer;
}
.detail-orig:hover { background: rgba(255,255,255,.28); color: #fff; }
.detail-orig[hidden] { display: none; }

.detail-select {
  position: absolute; top: 18px; left: 22px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 24px; cursor: pointer; font-size: 15px; font-weight: 700;
  border: 2px solid rgba(255,255,255,.6); background: rgba(255,255,255,.12); color: #fff;
  transition: all .12s;
}
.detail-select:hover { background: rgba(255,255,255,.22); }
.detail-select.on { background: #16a34a; border-color: #16a34a; color: #fff; }
.detail-select.heart.on { background: #e0245e; border-color: #e0245e; }
.detail-select:disabled { opacity: .6; cursor: default; }
/* 크롭 도구 */
.detail-crop {
  position: absolute; top: 18px; right: 78px; z-index: 3;
  padding: 10px 18px; border-radius: 24px; cursor: pointer; font-size: 14px; font-weight: 700;
  border: 2px solid rgba(255,255,255,.6); background: rgba(255,255,255,.12); color: #fff;
  transition: all .12s;
}
.detail-crop:hover { background: rgba(255,255,255,.22); }
.detail-crop.on { background: #0ea5e9; border-color: #0ea5e9; }
.detail-layer.cropping img { cursor: crosshair; user-select: none; }
/* 1:1 확대: 원본 픽셀 그대로 보며 영역을 잡는다 */
.detail-layer.zoomed { overflow: auto; align-items: flex-start; justify-content: flex-start; padding: 0; }
.detail-layer.zoomed img { max-width: none; max-height: none; border-radius: 0; }
.crop-zoom {
  position: fixed; top: 74px; right: 22px; z-index: 6;
  padding: 8px 14px; border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 700;
  border: 2px solid rgba(255,255,255,.5); background: rgba(18,19,28,.85); color: #fff;
}
.crop-zoom:hover { background: rgba(14,165,233,.85); border-color: #0ea5e9; }
.crop-zoom[hidden] { display: none; }
.crop-hint { position: fixed; }
.crop-box {
  position: fixed; z-index: 5; pointer-events: none;
  border: 2px dashed #0ea5e9; background: rgba(14,165,233,.16);
  box-shadow: 0 0 0 9999px rgba(0,0,0,.35);
}
.crop-hint {
  position: absolute; top: 74px; left: 50%; transform: translateX(-50%); z-index: 4;
  background: rgba(14,165,233,.9); color: #fff; padding: 7px 16px;
  border-radius: 20px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.crop-bar {
  position: fixed; z-index: 6; display: flex; align-items: center; gap: 10px;
  background: rgba(18,19,28,.95); padding: 9px 12px; border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
/* display 를 지정하면 hidden 속성이 무시되므로 명시적으로 눌러준다 */
.crop-bar[hidden] { display: none; }
.crop-dim { color: #cbd5e1; font-size: 12px; white-space: nowrap; }
.crop-dim .crop-link { color: #7dd3fc; font-weight: 700; }
.crop-go, .crop-reset {
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer;
  border: 0; white-space: nowrap;
}
.crop-go { background: #0ea5e9; color: #fff; }
.crop-go:disabled { opacity: .6; cursor: default; }
.crop-reset { background: rgba(255,255,255,.15); color: #fff; }
/* ===== 조합 리스트 ===== */
.cb-formula {
  background: #fff; border: 1px solid #e2e5ee; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 12px; font-size: 14px; color: #3a4055;
}
.cb-formula b { color: #4f46e5; }
.cb-formula .cb-total { font-size: 17px; }
.cb-filters {
  background: #fff; border: 1px solid #e2e5ee; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 12px;
}
.cb-frow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.cb-flabel { font-size: 13px; font-weight: 700; color: #556; width: 52px; flex: 0 0 52px; }
.cb-pageinfo { font-size: 13px; color: #6b7280; padding: 2px 4px 10px; }
.cb-pageinfo b { color: #4f46e5; }
.cb-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px; padding: 0 4px 8px;
}
.cb-card { background: #fff; border: 1px solid #e2e5ee; border-radius: 12px; overflow: hidden; position: relative; }
.cb-no {
  position: absolute; top: 6px; left: 6px; z-index: 4;
  background: rgba(0,0,0,.62); color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
}
.cb-imgs { position: relative; background: #12131c; line-height: 0; }
.cb-main { width: 100%; height: 230px; object-fit: cover; cursor: zoom-in; }
.cb-chip { border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.cb-faces { position: absolute; bottom: 8px; left: 8px; display: flex; gap: 4px; }
.cb-chip-face { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.cb-chip-plate { position: absolute; bottom: 8px; right: 8px; width: 54px; height: 40px; border-radius: 6px; object-fit: cover; }
.cb-badge2 {
  position: absolute; top: 6px; right: 6px; z-index: 4;
  background: #e0245e; color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
}
.cb-note { color: #9aa0b0; font-size: 12px; margin-left: 6px; }
.cb-label {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; font-size: 11px; color: #6b7280;
}
.cb-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-pager { display: flex; align-items: center; gap: 6px; justify-content: center; padding: 14px 0 6px; flex-wrap: wrap; }
.cb-pnum {
  min-width: 32px; text-align: center; padding: 6px 8px; border-radius: 8px;
  border: 1px solid #d7dae3; background: #fff; color: #3a4055; font-size: 13px; font-weight: 600;
}
.cb-pnum:hover { border-color: #4f46e5; color: #4f46e5; }
.cb-pnum.active { background: #4f46e5; border-color: #4f46e5; color: #fff; }

/* ===== 종합판 ===== */
.ov-sec { margin-bottom: 26px; }
.ov-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid #e2e5ee;
}
.ov-head h2 { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; }
.ov-cnt {
  background: #eceafe; color: #4f46e5; font-size: 12px; font-weight: 700;
  padding: 2px 9px; border-radius: 12px;
}
.ov-head .view-toggle { margin-left: auto; padding: 5px 12px; font-size: 12px; }
.ov-head .view-toggle + .view-toggle { margin-left: 0; }
.ov-empty { color: #9aa0b0; font-size: 14px; padding: 14px 4px; }
.ov-sub { font-size: 13px; font-weight: 700; color: #3a4055; margin: 10px 0 8px; }
.ov-sub .muted { font-weight: 400; font-size: 12px; color: #9aa0b0; }
/* 가로 스크롤 스트립 (배경판·얼굴처럼 개수가 적은 것) */
.ov-strip {
  display: flex; gap: 14px; overflow-x: auto; padding: 4px 4px 10px;
}
.ov-strip .ov-card { flex: 0 0 240px; }
.ov-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px; padding: 4px 4px 8px;
}
.ov-card .card-img { width: 100%; height: 240px; object-fit: cover; background: #12131c; }
.ov-face .card-img { object-fit: contain; }

/* 배경판 그리드 */
.plate-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px; padding: 4px 4px 8px;
}
.plate-card .card-img { width: 100%; height: 340px; object-fit: cover; background: #12131c; }
.plate-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 10px; font-size: 12px; color: #9aa0b0; background: #12131c;
}
.plate-meta a { color: #7dd3fc; font-weight: 600; margin-left: auto; }

/* 크롭 출처 폴더별 묶음 */
.crop-group { margin-bottom: 22px; }
.crop-group-title {
  font-size: 14px; font-weight: 700; color: #3a4055;
  padding: 6px 4px 10px; display: flex; align-items: center; gap: 8px;
}
.crop-group-title .muted { font-weight: 400; font-size: 12px; color: #9aa0b0; }

/* 크롭 카드 삭제 버튼 */
.crop-card .cdel {
  position: absolute; top: 8px; right: 8px; z-index: 3; padding: 0;
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.9); color: #9aa0b0; border: 2px solid rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; transition: all .12s;
}
.crop-card .cdel:hover { background: #c0392b; color: #fff; border-color: #c0392b; }

/* 머리 교체 결과: 원본 ↔ 결과 나란히 */
.hs-card {
  background: #fff; border: 1px solid #e2e5ee; border-radius: 12px;
  padding: 10px 12px 12px; margin-bottom: 16px;
}
.hs-title { font-size: 13px; font-weight: 700; color: #3a4055; padding-bottom: 8px; }
.hs-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hs-side { margin: 0; }
.hs-side img {
  display: block; width: 100%; height: auto; border-radius: 8px;
  background: #12131c; cursor: zoom-in;
}
.hs-side figcaption { font-size: 12px; color: #6b7280; padding-top: 6px; }

/* 두 명이 함께 찍힌 크롭 표시 */
.crop-card .crop-2in {
  position: absolute; bottom: 8px; left: 8px; z-index: 2; pointer-events: none;
  background: #e0245e; color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 10px;
}

.detail-close {
  position: absolute; top: 18px; right: 22px; width: 44px; height: 44px;
  border-radius: 50%; border: 0; cursor: pointer; font-size: 22px;
  background: rgba(255,255,255,.12); color: #fff; transition: background .12s;
}
.detail-close:hover { background: rgba(255,255,255,.25); }
.detail-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px;
  border-radius: 50%; border: 0; cursor: pointer; font-size: 30px; line-height: 1;
  background: rgba(255,255,255,.12); color: #fff; transition: background .12s;
}
.detail-nav:hover { background: rgba(255,255,255,.25); }
.detail-nav.prev { left: 24px; }
.detail-nav.next { right: 24px; }
@media (max-width: 820px) {
  .detail-nav { width: 42px; height: 42px; font-size: 24px; }
  .detail-nav.prev { left: 10px; } .detail-nav.next { right: 10px; }
}

/* 영상 변환 패널 */
.convert-area { flex: 1; min-height: 0; overflow-y: auto; padding: 4px; }

/* 업로드 박스 */
.upload-box {
  border: 2px dashed #c9cdda; border-radius: 12px; background: #fafbff;
  padding: 18px 20px; margin-bottom: 18px; transition: border-color .15s, background .15s;
}
.upload-box.dragover { border-color: #4f46e5; background: #eceafe; }
.upload-inner { display: flex; align-items: center; gap: 16px; }
.upload-ico {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 10px;
  background: #eceafe; color: #4f46e5; display: flex; align-items: center;
  justify-content: center; font-size: 22px;
}
.upload-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.upload-text b { font-size: 15px; }
.upload-text span { font-size: 13px; color: #8a90a2; }
.btn-upload {
  padding: 9px 18px; font-size: 14px; font-weight: 700; cursor: pointer;
  border: 1px solid #4f46e5; background: #4f46e5; color: #fff; border-radius: 10px;
  white-space: nowrap; transition: background .15s;
}
.btn-upload:hover:not(:disabled) { background: #4338ca; }
.btn-upload:disabled { opacity: .55; cursor: default; }
.upload-progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.upload-progress .progress { width: 100%; }

.video-list { display: flex; flex-direction: column; gap: 14px; }
.video-card {
  background: #fff; border: 1px solid #e2e5ee; border-radius: 12px;
  padding: 16px 18px; display: flex; align-items: center; gap: 16px;
}
.video-ico {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 10px;
  background: #eceafe; color: #4f46e5; display: flex; align-items: center;
  justify-content: center; font-size: 22px;
}
.video-info { flex: 1; min-width: 0; }
.video-name { font-weight: 700; font-size: 15px; word-break: break-all; }
.video-sub { font-size: 13px; color: #8a90a2; margin-top: 3px; }
.video-sub .ok { color: #16a34a; font-weight: 700; }
.video-sub .no { color: #d97706; font-weight: 700; }
.video-action { flex: 0 0 auto; display: flex; flex-direction: row; align-items: center; gap: 8px; }
.btn-delete {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 16px; font-size: 14px; font-weight: 700; cursor: pointer; line-height: 1.2;
  border: 1px solid #e2b3b3; background: #fff; color: #c0392b; border-radius: 10px;
  white-space: nowrap; transition: all .15s;
}
.btn-delete:hover { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-convert {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 18px; font-size: 14px; font-weight: 700; cursor: pointer; line-height: 1.2;
  border: 1px solid #4f46e5; background: #4f46e5; color: #fff; border-radius: 10px;
  transition: background .15s; white-space: nowrap; text-decoration: none;
}
.btn-convert:hover:not(:disabled) { background: #4338ca; }
.btn-convert:disabled { opacity: .55; cursor: default; }
.btn-convert.re { background: #fff; color: #4f46e5; }
.progress {
  width: 180px; height: 8px; border-radius: 5px; background: #eef0f5; overflow: hidden;
}
.progress > i { display: block; height: 100%; width: 0; background: #4f46e5; transition: width .2s; }
.progress-txt { font-size: 12px; color: #6b7280; }

.viewer-hint { text-align: center; color: #9aa0b0; font-size: 13px; margin-top: 10px; }
.empty-msg {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #9aa0b0; font-size: 15px;
}

@media (max-width: 820px) {
  .app-side { position: absolute; z-index: 15; height: calc(100% - 58px); }
  .app-content { padding: 14px; }
  .img-grid { gap: 10px; }
  .sl-item { flex-direction: column; }
  .sl-thumb { flex: none; width: 100%; }
  .sl-memo { min-height: 200px; }
}

/* ===== 이미지 생성 설정 패널 (gallery.php) ===== */
.gen-settings {
  background: #fff; border: 1px solid #e2e5ee; border-radius: 12px;
  padding: 4px 16px; margin-bottom: 16px;
}
.gen-settings > summary {
  cursor: pointer; font-weight: 700; font-size: 15px; padding: 12px 4px; list-style: none;
}
.gen-settings > summary::-webkit-details-marker { display: none; }
.gen-settings > summary::before { content: "▸ "; color: #9aa0b0; }
.gen-settings[open] > summary::before { content: "▾ "; }
.gen-settings .muted { font-weight: 400; color: #9aa0b0; font-size: 13px; }
.gen-settings-form { padding: 8px 4px 16px; }
.gs-active { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; font-size: 14px; }
.gs-active .gs-label { font-weight: 700; color: #556; }
.gs-active label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.gs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gs-box { border: 1px solid #e2e5ee; border-radius: 10px; padding: 12px 14px 14px; margin: 0; }
.gs-box legend { font-weight: 700; font-size: 13px; color: #4f46e5; padding: 0 6px; }
.gs-f { display: block; margin-bottom: 10px; }
.gs-f > span { display: block; font-size: 12px; color: #6b7280; margin-bottom: 5px; font-weight: 600; }
.gs-f input, .gs-f select {
  width: 100%; padding: 9px 11px; font-size: 14px; border: 1px solid #d7dae3; border-radius: 8px; background: #fff;
}
.gs-f input:focus, .gs-f select:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.gs-row { display: flex; gap: 10px; }
.gs-row .gs-f { flex: 1; }
.gs-actions { display: flex; align-items: center; gap: 16px; margin-top: 14px; font-size: 13px; }
.gs-actions .muted { color: #9aa0b0; }
.gs-actions a { color: #4f46e5; font-weight: 600; }

/* ===== 이미지 생성 폼 (generate.php) ===== */
.gen-form {
  background: #fff; border: 1px solid #e2e5ee; border-radius: 12px;
  padding: 18px 20px; margin-bottom: 18px; max-width: 760px;
}
.gen-form.busy { opacity: .7; pointer-events: none; }
.gen-modes { display: flex; gap: 18px; margin-bottom: 14px; }
.gen-mode { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
.gen-field { display: block; margin-bottom: 14px; }
.gen-field > span { display: block; font-size: 13px; color: #556; margin-bottom: 6px; font-weight: 600; }
.gen-field textarea, .gen-field input, .gen-field select {
  width: 100%; padding: 10px 12px; font-size: 14px; border: 1px solid #d7dae3; border-radius: 9px; background: #fff;
  font-family: inherit; resize: vertical;
}
.gen-field textarea:focus, .gen-field input:focus, .gen-field select:focus {
  outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
.gen-row { display: flex; gap: 12px; }
.gen-row .gen-field { flex: 1; }
.gen-actions { display: flex; align-items: center; gap: 14px; }
.gen-status { font-size: 13px; color: #6b7280; }
.gen-result { max-width: 760px; }
.gen-result-head { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.gen-result-head .gen-link { color: #4f46e5; }
.gen-result .img-grid { grid-template-columns: repeat(2, 1fr); }

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

/* AI 턴 탭 */
.turn-tabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.turn-tab {
  padding: 6px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  background: #f1f2f7; color: #3a4055; border: 1px solid #e2e5ee;
}
.turn-tab:hover { background: #eceafe; }
.turn-tab.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }

/* 하위 메뉴 (조합 리스트 → 생성 결과) */
.nav-item.nav-sub { padding-left: 20px; font-size: 13px; color: #6b7280; }

/* 최신 버전 강조 */
.cb-card.cb-latest { outline: 3px solid #4f46e5; outline-offset: -3px; }
.cb-card.cb-latest .cb-no { background: #4f46e5; }

/* ===== 생성 결과 블로그형 보기 ===== */
.blog-list { max-width: 1000px; margin: 0 auto; }
.blog-item {
  background: #fff; border: 1px solid #e2e5ee; border-radius: 14px;
  overflow: hidden; margin-bottom: 26px;
}
.blog-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid #eef0f5;
}
.blog-no {
  background: #4f46e5; color: #fff; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 12px;
}
.blog-title { font-size: 15px; word-break: break-all; }
.blog-ver {
  background: #eceafe; color: #4f46e5; font-size: 11px; font-weight: 700;
  padding: 2px 9px; border-radius: 10px;
}
.blog-2in { position: static; }
.blog-set { margin-left: auto; font-size: 12px; color: #9aa0b0; }
.blog-img { background: #12131c; line-height: 0; text-align: center; }
.blog-img img {
  max-width: 100%; width: auto; height: auto; max-height: 80vh;
  cursor: zoom-in; display: inline-block;
}
.blog-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px;
}
.blog-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.blog-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: #f1f2f7; border-radius: 20px; padding: 4px 12px 4px 4px;
  font-size: 12px; color: #3a4055;
}
.blog-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.blog-meta { margin-left: auto; font-size: 12px; color: #9aa0b0; }
.blog-meta a { color: #4f46e5; font-weight: 600; }
@media (max-width: 820px) {
  .blog-foot { flex-direction: column; align-items: flex-start; }
  .blog-meta { margin-left: 0; }
}

/* ===== 한복별 보기 ===== */
.hb-back { color: #4f46e5; font-size: 13px; font-weight: 600; margin-right: 10px; }
.hb-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px; padding: 4px 4px 8px;
}
.hb-item {
  background: #fff; border: 1px solid #e2e5ee; border-radius: 12px;
  overflow: hidden; display: block; transition: transform .12s, border-color .12s;
}
.hb-item:hover { transform: translateY(-2px); border-color: #4f46e5; }
.hb-thumb { position: relative; background: #12131c; }
.hb-thumb img { width: 100%; height: 250px; object-fit: cover; display: block; }
.hb-2in, .hb-mann {
  position: absolute; top: 8px; right: 8px;
  color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
}
.hb-2in { background: #e0245e; }
.hb-mann { background: #6b7280; }
.hb-info { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 13px; }
.hb-info b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-cnt { background: #eceafe; color: #4f46e5; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.hb-sel { background: #ffe4ec; color: #e0245e; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
/* 상세 */
.hb-cover {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border: 1px solid #e2e5ee; border-radius: 12px;
  padding: 12px 16px; margin-bottom: 12px;
}
.hb-cover img { width: 90px; height: 120px; object-fit: cover; border-radius: 8px; background: #12131c; }
.hb-cover-txt { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.hb-cover-txt .muted { color: #9aa0b0; font-size: 12px; }
.hb-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px; padding: 4px 4px 8px;
}
.hb-card .card-img { width: 100%; height: 290px; object-fit: cover; }

/* ===== 사진 상세 페이지 ===== */
.pv-area { display: flex; flex-direction: column; }
.pv-wrap {
  position: relative; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background: #12131c; border-radius: 12px; overflow: hidden;
}
.pv-img { max-width: 100%; max-height: 72vh; width: auto; height: auto; display: block; }
.pv-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; line-height: 1; color: #fff; background: rgba(255,255,255,.15);
  backdrop-filter: blur(4px); transition: background .12s;
}
.pv-nav:hover { background: rgba(255,255,255,.32); }
.pv-nav.prev { left: 16px; }
.pv-nav.next { right: 16px; }
.pv-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1px solid #e2e5ee; border-radius: 12px;
  padding: 12px 16px; margin-top: 12px;
}
.pv-kv { font-size: 12px; color: #6b7280; }
.pv-kv b { color: #3a4055; margin-right: 4px; }
.pv-kv a { color: #4f46e5; font-weight: 600; }

/* ===== 메모 ===== */
.pv-memo {
  background: #fff; border: 1px solid #e2e5ee; border-radius: 12px;
  padding: 12px 16px; margin-top: 12px;
}
.pv-memo-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.pv-memo-head .muted { color: #9aa0b0; font-size: 12px; }
.pv-memo-state { margin-left: auto; font-size: 12px; color: #16a34a; font-weight: 700; }
.pv-memo textarea, .sl-memo {
  width: 100%; padding: 10px 12px; font-size: 14px; font-family: inherit;
  border: 1px solid #d7dae3; border-radius: 9px; background: #fff; resize: vertical;
}
.pv-memo textarea:focus, .sl-memo:focus {
  outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

/* ===== 셀렉 목록 ===== */
/* 1열 구조: 한 줄에 한 장 · 왼쪽 사진 / 오른쪽 코멘트 */
.sl-list { display: flex; flex-direction: column; gap: 12px; padding: 4px 4px 8px; }
.sl-item {
  display: flex; gap: 16px; width: 100%; align-items: stretch; background: #fff;
  border: 1px solid #e2e5ee; border-radius: 12px; padding: 14px;
}
/* 좌우 폭 5:5 */
.sl-thumb { flex: 1 1 0; min-width: 0; align-self: flex-start; }
.sl-thumb img { width: 100%; height: auto; border-radius: 8px; background: #12131c; display: block; }
.sl-body { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
/* 코멘트가 충분히 보이도록 남는 높이를 전부 차지 (내용이 길면 JS가 더 늘림) */
.sl-memo { flex: 1 1 auto; min-height: 300px; line-height: 1.6; overflow: hidden; }
/* 묶음 제목줄의 원본 한복 링크 — 생성 사진과 비교용 */
.sl-orig {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #e2e5ee; border-radius: 10px;
  padding: 4px 12px 4px 4px; font-size: 12px; font-weight: 700; color: #4f46e5;
}
.sl-orig:hover { border-color: #6366f1; background: #f5f5ff; }
.sl-orig img {
  width: 34px; height: 44px; object-fit: cover;
  border-radius: 7px; background: #12131c; display: block;
}
.sl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.sl-head b { word-break: break-all; }
.sl-scene { background: #eceafe; color: #4f46e5; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 10px; }
.sl-head .muted { color: #9aa0b0; font-size: 12px; }
.sl-foot { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.sl-state { color: #16a34a; font-weight: 700; }
.sl-foot a { margin-left: auto; color: #4f46e5; font-weight: 600; }
@media print {
  .app-header, .app-side, .content-meta, .viewer-hint, .sl-foot { display: none !important; }
  .app-content { padding: 0; }
  .sl-item { break-inside: avoid; border-color: #999; }
  .grid-area { overflow: visible !important; }
}
.sl-rev {
  background: #dcfce7; color: #15803d; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 10px;
}
.sl-rev:hover { background: #bbf7d0; }

/* ===== 배경 8종 생성 ===== */
.bg-panel { background: #fff; border: 1px solid #e2e5ee; border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.bg-sec-title { font-size: 14px; font-weight: 700; color: #3a4055; margin: 14px 0 10px; }
.bg-sec-title:first-child { margin-top: 0; }
.bg-sec-title small { font-weight: 400; font-size: 12px; color: #9aa0b0; margin-left: 6px; }
.bg-cat { font-size: 12px; font-weight: 700; color: #4f46e5; margin: 12px 0 6px; }
.bg-srcs { display: flex; gap: 12px; flex-wrap: wrap; }
.bg-src {
  display: flex; align-items: center; gap: 10px; flex: 1 1 220px;
  border: 1px solid #d7dae3; border-radius: 10px; padding: 8px 12px; cursor: pointer;
}
.bg-src:has(input:checked), .bg-scene:has(input:checked) { border-color: #4f46e5; background: #f5f4ff; }
.bg-src img { width: 44px; height: 56px; object-fit: cover; border-radius: 6px; background: #12131c; }
.bg-src-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bg-src-body small { font-size: 11px; color: #9aa0b0; }
.bg-scenes { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.bg-scene {
  display: flex; align-items: flex-start; gap: 9px;
  border: 1px solid #d7dae3; border-radius: 10px; padding: 9px 12px; cursor: pointer;
}
.bg-scene input { margin-top: 3px; }
.bg-scene-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; }
.bg-scene-body small { font-size: 11px; color: #6b7280; line-height: 1.5; }
.bg-scene-cnt { font-size: 11px; font-style: normal; color: #16a34a; font-weight: 700; }
.bg-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.bg-progress { background: #fff; border: 1px solid #e2e5ee; border-radius: 12px; padding: 14px 18px; margin-bottom: 14px; }
.bg-bar { height: 8px; background: #eceafe; border-radius: 6px; overflow: hidden; }
.bg-bar-fill { height: 100%; width: 0; background: #4f46e5; transition: width .4s; }
.bg-stat { font-size: 13px; color: #3a4055; margin: 10px 0 8px; font-weight: 600; }
.bg-log {
  max-height: 180px; overflow-y: auto; margin: 0; padding: 10px 12px;
  background: #12131c; color: #cbd5e1; border-radius: 8px;
  font-size: 11px; line-height: 1.7; white-space: pre-wrap; word-break: break-all;
}

/* ===== 배경 이어보기 (웹툰형 세로 스크롤) ===== */
.strip-area { background: #12131c; }
.strip { max-width: 860px; margin: 0 auto; }
.strip-sep {
  position: sticky; top: 0; z-index: 5;
  background: rgba(18,19,28,.92); color: #cbd5e1;
  font-size: 12px; font-weight: 700; padding: 10px 14px; margin-bottom: 8px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.strip-item {
  position: relative; margin: 0 0 16px; display: block; background: #12131c;
  border-radius: 10px; overflow: hidden; border: 3px solid transparent;
}
.strip-item.picked { border-color: #16a34a; }
.strip-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.strip-item figcaption {
  position: absolute; left: 10px; top: 10px;
  display: flex; align-items: center; gap: 7px;
  background: rgba(0,0,0,.5); color: #fff; font-size: 11px;
  padding: 4px 10px; border-radius: 12px; backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .15s;
}
.strip-item:hover figcaption { opacity: 1; }
.strip-no { background: rgba(255,255,255,.22); border-radius: 8px; padding: 0 6px; font-weight: 700; }
.strip-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 20;
  width: 44px; height: 44px; border-radius: 50%;
  background: #4f46e5; color: #fff; border: 0; font-size: 20px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.strip-top:hover { background: #4338ca; }
@media (max-width: 900px) { .strip { max-width: none; } }

.strip-pick {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255,255,255,.75); background: rgba(0,0,0,.4);
  color: rgba(255,255,255,.8); font-size: 15px; line-height: 1;
}
.strip-pick:hover { border-color: #16a34a; color: #16a34a; transform: scale(1.08); }
.strip-item.picked .strip-pick { background: #16a34a; border-color: #16a34a; color: #fff; }
.strip-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 22px; z-index: 25;
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #e2e5ee; border-radius: 30px;
  padding: 8px 10px 8px 20px; box-shadow: 0 6px 22px rgba(0,0,0,.25);
}
.strip-bar-n { font-size: 14px; }
.strip-bar-n b { color: #4f46e5; font-size: 16px; }
.strip-bar-size { font-size: 12px; color: #9aa0b0; }
.strip-bar .btn-upload { padding: 8px 18px; font-size: 13px; }
.strip-bar .view-toggle { padding: 7px 14px; font-size: 12px; }

/* ===== 사이드바 1차 메뉴 그룹 (빈알페오 / 다운블로우) ===== */
.nav-grp { margin-bottom: 4px; }
.nav-grp > summary {
  list-style: none; cursor: pointer; padding: 11px 12px; border-radius: 9px;
  font-size: 15px; font-weight: 700; color: #232838; background: #f6f7fb;
}
.nav-grp > summary::-webkit-details-marker { display: none; }
.nav-grp > summary::before { content: "▸ "; color: #9aa0b0; font-weight: 400; }
.nav-grp[open] > summary::before { content: "▾ "; }
.nav-grp > summary:hover { background: #eceafe; }
.nav-grp[open] > summary { color: #4f46e5; }
.nav-grp .nav-item { margin-left: 6px; }
.nav-grp .side-title { padding-top: 12px; }

/* ===== 다운블로우 요청사항 (downblow.php) ===== */
.db-req {
  background: #fff; border: 1px solid #e2e5ee; border-radius: 12px;
  padding: 18px 22px; margin: 4px 4px 20px;
  white-space: pre-wrap; font-size: 14px; line-height: 1.8; color: #3a4055;
}
.db-req a { color: #4f46e5; font-weight: 600; }
.db-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px; padding: 4px 4px 8px;
}
.db-card .card-img { width: 100%; height: auto; background: #12131c; }
.nav-grp .folder-list { margin-left: 6px; }
.db-grid.db-tall { grid-template-columns: 1fr; max-width: 900px; }
.db-grid.db-tall .db-card > a { display: block; max-height: 70vh; overflow-y: auto; }
.db-model {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border: 1px solid #e2e5ee; border-left: 4px solid #4f46e5;
  border-radius: 12px; padding: 14px 18px; margin: 4px 4px 16px;
}
.db-model img { display: block; width: 104px; height: 104px; object-fit: cover; border-radius: 10px; }
.db-model-txt { font-size: 14px; color: #3a4055; line-height: 1.7; }
.db-model-txt > b { color: #4f46e5; font-size: 15px; }
.db-model-txt a { color: #4f46e5; font-weight: 600; }
/* 요청사항(1열) · 결과(2열) */
.db-cols { display: grid; grid-template-columns: minmax(360px, 480px) 1fr; gap: 22px; align-items: start; padding: 4px; }
.db-col-head {
  font-size: 13px; font-weight: 700; color: #4f46e5; letter-spacing: .5px;
  padding: 2px 2px 10px; border-bottom: 2px solid #eceafe; margin-bottom: 14px;
}
.db-col-req .db-req { margin: 0 0 18px; padding: 16px 18px; line-height: 1.75; }
.db-col-res .db-model { margin: 0 0 18px; }
.db-col-req .db-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; padding: 2px; }
.db-col-req .db-grid.db-tall { max-width: none; }
.db-col-req .db-grid.db-tall .db-card > a { max-height: 420px; }
.db-col-req .plate-meta { font-size: 11px; padding: 6px 8px; gap: 6px; }
.db-col-res .db-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.db-empty {
  background: #fff; border: 1px dashed #d7dae3; border-radius: 12px;
  padding: 28px; text-align: center; color: #9aa0b0; font-size: 14px;
}
@media (max-width: 1100px) {
  .db-cols { grid-template-columns: 1fr; }
}

/* ===== 결과 갤러리 (dbgallery.php) ===== */
.dbg-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px; padding: 4px 4px 8px;
}
.dbg-card .card-img { width: 100%; height: auto; background: #12131c; }
.dbg-card .card-badge { max-width: calc(100% - 60px); }
.dbg-card .dbg-pick {
  position: absolute; top: 8px; right: 8px; z-index: 3; padding: 0;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.9); color: #c9ccd6; border: 2px solid rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1; transition: all .12s; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.dbg-card .dbg-pick:hover { color: #f59e0b; border-color: #f59e0b; transform: scale(1.08); }
.dbg-card .dbg-pick:disabled { opacity: .6; cursor: default; }
.dbg-card.picked { border-color: #f59e0b; }
.dbg-card.picked .dbg-pick { background: #f59e0b; color: #fff; border-color: #f59e0b; }
.dbg-ver {
  position: absolute; left: 10px; bottom: 44px; z-index: 2; pointer-events: none;
  background: rgba(0,0,0,.6); color: #c9ccd6; padding: 3px 9px; border-radius: 14px; font-size: 11px;
}
.dbg-ver.is-latest { background: #4f46e5; color: #fff; }
.db-more { padding: 6px 4px 2px; font-size: 13px; }
.db-more a { color: #4f46e5; font-weight: 600; }

/* ===== 다운블로우 상세 레이어 (dblayer.js) ===== */
.dbl-layer {
  position: fixed; inset: 0; z-index: 60; background: rgba(10,11,16,.94);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.dbl-layer[hidden] { display: none; }
.dbl-stage {
  margin: 0; flex: 1; min-height: 0; width: 100%;
  display: flex; align-items: center; justify-content: center; padding: 46px 64px 8px;
}
.dbl-img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #12131c;
}
.dbl-close {
  position: absolute; top: 14px; right: 18px; z-index: 2; cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%; padding: 0;
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25);
  font-size: 18px; line-height: 1;
}
.dbl-close:hover { background: rgba(255,255,255,.24); }
.dbl-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; cursor: pointer;
  width: 52px; height: 76px; border-radius: 10px; padding: 0;
  background: rgba(255,255,255,.10); color: #fff; border: 1px solid rgba(255,255,255,.2);
  font-size: 30px; line-height: 1;
}
.dbl-nav:hover { background: rgba(255,255,255,.22); }
.dbl-nav.prev { left: 12px; }
.dbl-nav.next { right: 12px; }
.dbl-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center;
  padding: 10px 18px 18px; color: #c9ccd6; font-size: 13px;
}
.dbl-bar .dbl-orig { color: #7dd3fc; font-weight: 600; }
.dbl-pick {
  cursor: pointer; padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 700;
  background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.25);
}
.dbl-pick:hover { border-color: #f59e0b; color: #f59e0b; }
.dbl-pick.on { background: #f59e0b; border-color: #f59e0b; color: #fff; }
@media (max-width: 820px) {
  .dbl-stage { padding: 44px 8px 4px; }
  .dbl-nav { width: 40px; height: 60px; font-size: 24px; }
}

/* ===== 전달 구성 (dbdeliver.php) ===== */
.dv-note {
  background: #fff; border: 1px solid #e2e5ee; border-left: 4px solid #4f46e5; border-radius: 10px;
  padding: 12px 16px; margin: 4px 4px 18px; font-size: 13px; line-height: 1.7; color: #3a4055;
}
.dv-note.muted { border-left-color: #d7dae3; color: #9aa0b0; }
.dv-group { margin-bottom: 26px; }
.dv-group-title {
  font-size: 14px; font-weight: 700; color: #3a4055; padding: 6px 4px 10px;
  display: flex; align-items: center; gap: 10px;
}
.dv-group-title .muted { font-weight: 400; font-size: 12px; color: #9aa0b0; }
.dv-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px; padding: 2px 4px;
}
.dv-slot {
  background: #12131c; border: 1px solid #e2e5ee; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column;
}
.dv-slot.empty { background: #fff; border-style: dashed; border-color: #d7dae3; }
.dv-slot-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; font-size: 12px; background: #fff; color: #3a4055; border-bottom: 1px solid #eef0f5;
}
.dv-slot .dv-code {
  font-size: 11px; font-weight: 700; color: #4f46e5; background: #eceafe;
  padding: 2px 8px; border-radius: 10px;
}
.dv-slot .card-img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.dv-slot-foot {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  font-size: 11px; color: #9aa0b0; background: #12131c;
}
.dv-file { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-clear {
  margin-left: auto; cursor: pointer; font-size: 11px; padding: 3px 9px; border-radius: 7px;
  background: transparent; color: #9aa0b0; border: 1px solid #3a4055;
}
.dv-clear:hover { color: #fff; border-color: #c0392b; background: #c0392b; }
.dv-empty-box {
  flex: 1; min-height: 190px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  color: #b6bac6; font-size: 13px; text-align: center; padding: 12px;
}
.dv-assign {
  width: 100%; font-size: 12px; padding: 5px 8px; border-radius: 7px;
  border: 1px solid #3a4055; background: #1b1d29; color: #c9ccd6;
}
@media print {
  .dv-pool, .dv-clear, .dv-slot-foot { display: none !important; }
  .dv-slot { break-inside: avoid; border-color: #ccc; }
  .dv-grid { grid-template-columns: repeat(3, 1fr); }
}

/* 시간순 전체보기 (timeline.php) */
.tl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; padding: 4px 4px 8px; }
.tl-day {
  grid-column: 1 / -1; position: sticky; top: 0; z-index: 2; margin: 14px 0 2px;
  background: #eceafe; color: #4f46e5; border: 1px solid #ddd8fb; border-radius: 8px;
  padding: 7px 12px; font-size: 14px; font-weight: 700;
}
.tl-grid > .tl-day:first-child { margin-top: 0; }
.tl-item {
  position: relative; display: block; background: #12131c; border-radius: 10px; overflow: hidden;
  border: 2px solid transparent; transition: border-color .12s, transform .12s;
  content-visibility: auto; contain-intrinsic-size: 270px;
}
.tl-item:hover { border-color: #4f46e5; transform: translateY(-2px); }
.tl-item.liked, .tl-item.liked:hover { border-color: #e0245e; }
.tl-link { display: block; }
.tl-item img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; cursor: pointer; }
.tl-no {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  background: rgba(0,0,0,.55); color: #fff; border-radius: 8px;
  padding: 1px 7px; font-size: 11px; font-weight: 700;
}
.tl-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px;
  display: flex; gap: 6px; align-items: baseline; color: #fff; font-size: 11px;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
}
.tl-cap b { font-size: 12px; flex: none; }
.tl-cap > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .85; }
.tl-more { display: flex; justify-content: center; padding: 18px 0 28px; }
