/* "Ask a question" (README, "Asking a question") — ui/ask.js's small overlay panel. Tokens only,
   from ui/theme.css. Modelled on ui/identity.css's name-prompt (a centred dialog, same layering
   idea) and reuses board.css's own .field/.primary/.linkish/.quiet-btn/.hint for everything a
   plain field or button can already do — this file only draws what nothing else already has: the
   overlay itself, the who-should-answer toggle row, and the option rows.

   z-index: above .panel-bg (20) and .welcome-bg (25), below .name-prompt-bg (32) — requireName()
   can open its own dialog on top of this one (e.g. pressing Ask before a name is set). */

.ask-bg {
  position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center;
  justify-content: center; padding: var(--s4); z-index: 31; overflow-y: auto;
}

.ask-panel {
  position: relative; background: var(--paper); color: var(--ink); width: min(26rem, 100%);
  max-height: calc(100vh - 2 * var(--s4)); overflow-y: auto; border-radius: var(--radius);
  box-shadow: var(--shadow-panel); padding: var(--s4); display: grid; gap: var(--s3);
}

.ask-panel h3 {
  margin: 0; padding-right: 1.4rem; font-size: var(--text-lg); font-weight: 700;
}

.ask-close {
  position: absolute; top: .5rem; right: .6rem; background: none; border: none; cursor: pointer;
  font-size: 1.15rem; line-height: 1; color: var(--graphite); padding: .1rem .35rem;
}
.ask-close:hover { color: var(--ink); }

.ask-panel .field { display: flex; flex-direction: column; gap: .25rem; }
.ask-panel .field label {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: var(--label-track);
  text-transform: uppercase; color: var(--graphite);
}
.ask-panel input[type="text"], .ask-panel textarea {
  width: 100%; padding: .45rem .6rem; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); font: inherit; color: inherit;
}
.ask-panel textarea { resize: vertical; min-height: 3.6rem; }

.ask-label {
  font-size: var(--text-xs); font-weight: 700; letter-spacing: var(--label-track);
  text-transform: uppercase; color: var(--graphite);
}

/* Who should answer: toggle pills, same look as the board's own filter chips. */
.ask-who { display: flex; flex-wrap: wrap; gap: .35rem; }
.ask-who-btn {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 999px;
  padding: .3rem .75rem; min-height: 34px; font-size: var(--text-sm); color: var(--graphite); cursor: pointer;
}
.ask-who-btn:hover { border-color: var(--ink); color: var(--ink); }
.ask-who-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

/* A (owner: "You can ask an agent."): connected agents, a second row of the same pills under a
   small label — one kind per question, so picking either clears the other (ui/ask.js). */
.ask-agents-label { margin-top: -.1rem; }

/* How they answer: each option a removable row. */
.ask-opts { display: grid; gap: .4rem; }
.ask-opt-row { display: flex; align-items: center; gap: .5rem; }
.ask-opt-row input {
  flex: 1 1 auto; min-width: 0; padding: .4rem .55rem; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius); font: inherit; color: inherit;
}
.ask-opt-row .linkish { white-space: nowrap; }
.ask-one-hint { margin: 0; }

.ask-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-top: .1rem; }
.ask-actions .primary { min-height: 44px; padding: .5rem 1.1rem; }

@media (max-width: 30rem) {
  .ask-panel { padding: var(--s3); }
}

@media (prefers-reduced-motion: reduce) {
  .ask-bg { transition: none; }
}

/* The way in: a real button in the nav row, outlined so the page keeps one filled button. It sits
   on the row's baseline with the view tabs, a little clear of them. */
.tabs .ask-open {
  align-self: center; margin-left: var(--s3); padding: .3rem .8rem; min-height: 2rem;
  background: transparent; color: var(--ink); border: 1px solid var(--ink); border-radius: var(--radius);
  font-size: var(--text-sm); font-weight: 600; cursor: pointer;
}
.tabs .ask-open:hover, .tabs .ask-open:focus-visible { background: var(--ink); color: var(--paper); }
.ask-how { margin: 0; font-size: var(--text-sm); color: var(--graphite); }
