:root {
  --bg: #0a0a0a;
  --surface: #111;
  --border: rgba(255,255,255,0.08);
  --text: #f0f0f0;
  --text-muted: #888;
  --accent: #34d399;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, sans-serif;
  padding: 32px;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

h1 { font-size: 1.1rem; font-weight: 700; }

.header-actions {
  display: flex;
  gap: 8px;
}

.logout {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  margin: 0;
}

.auth-card .cancel {
  background: none;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 8px;
}

.auth-card .success {
  color: var(--accent);
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.auth-card {
  max-width: 340px;
  margin: 15vh auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
}

.auth-card h1 { margin-bottom: 12px; }
.auth-card .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.auth-card input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 10px;
  font-family: inherit;
}

.auth-card button {
  width: 100%;
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.auth-card .error {
  color: #f87171;
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.email-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  overflow: hidden;
}

.email-card-header {
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}

.email-row.open .email-card-header {
  border-bottom: 1px solid var(--border);
}

.email-meta {
  display: flex;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.subject { font-weight: 600; }

.body-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.email-row.open .body-wrap {
  max-height: 6000px;
}

.body-inner { padding: 14px 16px; }

.body-frame {
  width: 100%;
  height: 60px;
  border: none;
  border-radius: 8px;
  display: block;
  background: #111;
}

.body-frame.flagged-hidden { display: none; }

.body-actions { margin-bottom: 10px; }

.load-images-btn, .show-anyway-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
}

.verdict-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(248,113,113,0.1);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.78rem;
  color: #f87171;
  margin-bottom: 10px;
}

.verdict-banner .show-anyway-btn { color: #f87171; border-color: rgba(248,113,113,0.25); flex-shrink: 0; }

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  color: var(--text);
  text-decoration: none;
}

.att-size { color: var(--text-muted); }

.empty { color: var(--text-muted); font-size: 0.85rem; padding: 14px 16px; }

.email-row.search-hidden { display: none; }

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
}

.search-bar input, .search-input-wrap input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 36px 9px 12px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  width: 100%;
}

#search-dropdown-arrow {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  width: 28px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.search-dropdown-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 20;
  max-height: 220px;
  overflow-y: auto;
}

.search-dropdown-item {
  padding: 9px 12px;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
}

.search-dropdown-item:hover { background: var(--bg); }

.search-dropdown-empty {
  padding: 9px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-bar button {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

#search-btn { background: var(--accent); color: #0a0a0a; border: none; font-weight: 700; }

.addresses-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.addresses-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.addresses-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.address-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  color: var(--text);
}

.remove-address-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
}

#add-address-form {
  display: flex;
  gap: 8px;
}

#add-address-form input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
}

#add-address-form button {
  background: var(--accent);
  color: #0a0a0a;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
