:root {
  --desk: #e9e5dd;
  --bar: #fbfaf7;
  --line: #e2ddd3;
  --ink: #2b2b30;
  --muted: #8a857c;
  --accent: #3b6fd8;
  --accent-soft: #e6eefc;
  --tb-h: 56px;
  --hand: "Klee One", "Yu Gothic UI", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--desk);
  color: var(--ink);
  font-family: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; }

/* ---------- ツールバー ---------- */
#toolbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--tb-h);
  display: flex; align-items: center; gap: 4px;
  padding: 0 10px;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
  z-index: 20;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
}
#toolbar::-webkit-scrollbar { display: none; }

.group {
  display: flex; align-items: center; gap: 2px;
  padding: 0 8px;
  border-left: 1px solid var(--line);
  flex: none;
}
.group:empty { display: none; }
.spacer { flex: 1; min-width: 8px; }

.tbtn {
  width: 38px; height: 38px;
  border: 0; background: none; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--ink); cursor: pointer; flex: none;
}
.tbtn:hover { background: #efece6; }
.tbtn.active { background: var(--accent-soft); color: var(--accent); }
.tbtn:disabled { opacity: .3; cursor: default; background: none; }
.tbtn svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

#nbTitle {
  font-weight: 600; font-size: 15px;
  max-width: 180px; padding: 6px 8px; border-radius: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; flex: none;
}
#nbTitle:hover { background: #efece6; }

.swatch {
  width: 24px; height: 24px; margin: 0 3px;
  border: 0; border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
  cursor: pointer; position: relative; flex: none; padding: 0;
}
.swatch.active { box-shadow: 0 0 0 2px var(--bar), 0 0 0 4px var(--c, #999); }
.swatch.custom { background: var(--c, conic-gradient(#f44, #fd3, #4d4, #3cf, #44f, #e4e, #f44)); }
.swatch.custom.active { box-shadow: 0 0 0 2px var(--bar), 0 0 0 4px #999; }
.swatch.custom input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; cursor: pointer;
}

.wbtn {
  width: 34px; height: 34px;
  border: 0; background: none; border-radius: 9px;
  display: grid; place-items: center;
  color: var(--ink); cursor: pointer; flex: none; padding: 0;
}
.wbtn:hover { background: #efece6; }
.wbtn.active { background: var(--accent-soft); color: var(--accent); }
.wbtn .bar { width: 20px; border-radius: 3px; background: currentColor; }
.wbtn .ring { border-radius: 50%; border: 1.5px solid currentColor; }
.wbtn .letter { font-family: var(--hand); font-weight: 600; line-height: 1; }

.tbtn.small { width: 32px; height: 32px; border-radius: 8px; }
.tbtn.small svg { width: 19px; height: 19px; }
.hint { font-size: 12px; color: var(--muted); white-space: nowrap; padding: 0 4px; }

#fontMenu {
  position: fixed; top: calc(var(--tb-h) - 4px);
  min-width: 170px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(40,30,10,.15);
  z-index: 40; display: flex; flex-direction: column;
}
#fontMenu[hidden] { display: none; }
#fontMenu button {
  text-align: left; padding: 9px 12px; font-size: 17px;
  border: 0; background: none; border-radius: 8px; color: var(--ink); cursor: pointer;
}
#fontMenu button:hover { background: #f3f0ea; }
#fontMenu button.active { background: var(--accent-soft); color: var(--accent); }

.zoom-label {
  min-width: 52px; height: 30px; border: 0; background: none;
  border-radius: 8px; font-size: 13px; color: var(--ink); cursor: pointer;
}
.zoom-label:hover { background: #efece6; }

.pill {
  height: 32px; padding: 0 12px; margin: 0 2px;
  border-radius: 16px; border: 1px solid var(--line);
  background: #fff; color: var(--ink);
  font-size: 13px; cursor: pointer; white-space: nowrap; flex: none;
}
.pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }
select.pill { padding-right: 8px; }

/* ---------- メニュー ---------- */
#menu {
  position: fixed; top: calc(var(--tb-h) - 4px); right: 10px;
  min-width: 240px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(40,30,10,.15);
  z-index: 40;
  display: flex; flex-direction: column;
}
#menu[hidden] { display: none; }
#menu button, .menu-check {
  text-align: left; padding: 10px 12px;
  border: 0; background: none; border-radius: 8px;
  font-size: 14px; color: var(--ink); cursor: pointer;
  display: flex; align-items: center; gap: 8px;
}
#menu button:hover, .menu-check:hover { background: #f3f0ea; }
#menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }

/* ---------- サイドバー ---------- */
/* ---------- 左のパネル（≡）：ページ一覧／ノート一覧 ---------- */
:root { --pn-w: clamp(320px, 50vw, 900px); }
#panel {
  position: fixed; top: var(--tb-h); left: 0; bottom: 0;
  width: var(--pn-w);
  background: #ebe7e0; border-right: 1px solid var(--line);
  transform: translateX(-102%); transition: transform .2s ease;
  z-index: 30; display: flex; flex-direction: column;
}
body.panel-open #panel { transform: none; }
/* 広い画面：本文はパネルの右に並ぶ */
#workspace { transition: left .2s ease; }
@media (min-width: 800px) {
  body.panel-open #workspace { left: var(--pn-w); }
}
/* 狭い画面：パネルは上に重ねる */
@media (max-width: 799px) {
  :root { --pn-w: min(94vw, 460px); }
  body.panel-open #backdrop { display: block; }
}
#backdrop {
  position: fixed; top: var(--tb-h); left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.15); z-index: 25; display: none;
}
.pn-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 50px; padding: 0 8px 0 12px; background: #f7f5f1; border-bottom: 1px solid #ddd7cc; flex: none;
}
.pn-label { font-size: 14px; font-weight: 600; color: var(--ink); padding-left: 4px; }
.pn-body { display: none; flex: 1; min-height: 0; flex-direction: column; position: relative; }
#panel[data-tab="pages"] .pn-pages, #panel[data-tab="notes"] .pn-notes { display: flex; }
.pn-notes { background: var(--bar); }
.sb-head { padding: 16px 18px 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
#nbList { flex: 1; overflow-y: auto; padding-bottom: 8px; }
.nb-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px; margin: 2px 8px; border-radius: 10px; cursor: pointer;
}
.nb-item:hover { background: #f1eee8; }
.nb-item.active { background: var(--accent-soft); }
.nb-cover {
  width: 34px; height: 46px; flex: none; border-radius: 2px;
  background: repeating-linear-gradient(#fffefa 0 5px, #b9cfe4 5px 6px);
  background-color: #fffefa;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  position: relative;
}
.nb-cover::before {
  content: ""; position: absolute; left: 3px; top: 3px; bottom: 3px; width: 3px;
  background: radial-gradient(circle, var(--desk) 1.2px, transparent 1.5px) 0 0 / 3px 5px repeat-y;
}
.nb-info { flex: 1; min-width: 0; }
.nb-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.nb-btn {
  width: 28px; height: 28px; border: 0; border-radius: 7px;
  background: none; color: var(--muted); cursor: pointer; flex: none;
}
.nb-btn:hover { background: #e4dfd6; color: var(--ink); }
.sb-new {
  margin: 10px 12px 16px; height: 42px;
  border: 1.5px dashed #c9c2b5; border-radius: 10px;
  background: none; color: var(--ink); cursor: pointer;
}
.sb-new:hover { background: #f1eee8; }

/* ---------- ページ ---------- */
#workspace {
  position: fixed; top: var(--tb-h); left: 0; right: 0; bottom: 0;
  overflow: auto;
  background: var(--desk);
}
#pages { width: max-content; min-width: 100%; padding: 28px 16px 60px; }

.page-wrap {
  position: relative;
  margin: 0 auto 52px;
  background: #fffefa;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 8px 24px rgba(60,50,30,.13);
}
.page {
  position: absolute; left: 0; top: 0;
  transform-origin: 0 0;
  touch-action: none;
}

/* 見開き */
.spread {
  display: flex; width: max-content;
  margin: 0 auto 52px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 8px 24px rgba(60,50,30,.13);
}
.spread .page-wrap { margin: 0; box-shadow: none; }
.spread .page-wrap::after {        /* 綴じ目の陰 */
  content: ""; position: absolute; top: 0; bottom: 0; width: 18px;
  pointer-events: none;
}
.spread .page-wrap.back::after { right: 0; background: linear-gradient(to left, rgba(0,0,0,.07), transparent); }
.spread .page-wrap:not(.back)::after { left: 0; background: linear-gradient(to right, rgba(0,0,0,.07), transparent); }
.page-wrap.placeholder {
  display: grid; place-items: center;
  background: rgba(255,255,255,.35);
  border: 2px dashed #c9c2b5; color: var(--muted);
  font-size: 14px; cursor: pointer;
}
.page-wrap.placeholder::after { display: none; }
.page-wrap.placeholder:hover { background: rgba(255,255,255,.6); color: var(--ink); }

/* 選択 */
.sel {
  position: absolute; pointer-events: none;
  border: 1.5px dashed var(--accent); border-radius: 4px;
  background: rgba(59,111,216,.04);
}
.sel-menu {
  position: absolute; left: 0; bottom: calc(100% + 6px);
  transform-origin: left bottom;
  display: flex; gap: 4px; pointer-events: auto; white-space: nowrap;
}
.sel-menu button {
  background: #2b2b30; color: #fff; border: 0; border-radius: 8px;
  padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.sel-menu button:hover { background: #45454d; }
.sel-scale {
  position: absolute; right: -10px; bottom: -10px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent);
  pointer-events: auto; cursor: nwse-resize; touch-action: none;
}
.page canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.page canvas.live { pointer-events: none; }

body[data-tool=pen] .page,
body[data-tool=shape] .page { cursor: crosshair; }
body[data-tool=select] .page { cursor: default; }
body[data-tool=marker] .page { cursor: crosshair; }
body[data-tool=eraser] .page { cursor: cell; }
body[data-tool=text] .page { cursor: text; }

.page-tools {
  position: absolute; left: 0; right: 0; bottom: -38px;
  display: flex; justify-content: center; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
}
.page-tools button {
  border: 0; background: none; color: var(--muted);
  padding: 4px 8px; border-radius: 6px; cursor: pointer; font-size: 12px;
}
.page-tools button:hover { background: #ddd7cc; color: #b3372f; }
.page-tools button.dup-page:hover, .page-tools button.paste-here:hover { color: var(--accent); }

.add-page {
  display: block; margin: 0 auto; height: 60px;
  border: 2px dashed #c9c2b5; border-radius: 12px;
  background: transparent; color: var(--muted); cursor: pointer; font-size: 14px;
}
.add-page:hover { background: #e2ddd3; color: var(--ink); }

/* ---------- テキスト ---------- */
.texts { position: absolute; inset: 0; pointer-events: none; }
.tbox {
  position: absolute;
  width: max-content;
  pointer-events: none;
  font-family: var(--hand);
}
body[data-tool=text] .tbox { pointer-events: auto; }
.tx {
  outline: none;
  white-space: pre-wrap; word-break: break-word;
  min-width: .6em; padding: 0 2px;
  cursor: text;
  -webkit-user-select: text; user-select: text;
  border-radius: 2px;
}
body[data-tool=text] .tbox:hover .tx { box-shadow: 0 0 0 1px rgba(59,111,216,.35); }
.tbox.editing .tx { box-shadow: 0 0 0 1.5px rgba(59,111,216,.75) !important; background: rgba(255,255,255,.4); }

.thandle {
  position: absolute; left: -28px;
  width: 22px; height: 22px; border-radius: 6px;
  display: none; place-items: center;
  font: 13px/1 system-ui, sans-serif; padding: 0;
}
body[data-tool=text] .tbox:hover .thandle,
.tbox.editing .thandle { display: grid; }
.thandle { top: 0; background: var(--accent); color: #fff; cursor: move; touch-action: none; }

/* ---------- トースト ---------- */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: #2b2b30; color: #fff; font-size: 13px;
  padding: 10px 16px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: all .2s; z-index: 50;
  max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 印刷 ---------- */
/* 「ここに貼り付け」はコピーしたあとだけ出す */
.page-tools .paste-here { display: none; }
body.has-clip .page-tools .paste-here { display: inline-block; }
.page-tools .paste-here:hover { color: var(--accent, #3b6fd8); }

/* ---------- ページ一覧（パネルの「ページ」タブ） ---------- */
.ov-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 8px 8px 16px; flex: none;
}
.ov-titles { min-width: 0; }
#ovTitle { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ovSub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.ov-hright { display: flex; justify-content: flex-end; gap: 6px; }
.ov-hbtn {
  display: inline-flex; align-items: center; gap: 2px; justify-self: start;
  border: 0; background: none; color: var(--accent); font: inherit; font-size: 14px;
  padding: 7px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.ov-hbtn:hover { background: var(--accent-soft); }
.ov-hbtn[hidden] { display: none; }
.ov-hbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ov-hbtn.on { background: var(--accent); color: #fff; }
#ovGrid {
  flex: 1; overflow: auto; padding: 8px 16px 110px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 12px;
  align-content: start; justify-items: center;
}
.ov-item { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; outline: none; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ov-thumb { position: relative; border-radius: 4px; }
.ov-thumb canvas, .ov-add { width: 136px; aspect-ratio: 728 / 1028; height: auto; }
.ov-thumb canvas {
  display: block; background: #fff; border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.14), 0 4px 14px rgba(0,0,0,.06);
  outline: 3px solid transparent; outline-offset: 3px; transition: outline-color .1s, transform .12s;
}
.ov-item:hover .ov-thumb canvas { transform: translateY(-2px); }
.ov-item:focus-visible .ov-thumb canvas { outline-color: #c9c2b5; }
.ov-item.current .ov-thumb canvas { outline-color: #9fbaf0; }
.ov-num { font-size: 13px; color: var(--muted); padding: 1px 9px; border-radius: 10px; }
.ov-item.current .ov-num { background: var(--accent); color: #fff; }
/* 選択モード */
.ov-check {
  position: absolute; right: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0,0,0,.18); box-shadow: 0 1px 3px rgba(0,0,0,.25);
  display: none;
}
#panel.selecting .ov-check { display: block; }
.ov-item.checked .ov-check {
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/16px no-repeat;
}
.ov-item.checked .ov-thumb canvas { outline-color: var(--accent); }
/* 並べ替え：指はつまみから */
.ov-grip {
  position: absolute; left: 6px; bottom: 6px; width: 30px; height: 30px; border-radius: 8px;
  display: none; place-items: center; background: rgba(255,255,255,.9); box-shadow: 0 1px 3px rgba(0,0,0,.2);
  touch-action: none; cursor: grab; color: #8a8378;
}
.ov-grip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
@media (hover: none) { .ov-grip { display: grid; } }
.ov-item:hover .ov-grip { display: grid; }
.ov-item.dragging { opacity: .35; }
.ov-item.drop-before .ov-thumb::before, .ov-item.drop-after .ov-thumb::after {
  content: ''; position: absolute; top: -6px; bottom: -6px; width: 4px; border-radius: 2px; background: var(--accent);
}
.ov-item.drop-before .ov-thumb::before { left: -12px; }
.ov-item.drop-after .ov-thumb::after { right: -12px; }
.ov-ghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; }
.ov-ghost canvas { width: 90px; border-radius: 3px; box-shadow: 0 8px 24px rgba(0,0,0,.3); background: #fff; }
.ov-ghost-n {
  position: absolute; right: -8px; top: -8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--accent); color: #fff; font-size: 12px; display: grid; place-items: center;
}
body.ov-dragging, body.ov-dragging * { cursor: grabbing !important; }
.ov-add {
  border: 2px dashed #c9c2b5; border-radius: 6px; background: transparent; color: var(--muted);
  font: inherit; font-size: 13px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.ov-add span { font-size: 28px; line-height: 1; }
.ov-add:hover { background: #e2ddd3; color: var(--ink); }
/* 下の操作バー */
#ovBar {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 6px; border-radius: 16px;
  background: rgba(255,255,255,.96); box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
#ovBar[hidden] { display: none; }
#ovBar button {
  display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 76px;
  border: 0; background: none; font: inherit; font-size: 12px; color: var(--ink);
  padding: 8px 10px; border-radius: 11px; cursor: pointer;
}
#ovBar button:hover:not(:disabled) { background: #f1eee8; }
#ovBar button:disabled { opacity: .35; cursor: default; }
#ovBar button.danger { color: #c9453b; }
#ovBar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dlg-field select {
  font: inherit; font-size: 15px; color: var(--ink);
  padding: 9px 11px; border: 1px solid #d8d2c7; border-radius: 9px; background: #fff; outline: none;
}
@media (max-width: 600px) {
  #ovGrid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); padding: 8px 10px 110px; gap: 18px 8px; }
  .ov-thumb canvas, .ov-add { width: 112px; }
  #ovBar button { min-width: 58px; padding: 8px 6px; }
}

/* ---------- アプリ内ダイアログ ---------- */
.dlg-wrap {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(40, 36, 30, .35);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 16vh 16px 16px;
  animation: dlg-fade .12s ease-out;
}
.dlg {
  background: #fbf9f5; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
  width: min(420px, 100%); padding: 20px 20px 16px;
  display: flex; flex-direction: column; gap: 12px;
  animation: dlg-pop .14s ease-out;
}
.dlg-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.dlg-msg { font-size: 13px; color: var(--muted); white-space: pre-line; line-height: 1.6; overflow-wrap: anywhere; }
.dlg-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.dlg-field input {
  font: inherit; font-size: 15px; color: var(--ink);
  padding: 9px 11px; border: 1px solid #d8d2c7; border-radius: 9px; background: #fff; outline: none;
}
.dlg-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.dlg-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.dlg-btn {
  font: inherit; font-size: 13px; padding: 8px 16px; border-radius: 9px; cursor: pointer;
  border: 1px solid #d8d2c7; background: #fff; color: var(--ink);
}
.dlg-btn:hover { background: #f1eee8; }
.dlg-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.dlg-btn.primary:hover { filter: brightness(1.08); }
.dlg-btn.danger { background: #c9453b; border-color: #c9453b; color: #fff; }
.dlg-btn.danger:hover { filter: brightness(1.08); }
.dlg-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes dlg-fade { from { opacity: 0; } }
@keyframes dlg-pop { from { transform: translateY(6px) scale(.98); opacity: 0; } }
@media print { .dlg-wrap { display: none !important; } }

/* クラウド同期の状態（ツールバーの小さな丸） */
#syncState {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  margin: 0 6px; background: #c9c4ba;
}
#syncState.sync-ok { background: #3a9d5d; }
#syncState.sync-busy { background: #e0a526; }
#syncState.sync-offline { background: #9aa3ad; }
#syncState.sync-err { background: #d0453b; }

@media print {
  @page { size: 182mm 257mm; margin: 0; }
  #toolbar, #panel, #backdrop, #menu, #toast, .page-tools, .add-page { display: none !important; }
  html, body { overflow: visible !important; height: auto !important; background: #fff !important; }
  #workspace { position: static !important; overflow: visible !important; background: #fff !important; }
  #pages { padding: 0 !important; width: auto !important; }
  .spread { display: block !important; margin: 0 !important; box-shadow: none !important; }
  .page-wrap.placeholder, .page-wrap::after, .sel { display: none !important; }
  .page-wrap {
    width: 182mm !important; height: 257mm !important;
    margin: 0 !important; box-shadow: none !important;
    overflow: hidden; break-after: page; page-break-after: always;
  }
  .page { transform: scale(0.94488) !important; }
  .tx { box-shadow: none !important; background: none !important; }
  .thandle { display: none !important; }
}
