/* QuestionCard — AgentBro-style with numbered options, custom input, multi-select */

.overlay-card.overlay-card--question {
  --question-accent: var(--island-warning);
  --question-panel: var(--island-bg);
  --question-surface: color-mix(in srgb, var(--island-card) 88%, var(--question-accent) 5%);
  --question-border: color-mix(in srgb, var(--island-border) 78%, var(--question-accent) 22%);
  --approval-context-font-size: 12px;
  --approval-context-line-height: 1.18;
  --approval-meta-font-size: 11px;
  --approval-meta-line-height: 1.28;
  --approval-title-font-size: 13px;
  --approval-title-line-height: 1.18;
  --approval-body-font-size: 12px;
  --approval-body-line-height: 1.4;
  --approval-caption-font-size: 11px;
  --approval-control-font-size: 12px;
  gap: 9px;
  width: 100%;
  min-height: 0;
  padding: 12px 16px 14px;
  border: 0;
  border-radius: 0 0 26px 26px;
  background: var(--question-panel);
  box-shadow: none;
}

.overlay-card--question .overlay-card__header {
  align-items: flex-start;
  min-height: 34px;
}

.overlay-card--question .overlay-card__close {
  width: 24px;
  height: 24px;
  color: var(--island-text-secondary);
  background: var(--island-subtle);
}

.overlay-card--question .overlay-ctx {
  gap: 2px;
}

.overlay-card--question .overlay-ctx__row1 {
  gap: 7px;
  font-size: var(--approval-context-font-size);
  font-weight: 800;
  line-height: var(--approval-context-line-height);
  color: var(--island-text);
}

.overlay-card--question .overlay-ctx__row1 .pixel-indicator {
  margin-right: 3px;
  transform: scale(1.45);
  transform-origin: center;
}

.overlay-card--question .overlay-ctx__sep,
.overlay-card--question .overlay-ctx__agent {
  color: var(--island-text-secondary);
  opacity: 1;
}

.overlay-card--question .overlay-ctx__row2 {
  gap: 4px;
  font-size: var(--approval-meta-font-size);
  font-weight: 700;
  line-height: var(--approval-meta-line-height);
  color: var(--island-text-muted);
}

.overlay-card--question .overlay-ctx__you {
  color: var(--island-text-secondary);
  font-weight: 800;
}

.overlay-card--question .overlay-ctx__msg {
  max-width: 430px;
}

.overlay-card--question .overlay-card__body {
  overflow: auto;
}

.question-card {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 8px;
}

.question-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.question-card__header-icon {
  color: var(--question-accent);
  flex-shrink: 0;
  width: 17px;
  height: 17px;
}

.question-card__header-title {
  font-size: var(--approval-title-font-size);
  font-weight: 800;
  line-height: var(--approval-title-line-height);
  color: var(--question-accent);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-card__header-count {
  font-size: var(--approval-title-font-size);
  font-weight: 700;
  line-height: var(--approval-title-line-height);
  color: var(--island-text-secondary);
  flex-shrink: 0;
}

.question-card__header-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.question-card__multi-badge {
  font-size: var(--approval-caption-font-size);
  font-weight: 750;
  color: var(--island-warning-text);
  background: var(--island-warning-bg);
  padding: 2px 8px;
  border-radius: 6px;
}

.question-card__text {
  font-size: var(--approval-body-font-size);
  font-weight: 650;
  line-height: var(--approval-body-line-height);
  color: var(--island-text);
  margin-bottom: 0;
}

.question-card__tag {
  color: var(--question-accent);
  margin-right: 6px;
}

.question-card__options {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  overflow: visible;
  padding-right: 2px;
}

/* Option Row — numbered block + label + description + chevron */
.question-card__option-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid var(--question-border);
  border-radius: 8px;
  background: var(--question-surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.question-card__option-row:hover {
  border-color: color-mix(in srgb, var(--question-accent) 42%, var(--question-border));
  background: color-mix(in srgb, var(--island-card-hover) 86%, var(--question-accent) 10%);
}

.question-card__option-row:active {
  transform: scale(0.99);
}

.question-card__option-row--selected {
  border-color: color-mix(in srgb, var(--question-accent) 48%, var(--question-border));
  background: color-mix(in srgb, var(--island-card-hover) 78%, var(--question-accent) 14%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--question-accent) 18%, transparent);
}

.question-card__option-index {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--question-accent) 70%, transparent);
  color: var(--island-on-accent, #ffffff);
  font-size: var(--approval-caption-font-size);
  font-weight: 700;
  flex-shrink: 0;
}

.question-card__option-index--selected {
  background: var(--question-accent);
}

.question-card__option-body {
  flex: 1;
  min-width: 0;
}

.question-card__option-label {
  font-size: var(--approval-body-font-size);
  font-weight: 680;
  line-height: 1.22;
  color: var(--island-text);
  overflow-wrap: anywhere;
}

.question-card__option-desc {
  font-size: var(--approval-caption-font-size);
  font-weight: 540;
  line-height: 1.22;
  color: var(--island-text-secondary);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.question-card__option-chevron {
  flex-shrink: 0;
  color: var(--island-text-muted);
  opacity: 0.7;
  transition: color 0.15s;
}

.question-card__option-row:hover .question-card__option-chevron {
  color: var(--island-warning-text);
}

/* "Other" option row */
.question-card__option-row--other {
  color: var(--island-text-muted);
}

.question-card__option-index--other {
  opacity: 0.6;
}

.question-card__option-row--custom-active {
  cursor: default;
}

.question-card__option-row--custom-active .question-card__input {
  flex: 1;
  min-width: 0;
  margin: 0;
  border-radius: 6px;
}

.question-card__secondary-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
  padding-top: 2px;
}

.question-card__secondary-action {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--island-border) 78%, var(--question-accent) 14%);
  border-radius: 8px;
  background: color-mix(in srgb, var(--island-card) 92%, transparent);
  color: var(--island-text-secondary);
  font: inherit;
  font-size: var(--approval-caption-font-size);
  font-weight: 680;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.question-card__secondary-action:hover {
  border-color: color-mix(in srgb, var(--question-accent) 38%, var(--island-border));
  background: color-mix(in srgb, var(--island-card-hover) 88%, var(--question-accent) 7%);
  color: var(--island-text);
}

/* Input */
.question-card__input {
  width: 100%;
  padding: 8px 10px;
  background: var(--island-input-bg);
  border: 1px solid color-mix(in srgb, var(--question-accent) 30%, var(--island-border));
  border-radius: 8px;
  color: var(--island-text);
  font-family: var(--font-sans, system-ui);
  font-size: var(--approval-control-font-size);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.question-card__input::placeholder {
  color: var(--island-text-muted);
}

.question-card__input:focus {
  border-color: color-mix(in srgb, var(--question-accent) 68%, var(--island-border));
}

.question-card__input[data-has-draft="true"],
.question-card__inline-input[data-has-draft="true"] {
  border-color: color-mix(in srgb, var(--question-accent) 78%, var(--island-border));
  background:
    linear-gradient(90deg, var(--question-accent) 0 3px, transparent 3px),
    var(--island-input-bg);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--question-accent) 20%, transparent);
}

/* Confirm button */
.question-card__confirm {
  width: 100%;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: var(--question-accent);
  color: var(--island-on-accent, #ffffff);
  font-size: var(--approval-control-font-size);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.question-card__confirm:hover {
  filter: brightness(1.06);
}

.question-card__confirm--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Multi-question mode */
.question-card__multi {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.question-card__multi-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 180px;
  overflow-y: auto;
  padding-right: 2px;
}

.question-card__multi-item {
  border: 1px solid var(--question-border);
  border-radius: 8px;
  background: var(--question-surface);
  padding: 7px 9px;
}

.question-card__multi-q {
  font-size: var(--approval-body-font-size);
  font-weight: 650;
  line-height: 1.36;
  color: var(--island-text);
  margin: 0 0 8px 0;
}

.question-card__multi-num {
  font-weight: 700;
  color: var(--question-accent);
  margin-right: 4px;
}

.question-card__multi-tag {
  color: var(--question-accent);
  margin-right: 4px;
}

.question-card__multi-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.question-card__chip {
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--question-accent) 22%, var(--island-border));
  border-radius: 6px;
  background: color-mix(in srgb, var(--island-card-hover) 80%, var(--question-accent) 6%);
  color: var(--island-text);
  font-size: var(--approval-caption-font-size);
  font-weight: 650;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

.question-card__chip:hover {
  border-color: color-mix(in srgb, var(--question-accent) 42%, var(--island-border));
  background: color-mix(in srgb, var(--island-card-hover) 70%, var(--question-accent) 12%);
}

.question-card__chip--selected {
  background: var(--question-accent);
  border-color: var(--question-accent);
  color: var(--island-on-accent, #ffffff);
}

.question-card__chip--checkbox {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.question-card__chip-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 1.5px solid color-mix(in srgb, var(--question-accent) 60%, var(--island-border));
  border-radius: 3px;
  flex-shrink: 0;
  color: transparent;
}

.question-card__chip-check--checked {
  background: var(--island-on-accent, #ffffff);
  border-color: var(--island-on-accent, #ffffff);
  color: var(--question-accent);
}

.question-card__chip:not(.question-card__chip--selected) .question-card__chip-check {
  border-color: color-mix(in srgb, var(--question-accent) 45%, var(--island-border));
}

.question-card__chip--custom {
  background: color-mix(in srgb, var(--island-card-hover) 70%, var(--question-accent) 22%);
  border-color: color-mix(in srgb, var(--question-accent) 45%, var(--island-border));
  color: var(--island-text);
  cursor: default;
}

.question-card__chip--other {
  color: var(--island-text-muted);
  border-style: dashed;
}

.question-card__chip--other:hover {
  color: var(--island-text);
}

.question-card__chip-input {
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--question-accent) 40%, var(--island-border));
  border-radius: 6px;
  background: var(--island-input-bg);
  color: var(--island-text);
  font-size: var(--approval-caption-font-size);
  outline: none;
  min-width: 120px;
  transition: border-color 0.15s;
}

.question-card__chip-input:focus {
  border-color: color-mix(in srgb, var(--question-accent) 68%, var(--island-border));
}

.question-card__chip-input::placeholder {
  color: var(--island-text-muted);
}

.question-card__submit-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: var(--island-warning-bg);
  color: var(--island-warning-text);
  font-size: var(--approval-control-font-size);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

@media (max-width: 760px) {
  .overlay-card.overlay-card--question {
    padding: 12px 14px 14px;
  }

  .overlay-card--question .overlay-ctx__row1 {
    font-size: 12px;
  }

  .question-card__header-title {
    font-size: 13px;
  }

  .overlay-card--question .overlay-ctx__row2,
  .question-card__text {
    font-size: 11.5px;
  }
}

.question-card__submit-all:hover {
  background: color-mix(in srgb, var(--island-warning-bg) 72%, var(--question-accent) 16%);
  color: var(--island-text);
}

.question-card__error {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--island-warning-text);
}

/* Legacy support — keep question-card__shortcut/check for backwards compat */
.question-card__check {
  font-size: 14px;
  flex-shrink: 0;
}

.question-card__shortcut {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  opacity: 0.5;
  flex-shrink: 0;
}
