/* =========================================================
   블로그 SEO 분석기 — 스타일시트
   디자인 시스템: design-system-step1.html (Glacier Blue) 기준
   ========================================================= */

:root {
  --canvas: #F7F9FC;
  --surface: #FFFFFF;
  --surface-sunken: #F0F3F8;
  --ink-900: #17202B;
  --ink-600: #4E5968;
  --ink-400: #8B95A1;
  --line-200: #E5E9F0;
  --line-100: #EEF1F6;

  --glacier-50: #EAF3FF;
  --glacier-100: #D2E7FF;
  --glacier-500: #1C8CF0;
  --glacier-600: #0F74D1;
  --glacier-700: #0B5CAA;

  --success: #1AAE7A;
  --success-bg: #E7F8F1;
  --warning: #F5A623;
  --warning-bg: #FFF4DE;
  --danger: #F0473D;
  --danger-bg: #FDEBEA;

  --shadow-card: 0 1px 2px rgba(23,32,43,0.04), 0 8px 24px rgba(23,32,43,0.06);
  --font-ui: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  /* 모노 폰트에는 한글 글리프가 없어서, 한글이 섞이면 Windows에서 굴림체로 대체되던 문제가 있었다.
     한글은 Pretendard로 대체되도록 모노 폰트 뒤에 UI 폰트를 폴백으로 둔다. */
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", "Pretendard Variable", Pretendard, "Malgun Gothic", monospace;

  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px; --radius-xl: 20px; --radius-full: 999px;
  --space-1: 4px; --space-2: 8px; --space-3: 16px; --space-4: 24px; --space-5: 32px; --space-6: 48px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #0B0F14; --surface: #131A22; --surface-sunken: #0F151C;
    --ink-900: #F3F6FA; --ink-600: #A9B4C0; --ink-400: #6C7885;
    --line-200: #232C36; --line-100: #1B222B;
    --glacier-50: #12233A; --glacier-100: #163A63; --glacier-500: #4FA3FF; --glacier-600: #7DBBFF; --glacier-700: #A9D2FF;
    --success-bg: #0F2A22; --warning-bg: #2E2410; --danger-bg: #33191A;
    --shadow-card: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scrollbar-gutter: stable; }
body {
  background: var(--canvas);
  color: var(--ink-900);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font-family: inherit; }
a { color: inherit; }
::selection { background: rgba(28,140,240,.18); }

#root { min-height: 100vh; }

@keyframes seo-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* 화면 전환 크로스페이드 (goTo 헬퍼가 #root에 부여)
   주의: translateY 등 transform을 쓰면 100vh 화면에서 스크롤 가능 영역이
   순간적으로 늘어나 스크롤바가 깜빡이며 화면이 덜컹거리므로 opacity만 사용한다. */
.root-leaving { opacity: 0; transition: opacity .14s ease; }
.root-entering { opacity: 0; }
.root-entered { opacity: 1; transition: opacity .22s ease; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- 레이아웃 ---------- */
.center-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 24px; box-sizing: border-box; }
.center-screen.top { align-items: flex-start; padding-top: 64px; }
.app-shell { padding: 56px 24px 100px; box-sizing: border-box; }
.admin-shell { padding-left: 4%; padding-right: 4%; }
.container { max-width: 1200px; margin: 0 auto; }
.container-fluid { width: 100%; max-width: none; margin: 0 auto; }
.container-narrow { max-width: 420px; margin: 0 auto; width: 100%; }
.container-xnarrow { max-width: 380px; margin: 0 auto; width: 100%; }

/* ---------- 버튼 ---------- */
.btn {
  cursor: pointer; border: none; border-radius: var(--radius-full); font-weight: 700;
  transition: background-color .15s ease, color .15s ease, opacity .15s ease, box-shadow .15s ease;
}
.btn:focus-visible { outline: 2px solid var(--glacier-500); outline-offset: 2px; }
.btn-block { width: 100%; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

.btn-primary { background: var(--glacier-500); color: #fff; padding: 13px 22px; font-size: 15px; }
.btn-primary:hover:not(:disabled) { background: var(--glacier-600); }
.btn-primary:disabled { background: var(--line-200); color: var(--ink-400); cursor: not-allowed; }

.btn-ghost { background: var(--glacier-50); color: var(--glacier-700); padding: 9px 18px; font-size: 13px; border-radius: var(--radius-md); }
.btn-ghost:hover:not(:disabled) { background: var(--glacier-100); }
.btn-ghost:disabled { opacity: .5; cursor: not-allowed; }

.btn-dark { background: var(--ink-900); color: #fff; padding: 9px 18px; font-size: 13px; border-radius: var(--radius-md); }
.btn-dark:hover:not(:disabled) { filter: brightness(1.15); }
.btn-dark:disabled { opacity: .5; cursor: not-allowed; }

.btn-guide { background: var(--warning-bg); color: var(--warning); padding: 9px 18px; font-size: 13px; border-radius: var(--radius-md); font-weight: 700; }
.btn-guide:hover:not(:disabled) { filter: brightness(0.94); }
.btn-guide:disabled { opacity: .5; cursor: not-allowed; }

.btn-link { background: none; color: var(--ink-400); font-size: 13px; font-weight: 600; padding: 8px 4px; border-radius: var(--radius-sm); }
.btn-link:hover { color: var(--ink-600); }

.btn-chip { background: var(--surface-sunken); color: var(--ink-600); font-size: 12.5px; font-weight: 600; padding: 6px 13px; border: 1px solid transparent; }
.btn-chip:hover:not(:disabled) { background: var(--line-200); }
.btn-chip:disabled { opacity: .5; cursor: not-allowed; }

.btn-danger-outline { background: transparent; color: var(--danger); border: 1px solid var(--danger-bg); padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); font-weight: 700; }
.btn-danger-outline:hover { background: var(--danger-bg); }
.btn-danger { background: var(--danger); color: #fff; padding: 13px 22px; font-size: 14.5px; }
.btn-danger:hover:not(:disabled) { filter: brightness(0.92); }

.btn-neutral-outline { background: transparent; color: var(--ink-600); border: 1px solid var(--line-200); padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); font-weight: 700; }
.btn-neutral-outline:hover { background: var(--surface-sunken); }
.btn-accent-outline { background: transparent; color: var(--glacier-600); border: 1px solid var(--glacier-100); padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); font-weight: 700; }
.btn-accent-outline:hover { background: var(--glacier-50); }
.btn-success-outline { background: transparent; color: var(--success); border: 1px solid var(--success-bg); padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); font-weight: 700; }
.btn-success-outline:hover { background: var(--success-bg); }
.btn-lg { padding: 13px 22px; font-size: 14.5px; } /* 변형 버튼(ghost 등)을 큰 크기로 쓸 때 — 변형보다 뒤에 둬야 적용됨 */

.link-accent { color: var(--glacier-600); font-weight: 700; text-decoration: none; }
.link-accent:hover { text-decoration: underline; }

/* ---------- 입력 필드 ---------- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-label { display: block; font-size: 14px; font-weight: 700; color: var(--ink-600); margin-bottom: 8px; }
.field-label.is-spaced { margin-top: 12px; } /* 앞 입력 요소와 간격이 필요한 라벨 */
.text-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; font-size: 15px; font-family: inherit;
  border: 1.5px solid var(--line-200); border-radius: var(--radius-md); outline: none;
  background: var(--surface); color: var(--ink-900); transition: border-color .15s ease;
}
.text-input::placeholder { color: var(--ink-400); }
.text-input:focus { border-color: var(--glacier-500); }
.text-input.has-error { border-color: var(--danger); }
.text-input:disabled { background: var(--surface-sunken); color: var(--ink-400); cursor: not-allowed; }
.field-error { margin-top: 8px; margin-bottom: 6px; font-size: 12.5px; color: var(--danger); font-weight: 600; }
.field-hint { margin-top: 8px; font-size: 13px; color: var(--ink-400); }
.field-hint.is-center { margin-top: 8px; text-align: center; }
.form-submit { margin-top: 6px; }

/* 버튼을 가운데 정렬로 두는 액션 줄 */
.action-row { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.action-row.is-loose { margin-top: 14px; }

/* 카드·리포트 섹션 사이 간격 */
.section-gap { margin-top: 16px; }

/* ---------- 카드 ---------- */
.card { background: var(--surface); border: 1px solid var(--line-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 24px; }
.card + .card { margin-top: 16px; }

/* ---------- 배지 ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: var(--glacier-600); background: var(--glacier-50);
  border-radius: var(--radius-full); padding: 5px 12px 5px 10px;
}
.badge { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-full); white-space: nowrap; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-neutral { background: var(--surface-sunken); color: var(--ink-600); }

.banner-success { margin-bottom: 16px; padding: 11px 14px; border-radius: var(--radius-md); background: var(--success-bg); color: var(--success); font-size: 12.5px; font-weight: 700; }

/* ---------- 스플래시 ---------- */
.splash { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: var(--glacier-500); }
.splash-mark { width: 72px; height: 72px; border-radius: 20px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; }
.splash-mark-inner { width: 34px; height: 34px; border-radius: 10px; background: #fff; }
.splash-text { text-align: center; }
.splash-title { font-size: 21px; font-weight: 800; color: #fff; letter-spacing: -.01em; margin-bottom: 6px; }
.splash-desc { font-size: 13.5px; color: rgba(255,255,255,.78); }
.splash-track { width: 120px; height: 4px; border-radius: var(--radius-full); background: rgba(255,255,255,.24); overflow: hidden; margin-top: 14px; }
.splash-fill { height: 100%; background: #fff; border-radius: var(--radius-full); transition: width .1s linear; }

/* ---------- 온보딩 ---------- */
.onboarding-skip-row { width: 100%; display: flex; justify-content: flex-end; gap: 4px; margin-bottom: 8px; }
.onboarding-mockup { background: var(--surface-sunken); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 24px; min-height: 132px; display: flex; align-items: center; justify-content: center; }
.onboarding-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; letter-spacing: -.01em; }
.onboarding-desc { font-size: 14px; line-height: 1.6; color: var(--ink-600); margin-bottom: 26px; }
.onboarding-footer { display: flex; align-items: center; justify-content: space-between; }
.onboarding-dots { display: flex; gap: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-200); transition: background-color .2s ease; }
.dot.active { background: var(--glacier-500); }

.mock-col { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.mock-row { display: flex; gap: 8px; }
.mock-input { flex: 1; height: 32px; border-radius: 8px; background: var(--surface); border: 1.5px solid var(--line-200); }
.mock-btn-sm { width: 52px; height: 32px; border-radius: 8px; background: var(--glacier-500); }
.mock-pill { height: 16px; border-radius: var(--radius-full); background: var(--line-200); }
.mock-bar-track { flex: 1; height: 8px; border-radius: var(--radius-full); background: var(--line-200); }
.mock-bar-fill { height: 8px; border-radius: var(--radius-full); background: var(--glacier-500); }
.mock-grid3 { width: 100%; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.mock-box { height: 44px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-200); }
.mock-line { grid-column: 1 / 4; height: 10px; border-radius: var(--radius-full); background: var(--line-200); }
.mock-row.is-center { align-items: center; }
.mock-row.is-end { justify-content: flex-end; }
.mock-pill.is-label { width: 44px; height: 8px; }
.mock-pill.w-56 { width: 56px; }
.mock-pill.w-70 { width: 70px; }
.mock-line.w-70 { width: 70%; }
.mock-line.w-78 { width: 78%; }
.mock-line.w-85 { width: 85%; }
.mock-line.w-92 { width: 92%; }
.mock-bar-fill.w-35 { width: 35%; }
.mock-bar-fill.w-41 { width: 41%; }
.mock-bar-fill.w-60 { width: 60%; }
.mock-bar-fill.w-63 { width: 63%; }
.mock-bar-fill.w-88 { width: 88%; }

/* ---------- 인증(로그인/회원가입) ---------- */
.auth-logo-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }
.auth-logo { width: 48px; height: 48px; border-radius: 14px; background: var(--glacier-500); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.auth-logo-inner { width: 20px; height: 20px; border-radius: 6px; background: #fff; }
.auth-title { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.auth-footer-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; font-size: 12.5px; color: var(--ink-400); }
.demo-hint { margin-top: 20px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-sunken); font-size: 12px; color: var(--ink-600); line-height: 1.7; }
.demo-hint b { color: var(--ink-900); font-family: var(--font-mono); }

/* ---------- 모달 (가이드) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(23,32,43,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; z-index: 100; animation: seo-fade-in .18s ease;
  box-sizing: border-box;
}
.modal-card {
  background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-card);
  width: 100%; max-width: 560px; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--line-200); flex: none;
}
.modal-title { font-size: 17px; font-weight: 800; }
.modal-close {
  background: none; border: none; cursor: pointer; color: var(--ink-400);
  font-size: 20px; line-height: 1; padding: 4px 10px; border-radius: var(--radius-sm);
}
.modal-close:hover { color: var(--ink-900); background: var(--surface-sunken); }
.modal-close:focus-visible { outline: 2px solid var(--glacier-500); outline-offset: 2px; }
.modal-body { padding: 12px 24px 24px; overflow-y: auto; }
.modal-card.is-center { text-align: center; }
.modal-card.is-center .modal-header { justify-content: center; border-bottom: none; padding-bottom: 0; }
.modal-message { font-size: 13.5px; line-height: 1.6; color: var(--ink-600); margin-bottom: 16px; }

.guide-steps { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.guide-step { display: flex; gap: 12px; align-items: flex-start; }
.guide-step-num {
  flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--glacier-500); color: #fff;
  font-size: 11.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.guide-step-text { font-size: 13.5px; line-height: 1.6; color: var(--ink-900); }
.tip-box {
  margin-top: 24px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--glacier-50);
  font-size: 12.5px; line-height: 1.6; color: var(--glacier-700);
}
.tip-box b { color: var(--glacier-700); }

/* ---------- 앱 헤더 ---------- */
.app-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.app-title { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 12px 0 8px; }
.app-desc { font-size: 15px; line-height: 1.6; color: var(--ink-600); max-width: 56ch; }
.app-header-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- 검색 카드 ---------- */
.search-row { display: flex; gap: 10px; }
.search-row > .text-input { flex: 1; min-width: 0; }
.search-row > .btn { flex: none; }
.chip-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- 광고 배너 ---------- */
.ad-banner-row { display: flex; gap: 12px; margin-bottom: 28px; flex-wrap: wrap; }
.ad-banner-slot {
  flex: 1 1 240px; min-height: 90px; border: 1.5px dashed var(--line-200); border-radius: var(--radius-md);
  background: var(--surface-sunken); color: var(--ink-400); font-size: 12.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.ad-banner-slot.has-image { padding: 0; overflow: hidden; }
.ad-banner-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

/* ---------- 탭 ---------- */
.tab-bar { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line-200); }
.tab-btn {
  background: none; border: none; cursor: pointer; font-family: inherit;
  font-size: 14px; font-weight: 700; color: var(--ink-400);
  padding: 10px 4px; margin-right: 24px; border-bottom: 2px solid transparent;
  transform: translateY(1px); transition: color .15s ease, border-color .15s ease;
}
.tab-btn:hover { color: var(--ink-900); }
.tab-btn.active { color: var(--glacier-700); border-bottom-color: var(--glacier-500); }
.tab-btn:focus-visible { outline: 2px solid var(--glacier-500); outline-offset: 2px; }

/* ---------- 라디오(원고 분석 비교 기준) ---------- */
.radio-row { display: flex; gap: 18px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-600); cursor: pointer; }
.radio-row input[type="radio"] { accent-color: var(--glacier-500); width: 15px; height: 15px; cursor: pointer; }

/* ---------- 광고 배너 관리(관리자) ---------- */
.ad-banner-preview { width: 100%; height: 140px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--line-200); display: block; }
.ad-banner-preview-wrap { position: relative; margin-bottom: 14px; }
.ad-banner-preview-empty {
  width: 100%; height: 140px; margin-bottom: 14px; box-sizing: border-box;
  border: 1.5px dashed var(--line-200); border-radius: var(--radius-md); background: var(--surface-sunken);
  color: var(--ink-400); font-size: 12.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.ad-banner-remove-btn {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(23,32,43,.6); color: #fff; border: none; cursor: pointer;
  font-size: 16px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.ad-banner-remove-btn:hover { background: rgba(23,32,43,.8); }
.banner-card-title { margin-bottom: 14px; }

/* ---------- URL 입력 ---------- */
.textarea-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; font-size: 15px; font-family: var(--font-ui);
  border: 1.5px solid var(--line-200); border-radius: var(--radius-md); outline: none;
  background: var(--surface); color: var(--ink-900); transition: border-color .15s ease;
  min-height: 140px; line-height: 1.6; resize: vertical;
}
.textarea-input::placeholder { color: var(--ink-400); }
.textarea-input:focus { border-color: var(--glacier-500); }
.textarea-input:disabled { background: var(--surface-sunken); color: var(--ink-400); }

/* ---------- 원고 점수 카드 ---------- */
.manuscript-score-card { padding: 20px 24px; }
.manuscript-score-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.manuscript-score-title { font-size: 13px; font-weight: 700; color: var(--ink-600); }
.manuscript-score-grade { font-size: 12.5px; font-weight: 800; padding: 4px 12px; border-radius: var(--radius-full); }
.manuscript-score-grade.danger { background: var(--danger-bg); color: var(--danger); }
.manuscript-score-grade.warning { background: var(--warning-bg); color: var(--warning); }
.manuscript-score-grade.info { background: var(--glacier-50); color: var(--glacier-600); }
.manuscript-score-grade.success { background: var(--success-bg); color: var(--success); }
.manuscript-score-value { font-size: 34px; font-weight: 800; color: var(--ink-900); line-height: 1; margin-bottom: 12px; }
.manuscript-score-max { font-size: 15px; font-weight: 700; color: var(--ink-400); margin-left: 4px; }
.manuscript-score-bar-track { width: 100%; height: 8px; border-radius: var(--radius-full); background: var(--surface-sunken); overflow: hidden; }
.manuscript-score-bar-fill { height: 100%; border-radius: var(--radius-full); transition: width .3s ease; }
.manuscript-score-bar-fill.danger { background: var(--danger); }
.manuscript-score-bar-fill.warning { background: var(--warning); }
.manuscript-score-bar-fill.info { background: var(--glacier-500); }
.manuscript-score-bar-fill.success { background: var(--success); }
.manuscript-score-sub { margin-top: 10px; font-size: 12.5px; color: var(--ink-600); font-weight: 600; }

/* ---------- 진행률 / 로그 ---------- */
.progress-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.progress-label { font-size: 13px; font-weight: 700; color: var(--ink-600); }
.progress-pct { font-size: 13px; font-weight: 800; color: var(--glacier-600); font-variant-numeric: tabular-nums; }
.progress-track { height: 8px; border-radius: var(--radius-full); background: var(--surface-sunken); overflow: hidden; margin-bottom: 20px; }
.progress-fill { height: 100%; border-radius: var(--radius-full); background: linear-gradient(90deg, var(--glacier-100), var(--glacier-500)); width: 0%; transition: width .25s cubic-bezier(.3,.6,.3,1); }
.log-label { font-size: 12.5px; font-weight: 700; color: var(--ink-400); letter-spacing: .03em; margin-bottom: 10px; }
.log-list { display: flex; flex-direction: column; gap: 7px; max-height: 220px; overflow-y: auto; }
.log-line { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--ink-600); font-family: var(--font-mono); animation: seo-fade-in .25s ease; }
.log-arrow { color: var(--ink-400); flex: none; }

/* ---------- 리포트 ---------- */
.report-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.report-head-left { display: flex; align-items: center; gap: 10px; }
.report-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.report-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }
.report-title { font-size: 14px; font-weight: 700; }
.report-timestamp { font-size: 12.5px; color: var(--ink-400); font-family: var(--font-mono); }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.summary-card { background: var(--surface); border: 1px solid var(--line-200); border-radius: var(--radius-md); padding: 16px 14px; box-shadow: var(--shadow-card); }
.summary-label { font-size: 11.5px; font-weight: 700; color: var(--ink-400); margin-bottom: 8px; white-space: nowrap; }
.summary-value { font-size: 19px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary-value.accent { color: var(--glacier-600); }
.summary-unit { font-size: 12px; font-weight: 600; color: var(--ink-400); margin-left: 2px; }

.ranking-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.ranking-grid > .card + .card { margin-top: 0; }
.ranking-card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.ranking-card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.ranking-card-sub { font-size: 11.5px; color: var(--ink-400); }
.kw-rows { display: flex; flex-direction: column; gap: 13px; }
.kw-row-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 5px; }
.kw-word { font-size: 13.5px; font-weight: 700; color: var(--ink-900); }
.kw-stat { font-size: 12px; color: var(--ink-600); font-variant-numeric: tabular-nums; }
.kw-bar-track { height: 6px; border-radius: var(--radius-full); background: var(--surface-sunken); overflow: hidden; }
.kw-bar-fill { height: 100%; border-radius: var(--radius-full); background: var(--glacier-500); width: 0%; transition: width .5s cubic-bezier(.2,.7,.3,1); }
.kw-bar-fill.red { background: var(--danger); }
.kw-bar-fill.yellow { background: var(--warning); }
.kw-bar-fill.green { background: var(--success); }
.kw-bar-fill.blue { background: var(--glacier-500); }

.doc-panel-title { font-size: 14px; font-weight: 800; margin-bottom: 14px; }
.doc-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line-100); }
.doc-row:first-child { border-top: none; }
.doc-index { flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--surface-sunken); color: var(--ink-600); font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.doc-body { flex: 1; min-width: 0; }
.doc-title { font-size: 13.5px; font-weight: 700; color: var(--ink-900); text-decoration: none; display: block; margin-bottom: 4px; line-height: 1.4; }
.doc-title:hover { text-decoration: underline; }
.doc-url { font-size: 12px; color: var(--glacier-600); font-family: var(--font-mono); text-decoration: none; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.doc-url:hover { text-decoration: underline; }
.doc-meta { flex: none; text-align: right; font-size: 12px; color: var(--ink-400); font-variant-numeric: tabular-nums; line-height: 1.6; }

/* ---------- 원고 분석 ---------- */
.manuscript-status-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.manuscript-status-pill { font-size: 14px; font-weight: 700; border-radius: var(--radius-full); padding: 9px 16px; }
.manuscript-status-pill.trial { color: var(--glacier-700); background: var(--glacier-50); }
.manuscript-status-pill.trial.exhausted { color: var(--danger); background: var(--danger-bg); }
.manuscript-status-pill.quota { color: var(--success); background: var(--success-bg); margin-left: auto; }
.manuscript-status-pill.quota.exhausted { color: var(--danger); background: var(--danger-bg); }
.file-display { display: flex; align-items: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-900); }
.file-display.is-empty { color: var(--ink-400); }

.manuscript-gate { position: relative; }
.manuscript-gate-blur { filter: blur(6px); pointer-events: none; user-select: none; }
.manuscript-gate-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 16px; z-index: 5;
}
.manuscript-gate-card {
  background: var(--surface); border: 1px solid var(--line-200); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 28px 32px; text-align: center; max-width: 360px;
}
.manuscript-gate-title { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.manuscript-gate-desc { font-size: 13.5px; line-height: 1.6; color: var(--ink-600); margin-bottom: 20px; }

/* ---------- 관리자: 회원 관리 ---------- */
.admin-stats-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.admin-stats-title { font-size: 14px; font-weight: 800; }
.admin-stats-actions { display: flex; align-items: center; gap: 12px; }
.admin-stats-row { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.admin-stat { background: var(--surface); border: 1px solid var(--line-200); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-card); flex: 1 1 140px; }
.admin-stat .label { font-size: 14px; font-weight: 700; color: var(--ink-400); margin-bottom: 6px; }
.admin-stat .value { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.admin-stat .value.is-success { color: var(--success); }
.admin-stat .value.is-danger { color: var(--danger); }
.admin-table-wrap { overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-size: 14px; font-weight: 700; color: var(--ink-400); text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-bottom: 1px solid var(--line-200); white-space: nowrap; }
.admin-table td { padding: 12px; border-bottom: 1px solid var(--line-100); vertical-align: middle; white-space: nowrap; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table th:first-child, .admin-table td:first-child { width: 1%; }
.admin-table input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--glacier-500); }
.pw-cell { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); }
.pw-toggle { background: none; border: none; color: var(--glacier-600); cursor: pointer; font-size: 11px; font-weight: 700; padding: 2px 4px; white-space: nowrap; }
.pw-toggle:hover { text-decoration: underline; }
.admin-empty { text-align: center; padding: 48px 24px; color: var(--ink-400); font-size: 13px; }

/* ---------- 관리자: 유입 경로 관리 ---------- */
.info-tooltip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--glacier-500); color: #fff; font-size: 10.5px; font-weight: 700; cursor: help; margin-left: 4px; vertical-align: middle; }
.info-tooltip:hover, .info-tooltip:focus-visible { background: var(--glacier-600); }
.info-tooltip::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  background: var(--ink-900); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.4; white-space: nowrap;
  padding: 7px 11px; border-radius: var(--radius-sm); box-shadow: 0 8px 20px rgba(0,0,0,.18);
  opacity: 0; visibility: hidden; transition: opacity .12s ease; pointer-events: none; z-index: 20;
}
.info-tooltip:hover::after, .info-tooltip:focus-visible::after { opacity: 1; visibility: visible; }
.traffic-range-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.traffic-range-bar .range-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.traffic-range-bar .range-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.traffic-date-picker { display: flex; align-items: center; gap: 8px; }
.traffic-date-picker .text-input { padding: 8px 10px; font-size: 13px; width: 148px; }
/* 오늘/최근 7일/최근 30일/조회 버튼 — 선택 상태(is-active)에 따라 배경색만 바뀌고
   크기(padding/font-size)는 항상 고정해서, 누를 때마다 버튼이 커졌다 작아지지 않게 한다. */
.range-btn { padding: 9px 18px; font-size: 13px; font-weight: 700; border-radius: var(--radius-md); background: var(--glacier-50); color: var(--glacier-700); }
.range-btn:hover { background: var(--glacier-100); }
.range-btn.is-active { background: var(--glacier-500); color: #fff; }
.range-btn.is-active:hover { background: var(--glacier-600); }
@media (max-width: 720px) {
  .traffic-range-bar { flex-direction: column; align-items: stretch; }
  .traffic-range-bar .range-right { justify-content: flex-start; }
}

.country-combo { position: relative; margin-top: 8px; }
.country-combo-field { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 46px; padding: 6px 10px; border: 1.5px solid var(--line-200); border-radius: var(--radius-md); background: var(--surface); cursor: text; transition: border-color .15s ease; }
.country-combo-field:focus-within { border-color: var(--glacier-500); }
.country-combo-input { flex: 1; min-width: 120px; border: none; outline: none; font-size: 15px; font-family: inherit; background: transparent; padding: 6px 2px; color: var(--ink-900); }
.country-combo-input::placeholder { color: var(--ink-400); }
.country-combo-dropdown { position: absolute; left: 0; right: 0; top: calc(100% + 6px); max-height: 222px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-200); border-radius: var(--radius-md); box-shadow: 0 12px 28px rgba(0,0,0,.14); z-index: 30; }
.country-combo-option { display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: 13.5px; cursor: pointer; }
.country-combo-option:hover { background: var(--surface-sunken); }
.country-combo-option.is-checked { background: var(--glacier-50); }
.country-combo-checkbox { width: 15px; height: 15px; flex-shrink: 0; pointer-events: none; accent-color: var(--glacier-500); }
.country-combo-option-label { flex: 1; }
.country-select-empty { padding: 16px; text-align: center; color: var(--ink-400); font-size: 12.5px; }
.country-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--glacier-50); color: var(--glacier-700); font-size: 12.5px; font-weight: 600; padding: 4px 6px 4px 10px; border-radius: var(--radius-full); }
.country-chip button { background: none; border: none; color: var(--glacier-600); cursor: pointer; font-size: 19px; line-height: 1; padding: 3px; display: flex; align-items: center; justify-content: center; }
.country-chip button:hover { color: var(--danger); }

.row-actions { display: flex; gap: 6px; flex-wrap: nowrap; }
.table-input {
  width: 100%; min-width: 110px; box-sizing: border-box; padding: 6px 8px; font-size: 12.5px;
  font-family: inherit; border: 1.5px solid var(--line-200); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-900); outline: none;
}
.table-input:focus { border-color: var(--glacier-500); }
.edit-row-error td { color: var(--danger); font-size: 12px; font-weight: 600; padding: 4px 12px 12px; border-top: none; }

#toast-layer { position: fixed; left: 0; right: 0; bottom: 32px; display: flex; justify-content: center; pointer-events: none; z-index: 1000; }
.toast-msg {
  background: var(--ink-900); color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 12px 22px; border-radius: var(--radius-full); box-shadow: 0 8px 24px rgba(0,0,0,.18);
  animation: seo-toast-in-out 3s ease forwards;
}
@keyframes seo-toast-in-out {
  0% { opacity: 0; transform: translateY(8px); }
  8% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(8px); }
}

/* ---------- 404 페이지 ---------- */
.notfound-card { text-align: center; }
.notfound-mark {
  width: 64px; height: 64px; border-radius: 18px; background: var(--glacier-50);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
}
.notfound-mark-inner { font-size: 26px; font-weight: 800; color: var(--glacier-600); }
.notfound-code { font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--ink-400); font-family: var(--font-mono); margin-bottom: 10px; }
.notfound-title { font-size: 19px; font-weight: 800; letter-spacing: -.01em; margin-bottom: 10px; }
.notfound-desc { font-size: 14px; line-height: 1.6; color: var(--ink-600); margin-bottom: 28px; }
.notfound-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---------- 반응형 ---------- */
@media (max-width: 720px) {
  .ranking-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .search-row { flex-direction: column; }
  .search-row .btn-primary { width: 100%; }
}
