﻿/* BKO Mail webmail.
 *
 * Design system: tokens on :root (colour, spacing, radius, type, elevation, motion), light and
 * dark themes (data-theme overrides the device), density via data-density="compact".
 * Branding may override --accent at runtime (CSSOM); every accent tint is derived from it.
 * The page CSP forbids inline style attributes: everything visual lives here.
 */

/* ============================================================ tokens */
:root {
  /* Brand board */
  --navy: #0a1f44;
  --brand-blue: #0a84ff;
  --brand-light: #e8f1ff;
  --slate: #64748b;

  /* Surfaces and text */
  --bg: #f1f4f9;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --sunken: #edf1f7;
  --text: #0a1f44;
  --text-2: #334360;
  --muted: #64748b;
  --subtle: #94a3b8;
  --border: #e3e8f0;
  --border-strong: #cfd8e5;
  --hover: rgba(10, 31, 68, 0.055);
  --pressed: rgba(10, 31, 68, 0.1);

  /* Accent (overridable) and its derived tints */
  --accent: #0a6fe8;
  --accent-2: #0a84ff;
  --accent-text: #ffffff;
  --accent-strong: color-mix(in srgb, var(--accent) 84%, #000);
  --accent-soft: color-mix(in srgb, var(--accent) 10%, var(--panel));
  --accent-softer: color-mix(in srgb, var(--accent) 5%, var(--panel));
  --selected: color-mix(in srgb, var(--accent) 13%, var(--panel));
  --search-bg: color-mix(in srgb, var(--accent) 7%, var(--panel));

  /* Status */
  --danger: #cf2f27;
  --danger-soft: #fdecea;
  --warn-bg: #fff7e8;
  --warn-border: #f5d9a3;
  --warn-text: #7a4300;
  --success: #12845b;
  --success-soft: #e5f6ee;
  --star: #f0a500;
  --unread: var(--text);

  /* Overlays */
  --scrim: rgba(6, 18, 42, 0.5);
  --toast-bg: #0a1f44;
  --toast-text: #ffffff;
  --toast-link: #7dbbff;
  --toast-ok: #4cc38a;
  --toast-err: #ff8f86;

  /* Spacing scale (4px base) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radius scale */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-pill: 999px;
  --radius: var(--radius-lg);

  /* Type scale */
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-display: "Inter", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --fs-2xs: 11px;
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: 36px;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(10, 31, 68, 0.06);
  --shadow-sm: 0 1px 3px rgba(10, 31, 68, 0.08), 0 1px 2px rgba(10, 31, 68, 0.04);
  --shadow-md: 0 4px 12px rgba(10, 31, 68, 0.08), 0 2px 4px rgba(10, 31, 68, 0.05);
  --shadow-lg: 0 12px 28px rgba(10, 31, 68, 0.14), 0 4px 10px rgba(10, 31, 68, 0.06);
  --shadow-xl: 0 24px 60px rgba(10, 31, 68, 0.22), 0 8px 20px rgba(10, 31, 68, 0.08);
  --shadow: var(--shadow-lg);
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 260ms;

  /* Layout */
  --topbar-h: 64px;
  --sidebar-w: 256px;
  --list-w: 440px;
  --row-pad: 12px;
  --row-avatar: 40px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #050d1e;
    --panel: #0b1730;
    --panel-2: #0f1d3a;
    --sunken: #0a1429;
    --text: #e6edf9;
    --text-2: #c3cfe3;
    --muted: #8fa0bb;
    --subtle: #5f7190;
    --border: #1a2949;
    --border-strong: #26395e;
    --hover: rgba(255, 255, 255, 0.06);
    --pressed: rgba(255, 255, 255, 0.11);
    --accent: #4da3ff;
    --accent-2: #6db3ff;
    --accent-text: #03122b;
    --accent-strong: color-mix(in srgb, var(--accent) 80%, #fff);
    --accent-soft: color-mix(in srgb, var(--accent) 17%, var(--panel));
    --accent-softer: color-mix(in srgb, var(--accent) 9%, var(--panel));
    --selected: color-mix(in srgb, var(--accent) 22%, var(--panel));
    --search-bg: color-mix(in srgb, var(--accent) 8%, var(--panel));
    --danger: #f47c74;
    --danger-soft: #3a1b22;
    --warn-bg: #2b220e;
    --warn-border: #5a4416;
    --warn-text: #f3c27a;
    --success: #4cc38a;
    --success-soft: #0f3326;
    --star: #f6c244;
    --scrim: rgba(0, 4, 12, 0.66);
    --toast-bg: #e6edf9;
    --toast-text: #0a1f44;
    --toast-link: #0a6fe8;
  --toast-ok: #12845b;
  --toast-err: #cf2f27;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.55);
    --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #050d1e;
  --panel: #0b1730;
  --panel-2: #0f1d3a;
  --sunken: #0a1429;
  --text: #e6edf9;
  --text-2: #c3cfe3;
  --muted: #8fa0bb;
  --subtle: #5f7190;
  --border: #1a2949;
  --border-strong: #26395e;
  --hover: rgba(255, 255, 255, 0.06);
  --pressed: rgba(255, 255, 255, 0.11);
  --accent: #4da3ff;
  --accent-2: #6db3ff;
  --accent-text: #03122b;
  --accent-strong: color-mix(in srgb, var(--accent) 80%, #fff);
  --accent-soft: color-mix(in srgb, var(--accent) 17%, var(--panel));
  --accent-softer: color-mix(in srgb, var(--accent) 9%, var(--panel));
  --selected: color-mix(in srgb, var(--accent) 22%, var(--panel));
  --search-bg: color-mix(in srgb, var(--accent) 8%, var(--panel));
  --danger: #f47c74;
  --danger-soft: #3a1b22;
  --warn-bg: #2b220e;
  --warn-border: #5a4416;
  --warn-text: #f3c27a;
  --success: #4cc38a;
  --success-soft: #0f3326;
  --star: #f6c244;
  --scrim: rgba(0, 4, 12, 0.66);
  --toast-bg: #e6edf9;
  --toast-text: #0a1f44;
  --toast-link: #0a6fe8;
  --toast-ok: #12845b;
  --toast-err: #cf2f27;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 24px 60px rgba(0, 0, 0, 0.65);
  color-scheme: dark;
}
:root[data-density="compact"] { --row-pad: 7px; --row-avatar: 30px; }

/* ============================================================ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-base)/1.5 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.012em; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: var(--radius-sm); text-align: center;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--panel);
  font: 600 var(--fs-2xs)/1.6 var(--font-mono); color: var(--text-2);
}
.sprite { display: none; }
.muted { color: var(--muted); }
.small-text { font-size: var(--fs-xs); }
.spacer { flex: 1; }
.error { color: var(--danger); margin: var(--space-2) 0; }
.form-error {
  display: flex; align-items: flex-start; gap: var(--space-2);
  padding: 10px 12px; border-radius: var(--radius-md); font-size: var(--fs-sm); font-weight: 500;
  background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
}
.form-error::before {
  content: ""; flex: none; width: 6px; align-self: stretch; border-radius: 3px; background: var(--danger);
}

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--subtle); }
::-webkit-scrollbar-track { background: transparent; }

/* Focus: a clear ring for keyboard users only. */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================ icons */
.icon {
  width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: middle;
}
.small .icon, .icon-btn.small .icon { width: 16px; height: 16px; }
[data-icon] { display: inline-flex; align-items: center; }

/* ============================================================ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: 38px; padding: 0 var(--space-4); border-radius: var(--radius-md);
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
  font-size: var(--fs-sm); font-weight: 550; line-height: 1; white-space: nowrap;
  cursor: pointer; text-decoration: none; user-select: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--panel-2); border-color: var(--subtle); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 17px; height: 17px; }
.btn.primary {
  background: var(--accent); border-color: transparent; color: var(--accent-text); font-weight: 650;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn.primary:hover { background: var(--accent-strong); }
.btn.primary.danger-btn { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.small { height: 32px; padding: 0 var(--space-3); font-size: var(--fs-sm); border-radius: var(--radius-sm); }
.btn.large { height: 46px; font-size: var(--fs-md); border-radius: var(--radius-lg); }
.btn.wide, .input.wide { width: 100%; }
.btn:disabled, .icon-btn:disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.danger { color: var(--danger); }
.btn.danger:hover, .btn.ghost.danger:hover { background: var(--danger-soft); color: var(--danger); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 38px; height: 38px; border: none; background: transparent; border-radius: var(--radius-md);
  color: var(--text-2); cursor: pointer; text-decoration: none;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.icon-btn.small { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { background: var(--pressed); }
.icon-btn.active { color: var(--accent); background: var(--accent-soft); }
.icon-btn.danger { color: var(--text-2); }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.link-btn {
  border: none; background: none; color: var(--accent); cursor: pointer; padding: 2px 4px;
  display: inline-flex; align-items: center; gap: 2px; border-radius: var(--radius-xs); font-weight: 550;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }
.link-btn .icon { width: 14px; height: 14px; }
.chip-btn {
  border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius-pill);
  padding: 4px 12px; cursor: pointer; font-size: var(--fs-sm);
}
.chip-btn.active { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }

/* ============================================================ form controls */
.input, .select {
  height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-md);
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
textarea.input { height: auto; padding: 10px var(--space-3); resize: vertical; line-height: 1.5; }
.input::placeholder, textarea::placeholder, input::placeholder { color: var(--subtle); opacity: 1; }
.input:hover, .select:hover { border-color: var(--subtle); }
.input:focus, .select:focus, .input:focus-visible, .select:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: var(--focus-ring);
}
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
}
.select.small { height: 32px; font-size: var(--fs-sm); border-radius: var(--radius-sm); padding: 0 28px 0 10px; background-position: right 8px center; }
label.stacked { display: block; margin: var(--space-4) 0 0; font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); }
label.stacked .input, label.stacked .select, label.stacked input {
  display: block; width: 100%; margin-top: 6px; font-weight: 400; font-size: var(--fs-base); color: var(--text);
}
.input-wrap { position: relative; display: flex; align-items: center; margin-top: 6px; }
.input-wrap.grow { flex: 1; margin-top: 0; }
.input-wrap .input { width: 100%; padding-left: 40px; }
.input-icon { position: absolute; left: 12px; color: var(--subtle); pointer-events: none; }
.input-icon .icon { width: 17px; height: 17px; }
.input-wrap:focus-within .input-icon { color: var(--accent); }

/* Checkbox */
.check { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; cursor: pointer; flex: none; }
.check input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.check span {
  width: 18px; height: 18px; border: 1.75px solid var(--subtle); border-radius: 5px; background: var(--panel);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.check:hover span { border-color: var(--accent); }
.check input:checked + span, .check input:indeterminate + span { background: var(--accent); border-color: var(--accent); }
.check input:checked + span::after {
  content: ""; display: block; width: 5px; height: 9px; margin: 1.5px 0 0 5px;
  border: solid var(--accent-text); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.check input:indeterminate + span::after {
  content: ""; display: block; width: 8px; height: 2px; margin: 6.25px 0 0 3.25px; background: var(--accent-text); border-radius: 1px;
}
.check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================ avatars */
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  color: #fff; font-weight: 650; font-size: 15px; letter-spacing: 0.01em;
  background: var(--accent); user-select: none;
}
.avatar-small { width: 32px; height: 32px; font-size: var(--fs-sm); }
.avatar-large { width: 48px; height: 48px; font-size: 18px; }
.avatar.c0 { background: linear-gradient(135deg, #2a8cff, #0a5fd6); }
.avatar.c1 { background: linear-gradient(135deg, #1fb57f, #0d8a5f); }
.avatar.c2 { background: linear-gradient(135deg, #e06a92, #c0436d); }
.avatar.c3 { background: linear-gradient(135deg, #e3922c, #b8690c); }
.avatar.c4 { background: linear-gradient(135deg, #9a6cf0, #6c43cf); }
.avatar.c5 { background: linear-gradient(135deg, #22aecd, #0b7f9c); }
.avatar.c6 { background: linear-gradient(135deg, #f0714f, #cc4426); }
.avatar.c7 { background: linear-gradient(135deg, #5b7d9f, #3a5676); }

/* ============================================================ brand */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 18px; letter-spacing: -0.01em; min-width: 0; }
.brand-large { font-size: 32px; gap: 14px; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; color: #fff; font-weight: 800; }
.brand-large .brand-mark { width: 52px; height: 52px; font-size: 24px; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.brand-mark { background: none; border-radius: 50%; overflow: hidden; }
.brand-mark .bko-mark { width: 100%; height: 100%; display: block; }
.bko-core { fill: #ffffff; }
.bko-chevron { fill: none; stroke: #0a84ff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="dark"] .bko-core { fill: #0a1f44; }
:root[data-theme="dark"] .bko-chevron { stroke: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bko-core { fill: #0a1f44; }
  :root:not([data-theme="light"]) .bko-chevron { stroke: #ffffff; }
}
.brand-hero .bko-core { fill: #0a1f44; }
.brand-hero .bko-chevron { stroke: #ffffff; }
.brand-mark.has-logo { border-radius: var(--radius-md); background: #fff; }
.brand-mark.branded { border-radius: var(--radius-md); background: var(--accent); color: #fff; }
.brand-name { display: inline-flex; align-items: baseline; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wm-bko { font-weight: 900; letter-spacing: -0.03em; color: var(--text); }
.wm-mail { margin-left: 0.45em; font-size: 0.62em; font-weight: 650; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); }
.brand-hero .wm-bko { color: #fff; }
.brand-hero .wm-mail { color: rgba(232, 241, 255, 0.78); }

/* ============================================================ login */
.login {
  height: 100%; min-height: 100dvh; overflow-y: auto;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--panel);
}
.login-art {
  position: relative; overflow: hidden; color: #fff; display: grid; place-items: center; padding: var(--space-12);
  background:
    radial-gradient(circle at 82% 12%, rgba(10, 132, 255, 0.55), transparent 42%),
    radial-gradient(circle at 10% 92%, rgba(42, 165, 255, 0.28), transparent 40%),
    linear-gradient(155deg, #050f24 0%, #0a1f44 52%, #0b3a8a 100%);
}
.login-art::before {
  /* A faint grid for depth. */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 75%);
}
.login-art::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -180px; bottom: -220px; border-radius: 50%;
  border: 1px solid rgba(232, 241, 255, 0.1); box-shadow: 0 0 0 60px rgba(232, 241, 255, 0.025), 0 0 0 130px rgba(232, 241, 255, 0.02);
  pointer-events: none;
}
.login-art-inner { position: relative; z-index: 1; width: 100%; max-width: 470px; }
.hero-title { margin: var(--space-10) 0 var(--space-3); font: 750 var(--fs-3xl)/1.12 var(--font-display); letter-spacing: -0.025em; }
.hero-lead { margin: 0 0 var(--space-8); font-size: 16px; line-height: 1.6; color: rgba(232, 241, 255, 0.78); max-width: 420px; }
.hero-features { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-5); }
.hero-features li { display: flex; gap: var(--space-4); align-items: flex-start; }
.hero-features strong { display: block; font-size: var(--fs-md); font-weight: 650; color: #fff; margin-bottom: 2px; }
.hero-features li > span:last-child { font-size: var(--fs-sm); line-height: 1.5; color: rgba(232, 241, 255, 0.68); }
.hero-feature-icon {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); color: #7dbbff;
}
.hero-feature-icon .icon { width: 20px; height: 20px; }
.pillars { margin: var(--space-12) 0 0; font-size: var(--fs-2xs); letter-spacing: 0.24em; text-transform: uppercase; color: rgba(232, 241, 255, 0.5); }

.login-main { display: grid; place-items: center; padding: var(--space-10) var(--space-6); min-width: 0; }
.login-card { width: 100%; max-width: 400px; }
.login-brand { display: none; margin-bottom: var(--space-8); }
.login-card h1 { margin: 0; font-size: var(--fs-2xl); font-weight: 750; line-height: 1.2; }
.login-sub { margin: 6px 0 var(--space-6); }
.login-card .input { height: 46px; font-size: var(--fs-md); }
.login-card .form-error { margin: var(--space-4) 0 0; }
.login-card .btn.primary { margin-top: var(--space-6); }
.login-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin: var(--space-6) 0 0; text-align: center; }
.login-foot .icon { width: 13px; height: 13px; }

/* ============================================================ app shell */
.app {
  height: 100%; height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(340px, var(--list-w)) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  grid-template-areas: "top top top" "side list read";
  overflow: hidden;
}
.app.contacts-mode { grid-template-areas: "top top top" "side contacts contacts"; }
.app.contacts-mode .list-pane, .app.contacts-mode .reader-pane { display: none; }

/* Top bar */
.topbar {
  grid-area: top; display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-4) 0 var(--space-3); min-width: 0; background: var(--bg);
}
.topbar-brand { width: calc(var(--sidebar-w) - 24px); flex: none; padding-left: var(--space-2); }
.search {
  position: relative; flex: 1; max-width: 720px; min-width: 0; height: 46px;
  display: flex; align-items: center; gap: var(--space-2);
  padding: 0 var(--space-2) 0 var(--space-4); border-radius: var(--radius-pill);
  background: var(--search-bg); border: 1px solid transparent;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.search:hover { border-color: var(--border); }
.search:focus-within { background: var(--panel); border-color: var(--border); box-shadow: var(--shadow-md); }
.search input { flex: 1; min-width: 0; height: 100%; border: none; background: transparent; outline: none; font-size: var(--fs-md); }
.search input::-webkit-search-cancel-button { display: none; }
.search-icon { color: var(--muted); }
.search:focus-within .search-icon { color: var(--accent); }
.search-hint { margin-right: var(--space-2); }
.search:focus-within .search-hint, .search:has(#search-clear:not([hidden])) .search-hint { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }

/* Account menu */
.account { position: relative; margin-left: var(--space-2); }
.account-btn {
  display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 50%;
  border: 2px solid transparent; background: transparent; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.account-btn:hover { box-shadow: 0 0 0 4px var(--hover); }
.account-btn[aria-expanded="true"] { border-color: var(--accent); }
.menu {
  position: absolute; z-index: 45; min-width: 240px; padding: 6px;
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: pop-in var(--dur) var(--ease);
  transform-origin: top right;
}
.account-menu { right: 0; top: calc(100% + 8px); width: 300px; max-width: calc(100vw - 24px); }
.menu-head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3); }
.menu-head-text { min-width: 0; }
.menu-kicker { font-size: var(--fs-xs); color: var(--muted); }
.menu-address { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--border); }
.menu-item {
  width: 100%; display: flex; align-items: center; gap: var(--space-3);
  min-height: 38px; padding: 0 var(--space-3); border: none; background: transparent;
  border-radius: var(--radius-sm); cursor: pointer; text-align: left; color: var(--text); font-weight: 500;
}
.menu-item .icon { color: var(--muted); }
.menu-item:hover { background: var(--hover); }
.menu-item:focus-visible { background: var(--hover); outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.menu-item:hover .icon { color: var(--text); }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger); }
.menu-kbd { margin-left: auto; }

/* Sidebar */
.sidebar {
  grid-area: side; display: flex; flex-direction: column; gap: 2px; min-height: 0;
  padding: var(--space-2) var(--space-3) var(--space-3); overflow-y: auto; overflow-x: hidden; background: var(--bg);
}
.sidebar > * { flex: none; }
.sidebar-brand { display: none; padding: var(--space-2) var(--space-2) var(--space-4); }
.compose-btn {
  height: 54px; justify-content: flex-start; gap: var(--space-3);
  padding: 0 var(--space-6) 0 var(--space-5); margin: 0 0 var(--space-4); align-self: flex-start;
  border-radius: var(--radius-xl); font-size: var(--fs-md);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.compose-btn:hover { box-shadow: var(--shadow-lg); }
.compose-btn .icon { width: 19px; height: 19px; }
.compose-btn .nav-label { flex: none; }
.sidebar-label {
  padding: var(--space-2) var(--space-3) 6px; font-size: var(--fs-2xs); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.folders { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.folder, .nav-link {
  position: relative; width: 100%; height: 38px; display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-3) 0 14px; border: none; background: transparent; border-radius: var(--radius-pill);
  text-align: left; cursor: pointer; color: var(--text-2); font-weight: 500;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.folder .icon, .nav-link .icon { color: var(--muted); transition: color var(--dur-fast) var(--ease); }
.folder:hover, .nav-link:hover { background: var(--hover); color: var(--text); }
.folder.active, .nav-link.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 650; }
.folder.active .icon, .nav-link.active .icon { color: var(--accent); }
.folder.drop-target { background: var(--selected); outline: 2px dashed var(--accent); outline-offset: -2px; }
.folder.nested { padding-left: 34px; }
.folder-name, .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder.has-unread { color: var(--text); }
.folder.has-unread .folder-name { font-weight: 700; }
.badge {
  flex: none; min-width: 22px; height: 20px; padding: 0 7px; display: inline-grid; place-items: center;
  border-radius: var(--radius-pill); background: var(--accent); color: var(--accent-text);
  font-size: var(--fs-2xs); font-weight: 700; font-variant-numeric: tabular-nums;
}
.badge.muted { background: var(--sunken); color: var(--muted); }
.folder.active .badge.muted { background: var(--panel); }
.sidebar-sep { height: 1px; background: var(--border); margin: var(--space-2) var(--space-3); flex: none; }
.sidebar-foot { margin-top: auto; padding-top: var(--space-4); display: grid; gap: var(--space-3); }
.quota {
  display: grid; gap: 6px; padding: var(--space-3); border-radius: var(--radius-lg);
  background: var(--panel); border: 1px solid var(--border);
}
.quota-head { display: flex; align-items: center; justify-content: space-between; }
.quota-label { font-size: var(--fs-xs); font-weight: 650; color: var(--text-2); }
.quota-bar { height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.quota-bar span {
  display: block; height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width var(--dur-slow) var(--ease);
}
.quota.high .quota-bar span { background: var(--danger); }
.quota.high #quota-text { color: var(--danger); }

/* ============================================================ panes */
.list-pane, .contacts-pane, .reader-pane {
  min-height: 0; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
}
.list-pane {
  grid-area: list; display: flex; flex-direction: column; overflow: hidden;
  margin: 0 6px var(--space-3) 0; border-radius: var(--radius-xl);
}
.contacts-pane {
  grid-area: contacts; display: flex; flex-direction: column; overflow-y: auto;
  margin: 0 var(--space-3) var(--space-3) 0; border-radius: var(--radius-xl);
}
.reader-pane {
  grid-area: read; overflow-y: auto; position: relative; container: reader / inline-size;
  margin: 0 var(--space-3) var(--space-3) 6px; border-radius: var(--radius-xl);
}

/* List header and toolbar */
.list-head { padding: var(--space-3) var(--space-4) 0; border-bottom: 1px solid var(--border); flex: none; background: var(--panel); }
.contacts-pane .list-head { position: sticky; top: 0; z-index: 2; }
.list-title-row { display: flex; align-items: center; gap: var(--space-2); min-height: 36px; }
.list-title-row h2 { font-size: var(--fs-lg); font-weight: 700; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.count-pill {
  flex: none; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--sunken);
  color: var(--muted); font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums;
}
.count-pill:empty { display: none; }
.list-tools { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) 0 10px; min-height: 52px; min-width: 0; }
.list-tools > .check { margin: 0 6px 0 20px; }
.segmented {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill); background: var(--sunken); flex: none;
}
.segmented button {
  height: 28px; padding: 0 var(--space-3); border: none; background: transparent; border-radius: var(--radius-pill);
  cursor: pointer; font-size: var(--fs-sm); font-weight: 550; color: var(--muted);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--panel); color: var(--text); font-weight: 650; box-shadow: var(--shadow-sm); }
.bulk-bar { display: flex; align-items: center; gap: 2px; min-width: 0; animation: fade-in var(--dur) var(--ease); }
.bulk-count {
  margin-right: 6px; padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent-strong); font-size: var(--fs-xs); font-weight: 700; white-space: nowrap;
}
.bulk-bar .select { max-width: 140px; margin: 0 2px; }
.list-tools:has(.bulk-bar:not([hidden])) #refresh-button { display: none; }

/* Message list */
.message-scroll { flex: 1; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.messages { list-style: none; margin: 0; padding: 2px 0 var(--space-3); }
.group-head {
  position: sticky; top: 0; z-index: 3; padding: 12px 20px 6px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  color: var(--muted); font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
}
.message {
  position: relative; display: grid;
  grid-template-columns: var(--row-avatar) minmax(0, 1fr) auto;
  grid-template-areas: "lead who when" "lead what meta";
  column-gap: var(--space-3); row-gap: 1px; align-items: center;
  margin: 1px var(--space-2); padding: var(--row-pad) var(--space-3) var(--row-pad) 18px;
  border-radius: var(--radius-lg); cursor: pointer; outline: none;
  transition: background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.message:hover { background: var(--hover); }
.message.checked { background: var(--accent-softer); }
.message.selected { background: var(--selected); box-shadow: inset 3px 0 0 var(--accent); }
.message:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.message.unread::after {
  content: ""; position: absolute; left: 6px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px;
  border-radius: 50%; background: var(--accent);
}
.message .check { grid-area: lead; justify-self: center; width: var(--row-avatar); height: var(--row-avatar); z-index: 2; opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
.message .avatar { grid-area: lead; width: var(--row-avatar); height: var(--row-avatar); font-size: 14px; transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
:root[data-density="compact"] .message .avatar { font-size: var(--fs-xs); }
/* Checkbox replaces the avatar on hover, when checked, and whenever a selection exists. */
.message.checked .check, .messages:has(.message.checked) .message .check { opacity: 1; }
.message.checked .avatar, .messages:has(.message.checked) .message .avatar { opacity: 0; transform: scale(0.8); }
@media (hover: hover) {
  .message:hover .check { opacity: 1; }
  .message:hover .avatar { opacity: 0; transform: scale(0.8); }
}
.message .who {
  grid-area: who; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14.5px; font-weight: 500; color: var(--text-2);
}
.message .when { grid-area: when; font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.message .what {
  grid-area: what; min-width: 0; display: flex; align-items: center; gap: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); color: var(--muted);
}
.message .subject-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message .meta { grid-area: meta; display: flex; align-items: center; justify-content: flex-end; gap: 2px; color: var(--muted); min-height: 24px; }
.message .meta .icon { width: 15px; height: 15px; }
.message.unread .who { color: var(--unread); font-weight: 700; }
.message.unread .what .subject-text { color: var(--text); font-weight: 600; }
.message.unread .when { color: var(--accent); font-weight: 650; }
.star-btn { width: 26px; height: 26px; color: var(--subtle); }
.star-btn:hover { color: var(--star); background: transparent; }
.star-btn.on { color: var(--star); }
.star-btn.on .icon, #flag-button.on .icon { fill: var(--star); stroke: var(--star); }
#flag-button.on { color: var(--star); }
.message .star-btn { opacity: 0; }
.message:hover .star-btn, .message .star-btn.on, .message .star-btn:focus-visible { opacity: 1; }
.message .answered { color: var(--muted); }
.message.dragging { opacity: 0.45; }

/* Hover quick actions (floating pill on pointer devices). */
.row-actions {
  position: absolute; right: 10px; top: 50%; z-index: 2; display: none; gap: 2px; padding: 2px;
  transform: translateY(-50%); background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
}
.row-actions .icon-btn.small { width: 30px; height: 30px; }
@media (hover: hover) {
  .message:hover .row-actions, .message .row-actions:focus-within { display: flex; animation: fade-in var(--dur-fast) var(--ease); }
}

.list-sentinel { height: 1px; }
.loading-row {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: var(--space-4); color: var(--muted); font-size: var(--fs-sm);
}
.loading-row::before, .spinner {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite;
}

/* Skeleton loaders (widths set from JS via CSSOM). */
.skeleton {
  display: flex; align-items: center; gap: var(--space-3);
  margin: 1px var(--space-2); padding: var(--row-pad) var(--space-3) var(--row-pad) 18px; list-style: none;
}
.skeleton .circle, .skeleton .bar, .skeleton-block {
  background: linear-gradient(90deg, var(--sunken) 0%, color-mix(in srgb, var(--sunken) 40%, var(--panel)) 50%, var(--sunken) 100%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton .circle { width: var(--row-avatar); height: var(--row-avatar); border-radius: 50%; flex: none; }
.skeleton .lines { flex: 1; display: grid; gap: 9px; }
.skeleton .bar { height: 10px; border-radius: 5px; }
.skeleton-block { border-radius: var(--radius-md); }

/* Empty states */
.empty-state {
  display: grid; place-items: center; align-content: center; text-align: center; gap: var(--space-2);
  padding: var(--space-12) var(--space-6); color: var(--muted);
}
.empty-state p { margin: 0; max-width: 340px; }
.empty-title { font-size: var(--fs-md); font-weight: 650; color: var(--text); }
.empty-icon {
  display: grid; place-items: center; width: 76px; height: 76px; margin-bottom: var(--space-2); border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, var(--panel), var(--accent-soft) 70%);
  color: var(--accent); box-shadow: 0 0 0 8px var(--accent-softer);
}
.empty-icon .icon { width: 32px; height: 32px; stroke-width: 1.6; }

/* ============================================================ reader */
.reader-pane .reader-empty { height: 100%; }
.reader-bar {
  position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: var(--space-2); flex-wrap: nowrap;
  min-height: 60px; padding: 10px var(--space-5);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.bar-group { display: flex; align-items: center; gap: 4px; min-width: 0; }
.bar-sep { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }
.move-select { flex: 0 1 150px; width: 150px; min-width: 84px; }
@container reader (max-width: 780px) {
  .reader-bar .hide-narrow { display: none; }
  .reader-bar .btn.small { padding: 0 9px; }
}
.reader-body { padding: 4px var(--space-8) var(--space-10); max-width: 1000px; margin: 0 auto; animation: fade-in var(--dur) var(--ease); }
.subject {
  margin: var(--space-6) 0 var(--space-5); font-size: var(--fs-xl); font-weight: 700; line-height: 1.3;
  letter-spacing: -0.015em; overflow-wrap: anywhere;
}
.sender-block { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-4); }
.sender-block .avatar { width: 44px; height: 44px; font-size: 16px; }
.sender-main { flex: 1; min-width: 0; padding-top: 1px; }
.sender-line { overflow-wrap: anywhere; line-height: 1.35; }
.sender-name { font-size: var(--fs-md); font-weight: 650; }
.sender-email { color: var(--muted); font-size: var(--fs-sm); }
.details-toggle { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; padding: 2px 4px 2px 0; margin-top: 2px; max-width: 100%; }
.details-toggle > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.details-toggle:hover { color: var(--text); text-decoration: none; }
.reader-date { flex: none; color: var(--muted); font-size: var(--fs-xs); padding-top: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.details {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px var(--space-4);
  margin: 0 0 var(--space-4) 56px; padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-lg);
  animation: fade-in var(--dur) var(--ease);
}
.details dt { color: var(--muted); font-weight: 550; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.banner {
  display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-3);
  padding: 10px 14px; border-radius: var(--radius-lg); font-size: var(--fs-sm); line-height: 1.45;
  background: var(--accent-softer); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
}
.banner > span:nth-child(2) { flex: 1; min-width: 0; }
.banner-icon { color: var(--accent); flex: none; }
.banner.warn { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.banner.warn .banner-icon { color: inherit; }
.banner .btn { flex: none; }
.body-switch { margin-bottom: var(--space-3); }
.body-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-md); line-height: 1.65; padding: var(--space-1) 0 var(--space-2); color: var(--text); }
.body-text .quoted { display: block; margin: 6px 0; padding-left: var(--space-3); color: var(--muted); border-left: 3px solid var(--border-strong); }
.body-html {
  display: block; width: 100%; height: 70vh; min-height: 360px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff;
}
.attachments-block { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--border); }
.section-title { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); font-size: var(--fs-sm); font-weight: 650; color: var(--text-2); }
.section-title .icon { width: 16px; height: 16px; color: var(--muted); }
.attachment-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(176px, 100%), 1fr)); gap: var(--space-3); }
.attachment-card {
  display: flex; flex-direction: column; overflow: hidden; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.attachment-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.attachment-thumb {
  height: 108px; width: 100%; padding: 0; border: none; display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(160deg, var(--panel-2), var(--sunken)); color: var(--muted);
}
.attachment-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attachment-thumb .icon { width: 34px; height: 34px; stroke-width: 1.5; }
.attachment-info { display: flex; align-items: center; gap: 6px; padding: var(--space-2) 6px var(--space-2) var(--space-3); border-top: 1px solid var(--border); }
.attachment-info .file-text { flex: 1; min-width: 0; }
.attachment-info .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); font-weight: 550; }
.attachment-info .size { font-size: var(--fs-2xs); color: var(--muted); }
.quick-reply { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid var(--border); }
.quick-reply .btn { border-radius: var(--radius-pill); padding: 0 var(--space-5); }

/* ============================================================ contacts */
.contact-grid {
  list-style: none; margin: 0; padding: var(--space-4);
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: var(--space-3);
}
.contact-card {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3) 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.contact-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.contact-card .who { flex: 1; min-width: 0; }
.contact-card .name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-card .email { font-size: var(--fs-sm); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-card .icon-btn { opacity: 0.75; }
.contact-card:hover .icon-btn, .contact-card .icon-btn:focus-visible { opacity: 1; }

/* ============================================================ compose */
.compose {
  position: fixed; right: var(--space-6); bottom: 0; z-index: 30;
  width: 640px; max-width: calc(100vw - 32px); height: min(680px, calc(100vh - 88px));
  display: flex; flex-direction: column; background: var(--panel);
  border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-xl); animation: slide-up var(--dur-slow) var(--ease);
}
.compose.maximized {
  right: 50%; bottom: 50%; transform: translate(50%, 50%);
  width: min(1040px, calc(100vw - 48px)); height: calc(100vh - 64px);
  border-radius: var(--radius-xl); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xl), 0 0 0 100vmax var(--scrim); animation: none;
}
.compose.minimized { height: auto; width: 340px; }
.compose.minimized .compose-body { display: none; }
.compose-head {
  display: flex; align-items: center; gap: 2px; min-height: 46px; padding: 4px 8px 4px var(--space-4);
  background: var(--navy); color: #fff; border-radius: var(--radius-xl) var(--radius-xl) 0 0; cursor: pointer;
}
.compose.maximized .compose-head { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
.compose-head h2 { flex: 1; margin: 0; font-size: var(--fs-base); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compose-head .icon-btn { color: rgba(232, 241, 255, 0.85); }
.compose-head .icon-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.compose-body { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0 var(--space-4) var(--space-3); position: relative; }
.field { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; border-bottom: 1px solid var(--border); }
.field > label { width: 36px; flex: none; color: var(--muted); font-size: var(--fs-sm); font-weight: 550; }
.chips { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 6px 0; min-width: 0; cursor: text; }
.chips input { flex: 1; min-width: 120px; border: none; background: transparent; padding: 4px 2px; outline: none; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; height: 26px;
  padding: 0 3px 0 10px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  font-size: var(--fs-sm); font-weight: 500; animation: fade-in var(--dur-fast) var(--ease);
}
.chip.invalid { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.chip .chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button {
  display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: none; border-radius: 50%;
  background: transparent; color: inherit; cursor: pointer; opacity: 0.7;
}
.chip button:hover { background: var(--pressed); opacity: 1; }
.chip .icon { width: 12px; height: 12px; }
.subject-input { flex: 1; border: none; background: transparent; padding: 10px 0; outline: none; font-size: var(--fs-md); font-weight: 600; }
.suggestions {
  list-style: none; margin: 0; padding: 6px; position: absolute; left: 56px; right: var(--space-4); z-index: 5;
  max-height: 280px; overflow-y: auto; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: pop-in var(--dur-fast) var(--ease); transform-origin: top left;
}
.suggestions li { display: flex; align-items: center; gap: 10px; padding: 7px var(--space-2); border-radius: var(--radius-md); cursor: pointer; }
.suggestions li.active, .suggestions li:hover { background: var(--accent-softer); }
.suggestions li.active { box-shadow: inset 2px 0 0 var(--accent); }
.suggestions .avatar { width: 30px; height: 30px; font-size: var(--fs-xs); }
.suggestions .s-name { font-weight: 600; }
.suggestions .s-email { color: var(--muted); font-size: var(--fs-xs); }
.editor-toolbar {
  display: flex; align-items: center; gap: 1px; flex-wrap: wrap;
  margin: var(--space-2) 0 0; padding: 3px; border-radius: var(--radius-md); background: var(--panel-2); border: 1px solid var(--border);
}
.editor-toolbar .icon-btn.small { width: 32px; height: 30px; }
.tool-sep { width: 1px; height: 18px; background: var(--border-strong); margin: 0 4px; }
.editor { position: relative; flex: 1; overflow-y: auto; padding: var(--space-3) 2px; outline: none; font-size: 14.5px; line-height: 1.6; min-height: 120px; overflow-wrap: anywhere; }
/* Placeholder while nothing but the signature/quote is in the editor (class set from JS). */
.editor:empty::before, .editor.blank::before {
  content: "Write your message…"; position: absolute; top: var(--space-3); left: 2px;
  color: var(--subtle); pointer-events: none;
}
.editor blockquote, .body-text blockquote { margin: 6px 0; padding-left: var(--space-3); border-left: 3px solid var(--border-strong); color: var(--muted); }
.editor .signature { color: var(--muted); }
.editor .quoted-original { color: var(--text-2); }
.attachment-chips { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.attachment-chips:empty { display: none; }
.attachment-chips li {
  display: flex; align-items: center; gap: 6px; max-width: 100%; height: 36px; padding: 0 3px 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--panel-2); font-size: var(--fs-sm);
}
.attachment-chips li > .icon { color: var(--accent); width: 16px; height: 16px; }
.attachment-chips .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; font-weight: 550; }
.attachment-chips .size { color: var(--muted); font-size: var(--fs-2xs); }
.compose-actions { display: flex; align-items: center; gap: var(--space-2); padding-top: var(--space-3); }
.send-btn { height: 42px; padding: 0 var(--space-6); border-radius: var(--radius-pill); }
.compose-status { color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.drop-zone {
  position: absolute; inset: var(--space-2); z-index: 6; display: grid; place-items: center; align-content: center; gap: var(--space-2);
  border: 2px dashed var(--accent); border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent-soft) 94%, transparent); color: var(--accent); font-weight: 650; pointer-events: none;
}
.drop-zone .icon { width: 32px; height: 32px; }

/* Floating compose button (phones). */
.fab {
  display: none; position: fixed; right: var(--space-4); bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px)); z-index: 25;
  width: 58px; height: 58px; place-items: center; border: none; border-radius: 18px; cursor: pointer;
  background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow-lg);
}
.fab .icon { width: 22px; height: 22px; }
.fab:active { transform: scale(0.96); }

/* ============================================================ dialogs */
.dialog {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: var(--space-6);
  border: 1px solid var(--border); border-radius: var(--radius-2xl);
  background: var(--panel); color: var(--text); box-shadow: var(--shadow-xl);
}
.dialog[open] { animation: dialog-in var(--dur-slow) var(--ease); }
.dialog-wide { width: min(600px, calc(100vw - 32px)); }
.dialog::backdrop, .lightbox::backdrop { background: var(--scrim); backdrop-filter: blur(2px); }
.dialog h2 { margin: 0 0 6px; font-size: var(--fs-lg); font-weight: 700; }
.dialog p { margin: 0 0 var(--space-2); }
.dialog .input.wide { margin-top: var(--space-3); }
.dialog-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: var(--space-2); }
.dialog-head h2 { margin: 0 0 2px; }
.dialog-head p { margin: 0; }
.dialog-icon {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius-lg);
  background: var(--accent-soft); color: var(--accent);
}
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-6); }
.settings-section { margin: var(--space-5) 0 0; padding: var(--space-4) 0 0; border: none; border-top: 1px solid var(--border); min-width: 0; }
.settings-section legend {
  padding: 0 var(--space-2) 0 0; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.settings-section label.stacked:first-of-type { margin-top: var(--space-2); }
.settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5) var(--space-8); margin-top: var(--space-5); }
.shortcut-group h3 { margin: 0 0 6px; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.shortcut {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 7px 0; font-size: var(--fs-sm); border-bottom: 1px dashed var(--border);
}
.shortcut > span:last-child { flex: none; color: var(--muted); font-size: var(--fs-xs); }
.lightbox { border: none; background: transparent; padding: 0; max-width: 94vw; max-height: 94vh; display: none; overflow: visible; }
.lightbox[open] { display: grid; justify-items: center; gap: var(--space-3); animation: dialog-in var(--dur-slow) var(--ease); }
.lightbox img { max-width: 92vw; max-height: 80vh; border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-xl); }
.lightbox #lightbox-close { justify-self: end; color: #fff; background: rgba(255, 255, 255, 0.12); border-radius: 50%; }
.lightbox #lightbox-close:hover { background: rgba(255, 255, 255, 0.22); }

/* ============================================================ toast */
.toast {
  position: fixed; left: 50%; bottom: var(--space-6); z-index: 60; transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--space-3);
  max-width: min(560px, calc(100vw - 32px)); min-height: 46px; padding: 8px 10px 8px 14px;
  background: var(--toast-bg); color: var(--toast-text); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  font-size: var(--fs-sm); font-weight: 500; animation: toast-in var(--dur-slow) var(--ease);
}
.toast-icon { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--toast-ok) 22%, transparent); color: var(--toast-ok); }
.toast-icon .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.toast.error .toast-icon, .toast.warn .toast-icon { background: color-mix(in srgb, var(--toast-err) 22%, transparent); color: var(--toast-err); }
#toast-text { flex: 1; min-width: 0; }
.toast .link-btn { color: var(--toast-link); font-weight: 700; padding: 6px 10px; border-radius: var(--radius-sm); }
.toast .link-btn:hover { background: rgba(127, 127, 127, 0.16); text-decoration: none; }

/* Tooltip hook for the JS layer: <el data-tip="Text">. */
[data-tip] { position: relative; }
@media (hover: hover) {
  [data-tip]:hover::after, [data-tip]:focus-visible::after {
    content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 6px); z-index: 70; transform: translateX(-50%);
    padding: 5px 8px; border-radius: var(--radius-sm); background: var(--toast-bg); color: var(--toast-text);
    font-size: var(--fs-2xs); font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-md);
    animation: fade-in var(--dur-fast) var(--ease);
  }
}

.backdrop { position: fixed; inset: 0; z-index: 19; display: none; background: var(--scrim); animation: fade-in var(--dur) var(--ease); }
.only-mobile { display: none !important; }
.show-compact { display: none !important; }

/* ============================================================ motion */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes pulse { 50% { opacity: 0.45; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* ============================================================ touch */
@media (pointer: coarse) {
  .icon-btn { width: 42px; height: 42px; }
  .icon-btn.small { width: 38px; height: 38px; }
  .folder, .nav-link { height: 44px; }
  .menu-item { min-height: 46px; }
  .message .star-btn { opacity: 1; width: 34px; height: 34px; }
  .segmented button { height: 32px; }
  .btn.small { height: 36px; }
}

/* ============================================================ responsive */
/* Large desktops: a little more room for the list. */
@media (min-width: 1600px) {
  :root { --list-w: 500px; --sidebar-w: 272px; }
}

/* Laptops and tablets: icon rail sidebar; the menu button expands it as a drawer. */
@media (max-width: 1180px) {
  :root { --sidebar-w: 80px; --list-w: 380px; }
  .show-compact { display: inline-flex !important; }
  .hide-narrow { display: none !important; }
  .topbar-brand { width: auto; padding-left: 0; }
  .app { grid-template-columns: var(--sidebar-w) minmax(300px, var(--list-w)) minmax(0, 1fr); }

  .app:not(.menu-open) .sidebar { align-items: center; padding: var(--space-2) var(--space-2) var(--space-3); }
  .app:not(.menu-open) .sidebar .nav-label,
  .app:not(.menu-open) .sidebar .folder-name,
  .app:not(.menu-open) .sidebar .sidebar-label,
  .app:not(.menu-open) .sidebar .sidebar-foot,
  .app:not(.menu-open) .sidebar .badge.muted { display: none; }
  .app:not(.menu-open) .compose-btn { width: 56px; height: 56px; padding: 0; justify-content: center; align-self: center; }
  .app:not(.menu-open) .folders { width: 100%; justify-items: center; }
  .app:not(.menu-open) .folder,
  .app:not(.menu-open) .nav-link { width: 56px; height: 44px; padding: 0; justify-content: center; border-radius: var(--radius-lg); }
  .app:not(.menu-open) .folder .badge {
    position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px;
    box-shadow: 0 0 0 2px var(--bg);
  }
  .app:not(.menu-open) .sidebar-sep { width: 32px; margin: var(--space-2) auto; }

  .app.menu-open .backdrop { display: block !important; }
  .app.menu-open .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 20; width: 292px; max-width: 86vw;
    padding: var(--space-3); background: var(--panel); box-shadow: var(--shadow-xl);
    border-radius: 0 var(--radius-2xl) var(--radius-2xl) 0; animation: drawer-in var(--dur-slow) var(--ease);
  }
  .app.menu-open .sidebar-brand { display: flex; }
  .app.menu-open .compose-btn { align-self: stretch; }
  .reader-body { padding: 4px var(--space-6) var(--space-8); }
}
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: none; } }

/* Phones and narrow windows: one pane at a time, off-canvas sidebar, full-screen compose. */
@media (max-width: 860px) {
  :root { --topbar-h: 58px; }
  .only-mobile { display: inline-flex !important; }
  .hide-mobile { display: none !important; }

  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-brand { display: flex; }
  .login-main {
    align-items: start; padding: var(--space-12) var(--space-5) var(--space-8);
    background: radial-gradient(120% 60% at 50% -10%, var(--accent-soft), transparent 70%), var(--panel);
  }

  .app, .app.contacts-mode {
    grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--topbar-h) minmax(0, 1fr);
    grid-template-areas: "top" "main";
  }
  .list-pane, .reader-pane, .contacts-pane { grid-area: main; margin: 0; border: none; border-radius: 0; box-shadow: none; }
  .list-pane { border-top: 1px solid var(--border); }
  .reader-pane { display: none; }
  .app.reading .reader-pane { display: block; }
  .app.reading .list-pane { display: none; }

  .topbar { gap: var(--space-2); padding: 0 var(--space-2); background: var(--panel); }
  .topbar-brand { display: none; }
  .search { height: 44px; }
  .account { margin-left: 2px; }

  /* The drawer: hidden off-canvas until the menu opens. */
  .app:not(.menu-open) .sidebar { display: none; }

  .list-head { padding: var(--space-2) var(--space-3) 0; }
  .list-tools > .check { margin-left: 18px; }
  .bulk-bar { flex: 1 1 auto; }
  .bulk-count { margin-right: 2px; padding: 3px 8px; }
  .bulk-bar .select { flex: 1 1 112px; min-width: 56px; max-width: 120px; }
  .messages { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  .message { margin: 0; border-radius: 0; padding-left: 20px; padding-right: var(--space-4); border-bottom: 1px solid var(--border); }
  .message.selected { box-shadow: none; }
  .skeleton { margin: 0; }
  .group-head { padding-left: 20px; }

  .reader-bar { padding: 8px var(--space-2); min-height: 56px; gap: 2px; flex-wrap: nowrap; }
  .reader-bar .bar-group { gap: 0; }
  .move-select { flex-basis: 120px; width: 120px; }
  .reader-body { padding: 0 var(--space-4) calc(var(--space-12) + env(safe-area-inset-bottom, 0px)); }
  .subject { font-size: 20px; margin: var(--space-4) 0; }
  .details { margin-left: 0; }
  .body-html { height: 65vh; min-height: 300px; }
  .quick-reply .btn { flex: 1 1 auto; }

  .contacts-pane .list-head { position: sticky; }
  .contact-grid { padding: var(--space-3); }

  .fab { display: grid; }
  .app.reading .fab, .app.menu-open .fab { display: none; }

  .compose, .compose.maximized {
    inset: 0; width: 100%; max-width: none; height: 100%; height: 100dvh; transform: none;
    border: none; border-radius: 0; box-shadow: none;
  }
  .compose-head, .compose.maximized .compose-head { border-radius: 0; min-height: 54px; padding-top: env(safe-area-inset-top, 0px); }
  .compose.minimized { inset: auto 0 0 0; height: auto; border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-xl); }
  .compose.minimized .compose-head { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
  .compose-body { padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); }
  .suggestions { left: var(--space-3); right: var(--space-3); }
  .attachment-chips .name { max-width: 150px; }

  .settings-row, .shortcuts { grid-template-columns: 1fr; }
  .dialog { padding: var(--space-5); }
  .toast { left: var(--space-3); right: var(--space-3); bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px)); transform: none; max-width: none; animation-name: fade-in; }
  .app:not([hidden]):not(.reading) ~ .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 420px) {
  .segmented button { padding: 0 10px; }
  .attachment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .attachment-thumb { height: 90px; }
  .dialog-actions .btn { flex: 1; }
}

/* ============================================================ behaviour polish */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Tooltips: right-aligned variant for controls near the right edge; none on disabled controls. */
@media (hover: hover) {
  [data-tip][data-tip-align="end"]:hover::after, [data-tip][data-tip-align="end"]:focus-visible::after { left: auto; right: 0; transform: none; }
  [data-tip]:disabled:hover::after, [data-tip][aria-expanded="true"]::after { display: none; }
}

/* Reader "More" menu. */
.menu-wrap { position: relative; flex: none; }
.more-menu { right: 0; top: calc(100% + 6px); width: 270px; max-width: calc(100vw - 24px); }
.menu .mobile-sep { display: none; }
.menu-item > span:not(.icon):not([data-icon]) { flex: none; }

/* Loading and error states. */
.reader-loading .reader-bar { position: static; }
.sk-btn { width: 86px; height: 32px; border-radius: var(--radius-pill); }
.sk-icon { width: 34px; height: 34px; border-radius: 50%; }
.sk-subject { height: 26px; width: 68%; margin: var(--space-6) 0 var(--space-5); }
.sk-sender { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-8); }
.sk-avatar { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.sk-sender-lines, .sk-paragraph { display: grid; gap: 11px; flex: 1; }
.sk-line { display: block; height: 11px; border-radius: 6px; }
.sk-w25 { width: 25%; } .sk-w40 { width: 40%; } .sk-w50 { width: 50%; } .sk-w75 { width: 75%; }
.sk-w85 { width: 85%; } .sk-w90 { width: 90%; } .sk-w95 { width: 95%; }
.empty-icon.error-icon { background: var(--danger-soft); color: var(--danger); box-shadow: 0 0 0 8px color-mix(in srgb, var(--danger-soft) 55%, transparent); }
.empty-state .btn { margin-top: var(--space-3); }
.empty-actions { display: flex; gap: var(--space-2); justify-content: center; }
.list-retry-row { display: flex; justify-content: center; padding: var(--space-3); }

/* Busy buttons (sending, saving). */
.btn.busy { pointer-events: none; opacity: 0.85; }
.btn.busy .icon { display: none; }
.btn.busy::before {
  content: ""; width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 2px solid color-mix(in srgb, currentColor 35%, transparent); border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
}

/* Compose attachment summary. */
.attach-summary { margin: 6px 0 0; font-size: var(--fs-xs); color: var(--muted); }
.attach-summary.warn { color: var(--warn-text); }
.compose-status.saved { color: var(--success, var(--muted)); }

/* Keyboard focus inside the list moves row to row (roving tabindex). */
.message:focus-visible { background: var(--hover); }

@media (max-width: 860px) {
  .menu .mobile-sep { display: block; }
}

/* Printing a message: only the reader. */
@media print {
  html, body, .app { height: auto !important; overflow: visible !important; background: #fff !important; color: #000; }
  .app { display: block !important; }
  .topbar, .sidebar, .backdrop, .list-pane, .contacts-pane, .reader-bar, .quick-reply, .fab, .toast,
  .compose, .body-switch, #images-banner, #details-toggle, .reader-empty, .attachment-thumb, .attachment-info .icon-btn { display: none !important; }
  .reader-pane { display: block !important; overflow: visible !important; border: none !important; box-shadow: none !important; margin: 0 !important; }
  .reader-body { max-width: none; padding: 0; animation: none; }
  .details { margin-left: 0; }
  .body-html { height: 90vh; border: none; }
}
