/* ===================== GLOBAL-THEME-DARK-LIGHT-SYSTEM-A86: ライトテーマ =====================
   ここに書くのは「ライトのときだけ効く上書き」だけ。既存のダーク（app.css / plot.css）は
   1行も書き換えていないので、data-theme="dark" のときはこのファイルの中身が一切効かない。

   考え方
     - 背景は白〜オフホワイト、カードは白、罫線はライト〜ミドルグレー。
     - 文字は黒〜濃いグレー。補助はミドルグレー。白背景に対して読める濃さを確保する。
     - ダークで「ゴールド」だったデザイン上のアクセントは、ライトでは炭色（チャコール）にする。
       意味を持つ色（注意・エラー・良い・危険）は色みを残したまま、白地で読める濃さへ置き換える。
     - 影はダークの重い影を弱め、境界は罫線で見せる。
   ============================================================================================ */
html[data-theme="light"]{
  --bg:#f5f6f8;             /* ベース背景（オフホワイト） */
  --panel:#ffffff;          /* カード・パネル */
  --panel-2:#eef0f4;        /* 一段沈めたパネル */
  --line:#d3d8e0;           /* 罫線（ライト〜ミドルグレー） */
  --text:#16181d;           /* 基本テキスト（ほぼ黒） */
  --text-sub:#4b525c;       /* サブテキスト（濃いグレー） */
  --text-mute:#6b7280;      /* 補足（ミドルグレー） */
  --gold:#3a4049;           /* アクセント：ライトでは炭色 */
  --gold-soft:#20242b;      /* 見出し・強調（さらに濃い炭色） */
  --navy:#2f4f7d;
  --good:#1f7a52;
  --warn:#9a5b1f;
  --risk:#a33a3a;
  --shadow:0 4px 16px rgba(20,24,32,.10);
  /* このテーマだけで使う補助色 */
  --lt-hover:#e7eaf0;       /* hover の薄グレー */
  --lt-selected:#20242b;    /* 選択中（濃い） */
  --lt-input-bg:#ffffff;
  --lt-head:#eceff4;        /* テーブル見出し・ヘッダー帯 */
  --lt-disabled:#9aa1ab;
}
/* 背景：ダークの光彩グラデーションは使わず、白基調にごく薄い陰影だけ残す */
html[data-theme="light"] body{
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(58,64,73,.05), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(47,79,125,.05), transparent 60%),
    var(--bg);
  color:var(--text);
}
html[data-theme="light"] .app-shell{background:var(--bg);}

/* ---------- サイドバー ---------- */
html[data-theme="light"] .app-sidebar{
  background:#ffffff;border-right:1px solid var(--line);
  scrollbar-color:#c3c9d2 transparent;
}
html[data-theme="light"] .app-sidebar::-webkit-scrollbar-thumb{background:#c3c9d2;}
html[data-theme="light"] .app-sidebar .brand-mini{background:#ffffff;border-bottom:1px solid var(--line);}
html[data-theme="light"] .app-sidebar .brand-mini h1{color:var(--gold-soft);}
html[data-theme="light"] .app-sidebar .brand-mini .by{color:#6b7280;}
html[data-theme="light"] .app-sidebar .brand-mini .platform{color:#8a919b;}
html[data-theme="light"] .app-sidebar .menu-parent{color:#20242b;}
html[data-theme="light"] .app-sidebar .menu-parent:hover{background:var(--lt-hover);}
html[data-theme="light"] .app-sidebar .menu-group.open .menu-parent{color:#000;}
html[data-theme="light"] .app-sidebar .menu-children{border-left:1px solid var(--line);}
html[data-theme="light"] .app-sidebar .menu-child{color:#4b525c;}
html[data-theme="light"] .app-sidebar .menu-child>.rank-meta{color:#6b7280;}
html[data-theme="light"] .app-sidebar .menu-child:hover{background:var(--lt-hover);color:#16181d;}
html[data-theme="light"] .app-sidebar .menu-child:hover>.rank-meta{color:#4b525c;}
/* 選択中は背景と同化しないよう、濃い色で塗る */
html[data-theme="light"] .app-sidebar .menu-child.active{
  background:var(--lt-selected);color:#ffffff;border-left-color:var(--lt-selected);
}
html[data-theme="light"] .app-sidebar .menu-child.active>.rank-meta{color:#e5e7eb;}

/* ---------- カード・見出し・区切り ---------- */
html[data-theme="light"] .card{background:var(--panel);border:1px solid var(--line);box-shadow:var(--shadow);}
html[data-theme="light"] .section-title h2{color:var(--gold-soft);}
html[data-theme="light"] .hint,
html[data-theme="light"] .rank-meta{color:var(--text-mute);}
html[data-theme="light"] .empty{color:var(--text-mute);}

/* ---------- ボタン ---------- */
html[data-theme="light"] .btn{background:#ffffff;border:1px solid var(--line);color:var(--text);}
html[data-theme="light"] .btn:hover{background:var(--lt-hover);border-color:#a9b1bd;color:var(--text);}
html[data-theme="light"] .btn.primary{
  background:linear-gradient(135deg,#3a4049,#20242b);color:#ffffff;border-color:#20242b;
}
html[data-theme="light"] .btn.primary:hover{color:#ffffff;filter:brightness(1.12);}
html[data-theme="light"] .btn.ghost{background:transparent;}
html[data-theme="light"] .btn.danger{border-color:rgba(163,58,58,.45);color:#a33a3a;background:#fff;}
html[data-theme="light"] .btn.danger:hover{background:rgba(163,58,58,.10);}
html[data-theme="light"] .btn.active,
html[data-theme="light"] .btn.on{background:var(--lt-selected);color:#ffffff;border-color:var(--lt-selected);}
html[data-theme="light"] .btn:disabled,
html[data-theme="light"] .btn[disabled]{color:var(--lt-disabled);border-color:#e1e5eb;background:#f2f4f7;}
html[data-theme="light"] .btn-bt{border:1px solid var(--gold);background:rgba(58,64,73,.08);color:var(--gold-soft);}
html[data-theme="light"] .btn-bt:hover{background:rgba(58,64,73,.16);}

/* ---------- 入力欄 ---------- */
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea{color-scheme:light;}
html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .import-form input[type=text],
html[data-theme="light"] .import-form input[type=date],
html[data-theme="light"] .import-form select,
html[data-theme="light"] .import-form textarea,
html[data-theme="light"] .modern-select,
html[data-theme="light"] .online-search,
html[data-theme="light"] .horse-ac-input,
html[data-theme="light"] .list-membership-search,
html[data-theme="light"] .horse-tag-search{
  background:var(--lt-input-bg);color:var(--text);border:1px solid var(--line);
}
html[data-theme="light"] .field input:focus,
html[data-theme="light"] .field select:focus,
html[data-theme="light"] .field textarea:focus{border-color:var(--gold);box-shadow:0 0 0 2px rgba(58,64,73,.12);}
html[data-theme="light"] ::placeholder{color:#8a919b;opacity:1;}
html[data-theme="light"] input:disabled,
html[data-theme="light"] select:disabled,
html[data-theme="light"] textarea:disabled{background:#f2f4f7;color:var(--lt-disabled);}
html[data-theme="light"] .field label{color:var(--text-sub);}
html[data-theme="light"] .field label.m-attach{color:var(--gold-soft);}
html[data-theme="light"] .form-sec > h4{color:var(--gold-soft);}

/* ---------- 表 ---------- */
html[data-theme="light"] .import-table th,
html[data-theme="light"] .import-table td{border-color:var(--line);color:var(--text);}
html[data-theme="light"] .import-table th{background:var(--lt-head);color:var(--text-sub);}
html[data-theme="light"] .import-table tr:hover td{background:var(--lt-hover);}
html[data-theme="light"] .import-table .empty{color:var(--text-mute);}
html[data-theme="light"] .hd-race-table th,
html[data-theme="light"] .hd-race-table td{border-color:var(--line);}
html[data-theme="light"] .hd-race-table thead th{background:var(--lt-head);color:var(--text-sub);}
html[data-theme="light"] .ai-autofill-preview-table th{background:var(--lt-head);color:var(--text-sub);}
html[data-theme="light"] .ai-autofill-preview-table th,
html[data-theme="light"] .ai-autofill-preview-table td{border-color:var(--line);}
html[data-theme="light"] .batch-bar button{background:#fff;color:var(--text);border:1px solid var(--line);}
html[data-theme="light"] .batch-bar button.active{background:var(--lt-selected);color:#fff;border-color:var(--lt-selected);}

/* ---------- モーダル・オーバーレイ ---------- */
html[data-theme="light"] .plot-modal,
html[data-theme="light"] .ai-register-modal,
html[data-theme="light"] .bt-modal,
html[data-theme="light"] .modal-backdrop{background:rgba(16,18,22,.45);}
html[data-theme="light"] .plot-sheet,
html[data-theme="light"] .ai-register-sheet,
html[data-theme="light"] .bt-modal .sheet,
html[data-theme="light"] .modal-sheet{background:#ffffff;color:var(--text);border:1px solid var(--line);}
html[data-theme="light"] .plot-header,
html[data-theme="light"] .ai-register-header{border-bottom:1px solid var(--line);}
html[data-theme="light"] .plot-help{color:var(--text-sub);}
html[data-theme="light"] .mobile-menu-backdrop{background:rgba(16,18,22,.35);}

/* ---------- 通知（flash / toast） ---------- */
html[data-theme="light"] .flash,
html[data-theme="light"] .toast{background:#20242b;color:#ffffff;border:1px solid #20242b;}

/* ---------- バッジ・状態色（意味は残し、白地で読める濃さへ） ---------- */
html[data-theme="light"] .badge{border-color:var(--line);}

/* ---------- Horse Data / インフォメーション ---------- */
html[data-theme="light"] .hd-sec,
html[data-theme="light"] .hd-ai-card,
html[data-theme="light"] .hd-race-entry,
html[data-theme="light"] .hd-bcs-row,
html[data-theme="light"] .hd-race-chip,
html[data-theme="light"] .hd-race-entry-finish,
html[data-theme="light"] .hd-bcs-avg,
html[data-theme="light"] .plot-usage-metric{
  background:var(--panel);border-color:var(--line);
}
html[data-theme="light"] .hd-sec-head h3,
html[data-theme="light"] .hd-ai-card-title,
html[data-theme="light"] .hd-ai-frame-title{color:var(--gold-soft);}
html[data-theme="light"] .hd-k,
html[data-theme="light"] .hd-bcs-part,
html[data-theme="light"] .hd-race-chip-k{color:var(--text-sub);}
html[data-theme="light"] .hd-v,
html[data-theme="light"] .hd-bcs-score,
html[data-theme="light"] .hd-race-chip-v{color:var(--text);}
html[data-theme="light"] .hd-field.is-empty .hd-v{color:var(--text-mute);}
html[data-theme="light"] .hd-v a{color:#2f4f7d;}
html[data-theme="light"] .hd-ai-frame,
html[data-theme="light"] .hd-doc-frame,
html[data-theme="light"] .hd-race-entries{background:var(--panel);border-color:var(--line);}
html[data-theme="light"] .hd-ai-card-body::-webkit-scrollbar-thumb,
html[data-theme="light"] .hd-race-entries::-webkit-scrollbar-thumb{background:#c3c9d2;}
html[data-theme="light"] .hd-bcs-avg-v,
html[data-theme="light"] .badge.plot-usage-rank{color:var(--gold-soft);border-color:var(--gold);background:#fff;}
html[data-theme="light"] .plot-usage-head{background:#ffffff;border-bottom-color:var(--line);}
html[data-theme="light"] .plot-usage-metric.is-active{border-color:var(--gold);}
html[data-theme="light"] .plot-usage-metric.is-active .plot-usage-metric-v{color:var(--gold-soft);}

/* ---------- AIパネル（登録/編集） ---------- */
html[data-theme="light"] .admin-ai-panel,
html[data-theme="light"] .admin-ai-output,
html[data-theme="light"] .admin-ai-column{background:var(--panel);border-color:var(--line);color:var(--text);}
html[data-theme="light"] .admin-ai-panel-title{color:var(--gold-soft);}
html[data-theme="light"] .admin-ai-output:empty::before{color:var(--text-mute);}

/* ---------- 馬カード・一覧 ---------- */
html[data-theme="light"] .hcard{background:var(--panel);border-color:var(--line);}
html[data-theme="light"] .hcard:hover{border-color:#a9b1bd;}
html[data-theme="light"] .hcard .photo{background:var(--panel-2);}
html[data-theme="light"] .hcard .ped,
html[data-theme="light"] .hcard .share{color:var(--text-sub);}
html[data-theme="light"] .placeholder{background:var(--panel-2);color:var(--text-mute);}

/* ---------- メディア（写真・動画・PDF）まわりの枠だけ ----------
   画像・動画・PDFそのものには手を入れない（filter などをかけない）。 */
html[data-theme="light"] .m-thumb{background:var(--panel-2);border-color:var(--line);}
html[data-theme="light"] .m-thumb .m-ord,
html[data-theme="light"] .m-thumb .mtag{background:rgba(32,36,43,.78);color:#fff;}
html[data-theme="light"] .m-thumb .m-pdf-preview{background:var(--panel-2);color:var(--text-sub);}

/* ---------- プロット（UIの枠だけ。座標・保存値・点や線の意味色は変えない） ---------- */
html[data-theme="light"] .plot-panel{background:#ffffff;border:1px solid var(--line);}
html[data-theme="light"] .plot-panel .plot-image-note,
html[data-theme="light"] .plot-panel .plot-bg-status,
html[data-theme="light"] .plot-panel .plot-adjust-row label,
html[data-theme="light"] .plot-panel .plot-coord-row .plot-coord-label{color:var(--text-sub);}
html[data-theme="light"] .plot-panel .plot-bg-info{background:#f7f8fa;border-color:var(--line);color:var(--text-sub);}
html[data-theme="light"] .plot-panel .plot-bg-info-row span:first-child{color:var(--text-mute);}
html[data-theme="light"] .plot-panel .mode-row button{background:#fff;color:var(--text);border-color:var(--line);}
html[data-theme="light"] .plot-panel .mode-row button.active{background:var(--lt-selected);color:#fff;border-color:var(--lt-selected);}
html[data-theme="light"] .plot-panel select,
html[data-theme="light"] .plot-panel input[type=text]{background:#fff;color:var(--text);border-color:var(--line);}
html[data-theme="light"] .plot-card,
html[data-theme="light"] .plot-card-media{background:var(--panel-2);border-color:var(--line);}
html[data-theme="light"] .plot-card-name{color:var(--text);}
html[data-theme="light"] .comparison-detail-row td{background:#f7f8fa;}
html[data-theme="light"] .comparison-detail-box,
html[data-theme="light"] .comparison-section{background:#ffffff;border-color:var(--line);}
html[data-theme="light"] .comparison-section-head{background:var(--lt-head);color:var(--text);}
html[data-theme="light"] .comparison-section-head:hover{background:var(--lt-hover);}
/* 作業台（写真を置く面）は、写真の色を変えないよう中立の薄いグレーにする */
html[data-theme="light"] .plot-editor-canvas{background:#e9ebef;}
html[data-theme="light"] .base-plot-preview{background:#f7f8fa;border-color:var(--line);}
/* 点のラベルは白地で読めるよう、白抜きから黒文字＋白縁へ入れ替える */
html[data-theme="light"] .plot-editor-svg .pt-label{fill:#16181d;stroke:#ffffff;}
html[data-theme="light"] .plot-editor-svg .pt-circle{stroke:#20242b;}
html[data-theme="light"] .plot-editor-svg .pt-circle.selected{stroke:#20242b;filter:drop-shadow(0 0 4px rgba(32,36,43,.55));}

/* ---------- 設定画面のテーマ選択（A86で追加） ---------- */
html[data-theme="light"] .theme-choice{background:#ffffff;border-color:var(--line);color:var(--text);}
html[data-theme="light"] .theme-choice:hover{background:var(--lt-hover);}
html[data-theme="light"] .theme-choice.is-active{background:var(--lt-selected);color:#ffffff;border-color:var(--lt-selected);}
html[data-theme="light"] .theme-choice.is-active .theme-choice-note{color:#e5e7eb;}

/* ---------- 縦向きの案内（A85） ---------- */
html[data-theme="light"] .orientation-guard{background:var(--bg);color:var(--text);}
html[data-theme="light"] .orientation-guard h2{color:var(--gold-soft);}
html[data-theme="light"] .orientation-guard p{color:var(--text-sub);}

/* ---------- スクロールバー ---------- */
html[data-theme="light"] *::-webkit-scrollbar-thumb{background:#c3c9d2;}
html[data-theme="light"] *{scrollbar-color:#c3c9d2 transparent;}

/* ============================================================================================
   ここから下は、app.css / plot.css に直書きされているダーク色に対する1:1の上書き。
   （ダーク側の値は触っていない。ライトのときだけこの指定が効く）
   ============================================================================================ */

/* ---------- 取込・一覧まわり ---------- */
html[data-theme="light"] .import-form label,
html[data-theme="light"] .ai-reg-form label{color:var(--text-sub);}
html[data-theme="light"] .ai-reg-form input[type=text],
html[data-theme="light"] .ai-reg-form select,
html[data-theme="light"] .ai-reg-form textarea,
html[data-theme="light"] .plot-prompt-input,
html[data-theme="light"] .lm-sys-rename-input,
html[data-theme="light"] .horse-tag-rename-input,
html[data-theme="light"] .horse-tag-create input,
html[data-theme="light"] .admin-remark-input,
html[data-theme="light"] .admin-ai-size,
html[data-theme="light"] .plot-header-category select{
  background:#ffffff;color:var(--text);border-color:var(--line);
}
html[data-theme="light"] .placeholder-note,
html[data-theme="light"] .ai-bt-block,
html[data-theme="light"] .ai-autofill-pre-row,
html[data-theme="light"] .ai-autofill-history-item,
html[data-theme="light"] .ai-autofill-section-check,
html[data-theme="light"] .ai-reg-domain-row label,
html[data-theme="light"] .import-folder-card,
html[data-theme="light"] .year-folder{background:#f7f8fa;border-color:var(--line);color:var(--text);}
html[data-theme="light"] .folder-title{color:var(--gold-soft);}
html[data-theme="light"] .folder-line{color:var(--text);}
html[data-theme="light"] .folder-block{border-bottom-color:var(--line);}
html[data-theme="light"] .ai-reg-preview-table th,
html[data-theme="light"] .online-horse-table th,
html[data-theme="light"] .cip-table thead th,
html[data-theme="light"] .pcmp-table thead th,
html[data-theme="light"] .hd-coord-table thead th{background:var(--lt-head);color:var(--text-sub);}
html[data-theme="light"] .ai-reg-preview-table th,
html[data-theme="light"] .ai-reg-preview-table td,
html[data-theme="light"] .ai-bt-table tr,
html[data-theme="light"] .ai-bt-table td,
html[data-theme="light"] .bloodline-type-row,
html[data-theme="light"] .lm-root-dropzone{border-color:var(--line);}
html[data-theme="light"] .cip-table .cip-sticky{background:#ffffff;}
html[data-theme="light"] .online-horse-row:hover td,
html[data-theme="light"] .catalog-picker-row:hover,
html[data-theme="light"] .online-catalog-row:hover,
html[data-theme="light"] .online-bid-card:hover,
html[data-theme="light"] .online-year-tab:hover,
html[data-theme="light"] .info-kv-clickable:hover,
html[data-theme="light"] .pedigree-name:hover,
html[data-theme="light"] .lm-crumb:hover,
html[data-theme="light"] .lm-grip:hover,
html[data-theme="light"] .horse-ac-item:hover,
html[data-theme="light"] .horse-ac-item.active{background:var(--lt-hover);}
html[data-theme="light"] .lm-ghost{background:var(--lt-hover);}
html[data-theme="light"] .horse-ac-list{background:#ffffff;border-color:var(--line);}
html[data-theme="light"] .note-horse-chip{background:var(--lt-head);color:var(--text);}
html[data-theme="light"] .note-horse-chip-del,
html[data-theme="light"] .horse-tag-create-msg,
html[data-theme="light"] .ai-bt-error,
html[data-theme="light"] .cip-warn,
html[data-theme="light"] .cip-thumb--ng,
html[data-theme="light"] .cip-frameset--ng .cip-frameset-title,
html[data-theme="light"] .plot-prompt-over{color:#a33a3a;}
html[data-theme="light"] .mini-badge.req{color:#a33a3a;}

/* ---------- 状態・信頼度・バッジ（意味を保ったまま白地で読める色へ） ---------- */
html[data-theme="light"] .list-badge{background:#e9f0fa;color:#2f4f7d;}
html[data-theme="light"] .list-badge--unclassified{background:var(--lt-head);color:var(--text-sub);}
html[data-theme="light"] .online-method-badge,
html[data-theme="light"] .cip-badge-create{background:#e9f0fa;color:#2f4f7d;}
html[data-theme="light"] .online-status,
html[data-theme="light"] .online-status--imported,
html[data-theme="light"] .cip-badge-merge{background:#e9f6ef;color:#1f7a52;}
html[data-theme="light"] .online-status--unimported{background:var(--lt-head);color:var(--text-sub);}
html[data-theme="light"] .online-status--cancelled,
html[data-theme="light"] .cip-badge-blocked{background:#fdeceb;color:#a33a3a;}
html[data-theme="light"] #ios-ai-key-state{background:var(--lt-head);color:var(--text-sub);}
html[data-theme="light"] #ios-ai-key-state.ios-key-on{background:#e9f0fa;color:#2f4f7d;}
html[data-theme="light"] .ai-reg-conf.high{color:#1f7a52;}
html[data-theme="light"] .ai-reg-conf.mid{color:#8a5a12;}
html[data-theme="light"] .ai-reg-conf.low{color:#a33a3a;}
html[data-theme="light"] .ai-reg-preview-table tr.low td{background:#fdeceb;}
html[data-theme="light"] .ai-reg-preview-table tr.mid td{background:#fdf3e2;}
html[data-theme="light"] .ai-bt-warn{background:#fdf3e2;color:#8a5a12;}
html[data-theme="light"] .ai-bt-tag-ambiguous,
html[data-theme="light"] .ai-bt-flag-warn,
html[data-theme="light"] .pcmp-na,
html[data-theme="light"] .plot-panel .plot-dirty-status.dirty,
html[data-theme="light"] .plot-header .plot-dirty-status{color:#8a5a12;}
/* ランク・リスク・タイプ・性別（意味色。白地で沈まない濃さへ） */
html[data-theme="light"] .rank-no{color:var(--text);}
html[data-theme="light"] .rank-B{color:#3a6295;}
html[data-theme="light"] .rank-C{color:#8a5a12;}
html[data-theme="light"] .rank-D{color:#5b626c;}
html[data-theme="light"] .risk-高{color:#a33a3a;}
html[data-theme="light"] .risk-中{color:#8a5a12;}
html[data-theme="light"] .risk-低{color:#1f7a52;}
html[data-theme="light"] .tag-type{color:#3a6295;}
html[data-theme="light"] .horse-sex.sex-gelding{color:#8a5a12;}
html[data-theme="light"] .hd-ped-sire,
html[data-theme="light"] .hd-mm-node.is-sire .hd-mm-name{color:#2f4f7d;}
html[data-theme="light"] .hd-ped-dam,
html[data-theme="light"] .hd-mm-node.is-dam .hd-mm-name{color:#a33a3a;}
html[data-theme="light"] .hd-mm-node.is-sire{background:#eef3fb;}
html[data-theme="light"] .hd-mm-node.is-dam{background:#fdefef;}
html[data-theme="light"] .hd-mm-node.is-self{background:#f5f1e6;}
html[data-theme="light"] .hd-mm-node.is-sibling{border-color:var(--line);}

/* ---------- 写真・動画まわりの枠（映像そのものの色は変えない） ---------- */
html[data-theme="light"] .m-thumb{background:var(--panel-2);}
html[data-theme="light"] .bt-modal .bt-close{background:var(--lt-selected);color:#ffffff;}
html[data-theme="light"] .plot-card-media{background:var(--panel-2);}
html[data-theme="light"] .plot-card-media-neutral{background:#e9ebef;}
/* 動画の再生面（レターボックス）は黒のまま：映像の見え方を変えないため */

/* ---------- AI出力・比較表 ---------- */
html[data-theme="light"] .admin-ai-output,
html[data-theme="light"] .admin-ai-output.is-editing,
html[data-theme="light"] .admin-ai-prompt-text{background:#ffffff;color:var(--text);border-color:var(--line);}
html[data-theme="light"] .ai-autofill-preview-table th{background:var(--lt-head);color:var(--text-sub);}
html[data-theme="light"] .plot-panel .sel-info{background:var(--lt-head);color:var(--text);}
html[data-theme="light"] .plot-panel .sel-info.connect-info{background:#e9f0fa;color:#2f4f7d;}
html[data-theme="light"] .plot-panel .plot-kbd-help{background:#eef7f1;border-color:#cfe3d7;color:#1f7a52;}
html[data-theme="light"] .plot-panel .plot-coord-row label,
html[data-theme="light"] .plot-panel .plot-coord-row input[type=number],
html[data-theme="light"] .plot-panel .plot-base-size-row input[type=number]{
  background:#ffffff;color:var(--text);border-color:var(--line);
}
html[data-theme="light"] .plot-panel .color-row button{border-color:var(--line);}
html[data-theme="light"] .plot-panel .color-row button.active{border-color:var(--lt-selected);box-shadow:0 0 0 2px rgba(32,36,43,.25);}
html[data-theme="light"] .plot-panel .plot-clear-all-row{border-top-color:var(--line);}
html[data-theme="light"] .btn.danger-solid:disabled{background:#f2e3e3;border-color:#e0cccc;color:#a08a8a;}
/* 角度表示（意味を持つ色。白地で読める濃さへ） */
html[data-theme="light"] .plot-angle-arc,
html[data-theme="light"] .plot-angle-arm,
html[data-theme="light"] .plot-angle-axis{stroke:#8a5a12;}
html[data-theme="light"] .plot-angle-deg{color:#8a5a12;}
html[data-theme="light"] .plot-angle-pair{color:var(--text-sub);}
html[data-theme="light"] .plot-angle-target{stroke:#2f7a2f;}
html[data-theme="light"] .plot-angle-target-name{border-color:#bcd9a8;color:#2f7a2f;}
html[data-theme="light"] .plot-editor-svg .pt-sel-ring{stroke:#8a5a12;}

/* ---------- 各種スクロールバー ---------- */
html[data-theme="light"] .horse-tag-rows::-webkit-scrollbar-thumb,
html[data-theme="light"] .admin-list .admin-list-rows::-webkit-scrollbar-thumb,
html[data-theme="light"] .hd-thumbs::-webkit-scrollbar-thumb,
html[data-theme="light"] .hd-video-strip::-webkit-scrollbar-thumb,
html[data-theme="light"] .hd-coord-scroll::-webkit-scrollbar-thumb,
html[data-theme="light"] .hd-mindmap::-webkit-scrollbar-thumb,
html[data-theme="light"] .admin-ai-side::-webkit-scrollbar-thumb{background:#c3c9d2;}

/* ---------- iOS / Electron の帯 ---------- */
html[data-theme="light"].platform-ios .app-sidebar{border-right-color:var(--line);}
html[data-theme="light"] .ios-update-marker,
html[data-theme="light"] .electron-update-marker{border-top-color:var(--line);color:var(--text-mute);}

/* ---------- 直書きから移したクラス（A86）。ライトでは白地＋濃い文字にする ---------- */
html[data-theme="light"] .ui-bg-0c0c0c,
html[data-theme="light"] .ui-bg-0d0d0d,
html[data-theme="light"] .ui-bg-0e0e0e,
html[data-theme="light"] .ui-bg-101010,
html[data-theme="light"] .ui-bg-121212,
html[data-theme="light"] .ui-bg-141414,
html[data-theme="light"] .ui-bg-151515,
html[data-theme="light"] .ui-bg-161616,
html[data-theme="light"] .ui-bg-171717,
html[data-theme="light"] .ui-bg-181818,
html[data-theme="light"] .ui-bg-1a1a1a,
html[data-theme="light"] .ui-bg-1c1c1c,
html[data-theme="light"] .ui-bg-1d1d1d{background:#ffffff;}
html[data-theme="light"] .ui-fg-fff,
html[data-theme="light"] .ui-fg-ffffff,
html[data-theme="light"] .ui-fg-eee,
html[data-theme="light"] .ui-fg-ddd,
html[data-theme="light"] .ui-fg-ccc{color:var(--text);}
html[data-theme="light"] .ui-fg-bbb,
html[data-theme="light"] .ui-fg-aaa{color:var(--text-sub);}
/* 拡大表示など、暗いまま残す面の上に出る文字は白のままにする */
html[data-theme="light"] .media-zoom .ui-fg-fff,
html[data-theme="light"] .plot-modal .ui-fg-fff,
html[data-theme="light"] .m-thumb .ui-fg-fff{color:#ffffff;}

/* 入力欄は、直書きが残っていても必ず白地＋濃い文字にする（読めない組み合わせを作らない）。
   色そのものを選ぶ部品（カラーピッカー・チェック・スライダー）は対象外。 */
html[data-theme="light"] input:not([type="color"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-theme="light"] select,
html[data-theme="light"] textarea{
  background-color:#ffffff !important;color:var(--text) !important;
}

/* ---------- 意味のある色（A86）。白地で読める濃さへ入れ替える ---------- */
html[data-theme="light"] .ui-bg-3a1a1a{background:#fdeceb;}
html[data-theme="light"] .ui-bg-3a2c1a,
html[data-theme="light"] .ui-bg-3a2a1a,
html[data-theme="light"] .ui-bg-2a2014{background:#fdf3e2;}
html[data-theme="light"] .ui-bg-1f3326,
html[data-theme="light"] .ui-bg-1a3a23{background:#e9f6ef;}
html[data-theme="light"] .ui-bg-1f2a3a,
html[data-theme="light"] .ui-bg-1a2a3a,
html[data-theme="light"] .ui-bg-1d3158,
html[data-theme="light"] .ui-bg-16202c{background:#e9f0fa;}
html[data-theme="light"] .ui-bg-2a2a2a{background:var(--lt-head);}
html[data-theme="light"] .ui-fg-fbb1a3{color:#a33a3a;}
html[data-theme="light"] .ui-fg-fbd99a,
html[data-theme="light"] .ui-fg-ffe7a3,
html[data-theme="light"] .ui-fg-e0c14a{color:#8a5a12;}
html[data-theme="light"] .ui-fg-bdf5cf{color:#1f7a52;}
html[data-theme="light"] .ui-fg-9ec8ff,
html[data-theme="light"] .ui-fg-9fd4ff{color:#2f4f7d;}
html[data-theme="light"] .ui-fg-888,
html[data-theme="light"] .ui-fg-666{color:var(--text-sub);}

/* 注記（A86）: 以前ここにあった [style*="#..."] を使う上書きは削除した。
   Chromium は style 属性の中身が変わったときの再判定を保証せず、同じ要素でも
   効いたり効かなかったりするため。直書きしていた色は index.html 側でクラスへ移し、
   このファイルではそのクラスを上書きしている。 */

/* ---------- ゴールドの淡い塗り（アクセント）はライトでは炭色の淡い塗りにする ---------- */
html[data-theme="light"] .m-attach{background:rgba(58,64,73,.10);color:var(--gold-soft);border-color:var(--line);}
html[data-theme="light"] .m-attach:hover{background:rgba(58,64,73,.18);}
html[data-theme="light"] .info-i:hover,
html[data-theme="light"] .plot-ref-info-btn:hover{background:rgba(58,64,73,.14);}
html[data-theme="light"] .rank-A{background:rgba(58,64,73,.10);color:var(--gold-soft);border-color:rgba(58,64,73,.30);}
html[data-theme="light"] .app-sidebar .menu-child.active{background:var(--lt-selected);color:#ffffff;}
html[data-theme="light"] .horse-tag-swatch.on{box-shadow:0 0 0 2px rgba(58,64,73,.30);}
html[data-theme="light"] .fav-btn.on{border-color:var(--gold);}

/* ---------- 写真の上に重ねるバッジ（暗い面の上なので、文字は明るいままにする） ---------- */
html[data-theme="light"] .ph-score{background:rgba(32,36,43,.86);border-color:rgba(255,255,255,.18);}
html[data-theme="light"] .ph-metric .n{color:#f3d78a;}
html[data-theme="light"] .ph-metric .t{color:#d7dbe2;}
html[data-theme="light"] .ph-metric + .ph-metric{border-left-color:rgba(255,255,255,.18);}
html[data-theme="light"] .fav-overlay .fav-btn{background:rgba(32,36,43,.72);color:#ffffff;}
html[data-theme="light"] .admin-ai-expand{background:#ffffff;color:var(--gold-soft);border-color:var(--line);}
html[data-theme="light"] .admin-ai-expand:hover{background:var(--lt-hover);}
html[data-theme="light"] .mini-badge.req{background:#fdeceb;color:#a33a3a;border-color:rgba(163,58,58,.35);}
html[data-theme="light"] .mini-badge.rec{background:rgba(58,64,73,.10);color:var(--gold-soft);border-color:rgba(58,64,73,.28);}
html[data-theme="light"] .mini-badge.opt{background:#eef0f4;color:#5b626c;border-color:#cdd3db;}

/* ---------- ダッシュボードのタスク・ログ（A87） ---------- */
html[data-theme="light"] .dash-task-card{background:var(--panel);border-color:var(--line);color:var(--text);}
html[data-theme="light"] .dash-task-card:hover{border-color:var(--gold);background:var(--lt-hover);}
html[data-theme="light"] .dash-task-value,
html[data-theme="light"] .dash-info-card .dash-info-value,
html[data-theme="light"] .dash-task-cta{color:var(--gold-soft);}
html[data-theme="light"] .dash-task-card.is-warn,
html[data-theme="light"] .dash-info-card.is-warn{border-color:rgba(154,91,31,.45);}
html[data-theme="light"] .dash-task-card.is-warn .dash-task-value,
html[data-theme="light"] .dash-info-card .dash-info-value.is-warn{color:#8a5a12;}
html[data-theme="light"] .dash-log-card{background:var(--panel);border-color:var(--line);}
html[data-theme="light"] .dash-log-card:hover{border-color:var(--gold);}
html[data-theme="light"] .dash-log-msg{color:var(--text);}
html[data-theme="light"] .dash-log-who{color:var(--text-sub);}
html[data-theme="light"] .badge.dash-log-kind{background:var(--lt-head);color:var(--text-sub);border-color:var(--line);}

/* ---------- バックアップ（A88） ---------- */
html[data-theme="light"] .backup-fact{background:var(--panel);border-color:var(--line);}
html[data-theme="light"] .backup-fact-k{color:var(--text-sub);}
html[data-theme="light"] .backup-fact-v{color:var(--gold-soft);}
html[data-theme="light"] #backup-status.is-error,
html[data-theme="light"] .ai-register-body .is-error{color:#a33a3a;}
html[data-theme="light"] #backup-status.is-done{color:#1f7a52;}

/* ---------- 復元（A89） ---------- */
html[data-theme="light"] .restore-warn{background:#fdf3e2;border-color:rgba(154,91,31,.35);color:var(--text);}
html[data-theme="light"] .restore-error{background:#fdeceb;border-color:rgba(163,58,58,.35);}
html[data-theme="light"] .restore-error-title{color:#a33a3a;}
html[data-theme="light"] .restore-step.is-now{color:var(--gold-soft);}
html[data-theme="light"] .restore-step.is-done::before{color:#1f7a52;}
