/* V6.x Moderação: lado do membro (tema escuro do app). Variáveis --mod-* presas a .mod-m; o integrador pode mapear às do app. */
.mod-m {
  --mod-bg: #0f0f0f;
  --mod-surface: #1a1a1a;
  --mod-surface-2: #222222;
  --mod-text: #f2f2f2;
  --mod-muted: #b3b3b3;
  --mod-border: #3a3a3a;
  --mod-accent: #ff6b35;
  --mod-on-accent: #111111;
  --mod-danger: #e5484d;
  --mod-danger-text: #ff9592;
  --mod-on-danger: #ffffff;
  --mod-warn-bg: #3a2a12;
  --mod-warn-text: #ffd08a;
  --mod-ok: #3ecf8e;
  --mod-focus: #ffb38f;
  --mod-overlay: rgba(0, 0, 0, .66);
  color: var(--mod-text);
  font-size: 15px;
  line-height: 1.45;
  box-sizing: border-box;
}
.mod-m *, .mod-m *::before, .mod-m *::after { box-sizing: border-box; }

/* Folha de baixo */
.mod-m.mod-m-overlay { position: fixed; inset: 0; background: var(--mod-overlay); z-index: 10000; display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .18s; }
.mod-m.mod-m-overlay.is-open { opacity: 1; }
.mod-m-sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; overflow-x: hidden; background: var(--mod-surface); border-radius: 18px 18px 0 0; border: 1px solid var(--mod-border); border-bottom: 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(24px); transition: transform .18s; }
.mod-m-overlay.is-open .mod-m-sheet { transform: none; }
.mod-m-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--mod-border); margin: 4px auto 10px; }
.mod-m-h { font-size: 19px; margin: 4px 0 8px; color: var(--mod-text); }
.mod-m-sub { margin: 0 0 10px; color: var(--mod-muted); }
.mod-m-preview { background: var(--mod-surface-2); border-left: 3px solid var(--mod-border); padding: 8px 10px; border-radius: 6px; margin: 0 0 10px; overflow-wrap: anywhere; color: var(--mod-text); }
.mod-m-preview-img img { max-width: 100%; max-height: 120px; border-radius: 6px; display: block; }

.mod-m-cats { border: 0; margin: 0; padding: 0; min-width: 0; }
.mod-m-cats legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.mod-m-cat { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--mod-border); border-radius: 12px; margin-bottom: 6px; cursor: pointer; background: var(--mod-surface-2); min-height: 44px; }
.mod-m-cat:has(input:checked) { border-color: var(--mod-accent); }
.mod-m-cat input { margin-top: 3px; accent-color: var(--mod-accent); width: 18px; height: 18px; flex: none; }
.mod-m-cat span { display: flex; flex-direction: column; min-width: 0; }
.mod-m-cat small { color: var(--mod-muted); font-size: 13px; }

.mod-m-alert { background: var(--mod-warn-bg); color: var(--mod-warn-text); border: 1px solid #8a5a14; border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.mod-m-alert p { margin: 4px 0 0; }
.mod-m-alert[hidden] { display: none; }

.mod-m-field { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-size: 14px; }
.mod-m-field > span { font-weight: 600; }
.mod-m-field-inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.mod-m-note, .mod-m-input { width: 100%; background: var(--mod-bg); color: var(--mod-text); border: 1px solid var(--mod-border); border-radius: 10px; padding: 10px; font: inherit; }
.mod-m-input { width: 110px; }
.mod-m-counter { align-self: flex-end; color: var(--mod-muted); font-size: 12px; }
.mod-m-err { color: var(--mod-danger-text); min-height: 1em; margin: 4px 0; font-size: 14px; }
.mod-m-fine { color: var(--mod-muted); font-size: 13px; margin: 6px 0; }
.mod-m-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.mod-m-row .mod-m-btn { flex: 1 1 140px; }
.mod-m-check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }
.mod-m-check input { width: 18px; height: 18px; accent-color: var(--mod-danger); flex: none; margin-top: 2px; }
.mod-m-done { text-align: center; padding: 12px 0; }
.mod-m-done .mod-m-check { display: inline-flex; width: 52px; height: 52px; border-radius: 50%; background: var(--mod-ok); color: #0b0b0b; font-size: 28px; align-items: center; justify-content: center; margin: 6px auto; }

/* Botões */
.mod-m-btn { appearance: none; border: 1px solid var(--mod-border); background: var(--mod-surface-2); color: var(--mod-text); border-radius: 12px; padding: 11px 16px; font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; }
.mod-m-btn[disabled] { opacity: .5; cursor: not-allowed; }
.mod-m-btn-primary { background: var(--mod-accent); border-color: var(--mod-accent); color: var(--mod-on-accent); }
.mod-m-btn-danger { background: transparent; border-color: var(--mod-danger); color: var(--mod-danger-text); }
.mod-m-sheet .mod-m-btn-danger.mod-m-confirm:not([disabled]), .mod-m-sheet .mod-m-ok.mod-m-btn-danger { background: var(--mod-danger); color: var(--mod-on-danger); }
.mod-m-btn-small { padding: 6px 12px; min-height: 36px; font-size: 13px; }
.mod-m-btn-block { width: 100%; text-align: left; }
.mod-m-btn:focus-visible, .mod-m-note:focus-visible, .mod-m-input:focus-visible, .mod-m-switch input:focus-visible + .mod-m-slider { outline: 2px solid var(--mod-focus); outline-offset: 2px; }

/* Centro de Privacidade */
.mod-m-privacy { width: 100%; max-width: 100%; overflow-wrap: anywhere; }
.mod-m-sec { background: var(--mod-surface); border: 1px solid var(--mod-border); border-radius: 14px; padding: 12px 14px; margin: 0 0 12px; }
.mod-m-sec h3 { margin: 0 0 6px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.mod-m-sec h4 { margin: 14px 0 6px; font-size: 14px; }
.mod-m-muted { color: var(--mod-muted); }
.mod-m-small { font-size: 13px; }
.mod-m-list { list-style: none; padding: 0; margin: 6px 0 0; }
.mod-m-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mod-m-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.mod-m-consent { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--mod-border); }
.mod-m-consent:first-child { border-top: 0; }
.mod-m-consent-txt { display: flex; flex-direction: column; min-width: 0; }
.mod-m-consent-label { font-weight: 600; }
.mod-m-consent-txt small { font-size: 12.5px; }
.mod-m-switch { position: relative; display: inline-block; width: 50px; height: 30px; flex: none; }
.mod-m-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.mod-m-slider { position: absolute; inset: 0; background: #555; border-radius: 30px; transition: background .15s; }
.mod-m-slider::before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.mod-m-switch input:checked + .mod-m-slider { background: var(--mod-accent); }
.mod-m-switch input:checked + .mod-m-slider::before { transform: translateX(20px); }
.mod-m-switch input:disabled + .mod-m-slider { opacity: .5; }

.mod-m-notice, .mod-m-req { padding: 10px 0; border-top: 1px solid var(--mod-border); }
.mod-m-notice:first-child, .mod-m-req:first-child { border-top: 0; }
.mod-m-notice p { margin: 4px 0; }
.mod-m-notice.is-unread { border-left: 3px solid var(--mod-accent); padding-left: 10px; }
.mod-m-notice-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mod-m-notice-top time { color: var(--mod-muted); font-size: 12.5px; }
.mod-m-pill { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--mod-surface-2); border: 1px solid var(--mod-border); color: var(--mod-text); }
.mod-m-pill-done { border-color: var(--mod-ok); color: #8ff0c0; }
.mod-m-pill-rejected { border-color: var(--mod-danger); color: var(--mod-danger-text); }
.mod-m-pill-received, .mod-m-pill-in_progress { border-color: #8a5a14; color: var(--mod-warn-text); }

/* Contador de avisos não lidos */
.mod-m-badge { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--mod-accent, #ff6b35); color: var(--mod-on-accent, #111); font-size: 12px; font-weight: 700; align-items: center; justify-content: center; line-height: 1; }
:not(.mod-m) > .mod-m-badge:not(.mod-m-badge-inline) { margin-left: 6px; background: #ff6b35; color: #111; }

.mod-m-toast { display: none; border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; font-weight: 600; }
.mod-m-toast.is-on { display: block; }
.mod-m-toast-ok { background: #123326; color: #8ff0c0; border: 1px solid var(--mod-ok); }
.mod-m-toast-err { background: #3b1416; color: var(--mod-danger-text); border: 1px solid var(--mod-danger); }

/* V6.x Moderação: ecrã bloqueante de idade (a toda a altura) */
html.mod-m-locked, html.mod-m-locked body { overflow: hidden; }
.mod-m.mod-m-agegate { position: fixed; inset: 0; z-index: 10050; background: var(--mod-bg); display: flex; align-items: center; justify-content: center; padding: 24px 16px; min-height: 100vh; min-height: 100dvh; overflow-y: auto; }
.mod-m-agegate-box { width: 100%; max-width: 420px; background: var(--mod-surface); border: 1px solid var(--mod-border); border-radius: 18px; padding: 22px 18px; }
.mod-m-agegate-box .mod-m-h { font-size: 22px; }
.mod-m-agegate-box .mod-m-input { width: 100%; font-size: 20px; text-align: center; letter-spacing: 2px; }
.mod-m-agegate-box .mod-m-btn-block { text-align: center; margin-top: 8px; }
.mod-m-agegate-icon { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--mod-accent); color: var(--mod-accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; margin: 0 auto 12px; }
.mod-m-agegate-blocked { text-align: center; }
.mod-m-reason { font-size: 14px; margin: 4px 0; }
