
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f5f5f5; color: #111; line-height: 1.5; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.container { max-width: 960px; margin: 0 auto; padding: 16px; }
.header { background: #1e293b; color: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.header h1 { font-size: 1.2rem; font-weight: 600; }
.header nav { display: flex; gap: 12px; flex-wrap: wrap; }
.header nav a { color: #e2e8f0; font-size: 0.9rem; }
.card { background: #fff; border-radius: 8px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; font-size: 0.9rem; cursor: pointer; border: none; font-weight: 500; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-gray { background: #e5e7eb; color: #374151; }
.btn:disabled { cursor: not-allowed; opacity: .55; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-connected { background: #16a34a; }
.status-syncing { background: #2563eb; }
.status-error { background: #dc2626; }
.status-paused { background: #9ca3af; }
input, textarea, select { width: 100%; padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.9rem; font-family: inherit; }
textarea { min-height: 120px; resize: vertical; }
label { display: block; margin-bottom: 4px; font-weight: 500; font-size: 0.85rem; color: #374151; }
.form-group { margin-bottom: 12px; }
.message-item { display: block; border-bottom: 1px solid #e5e7eb; padding: 12px 0; cursor: pointer; color: inherit; }
.message-item:hover { background: #f8fafc; text-decoration: none; }
.message-item-meta { display: flex; justify-content: space-between; align-items: baseline; }
.message-sender { font-weight: 600; }
.message-sender.unread { font-weight: 700; color: #111; }
.message-subject { color: #374151; }
.message-subject.unread { font-weight: 600; }
.message-date { color: #9ca3af; font-size: 0.8rem; }
.message-account { color: #6b7280; font-size: 0.75rem; background: #f3f4f6; border-radius: 4px; padding: 1px 6px; margin-left: 6px; }
.inbox-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.inbox-tab { font-size: 0.85rem; padding: 4px 10px; border: 1px solid #d1d5db; border-radius: 14px; color: #374151; text-decoration: none; }
.inbox-tab.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.inbox-tab:hover { text-decoration: none; border-color: #9ca3af; }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.5); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: #fff; border-radius: 8px; padding: 24px; max-width: 400px; width: 90%; }
.modal h2 { margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.end-button { cursor: default; }
.empty-state { text-align: center; padding: 48px 16px; color: #9ca3af; }
.error-banner { background: #fef2f2; color: #dc2626; padding: 8px 12px; border-radius: 6px; margin-bottom: 12px; font-size: 0.85rem; }
.page-title { margin-bottom: 12px; }
.login-card { max-width: 400px; margin: 40px auto; }
.login-title { margin-bottom: 16px; }
.full-width { width: 100%; }
.account-card { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.account-card-main { min-width: 0; }
.account-address { font-weight: 600; }
.account-state { font-size: 0.8rem; color: #6b7280; }
.account-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.account-action-form { display: inline; }
.account-hint { font-size: 0.85rem; color: #b45309; margin: 6px 0 0; }
.skip-link { position: absolute; left: -9999px; top: 0; background: #111827; color: #fff; padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
.accounts-form-card { margin-bottom: 16px; }
.accounts-fields { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.account-email-field { flex: 1; min-width: 200px; }
.account-provider-field { min-width: 120px; }
.message-content { white-space: pre-wrap; word-break: break-word; }
.message-title { margin-bottom: 8px; }
.message-header { font-size: 0.85rem; color: #6b7280; margin-bottom: 12px; }
.message-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.message-divider { border: 0; border-top: 1px solid #e5e7eb; margin-bottom: 12px; }
.attachment-title { margin-bottom: 8px; }
.attachment-row { padding: 4px 0; }
.attachment-meta { color: #9ca3af; font-size: 0.8rem; }
.compose-actions { display: flex; gap: 8px; }
.logout-card { text-align: center; padding: 48px; }
.logout-link { margin: 16px 0; }
.message-row { display: flex; align-items: center; gap: 8px; }
.message-row .message-item { flex: 1; min-width: 0; }
.message-row .btn { flex: 0 0 auto; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.audit-table th, .audit-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.audit-table th { font-weight: 600; color: #374151; }
.audit-outcome-success { color: #047857; }
.audit-outcome-failure { color: #b91c1c; }
.audit-details { color: #6b7280; word-break: break-word; }
.audit-scroll { overflow-x: auto; }
@media (max-width: 768px) { .container { padding: 8px; } .header { flex-direction: column; align-items: flex-start; } }
@media (max-width: 360px) { .btn { width: 100%; } .header nav { flex-direction: column; } }
@media (min-width: 1440px) { .container { max-width: 1200px; margin: 0 auto; } }
