.download-module {
    width: 100%;
}

.download-page {
    max-width: 1040px;
    margin: 0 auto;
}

.download-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.download-heading h1 {
    margin: 0 0 4px;
    color: var(--text-primary, #1a1a1a);
    font-size: 22px;
    font-weight: 700;
}

.download-subtitle {
    color: var(--text-tertiary, #888);
    font-size: 13px;
}

.download-connection {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-tertiary, #888);
    font-size: 11px;
    white-space: nowrap;
}

.download-connection[hidden] { display: none; }

.download-connection::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    content: '';
}

.download-connection.is-loading::before { background: #f59e0b; }
.download-connection.is-live::before { background: #22c55e; }
.download-connection.is-error::before { background: #ef4444; }

.download-select-card,
.download-report-card {
    border: 1px solid var(--border-default, #e8e6df);
    border-radius: 12px;
    background: var(--bg-card, #fff);
}

.download-select-card {
    margin-bottom: 20px;
    padding: 20px;
}

.download-select-title {
    margin-bottom: 14px;
    color: var(--text-primary, #1a1a1a);
    font-size: 14px;
    font-weight: 600;
}

.download-select-row {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 12px;
}

.download-select-group label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-tertiary, #888);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.download-select-group select {
    min-width: 100px;
    padding: 9px 14px;
    border: 1px solid var(--border-default, #e8e6df);
    border-radius: 8px;
    color: var(--text-primary, #1a1a1a);
    background: var(--bg-card, #fff);
    font: 13px var(--font-sans, 'DM Sans', system-ui, sans-serif);
    cursor: pointer;
}

.download-select-group input[type="date"] {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--border-default, #e8e6df);
    border-radius: 8px;
    color: var(--text-primary, #1a1a1a);
    background: var(--bg-card, #fff);
    font: 13px var(--font-sans, 'DM Sans', system-ui, sans-serif);
    box-sizing: border-box;
}

.download-select-group input[type="date"]:focus {
    outline: none;
    border-color: #999;
}

.download-select-group select:focus {
    outline: none;
    border-color: #999;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 14px;
}

.download-grid--two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.download-report-card {
    display: flex;
    align-self: stretch;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    transition: box-shadow .15s;
}

.download-report-card:hover { box-shadow: 0 2px 12px rgba(0, 0, 0, .06); }

.download-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.download-card-icon {
    display: flex;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.download-card-icon svg { width: 20px; height: 20px; }
.download-card-icon.is-blue { color: #3b82f6; background: #eff6ff; }
.download-card-icon.is-amber { color: #f59e0b; background: #fef3c7; }
.download-card-icon.is-purple { color: #8b5cf6; background: #faf5ff; }

.download-card-info { flex: 1; }

.download-card-title {
    margin-bottom: 2px;
    color: var(--text-primary, #1a1a1a);
    font-size: 14px;
    font-weight: 600;
}

.download-card-description {
    color: var(--text-tertiary, #888);
    font-size: 12px;
    line-height: 1.4;
}

.download-log-range {
    display: flex;
    gap: 10px;
    margin: 0 0 14px;
}

.download-log-range .download-select-group {
    flex: 1;
    min-width: 0;
}

.download-card-meta {
    min-height: 18px;
    margin-bottom: 12px;
    color: var(--text-tertiary, #888);
    font: 11px var(--font-mono, 'DM Mono', monospace);
}

.download-card-button {
    display: flex;
    width: 100%;
    margin-top: auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 0;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--text-primary, #1a1a1a);
    font: 600 13px var(--font-sans, 'DM Sans', system-ui, sans-serif);
    cursor: pointer;
    transition: background .15s, opacity .15s;
}

.download-card-button:hover { background: #333; }
.download-card-button:disabled { cursor: wait; opacity: .55; }
.download-card-button svg { width: 16px; height: 16px; }

.download-message {
    min-height: 20px;
    margin-top: 12px;
    color: var(--text-tertiary, #888);
    font-size: 11px;
}

@media (max-width: 800px) {
    .download-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .download-heading { flex-direction: column; }
    .download-select-row { flex-direction: column; align-items: stretch; }
    .download-select-group select { width: 100%; }
}
