/* Shared image gate and nonbaseline cognition challenge. */
.protected-image .image-protection {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--subtle-line);
  background: var(--panel);
}
.protected-image .image-protection.has-grayscale-preview {
  position: relative;
  display: grid;
  isolation: isolate;
  overflow: hidden;
  padding: 0;
}
.image-protection.has-grayscale-preview > .image-protection-preview {
  grid-area: 1 / 1;
  align-self: start;
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: grayscale(1) blur(1px);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.image-protection.has-grayscale-preview > .image-protection-message {
  grid-area: 1 / 1;
  align-self: end;
  justify-self: center;
  z-index: 1;
  width: min(520px, calc(100% - 40px));
  margin: 20px;
  padding: 18px 20px;
  border: 1px solid #a2a9b1bb;
  border-radius: 3px;
  background: #ffffffe8;
  box-shadow: 0 2px 14px #0002;
  color: var(--text);
}
[data-theme="dark"] .image-protection.has-grayscale-preview > .image-protection-message {
  border-color: #72777dbb;
  background: #101418e8;
  box-shadow: 0 2px 14px #0006;
}
.image-protection .image-protection-title {
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: 650;
}
.image-protection p { margin: 0 0 14px; }
.image-protection button { min-height: 42px; padding: 7px 14px; }
.image-protection [data-image-gate-status]:empty { display: none; }
.image-protection [data-image-gate-status] {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.image-protection .image-protection-about {
  margin: 12px 0 0;
  font-size: 12px;
}
.protected-image-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--subtle-line);
}
.protected-image-status { color: var(--muted); font-size: 13px; }
.protected-image-controls button { flex-shrink: 0; min-height: 40px; }
.nonbaseline-dialog {
  box-sizing: border-box;
  width: min(660px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  background: var(--background);
  box-shadow: 0 12px 60px #0005;
  font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
.nonbaseline-dialog::backdrop { background: #000b; }
.nonbaseline-form { margin: 0; }
.nonbaseline-header { padding: 20px 22px 0; }
.nonbaseline-eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.nonbaseline-header h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 650;
  line-height: 1.25;
}
.nonbaseline-header h2:focus { outline: none; }
.nonbaseline-purpose { margin: 10px 0 16px; color: var(--muted); }
.nonbaseline-reaction {
  margin: 0 22px 16px;
  padding: 10px 12px;
  border: 1px solid var(--subtle-line);
  border-radius: 2px;
  background: var(--panel);
}
.nonbaseline-reaction-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.nonbaseline-reaction img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 150px;
  object-fit: contain;
  background: #fff;
  border-radius: 2px;
}
.nonbaseline-choices { min-width: 0; margin: 0; padding: 0 22px; border: 0; }
.nonbaseline-choices legend { padding: 0 0 12px; font-weight: 600; }
.nonbaseline-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.nonbaseline-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 3px;
  border: 2px solid var(--subtle-line);
  border-radius: 3px;
  background: var(--panel);
  cursor: pointer;
}
.nonbaseline-card:hover { border-color: var(--line); }
.nonbaseline-card:has(input:checked) { border-color: var(--accent); background: var(--hover); }
.nonbaseline-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.nonbaseline-card input {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 1;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.nonbaseline-card-visual { display: block; overflow: hidden; border-radius: 1px; background: #fff; }
.nonbaseline-card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.nonbaseline-card-caption {
  display: flex;
  min-height: 35px;
  align-items: center;
  justify-content: center;
  padding: 5px 3px 3px;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
}
.nonbaseline-footer { padding: 10px 22px 20px; }
.nonbaseline-count { margin: 0; color: var(--muted); font-size: 12px; }
.nonbaseline-status { margin: 8px 0 12px; font-size: 13px; }
.nonbaseline-status:empty { display: none; }
.nonbaseline-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.nonbaseline-actions button { min-height: 42px; padding: 8px 12px; }
.nonbaseline-submit { border-color: var(--accent); color: var(--accent); font-weight: 650; }
.nonbaseline-submit:hover { background: var(--hover); }
@media (max-width: 480px) {
  .protected-image .image-protection { padding: 22px 16px 18px; }
  .protected-image .image-protection.has-grayscale-preview { padding: 0; }
  .image-protection.has-grayscale-preview > .image-protection-message {
    grid-area: 2 / 1;
    width: calc(100% - 20px);
    margin: -48px 10px 10px;
    padding: 12px 13px;
    font-size: 13px;
    line-height: 1.45;
  }
  .has-grayscale-preview .image-protection-title { margin-bottom: 6px; font-size: 15px; }
  .has-grayscale-preview .image-protection-message > p { margin-bottom: 10px; }
  .has-grayscale-preview .image-protection-message > .image-protection-about { margin: 8px 0 0; font-size: 11px; }
  .has-grayscale-preview .image-protection-message > button { max-width: 100%; min-height: 42px; padding: 7px 10px; }
  .nonbaseline-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .nonbaseline-header { padding: 16px 14px 0; }
  .nonbaseline-header h2 { font-size: 20px; }
  .nonbaseline-purpose { font-size: 13px; }
  .nonbaseline-reaction { margin: 0 14px 14px; padding: 8px; }
  .nonbaseline-reaction-label { font-size: 12px; }
  .nonbaseline-choices { padding-inline: 14px; }
  .nonbaseline-choices legend { font-size: 13px; }
  .nonbaseline-grid { gap: 6px; }
  .nonbaseline-card { padding: 2px; }
  .nonbaseline-card input { width: 17px; height: 17px; top: 6px; left: 6px; }
  .nonbaseline-card-caption { min-height: 31px; font-size: 11px; }
  .nonbaseline-footer { padding: 10px 14px 16px; }
  .nonbaseline-actions { gap: 8px; }
  .nonbaseline-actions button { flex: 1; min-height: 44px; padding-inline: 8px; font-size: 13px; }
}
@media (max-width: 340px) {
  .nonbaseline-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .protected-image-controls { align-items: flex-start; flex-direction: column; }
}
@media print {
  .nonbaseline-dialog, .image-protection button, .protected-image-controls { display: none !important; }
  .protected-image .image-protection { break-inside: avoid; }
}
