.file-input,
.select-input {
  width: 100%;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font: inherit;
  font-size: 0.9375rem;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.drop-area {
  position: relative;
  padding: 32px 24px;
  margin-bottom: 12px;
  text-align: center;
  border: 2px dashed var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-large);
  background: var(--md-sys-color-surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.drop-area.is-dragover {
  border-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-primary-container);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) 18%, transparent);
}

.drop-area__icon {
  display: block;
  margin-bottom: 8px;
  font-size: 40px;
  color: var(--md-sys-color-primary);
}

.drop-area__text {
  margin: 0 0 4px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
}

.drop-area__subtext,
.drop-area__note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--md-sys-color-on-surface-variant);
}

.drop-area__note {
  margin-top: 8px;
}

.drop-area .file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.selected-file-name {
  margin: 0 0 14px;
  font-size: 0.875rem;
  color: var(--md-sys-color-on-surface-variant);
}

.file-input:focus,
.select-input:focus,
input[type="range"]:focus {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--md-sys-color-primary) 22%, transparent);
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.control-field {
  min-width: 0;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-row input[type="range"] {
  flex: 1;
  margin: 0;
  accent-color: var(--md-sys-color-primary);
}

.range-value {
  min-width: 52px;
  text-align: right;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.result-stat {
  padding: 14px 16px;
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
}

.result-stat__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  color: var(--md-sys-color-on-surface-variant);
}

.result-stat strong {
  font-size: 0.9375rem;
  color: var(--md-sys-color-on-surface);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.preview-card {
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 16px;
}

.preview-card__title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}

.preview-image {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 10px;
  background: linear-gradient(45deg, #f4f7fb 25%, #eaf1f8 25%, #eaf1f8 50%, #f4f7fb 50%, #f4f7fb 75%, #eaf1f8 75%, #eaf1f8 100%);
  background-size: 16px 16px;
  border: 1px solid var(--md-sys-color-outline-variant);
}

@media (max-width: 600px) {
  .drop-area {
    padding: 24px 16px;
  }

  .control-grid,
  .result-stats,
  .preview-grid {
    grid-template-columns: 1fr;
  }}
