html {
  width: 100%;
  min-height: 100%;
}

body {
  font-family: sans-serif;
  line-height: 1.8;
  margin: 0;
  width: 100%;
  min-height: 100%;
  zoom: 0.8;
  overflow-x: hidden;
}


/* ===== 画面上部：ヘッダー（文書管理・表示モード・編集メニュー・ステータス行） =====
   寸法はデザイン（menu.svg / allarea.svg）の値 × 約1.33。
   1980×1080 の画面を縮小したデザインを、body の zoom: 0.8 で表示したときに同じ大きさになる値。
   ドロップダウン・ツールバーの z-index（1010）は、ダイアログ類（9999〜）より下に収める。 */
.pe-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  color: #595757;
  font-family: Meiryo, "メイリオ", "Yu Gothic UI", sans-serif;
  line-height: 1.4;
}

.pe-header,
.pe-header * {
  box-sizing: border-box;
}

/* hidden 属性を、下で指定している display より優先させる */
.pe-header [hidden] {
  display: none !important;
}

/* 1段目：ボタンの列
   ウィンドウが狭く右にはみ出す場合は、折り返して2行・3行で表示する。
   - 1行目：文書管理・表示モード（.pe-file-group）、2行目以降：編集メニュー（.editor-command-bar）
   - 1行のときの高さは、上 padding 10px ＋ ボタン 40px ＋ 下 padding 10px で 60px
     （下 padding が 9px なのは、下罫線 1px と合わせて 10px にするため）
   - 折り返したときの行間は 10px（row-gap は折り返したときだけ効くため、1行のときの見た目は変わらない）
   - 行の端に来た区切り線は、js/editor-ui.js が .is-line-edge を付けて隠す */
.pe-header-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 10px;
  padding: 10px 24px 9px 39px;
  border-bottom: 1px solid #9e9e9f;
}

/* updateFolderUi() が #folderInitialControls / #documentTopControls に
   style.display = 'block' を直接書き込むため、横並びは内側の .pe-file-group で行う */
.pe-file-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 20px;
}

/* グループの区切り線 */
.pe-separator {
  flex: 0 0 auto;
  width: 1px;
  height: 25px;
  margin: 0 18px;
  background: #b4b4b5;
}

/* 折り返しで行の先頭・末尾に来た区切り線（js/editor-ui.js が付け外しする）。
   display: none だと幅がなくなり、ボタンが前の行へ戻って表示が行ったり来たりするため、
   場所を残したまま見えなくする */
.pe-header-main .pe-separator.is-line-edge {
  visibility: hidden;
}

/* ----- 文字付きボタン（開く・閉じる・保存・表示モード・フォルダ指定） -----
   アイコンはボタン全面の背景画像。ラベルはアイコンの右側の領域で中央揃えにする。 */
.document-controls,
.mode-controls {
  display: flex;
  gap: 10px;
}

.pe-text-button {
  width: 100px;
  height: 40px;
  margin: 0;
  /* 上 4px：button の文字は padding の内側で上下中央に置かれるため、
     上だけ 2px 足すごとに中心が 1px 下がる（4px で、元の位置から 2px 下）。
     文字を 14px にしたときに下へ寄って見えたため、5px から 4px に戻した。
     背景のアイコンは padding の影響を受けない */
  padding: 4px 0 0 39px;
  border: 1px solid #888;
  border-radius: 4px;
  background-color: #eee;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  /* 文字色は見本（plants_editor_plan01-2.svg：#231815）に合わせる。
     大きさは見本（Meiryo 9 → 12px）より大きくし、読みやすさを優先して 14px に統一する。
     選択中の表示モードの文字色（青）は、下の .mode-button.active が上書きする */
  color: #231815;
  font: inherit;
  font-size: 14px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.pe-text-button:hover:not(:disabled) {
  background-color: #e2e2e2;
}

/* 「開く」は表示切り替え用の要素（#folderInitialControls／#documentTopControls）に包まれているため、
   ブロック表示にして、行の高さの分だけ縦位置がずれないようにする */
.document-controls .pe-text-button {
  display: block;
}

.pe-icon-open { background-image: url("../img/icons/open.svg"); }
.pe-icon-close { background-image: url("../img/icons/close.svg"); }
.pe-icon-save { background-image: url("../img/icons/save.svg"); }
.pe-icon-mode-edit { background-image: url("../img/icons/mode-edit.svg"); }
.pe-icon-mode-web { background-image: url("../img/icons/mode-web.svg"); }
.pe-icon-mode-pdf { background-image: url("../img/icons/mode-pdf.svg"); }

/* 表示モードの選択中（.active は editor.js の setMode() が付け替える） */
.mode-button.active {
  border-color: #4a7dbe;
  background-color: #e4edf8;
  color: #4a7dbe;
}

.mode-button.active.pe-icon-mode-edit { background-image: url("../img/icons/mode-edit-active.svg"); }
.mode-button.active.pe-icon-mode-web { background-image: url("../img/icons/mode-web-active.svg"); }
.mode-button.active.pe-icon-mode-pdf { background-image: url("../img/icons/mode-pdf-active.svg"); }

/* ----- 編集メニュー（nav.editor-command-bar） ----- */
.editor-command-bar {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 10px;
  min-width: 0;
}

/* 中のボタン・グループを .editor-command-bar の並びに直接参加させ、まとまり（.command-group など）単位で折り返す。
   こうすると［操作マニュアル］も最後の行に一緒に並べられる（入れ子のまま折り返すと、別の行に分かれてしまう）。
   この div は見た目のまとまりだけで意味付けを持たないため、display: contents にしても読み上げには影響しない */
.editor-command-bar .command-group-editor {
  display: contents;
}

.command-group {
  display: flex;
  align-items: center;
  gap: 13px;
}

.command-menu,
.command-toggle {
  position: relative;
}

/* アイコンボタン：アイコンはボタン全面の背景画像 */
.command-icon-button {
  flex: 0 0 auto;
  width: 42px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background-color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  cursor: pointer;
}

/* ▼付きのアイコンボタン（削除・画像ブロック・インラインG・結合処理） */
.command-icon-button-wide {
  width: 74px;
}

.command-icon-button:hover {
  background-color: #eee;
}

/* ドロップダウン付きのボタン（タイトル・削除・画像ブロック・インラインG・結合処理）：ドロップダウンが開いている間は背景を青にする。
   条件は .command-dropdown を開く条件（:hover／:focus-within）と同じにして、表示と色をそろえる */
.command-menu:hover > .command-icon-button,
.command-menu:focus-within > .command-icon-button,
.command-menu:hover > .command-title-button,
.command-menu:focus-within > .command-title-button {
  background-color: #e4edf8;
}

/* 文字装飾ボタン：選択中の文字にその装飾が付いているときは、:hover と同じ色にする。
   aria-pressed は editor.js の updateTextDecorationButtons() が書き換える */
.command-icon-button[aria-pressed="true"] {
  background-color: #eee;
}

/* 装飾を外した直後は、マウスが一度ボタンから離れるまでホバーの色を出さない。
   .is-hover-suppressed は editor.js の toggleTextDecoration() が付け、mouseleave で外す */
.command-icon-button.is-hover-suppressed:hover:not([aria-pressed="true"]) {
  background-color: #fff;
}

.command-icon-button:focus-visible,
.command-title-button:focus-visible,
.pe-text-button:focus-visible,
.command-dropdown-item:focus-visible {
  outline: 2px solid #4a7dbe;
  outline-offset: 1px;
}

.pe-icon-paragraph { background-image: url("../img/icons/paragraph.svg"); }
.pe-icon-list-ul { background-image: url("../img/icons/list-ul.svg"); }
.pe-icon-list-ol { background-image: url("../img/icons/list-ol.svg"); }
.pe-icon-list-ul-child { background-image: url("../img/icons/list-ul-child.svg"); }
.pe-icon-list-ol-child { background-image: url("../img/icons/list-ol-child.svg"); }
.pe-icon-paragraph-continue { background-image: url("../img/icons/paragraph-continue.svg"); }
.pe-icon-delete { background-image: url("../img/icons/delete.svg"); }
.pe-icon-bold { background-image: url("../img/icons/bold.svg"); }
.pe-icon-underline { background-image: url("../img/icons/underline.svg"); }
.pe-icon-sup { background-image: url("../img/icons/sup.svg"); }
.pe-icon-sub { background-image: url("../img/icons/sub.svg"); }
.pe-icon-table { background-image: url("../img/icons/table.svg"); }
.pe-icon-image { background-image: url("../img/icons/image.svg"); }
.pe-icon-inline-graphic { background-image: url("../img/icons/inline-graphic.svg"); }
.pe-icon-page-break { background-image: url("../img/icons/page-break.svg"); }
.pe-icon-list-merge { background-image: url("../img/icons/list-merge.svg"); }
.pe-icon-search { background-image: url("../img/icons/search.svg"); }
.pe-icon-export-pdf { background-image: url("../img/icons/export-pdf.svg"); }
.pe-icon-export-web { background-image: url("../img/icons/export-web.svg"); }

/* ----- タイトル▼ ----- */
.command-title-button {
  width: 112px;
  height: 40px;
  margin: 0;
  padding: 3px 0 0 10px;
  border: 0;
  border-radius: 4px;
  /* ふだんは白。ドロップダウンが開いている間だけ青（上の「ドロップダウン付きのボタン」の規則）。
     文字と▼の色は、デザインと、ほかの▼付きボタンに合わせてグレー */
  background: #fff url("../img/icons/caret-title.svg") no-repeat right 5px center / 27px 27px;
  color: #595757;
  font: inherit;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}

/* ----- ドロップダウン（タイトル・削除・画像ブロック・インラインG・結合処理）：ホバーで開く ----- */
.command-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 1010;
  display: none;
  flex-direction: column;
  gap: 7px;
  width: 226px;
  padding: 7px;
  border-radius: 7.5px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  transform: translateX(-50%);
}

/* ボタンとパネルの間の隙間でホバーが途切れないようにする */
.command-dropdown::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 10px;
}

.command-menu:hover > .command-dropdown,
.command-menu:focus-within > .command-dropdown {
  display: flex;
}

/* 項目：左端 65px の空き（padding-left）に、ホバー中の青い●を置く（下の「アイコンのない項目」の規則）。ラベルはその右。
   background-* の指定は、項目にアイコン画像を付ける場合のために残している（現在はどの項目も画像を使っていない） */
.command-dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 8px 0 65px;
  border: 1px solid transparent;
  border-radius: 4px;
  background-color: #fff;
  background-position: left center;
  background-repeat: no-repeat;
  background-size: 60px 40px;
  /* 文字色は #231815、大きさは 14px に統一する。
     タイトル1〜4は下の .command-title-item-1〜4 が大きさを指定し直すので、色だけが変わる */
  color: #231815;
  font: inherit;
  font-size: 14px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.command-dropdown-item:hover {
  border-color: #4a7dbe;
}

/* タイトル1〜4：見出しレベルが分かるように文字の大きさを変える */
.command-title-item {
  font-weight: 700;
}

.command-title-item-1 { font-size: 21px; }
.command-title-item-2 { font-size: 19px; }
.command-title-item-3 { font-size: 16px; }
.command-title-item-4 { font-size: 15px; }

/* アイコンのない項目（タイトル・削除・画像ブロック・インラインG・結合処理）：ホバー中は左端に青い●を出す。
   ●は .command-dropdown-item の padding-left（65px）の空きに置く。
   寸法はデザイン（allarea_ol_2.svg）の値 × 約1.33（半径 4.15 → 直径 11px、項目の左端から中心まで約 26px）。
   .command-marker-item は「●を出す」ことだけを表すクラス（文字の大きさ・太さは変えない） */
.command-title-item,
.command-delete-item,
.command-marker-item {
  position: relative;
}

.command-title-item::before,
.command-delete-item::before,
.command-marker-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 20px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #4a7dbe;
  transform: translateY(-50%);
  visibility: hidden;
}

.command-title-item:hover::before,
.command-title-item:focus-visible::before,
.command-delete-item:hover::before,
.command-delete-item:focus-visible::before,
.command-marker-item:hover::before,
.command-marker-item:focus-visible::before {
  visibility: visible;
}

/* ----- 表組編集ツールバー：選択中のセル（.selected-cell）の上に表示する -----
   - HTML では #contentArea の外（.layout の後ろ）に置く。中に置くと、保存・Undo 履歴・出力に混ざるため。
   - 位置は CSS Anchor Positioning で決める。基準（アンカー）は選択中のセル。
     セルの左端に揃えて右へ伸ばし、画面からはみ出すときは、セルの右端に揃えて左へ伸ばす（flip-inline）。
     表の行数が多く、画面の縦幅を超える表でも、操作中のセルのすぐ上に出るようにするため。
   - セルが選ばれていない（表だけが選択中の）ときは、表を基準にする。
     基準の名前が付く要素が常に1つになるよう、表の側は :not(:has(.selected-cell)) で外す。
   - 表示条件は :has() で判定する。editor.js が付け外しする .selected-cell / .selected-block を
     含む表があるときだけ表示するので、表示用の JS はいらない。
   - z-index はヘッダー（1000）より下にする。表が上へスクロールしたとき、ヘッダーの下に潜らせるため。 */

/* アンカー①：選択中のセル */
body.edit-mode #contentArea table.manual-table .selected-cell {
  anchor-name: --pe-table-toolbar-anchor;
}

/* アンカー②：セルが選ばれていないときの代わり。表そのものが選択中か、選択中のブロックを含む表 */
body.edit-mode #contentArea table.manual-table:is(.selected-block, :has(.selected-block)):not(:has(.selected-cell)) {
  anchor-name: --pe-table-toolbar-anchor;
}

.table-toolbar {
  position: absolute;
  position-anchor: --pe-table-toolbar-anchor;
  bottom: calc(anchor(top) + 8px);
  left: anchor(left);
  /* Chrome 125〜127 は旧名、128 以降は新名。知らないプロパティは無視されるので両方書く */
  position-try-options: flip-inline;
  position-try-fallbacks: flip-inline;
  z-index: 900;
  display: none;
  box-sizing: border-box;
  align-items: center;
  gap: 13px;
  height: 62px;
  padding: 0 19px;
  border-radius: 7.5px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

/* 編集モードで、表（または表の中の要素）が選択されているときだけ表示する */
body.edit-mode:has(#contentArea table.manual-table.selected-block, #contentArea table.manual-table .selected-cell, #contentArea table.manual-table .selected-block) .table-toolbar {
  display: flex;
}

.table-toolbar .pe-separator {
  margin: 0 5px;
}

.table-toolbar .command-icon-button:hover {
  background-color: #e4edf8;
}

/* WEB／PDFの表示モードでは、編集用のツールバーを隠す */
body.web-preview-mode .table-toolbar,
body.pdf-preview-mode .table-toolbar {
  display: none;
}

.pe-icon-table-settings { background-image: url("../img/icons/table-settings.svg"); }
.pe-icon-table-row-above { background-image: url("../img/icons/table-row-above.svg"); }
.pe-icon-table-row-below { background-image: url("../img/icons/table-row-below.svg"); }
.pe-icon-table-col-left { background-image: url("../img/icons/table-col-left.svg"); }
.pe-icon-table-col-right { background-image: url("../img/icons/table-col-right.svg"); }
.pe-icon-table-merge-right { background-image: url("../img/icons/table-merge-right.svg"); }
.pe-icon-table-merge-down { background-image: url("../img/icons/table-merge-down.svg"); }
.pe-icon-table-unmerge { background-image: url("../img/icons/table-unmerge.svg"); }
.pe-icon-table-delete-row { background-image: url("../img/icons/table-delete-row.svg"); }
.pe-icon-table-delete-col { background-image: url("../img/icons/table-delete-col.svg"); }
.pe-icon-table-toggle-th { background-image: url("../img/icons/table-toggle-th.svg"); }
.pe-icon-table-toggle-layout { background-image: url("../img/icons/table-toggle-layout.svg"); }
.pe-icon-table-split { background-image: url("../img/icons/table-split.svg"); }

/* ----- 操作マニュアル ----- */
/* margin-left: auto で、何行目にあっても右端に寄せる。
   padding-left は、左のメニューとの最低限の間隔（以前の margin-left: 24px の代わり） */
.editor-command-bar .command-extra {
  display: flex;
  align-items: center;
  margin-left: auto;
  padding-left: 24px;
}

.editor-command-bar .command-extra .command-extra-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 166px;
  height: 40px;
  padding: 4px 0 0 36px;
  border: 1px solid #b4b4b5;
  border-radius: 4px;
  background: #fff url("../img/icons/manual.svg") no-repeat center / 100% 100%;
  /* 文字色は編集画面の見本（plants_editor_plan01-2.svg：Meiryo 9・#231815）に合わせる。
     起動画面の見本（plants_editor_plan01-2_first.svg）は #595757 だが、編集画面の色に統一する */
  color: #231815;
  /* 大きさは見本（Meiryo 9 → 12px）より大きくし、ほかのボタンと同じ 14px に統一する */
  font-size: 14px;
  line-height: 1;
  text-decoration: none;
}

.editor-command-bar .command-extra .command-extra-button:hover {
  background-color: #eee;
}

/* ----- 2段目：ステータス行 ----- */
.pe-status-bar {
  display: flex;
  align-items: center;
  height: 62px;
  padding: 0 24px 0 39px;
  border-bottom: 1px solid #9e9e9f;
  /* 文字の色と大きさは見本（plants_editor_plan01-2.svg：Meiryo 11・#231815）に合わせる。
     11 × 約1.33 ＝ 14.67 を整数に丸めて 15px にする（ほかのボタン類の 14px より 1px 大きい） */
  color: #231815;
  font-size: 15px;
  line-height: 1.35;
}

/* 編集対象フォルダ（#folderStatusText）：文字の長さに合わせた幅で、1行のテキストとして表示する。
   文字の色・大きさは .pe-status-bar から受け継ぐので、編集対象HTMLと同じ見た目になる。
   ウィンドウが狭いときは縮められるようにし、はみ出した部分は「…」で省略する。
   （「未保存」が出る編集対象HTMLは省略できないため、こちらで幅を譲る）
   min-width: 0 は、flex の項目を文字の長さより小さく縮められるようにするため */
.pe-status-bar .folder-status {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 最小幅は1段目の「開く〜保存」と同じにし、1行で表示する（「未保存」が隠れないよう省略はしない）。
   左に編集対象フォルダを置いたため、縦の位置は1段目とは揃わない */
.pe-status-bar .file-status {
  flex: 0 0 auto;
  min-width: 302px;
  white-space: nowrap;
}

/* 1段目の「編集〜PDF」と同じ幅を最小にし、長いメッセージは右へ伸ばす */
.pe-status-bar .status {
  flex: 0 1 auto;
  min-width: 302px;
}

/* ----- 編集対象フォルダの指定前：ヘッダー全体を表示しない -----
   - 起動画面（.start-guide）は、ヘッダーのない画面として作っている（見本 sample/テンプレート準備とフォルダ指定ガイド.png）。
     ［操作マニュアル］だけを残すと、ボタン1つと下罫線だけの帯が上に残るため、ヘッダーごと隠す。
   - ［操作マニュアル］はフォルダ指定後の編集画面でも使うため、HTML からは削除せず、ここで隠すだけにする。
   - .is-folder-selected は、editor.js の updateFolderUi() が body に付け外しする。
     起動直後は付いていないので、指定前の表示から始まる。フォルダを指定すると付き、ヘッダーが表示される。
   - 表示に戻ったときの区切り線の判定は、js/editor-ui.js がやり直す */
body:not(.is-folder-selected) .pe-header {
  display: none;
}

/* ===== PE操作画面：固定80％表示 =====
   ブラウザの表示倍率80％に近い見た目になるよう、PE全体を縮小する。 */
.layout {
  display: flex;
  width: 100%;
  min-height: 125vh;
}

.content-area {
  flex: 1;
  padding: 40px;
  min-width: 0;
}

.editor-start-screen {
  text-align: center;
  margin-top: 120px;
  line-height: 1.6;
}

.editor-title {
  font-size: 30px;
  font-weight: bold;
  letter-spacing: 0.04em;
}

.editor-edition {
  margin-top: 8px;
  font-size: 22px;
}

.editor-version {
  margin-top: 6px;
  font-size: 18px;
  color: #666;
}

.editor-message {
  margin-top: 60px;
  font-size: 20px;
}

/* ----- 起動画面（編集対象フォルダの指定前）：テンプレート準備とフォルダ指定ガイド -----
   - 背景画像（img/topbase.png：1671×941px）に描かれた絵（丸・ZIP・フォルダ・吹き出しなど）の位置に、
     文字とボタンを絶対配置で重ねる。数値は背景画像の上のピクセル座標
     （見本 sample/テンプレート準備とフォルダ指定ガイド.png からの目測）。
   - 背景画像と同じ縦横比の箱（.start-guide）を作り、container-type: inline-size にする。
     --u は「背景画像の 1px が、いま画面上で何 px か」（100cqw ＝ 箱の幅）。
     位置・大きさをすべて calc(画像上の px × var(--u)) で書くと、箱が縮んでも文字と絵がずれない。
   - --u は子要素で使う（cqw は祖先のコンテナを基準にするため、.start-guide 自身の指定には使えない）。
   - 箱の最大幅は画像と同じ 1671px。これより大きくすると背景画像がぼやけるため。
   - フォルダ指定後の画面（editor.js の getStartScreenHtml()）は .editor-start-screen だけなので、上の規則のまま表示される。
   - 利用規約に同意するまでの無効表示は .start-guide__folder-button:disabled で行う */
.editor-start-screen.start-guide {
  --u: calc(100cqw / 1671);
  container-type: inline-size;
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 1671px;
  aspect-ratio: 1671 / 941;
  margin: 0 auto;
  background: url("../img/topbase.png") no-repeat center / 100% 100%;
  color: #1f2433;
  font-family: "Noto Sans JP", Meiryo, "メイリオ", "Yu Gothic UI", sans-serif;
  line-height: 1;
  text-align: left;
}

/* 起動画面はヘッダーの外にあり、.pe-header * の box-sizing が効かないので、ここで指定する */
.start-guide * {
  box-sizing: border-box;
}

/* 子要素は、すべて背景画像の座標で置く */
.start-guide > * {
  position: absolute;
  margin: 0;
}

/* 見出し・リード文 */
.start-guide__title {
  top: calc(113 * var(--u));
  right: 0;
  left: 0;
  font-size: calc(44 * var(--u));
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.start-guide__lead {
  top: calc(174 * var(--u));
  right: 0;
  left: 0;
  color: #4b5366;
  font-size: calc(28 * var(--u));
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1;
  text-align: center;
}

/* 丸い数字：丸は背景画像に描かれているので、数字だけを丸の中央に置く */
.start-guide__step-number {
  top: calc(295 * var(--u));
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(68 * var(--u));
  height: calc(68 * var(--u));
  color: #fff;
  font-size: calc(40 * var(--u));
  font-weight: 700;
  line-height: 1;
}

.start-guide__step-number--1 { left: calc(147 * var(--u)); }
.start-guide__step-number--2 { left: calc(905 * var(--u)); }

/* 各ステップの見出し */
.start-guide__step-title {
  font-size: calc(31 * var(--u));
  font-weight: 700;
  line-height: calc(40 * var(--u));
  white-space: nowrap;
}

.start-guide__step-title--1 { top: calc(291 * var(--u)); left: calc(248 * var(--u)); }
.start-guide__step-title--2 { top: calc(309 * var(--u)); left: calc(1003 * var(--u)); }

/* 青いボタン（テンプレートのダウンロード・フォルダ指定）の共通の見た目 */
.start-guide__download,
.start-guide__folder-button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: linear-gradient(180deg, #3b8cff 0%, #0d5cf2 100%);
  box-shadow: 0 calc(6 * var(--u)) calc(14 * var(--u)) rgba(13, 92, 242, 0.28);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.start-guide__download:hover,
.start-guide__folder-button:hover:not(:disabled) {
  filter: brightness(1.08);
}

.start-guide__download:focus-visible,
.start-guide__folder-button:focus-visible,
.start-guide__consent-checkbox:focus-visible,
.start-guide .terms-link-button:focus-visible {
  outline: 3px solid #4a7dbe;
  outline-offset: 3px;
}

/* ボタン内のアイコン（インラインSVG。色は文字色に合わせる） */
.start-guide__icon {
  display: block;
  flex: 0 0 auto;
}

.start-guide__icon--download,
.start-guide__icon--folder {
  width: calc(38 * var(--u));
  height: calc(38 * var(--u));
}

.start-guide__icon--external {
  width: calc(20 * var(--u));
  height: calc(20 * var(--u));
}

/* ステップ1：テンプレートのダウンロード */
.start-guide__download {
  top: calc(405 * var(--u));
  left: calc(182 * var(--u));
  gap: calc(22 * var(--u));
  width: calc(482 * var(--u));
  height: calc(87 * var(--u));
  border-radius: calc(16 * var(--u));
}

.start-guide__download-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(8 * var(--u));
}

.start-guide__download-main {
  font-size: calc(25 * var(--u));
  letter-spacing: 0.06em;
}

.start-guide__download-sub {
  font-size: calc(20 * var(--u));
  font-weight: 500;
}

/* ZIPアイコン（背景画像）の上の文字 */
.start-guide__zip-label {
  top: calc(621 * var(--u));
  left: calc(260 * var(--u));
  width: calc(80 * var(--u));
  color: #5b6b84;
  font-size: calc(20 * var(--u));
  font-weight: 700;
  line-height: calc(22 * var(--u));
  text-align: center;
}

/* ZIP・フォルダのアイコンの下の説明 */
.start-guide__caption {
  top: calc(664 * var(--u));
  width: calc(240 * var(--u));
  color: #3b4252;
  font-size: calc(19 * var(--u));
  line-height: calc(27 * var(--u));
  text-align: center;
}

.start-guide__caption--zip { left: calc(180 * var(--u)); }
.start-guide__caption--folder {
  left: calc(423 * var(--u));
  font-weight: 700;
}

.start-guide__em {
  font-weight: 700;
}

/* ステップ2：フォルダ一覧（背景画像）の選択行の文字と、吹き出しの文字 */
.start-guide__folder-name {
  top: calc(545 * var(--u));
  left: calc(1088 * var(--u));
  font-size: calc(22 * var(--u));
  font-weight: 700;
  line-height: calc(26 * var(--u));
}

.start-guide__balloon {
  top: calc(488 * var(--u));
  left: calc(1352 * var(--u));
  color: #2b3140;
  font-size: calc(18 * var(--u));
  line-height: calc(30 * var(--u));
  white-space: nowrap;
}

/* 下の帯：利用規約 */
.start-guide__terms-title {
  top: calc(830 * var(--u));
  left: calc(147 * var(--u));
  font-size: calc(28 * var(--u));
  font-weight: 700;
  line-height: calc(32 * var(--u));
}

.start-guide__terms-text {
  top: calc(801 * var(--u));
  left: calc(459 * var(--u));
  color: #3b4252;
  font-size: calc(18 * var(--u));
  line-height: calc(29 * var(--u));
  white-space: nowrap;
}

/* ［利用規約を読む］：.terms-link-button（下の Placeholder / Terms UI）より後に書かれていなくても勝つよう、
   .start-guide を付けて詳細度を上げる */
.start-guide .terms-link-button {
  display: inline-flex;
  align-items: center;
  gap: calc(6 * var(--u));
  margin-top: calc(6 * var(--u));
  color: #1a5fd8;
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
  text-underline-offset: 0.2em;
}

/* ［利用規約に同意する］：label で包み、白い枠のどこをクリックしてもチェックが切り替わるようにする */
.start-guide__consent {
  top: calc(820 * var(--u));
  left: calc(905 * var(--u));
  display: flex;
  align-items: center;
  gap: calc(16 * var(--u));
  width: calc(300 * var(--u));
  height: calc(62 * var(--u));
  padding-left: calc(16 * var(--u));
  border: 1px solid #dfe5ef;
  border-radius: calc(10 * var(--u));
  background: #fff;
  box-shadow: 0 calc(2 * var(--u)) calc(8 * var(--u)) rgba(30, 60, 120, 0.08);
  font-size: calc(24 * var(--u));
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

/* チェックボックスは本物の input のまま見た目だけを変える（change イベント・キーボード操作をそのまま使うため） */
.start-guide__consent-checkbox {
  appearance: none;
  flex: 0 0 auto;
  width: calc(34 * var(--u));
  height: calc(34 * var(--u));
  margin: 0;
  border: calc(2.5 * var(--u)) solid #2f6fd8;
  border-radius: calc(6 * var(--u));
  background: #fff no-repeat center / 80% 80%;
  cursor: pointer;
}

.start-guide__consent-checkbox:checked {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%232f6fd8' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ［フォルダを指定する］：同意するまでは灰色（disabled は editor.js の updateTermsAcceptanceUi() が切り替える） */
.start-guide__folder-button {
  top: calc(818 * var(--u));
  left: calc(1243 * var(--u));
  gap: calc(20 * var(--u));
  width: calc(360 * var(--u));
  height: calc(65 * var(--u));
  padding: 0;
  border-radius: calc(12 * var(--u));
  font-size: calc(24 * var(--u));
  letter-spacing: 0.06em;
}

.start-guide__folder-button:disabled {
  background: linear-gradient(180deg, #c4cbd7 0%, #a9b2c2 100%);
  box-shadow: none;
  color: rgba(255, 255, 255, 0.92);
}

.empty-document-message {
  margin-top: 80px;
  color: #999;
  font-size: 18px;
  line-height: 1.8;
  text-align: center;
  user-select: none;
}

.insert-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 18px;
}

.insert-grid button {
  margin-bottom: 0;
  min-height: 1.5em;
  padding: 12px 14px;
  font-size: 13px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
}

.text-format-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 18px;
}

.text-format-grid button {
  margin-bottom: 0;
  min-height: 1.5em;
  padding: 12px 14px;
  font-size: 13px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
}

.text-format-grid .text-format-full {
  grid-column: 1 / -1;
}

.delete-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 18px;
}

.delete-grid button {
  margin-bottom: 0;
  min-height: 1.5em;
  padding: 12px 14px;
  font-size: 13px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
}

.delete-grid .delete-full {
  grid-column: 1 / -1;
}

.table-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 18px;
}

.table-edit-grid button {
  margin-bottom: 0;
  min-height: 1.5em;
  padding: 12px 14px;
  font-size: 13px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
}

.table-edit-grid .table-edit-full {
  grid-column: 1 / -1;
}

.image-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 18px;
}

.image-edit-grid button {
  margin-bottom: 0;
  min-height: 1.5em;
  padding: 12px 14px;
  font-size: 13px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
}

.output-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-bottom: 18px;
}

.output-grid button {
  margin-bottom: 0;
  min-height: 1.5em;
  padding: 12px 14px;
  font-size: 13px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
  font-weight: bold;
}

.editable {
  border: 1px dashed #999;
  padding: 8px;
  min-height: 1.5em;
}

.editable:focus {
  outline: 2px solid #5b9dd9;
  background: #fff;
}

.selected-block {
  outline: 3px solid #f0a000;
  outline-offset: 3px;
}



/* ===== 連続する同種リストの結合候補表示（編集画面のみ） ===== */
body.edit-mode #contentArea ul.adjacent-list-merge-source,
body.edit-mode #contentArea ol.adjacent-list-merge-source {
  box-shadow: 0 3px 0 #d27a00;
}

body.edit-mode #contentArea ul.adjacent-list-merge-candidate,
body.edit-mode #contentArea ol.adjacent-list-merge-candidate {
  position: relative;
  box-shadow: 0 -3px 0 #d27a00;
  outline: 1px dashed #d27a00;
  outline-offset: 3px;
}

body.edit-mode #contentArea ul.adjacent-list-merge-candidate::after,
body.edit-mode #contentArea ol.adjacent-list-merge-candidate::after {
  content: "結合候補";
  position: absolute;
  top: -20px;
  right: 4px;
  z-index: 2;
  padding: 1px 6px;
  border: 1px solid #d27a00;
  border-radius: 3px;
  background: #fff8e8;
  color: #8a4b00;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 10px;
  line-height: 1.5;
  pointer-events: none;
}

body.web-preview-mode #contentArea .adjacent-list-merge-source,
body.web-preview-mode #contentArea .adjacent-list-merge-candidate,
body.pdf-preview-mode #contentArea .adjacent-list-merge-source,
body.pdf-preview-mode #contentArea .adjacent-list-merge-candidate {
  box-shadow: none !important;
  outline: none !important;
}

.image-block {
  margin: 20px 0;
  display: inline-block;
  padding: 8px;
  border: 1px dashed #aaa;
}

.image-block img {
  display: block;
  max-width: 500px;
  height: auto;
  cursor: pointer;
}

.image-block figcaption {
  margin-top: 6px;
  font-size: 0.9em;
  color: #555;
}

.inline-graphic {
  display: inline-block;
  margin: 0;
  padding: 0;
  vertical-align: middle;
  height: auto;
}

.selected-inline-graphic {
  outline: 2px solid #f0a000;
  outline-offset: 2px;
}

table.manual-table {
  border-collapse: collapse;
  width: 640px;
  max-width: 100%;
  margin: 24px 0;
}

.manual-table th,
.manual-table td {
  border: 1px solid #777;
  vertical-align: top;
  padding: 6px;
  text-align: left;
}

.manual-table th {
  background: #eee;
  text-align: left;
}

.manual-table td.align-center {
  text-align: center;
}

.manual-table td.align-right {
  text-align: right;
}

.selected-cell {
  outline: 3px solid #006fd6;
  outline-offset: -3px;
  background: #eef7ff;
}

table.manual-table.borderless th,
table.manual-table.borderless td {
  border: none;
}

table.manual-table.borderless th {
  background: transparent;
}

/* ===== レイアウト表モード（T/Lモード） =====
   罫線なしの表は、表組ではなくレイアウト調整用として扱う。
   セル内の文章が通常文に近い見た目になるように余白・行間を調整する。 */
table.manual-table.layout-table {
  border-collapse: collapse;
  margin: 0.8em 0;
}

table.manual-table.layout-table th,
table.manual-table.layout-table td {
  border: none;
  background: transparent;
  padding: 0 0.8em 0 0;
  vertical-align: top;
}

table.manual-table.layout-table div[data-type="table-cell"] {
  margin: 0;
  padding: 0;
}

table.manual-table.layout-table p {
  margin: 0 0 0.6em 0;
  padding: 0;
  line-height: inherit;
}


/* ===== PDF改ページ指示 ===== */

/* ===== 表内PDF改ページマーカー =====
   通常の表データ行とは区別し、編集画面だけで選択可能なマーカーとして表示する。 */
table.manual-table tr.table-pdf-page-break-marker.pdf-page-break {
  display: table-row;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
}

table.manual-table tr.table-pdf-page-break-marker.pdf-page-break::after {
  content: none;
}

table.manual-table tr.table-pdf-page-break-marker td {
  padding: 3px 8px !important;
  border: 0 !important;
  border-top: 2px dashed #888 !important;
  border-bottom: 2px dashed #888 !important;
  background: #fff !important;
  color: #666;
  font-size: 12px;
  font-weight: normal;
  text-align: center !important;
  line-height: 1.6;
  cursor: pointer;
  user-select: none;
}

table.manual-table tr.table-pdf-page-break-marker.selected-block td {
  outline: 2px solid #4b86c5;
  outline-offset: -2px;
}

body.web-preview-mode table.manual-table tr.table-pdf-page-break-marker {
  display: none !important;
}

body.pdf-preview-mode table.manual-table tr.table-pdf-page-break-marker.pdf-page-break {
  display: table-row;
  height: auto;
  margin: 0;
  border: 0;
}

body.pdf-preview-mode table.manual-table tr.table-pdf-page-break-marker td {
  padding: 2px 6px !important;
  border-top: 1.5px dashed #999 !important;
  border-bottom: 1.5px dashed #999 !important;
  font-size: 9pt;
}

.pdf-page-break {
  position: relative;
  display: block;
  height: 30px;
  margin: 22px 0;
  border-top: 2px dashed #888;
  cursor: pointer;
  user-select: none;
}

.pdf-page-break::after {
  content: "PDF改ページ";
  position: absolute;
  top: -14px;
  left: 50%;
  padding: 1px 10px;
  background: #fff;
  color: #666;
  font-family: sans-serif;
  font-size: 12px;
  line-height: 1.6;
  transform: translateX(-50%);
}

body.web-preview-mode .pdf-page-break {
  display: none;
}

body.pdf-preview-mode .pdf-page-break {
  height: 24px;
  margin: 8mm 0 5mm;
  border-top: 1.5px dashed #999;
}

body.pdf-preview-mode .pdf-page-break::after {
  background: #fff;
  font-size: 9pt;
}

/* ===== 検索・置換 ===== */
.search-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.search-dialog {
  width: 460px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border: 1px solid #777;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  padding: 20px;
  box-sizing: border-box;
  line-height: 1.6;
}

.search-dialog h2 {
  font-size: 18px;
  margin: 0 0 14px;
}

.search-dialog-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.search-dialog-row input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px;
  font-size: 14px;
}

.search-dialog-status {
  min-height: 1.4em;
  margin: 8px 0 12px;
  font-size: 13px;
  color: #333;
}

.search-dialog-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.search-dialog-actions button {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  text-align: center;
}


/* ===== 画像挿入ダイアログ ===== */
.image-insert-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.image-insert-dialog {
  width: 460px;
  max-width: calc(100vw - 40px);
  background: #fff;
  border: 1px solid #777;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  padding: 20px;
  box-sizing: border-box;
  line-height: 1.6;
}

.image-insert-dialog h2 {
  font-size: 18px;
  margin: 0 0 14px;
}

.image-insert-preview {
  border: 1px solid #ccc;
  background: #f7f7f7;
  padding: 10px;
  margin-bottom: 12px;
  text-align: center;
  max-height: 220px;
  overflow: auto;
}

.image-insert-preview img {
  max-width: 100%;
  max-height: 190px;
  height: auto;
}

.image-insert-dialog-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.image-insert-dialog-row input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px;
  font-size: 14px;
}

.image-insert-dialog-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px 118px;
  font-size: 14px;
  cursor: pointer;
}

.image-insert-dialog-check input {
  width: auto;
  margin: 0;
}

.image-insert-dialog-note {
  font-size: 12px;
  color: #555;
  margin: 8px 0 12px;
}

.image-insert-dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.image-insert-dialog-actions button {
  width: auto;
  margin: 0;
  padding: 8px 18px;
  text-align: center;
}


.accordion-toggle {
  display: block;
  width: 100%;
  margin: 22px 0 8px;
  border-top: 1px solid #ddd;
  border-right: none;
  border-bottom: none;
  border-left: none;
  background: transparent;
  padding: 14px 0 0;
  font-size: 14px;
  font-weight: bold;
  text-align: left;
  cursor: pointer;
  color: #222;
}

.accordion-toggle::before {
  content: '▼ ';
  font-size: 11px;
}

.accordion-toggle.closed::before {
  content: '▶ ';
}

.accordion-panel.closed {
  display: none;
}

.column-width-dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.column-width-dialog {
  width: 560px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border: 1px solid #777;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  padding: 20px;
  box-sizing: border-box;
  line-height: 1.6;
}

.column-width-dialog h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

.column-width-dialog .column-width-header,
.column-width-dialog .column-width-row {
  display: grid;
  grid-template-columns: 72px minmax(80px, 1fr) 32px minmax(120px, 1fr);
  gap: 8px;
  align-items: center;
}

.column-width-dialog .column-width-header {
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid #ddd;
  font-size: 13px;
  font-weight: bold;
}

.column-width-dialog .column-width-row {
  margin-bottom: 8px;
}

.column-width-dialog input[type="number"],
.column-width-dialog select {
  width: 100%;
  box-sizing: border-box;
  padding: 6px;
}

.column-width-dialog .column-width-total {
  margin: 12px 0;
  padding: 8px;
  background: #f4f4f4;
  border: 1px solid #ddd;
  font-size: 13px;
}

.column-width-dialog .column-width-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 12px 0;
  font-size: 13px;
}

.column-width-dialog .column-width-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.column-width-dialog .column-width-actions button {
  width: auto;
  margin-bottom: 0;
  padding: 8px 18px;
  text-align: center;
}


/* ===== 編集モード ===== */
body.edit-mode {
  background: #fff;
}

body.edit-mode .content-area {
  background: #fff;
}

body.edit-mode .editable {
  border: 1px dashed #999;
  padding: 8px;
  min-height: 1.5em;
}

body.edit-mode .image-block {
  display: block;
  border: 1px dashed #aaa;
  padding: 8px;
}

/* ===== WEBモード：Webマニュアル表示想定 ===== */
body.web-preview-mode {
  background: #f3f5f7;
}

body.web-preview-mode .content-area {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 56px;
  background: #fff;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

body.web-preview-mode .editable {
  border: none;
  padding: 0;
  min-height: 0;
}

body.web-preview-mode .editable:focus {
  outline: none;
  background: transparent;
}

body.web-preview-mode .selected-block,
body.web-preview-mode .selected-cell {
  outline: none;
  background: transparent;
}

body.web-preview-mode h1 {
  margin-bottom: 1.2em;
}

body.web-preview-mode .image-block {
  display: block;
  border: none;
  padding: 0;
  margin: 28px 0;
}

body.web-preview-mode .image-block img {
  max-width: 100%;
}

body.web-preview-mode .image-block figcaption {
  text-align: left;
  color: #666;
  font-size: 0.9em;
}

body.web-preview-mode table.manual-table {
  width: 100%;
  margin: 28px 0;
}

body.web-preview-mode .manual-table th {
  background: #e9eef5;
}

/* ===== PDFプレビューモード：A4紙面表示想定 ===== */
body.pdf-preview-mode {
  background: #bdbdbd;
}

body.pdf-preview-mode .layout {
  align-items: flex-start;
}

body.pdf-preview-mode .content-area {
  flex: none;
  width: 210mm;
  min-height: 297mm;
  margin: 32px auto;
  padding: 18mm 16mm;
  box-sizing: border-box;
  background: #fff;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 10.5pt;
  line-height: 1.75;
}

body.pdf-preview-mode h1 {
  font-size: 20pt;
  margin-top: 0;
  margin-bottom: 10mm;
}

body.pdf-preview-mode .editable {
  border: none;
  padding: 0;
  min-height: 0;
}

body.pdf-preview-mode .editable:focus {
  outline: none;
  background: transparent;
}

body.pdf-preview-mode .selected-block,
body.pdf-preview-mode .selected-cell {
  outline: none;
  background: transparent;
}

body.pdf-preview-mode .image-block {
  display: block;
  border: none;
  padding: 0;
  margin: 8mm 0;
  text-align: left;
}

body.pdf-preview-mode .image-block img {
  max-width: 150mm;
}

body.pdf-preview-mode .image-block figcaption {
  margin-top: 2mm;
  font-size: 9pt;
  color: #555;
  text-align: left;
}

body.pdf-preview-mode table.manual-table {
  width: 100%;
  margin: 8mm 0;
  font-size: 9.5pt;
  page-break-inside: avoid;
}

body.pdf-preview-mode .manual-table th {
  background: #eee;
  font-weight: bold;
}



/* ===== PDFモード用：選択位置マーカー =====
   編集モードで選択した要素の位置を、PDFモードでも本文の見え方を崩さず示す。 */
body.web-preview-mode .preview-marker-target,
body.pdf-preview-mode .preview-marker-target {
  position: relative;
}

body.web-preview-mode .preview-marker-target::before,
body.pdf-preview-mode .preview-marker-target::before {
  content: "●";
  position: absolute;
  left: -1.4em;
  top: 0.15em;
  color: #d00000;
  font-size: 14px;
  line-height: 1;
  font-family: sans-serif;
  font-weight: bold;
  z-index: 5;
  pointer-events: none;
}

body.pdf-preview-mode .preview-marker-target::before {
  left: -1.2em;
  top: 0.2em;
  font-size: 10pt;
}

/* =========================================================
   PLANTS EDITOR Version 0.7.0
   PDF preview layout synchronized with PDF output
   ========================================================= */

body.pdf-preview-mode .content-area {
  width: 210mm;
  min-height: 297mm;
  padding: 28mm 20mm 20mm;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic", "YuGothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  font-size: 10.5pt;
  line-height: 1.75;
}

body.pdf-preview-mode .content-area ul {
  list-style: none;
  margin: 0.5em 0 0.9em;
  padding-left: 0;
}

body.pdf-preview-mode .content-area ul > li {
  position: relative;
  margin: 0;
  padding-left: 1.25em;
}

body.pdf-preview-mode .content-area ul > li::before {
  content: "•";
  position: absolute;
  left: 0.25em;
  top: 0;
  width: 0.5em;
  text-align: center;
  font: inherit;
  font-weight: 400;
}

body.pdf-preview-mode .content-area ul ul {
  margin-top: 0.2em;
  margin-left: 0;
  margin-bottom: 0.2em;
}

body.pdf-preview-mode .content-area ol {
  list-style: none;
  counter-reset: pe-pdf-list;
  margin: 0.5em 0 0.9em;
  padding-left: 0;
}

body.pdf-preview-mode .content-area ol > li {
  counter-increment: pe-pdf-list;
  position: relative;
  margin: 0;
  padding-left: 2.25em;
}

body.pdf-preview-mode .content-area ol > li::before {
  content: counter(pe-pdf-list) ".";
  position: absolute;
  left: -0.4em;
  top: 0;
  width: 2.05em;
  text-align: right;
  font: inherit;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

body.pdf-preview-mode .content-area ul > li > p,
body.pdf-preview-mode .content-area ol > li > p {
  margin-top: 0;
  margin-bottom: 0;
}

/* =========================================================
   PLANTS EDITOR Version 0.7.0
   Placeholder / Terms UI
   ========================================================= */
body.edit-mode .editable[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: #9a9a9a;
  font-style: normal;
  pointer-events: none;
}

body.edit-mode .editable[data-placeholder]:empty:focus::before {
  content: "";
}

.terms-link-button {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1a5fa8;
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}

/* 無効時の色は起動画面の .start-guide__folder-button:disabled で指定する。
   ここで opacity を下げると、見本の灰色のボタンがさらに薄くなるため、カーソルだけを指定する */
#selectEditingFolderButton:disabled {
  cursor: not-allowed;
}

.terms-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}

.terms-dialog {
  width: min(820px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: #fff;
  border: 1px solid #777;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.terms-dialog h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.terms-dialog-text {
  flex: 1 1 auto;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid #ddd;
  background: #fafafa;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.75;
}

.terms-dialog-controls {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.terms-dialog-controls button {
  width: auto;
  margin: 0;
  padding: 8px 22px;
}
