:root {
  --bg: #1b1e24;
  --panel: #252930;
  --fg: #e6e8eb;
  --muted: #9aa3ad;
  --accent: #6bc1a8;
  --accent-dim: #3d8f7a;
  --danger: #f07178;
  --border: #343b47;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  font-size: 15px;
}

a { color: var(--accent); }

.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.8rem;
}

.topbar .brand { font-weight: 700; color: var(--accent); margin-right: auto; }

.topbar nav a { margin-right: 1rem; text-decoration: none; }
.topbar nav a:hover { text-decoration: underline; }

.wrap { max-width: 780px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

h1 { font-size: 1.35rem; margin: 0 0 0.5rem; font-weight: 600; }

.sub { color: var(--muted); margin-bottom: 1.25rem; font-size: 0.9rem; }

label { display: block; color: var(--muted); margin: 1rem 0 0.35rem; font-size: 0.8rem; }

input[type="text"], input[type="password"] {
  width: 100%;
  background: #12151a;
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.7rem;
  border-radius: 4px;
  font: inherit;
}

textarea {
  width: 100%;
  display: block;
  background: #12151a;
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.7rem;
  border-radius: 4px;
  font: inherit;
  min-height: 4.5rem;
  resize: none;
  overflow: hidden;
  field-sizing: content;
}

button, .btn {
  background: var(--accent-dim);
  color: #0e1114;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 4px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.75rem;
}

button:hover { background: var(--accent); }

button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent-dim); }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
}

.pubkey {
  word-break: break-all;
  font-size: 0.78rem;
  color: #c5cdd5;
}

.notice {
  border-left: 3px solid var(--accent);
  padding: 0.65rem 0.9rem;
  background: #1e2623;
  margin: 1rem 0;
  font-size: 0.85rem;
}

.warn {
  border-left: 3px solid var(--danger);
  background: #2a1f21;
  padding: 0.65rem 0.9rem;
  margin: 1rem 0;
  font-size: 0.85rem;
}

.hidden { display: none !important; }

.panel,
.wrap {
  overflow: visible;
}

#decrypted {
  white-space: pre-wrap;
  min-height: 4rem;
}

.footer-links { margin-top: 2rem; font-size: 0.8rem; color: var(--muted); }
.footer-links a { margin-right: 1rem; }

.pgp-toggle { color: #6d7378; text-decoration: underline; cursor: pointer; font-style: italic; }
.pgp-block { display: none; white-space: pre-wrap; font-size: 0.72rem; margin-top: 0.5rem; }

/* Humble footer ads — silent slideshow, not fixed (does not cover content) */
.ad-footer {
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
  background: #14171c;
}

.ad-footer[hidden] { display: none; }

.ad-footer-bar {
  max-width: 780px;
  margin: 0 auto;
  padding: 0.45rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
}

.ad-label {
  flex-shrink: 0;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5c656e;
}

.ad-slideshow {
  flex: 1;
  position: relative;
  min-height: 1.75rem;
  overflow: hidden;
}

.ad-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.ad-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.ad-slide a,
.ad-slide > div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.78rem;
}

.ad-slide a:hover { color: var(--fg); }

.ad-slide img {
  max-height: 1.5rem;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
}

.ad-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}