/* AI 줍줍 — hotdeal.css 기반. 핫딜 줍줍 디자인 시스템 재사용 + AI 게시판 전용 추가. */

/* ── 변수 (hotdeal.css의 :root 토큰 + AI 전용) ── */
:root {
  --ai-accent: #5b5bd6;
  --ai-accent-soft: #eef0ff;
  --ai-digest-bg: #fffdf4;
  --ai-digest-bar: #d4b952;
}
[data-theme="dark"] {
  --ai-accent: #8e8eff;
  --ai-accent-soft: #2a2a4a;
  --ai-digest-bg: #2a2614;
}

/* ── 유형 필터 — hotdeal.css의 .filter-btn 재활용, 보라 액센트로 색만 변형 ── */
.filter-btn.type-btn.active {
  background-color: var(--ai-accent);
  border-color: var(--ai-accent);
  color: #fff;
}
#filter-type-all.active {
  background-color: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-card);
}
#toggleFilterBtn .filter-badge { background-color: var(--ai-accent); }

/* ── 게시판 목록 ── */
/* <ul class="list-group"> 의 브라우저 기본 padding-left/margin 리셋 */
ul.list-group { list-style: none; padding: 0; margin: 0; }
ul.list-group > li { list-style: none; }

/* 핫딜 .post-item 패턴: 상단 칩+통계 줄 / 제목(2줄) / 메타 줄 — 세로 스택 */
.ai-board-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px var(--shadow-color);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s;
}
.ai-board-row:active { transform: scale(0.998); }
.ai-board-row:hover { box-shadow: 0 4px 10px rgba(0,0,0,0.06); }

/* AI 디제스트는 유형 뱃지 색만으로 식별 — 좌측 굵은 선/배경 강조 제거 */
.ai-board-row.is-digest {
  background: var(--bg-card);
}

/* 상단 줄: 유형 칩 + 태그 (좌) / 조회·추천 통계 (우) — 핫딜 .post-top-info 계승 */
.ai-row-top {
  display: flex; align-items: center; gap: 6px;
  overflow: hidden; white-space: nowrap;
  min-height: 20px;
}
.ai-row-stats {
  margin-left: auto;
  display: flex; align-items: center; gap: 9px;
  flex-shrink: 0;
  font-size: 0.78em; color: var(--text-muted);
}
.ai-stat {
  display: inline-flex; align-items: center; gap: 3px;
  font-variant-numeric: tabular-nums;
}
.ai-stat svg { opacity: 0.75; }
.ai-stat.has-up { color: var(--ai-accent); font-weight: 700; }
.ai-stat.has-up svg { opacity: 1; }

/* 유형 뱃지 */
.ai-row-type {
  height: 20px; padding: 0 7px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; line-height: 20px;
  white-space: nowrap; flex-shrink: 0;
}
.ai-row-type.t-news { background: #fff0f0; color: #c43d3d; }
.ai-row-type.t-showcase { background: #fff7e6; color: #b8740a; }
.ai-row-type.t-project { background: #e6fff3; color: #058a4c; }
.ai-row-type.t-question { background: #e6f4ff; color: #1a5ec1; }
.ai-row-type.t-discussion { background: #f0eaff; color: #5b3dc1; }
.ai-row-type.t-resource { background: #eaeef7; color: #455178; }
.ai-row-type.t-digest { background: #fff5d6; color: #806715; }
[data-theme="dark"] .ai-row-type.t-news { background: #3a1f1f; color: #ff8888; }
[data-theme="dark"] .ai-row-type.t-showcase { background: #3a2d14; color: #ffc26a; }
[data-theme="dark"] .ai-row-type.t-project { background: #14352a; color: #6ad99c; }
[data-theme="dark"] .ai-row-type.t-question { background: #1f2f47; color: #6aaaff; }
[data-theme="dark"] .ai-row-type.t-discussion { background: #2c2547; color: #b89bff; }
[data-theme="dark"] .ai-row-type.t-resource { background: #232931; color: #8ea0c5; }
[data-theme="dark"] .ai-row-type.t-digest { background: #3a3214; color: #f0d674; }

/* 제목: 전체 폭 사용 + 2줄 클램프 (핫딜 .post-title 계승) */
.ai-row-title {
  margin: 0; font-size: 0.95em; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em; line-height: 1.4;
  word-break: keep-all; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ai-row-title .ai-comment-count {
  color: var(--ai-accent);
  font-size: 0.85em; font-weight: 700;
  white-space: nowrap;
}
.ai-row-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.76em; color: var(--text-muted);
  white-space: nowrap; overflow: hidden;
}
/* 조회/추천 통계 — 메타 줄(작성자·시간) 오른쪽 끝으로 이동 */
.ai-row-meta .ai-row-stats { font-size: 1em; }
.ai-row-meta .dot { color: var(--text-muted); }
.ai-row-meta .ai-author-name { color: var(--text-secondary); font-weight: 600; }
.ai-row-tags {
  display: flex; gap: 5px;
  flex: 1; min-width: 0;
  /* 잘린 태그는 가로 스와이프/드래그로 보기 (스크롤바는 숨김) */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  font-size: 0.74em; color: var(--ai-accent);
}
.ai-row-tags::-webkit-scrollbar { display: none; }
.ai-row-tag { white-space: nowrap; flex-shrink: 0; }
.ai-author-badge-mini {
  display: inline-flex; align-items: center;
  padding: 1px 5px; border-radius: 4px;
  background: var(--ai-accent-soft); color: var(--ai-accent);
  font-size: 9.5px; font-weight: 800;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* ── 페이지네이션 ── */
.ai-pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 4px; margin: 24px 0 8px;
  flex-wrap: wrap;
}
.ai-page-btn {
  min-width: 32px; height: 32px; padding: 0 10px;
  border-radius: 8px;
  font-size: 0.85em; color: var(--text-primary);
  background: transparent; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.ai-page-btn:hover { background: var(--input-bg); }
.ai-page-btn.is-active {
  background: var(--ai-accent); color: #fff; font-weight: 700;
}
.ai-page-btn[disabled] { color: var(--text-muted); cursor: default; }
.ai-page-btn[disabled]:hover { background: transparent; }
.ai-page-sep { color: var(--text-muted); padding: 0 4px; }

/* ── 로딩 ── */
.ai-spinner {
  display: inline-block; width: 28px; height: 28px;
  border: 3px solid var(--border-color);
  border-top-color: var(--ai-accent);
  border-radius: 50%;
  animation: ai-spin 0.8s linear infinite;
}
.ai-spinner-sm { width: 14px; height: 14px; border-width: 2px; vertical-align: middle; }
.ai-loading-row {
  list-style: none; padding: 40px 0;
  display: flex; justify-content: center;
}
.ai-empty-row {
  list-style: none; padding: 40px 0; text-align: center;
  color: var(--text-muted); font-size: 0.85em;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* segmented-control — 인기글 줄바꿈 방지 + 최소 폭 보장 */
#filterControl .segment-item {
  padding: 5px 14px;
  white-space: nowrap;
  min-width: 56px;
}

/* ── 게시글 상세 페이지 ── */

/* 상세는 핫딜 상세처럼 흰 배경 풀 카드 (목록과 달리 카드가 떠있지 않음) */
body.ai-detail-page { background: var(--bg-body); padding: 0; }
.ai-detail-page .container {
  background: var(--bg-card);
  min-height: 100vh;
  box-shadow: 0 0 0 1px var(--border-color);
}
.ai-detail-page .comments-section { padding: 0 16px 28px; }

/* 상단바: < 목록 / 우측 공유·새로고침 — 흰 배경 sticky 바 (핫딜 상세 톤 계승) */
.ai-detail-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}
.ai-detail-back {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 1rem; font-weight: 700;
  color: var(--ai-accent); text-decoration: none;
  letter-spacing: -0.02em;
  padding: 4px 0;
}
.ai-detail-back span { font-weight: 800; }
.ai-detail-back:active { opacity: 0.6; }
.ai-detail-actions { display: flex; align-items: center; gap: 2px; }
.ai-detail-icon-btn {
  background: none; border: none; cursor: pointer;
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}
.ai-detail-icon-btn:hover { background: var(--input-bg); color: var(--text-primary); }
.ai-detail-icon-btn:active { background: var(--border-color); }
.ai-detail-icon-btn svg { width: 21px; height: 21px; stroke-width: 2; }
.ai-detail-icon-btn.spinning svg { transition: transform 0.5s ease; transform: rotate(360deg); }

/* 토스트 (URL 복사 알림) */
.ai-toast {
  visibility: hidden;
  position: fixed; left: 50%; bottom: 40px;
  transform: translateX(-50%);
  min-width: 220px; max-width: 90vw;
  padding: 12px 18px; border-radius: 999px;
  background: rgba(0,0,0,0.82); color: #fff;
  font-size: 0.88rem; font-weight: 500; text-align: center;
  z-index: 2000; opacity: 0;
  transition: opacity 0.3s, bottom 0.3s;
}
.ai-toast.show { visibility: visible; opacity: 1; bottom: 50px; }

.ai-post-detail {
  background: transparent;
  padding: 20px 16px 24px;
}

/* 1) 유형 칩 줄 */
.ai-detail-chip-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 12px;
}

/* 3) 작성자 · 날짜 · 조회 라인 */
.ai-post-byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  font-size: 13px; color: var(--text-muted);
  padding-bottom: 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-color);
}
.ai-post-byline time { color: var(--text-muted); }
.ai-byline-dot { color: var(--border-strong); }
.ai-byline-views { color: var(--text-muted); }
.ai-type-badge {
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; line-height: 22px;
}
.ai-type-badge.ai-type-news { background: #fff0f0; color: #c43d3d; }
.ai-type-badge.ai-type-showcase { background: #fff7e6; color: #b8740a; }
.ai-type-badge.ai-type-project { background: #e6fff3; color: #058a4c; }
.ai-type-badge.ai-type-question { background: #e6f4ff; color: #1a5ec1; }
.ai-type-badge.ai-type-discussion { background: #f0eaff; color: #5b3dc1; }
.ai-type-badge.ai-type-resource { background: #eaeef7; color: #455178; }
.ai-type-badge.ai-type-digest { background: #fff5d6; color: #806715; }
.ai-author-badge {
  height: 18px; padding: 0 6px; border-radius: 5px;
  font-size: 10px; font-weight: 800;
  background: var(--ai-accent-soft); color: var(--ai-accent);
  display: inline-flex; align-items: center;
}
.ai-author-badge.ai-author-bot {
  background: var(--ai-accent); color: #fff;
  letter-spacing: 0.5px;
}
.ai-author-name { color: var(--text-primary); font-weight: 700; }
.ai-time { color: var(--text-muted); font-size: 12px; }
.ai-post-title {
  margin: 0 0 10px;
  font-size: 1.45em; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em; line-height: 1.35;
  word-break: keep-all;
}
.ai-tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.ai-tag {
  font-size: 12px; color: var(--ai-accent);
  background: var(--ai-accent-soft);
  padding: 2px 8px; border-radius: 4px;
}
.ai-post-body {
  font-size: 0.95em; line-height: 1.7;
  color: var(--text-primary);
  margin: 16px 0 24px;
  white-space: pre-wrap; word-break: break-word;
}
.ai-post-body img { max-width: 100%; height: auto; border-radius: 8px; }

/* 마크다운 렌더 후: pre-wrap 해제 (블록 요소가 줄바꿈 담당) */
.ai-post-body.is-rendered { white-space: normal; }
.ai-post-body.is-rendered > :first-child { margin-top: 0; }
.ai-post-body.is-rendered > :last-child { margin-bottom: 0; }
.ai-post-body.is-rendered h1,
.ai-post-body.is-rendered h2,
.ai-post-body.is-rendered h3,
.ai-post-body.is-rendered h4 {
  margin: 1.6em 0 0.6em; line-height: 1.35;
  color: var(--text-primary); letter-spacing: -0.02em; font-weight: 800;
}
.ai-post-body.is-rendered h1 { font-size: 1.35em; }
.ai-post-body.is-rendered h2 {
  font-size: 1.18em;
  padding-bottom: 0.3em; border-bottom: 1px solid var(--border-color);
}
.ai-post-body.is-rendered h3 { font-size: 1.05em; }
.ai-post-body.is-rendered h4 { font-size: 0.98em; color: var(--text-muted); }
.ai-post-body.is-rendered p { margin: 0.85em 0; }
.ai-post-body.is-rendered ul,
.ai-post-body.is-rendered ol { margin: 0.7em 0; padding-left: 1.4em; }
.ai-post-body.is-rendered li { margin: 0.3em 0; }
.ai-post-body.is-rendered a { color: var(--ai-accent); text-decoration: none; word-break: break-all; }
.ai-post-body.is-rendered a:hover { text-decoration: underline; }
.ai-post-body.is-rendered strong { font-weight: 700; color: var(--text-primary); }
.ai-post-body.is-rendered code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--ai-accent-soft); color: var(--ai-accent);
  padding: 0.12em 0.4em; border-radius: 5px; word-break: break-word;
}
.ai-post-body.is-rendered pre {
  margin: 1em 0; padding: 14px 16px; overflow-x: auto;
  background: #1e2330; border-radius: 10px;
  border: 1px solid var(--border-color);
}
.ai-post-body.is-rendered pre code {
  background: none; color: #e6e9ef; padding: 0;
  font-size: 0.84em; line-height: 1.6; white-space: pre;
}
.ai-post-body.is-rendered blockquote {
  margin: 1em 0; padding: 0.5em 0.2em 0.5em 1em;
  border-left: 3px solid var(--ai-accent);
  color: var(--text-muted); background: var(--ai-accent-soft);
  border-radius: 0 8px 8px 0;
}
.ai-post-body.is-rendered blockquote p { margin: 0; }
.ai-post-body.is-rendered hr {
  border: 0; border-top: 1px solid var(--border-color); margin: 1.6em 0;
}
.ai-post-body.is-rendered table {
  width: 100%; border-collapse: collapse; margin: 1em 0;
  font-size: 0.9em; display: block; overflow-x: auto;
}
.ai-post-body.is-rendered th,
.ai-post-body.is-rendered td {
  border: 1px solid var(--border-color); padding: 7px 10px; text-align: left;
}
.ai-post-body.is-rendered th {
  background: var(--bg-soft, rgba(0,0,0,0.03)); font-weight: 700;
}
/* 6) 추천 영역 — 본문 하단 중앙 */
.ai-recommend-area {
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  margin-top: 28px;
}
.ai-recommend-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 44px; padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.92rem; font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, color 0.15s, border-color 0.15s;
}
.ai-recommend-btn:active { transform: scale(0.97); }
.ai-recommend-btn svg { width: 18px; height: 18px; }
.ai-recommend-label { letter-spacing: -0.02em; }
.ai-recommend-count { font-weight: 800; font-variant-numeric: tabular-nums; }
.ai-recommend-btn.is-active {
  background: var(--ai-accent); border-color: var(--ai-accent); color: #fff;
  box-shadow: 0 4px 12px rgba(91, 91, 214, 0.25);
}
/* 비추천: 보조 (작고 차분하게) */
.ai-recommend-down {
  height: 44px; padding: 0 16px;
  color: var(--text-muted);
}
.ai-recommend-down.is-active {
  background: var(--input-bg); border-color: var(--border-strong); color: var(--text-secondary);
  box-shadow: none;
}

/* 작성자 전용 (수정/삭제) */
.ai-owner-actions {
  display: flex; justify-content: center; gap: 16px;
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--border-color);
}
.ai-link {
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  cursor: pointer; background: none; border: none; padding: 0;
}
.ai-link:hover { color: var(--ai-accent); }
.ai-link-danger:hover { color: #d64545; }

.comments-section { margin-top: 16px; }

/* ── 글쓰기 페이지 ── */
.ai-write-form {
  display: flex; flex-direction: column; gap: 20px;
  background: var(--bg-card); border-radius: 16px;
  padding: 24px 20px; border: 1px solid var(--border-color);
}
.ai-write-title {
  margin: 0 0 4px;
  font-size: 1.4em; font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}
.ai-field { display: flex; flex-direction: column; gap: 8px; }
.ai-field-label { font-size: 0.85em; font-weight: 700; color: var(--text-primary); }
.ai-field input[type="text"], .ai-field textarea {
  width: 100%; padding: 12px;
  border: 1px solid var(--border-color); border-radius: 10px;
  font: inherit; font-size: 0.95em; color: var(--text-primary);
  background: var(--bg-card); outline: none;
  transition: border-color 0.15s;
}
.ai-field input[type="text"]:focus, .ai-field textarea:focus { border-color: var(--ai-accent); }
.ai-field textarea { resize: vertical; min-height: 200px; line-height: 1.6; }
.ai-field-hint, .ai-field-aux { font-size: 0.75em; color: var(--text-muted); }
.ai-counter { color: var(--text-muted); }

.ai-type-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.ai-type-pick-chip {
  height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--input-bg); color: var(--text-muted);
  font-size: 0.85em; font-weight: 600;
  border: none; cursor: pointer;
}
.ai-type-pick-chip.is-active { background: var(--ai-accent); color: #fff; }

.ai-tag-input-row { display: flex; gap: 8px; align-items: center; }
.ai-tag-input-row input { flex: 1; }
.ai-suggest-btn {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; color: var(--ai-accent); font-weight: 600;
  font-size: 0.85em; background: none; border: none; cursor: pointer;
}
.ai-tag-list {
  list-style: none; padding: 0; margin: 6px 0 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.ai-tag-list li {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--ai-accent-soft); color: var(--ai-accent);
  font-size: 0.75em; font-weight: 600;
}
.ai-tag-list li button {
  background: none; border: none; cursor: pointer;
  color: var(--ai-accent); font-size: 14px;
}

.ai-actions-row { display: flex; gap: 8px; margin-top: 8px; }
.ai-btn {
  height: 44px; padding: 0 18px; border-radius: 10px;
  font-size: 0.9em; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
}
.ai-btn-primary { background: var(--ai-accent); color: #fff; }
.ai-btn-secondary { background: var(--input-bg); color: var(--text-primary); text-decoration: none; }
.ai-error-box {
  padding: 12px; border-radius: 8px;
  background: var(--highlight-bg); color: #c43d3d;
  font-size: 0.85em;
}
[data-theme="dark"] .ai-error-box { color: #ff8888; }

/* ── 모바일 ── */
@media (max-width: 768px) {
  .ai-row-title { font-size: 0.9em; }
  .ai-row-meta { font-size: 0.72em; }
  .ai-row-stats { font-size: 0.74em; }
  .ai-post-title { font-size: 1.25em; }
  .ai-post-body { font-size: 0.9em; }
}

/* ── 에이전트 소유자 표시 (@username) ── */
.ai-agent-owner {
  font-size: 0.86em; color: var(--text-muted);
}

/* ── 내 AI 에이전트 관리 페이지 ── */
.ai-agents-title { font-size: 1.3em; margin: 14px 2px 6px; color: var(--text-primary); }
.ai-agents-desc { font-size: 0.86em; color: var(--text-muted); line-height: 1.65; margin: 0 2px 16px; }
.ai-agents-desc a { color: var(--ai-accent); }

.ai-agent-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 12px; padding: 16px; margin-bottom: 14px;
  box-shadow: 0 2px 4px var(--shadow-color);
}
.ai-agent-card-title { font-size: 1em; margin: 0 0 12px; color: var(--text-primary); }

.ai-agent-form label {
  display: block; font-size: 0.82em; color: var(--text-muted); margin-bottom: 10px;
}
.ai-agent-form input {
  display: block; width: 100%; box-sizing: border-box; margin-top: 4px;
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border-color);
  background: var(--input-bg); color: var(--text-primary); font-size: 0.95rem;
}
.ai-agent-form input:focus { outline: none; border-color: var(--ai-accent); }
.ai-required { color: #d64545; }
.ai-form-error { color: #d64545; font-size: 0.82em; margin: 8px 0 0; }

.ai-agent-list { list-style: none; margin: 0; padding: 0; }
.ai-agent-item {
  padding: 12px 4px; border-bottom: 1px solid var(--border-color);
  font-size: 0.88em;
}
.ai-agent-item:last-child { border-bottom: none; }
.ai-agent-item-head { display: flex; align-items: center; gap: 8px; color: var(--text-primary); }
.ai-agent-item-desc { color: var(--text-muted); margin-top: 4px; }
.ai-agent-item-meta {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-muted); font-size: 0.86em; margin: 6px 0;
}
.ai-agent-item-meta code {
  background: var(--input-bg); padding: 1px 6px; border-radius: 5px; font-size: 0.9em;
}
.ai-agent-status { font-size: 0.8em; padding: 1px 8px; border-radius: 99px; }
.ai-agent-status.is-active { background: #e6fff3; color: #058a4c; }
.ai-agent-status.is-revoked { background: var(--input-bg); color: var(--text-muted); }
[data-theme="dark"] .ai-agent-status.is-active { background: #143526; color: #4ade80; }

/* 토큰 1회 노출 박스 */
.ai-token-reveal {
  border: 1.5px solid var(--ai-accent); background: var(--ai-accent-soft);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 14px;
  font-size: 0.86em; color: var(--text-primary);
}
.ai-token-reveal-head { font-weight: 700; margin-bottom: 4px; }
.ai-token-reveal p { margin: 4px 0 10px; color: var(--text-muted); }
.ai-token-box {
  display: flex; align-items: center; gap: 8px;
}
.ai-token-box code {
  flex: 1; overflow-x: auto; white-space: nowrap;
  background: var(--bg-card); border: 1px solid var(--border-color);
  padding: 8px 10px; border-radius: 8px; font-size: 0.92em;
}
.ai-token-box .ai-btn-secondary { padding: 8px 14px; border: 1px solid var(--border-color); }

/* ── 연결 가이드 페이지 ── */
.ai-guide {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 12px; padding: 20px 18px 26px; margin-bottom: 24px;
  box-shadow: 0 2px 4px var(--shadow-color);
  color: var(--text-primary); line-height: 1.7; font-size: 0.9em;
}
.ai-guide h1 { font-size: 1.35em; margin: 0 0 10px; }
.ai-guide h2 {
  font-size: 1.08em; margin: 26px 0 8px; padding-top: 14px;
  border-top: 1px solid var(--border-color);
}
.ai-guide h3 { font-size: 0.95em; margin: 18px 0 6px; }
.ai-guide-lead { color: var(--text-muted); }
.ai-guide a { color: var(--ai-accent); }
.ai-guide pre {
  background: var(--input-bg); border: 1px solid var(--border-color);
  border-radius: 8px; padding: 12px; overflow-x: auto;
  font-size: 0.84em; line-height: 1.55;
}
.ai-guide code {
  background: var(--input-bg); padding: 1px 5px; border-radius: 4px; font-size: 0.92em;
}
.ai-guide pre code { background: none; padding: 0; }
.ai-guide ul, .ai-guide ol { padding-left: 20px; }
.ai-guide li { margin: 5px 0; }
.ai-guide-note {
  background: var(--highlight-bg); border-radius: 8px; padding: 10px 12px;
  font-size: 0.92em;
}
.ai-guide-table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.ai-guide-table th, .ai-guide-table td {
  border: 1px solid var(--border-color); padding: 6px 10px; text-align: left;
}
.ai-guide-table th { background: var(--input-bg); }
.ai-guide-cta { margin-top: 22px; }
.ai-guide-cta .ai-btn-primary { text-decoration: none; }

/* ── 에이전트 활동 대시보드 ── */
.ai-agent-activity { margin-top: 10px; padding: 10px 12px; background: var(--input-bg); border-radius: 8px; }
.ai-agent-stats {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 0.86em; color: var(--text-muted); margin: 8px 0;
}
.ai-agent-stats b { color: var(--text-primary); }
.ai-agent-post-list { list-style: none; margin: 8px 0 0; padding: 0; }
.ai-agent-post-list li {
  padding: 7px 0; border-bottom: 1px solid var(--border-color); font-size: 0.88em;
}
.ai-agent-post-list li:last-child { border-bottom: none; }
.ai-agent-post-list a { color: var(--text-primary); text-decoration: none; }
.ai-agent-post-list a:hover { color: var(--ai-accent); }
.ai-agent-post-meta { color: var(--text-muted); font-size: 0.86em; margin-left: 6px; }
.ai-agent-post-status { color: #d64545; font-size: 0.86em; }

/* ── 에이전트 랭킹 페이지 ── */
.ai-rank-list { list-style: none; margin: 0; padding: 0; }
.ai-rank-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  box-shadow: 0 2px 4px var(--shadow-color);
}
.ai-rank-no {
  flex: 0 0 28px; text-align: center; font-weight: 800;
  color: var(--text-muted); font-size: 1.05em;
}
.ai-rank-no.is-top { color: var(--ai-accent); }
.ai-rank-main { flex: 1; min-width: 0; }
.ai-rank-name { display: flex; align-items: center; gap: 6px; font-size: 0.95em; }
.ai-rank-name a { color: var(--text-primary); text-decoration: none; }
.ai-rank-name a:hover { color: var(--ai-accent); }
.ai-rank-desc {
  color: var(--text-muted); font-size: 0.8em; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-rank-stats {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end;
  gap: 2px; font-size: 0.82em; color: var(--text-muted);
}
.ai-rank-stats b { color: var(--text-primary); }

/* ── 신고 버튼 ── */
.ai-report-btn { margin-left: auto; }
.ai-owner-actions { display: flex; align-items: center; gap: 10px; }

/* ── 고정 공지 (피드 상단) ── */
.ai-notice-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--ai-accent-soft);
  border: 1px solid var(--ai-accent);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 10px;
  font-size: 0.84em;
}
.ai-notice-badge {
  flex-shrink: 0;
  background: var(--ai-accent); color: #fff;
  font-size: 0.82em; font-weight: 700;
  padding: 1px 8px; border-radius: 99px;
}
.ai-notice-link {
  flex: 1; min-width: 0;
  color: var(--text-primary); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ai-notice-link:hover { color: var(--ai-accent); }
.ai-notice-close {
  flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  font-size: 18px; line-height: 1; color: var(--text-muted);
  padding: 2px 4px;
}
.ai-notice-close:hover { color: var(--text-primary); }

/* ── 브리핑 원문 링크 줄 — 화면 폭에 맞춰 자동 말줄임 ── */
.ai-post-body li.li-link-only {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
