/* A99.17: the report-a-problem button and form shared by every server-rendered page. */
/* The root is the last element of every page body; its height keeps the end of the page clear of the button corner.
   A body that is a flexbox must stack its children in a column, or the root lands beside the content instead of below it. */
.qms-report {
  display: block;
  block-size: var(--report-bug-clearance, calc(var(--touch-web) + 2rem));
}
.qms-report-fab {
  position: fixed;
  inset-inline-end: 1rem;
  /* report-bug.js sets the lift to how far a visible [data-bottom-bar] reaches up from the viewport bottom. */
  bottom: calc(1rem + var(--report-bug-lift, 0px));
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--touch-web);
  height: var(--touch-web);
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: var(--color-surface-inverse);
  color: var(--color-surface-on-inverse);
  /* The circle alone can drop under 1.2:1 against a dark or brand-navy backdrop; the ring keeps it visible there. */
  box-shadow: 0 0 0 2px var(--color-surface-on-inverse), var(--elevation-card);
  cursor: pointer;
  transition: box-shadow var(--motion-fast);
}
/* No inverse hover role exists; a shade change could drop the glyph below contrast, so hover raises the button. */
.qms-report-fab:hover {
  box-shadow: 0 0 0 2px var(--color-surface-on-inverse), var(--elevation-card-hover);
}
.qms-report-fab:focus-visible {
  outline: 2px solid var(--button-focus-ring);
  outline-offset: 2px;
}
.qms-report-fab-icon {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}
.qms-report-fab[hidden],
.qms-report-preview[hidden] {
  display: none;
}

.qms-report-dialog {
  box-sizing: border-box;
  /* A page-wide `margin: 0` reset would otherwise drop the browser's auto margin and pin the open dialog to a corner. */
  margin: auto;
  width: min(32rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.5rem;
  border: 1px solid var(--dialog-surface-border);
  border-radius: var(--radius-lg);
  background: var(--dialog-surface-bg);
  color: var(--color-neutral-800);
  box-shadow: var(--elevation-dialog);
  font-family: var(--type-body-family);
  font-size: var(--type-body-size);
  line-height: var(--type-body-leading);
}
.qms-report-dialog::backdrop {
  background: var(--dialog-overlay-bg);
}
.qms-report-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
}
.qms-report-title {
  margin: 0;
  font-size: var(--type-h3-size);
  font-weight: var(--type-h3-weight);
  line-height: var(--type-h3-leading);
}
.qms-report-label {
  display: block;
  padding: 0;
  margin-bottom: 0.5rem;
  color: var(--input-label-fg);
  font-size: var(--type-caption-size);
  font-weight: var(--type-caption-weight);
  line-height: var(--type-caption-leading);
}
.qms-report-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0;
  padding: 0;
  border: 0;
}
.qms-report-type,
.qms-report-attach {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--touch-web);
  cursor: pointer;
}
.qms-report-type input,
.qms-report-attach input {
  margin: 0;
  accent-color: var(--color-accent-primary);
}
.qms-report-attach input:disabled,
.qms-report-attach input:disabled + span {
  cursor: not-allowed;
  opacity: 0.5;
}
.qms-report-description {
  box-sizing: border-box;
  width: 100%;
  min-height: 7.5rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--input-fg);
  font: inherit;
  resize: vertical;
}
.qms-report-description::placeholder {
  color: var(--input-placeholder-fg);
}
.qms-report-description:focus {
  outline: 2px solid var(--input-border-focus);
  outline-offset: 0;
}
.qms-report-preview {
  display: block;
  max-width: 100%;
  max-height: 12rem;
  object-fit: contain;
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-sm);
}
.qms-report-notice,
.qms-report-status {
  margin: 0;
  font-size: var(--type-caption-size);
  font-weight: var(--type-caption-weight);
  line-height: var(--type-caption-leading);
}
.qms-report-notice {
  color: var(--color-neutral-600);
}
/* An empty live region stays rendered, out of the layout, so screen readers announce its first message. */
.qms-report-status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.qms-report-status[data-tone="success"] {
  color: var(--color-semantic-success);
}
.qms-report-status[data-tone="error"] {
  color: var(--color-semantic-error);
}
.qms-report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}
.qms-report-btn {
  min-width: var(--touch-web);
  min-height: var(--touch-web);
  padding: 0.625rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--motion-fast);
}
.qms-report-btn:focus-visible {
  outline: 2px solid var(--button-focus-ring);
  outline-offset: 2px;
}
.qms-report-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.qms-report-btn-primary {
  background: var(--button-primary-bg);
  color: var(--button-primary-fg);
}
.qms-report-btn-primary:hover:not(:disabled) {
  background: var(--button-primary-bg-hover);
}
.qms-report-btn-secondary {
  border-color: var(--button-secondary-border);
  background: var(--button-secondary-bg);
  color: var(--button-secondary-fg);
}
.qms-report-btn-secondary:hover:not(:disabled) {
  background: var(--button-secondary-bg-hover);
}

@media (prefers-reduced-motion: reduce) {
  .qms-report-fab,
  .qms-report-btn {
    transition: none;
  }
}
