#qf-root,
#qf-root * {
  box-sizing: border-box;
}

#qf-root {
  --qf-blue: #3159d7;
  --qf-ink: #18212f;
  --qf-muted: #66758a;
  --qf-border: #d4dbe4;
  color: var(--qf-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

#qf-root[hidden],
#qf-root [hidden] {
  display: none !important;
}

.qf-layer {
  position: absolute;
  z-index: 2147483000;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100%;
  pointer-events: none;
}

.qf-layer[data-mode="annotate"] {
  cursor: crosshair;
  pointer-events: auto;
  background: rgb(49 89 215 / 4%);
  outline: 3px solid rgb(49 89 215 / 45%);
  outline-offset: -3px;
}

.qf-is-annotating,
.qf-is-annotating body {
  cursor: crosshair !important;
}

.qf-pin {
  position: absolute;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 999px 999px 999px 3px;
  color: #fff;
  cursor: pointer;
  font: 800 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  pointer-events: auto;
}

.qf-layer[data-mode="annotate"] .qf-pin {
  pointer-events: none;
}

.qf-pin:hover,
.qf-pin:focus-visible {
  z-index: 2;
  transform: translate(-50%, -50%) scale(1.12);
  outline: 3px solid rgb(49 89 215 / 24%);
}

.qf-admin-controls {
  position: fixed;
  z-index: 2147483630;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
}

.qf-admin-links {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 6px;
}

.qf-admin-button {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 13px;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 8px;
  background: #172238;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

.qf-admin-button:hover,
.qf-admin-button:focus-visible,
.qf-admin-button[aria-pressed="true"] {
  border-color: var(--qf-blue);
  background: var(--qf-blue);
  outline: none;
}

.qf-labels-toggle strong {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 42%);
  border-radius: 999px;
}

.qf-dock {
  display: flex;
  overflow: hidden;
  align-items: stretch;
  border: 1px solid rgb(255 255 255 / 75%);
  border-radius: 999px;
  background: #172238;
}

.qf-dock-button {
  display: flex;
  height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: 750 13px/1 Inter, ui-sans-serif, system-ui, sans-serif;
}

.qf-dock-button:hover,
.qf-dock-button:focus-visible,
.qf-dock-button[aria-pressed="true"] {
  background: var(--qf-blue);
  outline: none;
}

.qf-dock-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.qf-dock-add {
  width: 48px;
  padding: 0 14px;
  transition: width 160ms ease;
  white-space: nowrap;
}

.qf-dock-label {
  overflow: hidden;
  width: 0;
  opacity: 0;
  transition: width 160ms ease, opacity 120ms ease;
}

.qf-dock:hover .qf-dock-add,
.qf-dock:focus-within .qf-dock-add,
.qf-dock-add[aria-pressed="true"] {
  width: 142px;
}

.qf-dock:hover .qf-dock-label,
.qf-dock:focus-within .qf-dock-label,
.qf-dock-add[aria-pressed="true"] .qf-dock-label {
  width: 82px;
  opacity: 1;
}

.qf-dock-list {
  position: relative;
  min-width: 48px;
  border-left: 1px solid rgb(255 255 255 / 18%);
}

.qf-count {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #172238;
  border-radius: 999px;
  background: #fff;
  color: var(--qf-blue);
  font-size: 10px;
  font-weight: 850;
}

.qf-panel {
  position: fixed;
  z-index: 2147483620;
  top: 16px;
  right: 16px;
  bottom: 80px;
  display: flex;
  width: min(390px, calc(100vw - 32px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--qf-border);
  border-radius: 14px;
  background: #fff;
}

.qf-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 18px 12px;
  border-bottom: 1px solid #e6eaf0;
}

.qf-kicker {
  color: #758296;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.qf-panel h2,
.qf-composer h2 {
  margin: 2px 0 0;
  color: var(--qf-ink);
  font: 800 20px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.02em;
}

.qf-icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--qf-border);
  border-radius: 8px;
  background: #fff;
  color: #46546a;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.qf-panel-meta {
  overflow: hidden;
  padding: 10px 18px;
  border-bottom: 1px solid #edf0f4;
  color: var(--qf-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qf-empty {
  margin: auto;
  padding: 24px;
  color: var(--qf-muted);
  text-align: center;
}

.qf-comments {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  margin: 0;
  padding: 12px;
  list-style: none;
}

.qf-comment {
  margin: 0 0 10px;
  padding: 13px;
  border: 1px solid #dfe5ec;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.qf-comment:hover,
.qf-comment[data-selected="true"] {
  border-color: #8ca3eb;
}

.qf-comment-resolved {
  opacity: .68;
}

.qf-comment-header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.qf-comment-number {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 850;
}

.qf-comment-meta {
  overflow: hidden;
  color: var(--qf-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qf-comment-text {
  margin: 11px 0 7px;
  color: var(--qf-ink);
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.qf-comment-context {
  margin: 0;
  color: #8a96a7;
  font-size: 10px;
}

.qf-comment-selector {
  display: block;
  overflow: hidden;
  margin: 0 0 7px;
  padding: 5px 7px;
  border-radius: 5px;
  background: #f2f5f9;
  color: #41516a;
  font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qf-comment-actions {
  display: flex;
  gap: 12px;
  margin-top: 11px;
}

.qf-comment-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--qf-blue);
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.qf-comment-action-danger {
  color: #c43d54;
}

.qf-panel-footer {
  padding: 12px 18px;
  border-top: 1px solid #e6eaf0;
  background: #f8fafc;
}

.qf-panel-footer a {
  color: var(--qf-blue);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.qf-modal-backdrop {
  position: fixed;
  z-index: 2147483640;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(19 29 44 / 32%);
  backdrop-filter: blur(2px);
}

.qf-composer {
  width: min(440px, 100%);
  padding: 20px;
  border: 1px solid var(--qf-border);
  border-radius: 14px;
  background: #fff;
}

.qf-composer-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.qf-composer-heading span {
  overflow: hidden;
  max-width: 62%;
  color: var(--qf-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qf-composer :is(input, textarea) {
  display: block;
  width: 100%;
  resize: vertical;
  padding: 12px;
  border: 1px solid #bdc8d5;
  border-radius: 8px;
  color: var(--qf-ink);
}

.qf-composer :is(input, textarea):focus {
  border-color: var(--qf-blue);
  outline: 3px solid rgb(49 89 215 / 14%);
}

.qf-composer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.qf-button {
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 750;
}

.qf-button-primary {
  border-color: var(--qf-blue);
  background: var(--qf-blue);
  color: #fff;
}

.qf-button-secondary {
  border-color: #c5ced9;
  background: #fff;
  color: #344258;
}

.qf-toast,
.qf-sign-in-hint {
  position: fixed;
  z-index: 2147483645;
  right: 20px;
  bottom: 82px;
  max-width: min(370px, calc(100vw - 40px));
  padding: 11px 14px;
  border-radius: 9px;
  background: #172238;
  color: #fff;
  font: 650 12px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
}

.qf-toast[data-kind="error"] {
  background: #a93148;
}

.qf-sign-in-hint {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qf-sign-in-hint a {
  padding: 6px 9px;
  border-radius: 6px;
  background: #fff;
  color: #23304a;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .qf-admin-controls {
    right: 12px;
    bottom: 12px;
  }

  .qf-panel {
    top: 10px;
    right: 10px;
    bottom: 70px;
    width: calc(100vw - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .qf-dock-add,
  .qf-dock-label,
  .qf-pin {
    transition: none;
  }
}

.qf-managed-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px 0;
  cursor: pointer;
}

.qf-managed-filter input {
  appearance: none;
  position: relative;
  width: 36px;
  height: 22px;
  margin: 0;
  flex: 0 0 auto;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  cursor: pointer;
}

.qf-managed-filter input::before {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: var(--color-muted);
}

.qf-managed-filter input:checked { background: var(--color-accent); }
.qf-managed-filter input:checked::before { transform: translateX(14px); background: var(--color-canvas); }
.qf-managed-filter input:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

.qf-managed-help {
  margin: 6px 18px 12px;
}

.qf-field-label {
  display: block;
  margin: 12px 0 6px;
}

.qf-composer {
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}

.qf-comment-summary {
  position: relative;
  padding-right: 22px;
  list-style: none;
  cursor: pointer;
}

.qf-comment-summary::-webkit-details-marker { display: none; }
.qf-comment-summary::after { content: '+'; position: absolute; top: 0; right: 0; }
.qf-comment details[open] > summary::after { content: '−'; }
.qf-comment-summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; }
.qf-comment-title, .qf-comment-excerpt { display: block; overflow-wrap: anywhere; }
.qf-comment-title { color: var(--color-text-light); }
.qf-comment-excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 8px;
  color: var(--color-muted-light);
}
.qf-comment details[open] .qf-comment-excerpt { display: none; }
.qf-comment details[open] .qf-comment-header { margin-top: 12px; }
.qf-comment-text, .qf-comment-meta { overflow-wrap: anywhere; }
.qf-comment-meta { white-space: normal; }
.qf-comment-resolved-at { margin: 10px 0; }

/* Keep the administrator dock from covering comment actions. */
#qf-root:has(.qf-panel:not([hidden])) .qf-admin-links { display: none; }
