.book-web { margin: 18px 0; border: 1px solid #a9bab5; border-radius: 16px; background: #f2f7f5; color: #173e37; overflow: hidden; }
.book-web summary { padding: 16px; cursor: pointer; font-weight: 700; }
.book-web-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; padding: 0 16px 12px; }
.book-web-tools label { flex: 1 1 220px; display: grid; gap: 5px; }
.book-web-tools textarea { min-height: 65px; width: 100%; resize: vertical; background: white; color: #173e37; border: 1px solid #78958c; border-radius: 8px; padding: 10px; font: inherit; }
.book-web-tools button { padding: 12px; border-radius: 10px; border: 1px solid #2c6758; background: #215d4e; color: white; cursor: pointer; }
.book-web-tools button:disabled { opacity: .45; cursor: default; }
.book-web-help { margin: 0; padding: 0 16px 12px; font-size: .85rem; }
.book-web-viewport { height: min(52vh, 460px); min-height: 280px; overflow: auto; overscroll-behavior: contain; touch-action: none; cursor: grab; overflow-anchor: none; }
.book-web-space { position: relative; width: 1200px; height: 800px; overflow: hidden; }
.book-web-canvas { transform-origin: top left; }
.book-web-zoom { display: flex; gap: 6px; padding: 0 16px 12px; flex-wrap: wrap; }
.book-web-zoom button { min-height: 44px; min-width: 44px; border: 1px solid #699587; border-radius: 9px; background: white; color: #153e33; padding: 8px 12px; cursor: pointer; font: inherit; }
.book-web-zoom button:disabled { opacity: .4; cursor: default; }
.book-web-canvas { width: 1200px; height: 800px; position: relative; background: radial-gradient(#bdcec6 1px, transparent 1px) 0 0 / 22px 22px; }
.book-web-canvas svg { position: absolute; inset: 0; width: 1200px; height: 800px; pointer-events: none; }
.book-web-canvas line { stroke: #789b90; stroke-width: 3; }
.book-web-bubble { position: absolute; width: 180px; height: 90px; padding: 9px 12px; border-radius: 45px; border: 2px solid var(--bubble-border, #699587); background: var(--bubble-fill, #fff); color: #203044; font: inherit; overflow: auto; overflow-wrap: anywhere; touch-action: none; cursor: grab; white-space: pre-wrap; }
.book-web-bubble::before { content: attr(data-layer-label); display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 3px; }
.book-web-bubble[aria-pressed="true"] { box-shadow: 0 0 0 4px #20304455; border-width: 3px; }
.book-web-bubble.is-complete { background: #e4e7e6; border-color: #7d8983; color: #46534d; }
.book-web-bubble.is-complete .book-web-bubble-text { text-decoration: line-through; text-decoration-thickness: 2px; }
.book-web-bubble.is-complete::after { content: '✓'; position: absolute; top: 7px; right: 18px; color: #176a39; font-size: 21px; font-weight: 900; text-decoration: none; }
.book-web-legend { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 12px; color: #203044; }
.book-web-legend span { border: 1px solid; border-radius: 20px; padding: 4px 9px; font-size: .75rem; font-weight: 700; }
.book-web-bubble:focus-visible { outline: 3px solid #6947b9; outline-offset: 3px; }
.book-editor-area { min-width: 0; grid-template-rows: auto auto auto minmax(350px, 1fr) auto; }
.book-web { grid-row: 2; min-width: 0; }
.book-editor-area .book-page-figure { grid-row: 3; }
.book-editor-area .book-page-spread { grid-row: 4; }
.book-editor-area > footer { grid-row: 5; }
#book-save-status { padding: 8px 20px; color: var(--muted); font-size: .8rem; }
.book-web-confirm { margin: auto; width: min(420px, calc(100vw - 32px)); max-height: 80dvh; overflow: auto; border: 1px solid #78958c; border-radius: 18px; padding: 24px; color: #203044; background: #f2f7f5; box-shadow: 0 20px 80px #0005; }
.book-web-confirm::backdrop { background: #13251e88; }
.book-web-confirm h3 { margin: 0 0 12px; }
.book-web-confirm p { overflow-wrap: anywhere; }
.book-web-confirm > div { display: flex; justify-content: flex-end; gap: 10px; }
.book-web-confirm button { min-height: 44px; padding: 10px 16px; border: 1px solid #78958c; border-radius: 9px; background: white; color: #203044; cursor: pointer; font: inherit; }
.book-web-confirm [data-web-confirm-delete] { background: #9b2439; border-color: #9b2439; color: white; }
