/* ============================================================================
   The feedback popup (templates/_feedback.html).

   Redesigned: category chips, a message field with a counter, photo attachments
   with thumbnails, an optional reply address and a collapsible "page details"
   block. Everything is scoped to .fbk- so it cannot touch the editor's own
   panels, and the modal chrome still comes from .modal / .modal-box.
   ========================================================================== */

.fbk-box {
  max-width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.fbk-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.fbk-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: 0 0 auto;
  border-radius: 10px; font-size: 1rem;
  background: var(--brand-soft, #e8f4fd);
  color: var(--brand, #1f7ae0);
}
.fbk-box h3 { margin: 0 0 4px; }
.fbk-lead { margin: 0; font-size: .86rem; line-height: 1.5; color: var(--muted); }

/* --------------------------------------------------------------- category */
.fbk-cats {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 16px; padding: 0; border: 0;
}
.fbk-cats legend {
  width: 100%; padding: 0; margin-bottom: 8px;
  font-size: .74rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}
.fbk-chip { position: relative; display: inline-flex; }
.fbk-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fbk-chip span {
  display: inline-block; padding: 7px 12px;
  border: 1px solid var(--line-2, #d8e0e8); border-radius: 999px;
  background: var(--surface, #fff); color: var(--ink, #26303a);
  font-size: .84rem; cursor: pointer; white-space: nowrap;
}
.fbk-chip span:hover { border-color: var(--brand, #1f7ae0); }
.fbk-chip input:checked + span {
  border-color: var(--brand, #1f7ae0);
  background: var(--brand-soft, #e8f4fd);
  color: var(--brand, #1f7ae0);
  font-weight: 600;
}
.fbk-chip input:focus-visible + span { outline: 2px solid var(--brand, #1f7ae0); outline-offset: 2px; }

/* ----------------------------------------------------------------- fields */
.fbk-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 0 0 6px;
  font-size: .8rem; font-weight: 600; color: var(--ink, #26303a);
}
.fbk-hint, .fbk-count { font-weight: 400; font-size: .76rem; color: var(--muted); }
.fbk-form textarea, .fbk-form input[type="email"] { width: 100%; }
.fbk-form textarea { resize: vertical; min-height: 108px; }
.fbk-form input[type="email"] { margin-bottom: 4px; }

/* -------------------------------------------------------------- photos */
.fbk-attach { margin-top: 14px; }
.fbk-drop {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  border: 1.5px dashed var(--line-2, #cdd7e2); border-radius: 10px;
  background: var(--surface, #fff); cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.fbk-drop:hover, .fbk-drop.is-over {
  border-color: var(--brand, #1f7ae0);
  background: var(--brand-soft, #f2f9ff);
}
.fbk-drop.has-files { border-style: solid; }
.fbk-drop:focus-visible { outline: 2px solid var(--brand, #1f7ae0); outline-offset: 2px; }
.fbk-drop-ico { font-size: 1.2rem; line-height: 1; flex: 0 0 auto; }
.fbk-drop-text { display: flex; flex-direction: column; gap: 2px; font-size: .86rem; }
.fbk-drop-text small { color: var(--muted); font-size: .76rem; line-height: 1.4; }

.fbk-thumbs {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 10px 0 0; padding: 0; list-style: none;
}
.fbk-thumbs:empty { display: none; }
.fbk-thumb {
  position: relative; width: 72px;
  border: 1px solid var(--line-2, #d8e0e8); border-radius: 8px;
  overflow: hidden; background: #fff;
}
.fbk-thumb img { display: block; width: 100%; height: 54px; object-fit: cover; }
.fbk-thumb-name {
  display: block; padding: 2px 3px;
  font-size: .6rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fbk-thumb-x {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: rgba(17, 17, 17, .72); color: #fff;
  font-size: .8rem; line-height: 1; cursor: pointer;
}
.fbk-thumb-x:hover { background: #c0392b; }

/* ------------------------------------------------------------ page details */
.fbk-more { margin-top: 14px; }
.fbk-more summary {
  cursor: pointer; font-size: .8rem; color: var(--muted);
  padding: 4px 0;
}
.fbk-more summary:hover { color: var(--brand, #1f7ae0); }
.fbk-check {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 6px 0; font-size: .82rem; color: var(--ink, #26303a);
}
.fbk-check input { margin-top: 2px; }
.fbk-details {
  margin: 4px 0 0; padding: 8px 10px;
  border-radius: 8px; background: var(--surface-2, #f6f8fa);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem; line-height: 1.5; color: var(--muted);
  white-space: pre-wrap; word-break: break-all;
}

/* --------------------------------------------------------------- status */
.fbk-status {
  margin: 12px 0 0; padding: 8px 10px; border-radius: 8px;
  font-size: .82rem;
}
.fbk-status.is-info { background: #eef4fb; color: #23527c; }
.fbk-status.is-ok { background: #e8f6ee; color: #1d6b45; }
.fbk-status.is-warn { background: #fdf4e3; color: #8a5a12; }
.fbk-status.is-error { background: #fdeceb; color: #a02a1f; }

.fbk-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--line-2, #e6ebf1);
}
