/* Keep the heading and save action in view while the settings scroll. */
#autoReplyForm {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: var(--ink, #20211f);
  font-size: 14px;
  line-height: 1.5;
}
.reply-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#autoReplyForm p {
  margin: 0;
  color: var(--muted, #60615c);
  font-size: 14px;
  line-height: 1.5;
}
.reply-master {
  padding: 20px 28px;
  border-bottom: 1px solid var(--line, #deded8);
}
#autoReplyForm .reply-master p {
  margin-top: 4px;
}
.reply-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 32px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
}
.reply-switch input {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  flex: none;
  position: relative;
  margin: 0;
  padding: 0;
  width: 36px;
  height: 22px;
  border: 1px solid #a4a59e;
  background: #b2b3ad;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.reply-switch input::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform 120ms ease;
}
.reply-switch input:checked {
  border-color: #242521;
  background: #242521;
}
.reply-switch input:checked::before {
  transform: translateX(14px);
  background: var(--accent, #ffcb35);
}
.reply-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(280px, 1fr);
}
.reply-messages,
.reply-schedule {
  min-width: 0;
  padding: 24px 28px;
}
.reply-messages {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.reply-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.reply-field > span,
.reply-days legend {
  color: var(--muted, #60615c);
  font-weight: 500;
}
.reply-messages .reply-field > span {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink, #20211f);
}
#autoReplyForm textarea,
.reply-schedule input:not([type="checkbox"]) {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 8px 12px;
  margin: 0;
  border: 1px solid #c9cac4;
  border-radius: 8px;
  background: white;
  color: var(--ink, #20211f);
  font: inherit;
  outline-offset: 2px;
}
#autoReplyForm textarea {
  min-height: 88px;
  padding: 12px;
  font-size: 15px;
  line-height: 1.5;
  resize: vertical;
}
.reply-exception {
  border-top: 1px solid var(--line, #deded8);
  padding-top: 16px;
}
.reply-exception p {
  padding-bottom: 12px;
}
.reply-schedule {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  background: #f7f7f4;
  border-left: 1px solid var(--line, #deded8);
}
.reply-schedule h3 {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  margin: 0;
}
.reply-days {
  padding: 0;
  margin: 0;
  min-width: 0;
  border: 0;
}
.reply-days legend {
  padding: 0;
  margin-bottom: 8px;
}
.day-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.day-picker label {
  position: relative;
  cursor: pointer;
}
.day-picker input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}
.day-picker span {
  display: grid;
  place-items: center;
  height: 36px;
  border-radius: 6px;
  border: 1px solid #d2d3cc;
  color: var(--muted, #60615c);
  background: white;
}
.day-picker input:checked + span {
  border-color: #242521;
  color: white;
  background: #242521;
}
.reply-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.reply-schedule input:not([type="checkbox"]) {
  height: 40px;
  font-variant-numeric: tabular-nums;
}
#autoReplyForm .reply-shift-hint {
  font-size: 13px;
}
#autoReplyForm footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex: 0 0 auto;
  border-top: 1px solid var(--line, #deded8);
  padding: 16px 28px max(16px, env(safe-area-inset-bottom));
  background: white;
}
#autoReplyStatus {
  color: var(--muted, #60615c);
  font-size: 14px;
}
#saveAutoReply {
  flex-shrink: 0;
  min-height: 40px;
  padding: 8px 20px;
  color: var(--ink, #20211f);
  background: var(--accent, #ffcb35);
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 600;
}
#saveAutoReply:hover {
  background: #f6c02b;
}
#autoReplyForm :is(input, textarea, button):focus-visible,
.day-picker input:focus-visible + span {
  outline: 2px solid #775707;
  outline-offset: 2px;
}
@media (max-width: 720px) {
  .reply-layout {
    display: block;
  }
  .reply-master,
  .reply-messages,
  .reply-schedule {
    padding: 16px 20px;
  }
  .reply-switch {
    min-height: 40px;
  }
  .reply-schedule {
    border-left: 0;
    border-top: 1px solid var(--line, #deded8);
  }
  .day-picker span,
  #saveAutoReply {
    min-height: 44px;
  }
  .reply-schedule input:not([type="checkbox"]),
  #autoReplyForm textarea {
    font-size: 16px;
  }
  #autoReplyForm footer {
    padding: 12px 20px max(12px, env(safe-area-inset-bottom));
  }
}
@media (prefers-reduced-motion: reduce) {
  .reply-switch input, .reply-switch input::before {
    transition: none;
  }
}
