/* ================================================================
   RESPONSE UI & DECISION CARDS
   ================================================================ */
.card.waiting { animation: subtlePulse 3s ease-in-out infinite; }

/* Responded: stop animation, freeze inputs */
.card.responded {
  animation: none;
}

.card.responded .select-col input[type="checkbox"] {
  pointer-events: none;
  opacity: 0.5;
}

.card.responded .form-field input,
.card.responded .form-field select,
.card.responded .form-field textarea,
.card.responded .question-option,
.card.responded .question-other-input {
  pointer-events: none;
  opacity: 0.6;
}

/* Response UI panel */
.card-response-ui {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.response-prompt {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.response-message-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  resize: vertical;
  min-height: 36px;
  max-height: 120px;
  outline: none;
  transition: border-color 0.15s;
}

.response-message-input:focus { border-color: var(--accent); }

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

.response-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.response-btn-confirm {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.response-btn-confirm:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.response-btn-skip {
  background: var(--bg);
  color: var(--text-muted);
}

.response-btn-skip:hover {
  background: var(--bg-header);
  color: var(--text);
}

.response-timeout {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
}

/* ================================================================
   FORM FIELDS — generic container styles
   ================================================================ */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 0;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.form-field input[type="text"] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

.form-field input[type="text"]:focus {
  border-color: var(--accent);
}

/* Question field */
.question-header {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border: var(--border-width) solid var(--border);
  background: var(--bg-header);
  margin-bottom: 4px;
}

.question-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.question-option {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: var(--border-width) solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  transition: background-color 0.15s, transform 0.1s, box-shadow 0.1s;
}

.question-option:hover {
  background: var(--bg-header);
}

.question-option.selected {
  background: var(--text);
  color: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.question-option.selected .question-option-label {
  color: var(--card-bg);
}

.question-option.selected .question-option-desc {
  color: color-mix(in srgb, var(--card-bg) 70%, transparent);
}

.question-option.selected input[type="radio"],
.question-option.selected input[type="checkbox"] {
  border-color: var(--card-bg);
  background: var(--text);
}

.question-option.selected input[type="radio"]:checked {
  background: radial-gradient(circle at center, var(--text) 0 34%, var(--card-bg) 40%);
}

.question-option.selected input[type="checkbox"]:checked {
  background-color: var(--card-bg);
}

.question-option.selected input[type="checkbox"]:checked::after {
  border-color: var(--text);
}

.question-option input[type="radio"],
.question-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 1px 0 0 0;
  border: var(--border-width) solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}

.question-option input[type="radio"] {
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.question-option input[type="radio"]:checked {
  background: radial-gradient(circle at center, var(--card-bg) 0 34%, var(--text) 40%);
}

.question-option input[type="checkbox"]:checked {
  background-color: var(--text);
}

.question-option input[type="checkbox"]:checked::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid var(--card-bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.question-option input[type="radio"]:hover,
.question-option input[type="checkbox"]:hover {
  border-color: var(--text);
}

.question-option-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.question-option-desc {
  width: 100%;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  padding-left: 24px;
  margin-top: -2px;
}

.question-other-input {
  flex: 1;
  min-width: 120px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

.question-other-input:focus {
  border-color: var(--accent);
}

.question-option.selected .question-other-input {
  background: color-mix(in srgb, var(--card-bg) 15%, var(--text));
  border-color: var(--card-bg);
  color: var(--card-bg);
}

.question-option.selected .question-other-input::placeholder {
  color: color-mix(in srgb, var(--card-bg) 50%, transparent);
}

/* Frozen form (confirmed) */
.form-frozen {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
}

.form-frozen-item {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.form-frozen-item .frozen-label {
  color: var(--text-muted);
}

.form-frozen-item .frozen-value {
  font-weight: 500;
}

.form-frozen-item .frozen-desc {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 1px;
}

/* Decision note (additional message on completed decision cards) */
.decision-note {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-muted);
  border-left: 2px solid var(--border);
  font-style: italic;
}

/* Controls bar for hybrid cards */
.card-controls-bar {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.card-controls-bar .form-fields {
  gap: 10px;
}

/* Table row checkboxes for selection */
.table-wrapper th.select-col,
.table-wrapper td.select-col {
  width: 32px;
  text-align: center;
  padding: 5px 4px;
}

.table-wrapper td.select-col input[type="checkbox"],
.table-wrapper th.select-col input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 2px solid var(--border);
  border-radius: 0;
  background: var(--card-bg);
  box-shadow: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}

.table-wrapper td.select-col input[type="checkbox"]:hover,
.table-wrapper th.select-col input[type="checkbox"]:hover {
  border-color: var(--text);
}

.table-wrapper td.select-col input[type="checkbox"]:checked,
.table-wrapper th.select-col input[type="checkbox"]:checked {
  background-color: var(--text);
  box-shadow: none;
}

.table-wrapper td.select-col input[type="checkbox"]:checked::after,
.table-wrapper th.select-col input[type="checkbox"]:checked::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid var(--card-bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-bottom: 2px;
}

.table-wrapper td.select-col input[type="checkbox"]:focus-visible,
.table-wrapper th.select-col input[type="checkbox"]:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--highlight) 75%, transparent);
  outline-offset: 1px;
}
