/* Scope the comparison window so page resets cannot change its geometry. */
html.remb-robot-panel-open { overflow: hidden; }
dialog.robot-panel {
  --robot-ink: var(--text-primary, #18243c);
  --robot-muted: var(--text-secondary, #65748b);
  --robot-surface: var(--bg-card, #fff);
  --robot-soft: var(--bg-primary, #f4f7fb);
  --robot-border: var(--border, #dce5f1);
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(1440px, calc(100vw - 48px));
  height: fit-content;
  max-width: none;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--robot-border);
  border-radius: 20px;
  background: var(--robot-soft);
  color: var(--robot-ink);
  box-shadow: 0 24px 90px #0f234140;
  box-sizing: border-box;
  overflow: hidden;
  font: 14px/1.6 Inter, "Segoe UI", sans-serif;
  text-align: left;
}
dialog.robot-panel[open] { display: flex; flex-direction: column; }
.robot-panel *, .robot-panel *::before, .robot-panel *::after { box-sizing: border-box; }
.robot-panel::backdrop { background: #12223b80; backdrop-filter: blur(3px); }
.robot-panel > .robot-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  gap: 20px;
  padding: 18px 26px;
  border-bottom: 1px solid var(--robot-border);
  background: var(--robot-surface);
}
.robot-panel .robot-heading { display: flex; gap: 13px; align-items: center; min-width: 0; }
.robot-panel .robot-brandmark { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 13px; background: #245eea; color: #fff; font-size: 21px; font-weight: 750; }
.robot-panel h2 { margin: 0; color: var(--robot-ink); font: 700 20px/1.3 Inter, "Segoe UI", sans-serif; letter-spacing: -.4px; }
.robot-panel h3 { margin: 0; color: var(--robot-ink); font: 650 16px/1.4 Inter, "Segoe UI", sans-serif; letter-spacing: -.15px; }
.robot-panel p { margin: 0; }
.robot-panel .robot-subtitle { margin-top: 3px; color: var(--robot-muted); font-size: 12px; line-height: 1.5; }
.robot-panel .robot-content { min-height: 0; padding: 20px 26px 26px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #aabbd2 transparent; }
.robot-panel .robot-overview { padding: 14px 18px; border: 1px solid var(--robot-border); border-radius: 12px; background: var(--robot-surface); }
.robot-panel .robot-status { color: var(--robot-ink); font-size: 13px; font-weight: 550; }
.robot-panel .robot-status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #168368; margin-right: 8px; vertical-align: 1px; }
.robot-panel .robot-status[data-state="processando"]::before { background: #245eea; }
.robot-panel .robot-status[data-state="falha"]::before { background: #c74335; }
.robot-panel .robot-description { margin-top: 4px; color: var(--robot-muted); font-size: 12px; }
.robot-panel .robot-toolbar { position: sticky; top: -20px; z-index: 2; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 18px; padding: 14px 0; background: var(--robot-soft); }
.robot-panel .robot-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.robot-panel button { min-height: 38px; margin: 0; padding: 8px 13px; border: 1px solid var(--robot-border); border-radius: 8px; background: var(--robot-surface); color: #2457b8; font: 550 12px/1.4 Inter, "Segoe UI", sans-serif; cursor: pointer; white-space: normal; }
.robot-panel button:hover:not(:disabled) { border-color: #97b4e6; background: var(--accent-light, #edf3ff); }
.robot-panel button:focus-visible, .robot-panel select:focus-visible, .robot-panel input:focus-visible, .robot-launch:focus-visible { outline: 3px solid #528df1; outline-offset: 3px; }
.robot-panel button:disabled { opacity: .5; cursor: default; }
.robot-panel .robot-close { flex: none; padding-inline: 16px; color: var(--robot-muted); }
.robot-panel .robot-secondary { border-color: #c4d5f4; background: var(--accent-light, #edf3ff); }
.robot-panel .robot-pagination { flex-wrap: nowrap; }
.robot-panel .robot-count { margin-right: 6px; color: var(--robot-muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.robot-panel .robot-feedback:empty { display: none; }
.robot-panel .robot-feedback { margin-bottom: 14px; padding: 10px 14px; border: 1px solid var(--robot-border); border-radius: 8px; background: var(--robot-surface); color: var(--robot-ink); font-size: 13px; overflow-wrap: anywhere; }
.robot-panel .robot-feedback[data-error="true"] { border-color: #efc6bc; background: #fff4f0; color: #a13b24; }
.robot-panel .robot-result-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 4px 0 12px; }
.robot-panel .robot-list-name { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.robot-panel .robot-eyebrow { display: block; color: var(--robot-muted); font-size: 10px; font-weight: 650; letter-spacing: .8px; text-transform: uppercase; }
.robot-panel .robot-list-name strong { font-size: 14px; font-weight: 650; }
.robot-panel .robot-similarity { padding: 5px 10px; border: 1px solid #c4e6d8; border-radius: 7px; background: #eef9f4; color: #19694e; font-size: 12px; font-weight: 600; }
.robot-panel .robot-similarity[data-exact="false"] { border-color: #edd9aa; background: #fffaee; color: #865b16; }
.robot-panel .robot-notice { padding: 10px 13px; border: 1px solid #eeddb8; border-radius: 9px; background: #fff9ed; color: #825d24; font-size: 12px; line-height: 1.6; }
.robot-panel .robot-notice[data-tone="success"] { border-color: #c4e6d8; background: #eef9f4; color: #19694e; }
.robot-panel .robot-notice[data-tone="info"] { border-color: #cadcf4; background: #eef4fd; color: #325a8d; }
.robot-panel .robot-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; gap: 18px; margin: 16px 0; }
.robot-panel .robot-question-card { min-width: 0; padding: 20px; border: 1px solid var(--robot-border); border-top: 3px solid #82aaf2; border-radius: 12px; background: var(--robot-surface); overflow-wrap: anywhere; }
.robot-panel .robot-question-card[data-source="exam"] { border-top-color: #90a6bd; }
.robot-panel .robot-question-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--robot-border); }
.robot-panel .robot-question-number { flex: none; padding: 3px 9px; border: 1px solid var(--robot-border); border-radius: 6px; background: var(--robot-soft); color: #3f6495; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.robot-panel .robot-question-section + .robot-question-section { margin-top: 16px; }
.robot-panel .robot-question-section > strong { display: block; margin-bottom: 6px; color: var(--robot-muted); font-size: 11px; font-weight: 650; letter-spacing: .3px; }
.robot-panel .robot-question-text { margin: 0; font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.robot-panel .robot-question-text[data-empty="true"] { color: var(--robot-muted); font-size: 12px; }
.robot-panel .robot-alternatives { display: grid; gap: 8px; margin-top: 18px; }
.robot-panel .robot-alternative { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--robot-border); border-radius: 8px; background: var(--robot-soft); }
.robot-panel .robot-alternative-letter { display: grid; place-items: center; flex: none; min-width: 24px; height: 24px; border-radius: 6px; background: var(--robot-surface); color: #325a8d; font-size: 11px; font-weight: 700; }
.robot-panel .robot-alternative-text { min-width: 0; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.robot-panel .robot-exam-source { display: grid; gap: 3px; margin-bottom: 14px; color: var(--robot-muted); font-size: 12px; overflow-wrap: anywhere; }
.robot-panel .robot-match-note { margin-bottom: 16px; }
.robot-panel .robot-confirmation { margin-top: 16px; padding: 20px; border: 1px solid var(--robot-border); border-radius: 12px; background: var(--robot-surface); }
.robot-panel .robot-confirmation > h3 { margin-bottom: 5px; }
.robot-panel .robot-confirmation > p:not(.robot-notice) { color: var(--robot-muted); font-size: 12px; }
.robot-panel .robot-confirmation > .robot-notice { margin-top: 14px; }
.robot-panel .robot-map { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.robot-panel .robot-map label { display: grid; gap: 6px; min-width: 0; color: var(--robot-muted); font-size: 11px; font-weight: 550; }
.robot-panel .robot-map select { width: 100%; min-width: 0; max-width: 100%; margin: 0; padding: 9px 11px; border: 1px solid var(--robot-border); border-radius: 7px; background: var(--robot-soft); color: var(--robot-ink); font: 500 13px/1.4 Inter, "Segoe UI", sans-serif; }
.robot-panel .robot-check { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--robot-border); border-radius: 8px; background: var(--robot-soft); color: var(--robot-ink); font-size: 12px; cursor: pointer; }
.robot-panel .robot-check input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: #245eea; }
.robot-panel .robot-confirmation-actions { justify-content: flex-end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--robot-border); }
.robot-panel button.robot-confirm { border-color: #245eea; background: #245eea; color: #fff; }
.robot-panel button.robot-confirm:hover:not(:disabled) { border-color: #194dc9; background: #194dc9; }
.robot-panel .robot-empty { padding: 36px 20px; border: 1px dashed var(--robot-border); border-radius: 12px; text-align: center; }
.robot-panel .robot-empty p { margin-top: 6px; color: var(--robot-muted); font-size: 13px; }
.robot-launch { position: fixed; right: 22px; bottom: 24px; z-index: 10050; max-width: calc(100vw - 28px); padding: 11px 16px; border: 0; border-radius: 24px; background: #174bba; color: #fff; box-shadow: 0 3px 12px #0003; font: inherit; cursor: pointer; }
.robot-launch[data-state="erro"] { background: #8b381d; }
[data-theme="dark"] .robot-panel .robot-notice { border-color: #6b542e; background: #332b20; color: #efd098; }
[data-theme="dark"] .robot-panel .robot-notice[data-tone="success"], [data-theme="dark"] .robot-panel .robot-similarity { border-color: #305d50; background: #20382f; color: #a1ddc6; }
[data-theme="dark"] .robot-panel .robot-notice[data-tone="info"] { border-color: #31537c; background: #20344e; color: #a8c7ef; }
[data-theme="dark"] .robot-panel .robot-similarity[data-exact="false"] { border-color: #6b542e; background: #332b20; color: #efd098; }
[data-theme="dark"] .robot-panel .robot-feedback[data-error="true"] { border-color: #7a403b; background: #402725; color: #f5b7a6; }
[data-theme="dark"] .robot-panel .robot-question-number, [data-theme="dark"] .robot-panel .robot-alternative-letter { color: #adc9f2; }
[data-theme="dark"] .robot-panel button:not(.robot-confirm):not(.robot-close) { color: #a9c8ff; }
@media (max-width: 900px) {
  dialog.robot-panel { width: calc(100vw - 28px); max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); border-radius: 15px; }
  .robot-panel > .robot-panel-header { padding: 15px 18px; }
  .robot-panel .robot-content { padding: 16px 18px 20px; }
  .robot-panel .robot-toolbar { top: -16px; }
  .robot-panel .robot-question-card { padding: 16px; }
}
@media (max-width: 700px) {
  dialog.robot-panel { width: calc(100vw - 16px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); border-radius: 13px; }
  .robot-panel > .robot-panel-header { gap: 10px; padding: 14px; }
  .robot-panel .robot-heading { gap: 10px; }
  .robot-panel .robot-brandmark { width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }
  .robot-panel h2 { font-size: 16px; }
  .robot-panel .robot-subtitle { display: none; }
  .robot-panel .robot-content { padding: 12px; }
  .robot-panel .robot-overview { padding: 12px; }
  .robot-panel .robot-toolbar { top: -12px; gap: 12px; padding: 12px 0; }
  .robot-panel .robot-pagination { width: 100%; justify-content: flex-end; }
  .robot-panel .robot-count { margin-right: auto; }
  .robot-panel .robot-columns { grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 12px 0; }
  .robot-panel .robot-question-card, .robot-panel .robot-confirmation { padding: 14px; }
  .robot-panel .robot-map { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .robot-panel .robot-confirmation-actions > button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .robot-panel::backdrop { backdrop-filter: none; } }
