:root {
  color-scheme: light;
  font-family: 'Inter', 'Noto Sans JP', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f5f7fb 0%, #ffffff 100%);
  color: #1f2933;
}

.page {
  display: grid;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

@media (min-width: 960px) {
  .page {
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
  }
}

.panel,
.aside {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 18px 50px -30px rgba(15, 23, 42, 0.46);
  padding: 2rem;
  backdrop-filter: blur(10px);
}

.panel__header h1 {
  margin: 0;
  font-size: clamp(1.8rem, 2vw + 1rem, 2.4rem);
  font-weight: 700;
}

.panel__lead {
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
  color: #4b5563;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0.75rem;
  padding: 2.8rem 1.5rem;
  border: 2px dashed rgba(59, 130, 246, 0.5);
  border-radius: 16px;
  background: rgba(59, 130, 246, 0.06);
  color: #1d4ed8;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.dropzone input[type='file'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dropzone__label {
  font-weight: 600;
  font-size: 1.05rem;
}

.dropzone__hint {
  color: #64748b;
  font-size: 0.92rem;
}

.dropzone--active {
  border-color: #2563eb;
  background: rgba(59, 130, 246, 0.16);
  transform: translateY(-2px);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.slider {
  display: grid;
  gap: 0.6rem;
  color: #1f2933;
}

.slider span {
  font-weight: 600;
}

.slider input[type='range'] {
  width: 100%;
  accent-color: #2563eb;
}

.slider small {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 400;
}

.quality-hints {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.quality-hints span {
  font-weight: 400;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(59, 130, 246, 0.08);
  border-radius: 12px;
  border: 1.5px solid rgba(59, 130, 246, 0.3);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.checkbox-option:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.4);
}

.checkbox-option input[type='checkbox'] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #2563eb;
}

.checkbox-option span {
  font-weight: 600;
  color: #1d4ed8;
  font-size: 0.95rem;
}

.submit-button {
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.6rem;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  cursor: pointer;
  box-shadow: 0 14px 30px -20px rgba(37, 99, 235, 0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.submit-button:hover,
.submit-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px -22px rgba(37, 99, 235, 0.8);
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.status {
  min-height: 1.2rem;
  font-weight: 600;
  padding: 0.5rem 0;
}

.status[data-type='pending'] {
  color: #1d4ed8;
}

.status[data-type='success'] {
  color: #047857;
}

.status[data-type='error'] {
  color: #dc2626;
}

.download {
  display: grid;
  gap: 0.6rem;
}

.download__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease;
}

.download__link::before {
  content: '⬇';
  font-size: 1.1rem;
}

.download__link:hover,
.download__link:focus-visible {
  background: rgba(16, 185, 129, 0.24);
}

.download__summary {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
}

.download__summary p {
  margin: 0.5rem 0;
}

.compression-stats {
  padding: 0.75rem;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 8px;
  font-size: 0.95rem;
}

.progress-container {
  margin: 1rem 0;
}

.progress-bar {
  width: 100%;
  height: 24px;
  background: rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);
  transition: width 0.3s ease;
  width: 0%;
}

.progress-text {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: #475569;
  text-align: center;
  font-weight: 600;
}

.aside h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.aside ul {
  margin: 0;
  padding-left: 1.1rem;
  color: #475569;
  display: grid;
  gap: 0.6rem;
  font-size: 0.95rem;
}

.footer {
  font-size: 0.8rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 2rem;
}

@media (max-width: 600px) {
  .panel,
  .aside {
    padding: 1.5rem;
  }

  .dropzone {
    padding: 2rem 1rem;
  }
}
