/* IAL Prep — Mark with AI (js/aimark.js): the button on each question card and its dialog, in the
   site's Control look (css/control.css). */

/* The button sits at the end of the card's row of options. */
.topicbank .qcard-actions .act-aim { margin-left: auto; gap: 8px; }
.topicbank .act-aim .act-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 520px) {
  .topicbank .qcard-actions .act-aim { margin-left: 0; }
}

.tb-aim {
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: var(--panel-solid);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.tb-aim::backdrop { background: var(--scrim, rgba(0, 0, 0, 0.6)); }
.tb-aim[open] { display: flex; flex-direction: column; animation: ctl-fade 0.2s ease both; }
.aim-head { display: flex; align-items: center; gap: 12px; padding: 16px 12px 4px 22px; }
.aim-title { flex: 1; margin: 0; font: 700 22px/1.2 var(--f-display); }
.aim-x {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.aim-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.aim-x:hover { color: var(--accent); }
.aim-x:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.aim-what { margin: 0 22px; color: var(--ink-2); font-size: 14px; }
.aim-steps { margin: 12px 22px 0; padding-left: 20px; color: var(--ink); font-size: 14.5px; line-height: 1.5; }
.aim-warn {
  margin: 12px 22px 0;
  padding: 10px 12px;
  border: 1px solid var(--red);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}
.aim-warn[hidden] { display: none; }
.aim-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  padding: 16px 22px 22px;
  overflow: auto;
}
.aim-fig { margin: 0; min-width: 0; }
.aim-pic {
  max-height: min(62vh, 640px);
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
}
.aim-img { display: block; width: 100%; height: auto; }
.aim-wait { margin: 0; padding: 40px 16px; color: #555; font-size: 14px; text-align: center; }
.aim-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.aim-label { color: var(--ink-2); font: 700 13px/1 var(--f-display); }
.aim-prompt {
  width: 100%;
  min-height: 220px;
  flex: 1;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: var(--field);
  color: var(--ink);
  font: 400 13.5px/1.5 var(--f-text);
}
.aim-prompt:focus-visible { outline: 1px solid var(--accent); outline-offset: 1px; }
.aim-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.aim-btns .ctl-btn { min-height: 42px; }
.aim-btns .ctl-btn:disabled { opacity: 0.45; cursor: default; }
.aim-note { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
@media (max-width: 760px) {
  .aim-cols { grid-template-columns: minmax(0, 1fr); }
  .aim-pic { max-height: 40vh; }
  .aim-prompt { min-height: 160px; }
}
@media (pointer: coarse) {
  .aim-btns .ctl-btn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .tb-aim[open] { animation: none; }
}
