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

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

.container {
  max-width: 680px;
  width: 100%;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #8b949e;
  margin-bottom: 2rem;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed #30363d;
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 1.5rem;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: #58a6ff;
  background: rgba(88, 166, 255, 0.05);
}

.drop-zone__prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: #8b949e;
}

.drop-zone__prompt svg {
  color: #58a6ff;
}

.link-btn {
  background: none;
  border: none;
  color: #58a6ff;
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
}

.drop-zone__file {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-size: 1.05rem;
  color: #c9d1d9;
}

.remove-btn {
  background: none;
  border: none;
  color: #f85149;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

/* Format options */
.options {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.format-option {
  flex: 1;
  cursor: pointer;
}

.format-option input[type="radio"] {
  display: none;
}

.format-label {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid #30363d;
  border-radius: 8px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  color: #8b949e;
}

.format-option input[type="radio"]:checked + .format-label {
  border-color: #58a6ff;
  background: rgba(88, 166, 255, 0.1);
  color: #58a6ff;
}

/* Buttons */
.btn-primary {
  width: 100%;
  padding: 0.85rem;
  background: #238636;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary:hover:not(:disabled) {
  background: #2ea043;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 0.5rem 1rem;
  background: #21262d;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover {
  background: #30363d;
}

/* Hidden attribute override — display:flex/block beats [hidden] */
[hidden] {
  display: none !important;
}

/* Progress */
.progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 1rem;
  background: #161b22;
  border-radius: 8px;
  color: #8b949e;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #30363d;
  border-top-color: #58a6ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Result */
.result {
  margin-top: 1.5rem;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.result-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.result-actions {
  display: flex;
  gap: 0.5rem;
}

#resultContent {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1.25rem;
  max-height: 500px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #c9d1d9;
}

/* Error */
.error {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid #f8514980;
  border-radius: 8px;
  color: #f85149;
}

/* Responsive */
@media (max-width: 480px) {
  .options {
    flex-direction: column;
  }
}
