/* OpenPGP: compose switches, reader badges, Settings > Security keys. */

:root {
  --pgp-good: #137333;
  --pgp-good-bg: #E6F4EA;
  --pgp-warn: #8A5300;
  --pgp-warn-bg: #FEF3D6;
  --pgp-bad-bg: #FCE8E6;
}
:root[data-scheme="dark"] {
  --pgp-good: #81C995;
  --pgp-good-bg: #173A27;
  --pgp-warn: #F6C76B;
  --pgp-warn-bg: #3D3017;
  --pgp-bad-bg: #4A1E1C;
}

.pgp-glyph { display: inline-flex; }
.pgp-glyph svg { width: 16px; height: 16px; fill: currentColor; }

/* Compose */
.compose-win .pgp-line { gap: 6px; min-height: 36px; flex-wrap: wrap; }
.pgp-toggle {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 14px;
  border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: 13px; cursor: pointer;
}
.pgp-toggle:hover { background: var(--hover); }
.pgp-toggle.on { background: var(--selected); border-color: transparent; color: var(--accent-ink); font-weight: 500; }
.pgp-note { font-size: 12px; flex: 1; min-width: 0; }
.pgp-note.warn { color: var(--pgp-warn); }
.pgp-note .link { color: var(--accent-ink) !important; text-decoration: underline; padding: 0; font-size: 12px; }

/* Reader */
.reader .pgp-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.reader .pgp-badges:empty { display: none; }
.pgp-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 12px;
  font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--text-2);
}
.pgp-badge.good { background: var(--pgp-good-bg); color: var(--pgp-good); }
.pgp-badge.warn { background: var(--pgp-warn-bg); color: var(--pgp-warn); }
.pgp-badge.bad { background: var(--pgp-bad-bg); color: var(--danger); }
.pgp-badges .link { border: 0; background: none; color: var(--accent-ink); cursor: pointer; font-size: 12px; text-decoration: underline; }
.pgp-panel {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); max-width: 560px; margin: 8px 0;
}
.pgp-panel > .pgp-glyph svg { width: 28px; height: 28px; fill: var(--accent-ink); }
.pgp-panel p { margin: 4px 0 10px; }
.pgp-panel input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: inherit; min-width: 220px; }

/* Settings > Security */
.pgp-sec table { width: 100%; }
.pgp-sec td { vertical-align: top; }
.pgp-fp { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; letter-spacing: .02em; margin: 2px 0; overflow-wrap: anywhere; }
.pgp-actions { text-align: right; }
.pgp-actions .row-btns { justify-content: flex-end; }
.pgp-check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; cursor: pointer; }
.pgp-check input { margin-top: 3px; }
.pgp-check .muted { font-size: 13px; }
.pgp-hint { font-size: 12px; }
.pgp-paste { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
@media (max-width: 720px) {
  .pgp-accounts tr { display: flex; flex-direction: column; gap: 6px; }
  .pgp-actions, .pgp-actions .row-btns { text-align: left; justify-content: flex-start; }
}
