:root {
    --primary: #06679e;
    --primary-dark: #04496f;
    --bg: #f2f4f7;
    --card-bg: #ffffff;
    --text: #1c2530;
    --text-muted: #6b7684;
    --border: #e0e4e9;
    --success: #2e9e5b;
    --error: #d64545;
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

.app-header {
    text-align: center;
    margin-bottom: 24px;
}

.app-header h1 {
    font-size: 1.6rem;
    margin-bottom: 4px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}

.hidden {
    display: none !important;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: #fafbfc;
}

.field input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
}

.btn {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.05s;
    width: 100%;
}

.btn:active {
    transform: scale(0.99);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:disabled {
    background: #b7c3cd;
    cursor: not-allowed;
}

.btn-secondary {
    background: #eef1f4;
    color: var(--text);
}

.btn-secondary:hover {
    background: #e2e6ea;
}

.btn-small {
    width: auto;
    padding: 8px 14px;
    font-size: 0.85rem;
    background: #eef1f4;
    color: var(--text);
    margin-right: 8px;
    margin-bottom: 8px;
}

.msg {
    margin-top: 12px;
    font-size: 0.9rem;
    min-height: 1.2em;
}

.msg.error {
    color: var(--error);
}

.msg.success {
    color: var(--success);
}

.files-toolbar {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.ext-filter {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.ext-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.ext-chip {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: #fafbfc;
    font-size: 0.8rem;
    cursor: pointer;
    user-select: none;
}

.ext-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.file-tree {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
}

.tree-node {
    padding: 6px 4px;
}

.tree-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.tree-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.tree-row .icon {
    flex-shrink: 0;
}

.tree-row .label {
    font-size: 0.92rem;
    word-break: break-word;
}

.tree-row .size {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    padding-left: 8px;
}

.tree-children {
    margin-left: 26px;
    border-left: 1px dashed var(--border);
    padding-left: 10px;
}

.selection-summary {
    margin: 14px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.progress-bar-outer {
    width: 100%;
    height: 14px;
    background: #eef1f4;
    border-radius: 10px;
    overflow: hidden;
    margin: 16px 0 10px;
}

.progress-bar-inner {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.progress-text {
    font-weight: 600;
    margin: 4px 0;
}

.current-file {
    font-size: 0.85rem;
    color: var(--text-muted);
    word-break: break-all;
    min-height: 1.2em;
}

@media (max-width: 480px) {
    .container {
        padding: 12px 10px 40px;
    }

    .card {
        padding: 16px;
    }

    .btn-small {
        width: 100%;
        margin-right: 0;
    }
}