/* デスクトップ版だけの見た目。図面ビューアー本体は vendor/style.css(現場管理アプリと同じ) */
html, body { height: 100%; overflow: hidden; }
body {
    display: flex;
    flex-direction: column;
}

.pdfv-appbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: var(--blueprint);
    color: #fff;
    flex-shrink: 0;
    user-select: none;
}
.pdfv-btn {
    height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}
.pdfv-btn:hover { background: rgba(255, 255, 255, 0.18); }
.pdfv-btn[aria-pressed="true"] { background: var(--copper); border-color: var(--copper); }
.pdfv-title {
    margin-left: 10px;
    font-size: 14px;
    opacity: 0.9;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.pdfv-main {
    flex: 1;
    display: flex;
    min-height: 0;
}
/* 現場管理アプリでは「画面の高さ - 上部帯」で決めている高さを、ここでは残りいっぱいにする */
.pdfv-main .drawing-layout {
    flex: 1;
    min-width: 0;
    height: auto;
    min-height: 0;
}

/* ---- 検索・しおりの横の欄 ---- */
.pdfv-side {
    position: relative;
    width: 300px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 10px 10px 0;
}
.pdfv-side[hidden] { display: none; }
.pdfv-side section { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.pdfv-side section[hidden] { display: none; }
.pdfv-side-close {
    position: absolute;
    top: 6px;
    right: 6px;
    border: none;
    background: transparent;
    font-size: 15px;
    cursor: pointer;
    color: var(--ink);
    width: 28px;
    height: 28px;
    border-radius: 50%;
}
.pdfv-side-close:hover { background: var(--line); }
.pdfv-side-title { font-size: 15px; margin: 4px 0 8px; }
/* 欄の右の端: ドラッグで幅を変える(side_resize.js) */
.pdfv-side-resizer {
    position: absolute;
    top: 0;
    right: -4px;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    z-index: 5;
    touch-action: none;
}
.pdfv-side-resizer:hover, .pdfv-side-resizer.dragging { background: rgba(11, 107, 203, .35); }
body.pdfv-side-resizing { cursor: col-resize; user-select: none; }
body.pdfv-side-resizing iframe, body.pdfv-side-resizing canvas { pointer-events: none; }
/* 読み上げの欄は項目が多いので、欄ごと縦にスクロールして下の項目まで見えるようにする */
#reader-section { overflow-y: auto; overflow-x: hidden; padding-bottom: 16px; margin-right: -10px; padding-right: 10px; }
#reader-section > * { flex-shrink: 0; }
#reader-section #reader-list { flex: 1 0 auto; min-height: 160px; max-height: 50vh; }
.pdfv-find { display: flex; gap: 4px; margin-right: 30px; }
.pdfv-find input {
    flex: 1;
    min-width: 0;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
}
.pdfv-find .pdfv-btn { background: var(--paper); color: var(--ink); border-color: var(--line); padding: 0 8px; }
.pdfv-find .pdfv-btn:hover { background: var(--line); }
.pdfv-find-status { font-size: 13px; color: #5f6b73; margin: 6px 0; min-height: 1.2em; }
.pdfv-results, #outline-body { list-style: none; margin: 0; padding: 0 0 10px; overflow-y: auto; flex: 1; }
.pdfv-result {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    color: var(--ink);
    line-height: 1.5;
}
.pdfv-result:hover { background: var(--paper); }
.pdfv-result.current { background: #fde9c9; }
.pdfv-result-page { color: var(--copper-dark); font-weight: 600; margin-right: 6px; }
.pdfv-result mark { background: #ffe066; padding: 0 1px; }

.pdfv-outline ul { list-style: none; margin: 0; padding-left: 14px; }
.pdfv-outline > ul { padding-left: 0; }
.pdfv-outline-row { display: flex; align-items: flex-start; }
.pdfv-outline-toggle {
    width: 18px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px 0;
    font-size: 10px;
    color: #5f6b73;
}
.pdfv-outline-link {
    flex: 1;
    border: none;
    background: transparent;
    text-align: left;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    color: var(--ink);
    overflow-wrap: anywhere;
}
.pdfv-outline-link:hover { background: var(--paper); }
.pdfv-outline-collapsed > ul { display: none; }
.pdfv-empty { color: #5f6b73; font-size: 13px; padding: 8px 4px; }

/* ---- 検索で見つかった文字の強調(ページの上に重ねる) ---- */
.pdfv-hl-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}
.pdfv-hl {
    position: absolute;
    background: rgba(255, 214, 0, 0.38);
    outline: 1px solid rgba(230, 160, 0, 0.6);
    border-radius: 2px;
}
.pdfv-hl.current {
    background: rgba(255, 120, 0, 0.42);
    outline: 2px solid rgba(220, 80, 0, 0.9);
}

/* ---- ドロップ・通知 ---- */
.pdfv-drop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(22, 50, 76, 0.18);
    border: 3px dashed var(--blueprint);
    font-size: 20px;
    color: var(--blueprint);
    pointer-events: none;
    z-index: 2000;
}
.pdfv-drop[hidden], .pdfv-toast[hidden] { display: none; }
.pdfv-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    background: #202124;
    color: #fff;
    padding: 10px 18px;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    z-index: 2100;
    max-width: 80vw;
    white-space: pre-wrap;
}

/* ---- パスワードの入力 ---- */
.pdfv-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2050;
}
.pdfv-modal-backdrop[hidden] { display: none; }
.pdfv-modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    width: min(380px, 90vw);
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}
.pdfv-modal p { margin: 0; }
.pdfv-modal input { padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; }
.pdfv-modal-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.pdfv-modal-buttons button { padding: 6px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--paper); cursor: pointer; font: inherit; }
.pdfv-modal-buttons button[type="submit"] { background: var(--blueprint); border-color: var(--blueprint); color: #fff; }

/* ---- 上の文字付きツールバー(マウスで使う) ---- */
.pdfv-strip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
    flex-wrap: wrap;
    row-gap: 2px;
    user-select: none;
    font-size: 13px;
    color: var(--ink);
}
.pdfv-strip-group {
    display: flex;
    align-items: center;
    gap: 1px;
    padding-right: 6px;
    margin-right: 2px;
    border-right: 1px solid var(--line);
    flex-shrink: 0;
}
.pdfv-strip-group:last-child { border-right: none; }
.pdfv-sbtn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 26px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: inherit;
    font: inherit;
    white-space: nowrap;
    cursor: pointer;
}
.pdfv-sbtn:hover:not(:disabled) { background: #eef1f4; border-color: var(--line); }
.pdfv-sbtn:disabled { opacity: 0.4; cursor: default; }
.pdfv-sbtn.active { background: #dde8f3; border-color: #9db5cc; color: var(--blueprint); }
.pdfv-sbtn.pdfv-sbtn-open { background: #e4e9ee; border-color: #b9c3cc; }
.pdfv-sdrop::after { content: "▾"; font-size: 10px; opacity: 0.65; margin-left: 1px; }
.pdfv-sicon { display: inline-block; min-width: 1em; text-align: center; }
.pdfv-zoom { min-width: 58px; justify-content: center; font-variant-numeric: tabular-nums; }
.pdfv-spage {
    width: 46px;
    height: 22px;
    padding: 0 4px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font: inherit;
    text-align: right;
}
.pdfv-spage::-webkit-inner-spin-button { display: none; }
.pdfv-stotal { padding: 0 4px; opacity: 0.8; font-variant-numeric: tabular-nums; }

/* ツールバーの▾から出る一覧 */
.pdfv-dd {
    position: fixed;
    z-index: 80;
    display: flex;
    flex-direction: column;
    min-width: 160px;
    padding: 4px;
    background: #fff;
    border: 1px solid #b9c3cc;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    font-size: 13px;
    color: var(--ink);
}
.pdfv-dd-wide { padding: 8px; gap: 8px; }
.pdfv-dd-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border: none;
    border-radius: 4px;
    background: transparent;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.pdfv-dd-item:hover:not(:disabled) { background: #e8eef4; }
.pdfv-dd-item:disabled { opacity: 0.4; cursor: default; }
.pdfv-dd-item.active { background: #dde8f3; font-weight: 600; }
.pdfv-dd-icon { width: 1.3em; text-align: center; }
.pdfv-dd-label { flex: 1; }
.pdfv-dd-key { color: #7a8590; font-size: 12px; padding-left: 16px; }

/* 右クリックメニューのキー表示 */
.dv-annot-tool-contextmenu-shortcut { margin-left: auto; padding-left: 18px; color: #7a8590; font-size: 12px; }
.dv-annot-tool-contextmenu { font-size: 13px; }
.dv-annot-tool-contextmenu-item { padding: 4px 8px; }

/* 左右のアイコン列は、ふだんは出さない(表示メニューで出せる) */
body.pdfv-hide-icon-toolbars .dv-toolbar,
body.pdfv-hide-icon-toolbars .dv-annot-toolbar { display: none !important; }
body.pdfv-hide-icon-toolbars .dv-thumb-strip { left: 16px; right: 16px; }

/* スペースを押している間は手のひら */
body.dv-space-pan .drawing-canvas-wrap { cursor: grab; }
body.dv-space-pan .drawing-canvas-wrap.dv-pan-dragging { cursor: grabbing; }
body.dv-space-pan .drawing-canvas-wrap * { cursor: inherit !important; }

/* 読み上げ(VOICEVOX) */
.pdfv-reader-row { display: flex; align-items: center; gap: 6px; margin: 0 30px 8px 0; }
.pdfv-reader-row .pdfv-btn { background: var(--paper); color: var(--ink); border-color: var(--line); }
.pdfv-reader-row .pdfv-btn:hover:not(:disabled) { background: var(--line); }
.pdfv-reader-row .pdfv-btn:disabled { opacity: .45; cursor: default; }
.pdfv-reader-row .pdfv-reader-play { flex: 1; background: var(--copper, #b8692e); color: #fff; border-color: transparent; font-weight: 600; }
.pdfv-reader-row .pdfv-reader-play:hover { background: var(--copper-dark, #8f4f20); }
#reader-play[aria-pressed="true"] { background: #5f6b73; color: #fff; }
.pdfv-reader-page { flex: 1; text-align: center; font-size: 13px; }
.pdfv-reader-field { display: flex; flex-direction: column; gap: 3px; font-size: 13px; margin-bottom: 8px; }
.pdfv-reader-field input[type=range] { width: 100%; }
.pdfv-reader-inline { display: flex; gap: 4px; }
.pdfv-reader-inline select { flex: 1; min-width: 0; height: 30px; font: inherit; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.pdfv-reader-inline .pdfv-btn { background: var(--paper); color: var(--ink); border-color: var(--line); padding: 0 8px; }
.pdfv-reader-check { font-size: 13px; display: flex; align-items: center; gap: 6px; }
.pdfv-reader-status.error { color: #b42318; }
.pdfv-reader-credit { margin: -4px 0 8px; font-size: 12px; color: #5f6b73; }
.pdfv-reader-line { font-size: 14px; }
.pdfv-reader-engine { font-size: 12px; color: #5f6b73; padding: 6px 0 10px; border-top: 1px solid var(--line); }
.pdfv-reader-engine form { display: flex; gap: 4px; margin-top: 6px; }
.pdfv-reader-engine input { flex: 1; min-width: 0; height: 28px; padding: 0 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; }
.pdfv-reader-engine .pdfv-btn { background: var(--paper); color: var(--ink); border-color: var(--line); }
.pdfv-reader-engine p { margin: 6px 0 0; }
#reader-readings-form { flex-direction: column; align-items: stretch; }
#reader-readings { width: 100%; box-sizing: border-box; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; font-size: 13px; resize: vertical; }
#reader-readings-form .pdfv-btn { align-self: flex-end; height: 28px; }
#reader-export-page, #reader-export-all { background: var(--paper); color: var(--ink); border-color: var(--line); font-size: 13px; padding: 0 8px; }
.pdfv-hl.reading { background: rgba(0, 150, 255, .22); outline: 2px solid rgba(0, 120, 220, .75); }
#btn-reader.pdfv-reading { background: #fde9c9; color: #7a3d00; }

/* ---- 連続スクロール・見開きの表示(reading_view.js)。図面ビューアーの上にかぶせる ---- */
.pdfv-readview {
    position: absolute;
    inset: 0;
    z-index: 15; /* ページ一覧(z-index 20)より下、図面より上 */
    background: #d9dcd6;
}
.pdfv-readview[hidden] { display: none; }
.pdfv-readview-scroll {
    position: absolute;
    inset: 0;
    overflow: auto;
    outline: none;
}
.pdfv-readview .pdfViewer { padding: 8px 0 140px; }
.pdfv-readview .pdfViewer .page { box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
/* 書き込みは見せるだけ。文字の選択のじゃまをしない */
.pdfv-annot-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: visible;
}
.pdfv-annot-overlay, .pdfv-annot-overlay * { pointer-events: none !important; }
.pdfv-readview .textLayer { z-index: 2; }
.pdfv-readview .annotationLayer { z-index: 3; }
.pdfv-readview-menu { position: fixed; z-index: 1000; }
/* 連続スクロールの表示のときは、書き込みだけに効くボタンを押せなくする(ツールを選ぶと元の表示に戻る) */
body.pdfv-readview-on #toolstrip [data-action="image"],
body.pdfv-readview-on #toolstrip [data-panel="style"],
body.pdfv-readview-on #toolstrip [data-panel="angle"],
body.pdfv-readview-on #toolstrip [data-action="undo"],
body.pdfv-readview-on #toolstrip [data-action="delete"],
body.pdfv-readview-on #toolstrip [data-action="split"] {
    opacity: 0.4;
    pointer-events: none;
}
.pdfv-reader-export { align-items: center; font-size: 13px; color: #5f6b73; }

/* ---- ほかのPDFソフトで付けたコメントの一覧(comments.js) ---- */
.pdfv-cmt { border-radius: var(--radius-sm); }
.pdfv-cmt.current { background: #fde9c9; }
.pdfv-cmt-head {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    color: var(--ink);
    line-height: 1.5;
}
.pdfv-cmt-head:hover { background: var(--paper); }
.pdfv-cmt-color {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 6px;
    border: 1px solid rgba(0, 0, 0, .25);
}
.pdfv-cmt-type { font-weight: 600; margin-right: 6px; }
.pdfv-cmt-meta { color: #5f6b73; font-size: 12px; }
.pdfv-cmt-body { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.pdfv-cmt-body:empty { display: none; }
.pdfv-cmt-edit { padding: 0 8px 8px; font-size: 13px; }
.pdfv-cmt-edit textarea {
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 4px 6px;
    resize: vertical;
}
.pdfv-cmt-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.pdfv-cmt-row label { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.pdfv-cmt-row input[type=color] { width: 36px; height: 26px; padding: 0; border: 1px solid var(--line); }
.pdfv-cmt-row .pdfv-btn { height: 28px; background: var(--paper); color: var(--ink); border-color: var(--line); }
.pdfv-cmt-row .pdfv-btn:hover { background: var(--line); }
.pdfv-cmt-row .pdfv-cmt-delete { color: #b3261e; }
#comments-list.busy { opacity: .5; pointer-events: none; }
.pdfv-cmt-note { font-size: 12px; color: #5f6b73; margin: 4px 0 10px; }
.pdfv-cmt-flash {
    position: absolute;
    pointer-events: none;
    z-index: 3;
    outline: 3px solid rgba(220, 80, 0, .9);
    background: rgba(255, 140, 0, .25);
    border-radius: 2px;
    animation: pdfv-cmt-flash 1.6s ease-out forwards;
}
@keyframes pdfv-cmt-flash {
    0%, 60% { opacity: 1; }
    100% { opacity: 0; }
}

/* ---- しおりを直す(bookmarks.js) ---- */
.pdfv-bm-tools { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.pdfv-bm-tools .pdfv-btn { padding: 3px 8px; font-size: 12px; }
.pdfv-bm-tools .pdfv-btn:disabled { opacity: 0.45; cursor: default; }
.pdfv-outline-row.selected > .pdfv-outline-link { background: #fde9c9; }
.pdfv-outline-row.pdfv-bm-drop-before { box-shadow: inset 0 2px 0 var(--blueprint); }
.pdfv-outline-row.pdfv-bm-drop-after { box-shadow: inset 0 -2px 0 var(--blueprint); }
.pdfv-outline-row.pdfv-bm-drop-inside > .pdfv-outline-link { outline: 2px dashed var(--blueprint); }
#bookmark-modal .pdfv-modal input { min-width: 320px; }

/* ---- 署名を置く(signature.js) ---- */
.pdfv-sig-modal { width: min(600px, 94vw); max-height: 90vh; overflow: auto; }
.pdfv-sig-modal h3 { margin: 4px 0 0; font-size: 13px; color: #5f6b73; font-weight: 600; }
.pdfv-sig-saved { display: flex; flex-wrap: wrap; gap: 8px; }
.pdfv-sig-cell { position: relative; }
.pdfv-sig-item { width: 132px; height: 56px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; padding: 4px; }
.pdfv-sig-item:hover { border-color: var(--blueprint); }
.pdfv-sig-item img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pdfv-sig-del { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 11px; line-height: 1; padding: 0; }
.pdfv-sig-tabs { display: flex; gap: 4px; }
.pdfv-sig-tab { padding: 4px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); cursor: pointer; font: inherit; font-size: 13px; }
.pdfv-sig-tab[aria-selected="true"] { background: var(--blueprint); border-color: var(--blueprint); color: #fff; }
.pdfv-sig-pane { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.pdfv-sig-pane[hidden] { display: none; }
.pdfv-sig-canvas { width: 520px; max-width: 100%; height: 160px; border: 1px dashed var(--line); border-radius: var(--radius-sm); background: #fff; touch-action: none; cursor: crosshair; }
.pdfv-sig-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; }
.pdfv-sig-row input[type="text"] { min-width: 260px; }
.pdfv-sig-preview { min-height: 60px; width: 100%; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); color: #8a959c; font-size: 12px; }
.pdfv-sig-preview img { max-width: 100%; max-height: 90px; }
.pdfv-sig-note { color: #5f6b73; font-size: 12px; }
.pdfv-sig-digital-list { margin: 0; padding-left: 18px; font-size: 13px; }

/* 倍率: 範囲を指定して拡大(zoom.js)・倍率の一覧のスライダー */
.pdfv-zoomrect-overlay {
    position: fixed;
    z-index: 900;
    cursor: zoom-in;
    background: rgba(0, 0, 0, .04);
    touch-action: none;
}
.pdfv-zoomrect-box {
    position: absolute;
    border: 2px dashed #1565c0;
    background: rgba(21, 101, 192, .12);
    pointer-events: none;
}
.pdfv-zoom-slider {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 8px;
    border-bottom: 1px solid #e0e4e8;
    margin-bottom: 4px;
}
.pdfv-zoom-slider input[type=range] { width: 150px; }
.pdfv-zoom-slider-value { min-width: 3.5em; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }

/* ---- 添付ファイルの一覧(attachments.js) ---- */
.pdfv-att { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.pdfv-att-head { display: flex; align-items: center; gap: 6px; }
.pdfv-att-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; color: var(--ink); }
.pdfv-att-page { border: none; background: none; cursor: pointer; padding: 0 2px; font: inherit; }
.pdfv-att-desc { font-size: 12px; color: #5f6b73; margin: 2px 0 0 22px; white-space: pre-wrap; overflow-wrap: anywhere; }
.pdfv-att-row { display: flex; gap: 6px; margin: 4px 0 0 22px; }
.pdfv-att-row .pdfv-btn { background: var(--paper); color: var(--ink); border-color: var(--line); padding: 2px 10px; }
.pdfv-att-row .pdfv-btn:hover { background: var(--line); }
.pdfv-att-row .pdfv-att-delete { color: #a33; }
#attach-list.busy { opacity: 0.5; pointer-events: none; }
/* ページに貼る場所を選んでいる間 */
body.pdfv-att-picking .drawing-canvas-stack, body.pdfv-att-picking .drawing-canvas-stack * { cursor: crosshair !important; }

/* ---- スキャナーから取り込む(send_scan.js) ---- */
.pdfv-scan { width: min(560px, 92vw); }
.pdfv-scan #scan-message { white-space: pre-line; }
.pdfv-scan-thumbs { display: flex; flex-wrap: wrap; gap: 6px; max-height: 40vh; overflow: auto; }
.pdfv-scan-thumbs:empty { display: none; }
.pdfv-scan-thumbs img { height: 110px; border: 1px solid var(--line); background: #fff; }
.pdfv-scan-options select { font: inherit; padding: 3px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pdfv-modal-buttons button.pdfv-primary { background: var(--blueprint); border-color: var(--blueprint); color: #fff; }
/* ---- 読み上げの範囲と順番(reader.js・read_order_ui.js) ---- */
.pdfv-reader-opt { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; margin-bottom: 6px; }
.pdfv-reader-opt > label { width: 2.6em; }
.pdfv-reader-opt select { flex: 1; min-width: 0; height: 28px; font: inherit; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); }
.pdfv-reader-opt input { width: 7.5em; height: 26px; padding: 0 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; }
.pdfv-reader-opt .pdfv-btn, .pdfv-reader-modebar .pdfv-btn { background: var(--paper); color: var(--ink); border-color: var(--line); font-size: 13px; padding: 0 8px; height: 28px; }
.pdfv-reader-opt [hidden] { display: none; }
.pdfv-reader-modebar { background: #fff6e0; border: 1px solid #f0c36d; border-radius: var(--radius-sm); padding: 6px 8px; margin-bottom: 8px; font-size: 13px; }
.pdfv-reader-modebar p { margin: 0 0 6px; }
.pdfv-reader-modebar[hidden] { display: none; }
.pdfv-reader-modebar #reader-mode-done { background: #0b6bcb; color: #fff; border-color: transparent; }
.pdfv-ro-layer { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.pdfv-ro-layer.active { pointer-events: auto; }
.pdfv-ro-layer.drawing { cursor: crosshair; background: rgba(0, 0, 0, 0.04); }
.pdfv-ro-rect, .pdfv-ro-block { position: absolute; box-sizing: border-box; border-radius: 2px; }
.pdfv-ro-rect { border: 2px dashed rgba(0, 120, 220, 0.85); background: rgba(0, 150, 255, 0.06); }
.pdfv-ro-ghost { border-style: solid; }
.pdfv-ro-frame { pointer-events: none; background: none; }
.pdfv-ro-edit { cursor: move; pointer-events: auto; }
.pdfv-ro-edit.editing { border-style: solid; }
.pdfv-ro-handle {
    position: absolute; width: 10px; height: 10px; box-sizing: border-box;
    background: #fff; border: 2px solid rgba(0, 120, 220, 0.95); border-radius: 2px;
}
.pdfv-ro-handle.h-nw { left: -6px; top: -6px; cursor: nwse-resize; }
.pdfv-ro-handle.h-se { right: -6px; bottom: -6px; cursor: nwse-resize; }
.pdfv-ro-handle.h-ne { right: -6px; top: -6px; cursor: nesw-resize; }
.pdfv-ro-handle.h-sw { left: -6px; bottom: -6px; cursor: nesw-resize; }
.pdfv-ro-del {
    position: absolute; right: 8px; top: -10px; width: 18px; height: 18px; border-radius: 9px;
    background: #c0392b; color: #fff; font: bold 13px/18px sans-serif; text-align: center; cursor: pointer;
}
.pdfv-ro-block { border: 2px solid rgba(120, 120, 120, 0.7); background: rgba(120, 120, 120, 0.12); cursor: pointer; }
.pdfv-ro-block:hover { background: rgba(0, 150, 255, 0.15); }
.pdfv-ro-block.picked { border-color: rgba(0, 120, 220, 0.95); background: rgba(0, 150, 255, 0.18); }
.pdfv-ro-block.picked { cursor: grab; }
.pdfv-ro-layer.dragging, .pdfv-ro-layer.dragging .pdfv-ro-block { cursor: grabbing; }
.pdfv-ro-block.drag-source { opacity: 0.45; }
.pdfv-ro-block.drop-target { border-color: #e07000; background: rgba(255, 150, 0, 0.22); }
/* ふだん出す読む順番(押せない) */
.pdfv-ro-mark { position: absolute; box-sizing: border-box; border: 1px dashed rgba(11, 107, 203, 0.55); border-radius: 2px; }
.pdfv-ro-mark .pdfv-ro-num { opacity: 0.9; }
.pdfv-reader-orderlist { list-style: none; margin: 6px 0; padding: 0; max-height: 220px; overflow: auto; }
.pdfv-reader-orderlist li { display: flex; align-items: center; gap: 4px; padding: 2px 0; font-size: 12px; }
.pdfv-reader-orderlist .num { width: 42px; text-align: center; font-weight: bold; color: #0b6bcb; padding: 1px 2px; }
.pdfv-reader-orderlist .text { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pdfv-reader-orderlist button { padding: 0 6px; min-width: 0; }
.pdfv-ro-num {
    position: absolute; left: -2px; top: -2px; transform: translate(-50%, -50%);
    min-width: 20px; height: 20px; padding: 0 4px; box-sizing: border-box; border-radius: 10px;
    background: #0b6bcb; color: #fff; font: bold 12px/20px sans-serif; text-align: center;
}

/* 連続スクロール・見開きで手のひらのとき */
.pdfv-readview-scroll.pan-mode, .pdfv-readview-scroll.pan-mode .textLayer span { cursor: grab; }
.pdfv-readview-scroll.panning, .pdfv-readview-scroll.panning * { cursor: grabbing !important; user-select: none; }

/* ダブルクリックで固定したツール(置いても選択に戻らない) */
#toolstrip .pdfv-sdrop.locked { box-shadow: inset 0 0 0 2px #e07000; }
#toolstrip .pdfv-sdrop.locked .pdfv-slabel::after { content: " 🔒"; }

/* 順番を決めるとき、番号の丸を押すと出る欄 */
.pdfv-ro-layer.picking .pdfv-ro-block.picked .pdfv-ro-num { cursor: text; }
.pdfv-ro-numedit {
    position: absolute; left: -2px; top: -2px; transform: translate(-50%, -50%); z-index: 2;
    width: 52px; height: 24px; box-sizing: border-box; padding: 0 2px;
    border: 2px solid #e07000; border-radius: 6px; background: #fff; color: #0b6bcb;
    font: bold 13px/20px sans-serif; text-align: center;
}

/* 読み上げ: 途中から読む・何を読むかの説明 */
.pdfv-reader-summary { margin: 2px 0 6px; font-size: 12px; color: #555; }
.pdfv-reader-from { width: 4.5em; }
.pdfv-ro-mark .pdfv-ro-num.pdfv-ro-start, .pdfv-ro-rect .pdfv-ro-num.pdfv-ro-start { pointer-events: auto; cursor: pointer; }
.pdfv-ro-num.pdfv-ro-start:hover { outline: 2px solid #f59e0b; }
#btn-reader-play.pdfv-reading { background: #fde68a; }
/* 直せる四角の番号の丸は、左上の大きさを変える印と重ならないよう、左の辺の外に出す */
.pdfv-ro-edit > .pdfv-ro-num { left: -12px; top: 16px; }

/* 読み上げ: 上の帯の「🔊 読む ▾」(押すと読む・▾ でメニュー) */
.pdfv-split { position: relative; display: inline-flex; align-items: stretch; }
.pdfv-split .pdfv-split-main { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.pdfv-split .pdfv-split-arrow { border-top-left-radius: 0; border-bottom-left-radius: 0; padding-left: 6px; padding-right: 6px; margin-left: 1px; }
.pdfv-split-menu {
    position: absolute; top: 100%; left: 0; z-index: 1000; margin-top: 2px; min-width: 220px;
    display: flex; flex-direction: column; padding: 4px; background: #fff; color: #222;
    border: 1px solid #c8c8c8; border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.pdfv-split-menu[hidden] { display: none; }
.pdfv-split-menu button { white-space: nowrap; text-align: left; padding: 6px 10px; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; border-radius: 4px; }
.pdfv-split-menu button:hover:not(:disabled) { background: #eef4fb; }
.pdfv-split-menu button:disabled { color: #aaa; cursor: default; }
.pdfv-split-sep { height: 1px; margin: 4px 2px; background: #ddd; }
/* 読み方(1つずつ) */
.pdfv-reader-readings { list-style: none; margin: 6px 0; padding: 0; max-height: 200px; overflow: auto; }
.pdfv-reader-readings li { display: flex; align-items: center; gap: 4px; padding: 2px 0; font-size: 12px; }
.pdfv-reader-readings .rd-text { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pdfv-reader-readings .rd-scope { font-size: 11px; color: #666; border: 1px solid #ccc; border-radius: 8px; padding: 0 5px; }
.pdfv-reader-readings button { padding: 0 6px; min-width: 0; }
.pdfv-reading-modal label { display: flex; flex-direction: column; gap: 3px; }
.pdfv-reading-modal input[type=text] { min-width: 320px; }
.pdfv-reading-scope { border: 1px solid #ddd; border-radius: 6px; display: flex; gap: 14px; }
.pdfv-reading-scope label { flex-direction: row; align-items: center; }
.pdfv-reading-context { font-size: 12px; color: #555; max-width: 420px; }
.pdfv-reading-msg { font-size: 12px; color: #0b6bcb; min-height: 1em; }
