@font-face{font-family:'Logs-Symbols';src:url('/base-tools/css/Symbols.woff2') format('woff2');font-weight:400;font-style:normal;font-display:swap;}
*,*::before,*::after{box-sizing:border-box}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;line-height:1.6;margin:20px;background-color:#f4f4f4;color:#333}
.container{max-width:860px;margin:auto;background:white;padding:20px 20px 30px;border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,.1)}
h1{text-align:center;color:#2c3e50}
.form-row{margin-bottom:15px}
label{display:inline-block;margin-bottom:5px;font-weight:bold;color:#555}
.btn{display:flex;justify-content:center;align-items:center;padding:10px 15px;border:1px solid #ccc;border-radius:4px;font-weight:bold;cursor:pointer;user-select:none;transition:background-color .2s,border-color .2s,color .2s;background-color:#f0f0f0;color:#555}
.option-button{flex:0 1 calc(20% - 8px);padding:5px 10px;flex-direction:column;height:48px;margin-bottom:0}
.radio-input:checked+.option-button{background-color:#28a745;color:white;border-color:#218838}
#font-choice-custom:checked+#custom-font-label{background-color:#e67e22;border-color:#c86e1a}
.custom-toggle-button{width:100%}
.custom-toggle-button.active{background-color:#6f42c1;color:white;border-color:#5a32a3}
#alignment-toggle-button{background-color:#17a2b8;color:white;border-color:#117a8b}
#pua-toggle-button.active{background-color:#a52a2a;color:white;border-color:#8B2323}
#content-protection-toggle-button.active{background-color:#222;color:white;border-color:#000}
#font-weight-button,#line-height-button,#paragraph-spacing-button,#page-margin-button{background-color:#786a74;color:white;border-color:#425424}
#font-weight-button.is-inactive,#pua-toggle-button.is-inactive,#content-protection-toggle-button.is-inactive{background-color:#f0f0f0;color:#888;border-color:#ccc;cursor:not-allowed;pointer-events:none}
#font-weight-button.is-inactive .weight-controls-panel{display:none!important}
button.btn[type=submit]{width:100%;background-color:#007bff;color:white;padding:12px 15px;font-size:16px;border:none}
button.btn[type=submit]:hover:not(:disabled){background-color:#0056b3}
button.btn[type=submit]:disabled{background-color:#ccc;cursor:not-allowed}
button.btn[type=submit].is-confirm-state{background-color:#e67e22}
button.btn[type=submit].is-confirm-state:hover:not(:disabled){background-color:#c86e1a}
.hidden-file-input,.radio-input{display:none}
.options-container{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-start}
.small-text{font-size:.8em;font-weight:normal;display:block;line-height:1.3}
.reselect-hint{color:#eee;margin-top:2px;opacity:.8}
#logs-container{margin-top:25px}
h3{border-bottom:2px solid #eee;padding-bottom:5px}
#logs{background-color:#222;color:#eee;padding:15px;border-radius:4px;height:400px;overflow-y:scroll;white-space:pre-wrap;font-family:'Logs-Symbols','Menlo','Monaco','Consolas',"Courier New",monospace;line-height:1.5;font-size:.85em}
#result a{display:flex;justify-content:center;align-items:center;width:100%;margin-top:20px;background-color:#28a745;color:white;padding:12px 15px;text-decoration:none;border-radius:4px;font-size:16px;font-weight:bold;transition:background-color .3s}
#result a:hover{background-color:#218838}
#result a.is-disabled{background-color:#ccc;cursor:not-allowed;pointer-events:none}
#drop-zone{border:2px dashed #ccc;padding:20px;text-align:center;transition:background-color .2s,border-color .2s;border-radius:8px}
#drop-zone p{margin:5px 0}
#drop-zone label{cursor:pointer;color:#007bff;font-weight:bold}
#file-info{font-weight:bold;color:#555;min-height:1.2em}
#file-info.file-selected{color:#28a745}
#file-info.file-error{color:#e74c3c}
.upload-notes{margin:15px auto 5px;padding:8px 15px;background-color:#f8f9fa;border-left:4px solid #6c757d;border-radius:4px;text-align:left;max-width:90%}
.upload-notes ul{margin:0;padding-left:18px;list-style-position:outside}
.upload-notes li{font-size:.85em;color:#495057;line-height:1.5}
.upload-notes code{background-color:#e9ecef;padding:2px 4px;border-radius:3px;font-size:.95em}
#status-bar{background-color:#e9ecef;padding:8px 15px;border-radius:5px;margin-bottom:20px;text-align:center;font-size:.9em;color:#495057}
#logviewer-stats-widget{text-align:center;margin-top:30px;padding-top:15px;border-top:1px solid #eee;font-size:.9em;color:#6c757d}
#format-guide{border:1px solid #e0e0e0;border-radius:6px;margin-bottom:20px;background-color:#f9f9f9}
#format-guide summary{cursor:pointer;padding:12px 15px;font-weight:bold;color:#0056b3;outline:none}
#format-guide summary:hover{background-color:#f0f0f0}
#format-guide .guide-content{padding:0 15px 15px;border-top:1px solid #e0e0e0}
#format-guide table{width:100%;border-collapse:collapse;margin:10px 0;font-size:.95em}
#format-guide th,#format-guide td{border:1px solid #ddd;padding:8px 10px;text-align:left;vertical-align:top}
#format-guide th{background-color:#f2f2f2}
#format-guide code{background-color:#eef;padding:2px 5px;border-radius:3px;font-family:'Menlo','Monaco','Consolas',monospace}
#format-guide ul{padding-left:20px;font-size:.95em}
#format-guide .important-note{color:#c0392b;font-weight:bold}
#format-guide .general-note{margin-top:15px;padding:10px;background-color:#e9f5ff;border-left:4px solid #007bff;font-size:.95em}
.drop-area.drag-over{border-color:#007bff;background-color:#e9f5ff}
#custom-font-label #font-label-selected{display:none}
#custom-font-label .font-label-state{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%}
#custom-font-label .upload-hint{display:none}
#font-choice-custom:checked+#custom-font-label .upload-hint{display:block}
#custom-font-label.file-selected #font-label-default{display:none}
#custom-font-label.file-selected #font-label-selected{display:flex}
#custom-font-label.file-error{border-color:#e74c3c!important}
#custom-font-label.file-error #font-label-default{display:none}
#custom-font-label.file-error #font-label-selected{display:flex}
#custom-font-label.file-error #custom-font-info{color:#e74c3c;font-weight:bold}
#custom-font-label.file-error .reselect-hint{display:none}
#font-choice-custom:checked+#custom-font-label.file-selected #custom-font-info{color:white}
#font-choice-custom:checked+#custom-font-label.file-selected .reselect-hint{color:#eee}
.slider-selector-container{display:flex;position:relative}
.font-weight-label-container{display:flex;flex-direction:row;justify-content:center;align-items:baseline;gap:.5em;width:100%}
.weight-controls-panel{display:none;position:absolute;bottom:100%;left:0;width:100%;background:#fff;border:1px solid #ddd;border-radius:8px;padding:8px;box-shadow:0 -4px 12px rgba(0,0,0,.1);z-index:10;margin-bottom:5px;flex-direction:column;gap:8px;cursor:default}
.weight-controls-panel.is-open{display:flex}
.weight-info-text{font-size:.7rem;color:#6c757d;text-align:center;padding-bottom:4px;border-bottom:1px solid #eee;margin-bottom:4px}
.weight-preset-buttons{display:flex;gap:5px;justify-content:center}
.weight-preset-buttons button.btn{flex:none;padding:4px 10px;font-size:.75rem;color:#333;background:#f0f0f0;border:1px solid #ccc;border-radius:4px}
.weight-preset-buttons button.btn:hover{background-color:#e0e0e0}
input[type=range][id$=-slider]{width:100%;margin:0;transition:opacity .2s}
input[type=range][id$=-slider].is-default-state{opacity:.5;pointer-events:none}
.custom-toggle-button:focus-visible,.weight-preset-buttons button:focus-visible,input[type=range][id$=-slider]:focus-visible{outline:2px solid #007bff;outline-offset:2px}
.weight-slider-row{padding:8px 0}
.text-error{color:#e74c3c;font-weight:bold}
.text-warning{color:#ffcc00;font-weight:bold}
.text-info-light{color:#ff5555;font-weight:bold}
#txt-options-panel{border:1px solid #e0e0e0;border-radius:6px;padding:15px;background-color:#f9f9f9;display:none;grid-template-columns:1fr 1fr;gap:12px}
.left-panel-group{display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:center}
.form-grid-label{grid-column:1;margin-bottom:0;font-weight:bold;text-align:right}
.form-grid-label.align-start{align-self:start;padding-top:8px}
.txt-panel-field{grid-column:2}
.txt-input-field{padding:8px;border:1px solid #ccc;border-radius:4px;font-size:1em;width:100%;background-color:#fff}
#book-publication-date-input.invalid{border-color:red!important}
.cover-drop-zone{border:1px solid #ccc;border-radius:4px;padding:0 12px;text-align:left;cursor:pointer;transition:background-color .2s,border-color .2s;background-color:#f8f8f8;height:38px;line-height:36px;overflow:hidden}
.cover-drop-zone label{flex:1;cursor:pointer;overflow:hidden;min-width:0;font-weight:normal}
.cover-drop-zone span{font-size:1em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#cover-prompt-initial{color:#888}
#cover-prompt-selected{display:none;font-weight:bold;color:#28a745}
#cover-prompt-selected.file-error{color:#e74c3c}
.description-card{display:flex;flex-direction:column;border:1px solid #ccc;border-radius:4px;height:100%;overflow:hidden}
.description-header{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;border-bottom:1px solid #eee}
.description-title{font-weight:bold;color:#555}
#description-char-counter{font-size:.8em;color:#888}
#description-input{flex-grow:1;border:none;padding:8px 12px;font-size:.85em;line-height:1.5;resize:none;background-color:#fff;outline:none;border-bottom-left-radius:4px;border-bottom-right-radius:4px}
.functional-buttons-row{display:flex;gap:10px;flex-wrap:wrap}
.functional-button-item{flex:1 1 20%}
@media (max-width:800px){
#txt-options-panel{grid-template-columns:1fr;gap:15px}
.description-card{min-height:180px}
}
@media (max-width:600px){
.option-button{flex:0 1 calc(50% - 5px)}
.functional-button-item{flex-basis:calc(50% - 5px)}
}