/* ===== tool-wrapper (base) ===== */
.tool-wrapper.word-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2d3748;
}

/* ===== Upload Area (shared pattern) ===== */
.upload-area {
    display: block; /* .upload-area is a <label for="..."> element (native file-dialog trigger, no JS needed); it defaults to inline without this */
    border: 2px dashed #cbd5e0;
    border-radius: 0.9rem;
    padding: 2.4rem 1.5rem;
    text-align: center;
    cursor: pointer;
    background: #fafbfc;
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 1.5rem;
}
.upload-area:hover, .upload-area.dragover { border-color: #2b579a; background: #eef3fb; }
.upload-icon { font-size: 2.6rem; color: #cbd5e0; margin-bottom: 0.6rem; }
.upload-text { font-weight: 600; font-size: 1.05rem; margin-bottom: 0.3rem; }
.upload-hint { color: #718096; font-size: 0.85rem; margin-bottom: 1rem; }
.upload-btn {
    background: #2b579a; color: #fff; border: none; padding: 0.55rem 1.4rem;
    border-radius: 2rem; font-weight: 600; cursor: pointer; display: inline-flex;
    align-items: center; gap: 0.4rem;
}
.upload-btn:hover { background: #204373; }
.upload-security-note {
    display: flex; align-items: center; justify-content: center; gap: 0.4rem;
    margin-top: 1rem; font-size: 0.78rem; color: #4a5568;
}
.upload-security-note i { color: #2b579a; }

/* ===== Progress / converting state ===== */
.progress-area {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.6rem; padding: 3rem 1.5rem; background: #fafbfc; border: 1px solid #e2e8f0;
    border-radius: 0.9rem; margin-bottom: 1.5rem;
}
.progress-spinner { font-size: 1.8rem; color: #2b579a; }
.progress-text { font-weight: 600; color: #4a5568; }
.progress-bar-track {
    width: 100%; max-width: 360px; height: 8px; border-radius: 999px;
    background: #e2e8f0; overflow: hidden; margin-top: 0.4rem;
}
.progress-bar-fill {
    height: 100%; width: 0%; background: linear-gradient(90deg,#2b579a,#4a7fc9);
    border-radius: 999px; transition: width 0.2s ease;
}

/* ===================================================== */
/* Word App shell                                         */
/* ===================================================== */
.word-app {
    border: 1px solid #d7dde5;
    border-radius: 0.6rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
}

/* ===== Result card ===== */
.word-result-card {
    display: flex; align-items: center; gap: 1rem;
    padding: 1.6rem 1.4rem;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
}
.word-result-icon {
    width: 3.2rem; height: 3.2rem; border-radius: 0.6rem;
    background: #2b579a; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex: 0 0 auto;
}
.word-result-info { min-width: 0; }
.word-result-name {
    font-weight: 700; font-size: 1.05rem; color: #2d3748;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.word-result-meta { color: #718096; font-size: 0.85rem; margin-top: 0.15rem; }

/* ===== Top Toolbar (shared pattern) ===== */
.app-toolbar {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
    background: #f7f8fa;
    padding: 0.5rem 0.7rem;
}
.toolbar-group { display: flex; align-items: center; gap: 0.25rem; }
.toolbar-sep { width: 1px; height: 1.5rem; background: #e2e8f0; margin: 0 0.35rem; flex: 0 0 auto; }
.toolbar-sep-push { margin-left: auto; }

.icon-btn {
    width: 2.1rem; height: 2.1rem; border-radius: 0.4rem;
    border: 1px solid transparent; background: transparent; color: #4a5568;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.15s, border-color 0.15s; flex: 0 0 auto; font-size: 0.95rem;
}
.icon-btn:hover { background: #edf2f7; border-color: #e2e8f0; }
.icon-btn:disabled { opacity: 0.4; cursor: not-allowed; background: transparent; }
.icon-btn.btn-danger-icon:hover { background: #fff5f5; color: #c53030; border-color: #feb2b2; }
.icon-btn-primary { background: #2b579a; color: #fff; border-color: #2b579a; }
.icon-btn-primary:hover { background: #204373; color: #fff; }
.icon-btn-wide { width: auto; padding: 0 0.9rem; gap: 0.45rem; }
.icon-btn-label { font-size: 0.85rem; font-weight: 600; }

/* ===== Status text (shared) ===== */
.compression-stats {
    background: #f7fafc; padding: 0.5rem 1rem; border-radius: 0.5rem;
    margin-bottom: 1rem; font-size: 0.95rem; color: #4a5568;
}

/* ===== Hidden ===== */
.hidden { display: none !important; }

/* ===== RTL ===== */
[dir="rtl"] .toolbar-sep-push { margin-left: 0; margin-right: auto; }

/* ===== Responsive ===== */
@media (max-width: 860px) {
    .app-toolbar { justify-content: center; }
    .toolbar-sep-push { margin-left: 0; }
    [dir="rtl"] .toolbar-sep-push { margin-right: 0; }
    .word-result-card { flex-direction: column; text-align: center; }
}