.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.comment-auto-settings-button {
  width: 36px;
  height: 36px;
  justify-content: center;
  padding: 0;
}

.comment-auto-home-countdown {
  display: grid;
  gap: 2px;
  min-width: 118px;
  padding: 5px 10px;
  border: 1px solid #d9e8ff;
  border-radius: 11px;
  background: #f4f8ff;
  line-height: 1.15;
}

.comment-auto-home-countdown span {
  color: #6e6e73;
  font-size: 9px;
  font-weight: 600;
}

.comment-auto-home-countdown strong {
  color: #007aff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ───────────────────────── Diálogo de respostas automáticas ─────────────────────────
   Visual inspirado no app Ajustes da Apple, em versão compacta: fundo agrupado cinza-claro,
   cartões brancos sem bordas, chaves estilo iOS e vidro fosco no topo e no rodapé.
   Em telas largas o conteúdo usa três colunas para caber sem rolagem. */

.comment-auto-overlay[hidden] {
  display: none;
}

.comment-auto-overlay {
  position: fixed;
  z-index: 200000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .3);
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
  animation: comment-auto-fade .22s ease both;
}

.comment-auto-dialog {
  --ca-bg: #f5f5f7;
  --ca-card: #fff;
  --ca-fill: #f2f2f7;
  --ca-line: rgba(60, 60, 67, .12);
  --ca-text: #1d1d1f;
  --ca-text-2: #6e6e73;
  --ca-text-3: #86868b;
  --ca-blue: #007aff;
  --ca-green: #34c759;
  --ca-card-shadow: 0 0 0 .5px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .05);
  display: flex;
  flex-direction: column;
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border: .5px solid rgba(255, 255, 255, .7);
  border-radius: 22px;
  background: var(--ca-bg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28), 0 2px 10px rgba(0, 0, 0, .08);
  color: var(--ca-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif;
  letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased;
  animation: comment-auto-pop .32s cubic-bezier(.2, .9, .3, 1.05) both;
}

@keyframes comment-auto-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes comment-auto-pop { from { opacity: 0; transform: translateY(10px) scale(.965); } to { opacity: 1; transform: none; } }

/* Topo */
.comment-auto-dialog-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: .5px solid var(--ca-line);
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
}

.comment-auto-title-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(160deg, #5ac8fa 0%, #007aff 100%);
  box-shadow: 0 3px 10px rgba(0, 122, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .35);
  color: #fff;
  font-size: 15px;
}

.comment-auto-dialog-header h2 {
  color: var(--ca-text);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.022em;
  line-height: 1.15;
}

.comment-auto-dialog-header p {
  margin-top: 3px;
  color: var(--ca-text-2);
  font-size: 12px;
  line-height: 1.4;
}

.comment-auto-account-name {
  display: inline-block;
  margin: 0 0 0 6px;
  padding: 0 8px 1px;
  border-radius: 999px;
  background: rgba(0, 122, 255, .09);
  color: var(--ca-text-2);
  font-size: 11px;
}

.comment-auto-account-name strong {
  color: var(--ca-blue);
  font-weight: 600;
}

.comment-auto-close {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  margin-left: auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(120, 120, 128, .16);
  color: var(--ca-text-2);
  font-size: 12px;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}

.comment-auto-close:hover { background: rgba(120, 120, 128, .26); color: var(--ca-text); }
.comment-auto-close:active { transform: scale(.92); }

/* Corpo (duas colunas em telas médias; três em telas largas) */
.comment-auto-form {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "master master"
    "channels channels"
    "timing replies"
    "timing-note replies"
    "cycle-summary cycle-summary"
    "usage usage"
    "limits model"
    "instructions apikey"
    "status status";
  align-items: start;
  gap: 8px 12px;
  padding: 12px 20px 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(60, 60, 67, .28) transparent;
}

.comment-auto-form:has(.comment-auto-instructions[open]) {
  grid-template-areas:
    "master master"
    "channels channels"
    "timing replies"
    "timing-note replies"
    "cycle-summary cycle-summary"
    "usage usage"
    "limits model"
    "instructions instructions"
    "apikey apikey"
    "status status";
}

/* Linhas com chave (estilo iOS) */
.comment-auto-switch-row {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 12px;
  border: 0;
  border-radius: 13px;
  background: var(--ca-card);
  box-shadow: var(--ca-card-shadow);
  cursor: pointer;
  transition: background-color .16s ease;
}

.comment-auto-switch-row > span { display: grid; gap: 1px; }
.comment-auto-switch-row:hover { background: #fafafc; }
.comment-auto-switch-row strong { color: var(--ca-text); font-size: 13px; font-weight: 600; letter-spacing: -.012em; }
.comment-auto-switch-row small { color: var(--ca-text-3); font-size: 10.5px; line-height: 1.3; }
.comment-auto-master-row { grid-area: master; }

.comment-auto-switch-row input[type="checkbox"] {
  position: relative;
  width: 40px;
  height: 24px;
  flex: 0 0 auto;
  margin: 0;
  border-radius: 999px;
  outline: none;
  background: rgba(120, 120, 128, .32);
  cursor: pointer;
  transition: background-color .25s ease, box-shadow .16s ease;
  -webkit-appearance: none;
  appearance: none;
}

.comment-auto-switch-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16), 0 3px 1px rgba(0, 0, 0, .1);
  transition: transform .28s cubic-bezier(.3, 1.3, .5, 1), width .2s ease;
}

.comment-auto-switch-row input[type="checkbox"]:checked { background: var(--ca-green); }
.comment-auto-switch-row input[type="checkbox"]:checked::after { transform: translateX(16px); }
.comment-auto-switch-row input[type="checkbox"]:active::after { width: 25px; }
.comment-auto-switch-row input[type="checkbox"]:checked:active::after { transform: translateX(11px); }
.comment-auto-switch-row input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 4px rgba(0, 122, 255, .3); }
.comment-auto-switch-row input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }

.comment-auto-channel-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  grid-area: channels;
}

/* A legenda continua disponível para leitores de tela, mas não ocupa espaço. */
.comment-auto-channel-group legend {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.comment-auto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Intervalo + próximo ciclo */
.comment-auto-grid-timing { grid-area: timing; }
.comment-auto-grid-timing > .comment-auto-field {
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--ca-card);
  box-shadow: var(--ca-card-shadow);
}
.comment-auto-timing-note { grid-area: timing-note; padding: 0 4px; font-size: 10.5px; line-height: 1.35; }

.comment-auto-count-limits {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--ca-card);
  box-shadow: var(--ca-card-shadow);
  grid-area: limits;
}
.comment-auto-grid-limits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.comment-auto-grid-limits > .comment-auto-field { align-content: space-between; }
.comment-auto-grid-model {
  grid-area: model;
  align-content: start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--ca-card);
  box-shadow: var(--ca-card-shadow);
}
.comment-auto-grid-model > .comment-auto-field:last-child { grid-column: 1 / -1; }

/* Campos */
.comment-auto-field {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  color: var(--ca-text-2);
  font-size: 12px;
  font-weight: 600;
}

.comment-auto-field input,
.comment-auto-field select,
.comment-auto-instructions textarea {
  width: 100%;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  outline: none;
  background-color: var(--ca-fill);
  color: var(--ca-text);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.comment-auto-field select {
  padding-right: 28px;
  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.5 4.5 6 8l3.5-3.5' fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 9px center;
  background-repeat: no-repeat;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.comment-auto-field input::placeholder { color: #aeaeb2; }

.comment-auto-field input:focus,
.comment-auto-field select:focus,
.comment-auto-instructions textarea:focus {
  border-color: var(--ca-blue);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, .16);
}

.comment-auto-input-suffix {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ca-text-3);
  font-size: 12px;
  font-weight: 500;
}

.comment-auto-input-suffix input { width: 54px; max-width: 54px; flex: 0 1 54px; text-align: center; font-variant-numeric: tabular-nums; }
.comment-auto-input-suffix span { white-space: nowrap; }
.comment-auto-input-suffix select { width: auto; min-width: 112px; max-width: 130px; }
.comment-auto-limit-note { margin: 0; color: var(--ca-text-3); font-size: 10px; line-height: 1.35; }

.comment-auto-countdown-card {
  display: grid;
  align-content: center;
  gap: 2px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 13px;
  background: linear-gradient(150deg, #0a84ff 0%, #0060df 100%);
  box-shadow: 0 5px 14px rgba(0, 122, 255, .24);
  color: #fff;
}

.comment-auto-countdown-card span { color: rgba(255, 255, 255, .78); font-size: 11px; font-weight: 500; }
.comment-auto-countdown-card strong { color: #fff; font-size: 18px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* Resumo do último ciclo: título e nota à esquerda, texto à direita */
.comment-auto-cycle-summary {
  display: grid;
  grid-template-columns: minmax(170px, .28fr) minmax(0, 1fr);
  align-items: start;
  gap: 2px 14px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--ca-card);
  box-shadow: var(--ca-card-shadow);
  grid-area: cycle-summary;
}
.comment-auto-cycle-summary > strong { grid-column: 1; grid-row: 1; color: var(--ca-text); font-size: 13px; font-weight: 600; }
.comment-auto-cycle-summary > small { grid-column: 1; grid-row: 2; color: var(--ca-text-3); font-size: 10px; line-height: 1.35; }
.comment-auto-cycle-summary > p { grid-column: 2; grid-row: 1 / span 2; margin: 0; padding: 6px 10px; border-radius: 9px; background: var(--ca-fill); color: #3a3a3c; font-size: 11.5px; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.comment-auto-cycle-summary > .comment-auto-clear-error { grid-column: 2; grid-row: 3; justify-self: end; min-height: 28px; padding: 4px 9px; border: 1px solid var(--ca-line); border-radius: 8px; background: var(--ca-card); color: var(--ca-text-2); font-size: 10px; font-weight: 600; }
.comment-auto-cycle-summary > .comment-auto-clear-error:hover { color: var(--ca-blue); border-color: rgba(0, 122, 255, .3); }
.comment-auto-cycle-summary > .comment-auto-clear-error:disabled { cursor: wait; opacity: .55; }

/* Uso da API (recolhível) */
.comment-auto-usage {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 0;
  border-radius: 13px;
  background: var(--ca-card);
  box-shadow: var(--ca-card-shadow);
  grid-area: usage;
}

.comment-auto-usage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  list-style: none;
  cursor: pointer;
  border-radius: 13px;
}
.comment-auto-usage-header::-webkit-details-marker { display: none; }
.comment-auto-usage-header:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(0, 122, 255, .25); }
.comment-auto-usage-header strong { color: var(--ca-text); font-size: 13px; font-weight: 600; }
.comment-auto-usage-header > span:not(.comment-auto-usage-title) {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--ca-fill);
  color: var(--ca-text-2);
  font-size: 10.5px;
  font-weight: 600;
}
.comment-auto-usage-header::after {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  margin: 0 3px 3px 2px;
  border-right: 2px solid #aeaeb2;
  border-bottom: 2px solid #aeaeb2;
  transform: rotate(45deg);
  transition: transform .25s ease;
}
.comment-auto-usage[open] > .comment-auto-usage-header::after { margin-bottom: -3px; transform: rotate(-135deg); }
.comment-auto-usage-title { display: grid; gap: 1px; }
.comment-auto-usage-title small { color: var(--ca-text-3); font-size: 10.5px; font-weight: 400; }
.comment-auto-usage-body { display: grid; gap: 8px; padding: 0 12px 12px; }
.comment-auto-usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 6px; }
.comment-auto-usage-grid > div { display: grid; gap: 2px; min-width: 0; padding: 7px 10px; border: 0; border-radius: 10px; background: var(--ca-fill); }
.comment-auto-usage-grid span { color: var(--ca-text-3); font-size: 10px; font-weight: 500; }
.comment-auto-usage-grid strong { color: var(--ca-text); font-size: 14px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.comment-auto-usage-grid > div[data-highlight] { background: rgba(0, 122, 255, .09); }
.comment-auto-usage-grid > div[data-highlight] strong { color: var(--ca-blue); }
.comment-auto-usage p { color: var(--ca-text-2); font-size: 11px; line-height: 1.4; }
.comment-auto-usage-note { color: var(--ca-text-3); font-size: 10px; line-height: 1.4; }

/* Respostas nas últimas 24h */
.comment-auto-replies-24h {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--ca-card);
  box-shadow: var(--ca-card-shadow);
  grid-area: replies;
}
.comment-auto-replies-24h > strong { color: var(--ca-text); font-size: 13px; font-weight: 600; }
.comment-auto-replies-24h-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.comment-auto-replies-24h-grid > div { display: grid; align-content: center; gap: 0; min-width: 0; padding: 6px 10px; border: 0; border-radius: 10px; background: var(--ca-fill); }
.comment-auto-replies-24h-grid span { color: var(--ca-text-3); font-size: 10px; font-weight: 500; }
.comment-auto-replies-24h-grid strong { color: var(--ca-text); font-size: 18px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.comment-auto-replies-24h > small { color: var(--ca-text-3); font-size: 10px; line-height: 1.35; }

/* Prompt, Pix e chave */
.comment-auto-instructions {
  padding: 9px 12px;
  border-radius: 13px;
  background: var(--ca-card);
  box-shadow: var(--ca-card-shadow);
}

.comment-auto-instructions summary {
  color: var(--ca-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.comment-auto-instructions[open] summary { margin-bottom: 8px; }
.comment-auto-instructions textarea { min-height: 150px; margin-top: 5px; resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 11.5px; line-height: 1.5; }
.comment-auto-instructions > small,
.comment-auto-field > small { color: var(--ca-text-3); font-size: 10px; font-weight: 400; line-height: 1.35; }
.comment-auto-instructions-column { display: grid; align-content: start; gap: 8px; min-width: 0; grid-area: instructions; }
.comment-auto-pix-field {
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--ca-card);
  box-shadow: var(--ca-card-shadow);
}
.comment-auto-api-key-field {
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--ca-card);
  box-shadow: var(--ca-card-shadow);
  grid-area: apikey;
}
.comment-auto-api-key-field > label { color: var(--ca-text-2); font-size: 12px; font-weight: 600; }
.comment-auto-file-label { margin-top: 2px; color: var(--ca-text-2); font-size: 11px; font-weight: 600; }
.comment-auto-api-key-field input[type="file"] { padding: 3px; font-size: 11px; }
.comment-auto-api-key-field input[type="file"]::file-selector-button {
  margin-right: 8px;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 122, 255, .1);
  color: var(--ca-blue);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .16s ease;
}
.comment-auto-api-key-field input[type="file"]::file-selector-button:hover { background: rgba(0, 122, 255, .18); }
.comment-auto-form-status { grid-area: status; }
.comment-auto-key-status { color: #b25e00 !important; }
.comment-auto-key-status[data-state="ready"] { color: #248a3d !important; }
.comment-auto-key-status[data-state="missing"] { color: #b25e00 !important; }

.comment-auto-form-status {
  padding: 0 4px;
  color: var(--ca-text-2);
  font-size: 12px;
  line-height: 1.4;
}
/* Sem mensagem, a linha de status não ocupa espaço nem gera intervalo. */
.comment-auto-form-status:empty { display: none; }
.comment-auto-now-note { margin: 0; padding: 0 4px; color: var(--ca-text-3); font-size: 10px; line-height: 1.35; }

/* Rodapé */
.comment-auto-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
  margin: 0;
  padding: 10px 20px 12px;
  border-top: .5px solid var(--ca-line);
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
}

.comment-auto-cancel,
.comment-auto-run-now,
.comment-auto-save {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  cursor: pointer;
  transition: background-color .16s ease, transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.comment-auto-cancel:active,
.comment-auto-run-now:active:not(:disabled),
.comment-auto-save:active:not(:disabled) { transform: scale(.97); }

.comment-auto-cancel { background: rgba(120, 120, 128, .16); color: var(--ca-text); }
.comment-auto-cancel:hover { background: rgba(120, 120, 128, .24); }
.comment-auto-run-now { background: rgba(0, 122, 255, .12); color: var(--ca-blue); }
.comment-auto-run-now:hover:not(:disabled) { background: rgba(0, 122, 255, .2); }
.comment-auto-save { background: var(--ca-blue); box-shadow: 0 3px 10px rgba(0, 122, 255, .3); color: #fff; }
.comment-auto-save:hover:not(:disabled) { background: #0a84ff; box-shadow: 0 5px 14px rgba(0, 122, 255, .38); }
.comment-auto-cancel:focus-visible,
.comment-auto-run-now:focus-visible,
.comment-auto-save:focus-visible,
.comment-auto-close:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(0, 122, 255, .3); }
.comment-auto-run-now:disabled,
.comment-auto-save:disabled { opacity: .55; cursor: wait; }

/* Telas largas: três colunas, tudo visível sem rolagem */
@media (min-width: 961px) {
  .comment-auto-form,
  .comment-auto-form:has(.comment-auto-instructions[open]) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "master channels channels"
      "timing timing replies"
      "timing-note timing-note replies"
      "cycle-summary cycle-summary cycle-summary"
      "usage usage usage"
      "limits model model"
      "instructions apikey apikey"
      "status status status";
  }

  .comment-auto-form:has(.comment-auto-instructions[open]) {
    grid-template-areas:
      "master channels channels"
      "timing timing replies"
      "timing-note timing-note replies"
      "cycle-summary cycle-summary cycle-summary"
      "usage usage usage"
      "limits model model"
      "instructions instructions instructions"
      "apikey apikey apikey"
      "status status status";
  }

  .comment-auto-grid-model { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .comment-auto-grid-model > .comment-auto-field:last-child { grid-column: auto; }

  /* Chave: campo + notas à esquerda, importação de arquivo à direita */
  .comment-auto-api-key-field {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 14px;
    row-gap: 4px;
    align-content: start;
  }
  .comment-auto-api-key-field > :nth-child(-n + 4) { grid-column: 1; }
  .comment-auto-api-key-field > :nth-child(1) { grid-row: 1; }
  .comment-auto-api-key-field > :nth-child(2) { grid-row: 2; }
  .comment-auto-api-key-field > :nth-child(3) { grid-row: 3; }
  .comment-auto-api-key-field > :nth-child(4) { grid-row: 4; }
  .comment-auto-api-key-field > :nth-child(n + 5) { grid-column: 2; }
  .comment-auto-api-key-field > :nth-child(5) { grid-row: 1; }
  .comment-auto-api-key-field > :nth-child(6) { grid-row: 2; }
  .comment-auto-api-key-field > :nth-child(7) { grid-row: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .comment-auto-overlay,
  .comment-auto-dialog { animation: none; }
  .comment-auto-switch-row input[type="checkbox"],
  .comment-auto-switch-row input[type="checkbox"]::after { transition: none; }
}

@media (max-width: 760px) {
  .comment-auto-home-countdown { min-width: 0; max-width: 118px; padding: 5px 7px; }
  .comment-auto-home-countdown strong { font-size: 10px; }
  .comment-auto-overlay { padding: 10px; }
  .comment-auto-dialog { width: 100%; max-height: calc(100dvh - 20px); border-radius: 20px; }
  .comment-auto-dialog-header { padding: 12px 14px; }
  .comment-auto-form {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "master" "channels" "timing" "timing-note" "replies" "cycle-summary" "usage" "limits" "model" "instructions" "apikey" "status";
    gap: 8px;
    padding: 10px 14px 14px;
  }
  .comment-auto-form:has(.comment-auto-instructions[open]) {
    grid-template-areas: "master" "channels" "timing" "timing-note" "replies" "cycle-summary" "usage" "limits" "model" "instructions" "apikey" "status";
  }
  .comment-auto-cycle-summary { grid-template-columns: minmax(0, 1fr); }
  .comment-auto-cycle-summary > strong,
  .comment-auto-cycle-summary > small,
  .comment-auto-cycle-summary > p,
  .comment-auto-cycle-summary > .comment-auto-clear-error { grid-column: 1; grid-row: auto; }
  .comment-auto-grid { grid-template-columns: 1fr; }
  .comment-auto-grid-limits { grid-template-columns: minmax(0, 1fr); }
  .comment-auto-channel-group { grid-template-columns: 1fr; }
  .comment-auto-actions { display: grid; grid-template-columns: 1fr 1fr; padding: 10px 14px 14px; }
  .comment-auto-save { grid-column: 1 / -1; }
}
