/* ============================================================
   TSCA Content Studio — TSCA UI Theme
   기존 TSCA Blog Lab 디자인 언어 계승: 네이비/블루/청록, 둥근 카드
   ============================================================ */
:root {
  --ink:#102836;
  --muted:#667984;
  --line:#dce7eb;
  --surface:#ffffff;
  --canvas:#f3f7fa;
  --navy:#0b4057;
  --blue:#1179a5;
  --cyan:#1db7bd;
  --teal:#0d8b8a;
  --primary:var(--blue);
  --primary-dark:var(--navy);
  --accent:var(--teal);
  --danger:#bd3c47;
  --warning:#b56a08;
  --yellow:#fdb022;
  --blue-issue:#2e90fa;
  --purple:#7a5af8;
  --soft-blue:#eaf6fb;
  --soft-teal:#e8f8f7;
  --soft-warn:#fff5e7;
  --soft-bad:#fff0f1;
  --shadow:0 14px 42px rgba(15,52,69,.09);
}
*{box-sizing:border-box}
body{font-family:Pretendard,"Noto Sans KR","Apple SD Gothic Neo",system-ui,-apple-system,sans-serif;background:linear-gradient(180deg,#eef6f8 0,var(--canvas) 320px);color:var(--ink);letter-spacing:-.015em;line-height:1.6}
a{color:var(--blue)}

/* ---------- 상단바 / 브랜드 ---------- */
.app-navbar{background:rgba(255,255,255,.92);border-bottom:1px solid var(--line);backdrop-filter:blur(16px)}
.navbar-brand{font-weight:800;color:var(--ink)}
.brand-logo{width:40px;height:40px;object-fit:cover;border-radius:12px;box-shadow:0 7px 18px rgba(11,64,87,.2)}
.brand-name{font-size:1.05rem;letter-spacing:-.03em}
.version-badge{display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;background:#e8f7f5;color:#0b6f68;font-size:.68rem;font-weight:800;letter-spacing:.02em;border:1px solid #b7e5df}
.nav-link{color:#475f6b!important;font-weight:600;margin:0 .15rem;border-radius:.65rem;padding:.55rem .75rem!important}
.nav-link:hover{background:var(--soft-blue);color:var(--blue)!important}
.user-chip{display:inline-flex;align-items:center;gap:.35rem;padding:.45rem .7rem;border-radius:999px;background:var(--soft-teal);border:1px solid #c6e9e6;color:#176964;font-size:.78rem;font-weight:700}
.app-footer{display:flex;align-items:center;justify-content:center;gap:8px;color:var(--muted);font-size:.72rem;padding:22px 0 26px}
.app-footer img{width:22px;height:22px;border-radius:6px;object-fit:cover}

/* ---------- 로그인 (2단 브랜드 레이아웃) ---------- */
.auth-shell{min-height:100vh;display:grid;place-items:center;padding:2rem;background:radial-gradient(circle at 15% 20%,rgba(29,183,189,.18),transparent 28%),radial-gradient(circle at 88% 78%,rgba(17,121,165,.16),transparent 30%),linear-gradient(135deg,#ecf7f8,#f8fafb 55%,#eef5f9)}
.login-shell{width:min(980px,100%);display:grid;grid-template-columns:1.05fr .85fr;gap:26px;align-items:center}
.login-brand{display:flex;align-items:center;gap:20px;padding:30px}
.login-brand img{width:92px;height:92px;object-fit:cover;border-radius:24px;box-shadow:0 20px 48px rgba(11,64,87,.22)}
.login-eyebrow{font-size:.7rem;letter-spacing:.15em;color:var(--teal);font-weight:800}
.login-brand h1{font-size:2.7rem;line-height:1.05;letter-spacing:-.055em;margin:.45rem 0;font-weight:800;color:var(--navy)}
.login-brand p{margin:0;color:var(--muted);font-size:.88rem;line-height:1.7}
.auth-card{width:min(100%,480px);background:#fff;padding:2.1rem;border:1px solid var(--line);border-radius:24px;box-shadow:0 24px 70px rgba(11,64,87,.14)}
.pending-icon{width:80px;height:80px;border-radius:50%;display:grid;place-items:center;background:var(--soft-blue);color:var(--blue);font-size:2rem;margin:auto}
@media(max-width:860px){.login-shell{grid-template-columns:1fr}.login-brand{padding:8px 4px}.login-brand img{width:62px;height:62px;border-radius:18px}.login-brand h1{font-size:1.9rem}.login-brand p{display:none}}

/* ---------- 공통 레이아웃 ---------- */
.eyebrow{display:inline-block;font-size:.72rem;letter-spacing:.14em;font-weight:800;color:var(--blue);margin-bottom:.55rem}
.page-heading{display:flex;justify-content:space-between;align-items:end;gap:1rem;margin-bottom:1.5rem}
.page-heading h1{font-weight:800;margin:0 0 .35rem}
.page-heading p{color:var(--muted);margin:0}
.panel{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:1.35rem;box-shadow:0 2px 6px rgba(15,52,69,.03)}
.panel-header{display:flex;justify-content:space-between;align-items:start;gap:1rem}
.panel-title{font-size:1.05rem;font-weight:800;margin:0;letter-spacing:-.025em}
.panel-subtitle{font-size:.88rem;color:var(--muted);margin:.25rem 0 0}

/* ---------- 히어로 ---------- */
.hero-panel{border-radius:24px;padding:2.2rem;color:#fff;min-height:250px;display:flex;justify-content:space-between;align-items:center;gap:2rem;background:radial-gradient(circle at 88% 16%,rgba(40,212,214,.28),transparent 25%),linear-gradient(135deg,#08394f 0%,#0e6687 62%,#0f8f92 100%);box-shadow:var(--shadow);overflow:hidden;position:relative}
.hero-panel:after{content:"";position:absolute;width:360px;height:360px;border:70px solid rgba(255,255,255,.07);border-radius:50%;right:-130px;top:-120px}
.hero-panel>div{position:relative;z-index:1}
.hero-panel h2{font-size:clamp(1.7rem,3vw,2.6rem);font-weight:800;line-height:1.22;margin:.8rem 0;letter-spacing:-.04em}
.hero-panel p{max-width:680px;color:rgba(255,255,255,.84);font-size:1rem}
.hero-badge{display:inline-flex;gap:.45rem;align-items:center;background:rgba(255,255,255,.14);padding:.4rem .7rem;border-radius:99px;font-size:.8rem;font-weight:700}
.hero-panel .btn-light{color:var(--navy);font-weight:800}

/* ---------- 점수·통계 카드 ---------- */
.weight-card{background:#fbfdfe;border:1px solid var(--line);border-radius:14px;padding:1rem;height:100%;display:flex;flex-direction:column;gap:.3rem}
.weight-card strong{font-size:1.25rem;color:var(--blue)}
.weight-card span{font-size:.84rem;color:#475f6b;font-weight:650}
.metric-stack{display:grid;gap:.75rem;margin-top:1rem}
.metric-stack>div{display:flex;justify-content:space-between;padding:.8rem 0;border-bottom:1px solid var(--line)}
.metric-stack span{color:var(--muted)}
.metric-stack strong{font-size:1.08rem}
.score-note{font-size:.72rem;color:var(--muted)}

.app-table th{font-size:.76rem;text-transform:uppercase;letter-spacing:.03em;color:#57707b;font-weight:800;border-bottom-color:var(--line);white-space:nowrap;background:#f5f9fa}
.app-table td{border-bottom-color:#e7eef0;vertical-align:middle}
.app-table tbody tr:hover{background:#fafdfe}
.status-pill{display:inline-flex;align-items:center;padding:.25rem .55rem;border-radius:999px;font-size:.72rem;font-weight:800;background:#f1f4f5;color:#475f6b}
.status-completed,.status-approved{background:#e8f8ef;color:#147149}
.status-failed,.status-rejected{background:var(--soft-bad);color:#9a2832}
.status-analyzing,.status-researching,.status-collecting,.status-queued,.status-pending{background:var(--soft-warn);color:#8a5406}
.status-disabled{background:#eaecf0;color:#344054}
.empty-state{text-align:center;color:var(--muted);padding:2.8rem}
.empty-state i{font-size:2rem;display:block;margin-bottom:.6rem}

/* ---------- 새 분석 폼 ---------- */
.step-title{display:flex;gap:.9rem;align-items:start;margin-bottom:1.2rem}
.step-title>span{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:linear-gradient(135deg,var(--blue),var(--cyan));color:#fff;font-weight:800;flex:none;box-shadow:0 6px 15px rgba(17,121,165,.2)}
.step-title h2{font-size:1.05rem;font-weight:800;margin:.1rem 0}
.step-title p{font-size:.86rem;color:var(--muted);margin:0}
.segmented{display:flex;gap:.5rem;background:#eef3f5;padding:.35rem;border-radius:13px;width:max-content;max-width:100%}
.segmented label input{display:none}
.segmented label span{display:block;padding:.6rem .85rem;border-radius:10px;font-weight:700;font-size:.9rem;color:#667984;cursor:pointer}
.segmented label input:checked+span{background:#fff;color:var(--blue);box-shadow:0 2px 8px rgba(15,52,69,.09)}
.reference-box{background:#f8fbfc;border:1px dashed #b9d3da;border-radius:13px;padding:1rem}
.analysis-options{z-index:2}
.provider-list{display:grid;gap:.65rem}
.provider-card{display:flex;align-items:center;gap:.75rem;border:1px solid var(--line);border-radius:13px;padding:.8rem;cursor:pointer;background:#fff}
.provider-card:has(input:checked){border-color:var(--blue);background:var(--soft-blue);box-shadow:0 0 0 3px rgba(17,121,165,.1)}
.provider-card.disabled{opacity:.45;cursor:not-allowed}
.provider-card input{margin-right:.1rem}
.provider-icon{width:34px;height:34px;border-radius:10px;background:var(--navy);color:#fff;display:grid;place-items:center;font-weight:900}
.provider-card strong,.provider-card small{display:block}
.provider-card small{font-size:.74rem;color:var(--muted);margin-top:.15rem}
.research-note{display:flex;gap:.6rem;background:var(--soft-teal);border-radius:12px;padding:.8rem;color:#0b6f68;font-size:.83rem}
.research-note i{font-size:1.05rem}

/* ---------- 처리 중 ---------- */
.processing-card{max-width:820px;margin:5vh auto;background:#fff;border:1px solid var(--line);border-radius:26px;padding:3rem;text-align:center;box-shadow:var(--shadow)}
.processing-card h1{font-weight:800;font-size:1.65rem;margin:.6rem auto;max-width:650px}
.processing-card>p{color:var(--muted)}
.processing-orbit{width:100px;height:100px;margin:0 auto 1.6rem;position:relative}
.processing-orbit>div{position:absolute;inset:0;border-radius:50%;border:2px dashed #9fd2dc;animation:spin 7s linear infinite}
.processing-orbit span{position:absolute;inset:17px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,var(--blue),var(--cyan));color:#fff;font-size:1.6rem;box-shadow:0 15px 30px rgba(17,121,165,.25)}
@keyframes spin{to{transform:rotate(360deg)}}
.progress-thin{height:7px;background:#e4edef}
.progress-thin .progress-bar{background:linear-gradient(90deg,var(--blue),var(--cyan))}
.processing-steps{display:grid;grid-template-columns:repeat(4,1fr);gap:.5rem}
.processing-steps span{font-size:.78rem;color:#94a6ae;padding:.5rem}
.processing-steps span.active{color:var(--blue);font-weight:800}
.processing-steps span.done{color:var(--teal);font-weight:700}

/* ---------- 결과 화면 ---------- */
.score-hero{background:radial-gradient(circle at 85% 12%,rgba(40,212,214,.3),transparent 30%),linear-gradient(145deg,#08394f,#0e6687 70%,#0f8f92);border-radius:20px;color:#fff;padding:1.7rem;box-shadow:0 16px 35px rgba(11,64,87,.2)}
.score-hero>span{font-size:.82rem;color:#cdeef2;font-weight:700}
.score-comparison{display:flex;align-items:center;justify-content:space-between;margin:1rem 0}
.score-comparison div{display:flex;flex-direction:column}
.score-comparison small{color:#a8d8e2;font-weight:700}
.score-comparison strong{font-size:2.4rem;line-height:1}
.score-comparison .after strong{color:#9df0e5}
.score-delta{display:inline-block;padding:.35rem .65rem;background:rgba(255,255,255,.14);border-radius:999px;font-weight:750;font-size:.82rem}
.score-hero p{font-size:.76rem;color:#bfe3ea;margin:1rem 0 0}
.score-rows{display:grid;gap:.9rem}
.score-row-label{display:flex;justify-content:space-between;font-size:.82rem;margin-bottom:.35rem}
.score-row-label span{font-weight:650}
.score-row-label strong{font-size:.78rem;color:#667984}
.dual-bars{height:9px;background:#edf2f3;border-radius:99px;position:relative;overflow:hidden}
.dual-bars .bar{position:absolute;left:0;height:4px;border-radius:99px}
.dual-bars .before{top:0;background:#a3b6be}
.dual-bars .after{bottom:0;background:linear-gradient(90deg,var(--blue),var(--cyan))}
.intent-card{background:#f5fafb;border-radius:14px;padding:1rem}
.intent-card span{font-size:.75rem;color:var(--muted)}
.intent-card strong{font-size:1.25rem;display:block;margin:.15rem 0}
.intent-card p{color:#475f6b;margin:0;font-size:.9rem}
.keyword-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:.65rem}
.keyword-grid>div{border:1px solid var(--line);border-radius:12px;padding:.75rem;background:#fbfdfe}
.keyword-grid span,.keyword-grid strong{display:block}
.keyword-grid span{font-size:.72rem;color:var(--muted)}
.keyword-grid strong{font-size:.9rem;margin-top:.2rem}
.recommendation-list{padding-left:1.2rem}
.recommendation-list li{padding:.55rem 0;border-bottom:1px solid var(--line);color:#344f5d}
.recommendation-list li::marker{color:var(--blue);font-weight:900}

/* ---------- 문제 표시 ---------- */
.issue-legend{display:flex;gap:.4rem;flex-wrap:wrap}
.issue-legend span{font-size:.7rem;font-weight:750;border-radius:99px;padding:.25rem .55rem}
.issue-legend .red{background:#fee4e2;color:#b42318}
.issue-legend .orange{background:#ffead5;color:#b54708}
.issue-legend .yellow{background:#fef0c7;color:#93370d}
.issue-legend .blue{background:#d1e9ff;color:#175cd3}
.issue-legend .purple{background:#ebe9fe;color:#5925dc}
.source-preview{white-space:pre-wrap;line-height:1.9;background:#fafbfc;border:1px solid var(--line);border-radius:14px;padding:1.2rem;max-height:520px;overflow:auto;margin-top:1rem}
.source-preview mark{border-radius:4px;padding:.05em .12em;cursor:help}
.issue-red{background:#fecdc9}.issue-orange{background:#fedfbd}.issue-yellow{background:#fef0c7}.issue-blue{background:#d1e9ff}.issue-purple{background:#ddd6fe}
.issue-dot{display:inline-block;width:12px;height:12px;border-radius:50%}
.issue-dot.red{background:var(--danger)}.issue-dot.orange{background:var(--warning)}.issue-dot.yellow{background:var(--yellow)}.issue-dot.blue{background:var(--blue-issue)}.issue-dot.purple{background:var(--purple)}
.suggestion{background:#f1f5f6;padding:.55rem;border-radius:8px;font-size:.82rem;color:#344f5d}

/* ---------- 편집기·수정 채팅 ---------- */
.editor-textarea{font-family:Pretendard,"Noto Sans KR",sans-serif;line-height:1.9;font-size:.98rem;min-height:760px}
.revision-chat{border:1px solid #cce6eb;background:#f2fafc;border-radius:16px;padding:1rem}
.chat-head{display:flex;gap:.7rem;align-items:center}
.chat-head>i{width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:linear-gradient(135deg,var(--navy),var(--blue));color:#fff}
.chat-head strong,.chat-head span{display:block}
.chat-head span{font-size:.78rem;color:var(--muted)}
.source-list{display:grid;gap:.7rem}
.source-list article{display:flex;justify-content:space-between;gap:1rem;padding:.9rem;border:1px solid var(--line);border-radius:13px;background:#fff}
.source-list article span{font-size:.7rem;color:var(--muted)}
.source-list article h3{font-size:.95rem;font-weight:750;margin:.2rem 0}
.source-list article p{font-size:.83rem;color:#475f6b;margin:0}
.source-list article small{display:block;margin-top:.4rem;color:#667984}
.version-list{display:grid;gap:.55rem}
.version-list>div{display:flex;gap:.7rem;align-items:center;border:1px solid var(--line);padding:.65rem;border-radius:11px;background:#fff}
.version-list>div>span{width:34px;height:34px;border-radius:9px;background:var(--soft-blue);color:var(--blue);display:grid;place-items:center;font-weight:800}
.version-list>div>div{flex:1;min-width:0}
.version-list strong,.version-list small{display:block}
.version-list strong{font-size:.82rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.version-list small{font-size:.7rem;color:var(--muted)}
.usage-footnote{text-align:center;font-size:.76rem;color:var(--muted);padding:1rem}

/* ---------- 관리자 ---------- */
.admin-tabs{display:flex;gap:.45rem;overflow:auto;padding-bottom:.2rem}
.admin-tabs a{white-space:nowrap;text-decoration:none;color:#475f6b;border:1px solid var(--line);background:#fff;border-radius:10px;padding:.55rem .75rem;font-size:.82rem;font-weight:700}
.admin-tabs a:hover{color:var(--blue);border-color:#a9c2cb}
.admin-stat{background:#fff;border:1px solid var(--line);border-radius:15px;padding:1rem;display:grid;grid-template-columns:auto 1fr;gap:.2rem .7rem;align-items:center}
.admin-stat i{grid-row:1/3;width:38px;height:38px;display:grid;place-items:center;border-radius:11px;background:var(--soft-blue);color:var(--blue)}
.admin-stat span{font-size:.75rem;color:var(--muted)}
.admin-stat strong{font-size:1.3rem}
.pricing-card{border:1px solid var(--line);border-radius:14px;padding:1rem;background:#fff}
.pricing-card strong,.pricing-card small{display:block}
.pricing-card small{color:var(--muted)}
.pricing-card label{font-size:.7rem;color:var(--muted)}
.layout-sortable{display:grid;gap:.6rem}
.layout-item{display:flex;align-items:center;gap:.7rem;border:1px solid var(--line);background:#fbfdfe;padding:.8rem;border-radius:12px;cursor:grab}
.layout-item:active{cursor:grabbing}
.layout-item>span{font-weight:700}
.layout-item>i{color:#94a6ae}
.usage-card{height:100%;background:#fff;border:1px solid var(--line);border-radius:16px;padding:1.1rem}
.usage-card>span{font-size:.72rem;text-transform:uppercase;color:var(--blue);font-weight:800}
.usage-card h2{font-size:1rem;font-weight:800;margin:.2rem 0 1rem}
.usage-card>div{display:flex;justify-content:space-between;border-bottom:1px solid var(--line);padding:.45rem 0}
.usage-card small{color:var(--muted)}
.usage-card footer{margin-top:.8rem;font-weight:750;color:#344f5d}
.log-text{max-width:300px;white-space:normal}
.font-monospace{font-size:.78rem}

/* ---------- Bootstrap 오버라이드 ---------- */
.btn-primary{background:linear-gradient(135deg,var(--navy),var(--blue));border-color:transparent;box-shadow:0 8px 18px rgba(17,121,165,.18);font-weight:700}
.btn-primary:hover{background:linear-gradient(135deg,#093347,#0e6b93);border-color:transparent}
.btn-outline-primary{color:var(--blue);border-color:#a9c8d4}
.btn-outline-primary:hover{background:var(--blue);border-color:var(--blue)}
.form-control,.form-select{border-color:#d2e0e5;border-radius:10px}
.form-control:focus,.form-select:focus{border-color:var(--blue);box-shadow:0 0 0 .22rem rgba(17,121,165,.1)}
.text-success{color:#147149!important}

@media(max-width:768px){.hero-panel{padding:1.5rem;min-height:300px;align-items:flex-start;flex-direction:column}.hero-panel h2{font-size:1.8rem}.keyword-grid{grid-template-columns:1fr}.processing-card{padding:1.5rem}.processing-steps{grid-template-columns:1fr 1fr}.panel{padding:1rem}.source-preview{font-size:.9rem}.editor-textarea{min-height:600px}.page-heading{align-items:start}.issue-legend{margin-top:.5rem}.brand-name{font-size:.92rem}.user-chip{display:none}}

/* v2.2 instant diagnostic */
.quick-live-label{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border-radius:999px;background:#e8f7f5;color:#0b6f68;font-size:10px;font-weight:900;border:1px solid #c1e7e0}
.quick-analysis-panel{border-color:#bfd8df;background:linear-gradient(180deg,#fff,#fbfeff)}
.quick-analysis-head{display:flex;align-items:start;justify-content:space-between;gap:12px}.quick-api-badge{font-size:9px;font-weight:900;color:#0b6f68;background:#e8f7f5;border:1px solid #c6e9e6;border-radius:999px;padding:5px 8px}.quick-empty{text-align:center;padding:24px 8px;color:var(--tsca-muted)}.quick-empty i{display:block;font-size:30px;color:var(--tsca-blue);margin-bottom:10px}.quick-empty strong{display:block;color:var(--tsca-ink);font-size:13px}.quick-empty p{font-size:11px;margin:6px auto 0;max-width:310px}.quick-loading{display:flex;align-items:center;justify-content:center;gap:8px;padding:28px;color:var(--tsca-muted);font-size:11px}
.quick-score-top{display:grid;grid-template-columns:auto 1fr;gap:16px;align-items:center;margin-top:14px}.quick-score-ring{--score:0;width:92px;height:92px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--tsca-cyan) calc(var(--score)*1%),#e8eff2 0);position:relative}.quick-score-ring:after{content:"";position:absolute;inset:8px;border-radius:50%;background:#fff}.quick-score-ring>div{position:relative;z-index:1;text-align:center}.quick-score-ring strong{font-size:26px;line-height:1;color:var(--tsca-navy)}.quick-score-ring span{display:block;font-size:9px;color:var(--tsca-muted);margin-top:3px}.quick-score-summary>span{font-size:10px;color:var(--tsca-muted)}.quick-score-summary>strong{display:block;font-size:16px;margin:3px 0;color:var(--tsca-navy)}.quick-score-summary>p{font-size:10px;line-height:1.55;color:#5f7480;margin:0}
.quick-keywords{display:flex;gap:5px;flex-wrap:wrap;margin:14px 0}.quick-keywords span{font-size:9px;padding:4px 7px;border-radius:999px;background:#f0f4f6;color:#4c6470}.quick-keywords span.main{background:var(--tsca-info-soft);color:var(--tsca-blue);font-weight:900}.quick-score-bars{display:grid;gap:8px}.quick-score-row>div:first-child{display:flex;justify-content:space-between;gap:10px;font-size:10px}.quick-score-row span{color:#566f7b}.quick-score-row strong{color:var(--tsca-ink)}.quick-track{height:5px;background:#eaf0f2;border-radius:999px;overflow:hidden;margin-top:4px}.quick-track i{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,var(--tsca-blue),var(--tsca-cyan))}.quick-readiness-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:14px}.quick-readiness-grid>div{padding:9px;border:1px solid var(--tsca-line);border-radius:10px;background:#fbfdfe;display:flex;justify-content:space-between;align-items:center;gap:6px}.quick-readiness-grid span{font-size:9px;color:var(--tsca-muted)}.quick-readiness-grid strong{font-size:12px;color:var(--tsca-navy)}
.quick-warning-summary{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}.quick-warning-summary span{font-size:9px;font-weight:850;border-radius:999px;padding:5px 7px}.quick-warning-summary .required{background:#fff0ef;color:#a72e2a}.quick-warning-summary .review{background:#fff6dc;color:#8b5900}.quick-warning-summary .auto{background:#ebf7fb;color:#126a8b}.quick-details{border-top:1px solid var(--tsca-line);margin-top:12px;padding-top:12px}.quick-improvements h3{font-size:11px;font-weight:900}.quick-improvements ol{padding-left:18px;margin-bottom:10px}.quick-improvements li{font-size:10px;color:#536a75;padding:3px 0;line-height:1.45}.quick-issues{display:grid;gap:6px}.quick-issue-card{width:100%;text-align:left;border:1px solid var(--tsca-line);background:#fff;border-radius:10px;padding:9px 10px}.quick-issue-card span,.quick-issue-card small{display:block;font-size:9px;color:var(--tsca-muted)}.quick-issue-card strong{display:block;font-size:10px;margin:3px 0;color:var(--tsca-ink)}.quick-issue-card.severity-required{border-left:3px solid #d92d20}.quick-issue-card.severity-review{border-left:3px solid #f79009}.quick-issue-card.severity-auto{border-left:3px solid #2e90fa}.quick-disclaimer{font-size:9px;color:#7a909b;line-height:1.5;margin:12px 0 0}.issue-modal .modal-header{border-bottom:1px solid var(--tsca-line)}.issue-modal-meta{display:flex;gap:6px;margin-bottom:14px}.issue-modal-meta span{padding:5px 8px;border-radius:999px;background:#eef4f6;font-size:10px;font-weight:800}.issue-modal label{display:block;font-size:10px;font-weight:900;color:#526a76;margin:13px 0 5px}.issue-modal-quote,.issue-modal-suggestion{border-radius:11px;padding:12px;background:#f8fbfc;border:1px solid var(--tsca-line);white-space:pre-wrap;font-size:12px}.issue-modal-suggestion{background:var(--tsca-success-soft);color:#0b655f}.issue-modal p{font-size:12px;color:#4e6570;line-height:1.7}.live-rescore-box{border:1px solid #b9dfda;background:#f0fbf8;border-radius:12px;padding:11px 13px;display:flex;align-items:center;gap:10px}.live-rescore-box strong{font-size:20px;color:#0d756e}.live-rescore-box span{font-size:10px;color:#52716f}
@media(max-width:1199px){.analysis-options{position:static!important}.quick-analysis-panel{max-width:none}}
.result-issue-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.result-issue-card{text-align:left;border:1px solid var(--tsca-line);border-radius:12px;background:#fff;padding:12px 13px}.result-issue-card:hover{box-shadow:var(--tsca-shadow-soft);transform:translateY(-1px)}.result-issue-card span,.result-issue-card small{display:block;font-size:10px;color:var(--tsca-muted)}.result-issue-card strong{display:block;font-size:12px;color:var(--tsca-ink);margin:4px 0}.result-issue-card.severity-required{border-left:4px solid #d92d20}.result-issue-card.severity-review{border-left:4px solid #f79009}.result-issue-card.severity-auto{border-left:4px solid #2e90fa}.diagnostic-readiness-row .weight-card strong{font-size:18px}@media(max-width:768px){.result-issue-cards{grid-template-columns:1fr}}

/* ============================================================
   v3.0 coherence layer — single design token map
   ============================================================ */
:root{
  --tsca-ink:var(--ink);
  --tsca-muted:var(--muted);
  --tsca-line:var(--line);
  --tsca-navy:var(--navy);
  --tsca-blue:var(--blue);
  --tsca-cyan:var(--cyan);
  --tsca-teal:var(--teal);
  --tsca-info-soft:var(--soft-blue);
  --tsca-success-soft:var(--soft-teal);
  --tsca-shadow-soft:0 7px 22px rgba(15,52,69,.07);
}
body{font-family:"Noto Sans KR","Apple SD Gothic Neo",system-ui,-apple-system,sans-serif}
.studio-display{font-family:"Anton","Arial Narrow",sans-serif!important;letter-spacing:.015em!important;font-weight:400!important}
.brand-name.studio-display{font-size:1.15rem}
.login-brand h1.studio-display{font-size:2.9rem;line-height:1.03;letter-spacing:.01em!important}
.compact-heading{min-height:92px;display:flex;align-items:center;max-width:1540px;margin-left:auto;margin-right:auto}
.compact-heading h1{font-size:clamp(1.65rem,2.4vw,2.15rem);letter-spacing:-.035em}
.compact-heading p{font-size:.92rem}
.analysis-workspace{max-width:1540px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1.45fr) minmax(355px,.62fr);gap:18px;align-items:start}
.analysis-stack{display:grid;gap:18px}
.analysis-options{position:sticky;top:88px}
.tsca-notice{padding:.8rem .9rem;border-radius:12px;border:1px solid var(--line);font-size:.82rem}
.tsca-notice--info{background:#edf7fb;border-color:#c7e1eb;color:#3f6472}
.tsca-notice--success{background:#edf9f5;border-color:#c7e8dc;color:#24675d}
.tsca-notice--danger{background:#fff1f1;border-color:#f0cccc;color:#943a42}
.source-preview-card{border:1px solid #c7dedf;border-radius:14px;padding:1rem;background:linear-gradient(180deg,#fff,#f8fcfc)}
.source-preview-card h3{font-size:1rem;font-weight:800;margin:.15rem 0 .3rem}.source-preview-card p{font-size:.8rem;color:var(--muted)}
.app-message-modal{border:0;border-radius:18px;box-shadow:0 24px 70px rgba(11,64,87,.18)}
@media(max-width:1199px){.analysis-workspace{grid-template-columns:1fr}.analysis-options{position:static}.compact-heading{min-height:auto}}
@media(max-width:768px){.login-brand h1.studio-display{font-size:2.1rem}.brand-name.studio-display{font-size:1rem}.compact-heading h1{font-size:1.65rem}.analysis-workspace{gap:12px}.input-group-lg>.form-control,.input-group-lg>.btn{font-size:.95rem}}

/* v3.1.0: visible AI revision progress + single-submit layout */
.revision-form{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.65rem;align-items:stretch}
.revision-form .btn{min-width:190px;white-space:nowrap}
.revision-progress{display:flex;gap:.55rem;align-items:center;color:var(--tsca-muted,#64748b);font-size:.9rem}
@media (max-width:720px){.revision-form{grid-template-columns:1fr}.revision-form .btn{width:100%}}

/* ============================================================
   v4.0 unified Content Studio shell
   ============================================================ */
body{min-height:100vh}
.app-shell{min-height:100vh;display:grid;grid-template-columns:272px minmax(0,1fr)}
.app-sidebar{position:fixed;inset:0 auto 0 0;width:272px;z-index:1040;display:flex;flex-direction:column;background:linear-gradient(180deg,#092f41,#0b4057 58%,#0b374b);color:#fff;border-right:1px solid rgba(255,255,255,.08);box-shadow:12px 0 36px rgba(8,47,65,.1)}
.sidebar-brand{display:flex;align-items:center;gap:12px;padding:20px 18px;color:#fff;text-decoration:none;border-bottom:1px solid rgba(255,255,255,.1)}
.sidebar-brand:hover{color:#fff}
.sidebar-brand img{width:46px;height:46px;object-fit:cover;border-radius:14px;box-shadow:0 10px 28px rgba(0,0,0,.2)}
.sidebar-brand span,.sidebar-brand strong,.sidebar-brand small{display:block}
.sidebar-brand strong{font-size:1.04rem;line-height:1.1;letter-spacing:.03em!important}
.sidebar-brand small{margin-top:4px;color:#a9d6df;font-size:.68rem;letter-spacing:.13em;font-weight:700}
.sidebar-brand small b{letter-spacing:0;color:#8de5dc;background:rgba(141,229,220,.1);padding:2px 5px;border-radius:99px}
.sidebar-nav{flex:1;overflow:auto;padding:16px 12px}
.sidebar-group{display:grid;gap:4px;margin-bottom:18px}
.sidebar-label{padding:0 11px 6px;color:#79aeb9;font-size:.62rem;font-weight:900;letter-spacing:.15em}
.sidebar-nav a{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:11px;color:#cce1e6;text-decoration:none;font-size:.86rem;font-weight:650;transition:.15s ease}
.sidebar-nav a i{width:20px;text-align:center;font-size:1rem;color:#8fc3ce}
.sidebar-nav a:hover{background:rgba(255,255,255,.08);color:#fff}
.sidebar-nav a.active{background:linear-gradient(135deg,rgba(29,183,189,.27),rgba(17,121,165,.34));color:#fff;box-shadow:inset 0 0 0 1px rgba(141,229,220,.18)}
.sidebar-nav a.active i{color:#8df0e8}
.sidebar-user{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 15px;border-top:1px solid rgba(255,255,255,.1);background:rgba(0,0,0,.08)}
.sidebar-user-info{display:flex;align-items:center;gap:10px;min-width:0}
.sidebar-user-info>i{font-size:1.55rem;color:#92cbd4}
.sidebar-user-info span,.sidebar-user-info strong,.sidebar-user-info small{display:block;min-width:0}
.sidebar-user-info strong{max-width:145px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.8rem}
.sidebar-user-info small{color:#86adb6;font-size:.66rem}
.sidebar-user form{margin:0}
.sidebar-user button{width:34px;height:34px;border:0;border-radius:9px;background:rgba(255,255,255,.08);color:#b9d8df}
.sidebar-user button:hover{background:rgba(255,255,255,.14);color:#fff}
.app-main{grid-column:2;min-width:0;min-height:100vh;display:flex;flex-direction:column}
.app-main>main{flex:1;width:100%}
.mobile-topbar{display:none}
.sidebar-backdrop{display:none}
.app-main .compact-heading{max-width:1540px}

/* Dashboard split */
.studio-switch-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.studio-switch-grid>.studio-switch-card:only-child{grid-column:1/-1}
.studio-switch-card{position:relative;overflow:hidden;min-height:210px;border-radius:22px;padding:1.7rem;color:#fff;text-decoration:none;display:flex;flex-direction:column;justify-content:space-between;box-shadow:var(--shadow)}
.studio-switch-card:hover{color:#fff;transform:translateY(-2px)}
.studio-switch-card.blog{background:radial-gradient(circle at 90% 10%,rgba(57,216,209,.35),transparent 28%),linear-gradient(135deg,#08394f,#1179a5)}
.studio-switch-card.script{background:radial-gradient(circle at 90% 10%,rgba(90,222,211,.28),transparent 28%),linear-gradient(135deg,#0a394a,#0d8b8a)}
.studio-switch-card:after{content:"";position:absolute;width:210px;height:210px;border:45px solid rgba(255,255,255,.07);border-radius:50%;right:-65px;top:-75px}
.studio-switch-card>*{position:relative;z-index:1}
.studio-switch-card .switch-icon{width:46px;height:46px;border-radius:14px;background:rgba(255,255,255,.14);display:grid;place-items:center;font-size:1.3rem}
.studio-switch-card h2{font-size:1.55rem;font-weight:850;margin:.8rem 0 .35rem}
.studio-switch-card p{margin:0;color:rgba(255,255,255,.78);font-size:.86rem;max-width:520px}
.studio-switch-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:1rem}
.studio-switch-meta span{padding:5px 8px;border-radius:99px;background:rgba(255,255,255,.12);font-size:.7rem;font-weight:750}

/* Script Lab */
.script-save-state{display:inline-flex;align-items:center;gap:7px;border:1px solid #c6e5df;background:#eef9f6;color:#287068;border-radius:99px;padding:7px 11px;font-size:.72rem;font-weight:800}
.script-save-state.saving{background:#eef6fa;border-color:#c8dee8;color:#2d687e}
.script-save-state.error{background:#fff0f1;border-color:#efc7cb;color:#a83b45}
.script-workflow{max-width:1540px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1.12fr) minmax(350px,.72fr);gap:18px;align-items:start}
.script-editor-panel{grid-column:1}
.transcript-collector-status{display:flex;align-items:center;gap:9px;border:1px solid #d5e3e7;border-radius:12px;background:#f7fafb;padding:9px 11px;color:#536d78;font-size:.72rem}
.collector-badge{display:inline-flex;align-items:center;gap:5px;flex:none;border-radius:99px;padding:4px 8px;font-size:.64rem;font-weight:850}
.collector-badge.online{background:#e7f7f2;color:#176a5c}
.collector-badge.offline{background:#fff1e7;color:#9a570c}
.script-youtube-set{padding:14px;border:1px solid #cbdde4;border-radius:14px;background:#f9fcfd}
.script-input-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px;align-items:stretch}
.script-input-row button{min-width:145px}
.source-divider{display:flex;align-items:center;gap:10px;margin:18px 0 12px;color:var(--muted);font-size:.7rem;font-weight:800}
.source-divider:before,.source-divider:after{content:"";height:1px;background:var(--line);flex:1}
.manual-source-box{border:1px dashed #b9d3da;border-radius:13px;background:#f8fbfc;padding:11px 13px}
.manual-source-box summary{cursor:pointer;color:#486572;font-size:.82rem;font-weight:800;list-style:none}
.manual-source-box summary::-webkit-details-marker{display:none}
.manual-source-box summary i{color:var(--blue);margin-right:6px}
.script-source-list{display:grid;gap:8px}
.script-source-item{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:10px;padding:10px;border:1px solid var(--line);border-radius:12px;background:#fff}
.script-source-item.excluded{opacity:.55;background:#f6f8f9}
.script-source-item.transcript-pending{border-style:dashed;background:#fbfdfe}
.source-item-icon{width:38px;height:38px;border-radius:11px;background:var(--soft-blue);color:var(--blue);display:grid;place-items:center;font-size:1.05rem}
.source-item-body{min-width:0}
.source-item-body strong,.source-item-body span,.source-item-body small{display:block}
.source-item-body strong{font-size:.82rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.source-item-body span{font-size:.68rem;color:var(--muted)}
.source-item-body>div{display:flex;align-items:center;gap:7px;min-width:0}
.source-role{flex:none;border-radius:99px;background:#eaf5f8;color:#286a83;padding:3px 6px;font-size:.58rem;font-style:normal;font-weight:850}
.source-role.main{background:#e8f7f3;color:#126b5d}
.transcript-state{flex:none;border-radius:99px;background:#edf4f7;color:#496975;padding:3px 6px;font-size:.58rem;font-style:normal;font-weight:850}
.transcript-state--processing{background:#e8f4fb;color:#216c8b}
.transcript-state--retry_wait{background:#fff4df;color:#91600d}
.transcript-state--no_transcript,.transcript-state--failed{background:#fff0f1;color:#9a3d47}
.source-item-body .source-warning{font-size:.67rem;color:#9b5c07;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.source-include{display:flex;align-items:center;gap:5px;font-size:.67rem;font-weight:750;color:#536d78}
.source-delete{width:30px;height:30px;border:0;border-radius:8px;background:#f2f5f6;color:#70828a}
.source-delete:hover{background:#fff0f1;color:var(--danger)}
.script-empty{padding:1.3rem}
.web-research-toggle{display:flex;align-items:flex-start;gap:10px;border:1px solid #c9e4e1;border-radius:13px;background:#f0faf8;padding:12px;cursor:pointer}
.web-research-toggle span,.web-research-toggle strong,.web-research-toggle small{display:block}
.web-research-toggle strong{font-size:.83rem}
.web-research-toggle small{font-size:.69rem;color:#5e7d79;margin-top:2px}
.topic-suggestion-list{display:grid;gap:7px}
.topic-suggestion-list button{display:flex;align-items:flex-start;gap:8px;width:100%;border:1px solid #c9dfe6;border-radius:11px;background:#f8fcfd;color:#365b69;padding:9px 10px;text-align:left;font-size:.76rem;font-weight:700}
.topic-suggestion-list button:hover{border-color:var(--blue);background:#eef8fb;color:var(--navy)}
.topic-suggestion-list button span{flex:none;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;background:var(--blue);color:#fff;font-size:.62rem}
.script-editor{min-height:880px;resize:vertical;line-height:1.9;font-size:.96rem;padding:1.15rem}
.script-revision-tools{border:1px solid #cce6eb;background:#f5fbfc;border-radius:14px;padding:12px}
.quick-revision-buttons{display:flex;gap:7px;flex-wrap:wrap}
.quick-revision-buttons button{border:1px solid #c8dce4;background:#fff;color:#46626e;border-radius:99px;padding:6px 10px;font-size:.7rem;font-weight:750}
.quick-revision-buttons button:hover{border-color:var(--blue);color:var(--blue)}
.script-revision-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;margin-top:10px}
.script-revision-row button{min-width:120px}
.script-quality{border-top:1px solid var(--line);padding-top:14px}
.script-quality>div>span{color:var(--teal);font-weight:900}
.quality-check-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}
.quality-check-grid span{display:flex;align-items:center;gap:6px;padding:8px;border-radius:9px;background:#f2f5f6;color:#7b8e96;font-size:.7rem;font-weight:700}
.quality-check-grid span.pass{background:#e9f8f3;color:#176d5c}
.script-library-grid{max-width:1540px;margin:0 auto;display:grid;grid-template-columns:1fr 1fr;gap:18px}
.script-style-editor{min-height:560px;line-height:1.75;resize:vertical}
.style-library-stack{max-width:1180px;margin:0 auto;display:grid;gap:18px}
.style-rule-editor{min-height:560px;line-height:1.75;resize:vertical}
.sample-content-editor{min-height:310px;line-height:1.75;resize:vertical}
.saved-sample-list{display:grid;gap:8px}
.saved-sample-list>div{display:flex;align-items:center;gap:9px;border:1px solid var(--line);border-radius:11px;background:#fbfdfe;padding:10px 12px}
.saved-sample-list i{color:var(--teal)}
.saved-sample-list strong{flex:1;font-size:.84rem}
.saved-sample-list span{color:var(--muted);font-size:.68rem;font-weight:750}
.sample-management-list{display:grid;gap:14px}
.sample-management-list article{position:relative;border:1px solid var(--line);border-radius:14px;background:#f9fbfc;padding:14px}
.sample-delete-form{position:absolute;right:14px;bottom:14px}
.revision-memory-list{display:grid;gap:8px;max-height:520px;overflow:auto}
.revision-memory-list article{border-left:3px solid #8ccfd1;border-radius:0 10px 10px 0;background:#f8fbfc;padding:10px 12px}
.revision-memory-list span,.revision-memory-list small{display:block;color:var(--muted);font-size:.66rem}
.revision-memory-list p{margin:3px 0;font-size:.8rem;white-space:pre-wrap}
.permission-form{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:360px}
.permission-form label{display:flex;align-items:center;gap:5px;white-space:nowrap;font-size:.76rem;font-weight:700}
.permission-table th,.permission-table td{vertical-align:middle}
.sticky-save{grid-column:1/-1;position:sticky;bottom:14px;display:flex;justify-content:flex-end;z-index:10;pointer-events:none}
.sticky-save button{pointer-events:auto;min-width:190px;box-shadow:0 15px 35px rgba(11,64,87,.24)}
.source-library-grid{max-width:1540px;margin:0 auto;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.source-library-card{display:flex;flex-direction:column;min-height:260px}
.source-library-card h2{font-size:1rem;font-weight:850;margin:13px 0 8px}
.source-library-card p{font-size:.78rem;color:#536b76;line-height:1.65}
.source-library-card>div>small{color:var(--muted);font-size:.65rem}
.source-kind{display:inline-flex;align-items:center;gap:5px;width:max-content;border-radius:99px;background:var(--soft-blue);color:var(--blue);padding:4px 8px;font-size:.65rem;font-weight:850;text-transform:uppercase}
.source-kind-youtube{background:#fff0f1;color:#b4232c}
.source-url{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:.68rem}

@media(max-width:1100px){
  .app-shell{grid-template-columns:1fr}
  .app-sidebar{transform:translateX(-105%);transition:transform .2s ease}
  .app-sidebar.open{transform:translateX(0)}
  .app-main{grid-column:1}
  .mobile-topbar{position:sticky;top:0;z-index:1030;height:62px;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 14px;background:rgba(255,255,255,.95);border-bottom:1px solid var(--line);backdrop-filter:blur(14px)}
  .mobile-topbar>button{width:38px;height:38px;border:0;border-radius:10px;background:var(--soft-blue);color:var(--navy);font-size:1.3rem}
  .mobile-topbar>a{display:flex;align-items:center;gap:8px;min-width:0;color:var(--navy);text-decoration:none}
  .mobile-topbar img{width:36px;height:36px;border-radius:10px;object-fit:cover}
  .mobile-topbar strong{font-size:.9rem;white-space:nowrap}
  .sidebar-backdrop{position:fixed;inset:0;z-index:1035;background:rgba(5,24,34,.48);backdrop-filter:blur(2px)}
  .sidebar-backdrop.show{display:block}
  .script-workflow{grid-template-columns:1fr}
  .script-editor-panel{grid-column:auto}
  .source-library-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:720px){
  .app-main>main{padding:18px 12px!important}
  .mobile-topbar strong{font-size:.78rem}
  .mobile-topbar .version-badge{display:none}
  .studio-switch-grid,.script-library-grid,.source-library-grid{grid-template-columns:1fr}
  .studio-switch-card{min-height:190px;padding:1.35rem}
  .script-input-row,.script-revision-row{grid-template-columns:1fr}
  .script-input-row button,.script-revision-row button{width:100%}
  .script-source-item{grid-template-columns:auto minmax(0,1fr) auto}
  .source-include{grid-column:2}
  .source-delete{grid-column:3;grid-row:1}
  .script-editor{min-height:520px}
  .quality-check-grid{grid-template-columns:1fr 1fr}
  .script-save-state{margin-top:8px}
  .page-heading{display:block}
}
