/* === BATCH FILE LIST === */
.batch-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface) transparent;
}

.batch-list::-webkit-scrollbar {
  width: 5px;
}

.batch-list::-webkit-scrollbar-thumb {
  background: var(--surface);
  border-radius: 3px;
}

.batch-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface2);
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.83rem;
}

.bfr-icon {
  font-size: 15px;
  flex-shrink: 0;
}

.bfr-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bfr-status {
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.bfr-status.done {
  color: var(--success);
}

.bfr-status.processing {
  color: var(--accent2);
}

.bfr-status.error {
  color: var(--error);
}

.bfr-status.pending {
  color: var(--text3);
}

.bfr-cost {
  font-size: 0.75rem;
  color: var(--text3);
  flex-shrink: 0;
}

/* === RESULT CARD === */
.result-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 30px;
  display: none;
  flex-direction: column;
  gap: 18px;
}

.result-card.visible {
  display: flex;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 18px 22px;
  margin: -26px -30px 18px -30px;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), rgba(167, 139, 250, 0.06));
  border-bottom: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
}

.result-header-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.result-header-icon {
  font-size: 28px;
}

.result-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.result-header-desc {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 2px;
}

.result-title {
  font-size: 1rem;
  font-weight: 600;
}

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: 'Inter', sans-serif;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent2);
  background: rgba(108, 99, 255, 0.08);
}

.btn-docx {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: var(--success);
}

.btn-docx:hover {
  background: rgba(34, 197, 94, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.result-text {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  font-size: 0.93rem;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface) transparent;
}

.result-text::-webkit-scrollbar {
  width: 6px;
}

.result-text::-webkit-scrollbar-thumb {
  background: var(--surface);
  border-radius: 3px;
}

/* === AI ANALYSIS BLOCK === */
.ai-panel {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.ai-panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(108, 99, 255, 0.08));
  border-bottom: 1px solid var(--border);
}

.ai-panel-icon {
  font-size: 28px;
}

.ai-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.ai-panel-desc {
  font-size: 0.78rem;
  color: var(--text2);
  margin-top: 2px;
}

.ai-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 22px;
}

.ai-row {
  display: flex;
  gap: 12px;
  width: 100%;
  flex-wrap: wrap;
}

.ai-field {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ai-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-select {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b92b0'%3E%3Cpath d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.ai-select:hover {
  border-color: rgba(16, 185, 129, 0.4);
}

.ai-select:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.btn-ai-generate {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s;
  margin-top: 4px;
}

.btn-ai-generate:hover {
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.btn-ai-sparkle {
  font-size: 1.1em;
}

.btn-ai {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}

.btn-ai:hover {
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.ai-result-box {
  display: none;
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}

/* === TOTAL COST PANEL === */
.total-cost-panel {
  width: 100%;
  background: linear-gradient(135deg, rgba(108, 99, 255, 0.12), rgba(167, 139, 250, 0.08));
  border: 1px solid rgba(108, 99, 255, 0.2);
  border-radius: 16px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tcp-label {
  font-size: 0.82rem;
  color: var(--text2);
}

.tcp-label strong {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.tcp-right {
  display: flex;
  gap: 20px;
  align-items: center;
}

.tcp-stat {
  text-align: center;
}

.tcp-stat .ts-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent2);
}

.tcp-stat .ts-lbl {
  font-size: 0.68rem;
  color: var(--text3);
  text-transform: uppercase;
}

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 999;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent2);
  animation: pulse-anim 1.2s ease-in-out infinite;
  margin-right: 4px;
}

@keyframes pulse-anim {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.7);
  }
}

footer {
  text-align: center;
  padding: 18px;
  color: var(--text3);
  font-size: 0.76rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* === CREDIT POPUP === */
.credit-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.credit-popup-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.credit-popup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 40px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.credit-popup-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.credit-popup-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.credit-popup-msg {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 24px;
  line-height: 1.5;
}

.credit-popup-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.credit-popup-actions .btn {
  padding: 12px 24px;
  font-size: 0.9rem;
}