:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #1e293b;
  --text-muted: #475569;   /* 기존 회색보다 더 진하게: 밝은 배경에서도 확실히 읽히도록 */
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #4f8ef7;
  --accent-2: #2563eb;
  --accent-tint: #eff6ff;
  --accent-tint-strong: #dbeafe;
  --danger: #dc2626;
  --danger-tint: #fef2f2;
  --success: #16a34a;
  --success-tint: #f0fdf4;
  --warning-tint: #fffbeb;
  --warning-text: #92400e;
  --radius: 14px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

a { color: inherit; text-decoration: none; }

body {
  margin: 0;
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", -apple-system, "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 15.5px;
  margin-bottom: 32px;
}

.back-link {
  display: inline-block;
  color: var(--text-muted);
  font-size: 13.5px;
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.back-link:hover { color: var(--accent-2); }

/* 브랜드 헤더 */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-bottom: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.brand:hover .brand-mark { transform: translateY(-1px); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.5);
  transition: transform 0.15s ease;
}

.header-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 12px;
}

.user-menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.user-email {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent-2);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.credit-badge .dot { font-size: 10px; }

.logout-btn {
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.logout-btn:hover { background: var(--danger-tint); color: #991b1b; border-color: #fecaca; }

@media (max-width: 560px) {
  /* 좁은 화면에서는 헤더가 두 줄로 자연스럽게 나뉘도록:
     로고는 왼쪽 위, 메뉴(마이페이지·크레딧·멤버십·로그아웃)는 그 아래 오른쪽 정렬 */
  .site-header { align-items: flex-start; }
  .header-right { width: 100%; }
  .user-email { display: none; }              /* 이메일은 폰에선 숨김(공간 절약) */
  .credit-badge { padding: 5px 10px; font-size: 12px; }
  .logout-btn, .charge-link { padding: 6px 11px; font-size: 12px; }
  .back-link { font-size: 13px; }
}

/* 공통 포커스 스타일: 키보드로 탭 이동할 때 확실히 보이게 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
.voice-card input:focus-visible + .voice-body,
.tpl-card input:focus-visible + .tpl-body,
.switch input:focus-visible + .slider {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 게이트 페이지 */
.gate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.gate-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.gate-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px -14px rgba(37, 99, 235, 0.28);
}

.gate-icon { font-size: 34px; }
.gate-card strong { font-size: 18px; }
.gate-card small { color: var(--text-muted); font-size: 13.5px; line-height: 1.6; }

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

/* 업로드 모드 */
.upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 20px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.upload-drop:hover { border-color: var(--accent); background: var(--accent-tint); }
.upload-icon { font-size: 30px; }
.upload-drop small { color: var(--text-muted); font-size: 13px; }

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.preview-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.preview-item img,
.preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: white;
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}

.preview-remove:hover { background: var(--danger); }

.style-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.style-btn {
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.style-btn:hover { border-color: var(--accent); }
.style-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

#style-prompt {
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  resize: vertical;
}

#style-prompt::placeholder { color: #94a3b8; }

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

input[type="url"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 16px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15.5px;
  font-family: inherit;
}

input[type="url"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder { color: #94a3b8; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
}

/* 로그인 / 회원가입 */
.auth-wrap {
  max-width: 380px;
  margin: 64px auto 0;
}

.auth-wrap .site-header { justify-content: center; margin-bottom: 32px; }

.field-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.auth-switch {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-switch a { color: var(--accent-2); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }

.submit-btn {
  width: 100%;
  padding: 18px;
  font-size: 17px;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px -8px rgba(37, 99, 235, 0.4);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12.5px;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.kakao-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  border-radius: var(--radius-sm);
  background: #FEE500;
  color: #191600;
  font-weight: 700;
  font-size: 15px;
  transition: filter 0.15s ease;
}
.kakao-login-btn:hover { filter: brightness(0.96); }

.intro-panel .pick-sub {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 13.5px;
}

.intro-file,
.intro-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.intro-file { margin-bottom: 10px; }

.intro-toggle-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.arrow-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.arrow-panel .arrow-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.product-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.product-code-input {
  flex: none;
  width: 90px;
  padding: 9px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14.5px;
  text-align: center;
}

.product-code-input::placeholder { color: #94a3b8; }

.product-code-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.intro-file input[type="file"] {
  flex: none;
  max-width: 220px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.badge.free {
  background: var(--success-tint);
  color: #15803d;
}

.intro-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.intro-text strong { font-size: 15.5px; }
.intro-text small { color: var(--text-muted); font-size: 13px; line-height: 1.55; }

/* 좁은 화면: "설명 텍스트 | 파일선택/토글"을 가로로 두면 텍스트가 한 글자씩
   세로로 쪼개지므로, 위아래로 쌓아서 각 요소가 온전한 폭을 갖게 한다 */
@media (max-width: 560px) {
  .intro-file,
  .intro-toggle {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .intro-file input[type="file"] { max-width: 100%; }
  .product-code-row { flex-wrap: wrap; }
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  margin-left: 4px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 10px;
  background: var(--warning-tint);
  color: var(--warning-text);
  vertical-align: middle;
}

.switch {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 14px;
  transition: background 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }

button {
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button:hover:not(:disabled) { background: var(--accent-2); }

button:disabled {
  opacity: 0.55;
  cursor: default;
}

.progress-panel {
  display: none;
  margin-top: 20px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
}

.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 15px;
}

.progress-head strong { color: var(--accent-2); font-size: 17px; }

.progress-track {
  height: 12px;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 6px;
  transition: width 0.6s ease;
}

.progress-hint {
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.error {
  margin-top: 24px;
  padding: 15px 16px;
  border-radius: var(--radius-sm);
  background: var(--danger-tint);
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 14.5px;
}

.result {
  margin-top: 40px;
}

.intro-note {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  background: var(--warning-tint);
  color: var(--warning-text);
  font-size: 13.5px;
  border: 1px solid #fde68a;
}

.result video {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  display: block;
  margin: 16px 0;
  background: black;
  box-shadow: 0 20px 40px -20px rgba(15, 23, 42, 0.35);
}

.result a {
  color: var(--accent-2);
  font-weight: 600;
}

.result details {
  margin-top: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 16px;
}

.result ol {
  padding-left: 20px;
  font-size: 14.5px;
  line-height: 1.8;
}

.source {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.gallery {
  margin-top: 48px;
}

.gallery h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.gallery-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
}

.gallery-item.latest {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-tint-strong);
}

.gallery-item video {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  background: black;
  display: block;
}

.gallery-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.gallery-meta a {
  color: var(--accent-2);
  font-weight: 600;
}

.qr-box {
  margin-top: 10px;
  color: var(--text);
  font-size: 14.5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 16px;
}

.qr-box summary {
  cursor: pointer;
  color: var(--accent-2);
  font-weight: 600;
  padding: 12px 0;
  list-style: none;
}

.qr-box summary::-webkit-details-marker { display: none; }

.qr-box img {
  display: block;
  margin: 12px auto 4px;
  width: 220px;
  max-width: 100%;
  border-radius: 10px;
  background: white;
  padding: 8px;
  border: 1px solid var(--border);
}

.qr-box.small { padding: 4px 10px; }

.qr-box.small summary {
  font-size: 12.5px;
  white-space: nowrap;
  padding: 9px 0;
}

.qr-box.small img {
  width: 150px;
}

.qr-box .hint {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
  padding-bottom: 14px;
}

.cta-box {
  margin-top: 10px;
  padding: 4px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14.5px;
}

.cta-box summary {
  cursor: pointer;
  color: var(--accent-2);
  font-weight: 600;
  padding: 12px 0;
}

.cta-field {
  margin-top: 12px;
}

.cta-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.cta-field textarea {
  width: 100%;
  resize: vertical;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.55;
  font-family: inherit;
}

.copy-btn {
  margin-top: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.copy-btn:hover {
  background: var(--accent-tint);
  border-color: var(--accent);
}

.pick-label {
  margin: 0 0 12px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
}

.pick-label + .pick-label,
.tpl-row + .pick-label,
.voice-row + .pick-label {
  margin-top: 24px;
}

.pick-sub { font-weight: 400; color: var(--text-muted); font-size: 13px; }

.required-mark { color: var(--danger); }

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill-radio input {
  position: absolute;
  opacity: 0;
}

.pill-radio span {
  display: inline-block;
  padding: 9px 18px;
  font-size: 13.5px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.pill-radio input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.pill-radio input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.voice-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.voice-card input,
.tpl-card input {
  position: absolute;
  opacity: 0;
}

.voice-card .voice-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.voice-card .voice-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.voice-card input:checked + .voice-body {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.voice-card strong { font-size: 15.5px; }
.voice-card small { color: var(--text-muted); font-size: 12.5px; white-space: nowrap; }

.play-btn {
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 13px;
  background: var(--surface-2);
  color: var(--accent-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
}

.play-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }

.tpl-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tpl-card .tpl-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s;
}

.tpl-card input:checked + .tpl-body {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.tpl-card .tpl-body { position: relative; }

.premium-badge {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: #78350f;
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(180, 120, 10, 0.35);
  pointer-events: none;
}

.tpl-card.premium input:checked + .tpl-body {
  border-color: #f59e0b;
  background: #fffbeb;
}

/* ── 마이페이지 ── */
.tx-plus { color: var(--success); font-weight: 700; }
.tx-minus { color: var(--danger); font-weight: 700; }
.tx-date { color: var(--text-muted); font-size: 13px; white-space: nowrap; }

.credit-guide {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
  font-size: 14.5px;
}

a.credit-badge:hover { border-color: var(--accent); }

/* 제작 버튼 위 소모 크레딧 안내 */
.cost-note {
  margin: 18px 0 10px;
  padding: 12px 16px;
  background: var(--accent-tint);
  border: 1px solid var(--accent-tint-strong);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  color: var(--text);
}
.cost-note strong { color: var(--accent-2); font-size: 16px; }

.tpl-card img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 10px;
}

.tpl-card strong { font-size: 15px; margin-top: 8px; }
.tpl-card small { color: var(--text-muted); font-size: 12.5px; }

.gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gallery-pager {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gallery-pager button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-pager button:hover:not(:disabled) { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-2); }
.gallery-pager button:disabled { opacity: 0.35; cursor: default; }

.gallery-pager .gallery-page-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 42px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.gallery-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery-actions form { margin: 0; }

.del-btn {
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.del-btn:hover { background: var(--danger-tint); border-color: var(--danger); color: #991b1b; }

/* 관리자 페이지 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-card .stat-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.admin-section {
  margin-top: 40px;
}

.admin-section h2 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 14px;
}

.admin-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.admin-table tr:last-child td { border-bottom: none; }

.admin-table a { color: var(--accent-2); font-weight: 600; }

.credit-grant-form {
  display: flex;
  gap: 6px;
  margin: 0;
}

.credit-grant-form input[type="number"] {
  width: 64px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

.credit-grant-form .copy-btn { margin-top: 0; padding: 6px 12px; }

.credit-grant-form select {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

/* 인트로(스플래시) 페이지 */
.intro-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background: #ffffff;
}

.intro-blob {
  position: absolute;
  inset: -10%;
  z-index: 0;
  background:
    radial-gradient(60% 55% at 78% 18%, #4f8ef7 0%, transparent 60%),
    radial-gradient(55% 50% at 26% 78%, #8b5cf6 0%, transparent 65%),
    radial-gradient(65% 55% at 92% 88%, #38bdf8 0%, transparent 60%);
  filter: blur(60px);
  opacity: 0.85;
}

.intro-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px;
}

.intro-nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.intro-nav .login-link {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.intro-hero {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px 110px;
}

.intro-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-2);
  letter-spacing: 0.06em;
  margin-bottom: 30px;
}

.intro-headline {
  font-size: clamp(40px, 7vw, 84px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #0f172a;
  max-width: 16ch;
  margin: 0;
}

.intro-sub {
  margin-top: 24px;
  font-size: 19px;
  color: #334155;
  max-width: 42ch;
}

.intro-cta {
  margin-top: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 20px 46px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 20px 40px -16px rgba(15, 23, 42, 0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.intro-cta:hover { transform: translateY(-2px); box-shadow: 0 24px 48px -16px rgba(15, 23, 42, 0.5); }

@media (max-width: 560px) {
  .intro-hero { padding: 24px 20px 80px; }
  .intro-sub { font-size: 16px; }
  .intro-cta { padding: 18px 36px; font-size: 16px; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .voice-row, .tpl-row { grid-template-columns: 1fr; }
}

/* 크레딧 충전/업그레이드 유도 모달 */
.charge-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 12.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.charge-link:hover { background: var(--accent-2); }

.credit-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.credit-modal-backdrop.open { display: flex; }

.credit-modal {
  position: relative;
  width: 100%;
  max-width: 880px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 24px;
  padding: 36px 40px 32px;
  box-shadow: 0 32px 64px -20px rgba(15, 23, 42, 0.35);
}

.credit-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 16px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.credit-modal-close:hover { background: var(--border); color: var(--text); }

.credit-modal h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.credit-modal p.credit-modal-sub {
  margin: 0 0 28px;
  color: var(--text-muted);
  font-size: 14.5px;
}

.credit-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.credit-plan-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 20px;
  background: var(--surface);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.credit-plan-card:hover { transform: translateY(-3px); box-shadow: 0 16px 32px -18px rgba(15, 23, 42, 0.25); }

.credit-plan-card.featured {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-tint) 0%, var(--surface) 55%);
  box-shadow: 0 16px 32px -16px rgba(79, 142, 247, 0.35);
}

.credit-plan-tag {
  align-self: flex-start;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  margin-bottom: 14px;
}
.credit-plan-card.featured .credit-plan-tag {
  background: var(--accent);
  color: white;
}

.credit-plan-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.credit-plan-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.credit-plan-card.featured .credit-plan-price { color: var(--accent-2); }
.credit-plan-price small {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.credit-plan-unit {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.credit-plan-features {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.credit-plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.4;
}
.credit-plan-features li::before {
  content: "✓";
  color: var(--accent-2);
  font-weight: 800;
  flex-shrink: 0;
}

.credit-plan-cta {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}
.credit-plan-card.featured .credit-plan-cta {
  background: var(--accent);
  color: white;
}
.credit-plan-card.featured .credit-plan-cta:hover { background: var(--accent-2); }
.credit-plan-cta:hover { background: var(--border); }

.credit-modal-note {
  margin: 22px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 720px) {
  .credit-plan-grid { grid-template-columns: 1fr; }
  .credit-modal { padding: 28px 22px 24px; }
}
