.download-page {
  gap: 1.35rem;
}

.download-shell {
  display: grid;
  gap: 1rem;
}

.download-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.download-head h3 {
  margin-top: 0.22rem;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
}

.download-head p {
  max-width: 24rem;
  color: var(--muted);
  line-height: 1.65;
  text-align: right;
}

.download-eyebrow {
  display: inline-flex;
  width: fit-content;
  padding: 0.34rem 0.68rem;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.08);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.download-form {
  display: grid;
  gap: 0.55rem;
}

.download-section {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.38);
}

[data-theme="dark"] .download-section {
  background: rgba(15, 23, 42, 0.46);
}

.download-company-box {
  display: grid;
  gap: 0.7rem;
}

.download-company-list {
  display: grid;
  gap: 0.65rem;
}

.download-check {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.34);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  transition-delay: var(--hover-out-delay);
}

[data-theme="dark"] .download-check {
  background: rgba(15, 23, 42, 0.38);
}

.download-check:hover {
  border-color: var(--hover-border);
  background: var(--hover-surface);
  box-shadow: var(--hover-shadow);
  transition-delay: 0s;
}

.download-check input {
  width: auto;
  margin: 0;
}

.download-check-all {
  font-weight: 650;
}

.download-custom-month {
  margin-top: 0.25rem;
}

.download-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.download-status-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
}

.download-summary-item {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.34);
}

[data-theme="dark"] .download-summary-item {
  background: rgba(15, 23, 42, 0.38);
}

.download-summary-item strong {
  font-size: 1.25rem;
  letter-spacing: 0;
}

.download-summary-item span,
.download-summary-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.download-summary-empty {
  margin: 0;
}

.download-summary-empty.error {
  color: var(--danger);
}

.download-report {
  display: grid;
  gap: 0.75rem;
}

.download-report-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(0, 113, 227, 0.06);
}

.download-report-selected {
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 650;
}

.download-report-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.download-report-action {
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: rgba(255, 255, 255, 0.44);
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  transition-delay: var(--hover-out-delay);
}

[data-theme="dark"] .download-report-action {
  background: rgba(15, 23, 42, 0.52);
}

.download-report-action:hover {
  border-color: var(--hover-border);
  background: var(--hover-surface);
  box-shadow: var(--hover-shadow);
  transition-delay: 0s;
}

.download-report-section {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

[data-theme="dark"] .download-report-section {
  background: rgba(15, 23, 42, 0.34);
}

.download-report-section summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  font-weight: 650;
}

.download-report-section summary strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 1.7rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(0, 113, 227, 0.08);
  font-size: 0.8rem;
}

.download-report-list {
  display: grid;
  gap: 0.35rem;
  max-height: 18rem;
  margin: 0;
  padding: 0 0.95rem 0.95rem;
  overflow: auto;
  list-style: none;
}

.download-report-list li {
  min-width: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--text);
  background: rgba(148, 163, 184, 0.12);
  font-size: 0.84rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.download-report-row {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  min-width: 0;
  padding: 0.65rem 0.7rem;
  cursor: pointer;
}

.download-report-checkbox {
  width: 1rem;
  height: 1rem;
  margin-top: 0.12rem;
}

.download-report-body {
  display: grid;
  gap: 0.26rem;
  min-width: 0;
}

.download-report-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0;
}

.download-report-name {
  min-width: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.download-report-reference {
  color: var(--muted);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.download-report-badge {
  flex: 0 0 auto;
  max-width: 9rem;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(0, 113, 227, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.download-report-empty {
  margin: 0;
  padding: 0 0.95rem 0.95rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.download-progress-shell {
  display: grid;
  gap: 0.6rem;
}

.download-progress {
  width: 100%;
  height: 0.95rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.download-progress-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 2.5rem;
  padding-right: 0.4rem;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.25s ease;
}

@media (max-width: 900px) {
  .download-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .download-head p {
    text-align: left;
  }

  .download-status-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .download-report-tools,
  .download-report-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .download-report-badge {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .download-status-summary {
    grid-template-columns: 1fr;
  }
}
