* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

header {
  background: #5b87df;
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.title-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-area img {
  max-height: 50px;
  padding: 4px;
  background-color: #fff;
  border-radius: 4px;
}

header h1 {
  font-size: 20px;
  white-space: nowrap;
}

nav {
  display: flex;
  gap: 8px;
}

.nav-btn {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: none;
}

.nav-btn.active {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

main {
  max-width: 960px;
  margin: 24px auto;
  padding: 0 16px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* フォーム */
h2 {
  font-size: 18px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
}

.form-group select:disabled {
  background: #f0f0f0;
  color: #999;
}

.form-hint {
  display: block;
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

button[type="submit"],
#refresh-btn {
  background: #1a73e8;
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

button[type="submit"]:hover,
#refresh-btn:hover {
  background: #0d17d0;
}

button[type="submit"]:disabled {
  background: #999;
  cursor: not-allowed;
}

#refresh-btn {
  margin-bottom: 16px;
}

/* --- ジョブ一覧ツールバー --- */
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.list-toolbar h2 {
  margin: 0;
  flex: 1 1 auto;
}

.list-toolbar #refresh-btn {
  margin-bottom: 0;
}

/* --- ランディング画面 (ルート URL) --- */
.landing-card {
  max-width: 520px;
  margin: 48px auto;
  padding: 32px 28px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  text-align: center;
  color: #333;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.landing-card h2 {
  margin-top: 0;
  font-size: 18px;
  color: #1a73e8;
}

.landing-card p {
  margin: 12px 0;
  line-height: 1.7;
  font-size: 14px;
}

.landing-card .landing-hint {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #e8eaed;
  font-size: 12px;
  color: #888;
}

.landing-card code {
  background: #f1f3f4;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  color: #444;
}

.message {
  margin-top: 16px;
  padding: 12px;
  border-radius: 4px;
  font-size: 14px;
}

.message.success {
  background: #e6f4ea;
  color: #1e7e34;
}

.message.error {
  background: #fce8e6;
  color: #c5221f;
}

/* ジョブ一覧 */
.job-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.job-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.job-card-title {
  font-weight: 600;
  font-size: 15px;
}

.job-card-meta {
  font-size: 13px;
  color: #666;
}

.job-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.delete-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid #ddd;
  color: #999;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.delete-btn:hover {
  color: #c5221f;
  border-color: #c5221f;
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-pending {
  background: #fef7e0;
  color: #b8860b;
}

.status-dedup_check {
  background: #f3e5f5;
  color: #7b1fa2;
}

.status-processing {
  background: #e3f2fd;
  color: #1565c0;
}

.status-done {
  background: #e6f4ea;
  color: #1e7e34;
}

.status-error {
  background: #fce8e6;
  color: #c5221f;
}

/* 結果画面 */
#result-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

#back-btn {
  background: none;
  border: 1px solid #ccc;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

#back-btn:hover {
  background: #f0f0f0;
}

/* Vチェック結果へのリンクボタン（結果ヘッダー右端） */
.vcheck-link {
  margin-left: auto;
  display: inline-block;
  padding: 6px 14px;
  font-size: 13px;
  color: #fff;
  background: #4a76ce;
  border: 1px solid #4a76ce;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.vcheck-link:hover {
  background: #3a5fa8;
}

#job-status-area {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.result-item {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.result-item-content {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.result-image {
  flex-shrink: 0;
  width: 380px;
}

.result-image img {
  width: 100%;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  transition: opacity 0.15s;
}

.result-image img:hover {
  opacity: 0.8;
}

.result-text {
  flex: 1;
  min-width: 0;
}

.result-item-header {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: #1a73e8;
}

.result-ocr-text {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 4px;
  font-size: 13px;
  white-space: pre-wrap;
  margin-bottom: 8px;
}

/* 考査結果 */
.check-summary {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.check-summary.no-issues {
  border-left: 4px solid #34a853;
}

.check-issue {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  margin: 8px 0;
  border-left: 4px solid #9aa0a6;
  background: #f8f9fa;
  border-radius: 0 4px 4px 0;
  font-size: 13px;
}

.check-issue.severity-high {
  border-left-color: #ea4335;
  background: #fce8e6;
}

.check-issue.severity-med {
  border-left-color: #f29900;
  background: #fef7e0;
}

.check-issue.severity-low {
  border-left-color: #9aa0a6;
  background: #f8f9fa;
}

.check-issue-body {
  flex: 1;
  min-width: 0;
}

.severity-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  margin-top: 2px;
}

.severity-icon.severity-high {
  background: #ea4335;
  color: #fff;
}

.severity-icon.severity-med {
  background: #f29900;
  color: #fff;
}

.severity-icon.severity-low {
  background: #e8eaed;
  color: #5f6368;
  font-size: 16px;
}

.check-issue-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.check-issue-line {
  font-size: 12px;
  color: #888;
}

.check-issue-text {
  font-size: 12px;
  color: #555;
  margin-bottom: 4px;
  font-style: italic;
}

.check-issue-message {
  font-size: 13px;
}

.check-issue-suggestion {
  font-size: 12px;
  color: #1a73e8;
  margin-top: 4px;
}

.severity-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: #e8eaed;
  color: #5f6368;
}

.severity-tag.severity-high {
  background: #fce8e6;
  color: #c5221f;
}

.severity-tag.severity-med {
  background: #fef7e0;
  color: #b8860b;
}

.severity-tag.severity-low {
  background: #e8eaed;
  color: #5f6368;
}

/* テキスト/画像チェック セクション */
.issue-section {
  margin-top: 16px;
}
.issue-section-label {
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.issue-section-text .issue-section-label {
  background: #e8f0fe;
  color: #1a73e8;
}
.issue-section-image .issue-section-label {
  background: #fce8e6;
  color: #c5221f;
}

/* 確認済み (low) セクション: <details>/<summary> ベースの折りたたみ */
.issue-section-low {
  margin-top: 16px;
}
.issue-section-label-low {
  background: #f1f3f4;
  color: #5f6368;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.issue-section-label-low::-webkit-details-marker {
  display: none;
}
.issue-section-label-low::before {
  content: "▶";
  display: inline-block;
  margin-right: 6px;
  font-size: 10px;
  transition: transform 0.15s ease;
}
.issue-section-low[open] > .issue-section-label-low::before {
  transform: rotate(90deg);
}
.issue-section-low[open] > .issue-section-label-low {
  margin-bottom: 8px;
}

/* ガイドライン参照ブロック */
.guideline-ref {
  margin-top: 8px;
  padding: 8px 12px;
  background: #f0f4ff;
  border-radius: 4px;
  border-left: 3px solid #1a73e8;
  font-size: 12px;
}

.guideline-ref-title {
  font-weight: 600;
  color: #1a73e8;
  margin-bottom: 4px;
}

.guideline-ref-quote {
  color: #555;
  font-style: italic;
  line-height: 1.5;
}

.result-item.has-issues {
  border-left: 3px solid #fbbc04;
}

.result-item.has-issues:has(.severity-high) {
  border-left-color: #ea4335;
}

.check-summary.has-warnings {
  border-left: 4px solid #ea4335;
}

.check-summary.has-errors {
  border-left: 4px solid #ea4335;
}

.summary-error {
  color: #c5221f;
  font-weight: 700;
  text-decoration: none;
}
.summary-error:hover {
  text-decoration: underline;
}

.ocr-error-section {
  border-left: 3px solid #ea4335;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0 24px;
  background: #fff;
}

.ocr-error-heading {
  margin: 0 0 12px;
  color: #c5221f;
  font-size: 16px;
}

.summary-high {
  color: #c5221f;
  font-weight: 600;
}

.summary-med {
  color: #b8860b;
  font-weight: 600;
}

.summary-low {
  color: #5f6368;
  font-weight: 600;
}

/* --------------------------------------------------------------------------
 * 指摘サマリカード
 *
 * check-summary (1 行バッジ) の直後、テロップ詳細 h3 の直前に挿入される。
 * 「同じ指摘 (word / text / category) を複数テロップで束ねて 1 行にまとめ、
 * 各テロップへのアンカーリンクを chip で並べる」ためのブロック。
 *
 * 集約セマンティクスは app.js の buildIssueSummary() を参照。
 * severity 配色は既存 .severity-high/-med/-low と揃えている。
 * -------------------------------------------------------------------------- */

.issue-summary-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.issue-summary-header {
  font-weight: 700;
  color: #202124;
  margin-bottom: 12px;
}

.issue-summary-severity {
  padding: 10px 0;
  border-top: 1px solid #f1f3f4;
}
.issue-summary-severity:first-of-type {
  border-top: none;
  padding-top: 4px;
}

.issue-summary-severity-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 700;
  margin: 0 0 8px;
  background: #f1f3f4;
  color: #5f6368;
}
.issue-summary-severity.severity-high .issue-summary-severity-title {
  background: #fce8e6;
  color: #c5221f;
}
.issue-summary-severity.severity-med .issue-summary-severity-title {
  background: #fef7e0;
  color: #b8860b;
}
.issue-summary-severity.severity-low .issue-summary-severity-title {
  background: #e8eaed;
  color: #5f6368;
}

.issue-summary-group {
  display: grid;
  /* 見出しカラムを固定幅にして detail の開始位置を揃える。
     app.js: SUMMARY_LABEL_MAX = 5 (5文字 + 省略記号 = 最大 6 文字幅) を
     許容する幅として設定。CJK 1文字 ≈ 1em @ font-size:13px。 */
  grid-template-columns: 6.5em 1fr auto;
  align-items: baseline;
  gap: 8px 12px;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.5;
}
.issue-summary-group + .issue-summary-group {
  border-top: 1px dashed #f1f3f4;
}

.issue-summary-label {
  font-weight: 700;
  color: #5f6368;
  word-break: break-all;
}
.issue-summary-severity.severity-high .issue-summary-label {
  color: #c5221f;
}
.issue-summary-severity.severity-med .issue-summary-label {
  color: #b8860b;
}

.issue-summary-detail {
  color: #5f6368;
  min-width: 0;
  overflow-wrap: anywhere;
}

.issue-summary-anchors {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.summary-anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  color: #5f6368;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: none;
}

/* --------------------------------------------------------------------------
 * カード側の #N バッジ + サマリからジャンプした際の一瞬ハイライト
 *
 * .card-index-badge: result-item-header の先頭に置く連番バッジ。
 *   サマリの [N] chip と対応させ、ジャンプ先が視認しやすいようにする。
 * .card-flash: scrollToCard() が付与し 1.5s 後に外す。ジャンプ後の
 *   カードを短時間だけ強調（既存の has-issues ボーダーは触らない）。
 * .result-item に scroll-margin-top を確保して、上部に余白を持たせる
 * （sticky header は無いが、ジャンプ後にカード上端がビューポート最上部
 *  に張り付くと視認性が悪いため）。
 * -------------------------------------------------------------------------- */

.result-item {
  scroll-margin-top: 20px;
}

.result-item-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.card-index-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #f1f3f4;
  color: #5f6368;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.result-item.has-issues .card-index-badge {
  background: #fef7e0;
  color: #b8860b;
}
.result-item.has-issues:has(.severity-high) .card-index-badge {
  background: #fce8e6;
  color: #c5221f;
}

.card-flash {
  animation: card-flash-anim 1.5s ease-out;
}

@keyframes card-flash-anim {
  0% {
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.35);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(26, 115, 232, 0);
  }
}

/* --------------------------------------------------------------------------
 * ページトップへ戻るボタン
 *
 * 位置: 画面右下固定 (position: fixed)。
 * 可視性: window.scrollY が閾値を超えたら表示。app.js の scroll listener で
 *   hidden 属性をトグルする。
 * z-index: 900 = 画像モーダル (1000) より下、通常コンテンツより上。
 *   ホワイトリスト/決まりものパネル、モーダル表示中も裏に隠れるだけで
 *   誤操作にはならない。
 * -------------------------------------------------------------------------- */
.back-to-top-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #1a73e8;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.back-to-top-btn:hover {
  background: #1557b0;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}
.back-to-top-btn:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}
.back-to-top-btn svg {
  width: 22px;
  height: 22px;
}

/* 画像モーダル */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.image-modal-content img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 8px;
}

.image-modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  background: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* BEFORE/AFTER 差分表示 */
.diff-block {
  margin: 6px 0;
  font-size: 13px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
}

.diff-line {
  padding: 6px 10px;
  line-height: 1.5;
}

.diff-before {
  background: #fff5f5;
  border-bottom: 1px solid #e0e0e0;
}

.diff-after {
  background: #f0fff0;
  border-bottom: 1px solid #e0e0e0;
}

.diff-reason {
  background: #f8f9fa;
  color: #555;
}

.diff-label {
  font-weight: 700;
  font-size: 11px;
  margin-right: 6px;
  display: inline-block;
  width: 60px;
  flex-shrink: 0;
}

.diff-before .diff-label {
  color: #cc4444;
}

.diff-after .diff-label {
  color: #44aa44;
}

.diff-reason .diff-label {
  color: #666;
}

.diff-del {
  background: #fcc;
  color: #a00;
  text-decoration: line-through;
  border-radius: 2px;
  padding: 0 1px;
}

.diff-ins {
  background: #cfc;
  color: #070;
  border-radius: 2px;
  padding: 0 1px;
}

.empty-state {
  text-align: center;
  color: #999;
  padding: 48px 0;
  font-size: 14px;
}

/* --- 認証ゲート（ログイン画面） --- */
[hidden] {
  display: none !important;
}

.auth-gate {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #5b87df 0%, #3d63b8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.auth-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.auth-card h1 {
  font-size: 22px;
  color: #333;
  margin-bottom: 8px;
}

.auth-desc {
  color: #666;
  font-size: 14px;
  margin-bottom: 24px;
}

.auth-btn {
  background: #5b87df;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  font-size: 15px;
  cursor: pointer;
  width: 100%;
  font-weight: 500;
  transition: background 0.15s ease;
}

.auth-btn:hover {
  background: #4a76ce;
}

.auth-error {
  color: #c5221f;
  font-size: 13px;
  margin-top: 16px;
  white-space: pre-line;
  text-align: left;
  background: #fdecea;
  padding: 10px 12px;
  border-radius: 6px;
  border-left: 3px solid #c5221f;
}

.auth-hint {
  color: #999;
  font-size: 12px;
  margin-top: 20px;
}

/* ヘッダー右側のユーザー情報 */
.user-info {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
}

.user-info button {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
}

.user-info button:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* =========================================================
   ホワイトリスト
   ========================================================= */
:root {
  --wl-bg: #ffffff;
  --wl-border: #e6e8eb;
  --wl-muted: #6b7280;
  --wl-fg: #1f2937;
  --wl-accent: #1a73e8;
  --wl-accent-soft: #eaf2fe;
  --wl-success: #1e7e34;
  --wl-success-soft: #e8f6ed;
}

/* ヘッダの管理ボタン */
.wl-header-btn {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 6px;
  padding: 5px 10px !important;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}
.wl-header-btn:hover { background: rgba(255, 255, 255, 0.25) !important; }
.wl-header-btn svg { width: 14px; height: 14px; }

/* 指摘カードに追加するピル型ボタン */
.check-issue-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.wl-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--wl-border);
  color: var(--wl-muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.4;
  transition: all 0.12s ease;
}
.wl-pill:hover {
  background: var(--wl-accent-soft);
  border-color: var(--wl-accent);
  color: var(--wl-accent);
}
.wl-pill svg { width: 12px; height: 12px; }
.wl-pill.is-added,
.wl-pill[disabled] {
  background: var(--wl-success-soft);
  border-color: transparent;
  color: var(--wl-success);
  cursor: default;
}
.wl-pill.is-added:hover {
  background: var(--wl-success-soft);
  border-color: transparent;
  color: var(--wl-success);
}

/* 右スライドインの一覧パネル */
.wl-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.wl-panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.wl-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 460px;
  max-width: 92vw;
  background: var(--wl-bg);
  box-shadow: -16px 0 40px rgba(15, 23, 42, 0.12);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(.2,.8,.2,1);
  display: flex;
  flex-direction: column;
}
.wl-panel.open { transform: translateX(0); }

.wl-panel-header {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--wl-border);
}
.wl-panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--wl-fg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.wl-panel-close {
  background: none;
  border: none;
  color: var(--wl-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 20px;
  line-height: 1;
}
.wl-panel-close:hover { background: #f4f5f6; color: var(--wl-fg); }

.wl-panel-desc {
  font-size: 12px;
  color: var(--wl-muted);
  margin-top: 4px;
}

.wl-add-row {
  display: flex;
  gap: 8px;
  margin: 14px 0 0;
}
.wl-add-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--wl-border);
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  transition: all 0.12s;
}
.wl-add-row input:focus {
  outline: none;
  border-color: var(--wl-accent);
  box-shadow: 0 0 0 3px var(--wl-accent-soft);
}
.wl-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--wl-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
}
.wl-add-btn:hover { background: #0d17d0; }
.wl-add-btn:disabled {
  background: #c5c9d1;
  cursor: not-allowed;
}
.wl-add-btn svg { width: 12px; height: 12px; }

.wl-search {
  margin: 10px 0 0;
  position: relative;
}
.wl-search input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--wl-border);
  border-radius: 6px;
  font-size: 13px;
  background: #fafbfc;
  transition: all 0.12s;
}
.wl-search input:focus {
  outline: none;
  border-color: var(--wl-accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--wl-accent-soft);
}
.wl-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--wl-muted);
}

.wl-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px 24px;
}
.wl-count {
  font-size: 11px;
  color: var(--wl-muted);
  padding: 12px 0 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid #f1f3f5;
}
.wl-row:hover { background: #fafbfc; }
.wl-row:last-child { border-bottom: none; }

.wl-row-word {
  font-size: 14px;
  font-weight: 500;
  color: var(--wl-fg);
  flex: 1;
  min-width: 0;
  word-break: break-all;
}
.wl-row-meta {
  font-size: 11px;
  color: var(--wl-muted);
  text-align: right;
  white-space: nowrap;
}
.wl-row-delete {
  background: none;
  border: none;
  color: #cbd0d6;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
}
.wl-row-delete:hover { background: #fce8e6; color: #c5221f; }

.wl-empty {
  text-align: center;
  color: #b0b6bd;
  font-size: 13px;
  padding: 48px 16px;
}

/* トースト */
.wl-toast-stack {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.wl-toast {
  background: #1f2937;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  pointer-events: auto;
  animation: wl-toast-in 0.2s ease-out;
}
.wl-toast.is-error { background: #b91c1c; }
.wl-toast-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}
.wl-toast-undo {
  background: none;
  border: none;
  color: #93c5fd;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 0;
}
.wl-toast-undo:hover { color: #bfdbfe; text-decoration: underline; }
@keyframes wl-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =====================================================================
   決まりもの (allowlist) 管理パネル
   ---------------------------------------------------------------------
   .wl-panel の見た目を継承しつつ、番組セレクタ・bulk-import 用の入力群と
   サムネイル付きリストのスタイルだけを追加する。トースト・open/close の
   演出は .wl-* をそのまま利用する。
   ===================================================================== */
.al-program-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--wl-border);
}
.al-program-label {
  font-size: 12px;
  color: var(--wl-fg-muted);
  font-weight: 600;
}
.al-program-row select {
  flex: 1;
  padding: 6px 8px;
  font-size: 13px;
  border: 1px solid var(--wl-border);
  border-radius: 6px;
  background: #fff;
  color: var(--wl-fg);
}

.al-bulk-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 20px;
  background: #f9fafb;
  border-bottom: 1px solid var(--wl-border);
}
.al-bulk-hint {
  font-size: 11px;
  color: var(--wl-fg-muted);
}
.al-bulk-row input {
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid var(--wl-border);
  border-radius: 6px;
  background: #fff;
}
.al-bulk-row .wl-add-btn { align-self: flex-end; }

.al-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid #eef1f4;
}
.al-row:hover { background: #fafbfc; }
.al-row:last-child { border-bottom: none; }

.al-row-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  background: #e5e7eb;
  flex-shrink: 0;
}
.al-row-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--wl-fg-muted);
  font-size: 20px;
}
.al-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.al-row-phash {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--wl-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.al-row-note {
  font-size: 12px;
  color: var(--wl-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
