* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #1a1a1a;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 2rem 1rem;
}

#app {
  width: 100%;
  max-width: 480px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-bottom: 1.5rem;
  color: #b0b0b0;
}

.card {
  background: #242424;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.file-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.file-area:hover {
  background: #2a2a2a;
}

.file-area input {
  display: none;
}

#fileName {
  font-size: 0.95rem;
}

#fileSize {
  font-size: 0.8rem;
  color: #888;
}

.row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.row:last-child {
  margin-bottom: 0;
}

.field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #777;
}

.crf-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.crf-row input {
  flex: 1;
}

#crfValue {
  min-width: 1.8rem;
  text-align: center;
  font-size: 0.9rem;
  color: #ccc;
}

select, input[type="text"] {
  background: #1a1a1a;
  color: #ddd;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s;
}

select:focus, input[type="text"]:focus {
  border-color: #5a5a5a;
}

select {
  cursor: pointer;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #3a3a3a;
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #666;
  cursor: pointer;
  transition: background 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  background: #888;
}

button {
  width: 100%;
  padding: 0.7rem;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  background: #3a3a3a;
  color: #999;
  transition: all 0.15s;
  margin-bottom: 1rem;
}

button:not(:disabled):hover {
  background: #4a4a4a;
}

button.active {
  background: #4a6fa5;
  color: #fff;
}

button.active:hover {
  background: #5a7fb5;
}

button:disabled {
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

#progressWrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

#progressTrack {
  flex: 1;
  height: 4px;
  background: #333;
  border-radius: 2px;
  overflow: hidden;
}

#progressFill {
  height: 100%;
  width: 0%;
  background: #4a6fa5;
  border-radius: 2px;
  transition: width 0.3s;
}

#progressText {
  font-size: 0.8rem;
  color: #888;
  min-width: 3rem;
  text-align: right;
}

#result {
  text-align: center;
  margin-bottom: 1rem;
}

#downloadLink {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: #2d4a3a;
  color: #8fbc8f;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s;
}

#downloadLink:hover {
  background: #3a5a4a;
}

#status {
  font-size: 0.8rem;
  color: #666;
  text-align: center;
}
