.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  height: 34px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--r-md);
  transition: background var(--transition), border-color var(--transition), color var(--transition), opacity var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.005em;
}

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

.btn-primary {
  background: var(--c-accent);
  color: #fff;
  border: 1px solid transparent;
}
.btn-primary:hover:not(:disabled) {
  background: var(--c-accent-hover);
}

.btn-outline {
  background: transparent;
  color: var(--c-accent);
  border: 1px solid var(--c-accent-border);
}
.btn-outline:hover:not(:disabled) {
  background: var(--c-accent-subtle);
}

.btn-ghost {
  background: transparent;
  color: var(--c-text-2);
  border: 1px solid transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--c-surface-alt);
  color: var(--c-text);
}

.btn-lg {
  height: 40px;
  padding: 0 20px;
  font-size: 14px;
}

.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.btn-xs {
  height: 24px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: 600;
}

.input, .select, .textarea {
  width: 100%;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  color: var(--c-text);
  font-size: 13.5px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input {
  height: 34px;
  padding: 0 10px;
}

.select {
  height: 34px;
  padding: 0 10px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238A96A8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.textarea {
  padding: 8px 10px;
  resize: vertical;
  line-height: 1.55;
  font-size: 12.5px;
  font-family: var(--font-mono);
  min-height: 80px;
}

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-subtle);
}

.input::placeholder, .textarea::placeholder {
  color: var(--c-text-3);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.field-group-check {
  flex: 0 0 auto;
  min-width: 160px;
}

.field-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field-hint {
  font-size: 11.5px;
  color: var(--c-text-3);
  line-height: 1.45;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text);
  margin-top: 4px;
}

.checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-mark {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--c-border-strong);
  border-radius: 4px;
  background: var(--c-surface);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}

.checkbox:checked + .checkbox-mark {
  background: var(--c-accent);
  border-color: var(--c-accent);
}

.checkbox:checked + .checkbox-mark::after {
  content: '';
  display: block;
  width: 8px;
  height: 5px;
  border-left: 1.8px solid #fff;
  border-bottom: 1.8px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.checkbox:focus-visible + .checkbox-mark {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}

.drop-zone {
  margin: 16px 20px 0;
  border: 1.5px dashed var(--c-border-strong);
  border-radius: var(--r-lg);
  background: var(--c-surface-alt);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  user-select: none;
}

.drop-zone:hover, .drop-zone:focus-visible {
  border-color: var(--c-accent);
  background: var(--c-accent-subtle);
}

.drop-zone.drag-over {
  border-color: var(--c-accent);
  border-style: solid;
  background: var(--c-accent-subtle);
}

.drop-zone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  gap: 6px;
  pointer-events: none;
}

.drop-icon {
  color: var(--c-text-3);
  margin-bottom: 4px;
}

.drop-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text-2);
}

.drop-sublabel {
  font-size: 12.5px;
  color: var(--c-text-3);
}

.drop-actions {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
}

.file-list {
  margin: 0 12px 4px;
  max-height: 260px;
  overflow-y: auto;
  border-radius: var(--r-md);
}

.file-list::-webkit-scrollbar {
  width: 6px;
}
.file-list::-webkit-scrollbar-track {
  background: transparent;
}
.file-list::-webkit-scrollbar-thumb {
  background: var(--c-border-strong);
  border-radius: 3px;
}

.file-list-empty {
  padding: 12px 8px;
  font-size: 13px;
  color: var(--c-text-3);
  text-align: center;
}

.file-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  transition: background var(--transition);
}

.file-row:hover {
  background: var(--c-surface-alt);
}

.file-row-icon {
  color: var(--c-text-3);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.file-row-path {
  font-size: 12.5px;
  color: var(--c-text);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-row-size {
  font-size: 11.5px;
  color: var(--c-text-3);
  font-family: var(--font-mono);
  white-space: nowrap;
  flex-shrink: 0;
}

.file-summary {
  padding: 8px 20px 16px;
  font-size: 12px;
  color: var(--c-text-2);
  border-top: 1px solid var(--c-border);
  font-family: var(--font-mono);
  line-height: 1.6;
  word-break: break-word;
}

.progress-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.progress-track {
  flex: 1;
  height: 4px;
  background: var(--c-border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--c-accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.2s ease;
}

.progress-label {
  font-size: 12px;
  color: var(--c-text-2);
  white-space: nowrap;
  font-family: var(--font-mono);
  flex-shrink: 0;
}

.output-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--c-border);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--c-surface);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--c-text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text);
  word-break: break-all;
}

.stat-value-mono {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.stat-cell-full {
  grid-column: 1 / -1;
}

.magnet-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.magnet-row {
  display: flex;
  gap: 8px;
}

.magnet-input {
  flex: 1;
  height: 34px;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--c-text-2);
  background: var(--c-surface-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: text;
  min-width: 0;
}

.magnet-input:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-accent-subtle);
}

.output-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 9px 16px;
  border-radius: var(--r-lg);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  text-align: center;
}

.toast.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: var(--c-text);
  color: #fff;
}

.toast-error {
  background: var(--c-error);
  color: #fff;
}

.toast-info {
  background: var(--c-text);
  color: #fff;
}
