/* [가독성 s49-2a] 글자 크기 사다리 — 옛 px 값 → 새 px 값. 여기 숫자만 바꾸면 화면 전체가 따라온다. 되돌리기 = 오른쪽 값을 왼쪽 이름과 같게. */
:root { --fs-9: 12px; --fs-10: 13px; --fs-11: 14px; --fs-12: 15px; --fs-12_5: 15.5px; --fs-13: 16px; --fs-13_5: 16.5px; --fs-14: 17px; --fs-15: 18px; --fs-15_5: 18.5px; --fs-16: 19px; --fs-17: 20px; --fs-18: 21px; }  /* [s49-2a-2] +1단계 */
  :root {
    --bg: #0d0f14;
    --surface: #161920;
    --surface2: #1e2230;
    --border: #2a2f3d;
    --accent: #3b6fff;
    --accent2: #00d4aa;
    --warn: #ff6b35;
    --text: #e8eaf0;
    --text2: #a6acbe;  /* [s49-2a] 8b90a0→ */
    --text3: #7b8194;  /* [s49-2a] 555a6e→ */
    --btn-1: #4a7dff; --btn-2: #8a6cf0; --btn-3: #1aa88c;  /* [s49-2b2] 주 버튼 3색(C안): 첫째 선택지·둘째·셋째 */
    --success: #22c55e;
    --red: #ef4444;
    --purple: #a78bfa;
    --yellow: #f59e0b;
  }
  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { background: var(--bg); color: var(--text); font-family: 'Noto Sans KR', sans-serif; min-height: 100vh; padding: 32px 16px 80px; }

  /* 헤더 */
  .header { max-width: 900px; margin: 0 auto 40px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
  .header-title { font-size: 26px; font-weight: 900; letter-spacing: -1px; line-height: 1.1; }
  .header-title span { color: var(--accent2); }
  .header-sub { color: var(--text2); font-size: var(--fs-13); margin-top: 6px; }
  .badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px; font-size: var(--fs-11); font-weight: 700; white-space: nowrap; }
  .badge-blue { background: rgba(59,111,255,.15); color: var(--accent); border: 1px solid rgba(59,111,255,.3); }
  .badge-teal { background: rgba(0,212,170,.12); color: var(--accent2); border: 1px solid rgba(0,212,170,.25); }
  .badge-purple { background: rgba(167,139,250,.12); color: var(--purple); border: 1px solid rgba(167,139,250,.3); }

  /* 카드 */
  .card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 24px; max-width: 900px; margin: 0 auto 20px; }
  .card-title { font-size: var(--fs-16); font-weight: 800; color: var(--text); margin-bottom: 18px; /* [s49-2b] */ display: flex; align-items: center; gap: 8px; }
  .card-title::before { content: ''; display: inline-block; width: 3px; height: 18px; background: var(--accent); border-radius: 2px; }
  .hidden { display: none !important; }
  .fact-panel { max-width: 900px; margin: 0 auto; }

  /* STEP1: 매체 유형 선택 */
  .media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
  .media-btn { background: var(--surface2); border: 2px solid var(--border); border-radius: 14px; padding: 18px 12px; cursor: pointer; text-align: center; transition: all .2s; }
  .media-btn:hover { border-color: var(--text3); }
  .media-btn.active-web { border-color: var(--accent2); background: rgba(0,212,170,.07); }
  .media-btn.active-brief { border-color: var(--accent); background: rgba(59,111,255,.07); }
  .media-btn.active-report { border-color: var(--purple); background: rgba(167,139,250,.07); }
  .media-icon { font-size: 26px; margin-bottom: 6px; }
  .media-label { font-size: var(--fs-14); font-weight: 700; color: var(--text); margin-bottom: 4px; }
  .media-desc { font-size: var(--fs-11); color: var(--text2); line-height: 1.5; }
  .media-tag { display: inline-block; font-size: var(--fs-10); padding: 2px 8px; border-radius: 10px; margin-top: 6px; font-weight: 700; }
  .tag-web { background: rgba(0,212,170,.15); color: var(--accent2); }
  .tag-brief { background: rgba(59,111,255,.15); color: var(--accent); }
  .tag-report { background: rgba(167,139,250,.15); color: var(--purple); }

  /* 유형 설명 박스 */
  .type-info { padding: 12px 16px; border-radius: 10px; font-size: var(--fs-13); line-height: 1.7; color: var(--text2); margin-bottom: 16px; border-left: 3px solid var(--border); }
  .type-info.web { border-color: var(--accent2); background: rgba(0,212,170,.05); }
  .type-info.brief { border-color: var(--accent); background: rgba(59,111,255,.05); }
  .type-info.report { border-color: var(--purple); background: rgba(167,139,250,.05); }

  /* 출처 유형 버튼 */
  .source-type-btn { padding:7px 14px; border-radius:8px; border:1px solid var(--border); background:var(--surface2); color:var(--text2); font-family:'Noto Sans KR',sans-serif; font-size:var(--fs-12); font-weight:700; cursor:pointer; transition:all .15s; }
  .source-type-btn:hover { border-color:var(--text3); color:var(--text); }
  .source-type-btn.active { border-color:var(--accent2); color:var(--accent2); background:rgba(0,212,170,.08); }

  /* 입력 */
  textarea { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-family: 'Noto Sans KR', sans-serif; font-size: var(--fs-14); line-height: 1.8; padding: 14px; resize: vertical; outline: none; transition: border-color .2s; min-height: 140px; }
  textarea:focus { border-color: var(--accent); }
  .input-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: var(--fs-12); color: var(--text3); }
  .clear-btn { background: none; border: 1px solid var(--border); color: var(--text3); border-radius: 6px; padding: 3px 10px; font-size: var(--fs-11); cursor: pointer; font-family: inherit; }
  .clear-btn:hover { border-color: var(--red); color: var(--red); }

  /* 버튼 */
  .btn-primary { width: 100%; padding: 14px; border: none; border-radius: 10px; font-family: 'Noto Sans KR', sans-serif; font-size: var(--fs-15); font-weight: 700; cursor: pointer; transition: all .2s; box-sizing: border-box; }
  .btn-group-3 .btn-primary { width: auto; }
  .btn-factcheck { background: var(--btn-3); color: #fff; }
  .btn-factcheck:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(0,212,170,.4); }
  .btn-brief { background: linear-gradient(135deg, var(--accent), #5580ff); color: #fff; }
  .btn-brief:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(59,111,255,.4); }
  .btn-report { background: linear-gradient(135deg, var(--purple), #7c3aed); color: #fff; }
  .btn-report:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(167,139,250,.4); }
  .btn-primary:disabled { background: var(--surface2) !important; color: var(--text3) !important; transform: none !important; box-shadow: none !important; cursor: not-allowed !important; }

  /* 버튼 그룹 */
  .action-btns { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }
  @media(min-width: 500px) { .action-btns { grid-template-columns: 1fr 1fr 1fr; } }

  /* 슬라이더 */
  .quick-slider-area { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-top: 16px; }
  .quick-slider-label { font-size: var(--fs-12); color: var(--text3); margin-bottom: 6px; font-weight: 600; letter-spacing: .3px; }
  .slider-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
  .slider-label { font-size: var(--fs-13); color: var(--text2); font-weight: 600; }
  .duration-display { font-size: 22px; font-weight: 900; color: var(--accent); }
  .duration-unit { font-size: var(--fs-13); color: var(--text2); margin-left: 2px; }
  input[type=range] { -webkit-appearance: none; width: 100%; height: 6px; background: var(--surface2); border-radius: 3px; outline: none; margin-bottom: 8px; cursor: pointer; }
  input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; border: 2px solid var(--bg); box-shadow: 0 0 0 3px rgba(59,111,255,.2); }
  .slider-ticks { position: relative; height: 18px; font-size: var(--fs-10); color: var(--text3); margin-bottom: 8px; }
  .slider-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }

  /* 인터뷰 패널 */
  .interview-section { margin-top: 16px; }
  .interview-toggle { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface2); border-radius: 10px; cursor: pointer; border: 1px solid var(--border); transition: border-color .2s; margin-bottom: 2px; }
  .interview-toggle:hover { border-color: var(--accent2); }
  .interview-toggle-label { font-size: var(--fs-13); font-weight: 700; color: var(--text); flex: 1; }
  .interview-toggle-badge { font-size: var(--fs-10); padding: 2px 8px; border-radius: 10px; background: rgba(245,158,11,.15); color: var(--yellow); border: 1px solid rgba(245,158,11,.3); font-weight: 700; }
  .toggle-arrow { color: var(--text3); font-size: var(--fs-12); transition: transform .2s; }
  .toggle-arrow.open { transform: rotate(180deg); }
  .interview-body { background: var(--surface2); border: 1px solid var(--border); border-radius: 0 0 10px 10px; padding: 16px; border-top: none; }
  .interview-input { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: 'Noto Sans KR', sans-serif; font-size: var(--fs-13); line-height: 1.8; padding: 12px; resize: vertical; outline: none; min-height: 100px; }
  .interview-input:focus { border-color: var(--accent2); }
  .placement-opts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
  .placement-btn { flex: 1; min-width: 120px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); color: var(--text2); font-size: var(--fs-12); font-weight: 700; cursor: pointer; font-family: inherit; text-align: center; transition: all .15s; }
  .placement-btn:hover { border-color: var(--accent2); color: var(--accent2); }
  .placement-btn.active { border-color: var(--accent2); color: var(--accent2); background: rgba(0,212,170,.08); }

  /* 스타일 학습 */
  .style-section { margin-top: 12px; }
  .style-toggle { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface2); border-radius: 10px; cursor: pointer; border: 1px solid var(--border); transition: border-color .2s; }
  .style-toggle:hover { border-color: var(--purple); }
  .style-toggle-label { font-size: var(--fs-13); font-weight: 700; color: var(--text2); flex: 1; }
  .style-body { background: var(--surface2); border: 1px solid var(--border); border-radius: 0 0 10px 10px; padding: 16px; border-top: none; }
  .style-status { font-size: var(--fs-12); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }
  .style-status.none { background: rgba(85,90,110,.1); color: var(--text3); border: 1px solid var(--border); }
  .style-status.ready { background: rgba(0,212,170,.08); color: var(--accent2); border: 1px solid rgba(0,212,170,.25); }
  .style-hint { font-size: var(--fs-11); color: var(--text3); margin-top: 8px; line-height: 1.6; }
  .style-analyze-btn { margin-top: 10px; width: 100%; padding: 9px; border: none; border-radius: 8px; background: var(--purple); color: #fff; font-family: inherit; font-size: var(--fs-13); font-weight: 700; cursor: pointer; transition: all .15s; }
  .style-analyze-btn:hover { background: #8b5cf6; }
  .style-analyze-btn:disabled { background: var(--surface2); color: var(--text3); cursor: not-allowed; }

  /* 로딩 */
  .loading-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 32px; }
  .spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent2); border-radius: 50%; animation: spin .8s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .loading-text { color: var(--text2); font-size: var(--fs-14); }

  /* 팩트체크 결과 */
  .score-hero { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; }
  .score-circle { width: 80px; height: 80px; border-radius: 50%; border: 4px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
  .score-num { font-size: 26px; font-weight: 900; line-height: 1; }
  .score-max { font-size: var(--fs-11); color: var(--text3); }
  .score-meta h3 { font-size: var(--fs-17); font-weight: 700; margin-bottom: 4px; }
  .score-meta p { font-size: var(--fs-13); color: var(--text2); line-height: 1.6; }
  .analysis-list { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
  .analysis-item { display: flex; gap: 10px; padding: 8px 12px; background: var(--surface2); border-radius: 8px; font-size: var(--fs-13); }
  .analysis-item .icon { font-size: var(--fs-14); flex-shrink: 0; }

  /* 기사 설정 */
  .hook-select { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-family: 'Noto Sans KR', sans-serif; font-size: var(--fs-14); padding: 11px 14px; outline: none; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238b90a0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; transition: border-color .2s; margin-bottom: 8px; }
  .hook-select:focus { border-color: var(--accent); }
  .hook-preview { font-size: var(--fs-12); color: var(--text3); padding: 8px 12px; background: var(--bg); border-radius: 8px; border-left: 2px solid var(--accent2); line-height: 1.6; font-style: italic; margin-bottom: 18px; }
  .hook-preview em { color: var(--accent2); font-style: normal; font-weight: 700; }

  /* 웹 길이 */
  .web-length-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
  .web-length-btn { padding: 10px 8px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; text-align: center; background: var(--surface2); transition: all .15s; }
  .web-length-btn:hover { border-color: var(--text3); }
  .web-length-btn.active { border-color: var(--accent2); background: rgba(0,212,170,.07); }
  .wl-label { font-size: var(--fs-13); font-weight: 700; color: var(--text); }
  .wl-desc { font-size: var(--fs-10); color: var(--text3); margin-top: 2px; }

  /* SEO 옵션 */
  .seo-opts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
  .seo-opt { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; font-size: var(--fs-12); color: var(--text2); transition: all .15s; background: var(--surface2); }
  .seo-opt.active { border-color: var(--accent2); color: var(--accent2); background: rgba(0,212,170,.07); }
  .seo-opt input { display: none; }

  /* 스탯 */
  .stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
  .stat-box { background: var(--surface2); border-radius: 10px; padding: 12px; text-align: center; }
  .stat-val { font-size: 20px; font-weight: 900; color: var(--accent2); }
  .stat-key { font-size: var(--fs-10); color: var(--text3); margin-top: 4px; }

  /* 스크립트 결과 */
  .script-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
  .script-badges { display: flex; gap: 6px; }
  .script-info { font-size: var(--fs-12); color: var(--text3); margin-bottom: 14px; }
  .script-block { background: var(--surface2); border-radius: 12px; padding: 16px; margin-bottom: 10px; }
  .script-block-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
  .script-role { font-size: var(--fs-11); font-weight: 700; letter-spacing: .5px; padding: 3px 10px; border-radius: 8px; }
  .role-thumb { background: rgba(0,212,170,.12); color: var(--accent2); }
  .role-anchor { background: rgba(59,111,255,.12); color: var(--accent); }
  .role-reporter { background: rgba(167,139,250,.12); color: var(--purple); }
  .role-closing { background: rgba(245,158,11,.12); color: var(--yellow); }
  .role-interview { background: rgba(255,140,66,.15); color: var(--warn); }
  /* 인터뷰 블록 — 앵커멘트/클로징과 동일한 박스 구조 */
  .interview-block {
    background: rgba(255, 140, 66, 0.06);
    border: 1px solid rgba(255, 140, 66, 0.25);
  }
  .interview-block .caption-row {
    border-bottom: none;
    padding: 0;
  }
  .role-web { background: rgba(0,212,170,.12); color: var(--accent2); }
  .script-text { font-size: var(--fs-14); line-height: 1.9; color: var(--text); white-space: pre-wrap; }
  .edit-btn { background: none; border: 1px solid var(--border); color: var(--text3); border-radius: 6px; padding: 3px 10px; font-size: var(--fs-11); cursor: pointer; font-family: inherit; transition: all .15s; }
  .edit-btn:hover { border-color: var(--accent2); color: var(--accent2); }
  .edit-btn.active { border-color: var(--accent2); color: var(--accent2); background: rgba(0,212,170,.08); }
  .script-textarea { width: 100%; background: var(--bg); border: 1px solid var(--accent2); border-radius: 8px; color: var(--text); font-family: 'Noto Sans KR', sans-serif; font-size: var(--fs-14); line-height: 1.9; padding: 12px; resize: vertical; min-height: 80px; outline: none; }
  .ai-edit-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
  .ai-edit-input { flex: 1; min-width: 180px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; font-size: var(--fs-13); padding: 8px 12px; outline: none; }
  .ai-edit-input:focus { border-color: var(--accent); }
  .ai-edit-btn { background: var(--accent); border: none; color: #fff; border-radius: 8px; padding: 8px 14px; font-size: var(--fs-12); font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; }
  .ai-edit-btn:disabled { background: var(--surface2); color: var(--text3); cursor: not-allowed; }
  .model-tag { font-size: var(--fs-10); padding: 2px 7px; border-radius: 10px; background: rgba(0,212,170,.12); color: var(--accent2); border: 1px solid rgba(0,212,170,.25); white-space: nowrap; }
  .edit-loading { font-size: var(--fs-12); color: var(--text3); display: none; align-items: center; gap: 6px; }
  .edit-loading.show { display: flex; }
  .mini-spinner { width: 12px; height: 12px; border: 2px solid var(--border); border-top-color: var(--accent2); border-radius: 50%; animation: spin .6s linear infinite; flex-shrink: 0; }

  /* 전문 */
  .full-script-box { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-top: 12px; }
  .full-script-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--surface2); font-size: var(--fs-12); font-weight: 700; color: var(--text2); }
  .copy-btn { background: var(--accent); border: none; color: #fff; border-radius: 6px; padding: 4px 12px; font-size: var(--fs-11); font-weight: 700; cursor: pointer; font-family: inherit; }
  pre { padding: 16px; font-family: 'Noto Sans KR', sans-serif; font-size: var(--fs-13); line-height: 1.9; color: var(--text); white-space: pre-wrap; overflow-x: auto; }

  /* 썸네일 카드 */
  .thumb-section-title { font-size: var(--fs-13); font-weight: 700; color: var(--text2); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
  .thumb-section-title::before { content: ''; display: inline-block; width: 3px; height: 14px; background: var(--yellow); border-radius: 2px; }
  .thumb-cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
  @media(max-width: 600px) { .thumb-cards-grid { grid-template-columns: 1fr; } }
  .thumb-card {
    background: #0a0a0a;
    border-radius: 14px;
    padding: 24px 18px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all .2s;
    border: 2px solid transparent;
    box-shadow: 0 4px 20px rgba(0,0,0,.5);
  }
  .thumb-card:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: 0 8px 30px rgba(239,68,68,.25); }
  .thumb-card-copy { position: absolute; top: 10px; right: 10px; opacity: 0; transition: opacity .2s; color: var(--text3); font-size: var(--fs-12); }
  .thumb-card:hover .thumb-card-copy { opacity: 1; }
  .thumb-line1 { font-size: var(--fs-18); font-weight: 900; color: var(--yellow); line-height: 1.4; word-break: keep-all; drop-shadow: 0 1px 4px rgba(0,0,0,.8); }
  .thumb-divider { width: 32px; height: 2px; background: rgba(255,255,255,.2); border-radius: 2px; margin: 10px auto; }
  .thumb-line2 { font-size: var(--fs-15); font-weight: 700; color: #fff; line-height: 1.4; word-break: keep-all; }
  .thumb-num { position: absolute; top: 10px; left: 12px; font-size: var(--fs-10); font-weight: 700; color: var(--text3); }

  /* 자막+낭독 분리 렌더링 — 2열 레이아웃 */
  .caption-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 0;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    align-items: start;
  }
  .caption-col-label { font-size: var(--fs-11); color: var(--text3); margin-bottom: 4px; }
  .caption-cg-box {
    background: #111318;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: var(--fs-13);
    font-weight: 700;
    color: #fff;
    line-height: 1.5;
    word-break: keep-all;
  }
  .caption-narration-text { font-size: var(--fs-14); line-height: 1.7; color: var(--text); word-break: keep-all; }
  /* 레거시 (웹기사 등 단순 텍스트용) */
  .caption-narration { font-size: var(--fs-14); line-height: 1.9; color: var(--text); padding-left: 4px; }

  /* 비교 */
  .compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .compare-col { background: var(--surface2); border-radius: 10px; padding: 14px; }
  .compare-col h4 { font-size: var(--fs-12); font-weight: 700; margin-bottom: 10px; }
  .compare-col.before h4 { color: var(--red); }
  .compare-col.after h4 { color: var(--accent2); }
  .compare-text { font-size: var(--fs-13); color: var(--text2); line-height: 1.8; }

  /* 팩트체크 설정 유형 */
  .type-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-bottom: 20px; }
  .type-btn { padding: 14px 10px; border-radius: 12px; border: 2px solid var(--border); cursor: pointer; text-align: center; transition: all .15s; background: var(--surface2); }
  .type-btn:hover { border-color: var(--text3); }
  .t-label { font-size: var(--fs-14); font-weight: 700; margin-bottom: 4px; }
  .t-desc { font-size: var(--fs-11); color: var(--text3); }
  .btn-generate { background: var(--btn-1); color: #fff; width: 100%; padding: 14px; border: none; border-radius: 10px; font-family: 'Noto Sans KR', sans-serif; font-size: var(--fs-15); font-weight: 700; cursor: pointer; transition: all .2s; margin-top: 4px; }
  .btn-generate:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(0,212,170,.4); }

  /* 인용 결과 */
  .quote-result-block { background: rgba(0,212,170,.05); border: 1px solid rgba(0,212,170,.2); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; }
  .quote-result-label { font-size: var(--fs-11); color: var(--accent2); font-weight: 700; margin-bottom: 4px; }
  .quote-result-text { font-size: var(--fs-13); color: var(--text); line-height: 1.7; }

  @media(max-width: 600px) {
    .media-grid, .type-grid { grid-template-columns: 1fr; }
    .compare-grid { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .header { flex-direction: column; align-items: flex-start; }
    .web-length-grid { grid-template-columns: 1fr 1fr; }
  }

  /* ── 스크립트 white-space 오버라이드 (pre-wrap 상속 방지) ── */
  #outReporter, #outAnchor { white-space: normal !important; }

  /* ── 하단 수정 바 (broadcastResults 내부) ── */
  .article-edit-bar { display: flex; gap: 8px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
  .article-edit-input { flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-family: 'Noto Sans KR', sans-serif; font-size: var(--fs-14); padding: 10px 14px; outline: none; transition: border-color .2s; min-width: 0; }
  .article-edit-input:focus { border-color: var(--accent); }
  .article-edit-input::placeholder { color: var(--text3); }
  .article-ai-btn { background: var(--accent); border: none; color: #fff; border-radius: 10px; padding: 10px 18px; font-size: var(--fs-14); font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; transition: all .15s; flex-shrink: 0; }
  .article-ai-btn:hover:not(:disabled) { background: #2d5ce0; }
  .article-ai-btn:disabled { background: var(--surface2); color: var(--text3); cursor: not-allowed; }
  .article-direct-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--text2); border-radius: 10px; padding: 10px 16px; font-size: var(--fs-14); font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; transition: all .15s; flex-shrink: 0; }
  .article-direct-btn:hover { border-color: var(--accent2); color: var(--accent2); }
  .article-direct-btn.active { border-color: var(--accent2); color: var(--accent2); background: rgba(0,212,170,.08); }

  /* ── 결과 화면 상단 네비 ── */
  .result-top-nav { display: flex; justify-content: space-between; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; margin-bottom: 16px; gap: 8px; }
  .result-nav-btn { background: none; border: 1px solid var(--border); color: var(--text2); border-radius: 8px; padding: 8px 14px; font-size: var(--fs-13); font-weight: 600; cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap; }
  .result-nav-btn:hover { border-color: var(--text3); color: var(--text); }
  .result-nav-btn.primary { background: rgba(0,212,170,.1); border-color: var(--accent2); color: var(--accent2); }
  .result-nav-btn.primary:hover { background: rgba(0,212,170,.2); }

  /* ── 스크립트 섹션 헤더 ── */
  .script-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; margin-top: 4px; }
  .script-section-title { font-size: var(--fs-15); font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
  .script-section-title::before { content: ''; display: inline-block; width: 14px; height: 14px; background: var(--red); border-radius: 3px; flex-shrink: 0; }
  .script-copy-btn { background: none; border: 1px solid var(--border); color: var(--text2); border-radius: 6px; padding: 4px 12px; font-size: var(--fs-12); font-weight: 600; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 5px; transition: all .15s; white-space: nowrap; }
  .script-copy-btn:hover { border-color: var(--accent2); color: var(--accent2); }

  /* ── 직접 수정 모드 ── */
  .direct-edit-mode .caption-cg-box[contenteditable="true"] { outline: 2px solid var(--accent2); cursor: text; }
  .direct-edit-mode .caption-narration-text[contenteditable="true"] { outline: 2px solid var(--accent2); border-radius: 4px; padding: 2px 4px; cursor: text; }
  .direct-edit-mode .caption-cg-box[contenteditable="true"]:focus,
  .direct-edit-mode .caption-narration-text[contenteditable="true"]:focus { box-shadow: 0 0 0 3px rgba(0,212,170,.15); outline-color: var(--accent2); }

  /* ── 하단 액션 바 ── */
  .bottom-action-bar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 16px; display: none; gap: 8px; align-items: center; box-shadow: 0 -4px 24px rgba(0,0,0,.4); }
  .bottom-action-bar.visible { display: flex; }
  .bottom-action-input { flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; color: var(--text); font-family: 'Noto Sans KR', sans-serif; font-size: var(--fs-14); padding: 10px 14px; outline: none; transition: border-color .2s; min-width: 0; }
  .bottom-action-input:focus { border-color: var(--accent); }
  .bottom-action-input::placeholder { color: var(--text3); }
  .bottom-ai-btn { background: var(--accent); border: none; color: #fff; border-radius: 10px; padding: 10px 18px; font-size: var(--fs-14); font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; transition: all .15s; }
  .bottom-ai-btn:hover:not(:disabled) { background: #2d5ce0; }
  .bottom-ai-btn:disabled { background: var(--surface2); color: var(--text3); cursor: not-allowed; }
  .bottom-direct-btn { background: var(--surface2); border: 1px solid var(--border); color: var(--text2); border-radius: 10px; padding: 10px 16px; font-size: var(--fs-14); font-weight: 700; cursor: pointer; font-family: inherit; white-space: nowrap; transition: all .15s; }
  .bottom-direct-btn:hover { border-color: var(--accent2); color: var(--accent2); }
  .bottom-direct-btn.active { border-color: var(--accent2); color: var(--accent2); background: rgba(0,212,170,.08); }

  /* ── Gemini 채팅 패널 ── */
  .app-layout { display: flex; gap: 20px; align-items: flex-start; max-width: 1300px; margin: 0 auto; }
  .main-col { flex: 1; min-width: 0; }
  .chat-panel {
    width: 360px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-top: 0;
  }
  .chat-panel-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
  }
  .chat-panel-title { font-size: var(--fs-14); font-weight: 700; color: var(--text); flex: 1; }
  .chat-panel-badge { font-size: var(--fs-10); padding: 2px 8px; border-radius: 10px; background: rgba(0,212,170,.12); color: var(--accent2); border: 1px solid rgba(0,212,170,.25); font-weight: 700; }
  .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .chat-messages::-webkit-scrollbar { width: 4px; }
  .chat-messages::-webkit-scrollbar-track { background: transparent; }
  .chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
  .chat-msg { max-width: 90%; }
  .chat-msg.user { align-self: flex-end; }
  .chat-msg.bot { align-self: flex-start; }
  .chat-msg-bubble {
    padding: 9px 13px;
    border-radius: 12px;
    font-size: var(--fs-13);
    line-height: 1.7;
    word-break: keep-all;
  }
  .chat-msg.user .chat-msg-bubble { background: var(--accent); color: #fff; border-radius: 12px 12px 3px 12px; }
  .chat-msg.bot .chat-msg-bubble { background: var(--surface2); color: var(--text); border-radius: 12px 12px 12px 3px; }
  .chat-msg-time { font-size: var(--fs-10); color: var(--text3); margin-top: 3px; text-align: right; }
  .chat-msg.bot .chat-msg-time { text-align: left; }
  /* s41-1: 메시지가 적을 때도 메신저처럼 아래부터 쌓이게 — 첫 말풍선이 위 여백을 전부 흡수 */
  .chat-messages .chat-msg:first-child { margin-top: auto; }
  .chat-input-area {
    padding: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    background: var(--surface);
  }
  .chat-input {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: 'Noto Sans KR', sans-serif;
    font-size: var(--fs-13);
    padding: 9px 12px;
    outline: none;
    resize: none;
    max-height: 100px;
    min-height: 38px;
    transition: border-color .2s;
  }
  .chat-input:focus { border-color: var(--accent2); }
  .chat-input::placeholder { color: var(--text3); }
  .chat-send-btn {
    background: var(--accent2);
    border: none;
    color: #111;
    border-radius: 10px;
    width: 38px;
    height: 38px;
    font-size: var(--fs-16);
    cursor: pointer;
    flex-shrink: 0;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .chat-send-btn:hover:not(:disabled) { background: #00b894; }
  .chat-send-btn:disabled { background: var(--surface2); color: var(--text3); cursor: not-allowed; }
  .chat-empty { color: var(--text3); font-size: var(--fs-13); text-align: center; padding: 20px 10px; line-height: 1.8; }
  .chat-search-indicator { font-size: var(--fs-11); color: var(--accent2); display: flex; align-items: center; gap: 5px; padding: 4px 0; }
  .chat-typing { display: flex; gap: 4px; align-items: center; padding: 10px 13px; background: var(--surface2); border-radius: 12px 12px 12px 3px; width: fit-content; }
  .chat-typing span { width: 6px; height: 6px; background: var(--text3); border-radius: 50%; animation: chatBounce .9s infinite; }
  .chat-typing span:nth-child(2) { animation-delay: .15s; }
  .chat-typing span:nth-child(3) { animation-delay: .3s; }
  @keyframes chatBounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-5px)} }
  .chat-api-warn {
    margin: 10px;
    padding: 10px 12px;
    background: rgba(239,68,68,.08);
    border: 1px solid rgba(239,68,68,.2);
    border-radius: 10px;
    font-size: var(--fs-12);
    color: var(--red);
    line-height: 1.6;
  }
  /* ── 왼쪽 타임라인 ── */
  .timeline-rail {
    width: 44px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 32px;
    gap: 0;
  }
  .tl-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
  }
  .tl-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--surface2);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-12); font-weight: 800; color: var(--text2); /* [s49-2b] 숫자 */
    transition: all .2s;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
  }
  .tl-item.active .tl-dot {
    border-color: var(--accent2);
    background: rgba(0,212,170,.15);
    box-shadow: 0 0 0 4px rgba(0,212,170,.12);
  }
  .tl-item.done .tl-dot {
    border-color: var(--accent2);
    background: var(--accent2);
  }
  .tl-item.done .tl-dot { color: #111; }
  .tl-line {
    width: 2px;
    height: 32px;
    background: var(--border);
    transition: background .3s;
  }
  .tl-item.done + .tl-item .tl-line,
  .tl-line.done { background: var(--accent2); }
  .tl-tooltip {
    position: absolute;
    left: 38px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: var(--fs-12);
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 999;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
  }
  .tl-item:hover .tl-tooltip { opacity: 1; }
  @media(max-width: 800px) { .timeline-rail { display: none; } }

  @media(max-width: 1100px) { .chat-panel { width: 300px; } }
  @media(max-width: 800px) { .app-layout { flex-direction: column; } .chat-panel { width: 100%; position: static; height: 400px; } }

/* ── SNS 글쓰기 유형 카드 ── */
.sns-type-card {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.sns-type-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.sns-type-card.active {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.sns-type-icon {
  font-size: 24px;
  line-height: 1;
}
.sns-type-label {
  font-size: var(--fs-12);
  font-weight: 700;
  color: var(--text);
  word-break: keep-all;
  line-height: 1.3;
}
.sns-type-desc {
  font-size: var(--fs-10);
  color: var(--text3);
  line-height: 1.5;
  word-break: keep-all;
}
.sns-type-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 2px;
}
.sns-type-tag {
  font-size: var(--fs-9);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 8px;
  white-space: nowrap;
}
@media(max-width: 600px) {
  #snsTypeCards, #snsTypeCardsTab {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .sns-type-card:last-child {
    grid-column: 1 / -1;
  }
}


/* 외신 핵심 정리 로딩 스피너 */
@keyframes foreignSpin {
  to { transform: rotate(360deg); }
}
