/* carvel page — the decision cards a Helmsman posts with carvel ask.
   The cards stand in one strip under the chat header, above the messages.
   Each is a folded line until it is pressed; the amber mark and the count
   stay in view while the log scrolls. */
/* The card wears the "waits for the owner" amber of an order that needs a press. */

#question-cards.question-cards {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  /* Half of the chat view at most: past that the cards scroll inside the strip,
     so the messages and the message box keep the rest, phone included. */
  max-height: 50%;
  margin-bottom: 0.75rem;
}
#question-cards.question-cards[hidden] { display: none; }
/* The strip gives way before the log does: a few lines of the log stay in
   view under the cards. */
#question-cards.question-cards:not([hidden]) + #messages-wrap { min-height: 6rem; }

.question-strip-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  padding: 0.125rem 0 0.5rem;
  font-family: var(--font-label);
  font-size: var(--fs-11, 0.6875rem);
  font-weight: 700;
  letter-spacing: var(--track, 0.1em);
  text-transform: var(--caps, uppercase);
  color: var(--signal-amber);
}
.question-strip-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.question-fold-mark {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--signal-amber);
}

.question-card {
  flex: none;
  border: 1px solid color-mix(in srgb, var(--signal-amber) 55%, transparent);
  background: var(--system-black);
}
.question-card[data-open="true"] { border-color: var(--signal-amber); }

/* The folded line: one tap target that is the whole card at rest. */
.question-fold {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.375rem 0.75rem;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  color: var(--paper-white);
  cursor: pointer;
}
.question-fold:hover { background: color-mix(in srgb, var(--signal-amber) 8%, transparent); }
.question-fold:focus-visible { outline-offset: -2px; }
.question-fold-text,
.question-fold-label {
  flex: 1 1 auto;
  min-width: 0;
}
.question-fold-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.9375rem;
  font-weight: 600;
}
.question-fold-label {
  display: none;
  font-family: var(--font-label);
  font-size: var(--fs-10, 0.625rem);
  letter-spacing: var(--track, 0.1em);
  text-transform: var(--caps, uppercase);
  color: var(--glow-dim);
}
.question-fold[aria-expanded="true"] .question-fold-text { display: none; }
.question-fold[aria-expanded="true"] .question-fold-label { display: block; }
.question-fold-id,
.question-fold-left {
  flex: none;
  font-family: var(--font-label);
  font-size: var(--fs-11, 0.6875rem);
  font-variant-numeric: tabular-nums;
  color: var(--glow-dim);
}
.question-fold-left { color: var(--signal-amber); white-space: nowrap; }
.question-fold-chevron {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin: 0 0.125rem 0.25rem;
  border-right: 2px solid var(--glow-dim);
  border-bottom: 2px solid var(--glow-dim);
  transform: rotate(45deg);
  transition: transform 150ms cubic-bezier(0.22, 1, 0.36, 1);
}
.question-fold[aria-expanded="true"] .question-fold-chevron { margin-bottom: -0.125rem; transform: rotate(225deg); }
@media (prefers-reduced-motion: reduce) { .question-fold-chevron { transition: none; } }

.question-card-body { padding: 0 0.75rem 0.75rem; }
.question-card-body[hidden] { display: none; }
.question-card-text {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--paper-white);
  overflow-wrap: anywhere;
}
.question-card-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}
.question-card-options .question-option { min-width: 0; }
.question-other-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}
.question-other-box[hidden] { display: none; }
.question-other-box .question-other-input { flex: 1 1 14rem; min-width: 0; }
.question-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.question-card-foot .question-note { flex: 1 1 10rem; min-width: 0; }
.question-detail {
  margin-top: 0.75rem;
  padding-top: 0.625rem;
  border-top: 1px solid var(--glow-line);
  font-size: 0.875rem;
  color: var(--paper-white);
  overflow-wrap: anywhere;
}
.question-detail ul, .question-detail ol { padding-left: 1.5rem; }
.question-detail li + li { margin-top: 0.25rem; }
/* A detail has three parts, each under its own heading: why it is asked, why
   it needs the owner, and what each choice means. */
.question-detail :is(h2, h3, h4) {
  margin: 0.875rem 0 0.25rem;
  font-family: var(--font-label);
  font-size: var(--fs-11, 0.6875rem);
  font-weight: 700;
  letter-spacing: var(--track, 0.1em);
  text-transform: var(--caps, uppercase);
  color: var(--signal-amber);
}
.question-detail :is(h2, h3, h4):first-child { margin-top: 0; }
.question-detail p { margin: 0 0 0.375rem; line-height: 1.5; }
.question-detail[hidden] { display: none; }
.question-details { font-weight: 600; }
/* The html prefix outranks the Jolly Roger skin's own outline button. */
html .question-card .question-details[aria-expanded="true"] { border-color: var(--signal-amber); color: var(--signal-amber); }

@media (max-width: 700px) {
  /* The note's placeholder names Dismiss too; on its own line it fits whole,
     under the buttons. */
  .question-card-foot .question-note { flex-basis: 100%; order: 1; }
  /* A phone's header leaves little room: the log keeps two lines under the cards. */
  #question-cards.question-cards:not([hidden]) + #messages-wrap { min-height: 3rem; }
  .question-fold { min-height: 2.75rem; gap: 0.5rem; padding-inline: 0.625rem; }
  .question-card-body { padding-inline: 0.625rem; }
  .question-card-foot .btn, .question-card-options .btn { min-height: 2.75rem; }
}
