:root {
  --bg-dark: #0b0f19;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #0284c7;
  --accent-blue-hover: #0369a1;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(2, 132, 199, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(139, 92, 246, 0.12) 0%, transparent 40%);
}

.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.hidden {
  display: none !important;
}

/* Scrollbar styling */
.scrollable::-webkit-scrollbar {
  width: 6px;
}
.scrollable::-webkit-scrollbar-track {
  background: transparent;
}
.scrollable::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
.scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Login Screen */
.login-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  background: rgba(11, 15, 25, 0.85);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  border-radius: var(--radius-lg);
}

.login-language { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.language-select {
  min-height: 34px;
  padding: 6px 30px 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.language-select:focus { outline: none; border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16); }
.header-language { max-width: 95px; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.brand-icon {
  width: 32px;
  height: 32px;
  color: var(--accent-blue);
}

.brand h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 28px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25);
}

.password-input-wrap { position: relative; }
.password-input-wrap input { padding-right: 48px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.password-toggle:hover { color: #bae6fd; background: rgba(56, 189, 248, 0.12); }
.password-toggle:focus-visible { outline: 2px solid #38bdf8; outline-offset: 1px; }
.password-toggle svg { width: 19px; height: 19px; }
.password-toggle-slash { opacity: 0; transition: opacity 0.15s ease; }
.password-toggle.is-visible .password-toggle-slash { opacity: 1; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-blue);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-blue-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-accent {
  background: var(--accent-purple);
  color: #fff;
}
.btn-accent:hover {
  background: #7c3aed;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid var(--accent-rose);
  color: var(--accent-rose);
}
.btn-outline-danger:hover {
  background: var(--accent-rose);
  color: #fff;
}

.icon {
  width: 16px;
  height: 16px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-top: 16px;
}
.alert-danger {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fecdd3;
}

/* App Console Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px;
  gap: 16px;
}

/* App Header */
/* Visual shell only. The layout itself lives in the consolidated header
   section at the end of this file, so there is a single source of truth. */
.app-header {
  /* The glass backdrop creates a stacking context. Keep its dropdowns above
     the workspace panes instead of letting them paint behind a later sibling. */
  position: relative;
  z-index: 9400;
  border-radius: var(--radius-lg);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-small {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
}

/* The logo doubles as the home link on both pages. */
.brand-home {
  color: inherit;
  text-decoration: none;
  padding: 6px 8px;
  margin: -6px -8px;
  border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
}

.brand-home:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #e0f2fe;
}

.brand-home:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}

.header-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.actions-bar {
  display: flex;
  gap: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Central in-panel notification centre. It deliberately uses page markup only
   so no browser/Chrome notification permission or system popup is involved. */
.notification-center { position: relative; z-index: 1; }

.notification-toggle {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.45);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}
.notification-toggle svg { width: 19px; height: 19px; }
.notification-toggle:hover,
.notification-toggle[aria-expanded="true"] {
  color: #e0f2fe;
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(2, 132, 199, 0.16);
}
.notification-toggle:focus-visible,
.notification-clear:focus-visible,
.notification-item-remove:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}
.notification-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 2px solid #182235;
  border-radius: 999px;
  background: var(--accent-rose);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.notification-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 1;
  width: min(390px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.98);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}
.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}
.notification-panel-header strong { display: block; font-size: 14px; }
.notification-summary { display: block; margin-top: 2px; color: var(--text-muted); font-size: 11px; }
.notification-clear {
  border: 0;
  background: transparent;
  color: #7dd3fc;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.notification-clear:hover:not(:disabled) { color: #e0f2fe; }
.notification-clear:disabled { opacity: 0.45; cursor: default; }
.notification-list { max-height: min(440px, calc(100vh - 150px)); overflow-y: auto; }
.notification-empty { padding: 28px 16px; color: var(--text-muted); font-size: 13px; text-align: center; }
.notification-item {
  position: relative;
  display: flex;
  gap: 10px;
  padding: 13px 38px 13px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  color: var(--text-secondary);
}
.notification-item:last-child { border-bottom: 0; }
.notification-item.unread { background: rgba(14, 165, 233, 0.08); color: #dbeafe; }
.notification-item-icon {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 700;
}
.notification-item-success .notification-item-icon { background: rgba(74, 222, 128, 0.18); color: #4ade80; }
.notification-item-warning .notification-item-icon { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.notification-item-error .notification-item-icon { background: rgba(248, 113, 113, 0.18); color: #f87171; }
.notification-item-content { min-width: 0; flex: 1; }
.notification-item-title,
.notification-item-message,
.notification-item-time { display: block; }
.notification-item-title { margin-bottom: 2px; color: var(--text-primary); font-size: 12px; }
.notification-item-message { overflow-wrap: anywhere; font-size: 12px; line-height: 1.45; }
.notification-item-time { margin-top: 4px; color: var(--text-muted); font-size: 10px; }
.notification-item-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 17px;
  cursor: pointer;
}
.notification-item-remove:hover { background: rgba(148, 163, 184, 0.18); color: #f8fafc; }

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Workspace Grid */
.workspace {
  display: grid;
  /* A little more room for the accounts column: an ordinary address now fits
     without truncation. The reader keeps whatever is left. */
  grid-template-columns: 288px minmax(340px, 400px) minmax(0, 1fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
}

/* Sidebar Accounts */
.sidebar {
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--bg-card-border);
}

.sidebar-header h2 {
  font-size: 15px;
  font-weight: 600;
}

.badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.accounts-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
}

.account-card {
  display: grid;
  gap: 7px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid transparent;
  cursor: pointer;
  /* Only the properties that actually change: `all` also transitioned the
     border colour of the active card, which made selection feel laggy. */
  transition: background 0.18s ease, border-color 0.18s ease;
}

.account-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.account-card.active {
  background: rgba(2, 132, 199, 0.15);
  border-color: var(--accent-blue);
}

/* The address owns a full row. Sharing one with the action buttons left it
   about 120px wide, which truncated even ordinary addresses to "ayjnwoz...". */
.account-email {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  /* Matches .icon-btn, so revealing the actions on hover cannot change the
     card's height and nudge the rest of the list. */
  min-height: 24px;
  font-size: 12px;
  color: var(--text-secondary);
}

.account-meta-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.account-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.account-status-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Shown only when there is something unread: a permanent "0 unread" was pure
   noise and it was what pushed the address out of the card. */
.account-unread {
  flex-shrink: 0;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.22);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #e0f2fe;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Resting cards stay clean; the controls arrive on hover, keyboard focus or
   selection. Touch devices get them permanently (see the coarse-pointer block). */
.account-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.account-card:hover .account-actions,
.account-card.active .account-actions,
.account-card:focus-within .account-actions {
  opacity: 1;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
}
.status-dot.needsreconnect { background: var(--accent-amber); }
.status-dot.error { background: var(--accent-rose); }
.status-dot.permissionrevoked { background: var(--accent-rose); }
.status-dot.disconnected,
.status-dot.disabled { background: var(--text-muted); }

/* Messages Pane */
.messages-pane {
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pane-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--bg-card-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Stacked rather than side by side. Competing for one row, a long status
   ("Senkronizasyon kuyruğa alındı") left the address ~120px and clipped it,
   and whether it fit changed with the status - so the header moved on its own.
   Two fixed rows read the same at every width and never shift. */
.pane-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

/* One line, ellipsised. Letting it wrap broke the address mid-word
   ("...hotm / ail.com") and left the status tag floating against two lines. */
.pane-title h2 {
  width: 100%;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-status-tag {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.search-box input {
  width: 100%;
  padding: 8px 14px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.messages-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.message-item {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: var(--transition);
}

.message-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.message-item.unread {
  border-left: 3px solid var(--accent-blue);
  background: rgba(2, 132, 199, 0.05);
}

.message-item.active {
  background: rgba(255, 255, 255, 0.08);
}

.msg-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.msg-sender {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.msg-time {
  font-size: 11px;
  color: var(--text-muted);
}

.msg-subject-text {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-preview {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Detail Pane */
.detail-pane {
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #ffffff;
  color: #1e293b;
}

.detail-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.detail-header {
  padding: 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.msg-subject {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 12px;
}

.msg-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sender-name {
  font-weight: 600;
  color: #1e293b;
}

.sender-email {
  color: #64748b;
  font-size: 13px;
}

.msg-date {
  font-size: 12px;
  color: #64748b;
}

.body-container {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.msg-iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* ==========================================================================
   Notifications and dialogs (replaces window.alert / confirm / prompt)
   ========================================================================== */

.ui-toasts {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* The container must not swallow clicks on the page behind it. */
  pointer-events: none;
  max-width: min(400px, calc(100vw - 48px));
}

.ui-toast {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border-radius: 11px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.97);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  color: var(--text-primary, #f8fafc);
  font-size: 13px;
  line-height: 1.45;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s ease;
}

.ui-toast.visible {
  transform: translateX(0);
  opacity: 1;
}

.ui-toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}

.ui-toast-body { flex: 1; min-width: 0; }
.ui-toast-title { display: block; margin-bottom: 2px; font-size: 13px; }
.ui-toast-message { display: block; word-wrap: break-word; }

.ui-toast-close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.ui-toast-close:hover { background: rgba(148, 163, 184, 0.2); color: #f8fafc; }

.ui-toast-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: left;
  animation: ui-toast-countdown linear forwards;
}

@keyframes ui-toast-countdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.ui-toast-success { border-color: rgba(74, 222, 128, 0.45); }
.ui-toast-success .ui-toast-icon { background: rgba(74, 222, 128, 0.2); color: #4ade80; }
.ui-toast-success .ui-toast-progress { background: var(--accent-green, #4ade80); }

.ui-toast-error { border-color: rgba(248, 113, 113, 0.5); }
.ui-toast-error .ui-toast-icon { background: rgba(248, 113, 113, 0.2); color: #f87171; }
.ui-toast-error .ui-toast-progress { background: var(--accent-rose, #f87171); }

.ui-toast-warning { border-color: rgba(251, 191, 36, 0.45); }
.ui-toast-warning .ui-toast-icon { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.ui-toast-warning .ui-toast-progress { background: var(--accent-amber, #fbbf24); }

.ui-toast-info { border-color: rgba(56, 189, 248, 0.45); }
.ui-toast-info .ui-toast-icon { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.ui-toast-info .ui-toast-progress { background: #38bdf8; }

/* ------------------------------------------------------------------ modal */

.ui-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.ui-modal-overlay.visible { opacity: 1; }

.ui-modal {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.ui-modal-overlay.visible .ui-modal { transform: translateY(0) scale(1); }

.ui-modal-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary, #f8fafc);
}

.ui-modal-message {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.ui-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.ui-copy-field {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.ui-copy-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(2, 6, 23, 0.6);
  color: var(--text-primary, #f8fafc);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.ui-copy-input:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
}

.ui-copy-action { flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
  .ui-toast,
  .ui-modal,
  .ui-modal-overlay { transition: none; }
  .ui-toast-progress { animation: none; }
}

@media (max-width: 640px) {
  .ui-toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; }
  .ui-copy-field { flex-direction: column; }
}

/* Folder filter above the message list */
.folder-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}

.folder-tab {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.folder-tab:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #e0f2fe;
}

.folder-tab.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.65);
  color: #e0f2fe;
  font-weight: 500;
}

.msg-subject-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.msg-subject-row .msg-subject-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Makes a message sitting outside the inbox impossible to overlook */
.folder-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.folder-badge.junkemail {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.folder-badge.sentitems {
  background: rgba(74, 222, 128, 0.15);
  border-color: rgba(74, 222, 128, 0.4);
  color: #bbf7d0;
}

/* Account filter - matters once the sidebar holds dozens of accounts */
.account-search {
  position: relative;
  padding: 0 20px 12px;
}

.account-search input {
  width: 100%;
  padding: 9px 30px 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color, rgba(148, 163, 184, 0.25));
  background: rgba(15, 23, 42, 0.55);
  color: var(--text-primary, #f8fafc);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.account-search input::placeholder {
  color: var(--text-muted);
}

.account-search input:focus {
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

/* The native search clear button is inconsistent across browsers. */
.account-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 28px;
  transform: translateY(-60%);
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.25);
  color: var(--text-primary, #f8fafc);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.search-clear:hover {
  background: rgba(248, 113, 113, 0.35);
}

/* Compact inline actions: copy address, remove message */
.icon-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.5);
  color: #e0f2fe;
}

.icon-btn.copied {
  background: rgba(74, 222, 128, 0.2);
  border-color: rgba(74, 222, 128, 0.6);
  color: #bbf7d0;
}

.icon-btn.copy-failed {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.6);
  color: #fecaca;
}

.icon-btn.delete-btn:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}

.icon-btn.share-btn.share-active {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(52, 211, 153, 0.72);
  color: #bbf7d0;
}
.icon-btn.share-btn.share-active:hover {
  background: rgba(16, 185, 129, 0.34);
  border-color: #6ee7b7;
  color: #ecfdf5;
}
.icon-btn.share-btn.share-inactive {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.58);
  color: #fecaca;
}
.icon-btn.share-btn.share-inactive:hover {
  background: rgba(248, 113, 113, 0.28);
  border-color: #fda4af;
  color: #fff1f2;
}

/* Standalone read-only share page */
.share-loading,
.share-invalid {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: var(--text-muted);
}

.invalid-card {
  padding: 40px;
  border-radius: 14px;
  text-align: center;
  max-width: 420px;
}

.invalid-icon {
  width: 48px;
  height: 48px;
  color: var(--accent-rose);
  margin-bottom: 14px;
}

.invalid-card h1 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text-primary, #f8fafc);
}

/* The share view has no sidebar, so the two panes split the width */
.share-workspace {
  grid-template-columns: minmax(320px, 420px) 1fr;
  grid-template-rows: minmax(0, 1fr);
}

/* Firefox is stricter about automatic minimum sizes in nested grid/flex
   layouts. These explicit constraints preserve independent, usable scrolling
   for both the message list and the mail body in every evergreen browser. */
.share-workspace,
.share-workspace .messages-pane,
.share-workspace .detail-pane,
.share-workspace .detail-content,
.share-workspace .body-container {
  min-height: 0;
}

.share-workspace .messages-list,
.share-workspace .body-container {
  flex: 1 1 auto;
}

@media (min-width: 761px) {
  /* Give both panes a definite height. Firefox otherwise derives the iframe
     height from its document and exposes two competing scrollbars. */
  .app-container { height: 100dvh; min-height: 0; }
  .share-workspace { height: 100%; overflow: hidden; }
  .share-workspace .messages-pane,
  .share-workspace .detail-pane,
  .share-workspace .detail-content { height: 100%; min-height: 0; }
  .share-workspace .body-container { flex: 1 1 0; height: 0; min-height: 0; }
  .share-workspace .msg-iframe { position: absolute; inset: 0; width: 100%; height: 100%; }

  /* The inbox, Spam and Sent views use the same detail viewer. Give that
     right-hand pane an explicit flex height too, not an intrinsic iframe size. */
  .workspace:not(.share-workspace) .detail-pane,
  .workspace:not(.share-workspace) .detail-content { min-height: 0; }
  .workspace:not(.share-workspace) .body-container { flex: 1 1 0; height: 0; min-height: 0; }
  .workspace:not(.share-workspace) .msg-iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
}

/* Row actions stay out of the way until the message is hovered or selected. */
.msg-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.message-item:hover .msg-actions,
.message-item.active .msg-actions,
.message-item:focus-within .msg-actions {
  opacity: 1;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.detail-actions .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Banner for accounts that need attention (NeedsReconnect, sync errors) */
.account-alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 24px 12px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
  font-size: 13px;
}

.account-alert .alert-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent-rose);
  margin-top: 1px;
}

/* ===========================================================================
   Responsive application shell
   The panel deliberately changes layout before content starts to collide: a
   three-pane desktop workspace, two-pane tablet workspace, and a vertical
   phone workspace. `min-width: 0` is critical for long e-mail addresses and
   translated button labels not to push panels outside the viewport.
   =========================================================================== */
.app-container,
.app-header,
.header-left,
.header-center,
.header-right,
.workspace,
.sidebar,
.messages-pane,
.detail-pane,
.pane-title,
.msg-meta,
.detail-actions {
  min-width: 0;
}

.app-container { min-height: 100dvh; }
.brand-small,
.header-badge,
.user-name { white-space: nowrap; }
/* A subject or sender may be a single unbroken string; the account address in
   the pane title is ellipsised instead, so it must not be listed here. */
.msg-subject,
.sender-info { min-width: 0; overflow-wrap: anywhere; }
.msg-date { flex-shrink: 0; }

@media (max-width: 1380px) {
  /* The admin console has three panes; the share page only has two. The
     share override below must stay a plain class so its specificity matches
     the narrower breakpoints further down - a :not() here would outrank them
     and force three columns onto tablets. */
  /* 260px is the width at which an ordinary address still fits the card in
     full; below that the column was collapsing to its minimum and clipping. */
  .workspace { grid-template-columns: minmax(260px, 0.75fr) minmax(300px, 1.05fr) minmax(360px, 1.35fr); }
  .share-workspace { grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 2.2fr); }
}

@media (max-width: 1120px) {
  body { overflow: auto; }
  .app-container { height: auto; min-height: 100dvh; }
  .workspace {
    grid-template-columns: minmax(230px, 0.8fr) minmax(300px, 1.2fr);
    grid-template-rows: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
  }
  .detail-pane { grid-column: 1 / -1; }
  .sidebar,
  .messages-pane,
  .detail-pane { min-height: 0; }
  .share-workspace { grid-template-columns: minmax(280px, 0.85fr) minmax(340px, 1.15fr); grid-template-rows: minmax(500px, 1fr); }
  .share-workspace .detail-pane { grid-column: auto; }
}

/* Back control for the phone master/detail flow; irrelevant on wider screens
   where both panes are visible at once. */
/* Reads as a navigation bar rather than a generic button: a chevron, what the
   action does, and the list it returns to - none of which the phone layout can
   show otherwise, because that list is off screen while reading. */
/* Mailbox being viewed on the share page. The header is a grid, so this claims
   a full row of its own rather than competing with the controls beside it.
   Hidden on wide screens, where the header already has room in the usual spot. */
.share-account-name {
  display: none;
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: #7dd3fc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The reading pane is white so mail renders on its intended background. This
   bar therefore carries its own opaque dark surface - a translucent tint would
   inherit that white and leave the label unreadable. */
.mobile-back {
  display: none;
  align-items: center;
  gap: 12px;
  width: 100%;
  /* Stays reachable no matter how far down a long e-mail the reader has gone. */
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 0 14px;
  padding: 11px 14px;
  border: 0;
  border-radius: 12px 12px 0 0;
  background: #131c31;
  box-shadow: 0 1px 0 rgba(56, 189, 248, 0.4), 0 6px 16px rgba(2, 6, 23, 0.35);
  color: #f8fafc;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mobile-back-icon {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 6px;
  border-radius: 50%;
  background: var(--accent-blue, #0284c7);
  color: #fff;
}

.mobile-back-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  line-height: 1.3;
}

.mobile-back-label {
  font-size: 14.5px;
  font-weight: 600;
  color: #f8fafc;
  letter-spacing: -0.1px;
}

/* The mailbox this returns to - the phone cannot show that list while reading. */
.mobile-back-target {
  font-size: 12px;
  color: #7dd3fc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-back-target:empty { display: none; }

.mobile-back:hover,
.mobile-back:active { background: #1b2742; }

.mobile-back:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: -2px;
}

@media (max-width: 760px) {
  .app-container { padding: 10px; gap: 10px; }
  .app-header { padding: 12px; border-radius: 12px; }
  .header-left { flex: 1 1 auto; gap: 10px; }
  .brand-small { font-size: 16px; }
  .header-badge { display: none; }
  .header-right { gap: 8px; }
  .user-name { display: none; }
  .header-language { max-width: 82px; }

  /* The share page header carries nothing else on a phone, and the mailbox
     being viewed is the one thing a reader actually needs to see there. */
  .share-page .app-header {
    height: auto;
    min-height: 0;
    /* Two columns: brand on the left, language on the right; the mailbox name
       spans row 2. The console's three-column track list would leave a gap. */
    grid-template-columns: auto auto;
    justify-content: space-between;
    gap: 4px 10px;
    padding: 10px 14px;
  }
  .share-page .app-header > .header-left { grid-column: 1; grid-row: 1; }
  .share-page .app-header > .header-right { grid-column: 2; grid-row: 1; }
  .share-page .brand-small { font-size: 15px; }
  .share-account-name { display: block; }
  .workspace,
  .share-workspace { display: flex; flex-direction: column; gap: 10px; }
  .sidebar { min-height: 250px; max-height: 42dvh; }
  .messages-pane { min-height: 360px; }
  .detail-pane { min-height: 540px; }

  /* ----------------------------------------------------------------------
     Master/detail on phones.

     Stacking the panes meant a long mailbox pushed the reader thousands of
     pixels down the page: tapping a message appeared to do nothing. The list
     and the reader now take turns owning the screen, with a back button to
     return. `.is-reading` is toggled by the page script.
     ---------------------------------------------------------------------- */
  .workspace:not(.is-reading) .detail-pane,
  .share-workspace:not(.is-reading) .detail-pane { display: none; }

  .workspace.is-reading .sidebar,
  .workspace.is-reading .messages-pane,
  .share-workspace.is-reading .messages-pane { display: none; }

  .workspace.is-reading .detail-pane,
  .share-workspace.is-reading .detail-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    /* Fill what is left below the header instead of collapsing to content. */
    height: calc(100dvh - 150px);
  }

  .workspace.is-reading .detail-content,
  .share-workspace.is-reading .detail-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .workspace.is-reading .body-container,
  .share-workspace.is-reading .body-container {
    flex: 1 1 auto;
    min-height: 260px;
    position: relative;
  }

  .workspace.is-reading .msg-iframe,
  .share-workspace.is-reading .msg-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  /* Bounded lists so the page itself never becomes thousands of pixels tall. */
  .messages-list { max-height: 65dvh; overflow-y: auto; }
  .accounts-list { max-height: 34dvh; overflow-y: auto; }

  .mobile-back { display: inline-flex; }

  /* While reading, the console's action bar would eat close to 40% of a phone
     screen. Collapse it; the list view brings it straight back. */
  body.is-reading .actions-bar,
  body.is-reading .account-alert { display: none; }
  .sidebar-header { padding: 14px 16px; }
  .account-search { padding: 0 16px 10px; }
  .search-clear { right: 24px; }
  .pane-header { padding: 14px 16px; }
  .message-item { padding: 13px 16px; }
  .detail-header { padding: 18px 16px; }
  .msg-subject { font-size: 18px; }
  .msg-meta { align-items: flex-start; flex-direction: column; gap: 5px; }
  .detail-actions .btn { flex: 1 1 180px; }
  .account-alert { margin: 0 2px; padding: 10px 12px; }
  .notification-panel { position: fixed; top: 68px; right: 10px; width: min(390px, calc(100vw - 20px)); }
}

@media (max-width: 430px) {
  .login-card { padding: 28px 22px; margin: 12px; }
  .header-left { flex-basis: auto; }
  .brand-small span { display: none; }
  .header-right .btn-outline-danger { padding: 7px 9px; font-size: 0; }
  .header-right .btn-outline-danger::after { content: '↪'; font-size: 16px; }
  .sidebar { max-height: none; }
  .messages-pane { min-height: 330px; }
  .detail-pane { min-height: 460px; }
  .detail-actions { flex-direction: column; }
  .detail-actions .btn { width: 100%; }
  .attachments-bar { align-items: flex-start; flex-direction: column; }
  .ui-modal-overlay { padding: 10px; }
  .ui-modal { padding: 20px 16px; }
}


/* ==========================================================================
   Touch devices
   A finger is far less precise than a cursor, and there is no hover state to
   reveal anything with, so controls that the desktop layout hides or shrinks
   have to be permanently visible and comfortably large here.
   ========================================================================== */
@media (pointer: coarse), (max-width: 820px) {
  /* Row actions are hover-revealed on desktop; on touch that means invisible. */
  .msg-actions,
  .account-actions { opacity: 1; }

  .icon-btn {
    width: 36px;
    height: 36px;
    font-size: 15px;
  }

  .btn-sm {
    padding: 9px 14px;
    font-size: 13px;
    min-height: 36px;
  }

  .btn {
    min-height: 40px;
  }

  .search-clear {
    width: 28px;
    height: 28px;
    right: 26px;
    font-size: 18px;
  }

  .folder-tab {
    padding: 8px 14px;
    font-size: 13px;
    min-height: 36px;
  }

  .language-select {
    min-height: 38px;
  }

  .notification-toggle {
    width: 42px;
    height: 42px;
  }

  .ui-toast-close {
    width: 30px;
    height: 30px;
    font-size: 20px;
  }

  /* Comfortable rows, and enough space for the always-visible actions. */
  .message-item { padding-top: 12px; padding-bottom: 12px; }
  .account-card { padding-top: 12px; padding-bottom: 12px; }

  /* iOS zooms the page in when a focused field is under 16px. */
  input,
  select,
  textarea { font-size: 16px; }
}

/* At medium desktop widths the detail reader needs priority. Keeping the
   original fixed-ish account and message columns left too little room for an
   actual mail body as the browser window was narrowed.

   The accounts column still may not drop below 264px: that is what an ordinary
   address needs inside a card, and the old 230px cap was what truncated it. */
@media (min-width: 1121px) and (max-width: 1500px) {
  .workspace:not(.share-workspace) {
    grid-template-columns: minmax(264px, 288px) minmax(280px, 340px) minmax(0, 1fr);
  }
}

.account-alert .alert-body strong {
  display: block;
  margin-bottom: 3px;
  color: #fca5a5;
}

.account-alert .alert-detail {
  opacity: 0.9;
  line-height: 1.5;
}

/* Attachment metadata rendered under the message header */
.attachments-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 12px;
  color: var(--text-muted);
}

.attachments-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  max-width: 260px;
}

.attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.attachment-size {
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Console header - single source of truth for the layout.

   Named grid areas rather than per-child row/column numbers, so a breakpoint
   is one declaration instead of four that have to agree with each other. Three
   arrangements, picked by how much room the toolbar genuinely needs:

     >= 1541px    brand | sync actions | session controls   - one row
     861-1540px   brand + session controls, actions on row 2
     <= 860px     brand, session controls, actions - a row each

   The header height is never fixed: a wrapped row must grow the bar rather
   than spill out of it.
   ========================================================================== */
.app-header {
  min-height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "left center right";
  align-items: center;
  gap: 10px 20px;
  padding: 12px 18px;
}

.app-header > .header-left { grid-area: left; }
.app-header > .header-center { grid-area: center; width: 100%; min-width: 0; }
.app-header > .header-right { grid-area: right; min-width: 0; justify-content: flex-end; }

.actions-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}
.actions-bar .btn { white-space: nowrap; min-width: 0; }

@media (max-width: 1540px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "left   right"
      "center center";
  }
  /* Once the toolbar owns a full row, sharing a left edge with the logo reads
     as deliberate; centred it looked like it had fallen out of the bar. */
  .actions-bar { justify-content: flex-start; }
}

/* Two rows all the way down to 320px: measured, the brand (an icon alone below
   430px) and the session controls need ~254px together, so giving them a row
   each only made the header taller for no gain. */
@media (max-width: 860px) {
  .app-header {
    gap: 10px;
    padding: 12px;
  }
  /* auto-fit keeps the buttons on as few rows as the width allows, without a
     hard-coded column count per breakpoint. */
  .actions-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: 8px;
  }
  .actions-bar .btn {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    white-space: normal;
    text-align: center;
  }
  /* The panel is anchored to its bell, even when the header becomes taller. */
  .notification-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
  }
}

/* Native selects reserve space for their arrow. The previous 82px cap left
   only ~42px for the label, clipping "English" on compact screens. */
.header-language {
  width: 112px;
  min-width: 112px;
  max-width: none;
}

@media (max-width: 360px) {
  .app-container { padding: 8px; }
  .app-header { padding: 10px; }
  .notification-panel { width: calc(100vw - 16px); }
}

