/* EPUB to PDF Converter — component styles layered on the shared ICT Tools design system (../styles.css) */
[hidden] { display: none !important; }
input[type=file] { display: none; }

/* Drop zone (same look as the other upload tools) */
.drop {
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    padding: 30px 18px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.drop.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { width: 36px; height: 36px; margin: 0 auto 12px; color: var(--accent); display: block; }
.drop-title { font-weight: 600; font-size: 1rem; margin-bottom: 6px; color: var(--text-primary); }
.drop-hint { color: var(--text-secondary); font-size: 0.8rem; line-height: 1.6; }
.drop-hint b { color: var(--text-primary); font-weight: 600; }
.drop:focus-visible, .ep-actions .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ep-msg { font-size: 0.82rem; min-height: 1.3em; margin-top: 12px; color: var(--text-secondary); }
.ep-msg:empty { display: none; }
.ep-msg.is-error { color: #ef6b6b; }

/* Loaded book */
.ep-book { display: flex; align-items: center; gap: 14px; }
.ep-cover {
    width: 58px; height: 80px; flex: none; border-radius: 6px; overflow: hidden;
    background: linear-gradient(135deg, #ffb48a 0%, #d1572f 100%);
    color: #fff; font-size: 1.3rem;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border);
}
.ep-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-book-text { flex: 1; min-width: 0; }
.ep-book-title { font-weight: 700; font-size: 1rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ep-book-author { color: var(--text-secondary); font-size: 0.85rem; margin-top: 3px; }
.ep-book-facts { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; margin-top: 6px; }

/* Options */
.ep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.ep-field { display: flex; flex-direction: column; gap: 6px; }
.ep-field label { font-family: 'JetBrains Mono', monospace; font-size: 0.66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.ep-field .select { width: 100%; }

.ep-chapters { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-input); margin-bottom: 18px; }
.ep-chapters summary { cursor: pointer; padding: 12px 14px; font-size: 0.85rem; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.ep-chapters summary::-webkit-details-marker { display: none; }
.ep-chapters summary::before { content: '\25B8'; color: var(--accent); transition: transform .15s ease; }
.ep-chapters[open] summary::before { transform: rotate(90deg); }
.ep-ch-tools { display: flex; gap: 8px; padding: 0 14px 10px; }
.ep-ch-list { max-height: 300px; overflow: auto; border-top: 1px solid var(--border); }
.ep-ch { display: flex; align-items: baseline; gap: 10px; padding: 9px 14px; cursor: pointer; font-size: 0.84rem; border-bottom: 1px solid var(--border); }
.ep-ch:last-child { border-bottom: 0; }
.ep-ch:hover { background: var(--accent-soft); }
.ep-ch input { accent-color: var(--accent); flex: none; transform: translateY(2px); }
.ep-ch-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-ch small { color: var(--text-muted); font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Actions + progress */
.ep-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ep-go { padding: 12px 20px; font-size: 0.9rem; }
.ep-actions .btn:disabled { opacity: .45; cursor: not-allowed; }
.ep-actions .btn:disabled:hover { border-color: var(--border); color: var(--text-primary); }
.ep-actions .btn-primary:disabled:hover { background: var(--accent); border-color: var(--accent); color: #0b120e; }

.ep-prog { margin-top: 16px; }
.ep-track { height: 8px; border-radius: 99px; background: var(--bg-input); border: 1px solid var(--border); overflow: hidden; }
.ep-bar { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .2s ease; }
.ep-prog-text { margin-top: 8px; font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; color: var(--text-secondary); word-break: break-word; }

.ep-done { margin-top: 16px; display: flex; gap: 12px; align-items: flex-start; font-size: 0.85rem; line-height: 1.55; }
.ep-done > i { color: var(--accent); font-size: 1.2rem; margin-top: 2px; }
.ep-done span { display: block; color: var(--text-secondary); font-size: 0.78rem; }
.ep-done a { color: var(--accent); font-weight: 600; font-size: 0.8rem; }

.ep-about { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.7; margin-bottom: 10px; }
.ep-about strong { color: var(--text-primary); }

@media (max-width: 680px) {
    .ep-book { flex-wrap: wrap; }
    .ep-book .btn { margin-left: auto; }
    .ep-actions .btn { flex: 1 1 100%; justify-content: center; }
    .ep-ch small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ep-bar, .ep-chapters summary::before, .drop { transition: none !important; }
}
