/* FORGE — Feedback / Bug Reporting styles
   Uses ARL brand tokens from styles.css */

/* ─── Floating bug button ──────────────────────────────────── */

.fb-floating-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--arl-accent);
  color: #fff;
  border: none;
  box-shadow: var(--arl-shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9500;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.fb-floating-btn:hover {
  transform: translateY(-2px) scale(1.05);
  background: var(--arl-accent-dark);
  box-shadow: 0 6px 20px rgba(225, 26, 34, 0.35);
}
.fb-floating-btn:active { transform: translateY(0) scale(0.98); }
.fb-floating-btn.hidden { display: none; }

/* ─── Modal ────────────────────────────────────────────────── */

.fb-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fb-modal.hidden { display: none; }

.fb-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 10, 25, 0.55);
  backdrop-filter: blur(2px);
}

.fb-modal-content {
  position: relative;
  background: var(--arl-white);
  border-radius: var(--arl-radius-lg);
  box-shadow: var(--arl-shadow-lg);
  width: min(560px, 92vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fbModalIn 0.18s ease;
}
.fb-modal-content-wide { width: min(1000px, 95vw); }

@keyframes fbModalIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fb-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--arl-border);
  background: var(--arl-surface-light);
}
.fb-modal-header h2 {
  font-family: var(--arl-font-heading);
  font-size: 18px;
  color: var(--arl-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}
.fb-modal-close {
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--arl-text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}
.fb-modal-close:hover { background: var(--arl-border); }

.fb-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.fb-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--arl-border);
  background: var(--arl-surface-light);
}

/* ─── Form ─────────────────────────────────────────────────── */

.fb-form-group { margin-bottom: 14px; }
.fb-form-group label {
  display: block;
  font-family: var(--arl-font-accent);
  font-weight: 600;
  font-size: 13px;
  color: var(--arl-text);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.fb-required { color: var(--arl-accent); }

.fb-form-group input[type="text"],
.fb-form-group input[type="email"],
.fb-form-group textarea,
.fb-form-group select,
.fb-admin-controls input[type="text"],
.fb-admin-controls textarea,
.fb-admin-controls select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--arl-border);
  border-radius: var(--arl-radius);
  font-family: var(--arl-font-body);
  font-size: 14px;
  background: var(--arl-white);
  color: var(--arl-text);
}
.fb-form-group textarea { resize: vertical; min-height: 80px; }

.fb-form-group input:focus,
.fb-form-group textarea:focus,
.fb-form-group select:focus {
  outline: none;
  border-color: var(--arl-primary);
  box-shadow: 0 0 0 3px rgba(0, 96, 175, 0.12);
}

.fb-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: end;
}
@media (max-width: 540px) {
  .fb-form-row { grid-template-columns: 1fr; }
}

.fb-checkbox-group {
  display: flex;
  align-items: center;
}
.fb-checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  margin-bottom: 0 !important;
  color: var(--arl-text) !important;
}

.fb-auto-captured {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--arl-surface-light);
  border: 1px solid var(--arl-border);
  border-radius: var(--arl-radius);
  font-size: 12px;
  color: var(--arl-text-secondary);
}
.fb-auto-captured-title {
  font-family: var(--arl-font-accent);
  font-weight: 600;
  color: var(--arl-text);
  margin-bottom: 4px;
}
.fb-auto-captured ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.fb-auto-captured li {
  padding: 2px 0;
  font-family: var(--arl-font-body);
}
.fb-auto-captured strong { color: var(--arl-text); font-weight: 600; }

#fb-status {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--arl-radius);
  font-size: 13px;
}
#fb-status.hidden { display: none; }
.fb-status-info { background: #EFF6FF; color: var(--arl-primary); border: 1px solid #BFDBFE; }
.fb-status-success { background: var(--arl-success-light); color: var(--arl-success); border: 1px solid #86EFAC; }
.fb-status-error { background: var(--arl-error-light); color: var(--arl-error); border: 1px solid #FECACA; }

/* ─── Buttons (scoped) ─────────────────────────────────────── */

/* The kit's buttons ("One FORGE look" step 3): normal case, blue primary, white secondary. */
.fb-btn {
  padding: 8px 14px;
  border-radius: var(--fk-radius-md);
  font-family: var(--fk-font-ui);
  font-weight: 600;
  font-size: var(--fk-type-md);
  line-height: 1.25;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.fb-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.fb-btn-primary { background: var(--fk-blue-600); color: var(--fk-white); }
.fb-btn-primary:hover:not(:disabled) { background: var(--fk-blue-700); }
.fb-btn-secondary { background: var(--fk-surface); color: var(--fk-ink); border-color: var(--fk-line); box-shadow: var(--fk-shadow-xs); }
.fb-btn-secondary:hover:not(:disabled) { background: var(--fk-canvas); }

/*
 * #227. The reopen button while its intent is armed — the reporter pressed it on an empty
 * composer and we are holding the intent rather than discarding it. It has to read as
 * "pending, come back to me", which a plain hover state does not.
 *
 * The outline is on box-shadow rather than `border`, because .fb-btn already sets a border
 * width and swapping the colour alone is invisible on the primary fill.
 */
.fb-btn-armed {
  box-shadow: 0 0 0 3px var(--arl-warning-light);
  position: relative;
}
.fb-btn-armed::after {
  content: '●';
  margin-left: 6px;
  color: var(--arl-warning);
}

/*
 * #227. The outcome of the last comment/reopen, pinned above the composer.
 *
 * It replaces a message that was written into #fb-comment-status and then destroyed
 * milliseconds later by the detail re-render, and cleared by a 1.5s timeout even when it
 * survived. There is deliberately NO auto-dismiss: the whole defect was a reporter not
 * being told what happened, so it stays until the next action re-renders the modal.
 */
.fb-detail-notice {
  margin: 8px 0 4px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.45;
}
.fb-detail-notice-ok {
  background: var(--arl-success-light);
  color: var(--arl-success);
  border: 1px solid #86EFAC;
}
/*
 * `warn`, not `error`: "your comment saved but the report is still Fixed" is a true,
 * successful outcome that the reporter must not mistake for an escalation. Red would say
 * the save failed; amber says look at this.
 */
.fb-detail-notice-warn {
  background: var(--arl-warning-light);
  color: var(--arl-warning-dark, #92400E);
  border: 1px solid var(--arl-warning);
}

/*
 * #227. "Awaiting reply" on the list — a resolved report whose newest comment came from
 * the reporter AFTER it was closed, i.e. we answered and they came back. Amber like the
 * notice above, and deliberately not a status pill: the status genuinely is Fixed.
 */
.fb-badge-awaiting {
  background: var(--arl-warning-light);
  color: var(--arl-warning-dark, #92400E);
  border: 1px solid var(--arl-warning);
  border-radius: 10px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── Admin triage page ───────────────────────────────────── */

/* No padding of its own above or beside: <main> supplies the gutter, which is what lets the
   header band (.fb-admin-header) reach main's edges like every other page's. */
.fb-admin-view {
  max-width: var(--arl-container);
  margin: 0 auto;
  padding: 0 0 32px;
}
.fb-admin-view.hidden { display: none; }

.fb-admin-toolbar { margin-bottom: 16px; }

.fb-admin-pills {
  display: flex;
  gap: 4px;
  background: var(--arl-surface-light);
  border: 1px solid var(--arl-border);
  border-radius: var(--arl-radius);
  padding: 3px;
}
.fb-pill {
  padding: 6px 14px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: calc(var(--arl-radius) - 2px);
  font-family: var(--arl-font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--arl-text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.fb-pill:hover { color: var(--arl-text); }
.fb-pill-active {
  background: #fff;
  color: var(--arl-text);
  border-color: var(--arl-border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/*
 * #227. The Awaiting-reply tab and its count.
 *
 * The count is ALWAYS rendered, including "0" — a pill that vanishes at zero is a pill
 * whose absence you cannot distinguish from a page that failed to load the number, and
 * the whole point of this tab is being trustworthy about what is outstanding.
 *
 * Quiet at zero, amber above it: `.fb-pill-has-waiting` is toggled from the list
 * response, so the colour tracks the server's number rather than anything the client
 * decided for itself.
 */
.fb-pill-count {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--arl-border);
  color: var(--arl-text-secondary);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.fb-pill-has-waiting { color: var(--arl-warning-dark, #92400E); }
.fb-pill-has-waiting .fb-pill-count {
  background: var(--arl-warning-light);
  color: var(--arl-warning-dark, #92400E);
  border: 1px solid var(--arl-warning);
  line-height: 14px;
}

/* On the header band the scope pills are the band's tabs (.fk-tab, forge-kit.css). The
   pill look above is for a light page; these put the tab look back over it. The script
   still marks the current one with .fb-pill-active. */
.fb-admin-pills.fk-tabs { gap: 4px 22px; padding: 0; background: none; border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); border-radius: 0; }
.fb-admin-pills.fk-tabs .fb-pill { padding: 10px 0 11px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; box-shadow: none; font-size: var(--fk-type-md); font-weight: 600; color: rgba(255, 255, 255, 0.62); }
.fb-admin-pills.fk-tabs .fb-pill:hover { color: var(--fk-white); }
.fb-admin-pills.fk-tabs .fb-pill.fb-pill-active { color: var(--fk-white); border-bottom-color: var(--fk-blue-400); }
.fb-admin-pills.fk-tabs .fb-pill-count { background: rgba(255, 255, 255, 0.14); color: var(--fk-white); }
.fb-admin-pills.fk-tabs .fb-pill-has-waiting { color: var(--fk-amber-100); }
.fb-admin-pills.fk-tabs .fb-pill-has-waiting .fb-pill-count { background: var(--fk-amber-600); color: var(--fk-white); border: 0; line-height: 16px; }

.fb-admin-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.fb-admin-filters select {
  padding: 6px 10px;
  border: 1px solid var(--arl-border);
  border-radius: var(--arl-radius);
  font-family: var(--arl-font-body);
  background: #fff;
  font-size: 13px;
}
.fb-admin-filters .fb-search-input {
  padding: 6px 10px;
  border: 1px solid var(--arl-border);
  border-radius: var(--arl-radius);
  font-family: var(--arl-font-body);
  background: #fff;
  font-size: 13px;
  min-width: 240px;
  flex: 1 1 240px;
  max-width: 360px;
}
.fb-admin-filters .fb-search-input::placeholder { color: var(--arl-text-muted); }

.fb-admin-subheader {
  color: var(--arl-text-secondary);
  font-size: 13px;
  margin-bottom: 12px;
}

.fb-admin-list {
  background: #fff;
  border: 1px solid var(--arl-border);
  border-radius: var(--arl-radius-lg);
  overflow: hidden;
  box-shadow: var(--arl-shadow);
}

.fb-row {
  display: grid;
  grid-template-columns: 4px 1fr auto;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--arl-border);
  cursor: pointer;
  transition: background 0.1s ease;
  align-items: center;
}
.fb-row:last-child { border-bottom: none; }
.fb-row:hover { background: var(--arl-surface-light); }

.fb-row-severity {
  width: 4px;
  align-self: stretch;
  border-radius: 2px;
}
.fb-sev-blocker { background: #991B1B; }
.fb-sev-major { background: var(--arl-accent); }
.fb-sev-minor { background: var(--arl-warning); }
.fb-sev-cosmetic { background: var(--arl-text-muted); }

.fb-row-title {
  font-weight: 600;
  color: var(--arl-text);
  font-size: 14px;
  margin-bottom: 3px;
}
.fb-row-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--arl-text-secondary);
  flex-wrap: wrap;
}
.fb-row-module {
  font-family: var(--arl-font-accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--arl-primary);
  font-size: 11px;
}
.fb-badge-icon {
  font-size: 12px;
  line-height: 1;
}
.fb-row-duration {
  font-family: var(--arl-font-accent);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.3px;
  color: var(--arl-success, #047857);
  background: var(--arl-success-light, #D1FAE5);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.fb-detail-resolution {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--arl-text-secondary);
}
.fb-detail-resolution-label {
  font-family: var(--arl-font-accent);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--arl-success, #047857);
  background: var(--arl-success-light, #D1FAE5);
  padding: 2px 8px;
  border-radius: 4px;
}
.fb-detail-resolution-duration {
  font-weight: 600;
  color: var(--arl-text);
}

/* Read-only resolution note shown to the reporter (non-admins). Admins edit
   the same text via the Resolution notes textarea in fb-admin-controls; this
   is the reporter-facing render so they can see how their bug was resolved. */
.fb-detail-resolution-notes {
  background: var(--arl-success-light, #D1FAE5);
  border-left: 3px solid var(--arl-success, #047857);
  border-radius: 0 var(--arl-radius) var(--arl-radius) 0;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.fb-detail-resolution-notes-label {
  font-family: var(--arl-font-accent);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--arl-success, #047857);
  margin-bottom: 6px;
}
.fb-detail-resolution-notes-body {
  white-space: pre-wrap;
  font-size: 14px;
  color: var(--arl-text);
}

/* A report's status: the kit's chip (.fk-chip in forge-kit.css), with a dot because each
   one is a state. */
.fb-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--fk-radius-pill);
  font-family: var(--fk-font-ui);
  font-size: var(--fk-type-xs);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.fb-status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
/* One meaning per state: New waits on someone to pick it up, Acknowledged and In Progress
   are moving, Fixed is done, Won't Fix is parked. */
.fb-status-new { color: var(--fk-attention); background: var(--fk-attention-bg); box-shadow: inset 0 0 0 1px var(--fk-attention-line); }
.fb-status-acknowledged,
.fb-status-in_progress { color: var(--fk-moving); background: var(--fk-moving-bg); box-shadow: inset 0 0 0 1px var(--fk-moving-line); }
.fb-status-fixed { color: var(--fk-done); background: var(--fk-done-bg); box-shadow: inset 0 0 0 1px var(--fk-done-line); }
.fb-status-wont_fix { color: var(--fk-parked); background: var(--fk-parked-bg); box-shadow: inset 0 0 0 1px var(--fk-parked-line); }

.fb-row-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Who it is assigned to, as the kit draws a person: initials, then the name (step 6).
   It was the email, in a typewriter face. */
.fb-row-assigned {
  display: inline-flex;
  align-items: center;
  font-size: var(--fk-type-xs);
  color: var(--fk-ink-2);
}
.fb-row-assigned .fk-avatar { width: 20px; height: 20px; margin-right: 6px; }

/* Accept button — row-level chip + detail-modal large variant. The row's main action, in
   the kit's words: normal case, in the UI font, beside a status chip that is too. */
.fb-accept-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: 1px solid var(--arl-primary);
  border-radius: 14px;
  background: var(--arl-primary);
  color: #fff;
  font-family: var(--fk-font-ui);
  font-size: var(--fk-type-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, transform 0.08s;
  white-space: nowrap;
}
.fb-accept-chip:hover { background: var(--arl-primary-dark); }
.fb-accept-chip:active { transform: scale(0.97); }
.fb-accept-chip:disabled { opacity: 0.6; cursor: default; }
.fb-accept-chip-lg {
  grid-column: 1 / -1;
  padding: 10px 16px;
  border-radius: var(--arl-radius);
  font-size: 13px;
  justify-content: center;
}

.fb-row-new-indicator {
  display: none; /* reserved for future dot */
}
.fb-row-new .fb-row-title::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--arl-accent);
  margin-right: 8px;
  vertical-align: middle;
}

.fb-loading, .fb-empty, .fb-error {
  padding: 24px;
  text-align: center;
  color: var(--arl-text-secondary);
  font-size: 14px;
}
.fb-error { color: var(--arl-error); }

/* ─── Detail modal ─────────────────────────────────────────── */

.fb-detail-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 760px) {
  .fb-detail-grid { grid-template-columns: 1fr; }
}

.fb-detail-title {
  font-family: var(--arl-font-heading);
  font-size: 20px;
  color: var(--arl-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.fb-detail-meta {
  font-size: 12px;
  color: var(--arl-text-secondary);
  margin-bottom: 14px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fb-detail-description {
  background: var(--arl-surface-light);
  padding: 12px 14px;
  border-left: 3px solid var(--arl-primary);
  border-radius: 0 var(--arl-radius) var(--arl-radius) 0;
  white-space: pre-wrap;
  font-size: 14px;
  margin-bottom: 16px;
}

.fb-admin-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  padding: 14px;
  background: var(--arl-surface-light);
  border-radius: var(--arl-radius);
  margin-bottom: 14px;
}
.fb-admin-controls label {
  display: block;
  font-family: var(--arl-font-accent);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--arl-text);
  margin-bottom: 0;
}
.fb-admin-controls label.fb-full-width { grid-column: 1 / -1; }
.fb-admin-controls input,
.fb-admin-controls select,
.fb-admin-controls textarea {
  margin-top: 4px;
}
.fb-admin-controls #fb-detail-save { grid-column: 1; justify-self: start; }
.fb-save-status {
  grid-column: 2;
  align-self: end;
  font-size: 12px;
  color: var(--arl-success);
}

.fb-detail-context {
  margin-top: 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--arl-border);
  border-radius: var(--arl-radius);
  font-size: 12px;
}
.fb-detail-context summary {
  cursor: pointer;
  font-family: var(--arl-font-accent);
  font-weight: 600;
  color: var(--arl-primary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 12px;
  padding: 4px 0;
}
.fb-context-kv { margin: 4px 0; color: var(--arl-text-secondary); }
.fb-context-kv code {
  background: var(--arl-surface-light);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11px;
  word-break: break-all;
}
.fb-console-errors {
  background: var(--arl-dark);
  color: #E5E7EB;
  padding: 10px;
  border-radius: var(--arl-radius);
  max-height: 260px;
  overflow: auto;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  white-space: pre-wrap;
}

.fb-detail-screenshot {
  background: var(--arl-surface-light);
  border: 1px solid var(--arl-border);
  border-radius: var(--arl-radius);
  padding: 8px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fb-detail-screenshot img {
  max-width: 100%;
  max-height: 500px;
  border-radius: var(--arl-radius);
  display: block;
}
.fb-no-screenshot {
  color: var(--arl-text-muted);
  font-style: italic;
  font-size: 13px;
}

/* ─── Unread-count badge (rendered inside the static landing card) ── */

.fb-new-badge {
  background: var(--arl-accent);
  color: #fff;
  font-family: var(--arl-font-accent);
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  line-height: 1.4;
}
.fb-new-badge.hidden { display: none; }

/* ── List row ID chip ─────────────────────────────────────────── */
.fb-row-id {
  font-family: var(--arl-font-accent);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--arl-text-muted);
  background: var(--arl-surface-2, #F1F5F9);
  padding: 2px 6px;
  border-radius: 6px;
  margin-right: 6px;
  vertical-align: 1px;
}

/* ── Comment thread ──────────────────────────────────────────── */
.fb-comments-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--arl-border, #E5E7EB);
}
.fb-comments-header {
  font-family: var(--arl-font-accent);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--arl-text-secondary);
  margin-bottom: 10px;
}
.fb-comments-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.fb-comments-empty {
  font-size: 13px;
  color: var(--arl-text-muted);
  font-style: italic;
  padding: 6px 0;
}
.fb-comment {
  background: var(--arl-surface-2, #F9FAFB);
  border: 1px solid var(--arl-border, #E5E7EB);
  border-radius: 8px;
  padding: 10px 12px;
}
.fb-comment-reopen {
  background: #FEF3C7;
  border-color: #FCD34D;
}
.fb-comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 5px;
  color: var(--arl-text-secondary);
}
.fb-comment-author { font-weight: 600; color: var(--arl-text); }
.fb-comment-date { color: var(--arl-text-muted); margin-left: auto; }
.fb-comment-reopen-badge {
  font-family: var(--arl-font-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  background: #92400E;
  color: #FEF3C7;
  padding: 1px 6px;
  border-radius: 4px;
}
.fb-comment-body {
  font-size: 13px;
  color: var(--arl-text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Comment composer ─────────────────────────────────────── */
.fb-comment-composer textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--arl-border, #D1D5DB);
  border-radius: 6px;
  resize: vertical;
  min-height: 60px;
  box-sizing: border-box;
}
.fb-comment-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.fb-comment-actions .fb-save-status { margin-left: auto; }

/* ─── Attachment widget (submit modal + comment form) ─────────── */

.fb-attach-mount { margin-top: 14px; }

.fb-attach-widget {
  border: 1px solid var(--arl-border);
  border-radius: var(--arl-radius);
  padding: 10px 12px;
  background: var(--arl-surface-light);
}
.fb-attach-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.fb-attach-label {
  font-family: var(--arl-font-accent);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--arl-text);
}
.fb-attach-help {
  font-size: 11px;
  color: var(--arl-text-muted);
}
.fb-attach-dropzone {
  border: 1px dashed var(--arl-border);
  border-radius: var(--arl-radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.12s ease, border-color 0.12s ease;
  background: #fff;
}
.fb-attach-dropzone:focus-visible {
  outline: 2px solid var(--arl-primary);
  outline-offset: 2px;
}
.fb-attach-dropzone-active {
  border-color: var(--arl-primary);
  background: #f1f7ff;
}
.fb-attach-hint {
  font-size: 12px;
  color: var(--arl-text-muted);
}
.fb-attach-error {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: var(--arl-radius);
  background: #fdecea;
  color: #b3261e;
  font-size: 12px;
}
.fb-attach-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.fb-attach-strip:empty { margin-top: 0; }
.fb-attach-thumb {
  position: relative;
  border: 1px solid var(--arl-border);
  border-radius: var(--arl-radius);
  background: #fff;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fb-attach-thumb img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.fb-attach-caption {
  font-size: 11px;
  padding: 4px 6px;
  border: 1px solid var(--arl-border);
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
}
.fb-attach-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fb-attach-remove:hover { background: rgba(0, 0, 0, 0.85); }

/* ─── Detail-view gallery (right rail + inline on comments) ────── */

.fb-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.fb-gallery-inline {
  margin-top: 8px;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
.fb-gallery-thumb {
  position: relative;
  padding: 0;
  border: 1px solid var(--arl-border);
  border-radius: var(--arl-radius);
  background: #fff;
  cursor: zoom-in;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.fb-gallery-thumb:hover { border-color: var(--arl-primary); }
.fb-gallery-thumb img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  display: block;
}
.fb-gallery-inline .fb-gallery-thumb img { height: 70px; }
.fb-gallery-tag {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.fb-gallery-caption {
  font-size: 11px;
  color: var(--arl-text);
  padding: 4px 6px;
  background: var(--arl-surface-light);
  border-top: 1px solid var(--arl-border);
  text-align: left;
  /* truncate to single line */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Lightbox ─────────────────────────────────────────────────── */

.fb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fb-lightbox.hidden { display: none; }
.fb-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
}
.fb-lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.fb-lightbox-img {
  max-width: 92vw;
  max-height: 80vh;
  border-radius: var(--arl-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.fb-lightbox-caption {
  color: #fff;
  font-size: 13px;
  text-align: center;
  max-width: 70ch;
}
.fb-lightbox-close {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #fff;
  color: #222;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ─── File attachments (#237) ──────────────────────────────────────
 *
 * A file has no thumbnail to show, so it gets a named chip instead. Deliberately
 * placed at the END of this file: `.fb-gallery-file` and `.fb-gallery-thumb` are
 * both single-class selectors (0,1,0), so the tie is broken by source order and
 * these overrides only apply because they come later. Moving this block above
 * the gallery section would leave every rule here inert while still READING as
 * correct — the #231 trap, where `.dash-nv-falling-note` lost the same tie and
 * the amber never applied.
 */

.fb-gallery-file { cursor: pointer; }
.fb-gallery-file .fb-gallery-fileicon {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--arl-primary);
  background: #f4f6f8;
}
.fb-gallery-filename {
  font-size: 11px;
  padding: 4px 6px;
  text-align: left;
  word-break: break-all;
  line-height: 1.3;
  max-height: 2.6em;
  overflow: hidden;
}
.fb-gallery-filehint {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0 6px 5px;
  color: #6b7280;
  text-align: left;
}
.fb-gallery-file:hover .fb-gallery-filehint { color: var(--arl-primary); }
.fb-gallery-inline .fb-gallery-file .fb-gallery-fileicon { height: 70px; }

/* Staged-in-the-composer chips, before the report is posted. */
.fb-attach-thumb-file .fb-attach-fileicon {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--arl-primary);
  background: #f4f6f8;
  border-radius: 4px;
}
.fb-attach-filename {
  font-size: 11px;
  word-break: break-all;
  line-height: 1.3;
  max-height: 2.6em;
  overflow: hidden;
}
.fb-attach-filesize {
  font-size: 10px;
  color: #6b7280;
}

/* ─── Shared with (#187) ───────────────────────────────────────────
 * Appended at the end of the file on purpose, same reasoning as the file-chip
 * block above: these are single-class selectors and source order breaks a
 * specificity tie. A test pins the ordering.
 */

.fb-share {
  margin-top: 14px;
  border: 1px solid var(--arl-border);
  border-radius: var(--arl-radius);
  background: #fff;
  padding: 10px 12px;
}
.fb-share-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.fb-share-head h4 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #586173;
}
.fb-share-count {
  font-size: 11px;
  background: #eef1f4;
  border-radius: 10px;
  padding: 1px 7px;
  color: #586173;
}
.fb-share-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}
.fb-share-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid #f0f2f5;
}
.fb-share-row:last-child { border-bottom: 0; }
.fb-share-who {
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}
.fb-share-by {
  flex: 0 0 auto;
  font-size: 10px;
  color: #9aa3b0;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fb-share-remove {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #9aa3b0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.fb-share-remove:hover { color: var(--arl-primary); }
.fb-share-empty {
  font-size: 12px;
  color: #9aa3b0;
  padding: 4px 0;
}
.fb-share-add {
  display: flex;
  gap: 6px;
  align-items: center;
}
.fb-share-add .up-picker { flex: 1 1 auto; min-width: 0; }
.fb-share-note {
  font-size: 11px;
  color: #9aa3b0;
  line-height: 1.4;
}
.fb-share-error {
  margin-top: 6px;
  font-size: 11px;
  color: var(--arl-primary);
}
