/* ================= 리셋 & 기본 ================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }

/* ================= 디자인 토큰 (웜 시트러스 팔레트) =================
   보라 계열(밤 느낌)에서 오렌지·골드·그린의 화창한 시트러스 톤으로 전환.
   -primary/-dark는 흰 배경·흰 텍스트 양쪽에서 WCAG AA(4.5:1)를 만족하는 안전한 진한 톤이고,
   -bright는 대비 검증이 필요 없는 장식 전용(그라디언트 하이라이트·글로우·배경 워시)이다. */
:root {
  --color-bg: #FFFBF3;
  --color-bg-alt: #FFF3E0;
  --color-surface: #FFFFFF;
  --color-border: #F4E4CC;
  --color-border-strong: #E8CFA6;

  --color-primary: #C2410C;
  --color-primary-dark: #A83A0C;
  --color-primary-soft: #FFE4D1;
  --color-primary-bright: #FF7A33;

  --color-mint: #4CB963;
  --color-mint-soft: #DFF3E3;
  --color-peach: #FFC233;
  --color-peach-soft: #FFF3D1;
  --color-pink: #C23B3B;
  --color-pink-soft: #FFE3DD;
  --color-pink-bright: #FF6B5B;

  --color-text: #2B2420;
  --color-text-muted: #6E5F49;
  --color-text-faint: #84745C;

  --color-success: #2F7D45;
  --color-success-soft: #E4F6EC;
  --color-error: #CE2947;
  --color-error-soft: #FDEAEE;
  --color-pending: #8A6D3F;

  --color-peach-dark: #A2591C;
  --color-google-border: #E4E1EC;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --shadow-soft: 0 10px 30px -8px rgba(226, 96, 28, 0.22);
  --shadow-card: 0 4px 16px -4px rgba(226, 96, 28, 0.12);

  --font-sans: -apple-system, BlinkMacSystemFont, "Pretendard Variable", Pretendard,
    "Malgun Gothic", "Apple SD Gothic Neo", "Segoe UI", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

body {
  font-family: var(--font-sans);
  word-break: keep-all;
  overflow-wrap: break-word;
  position: relative;
  background:
    radial-gradient(1100px 560px at 12% -8%, rgba(255, 122, 51, 0.16) 0%, transparent 60%),
    radial-gradient(950px 480px at 102% -4%, rgba(255, 194, 51, 0.20) 0%, transparent 55%),
    radial-gradient(900px 520px at 50% 115%, rgba(76, 185, 99, 0.12) 0%, transparent 58%),
    var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

/* 아주 옅은 그레인 텍스처 — 평면적인 파스텔 느낌 대신 촉감 있는 프리미엄 인상을 준다(장식용, 콘텐츠 무관) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.page {
  position: relative;
  z-index: 1;
}

/* ================= 레이아웃 ================= */
.page {
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 24px 96px;
  min-height: calc(100vh - 65px);
  min-height: calc(100svh - 65px);
  box-sizing: border-box;
}

/* ================= 헤더 (스크롤에 고정, 흰 배경) ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-primary-dark);
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-pink) 100%);
  color: #fff;
  font-size: 0.9rem;
}

/* ---- 헤더 우측 액션(게이지 · 크레딧 · 계정) ---- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.header-status-group {
  display: flex;
  align-items: center;
  gap: 18px;
}

/* ---- 플러그인 링크 (배경 없는 순수 텍스트, hover는 색만 짙어진다) ---- */
.nav-plugin-link {
  color: var(--color-text-muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s var(--ease-out);
}

.nav-plugin-link:hover,
.nav-plugin-link:focus-visible {
  color: var(--color-primary-dark);
  outline: none;
}

/* 좁은 화면에서는 짧은 라벨로 바꾼다 — 긴 쪽은 nowrap이라 줄바꿈 대신 헤더를 밀어내
   가로 스크롤을 만든다(실측: 390px에서 78px 넘침). 링크 자체는 하나로 유지한다. */
.nav-plugin-short { display: none; }

/* ---- 언어 설정 (지구본) ---- */
.lang-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s var(--ease-out), background-color 0.15s var(--ease-out);
}

.btn-lang:hover,
.btn-lang:focus-visible {
  color: var(--color-primary-dark);
  background: var(--color-bg-alt);
  outline: none;
}

.lang-dropdown {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 132px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.15s var(--ease-out),
    transform 0.15s var(--ease-out),
    visibility 0s linear 0.15s;
}

.lang-menu.is-open .lang-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.lang-option {
  border: none;
  background: none;
  text-align: left;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: background-color 0.15s var(--ease-out);
}

.lang-option:hover,
.lang-option:focus-visible {
  background: var(--color-bg-alt);
  outline: none;
}

.lang-option.is-active {
  color: var(--color-primary-dark);
  background: var(--color-primary-soft);
}

.daily-gauge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
}

/* 프로필 드롭다운 최상단 항목으로 배치될 때 — 컬럼 폭 전체를 채우고 텍스트·게이지를 양끝으로 벌린다 */
.profile-dropdown .daily-gauge {
  justify-content: space-between;
  margin: 2px 2px 6px;
}

.daily-gauge-text {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.daily-gauge-text strong {
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

/* display 선언이 UA의 [hidden]{display:none}을 이겨서 소진 상태에서도 빈 막대가 남았다 — 가드를 건다 */
.daily-gauge-track:not([hidden]) {
  display: block;
}

.daily-gauge-track {
  width: 44px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--color-border);
  overflow: hidden;
}

.daily-gauge-fill {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--color-primary-bright) 0%, var(--color-peach) 50%, var(--color-mint) 100%);
  transition: width 0.3s var(--ease-out);
}

.daily-gauge-locked:not([hidden]) {
  display: inline-flex;
}

.daily-gauge-locked {
  align-items: center;
  gap: 5px;
  color: var(--color-text-faint);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

/* flex 축소 대상이 되어 자물쇠가 세로선처럼 눌렸다 */
.daily-gauge-locked svg {
  flex-shrink: 0;
}

/* ---- 비로그인 게이지 호버 툴팁 (실패 배지와 같은 어두운 말풍선 톤 재사용) ---- */
.daily-gauge.is-guest {
  position: relative;
  cursor: help;
}

.daily-gauge.is-guest::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  width: max-content;
  max-width: 200px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 4px);
  transition: opacity 0.15s var(--ease-out), transform 0.15s var(--ease-out), visibility 0.15s;
  pointer-events: none;
  z-index: 20;
}

.daily-gauge.is-guest:hover::after,
.daily-gauge.is-guest:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* 이제 버튼이 아니다 — 잔액 표시 칩일 뿐이고, 충전은 안의 + 버튼만 담당한다.
   그래서 hover·cursor:pointer를 걷어냈다(클릭해도 반응 없는 영역에 손 모양 커서가
   뜨는 건 오작동 신호라 오히려 혼란을 준다). */
.btn-credit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #F0D28A;
  border-radius: var(--radius-pill);
  padding: 8px 8px 8px 12px;
  background: var(--color-peach-soft);
  color: var(--color-peach-dark);
  font-size: 0.85rem;
  font-weight: 700;
}

/* 카드+코인 일러스트 아이콘 — 18px로는 카드 디테일이 뭉개져 22px로 확대 */
.credit-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

#credit-balance {
  font-variant-numeric: tabular-nums;
}

.btn-credit-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--color-peach);
  color: var(--color-peach-dark);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: filter 0.15s var(--ease-out);
}

/* 프로필 버튼과 같은 "그냥 어두워지는" 단순 hover — 색이 바뀌지 않아 어디에 얹어도 톤이 깨지지 않는다 */
.btn-credit-plus:hover,
.btn-credit-plus:focus-visible {
  filter: brightness(0.92);
  outline: none;
}

.btn-account {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  padding: 9px 18px;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s var(--ease-out);
}

.btn-account:hover,
.btn-account:focus-visible {
  filter: brightness(0.95);
  outline: none;
}

.btn-account.is-logged-in {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--color-primary-soft);
  border-color: var(--color-border-strong);
  color: var(--color-primary-dark);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

/* ---- 프로필 드롭다운 ---- */
.profile-menu {
  position: relative;
}

/* 상태 그룹(게이지·크레딧)과 계정 버튼 사이를 시각적으로 구분하는 얇은 구분선 */
.profile-menu::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 20px;
  background: var(--color-border-strong);
}

.profile-chevron:not([hidden]) {
  display: inline-block;
}

/* img, svg { display: block } 리셋이 UA의 [hidden]{display:none}보다 author 출처라 우선한다 — 명시적으로 다시 숨긴다 */
.profile-chevron[hidden] {
  display: none;
}

.profile-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-out);
}

.profile-menu.is-open .profile-chevron {
  transform: rotate(180deg);
}

/* 드롭다운은 계정 버튼을 클릭할 때만 열리고 닫힌다(호버로는 열리지 않는다).
   열림 상태는 JS가 .is-open으로 관리하며, 바깥 클릭·ESC·항목 선택 시 닫는다. */
.profile-dropdown {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 160px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 0.15s var(--ease-out),
    transform 0.15s var(--ease-out),
    visibility 0s linear 0.15s;
}

.profile-menu.is-open .profile-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition-delay: 0s;
}

.profile-dropdown-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 4px 2px 6px;
}

.profile-dropdown-item {
  border: none;
  background: none;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: background-color 0.15s var(--ease-out);
}

.profile-dropdown-item:hover,
.profile-dropdown-item:focus-visible {
  background: var(--color-bg-alt);
  outline: none;
}

.profile-dropdown-item.is-danger {
  color: var(--color-error);
}

/* ================= 히어로 ================= */
.hero {
  position: relative;
  text-align: center;
  padding: 28px 0 32px;
}

.hero-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-pink) 100%);
  color: #fff;
  font-size: 1.9rem;
  box-shadow: var(--shadow-soft), 0 0 0 0 rgba(255, 122, 51, 0.4);
  /* 등장(opacity·transform)과 상시 글로우(box-shadow)는 서로 다른 속성이라 한 요소에
     같이 걸어도 부딪히지 않는다 — 켜지는 순간과 켜진 뒤의 맥동을 자연스럽게 이어붙인다 */
  animation: hero-mark-in 0.6s var(--ease-out) both, brand-glow 2.8s ease-in-out infinite;
}

@keyframes brand-glow {
  0%, 100% { box-shadow: var(--shadow-soft), 0 0 0 0 rgba(255, 122, 51, 0.35); }
  50% { box-shadow: var(--shadow-soft), 0 0 22px 4px rgba(255, 122, 51, 0.35); }
}

/* ================= 첫 화면 로드 진입 모션 =================
   흔한 "위→아래" 대신 이 페이지의 실제 역할을 따라간다:
   ① 히어로 마크가 먼저 "켜지고"(장비 전원이 들어오듯 확대 등장 — 안의 eq-bounce는 계속 돈다)
   ② 제목·부제가 살짝 흐릿한 상태에서 초점이 맞아 들어온다("깔끔하게 정리"라는 제품 메시지와 결을 맞춤)
   ③ 드롭존 카드가 자리를 잡은 뒤, 파일을 기다리는 중이라는 신호로 테두리가 한 번 파장처럼 번진다 */
@keyframes hero-mark-in {
  0%   { opacity: 0; transform: scale(0.5) translateY(6px); }
  65%  { opacity: 1; transform: scale(1.06) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes focus-in {
  0%   { opacity: 0; filter: blur(5px); transform: translateY(14px); }
  100% { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@keyframes card-settle {
  0%   { opacity: 0; transform: scale(0.96) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes dropzone-ping {
  0%   { opacity: 0.5; transform: scale(1); }
  /* .upload-card가 overflow:hidden이라 밖으로 번지는 폭은 눈에 안 띌 만큼만 둔다 —
     신호의 대부분은 확대가 아니라 opacity 페이드가 만든다 */
  100% { opacity: 0; transform: scale(1.012); }
}

/* 히어로 마크의 웨이브바가 실제 이퀄라이저처럼 미세하게 움직인다 — "사운드"라는 브랜드 컨셉을 모션으로도 표현 */
.hero-brand-mark svg rect,
.brand-mark svg rect {
  transform-box: fill-box;
  transform-origin: center;
}

.hero-brand-mark svg rect {
  animation: eq-bounce 1.2s ease-in-out infinite;
}

.hero-brand-mark svg rect:nth-child(1) { animation-delay: -0.9s; }
.hero-brand-mark svg rect:nth-child(2) { animation-delay: -0.5s; }
.hero-brand-mark svg rect:nth-child(3) { animation-delay: -1.1s; }
.hero-brand-mark svg rect:nth-child(4) { animation-delay: -0.2s; }
.hero-brand-mark svg rect:nth-child(5) { animation-delay: -0.7s; }

@keyframes eq-bounce {
  0%, 100% { transform: scaleY(0.62); }
  50% { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-brand-mark { animation: none; }
  .hero-brand-mark svg rect { animation: none; }
}

.hero h1 {
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.15rem);
  line-height: 1.35;
  margin: 0 0 14px;
  letter-spacing: -0.015em;
  font-weight: 800;
  color: var(--color-primary-dark);
  animation: focus-in 0.62s var(--ease-out) 0.1s both;
}

/* 그라디언트 텍스트를 지원하는 브라우저에서만 시트러스 그라디언트 헤드라인 적용 — 미지원 브라우저는 위의 단색 폴백을 유지 */
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hero h1 {
    background: linear-gradient(100deg, var(--color-primary-dark) 0%, var(--color-primary) 45%, var(--color-pink) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.hero-sub {
  margin: 0 auto;
  max-width: 480px;
  color: var(--color-text-muted);
  font-size: 0.98rem;
  line-height: 1.6;
  animation: focus-in 0.62s var(--ease-out) 0.2s both;
}

/* ================= 업로드 카드 / 드롭존 ================= */
.upload-card {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
  animation: card-settle 0.6s var(--ease-out) 0.32s both;
}

/* 카드가 자리잡은 직후 한 번, 파일을 기다리는 중이라는 신호로 테두리가 파장처럼 번진다 —
   드롭존이라는 이 카드의 실제 역할(입력을 기다리는 대상)을 반영한 연출. overflow:hidden인
   .upload-card 대신 이 pseudo는 카드 자체 크기(inset:0)로 겹쳐 그려지며 카드 밖으로는
   퍼지지 않는다. */
.upload-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-primary);
  opacity: 0;
  pointer-events: none;
  animation: dropzone-ping 0.85s var(--ease-out) 0.7s 1 forwards;
}

/* 위 규칙들보다 파일에서 뒤에 둔다 — 동률 특이도에서는 소스 순서가 이기므로, 앞쪽(§597)의
   리듀스모션 블록에 같이 넣으면 이 뒤에 나오는 일반 규칙에 도로 덮인다(실제로 그렇게 됐다가
   발견해 여기로 옮김). */
@media (prefers-reduced-motion: reduce) {
  .hero h1,
  .hero-sub,
  .upload-card,
  .upload-card::after { animation: none; }
}

/* 카드 상단 시트러스 그라디언트 바 — 형태·레이아웃 변화 없이 색으로만 통일된 시그니처를 준다 */
.upload-card::before,
.settings-card::before,
.queue-card::before,
.results-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary-bright) 0%, var(--color-peach) 50%, var(--color-mint) 100%);
}

.dropzone {
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 52px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s var(--ease-out), background-color 0.2s var(--ease-out), transform 0.15s var(--ease-out);
  background: var(--color-bg-alt);
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  outline: none;
}

.dropzone.is-dragover {
  border-color: var(--color-primary-dark);
  background: var(--color-primary-soft);
  transform: scale(1.01);
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-primary-dark);
  box-shadow: var(--shadow-card);
}

.dropzone-title {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 1.02rem;
}

.dropzone-sub {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.dropzone-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px auto 0;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-mint-soft);
  text-align: left;
}

.dropzone-note-icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--color-mint);
}

.dropzone-note-text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* ================= 설정 카드 / 대기열 카드 / 결과 카드 ================= */
.settings-card,
.queue-card,
.results-card {
  position: relative;
  overflow: hidden;
  margin-top: 28px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--color-border);
  animation: rise-in 0.35s var(--ease-out);
}

.queue-count {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.queue-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.format-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.format-select-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.format-select {
  appearance: none;
  padding: 10px 34px 10px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-strong);
  background: var(--color-bg-alt)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A82A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E")
    no-repeat right 10px center / 16px;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s var(--ease-out), background-color 0.15s var(--ease-out);
}

.format-select:hover,
.format-select:focus-visible {
  border-color: var(--color-primary);
  outline: none;
}

.queue-total-duration {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* [hidden] 속성보다 이 규칙이 이기지 않도록 :not([hidden])일 때만 display를 건다
   (동률 우선순위에서 author 규칙이 UA 기본값을 이겨버리는 것을 방지) */
.btn-credit-chip:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-credit-chip {
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  /* 반투명 흰색이라 붉은 버튼 위에서 코인 아이콘의 골드·브라운 톤과 색이 섞였다 —
     헤더 크레딧 배지와 같은 밝은 크림색으로 바꿔 아이콘이 확실히 도드라지게 한다 */
  background: var(--color-peach-soft);
  color: var(--color-peach-dark);
  font-size: 0.85em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================= 라우드니스 슬라이더 / 미리듣기 ================= */
.loudness-value-group {
  display: flex;
  align-items: center;
  gap: 7px;
}

.loudness-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  font-variant-numeric: tabular-nums;
}

.loudness-recommend {
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--color-mint-soft);
  color: var(--color-mint);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.loudness-slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.loudness-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: transparent;
  outline: none;
  cursor: pointer;
}

.loudness-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--color-mint) 0%, var(--color-peach) 50%, var(--color-primary-bright) 100%);
}

.loudness-slider::-moz-range-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--color-mint) 0%, var(--color-peach) 50%, var(--color-primary-bright) 100%);
}

.loudness-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 3px solid var(--color-primary-dark);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}

.loudness-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 3px solid var(--color-primary-dark);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}

.loudness-slider:hover::-webkit-slider-thumb { transform: scale(1.15); }
.loudness-slider:hover::-moz-range-thumb { transform: scale(1.15); }

.loudness-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--color-primary-soft), var(--shadow-card);
}

.loudness-slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 4px var(--color-primary-soft), var(--shadow-card);
}

.btn-preview {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  border: none;
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s var(--ease-out), color 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}

.btn-preview:hover:not(:disabled),
.btn-preview:focus-visible:not(:disabled) {
  background: var(--color-primary);
  color: #fff;
  outline: none;
}

.btn-preview:active:not(:disabled) { transform: scale(0.96); }

.btn-preview:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.preview-error {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--color-error);
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.results-header h2 {
  margin: 0;
  font-size: 1.05rem;
}

.progress-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
}

#progress-count {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.progress-bar-track {
  flex: 1;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-alt);
  overflow: hidden;
  min-width: 100px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--color-primary-bright) 0%, var(--color-peach) 50%, var(--color-mint) 100%);
  transition: width 0.3s var(--ease-out);
}

/* ================= 파일 리스트 ================= */
.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 420px;
  overflow-y: auto;
  border-top: 1px solid var(--color-border);
}

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--color-border);
}

.file-row-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-faint);
  font-size: 0.75rem;
}

.file-row-main {
  flex: 1;
  min-width: 0;
}

.file-row-name {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-row-detail {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-badge.status-pending { background: var(--color-bg-alt); color: var(--color-pending); }
.status-badge.status-processing { background: var(--color-primary-soft); color: var(--color-primary-dark); }
.status-badge.status-processing::before { animation: pulse 1s ease-in-out infinite; }
.status-badge.status-done { background: var(--color-success-soft); color: var(--color-success); }
.status-badge.status-error { background: var(--color-error-soft); color: var(--color-error); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---- 실패 배지 호버 툴팁 (toast와 같은 어두운 말풍선 톤 재사용) ---- */
.status-badge.status-error {
  position: relative;
  cursor: help;
}

.status-badge.status-error::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  width: max-content;
  max-width: 220px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-text);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.45;
  white-space: normal;
  text-align: left;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s var(--ease-out), transform 0.15s var(--ease-out), visibility 0.15s;
  pointer-events: none;
  z-index: 20;
}

.status-badge.status-error:hover::after,
.status-badge.status-error:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  outline: none;
}

.file-download-link {
  flex-shrink: 0;
  color: var(--color-primary-dark);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s var(--ease-out);
}

.file-download-link:hover,
.file-download-link:focus-visible {
  background: var(--color-primary-soft);
  outline: none;
}

/* ================= 버튼 ================= */
.results-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* 인라인 배치일 때 크레딧 칩(inline-flex)의 베이스라인이 라벨 baseline에 맞아
   라벨이 아래로 처져 보인다 — flex 컨테이너로 만들어 수직 중앙에 맞춘다 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), background-color 0.15s var(--ease-out), opacity 0.15s var(--ease-out);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  box-shadow: 0 6px 18px -6px rgba(255, 122, 51, 0.55);
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px -6px rgba(255, 122, 51, 0.6);
  outline: none;
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost {
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
  background: var(--color-border);
  color: var(--color-text);
  outline: none;
}

/* ================= 푸터 ================= */
.site-footer {
  flex-shrink: 0;
  margin-top: 40px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 24px;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-brand-row .brand-mark {
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
}

.footer-brand-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text);
}

.footer-desc {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.footer-bottom {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
  font-size: 0.78rem;
  color: var(--color-text-faint);
}

.footer-contact {
  color: var(--color-text-faint);
  text-decoration: none;
}

.footer-contact:hover,
.footer-contact:focus-visible {
  color: var(--color-primary-dark);
  outline: none;
}

/* ================= 모달 공통 ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(43, 32, 20, 0.46);
  backdrop-filter: blur(6px);
  animation: overlay-in 0.2s var(--ease-out);
}

.modal-overlay.hidden { display: none; }

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-surface {
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  animation: modal-rise 0.25s var(--ease-out);
}

@keyframes modal-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color 0.15s var(--ease-out), color 0.15s var(--ease-out);
}

.modal-close:hover,
.modal-close:focus-visible {
  background: var(--color-border);
  color: var(--color-text);
  outline: none;
}

.modal-desc {
  margin: 0 0 20px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--color-text-muted);
}

/* ---- 크레딧 부족 안내 ---- */
.notice-surface strong {
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

#insufficient-short {
  color: var(--color-error);
  font-weight: 700;
}

.insufficient-cta {
  width: 100%;
}

/* ---- 크레딧 충전 모달 ---- */
.credit-surface {
  max-width: 420px;
}

.credit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.credit-pack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s var(--ease-out), transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}

.credit-pack:hover,
.credit-pack:focus-visible {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  outline: none;
}

.credit-pack:active { transform: translateY(0); }

.credit-pack-amount {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}

.credit-pack-price {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.credit-pack-badge {
  position: absolute;
  top: -8px;
  right: 10px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.credit-pack-badge-bonus {
  background: linear-gradient(135deg, var(--color-pink) 0%, var(--color-primary-dark) 100%);
  color: #fff;
}

/* ---- 결제 진행(임시) ---- */
.payment-surface {
  max-width: 380px;
}

.payment-summary {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
}

.payment-summary-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.payment-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.payment-summary-credits {
  font-weight: 700;
  color: var(--color-text);
}

.payment-summary-price {
  font-size: 1.05rem;
  color: var(--color-primary-dark);
  font-variant-numeric: tabular-nums;
}

/* 실제로 고를 수 없는 시각적 안내용 목록이라 hover·클릭 반응을 주지 않는다 */
.payment-method-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.payment-method-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  color: var(--color-text-faint);
  font-size: 0.88rem;
  font-weight: 600;
}

.payment-method-item.is-selected {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.payment-notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-peach-soft);
  color: var(--color-peach-dark);
  font-size: 0.82rem;
  line-height: 1.55;
  font-weight: 600;
}

.payment-submit {
  width: 100%;
}

/* ---- 로그인 모달 ---- */
.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--color-google-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), transform 0.15s var(--ease-out);
}

.btn-google:hover,
.btn-google:focus-visible {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-card);
  outline: none;
}

.btn-google:active { transform: translateY(1px); }

/* ---- 인증 폼 공통(로그인·회원가입·아이디찾기·비밀번호찾기) ---- */
.auth-field {
  margin-bottom: 14px;
}

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

.auth-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-strong);
  background: var(--color-bg-alt);
  font-size: 0.92rem;
  transition: border-color 0.15s var(--ease-out), background-color 0.15s var(--ease-out);
}

.auth-input:focus-visible,
.auth-input:focus {
  border-color: var(--color-primary);
  background: var(--color-surface);
  outline: none;
}

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

.auth-row .auth-input { flex: 1; min-width: 0; }

.auth-side-btn {
  flex-shrink: 0;
  padding: 0 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s var(--ease-out), color 0.15s var(--ease-out), opacity 0.15s var(--ease-out);
}

.auth-side-btn:hover:not(:disabled),
.auth-side-btn:focus-visible:not(:disabled) {
  background: var(--color-primary);
  color: #fff;
  outline: none;
}

.auth-side-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-feedback {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.auth-feedback.is-ok { color: var(--color-success); }
.auth-feedback.is-bad { color: var(--color-error); }

.auth-error {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-error-soft);
  color: var(--color-error);
  font-size: 0.82rem;
  font-weight: 600;
}

.auth-result {
  margin: 0 0 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--color-success-soft);
  color: var(--color-success);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.auth-options {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  cursor: pointer;
}

.auth-check input { accent-color: var(--color-primary); }

.auth-submit {
  width: 100%;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  font-size: 0.8rem;
}

.auth-link-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.15s var(--ease-out);
}

.auth-link-btn:hover,
.auth-link-btn:focus-visible {
  color: var(--color-primary-dark);
  outline: none;
}

.auth-link-sep {
  color: var(--color-border-strong);
}

.social-divider {
  position: relative;
  text-align: center;
  margin: 18px 0 14px;
}

.social-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-border);
}

.social-divider span {
  position: relative;
  padding: 0 12px;
  background: var(--color-surface);
  font-size: 0.76rem;
  color: var(--color-text-faint);
}

.auth-modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.auth-modal-footer .btn {
  flex: 1;
}

/* ---- 계정 설정 ---- */
.account-info-list {
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.account-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--color-border);
}

.account-info-row:last-child {
  border-bottom: none;
}

.account-info-label {
  color: var(--color-text-muted);
  font-weight: 600;
}

.account-danger-zone {
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.account-danger-desc {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--color-text-faint);
}

.btn-danger-ghost {
  width: 100%;
  background: var(--color-error-soft);
  color: var(--color-error);
}

.btn-danger-ghost:hover,
.btn-danger-ghost:focus-visible {
  background: var(--color-error);
  color: #fff;
  outline: none;
}

.btn-danger {
  background: var(--color-error);
  color: #fff;
}

.btn-danger:hover,
.btn-danger:focus-visible {
  background: #B01F39;
  outline: none;
}

#account-delete-form {
  margin-top: 16px;
}

/* ---- 토스트 ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(0);
  z-index: 200;
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  background: var(--color-text);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  animation: toast-in 0.25s var(--ease-out);
}

.toast[hidden] { display: none; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ================= 운영자 페이지 ================= */
.admin-header-bar {
  grid-template-columns: 1fr auto;
}

.admin-badge {
  margin-left: 6px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.admin-back-link {
  justify-self: end;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-decoration: none;
}

.admin-back-link:hover,
.admin-back-link:focus-visible {
  color: var(--color-primary-dark);
  outline: none;
}

.admin-content {
  max-width: 900px;
  justify-content: flex-start;
  padding-top: 32px;
  min-height: auto;
}

.admin-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stat-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.admin-stat-card::before,
.admin-table-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary-bright) 0%, var(--color-peach) 50%, var(--color-mint) 100%);
}

.admin-stat-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.admin-stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.admin-table-card {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

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

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

.admin-role-badge {
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  font-size: 0.76rem;
  font-weight: 700;
}

.admin-empty {
  text-align: center;
  padding: 24px;
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

/* ================= 반응형 ================= */
@media (max-width: 560px) {
  .dropzone { padding: 36px 16px; }
  .results-card { padding: 18px; }
  .file-row-detail { display: none; }
  .header-bar { padding: 12px 16px; gap: 8px; }
  .header-actions { gap: 14px; }
  .header-status-group { gap: 6px; }
  .brand-name { display: none; }
  .nav-plugin-full { display: none; }
  .nav-plugin-short { display: inline; }
  .credit-grid { grid-template-columns: 1fr; }
}
