/* ---------- The Authors Digest ---------- */
:root { --td-ink: #1f2a44; --td-accent: #1b6ec2; --td-muted: #6b7280; --td-line: #e5e7eb; --td-soft: #f7f7f9; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.empty-state { text-align: center; padding: 3rem 1rem; border: 2px dashed var(--td-line); border-radius: 1rem; }
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1.25rem; }
.book-card { display: flex; flex-direction: column; border: 1px solid var(--td-line); border-radius: .75rem; overflow: hidden; text-decoration: none; color: inherit; background: #fff; transition: box-shadow .15s; }
.book-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.book-thumb { aspect-ratio: 2 / 3; background: linear-gradient(160deg, #1f2a44, #3a4a6b); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.book-thumb img { width: 100%; height: 100%; object-fit: cover; }
.book-thumb-title { color: #fff; font-family: Georgia, serif; font-size: 1.2rem; text-align: center; padding: 1rem; }
.book-card-body { display: flex; flex-direction: column; gap: .25rem; padding: .75rem; }
.book-card-body .badge { align-self: flex-start; }
.book-card-link { display: flex; flex-direction: column; flex: 1; text-decoration: none; color: inherit; }
.book-card-next { display: block; padding: .5rem .75rem; border-top: 1px solid var(--td-line); font-size: .85rem; text-decoration: none; }
a.book-card-next:hover { background: var(--td-soft); }
.new-book-card { max-width: 44rem; }

.book-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1rem; }
.toc-list { padding-left: 1.2rem; margin: 0; max-height: 70vh; overflow: auto; }
.toc-list li { margin-bottom: .45rem; }
.toc-list li span { margin-right: .35rem; }
.toc-list li.excluded { opacity: .55; }
.toc-kind { display: inline-block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--td-muted); min-width: 4.5rem; }
.review-item { border-top: 1px solid var(--td-line); padding: .75rem 0; }
.review-text { font-family: Georgia, serif; margin-bottom: .25rem; }
.structure-list { max-height: 65vh; overflow: auto; border: 1px solid var(--td-line); border-radius: .5rem; }
.structure-row { display: grid; grid-template-columns: 1fr 10rem 12rem; gap: .5rem; align-items: center; padding: .4rem .6rem; border-bottom: 1px solid var(--td-line); min-height: 58px; }
.structure-row.section-start { background: #eef5ff; }
.structure-row.needs-review { box-shadow: inset 4px 0 0 #f0ad4e; }
.structure-text { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 700px) { .structure-row { grid-template-columns: 1fr; } }

.suggestion { border-top: 1px solid var(--td-line); padding: 1rem 0; }
.suggestion.accepted, .suggestion.rejected { opacity: .7; }
.sample { margin-top: .5rem; background: var(--td-soft); border-radius: .5rem; padding: .5rem .75rem; font-family: Georgia, serif; font-size: .95rem; }
.sample-label { display: inline-block; width: 3.5rem; font-family: system-ui, sans-serif; font-size: .75rem; color: var(--td-muted); text-transform: uppercase; }
.version-list li { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--td-line); padding: .25rem 0; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .75rem; }
.theme-card { display: flex; flex-direction: column; gap: .25rem; text-align: left; border: 2px solid var(--td-line); border-radius: .75rem; background: #fff; padding: .75rem; }
.theme-card.selected { border-color: var(--td-accent); box-shadow: 0 0 0 3px rgba(27,110,194,.15); }
.theme-sample { font-size: 1.2rem; display: block; letter-spacing: .05em; }
.theme-ornament { display: block; text-align: center; }
.ornament-tools, .chapter-image-tools { min-width: 0; }
.chapter-image-thumb { display: block; max-width: 100%; max-height: 7rem; border: 1px solid var(--td-line); border-radius: .3rem; background: #fff; }
.ornament-current { background: #fff; border: 1px solid var(--td-line); border-radius: .4rem; padding: .4rem; text-align: center; margin-bottom: .25rem; }
.ornament-current img { height: 2rem; max-width: 100%; }
.ornament-draw { border: 1px solid var(--td-line); border-radius: .5rem; padding: .6rem; background: var(--td-soft, #f7f7f4); }
.ornament-drafts { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .5rem; }
.ornament-draft { display: flex; flex-direction: column; align-items: center; gap: .3rem; background: #fff; border: 1px solid var(--td-line); border-radius: .4rem; padding: .5rem; text-align: center; }
.ornament-draft img { height: 2.4rem; max-width: 100%; }
.ornament-chip { display: inline-flex; align-items: center; gap: .25rem; margin: .15rem .4rem .15rem 0; }
.ornament-chip img { height: 1rem; }
.series-cover-sources { display: flex; flex-wrap: wrap; gap: .6rem; }
.series-cover-source { display: flex; flex-direction: column; align-items: center; gap: .3rem; width: 7.5rem; padding: .4rem; background: #fff; border: 2px solid var(--td-line); border-radius: .4rem; text-align: center; }
.series-cover-source.selected { border-color: var(--td-accent); box-shadow: 0 0 0 3px rgba(27,110,194,.15); }
.series-cover-source img { width: 100%; height: auto; border-radius: 2px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.series-cover-source__blank { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 2 / 3; background: var(--td-soft, #f1f1ec); font-size: .75rem; color: var(--td-muted); }
.cover-test__side { flex: 1 1 0; max-width: 9rem; display: flex; flex-direction: column; gap: .25rem; padding: .3rem; border-radius: .35rem; border: 2px solid transparent; }
.cover-test__side.winning { border-color: var(--td-accent); }
.cover-test__side img { width: 100%; height: auto; border-radius: 2px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.plan-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .9rem; }
.plan-card { display: flex; flex-direction: column; gap: .4rem; background: #fff; border: 1px solid var(--td-line); border-left: 5px solid var(--td-line); border-radius: .5rem; padding: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.plan-card[draggable="true"] { cursor: grab; }
.plan-card.dragging { opacity: .45; }
.plan-card.drop-target { outline: 2px dashed var(--td-accent); outline-offset: 2px; }
.plan-synopsis { resize: vertical; font-size: .85rem; }
.plan-swatch { width: 1.05rem; height: 1.05rem; border-radius: 50%; border: 2px solid transparent; padding: 0; }
.plan-swatch.on { border-color: #222; box-shadow: 0 0 0 2px #fff inset; }
.plan-swatch-red, .plan-color-red { --plan: #d9534f; } .plan-swatch-orange, .plan-color-orange { --plan: #e8893a; } .plan-swatch-yellow, .plan-color-yellow { --plan: #e6c229; }
.plan-swatch-green, .plan-color-green { --plan: #4caf6a; } .plan-swatch-blue, .plan-color-blue { --plan: #3b82c4; } .plan-swatch-purple, .plan-color-purple { --plan: #8a5cc2; }
.plan-swatch { background: var(--plan); }
.plan-card[class*="plan-color-"], .plan-outline li[class*="plan-color-"] { border-left-color: var(--plan); }
.plan-outline { padding-left: 1.4rem; }
.plan-outline li { border-left: 4px solid transparent; padding: .35rem .6rem; margin-bottom: .35rem; background: #fff; border-radius: .3rem; }
.plan-status { padding: .05rem .5rem; border-radius: 1rem; background: var(--td-soft, #eef0ea); }
.format-proposal { border-left: 3px solid var(--td-accent); padding: .25rem 0 .25rem .75rem; }
.compare-panes { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center; }
.compare-pane { flex: 1 1 22rem; min-width: 0; max-width: 38rem; display: flex; flex-direction: column; }
.compare-pane .device { margin: 0; }
.compare-head { min-height: 2.25rem; }
.compare-print { width: 100%; height: auto; border: 1px solid var(--td-line); box-shadow: 0 4px 16px rgba(0,0,0,.1); background: #fff; }
.font-sample { display: flex; flex-direction: column; gap: .15rem; padding: .5rem .75rem; border: 1px solid var(--td-line); border-radius: .5rem; background: #fff; }
.font-sample span:first-child { font-size: 1.25rem; letter-spacing: .04em; }
.font-sample span:last-child { font-size: .95rem; line-height: 1.5; }
.theme-card .badge { align-self: flex-start; }
.preview-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: .75rem; }
.preview-controls .form-select { width: auto; max-width: 14rem; }
.device { margin: 0 auto; border-radius: 1.6rem; background: #222; padding: 1.4rem 1rem 2.2rem; box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: 100%; }
.device iframe { width: 100%; height: 100%; border: 0; border-radius: .25rem; background: #fff; }
.device-kindle { width: 26rem; height: 34rem; background: #3a3a3a; }
.device-kindle iframe { filter: grayscale(1) contrast(1.05); background: #f4f4f0; }
.device-phone { width: 22rem; height: 42rem; border-radius: 2.4rem; }
.device-tablet { width: 36rem; height: 46rem; }

.cover-thumb { aspect-ratio: 2 / 3; border-radius: .5rem; overflow: hidden; background: var(--td-soft); border: 1px solid var(--td-line); display: flex; align-items: center; justify-content: center; }
.cover-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cover-path { border: 1px solid var(--td-line); border-radius: .5rem; padding: .9rem; display: flex; flex-direction: column; align-items: flex-start; }
.cover-path p { flex: 1; }
.cover-placeholder { color: var(--td-muted); }
.spec-list { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin-bottom: .75rem; }
.spec-list dt { font-weight: 500; } .spec-list dd { margin: 0; }
.checks { list-style: none; padding: 0; margin: 0; }
.check { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--td-line); }
.check-icon { flex: 0 0 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: .85rem; }
.check-pass .check-icon { background: #198754; } .check-info .check-icon { background: #0d6efd; }
.check-warning .check-icon { background: #e0a100; } .check-fail .check-icon { background: #dc3545; }

/* ---------- Cover editor ---------- */
/* Full-screen tools (cover editor, writer) fill the window below the site header instead of the page column. */
.content:has(> .cover-editor), .content:has(> .writer) { max-width: none; padding: 0; }
.cover-editor { display: flex; flex-direction: column; height: calc(100vh - 73px); background: #eceef2; }
.ce-toolbar { display: flex; align-items: center; gap: .4rem; padding: .4rem .75rem; background: #fff; border-bottom: 1px solid var(--td-line); flex-wrap: wrap; }
.ce-sep { width: 1px; height: 1.4rem; background: var(--td-line); margin: 0 .25rem; }
.ce-spacer { flex: 1; }
.ce-zoom { min-width: 3rem; text-align: center; font-size: .85rem; }
.ce-toolbar .dropdown { position: relative; }
.ce-menu { position: absolute; right: 0; top: 110%; background: #fff; border: 1px solid var(--td-line); border-radius: .5rem; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 20; min-width: 17rem; padding: .25rem; }
.ce-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .45rem .6rem; border-radius: .35rem; }
.ce-menu button:hover { background: var(--td-soft); }
.ce-menu-h { display: block; padding: .45rem .6rem .1rem; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--bs-secondary-color, #6c757d); }
.ce-body { flex: 1; display: grid; grid-template-columns: 17rem 1fr 18rem; min-height: 0; }
.ce-left, .ce-right { background: #fff; overflow-y: auto; padding: .75rem; }
.ce-left { border-right: 1px solid var(--td-line); }
.ce-right { border-left: 1px solid var(--td-line); }
.ce-tabs { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .75rem; }
.ce-tabs button { border: 1px solid var(--td-line); background: #fff; border-radius: 999px; padding: .2rem .65rem; font-size: .8rem; }
.ce-tabs button.active { background: var(--td-ink); color: #fff; border-color: var(--td-ink); }
.ce-h { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--td-muted); margin: .75rem 0 .4rem; }
.ce-stage { overflow: auto; display: flex; align-items: flex-start; justify-content: center; padding: 20px; }
.ce-canvas-wrap { box-shadow: 0 6px 30px rgba(0,0,0,.18); margin: auto; }
.ce-template-list { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ce-template { aspect-ratio: 2 / 3; border: 0; border-radius: .4rem; display: flex; align-items: center; justify-content: center; padding: .4rem; font-size: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.ce-my-template { position: relative; }
.ce-my-template .ce-template { width: 100%; padding: 0; overflow: hidden; background: #eee center / cover no-repeat; align-items: flex-end; }
.ce-my-template .ce-template span { width: 100%; background: rgba(0,0,0,.6); color: #fff; font-size: .75rem; padding: .2rem .3rem; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ce-my-template .ce-remove { position: absolute; top: .2rem; right: .2rem; border: 0; border-radius: 50%; width: 1.4rem; height: 1.4rem; line-height: 1; background: rgba(255,255,255,.9); font-size: .8rem; }
.ce-fonts { list-style: none; padding: 0; margin: 0 0 .5rem; }
.ce-fonts li { display: flex; align-items: center; gap: .4rem; padding: .25rem 0; border-bottom: 1px solid var(--td-line); }
.ce-fonts .ce-font-name { flex: 1; min-width: 0; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ce-fonts .ce-font-faces { font-size: .7rem; color: var(--bs-secondary-color, #6c757d); }
.ce-fonts button { border: 0; background: none; padding: .1rem .3rem; font-size: .8rem; }
.ce-versions { list-style: none; padding: 0; margin: .5rem 0 0; max-height: 16rem; overflow: auto; }
.ce-versions li { display: flex; align-items: center; gap: .4rem; padding: .25rem 0; border-bottom: 1px solid var(--td-line); font-size: .8rem; }
.ce-versions img { width: 2rem; height: 3rem; object-fit: cover; border-radius: .15rem; background: #eee; flex: none; }
.ce-versions .ce-version-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ce-versions button { border: 0; background: none; padding: .1rem .3rem; font-size: .8rem; color: var(--bs-link-color, #1b6ec2); }
.ce-add-text { display: block; width: 100%; text-align: left; border: 1px solid var(--td-line); background: var(--td-soft); border-radius: .4rem; padding: .55rem .7rem; margin-bottom: .45rem; }
.ce-add-title { font-size: 1.3rem; font-weight: 700; }
.ce-add-heading { font-size: 1.05rem; font-weight: 600; }
.ce-element-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.ce-element-grid button { display: flex; flex-direction: column; align-items: center; gap: .25rem; border: 1px solid var(--td-line); background: #fff; border-radius: .4rem; padding: .5rem .25rem; font-size: .72rem; }
.ce-element-grid button > span:first-child { font-size: 1.3rem; line-height: 1; display: inline-block; }
.shape-rect { width: 1.6rem; height: 1.1rem; background: #c9a227; }
.shape-circle { width: 1.3rem; height: 1.3rem; background: #c9a227; border-radius: 50%; }
.shape-triangle { width: 0; height: 0; border-left: .7rem solid transparent; border-right: .7rem solid transparent; border-bottom: 1.2rem solid #c9a227; }
.shape-line { width: 1.6rem; height: 3px; background: #333; margin: .55rem 0; }
.shape-fade { width: 1.6rem; height: 1.3rem; background: linear-gradient(transparent, #000); }
.shape-frame { width: 1.2rem; height: 1.6rem; border: 2px solid #c9a227; }
.shape-ribbon { width: 1.6rem; height: .7rem; background: #b3261e; clip-path: polygon(0 0, 100% 0, 88% 50%, 100% 100%, 0 100%, 12% 50%); }
.ce-icon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.ce-icon-grid button { border: 1px solid var(--td-line); background: #fff; border-radius: .4rem; padding: .35rem; color: #2b2b2b; }
.ce-icon-grid svg { width: 100%; height: 1.6rem; display: block; }
.ce-texture-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; }
.ce-texture-grid button { border: 1px solid var(--td-line); border-radius: .4rem; padding: 0; overflow: hidden; background: #fff; font-size: .72rem; }
.ce-texture-grid button span { display: block; height: 2.6rem; background-size: 160px; background-color: #e9dcc4; background-blend-mode: multiply; }
.ce-texture-grid button em { display: block; font-style: normal; padding: .15rem 0; }
.ce-uploads { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.ce-uploads img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: .3rem; cursor: pointer; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 12px 12px; }
.ce-uploads img:hover { outline: 2px solid var(--bs-primary, #1b6ec2); }
.ce-canvas-wrap.ce-drop { outline: 3px dashed var(--bs-primary, #1b6ec2); outline-offset: 4px; }
.ce-concepts { display: flex; flex-direction: column; gap: .6rem; margin-top: .6rem; }
.ce-concept { display: flex; gap: .5rem; align-items: flex-start; }
.ce-concept img { width: 5.5rem; border-radius: .25rem; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.ce-row { display: flex; align-items: center; gap: .35rem; margin-bottom: .45rem; flex-wrap: wrap; font-size: .8rem; }
.ce-row.ce-wrap .btn { font-size: .72rem; }
.ce-row input[type=color] { width: 2rem; height: 1.8rem; padding: 0; border: 1px solid var(--td-line); border-radius: .25rem; }
.ce-num { width: 4.5rem !important; }
.ce-props textarea { margin-bottom: .45rem; }
.ce-props .form-select { flex: 1; min-width: 0; }
.ce-range { display: block; font-size: .75rem; color: var(--td-muted); margin-bottom: .35rem; }
.ce-range input { width: 100%; }
.ce-props .ce-mask { flex: 0 1 9rem; }
.bk-colors { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.bk-color { display: inline-flex; align-items: center; border: 1px solid var(--td-line); border-radius: .35rem; padding: .15rem .1rem .15rem .25rem; }
.bk-color input[type=color] { width: 2.2rem; height: 1.9rem; padding: 0; border: 0; background: none; }
.bk-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .25rem .75rem; }
.bk-font { font-size: .9rem; }
.bk-font.on { font-weight: 600; }
.bk-logo { background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; border: 1px solid var(--td-line); border-radius: .35rem; padding: .75rem; text-align: center; }
.bk-logo img { max-width: 100%; max-height: 10rem; }
.ce-swatches { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; margin-bottom: .45rem; }
.ce-swatches .sw { width: 1.35rem; height: 1.35rem; border-radius: .25rem; border: 1px solid rgba(0,0,0,.25); padding: 0; cursor: pointer; }
.ce-swatches .ce-cmyk { width: 8.5rem; flex: 0 0 auto; }
.ce-swatches .sw-label { font-size: .7rem; color: var(--td-muted); width: 100%; }
.tc-list .tc-item { border-top: 1px solid var(--td-line); padding: .55rem 0; }
.tc-text { font-size: .9rem; overflow-wrap: anywhere; }
.tc-text ins { background: #e3f4e6; color: #145a23; text-decoration: none; border-bottom: 2px solid #3d9a52; padding: 0 .1rem; }
.tc-text del { background: #fbe4e4; color: #8a1f1f; padding: 0 .1rem; }
.ce-props .ce-cut { flex: 0 1 7rem; }
.ce-3d { margin-top: .5rem; }
.ce-3d-stage { perspective: 900px; display: flex; justify-content: center; padding: 1.25rem 0 1rem; overflow: hidden; }
.ce-book3d { position: relative; width: var(--w, 160px); height: var(--h, 240px); transform-style: preserve-3d; transform: rotateY(var(--turn, 28deg)); transition: transform .15s; }
.ce-face { position: absolute; top: 0; height: 100%; backface-visibility: hidden; background: #ddd; }
.ce-face img { display: block; width: 100%; height: 100%; }
.ce-front, .ce-back { left: 0; width: var(--w, 160px); }
.ce-front { transform: translateZ(calc(var(--d, 10px) / 2)); box-shadow: inset 3px 0 6px rgba(0,0,0,.18); }
.ce-back { transform: rotateY(180deg) translateZ(calc(var(--d, 10px) / 2)); }
.ce-spine, .ce-pages { left: calc((var(--w, 160px) - var(--d, 10px)) / 2); width: var(--d, 10px); }
.ce-spine { transform: rotateY(-90deg) translateZ(calc(var(--w, 160px) / 2)); }
.ce-pages { transform: rotateY(90deg) translateZ(calc(var(--w, 160px) / 2)); background: repeating-linear-gradient(90deg, #f6f2e9 0 1px, #e4ded1 1px 2px); }
.ce-shortcuts dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .6rem; margin: .4rem 0 0; }
.ce-shortcuts dt { font-weight: 600; white-space: nowrap; }
.ce-shortcuts dd { margin: 0; }
.dg-paragraph { max-height: 9rem; overflow: auto; }
.dg-preview { width: 100%; border: 1px solid var(--td-line); border-radius: .3rem; background: #fff; }
.dg-thumb { aspect-ratio: 4 / 3; object-fit: contain; background: #fff; border-bottom: 1px solid var(--td-line); }
.ce-looks, .ce-effects { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .55rem; align-items: center; }
.ce-looks .btn, .ce-effects .btn { font-size: .72rem; padding: .15rem .45rem; }
.ce-effects > .small { width: 100%; }
.ce-bg-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: .3rem; }
.ce-bg-swatches .sw { aspect-ratio: 1; width: 100%; border-radius: .3rem; border: 1px solid rgba(0,0,0,.25); padding: 0; cursor: pointer; }
.ce-bg-swatches .sw:hover, .ce-bg-swatches .sw:focus-visible { outline: 2px solid #1b6ec2; outline-offset: 1px; }
.ce-bg-swatches .sw-label { grid-column: 1 / -1; font-size: .7rem; color: var(--td-muted); }
#ce-bg-library img { cursor: pointer; }
.ce-size-backdrop { position: fixed; inset: 0; z-index: 1060; background: rgba(15, 23, 42, .55); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 1rem 1rem; overflow: auto; }
.ce-size-dialog { width: min(44rem, 100%); }
.ce-layers { list-style: none; padding: 0; margin: 0; max-height: 14rem; overflow: auto; border: 1px solid var(--td-line); border-radius: .4rem; }
.ce-layers li { display: flex; align-items: center; border-bottom: 1px solid var(--td-line); }
.ce-layers li.active { background: #e8f0fb; }
.ce-layers button { border: 0; background: none; padding: .3rem .4rem; font-size: .8rem; }
.ce-layer-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ce-checks { list-style: none; padding: 0; margin: 0; font-size: .8rem; }
.ce-check { padding: .3rem 0; border-bottom: 1px solid var(--td-line); }
.ce-check span { display: inline-flex; width: 1.1rem; height: 1.1rem; border-radius: 50%; align-items: center; justify-content: center; color: #fff; font-size: .7rem; font-weight: 700; margin-right: .25rem; }
.ce-pass span { background: #198754; }
.ce-warn span { background: #e0a100; }
.ce-fail span { background: #dc3545; }
.ce-thumbs { display: flex; gap: .6rem; align-items: flex-start; }
.ce-thumbs figure { margin: 0; text-align: center; }
.ce-thumbs img { height: 160px; box-shadow: 0 1px 6px rgba(0,0,0,.25); background: #fff; }
.ce-thumbs figcaption { font-size: .68rem; color: var(--td-muted); }
@media (max-width: 1100px) {
    .ce-body { grid-template-columns: 14rem 1fr; }
    .ce-right { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--td-line); }
    .cover-editor { height: auto; }
    .ce-stage { min-height: 60vh; }
}

/* ---------- Print spread preview ---------- */
.spread { display: flex; justify-content: center; gap: 0; background: #d9dce2; padding: 1.25rem; border-radius: .75rem; }
.spread-page { margin: 0; width: min(46%, 22rem); background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.18); text-align: center; }
.spread-page img { width: 100%; display: block; }
.spread-page figcaption { font-size: .7rem; color: var(--td-muted); background: #d9dce2; padding-top: .25rem; }
.spread-empty { background: transparent; box-shadow: none; }

/* ---------- Publish tab ---------- */
.keyword-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .4rem .6rem; }
.keyword-grid .form-text { margin: 0; font-size: .7rem; }
.publish-steps { padding-left: 1.2rem; margin: 0; }
.publish-steps li { margin-bottom: .55rem; }
.publish-steps li.done strong { color: #198754; }

/* ---------- Proofread tab ---------- */
.proof-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin: .75rem 0; }
.proof-list { list-style: none; padding: 0; margin: 0; }
.proof-list li { border-top: 1px solid var(--td-line); padding: .7rem 0; }
.proof-context { font-family: Georgia, serif; margin: .3rem 0 .4rem; }
.proof-context del { background: #fde2e1; color: #9b1c1c; text-decoration: line-through; padding: 0 .1em; }
.proof-context ins { background: #dcf5e3; color: #14532d; text-decoration: none; padding: 0 .1em; margin-left: .15em; }
.proof-actions .btn { margin-right: .3rem; }

/* ---------- Image descriptions ---------- */
.alt-list { list-style: none; padding: 0; margin: 0; }
.alt-list li { display: grid; grid-template-columns: 7rem 1fr; gap: .8rem; padding: .7rem 0; border-top: 1px solid var(--td-line); }
.alt-list img { width: 7rem; height: 5.5rem; object-fit: contain; background: var(--td-soft); border-radius: .3rem; }
.alt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .35rem; }

.export-history {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .export-history li {
        padding: 0.55rem 0;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }

.proof-modes {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
    max-width: 26rem;
}

.series-card .table td:first-child input {
    max-width: 5rem;
}

.design-options {
    display: grid;
    grid-template-columns: minmax(8rem, auto) 1fr;
    gap: 0.45rem 0.75rem;
    align-items: center;
}

    .design-options label {
        font-size: 0.875rem;
    }

@media (max-width: 480px) {
    .design-options {
        grid-template-columns: 1fr;
    }
}

.design-proposals {
    display: grid;
    gap: 0.75rem;
}

.design-proposal {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.8rem 0.9rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.375rem;
}

    .design-proposal.applied {
        border-color: var(--bs-success, #198754);
        box-shadow: 0 0 0 1px var(--bs-success, #198754);
    }

    .design-proposal .theme-sample {
        font-size: 1.15rem;
    }
