@view-transition { navigation: auto; }

:root {
  --accent: #5aa9ff;
  --accent-2: #7fd1ff;
  --accent-3: #3c6fff;
  --radius: 20px;
  --font-sans: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --sidebar-width: 340px;
  --sidebar-collapsed-width: -10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  background: radial-gradient(circle at top, rgba(90, 169, 255, 0.12), transparent 45%),
    linear-gradient(140deg, #f2f6fb 0%, #e8eef7 45%, #f8fafc 100%);
  color: #0f172a;
  --bg: #eef3f8;
  --glass: rgba(0, 0, 0, 0.05);
  --glass-2: rgba(255, 255, 255, 0.8);
  --border: rgba(255, 255, 255, 0.4);
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --muted: #5b6b7b;
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  overflow-y: hidden;
}
body.dark-mode {
  background: radial-gradient(circle at top, rgba(90, 169, 255, 0.15), transparent 50%),
    linear-gradient(140deg, #0b1119 0%, #0f172a 45%, #0c1320 100%);
  color: #f1f5f9;
  --bg: #0b1119;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-2: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --text: #f1f5f9;
  --muted: #a4b0c1;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="2" stitchTiles="stitch"/></filter><rect width="120" height="120" filter="url(%23n)" opacity="0.4"/></svg>');
  mix-blend-mode: soft-light;
  z-index: 1;
}

#bgStars {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.8;
  pointer-events: none;
}

@supports not ((-webkit-backdrop-filter: blur(12px)) or (backdrop-filter: blur(12px))) {
  body {
    --glass: rgba(255, 255, 255, 0.85);
    --glass-2: rgba(255, 255, 255, 0.95);
  }
  body.dark-mode {
    --glass: rgba(20, 24, 33, 0.9);
    --glass-2: rgba(20, 24, 33, 0.96);
  }
}

.app-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 16px 0;
}

.sidebar {
  position: fixed;
  left: 16px;
  top: 16px;
  bottom: 16px;
  width: var(--sidebar-width);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  overflow-y: auto;
  z-index: 60;
  transform: translateX(calc(-100% + var(--sidebar-collapsed-width)));
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  animation: sidebarFade 0.35s ease both;
  pointer-events: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar::after {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  right: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(90, 169, 255, 0.6), rgba(90, 169, 255, 0.12));
  opacity: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 60px;
  min-height: 52px;
  transition: opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(90, 169, 255, 0.35);
}

.brand-title { font-weight: 600; font-size: 16px; color: var(--text); font-family: var(--font-display); letter-spacing: -0.01em; }
.brand-subtitle { font-size: 12px; color: var(--muted); }

.sidebar-content { display: flex; flex-direction: column; gap: 20px; flex: 1; transition: opacity 0.2s ease; opacity: 0; pointer-events: none; }

.sidebar-footer { margin-top: auto; transition: opacity 0.2s ease; opacity: 0; pointer-events: none; }
.logout-btn { width: 100%; justify-content: center; }

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 24, 0.22);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 55;
}

.sidebar-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.floating-app-icon {
  position: fixed;
  top: 16px;
  left: 16px;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--glass-2);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: var(--shadow);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  cursor: pointer;
}
.floating-app-icon .material-icons { font-size: 24px; color: var(--accent-3); }
.floating-app-icon:hover { box-shadow: 0 16px 32px rgba(90, 169, 255, 0.25); }

.sidebar-handle {
  position: fixed;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--glass-2);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 75;
  cursor: pointer;
}
.sidebar-handle .material-icons { font-size: 20px; }
.sidebar-handle:hover { box-shadow: 0 12px 26px rgba(90, 169, 255, 0.2); }

.sidebar.is-open {
  transform: translateX(0);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
  pointer-events: auto;
}
.sidebar.is-open::after { opacity: 0; }
.sidebar.is-open .sidebar-header,
.sidebar.is-open .sidebar-content,
.sidebar.is-open .sidebar-footer {
  opacity: 1;
  pointer-events: auto;
}

.sidebar.is-collapsed {
  transform: translateX(calc(-100% + var(--sidebar-collapsed-width)));
  box-shadow: 0 0 16px rgba(90, 169, 255, 0.25);
  pointer-events: none;
}
.sidebar.is-collapsed::after { opacity: 1; }
.sidebar.is-collapsed .sidebar-header,
.sidebar.is-collapsed .sidebar-content,
.sidebar.is-collapsed .sidebar-footer {
  opacity: 0;
  pointer-events: none;
}

body.sidebar-open {
  overflow: hidden;
}

.sidebar-section {
  padding: 16px;
  border-radius: 16px;
  background: var(--glass-2);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.section-title {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: var(--muted);
}

.stack { display: grid; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; min-height: 86px; }
.field-label { font-size: 12px; color: var(--muted); }
.field-help { font-size: 11px; color: var(--muted); }
.field-error { font-size: 11px; color: #ef4444; min-height: 16px; }
.is-hidden { display: none; }

.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.input-group .form-input,
.input-group .form-select {
  flex: 1;
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn-sm {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.45);
  color: var(--text);
  border-radius: 10px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
body.dark-mode .icon-btn-sm { background: rgba(15, 23, 42, 0.5); }
.icon-btn-sm:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(90, 169, 255, 0.18); }
.icon-btn-sm .material-icons { font-size: 18px; }

.form-input,
.form-select {
  width: 100%;
  padding: 10px 12px;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.4);
  color: var(--text);
  font-size: 13px;
}

.hex-display {
  min-width: 110px;
  text-align: center;
  font-family: 'Consolas', 'Courier New', monospace;
}

.theme-custom input[type="color"] {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 0;
  background: transparent;
}
.theme-custom input[type="color"]::-webkit-color-swatch-wrapper { padding: 4px; }
.theme-custom input[type="color"]::-webkit-color-swatch {
  border-radius: 10px;
  border: none;
}

select option {
  color: #0f172a;
  background: #f8fafc;
}
body.dark-mode select option {
  color: #0f172a;
  background: #e2e8f0;
}
body.dark-mode .form-input,
body.dark-mode .form-select {
  background: rgba(15, 23, 42, 0.6);
}
.form-input:focus,
.form-select:focus {
  outline: 2px solid rgba(90, 169, 255, 0.4);
  border-color: transparent;
}

.btn {
  border: none;
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(140deg, var(--accent), var(--accent-3));
  color: white;
  box-shadow: 0 10px 20px rgba(90, 169, 255, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 26px rgba(90, 169, 255, 0.35); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.btn-secondary {
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
body.dark-mode .btn-secondary { background: rgba(15, 23, 42, 0.4); }
.btn-cancel { background: transparent; color: var(--muted); border: 1px solid var(--border); box-shadow: none; }
.btn-danger { background: #ef4444; box-shadow: 0 10px 20px rgba(239, 68, 68, 0.2); }

.icon-btn {
  border: none;
  background: rgba(255, 255, 255, 0.4);
  color: var(--text);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
}
body.dark-mode .icon-btn { background: rgba(15, 23, 42, 0.5); }

.chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.4);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}
body.dark-mode .chip { background: rgba(15, 23, 42, 0.4); }
.chip.active { background: var(--accent); color: white; border-color: transparent; }

.pill {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body.dark-mode .pill { background: rgba(15, 23, 42, 0.4); }

.theme-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.theme-custom { display: flex; gap: 8px; align-items: center; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

.status-card { display: grid; gap: 12px; }
.status-row { display: flex; gap: 12px; align-items: center; }
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.2);
}
.status-dot.success { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2); }
.status-dot.error { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2); }
.status-title { font-size: 13px; font-weight: 500; }
.status-sub { font-size: 12px; color: var(--muted); }

.about-card { display: grid; gap: 6px; }
.about-title { font-weight: 500; }
.about-sub { font-size: 12px; color: var(--muted); }
.about-link {
  font-size: 12px;
  color: var(--accent-3);
  text-decoration: none;
}
.about-link:hover { text-decoration: underline; }

.main {
  width: 100%;
  max-width: min(1600px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-radius: 18px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  backdrop-filter: blur(16px) saturate(150%);
  box-shadow: var(--shadow);
  animation: riseIn 0.6s ease both;
}

.topbar-title .title { font-size: 18px; font-weight: 600; font-family: var(--font-display); letter-spacing: -0.01em; }
.topbar-title .subtitle { font-size: 12px; color: var(--muted); }

.mail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  height: calc(100vh - 170px);
}

.pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--glass-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(150%);
  overflow: hidden;
  animation: riseIn 0.6s ease both;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pane-title { font-size: 16px; font-weight: 600; font-family: var(--font-display); letter-spacing: -0.01em; }
.pane-subtitle { font-size: 12px; color: var(--muted); }

.pane-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  border: 1px solid var(--border);
}

.pane-select {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12px;
  min-height: 40px;
}
body.dark-mode .pane-select { background: rgba(15, 23, 42, 0.5); }
.pane-select:disabled { opacity: 0.6; cursor: not-allowed; }
body.dark-mode .pane-tools { background: rgba(15, 23, 42, 0.5); }
.pane-tools .material-icons { font-size: 18px; color: var(--muted); }
.pane-tools input,
.pane-tools select {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  flex: 1;
}
.pane-tools input:focus,
.pane-tools select:focus { outline: none; }

.pane-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  gap: 10px;
  padding-right: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pane-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 24px 12px;
  display: none;
}

.address-item,
.inbox-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: grid;
  gap: 6px;
  transition: all 0.2s ease;
  min-width: 0;
}
body.dark-mode .address-item,
body.dark-mode .inbox-item {
  background: rgba(15, 23, 42, 0.5);
}
.address-item { grid-template-columns: 1fr auto; align-items: center; }
.address-item.active {
  border-color: rgba(90, 169, 255, 0.6);
  background: linear-gradient(140deg, rgba(90, 169, 255, 0.18), rgba(90, 169, 255, 0.05));
}
.address-item:hover,
.inbox-item:hover { transform: translateY(-1px); border-color: rgba(90, 169, 255, 0.4); }

.address-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.addr-title,
.addr-domain {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.addr-title { font-weight: 600; }
.addr-domain { font-size: 12px; color: var(--muted); }
.address-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.address-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(90, 169, 255, 0.15); color: var(--accent-3); flex: 0 0 auto; }
.address-actions { display: flex; gap: 12px; align-items: center; }
.mini-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mini-btn:hover { background: rgba(90, 169, 255, 0.12); color: var(--accent-3); }

.inbox-item { grid-template-columns: auto 1fr; align-items: flex-start; gap: 12px; }
.inbox-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(90, 169, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--accent-3);
}
.inbox-main { display: grid; gap: 6px; min-width: 0; }
.inbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.inbox-from-name {
  font-size: 14px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-date {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  margin-left: auto;
}
.inbox-subject {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  align-items: center;
}
.inbox-domain {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(90, 169, 255, 0.15);
  color: var(--accent-3);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inbox-from-email,
.inbox-to {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pagination-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.viewer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.viewer-overlay.active { display: flex; }

.viewer-panel {
  width: min(92vw, 1100px);
  height: min(90vh, 900px);
  background: var(--glass-2);
  border-radius: 24px;
  border: 1px solid var(--border);
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
}

.viewer-header { display: flex; justify-content: space-between; gap: 16px; }
.viewer-subject { font-size: 20px; font-weight: 600; font-family: var(--font-display); letter-spacing: -0.01em; }
.viewer-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.viewer-tabs { display: flex; gap: 8px; }
.viewer-body {
  flex: 1;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--border);
}
body.dark-mode .viewer-body { background: rgba(15, 23, 42, 0.7); }
.viewer-actions { display: flex; justify-content: space-between; }
.email-body-iframe { width: 100%; height: 100%; border: none; }
.email-body-text { font-size: 14px; line-height: 1.6; white-space: pre-wrap; }

.loading {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 1400;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-2);
  color: var(--text);
  transition: all 0.3s ease;
}
.notification.success { border: 1px solid rgba(34, 197, 94, 0.4); }
.notification.error { border: 1px solid rgba(239, 68, 68, 0.4); }

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 15, 24, 0.45);
  z-index: 1200;
  padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal {
  width: min(520px, 95vw);
  background: var(--glass-2);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(150%);
  display: flex;
  flex-direction: column;
}

.modal.wide { width: clamp(720px, 70vw, 920px); }

.modal-header { padding: 20px 22px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 18px; font-weight: 600; font-family: var(--font-display); letter-spacing: -0.01em; }
.modal-close { border: none; background: transparent; color: var(--muted); cursor: pointer; }
.modal-body { padding: 20px 22px; }
.modal-actions { padding: 0 22px 20px; display: flex; justify-content: space-between; gap: 12px; }

.form-grid { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.field-preview {
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(90, 169, 255, 0.12);
  color: var(--accent-3);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.login-overlay .modal { transform: scale(0.98); animation: fadeIn 0.3s ease; }

.auth-toggle { display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.5); border: 1px solid var(--border); margin-bottom: 16px; }
body.dark-mode .auth-toggle { background: rgba(15, 23, 42, 0.5); }
.auth-toggle-btn { flex: 1; border: none; background: transparent; color: var(--muted); padding: 8px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 500; transition: all 0.2s ease; }
.auth-toggle-btn.active { background: var(--accent); color: white; }
.auth-toggle-btn.disabled,
.auth-toggle-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.auth-notice { margin-bottom: 16px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 193, 7, 0.12); color: #b45309; font-size: 12px; }
.auth-notice.error { background: rgba(239, 68, 68, 0.12); color: #ef4444; }

.login-active .app-shell {
  filter: blur(14px) saturate(70%);
  pointer-events: none;
}
.login-active .sidebar {
  filter: blur(14px) saturate(70%);
  pointer-events: none;
}
.login-active .sidebar-overlay {
  opacity: 0;
  pointer-events: none;
}
.login-active .sidebar-handle,
.login-active .floating-app-icon {
  pointer-events: none;
  opacity: 0.7;
  filter: blur(8px) saturate(70%);
}

.mail-layout .pane:nth-child(1) { animation-delay: 0.1s; }
.mail-layout .pane:nth-child(2) { animation-delay: 0.2s; }

.list-item { animation: softRise 0.35s ease both; }


@media (max-width: 1024px) {
  .main { max-width: calc(100vw - 32px); }
  .mail-layout { grid-template-columns: 1fr; height: auto; }
  .pane { min-height: 320px; }
  .sidebar { width: min(320px, 90vw); }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  body { overflow: auto; }
  .main { padding: 16px; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .viewer-panel { width: 100vw; height: 100vh; border-radius: 0; }
  .viewer-actions { flex-direction: column; gap: 12px; }
  .floating-app-icon { top: 12px; left: 12px; }
  .sidebar { left: 12px; top: 12px; bottom: 12px; }
  .sidebar-handle { left: 8px; }
  .modal.wide { width: 92vw; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes sidebarFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes softRise {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
