/*
 * Operational console rhythm for social collection.
 * Parameters, conditions and actions each own one aligned row.
 */
.xhs-page {
  --xhs-control-height: 36px;
}

.xhs-page .batch-panel {
  padding: 16px 18px 18px;
}

.xhs-page .panel-title {
  margin-bottom: 12px;
}

.xhs-page .batch-params-row,
.xhs-page .batch-condition-row,
.xhs-page .batch-actions-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 8px 0;
}

.xhs-page .batch-params-row {
  grid-template-columns: 132px repeat(4, max-content);
  column-gap: 18px;
  padding-top: 0;
}

.xhs-page .batch-condition-row,
.xhs-page .batch-actions-row {
  border-top: 1px solid var(--sv-color-border);
}

.xhs-page .batch-step-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--xhs-control-height);
  color: var(--sv-color-text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.xhs-page .batch-step-label b {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--sv-color-border);
  border-radius: 50%;
  color: var(--sv-color-text-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.xhs-page .batch-panel .control {
  min-height: var(--xhs-control-height);
  display: inline-grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  gap: 8px;
}

.xhs-page .batch-panel .control > label {
  line-height: var(--xhs-control-height);
}

.xhs-page .batch-panel .control input,
.xhs-page .batch-panel .control select {
  height: var(--xhs-control-height);
  margin: 0;
}

.xhs-page .batch-options {
  min-height: var(--xhs-control-height);
  display: flex;
  align-items: center;
  gap: 22px;
  min-width: 0;
}

.xhs-page .batch-options .inline-check {
  min-height: var(--xhs-control-height);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--sv-color-text-muted);
  line-height: 1;
  white-space: nowrap;
}

.xhs-page .batch-options input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin: 0;
}

.xhs-page .batch-auto-next-hint {
  min-width: 0;
  margin-left: auto;
  text-align: right;
}

.xhs-page .batch-auto-next-hint:empty {
  display: none;
}

.xhs-page .batch-advanced {
  margin: 0;
  padding: 0 0 8px 146px;
  border-top: 0;
}

.xhs-page .batch-advanced-body {
  padding: 10px 0 2px;
  border-top: 1px dashed var(--sv-color-border);
}

.xhs-page .batch-actions-row {
  grid-template-columns: 132px max-content repeat(5, max-content);
  column-gap: 10px;
}

.xhs-page .batch-actions-row .btn {
  min-height: var(--xhs-control-height);
  height: var(--xhs-control-height);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
}

.xhs-page .batch-actions-row #btnRunBatch {
  padding-right: 18px;
  padding-left: 18px;
}

.xhs-page .progress-line {
  margin-top: 6px;
  padding-left: 146px;
}

@media (max-width: 1480px) {
  .xhs-page .batch-params-row {
    grid-template-columns: 116px repeat(2, max-content);
    row-gap: 8px;
  }

  .xhs-page .batch-params-row .batch-step-label {
    grid-row: 1 / 3;
  }

  .xhs-page .batch-condition-row {
    grid-template-columns: 116px minmax(0, 1fr);
  }

  .xhs-page .batch-actions-row {
    grid-template-columns: 116px repeat(3, max-content);
    row-gap: 8px;
  }

  .xhs-page .batch-actions-row .batch-step-label {
    grid-row: 1 / 3;
  }

  .xhs-page .batch-advanced,
  .xhs-page .progress-line {
    padding-left: 130px;
  }
}

@media (max-width: 920px) {
  .xhs-page .batch-params-row,
  .xhs-page .batch-condition-row,
  .xhs-page .batch-actions-row {
    grid-template-columns: 1fr;
  }

  .xhs-page .batch-params-row .batch-step-label,
  .xhs-page .batch-actions-row .batch-step-label {
    grid-row: auto;
  }

  .xhs-page .batch-panel .control {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .xhs-page .batch-options {
    flex-wrap: wrap;
  }

  .xhs-page .batch-auto-next-hint {
    flex-basis: 100%;
    margin-left: 0;
    text-align: left;
  }

  .xhs-page .batch-advanced,
  .xhs-page .progress-line {
    padding-left: 0;
  }
}

@media (max-width: 620px) {
  .xhs-page .batch-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .xhs-page .batch-actions-row .control,
  .xhs-page .batch-actions-row .btn {
    width: 100%;
  }
}

/* Wide desktop: compress the whole task console into one operational toolbar. */
@media (min-width: 1500px) {
  .xhs-page {
    --xhs-control-height: 34px;
  }

  .xhs-page .batch-panel {
    display: grid;
    grid-template-areas:
      "title title title"
      "params conditions actions"
      "advanced advanced advanced"
      "progress progress progress"
      "result result result";
    grid-template-columns: max-content max-content minmax(0, 1fr);
    align-items: center;
    column-gap: 20px;
    row-gap: 6px;
    padding-top: 14px;
    padding-bottom: 12px;
  }

  .xhs-page .batch-panel > .panel-title {
    grid-area: title;
    margin-bottom: 8px;
  }

  .xhs-page .batch-params-row {
    grid-area: params;
  }

  .xhs-page .batch-condition-row {
    grid-area: conditions;
  }

  .xhs-page .batch-actions-row {
    grid-area: actions;
  }

  .xhs-page .batch-params-row,
  .xhs-page .batch-condition-row,
  .xhs-page .batch-actions-row {
    min-height: var(--xhs-control-height);
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 0;
    border-top: 0;
    white-space: nowrap;
  }

  .xhs-page .batch-condition-row,
  .xhs-page .batch-actions-row {
    padding-left: 20px;
    border-left: 1px solid var(--sv-color-border);
  }

  .xhs-page .batch-step-label {
    display: none;
  }

  .xhs-page .batch-panel .control {
    min-height: var(--xhs-control-height);
    gap: 7px;
  }

  .xhs-page .batch-panel .control > label,
  .xhs-page .batch-options .inline-check {
    font-size: 11px;
  }

  .xhs-page .batch-params-row input[type="number"] {
    width: 52px;
  }

  .xhs-page .batch-params-row select {
    min-width: 100px;
  }

  .xhs-page .batch-options {
    min-height: var(--xhs-control-height);
    gap: 16px;
  }

  .xhs-page .batch-options .inline-check {
    min-height: var(--xhs-control-height);
  }

  .xhs-page .batch-auto-next-hint {
    display: none;
  }

  .xhs-page .batch-actions-row {
    justify-content: flex-start;
    gap: 9px;
  }

  .xhs-page .batch-actions-row .control {
    display: inline-grid;
  }

  .xhs-page .batch-actions-row select {
    min-width: 100px;
  }

  .xhs-page .batch-actions-row .btn {
    min-width: auto;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 12px;
  }

  .xhs-page .batch-actions-row #btnRunBatch {
    padding-right: 14px;
    padding-left: 14px;
  }

  .xhs-page .batch-advanced,
  .xhs-page .progress-line,
  .xhs-page #batchResult {
    grid-column: 1 / -1;
  }

  .xhs-page .batch-advanced {
    grid-area: advanced;
    padding: 8px 0 0;
  }

  .xhs-page .batch-advanced-toggle {
    padding: 3px 0;
    font-size: 11px;
  }

  .xhs-page .batch-advanced-body {
    gap: 16px;
    padding: 12px 0 6px;
  }

  .xhs-page .progress-line {
    grid-area: progress;
    grid-template-columns: auto minmax(180px, 360px) minmax(220px, 1fr);
    margin-top: 2px;
    padding-left: 0;
  }

  .xhs-page #batchResult {
    grid-area: result;
  }
}
