/* Floating Report Bugs — icon-only FAB, center bottom (#425). */
.imd-bug-fab {
  position: fixed;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  bottom: max(0.85rem, env(safe-area-inset-bottom, 0px));
  z-index: 11000;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(24, 28, 40, 0.92);
  color: #e8eaf2;
  box-shadow: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.imd-bug-fab.visible {
  display: inline-flex;
}
/* Sit above Prev/Next instead of covering the left dock button (#253). */
html:not([data-exam-style="usmle"]) body.has-tr-dock .imd-bug-fab {
  bottom: calc(var(--tr-dock-h, 3.55rem) + 0.45rem);
}
html[data-exam-style="usmle"] body.exam-run .imd-bug-fab {
  bottom: calc(var(--usmle-bot-h, 3.2rem) + var(--imd-vv-bottom, 0px) + 0.45rem);
}
.imd-bug-fab:hover {
  border-color: rgba(255, 139, 122, 0.55);
  background: rgba(40, 28, 28, 0.95);
  color: #ffc4ba;
  box-shadow: none;
}
.imd-bug-fab svg {
  width: 22px;
  height: 22px;
  display: block;
}
/* Unread admin reply waiting: a dot rather than a count, so it reads at 44px. */
.imd-bug-fab.has-unread::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid rgba(24, 28, 40, 0.92);
  box-sizing: border-box;
}
html[data-theme="light"] .imd-bug-fab.has-unread::after {
  border-color: #fff;
}
.imd-bug-mine {
  margin-right: auto;
  align-self: center;
  font-weight: 650;
  font-size: 0.9rem;
  color: #8fa6ff;
  text-decoration: none;
}
.imd-bug-mine:hover {
  text-decoration: underline;
}
html[data-theme="light"] .imd-bug-mine {
  color: #3d52d9;
}
.imd-bug-overlay {
  position: fixed;
  inset: 0;
  z-index: 11050;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
.imd-bug-overlay[hidden] {
  display: none !important;
}
.imd-bug-card {
  width: min(420px, 100%);
  background: var(--card, rgba(24, 28, 40, 0.96));
  border: 1px solid var(--border, rgba(98, 115, 180, 0.28));
  border-radius: 14px;
  padding: 1rem 1.05rem 1.1rem;
  color: var(--text, #e8eaf2);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
}
.imd-bug-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}
.imd-bug-card .sub {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--muted, #8b92a8);
}
.imd-bug-card label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted, #8b92a8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0.55rem 0 0.3rem;
}
.imd-bug-card textarea,
.imd-bug-card input[type="file"] {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  color: inherit;
}
.imd-bug-card textarea {
  min-height: 110px;
  resize: vertical;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border, rgba(98, 115, 180, 0.28));
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}
.imd-bug-actions {
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}
.imd-bug-actions button {
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #2c3348;
  color: inherit;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  box-shadow: none;
}
.imd-bug-actions button:hover:not(:disabled) {
  box-shadow: none;
}
.imd-bug-actions button.primary {
  background: #4f6fff;
  border-color: transparent;
  color: #fff;
}
.imd-bug-msg {
  margin: 0.55rem 0 0;
  min-height: 1.2em;
  font-size: 0.88rem;
}
.imd-bug-msg.ok {
  color: #9af0e4;
}
.imd-bug-msg.err {
  color: #ffc4ba;
}
html[data-theme="light"] .imd-bug-fab {
  background: #fff;
  color: #222;
  border-color: rgba(0, 0, 0, 0.14);
  box-shadow: none;
}
html[data-theme="light"] .imd-bug-card {
  background: #f7f8fc;
  color: #1a1d28;
  border-color: rgba(0, 0, 0, 0.12);
}
html[data-theme="light"] .imd-bug-card textarea {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.14);
  color: #1a1d28;
}
html[data-theme="light"] .imd-bug-actions button {
  background: #e4e8f2;
  color: #1a1d28;
}
html[data-theme="light"] .imd-bug-actions button.primary {
  background: #3d52d9;
  color: #fff;
}
