/* ══════════════════════════════════════════════════
   CINEGENE RESEARCH — 内部作業ダッシュボード
   ══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500&family=Barlow+Condensed:wght@400;500;600;700;800&family=Noto+Sans+JP:wght@300;400;500;700&display=swap');

/* ── CSS Variables ── */
:root {
  /* Backgrounds */
  --bg:          #f2f0eb;
  --bg-surface:  #ffffff;
  --bg-raised:   #e8e5df;
  --bg-hover:    #e0dcd5;

  /* Borders */
  --border:      #d4d0c8;
  --border-mid:  #bab6ae;
  --border-hi:   #9a958d;

  /* Brand accent — darker for light bg */
  --gold:        #7a5c00;
  --gold-bright: #9a7400;
  --gold-dim:    #c8a840;
  --crimson:     #b52e26;
  --mist:        #2a5c98;

  /* Text */
  --text:        #1a1816;
  --text-mid:    #48443e;
  --text-dim:    #7a756e;
  --text-ink:    #2a2520;

  /* ── Semantic item backgrounds ── */
  /* 期待通りのデータあり → 緑（低彩度） */
  --item-good-bg:      #e8f5e3;
  --item-good-border:  #aed4a5;
  /* 空欄・情報なし・要約済み → グレー */
  --item-gray-bg:      #ebebeb;
  --item-gray-border:  #cccccc;

  /* Group label column */
  --label-bg:    #e4e1d9;
  --label-text:  #1a1816;

  /* Fonts */
  --font-body:    'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --font-mono:    'JetBrains Mono', 'Hiragino Sans', monospace;
  --font-ui:      'Barlow Condensed', 'Noto Sans JP', sans-serif;

  --radius:    6px;
  --radius-lg: 10px;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ══ HEADER ══ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 36px;
  border-bottom: 2px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-mark {
  width: 34px;
  height: 34px;
  background: var(--gold);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.78rem;
  display: grid;
  place-items: center;
  border-radius: 4px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-main {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--text);
}

.logo-sub {
  font-family: var(--font-ui);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--text-dim);
}

.nav-tagline {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ══ MAIN ══ */
.site-main { min-height: calc(100vh - 120px); }

/* ══ FOOTER ══ */
.site-footer {
  padding: 20px 36px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.footer-sep { color: var(--border-hi); }

/* ══ INDEX — HERO ══ */
.hero {
  padding: 60px 36px 48px;
  max-width: 820px;
  border-bottom: 1px solid var(--border);
}

.hero-eyebrow {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-body);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 16px;
}

.hero-title em {
  font-style: italic;
  color: var(--gold);
}

.hero-desc {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.8;
  margin-bottom: 36px;
}

/* ── 検索フォーム ── */
.search-form { max-width: 640px; }

.search-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 5px 5px 5px 16px;
  gap: 10px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.search-wrap:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(122, 92, 0, 0.10);
}

.search-icon { color: var(--gold); font-size: 1rem; flex-shrink: 0; }

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 9px 0;
}

.search-input::placeholder { color: var(--text-dim); }

.search-btn {
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 9px 20px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition);
  flex-shrink: 0;
}

.search-btn:hover { background: var(--gold-bright); }
.btn-arrow { font-size: 0.95rem; }

/* ── インポートフォーム（ファイル選択） ── */
.import-file-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.import-file-wrap input[type="file"] {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  opacity: 0;
}

.import-file-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1.5px dashed var(--border-mid);
  border-radius: var(--radius);
  padding: 9px 16px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.import-file-label:hover { border-color: var(--gold); color: var(--gold); }

.import-file-names {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.import-submit-btn { margin-top: 16px; }
.import-back-link { margin-top: 24px; margin-bottom: 0; }

.import-mode-wrap {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.import-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1 1 220px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.import-mode-option:has(input:checked) {
  border-color: var(--gold);
  background: var(--bg-surface-hover, var(--bg-surface));
}

.import-mode-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--gold);
  flex-shrink: 0;
}

.import-mode-option span {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mid);
  line-height: 1.5;
}

.import-mode-option small {
  display: block;
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ══ INDEX — FILM LIST ══ */
.film-list-section { padding: 40px 36px; }

.list-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 24px;
}

.list-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-mid);
}

.count-badge {
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  color: var(--text-mid);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 20px;
}

.film-list { display: flex; flex-direction: column; gap: 2px; }

.film-entry {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.film-entry:hover {
  border-color: var(--border-mid);
  box-shadow: 0 2px 6px rgba(0,0,0,0.07);
}

.film-entry.is-complete:hover { border-color: var(--gold-dim); }

.film-entry-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
}

.film-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
  min-width: 110px;
}

.film-date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.status-pill {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.status-done  { color: #3a8a5a; }
.status-wip   { color: var(--gold); }
.status-err   { color: var(--crimson); }

.film-title-entry {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.film-actions { display: flex; gap: 7px; flex-shrink: 0; }

.action-btn {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
}

.action-primary {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}

.action-primary:hover { background: var(--gold-bright); border-color: var(--gold-bright); }

.action-ghost {
  color: var(--text-dim);
  border-color: var(--border-mid);
}

.action-ghost:hover { color: var(--crimson); border-color: var(--crimson); }

.film-entry-accent {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: transparent;
  transition: background var(--transition);
}

.film-entry.is-complete:hover .film-entry-accent { background: var(--gold); }
.film-entry.is-researching .film-entry-accent    { background: var(--gold-dim); }

/* ── 空状態 ── */
.empty-state { text-align: center; padding: 72px 0; }

.empty-reel { width: 56px; height: 56px; position: relative; margin: 0 auto 20px; }
.reel-ring {
  width: 56px; height: 56px;
  border: 2px solid var(--border-mid);
  border-radius: 50%;
}
.reel-hub {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 16px; height: 16px;
  border: 2px solid var(--border-mid);
  border-radius: 50%;
}

.empty-text { font-size: 1rem; color: var(--text-mid); margin-bottom: 7px; }
.empty-sub  { font-size: 0.82rem; color: var(--text-dim); }

/* ══ FILM DETAIL — HEADER ══ */
.film-header {
  position: sticky;
  top: 55px;
  z-index: 90;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.film-header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 36px;
}

.back-link {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-decoration: none;
  flex-shrink: 0;
  transition: color var(--transition);
}

.back-link:hover { color: var(--gold); }

.film-header-title { flex: 1; min-width: 0; }

.film-name {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.film-date-small {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.film-header-actions { display: flex; gap: 7px; flex-shrink: 0; }

.hdr-btn {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 7px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all var(--transition);
  background: none;
}

.hdr-btn-primary {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}

.hdr-btn-primary:hover { background: var(--gold-bright); }

.hdr-btn-ghost {
  color: var(--text-dim);
  border-color: var(--border-mid);
}

.hdr-btn-ghost:hover { color: var(--crimson); border-color: var(--crimson); }

.hdr-btn-focus {
  color: var(--text-mid);
  border-color: var(--border-mid);
}

.hdr-btn-focus:hover { color: var(--gold); border-color: var(--gold-dim); }

.hdr-btn-focus.is-active {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(122,92,0,0.08);
}

/* ── プログレスバー ── */
.progress-banner {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 36px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 7px;
}

.progress-label {
  font-family: var(--font-ui);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 7px;
}

.pulse-dot {
  width: 7px; height: 7px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

.progress-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-mid);
}

.progress-track {
  height: 3px;
  background: var(--border-mid);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* ══ SECTIONS ══ */
.sections-wrap {
  padding: 28px 36px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 1100px;
}

.section-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}

.section-block:hover { border-color: var(--border-mid); }

/* 先に結論 */
.section-conclusion {
  border-color: var(--gold-dim);
  border-width: 2px;
}

.section-conclusion .sec-num {
  color: var(--gold);
  border-color: var(--gold-dim);
}

/* Podcast系 */
.section-podcast {
  border-color: rgba(42, 92, 152, 0.35);
}

.section-podcast .sec-num {
  color: var(--mist);
  border-color: rgba(42, 92, 152, 0.4);
}

/* ── セクションヘッダー ── */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  transition: background var(--transition);
}

/* sec-head の色はパターン別クラスで制御（下記 sec-pattern-* を参照） */

.sec-head-left { display: flex; align-items: center; gap: 12px; }

.sec-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  border: 1px solid var(--border-mid);
  border-radius: 3px;
  padding: 2px 6px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.sec-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.sec-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text);
  letter-spacing: 0.01em;
}

.sec-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  background: var(--bg-surface);
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.status-wip-text { color: var(--gold); }
.status-err-text  { color: var(--crimson); }

.sec-head-right { display: flex; align-items: center; gap: 5px; }

.sec-ctrl-btn {
  font-family: var(--font-ui);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all var(--transition);
}

.sec-ctrl-btn:hover { color: var(--text); border-color: var(--border-hi); }

.sec-chevron {
  color: var(--text-dim);
  font-size: 0.85rem;
  transition: transform var(--transition);
  margin-left: 3px;
}

/* ── セクション本文 ── */
.sec-body {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}

/* ── アイテム行 ── */
.item-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  background: var(--bg-surface);
}

.item-row:last-child { border-bottom: none; }
.item-row:hover { background: var(--bg-hover) !important; }

/* ── セマンティック背景色 ── */
.item-row.item-good    { background: var(--item-good-bg); }
.item-row.item-empty   { background: var(--item-gray-bg); }
.item-row.item-nodata  { background: var(--item-gray-bg); }
.item-row.item-summary { background: var(--item-gray-bg); }

.item-row.item-off { opacity: 0.4; }
.item-row.item-off .item-text { text-decoration: line-through; }

/* アイテムなしラベル（セパレーター） */
.item-section-sep {
  padding: 0.4rem 1rem 0.4rem 1.2rem;
  font-size: 0.8em;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-mid);
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--border-hi);
}

/* 要約済み参照行 */
.item-row.item-summary-ref {
  opacity: 0.6;
  pointer-events: none;
}
.item-row.item-summary-ref .item-check-wrap,
.item-row.item-summary-ref .edit-icon { display: none; }
.item-row.item-summary-ref .item-text {
  color: var(--text-mid);
  font-size: 0.82em;
  font-style: italic;
}

/* ── フォーカスモード ── */
body.focus-mode .item-row.item-off { display: none; }
body.focus-mode .group-content-cells .item-row.item-off { display: none; }

/* ── カスタムチェックボックス ── */
.item-check-wrap {
  display: flex;
  align-items: flex-start;
  padding-top: 13px;
  padding-right: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.custom-check {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-hi);
  border-radius: 3px;
  display: grid;
  place-items: center;
  background: var(--bg-surface);
  transition: all var(--transition);
  flex-shrink: 0;
}

.custom-check svg {
  width: 9px; height: 7px;
  color: #fff;
  opacity: 0;
  transition: opacity var(--transition);
}

.item-cb:checked + .custom-check {
  background: var(--gold);
  border-color: var(--gold);
}

.item-cb:checked + .custom-check svg { opacity: 1; }

/* ── アイテム本文 ── */
.item-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 11px 0 11px;
  min-width: 0;
  position: relative;
}

.item-text {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.75;
  flex: 1;
  cursor: text;
  word-break: break-word;
}

/* 編集アイコン */
.edit-icon {
  opacity: 0;
  background: none;
  border: 1px solid var(--border-mid);
  color: var(--text-dim);
  font-size: 0.72rem;
  padding: 2px 5px;
  border-radius: 3px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
  margin-top: 1px;
  line-height: 1.4;
}

.item-row:hover .edit-icon { opacity: 1; }
.edit-icon:hover { color: var(--gold); border-color: var(--gold); }

/* ── インライン編集 ── */
.item-edit-wrap { flex: 1; padding: 9px 0; }

.item-textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.65;
  padding: 9px 11px;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.item-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(122,92,0,0.12);
}

.edit-actions { display: flex; gap: 7px; margin-top: 7px; }

.edit-save, .edit-cancel {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.edit-save {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}

.edit-save:hover { background: var(--gold-bright); }

.edit-cancel {
  background: none;
  color: var(--text-dim);
  border-color: var(--border-mid);
}

.edit-cancel:hover { color: var(--text); border-color: var(--border-hi); }

/* ── エラー / ローディング / 空 ── */
.sec-error {
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--crimson);
}

.sec-loading {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.loading-dots span { animation: blink 1.4s infinite; opacity: 0; }
.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0; }
  40%            { opacity: 1; }
}

.sec-empty { padding: 18px 20px; font-size: 0.78rem; color: var(--text-dim); }

/* ══ 4カラムテーブル：C1大項目｜C2中項目｜C3小項目名｜C4内容 ══ */

/* セクション本文全体のラッパー */
.section-table {
  display: flex;
  border-top: 1px solid var(--border);
}

/* C1: 大項目名（縦書き・セクション全体にまたがる） */
.col-c1 {
  flex: 0 0 28px;
  background: #bfbbb1;        /* C2より2段階濃い：上位概念を視覚的に強調 */
  border-right: 2px solid var(--border-hi);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-mid);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 6px;
}

/* C2〜C4: グループ列コンテナ */
.col-groups {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* グループ1行（C2＋C3＋C4） */
.group-block {
  display: flex;
  border-bottom: 1px solid var(--border-mid);  /* 罫線を濃く */
}
.group-block:last-child { border-bottom: none; }

/* C2: 中項目名（グループ内全行にまたがる） */
.col-c2 {
  flex: 0 0 150px;
  padding: 10px 14px;
  background: var(--label-bg);   /* #e4e1d9：C1より明るい */
  border-right: 2px solid var(--border-mid);  /* C2右罫線を太く・濃く */
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--label-text);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
}

/* C3＋C4: アイテム行コンテナ */
.col-items {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* 各アイテム行 */
.item-4col {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border-mid);  /* 罫線を濃く */
  transition: background var(--transition);
}
.item-4col:last-child { border-bottom: none; }
.item-4col:hover { background: var(--bg-hover) !important; }

/* セマンティック背景 */
.item-4col-good { background: var(--item-good-bg); }
.item-4col-gray { background: var(--item-gray-bg); }
.item-4col-off  { opacity: 0.38; }
.item-4col-off .item-text { text-decoration: line-through; }
body.focus-mode .item-4col-off { display: none; }

/* チェックボックスラッパー（C4内に配置） */
.col-c4 .item-check-wrap {
  padding-top: 10px;
  padding-right: 8px;
  flex-shrink: 0;
}

/* C3: 小項目名 */
.col-c3 {
  flex: 0 0 150px;
  padding: 9px 10px 9px 14px;
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-mid);
  border-right: 1px solid var(--border);
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
}

/* C4: 小項目の内容 */
.col-c4 {
  flex: 1;
  padding: 9px 14px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  position: relative;
}

.item-4col:hover .edit-icon { opacity: 1; }

/* ══ セクション奇偶カラーパターン ══
   パターン1（奇数）: ウォームグレー×ベージュ×グリーン（現行デフォルト）
   パターン2（偶数）: クールセージ×ペールブルー×スカイ
════════════════════════════════════ */

/* ── パターン1: 奇数セクション（デフォルト、上書き不要） ── */
.sec-pattern-odd .sec-head               { background: #bfbbb1 !important; }
.sec-pattern-odd .sec-head:hover         { background: #b5b1a7 !important; }
.sec-pattern-odd .col-c1                 { background: #bfbbb1; border-right-color: var(--border-hi); }
.sec-pattern-odd .col-c2                 { background: var(--label-bg); }
.sec-pattern-odd .item-4col-good         { background: var(--item-good-bg); }

/* ── パターン2: 偶数セクション（クールセージ系） ── */
.sec-pattern-even .sec-head              { background: #9eaaa5 !important; }
.sec-pattern-even .sec-head:hover        { background: #94a09b !important; }
.sec-pattern-even .col-c1               { background: #9eaaa5; border-right-color: #7a8a85; }
.sec-pattern-even .col-c2               { background: #d8e2de; border-right-color: #9ab0aa; }
.sec-pattern-even .item-4col-good        { background: #e4f0ec; }
.sec-pattern-even .group-block           { border-bottom-color: #9ab0aa; }
.sec-pattern-even .item-4col             { border-bottom-color: #b0c4be; }
.sec-pattern-even .section-table         { border-top-color: #9ab0aa; }
.sec-pattern-even .col-c3               { border-right-color: #b0c4be; }

/* ══ EXPORT FOOTER ══ */
.export-footer {
  padding: 40px 36px;
  display: flex;
  justify-content: center;
}

.export-btn {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--gold);
  border: 1.5px solid var(--gold-dim);
  border-radius: 40px;
  padding: 12px 32px;
  transition: all var(--transition);
  background: rgba(122,92,0,0.04);
}

.export-btn:hover {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
  box-shadow: 0 2px 12px rgba(122,92,0,0.18);
}

/* ══ RESPONSIVE ══ */
@media (max-width: 768px) {
  .site-header { padding: 12px 18px; }
  .nav-tagline  { display: none; }
  .hero         { padding: 40px 18px 32px; }
  .film-list-section, .sections-wrap, .export-footer { padding-left: 18px; padding-right: 18px; }
  .film-entry-inner { flex-wrap: wrap; gap: 10px; }
  .film-actions { width: 100%; }
  .film-header-inner { padding: 10px 18px; }
  .film-name { font-size: 0.95rem; }
  .progress-banner { padding: 10px 18px; }
  .col-c1 { flex: 0 0 20px; font-size: 0.6rem; }
  .col-c2 { flex: 0 0 110px; font-size: 0.75rem; }
  .col-c3 { flex: 0 0 100px; font-size: 0.72rem; }
}

/* ══ AUTH（PHP移植で追加）══ */
.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-account {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}
.nav-account a {
  color: var(--mist);
  text-decoration: none;
}
.nav-account a:hover {
  text-decoration: underline;
}

.auth-page {
  max-width: 420px;
  margin: 64px auto;
  padding: 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.auth-title {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 1.3rem;
  margin-bottom: 8px;
}
.auth-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 24px;
  line-height: 1.7;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.auth-field label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-mid);
  letter-spacing: 0.04em;
}
.auth-field input {
  padding: 10px 12px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
}
.auth-field input:focus {
  outline: 2px solid var(--mist);
  outline-offset: 1px;
}
.auth-submit {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg-surface);
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition);
}
.auth-submit:hover {
  background: var(--gold-bright);
}
.auth-error {
  background: #fbeceb;
  border: 1px solid var(--crimson);
  color: var(--crimson);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  margin-bottom: 16px;
}
.auth-policy {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.8;
  margin-top: 4px;
}
.auth-policy li { margin-left: 1.2em; }

/* ══ 公開年フィールド・バッジ（同名異作品の取り違え防止用に追加）══ */
.search-year-input {
  width: 84px;
  flex-shrink: 0;
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 9px 10px;
  text-align: center;
}
.search-year-input::placeholder { color: var(--text-dim); }
.search-year-input:focus { border-color: var(--gold); }

.search-year-hint {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 8px;
  padding-left: 4px;
}

.film-year-badge {
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.85em;
}
