/* VIDEO FACTORY — deck.css(VF 固有分)
   共通の部品(トークン・筐体・ブランド・パネル・VFD・下段・ダイアログ)は vendor/factory-ui/*.css を index.html が先に読む。
   ここに書くのは VF 固有(モニタ、一覧の列構成、2カウンター VFD、目盛りバー)と、部品に対するレイアウト差
   (筐体の padding/flex、ブランド/仕切り線の margin、フッターの折り返し)だけ。色・書体は必ず --f-* トークンを参照する。
   構造は design/Video Factory Desktop.dc.html の書き起こし。 */

/* 同梱フォント(開発時の相対パス。Electron では main.js が resources/fonts の絶対パスで同じ @font-face を注入する) */
@font-face { font-family: 'Share Tech Mono'; font-style: normal; font-weight: 400;
  src: url(factory-ui/fonts/ShareTechMono-Regular.subset.woff2) format('woff2'); }
@font-face { font-family: 'PixelMplus10'; font-style: normal; font-weight: 400;
  src: url(factory-ui/fonts/PixelMplus10-Regular.subset.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 500;
  src: url(factory-ui/fonts/BarlowSemiCondensed-500.subset.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 600;
  src: url(factory-ui/fonts/BarlowSemiCondensed-600.subset.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Semi Condensed'; font-style: normal; font-weight: 700;
  src: url(factory-ui/fonts/BarlowSemiCondensed-700.subset.woff2) format('woff2'); }
@font-face { font-family: 'Noto Sans JP'; font-style: normal; font-weight: 100 900;
  src: url(factory-ui/fonts/NotoSansJP-VF.subset.woff2) format('woff2'); }

:root {
  --sans: 'Noto Sans JP', sans-serif;   /* VF 固有: 日本語の案内文・TAPE TITLE 用 */
  --vf-red: #ff3a2a;                    /* VF 固有: OSD の REC 点・録画中ゲージ(design の赤) */
  --vf-red-glow: rgba(255,58,42,.6);
}
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; background: #17110c; }
body { min-height: 100vh; padding: 36px 28px; display: flex; justify-content: center; align-items: flex-start;
  font-family: var(--f-font-ui); color: var(--f-text-body); -webkit-font-smoothing: antialiased; }
button { font: inherit; padding: 0; }
@keyframes vf-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .15; } }

/* ============ 筐体(部品 .deck に対するレイアウト差) ============ */
.deck { flex: none; padding: 0 30px 68px; display: flex; flex-direction: column; }
/* ブランドパネルと仕切り線は筐体の横 padding の外側に出して TF と同じ 28px / 20px にする */
.brand { flex: none; margin: 0 -30px; }
.hr { flex: none; margin: 0 -10px 16px; }

/* ============ MONITOR + SOURCE ============ */
.upper { flex: none; margin-top: 0; display: grid; grid-template-columns: 740px minmax(0, 1fr); gap: 16px; }   /* 右列は中身(長いファイル名)で伸びない(v0.2.3) */

/* CRT · 240×160 ×3 — VF 固有(ベゼル・ブルーバック・走査線) */
.crt { position: relative; height: 508px; padding: 6px;
  background: linear-gradient(180deg, #262628, #1a1a1c); border: 1px solid #333; border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), inset 0 -2px 0 rgba(0,0,0,.6); }
.screen { position: relative; width: 720px; height: 480px; border-radius: 22px / 16px; background: #000; overflow: hidden;
  box-shadow: inset 0 0 0 2px #0a0a0a, inset 0 0 40px rgba(0,0,0,.9), 0 0 0 6px #141414, 0 0 0 7px #2e2e2e; }
.screen > div { position: absolute; inset: 0; pointer-events: none; }
.screen > canvas { position: absolute; left: 0; top: 0; width: 720px; height: 480px; image-rendering: pixelated; pointer-events: none; }
.screen > video { position: absolute; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
.mon-video { background: linear-gradient(180deg, #0c1a2c 0%, #2b4a6b 42%, #c97a3a 60%, #3a2418 62%, #0b0907 100%); }
.mon-blue { background: radial-gradient(ellipse at 50% 45%, #1f45d8 0%, #0f2ba8 70%, #0a1e7c 100%); }
.mon-pause { background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(255,255,255,.05) 3px 6px); mix-blend-mode: screen; }
.screen > .osd { inset: 48px 72px; font-family: var(--f-font-osd); font-size: 30px; line-height: 30px; color: #fff;
  text-shadow: 2px 2px 0 #000, -2px 0 0 #000, 0 -2px 0 #000, 2px 0 0 #000, 0 2px 0 #000;
  display: flex; flex-direction: column; justify-content: space-between; }
.osd .top { display: flex; align-items: center; gap: 12px; }
.osd .rec { width: 18px; height: 18px; border-radius: 50%; background: #e02020; box-shadow: 2px 2px 0 #000;   /* 要件 §0.6: ● 録画 */
  animation: vf-blink 1s steps(1) infinite; }
.osd .bot { display: flex; justify-content: flex-end; }   /* 左下の SP は出さない(REC MODE は表示しない方針) */
.osd .blink { animation: vf-blink 1s steps(1) infinite; }
.scan { background: repeating-linear-gradient(180deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px); }
.vignette { background: radial-gradient(ellipse at 50% 50%, transparent 55%, rgba(0,0,0,.55) 100%); }
.glare { background: linear-gradient(115deg, rgba(255,255,255,.09) 0%, rgba(255,255,255,0) 32%, rgba(255,255,255,0) 70%, rgba(255,255,255,.04) 100%); }
.bezel { border-radius: 22px / 16px; box-shadow: inset 0 0 28px 6px rgba(0,0,0,.75); }

/* SOURCE panel — 地色は部品の .bay と同じトークン。中身は部品(.seclab / .titlerow input / .list / .empty)+ VF のラベル */
.source { height: 508px; min-width: 0; padding: 10px 13px 9px; display: flex; flex-direction: column; gap: 12px; border-radius: 3px;
  background-image: var(--f-bay-bg); box-shadow: var(--f-bay-shadow); }
.source .head { display: flex; justify-content: space-between; align-items: center;
  font-size: 8.5px; font-weight: 600; letter-spacing: 0.24em; color: var(--f-text-mid); }
.source .head .lamp { display: flex; align-items: center; gap: 6px; color: var(--f-text-lo); }
.source .head .lamp i { width: 5px; height: 5px; border-radius: 50%; background: #3f4a45; box-shadow: inset 0 0 2px rgba(0,0,0,0.7); }
.source .head .lamp.on { color: var(--f-text-mid); }
.source .head .lamp.on i { background: var(--f-amber); box-shadow: 0 0 6px var(--f-amber-fill); }
/* TAPE TITLE は見出しの下に縦積み(部品は横並び) */
.titlerow { flex: none; flex-direction: column; align-items: stretch; gap: 7px; }
.titlerow input { flex: none; width: 100%; }

.list { flex: 1; min-height: 0; min-width: 0; position: relative; }
/* ラベル(要件 v0.9 §0.6)。色は同じ値のトークン(#f4f1ea=text-hi / #8d8880=text-lo / #d2cdc4=text-mid / #ffb04a=amber) */
.lbl { padding: 10px 12px 0; min-width: 0; }
.lname { position: relative; padding-bottom: 8px; border-bottom: 1px solid var(--f-line);
  font-family: var(--f-font-ui); font-size: 13px; font-weight: 500; letter-spacing: .26px; color: var(--f-text-hi); }
.lname > span { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 動画の削除(v0.2.4): ホバー時だけ右端に ×(v0.1.4 の .row .del と同じ書式・色)。REC / WRITE CART 中は出さない(hidden) */
.lname .del { all: unset; cursor: pointer; position: absolute; right: 0; top: 0; bottom: 8px; width: 24px;
  display: none; align-items: center; justify-content: flex-end; padding-right: 2px;
  font-size: 12px; line-height: 1; color: var(--f-text-del); }
.lname:hover .del { display: flex; }
.lname:hover > span { padding-right: 26px; }
.lname .del:hover { color: var(--f-red-txt); }
.lrow { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding-top: 8px; min-width: 0; }
.lrow .k { flex: none; font-family: var(--f-font-ui); font-size: 9px; font-weight: 600; letter-spacing: 1.98px; color: var(--f-text-lo); }
.lrow .v { min-width: 0; font-family: var(--f-font-mono); font-size: 12px; letter-spacing: .72px; color: var(--f-text-mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* READING(解析中だけ、枠の縦中央): 語 / 読み取り位置 / 1px の線の上を点が左→右へ。done で 300ms フェード */
.reading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none; transition: opacity 300ms; }
.reading.fade { opacity: 0; }
.rword { font-family: var(--f-font-mono); font-size: 22px; letter-spacing: 5.28px; color: var(--f-amber); text-shadow: 0 0 12px rgba(255,176,74,.55); }
/* 回るリール(v0.2.7、Claude Design 採用案 4c): 線と点の 12px 下、枠の水平中央。色・線は SVG 側の属性。1 周 1000ms を 30° ずつ steps(12)、時計回り。drop-shadow は 3px */
.reel { display: block; margin-top: 12px; width: 22px; height: 22px;
  transform-origin: 50% 50%; filter: drop-shadow(0 0 3px rgba(255,176,74,.6)); animation: vf-reel 1s steps(12) infinite; }
@keyframes vf-reel { to { transform: rotate(360deg); } }
.rpos { margin-top: 10px; font-family: var(--f-font-mono); font-size: 12px; letter-spacing: 1.44px; color: var(--f-text-mid); }
.rline { position: relative; margin-top: 10px; width: calc(100% - 48px); height: 1px; background: rgba(255,176,74,.25); }
.rline i { position: absolute; top: -2px; left: 0; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--f-amber);
  transition: left 600ms ease-out; }
/* 空の枠: 中央寄せ(部品は上下 84px の固定余白)。文言・書式は v0.1.4 のまま */
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.empty .e2 { line-height: 1.6; }
.empty .e2 span { white-space: nowrap; }   /* 1行目は折り返さない(2行固定) */

/* ============ VFD COUNTER — 地・書体は部品 .vfd。桁・ラベル・ランプは部品の .vtime / .vcaprow .lab / .ind / .vmeta と同じ値 ============ */
.vfd { flex: none; margin-top: 12px; display: flex; flex-direction: column; color: var(--f-amber); }
.vfd .upperrow { display: flex; align-items: flex-end; justify-content: space-between; }
.counters { display: flex; gap: 22px; flex: none; }
.counter .lab { font-size: 9px; letter-spacing: 0.18em; color: var(--f-amber-lo); }
.digits { position: relative; margin-top: 6px; font-size: 42px; line-height: 0.9; letter-spacing: .04em; white-space: nowrap; }
.digits .ghost { position: absolute; inset: 0; color: rgba(255,176,74,0.08); }
.digits .val { position: relative; color: var(--f-amber); text-shadow: 0 0 14px var(--f-amber-glow); }
/* 状態語(§0.6): Share Tech Mono 30px / 7.2px / shadow 12px。REC は赤(● と点滅は v0.2.3 で撤去)。字間の末尾ぶんを引いて最後の字を右端に合わせる */
.vword { flex: none; font-size: 30px; line-height: 0.9; letter-spacing: 7.2px; margin-right: -7.2px; margin-bottom: 1.33px; white-space: nowrap;   /* 1.33px 上げると字の底が 7 セグの底と同じ行に乗る(実測) */
  color: var(--f-amber); text-shadow: 0 0 12px rgba(255,176,74,.55); }
.vword.rec { color: #ff4a3a; text-shadow: 0 0 12px rgba(255,74,58,.6); }
.gauge { margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--f-vhr); }
.gauge .row1 { display: flex; justify-content: space-between; align-items: baseline; }
.gauge .lab { font-size: 9px; letter-spacing: 0.18em; color: var(--f-amber-lo); }
.gauge .fit { font-size: 9px; line-height: 11.33px; letter-spacing: 1.8px; color: rgba(255,176,74,.55); text-shadow: 0 0 6px rgba(255,176,74,.4); }   /* 動画なし。line-height は v0.1.4 の 10px 時の行高(バーの位置を動かさない) */
.gauge .fit.lit { color: var(--f-amber); }                                                                                  /* 動画あり */
.bar { position: relative; height: 8px; margin-top: 5px; border-radius: 3px; background: rgba(255,255,255,0.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); overflow: hidden; }
/* バー全体 = テープ(BUDGET)。明るい幅 = 右端の MB と同じ値。解析中は見込み(est_total)を薄く敷く(TF の ROM CAPACITY バーと同じ読み方) */
.bar .seg { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: var(--f-amber); box-shadow: 0 0 6px var(--f-amber-fill); }
.bar .seg.dim { background: rgba(255,176,74,.28); box-shadow: none; }
.bar.rec .seg:not(.dim) { background: var(--f-red); box-shadow: 0 0 6px var(--f-red-glow); }
.bar .seg-pos { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: rgba(255,255,255,0.12); }                       /* 再生 / 録画位置 */
.gauge .scale { display: flex; justify-content: space-between; margin-top: 4px; font-size: 8px; letter-spacing: 0.18em; color: var(--f-amber-lo); }

/* ============ CONTROL PANEL — 部品そのまま。VF はグループ配置と REC/OUTPUT の状態表示だけ ============ */
.controls { flex: none; margin-top: 20px; padding: 18px 0 0; position: relative; }
.controls::before { content: ""; position: absolute; left: -10px; right: -10px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.65) 12%, rgba(0,0,0,0.65) 88%, transparent);
  box-shadow: 0 1px 0 rgba(255,255,255,0.13); }
.cright { display: flex; align-items: flex-start; gap: 22px; }
.cstack.end { align-items: flex-end; }
.cstack.tight { gap: 5px; }
.tbtn.on .g, .tbtn.on .n { color: var(--f-amber); }
.recbtn:not(.armed):not(.busy) { opacity: 0.55; }
.recbtn.busy { background-image: linear-gradient(180deg, #4a1512, #2a0c0a); }
.recbtn.armed .reclamp { opacity: 1; }
.dlg-b .mono { font-family: var(--f-font-mono); }
