/* 入稿検査：app.css の部品（.bar .btn .fld .seg .tabs .side .body .sec）の上に、検査だけの部品を足す。説明の文は置かず、アイコン・色・並びで読ませる。 */
:root {
  --fail: #c40000; --failbg: #fde8e8; --failtx: #7c0000;
  --warn: #8a5a00; --warnbg: #fff4d6; --warntx: #5c3b00; --warnfill: #f2b200;
  --pass: var(--g800); --passbg: var(--g50);
  --ln-trim: #1a1a1a; --ln-bleed: #c40000; --ln-safe: #197a4b;
}
.ck { grid-template-columns: 308px minmax(0, 1fr) 372px; }
.ckstage { grid-template-rows: auto minmax(0, 1fr); }

/* 上の帯 */
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; padding: 0 6px 0 2px; white-space: nowrap; }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--g800); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--k536); border-radius: 16px; background: var(--k0); white-space: nowrap; max-width: 12em; }
.chip span { overflow: hidden; text-overflow: ellipsis; }
.chip:hover { background: var(--k100); }
.chip[aria-pressed="true"] { background: var(--g800); border-color: var(--g800); color: #fff; font-weight: 700; }
.chip .ic { width: 16px; height: 16px; }

/* 左：ファイル */
.drop { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 140px; border: 2px dashed var(--g700); border-radius: 12px; background: #f6fbf8; color: var(--g800); cursor: pointer; transition: background .12s; flex: none; }
.drop:hover, .drop.over { background: var(--g50); border-style: solid; }
.drop .disc { width: 56px; height: 56px; border-radius: 50%; background: var(--g800); color: #fff; display: flex; align-items: center; justify-content: center; }
.drop.slim { min-height: 52px; border-width: 1.5px; }
.drop.slim .disc { width: 32px; height: 32px; }
.drop.slim .disc .ic { width: 18px; height: 18px; }
.flist { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.fcard { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr) 36px; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--k200); border-radius: 10px; background: var(--k0); text-align: left; width: 100%; min-width: 0; }
.fcard:hover { background: var(--k50); }
.fcard[aria-current="true"] { border: 2px solid var(--g800); padding: 7px; background: var(--g50); }
.thumb { width: 46px; height: 62px; border-radius: 3px; background: var(--k100); border: 1px solid var(--k200); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--k536); }
.thumb canvas, .thumb img { max-width: 100%; max-height: 100%; display: block; background: #fff; }
.fbody { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fname { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fmeta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--k700); font-variant-numeric: tabular-nums; min-width: 0; }
.fmeta > span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.fmeta .ic { width: 14px; height: 14px; }
.tally { display: flex; align-items: center; gap: 10px; font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 700; }
.tally > span { display: inline-flex; align-items: center; gap: 2px; }
.tally .ic { width: 14px; height: 14px; }
.tally .f { color: var(--fail); } .tally .w { color: var(--warn); } .tally .p { color: var(--pass); }
.tally .z { opacity: .35; }
.vb { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.vb.pass { background: var(--g800); color: #fff; }
.vb.fail { background: var(--fail); color: #fff; }
.vb.warn { background: var(--warnfill); color: var(--warntx); }
.vb.wait { background: var(--k0); color: var(--k700); border: 2px solid var(--k536); }
.vb.busy { background: var(--k100); color: var(--k700); }
.vb .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.fcard .rm { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; min-width: 24px; padding: 0; opacity: 0; }
.fcard:hover .rm, .fcard:focus-within .rm { opacity: 1; }
@media (hover: none) { .fcard .rm { opacity: 1; } }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 左：基準 */
.rule { display: flex; flex-direction: column; gap: 6px; padding: 6px 8px; border: 1px solid var(--k200); border-radius: 8px; min-width: 0; background: var(--k0); }
.rule.off { border-style: dashed; background: var(--k50); }
.rule.off .rn, .rule.off .ri { color: var(--k536); }
.rule .rh { display: flex; align-items: center; gap: 8px; min-height: 32px; min-width: 0; }
.rule .ri { flex: none; color: var(--g800); display: flex; }
.rule .rn { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 13px; }
.rule .rp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.rule .rp .fld { height: 32px; }
.tg { position: relative; flex: none; width: 40px; height: 24px; border: 0; border-radius: 12px; background: var(--k536); padding: 0; transition: background .12s; }
.tg::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .12s; }
.tg[aria-pressed="true"] { background: var(--g800); }
.tg[aria-pressed="true"]::after { transform: translateX(16px); }
.tg:disabled { opacity: .7; cursor: default; }
.pname { display: flex; gap: 6px; align-items: center; min-width: 0; }
.pname .fld { flex: 1 1 0; }
.mlist { display: flex; flex-direction: column; gap: 6px; }
.mrow { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mrow .fld { flex: 1 1 0; }

/* 右：結果 */
.hero { display: grid; grid-template-columns: 116px minmax(0, 1fr); align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--k200); border-radius: 12px; background: var(--k0); flex: none; }
.hero.fail { border-color: var(--fail); background: var(--failbg); }
.hero.warn { border-color: var(--warn); background: var(--warnbg); }
.hero.pass { border-color: var(--g800); background: var(--passbg); }
.ring { width: 116px; height: 116px; position: relative; }
.ring svg.rg { width: 100%; height: 100%; display: block; transform: rotate(-90deg); }
.ring .ctr { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ring .ctr .vb { width: 54px; height: 54px; }
.ring .ctr .vb .ic { width: 30px; height: 30px; }
.stats { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stat { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .d { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.stat .d .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.stat.f .d { background: var(--fail); color: #fff; } .stat.f { color: var(--failtx); }
.stat.w .d { background: var(--warnfill); color: var(--warntx); } .stat.w { color: var(--warntx); }
.stat.p .d { background: var(--g800); color: #fff; } .stat.p { color: var(--g900); }
.stat.z { opacity: .4; }
.fhead { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 700; flex: none; }
.fhead .ic { color: var(--k700); }
.fhead .nm { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fhead .pf { flex: none; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 12px; background: var(--k100); }

.crows { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.crow { display: grid; grid-template-columns: 28px 22px minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 4px 10px 4px 8px; border: 1px solid var(--k200); border-radius: 8px; background: var(--k0); text-align: left; min-width: 0; }
.crow:hover { filter: brightness(.97); }
.crow .sd { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.crow .sd .ic { width: 16px; height: 16px; stroke-width: 2.6; }
.crow .ci { display: flex; color: var(--k700); }
.crow .cn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.crow .vl { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.crow .vl i { font-style: normal; font-size: 11px; font-weight: 400; color: var(--k700); margin-left: 2px; }
.crow .ct { min-width: 26px; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; color: #fff; }
.crow .ct.z { visibility: hidden; }
.crow.pass .sd { background: var(--g800); color: #fff; }
.crow.fail { background: var(--failbg); border-color: var(--fail); color: var(--failtx); }
.crow.fail .sd { background: var(--fail); color: #fff; } .crow.fail .ci { color: var(--failtx); } .crow.fail .ct { background: var(--fail); } .crow.fail .vl i { color: var(--failtx); }
.crow.warn { background: var(--warnbg); border-color: var(--warn); color: var(--warntx); }
.crow.warn .sd { background: var(--warnfill); color: var(--warntx); } .crow.warn .ci { color: var(--warntx); } .crow.warn .ct { background: var(--warn); } .crow.warn .vl i { color: var(--warntx); }
.crow.idle .sd { background: var(--k100); color: var(--k536); }
.crow.idle .ci { color: var(--k536); }
.crow.off { border-style: dashed; background: var(--k50); color: var(--k536); }
.crow.off .sd { background: var(--k200); color: var(--k700); } .crow.off .ci { color: var(--k536); }
.crow[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--k900); }
.occ { display: flex; flex-direction: column; gap: 3px; padding: 4px 0 2px 36px; min-width: 0; }
.oc { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: var(--k50); text-align: left; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 0; }
.oc:hover { background: var(--k100); }
.oc .pg { flex: none; min-width: 30px; height: 20px; border-radius: 10px; background: var(--k900); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.oc .tx { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.man { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 4px 10px; border: 1px solid var(--k200); border-radius: 8px; background: var(--k0); text-align: left; min-width: 0; }
.man .bx { width: 26px; height: 26px; border: 2px solid var(--k536); border-radius: 6px; display: flex; align-items: center; justify-content: center; flex: none; color: transparent; }
.man .bx .ic { width: 18px; height: 18px; stroke-width: 3; }
.man[aria-pressed="true"] { background: var(--passbg); border-color: var(--g800); }
.man[aria-pressed="true"] .bx { background: var(--g800); border-color: var(--g800); color: #fff; }
.man .mn { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 13px; }

/* 説明の札（オーバーレイ）と、その印 */
.inf { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: var(--k536); flex: none; cursor: help; }
.inf:hover, .inf:focus-visible { color: var(--k900); background: rgba(0, 0, 0, .08); }
.inf.warn { color: var(--warn); }
.crow.fail .inf { color: var(--failtx); } .crow.warn .inf { color: var(--warntx); }
.sec > h3 .inf { width: 22px; height: 22px; }
#tip { position: fixed; z-index: 60; max-width: min(340px, calc(100vw - 16px)); background: #1a1a1a; color: #fff; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.55; box-shadow: 0 8px 28px rgba(0, 0, 0, .4); pointer-events: none; }
#tip[hidden] { display: none; }
#tip .th { display: flex; align-items: center; gap: 8px; font-size: 14px; }
#tip ul { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
#tip li { display: flex; gap: 8px; align-items: flex-start; }
#tip li .ic { margin-top: 3px; }

/* 分版の切り替え：C・M・Y・K と合成 */
.pls { display: inline-flex; align-items: center; gap: 4px; }
.pl { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: var(--h); height: var(--h); padding: 0 8px; border: 1px solid var(--k536); border-radius: var(--r); background: var(--k0); font-weight: 700; }
.pl:hover { background: var(--k100); }
.pl i { width: 14px; height: 14px; border-radius: 50%; background: var(--pc); border: 1px solid rgba(0, 0, 0, .35); flex: none; }
.pl[aria-pressed="true"] { border-color: var(--k900); box-shadow: inset 0 -3px 0 var(--pc, var(--g800)); }
.pl.all[aria-pressed="true"] { background: var(--g800); border-color: var(--g800); color: #fff; box-shadow: none; }
.pl:disabled { opacity: .4; cursor: default; }
.pl-src { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; }
.pl-src.icc { background: var(--g800); color: #fff; } .pl-src.approx { background: var(--k200); color: var(--k700); }
.rbusy { position: absolute; top: 14px; right: 18px; color: var(--g800); background: #fff; border-radius: 50%; padding: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); z-index: 3; display: flex; }

/* 右：使った色（CMYK の値と各版の量） */
.pal { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; width: 100%; min-height: 62px; padding: 6px 10px 6px 8px; border: 1px solid var(--k200); border-radius: 8px; background: var(--k0); text-align: left; min-width: 0; }
.pal:hover { background: var(--k50); }
.pal[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--k900); }
.pal.rgb { background: var(--failbg); border-color: var(--fail); color: var(--failtx); }
.pal .sw { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--k536); }
.pal .sw.spot { background: repeating-linear-gradient(45deg, rgba(35, 24, 21, calc(var(--t) * .9)) 0 3px, #fff 3px 6px); }
.inks { display: flex; align-items: flex-end; gap: 8px; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.ink { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 30px; flex: none; font-variant-numeric: tabular-nums; }
.ink em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--k700); line-height: 1; }
.ink .tk { width: 14px; height: 24px; background: var(--k100); border: 1px solid var(--k200); border-radius: 3px; display: flex; align-items: flex-end; overflow: hidden; }
.ink .tk i { display: block; width: 100%; }
.ink b { font-size: 11px; line-height: 1.1; font-weight: 700; }
.pal .spn { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1 1 0; font-size: 13px; font-weight: 700; }
.pal .spn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal .tc { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pal .tc i { font-style: normal; font-size: 11px; font-weight: 400; color: var(--k700); }
.pal .ct.n { min-width: 26px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--k200); color: var(--k900); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* 中央：紙面 */
.ktool { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 6px 10px; background: var(--k0); border-bottom: 1px solid var(--k200); min-width: 0; }
.ktool .gap { flex: 1 1 0; min-width: 0; }
.ktool .pn { min-width: 4.4em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }
.ktool .pn i { font-style: normal; font-weight: 400; color: var(--k700); }
.lt { display: inline-flex; align-items: center; gap: 6px; height: var(--h); padding: 0 8px; border: 1px solid var(--k536); border-radius: var(--r); background: var(--k0); }
.lt:hover { background: var(--k100); }
.lt[aria-pressed="true"] { background: var(--k0); border-color: var(--k900); box-shadow: inset 0 -3px 0 var(--lc, var(--k900)); }
.lt[aria-pressed="false"] { color: var(--k536); border-color: var(--k200); }
.lt[aria-pressed="false"] .ln { opacity: .35; }
.lt .ln { width: 22px; height: 0; border-top: 3px solid var(--lc, var(--k900)); flex: none; }
.lt .ln.dash { border-top-style: dashed; }
.kview { position: relative; min-height: 0; min-width: 0; overflow: auto; display: flex; padding: 16px; background: var(--k200); }
.kview.over { outline: 3px solid var(--g800); outline-offset: -6px; }
.sheet { position: relative; margin: auto; flex: none; box-shadow: 0 1px 8px rgba(0, 0, 0, .38); background: #fff; }
.sheet canvas { display: block; background: #fff; }
.sheet svg.ov { position: absolute; left: 0; top: 0; overflow: visible; }
.sheet svg.ov .mk { cursor: pointer; }
.sheet svg.ov .mk rect.hit { fill-opacity: .14; }
.sheet svg.ov .mk.flash rect.hit { animation: pulse .5s ease-in-out 3; }
@keyframes pulse { 50% { fill-opacity: .55; stroke-width: 4; } }
.empty { margin: auto; display: flex; align-items: center; justify-content: center; width: min(46vmin, 240px); height: min(46vmin, 240px); border-radius: 50%; border: 3px dashed var(--g800); color: var(--g800); background: rgba(255, 255, 255, .6); cursor: pointer; }
.empty:hover { background: #fff; }
.empty .ic { width: 38%; height: 38%; stroke-width: 1.6; }
.busyring { margin: auto; color: var(--g800); }

/* 狭い画面：紙面の下にパネルを 1 つだけ出す（ページ全体はスクロールさせない） */
.zms { display: inline-flex; gap: 4px; }
.tabs [data-tab="res"], .rtabs { display: none; }
@media (max-width: 900px) {
  .ck { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 48%); }
  .ck .stage { grid-row: 1; }
  .ck .side.left, .ck .side.right { grid-row: 2; border: 0; border-top: 1px solid var(--k200); display: flex; }
  .ck[data-tab="res"] .side.left { display: none; }
  .ck:not([data-tab="res"]) .side.right { display: none; }
  .tabs [data-tab="res"] { display: flex; }
  .rtabs { display: flex; }
  .tabs button, .rtabs button { height: 44px; }
  .hero { grid-template-columns: 96px minmax(0, 1fr); }
  .ring { width: 96px; height: 96px; }
  .ring .ctr .vb { width: 44px; height: 44px; }
  .ring .ctr .vb .ic { width: 24px; height: 24px; }
  .kview { padding: 8px; }
}
/* 低い窓（横向きのスマホ・小さなペイン）：紙面を縦に潰さず、パネルを右に置く */
@media (max-width: 900px) and (max-height: 620px) and (min-width: 521px) {
  .ck { grid-template-columns: minmax(0, 1fr) minmax(0, 44%); grid-template-rows: minmax(0, 1fr); }
  .ck .stage { grid-row: 1; grid-column: 1; }
  .ck .side.left, .ck .side.right { grid-row: 1; grid-column: 2; border: 0; border-left: 1px solid var(--k200); }
}
@media (max-width: 520px) {
  .brand, .ktool .sep, .zms .btn:not(.on) { display: none; }
  .zms { display: inline-flex; }
  .chip { padding: 0 10px; max-width: 8em; }
  .lt { padding: 0 6px; gap: 4px; }
  .lt .ln { width: 14px; }
  .ck { grid-template-rows: minmax(0, 1fr) minmax(0, 52%); }
}
@media print { .bar, .left, .ktool, .rtabs { display: none !important; } }
