/* Inline section feedback widget */

/* Feedback button — anchored to the section's right edge, outside
 * the centered text column on wider screens. Compact circular icon. */
.fb-link {
  position: absolute;
  top: 1.6rem;
  right: 0.9rem;
  width: 2.4rem;
  height: 2.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--warm-muted);
  background: rgba(255,255,255,0.6);
  border: 1px dashed var(--warm-muted);
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
  padding: 0;
  transition: opacity 0.2s, transform 0.15s;
}
.fb-link:hover { opacity: 0.9; transform: scale(1.05); }

@media (min-width: 900px) {
  /* Wider screens — push outside the 36em center column */
  .fb-link { right: max(0.9rem, calc(50% - 22em)); }
}

.sec--cold .fb-link,
.sec--map  .fb-link { color: var(--cold-fg); border-color: var(--cold-muted); background: rgba(0,0,0,0.18); }
.sec--dark .fb-link { color: #d8c8a8; border-color: #5a4a3a; background: rgba(255,255,255,0.04); }
.sec--summary .fb-link,
.sec--coda    .fb-link { color: var(--accent-soft); border-color: var(--accent-soft); }

/* Make sure all sections are positioning contexts */
.sec { position: relative; }

.fb-form {
  display: none;
  margin: 1rem 0 0;
  padding: 1rem;
  background: rgba(0,0,0,0.04);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.92em;
  line-height: 1.5;
}
.sec--cold .fb-form,
.sec--dark .fb-form { background: rgba(255,255,255,0.04); }

.fb-form.fb-form--open { display: block; }

.fb-form label {
  display: block;
  margin: 0 0 0.4em;
  font-size: 0.85em;
  color: inherit;
  opacity: 0.7;
}

.fb-form textarea,
.fb-form input[type=text] {
  width: 100%;
  font: inherit;
  font-family: inherit;
  background: transparent;
  border: 1px solid currentColor;
  opacity: 1;
  color: inherit;
  border-radius: 4px;
  padding: 0.55em 0.7em;
  margin: 0 0 0.7em;
  resize: vertical;
}
.fb-form textarea { min-height: 4.5em; }

.fb-actions {
  display: flex;
  align-items: center;
  gap: 0.75em;
}

.fb-btn {
  font-family: inherit;
  font-size: 0.92em;
  padding: 0.5em 1.1em;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.fb-btn:hover { opacity: 0.92; }
.fb-btn--ghost {
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  opacity: 0.8;
}

.fb-status {
  font-size: 0.85em;
  color: inherit;
  opacity: 0.7;
}

/* All-notes panel — fixed bottom-right */
.fb-tray {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  font-family: var(--sans);
  font-size: 0.86em;
}

.fb-tray__btn {
  background: #2a2520;
  color: #f0e0c0;
  border: 1px solid #4a3a2a;
  padding: 0.55em 1em;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}
.fb-tray__btn[hidden] { display: none; }

.fb-tray__panel {
  display: none;
  background: #fdf8ec;
  color: var(--warm-fg);
  border: 1px solid var(--warm-muted);
  border-radius: 8px;
  padding: 1rem;
  width: min(420px, calc(100vw - 2rem));
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  margin-bottom: 0.6rem;
}
.fb-tray__panel.fb-tray__panel--open { display: block; }

.fb-tray__list {
  margin: 0 0 0.7rem;
  padding: 0;
  list-style: none;
}
.fb-tray__list li {
  padding: 0.6em 0;
  border-bottom: 1px solid #ddd2bc;
  font-size: 0.92em;
}
.fb-tray__list li:last-child { border-bottom: 0; }

.fb-tray__sec {
  font-weight: 600;
  font-size: 0.78em;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.05em;
}
.fb-tray__when { color: var(--warm-muted); font-size: 0.78em; }

.fb-tray__text {
  margin: 0.25em 0;
  white-space: pre-wrap;
}

.fb-tray__empty {
  color: var(--warm-muted);
  font-style: italic;
  margin: 0 0 0.5rem;
}

@media (max-width: 600px) {
  .fb-tray { right: 0.6rem; bottom: 0.6rem; }
  .fb-tray__btn { font-size: 0.82em; }
}
