/* LoadDone — Feedback & Suggestions (driver) v1.7.0 */
/* Matches: red #d42a1e, white cards, pale gray #f5f6f8, rounded 12px */

.fb-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 18, 25, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.fb-backdrop[hidden] { display: none; }
@media (min-width: 720px) {
  .fb-backdrop { align-items: center; padding: 24px; }
}
.fb-sheet {
  background: #fff; width: 100%; max-width: 560px; max-height: 92dvh;
  border-radius: 20px 20px 0 0; display: flex; flex-direction: column;
  overflow: hidden;
}
@media (min-width: 720px) {
  .fb-sheet { border-radius: 20px; max-height: 88vh; }
}
.fb-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid #eef0f3;
  position: sticky; top: 0; background: #fff; z-index: 2;
}
.fb-back {
  width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; border-radius: 12px;
  color: #1a1d23;
}
.fb-back:active { background: #f0f1f4; }
.fb-head h2 { font-size: 1.15rem; font-weight: 800; margin: 0; flex: 1; }
.fb-body {
  padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}
.fb-hero h3 { font-size: 1.35rem; font-weight: 800; margin: 0 0 6px; color: #14161a; }
.fb-hero p { color: #5b6470; margin: 0 0 20px; font-size: 0.95rem; }
.fb-label { display: block; font-weight: 700; margin: 18px 0 10px; font-size: 0.95rem; }
.fb-label .req { color: #d42a1e; }

/* Category tiles */
.fb-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fb-cat {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid #e3e6eb; border-radius: 12px; padding: 14px 12px;
  background: #fff; cursor: pointer; font-size: 0.9rem; font-weight: 600;
  min-height: 56px; text-align: left; color: #1a1d23; width: 100%;
}
.fb-cat svg { width: 22px; height: 22px; flex-shrink: 0; color: #5b6470; }
.fb-cat[aria-pressed="true"] {
  border-color: #d42a1e; background: #fef2f1; color: #d42a1e;
}
.fb-cat[aria-pressed="true"] svg { color: #d42a1e; }
.fb-cat:focus-visible { outline: 2px solid #d42a1e; outline-offset: 2px; }
.fb-cats-extra[hidden] { display: none; }
.fb-viewall {
  background: none; border: 0; color: #d42a1e; font-weight: 700;
  padding: 12px 4px; cursor: pointer; font-size: 0.9rem; min-height: 44px;
}

/* Inputs */
.fb-input, .fb-textarea {
  width: 100%; font-size: 16px; padding: 14px;
  border: 1.5px solid #e3e6eb; border-radius: 12px; background: #fff;
  font-family: inherit; color: #14161a; box-sizing: border-box;
}
.fb-input:focus, .fb-textarea:focus {
  outline: none; border-color: #d42a1e; box-shadow: 0 0 0 3px rgba(212,42,30,0.12);
}
.fb-textarea { min-height: 120px; resize: vertical; }
.fb-count { text-align: right; font-size: 0.8rem; color: #8a93a0; margin-top: 4px; }
.fb-err {
  color: #d42a1e; font-size: 0.85rem; margin-top: 6px; font-weight: 600;
}
.fb-err[hidden] { display: none; }
.fb-input[aria-invalid="true"], .fb-textarea[aria-invalid="true"] {
  border-color: #d42a1e;
}

/* Upload */
.fb-upload {
  border: 1.5px dashed #c9ced6; border-radius: 12px; padding: 24px 16px;
  text-align: center; cursor: pointer; background: #fafbfc;
  min-height: 44px; display: block; width: 100%; box-sizing: border-box;
}
.fb-upload:hover { border-color: #d42a1e; background: #fef2f1; }
.fb-upload svg { width: 28px; height: 28px; color: #8a93a0; margin-bottom: 8px; }
.fb-upload strong { display: block; font-size: 0.9rem; }
.fb-upload span { font-size: 0.8rem; color: #8a93a0; }
.fb-previews { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.fb-preview {
  position: relative; width: 88px; height: 88px; border-radius: 10px;
  overflow: hidden; border: 1px solid #e3e6eb;
}
.fb-preview img { width: 100%; height: 100%; object-fit: cover; }
.fb-preview button {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px;
  border-radius: 50%; border: 0; background: rgba(0,0,0,0.6); color: #fff;
  cursor: pointer; font-size: 16px; line-height: 1;
}

/* Checkbox */
.fb-check {
  display: flex; gap: 12px; align-items: flex-start; margin: 18px 0;
  cursor: pointer; min-height: 44px;
}
.fb-check input {
  width: 24px; height: 24px; margin: 0; flex-shrink: 0; accent-color: #d42a1e;
  cursor: pointer;
}
.fb-check span { font-size: 0.9rem; line-height: 1.4; }
.fb-check small { display: block; color: #8a93a0; font-size: 0.8rem; margin-top: 2px; }

/* Sender info */
.fb-sender {
  background: #f5f6f8; border-radius: 12px; padding: 14px; margin: 18px 0;
  font-size: 0.9rem;
}
.fb-sender div { margin: 4px 0; }
.fb-sender strong { color: #5b6470; font-weight: 600; margin-right: 8px; }

/* Notice */
.fb-notice {
  background: #fef9e7; border: 1px solid #f5e6a3; border-radius: 10px;
  padding: 12px 14px; font-size: 0.85rem; color: #6b5e1a; margin: 16px 0;
}

/* Buttons */
.fb-actions { display: grid; gap: 10px; margin-top: 20px; }
.fb-btn-primary {
  background: #d42a1e; color: #fff; border: 0; border-radius: 12px;
  padding: 16px; font-size: 1rem; font-weight: 700; cursor: pointer;
  min-height: 52px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.fb-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.fb-btn-primary:not(:disabled):active { background: #b82318; }
.fb-btn-secondary {
  background: #fff; color: #1a1d23; border: 1.5px solid #e3e6eb;
  border-radius: 12px; padding: 14px; font-size: 1rem; font-weight: 600;
  cursor: pointer; min-height: 52px; width: 100%;
}
.fb-btn-secondary:active { background: #f5f6f8; }

/* Success */
.fb-success { text-align: center; padding: 32px 20px; }
.fb-success svg { width: 64px; height: 64px; color: #16a34a; margin-bottom: 16px; }
.fb-success h3 { font-size: 1.25rem; margin: 0 0 10px; }
.fb-success p { color: #5b6470; margin: 0 0 6px; }
.fb-success .fb-ref {
  font-size: 1.1rem; font-weight: 800; color: #d42a1e; margin: 12px 0 24px;
}

/* My feedback list */
.fb-list { display: grid; gap: 10px; }
.fb-item {
  background: #fff; border: 1px solid #eef0f3; border-radius: 12px;
  padding: 16px; cursor: pointer; width: 100%; text-align: left;
  min-height: 44px;
}
.fb-item:active { background: #fafbfc; }
.fb-item-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.fb-item-ref { font-weight: 800; color: #d42a1e; font-size: 0.9rem; }
.fb-item-subject { font-weight: 700; margin: 0 0 4px; font-size: 0.95rem; }
.fb-item-date { font-size: 0.8rem; color: #8a93a0; }
.fb-status {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 0.8rem; font-weight: 700; white-space: nowrap;
}
.fb-status.new { background: #fef2f1; color: #d42a1e; }
.fb-status.under_review { background: #fef9e7; color: #92400e; }
.fb-status.planned { background: #eff6ff; color: #1d4ed8; }
.fb-status.resolved { background: #f0fdf4; color: #15803d; }
.fb-status.closed { background: #f5f6f8; color: #5b6470; }

/* Detail */
.fb-detail-meta {
  display: grid; gap: 8px; background: #f5f6f8; border-radius: 12px;
  padding: 14px; margin: 16px 0; font-size: 0.9rem;
}
.fb-detail-msg {
  background: #fff; border: 1px solid #eef0f3; border-radius: 12px;
  padding: 16px; white-space: pre-wrap; font-size: 0.95rem; line-height: 1.5;
}
.fb-attach-list { display: grid; gap: 8px; margin-top: 12px; }
.fb-attach {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border: 1px solid #eef0f3; border-radius: 10px; background: #fff;
  text-decoration: none; color: inherit; min-height: 44px;
}
.fb-attach img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.fb-attach span { flex: 1; font-size: 0.9rem; }
.fb-attach small { color: #8a93a0; display: block; font-size: 0.8rem; }

.fb-empty { text-align: center; padding: 48px 20px; color: #8a93a0; }
.fb-empty svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.5; }

.fb-loading { text-align: center; padding: 32px; color: #8a93a0; }

@media (prefers-reduced-motion: reduce) {
  .fb-sheet, .fb-cat, .fb-btn-primary { transition: none; }
}
