.batch-page {
  display: grid;
  gap: 14px;
}

.batch-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.85rem, 3vw, 2.5rem);
}

.batch-hero p {
  margin: 0;
  color: #4a5b78;
  max-width: 880px;
}

.batch-hero-note {
  margin-top: 8px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #5d6f8c;
}

.mode-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mode-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7dde6;
  border-radius: 12px;
  padding: 8px 14px;
  text-decoration: none;
  color: #243047;
  font-weight: 700;
  font-size: 0.92rem;
  background: #ffffff;
}

.mode-link.active {
  background: #eef4ff;
  border-color: #5a7cff;
  color: #2a4bbf;
}

.batch-form {
  display: grid;
  gap: 14px;
}

.batch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-control {
  display: grid;
  gap: 6px;
  align-content: start;
}

.field-control > span,
.field-label-row > span {
  font-size: 0.8rem;
  font-weight: 700;
  color: #4f5f78;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.field-help {
  font-size: 0.8rem;
  color: #637491;
  line-height: 1.4;
}

.field-control-language {
  margin-top: -2px;
}

.field-control input {
  width: 100%;
  border: 1px solid #d3dce8;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 0.95rem;
  color: #162138;
  background: #ffffff;
}

.field-control input:focus,
.app-select-button:focus,
.app-select-item:focus,
.amount-chip:focus,
.tool-chip:focus,
.interview-extra-chip:focus,
.btn:focus,
.row-upload-zone:focus,
.row-upload-zone:focus-within,
.row-url-input:focus {
  outline: 2px solid #5a7cff;
  outline-offset: 2px;
}

.app-select {
  position: relative;
}

.app-select-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #d3dce8;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 0.95rem;
  color: #162138;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.app-select-button svg {
  width: 16px;
  height: 16px;
  color: #667792;
  transition: transform 0.2s ease;
}

.app-select-button.open {
  border-color: #5a7cff;
  box-shadow: 0 0 0 3px rgba(90, 124, 255, 0.12);
}

.app-select-button.open svg {
  transform: rotate(180deg);
}

.app-select-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: #ffffff;
  border: 1px solid #d8e1ef;
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
  z-index: 30;
  overflow: hidden;
}

.app-select-menu.visible {
  display: block;
}

.app-select-item {
  width: 100%;
  border: none;
  border-bottom: 1px solid #edf1f7;
  background: #ffffff;
  text-align: left;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: #2f3b52;
  cursor: pointer;
}

.app-select-item:last-child {
  border-bottom: none;
}

.app-select-item:hover {
  background: #f8fbff;
}

.app-select-item.active {
  background: #ecf3ff;
  color: #2549b6;
  font-weight: 700;
}

.language-custom-input {
  width: 100%;
  border: 1px solid #d3dce8;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: #162138;
  background: #ffffff;
  margin-top: 8px;
}

.study-defaults-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.generation-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f8fbff;
  border: 1px solid #dce6f5;
  border-radius: 14px;
  padding: 12px;
}

.generation-control.wide {
  grid-column: 1 / -1;
}

.control-label {
  font-size: 0.79rem;
  color: #4f5f78;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.control-note {
  font-size: 0.84rem;
  color: #5f6f88;
}

.tool-chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.tool-chip {
  border: 1px solid #d0daea;
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
  color: #334158;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.tool-chip:hover {
  border-color: #54b884;
}

.tool-chip.active {
  border-color: #39a86f;
  background: rgba(57, 168, 111, 0.13);
  color: #0e6a41;
}

.chip-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.64rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(90, 124, 255, 0.17);
  color: #2a43a0;
}

.amount-chips {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.amount-chip {
  border: 1px solid #ced8ea;
  border-radius: 12px;
  padding: 9px 10px;
  background: #ffffff;
  color: #334158;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.amount-chip.active {
  border-color: #5a7cff;
  background: rgba(90, 124, 255, 0.12);
  color: #2a43a0;
}

.rows-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.rows-head h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
}

.rows-wrap {
  display: grid;
  gap: 12px;
}

.batch-row {
  border: 1px solid #dde7f6;
  border-radius: 14px;
  background: #fbfdff;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.batch-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.batch-row-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.batch-row-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.row-field {
  display: grid;
  gap: 8px;
}

.row-label {
  font-size: 0.83rem;
  font-weight: 700;
  color: #4d5d78;
}

.row-upload-zone {
  border: 2px dashed #ccd8ea;
  border-radius: 12px;
  padding: 16px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.row-upload-zone:hover {
  border-color: #6b8cff;
}

.row-upload-zone.dragover {
  border-color: #4f72ee;
  background: rgba(90, 124, 255, 0.08);
}

.row-upload-zone.has-file {
  border-style: solid;
  border-color: #3ea874;
  background: rgba(62, 168, 116, 0.06);
}

.row-upload-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #25344e;
}

.row-upload-subtitle {
  margin-top: 2px;
  font-size: 0.79rem;
  color: #62728c;
}

.row-upload-zone input[type="file"] {
  display: none;
}

.row-file-info {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid #dce7f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.row-file-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #21304a;
  word-break: break-word;
}

.row-file-meta {
  font-size: 0.78rem;
  color: #64748b;
}

.file-remove {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #fac3c3;
  background: #fff5f5;
  color: #b91c1c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.file-remove svg {
  width: 16px;
  height: 16px;
}

.row-url-import {
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  background: #ffffff;
  padding: 11px;
  display: grid;
  gap: 9px;
  margin-top: 2px;
}

.row-url-import.active {
  border-color: #7ea0ff;
  box-shadow: 0 0 0 3px rgba(90, 124, 255, 0.11);
}

.row-url-head {
  display: grid;
  gap: 3px;
}

.row-url-head strong {
  font-size: 0.84rem;
  color: #25344e;
}

.row-url-head span {
  font-size: 0.75rem;
  color: #72839f;
}

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

.row-url-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #ccd8ea;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 0.85rem;
}

.row-url-help {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.75rem;
  color: #657792;
  line-height: 1.45;
}

.row-url-help code {
  font-size: 0.72rem;
  color: #2a43a0;
}

.info-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(90, 124, 255, 0.45);
  background: rgba(90, 124, 255, 0.08);
  color: #2a43a0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.row-url-status {
  min-height: 1.2em;
  font-size: 0.78rem;
  color: #4f5f78;
}

.row-url-status.pending {
  color: #6b7280;
}

.row-url-status.success {
  color: #0f7a4a;
}

.row-url-status.info {
  color: #2a43a0;
}

.row-url-status.error {
  color: #991b1b;
}

.row-inline-group {
  display: grid;
  gap: 7px;
  align-content: start;
}

.row-inline-checkbox,
.custom-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #2a3953;
  font-weight: 600;
}

.row-inline-checkbox input,
.custom-check input {
  width: 16px;
  height: 16px;
}

.custom-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.custom-check-box {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #8ea0bd;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.custom-check-box svg {
  width: 12px;
  height: 12px;
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.custom-check input:checked + .custom-check-box {
  border-color: #2563eb;
  background: #2563eb;
}

.custom-check input:checked + .custom-check-box svg {
  opacity: 1;
}

.custom-check input:focus-visible + .custom-check-box {
  box-shadow: 0 0 0 3px rgba(90, 124, 255, 0.16);
}

.custom-check-label {
  line-height: 1.2;
}

.interview-extra-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

.interview-extra-chip {
  border: 1px solid #cbd6e8;
  border-radius: 12px;
  background: #ffffff;
  color: #334158;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.interview-extra-chip:hover {
  border-color: #39a86f;
}

.interview-extra-chip.active {
  border-color: #39a86f;
  background: rgba(57, 168, 111, 0.13);
  color: #0e6a41;
}

.row-override {
  border: 1px solid #dbe5f4;
  border-radius: 12px;
  padding: 11px;
  background: #ffffff;
  display: grid;
  align-content: start;
}

.row-override-head {
  display: grid;
  gap: 8px;
}

.row-override-help {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.76rem;
  color: #6a7d98;
  line-height: 1.42;
}

.row-override-panel {
  display: grid;
  opacity: 0.45;
  pointer-events: none;
  margin-top: 10px;
  border-top: 1px solid #e5ebf5;
  padding-top: 10px;
  gap: 10px;
  transition: opacity 0.18s ease;
}

.row-override-panel.enabled {
  opacity: 1;
  pointer-events: auto;
}

.row-field-override {
  grid-column: 2;
}

.batch-row.mode-slides .row-field-override {
  margin-top: 22px;
}

.batch-row.mode-lecture .row-field--audio .row-override {
  margin-top: 4px;
}

.rows-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rows-foot small {
  color: #5f6f88;
  font-size: 0.87rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #d2ddee;
  background: #ffffff;
  color: #273651;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.btn:hover {
  border-color: #b9c8df;
  background: #f9fbff;
}

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

.btn.primary {
  border: none;
  background: linear-gradient(135deg, #4f46e5, #2563eb);
  color: #ffffff;
}

.btn.primary:hover {
  opacity: 0.95;
}

.btn.danger-soft {
  border-color: #f6b8b8;
  background: #fff4f4;
  color: #b42323;
  min-width: 104px;
  min-height: 42px;
  font-size: 1.05rem;
}

.btn.danger-soft:hover {
  border-color: #ef9a9a;
  background: #ffeaea;
}

.btn.add-btn {
  padding-inline: 12px;
}

.btn-plus {
  font-size: 1.05rem;
  line-height: 1;
}

.btn.small {
  padding: 7px 10px;
  font-size: 0.8rem;
}

.btn.tiny {
  padding: 6px 8px;
  font-size: 0.78rem;
  margin-right: 6px;
}

.batch-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 12px;
}

.status-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #e8edf3;
  padding: 8px 6px;
  font-size: 0.86rem;
}

th {
  font-size: 0.74rem;
  color: #5a6577;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

@media (max-width: 1100px) {
  .study-defaults-wrap,
  .batch-grid {
    grid-template-columns: 1fr;
  }

  .batch-row-fields {
    grid-template-columns: 1fr;
  }

  .row-field-override,
  .batch-row.mode-slides .row-field-override {
    grid-column: auto;
    margin-top: 0;
  }

  .batch-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .tool-chip-grid,
  .amount-chips,
  .interview-extra-grid {
    grid-template-columns: 1fr 1fr;
  }

  .row-url-row {
    flex-direction: column;
  }

  .rows-head h2 {
    font-size: 1.6rem;
  }
}

@media (max-width: 520px) {
  .tool-chip-grid,
  .amount-chips,
  .interview-extra-grid {
    grid-template-columns: 1fr;
  }
}
