/* レイアウト作成の画面（/layout）。色と部品は demo.css にそろえる */
.designer .demo-head .hint strong { color: var(--navy); }

/* 下地 */
.dz-base { padding: 14px 16px; margin-bottom: 14px; }
.dz-base-row { display: flex; gap: 12px 18px; align-items: flex-end; flex-wrap: wrap; }
.dz-base-blank, .dz-custom { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.dz-base-blank .field { margin-bottom: 0; min-width: 220px; }
.dz-custom .field { width: 110px; flex: 0 0 auto; }
.dz-base-pdf { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; flex: 1; min-width: 0; }
.dz-sample-pdfs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dz-drop-pdf { flex: 1; min-width: 240px; padding: 10px 12px; }
.dz-base-info { display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
.dz-pager { display: flex; gap: 4px; align-items: center; }
.dz-pager select { width: auto; padding: 4px 6px; font-size: 13px; }
.dz-base .msg, .dz-stage > .msg, .dz-out .msg { margin: 8px 0 0; }
.msg-ok { background: #eef7f0; color: #1f5f33; border: 1px solid #c6e3cf; }

/* 切り替えのボタン（白紙・PDF、横書き・縦書き、寄せ） */
.dz-seg { display: inline-flex; border: 1px solid var(--navy); border-radius: var(--radius); overflow: hidden; flex-wrap: wrap; }
.dz-seg button { border: none; background: #fff; color: var(--navy); font: inherit; font-size: 13.5px; padding: 8px 14px; cursor: pointer; }
.dz-seg button + button { border-left: 1px solid var(--navy); }
.dz-seg button.on { background: var(--navy); color: #fff; }
.dz-seg.small button { font-size: 12.5px; padding: 5px 10px; }

/* 用紙と、部品の設定 */
.dz-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(300px, 4fr); gap: 14px; align-items: start; }
.dz-stage { padding: 10px 12px 12px; min-width: 0; }
.dz-toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.dz-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.dz-tool { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; min-width: 56px; padding: 5px 6px 4px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; color: var(--navy); font: inherit; font-size: 11.5px; cursor: pointer; }
.dz-tool:hover { background: var(--paper-3); }
.dz-tool.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.dz-ico { display: block; height: 18px; }
.dz-view { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.dz-mini { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--ink-soft); margin: 0; }
.dz-mini select { width: auto; padding: 4px 6px; font-size: 12.5px; }
.dz-zoom, .dz-undo { display: inline-flex; gap: 3px; }
.dz-zoom .btn { min-width: 34px; }
.dz-status { margin: 6px 0; min-height: 1.5em; }

.dz-scroll { overflow: auto; background: var(--paper-3); border-radius: var(--radius); padding: 12px; max-height: calc(100vh - 120px); min-height: 260px;
  outline: 2px dashed transparent; outline-offset: -4px; }
.dz-scroll.over { outline-color: var(--navy); background: #e6ecf5; }
.dz-page { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.18); user-select: none; -webkit-user-select: none;
  touch-action: pan-x pan-y; }
.dz-page.drawing { cursor: crosshair; touch-action: none; }
.dz-page.drawing .dz-frame { pointer-events: none; }
.dz-bg { position: absolute; left: 0; top: 0; display: none; pointer-events: none; }
.dz-gridlines { position: absolute; inset: 0; pointer-events: none; }
.dz-missing { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px;
  background: repeating-linear-gradient(45deg, #fff 0 12px, #f6f8fb 12px 24px); color: var(--navy); }
.dz-missing p { margin: 4px 0; max-width: 360px; }

/* 枠 */
.dz-frame { position: absolute; outline: 1px dashed rgba(23,52,88,.45); outline-offset: 0; cursor: move; touch-action: none; }
.dz-frame:hover { outline-color: var(--accent); }
.dz-frame.is-sel { outline: 2px solid var(--accent); }
.dz-frame:focus-visible { outline: 2px solid var(--accent); box-shadow: 0 0 0 4px rgba(226,97,46,.25); }
.dz-frame.is-line { outline: none; }
.dz-frame.is-line:hover .dz-linesvg, .dz-frame.is-line.is-sel .dz-linesvg { filter: drop-shadow(0 0 2px rgba(226,97,46,.9)); }
.dz-tag { position: absolute; left: -1px; top: -16px; background: var(--accent); color: #fff; font-size: 10.5px; line-height: 15px; padding: 0 5px; border-radius: 2px 2px 0 0;
  white-space: nowrap; pointer-events: none; display: none; }
.dz-frame.is-sel .dz-tag, .dz-frame:hover .dz-tag { display: block; }
.dz-frame.is-line .dz-tag { top: -10px; }
.dz-handles .dz-rh { position: absolute; width: 10px; height: 10px; background: #fff; border: 2px solid var(--accent); border-radius: 2px; touch-action: none; z-index: 2; }
.rh-nw { left: -6px; top: -6px; cursor: nwse-resize; } .rh-n { left: calc(50% - 5px); top: -6px; cursor: ns-resize; }
.rh-ne { right: -6px; top: -6px; cursor: nesw-resize; } .rh-e { right: -6px; top: calc(50% - 5px); cursor: ew-resize; }
.rh-se { right: -6px; bottom: -6px; cursor: nwse-resize; } .rh-s { left: calc(50% - 5px); bottom: -6px; cursor: ns-resize; }
.rh-sw { left: -6px; bottom: -6px; cursor: nesw-resize; } .rh-w { left: -6px; top: calc(50% - 5px); cursor: ew-resize; }
.dz-ep { position: absolute; top: calc(50% - 7px); width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); cursor: crosshair; touch-action: none; z-index: 2; }
.dz-ep[data-end="a"] { left: -7px; } .dz-ep[data-end="b"] { right: -7px; }
@media (pointer: coarse) {
  .dz-handles .dz-rh { width: 18px; height: 18px; }
  .rh-nw { left: -10px; top: -10px; } .rh-n { left: calc(50% - 9px); top: -10px; } .rh-ne { right: -10px; top: -10px; } .rh-e { right: -10px; top: calc(50% - 9px); }
  .rh-se { right: -10px; bottom: -10px; } .rh-s { left: calc(50% - 9px); bottom: -10px; } .rh-sw { left: -10px; bottom: -10px; } .rh-w { left: -10px; top: calc(50% - 9px); }
  .dz-ep { width: 22px; height: 22px; top: calc(50% - 11px); } .dz-ep[data-end="a"] { left: -11px; } .dz-ep[data-end="b"] { right: -11px; }
}
.dz-rubber { position: absolute; border: 1.5px dashed var(--accent); background: rgba(226,97,46,.08); pointer-events: none; z-index: 1000; }
.dz-rubber.line { height: 0; border: none; border-top: 2px dashed var(--accent); background: none; transform-origin: 0 0; }

/* 枠の中の目安（組版はしない） */
.dz-text { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.dz-text > span { display: block; overflow-wrap: anywhere; opacity: .92; }
.dz-table { position: absolute; inset: 0; overflow: hidden; line-height: 1.3; }
.dz-tr { display: flex; align-items: center; box-sizing: border-box; }
.dz-tr:first-child { border-top: 1px solid #333; }
.dz-tr > span { overflow: hidden; white-space: nowrap; box-sizing: border-box; height: 100%; display: flex; align-items: center; flex: 0 0 auto; }
.dz-more { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255,246,224,.95); color: #5c4208; font-size: 10.5px; padding: 1px 4px; text-align: center; }
.dz-image { position: absolute; inset: 0; overflow: hidden; }
.dz-image img { position: absolute; display: block; max-width: none; }
.dz-noimg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: #f6f8fb;
  color: var(--danger); font-size: 11px; line-height: 1.4; padding: 4px; }
.dz-rect { position: absolute; inset: 0; box-sizing: border-box; }
.dz-linesvg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.dz-code { position: absolute; inset: 0; }
.dz-bars { position: absolute; }
.dz-caption { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 10px; line-height: 1.2; color: #111; overflow: hidden; white-space: nowrap; }

/* 右の欄 */
.dz-side { padding: 0 0 14px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.dz-make { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 16px 0; }
.dz-props, .dz-pdf { margin: 12px 16px 0; }
.dz-h4 { font-size: 13.5px; margin: 12px 0 6px; }
.dz-layers { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 3px; max-height: 300px; overflow: auto; }
.dz-layers button { width: 100%; display: flex; gap: 8px; align-items: baseline; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  padding: 5px 8px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--ink); }
.dz-layers button:hover { background: var(--paper-3); }
.dz-layers b { color: var(--navy); flex: 0 0 auto; }
.dz-layers span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.dz-props-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.dz-props-head strong { font-size: 15px; color: var(--navy); }
.dz-props-head .btn { margin-left: auto; }
.dz-geom { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.dz-geom label { display: block; font-size: 12px; color: var(--ink-soft); }
.dz-geom input { padding: 5px 6px; font-size: 13px; }
.dz-unit { margin: 2px 0 10px; }
.dz-props .field > span { display: block; }
/* 並べた欄の、広い欄が細くなりすぎないように（狭いときは折り返す） */
.dz-props .field-row > .field:not(.field-s) { min-width: 140px; }
.dz-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }

/* 色を選ぶ欄 */
.dz-color { margin-top: 2px; }
.dz-swatches { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.dz-sw { width: 24px; height: 24px; border-radius: 50%; border: 1px solid #c9d1dc; cursor: pointer; padding: 0; }
.dz-sw.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent); }
.dz-sw-none { background: linear-gradient(135deg, #fff 45%, var(--danger) 45%, var(--danger) 55%, #fff 55%); }
.dz-cmyk-btn { margin-left: 4px; }
.dz-cmyk { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.dz-cmyk label { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.dz-cmyk input { padding: 4px 5px; font-size: 13px; }

/* 表の列とセル */
.dz-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.dz-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; border: 1px solid var(--line); border-radius: var(--radius); padding: 5px; font-size: 12px; }
.dz-col b { grid-column: 1 / -1; color: var(--navy); font-weight: 700; }
.dz-col input, .dz-col select { padding: 3px 4px; font-size: 12.5px; }
.dz-cells { display: grid; gap: 3px; overflow-x: auto; margin: 6px 0; max-height: 320px; overflow-y: auto; }
.dz-cellrow { display: contents; }
.dz-cellrow input { padding: 4px 5px; font-size: 12.5px; min-width: 0; }
.dz-cellrow.head input { background: var(--paper-3); font-weight: 700; }

/* 画像を選ぶ */
.dz-imgpick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.dz-thumb { width: 72px; height: 54px; padding: 0; border: 2px solid var(--line); border-radius: var(--radius); background: var(--paper-3); cursor: pointer; overflow: hidden; }
.dz-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dz-thumb.on { border-color: var(--accent); }
.dz-drop-small { padding: 8px 10px; }

/* 書き出したコード */
.dz-out { margin-top: 14px; padding: 16px; }
.dz-out-head { display: flex; gap: 10px 16px; align-items: flex-start; flex-wrap: wrap; }
.dz-out-head h3 { margin: 0 0 2px; font-size: 16px; color: var(--navy); }
.dz-out-head .hint { margin: 0; }
.dz-out-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.dz-drop-json { margin-top: 10px; padding: 9px 12px; }
.dz-code-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 12px; }
.dz-code-pane { min-width: 0; }
.dz-code-pane .bar { margin-bottom: 6px; }
.dz-code-pane .bar strong { font-size: 13.5px; color: var(--navy); margin-right: auto; }
/* position: relative は、選んだ枠の行まで送るときの基準（offsetTop）にするため */
.dz-codebox { position: relative; max-height: 70vh; min-height: 240px; padding: 10px 0; }
.dz-codebox .ln { display: block; padding: 0 14px; min-height: 1.6em; }
.dz-codebox .ln.hl { background: rgba(226,97,46,.28); box-shadow: inset 3px 0 0 var(--accent); }
.dz-codebox.stale { opacity: .55; }
.tk-key { color: #9cd2ff; } .tk-str { color: #c9e7a8; } .tk-num { color: #ffcf8a; } .tk-lit { color: #f5a3c7; }
.tk-var { color: #9cd2ff; } .tk-fn { color: #ffd98a; } .tk-com { color: #8a9ab0; }

/* ひな形・読み込みで外した項目 */
.dz-starter { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.dz-starter select { width: auto; max-width: 260px; padding: 4px 6px; font-size: 13px; }
.dz-report { padding: 12px 16px; margin-bottom: 14px; }
.dz-report .bar { margin-bottom: 4px; }
.dz-report .bar strong { margin-right: auto; }
.dz-report-head { margin: 6px 0 2px; font-weight: 700; font-size: 13px; }
.dz-report ul { margin: 0 0 4px; padding-left: 1.3em; font-size: 13px; columns: 2 280px; column-gap: 24px; }
.dz-report li { break-inside: avoid; }

/* ページ（番号のページ・全ページの要素・続きのページ） */
.dz-pagebar { display: flex; gap: 4px 6px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.dz-pagebar select { width: auto; max-width: 100%; min-width: 0; padding: 4px 6px; font-size: 13px; }
.dz-pageops { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: 6px; }
.dz-layerhint { margin: 6px 0 0; padding: 6px 10px; border-radius: var(--radius); background: #eef3fa; color: var(--navy); font-size: 12.5px; }
.dz-pagenote { margin: 6px 0 0; font-size: 12.5px; }
.dz-tool:disabled { opacity: .4; cursor: not-allowed; background: #fff; }

/* 薄く見せる、ほかの層の部品（全ページの要素） */
.dz-frame.is-ghost { pointer-events: none; opacity: .38; outline-color: rgba(23,52,88,.25); }
.dz-frame.is-ghost .dz-tag { display: none; }
/* 回り込み：文章が避ける範囲の目安 */
.dz-wrapzone { position: absolute; border: 1px dashed rgba(226,97,46,.7); background: repeating-linear-gradient(45deg, rgba(226,97,46,.07) 0 4px, transparent 4px 8px); pointer-events: none; }

/* 流し込み：段の目安と、文字の目安（送り・禁則はエンジン） */
.dz-flow { position: absolute; inset: 0; overflow: hidden; }
.dz-colguide { position: absolute; background: rgba(23,52,88,.045); outline: 1px dotted rgba(23,52,88,.3); }
.dz-flowtext { position: absolute; inset: 0; overflow: hidden; opacity: .55; pointer-events: none; }
/* 目安の文字の区画（段ごと。designer.js が測った大きさで組み、画面の倍率に縮める。測る隠れた要素も同じ） */
.dz-fslot { position: absolute; overflow: hidden; transform-origin: 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-break: strict;
  letter-spacing: 0; word-spacing: 0; font-feature-settings: normal; text-transform: none; }
.dz-fslot p { margin: 0; }
.dz-more.top { top: 0; bottom: auto; }
.dz-badge { position: absolute; right: 2px; top: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--navy); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; z-index: 1; cursor: help; }
/* 番号の印は、重ねると説明（title）が出る。押す・ドラッグは枠のまま */
.dz-frame.is-ghost .dz-badge, .dz-frame.is-fixed .dz-badge { pointer-events: none; }
.dz-frame.is-sub { outline: 2px dashed rgba(23,52,88,.55); background: rgba(23,52,88,.03); }
.dz-frame.is-sub.is-sel { outline: 2px dashed var(--accent); }
.dz-frame.is-fixed { cursor: default; pointer-events: none; outline-style: dotted; }
.dz-subnote { position: absolute; left: 6px; right: 6px; bottom: 6px; font-size: 11px; color: var(--navy); background: rgba(255,255,255,.85); padding: 2px 6px; border-radius: 2px; }

/* 順番をつなぐ：案内（画面を送っても上に残る）と、枠の見た目（つないだ枠・次にできる枠・今はできない枠・ほかの部品） */
.dz-orderbar { position: sticky; top: 0; z-index: 30; display: flex; gap: 6px 12px; align-items: center; flex-wrap: wrap; margin: 6px 0; padding: 8px 10px;
  border-radius: var(--radius); background: #fff4ee; border: 1.5px solid var(--accent); color: var(--ink); font-size: 13px; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.dz-orderbar-text { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.dz-orderbar-text b { color: var(--accent); font-size: 12px; }
/* 知らせは 2 行分をとっておく（押すたびに案内の高さが変わって、用紙がずれないように） */
.dz-ordermsg { font-size: 12.5px; min-height: 2.9em; }
.dz-ordermsg.is-error { color: var(--danger); }
.dz-ordermsg.is-ok { color: #1f5f33; }
.dz-orderbar-tools { display: flex; gap: 6px; flex: 0 0 auto; margin-left: auto; }
/* 間は、枠の上からも画面を送れる（数えるのはタップ） */
.dz-page.ordering, .dz-page.ordering .dz-frame { touch-action: manipulation; }
.dz-page.ordering .dz-frame { cursor: not-allowed; }
.dz-page.ordering .dz-frame.is-pick { cursor: pointer; outline: 2px dashed var(--accent); }
.dz-page.ordering .dz-frame.is-pick:hover { background: rgba(226,97,46,.08); }
.dz-page.ordering .dz-frame.is-picked { cursor: default; outline: 2px solid var(--accent); }
.dz-page.ordering .dz-frame.is-picked .dz-badge { background: var(--accent); }
.dz-page.ordering .dz-frame.is-blocked { outline: 2px dotted rgba(23,52,88,.45); }
.dz-page.ordering .dz-frame.is-off, .dz-page.ordering .dz-frame.is-off:hover { opacity: .45; outline-color: rgba(23,52,88,.3); }
.dz-page.ordering .dz-tag { display: none; }
/* つないだ枠を番号の順に結ぶ線（ほかの部品の上、選んでいる流し込みの枠の下。番号の印が線の上に来る） */
.dz-links { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 895; }
/* 前後の枠が別のページのときの印（入る側は始まりの角、出る側は終わりの角。縦書きは右上から左下へ） */
.dz-pagemark { position: absolute; z-index: 2; font-size: 10.5px; line-height: 16px; padding: 0 6px; border-radius: 8px; background: var(--navy); color: #fff;
  white-space: nowrap; pointer-events: none; opacity: .88; }
.dz-pagemark.in { left: 2px; top: 2px; }
.dz-pagemark.in.v { left: auto; right: 30px; }
.dz-pagemark.out { right: 2px; bottom: 2px; }
.dz-pagemark.out.v { right: auto; left: 2px; }
.dz-page.ordering .dz-pagemark { background: var(--accent); opacity: 1; }

/* 文書の設定・流し込みの設定 */
.dz-docset { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.dz-docset .dz-h4 { margin-top: 0; }
.dz-wrapset { display: flex; gap: 4px 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; padding: 8px 10px; background: var(--paper-2); border-radius: var(--radius); }
.dz-wrapset .check { margin: 0; flex: 1 1 200px; }
.dz-wrapset .field { margin: 0; }
.dz-blocks { display: grid; gap: 6px; max-height: 480px; overflow: auto; }
.dz-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; background: #fff; }
.dz-block.head { border-left: 3px solid var(--navy); }
.dz-block textarea { width: 100%; font-size: 13px; margin-top: 4px; }
.dz-block-head { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.dz-block-more { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.dz-framelist { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.dz-framelist li { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.dz-framelist b { display: inline-block; min-width: 20px; height: 20px; border-radius: 10px; background: var(--navy); color: #fff; text-align: center; line-height: 20px; font-size: 11.5px; }
.dz-framelist input { width: 58px; padding: 3px 5px; font-size: 12.5px; }
.dz-frametools { display: inline-flex; gap: 4px; align-items: center; margin-left: auto; }
.dz-linkbtn { border: none; background: none; padding: 0; color: var(--navy); text-decoration: underline; cursor: pointer; font: inherit; font-size: 12.5px; }

/* 表（結合・塗り・斜線の目安）・グラフ・入力欄・透かし */
.dz-tgrid { display: grid; }
.dz-tgrid > span { display: flex; align-items: center; overflow: hidden; white-space: nowrap; box-sizing: border-box; min-width: 0; }
.dz-chart { position: absolute; inset: 0; overflow: hidden; }
.dz-chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dz-charttitle { position: absolute; left: 0; right: 0; top: 2px; text-align: center; color: #333; white-space: nowrap; overflow: hidden; }
.dz-field { position: absolute; inset: 0; display: flex; align-items: center; box-sizing: border-box; padding: 0 2px; overflow: hidden; white-space: nowrap; line-height: 1; }
.dz-field.f-checkbox, .dz-field.f-radio { justify-content: center !important; }
.dz-frame.is-watermark { outline: none; pointer-events: none; }
.dz-frame.is-watermark .dz-tag { display: none !important; }
.dz-wm { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.dz-wm span { position: absolute; left: 50%; top: 50%; white-space: nowrap; transform-origin: center; line-height: 1; }
.dz-frame.is-watermark.is-sel .dz-wm span { outline: 2px dashed var(--accent); outline-offset: 4px; }

/* スタイル・文字の飾り・表のセル・グラフの値 */
.field.off, .dz-seg button:disabled { opacity: .45; }
.field.off .dz-color { pointer-events: none; }
.dz-stylepick { margin-bottom: 4px; }
.dz-stylepick .field { margin-bottom: 2px; }
.dz-decor { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; }
.dz-decor summary { cursor: pointer; font-weight: 700; color: var(--navy); font-size: 13px; }
.dz-decor summary .muted { font-weight: 400; margin-left: 6px; }
.dz-decor-row { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.dz-layer { border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 6px; margin: 4px 0; }
.dz-layer .field-row { align-items: flex-end; }
.dz-gradcolor { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
.dz-cellsec { display: contents; }
.dz-cellbox { min-width: 0; }
.dz-cellbox input { width: 100%; padding: 4px 5px; font-size: 12.5px; min-width: 0; }
.dz-cellbox.fmt input { border-color: var(--navy); }
.dz-cellbox.on input { outline: 2px solid var(--accent); }
.dz-cellbox.covered { display: flex; align-items: center; justify-content: center; background: var(--paper-2); border-radius: var(--radius); font-size: 11px; }
.dz-cellrow.head .dz-cellbox input, .dz-cellrow.foot .dz-cellbox input { background: var(--paper-3); font-weight: 700; }
.dz-cellpanel { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--accent); border-radius: var(--radius); background: #fffaf6; }
.dz-cellpanel > strong { display: block; font-size: 12.5px; color: var(--navy); margin-bottom: 4px; }
.dz-chartgrid { display: grid; gap: 3px; overflow-x: auto; font-size: 12px; align-items: center; }
.dz-chartgrid b { font-weight: 700; color: var(--navy); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-chartgrid input { padding: 3px 5px; font-size: 12.5px; min-width: 0; }
.dz-chartgrid .dz-cellrow.off input { opacity: .4; }
.dz-style { border: 1px solid var(--line); border-radius: var(--radius); padding: 5px 8px; margin-bottom: 6px; }
.dz-style summary { cursor: pointer; font-size: 13px; }
.dz-style summary .muted { margin-left: 6px; }
.dz-styleprop { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(0, 1.4fr) 26px; gap: 6px; align-items: center; margin: 4px 0; font-size: 12.5px; }
.dz-styleprop select, .dz-styleprop input { padding: 3px 5px; font-size: 12.5px; }
.dz-style-add { align-items: center; margin-top: 6px; }
.dz-style-add select { width: auto; flex: 1 1 140px; padding: 4px 6px; font-size: 12.5px; }

/* タブレット・スマートフォン */
@media (max-width: 1100px) {
  .dz-code-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .dz-grid { grid-template-columns: minmax(0, 1fr); }
  .dz-side { position: static; max-height: none; }
  .dz-scroll { max-height: 75vh; }
}
@media (max-width: 560px) {
  .dz-base { padding: 12px; }
  .dz-base-blank .field { min-width: 0; flex: 1 1 100%; }
  .dz-drop-pdf { min-width: 0; flex: 1 1 100%; }
  .dz-tool { min-width: 0; flex: 1 0 calc(25% - 4px); }
  .dz-tools { width: 100%; }
  .dz-scroll { padding: 8px; max-height: none; }
  .dz-geom { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dz-out { padding: 12px; }
  .dz-out-tools .btn { flex: 1 1 calc(50% - 6px); }
  .dz-codebox { max-height: 60vh; font-size: 11.5px; }
  .dz-codebox .ln { padding: 0 10px; }
  .dz-starter { margin-left: 0; width: 100%; }
  .dz-starter .dz-mini { flex: 1 1 100%; flex-direction: column; align-items: stretch; gap: 2px; }
  .dz-starter select { max-width: none; width: 100%; }
  .dz-pageops { margin-left: 0; }
  .dz-pagebar select { flex: 1 1 60%; }
  /* 順番をつなぐ：案内は画面の下に重ねる（用紙を押し下げない）。用紙の下に、案内の分の余白を足す */
  .dz-orderbar { position: fixed; left: 8px; right: 8px; bottom: 8px; top: auto; margin: 0; z-index: 1200; box-shadow: 0 4px 16px rgba(0,0,0,.22); }
  .dz-orderbar-text { flex-basis: 100%; }
  .dz-ordermsg { min-height: 0; }
  .dz-ordermsg:empty { display: none; }
  .dz-scroll.ordering { padding-bottom: 45vh; }
}
