/* ブドウ品種図鑑 系譜＝血統表（F-5・血統表 v7）
   目的：v7 の起点・血統表・右の数の列・特徴タブ・子の一覧・下のボタンの規則を写す。値は design-vars.css の変数だけ
   作成 2026-09-30 CTO（T7）。出典：../../デザイン/系譜_血統表_v7.html の 53〜180 行
   画面の外に漏れないよう [data-screen="pedigree"] の中に閉じる。上部バー・セグメント・タグ・印は base.css（v7 と同じ規則）
   アプリで足したもの（モックに無い）は「★」印：「注」の列（D-9）・向きの読めない親の帯・収録外の升・空の画面 */

/* ===== 上部：v7 は戻るに最小幅なし・セグメントの上 10px（base.css は案A の 12px） ===== */
[data-screen="pedigree"] .topbar .back{min-width:0;font-weight:400}
[data-screen="pedigree"] .tabs{margin-top:10px}
[data-screen="pedigree"] .tabs .cnt{display:inline-block}

/* ===== 起点：枠をやめ、大きな名前と余白 ===== */
[data-screen="pedigree"] .root{position:relative;padding:20px 16px 4px}
[data-screen="pedigree"] .root .hb{display:none}
[data-screen="pedigree"] .root .line1{display:flex;flex-direction:column;gap:0}
[data-screen="pedigree"] .root .txt{min-width:0}
[data-screen="pedigree"] .root h3{font-size:28px;line-height:1.25;font-weight:500;letter-spacing:-.01em;color:var(--ink);line-break:strict;overflow-wrap:anywhere}
[data-screen="pedigree"] .root .meta{font-size:14px;color:var(--ink-2);line-height:1.5;margin-top:6px}
[data-screen="pedigree"] .root .meta .mk{margin:0 4px 0 0;vertical-align:2px}
[data-screen="pedigree"] .root .meta::before{content:"";display:inline-block;width:12px;height:12px;border-radius:50%;vertical-align:-1px;margin-right:6px;border:1px solid rgba(0,0,0,.22)}
[data-screen="pedigree"] .root .hb.k-b~.txt .meta::before{background:var(--skin-b)}
[data-screen="pedigree"] .root .hb.k-r~.txt .meta::before{background:var(--skin-r)}
[data-screen="pedigree"] .root .hb.k-g~.txt .meta::before{background:var(--skin-g)}
[data-screen="pedigree"] .root .hb.k-unk~.txt .meta::before,[data-screen="pedigree"] .root .hb.k-line~.txt .meta::before{display:none}
[data-screen="pedigree"] .root .rtags{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px;align-items:center}
[data-screen="pedigree"] .root .rtags .none{font-size:14px;color:var(--ink-2)}
[data-screen="pedigree"] .rtags .brk{flex-basis:100%;height:0}
[data-screen="pedigree"] .mk{vertical-align:2px}

/* ===== 果皮色の粒（データにある事実だけを印にする） ===== */
[data-screen="pedigree"] .bunch{flex:0 0 auto;display:inline-block;vertical-align:-3px}
[data-screen="pedigree"] .vrow .bunch{width:14px;height:14px}
[data-screen="pedigree"] .tkey .bunch{width:12px;height:12px;margin-right:4px}
@keyframes ped-rise{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
[data-screen="pedigree"].enter .root,[data-screen="pedigree"].enter .ped{animation:ped-rise .28s ease-out both}
[data-screen="pedigree"].enter .ped{animation-delay:.05s}

/* ===== 血統表：角丸カードの中の細い罫の表 ===== */
[data-screen="pedigree"] .ped{display:flex;gap:0;margin:16px 16px 0;align-items:stretch;border:1px solid var(--rule);border-radius:var(--r-card);overflow:hidden;background:var(--paper);box-shadow:var(--shadow)}
[data-screen="pedigree"] .ped table{table-layout:fixed;border-collapse:collapse;flex:1 1 auto;min-width:0;width:100%;align-self:flex-start}
[data-screen="pedigree"] .ped col.bc{width:20px}
[data-screen="pedigree"] .ped thead th{height:36px;font-size:14px;font-weight:400;color:var(--ink-2);text-align:left;padding:0 0 0 12px;line-height:1.2;vertical-align:middle;background:var(--surface);border-bottom:.5px solid var(--rule)}
[data-screen="pedigree"] .ped tbody tr{height:44px}
[data-screen="pedigree"] .ped td{padding:0;border-top:.5px solid var(--rule);vertical-align:middle}
[data-screen="pedigree"] .ped tbody tr:first-child td{border-top:0}
[data-screen="pedigree"] td.band{width:20px;text-align:center;border-left:2px solid var(--plum);background:var(--seed-bg)}
/* 縦書きは writing-mode を使わず1字ずつ積む（iOS Safari で表のセルの縦書きが崩れたため） */
[data-screen="pedigree"] td.band span{display:flex;flex-direction:column;align-items:center;font-size:14px;font-weight:400;line-height:1.15;color:var(--plum-ink);padding:8px 0}
[data-screen="pedigree"] td.band i{font-style:normal}
[data-screen="pedigree"] td.band.pollen{border-left-color:var(--str);background:var(--pollen-bg)}
[data-screen="pedigree"] td.band.pollen span{color:var(--str-ink)}
[data-screen="pedigree"] td.band.origin,[data-screen="pedigree"] td.band.either{border-left-color:var(--rule-2);background:var(--surface)}   /* ★ either＝向きの読めない親は枝変わり元と同じ灰 */
[data-screen="pedigree"] td.band.origin{border-left:2px dotted var(--rule-3)}   /* 2026-10-31 枝変わり元は点線（系統図の枝変わりの点線と同じ印。CMO 決定 2026-10-31 §C-改 C-4） */
[data-screen="pedigree"] .tkey .sw.origin{background:var(--surface);border-left:2px dotted var(--rule-3)}
[data-screen="pedigree"] td.band.origin span,[data-screen="pedigree"] td.band.either span{color:var(--ink-2)}
[data-screen="pedigree"] td.band.none{border-left:2px dashed var(--rule-2);background:none}
[data-screen="pedigree"] td.band.none span{color:var(--ink-3)}
/* 種子親の側と花粉親の側の境だけ、少し濃い罫 */
[data-screen="pedigree"] .ped tbody tr:has(> td.band[rowspan="7"]:first-child):not(:first-child) > td{border-top:1px solid var(--rule-2)}
[data-screen="pedigree"] td.unk{padding:4px 12px;color:var(--ink-2);line-height:1.45}
[data-screen="pedigree"] td.unk span{font-size:15px;font-weight:400}
[data-screen="pedigree"] td.unk small{font-size:14px;display:block;color:var(--ink-3)}
[data-screen="pedigree"] td.unk.one small{display:inline;margin-left:6px}
[data-screen="pedigree"] td.note{padding:10px 12px;font-size:14px;color:var(--plum-ink);line-height:1.5;background:var(--plum-soft)}
[data-screen="pedigree"] .vrow{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;width:100%;min-height:var(--tap);padding:6px 10px 6px 12px;background:none;border:0;text-align:left;cursor:pointer}
[data-screen="pedigree"] .vrow:focus-visible{outline-offset:-4px;border-radius:8px}
[data-screen="pedigree"] .vrow .nm{flex:1 1 auto;min-width:0;max-width:calc(100% - 22px);font-size:16px;line-height:1.35;font-weight:400;color:var(--ink);overflow-wrap:anywhere;line-break:strict}
[data-screen="pedigree"] td[colspan="3"] .vrow .nm{font-size:17px;font-weight:400}
[data-screen="pedigree"] .vrow .tags{margin-left:auto;display:flex;gap:4px;align-items:center;flex:0 0 auto;flex-wrap:nowrap}
[data-screen="pedigree"] .vrow .tags .more{font-family:var(--num);font-size:14px;font-weight:400;color:var(--ink-2)}
[data-screen="pedigree"] .vrow.dup .nm{color:var(--ink-2)}
[data-screen="pedigree"] .vrow.dup .bunch{opacity:.5}
[data-screen="pedigree"] .vrow:active{background:var(--surface)}

/* 右の列：家系に入っているタグの数。系統ごとの地色と数字色 */
[data-screen="pedigree"] .tot{flex:0 0 46px;display:flex;flex-direction:column;border-left:.5px solid var(--rule);background:var(--paper)}
[data-screen="pedigree"] .tot .th{height:36px;font-size:14px;font-weight:400;color:var(--ink-2);text-align:center;line-height:1.2;display:flex;align-items:center;justify-content:center;background:var(--surface);border-bottom:.5px solid var(--rule)}
[data-screen="pedigree"] .tot .cell{height:44px;display:flex;flex-direction:column;align-items:center;justify-content:center;border-top:.5px solid var(--rule);gap:1px}
[data-screen="pedigree"] .tot .th + .cell{border-top:0}
[data-screen="pedigree"] .tot .tag{height:20px;padding:0 5px}
[data-screen="pedigree"] .tot .t-early,[data-screen="pedigree"] .tot .t-late{padding:0 7px}
[data-screen="pedigree"] .tot .cell.g-season{background:var(--time-bg)}
[data-screen="pedigree"] .tot .cell.g-season .n{color:var(--time-ink)}
[data-screen="pedigree"] .tot .cell.g-strength{background:var(--str-bg)}
[data-screen="pedigree"] .tot .cell.g-strength .n{color:var(--str-ink)}
[data-screen="pedigree"] .tot .cell.g-fruit .n{color:var(--fruit-ink)}
[data-screen="pedigree"] .tot .cnt{display:flex;align-items:center;height:18px}
[data-screen="pedigree"] .tot .n{font-family:var(--num);font-variant-numeric:tabular-nums;font-weight:400;font-size:16px;line-height:1;color:var(--ink)}
[data-screen="pedigree"] .tot .cell .n.zero{color:var(--ink-2)}
/* ★「注」の列（D-9）：数の列の隣に別の列。注意＝第4系統（赤茶の細い枠・塗らない）。特徴タグの数と合算しない */
[data-screen="pedigree"] .tot.cau-col{flex-basis:40px}
[data-screen="pedigree"] .tot.cau-col .th{color:var(--warn-ink)}
[data-screen="pedigree"] .tot.cau-col .cell{background:var(--paper)}
[data-screen="pedigree"] .tot.cau-col .n{color:var(--warn-ink)}
[data-screen="pedigree"] .tot.cau-col .n.zero{color:var(--ink-3)}   /* CMO 決定 §1：0 は 1 段薄く（「なし」を静かに言う） */
[data-screen="pedigree"] .tkey{display:flex;flex-wrap:wrap;gap:4px 14px;padding:12px 16px 0;font-size:14px;color:var(--ink-2);line-height:1.6}
[data-screen="pedigree"] .tkey .sw{display:inline-block;width:12px;height:14px;vertical-align:-2px;margin-right:5px;border-left:2px solid var(--plum);background:var(--seed-bg);border-radius:2px}
[data-screen="pedigree"] .tkey .sw.pollen{border-left-color:var(--str);background:var(--pollen-bg)}
[data-screen="pedigree"] .foot{padding:8px 16px 8px;font-size:14px;color:var(--ink-2);line-height:1.5}

/* ===== 特徴タブ：カードの中のリスト ===== */
[data-screen="pedigree"] .traits{margin:16px 16px 0;padding:0 14px;border:0;border-radius:var(--r-card);background:var(--paper);box-shadow:var(--shadow)}
[data-screen="pedigree"] .traits li{display:grid;grid-template-columns:3.2em 6.2em 1.4em 1fr;align-items:center;column-gap:8px;min-height:52px;padding:8px 0;border-top:.5px solid var(--rule)}
[data-screen="pedigree"] .traits .tn{font-size:16px;font-weight:400;line-height:1.3}
[data-screen="pedigree"] .traits .tv{font-family:var(--num);font-size:17px;font-weight:400;color:var(--plum-bright);text-align:center}
[data-screen="pedigree"] .traits .tv.no{color:var(--ink-3)}
[data-screen="pedigree"] .traits .tv.q{color:var(--str-ink)}
[data-screen="pedigree"] .traits small{font-size:14px;color:var(--ink-2);line-height:1.4}
[data-screen="pedigree"] .traits .cau-row{grid-template-columns:3.2em 1fr;align-items:start}
[data-screen="pedigree"] .traits .cau-row .cl{display:flex;flex-wrap:wrap;gap:6px}
[data-screen="pedigree"] .traits .cau-row .tn{color:var(--warn-ink)}
[data-screen="pedigree"] .traits .dzh{grid-template-columns:3.2em 1fr;min-height:0;padding:4px 0 2px;border-top:0}
[data-screen="pedigree"] .traits .dz{grid-template-columns:3.2em 1fr auto;min-height:40px;padding:4px 0;border-top:1px dashed var(--rule)}
[data-screen="pedigree"] .traits .dz .dn{font-size:15px;color:var(--ink-2)}
[data-screen="pedigree"] .traits .dz .dn em{font-style:normal;font-size:14px;color:var(--ink-3);margin-left:6px}
[data-screen="pedigree"] .traits .lv.u{padding:0 2px}
[data-screen="pedigree"] .traits .lead{grid-template-columns:1fr;min-height:0;padding:12px 0;font-size:14px;color:var(--ink-2);border-top:0;line-height:1.5}

/* ===== 子の一覧タブ ===== */
[data-screen="pedigree"] .kids{margin:16px 16px 0;padding:0 14px;border:0;border-radius:var(--r-card);background:var(--paper);box-shadow:var(--shadow)}
[data-screen="pedigree"] .kids .lead{font-size:14px;color:var(--ink-2);padding:12px 0;line-height:1.5}
[data-screen="pedigree"] .kids li{border-top:.5px solid var(--rule)}
[data-screen="pedigree"] .kids .vrow{padding-left:0;padding-right:0;min-height:56px}
[data-screen="pedigree"] .kids .nm small{display:block;font-size:14px;font-weight:400;color:var(--ink-2);line-height:1.35;margin-top:2px}
[data-screen="pedigree"] .kids .empty{padding:12px 0 16px;font-size:16px;color:var(--ink-2)}

/* ===== 下のボタン ===== */
[data-screen="pedigree"] .actions{display:flex;gap:10px;padding:16px 16px 22px;margin-top:10px;background:var(--paper)}
[data-screen="pedigree"] .actions .btn{padding:revert}   /* v7 の .btn はボタンの既定の余白のまま（base.css は 0 に戻している） */
[data-screen="pedigree"].enter .kids{animation:ped-rise .28s ease-out both;animation-delay:.05s}   /* 2026-10-02：子の一覧へ品種が替わったときも（見本どおり） */
