/* feedback.css - positions + paints the "Leave feedback" dock affordance for
   Crestline. The pill sits bottom-RIGHT, lifted clear ABOVE the page-tour launcher
   (.ti-dlt-launch-fixed, bottom:18px) so the two never overlap at 1280 or 375.
   The theme toggle lives bottom-LEFT, so there is no conflict there. Tokens are
   the Crestline set, so the same paint reads in light (paper + blue accent) and
   dark, both WCAG-AA. The blue accent marks the affordance; gold stays reserved
   for the deliverable. */

/* ---- position (Crestline owns this; clears the bottom-right tour launcher) ---- */
.ti-feedback-launch {
  position: fixed;
  right: 18px;
  bottom: 64px;            /* above the page-tour launcher (bottom:18px, ~34px tall) + gap */
  z-index: 2147483400;     /* under the tour launcher (…500), over page content */
}
.ti-fb-panel {
  position: fixed;
  right: 18px;
  bottom: 112px;           /* anchored above the launch pill */
  z-index: 2147483401;
}
@media (max-width: 820px) {
  .ti-feedback-launch { bottom: 60px; right: 14px; }
  .ti-fb-panel { bottom: 104px; right: 14px; }
}

/* ---- the pill ---- */
.ti-feedback-launch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--surface, #FBFBF9);
  color: var(--text, #15171C);
  border: 1px solid var(--border-accent, rgba(27, 83, 198, 0.20));
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(18, 22, 30, 0.05));
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ti-feedback-launch:hover { background: var(--accent-pale, rgba(27, 83, 198, 0.065)); border-color: var(--accent, #1B53C6); }
.ti-feedback-launch:focus-visible { outline: 2px solid var(--accent, #1B53C6); outline-offset: 2px; }
.ti-feedback-launch-glyph {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent-bright, #2E6CF0);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  flex: 0 0 auto;
}
.ti-feedback-launch-label { white-space: nowrap; }

/* ---- the panel ---- */
.ti-fb-panel {
  width: min(340px, 92vw);
  max-height: calc(100vh - 148px);
  display: none;
  flex-direction: column;
  background: var(--surface, #FBFBF9);
  border: 1px solid var(--border, #D6D9D3);
  border-radius: 16px;
  box-shadow: var(--shadow, 0 4px 16px rgba(18, 22, 30, 0.08));
  overflow-y: auto;
  font-family: var(--sans, system-ui, sans-serif);
}
.ti-fb-panel.is-open { display: flex; }

.ti-fb-head {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 8px;
}
.ti-fb-title { margin: 0; font-size: 16px; color: var(--text, #15171C); letter-spacing: -0.01em; }
.ti-fb-close {
  background: none; border: none; color: var(--text-dim, #474C54);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.ti-fb-close:hover { color: var(--text, #15171C); }
.ti-fb-close:focus-visible { outline: 2px solid var(--accent, #1B53C6); outline-offset: 2px; }

.ti-fb-intro {
  margin: 0; padding: 0 16px 10px;
  font-size: 12.5px; line-height: 1.5; color: var(--text-dim, #474C54);
}

.ti-fb-form { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 14px; }
.ti-fb-label { font-size: 12px; font-weight: 600; color: var(--text, #15171C); }

.ti-fb-note {
  width: 100%; box-sizing: border-box; min-width: 0;
  background: var(--bg, #ECEDE8);
  border: 1px solid var(--border, #D6D9D3);
  border-radius: 10px;
  padding: 9px 11px;
  color: var(--text, #15171C);
  font-size: 13.5px; line-height: 1.5;
  font-family: var(--sans, system-ui, sans-serif);
  resize: vertical;
}
.ti-fb-note::placeholder { color: var(--text-dimmer, #686E77); }
.ti-fb-note:focus-visible { outline: 2px solid var(--accent, #1B53C6); outline-offset: 1px; }

/* the read-only page line: a quiet tag plus the page label, never editable */
.ti-fb-page-row {
  display: flex; align-items: baseline; gap: 8px;
  background: var(--accent-pale, rgba(27, 83, 198, 0.065));
  border: 1px solid var(--border-accent, rgba(27, 83, 198, 0.20));
  border-radius: 8px;
  padding: 7px 10px;
}
.ti-fb-page-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-deep, #123A92);
  flex: 0 0 auto;
}
.ti-fb-page-val {
  font-size: 12.5px; color: var(--text, #15171C);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ti-fb-ratings { display: flex; flex-wrap: wrap; gap: 6px; }
.ti-fb-rating {
  background: var(--bg, #ECEDE8);
  border: 1px solid var(--border, #D6D9D3);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--text-dim, #474C54);
  cursor: pointer;
  font-family: var(--sans, system-ui, sans-serif);
}
.ti-fb-rating:hover { border-color: var(--border-accent, rgba(27, 83, 198, 0.20)); color: var(--text, #15171C); }
.ti-fb-rating:focus-visible { outline: 2px solid var(--accent, #1B53C6); outline-offset: 2px; }
.ti-fb-rating.is-on {
  background: var(--accent-soft, rgba(27, 83, 198, 0.14));
  border-color: var(--border-accent, rgba(27, 83, 198, 0.20));
  color: var(--accent-deep, #123A92);
  font-weight: 600;
}

.ti-fb-status {
  min-height: 18px;
  font-size: 12.5px; line-height: 1.4;
  color: var(--text-dim, #474C54);
}
.ti-fb-status.is-ok { color: var(--ok, #2F7D5B); font-weight: 600; }
.ti-fb-status.is-error { color: var(--warn, #B23A30); font-weight: 600; }

.ti-fb-actions { display: flex; justify-content: flex-end; }
.ti-fb-send {
  background: var(--accent-bright, #2E6CF0);
  color: #fff;
  border: 1px solid var(--accent-bright, #2E6CF0);
  border-radius: 10px;
  padding: 9px 18px;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  font-family: var(--sans, system-ui, sans-serif);
}
.ti-fb-send:hover { background: var(--accent, #1B53C6); border-color: var(--accent, #1B53C6); }
.ti-fb-send:focus-visible { outline: 2px solid var(--accent, #1B53C6); outline-offset: 2px; }
.ti-fb-send:disabled { opacity: 0.6; cursor: default; }

/* motion: a gentle reveal that the reduced-motion guard drops */
@media (prefers-reduced-motion: no-preference) {
  .ti-fb-panel.is-open { animation: tiFbIn 0.18s ease; }
}
@keyframes tiFbIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .ti-fb-panel, .ti-feedback-launch { transition: none; animation: none; }
}

/* phone: the pill drops to a compact glyph-only puck so it stays clear of the
   page-tour launcher on a narrow screen. */
@media (max-width: 820px) {
  .ti-feedback-launch { padding: 8px; }
  .ti-feedback-launch-label { display: none; }
}
