.af-feedback {
  --af-paper: var(--workspace-paper, var(--white));
  --af-ink: var(--ink);
  --af-green: var(--workspace-accent);
  --af-action: var(--workspace-action);
  --af-on-action: var(--workspace-on-action);
  --af-hover: var(--workspace-action-hover);
  --af-line: var(--line);
  --af-sage: var(--workspace-selected);
  --af-error: var(--theme-danger);
  --af-muted: var(--muted);
  --af-shadow: var(--shadow);
  --af-backdrop: var(--workspace-backdrop);
  --af-1: 4px;
  --af-2: 8px;
  --af-3: 12px;
  --af-4: 16px;
  --af-6: 24px;
  --af-8: 32px;
  --af-touch: var(--theme-touch);
  --af-control: var(--theme-control);
  --af-radius: var(--ui-radius);
  --af-small: 0.8125rem;
  --af-body: 0.875rem;
  --af-heading: 1.25rem;
  box-sizing: border-box;
  font-family: var(--ui-font);
  font-size: var(--af-body);
  line-height: 1.5;
  color: var(--af-ink);
}
@media (max-width: 700px) {
  dialog[open]:not(#feedback-dialog):has(
      > #feedback-button.af-feedback-launcher
    ) {
    --af-modal-gap: 16px;
    --af-modal-launcher-height: 44px;
    --af-modal-clearance: calc(
      var(--af-modal-launcher-height) +
      var(--af-modal-gap) +
      max(var(--af-modal-gap), env(safe-area-inset-bottom))
    );
    box-sizing: border-box;
    inset-block-end: var(--af-modal-clearance);
    max-height: calc(
      100dvh -
      var(--af-modal-clearance) -
      2 *
      var(--af-modal-gap)
    );
    margin-block: auto;
  }
}
.af-feedback[hidden],
.af-feedback [hidden] {
  display: none !important;
}
#feedback-button.af-feedback-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--af-2);
  position: fixed;
  inset: auto max(var(--af-4), env(safe-area-inset-right))
    max(var(--af-4), env(safe-area-inset-bottom)) auto;
  margin: 0;
  min-height: var(--af-control);
  min-width: var(--af-control);
  width: auto;
  max-width: calc(100vw - var(--af-8));
  padding: var(--af-1) var(--af-3);
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  background: var(--af-paper);
  color: var(--af-ink);
  font-weight: 600;
  box-shadow: var(--af-shadow);
  z-index: 2147483647;
  cursor: pointer;
}
#feedback-dialog.af-feedback-dialog {
  width: min(560px, calc(100vw - var(--af-8)));
  max-width: calc(100vw - var(--af-8));
  max-height: calc(100dvh - var(--af-8));
  margin: auto;
  padding: var(--af-6);
  padding-bottom: calc(var(--af-touch) + var(--af-8));
  overflow: auto;
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  background: var(--af-paper);
  box-shadow: var(--af-shadow);
}
.af-feedback-dialog::backdrop {
  background: var(--af-backdrop);
}
.af-feedback-dialog h2 {
  margin: 0 0 var(--af-2);
  font-size: var(--af-heading);
  padding: 0;
}
.af-feedback-dialog p {
  margin: 0 0 var(--af-4);
}
.af-feedback-dialog form {
  display: grid;
  gap: var(--af-3);
}
.af-feedback-dialog label {
  margin: 0;
  font-weight: 600;
  font-size: var(--af-small);
}
.af-feedback-dialog textarea {
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: var(--af-control);
  padding: var(--af-1) var(--af-3);
  margin: 0;
  border: 1px solid var(--af-muted);
  border-radius: var(--ui-radius);
  color: var(--af-ink);
  background: var(--af-paper);
  font: inherit;
  resize: vertical;
}
.af-feedback-dialog button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--af-2);
  min-height: var(--af-control);
  padding: var(--af-1) var(--af-3);
  border: 1px solid var(--af-line);
  border-radius: var(--ui-radius);
  background: var(--af-paper);
  color: var(--af-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.af-feedback-dialog button.af-feedback-primary {
  background: var(--af-action);
  color: var(--af-on-action);
  border-color: var(--af-action);
}
.af-feedback-dialog button:hover:not(:disabled) {
  background: var(--af-sage);
}
.af-feedback-dialog button.af-feedback-primary:hover:not(:disabled) {
  background: var(--af-hover);
}
#feedback-button.af-feedback-launcher:hover {
  background: var(--af-sage);
}
.af-feedback-dialog :disabled {
  opacity: 0.65;
  cursor: wait;
}
.af-feedback-dialog :focus-visible,
#feedback-button.af-feedback-launcher:focus-visible {
  outline: 3px solid var(--af-green);
  outline-offset: var(--af-1);
}
.af-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--af-2);
}
.af-feedback-context {
  padding-block: var(--af-3);
  border-block: 1px solid var(--af-line);
  overflow-wrap: anywhere;
}
.af-feedback-dialog :is(#feedback-privacy, #feedback-status, #feedback-target) {
  font-size: var(--af-small);
  color: var(--af-muted);
}
.af-feedback-dialog #feedback-error {
  color: var(--af-error);
}
.af-feedback-dialog :is(#feedback-error, #feedback-status):empty {
  display: none;
}
.af-feedback-hint {
  position: fixed;
  inset: auto var(--af-4)
    calc(var(--af-touch) + var(--af-8) + env(safe-area-inset-bottom)) auto;
  max-width: min(400px, calc(100vw - var(--af-8)));
  padding: var(--af-3) var(--af-4);
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  background: var(--af-paper);
  box-shadow: var(--af-shadow);
  font-size: var(--af-small);
  pointer-events: none;
  z-index: 2147483646;
}
.af-feedback-highlight {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 0;
  border: 2px solid var(--af-green);
  background: transparent;
  pointer-events: none;
  z-index: 2147483645;
}
.af-feedback .ui-icon,
.af-feedback-launcher .ui-icon {
  width: var(--theme-icon);
  height: var(--theme-icon);
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
}
.af-feedback-dialog .af-feedback-actions:last-child {
  padding-top: var(--af-3);
  border-top: 1px solid var(--af-line);
}
.af-feedback-dialog #feedback-retry {
  justify-self: start;
}
@media (max-width: 700px), (pointer: coarse) {
  .af-feedback {
    --af-control: var(--theme-touch);
  }
  #feedback-button.af-feedback-launcher {
    width: var(--af-touch);
    height: var(--af-touch);
    padding: var(--af-2);
  }
  #feedback-button.af-feedback-launcher > span {
    display: none;
  }
  .af-feedback-dialog textarea {
    font-size: 1rem;
  }
  #feedback-dialog.af-feedback-dialog {
    padding-inline: var(--af-4);
  }
}
/* A modal that owns the screen keeps a slot for the launcher in its header
   ([data-feedback-slot], feedback.js): there it is a compact header button
   in the flow, beside the header's own close button, clear of the corner.
   A page's own slot (its header or navigation) holds it the same way; the
   page's stylesheet shapes it to its place. In the flow it stacks like its
   neighbours: the slot is `display: contents`, so the launcher is a flex or
   grid item, and the corner's z-index would still lift it over a sticky bar
   or panel that the page draws above that row. */
[data-feedback-slot] {
  display: contents;
}
[data-feedback-slot] > #feedback-button.af-feedback-launcher {
  position: static;
  z-index: auto;
  flex: none;
  width: var(--af-control);
  height: var(--af-control);
  margin-inline-start: auto;
  padding: var(--af-1);
  box-shadow: none;
}
[data-feedback-slot] > #feedback-button.af-feedback-launcher > span {
  display: none;
}
.af-feedback-dialog #feedback-recent {
  padding-top: var(--af-3);
  border-top: 1px solid var(--af-line);
  font-size: var(--af-small);
}
.af-feedback-dialog #feedback-recent h3 {
  margin: 0 0 var(--af-2);
  font-size: var(--af-body);
}
.af-feedback-dialog #feedback-recent ul {
  margin: 0;
  padding-left: var(--af-4);
  color: var(--af-muted);
}
/* The live average from feedback to the team's thank-you: set apart in the
   theme's selected tint, the duration in bold. */
.af-feedback-dialog .af-feedback-turnaround {
  display: flex;
  align-items: flex-start;
  gap: var(--af-2);
  padding: var(--af-3);
  border-radius: var(--af-radius);
  background: var(--af-sage);
  font-size: var(--af-small);
}
.af-feedback-dialog .af-feedback-turnaround strong {
  font-weight: 700;
}
/* The note's kind, as chips: a native radio group under its legend, each
   radio stretched invisibly over its chip, so keyboard and focus keep their
   native behaviour. The chip itself shows which kind is chosen. */
.af-feedback-dialog .af-feedback-categories {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.af-feedback-dialog .af-feedback-categories legend {
  margin: 0 0 var(--af-2);
  padding: 0;
  font-weight: 600;
  font-size: var(--af-small);
}
.af-feedback-dialog .af-feedback-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--af-2);
}
/* The workspace's global label rule (styles.css: a 12px column with a gap)
   would stack and top-align the chip's words: it is a centred row here. */
.af-feedback-dialog .af-feedback-chip {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: var(--af-control);
  padding: var(--af-1) var(--af-3);
  border: 1px solid var(--af-line);
  border-radius: 999px;
  background: var(--af-paper);
  cursor: pointer;
}
.af-feedback-dialog .af-feedback-chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}
.af-feedback-dialog .af-feedback-chip:hover {
  background: var(--af-sage);
}
.af-feedback-dialog .af-feedback-chip:has(input:checked) {
  border-color: var(--af-action);
  background: var(--af-action);
  color: var(--af-on-action);
}
.af-feedback-dialog .af-feedback-chip:has(input:focus-visible) {
  outline: 3px solid var(--af-green);
  outline-offset: var(--af-1);
}
.af-feedback-dialog .af-feedback-chip:has(input:disabled) {
  opacity: 0.65;
  cursor: wait;
}
/* The note's optional screenshot (feedback.js): an add control shaped like
   the dialog's buttons, its file input stretched invisibly over it as the
   kind chips' radios are, then a small preview with its Remove button. */
.af-feedback-dialog .af-feedback-shot {
  display: grid;
  gap: var(--af-2);
  min-width: 0;
}
.af-feedback-dialog .af-feedback-shot-add {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  justify-self: start;
  gap: 0;
  max-width: 100%;
  min-height: var(--af-control);
  box-sizing: border-box;
  padding: var(--af-1) var(--af-3);
  border: 1px dashed var(--af-muted);
  border-radius: var(--ui-radius);
  background: var(--af-paper);
  color: var(--af-ink);
  font-size: inherit;
  cursor: pointer;
}
.af-feedback-dialog .af-feedback-shot-add input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}
.af-feedback-dialog .af-feedback-shot-add:hover {
  background: var(--af-sage);
}
.af-feedback-dialog .af-feedback-shot-add:has(input:focus-visible) {
  outline: 3px solid var(--af-green);
  outline-offset: var(--af-1);
}
.af-feedback-dialog .af-feedback-shot-add:has(input:disabled) {
  opacity: 0.65;
  cursor: wait;
}
.af-feedback-dialog .af-feedback-shot-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--af-2);
  min-width: 0;
}
.af-feedback-dialog .af-feedback-shot-preview img {
  display: block;
  box-sizing: border-box;
  width: auto;
  height: auto;
  max-width: min(100%, 220px);
  max-height: 140px;
  border: 1px solid var(--af-line);
  border-radius: var(--ui-radius);
  background: var(--af-paper);
  object-fit: contain;
}
.af-feedback-dialog .af-feedback-shot p {
  margin: 0;
  font-size: var(--af-small);
}
.af-feedback-dialog #feedback-shot-hint {
  color: var(--af-muted);
}
.af-feedback-dialog #feedback-shot-error {
  color: var(--af-error);
}
.af-feedback-dialog #feedback-shot-error:empty {
  display: none;
}
/* Forced colours replace the chosen chip's fill with the system's, which
   would leave nothing to tell it apart: it takes the system's highlight. */
@media (forced-colors: active) {
  .af-feedback-dialog .af-feedback-chip:has(input:checked) {
    forced-color-adjust: none;
    border-color: Highlight;
    background: Highlight;
    color: HighlightText;
  }
}
.af-feedback-dialog .af-feedback-sent {
  display: grid;
  gap: var(--af-3);
}
.af-feedback-dialog .af-feedback-sent p {
  margin: 0;
}
/* Otto (docs/otto-brand-guide.md). Transparent art sits on a soft plate in
   the dark theme, where his outline would sink into the page. */
.otto-art {
  display: block;
  max-width: 100%;
  height: auto;
}
.otto-scene {
  border-radius: 18px;
}
:root[data-theme="dark"] .otto-plate {
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 55%,
    #f3efe2 0 62%,
    transparent 63%
  );
}
/* The thank-you: Otto above the note, smaller on phones. */
.af-feedback-dialog .af-feedback-otto {
  justify-self: start;
}
@media (max-width: 700px) {
  .af-feedback-dialog .af-feedback-otto {
    width: 64px;
  }
}
.af-feedback-dialog #feedback-receipt {
  font-size: var(--af-small);
  color: var(--af-muted);
  overflow-wrap: anywhere;
  user-select: text;
}
.af-feedback-dialog #feedback-title:focus {
  outline: none;
}
/* public/member-language.js comes with feedback.js to every page this sheet
   styles, and shows a refused field's English message (englishFormControls).
   Its base style, for pages without one of their own (guides, whose inline
   stylesheet is at its first-paint budget); :where() leaves a page's own
   .form-error and .field-invalid-note rules (styles.css) in charge. */
:where(.field-invalid-note) {
  display: block;
  margin: 0 0 8px;
  color: var(--theme-danger, #9c3b43);
  font-size: 0.875rem;
  font-weight: 400;
}
