/* ── Layout ── */
body { background: #f4f6f9; }
/* navbar は sticky-top（フローに残る）ため固定オフセット不要。被り防止のハードコード 72px を撤廃。 */
.main-content { padding: 24px 24px 32px; }
.page { animation: fadeIn .15s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

/* ── Stat cards ── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 16px 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.stat-icon { font-size: 1.6rem; margin-bottom: 6px; }
.stat-val  { font-size: 2rem; font-weight: 700; line-height: 1; color: #1a1a2e; }
.stat-lbl  { font-size: .75rem; color: #6c757d; margin-top: 4px; }

/* ── Cards & tables ── */
.card { border: none; box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.table td { vertical-align: middle; }
.paper-row:hover td { background: #f0f4ff; }
.paper-row.selected td { background: #e8f0fe !important; }

/* ── Tag chips ── */
.tag-chip {
  display: inline-flex;
  align-items: center;
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}
.tag-chip-removable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .8rem;
  padding: 3px 10px 3px 10px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}
.btn-tag-remove {
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  font-size: .85rem;
  opacity: .6;
}
.btn-tag-remove:hover { opacity: 1; }

/* ── Tag swatch (management page) ── */
.tag-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.08);
}

/* ── Generated content ── */
.content-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px 14px;
}
.content-card-header { border-bottom: 1px solid #e9ecef; padding-bottom: 6px; }
.content-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .85rem;
  color: #343a40;
  margin: 8px 0 0;
  font-family: inherit;
  background: transparent;
  border: none;
  padding: 0;
}

/* ── Bootstrap color extension ── */
.text-purple { color: #7c3aed !important; }

/* ── Modal ── */
.modal-xl { max-width: 1100px; }

/* ── Navbar active link ── */
.navbar .nav-link.active {
  background: rgba(255,255,255,.2);
  border-radius: 6px;
}

/* ── Scrollable abstract ── */
#meta-abstract { max-height: 160px; resize: vertical; }

/* ── Markdown viewer/editor (P6) ── */
.markdown-viewer {
  max-height: 60vh;
  overflow-y: auto;
  font-size: .9rem;
  background: #fff;
}
.markdown-viewer img { max-width: 100%; height: auto; display: block; margin: 8px 0; }
.markdown-viewer table { border-collapse: collapse; width: auto; margin: 8px 0; }
.markdown-viewer th, .markdown-viewer td { border: 1px solid #dee2e6; padding: 4px 8px; }
.markdown-viewer pre.md-raw {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: .82rem;
  margin: 0;
}
.markdown-editor {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85rem;
  resize: vertical;
}

/* ── Inline status select ── */
.status-select-inline {
  font-size: .78rem;
  padding: 2px 20px 2px 6px;
  min-width: 100px;
  height: auto;
}

/* ── Inline tag chip (list row) ── */
.tag-chip-inline {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .73rem;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid;
  white-space: nowrap;
}

/* ── Tag add "+" button in list row ── */
.tag-add-btn {
  line-height: 1 !important;
  flex-shrink: 0;
}

/* ── Content generation page ── */
.cg-paper-list {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 4px 0;
}
.cg-paper-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: .85rem;
  cursor: pointer;
  margin: 0;
}
.cg-paper-item:hover { background: #f0f4ff; }
.cg-paper-item input[type="checkbox"] { flex-shrink: 0; }

/* ── T7 取り込み: ドラッグ&ドロップ ── */
.ingest-dropzone {
  border-style: dashed !important;
  border-color: #b6c2cf !important;
  background: #f8fafc;
  transition: background .15s, border-color .15s;
}
.ingest-dropzone:hover { background: #eef4ff; border-color: #0d6efd !important; }
.ingest-dropzone.dragover { background: #e0ecff; border-color: #0d6efd !important; }
.ingest-dropzone.uploading { opacity: .6; pointer-events: none; }
