/* CrossMail — plain CSS, no framework. Light/dark via prefers-color-scheme. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #dfe3e8;
  --text: #1f2328;
  --muted: #5d6671;
  --primary: #2f6feb;
  --primary-hover: #2459c7;
  --primary-soft: #e8f0fe;
  --danger: #cf222e;
  --danger-soft: #ffebe9;
  --success: #1a7f37;
  --success-soft: #dafbe1;
  --warning-soft: #fff8c5;
  --warning-border: #d4a72c;
  --unread: #1f2328;
  --focus: 0 0 0 3px rgba(47, 111, 235, 0.35);
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(31, 35, 40, 0.06), 0 8px 24px rgba(31, 35, 40, 0.08);
  --account-color: var(--primary);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #161b22;
    --surface-2: #1d232c;
    --border: #2d333b;
    --text: #e6edf3;
    --muted: #8d96a0;
    --primary: #4c8dff;
    --primary-hover: #6aa1ff;
    --primary-soft: #1c2a44;
    --danger: #ff6b6b;
    --danger-soft: #3a1d1f;
    --success: #3fb950;
    --success-soft: #16301f;
    --warning-soft: #3a3015;
    --unread: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: none; box-shadow: var(--focus); }

[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { display: flex; justify-content: center; padding: 24px; }
.spacer { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.narrow { max-width: 420px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.flag-on, .flag-on .icon { stroke: #d4a72c; fill: #d4a72c; }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.small { padding: 5px 10px; font-size: 0.85rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-block { width: 100%; padding: 10px 14px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.icon-btn.small { width: 28px; height: 28px; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }

.link-btn { border: 0; background: none; color: var(--primary); cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.stack > .link-btn { align-self: flex-start; }

.spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.7s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.boot { display: grid; place-items: center; height: 100vh; }
.boot-spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--primary); border-right-color: transparent; animation: spin 0.7s linear infinite; }

/* ------------------------------------------------------------------ forms */

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 0.85rem; font-weight: 600; }
.field input, .field select, .field textarea, .account-edit input {
  width: 100%; padding: 9px 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
}
.field textarea { resize: vertical; min-height: 200px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: var(--focus); outline: none; }
.field input[aria-invalid] { border-color: var(--danger); }
.field-hint { font-size: 0.8rem; color: var(--muted); }
.field-error, .form-error { color: var(--danger); font-size: 0.85rem; }
.form-error:not(:empty) { background: var(--danger-soft); padding: 8px 12px; border-radius: var(--radius-sm); }
.checkbox { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 0.9rem; }
.note { font-size: 0.82rem; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; margin: 0; }
.warning-box { background: var(--warning-soft); border-left: 3px solid var(--warning-border); padding: 10px 12px; border-radius: var(--radius-sm); margin: 0; font-size: 0.88rem; }
.success-box { background: var(--success-soft); color: var(--success); padding: 10px 12px; border-radius: var(--radius-sm); margin: 0; }
fieldset.server-settings { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 12px; margin: 0; }
fieldset.server-settings legend { padding: 0 6px; font-weight: 600; font-size: 0.9rem; }

/* ------------------------------------------------------------------ auth pages */

.auth-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; gap: 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { margin-top: 4px; }
.auth-card > p { margin: 0; }
.auth-alt { text-align: center; font-size: 0.9rem; color: var(--muted); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; }
.brand.small { font-size: 1rem; gap: 8px; }
a.brand { color: var(--text); text-decoration: none; align-self: flex-start; }
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.lang-switch button { border: 0; background: transparent; padding: 4px 12px; cursor: pointer; font-size: 0.8rem; color: var(--muted); }
.lang-switch button.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ------------------------------------------------------------------ mail shell */

.mail-shell { display: flex; flex-direction: column; height: 100vh; }

.topbar {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: inset 0 3px 0 var(--account-color);
}
.search-wrap { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 999px; padding: 0 14px; color: var(--muted); }
.search { flex: 1; border: 0; background: transparent; padding: 8px 0; outline: none; }
.search-wrap:focus-within { box-shadow: var(--focus); }
.user-menu { display: flex; gap: 2px; margin-left: auto; }
.mobile-only { display: none; }

/* account switcher */
.switcher { position: relative; }
.switcher-btn {
  display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: 320px;
  padding: 6px 10px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; text-align: left;
}
.switcher-btn:hover { background: var(--surface-2); }
.switcher-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.switcher-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-email { font-size: 0.78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--border); }
.badge { background: var(--primary); color: #fff; border-radius: 999px; font-size: 0.72rem; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center; }
.switcher-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; width: 340px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column;
}
.switcher-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.switcher-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; text-align: left; width: 100%;
}
.switcher-item:hover, .switcher-item:focus-visible { background: var(--surface-2); }
.switcher-item[aria-checked="true"] { background: var(--primary-soft); }
.switcher-item.action { color: var(--muted); }
kbd { font: 0.7rem var(--font); color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }

/* three panes */
.mail-body { flex: 1; display: grid; grid-template-columns: 230px minmax(300px, 400px) 1fr; min-height: 0; }

.folders { border-right: 1px solid var(--border); overflow-y: auto; padding: 10px 8px; background: var(--surface); }
.folders ul { list-style: none; margin: 0; padding: 0; }
.folders-header { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 6px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.folder {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 10px 7px calc(10px + var(--depth, 0) * 14px);
  border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer; text-align: left; color: var(--text);
}
.folder:hover { background: var(--surface-2); }
.folder.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.folder:disabled { opacity: 0.5; cursor: default; }
.folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { font-size: 0.78rem; font-weight: 700; color: var(--primary); }

/* folder actions: "+" in the header, "⋯" on each row (hover / keyboard focus; always visible on touch) */
.folders-tools { display: flex; gap: 2px; }
.folder-row { position: relative; display: flex; align-items: center; }
.folder-row .folder { flex: 1; min-width: 0; }
.folder-more { position: absolute; right: 4px; opacity: 0; background: var(--surface-2); }
.folder-row:hover .folder-more, .folder-row:focus-within .folder-more, .folder-more[aria-expanded="true"] { opacity: 1; }
.folder-row:hover .count, .folder-row:focus-within .count, .folder-row.menu-open .count { visibility: hidden; }
.icon-dots { stroke-width: 3.4; }
@media (hover: none) {
  .folder-more { position: static; opacity: 1; background: transparent; }
  .folder-row .count { visibility: visible !important; }
}

.popup-menu {
  position: fixed; z-index: 50; min-width: 210px; max-width: 280px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column;
}
.popup-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: var(--surface-2); }
.menu-item:disabled { opacity: 0.45; cursor: default; }
.menu-item.danger { color: var(--danger); }
.menu-note { font-size: 0.78rem; color: var(--muted); padding: 2px 10px 6px; }

.message-list { border-right: 1px solid var(--border); overflow-y: auto; background: var(--surface); }
.list-header { position: sticky; top: 0; z-index: 1; background: var(--surface); display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.items { list-style: none; margin: 0; padding: 0; }
.message-item {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  padding: 10px 16px; border: 0; border-bottom: 1px solid var(--border);
  background: transparent; cursor: pointer; text-align: left; border-left: 3px solid transparent;
}
.message-item:hover { background: var(--surface-2); }
.message-item.selected { background: var(--primary-soft); border-left-color: var(--account-color); }
.message-item.unread .item-from, .message-item.unread .item-subject { font-weight: 700; color: var(--unread); }
.message-item.unread { border-left-color: var(--primary); }
.item-top { display: flex; justify-content: space-between; gap: 10px; }
.item-from { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-date { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.item-subject { display: flex; align-items: center; gap: 5px; font-size: 0.92rem; overflow: hidden; white-space: nowrap; }
.item-subject span { overflow: hidden; text-overflow: ellipsis; }
.item-subject .icon { width: 14px; height: 14px; color: var(--muted); }
.item-preview { font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.load-more { margin: 14px auto; display: flex; }

/* bulk selection */
.list-header { align-items: center; justify-content: flex-start; min-height: 54px; }
.list-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex: 1; min-width: 0; }
.list-title h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.select-all, .item-check { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--primary); cursor: pointer; }
.select-all:disabled, .item-check:disabled { cursor: default; }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
.bulk-count { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.bulk-actions { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.bulk-actions .move-select { max-width: 150px; }
.spinner.small { width: 14px; height: 14px; border-width: 2px; }
.select-banner { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 10px; padding: 8px 16px; font-size: 0.85rem; background: var(--primary-soft); border-bottom: 1px solid var(--border); text-align: center; }
.message-row { display: flex; align-items: center; gap: 0; border-bottom: 1px solid var(--border); border-left: 3px solid transparent; padding-left: 13px; }
.message-row:hover { background: var(--surface-2); }
.message-row.unread { border-left-color: var(--primary); }
.message-row.checked { background: var(--primary-soft); }
.message-row.selected { background: var(--primary-soft); border-left-color: var(--account-color); }
.message-row .message-item { flex: 1; min-width: 0; border: 0; padding-left: 12px; }
.message-row .message-item:hover, .message-row .message-item.selected { background: transparent; }
.empty, .welcome, .pane-error, .reader-empty { padding: 40px 24px; text-align: center; color: var(--muted); }
.welcome { color: var(--text); display: flex; flex-direction: column; gap: 12px; align-items: center; max-width: 360px; margin: 40px auto; }
.pane-error { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.pane-loading { display: flex; justify-content: center; padding: 32px; color: var(--muted); }
.reader-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 8px; }
.reader-empty .icon { width: 48px; height: 48px; stroke-width: 1.2; opacity: 0.5; }

.reader { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.reader-actions { display: flex; align-items: center; gap: 2px; padding: 8px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.move-select { padding: 6px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); max-width: 170px; }
.reader-header { padding: 16px 20px 10px; display: flex; flex-direction: column; gap: 8px; }
.reader-subject { font-size: 1.25rem; }
.reader-meta { font-size: 0.88rem; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.info-banner { display: flex; align-items: center; gap: 10px; margin: 0 20px 10px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 0.85rem; flex-wrap: wrap; }
.message-frame { flex: 1; width: 100%; border: 0; border-top: 1px solid var(--border); background: #fff; min-height: 300px; }

.attachment-list { list-style: none; margin: 0; padding: 0 20px 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.compose .attachment-list { padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.82rem; background: var(--surface-2); color: var(--text); max-width: 100%; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.chip:hover { border-color: var(--primary); text-decoration: none; }

/* ------------------------------------------------------------------ modal */

.modal {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
  padding: 0; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.modal[open] { display: flex; flex-direction: column; }
.modal-wide { width: min(760px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(15, 18, 22, 0.45); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 18px; overflow-y: auto; flex: 1; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border); }

.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 12px; }
.provider-card {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; text-align: left;
}
.provider-card:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); }
.provider-card:disabled { opacity: 0.55; cursor: not-allowed; }
.provider-name { font-weight: 600; }
.provider-meta { font-size: 0.8rem; color: var(--muted); }
.provider-selected { display: flex; align-items: center; gap: 10px; }

/* ------------------------------------------------------------------ settings */

.settings-page { max-width: 920px; margin: 0 auto; padding: 24px 16px 60px; display: flex; flex-direction: column; gap: 18px; }
.settings-header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.settings-header h1 { flex: 1; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.account-list, .session-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.account-row { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.account-row:last-child, .session-row:last-child { border-bottom: 0; }
.account-info { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.account-edit { grid-column: 2; display: grid; grid-template-columns: 1fr 1fr 44px auto; gap: 8px; align-items: center; }
.account-edit input[type="color"] { padding: 2px; height: 38px; }
.account-actions { grid-column: 2; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.session-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tag { margin-left: 8px; font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-weight: 600; }

/* ------------------------------------------------------------------ toasts */

.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 40px)); }
.toast { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-size: 0.9rem; animation: toast-in 0.2s ease-out; transition: opacity 0.25s, transform 0.25s; }
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast.leaving { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1100px) {
  .mail-body { grid-template-columns: 200px minmax(260px, 340px) 1fr; }
  .switcher-btn { min-width: 0; }
}

@media (max-width: 860px) {
  .mobile-only { display: inline-flex; }
  .brand.small, .compose-btn span { display: none; }
  .move-select { max-width: 120px; }
  .topbar { flex-wrap: wrap; gap: 8px; }
  .search-wrap { order: 10; flex-basis: 100%; max-width: none; }
  .switcher { flex: 1; min-width: 0; }
  .switcher-btn { width: 100%; max-width: none; }
  .switcher-menu { width: min(340px, calc(100vw - 28px)); }

  .mail-body { grid-template-columns: 1fr; }
  .mail-body > * { display: none; border-right: 0; }
  .mail-shell[data-pane="folders"] .folders,
  .mail-shell[data-pane="list"] .message-list,
  .mail-shell[data-pane="reader"] .reader { display: flex; flex-direction: column; }
  .mail-shell[data-pane="folders"] .folders { display: block; }
  .mail-shell[data-pane="list"] .message-list { display: block; }

  .grid-2, .grid-3, .account-edit { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ OAuth quick connect */

.oauth-section { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.oauth-section h3 { font-size: 1rem; }
.oauth-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
/* Before going public, replace these neutral buttons with the official sign-in button assets
   published by Google and Microsoft (their branding guidelines require it). */
.oauth-btn { justify-content: flex-start; gap: 12px; padding: 11px 16px; font-weight: 600; }
.oauth-mark {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 0.8rem; font-weight: 700;
}
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.82rem; margin-top: 10px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.note.inline { display: block; }

/* ------------------------------------------------------------------ legal */

.legal-links { display: flex; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.legal-page { max-width: 820px; margin: 0 auto; padding: 24px 16px 64px; }
.legal-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.legal-header .brand { color: var(--text); text-decoration: none; }
.legal-nav { font-size: 0.9rem; color: var(--muted); }
.legal-page article { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; }
.legal-page h1 { margin-bottom: 4px; }
.legal-page h2 { margin: 24px 0 8px; font-size: 1.05rem; }
.legal-page p, .legal-page li { line-height: 1.6; }
.legal-page hr { border: 0; margin: 28px 0; }

/* Shown next to the message count while a list restored from the browser cache is being refreshed. */
.list-title .spinner.refreshing { margin-right: 6px; opacity: 0.6; }
