/* 모먼트랩 앱 화면 공통 스타일. 랜딩(index.html)은 design-taste-frontend 키트(/assets)를 쓰고,
   여기는 같은 색(white-mint-tiles: 흰 바탕, 짙은 회색, 민트 한 가지)과 글꼴(Familjen Grotesk + Noto Sans KR)을 앱 화면에 맞춘다. */
@import url('https://fonts.googleapis.com/css2?family=Familjen+Grotesk:wght@400..700&family=Noto+Sans+KR:wght@400;500&display=swap');

:root {
  --paper: #ffffff;      /* 바탕 */
  --paper-2: #f3f3f3;    /* 한 단계 어두운 면 */
  --ink: #232323;        /* 글자 */
  --muted: #686868;
  --line: #e2e2e2;
  --film: #232323;       /* 어두운 면 (바닥, 추천 요금제) */
  --edge: #a1ffcb;       /* 어두운 면 위의 강조 글자 */
  --action: #232323;     /* 주 단추, 링크, 포커스 */
  --pencil: #c8321f;     /* 오류, 환불처럼 되돌릴 수 없는 일 */
  --ok: #2f7a4f;
  --card: #ffffff;       /* 카드, 창, 입력란 바탕 */
  --soft: #fafafa;       /* 카드 안 머리줄, 지나갈 때 */
  --on-ink: #ffffff;     /* 짙은 단추(--ink, --action) 위 글자 */
  --on-film: #ffffff;    /* 짙은 면(--film) 위 글자 */
  --field-line: #c4c9d2; /* 입력란 테두리 */
  --mint-soft: #f3fff8;  /* 바뀐 칸, 새 알림 */
  --ok-soft: #e2efe6;
  --bad-soft: #f6e3e1;
  --switch-off: #d6d6d6;
  --glass: rgba(255, 255, 255, 0.94); /* 사진 위 단추 */
  --serif: 'Familjen Grotesk', 'Noto Sans KR', system-ui, sans-serif;
  --sans: 'Familjen Grotesk', 'Noto Sans KR', system-ui, sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
}
/* 다크 모드: 스튜디오 머리의 단추로 켜고 끈다(localStorage 'theme'). 처음에는 흰 바탕. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #121212;
  --paper-2: #1c1c1c;
  --ink: #ececec;
  --muted: #9b9b9b;
  --line: #2d2d2d;
  --film: #262626;
  --action: #ececec;
  --pencil: #ff7a66;
  --ok: #6fd39a;
  --card: #181818;
  --soft: #1f1f1f;
  --on-ink: #121212;
  --on-film: #f2f2f2;
  --field-line: #3a3a3a;
  --mint-soft: #13281d;
  --ok-soft: #16301f;
  --bad-soft: #3a1b16;
  --switch-off: #474747;
  --glass: rgba(24, 24, 24, 0.9);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.65; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; letter-spacing: -0.035em; }
h1 { font-size: clamp(32px, 4.4vw, 48px); }
h2 { font-size: clamp(26px, 3vw, 34px); margin: 0 0 12px; }
h3 { font-size: 20px; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

/* 머리말 */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.nav nav { display: flex; gap: 22px; align-items: center; }
.nav nav a { text-decoration: none; color: var(--muted); font-size: 15px; white-space: nowrap; }
.nav nav a:hover { color: var(--ink); }
.nav nav a.btn { color: var(--on-ink); }
.logo { font-family: var(--serif); font-weight: 500; font-size: 22px; letter-spacing: -0.03em; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.logo::before { content: ''; width: 20px; height: 20px; background: url(/favicon.svg) center / contain no-repeat; }
.footer .logo::before, :root[data-theme="dark"] .logo::before { filter: brightness(0) invert(1); }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.section { padding: 96px 0; border-top: 1px solid var(--line); }
.wrap.section { padding: 48px 28px 80px; border-top: 0; }
.center { text-align: center; }
.lead { color: var(--muted); font-size: 18px; max-width: 34em; }
.center .lead { margin-left: auto; margin-right: auto; }

/* 단추: 주 단추는 코발트 하나. */
.btn { display: inline-flex; align-items: center; justify-content: center; background: var(--action); color: var(--on-ink); border: 1px solid var(--action); border-radius: 999px; padding: 13px 22px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: background 0.15s; }
.btn:hover:not(:disabled) { background: #000; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn[hidden] { display: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { background: var(--paper-2); }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.danger { background: var(--pencil); border-color: var(--pencil); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* 테마 팩 */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 36px 24px; }
.pack-card { text-decoration: none; display: block; }
.pack-card img { aspect-ratio: 3 / 4; width: 100%; object-fit: cover; background: var(--paper-2); border-radius: 20px; }
.pack-card .body { padding: 14px 0 0; }
.pack-card h3 { margin: 0 0 4px; font-size: 19px; }
.pack-card:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.pack-card p { margin: 0; color: var(--muted); font-size: 15px; }
.pack-hero { margin: 40px 0 0; padding: 56px 0 72px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.pack-hero h1 { margin: 0 0 14px; }
.pack-hero p { font-size: 18px; color: var(--muted); max-width: 30em; }
.pack-hero .shots { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px; border-radius: 24px; }
.pack-hero .shots img { background: var(--card); padding: 6px; border-radius: 16px; }
.scene-list { padding-left: 20px; color: var(--muted); }
.scene-list li { margin: 6px 0; }

/* 요금표 */
.plans-head { text-align: center; }
.cycle-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: var(--card); padding: 3px; margin: 0 auto 40px; }
.cycle-toggle button { border: 0; font: inherit; font-weight: 600; padding: 9px 18px; border-radius: 999px; cursor: pointer; background: transparent; color: var(--ink); }
.cycle-toggle button.on { background: var(--film); color: var(--on-film); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 24px; overflow: hidden; }
.plan { padding: 48px 24px 32px; display: flex; flex-direction: column; position: relative; border-left: 1px solid var(--line); }
.plan:first-child { border-left: 0; }
.plan.recommended { background: var(--film); color: var(--on-film); border-color: var(--film); }
.plan.recommended .btn { background: var(--on-film); color: var(--film); border-color: var(--on-film); }
.plan.recommended .btn:hover:not(:disabled) { background: var(--on-film); opacity: 0.92; }
.plan.recommended :is(.per, .price-note, .blurb, li, li .sub) { color: #c9c3bb; }
.plan.recommended li.head { color: var(--paper); }
.plan .badge { position: absolute; top: 18px; left: 24px; font-family: var(--serif); color: var(--edge); font-size: 14px; }
.plan h3 { margin: 0; font-size: 24px; }
.price-row { display: flex; align-items: baseline; gap: 6px; margin: 14px 0 6px; white-space: nowrap; }
.price-row .per { color: var(--muted); }
.price { font-family: var(--serif); font-size: 36px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.price-note { font-size: 13px; color: var(--muted); min-height: 42px; }
.price-note b { color: var(--action); font-weight: 600; }
.plan.recommended .price-note b { color: var(--edge); }
.plan .blurb { color: var(--muted); font-size: 14px; min-height: 46px; margin: 10px 0 18px; }
.plan .other-cycle { margin-top: 8px; }
.plan.recommended .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.plan.recommended .btn.ghost:hover:not(:disabled) { background: rgba(255,255,255,.1); }
.plan .current { text-align: center; font-weight: 600; padding: 12px; border: 1px solid currentColor; border-radius: 999px; }
.plan ul { padding: 0; list-style: none; margin: 22px 0 0; }
.plan li { padding: 5px 0 5px 22px; font-size: 15px; position: relative; }
.plan li::before { content: ''; position: absolute; left: 2px; top: 13px; width: 9px; height: 5px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); opacity: 0.7; }
.plan li.head { padding-left: 0; font-weight: 600; margin-top: 10px; }
.plan li.head::before { display: none; }
.plan li .sub { display: block; font-size: 13px; color: var(--muted); }
.pill { font-weight: 600; text-decoration: underline; text-decoration-color: var(--action); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.plan.recommended .pill { text-decoration-color: var(--edge); }

/* 바닥: 링크 모음 */
.footer { background: var(--film); color: var(--on-film); padding: 64px 0 40px; margin-top: 0; }
.footer .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.footer h4 { margin: 0 0 12px; font-size: 14px; color: var(--edge); font-weight: 600; }
.footer a { display: block; color: #c9c3bb; text-decoration: none; font-size: 14px; padding: 3px 0; }
.footer a:hover { color: var(--paper); }
.footer a.logo { color: var(--on-film); font-size: 22px; display: inline-flex; }
.footer .hint { color: #9a938a; }
.footer .copy { color: #9a938a; font-size: 13px; margin-top: 40px; }

/* 폼, 카드 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 24px; }
.card h3 { margin-top: 0; }
.narrow { max-width: 460px; margin: 72px auto; }
label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
input[type=email], input[type=text], input[type=password], input[type=search], select, textarea { width: 100%; font: inherit; color: var(--ink); padding: 12px 14px; border: 1px solid var(--field-line); border-radius: 12px; background: var(--card); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--action); outline-offset: -1px; }
textarea:disabled { background: var(--paper-2); }
input[type=file] { color: var(--muted); font-size: 14px; }
textarea { min-height: 84px; resize: vertical; }
.hint { color: var(--muted); font-size: 14px; }
.link-btn { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 14px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn:hover { color: var(--muted); }
.error { color: var(--pencil); font-size: 14px; min-height: 20px; }
.notice { background: var(--card); border-left: 3px solid var(--action); padding: 12px 14px; font-size: 14px; word-break: break-all; }
.notice a { color: var(--action); font-weight: 600; }

/* 스튜디오 */
.studio { display: grid; grid-template-columns: 300px 1fr; gap: 20px; padding: 20px 0 56px; }
/* 스튜디오는 넓은 화면을 다 쓴다(홈페이지 스튜디오 창처럼) */
.wrap.studio { max-width: 1600px; }
.studio aside { display: flex; flex-direction: column; gap: 16px; }
.credit-pill { color: var(--ink) !important; font-weight: 600; font-size: 14px; text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: var(--card); }
.model { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.model:last-child { border-bottom: 0; }
.status { font-size: 12px; padding: 2px 8px; border-radius: 4px; background: var(--paper-2); color: var(--muted); white-space: nowrap; }
.status.ready { background: var(--ok-soft); color: var(--ok); }
.status.failed { background: var(--bad-soft); color: var(--pencil); }
.progress { height: 3px; background: var(--paper-2); margin-top: 8px; overflow: hidden; }
.progress div { height: 100%; background: var(--action); transition: width 1s linear; }
.thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 8px; }
.thumbs img { aspect-ratio: 1; object-fit: cover; }
.thumb { position: relative; }
.thumb img { display: block; width: 100%; border-radius: 6px; }
.thumb-x { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: rgba(35, 35, 35, .78); color: #fff; font: 500 14px/18px var(--sans, system-ui); text-align: center; cursor: pointer; }
.thumb-x:hover { background: var(--ink); }
.thumb-x:focus-visible { outline: 2px solid var(--edge); outline-offset: 1px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.shot { background: var(--card); padding: 6px 6px 26px; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 2px rgba(11, 12, 14, 0.12); position: relative; display: block; text-decoration: none; }
.shot img { border-radius: 12px; aspect-ratio: 3 / 4; width: 100%; object-fit: cover; }
.shot .tag { position: absolute; left: 8px; bottom: 5px; font-size: 12px; color: var(--muted); max-width: calc(100% - 64px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shot .tag.free { left: auto; right: 8px; color: var(--action); font-weight: 600; }
.shot.pending { display: grid; place-items: center; aspect-ratio: 3 / 4.4; color: var(--muted); font-size: 14px; background: linear-gradient(110deg, var(--card) 30%, var(--paper-2) 50%, var(--card) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .shot.pending { animation: none; } }
.shot.failed { display: grid; place-items: center; text-align: center; aspect-ratio: 3 / 4.4; padding: 12px; color: var(--muted); font-size: 14px; background: var(--paper-2); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.empty { border: 1px dashed #bfc3bb; padding: 36px; text-align: center; color: var(--muted); grid-column: 1 / -1; }

/* 결제 벽: 구독 전에는 위 메뉴(로고) 아래에 요금표만 보이는 보통 페이지로 보여 준다(스튜디오는 숨긴다. 스크롤은 하나) */
.paywall { background: var(--paper); padding: 48px 24px 64px; }
.paywall[hidden], .studio[hidden] { display: none; }
.paywall .inner { max-width: 1160px; margin: 0 auto; }
.paywall h1 { text-align: center; margin: 0 0 10px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }
.num { text-align: right; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.big { font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: -0.02em; }

@media (max-width: 960px) {
  .studio, .grid2, .pack-hero { grid-template-columns: 1fr; }
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .plan { border-left: 0; border-top: 1px solid var(--line); }
  .plan:first-child { border-top: 0; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 18px; }
  .section { padding: 64px 0; }
  .nav { padding: 12px 18px; }
  .nav nav { gap: 14px; }
  .nav nav a.hide-sm { display: none; }
}

/* 만든 사진 고치기 */
.shot > a { display: block; }
.shot-edit { position: absolute; top: 12px; right: 12px; border: 0; border-radius: 999px; background: var(--glass); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; padding: 6px 12px; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.shot-edit:hover { color: var(--action); }
.edit-dialog { background: var(--card); color: var(--ink); border: 0; border-radius: 24px; padding: 24px; width: min(520px, calc(100% - 32px)); box-shadow: 0 30px 80px rgba(11, 12, 14, 0.3); }
.edit-dialog::backdrop { background: rgba(11, 12, 14, 0.45); }
.edit-head { display: flex; gap: 16px; align-items: center; }
.edit-head img { width: 72px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; flex: none; }
.spec-fields { margin-top: 14px; }
.edit-dialog { max-height: calc(100vh - 32px); overflow-y: auto; padding-bottom: 0; }
.edit-foot { position: sticky; bottom: 0; background: var(--card); padding: 14px 0 20px; margin-top: 8px; border-top: 1px solid var(--line); }
.spec-fields label { margin-top: 10px; }
.spec-loading { margin: 18px 0; padding: 28px 16px; text-align: center; font-weight: 600; color: var(--muted); border-radius: 14px; background: linear-gradient(110deg, var(--card) 30%, var(--paper-2) 50%, var(--card) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@media (prefers-reduced-motion: reduce) { .spec-loading { animation: none; } }
.spec-fields input.changed { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--mint-soft); }
.chips { border: 0; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; padding: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 14px; background: var(--card); }
.chip input:checked + span { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--action); outline-offset: 2px; }

/* 나만의 테마 팩 */
#my-packs { margin-top: 14px; }

/* ── 스튜디오: 내 사진 (거르기 / 요청 목록 / 사진) ── */
.studio > section { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.studio aside .card { padding: 20px; }
/* 사진 만들기: 한 줄 막대 */
.gen-bar { padding: 18px 20px 6px; }
.gen-bar h3 { margin: 0 0 4px; font-size: 18px; }
.gen-fields { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.4fr) 92px auto; gap: 12px; align-items: end; }
.gen-fields label { margin-top: 10px; }
.gen-fields .btn { height: 46px; }
.gen-meta { margin: 8px 0 0; font-size: 13px; }
.gen-meta #cost { color: var(--ink); font-weight: 600; }
.library { background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 20px 50px rgba(11, 12, 14, 0.06); }
.lib-bar { display: flex; align-items: center; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--paper-2); font-size: 15px; }
.lib-bar h2 { margin: 0; font-size: 15px; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
.lib-bar .lib-search { margin-left: auto; width: min(320px, 50%); padding: 7px 12px; font-size: 14px; }
.lib-body { display: grid; grid-template-columns: 150px minmax(240px, 320px) 1fr; grid-template-rows: 1fr auto; grid-template-areas: 'filters list pane' 'actions list pane'; min-height: 600px; }
.lib-actions { grid-area: actions; }
.lib-filters { grid-area: filters; }
.lib-list { grid-area: list; }
.lib-pane { grid-area: pane; }
.lib-filters { padding: 10px 8px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.lib-filter { display: flex; justify-content: space-between; align-items: center; gap: 8px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink); padding: 7px 10px; border-radius: 10px; cursor: pointer; text-align: left; }
.lib-filter .n { color: var(--muted); font-size: 13px; }
.lib-filter:hover { background: var(--paper-2); }
.lib-filter.on { background: var(--paper-2); font-weight: 600; }
.lib-sub { margin: 14px 10px 4px; font-size: 13px; color: var(--muted); }
.lib-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 720px; }
.lib-row { display: grid; grid-template-columns: 18px 1fr; column-gap: 4px; align-items: center; padding-left: 12px; border-bottom: 1px solid var(--line); }
.lib-check { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); cursor: pointer; }
.lib-check:disabled { cursor: not-allowed; opacity: 0.35; }
.lib-open { display: grid; grid-template-columns: 30px 1fr auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; width: 100%; min-width: 0; padding: 12px 14px 12px 6px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.lib-row.sel { background: var(--mint-soft); }
.lib-row:hover { background: var(--soft); }
.lib-row.on { background: var(--paper-2); }
.lib-open .avatar { grid-row: span 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.avatar.a0 { background: #f6dfd6; color: #8a3b1f; }
.avatar.a1 { background: #d9eedf; color: #2f6b45; }
.avatar.a2 { background: #dfe6f6; color: #2f4a8a; }
.avatar.a3 { background: #f3e9cf; color: #7a5a12; }
.lib-row-text { display: flex; flex-direction: column; min-width: 0; grid-row: span 2; }
.lib-row-text b { font-size: 14px; font-weight: 600; }
.lib-row-text span { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-status { font-size: 12px; padding: 3px 9px 3px 20px; border: 1px solid var(--line); border-radius: 999px; position: relative; white-space: nowrap; justify-self: end; }
.lib-status::before { content: ""; position: absolute; left: 8px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: #b9b9b9; }
.lib-status.running::before { background: #e0a100; }
.lib-status.failed { color: var(--pencil); }
.lib-status.failed::before { background: var(--pencil); }
.lib-time { font-size: 12px; color: var(--muted); justify-self: end; }
.lib-pane { display: flex; flex-direction: column; min-width: 0; }
.lib-pane-head { display: flex; gap: 10px; align-items: baseline; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 15px; min-height: 50px; }
.lib-pane .gallery { padding: 14px; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); align-content: start; }
.library .empty { padding: 24px 16px; color: var(--muted); font-size: 14px; }
@media (max-width: 1280px) {
  .lib-body { grid-template-columns: minmax(220px, 280px) 1fr; grid-template-areas: 'filters filters' 'list pane'; }
  .lib-filters { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; border-right: 0; border-bottom: 1px solid var(--line); }
  .lib-filter { display: inline-flex; }
  .lib-sub { margin: 0 2px 0 8px; padding-left: 12px; border-left: 1px solid var(--line); }
  .lib-pane .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gen-fields { grid-template-columns: 1fr 1fr 80px; }
  .gen-fields .btn { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .lib-body { grid-template-columns: 1fr; grid-template-rows: auto; grid-template-areas: 'filters' 'list' 'actions' 'pane'; min-height: 0; }
  .lib-actions { border-right: 0; border-bottom: 1px solid var(--line); }
  .lib-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 300px; }
  .lib-pane .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── 알림 ── */
.notes { position: relative; }
.note-bell { border: 1px solid var(--line); background: var(--card); border-radius: 999px; font: inherit; font-size: 14px; padding: 6px 12px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; color: var(--ink); }
.note-count { background: var(--ink); color: var(--on-ink); border-radius: 999px; font-size: 12px; min-width: 18px; padding: 0 5px; line-height: 18px; text-align: center; }
.note-count[hidden] { display: none; }
.note-panel { position: absolute; right: 0; top: calc(100% + 10px); width: 360px; max-width: calc(100vw - 24px); background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 60px rgba(11, 12, 14, 0.18); padding: 8px; z-index: 30; }
.note-head { margin: 6px 10px 8px; font-weight: 600; font-size: 14px; }
.note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 420px; overflow-y: auto; }
.note { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; background: var(--card); }
.note.unread { background: var(--mint-soft); }
.note-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; background: var(--paper-2); color: var(--ink); border: 1px solid var(--line); }
.note-ic.pack_ready { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.note-ic.model_failed { color: var(--pencil); }
.note-text { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.note-text span { color: var(--muted); font-size: 13px; }
.note-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.note-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.note-act { border: 0; background: var(--ink); color: var(--on-ink); border-radius: 999px; font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; cursor: pointer; white-space: nowrap; }
.note-empty { padding: 18px 12px; color: var(--muted); font-size: 14px; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 50; width: 360px; max-width: calc(100vw - 40px); }
.toast { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 18px 50px rgba(11, 12, 14, 0.18); animation: toast-in 0.25s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ── 고치기: 한 줄 요청, 손동작 고르기, 표정·시선 조절 ── */
.edit-gen { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 6px; font-family: var(--sans); letter-spacing: 0; }
.edit-line { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--paper-2); }
.edit-line label { margin-top: 0; }
.edit-line-row { display: flex; gap: 8px; }
.edit-line-row .btn { padding: 10px 16px; white-space: nowrap; }
.edit-line .hint { margin: 8px 0 0; font-size: 13px; }
.picks, .expr { margin-top: 8px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.picks-head { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 10px 14px; font-size: 13px; font-weight: 600; background: var(--soft); border-bottom: 1px solid var(--line); }
.picks-head span + span { font-weight: 400; color: var(--muted); }
.pick { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); background: var(--card); font: inherit; text-align: left; cursor: pointer; }
.picks-head + .pick { border-top: 0; }
.pick b { display: block; font-size: 14px; font-weight: 600; }
.pick small { color: var(--muted); font-size: 12px; }
.switch { flex: none; width: 34px; height: 20px; border-radius: 999px; background: var(--switch-off); position: relative; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--card); transition: transform 0.15s; }
.pick[aria-pressed="true"] .switch { background: var(--ink); }
.pick[aria-pressed="true"] .switch::after { transform: translateX(14px); }
.expr { padding-bottom: 12px; }
.expr .range-row { display: flex; justify-content: space-between; font-weight: 500; font-size: 13px; margin: 12px 14px 4px; }
.expr output { font-variant-numeric: tabular-nums; color: var(--muted); }
.expr input[type=range] { width: calc(100% - 28px); margin: 0 14px; accent-color: var(--ink); }
.seg { display: flex; margin: 12px 14px 0; background: var(--paper-2); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; border: 0; background: none; font: inherit; font-size: 13px; padding: 6px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }

/* 휴대폰: 머리 줄이 넘치지 않게, 사진은 두 줄로 */
.note-bell, .nav nav .link { white-space: nowrap; }
@media (max-width: 600px) {
  .nav nav { gap: 10px; }
  .nav nav > a[href="/billing.html"]:not(.credit-pill) { display: none; }
  .lib-pane .gallery { padding: 12px; gap: 10px; }
  .gen-fields { grid-template-columns: 1fr 80px; }
  .gen-fields > div:first-child { grid-column: 1 / -1; }
}

/* 다크 모드 단추 (알림 옆) */
.theme-btn { border: 1px solid var(--line); background: var(--card); border-radius: 999px; font: inherit; font-size: 14px; padding: 6px 12px; cursor: pointer; color: var(--ink); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.theme-btn::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--ink); box-shadow: inset -4px -2px 0 0 var(--card); }
:root[data-theme="dark"] .theme-btn::before { box-shadow: none; background: #ffd66b; }

/* 나만의 테마 팩: 장면 목록과 다시 짓기 */
.pack-item { border-bottom: 1px solid var(--line); padding: 10px 0; }
.pack-item summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.pack-item summary::-webkit-details-marker { display: none; }
.pack-name { display: flex; flex-direction: column; min-width: 0; }
.pack-name .hint { font-size: 13px; }
.pack-item[open] .pack-name .hint::after { content: " ▲"; font-size: 10px; }
.pack-item:not([open]) .pack-name .hint::after { content: " ▼"; font-size: 10px; }
.scene-list { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.scene-list li::marker { color: var(--muted); }
.scene-text { display: flex; flex-direction: column; }
.scene-text b { font-weight: 600; }
.scene-text span { color: var(--muted); font-size: 13px; }
.scene-list .link-btn { padding: 2px 0; font-size: 13px; }
.redraft-form { display: flex; gap: 6px; margin-top: 6px; }
.redraft-form[hidden] { display: none; }
.redraft-form input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 13px; }
.redraft-form .btn { padding: 8px 12px; font-size: 13px; white-space: nowrap; }

/* 팩 전체 고치기, 이름 바꾸기, 지우기 */
.pack-desc { margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.pack-tools { margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--paper-2); }
.pack-tools label { margin: 0 0 6px; font-size: 13px; }
.pack-tools .redraft-form { margin-top: 0; }
.pack-tools .redraft-form + .redraft-form { margin-top: 8px; }
.pack-links { display: flex; justify-content: space-between; margin-top: 8px; }
.danger-link { color: var(--pencil); }

/* 우클릭 메뉴 (내 사진) */
.ctx-menu { position: fixed; z-index: 60; min-width: 160px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 50px rgba(11, 12, 14, 0.2); display: flex; flex-direction: column; }
.ctx-menu[hidden] { display: none; }
.ctx-menu button { border: 0; background: none; font: inherit; font-size: 14px; text-align: left; padding: 8px 12px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.ctx-menu button:hover, .ctx-menu button:focus-visible { background: var(--paper-2); outline: none; }
.ctx-menu button.danger { color: var(--pencil); }

/* 내 사진 왼쪽 아래: 선택 수, 모두 선택, 삭제 */
.lib-actions { padding: 12px 14px 14px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.lib-selcount { font-size: 13px; color: var(--muted); }
.lib-actions .link-btn { align-self: flex-start; font-size: 13px; }
.lib-delete { width: 100%; padding: 9px 12px; font-size: 14px; }
.btn.danger:disabled { opacity: 0.35; }
@media (max-width: 1280px) {
  .lib-body { grid-template-rows: auto 1fr auto; grid-template-areas: 'filters filters' 'list pane' 'actions pane'; }
  .lib-actions { flex-direction: row; align-items: center; gap: 10px; padding: 10px 14px; }
  .lib-delete { width: auto; margin-left: auto; padding: 6px 14px; font-size: 13px; }
}
@media (max-width: 900px) {
  .lib-body { grid-template-columns: 1fr; grid-template-rows: auto; grid-template-areas: 'filters' 'list' 'actions' 'pane'; }
  .lib-actions { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* 사진 고치기: 빠른 예시, 보낼 요청 미리보기 */
.edit-dialog textarea { min-height: 76px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; font: inherit; font-size: 13px; padding: 5px 12px; cursor: pointer; }
.quick button:hover { background: var(--paper-2); }
.edit-tools { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.edit-tools .picks, .edit-tools .expr { margin-top: 0; }
.edit-preview { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--mint-soft); font-size: 13px; }

/* 나만의 테마 팩 줄의 지우기 단추 */
.pack-side { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.pack-del { border: 1px solid var(--line); background: var(--card); color: var(--pencil); border-radius: 999px; font: inherit; font-size: 12px; padding: 3px 10px; cursor: pointer; }
.pack-del:hover { background: var(--bad-soft); }
.pack-del:disabled { opacity: 0.5; cursor: default; }

/* 장면 프롬프트: 팩을 펼치면 바로 보인다 */
.scene-prompt { margin: 6px 0 0; padding: 10px; max-height: 260px; overflow: auto; border-radius: 10px; background: var(--paper-2); color: var(--ink); font-size: 11px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

/* 내 모델: 다시 학습 / 이름 바꾸기 / 지우기 */
.model-links { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.model-links .link-btn { font-size: 13px; }

/* 내 사진: 즐겨찾기 별, 폴더, 잘라낸 세션, 끌어다 놓기 */
.lib-row { grid-template-columns: 18px 1fr auto; }
.lib-star { border: 0; background: none; font: inherit; font-size: 17px; line-height: 1; color: var(--muted); padding: 8px 12px 8px 2px; cursor: pointer; }
.lib-star:hover { color: var(--ink); }
.lib-star.on { color: #d99a00; }
.lib-row.cut { opacity: 0.45; }
.lib-sub-row { display: flex; justify-content: space-between; align-items: center; }
.lib-add { width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: 15px; line-height: 1; cursor: pointer; }
.lib-add:hover { background: var(--paper-2); }
.lib-folder > span:first-child { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.lib-folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-folder-icon { flex: none; color: var(--muted); }
.lib-folder-hint { margin: 2px 10px; font-size: 12px; color: var(--muted); }
.lib-filter.drop { outline: 2px dashed var(--ink); outline-offset: -2px; background: var(--mint-soft); }
.ctx-menu button { display: flex; justify-content: space-between; gap: 18px; }
.ctx-menu button[hidden] { display: none; }
.ctx-menu button:disabled { color: var(--muted); cursor: default; background: none; }
.ctx-menu kbd { font: inherit; font-size: 12px; color: var(--muted); }

/* 테마 팩 둘러보기 */
.browse-open { margin-top: 8px; }
.pack-share { margin-top: 10px; }
.share-note { margin: 8px 0 4px; }
.share-form { display: grid; gap: 8px; margin-top: 8px; }
.share-form[hidden], .share-form [hidden] { display: none; }
.share-anon { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.share-form .btn { justify-self: start; padding: 8px 14px; font-size: 13px; }
.browse-dialog { background: var(--card); color: var(--ink); border: 0; border-radius: 24px; padding: 24px; width: min(920px, calc(100% - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 30px 80px rgba(11, 12, 14, 0.3); }
.browse-dialog::backdrop { background: rgba(11, 12, 14, 0.45); }
.browse-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.browse-head h3 { margin: 0; }
.browse-close { border: 0; background: none; color: var(--ink); font-size: 26px; line-height: 1; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.browse-close:hover { background: var(--paper-2); }
.browse-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 16px; }
.browse-sort { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.browse-sort button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.browse-sort button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.browse-bar input { flex: 1 1 220px; max-width: 320px; margin-left: auto; padding: 9px 12px; font-size: 14px; }
.browse-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.browse-list > .empty, .browse-list > .error, .browse-list > .browse-found { grid-column: 1 / -1; }
.browse-found { margin: 0; }
.browse-post { margin: -4px 0 18px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper-2); display: flex; flex-direction: column; gap: 10px; }
.browse-post-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.browse-post-row label[for] { font-size: 14px; font-weight: 600; }
.browse-post-row select { flex: 1 1 240px; width: auto; padding: 9px 12px; font-size: 14px; }
.browse-post-row input[type=text] { flex: 1 1 200px; width: auto; max-width: 280px; padding: 9px 12px; font-size: 14px; }
.browse-post .hint, .browse-post .error { margin: 0; }
.browse-post .error:empty { display: none; }
.browse-post[hidden] { display: none; }
.share-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--card); }
.share-swatch { display: grid; grid-template-columns: 2fr 1fr; height: 54px; }
.share-swatch span:first-child { background: var(--c1); }
.share-swatch span:last-child { background: var(--c2); }
.share-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.share-body h4 { margin: 0; font-size: 16px; }
.share-by { margin: 0; font-size: 13px; color: var(--muted); }
.share-desc { margin: 2px 0 0; font-size: 14px; }
.share-scenes { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.share-prompts summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.share-scene-t { margin: 8px 0 0; font-size: 12px; font-weight: 600; }
.share-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; }
.share-foot .btn { padding: 8px 14px; font-size: 13px; }
.share-mine { font-size: 13px; color: var(--muted); }

/* 내 모델 목록 아래 기본 모델 묶음 */
.models-sub { margin: 16px 0 4px; font-size: 13px; color: var(--muted); }

/* 스튜디오 미리 보기(결제 전 체험): 위쪽 안내 띠와 구독 안내 창 */
.preview-bar { position: sticky; top: 64px; z-index: 9; display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 10px 24px; background: var(--ink); color: var(--paper); font-size: 14px; text-align: center; }
.preview-bar[hidden] { display: none; }
.preview-bar .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.preview-dialog { max-width: 440px; border: 0; border-radius: 20px; padding: 24px; background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
.preview-dialog::backdrop { background: rgba(0, 0, 0, 0.4); }

/* 사업자 정보 한 줄(전자상거래법 표시 사항) */
.footer .biz { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 32px 0 0; color: #9a938a; font-size: 12.5px; }
.footer .biz a { display: inline; padding: 0; font-size: inherit; text-decoration: underline; }
.footer .biz + .copy { margin-top: 10px; }
