:root { --navy:#152a4a; --navy-light:#1e3a5f; --gold:#c9a227; }
* { box-sizing: border-box; }
body { margin:0; -webkit-font-smoothing:antialiased; }

.hero-gradient { background: linear-gradient(135deg, #0d1b33 0%, #152a4a 50%, #1e3a5f 100%); }
.gold-text { color: var(--gold); }
.gold-border { border-color: var(--gold); }

.btn { display:inline-flex; align-items:center; justify-content:center; gap:.5rem; font-weight:600; border-radius:.6rem; transition:all .18s; cursor:pointer; border:none; }
.btn-primary { background:var(--navy); color:#fff; padding:.7rem 1.4rem; }
.btn-primary:hover { background:var(--navy-light); transform:translateY(-1px); }
.btn-gold { background:var(--gold); color:#152a4a; padding:.7rem 1.4rem; }
.btn-gold:hover { background:#b8921f; }
.btn-outline { background:transparent; border:1.5px solid var(--navy); color:var(--navy); padding:.65rem 1.3rem; }
.btn-outline:hover { background:var(--navy); color:#fff; }
.btn-ghost { background:transparent; color:#475569; padding:.5rem 1rem; }
.btn-ghost:hover { background:#f1f5f9; }
.btn:disabled { opacity:.5; cursor:not-allowed; transform:none !important; }

.card { background:#fff; border:1px solid #e2e8f0; border-radius:1rem; box-shadow:0 1px 3px rgba(0,0,0,.06); transition:all .2s; }
.card-hover:hover { box-shadow:0 8px 24px rgba(21,42,74,.12); transform:translateY(-2px); border-color:#cbd5e1; }

.input { width:100%; padding:.65rem .85rem; border:1.5px solid #cbd5e1; border-radius:.55rem; font-size:.95rem; transition:border .15s; background:#fff; }
.input:focus { outline:none; border-color:var(--navy-light); box-shadow:0 0 0 3px rgba(30,58,95,.1); }
label.field-label { display:block; font-weight:600; font-size:.85rem; color:#334155; margin-bottom:.35rem; }

.badge { display:inline-flex; align-items:center; padding:.2rem .6rem; border-radius:999px; font-size:.72rem; font-weight:600; }
.badge-gold { background:#fef3c7; color:#92400e; }
.badge-navy { background:#dbeafe; color:#1e3a5f; }
.badge-green { background:#dcfce7; color:#166534; }
.badge-red { background:#fee2e2; color:#991b1b; }
.badge-gray { background:#f1f5f9; color:#475569; }

.sidebar-link { display:flex; align-items:center; gap:.7rem; padding:.7rem .9rem; border-radius:.6rem; color:#cbd5e1; font-weight:500; transition:all .15s; cursor:pointer; }
.sidebar-link:hover { background:rgba(255,255,255,.08); color:#fff; }
.sidebar-link.active { background:var(--gold); color:#152a4a; font-weight:700; }

.toast { padding:.9rem 1.2rem; border-radius:.6rem; color:#fff; font-weight:500; box-shadow:0 6px 20px rgba(0,0,0,.2); min-width:260px; animation:slideIn .25s; }
.toast-success { background:#16a34a; } .toast-error { background:#dc2626; } .toast-info { background:#1e3a5f; }
@keyframes slideIn { from{opacity:0;transform:translateX(40px);} to{opacity:1;transform:translateX(0);} }

.modal-overlay { position:fixed; inset:0; background:rgba(13,27,51,.55); display:flex; align-items:center; justify-content:center; z-index:1000; padding:1rem; animation:fadeIn .15s; }
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }
.modal-box { background:#fff; border-radius:1rem; max-width:560px; width:100%; max-height:90vh; overflow-y:auto; box-shadow:0 20px 60px rgba(0,0,0,.3); }

.spinner { width:18px; height:18px; border:2.5px solid rgba(255,255,255,.4); border-top-color:#fff; border-radius:50%; animation:spin .7s linear infinite; }
.spinner-dark { border:2.5px solid rgba(21,42,74,.2); border-top-color:#152a4a; }
@keyframes spin { to{transform:rotate(360deg);} }

.ethics-warn { background:#fffbeb; border-left:4px solid var(--gold); padding:.8rem 1rem; border-radius:.4rem; font-size:.85rem; color:#78350f; }
.ai-output { line-height:1.75; font-size:.95rem; color:#1e293b; }
.ai-output .flag { background:#fee2e2; color:#991b1b; padding:0 .2rem; border-radius:3px; font-weight:600; }
/* 마크다운 렌더링 스타일 (박사급 학술 출력) */
.ai-output h1 { font-size:1.35rem; font-weight:700; color:#152a4a; margin:1.1rem 0 .6rem; padding-bottom:.3rem; border-bottom:2px solid #e2e8f0; }
.ai-output h2 { font-size:1.18rem; font-weight:700; color:#152a4a; margin:1rem 0 .5rem; padding-bottom:.25rem; border-bottom:1px solid #eef2f9; }
.ai-output h3 { font-size:1.05rem; font-weight:600; color:#1e3a5f; margin:.9rem 0 .4rem; }
.ai-output h4 { font-size:.98rem; font-weight:600; color:#334155; margin:.7rem 0 .3rem; }
.ai-output p { margin:.5rem 0; }
.ai-output ul, .ai-output ol { margin:.5rem 0 .5rem 1.4rem; }
.ai-output ul { list-style:disc; }
.ai-output ol { list-style:decimal; }
.ai-output li { margin:.2rem 0; }
.ai-output strong { color:#152a4a; font-weight:700; }
.ai-output blockquote { border-left:4px solid var(--gold); background:#fffbeb; padding:.5rem .9rem; margin:.6rem 0; color:#78350f; border-radius:.3rem; }
.ai-output table { width:100%; border-collapse:collapse; font-size:.86rem; margin:.7rem 0; }
.ai-output th { background:#f1f5f9; padding:.5rem .7rem; text-align:left; font-weight:600; color:#334155; border:1px solid #e2e8f0; }
.ai-output td { padding:.5rem .7rem; border:1px solid #eef2f9; vertical-align:top; }
.ai-output code { background:#f1f5f9; padding:.1rem .3rem; border-radius:3px; font-size:.85em; }
.ai-output pre { background:#0d1b33; color:#e2e8f0; padding:.8rem 1rem; border-radius:.5rem; overflow-x:auto; margin:.6rem 0; line-height:1.5; }
.ai-output pre code { background:transparent; color:inherit; padding:0; }
.ai-output hr { border:none; border-top:1px solid #e2e8f0; margin:1rem 0; }

table.data-table { width:100%; border-collapse:collapse; font-size:.88rem; }
table.data-table th { background:#f1f5f9; padding:.6rem .8rem; text-align:left; font-weight:600; color:#334155; border-bottom:2px solid #e2e8f0; }
table.data-table td { padding:.6rem .8rem; border-bottom:1px solid #f1f5f9; }
table.data-table tr:hover { background:#f8fafc; }

.fade-in { animation:fadeIn .3s; }
/* 무료 데모: 작성 차단 경고 (5초 후 천천히 사라짐) */
@keyframes demoWarnFade { 0%{opacity:0;transform:translateY(8px);} 8%{opacity:1;transform:translateY(0);} 70%{opacity:1;} 100%{opacity:0;transform:translateY(-6px);} }
.demo-warn { animation: demoWarnFade 5s ease forwards; }
.scrollbar-thin::-webkit-scrollbar { width:6px; height:6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:3px; }

/* ===== 접근성: 키보드 포커스 표시 ===== */
:focus-visible { outline:2.5px solid var(--gold); outline-offset:2px; border-radius:.3rem; }
.btn:active { transform:scale(.97); }
body.modal-open { overflow:hidden; }

/* ===== 브레드크럼 / 페이지 헤더 ===== */
.breadcrumb { display:flex; align-items:center; gap:.4rem; font-size:.8rem; color:#94a3b8; flex-wrap:wrap; }
.breadcrumb a, .breadcrumb span.crumb { cursor:pointer; color:#64748b; transition:color .15s; }
.breadcrumb a:hover { color:var(--navy); }
.breadcrumb .sep { color:#cbd5e1; font-size:.7rem; }
.breadcrumb .current { color:var(--navy); font-weight:600; cursor:default; }

/* ===== 진행률 / 온보딩 ===== */
.progress-track { width:100%; background:#e2e8f0; border-radius:999px; height:.55rem; overflow:hidden; }
.progress-fill { height:100%; background:linear-gradient(90deg,var(--navy),var(--gold)); border-radius:999px; transition:width .4s ease; }
.step-dot { width:1.9rem; height:1.9rem; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:.8rem; flex-shrink:0; }
.step-dot.done { background:#16a34a; color:#fff; }
.step-dot.current { background:var(--gold); color:#152a4a; box-shadow:0 0 0 4px rgba(201,162,39,.2); }
.step-dot.todo { background:#e2e8f0; color:#94a3b8; }

/* ===== 도구 선택 사이드바 (데스크톱 sticky) ===== */
.tool-list-btn { width:100%; text-align:left; padding:.6rem .8rem; border-radius:.6rem; font-size:.875rem; font-weight:500; display:flex; align-items:center; gap:.5rem; transition:all .15s; color:#475569; border:none; background:transparent; cursor:pointer; }
.tool-list-btn:hover { background:#f1f5f9; }
.tool-list-btn.active { background:var(--navy); color:#fff; }

/* ===== 드롭다운 (클릭 토글) ===== */
.dropdown-menu { position:absolute; right:0; margin-top:.4rem; min-width:13rem; background:#fff; border:1px solid #e2e8f0; border-radius:.7rem; box-shadow:0 12px 32px rgba(21,42,74,.16); overflow:hidden; z-index:50; }
.dropdown-menu button { width:100%; text-align:left; padding:.65rem 1rem; font-size:.875rem; color:#334155; display:flex; align-items:center; gap:.55rem; transition:background .12s; background:transparent; border:none; cursor:pointer; }
.dropdown-menu button:hover { background:#f1f5f9; }

/* ===== help / 안내 칩 ===== */
.help-chip { display:inline-flex; align-items:center; gap:.35rem; font-size:.78rem; padding:.25rem .6rem; border-radius:999px; background:#eff6ff; color:#1d4ed8; font-weight:500; }

@media (max-width:768px){
  .modal-box{max-width:100%;}
  /* 모바일에서는 도구 사이드바 sticky 해제 + 가로 스크롤 칩으로 */
  .tool-sidebar-sticky { position:static !important; max-height:none !important; }
}
