/* 바오밥 디자인 시스템 — NAVY #2B3A4E · COPPER #C67B3C · CREAM #F7F3EE */

:root {
  --navy: #2B3A4E;
  --copper: #C67B3C;
  --cream: #F7F3EE;
  --teal: #3A8FB7;
  --gray-100: #F5F5F5;
  --gray-300: #DDDDDD;
  --gray-500: #6B6B6B;
  --gray-700: #555555;
  --text: #222222;
  --danger: #D62F2F;
  --warning: #E6A800;
  --success: #2E7D32;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "맑은 고딕", "Malgun Gothic", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--gray-100);
  line-height: 1.5;
}
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
kbd {
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 0.85em;
  font-family: ui-monospace, "Cascadia Mono", monospace;
}
code {
  background: var(--cream);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  font-size: 0.92em;
}

/* ===== Unified Toolbar (한 줄 통합) ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, var(--navy), #1f2c3d);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.topbar-inner {
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.topbar-inner::-webkit-scrollbar { height: 4px; }
.topbar-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

/* 로고 */
.tb-logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: 6px;
  flex-shrink: 0;
  text-decoration: none;
  transition: background 0.12s;
}
.tb-logo:hover {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}
.tb-logo-icon { font-size: 1.15rem; }
.tb-logo-text { letter-spacing: -0.02em; white-space: nowrap; }

/* 토큰 배지 (D-N) */
.tb-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}
.tb-badge-ok { background: var(--success); color: white; }
.tb-badge-warning { background: var(--warning); color: white; }
.tb-badge-error { background: var(--danger); color: white; }

/* 구분선 */
.tb-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

/* 모델 토글 */
.tb-model-toggle {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  padding: 2px;
  flex-shrink: 0;
}
.tb-pill {
  padding: 3px 10px;
  font-size: 0.75rem;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: all 0.12s;
}
.tb-pill:hover { color: white; text-decoration: none; }
.tb-pill.active {
  background: var(--copper);
  color: white;
  font-weight: 600;
}

/* 토큰 사용량 */
.tb-tokens {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.tb-token {
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 0.72rem;
  font-family: ui-monospace, monospace;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}
.tb-token-cache {
  background: rgba(46, 125, 50, 0.4);
  color: #C8F2D0;
  font-weight: 600;
}

/* 액션 그룹 */
.tb-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.tb-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.12s;
}
.tb-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}
.tb-btn-primary {
  background: var(--copper);
  border-color: var(--copper);
}
.tb-btn-primary:hover { background: #d68a4a; }
.tb-btn-success {
  background: var(--success);
  border-color: var(--success);
}
.tb-btn-success:hover { background: #2e8a32; }
.tb-btn-danger {
  background: rgba(214, 47, 47, 0.4);
  border-color: rgba(214, 47, 47, 0.5);
}
.tb-btn-danger:hover { background: var(--danger); }

/* 우측 글로벌 네비 (도움말·설정·로그아웃) */
.tb-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.tb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.12s;
}
.tb-icon:hover {
  background: rgba(255, 255, 255, 0.18);
  text-decoration: none;
  border-color: rgba(255, 255, 255, 0.25);
}
.tb-icon-danger:hover {
  background: rgba(214, 47, 47, 0.6);
  color: white;
  border-color: var(--danger);
}

/* 좁은 화면 (1100px 이하) — 일부 축소 */
@media (max-width: 1100px) {
  .tb-logo-text { display: none; }  /* 아이콘만 */
  .tb-actions .tb-btn { padding: 5px 8px; font-size: 0.78rem; }
  .tb-tokens { gap: 2px; }
  .tb-token { font-size: 0.68rem; padding: 2px 5px; }
}

/* 매우 좁은 화면 (800px 이하) — 토큰 숨김 */
@media (max-width: 800px) {
  .tb-tokens { display: none; }
  .tb-divider:nth-of-type(2) { display: none; }
  /* 모바일 터치 타깃 ≥44px (UI검토 #2) */
  .tb-icon { width: 44px; height: 44px; }
}

/* ===== Top bar (legacy) — 호환성 유지 ===== */
.top {
  display: none;  /* legacy — topbar로 대체됨 */
  background: linear-gradient(180deg, var(--navy), #1f2c3d);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.top-inner {
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
}
.logo {
  color: white;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  transition: background 0.12s;
}
.logo:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
}
.logo-icon {
  font-size: 1.2rem;
}
.logo-text {
  letter-spacing: -0.02em;
}

/* 헤더 배지 (토큰 D-N) */
.top .badge {
  font-size: 0.78rem;
  padding: 3px 10px;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.logout {
  color: white;
  font-size: 0.9rem;
  opacity: 0.85;
}
.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: white;
  font-size: 1rem;
  opacity: 0.7;
  text-decoration: none;
  transition: all 0.12s;
}
.logout-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
  text-decoration: none;
}

/* Header 안의 아이콘 버튼 */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: white;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.12s;
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.18);
  text-decoration: none;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Action bar 안에서는 다른 색 */
.action-bar .btn-icon {
  color: var(--navy);
  background: var(--gray-100);
  border-color: var(--gray-300);
}
.action-bar .btn-icon:hover {
  background: var(--cream);
  color: var(--copper);
  border-color: var(--copper);
}

/* ===== Badge ===== */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-ok      { background: var(--success); color: white; }
.badge-warning { background: var(--warning); color: white; }
.badge-error   { background: var(--danger);  color: white; }

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  border: none;
  font-weight: 500;
}
.btn-primary   { background: var(--copper); color: white; }
.btn-primary:hover { background: #b56a2c; }
.btn-secondary { background: white; color: var(--navy); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--cream); }

/* ===== Main ===== */
.main { min-height: calc(100vh - 100px); }
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ===== Notice (legacy) ===== */
.notice {
  background: var(--cream);
  border-left: 4px solid var(--copper);
  padding: 14px 20px;
  margin-bottom: 24px;
  border-radius: var(--radius);
}
.notice h3 { margin: 0 0 8px; font-size: 1rem; color: var(--navy); }
.notice ol { margin: 4px 0 0 18px; padding: 0; }
.notice li { margin: 3px 0; font-size: 0.92rem; }
.notice strong { color: var(--copper); }

/* ===== Guide (collapsible) ===== */
.guide-box {
  background: var(--cream);
  border: 1px solid var(--copper);
  border-radius: var(--radius);
  margin-bottom: 24px;
  padding: 4px 18px;
}
.guide-box summary {
  cursor: pointer;
  padding: 10px 0;
  font-weight: 600;
  color: var(--navy);
  font-size: 0.95rem;
  list-style: none;
  user-select: none;
}
.guide-box summary::-webkit-details-marker { display: none; }
.guide-box summary::before {
  content: "▶ ";
  font-size: 0.7rem;
  margin-right: 4px;
  transition: transform 0.15s ease;
  display: inline-block;
}
.guide-box[open] summary::before {
  transform: rotate(90deg);
}
.guide-box[open] summary { border-bottom: 1px solid var(--copper); margin-bottom: 8px; }
.guide-list { margin: 8px 0 12px 22px; padding: 0; }
.guide-list li { margin: 5px 0; font-size: 0.92rem; }
.guide-list strong { color: var(--copper); }

/* ===== Stats grid (4 cards) ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.stat-card {
  background: white;
  padding: 18px 20px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 4px solid var(--gray-300);
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card .stat-icon {
  font-size: 2rem;
  line-height: 1;
}
.stat-card .stat-body { flex: 1; }
.stat-card .stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
  display: block;
}
.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--gray-700);
  margin-top: 2px;
  display: block;
}
.stat-pending    { border-left-color: var(--copper); }
.stat-pending    .stat-value { color: var(--copper); }
.stat-converting { border-left-color: var(--teal); }
.stat-converting .stat-value { color: var(--teal); }
.stat-published  { border-left-color: var(--success); }
.stat-published  .stat-value { color: var(--success); }
.stat-discarded  { border-left-color: var(--gray-500); }
.stat-discarded  .stat-value { color: var(--gray-700); }

/* ===== Stats (legacy single column) ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat {
  background: white;
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

/* ===== Card ===== */
.card {
  background: white;
  padding: 22px 26px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--cream);
}
.card-header h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2 {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 1.15rem;
}
.count-badge {
  display: inline-block;
  background: var(--copper);
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
}
.count-badge-neutral {
  background: var(--gray-300);
  color: var(--gray-700);
}
.hint {
  color: var(--gray-500);
  font-size: 0.85rem;
}

/* ===== Post grid (card-style list) ===== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.post-card {
  display: block;
  background: var(--cream);
  border: 1px solid transparent;
  padding: 14px 16px;
  border-radius: 8px;
  color: var(--text);
  transition: all 0.15s;
  text-decoration: none;
}
.post-card:hover {
  background: white;
  border-color: var(--copper);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.post-card-title {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--gray-700);
}
.post-card-done {
  background: white;
  border-color: var(--gray-300);
}
.post-card-done .post-card-title {
  color: var(--gray-700);
}
.meta-icon {
  opacity: 0.7;
}
.status-pill {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
}
.status-pending { background: var(--copper); color: white; }
.status-done { background: var(--success); color: white; }

/* ===== Post list (legacy) ===== */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-bottom: 1px solid var(--gray-300); }
.post-list li:last-child { border-bottom: none; }
.post-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  color: var(--text);
}
.post-link:hover { background: var(--cream); text-decoration: none; }
.post-title { font-weight: 500; color: var(--navy); }
.post-meta { font-size: 0.82rem; color: var(--gray-500); }
.empty {
  color: var(--gray-500);
  font-style: italic;
  padding: 20px 0;
  text-align: center;
}

/* ===== Foot ===== */
.foot {
  text-align: center;
  padding: 20px;
  color: var(--gray-500);
  font-size: 0.85rem;
}

/* ===== Login ===== */
.login-body {
  background: linear-gradient(135deg, var(--navy) 0%, #1a2533 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: white;
  padding: 36px 32px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 360px;
}
.login-card h1 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 1.3rem;
  line-height: 1.35;
}
.login-card .sub {
  margin: 0 0 22px;
  color: var(--gray-500);
  font-size: 0.9rem;
}
.login-card label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--navy);
  font-weight: 500;
}
.login-card input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  margin-bottom: 18px;
}
.login-card input:focus { outline: 2px solid var(--copper); border-color: var(--copper); }
.login-card button {
  width: 100%;
  background: var(--copper);
  color: white;
  padding: 11px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
}
.login-card button:hover { background: #b56a2c; }
.error {
  background: #FDE7E7;
  color: var(--danger);
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 0.9rem;
}

/* ===== Review page (3-COLUMN LAYOUT, 미세 튜닝 v4) ===== */
.review-page {
  max-width: 1800px;
  margin: 0 auto;
  padding: 16px 16px 60px;
}

/* --- 3열 grid --- */
.triple-view {
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  gap: 14px;
  margin-bottom: 16px;
}

/* --- 공통 카드 스타일 (시각적 통일감) --- */
.col-source,
.col-body,
.col-ai {
  background: white;
  border-radius: 12px;
  padding: 16px 18px;
  min-height: 740px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--gray-300);
}

/* --- 좌측: 원본 인스타 (cream 강조) --- */
.col-source {
  background: linear-gradient(180deg, #F7F3EE 0%, #FAF5EE 100%);
  border-color: rgba(198, 123, 60, 0.25);
}
.col-source::before {
  content: "";
  display: block;
  position: relative;
  height: 3px;
  background: linear-gradient(90deg, var(--copper) 0%, transparent 70%);
  margin: -16px -18px 12px;
  border-radius: 12px 12px 0 0;
}

/* --- 중앙: 블로그 본문 (메인 작업 영역, 더 강조) --- */
.col-body {
  border-color: rgba(43, 58, 78, 0.18);
}
.col-body::before {
  content: "";
  display: block;
  position: relative;
  height: 3px;
  background: linear-gradient(90deg, var(--navy) 0%, transparent 80%);
  margin: -16px -18px 12px;
  border-radius: 12px 12px 0 0;
}

/* --- 우측: AI 수정 (teal 그라데이션) --- */
.col-ai {
  background: linear-gradient(180deg, rgba(58, 143, 183, 0.06) 0%, rgba(198, 123, 60, 0.04) 100%);
  border-color: var(--teal);
  border-width: 2px;
}
.col-ai::before {
  content: "";
  display: block;
  position: relative;
  height: 3px;
  background: linear-gradient(90deg, var(--teal) 0%, transparent 70%);
  margin: -16px -18px 12px;
  border-radius: 12px 12px 0 0;
}

/* --- 카드 헤더 (3개 통일) --- */
.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--gray-300);
}
.col-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--navy);
  font-weight: 700;
}
.col-header-ai {
  border-bottom-style: solid;
  border-bottom-color: rgba(58, 143, 183, 0.3);
}

/* --- 중앙: 블로그 본문 textarea (메인 작업 영역) --- */
.col-body textarea[name="body_markdown"] {
  flex: 1;
  width: 100%;
  min-height: 540px;
  padding: 16px 18px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-family: ui-monospace, "Cascadia Mono", "맑은 고딕", monospace;
  font-size: 0.94rem;
  line-height: 1.75;
  resize: vertical;
  background: #FAFBFC;
  box-sizing: border-box;
  transition: all 0.15s;
}
.col-body textarea[name="body_markdown"]:focus {
  outline: 2px solid var(--copper);
  border-color: var(--copper);
  background: white;
  box-shadow: 0 0 0 4px rgba(198, 123, 60, 0.1);
}

/* --- 본문 영역 글자수 카운터 강조 --- */
.col-body .char-counter {
  padding: 2px 10px;
  background: var(--navy);
  color: white;
  border-radius: 12px;
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 600;
}

/* --- 우측: AI 수정 (컴팩트하게) --- */
.ai-sub-vertical {
  margin: 0 0 10px;
  color: var(--gray-700);
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 8px 10px;
  background: rgba(58, 143, 183, 0.08);
  border-radius: 6px;
  border-left: 3px solid var(--teal);
}
.col-ai textarea[name="instruction"] {
  width: 100%;
  min-height: 180px;
  padding: 11px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.55;
  resize: vertical;
  background: white;
  box-sizing: border-box;
}
.col-ai textarea[name="instruction"]:focus {
  outline: 2px solid var(--teal);
  border-color: var(--teal);
}

/* --- chips 컴팩트 영역 --- */
.refine-chips-vertical {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 10px 0 12px;
  padding: 8px 0;
  border-top: 1px dashed rgba(58, 143, 183, 0.3);
  border-bottom: 1px dashed rgba(58, 143, 183, 0.3);
}
.refine-chips-vertical::before {
  content: "💡 빠른 예시";
  display: block;
  width: 100%;
  font-size: 0.74rem;
  color: var(--gray-700);
  font-weight: 600;
  margin-bottom: 4px;
}
.refine-chips-vertical .refine-chip {
  background: white;
  border: 1px solid var(--gray-300);
  color: var(--navy);
  font-size: 0.78rem;
  padding: 3px 9px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.refine-chips-vertical .refine-chip:hover {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
  transform: translateY(-1px);
}

/* --- 우측 버튼 영역 (강조) --- */
.refine-buttons-vertical {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.btn-block {
  width: 100%;
  text-align: center;
  display: block;
  padding: 10px 14px;
  font-weight: 600;
}
.btn-block small {
  font-size: 0.74rem;
  opacity: 0.75;
  margin-left: 4px;
  font-weight: 400;
}

/* --- 메타 영역 (CAROUSEL 배지 강조) --- */
.ig-meta-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: rgba(198, 123, 60, 0.08);
  border-radius: 8px;
}
.meta-tag {
  display: inline-block;
  padding: 3px 9px;
  background: white;
  border: 1px solid rgba(198, 123, 60, 0.4);
  border-radius: 10px;
  font-size: 0.74rem;
  color: var(--copper);
  font-weight: 700;
}
.meta-tag-count {
  background: var(--copper);
  border-color: var(--copper);
  color: white;
}
.meta-time {
  font-size: 0.74rem;
  color: var(--gray-700);
  margin-left: auto;
  font-family: ui-monospace, monospace;
}

/* --- 좌측 캡션 박스 (가독성 향상) --- */
.caption-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text);
}

/* --- 캡션 영역 (좌측) --- */
.caption-scroll {
  background: white;
  border-radius: var(--radius);
  padding: 12px 14px;
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--gray-300);
  max-height: 600px;
}

/* --- Sticky action bar (legacy — topbar에 통합됨) --- */
.action-bar {
  display: none;  /* legacy 숨김 */
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, white, #FAFBFC);
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(10px);
}
.action-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  gap: 10px;
  flex-wrap: wrap;
}
.action-bar-left,
.action-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.action-bar .btn {
  padding: 6px 12px;
  font-size: 0.85rem;
}
.action-bar .model-toggle-compact {
  margin-right: 2px;
}
.action-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.action-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.model-toggle-compact {
  display: inline-flex;
  background: var(--gray-100);
  border-radius: 16px;
  padding: 2px;
}
.toggle-pill {
  padding: 4px 12px;
  font-size: 0.82rem;
  border-radius: 14px;
  color: var(--gray-700);
}
.toggle-pill:hover { text-decoration: none; }
.toggle-pill.active {
  background: var(--copper);
  color: white;
  font-weight: 600;
}
.token-info-compact {
  font-size: 0.78rem;
  color: var(--gray-500);
  font-family: ui-monospace, "Cascadia Mono", monospace;
}

/* 토큰 정보 pills */
.token-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.token-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  font-size: 0.74rem;
  color: var(--gray-700);
  font-family: ui-monospace, monospace;
}
.token-pill-label {
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.7rem;
}
.token-pill-cache {
  background: rgba(46, 125, 50, 0.08);
  border-color: rgba(46, 125, 50, 0.3);
  color: var(--success);
}
.token-pill-cache .token-pill-label {
  color: var(--success);
}

/* 버튼 그룹 (연속된 버튼 묶음) */
.btn-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  background: var(--gray-100);
  border-radius: 8px;
}
.btn-group .btn {
  margin: 0;
  font-size: 0.85rem;
  padding: 6px 12px;
}

/* --- Title row (제목 강조) --- */
.title-row {
  background: white;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--gray-300);
  border-left: 4px solid var(--copper);
}
.title-row label {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.92rem;
  flex-shrink: 0;
}
.title-row input[type="text"] {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  font-size: 1.08rem;
  font-family: inherit;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.title-row input[type="text"]:focus {
  outline: 2px solid var(--copper);
  border-color: var(--copper);
  box-shadow: 0 0 0 4px rgba(198, 123, 60, 0.1);
}
.char-counter {
  font-size: 0.78rem;
  color: var(--gray-500);
  flex-shrink: 0;
  min-width: 50px;
  text-align: right;
}
.char-counter.over {
  color: var(--danger);
  font-weight: 600;
}

/* --- Split view (좌: 원본 / 우: 편집) --- */
.split-view {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.split-source,
.split-edit {
  background: white;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 600px;
}
.split-source {
  background: var(--cream);
}
.split-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-300);
}
.split-header h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--navy);
}
.small-link {
  font-size: 0.82rem;
  color: var(--teal);
}

/* --- 원본 인스타 --- */
.ig-meta-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.meta-tag {
  display: inline-block;
  padding: 2px 8px;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: 10px;
  font-size: 0.75rem;
  color: var(--navy);
  font-weight: 600;
}
.meta-tag-count {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}
.meta-time {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin-left: auto;
}
.caption-scroll {
  background: white;
  border-radius: var(--radius);
  padding: 12px 14px;
  flex: 1;
  overflow-y: auto;
  max-height: 520px;
  border: 1px solid var(--gray-300);
}
.caption-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}
.media-detail {
  margin-top: 12px;
  font-size: 0.85rem;
  background: white;
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(198, 123, 60, 0.2);
}
.media-detail summary {
  cursor: pointer;
  padding: 4px 0;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.88rem;
}
.media-detail[open] summary {
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--gray-300);
  margin-bottom: 8px;
}
.media-hint {
  margin: 4px 0 8px;
  font-size: 0.78rem;
  color: var(--gray-700);
  line-height: 1.45;
  background: rgba(46, 125, 50, 0.06);
  border-left: 3px solid var(--success);
  padding: 6px 10px;
  border-radius: 4px;
}
.media-list {
  margin: 6px 0 0 0;
  padding-left: 0;
  list-style: none;
  font-size: 0.85rem;
}
.media-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
}
.media-item:last-child { border-bottom: none; }
.media-dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--copper);
  color: white;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.12s;
}
.media-dl-btn:hover {
  background: #b56a2c;
  text-decoration: none;
  color: white;
}

/* 전체 ZIP 다운로드 버튼 */
.media-zip-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  background: linear-gradient(135deg, var(--navy), #1f2c3d);
  color: white;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  margin: 4px 0 12px;
  transition: all 0.15s;
  box-shadow: 0 2px 6px rgba(43, 58, 78, 0.2);
}
.media-zip-btn:hover {
  background: linear-gradient(135deg, #1f2c3d, var(--navy));
  text-decoration: none;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(43, 58, 78, 0.3);
}
.media-zip-btn:active {
  transform: translateY(0);
}
.media-type {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 9px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-right: 6px;
  color: white;
}
.media-type-image { background: var(--teal); }
.media-type-video { background: var(--copper); }

/* --- 편집 우측 --- */
.split-edit textarea[name="body_markdown"] {
  flex: 1;
  width: 100%;
  min-height: 520px;
  padding: 14px 16px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: ui-monospace, "Cascadia Mono", "맑은 고딕", monospace;
  font-size: 0.92rem;
  line-height: 1.6;
  resize: vertical;
  background: #FAFBFC;
}
.split-edit textarea[name="body_markdown"]:focus {
  outline: 2px solid var(--copper);
  border-color: var(--copper);
  background: white;
}
.hashtag-row {
  margin-top: 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--cream);
  border-radius: 8px;
  border: 1px solid rgba(198, 123, 60, 0.2);
}
.hashtag-row label {
  padding-top: 9px;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.88rem;
  white-space: nowrap;
}
.hashtag-row textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
  background: white;
  color: var(--teal);
}
.hashtag-row textarea:focus {
  outline: 2px solid var(--copper);
  border-color: var(--copper);
}
.hashtag-row .char-counter {
  padding-top: 9px;
  font-weight: 700;
  color: var(--copper);
}
.edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gray-300);
}
.model-badge {
  margin-left: auto;
  background: var(--navy);
  color: white;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.74rem;
  font-family: ui-monospace, "Cascadia Mono", monospace;
}

/* --- Ghost button --- */
.btn-ghost {
  background: transparent;
  color: var(--gray-700);
  border: 1px dashed var(--gray-300);
}
.btn-ghost:hover {
  background: var(--gray-100);
  border-style: solid;
}

/* --- Legacy review-container/grid (keep for compatibility) --- */
.review-container { padding-bottom: 80px; }
.review-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 20px;
  margin-bottom: 20px;
}
.review-source .ig-meta { color: var(--gray-700); font-size: 0.92rem; margin-bottom: 14px; }
.review-source h3 { color: var(--navy); font-size: 0.95rem; margin: 14px 0 8px; }
.caption {
  background: var(--gray-100);
  padding: 12px;
  border-radius: var(--radius);
  white-space: pre-wrap;
  font-size: 0.9rem;
  max-height: 280px;
  overflow-y: auto;
  font-family: inherit;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.review-header h2 { margin: 0; }
.model-toggle { font-size: 0.85rem; color: var(--gray-700); }
.model-toggle .toggle {
  display: inline-block;
  padding: 3px 10px;
  margin-left: 4px;
  border-radius: 4px;
  background: var(--gray-100);
  color: var(--gray-700);
}
.model-toggle .toggle.active {
  background: var(--copper);
  color: white;
  font-weight: 600;
}
.model-toggle .toggle:hover { text-decoration: none; }

.review-target label {
  display: block;
  margin: 14px 0 6px;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.9rem;
}
.review-target input[type="text"],
.review-target textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.5;
}
.review-target input[type="text"]:focus,
.review-target textarea:focus {
  outline: 2px solid var(--copper);
  border-color: var(--copper);
}
.review-target textarea { font-family: ui-monospace, "Cascadia Mono", monospace; resize: vertical; }

.token-info {
  margin-top: 12px;
  padding: 8px 12px;
  background: var(--gray-100);
  border-radius: var(--radius);
  color: var(--gray-700);
}

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.actions-main { padding-top: 16px; border-top: 1px solid var(--gray-300); }
.actions-status { padding-top: 16px; border-top: 1px solid var(--gray-300); }

.btn-large { padding: 12px 22px; font-size: 1rem; font-weight: 600; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #1e5b21; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #a52323; }

/* ===== Help page ===== */
.help-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 20px 60px;
  line-height: 1.7;
}
.help-header {
  background: linear-gradient(135deg, var(--navy), #1a2533);
  color: white;
  padding: 28px 32px;
  border-radius: 12px;
  margin-bottom: 20px;
}
.help-header h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
}
.help-sub {
  margin: 0;
  opacity: 0.85;
  font-size: 0.95rem;
}
.help-toc {
  background: var(--cream);
  border-left: 4px solid var(--copper);
  padding: 14px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
}
.help-toc strong {
  display: block;
  width: 100%;
  margin-bottom: 4px;
  color: var(--navy);
}
.help-toc a {
  font-size: 0.88rem;
  color: var(--copper);
  padding: 3px 10px;
  background: white;
  border-radius: 14px;
  border: 1px solid rgba(198, 123, 60, 0.3);
}
.help-toc a:hover {
  background: var(--copper);
  color: white;
  text-decoration: none;
}
.help-section {
  background: white;
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-300);
}
.help-section h2 {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 1.25rem;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--cream);
}
.help-section h3 {
  margin: 18px 0 8px;
  color: var(--navy);
  font-size: 1.02rem;
}
.help-section p {
  margin: 8px 0 12px;
  color: var(--text);
}
.help-section ul, .help-section ol {
  margin: 8px 0 12px 22px;
  padding: 0;
}
.help-section li {
  margin: 5px 0;
}
.help-section code {
  background: var(--cream);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.88em;
}

/* 워크플로 단계 */
.workflow-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.step {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: var(--cream);
  border-radius: 8px;
  border-left: 3px solid var(--copper);
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--copper);
  color: white;
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
}
.step strong { display: block; color: var(--navy); margin-bottom: 4px; }
.step p { margin: 0; font-size: 0.92rem; color: var(--gray-700); }

/* 3열 레이아웃 설명 */
.layout-explain {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.layout-col {
  background: var(--cream);
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--gray-300);
}
.layout-col h3 {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--navy);
}
.layout-col ul {
  margin: 0 0 0 18px;
  font-size: 0.86rem;
}
.layout-col li {
  margin: 4px 0;
}

/* 예시 좋음/나쁨 */
.example-good {
  background: rgba(46, 125, 50, 0.06);
  border-left: 4px solid var(--success);
  padding: 10px 14px 10px 32px !important;
  border-radius: 6px;
  list-style: "✅  ";
}
.example-bad {
  background: rgba(214, 47, 47, 0.06);
  border-left: 4px solid var(--danger);
  padding: 10px 14px 10px 32px !important;
  border-radius: 6px;
  list-style: "❌  ";
}

/* 표 */
.help-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.92rem;
}
.help-table th {
  background: var(--navy);
  color: white;
  text-align: left;
  padding: 8px 12px;
}
.help-table td {
  border-bottom: 1px solid var(--gray-300);
  padding: 8px 12px;
}
.help-table tr:nth-child(even) td {
  background: var(--cream);
}

/* Callout */
.callout {
  padding: 12px 16px;
  border-radius: 8px;
  margin: 12px 0;
}
.callout-warn {
  background: rgba(230, 168, 0, 0.1);
  border-left: 4px solid var(--warning);
}

/* 발행 단계 */
.publish-steps {
  counter-reset: step-counter;
  list-style: none !important;
  padding: 0 !important;
  margin: 12px 0 !important;
}
.publish-steps li {
  counter-increment: step-counter;
  padding: 10px 14px 10px 50px;
  margin: 6px 0;
  background: var(--cream);
  border-radius: 6px;
  position: relative;
}
.publish-steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--copper);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

/* FAQ */
.faq-item {
  background: var(--cream);
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 4px 16px;
}
.faq-item summary {
  padding: 10px 0;
  cursor: pointer;
  color: var(--navy);
  font-weight: 600;
  font-size: 0.95rem;
}
.faq-item[open] summary {
  border-bottom: 1px solid var(--gray-300);
  margin-bottom: 8px;
}
.faq-item p {
  padding: 4px 0 12px;
  font-size: 0.92rem;
  color: var(--text);
}

/* 마무리 */
.help-footer {
  background: linear-gradient(135deg, var(--cream), white);
  text-align: center;
}
.help-footer h2 {
  border-bottom: none;
  text-align: center;
}

@media (max-width: 800px) {
  .layout-explain { grid-template-columns: 1fr; }
  .help-toc { font-size: 0.85rem; }
}

/* ===== Settings: Guides Control Center ===== */
.settings-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 20px 60px;
}
.settings-header {
  background: white;
  border-radius: 10px;
  padding: 22px 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--copper);
}
.settings-header h1 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 1.4rem;
}
.settings-sub {
  margin: 0;
  color: var(--gray-700);
  font-size: 0.92rem;
  line-height: 1.6;
}

.guides-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
}

/* 좌측 탭 리스트 */
.guides-tabs {
  background: white;
  border-radius: 10px;
  padding: 8px;
  box-shadow: var(--shadow);
  align-self: start;
  position: sticky;
  top: 16px;
}
.guide-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  margin-bottom: 4px;
  border-left: 3px solid transparent;
  transition: all 0.12s;
}
.guide-tab:hover {
  background: var(--cream);
  text-decoration: none;
}
.guide-tab.active {
  background: var(--cream);
  border-left-color: var(--copper);
}
.guide-tab-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.guide-tab-body {
  flex: 1;
  min-width: 0;
}
.guide-tab-label {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.92rem;
  margin-bottom: 3px;
}
.guide-tab-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
}
.guide-source {
  padding: 1px 7px;
  border-radius: 9px;
  font-weight: 600;
}
.guide-source-user {
  background: var(--copper);
  color: white;
}
.guide-source-default {
  background: var(--gray-300);
  color: var(--gray-700);
}
.guide-source-missing {
  background: var(--danger);
  color: white;
}
.guide-size {
  color: var(--gray-500);
}

/* 우측 편집기 */
.guides-editor {
  background: white;
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
.guides-editor-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--gray-300);
}
.guides-editor-header h2 {
  margin: 0 0 6px;
  color: var(--navy);
  font-size: 1.2rem;
}
.guide-description {
  margin: 0;
  color: var(--gray-700);
  font-size: 0.88rem;
  line-height: 1.5;
}
.guide-status {
  text-align: right;
  white-space: nowrap;
  flex-shrink: 0;
}
.guide-status small {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--gray-500);
}
.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}
.status-user { background: var(--copper); color: white; }
.status-default { background: var(--teal); color: white; }
.status-missing { background: var(--danger); color: white; }

.guides-editor textarea {
  width: 100%;
  min-height: 540px;
  padding: 14px 16px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-family: ui-monospace, "Cascadia Mono", "맑은 고딕", monospace;
  font-size: 0.88rem;
  line-height: 1.65;
  resize: vertical;
  background: #FAFBFC;
}
.guides-editor textarea:focus {
  outline: 2px solid var(--copper);
  border-color: var(--copper);
  background: white;
}

.guide-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--gray-300);
  flex-wrap: wrap;
}
.guide-actions-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.guide-actions-left .char-counter {
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  color: var(--gray-700);
}
.guide-actions-left .hint {
  color: var(--gray-500);
  font-size: 0.82rem;
}
.guide-actions-right {
  display: flex;
  gap: 8px;
}

/* 도움말 */
.guide-help {
  background: var(--cream);
  border: 1px solid var(--copper);
  border-radius: 10px;
  margin-top: 20px;
  padding: 4px 20px;
}
.guide-help summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
  color: var(--navy);
  user-select: none;
}
.guide-help-body {
  padding: 4px 0 16px;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.65;
}
.guide-help-body h3 {
  margin: 14px 0 6px;
  color: var(--navy);
  font-size: 0.98rem;
}
.guide-help-body ul {
  margin: 6px 0 6px 22px;
  padding: 0;
}
.guide-help-body li { margin: 4px 0; }

@media (max-width: 900px) {
  .guides-layout { grid-template-columns: 1fr; }
  .guides-tabs { position: static; }
}

/* ===== AI Refine Box ===== */
.ai-refine-box {
  background: linear-gradient(135deg, rgba(58, 143, 183, 0.08), rgba(198, 123, 60, 0.06));
  border: 2px solid var(--teal);
  border-radius: 10px;
  padding: 18px 20px;
  margin-top: 20px;
  margin-bottom: 16px;
}
.ai-refine-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.ai-refine-icon {
  font-size: 1.8rem;
  line-height: 1;
}
.ai-refine-header h3 {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 1.05rem;
}
.ai-refine-sub {
  margin: 0;
  color: var(--gray-700);
  font-size: 0.85rem;
  line-height: 1.45;
}
.ai-refine-box textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  background: white;
}
.ai-refine-box textarea:focus {
  outline: 2px solid var(--teal);
  border-color: var(--teal);
}
.refine-examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.refine-example-label {
  font-size: 0.82rem;
  color: var(--gray-700);
  margin-right: 4px;
}
.refine-chip {
  background: white;
  border: 1px solid var(--gray-300);
  color: var(--navy);
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.refine-chip:hover {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
}
.refine-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* ===== Toast (닫기 가능 + 자동 페이드) ===== */
.toast {
  padding: 10px 14px 10px 16px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: opacity 0.4s, transform 0.4s;
}
.toast-success {
  background: linear-gradient(90deg, #E6F4EA, #F0F9F2);
  color: var(--success);
  border-left: 4px solid var(--success);
}
.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.12s;
}
.toast-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}
.toast-fade {
  opacity: 0;
  transform: translateY(-8px);
}

/* ===== Wide desktop (1400px 이상) — 3열 풀 너비 ===== */
@media (min-width: 1400px) {
  .triple-view {
    grid-template-columns: 360px 1fr 360px !important;
  }
}

/* ===== Tablet 좁은 데스크탑 (1100~1400px) — 3열 좁게 ===== */
@media (max-width: 1399px) and (min-width: 1100px) {
  .triple-view {
    grid-template-columns: 280px 1fr 300px !important;
  }
}

/* ===== Narrow (900~1099px) — 2열 (좌·우) + AI 아래로 ===== */
@media (max-width: 1099px) and (min-width: 900px) {
  .triple-view {
    grid-template-columns: 280px 1fr !important;
    grid-template-areas:
      "source body"
      "ai ai" !important;
  }
  .col-source { grid-area: source; }
  .col-body { grid-area: body; }
  .col-ai {
    grid-area: ai;
    min-height: 360px !important;
    margin-top: 12px;
  }
  .col-ai textarea[name="instruction"] {
    min-height: 100px !important;
  }
  .review-page { padding: 16px 14px 60px; }
}

/* ===== Old split-view (legacy, 호환성) ===== */
@media (max-width: 1100px) {
  .split-view {
    grid-template-columns: 300px 1fr;
  }
}

/* ===== Mobile (900px 이하) — 모든 컬럼 세로 스택 ===== */
@media (max-width: 899px) {
  .triple-view {
    grid-template-columns: 1fr !important;
    grid-template-areas: none !important;
  }
  .col-source,
  .col-body,
  .col-ai {
    min-height: auto !important;
    grid-area: auto !important;
  }
  .col-source .caption-scroll {
    max-height: 280px;
  }
  .col-body textarea[name="body_markdown"] {
    min-height: 400px !important;
  }
  .col-ai textarea[name="instruction"] {
    min-height: 120px !important;
  }
}

/* ===== Mobile ===== */
@media (max-width: 800px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 14px; }
  .stat-card .stat-value { font-size: 1.5rem; }
  .stat-card .stat-icon { font-size: 1.5rem; }
  .top-inner { padding: 10px 14px; }
  .container { padding: 16px 14px; }
  .review-page { padding: 12px 12px 60px; }
  .review-grid { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }

  /* Split view → 세로 스택 */
  .split-view {
    grid-template-columns: 1fr;
  }
  .split-source {
    min-height: auto;
  }
  .split-source .caption-scroll {
    max-height: 240px;
  }
  .split-edit {
    min-height: auto;
  }
  .split-edit textarea[name="body_markdown"] {
    min-height: 400px;
  }

  /* Action bar 모바일 */
  .action-bar-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .action-bar-right {
    justify-content: flex-end;
  }

  /* Title row 모바일 */
  .title-row {
    flex-wrap: wrap;
  }
  .title-row input[type="text"] {
    flex: 1 1 100%;
    order: 2;
  }
  .title-row label {
    order: 1;
  }
  .title-row .char-counter {
    order: 3;
    margin-left: auto;
  }

  /* Hashtag row 모바일 */
  .hashtag-row {
    grid-template-columns: 1fr;
  }
  .hashtag-row .char-counter {
    text-align: left;
    padding-top: 0;
  }
}
