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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
  padding: 2rem 1rem;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.subtitle {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.controls {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

fieldset {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  flex: 1;
  min-width: 200px;
}

legend {
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0 0.4rem;
  color: #555;
}

fieldset label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 1rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.hint {
  font-weight: normal;
  font-size: 0.8rem;
  color: #999;
}

select {
  padding: 0.35rem 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.9rem;
  background: #fff;
}

.input-section {
  margin-bottom: 1rem;
}

.input-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.file-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.file-label input[type="file"] {
  display: none;
}

.file-btn {
  background: #e9ecef;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.file-btn:hover {
  background: #dee2e6;
}

.file-name {
  font-size: 0.85rem;
  color: #666;
}

.or-divider {
  font-size: 0.85rem;
  color: #999;
}

textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.75rem;
  font-family: "Nyala", "Abyssinica SIL", "Noto Sans Ethiopic", "Ebrima", monospace;
  font-size: 1rem;
  line-height: 1.8;
  resize: vertical;
  transition: border-color 0.15s;
}

textarea:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

textarea[readonly] {
  background: #fafafa;
}

.action-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.btn {
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

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

.btn-primary {
  background: #4a90d9;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #3a7bc8;
}

.btn-secondary {
  background: #e9ecef;
  color: #333;
  border: 1px solid #ced4da;
}

.btn-secondary:hover:not(:disabled) {
  background: #dee2e6;
}

.status {
  font-size: 0.85rem;
  color: #666;
}

.status.error {
  color: #c0392b;
}

.status.success {
  color: #27ae60;
}

.output-section {
  margin-bottom: 1rem;
}

.output-section > label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: #555;
}

.output-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
