[x-cloak] { display: none !important; }

/* ---- Nav links ---- */
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s, background-color 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: #fff; background-color: rgba(100,116,139,0.25); }
.nav-link.active { color: #fff; background-color: rgba(100,116,139,0.4); }

/* ---- Cards ---- */
.card {
  background: #fff;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ---- Status badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-gray   { background:#f1f5f9; color:#64748b; }
.badge-blue   { background:#eff6ff; color:#2563eb; }
.badge-yellow { background:#fefce8; color:#ca8a04; }
.badge-green  { background:#f0fdf4; color:#16a34a; }
.badge-red    { background:#fef2f2; color:#dc2626; }
.badge-indigo { background:#eef2ff; color:#4338ca; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background:#6366f1; color:#fff; }
.btn-primary:hover:not(:disabled) { background:#4f46e5; }
.btn-secondary { background:#f1f5f9; color:#475569; border:1px solid #e2e8f0; }
.btn-secondary:hover:not(:disabled) { background:#e2e8f0; }
.btn-danger { background:#fee2e2; color:#dc2626; }
.btn-danger:hover:not(:disabled) { background:#fecaca; }
.btn-success { background:#dcfce7; color:#16a34a; }
.btn-success:hover:not(:disabled) { background:#bbf7d0; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

/* ---- Form inputs ---- */
.input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background: #fff;
  color: #0f172a;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.input::placeholder { color: #94a3b8; }

textarea.input { resize: vertical; min-height: 120px; }

.label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.35rem;
}

/* ---- Transcription ---- */
.segment {
  display: flex;
  gap: 0.75rem;
  padding: 0.625rem 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.segment:hover { background: #f8fafc; }

/* 行の状態表示。情報軸ごとに色相を分け、同じ色が 2 つの意味を持たないようにする。
   再生位置 = 琥珀の面（今どこを聞いているか）
   コメント有り = インディゴの左辺のみ（静的な属性。面ではなく辺なので再生と共存できる）
   選択中（編集対象）= グレーの枠（一時的な作業状態なので彩度を持たせない）
   面・辺・枠で軸が違うため、3 つが同時に立っても潰し合わない。 */

/* コメント有り（単独） */
.segment.segment-has-comments:not(.segment-active):not(.segment-selected) {
  box-shadow: inset 3px 0 0 #6366f1;
}
/* 再生中（単独） */
.segment.segment-active:not(.segment-has-comments):not(.segment-selected) {
  background: #fffbeb;
  box-shadow: inset 3px 0 0 #f59e0b;
}
/* 選択中（単独） */
.segment.segment-selected:not(.segment-active):not(.segment-has-comments) {
  background: #f8fafc;
  box-shadow: inset 0 0 0 2px #cbd5e1;
}
/* 再生中 かつ コメント有り。左辺は再生（琥珀）に譲る */
.segment.segment-active.segment-has-comments:not(.segment-selected) {
  background: #fffbeb;
  box-shadow: inset 3px 0 0 #f59e0b;
}
/* 再生中 かつ 選択中 */
.segment.segment-active.segment-selected:not(.segment-has-comments) {
  background: #fffbeb;
  box-shadow: inset 3px 0 0 #f59e0b, inset 0 0 0 2px #cbd5e1;
}
/* コメント有り かつ 選択中 */
.segment.segment-has-comments.segment-selected:not(.segment-active) {
  background: #f8fafc;
  box-shadow: inset 3px 0 0 #6366f1, inset 0 0 0 2px #cbd5e1;
}
/* 3 つすべて */
.segment.segment-active.segment-has-comments.segment-selected {
  background: #fffbeb;
  box-shadow: inset 3px 0 0 #f59e0b, inset 0 0 0 2px #cbd5e1;
}

/* セッション詳細: 文字起こしとコメントの同じ高さ。
   上部の音声カードを下部固定バーへ移したぶん、縦を広く取れる */
.session-detail-panels {
  height: min(82vh, 54rem);
  min-height: 22rem;
  max-height: min(82vh, 54rem);
}
.segment-annot-btn {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  padding: 0.2rem 0.35rem;
  border-radius: 0.375rem;
  color: #94a3b8;
  line-height: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.1s, background 0.1s;
}
.segment-annot-btn:hover { color: #d97706; background: #fffbeb; }
.segment-speaker {
  flex-shrink: 0;
  width: 1.625rem;
  height: 1.625rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 2px;
}
.speaker-a { background: #dbeafe; color: #1d4ed8; }
.speaker-b { background: #fce7f3; color: #9d174d; }
/* 話者名。時刻とともに本文の上段に置く */
.segment-who { font-size: 0.8125rem; font-weight: 600; color: #1e293b; white-space: nowrap; }
/* 時刻。押すとその位置から再生されるためブランド色にする
   （変更前の #94A3B8 は白背景で 2.56:1 と WCAG AA 不合格だった） */
.segment-time {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6366f1;
  white-space: nowrap;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}
.segment-time:hover { text-decoration: underline; }
/* 行に付いているコメントの件数 */
.segment-count {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.05rem 0.4rem;
  border-radius: 9999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  color: #475569;
}
.segment-text { font-size: 0.875rem; line-height: 1.75; color: #334155; }
/* 行ホバーで出るアクション */
.segment-actions {
  flex-shrink: 0;
  align-self: flex-start;
  display: flex;
  gap: 0.125rem;
  padding: 0.1875rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
}
.segment-action {
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 0.375rem;
  background: transparent;
  color: #475569;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.segment-action:hover { background: #f1f5f9; }

/* ---- Markdown content ---- */
.md-content h1 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.md-content h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.4rem; margin-top: 1rem; }
.md-content h3 { font-size: 1rem; font-weight: 600; margin-top: 0.75rem; margin-bottom: 0.3rem; }
/* 日本語の長文を読みやすくするため行間を広めに取る（総評・振り返り・添削の共通） */
.md-content p  { margin-bottom: 0.6rem; font-size: 0.875rem; line-height: 1.75; }
.md-content ul, .md-content ol { padding-left: 1.25rem; margin-bottom: 0.6rem; font-size: 0.875rem; }
.md-content li { margin-bottom: 0.2rem; line-height: 1.75; }
.md-content code { background: #f1f5f9; padding: 0.1em 0.3em; border-radius: 3px; font-size: 0.85em; }
.md-content blockquote { border-left: 3px solid #6366f1; padding-left: 0.75rem; color: #64748b; margin: 0.5rem 0; }

/* 総評だけ見出しを強調する（振り返り・添削の見た目は変えない） */
.md-content.md-feedback h2 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e2e8f0;
}
.md-content.md-feedback h2:first-child { margin-top: 0; }

/* 参照したナレッジのチップ。本文と色相を分けて可読性を保つ */
.citation-chip {
  background: #e0e7ff;
  color: #3730a3;
}

/* 総評本文。右カラムを総評だけで使うため、余った高さを埋めてスクロールさせる */
.feedback-body { flex: 1; min-height: 0; }

/* 右カラム。背景を沈めることで、中の白いカードを浮かせる */
.feedback-col {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.25rem;
}
/* 総評。右カラムの中で独立した白いカードにする */
.feedback-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem;
}

/* 総評本文中のタイムスタンプ。押すとその再生位置へ移動する */
.ts-link {
  color: #6366f1;
  font-weight: 600;
  font-size: inherit;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}
.ts-link:hover { text-decoration: underline; }

/* ---- File drop zone ---- */
.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 0.75rem;
  padding: 2rem;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: #6366f1;
  background: #eef2ff;
}

/* ---- Lock banner ---- */
.lock-banner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
}
.lock-banner-mine   { background:#f0fdf4; color:#15803d; border:1px solid #bbf7d0; }
.lock-banner-other  { background:#fff7ed; color:#c2410c; border:1px solid #fed7aa; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }

/* ---- Transition ---- */
.fade-enter { animation: fadeIn 0.15s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- Spinner ---- */
.spinner {
  width: 1.25rem; height: 1.25rem;
  border: 2px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Annotation dot ---- */
.annot-dot {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: #f59e0b;
}
