/*
  Stage 4 — DM privacy + trust banner.

  Two surfaces:
    - .dm-trust-banner  — compact Discord-style safety callout rendered
      above the DM intro when the peer is a stranger (no exchanged
      history, no shared context) AND show_trust_banner is on.
    - #privacySection   — settings-modal panel: policy radio, toggles,
      and allow/deny override lists. Lives inside .modal-content and is
      revealed by the "Конфиденциальность" nav item.
*/

/* ── Trust banner ──────────────────────────────────────────────── */

.dm-trust-banner {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  margin: var(--space-md) var(--space-lg) 0;
  padding: var(--space-md);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-m);
  background: var(--glass);
  color: var(--ink);
  font-size: var(--font-sm);
  line-height: 1.45;
}

.dm-trust-banner-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.dm-trust-banner-body {
  flex: 1;
  min-width: 0;
}

.dm-trust-banner-title {
  margin: 0 0 4px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--ink);
}

.dm-trust-banner-text {
  margin: 0;
  color: var(--ink-muted);
}

.dm-trust-banner-dismiss {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

.dm-trust-banner-dismiss:hover { color: var(--ink); background: var(--surface); }

/* ── Privacy settings panel ────────────────────────────────────── */

/* Visibility is driven by `body[data-settings-section="privacy"]`
   on the wrapper [data-settings-section="privacy"] — see
   settings.css. Keep the layout primitives, drop `display:none`. */
#privacySection { display: flex; flex-direction: column; gap: var(--space-lg); max-width: 640px; }

.privacy-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-m);
  background: var(--surface);
}

.privacy-group-title {
  margin: 0;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.privacy-group-desc {
  margin: 0;
  font-size: var(--font-xs);
  color: var(--ink-muted);
}

.privacy-policy-option {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  padding: var(--space-sm);
  border: 1px solid transparent;
  border-radius: var(--radius-m);
  cursor: pointer;
  transition: background var(--transition);
}

.privacy-policy-option:hover { background: var(--glass); }
.privacy-policy-option.active { border-color: var(--accent); background: var(--glass); }

.privacy-policy-option input[type="radio"] {
  margin-top: 2px;
  flex-shrink: 0;
  /* DS path: Surface/radio/accent/default. accent-color paints both
     the radio fill (when checked) and the outline. */
  accent-color: var(--surface-radio-accent-default);
}
.privacy-policy-option input[type="radio"]:disabled {
  accent-color: var(--surface-radio-accent-disabled);
}

.privacy-policy-option-body { flex: 1; min-width: 0; }

.privacy-policy-option-label {
  display: block;
  font-size: var(--font-md);
  font-weight: 600;
  color: var(--ink);
}

.privacy-policy-option-hint {
  margin-top: 2px;
  font-size: var(--font-xs);
  color: var(--ink-muted);
}

.privacy-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--border-mid);
}

.privacy-toggle-row:first-of-type { border-top: 0; }

.privacy-toggle-label {
  font-size: var(--font-md);
  color: var(--ink);
}

.privacy-toggle-hint {
  margin-top: 2px;
  font-size: var(--font-xs);
  color: var(--ink-muted);
}

/* DS path: Surface/toggle/{accent,neutral}/{default,hovered,disabled}.
   Off → neutral surface, On → accent. `--surface-toggle-thumb` is the
   knob colour so it tracks the same light/dark flip as everything else. */
.privacy-switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-toggle-neutral-default);
  cursor: pointer;
  transition: background var(--transition);
}

.privacy-switch:hover { background: var(--surface-toggle-neutral-hovered); }
.privacy-switch.on { background: var(--surface-toggle-accent-default); }
.privacy-switch.on:hover { background: var(--surface-toggle-accent-hovered); }
.privacy-switch[aria-disabled="true"],
.privacy-switch.disabled {
  background: var(--surface-toggle-neutral-disabled);
  cursor: not-allowed;
}
.privacy-switch.on[aria-disabled="true"],
.privacy-switch.on.disabled {
  background: var(--surface-toggle-accent-disabled);
}

.privacy-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--surface-toggle-thumb);
  transition: left var(--transition);
}

.privacy-switch.on::after { left: 18px; }

.privacy-override-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.privacy-override-empty {
  padding: var(--space-sm);
  font-size: var(--font-xs);
  color: var(--ink-muted);
  text-align: center;
}

.privacy-override-row {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-m);
  background: var(--deep);
}

.privacy-override-avatar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: var(--radius-full);
  background: var(--surface) center/cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-2xs);
  font-weight: 600;
  color: #fff;
}

.privacy-override-name {
  flex: 1;
  font-size: var(--font-sm);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.privacy-override-remove {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

.privacy-override-remove:hover { color: var(--coral); background: var(--surface); }
