/* Account Catcher: compact settings cards and a quiet Discord preview. */
body:has(.feature-editor-workspace) #main {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 32px 72px;
}
.editor-back-link {
  margin-bottom: 20px;
  color: #bec6d2;
  font-size: 12px;
}
body:has(.feature-editor-workspace) .page-heading {
  margin-bottom: 32px;
}
body:has(.feature-editor-workspace) .page-heading h1 {
  font-size: 30px;
  letter-spacing: -0.6px;
}
body:has(.feature-editor-workspace) .page-heading p {
  line-height: 1.6;
  max-width: 640px;
}
.feature-editor-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.feature-editor-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}
.feature-editor-content .feature-editor-section {
  margin: 0;
}
.feature-editor-content .feature-editor-section + .feature-editor-section {
  margin: 0;
}
.feature-editor-workspace .settings-layout {
  display: block;
  margin: 0;
}
.feature-editor-workspace .feature-card-stack,
.feature-editor-workspace #feature-response .feature-card-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
  overflow: visible;
}
.feature-editor-workspace .feature-card-stack > .panel {
  width: 100%;
  margin: 0;
  padding: 20px;
  border: 1px solid #444a54;
  border-radius: 12px;
  background: #2b3038;
  box-shadow: none;
}
.feature-editor-workspace
  .feature-card-stack
  > .panel:not(.individual-feature) {
  border: 0;
  background: transparent;
  padding: 0 2px 2px;
}
.feature-editor-workspace .feature-card-stack > .panel h2 {
  color: #f4f5f7;
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
}
.feature-editor-workspace .feature-card-stack > .individual-feature:hover,
.feature-editor-workspace
  .feature-card-stack
  > .individual-feature:focus-within,
.feature-editor-workspace .feature-card-stack > .individual-feature:active {
  background: #2b3038;
  border-color: #444a54;
  box-shadow: none;
  transform: none;
}
.feature-editor-workspace .feature-disclosure,
.feature-editor-workspace .wide-feature .feature-disclosure {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  margin: 0;
}
.feature-editor-workspace .feature-disclosure > header {
  padding: 0;
  margin: 0;
  cursor: default;
}
.feature-editor-workspace .feature-disclosure > header strong,
.feature-editor-workspace .toggle-row strong {
  font-size: 13px;
  font-weight: 600;
  color: #edf0f5;
  line-height: 1.5;
}
.feature-editor-workspace .field {
  margin: 0;
  width: 100%;
  min-width: 0;
}
.feature-editor-workspace .channel-message-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.feature-editor-workspace
  .channel-message-group
  .field
  > span:not(.themed-select) {
  display: block;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
  color: #c7ced9;
}
.feature-editor-workspace input[type="text"],
.feature-editor-workspace textarea,
.feature-editor-workspace .select-trigger,
.feature-editor-workspace .exemption-dropdown summary {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #22262e;
  border: 1px solid #454c58;
  color: #e8ecf2;
  font-size: 13px;
  box-shadow: none;
}
.feature-editor-workspace input[type="text"]:focus,
.feature-editor-workspace textarea:focus,
.feature-editor-workspace .select-trigger:focus {
  border-color: #454c58;
  background: #22262e;
  box-shadow: none;
  outline: none;
}
.feature-editor-workspace :is(input, textarea, button, summary):focus-visible {
  outline: 2px solid #aeb8c8;
  outline-offset: 3px;
}
.feature-editor-workspace textarea {
  min-height: 120px;
  line-height: 1.6;
  resize: vertical;
}
.feature-editor-workspace .toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  gap: 20px;
  border: 0;
  background: transparent;
}
.feature-editor-workspace .toggle-row input {
  width: 36px;
  flex-shrink: 0;
}
.feature-editor-workspace #footer-fields {
  margin: 0;
}
.feature-editor-companion {
  position: sticky;
  top: 100px;
  height: auto;
  min-width: 0;
  max-height: none;
}
.feature-editor-companion .editor-preview-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  max-height: none;
  overflow: visible;
}
.feature-editor-companion .editor-preview-panel > h2 {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: #bac3d0;
  letter-spacing: 0.2px;
}
.feature-editor-companion #notice-preview {
  border-radius: 12px;
  overflow: hidden;
}
@media (max-width: 1000px) {
  .feature-editor-workspace {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .feature-editor-companion {
    position: static;
  }
}
@media (max-width: 600px) {
  body:has(.feature-editor-workspace) #main {
    padding: 28px 20px 48px;
  }
  .feature-editor-workspace .feature-card-stack > .panel {
    padding: 16px;
  }
}

/* Task-based setup: expand only the group you want to change. */
.guided-setup .setup-step {
  background: #2b3038;
  border: 1px solid #444a54;
  border-radius: 14px;
  overflow: visible;
}
.guided-setup .setup-step > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  cursor: pointer;
  list-style: none;
}
.guided-setup .setup-step > summary::-webkit-details-marker {
  display: none;
}
.guided-setup .setup-step > summary h2 {
  margin: 0 0 6px;
  color: #f3f5f8;
  font-size: 17px;
}
.guided-setup .setup-step > summary p {
  margin: 0;
  color: #b5becc;
  font-size: 13px;
  line-height: 1.6;
}
.guided-setup .setup-step-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: #b5becc;
  transform-origin: center;
  transition: transform 0.18s;
}
.guided-setup .setup-step-chevron svg {
  display: block;
  width: 20px;
  height: 20px;
}
.guided-setup .setup-step[open] .setup-step-chevron {
  transform: rotate(180deg);
}
.guided-setup .setup-step-content {
  padding: 0 24px 24px;
}
.guided-setup .setup-step-content .form-panel {
  padding: 0;
  margin: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.guided-setup .setup-step-content .field > span:not(.themed-select) {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  color: #e7ecf3;
  font-weight: 600;
}
.guided-setup .setup-step-content #footer-fields {
  margin: 0;
}
.guided-setup .setup-step-content .locked-banner {
  margin-bottom: 20px;
}
.guided-setup .setup-step-content .info-card {
  display: none;
}
.guided-setup .setup-step > summary:focus-visible {
  outline: 2px solid #adb8c8;
  outline-offset: 3px;
  border-radius: 14px;
}
@media (max-width: 600px) {
  .guided-setup .setup-step > summary {
    padding: 20px;
  }
  .guided-setup .setup-step-content {
    padding: 0 20px 20px;
  }
}

.guided-setup .setup-channel-group,
.guided-setup .setup-message-group {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  background: #22262e;
  border-radius: 10px;
  min-width: 0;
}
@media (max-width: 600px) {
  .guided-setup .setup-channel-group,
  .guided-setup .setup-message-group {
    padding: 16px;
  }
}

/* One spacing rhythm throughout Channel and Message. */
.guided-setup #feature-channel .setup-step-content {
  padding-top: 0;
}
.guided-setup #feature-channel .form-panel {
  gap: 20px;
}
.guided-setup #feature-channel :is(.setup-channel-group, .setup-message-group) {
  padding: 20px;
  gap: 20px;
}
.guided-setup #feature-channel .field {
  margin: 0;
  padding: 0;
}
.guided-setup #feature-channel .field > span:not(.themed-select) {
  margin: 0 0 10px;
  line-height: 1.5;
}
.guided-setup #feature-channel #footer-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0;
  margin: 0;
}
.guided-setup #feature-channel .themed-select {
  margin: 0;
}

/* Footer label and style selector share a centred header row. */
.footer-editor {
  position: relative;
  min-width: 0;
  width: 100%;
}
.feature-editor-workspace .footer-style-switch {
  position: absolute;
  top: 0;
  right: 0;
  height: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  border: 1px solid #454c58;
  border-radius: 8px;
  background: #22262e;
  overflow: hidden;
  cursor: pointer;
  box-sizing: border-box;
}
.feature-editor-workspace .footer-style-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  z-index: 1;
  cursor: pointer;
}
.feature-editor-workspace .footer-style-switch span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: #b5becc;
}
.feature-editor-workspace
  .footer-style-switch
  input:not(:checked)
  ~ .footer-style-text,
.feature-editor-workspace
  .footer-style-switch
  input:checked
  ~ .footer-style-image {
  color: #29230e;
  background: #ffe16b;
}
.feature-editor-workspace .footer-style-switch:has(input:focus-visible) {
  outline: 2px solid #aeb8c8;
  outline-offset: 3px;
}
.feature-editor-workspace .footer-style-switch:has(input:disabled) {
  opacity: 0.55;
}
.feature-editor-workspace .footer-style-switch input:disabled {
  cursor: not-allowed;
}
.guided-setup
  #feature-channel
  .footer-editor
  .field
  > span:not(.themed-select) {
  display: flex;
  align-items: center;
  min-height: 32px;
  margin: 0 0 10px;
  padding-right: 140px;
  box-sizing: border-box;
}

/* Shared spacing for every setup section. */
.guided-setup .feature-editor-content {
  gap: 20px;
}
.guided-setup .setup-step > summary {
  padding: 20px;
}
.guided-setup .setup-step-content {
  padding: 0 20px 20px;
}
.guided-setup .setup-step-content .form-panel {
  gap: 20px;
}
.guided-setup .setup-step-content .field {
  margin: 0;
  padding: 0;
}
.guided-setup .setup-step-content .field > span:not(.themed-select) {
  display: block;
  margin: 0 0 10px;
  line-height: 1.5;
}
.guided-setup .setup-step-content .themed-select {
  margin: 0;
}
.guided-setup .setup-step-content .toggle-row {
  margin: 0;
  padding: 0;
}
.guided-setup .setup-step-content .selected-exempt-roles {
  margin: 0 0 10px;
  gap: 8px;
}
.guided-setup .setup-step-content .exemption-dropdown {
  margin: 0;
}
.guided-setup
  #feature-channel
  .footer-editor
  .field
  > span:not(.themed-select) {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

/* Match field and toggle labels to the footer's 32px title row. */
.guided-setup .setup-step-content .field > span:not(.themed-select) {
  display: flex;
  align-items: center;
  min-height: 32px;
  box-sizing: border-box;
  margin: 0 0 10px;
  line-height: 1.5;
}
.guided-setup .setup-step-content .toggle-row {
  min-height: 32px;
  align-items: center;
}
.guided-setup .setup-step-content .toggle-row strong {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  line-height: 1.5;
}

.guided-setup #feature-channel :is(.setup-channel-group, .setup-message-group) {
  background: #22262e;
}
.guided-setup #feature-channel.setup-step {
  background: transparent;
}

/* Centre the footer selector and give message editing more room. */
.guided-setup .footer-style-switch {
  top: 16px;
  transform: translateY(-50%);
  align-items: stretch;
}
.guided-setup .footer-style-switch span {
  height: 24px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  padding-bottom: 0;
}
.guided-setup textarea[data-field="noticeMessage"] {
  min-height: 190px;
  height: 190px;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  resize: vertical;
  scrollbar-width: thin;
  scrollbar-color: #697382 #22262e;
}
.guided-setup textarea[data-field="noticeMessage"]::-webkit-scrollbar {
  width: 8px;
}
.guided-setup textarea[data-field="noticeMessage"]::-webkit-scrollbar-track {
  background: #22262e;
  border-radius: 8px;
}
.guided-setup textarea[data-field="noticeMessage"]::-webkit-scrollbar-thumb {
  background: #697382;
  border: 2px solid #22262e;
  border-radius: 8px;
}
.guided-setup
  textarea[data-field="noticeMessage"]::-webkit-scrollbar-thumb:hover {
  background: #8993a2;
}

.guided-setup textarea[data-field="noticeMessage"] {
  resize: none;
  height: 190px;
  min-height: 190px;
  max-height: 190px;
  overflow-y: auto;
}

/* Let each segment fill the available inner height without overflowing. */
.feature-editor-workspace .footer-style-switch {
  align-items: stretch;
  grid-template-rows: minmax(0, 1fr);
}
.feature-editor-workspace .footer-style-switch span {
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: normal;
  box-sizing: border-box;
}

/* Setup dropdowns use the same inset surface as the channel settings. */
.setup-select-popup {
  background: #22262e;
  border: 1px solid #454c58;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 12px 28px #00000035;
  scrollbar-width: thin;
  scrollbar-color: #697382 #22262e;
}
.setup-select-popup .select-option {
  background: transparent;
  color: #e7ecf3;
  border: 0;
  border-radius: 6px;
  padding: 11px 12px;
  min-height: 40px;
  font-size: 13px;
}
.setup-select-popup .select-option:hover,
.setup-select-popup .select-option:focus-visible {
  background: #343b46;
  color: #f3f5f8;
}
.setup-select-popup .select-option[aria-selected="true"] {
  background: #3a3526;
  color: #ffe16b;
}

/* All three sections share the same outer and inset surfaces. */
.guided-setup .setup-step {
  background: transparent;
}
.guided-setup
  :is(#feature-response, #feature-logging)
  .setup-step-content
  .form-panel {
  padding: 20px;
  background: #22262e;
  border-radius: 10px;
  gap: 20px;
}
.guided-setup
  :is(#feature-response, #feature-logging)
  .setup-step-content
  .form-panel:hover,
.guided-setup
  :is(#feature-response, #feature-logging)
  .setup-step-content
  .form-panel:focus-within {
  background: #22262e;
  box-shadow: none;
}

.guided-setup .exempt-roles-field > span {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}

/* All setup labels use one left-aligned title row and control gap. */
.guided-setup .setup-step-content .form-panel,
.guided-setup .setup-step-content .focused-form {
  text-align: left;
  align-items: stretch;
}
.guided-setup .setup-step-content .field > span:not(.themed-select),
.guided-setup #feature-channel .field > span:not(.themed-select),
.guided-setup
  #feature-channel
  .footer-editor
  .field
  > span:not(.themed-select) {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
  min-height: 32px;
  margin: 0 0 10px;
  line-height: 1.5;
  box-sizing: border-box;
}
.guided-setup .setup-step-content .field > .themed-select,
.guided-setup .setup-step-content .exemption-control {
  margin-top: 0;
}

/* Neutral selections match the rest of the setup controls. */
.guided-setup .exempt-role-chip {
  background: #343b46;
  border-color: #454c58;
  color: #e7ecf3;
}
.feature-editor-workspace
  .footer-style-switch
  input:not(:checked)
  ~ .footer-style-text,
.feature-editor-workspace
  .footer-style-switch
  input:checked
  ~ .footer-style-image {
  background: #414955;
  color: #f3f5f8;
}

/* Preview and live settings overview share the setup surfaces. */
.guided-setup .feature-editor-companion {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.guided-setup .feature-editor-companion .editor-preview-panel,
.guided-setup .setup-overview {
  padding: 20px;
  background: #22262e;
  border: 1px solid #454c58;
  border-radius: 12px;
}
.guided-setup .editor-preview-panel > h2,
.guided-setup .setup-overview > h2 {
  margin: 0 0 20px;
  font-size: 15px;
  color: #edf0f5;
}
.guided-setup .notice-preview.discord-message-preview {
  background: transparent;
  padding: 0;
}
.guided-setup .discord-v2-container {
  background: #2b3038;
  border-color: #454c58;
}
.guided-setup .notice-count-button {
  background: #343b46;
  border-color: #454c58;
  color: #edf0f5;
}
.guided-setup .setup-overview dl {
  margin: 0;
}
.guided-setup .setup-overview dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #ffffff0c;
}
.guided-setup .setup-overview dl > div:first-child {
  padding-top: 0;
}
.guided-setup .setup-overview dl > div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}
.guided-setup .setup-overview dt {
  color: #aeb8c8;
  font-size: 12px;
  line-height: 1.6;
}
.guided-setup .setup-overview dd {
  margin: 0;
  color: #edf0f5;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.guided-setup .discord-v2-container {
  border: 0;
  box-shadow: none;
}

.guided-setup .feature-editor-companion .editor-preview-panel,
.guided-setup .notice-preview.discord-message-preview,
.guided-setup #notice-preview {
  border: 0;
  box-shadow: none;
}

.guided-setup .notice-count-button:disabled {
  opacity: 1;
  cursor: default;
  pointer-events: none;
}

/* Locked Premium inputs all share the same subdued surface. */
.guided-setup input[type="text"]:disabled,
.guided-setup textarea:disabled,
.guided-setup .select-trigger:disabled {
  background: #1b1f26;
  border-color: #353c47;
  color: #808b9b;
  opacity: 1;
  cursor: not-allowed;
  -webkit-text-fill-color: #808b9b;
}
.guided-setup .toggle-row:has(input:disabled) .badge {
  background: #343b46;
  border: 1px solid #454c58;
  color: #b5becc;
  font-size: 10px;
}

/* Centre dropdown chevrons independently of control height. */
.guided-setup .select-trigger { position: relative; padding-right: 38px; }
.guided-setup .select-trigger::after {
  top: 50%;
  right: 16px;
  margin: 0;
  transform: translateY(-50%) rotate(45deg);
  transform-origin: center;
}
.guided-setup .exemption-dropdown summary { align-items: center; }
.guided-setup .exemption-dropdown summary svg {
  display: block;
  align-self: center;
  flex: 0 0 16px;
  margin: 0;
}

.guided-setup .premium-feature-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  margin-left: auto;
  border: 1px solid #ffe16b;
  border-radius: 6px;
  background: transparent;
  color: #ffe16b;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.guided-setup .field > span:not(.themed-select),
.guided-setup .toggle-row strong { gap: 12px; }
.guided-setup .toggle-row > div { flex: 1; min-width: 0; }

/* Premium badges appear only at the right end of the setting title row. */
.guided-setup .field > span:not(.themed-select),
.guided-setup .toggle-row strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.guided-setup .premium-feature-tag {
  flex: 0 0 auto;
  width: auto;
  margin-left: auto;
  border: 1px solid #ffe16b;
  background: transparent;
  color: #ffe16b;
}

.guided-setup .feature-editor-companion .editor-preview-panel {
  border: 1px solid #454c58;
  border-radius: 12px;
}

.guided-setup .exemption-dropdown[data-premium-locked="true"] > summary,
.guided-setup .exemption-dropdown[data-premium-locked="true"] > summary:hover {
  background: #1b1f26;
  border-color: #353c47;
  color: #808b9b;
  cursor: not-allowed;
  box-shadow: none;
}

/* Discord image gallery preview: keep the entire image in proportion. */
.discord-image-preview { width: 100%; min-height: 64px; overflow: hidden; border-radius: 8px; }
.discord-image-preview .discord-footer-image { width: 100%; height: auto; max-width: 100%; max-height: 320px; object-fit: contain; object-position: left center; border-radius: 8px; }
.discord-image-status { display: block; padding: 18px 0; color: #aeb8c7; font-size: 13px; line-height: 1.5; }
.discord-image-preview.image-ready .discord-image-status { display: none; }
.discord-image-preview:not(.image-ready) img { display: none; }
.discord-image-preview.image-failed img { display: none; }
