.field-label{display:block;font-size:.875rem;font-weight:500;margin-bottom:.4rem}.hint{font-size:.8rem;color:#6f6862;color:var(--text-muted);margin:.3rem 0 0}.key-input{font-family:"SF Mono","Fira Code","Cascadia Code",ui-monospace,monospace;font-size:2.25rem;text-align:center;letter-spacing:.3em;text-transform:uppercase;max-width:260px;padding:.5rem .75rem;width:100%;border:1px solid #e2ddd8;border:1px solid var(--border);border-radius:6px;background:#f5f4f1;background:var(--bg);color:#1c1917;color:var(--text);transition:border-color .12s,box-shadow .12s}.key-input:focus{outline:none;border-color:#2563eb;border-color:var(--accent);box-shadow:0 0 0 4px rgba(37,99,235,.12);box-shadow:0 0 0 4px var(--accent-glow)}.url-input{width:100%;padding:.6rem .85rem;border:1px solid #e2ddd8;border:1px solid var(--border);border-radius:6px;background:#f5f4f1;background:var(--bg);color:#1c1917;color:var(--text);font-size:1rem;font-family:inherit;transition:border-color .12s,box-shadow .12s}.url-input:focus{outline:none;border-color:#2563eb;border-color:var(--accent);box-shadow:0 0 0 4px rgba(37,99,235,.12);box-shadow:0 0 0 4px var(--accent-glow)}.zone{border:2px dashed #e2ddd8;border:2px dashed var(--border);border-radius:10px;padding:2rem 1.5rem;text-align:center;cursor:pointer;touch-action:manipulation;transition:border-color .12s,background .12s;user-select:none}@supports selector(:has(*)){.zone:has(.zone-pick:focus-visible){outline:2px solid #2563eb;outline:2px solid var(--accent);outline-offset:2px}.zone .zone-pick:focus-visible{outline:none}}.zone:hover,.zone.dragging{border-color:#2563eb;border-color:var(--accent);background:rgba(37,99,235,.04);background:var(--accent-subtle)}.zone.has-file{border-color:#86efac;border-color:var(--success-border);background:#f0fdf4;background:var(--success-bg)}.zone.has-file .zone-formats{display:none}.zone:not(.has-file) .zone-clear-btn{display:none}.zone-pick{display:block;width:100%;padding:0;border:none;background:none;color:inherit;font:inherit;cursor:pointer}.zone-icon{display:block;font-size:2rem;opacity:.4;margin-bottom:.4rem}.zone-label{display:block;font-size:.9rem;color:#6f6862;color:var(--text-muted);margin:0}.zone-label strong{color:#2563eb;color:var(--accent)}.zone-formats{font-size:.8rem;color:#6f6862;color:var(--text-muted);margin:.3rem 0 0}.zone-file-info{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;-webkit-align-items:center;align-items:center}.zone-file-info>*+*{margin-top:.25rem}.zone-file-info{margin:0}.zone-file-name{font-weight:500;color:#166534;color:var(--success-text);word-break:break-all}.zone-file-size{font-size:.8rem;color:#166534;color:var(--success-text)}.zone-clear-btn{margin-top:.65rem}.options-grid>*+*{margin-top:.6rem}@supports(display: grid){.options-grid{display:grid;grid-template-columns:1fr 1fr;gap:.6rem}.options-grid>*+*{margin-top:0}@media(max-width: 480px){.options-grid{grid-template-columns:1fr}}}.option-item{display:-webkit-flex;display:flex;-webkit-align-items:flex-start;align-items:flex-start}.option-item>*+*{margin-left:.6rem}.option-item{padding:.7rem .85rem;border:1px solid #e2ddd8;border:1px solid var(--border);border-radius:6px;cursor:pointer;transition:border-color .12s,background .12s}.option-item:has(input:checked){border-color:#2563eb;border-color:var(--accent);background:rgba(37,99,235,.04);background:var(--accent-subtle)}.option-item:has(input:disabled){opacity:.45;cursor:not-allowed}.option-item:has(input:disabled) input{cursor:not-allowed}.option-item input[type=checkbox]{margin-top:.2rem;accent-color:#2563eb;accent-color:var(--accent);width:1rem;height:1rem;-webkit-flex-shrink:0;flex-shrink:0;cursor:pointer}.option-disabled{opacity:.45;cursor:not-allowed}.option-label-row{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-flex-wrap:wrap;flex-wrap:wrap}.option-label-row>*+*{margin-left:.4rem}.option-label{font-size:.875rem;font-weight:500}.option-tag{font-size:.72rem;font-weight:500;letter-spacing:.02em;color:#6f6862;color:var(--text-muted);background:#f5f4f1;background:var(--bg);border-radius:3px;padding:.1em .45em;line-height:1.6;white-space:nowrap}.option-desc{display:block;font-size:.8rem;color:#6f6862;color:var(--text-muted);margin-top:.1rem;line-height:1.4}.btn-secondary{display:inline-block;padding:.35rem .9rem;background:#fff;background:var(--surface);border:1px solid #6f6862;border:1px solid var(--text-muted);border-radius:6px;color:#1c1917;color:var(--text);font-size:.8rem;line-height:1;transition:background .12s}.btn-secondary:hover{background:#f5f4f1;background:var(--bg)}.btn-secondary:active{background:#e2ddd8;background:var(--border)}.btn-primary{display:block;width:100%;padding:.8rem 1.5rem;background:#2563eb;background:var(--button-bg);color:#fff;border:none;border-radius:10px;font-size:1rem;font-weight:500;transition:background .12s;line-height:1}.btn-primary:hover:not(:disabled){background:#1d4ed8;background:var(--button-bg-hover)}.btn-primary:active:not(:disabled){box-shadow:inset 0 2px 4px rgba(0,0,0,.2)}.btn-primary:disabled{opacity:.5;cursor:not-allowed}@keyframes ellipsis{0%{content:""}33%{content:"."}66%{content:".."}100%{content:"..."}}.status-msg{padding:.85rem 1rem;border-radius:6px;font-size:.875rem;margin-top:.85rem;line-height:1.5;white-space:pre-wrap}.status-msg.status-success{background:#f0fdf4;background:var(--success-bg);border:1px solid #86efac;border:1px solid var(--success-border);color:#166534;color:var(--success-text)}.status-msg.status-error{background:#fef2f2;background:var(--error-bg);border:1px solid #fca5a5;border:1px solid var(--error-border);color:#991b1b;color:var(--error-text)}.status-msg.status-info{background:#fff;background:var(--surface);border:1px solid #e2ddd8;border:1px solid var(--border);color:#6f6862;color:var(--text-muted)}.status-msg.is-processing::after{content:"";animation:ellipsis 1.2s step-end infinite}.file-queue{list-style:none;padding:0;margin:.75rem 0 0;display:flex;flex-direction:column;gap:.4rem}.file-queue li{display:flex;align-items:center;gap:.5rem;padding:.5rem .75rem;border-radius:6px;background:#fff;background:var(--surface);border:1px solid #e2ddd8;border:1px solid var(--border)}.fq-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem}.fq-size{font-size:.8rem;color:#6f6862;color:var(--text-muted);white-space:nowrap}.fq-status{font-size:.72rem;padding:.15rem .5rem;border-radius:999px;white-space:nowrap;background:#e2ddd8;background:var(--border);color:#1c1917;color:var(--text)}.fq-status.fq-uploading{background:#fff;background:var(--surface);border:1px solid #e2ddd8;border:1px solid var(--border);color:#1c1917;color:var(--text)}.fq-status.fq-done{background:#f0fdf4;background:var(--success-bg);color:#166534;color:var(--success-text)}.fq-status.fq-error{background:#fef2f2;background:var(--error-bg);color:#991b1b;color:var(--error-text)}.fq-remove{background:none;border:none;padding:.1rem .3rem;font-size:1rem;line-height:1;color:#6f6862;color:var(--text-muted);border-radius:6px}.fq-remove:hover{color:#1c1917;color:var(--text);background:#e2ddd8;background:var(--border)}.progress-wrap{height:4px;background:#e2ddd8;background:var(--border);border-radius:2px;overflow:hidden;margin-top:.7rem}.progress-wrap .progress-fill{height:100%;width:var(--progress, 0%);background:#2563eb;background:var(--accent);border-radius:2px;transition:width .2s ease}details#history.card{margin-top:1rem}details#history[open] .history-summary{margin-bottom:.6rem}details#history[open] .history-chevron::after{transform:rotate(135deg)}.history-summary{display:flex;align-items:center;justify-content:space-between;cursor:pointer;list-style:none;font-size:.72rem;font-weight:600;text-transform:uppercase;letter-spacing:.07em;color:#6f6862;color:var(--text-muted);margin:0;user-select:none}.history-summary::-webkit-details-marker{display:none}.history-summary:hover .history-chevron{background:#e2ddd8;background:var(--border)}.history-summary:active .history-chevron{background:rgba(37,99,235,.04);background:var(--accent-subtle)}.history-chevron{display:inline-flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border-radius:50%;flex-shrink:0;transition:background .12s}.history-chevron::after{content:"";width:.35rem;height:.35rem;border-right:1.5px solid currentColor;border-top:1.5px solid currentColor;transform:rotate(45deg);transition:transform .15s}.history-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.3rem}.history-list li{display:flex;align-items:baseline;gap:.5rem;font-size:.875rem}.history-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.history-time{font-size:.8rem;color:#6f6862;color:var(--text-muted);white-space:nowrap}@keyframes toast-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes toast-out{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(8px)}}#toast-container{position:fixed;bottom:32px;right:32px;display:flex;flex-direction:column;gap:.5rem;z-index:1000;pointer-events:none}.toast{padding:.75rem 1rem;border-radius:6px;font-size:.875rem;max-width:320px;pointer-events:auto;background:#f0fdf4;background:var(--success-bg);border:1px solid #86efac;border:1px solid var(--success-border);color:#166534;color:var(--success-text);box-shadow:0 4px 12px rgba(0,0,0,.12),0 2px 4px rgba(0,0,0,.08);animation:toast-in .2s ease,toast-out .3s ease 2.7s forwards}@keyframes howto-in{from{opacity:0;transform:translateY(8px) scale(0.98)}to{opacity:1;transform:translateY(0) scale(1)}}.howto-dialog{padding:0;border:none;background:rgba(0,0,0,0);max-width:min(480px,100vw - 2rem);width:100%}.howto-dialog::backdrop{background:rgba(0,0,0,.45)}.howto-dialog[open]{animation:howto-in .18s ease-out}.howto-form{position:relative;background:#fff;background:var(--surface);color:#1c1917;color:var(--text);border:1px solid #e2ddd8;border:1px solid var(--border);border-radius:14px;box-shadow:0 1px 3px rgba(0,0,0,.07),0 1px 2px rgba(0,0,0,.04);padding:1.5rem 1.5rem 1.25rem}.howto-form p{font-size:.875rem;color:#6f6862;color:var(--text-muted);line-height:1.65;margin:0 0 .85rem}.howto-title{font-size:1rem;font-weight:600;margin:0 0 .9rem;padding-right:2rem;color:#1c1917;color:var(--text)}.howto-close{position:absolute;top:.6rem;right:.6rem;width:2rem;height:2rem;padding:0;background:rgba(0,0,0,0);border:none;border-radius:6px;color:#6f6862;color:var(--text-muted);display:-webkit-inline-flex;display:inline-flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;transition:background .12s,color .12s}.howto-close svg{width:1.1rem;height:1.1rem;display:block}.howto-close:hover{background:#e2ddd8;background:var(--border);color:#1c1917;color:var(--text)}.howto-got-it{display:block;width:fit-content;margin:.5rem auto 0;font-size:.875rem;padding:.6rem 1.5rem}.zip-dialog{padding:0;border:none;background:rgba(0,0,0,0);max-width:min(540px,100vw - 2rem);width:100%}.zip-dialog::backdrop{background:rgba(0,0,0,.45)}.zip-dialog[open]{animation:howto-in .18s ease-out}.zip-dialog-panel{position:relative;display:flex;flex-direction:column;max-height:min(85vh,640px);background:#fff;background:var(--surface);color:#1c1917;color:var(--text);border:1px solid #e2ddd8;border:1px solid var(--border);border-radius:14px;box-shadow:0 1px 3px rgba(0,0,0,.07),0 1px 2px rgba(0,0,0,.04);padding:1.5rem 1.5rem 1.25rem}.zip-title{font-size:1rem;font-weight:600;margin:0 0 .25rem;padding-right:2rem;color:#1c1917;color:var(--text)}.zip-subtitle{font-size:.8rem;color:#6f6862;color:var(--text-muted);margin:0 0 .85rem;word-break:break-word}.zip-toolbar{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap;margin-bottom:.65rem}.zip-selection-summary{font-size:.8rem;color:#6f6862;color:var(--text-muted)}.zip-limit-warning{padding:.6rem .85rem;border-radius:6px;font-size:.8rem;line-height:1.45;margin-bottom:.65rem;background:#fffbeb;background:var(--warning-bg);border:1px solid #fcd34d;border:1px solid var(--warning-border);color:#92400e;color:var(--warning-text)}.zip-file-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.4rem;overflow-y:auto;min-height:0;flex:1 1 auto}.zip-item{display:flex;align-items:flex-start;gap:.65rem;padding:.6rem .75rem;border-radius:6px;background:#f5f4f1;background:var(--bg);border:1px solid #e2ddd8;border:1px solid var(--border);cursor:pointer;transition:border-color .12s,background .12s}.zip-item:has(input:checked){border-color:#2563eb;border-color:var(--accent);background:rgba(37,99,235,.04);background:var(--accent-subtle)}.zip-item.zip-item-disabled{opacity:.55;cursor:not-allowed}.zip-item.zip-item-disabled input{cursor:not-allowed}.zip-item input[type=checkbox]{margin-top:.2rem;accent-color:#2563eb;accent-color:var(--accent);width:1rem;height:1rem;flex-shrink:0;cursor:pointer}.zip-item-info{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:.15rem}.zip-item-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.875rem;font-weight:500;color:#1c1917;color:var(--text)}.zip-item-folder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.72rem;color:#6f6862;color:var(--text-muted)}.zip-item-reason{font-size:.72rem;color:#991b1b;color:var(--error-text)}.zip-item-meta{display:flex;align-items:center;gap:.4rem;flex-shrink:0;margin-top:.05rem}.zip-item-ext{font-size:.72rem;font-weight:600;letter-spacing:.03em;text-transform:uppercase;padding:.1em .45em;border-radius:3px;background:#fff;background:var(--surface);border:1px solid #e2ddd8;border:1px solid var(--border);color:#6f6862;color:var(--text-muted)}.zip-item-size{font-size:.8rem;color:#6f6862;color:var(--text-muted);white-space:nowrap}.zip-actions{display:flex;align-items:center;justify-content:flex-end;gap:.6rem;margin-top:1rem;padding-top:.85rem;border-top:1px solid #e2ddd8;border-top:1px solid var(--border)}.zip-cancel-btn{padding:.65rem 1.1rem;font-size:.875rem}.zip-confirm-btn{width:auto;padding:.65rem 1.25rem;font-size:.875rem}@media(max-width: 480px){.zip-dialog-panel{padding:1.25rem 1rem 1rem}.zip-actions{flex-direction:column-reverse;align-items:stretch}.zip-cancel-btn,.zip-confirm-btn{width:100%;text-align:center}}.bd-launcher{margin-top:1rem}.bd-launcher-head{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.75rem}.bd-launcher-head .card-title{margin-bottom:0}.bd-launcher-badge{font-size:.72rem;color:#6f6862;color:var(--text-muted);white-space:nowrap}.bd-launcher-form{display:flex;gap:.5rem;align-items:stretch}.bd-launcher-input{flex:1 1 auto;min-width:0;font-size:.875rem;padding:.55rem .8rem}.bd-launcher-btn{flex-shrink:0;padding:.55rem 1rem;font-size:.875rem;font-weight:500}.bd-dialog{padding:0;border:none;background:rgba(0,0,0,0);max-width:min(640px,100vw - 1.5rem);width:100%}.bd-dialog::backdrop{background:rgba(0,0,0,.45)}.bd-dialog[open]{animation:howto-in .18s ease-out}.bd-dialog-panel{position:relative;display:flex;flex-direction:column;height:min(85vh,680px);max-height:min(85vh,680px);background:#fff;background:var(--surface);color:#1c1917;color:var(--text);border:1px solid #e2ddd8;border:1px solid var(--border);border-radius:14px;box-shadow:0 1px 3px rgba(0,0,0,.07),0 1px 2px rgba(0,0,0,.04);padding:1.35rem 1.4rem 1.2rem}.bd-dialog-header{flex-shrink:0;margin-bottom:.85rem;padding-bottom:.75rem;border-bottom:1px solid #e2ddd8;border-bottom:1px solid var(--border)}.bd-title{font-size:1rem;font-weight:600;margin:0 0 .3rem;padding-right:2.2rem;color:#1c1917;color:var(--text)}.bd-status-row{display:flex;align-items:center;justify-content:space-between;gap:.65rem;flex-wrap:wrap}.bd-status-text{font-size:.72rem;color:#6f6862;color:var(--text-muted)}.bd-mini-btn{padding:.3rem .65rem;font-size:.72rem;font-weight:500;line-height:1.25;white-space:nowrap}.bd-mini-btn:disabled{opacity:.55;cursor:not-allowed}.bd-link-btn{text-decoration:none}.bd-link-btn:hover{text-decoration:none}.bd-step{display:flex;flex-direction:column;flex:1 1 auto;min-height:0}.bd-step.hidden{display:none}.bd-search-controls{display:flex;flex-direction:column;gap:.6rem;flex-shrink:0;margin-bottom:.65rem}.bd-search-input,.bd-book-filter{font-size:.875rem;padding:.55rem .8rem}.bd-filter-group{display:inline-flex;gap:.35rem;flex-wrap:wrap}.bd-filter-btn{padding:.3rem .75rem;border-radius:999px;font-size:.8rem;font-weight:500;background:#f5f4f1;background:var(--bg);border:1px solid #e2ddd8;border:1px solid var(--border);color:#6f6862;color:var(--text-muted);transition:border-color .12s,background .12s,color .12s}.bd-filter-btn:hover{color:#1c1917;color:var(--text);border-color:#6f6862;border-color:var(--text-muted)}.bd-filter-btn.is-active{background:rgba(37,99,235,.04);background:var(--accent-subtle);border-color:#2563eb;border-color:var(--accent);color:#2563eb;color:var(--accent)}.bd-meta{font-size:.72rem;color:#6f6862;color:var(--text-muted);margin:0 0 .45rem;flex-shrink:0}.bd-meta:empty{display:none}.bd-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:.45rem;overflow-y:auto;min-height:0;flex:1 1 auto}.bd-empty,.bd-loading{margin:1.5rem 0;text-align:center;font-size:.875rem;color:#6f6862;color:var(--text-muted);line-height:1.5}.bd-topic-item{display:flex;align-items:stretch;gap:.45rem;border-radius:6px;background:#f5f4f1;background:var(--bg);border:1px solid #e2ddd8;border:1px solid var(--border);transition:border-color .12s,background .12s}.bd-topic-item:hover{border-color:#2563eb;border-color:var(--accent)}.bd-topic-main{flex:1 1 auto;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.6rem .75rem;background:rgba(0,0,0,0);border:none;color:inherit;text-align:left;border-radius:6px}.bd-topic-main:hover{background:rgba(37,99,235,.04);background:var(--accent-subtle)}.bd-topic-info{display:flex;flex-direction:column;align-items:flex-start;gap:.2rem;min-width:0}.bd-topic-name{font-size:.875rem;font-weight:500;color:#1c1917;color:var(--text);word-break:break-word}.bd-topic-chevron{font-size:1.25rem;line-height:1;color:#6f6862;color:var(--text-muted);flex-shrink:0}.bd-ext-link{display:inline-flex;align-items:center;padding:0 .7rem;font-size:.72rem;font-weight:500;white-space:nowrap;text-decoration:none;flex-shrink:0;border-left:1px solid #e2ddd8;border-left:1px solid var(--border);border-radius:0 6px 6px 0}.bd-ext-link:hover{background:rgba(37,99,235,.04);background:var(--accent-subtle);text-decoration:none}.bd-badge{display:inline-block;font-size:.72rem;font-weight:500;padding:.1em .5em;border-radius:4px;line-height:1.45;background:#fff;background:var(--surface);border:1px solid #e2ddd8;border:1px solid var(--border);color:#6f6862;color:var(--text-muted)}.bd-books-header{flex-shrink:0;margin-bottom:.7rem}.bd-books-nav{display:flex;align-items:center;justify-content:space-between;gap:.5rem;flex-wrap:wrap;margin-bottom:.55rem}.bd-books-actions{display:flex;align-items:center;gap:.4rem}.bd-topic-heading{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap}.bd-topic-title{font-size:1rem;font-weight:600;margin:0;color:#1c1917;color:var(--text);word-break:break-word}.bd-book-filter-wrap{flex-shrink:0;margin-bottom:.6rem}.bd-book-item{display:flex;flex-direction:column;gap:.35rem;padding:.7rem .85rem;border-radius:6px;background:#f5f4f1;background:var(--bg);border:1px solid #e2ddd8;border:1px solid var(--border)}.bd-book-top{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem}.bd-book-title-wrap{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:.3rem}.bd-book-title{font-size:.875rem;font-weight:600;line-height:1.4;color:#1c1917;color:var(--text);word-break:break-word}.bd-formats{display:flex;flex-wrap:wrap;gap:.3rem}.bd-format-chip{font-size:.72rem;font-weight:600;letter-spacing:.03em;padding:.08em .45em;border-radius:3px;background:#fff;background:var(--surface);border:1px solid #e2ddd8;border:1px solid var(--border);color:#2563eb;color:var(--accent)}.bd-post-link{display:inline-flex;align-items:center;flex-shrink:0;padding:.35rem .7rem;border-radius:6px;font-size:.72rem;font-weight:600;white-space:nowrap;text-decoration:none;background:#2563eb;background:var(--button-bg);color:#fff;transition:background .12s}.bd-post-link:hover{background:#1d4ed8;background:var(--button-bg-hover);color:#fff;text-decoration:none}.bd-book-meta{font-size:.72rem;color:#6f6862;color:var(--text-muted)}.bd-subtitles{font-size:.72rem;color:#6f6862;color:var(--text-muted)}.bd-subtitles summary{cursor:pointer;font-weight:500;user-select:none}.bd-subtitles summary:hover{color:#1c1917;color:var(--text)}.bd-subtitles-list{margin:.35rem 0 0;padding-left:1.15rem;display:flex;flex-direction:column;gap:.15rem;line-height:1.45;color:#1c1917;color:var(--text)}@media(max-width: 480px){.bd-dialog-panel{padding:1.1rem .95rem .95rem;height:90vh;max-height:90vh}.bd-book-top{flex-direction:column;gap:.5rem}.bd-post-link{align-self:flex-start}.bd-launcher-form{flex-direction:column}}@media(prefers-reduced-motion: reduce){.howto-dialog[open],.zip-dialog[open],.bd-dialog[open]{animation:none}}
