/* Arcana — design system and components. No framework; tokens drive light/dark. */

/* Brand: Arcana lime #D6FF3F, charcoal #0B0B0B, bone #F4F4F3. Syne for headings, Avenir for text. */
:root {
  /* Avenir where the device has it (Mac, iPhone); otherwise Nunito Sans, a free near-twin (Windows, Android). */
  --font: 'Avenir Next', Avenir, 'Nunito Sans Variable', 'Inter Variable', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Syne Variable', Syne, var(--font);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --lime: #d6ff3f;
  --charcoal: #0b0b0b;
  --bone: #f4f4f3;

  --bg: var(--bone);
  --bg-sunken: #ebebe8;
  /* The top bar and the rail around the panes. */
  --chrome: #eeeeeb;
  --surface: #ffffff;
  --surface-2: #fafaf8;
  --hover: #efefec;
  --active: #e6e6e2;
  /* What's picked (a row, a folder, an app): a quiet fill, no colour. */
  --selected: #e8e8e4;
  --inverse: #ffffff;
  /* Soft form fields (event editor): a light wash instead of a box. */
  --field: rgba(11, 11, 11, 0.045);
  --surface-solid: #ffffff;
  --border: #e5e5e1;
  --border-strong: #d3d3cd;
  --text: var(--charcoal);
  /* Secondary text stays easy to read (high contrast): 2 for details, 3 for hints and times. */
  --text-2: #3d3d38;
  --text-3: #66665f;
  /* --accent is a fill (buttons, badges, today) with --accent-fg on it; --accent-text is for accent-coloured text. */
  --accent: var(--lime);
  --accent-hover: #cbf52d;
  --accent-fg: var(--charcoal);
  --accent-text: #4f6b00;
  --accent-soft: #f1ffc2;
  --accent-soft-text: #3d5300;
  /* The accent as a thin line: line icons, indicator bars, focus rings. */
  --accent-line: #6c9a00;
  --danger: #d92d20;
  --danger-soft: #fdecea;
  --warn: #b45309;
  --warn-soft: #fdf3e2;
  --success: #15803d;
  --success-soft: #e8f6ec;
  --unread: #5f8200;
  --focus: 0 0 0 2px color-mix(in srgb, var(--accent-line) 45%, transparent);
  /* Line icons: thin strokes, each kind in its own colour (rail, command bar, settings). */
  --stroke: 1.3; /* thin, sharp line icons */
  --tone-blue: #2f6fed;
  --tone-teal: #0f9488;
  --tone-orange: #e5672d;
  --tone-amber: #d49100;
  --tone-red: #d9463b;
  --tone-green: #1f9a60;
  --tone-violet: #7657ea;
  --tone-pink: #d23f7c;
  --tone-slate: #64748b;
  --shadow-sm: 0 1px 2px rgba(11, 11, 11, 0.06);
  --shadow-md: 0 4px 16px rgba(11, 11, 11, 0.08), 0 1px 3px rgba(11, 11, 11, 0.06);
  --shadow-lg: 0 24px 64px rgba(11, 11, 11, 0.18), 0 4px 12px rgba(11, 11, 11, 0.08);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-xs: 5px;
  --sidebar-w: 256px;
  --rail-w: 56px;
  --myday-w: 300px;
  --list-w: 380px;
  /* Density (Settings → Display): list rows, their pictures, folder rows. */
  --row-pad: 12px;
  --row-avatar: 36px;
  --nav-h: 30px;
  color-scheme: light;
}

:root[data-theme='dark'] {
  /* Dark: soft graphite in layers — the window frame darkest, panes a step lighter, menus and cards lighter again. */
  --bg: #1c1d20;
  --bg-sunken: #161719;
  --chrome: #1c1d20;
  --surface: #26272b;
  --surface-2: #2f3035;
  --hover: #313338;
  --active: #3a3c42;
  --selected: #37393f;
  --inverse: #0b0b0b;
  --field: rgba(255, 255, 255, 0.07);
  --surface-solid: #2f3035;
  --border: #313338;
  --border-strong: #42444a;
  /* Real white for text, and brighter greys for the secondary lines: dark mode shouldn't look faded. */
  --text: #ffffff;
  --text-2: #e0e2e6;
  --text-3: #b4b7bd;
  --accent: var(--lime);
  --accent-hover: #e2ff72;
  --accent-fg: var(--charcoal);
  --accent-text: var(--lime);
  --accent-soft: #2b3312;
  --accent-soft-text: var(--lime);
  --accent-line: var(--lime);
  --danger: #ff7a6b;
  --danger-soft: #3a1714;
  --warn: #fbbf24;
  --warn-soft: #36280c;
  --success: #4ade80;
  --success-soft: #11291a;
  --unread: var(--lime);
  --focus: 0 0 0 2px rgba(214, 255, 63, 0.35);
  --tone-blue: #74a4ff;
  --tone-teal: #3cc8b9;
  --tone-orange: #ff9160;
  --tone-amber: #f2bb3c;
  --tone-red: #ff7d72;
  --tone-green: #52c98d;
  --tone-violet: #a891ff;
  --tone-pink: #ff7fae;
  --tone-slate: #9aa6b8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

:root[data-density='compact'] { --row-pad: 6px; --row-avatar: 28px; --nav-h: 26px; }
:root[data-density='roomy'] { --row-pad: 18px; --row-avatar: 44px; --nav-h: 34px; }
/* Compact: one line less per email (no preview); roomy: two lines of preview. */
:root[data-density='compact'] .thread-row .snip { display: none; }
:root[data-density='compact'] .thread-row .meta { margin-top: 3px; }
:root[data-density='roomy'] .thread-row .snip { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.thread-row .avatar-wrap .avatar { width: var(--row-avatar); height: var(--row-avatar); font-size: calc(var(--row-avatar) * 0.36); }
.thread-row .avatar-wrap .check { width: var(--row-avatar); height: var(--row-avatar); }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-xs); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scroll { overflow: auto; overscroll-behavior: contain; }
.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
.scroll::-webkit-scrollbar-track { background: transparent; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: var(--stroke); stroke-linecap: round; stroke-linejoin: round; shape-rendering: geometricPrecision; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 22px; height: 22px; }
svg.i.filled { fill: currentColor; }

/* ---- Buttons & inputs ------------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, transform 0.06s;
  user-select: none;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-fg); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 14.5px; }
.btn.icon { width: 32px; padding: 0; }
.btn.icon.sm { width: 28px; }
.btn.block { width: 100%; }
.btn.pill { border-radius: 999px; }
.btn .kbd { margin-left: 4px; }
.btn-group { display: inline-flex; }
.btn-group .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-group .btn:last-child { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(255, 255, 255, 0.25); padding: 0 8px; }

.input, .select, .textarea {
  width: 100%; height: 34px; padding: 0 11px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); transition: border-color 0.12s, box-shadow 0.12s;
}
.textarea { height: auto; min-height: 90px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent-line); box-shadow: var(--focus); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.pw-wrap { position: relative; display: block; }
.pw-wrap .input { padding-right: 40px; }
.pw-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 28px; padding: 0; background: none; border: 0; border-radius: 6px; color: var(--text-3); cursor: pointer; }
.pw-eye:hover { color: var(--text); background: var(--hover); }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e97' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.hint { font-size: 12.5px; color: var(--text-3); }
.hint.warn { color: var(--warn); }
.page-nav .release { margin: 14px 10px 4px; font-size: 11.5px; color: var(--text-3); }
.address-photo { gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.address-photo > .grow { flex: 1 1 160px; }
.address-photo .actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.address-photo:last-child { border-bottom: 0; }
.avatar-btn { border: 0; padding: 0; background: none; border-radius: 50%; cursor: pointer; line-height: 0; }
.avatar-btn:hover .avatar { box-shadow: 0 0 0 2px var(--accent); }
.hint:empty { display: none; }
.error-text { font-size: 13px; color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.switch { position: relative; width: 36px; height: 21px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-strong); transition: background 0.15s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(15px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }

.segmented { display: inline-flex; padding: 3px; background: var(--bg-sunken); border-radius: 10px; gap: 2px; border: 1px solid var(--border); }
.segmented button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 12.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.chip:hover { background: var(--hover); color: var(--text); }
.chip.on { background: var(--selected); border-color: var(--border-strong); color: var(--text); font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.badge { display: inline-flex; align-items: center; height: 19px; min-width: 19px; padding: 0 6px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent-soft-text); justify-content: center; font-variant-numeric: tabular-nums; }
.badge.plain { background: transparent; color: var(--text-3); font-weight: 500; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.success { background: var(--success-soft); color: var(--success); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 500; background: var(--bg-sunken); color: var(--text-2); white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.kbd { font-family: var(--font); font-size: 11px; font-weight: 500; color: var(--text-3); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; min-width: 18px; height: 19px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); }

/* ---- Avatars --------------------------------------------------------------------------------- */

.avatar { position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 620; font-size: 12.5px; letter-spacing: 0.01em; user-select: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.md { width: 36px; height: 36px; font-size: 13.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.avatar.xl { width: 88px; height: 88px; font-size: 30px; }
.avatar.square { border-radius: 10px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar + .avatar { margin-left: -7px; }

/* ---- App layout ------------------------------------------------------------------------------ */

#app { height: 100%; }
/* The arrangement: the top bar across the window, then rail | frame (command bar, then folder pane | main | My Day) */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 100%; background: var(--bg); }
.frame { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; }
.frame > .body { grid-row: 2; }
.body { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 0; position: relative; }
.shell.with-myday .body { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--myday-w); }
.shell.pane-off .body, .shell:not([data-section='mail']) .body { grid-template-columns: minmax(0, 1fr); }
.shell.pane-off.with-myday .body { grid-template-columns: minmax(0, 1fr) var(--myday-w); }
.shell.pane-off .sidebar, .shell:not([data-section='mail']) .sidebar { display: none; }
.myday { display: none; }
.shell.with-myday .myday { display: flex; }
.sidebar { display: flex; flex-direction: column; min-height: 0; padding: 12px 10px 10px; gap: 6px; background: var(--bg); border-right: 1px solid var(--border); }
.sidebar-top { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: -0.01em; font-size: 15px; }
.brand-lockup { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { width: 28px; height: auto; flex: none; display: block; color: var(--charcoal); }
:root[data-theme='dark'] .brand-logo { color: var(--lime); }
.brand-name { display: flex; align-items: center; min-width: 0; color: var(--text); }
.brand-name .wordmark { height: 11px; width: auto; display: block; }
.auth-card .brand-name .wordmark { height: 13px; }
.brand-text { font-family: var(--font-display); font-weight: 700; }
.list-title h1, .cal-head h1, .page-body h1, .auth-card h1, .convo-inner > h2 { font-family: var(--font-display); letter-spacing: -0.01em; }
.auth-card .brand-logo { width: 34px; }
.app-switch { display: grid; grid-template-columns: 1fr 1fr; margin: 0 2px 6px; }
.app-switch button { justify-content: center; }
.compose-btn { margin: 2px 2px 8px; height: 38px; font-size: 14px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-section { margin-top: 14px; padding: 0 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; justify-content: space-between; }
.nav-section button { background: none; border: 0; color: var(--text-3); cursor: pointer; padding: 2px; border-radius: 4px; display: inline-flex; }
.nav-section button:hover { color: var(--text); background: var(--hover); }
.nav a, .nav button.nav-item { display: flex; align-items: center; gap: 10px; height: var(--nav-h); padding: 0 10px; border-radius: var(--radius-sm); color: var(--text); font-weight: 400; text-decoration: none; border: 0; background: none; width: 100%; cursor: pointer; text-align: left; font-size: 13.5px; }
.nav a > svg, .nav button.nav-item > svg { color: var(--text-2); }
.nav a:hover, .nav button.nav-item:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: var(--selected); color: var(--text); font-weight: 600; }
.nav a.on > svg { color: var(--accent-line); }
.nav a .badge { margin-left: auto; }
.nav a .count { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nav a.unread-strong { color: var(--text); font-weight: 600; }
.nav a.unread-strong .count { color: var(--accent-text); font-weight: 600; }
/* Unread counts in the folder pane: a coloured number, not a pill. */
.nav .badge, .pane-head .badge { background: none; color: var(--accent-text); padding: 0 2px; min-width: 0; }
.nav .indent { padding-left: 28px; }
.sidebar-scroll { flex: 1; min-height: 0; margin: 0 -10px; padding: 0 10px; }
.sidebar-foot { border-top: 1px solid var(--border); padding-top: 8px; display: flex; align-items: center; gap: 8px; }
.me-btn { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; padding: 6px; border-radius: var(--radius-sm); border: 0; background: none; cursor: pointer; text-align: left; }
.me-btn:hover { background: var(--hover); }
.me-btn .n { font-weight: 500; font-size: 13px; }
.me-btn .e { font-size: 11.5px; color: var(--text-3); }

.main { min-width: 0; min-height: 0; display: flex; background: var(--bg); }

/* Mail: list + reader */
/* The list gives up width (down to 300px) before the reading pane goes below 360px. */
.mail { display: grid; grid-template-columns: minmax(260px, var(--list-w)) minmax(320px, 1fr); width: 100%; min-height: 0; }
.list-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); background: var(--surface); }
.list-head { padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--border); }
.list-title { display: flex; align-items: center; gap: 8px; }
.list-title h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; z-index: 1; }
.search .input { padding-left: 34px; height: 34px; background: var(--bg-sunken); border-color: transparent; }
.search .input:focus { background: var(--surface); }
.search .kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.search-face { display: none; }
@media (min-width: 761px) {
  .appbar-search .search-face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--text-2); font-size: 14px; pointer-events: none; }
  .appbar-search .search-face svg { position: static; transform: none; color: var(--text-2); }
  .appbar-search:has(.input:placeholder-shown):not(:focus-within) > svg, .appbar-search:has(.input:placeholder-shown):not(:focus-within) > .kbd { visibility: hidden; }
  .appbar-search:has(.input:placeholder-shown):not(:focus-within) .input::placeholder { color: transparent; }
  .appbar-search:focus-within .search-face, .appbar-search:has(.input:not(:placeholder-shown)) .search-face { display: none; }
}
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.bulkbar { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.bulkbar .count { font-weight: 500; font-size: 13px; color: var(--text); margin-right: auto; padding-left: 4px; }

.threads { flex: 1; min-height: 0; }
.thread-row { position: relative; display: grid; grid-template-columns: var(--row-avatar) 1fr; gap: 11px; padding: var(--row-pad) 14px var(--row-pad) 12px; cursor: pointer; border-bottom: 1px solid var(--border); background: var(--surface); outline: none; }
.thread-row:hover { background: var(--hover); }
.thread-row.selected { background: var(--selected); }
.thread-row.cursor::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-line); }
.thread-row .avatar-wrap { position: relative; padding-top: 1px; }
.thread-row .check { position: absolute; inset: 1px 0 0 0; width: 36px; height: 36px; border-radius: 50%; display: none; align-items: center; justify-content: center; background: var(--surface); border: 1.5px solid var(--border-strong); }
.thread-row:hover .check, .thread-row.checked .check, .threads.selecting .check { display: flex; }
.thread-row.checked .check { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.thread-row .l1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.thread-row .who { font-size: 13.5px; font-weight: 400; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-row .n { color: var(--text-3); font-size: 12px; font-weight: 500; }
.thread-row .when { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.thread-row .subj { font-size: 13.5px; color: var(--text); margin-top: 1px; }
.thread-row .snip { font-size: 13px; color: var(--text-3); margin-top: 1px; }
.thread-row .meta { display: flex; align-items: center; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.thread-row .meta:empty { display: none; }
.thread-row .icons { display: inline-flex; gap: 4px; color: var(--text-3); }
.thread-row .icons .star { color: #f59e0b; }
.thread-row.unread .who, .thread-row.unread .subj { font-weight: 600; }
.thread-row.unread .when { color: var(--unread); font-weight: 600; }
.thread-row.unread::after { content: ''; position: absolute; left: 4px; top: calc(var(--row-pad) + 13px); width: 6px; height: 6px; border-radius: 50%; background: var(--unread); }
.acct { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-3); max-width: 190px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.acct .dot { width: 7px; height: 7px; }
.hover-actions { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); display: none; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 2px; box-shadow: var(--shadow-md); }
.thread-row:hover .hover-actions { display: flex; }
.thread-row:hover .when { visibility: hidden; }

.list-empty { padding: 60px 30px; text-align: center; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.list-empty .art { width: 64px; height: 64px; border-radius: 50%; border: 1px solid var(--border-strong); color: var(--accent-line); display: grid; place-items: center; margin-bottom: 4px; }
.list-empty .art svg { width: 28px; height: 28px; }
.list-empty h3 { margin: 0; color: var(--text); font-size: 15px; font-weight: 600; }
.list-more { padding: 14px; display: flex; justify-content: center; }
.skeleton { background: linear-gradient(90deg, var(--hover) 25%, var(--active) 37%, var(--hover) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Reader */
.reader { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.reader-empty { flex: 1; display: grid; place-items: center; color: var(--text-3); text-align: center; padding: 40px; }
.reader-empty .stack { align-items: center; gap: 8px; }
.toolbar { display: flex; align-items: center; gap: 2px; padding: 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface); min-height: 50px; }
.toolbar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; }
.reader-body { flex: 1; min-height: 0; display: flex; }
.convo { flex: 1; min-width: 0; padding: 22px 28px 60px; }
/* The conversation uses the whole reading pane (no empty bands either side when My Day is closed). */
.convo-inner { max-width: none; margin: 0; }
.convo h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 6px; line-height: 1.3; word-wrap: break-word; }
.convo-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.msg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.msg-head { display: flex; gap: 12px; padding: 14px 16px; cursor: pointer; align-items: flex-start; }
.msg-head .who { font-weight: 600; font-size: 14px; }
.msg-head .addr { color: var(--text-3); font-size: 12.5px; }
.msg-head .to { color: var(--text-3); font-size: 12.5px; margin-top: 1px; }
.msg-head .to-lines { display: flex; flex-direction: column; gap: 1px; margin-top: 1px; }
.msg-head .to-lines .lbl { display: inline-block; min-width: 34px; color: var(--text-3); }
.msg-head .when { margin-left: auto; color: var(--text-3); font-size: 12.5px; white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.msg.collapsed .msg-head { padding: 11px 16px; }
.msg.collapsed .msg-snip { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.msg-body { padding: 0 16px 16px 64px; }
.msg-body .plain { white-space: pre-wrap; word-wrap: break-word; font-size: 14px; line-height: 1.6; }
.msg-body .quote-toggle { margin-top: 6px; }
.msg-frame { width: 100%; border: 0; display: block; min-height: 40px; background: #fff; border-radius: 8px; }
:root[data-theme='dark'] .msg-frame { border-radius: 8px; }
:root[data-mail-bg='dark'] .msg-frame { background: transparent; }
.banner { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--bg-sunken); color: var(--text-2); font-size: 13px; margin-bottom: 12px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.success { background: var(--success-soft); color: var(--success); }
.banner.accent { background: var(--surface-2); color: var(--text-2); box-shadow: inset 2px 0 0 var(--accent-line); }
.banner .btn { margin-left: auto; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.att { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); min-width: 0; max-width: 280px; color: var(--text); text-decoration: none; }
.att:hover { background: var(--hover); text-decoration: none; }
.att .ic { width: 34px; height: 34px; border-radius: 8px; background: var(--bg-sunken); color: var(--accent-line); display: grid; place-items: center; flex: none; }
.att .nm { font-size: 13px; font-weight: 500; }
.att .sz { font-size: 11.5px; color: var(--text-3); }
.att .x { margin-left: 4px; }
.reply-bar { display: flex; gap: 8px; margin-top: 16px; }

.invite-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; background: var(--surface); display: flex; gap: 14px; }
.cal-tile { width: 52px; flex: none; border-radius: 10px; overflow: hidden; background: var(--surface); border: 1px solid var(--border-strong); text-align: center; }
.cal-tile .m { color: var(--tone-red); font-size: 11px; font-weight: 600; text-transform: uppercase; padding: 3px 0 0; letter-spacing: 0.05em; }
.cal-tile .d { font-size: 20px; font-weight: 500; padding: 0 0 4px; }
.invite-card h4 { margin: 0 0 2px; font-size: 15px; }
.invite-warning { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: var(--warn-soft, rgba(234, 179, 8, 0.12)); color: var(--text); font-size: 12.5px; line-height: 1.45; }
.invite-warning .btn { flex-shrink: 0; }
.invite-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.invite-actions .btn.on { background: var(--selected); color: var(--accent-text); border-color: var(--accent-line); }

/* Team side panel */
.side-panel { width: 300px; flex: none; border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.side-panel h5 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); font-weight: 600; }
.side-section { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.note { display: flex; gap: 9px; }
.note .bubble { background: var(--warn-soft); border-radius: 4px 12px 12px 12px; padding: 8px 11px; font-size: 13px; white-space: pre-wrap; word-wrap: break-word; color: var(--text); }
.note .by { font-size: 11.5px; color: var(--text-3); margin-bottom: 3px; }
.note-input { display: flex; flex-direction: column; gap: 8px; }

/* ---- Composer -------------------------------------------------------------------------------- */

.composer-dock { position: fixed; right: 20px; bottom: 0; display: flex; gap: 14px; align-items: flex-end; z-index: 40; pointer-events: none; }
.composer { position: relative; pointer-events: auto; width: 700px; max-width: calc(100vw - 40px); height: min(640px, calc(100vh - 60px)); background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: 14px 14px 0 0; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.composer.min { height: 44px; width: 320px; }
.composer.max { position: fixed; inset: 4vh max(4vw, calc(50vw - 560px)); width: auto; height: auto; max-width: none; border-radius: 14px; border-bottom: 1px solid var(--border); z-index: 2; }
.composer-dock.dim::before { content: ''; position: fixed; inset: 0; background: rgba(12, 12, 16, 0.34); pointer-events: auto; }
/* A reply written right in the conversation, under the last message. */
.composer.inline { width: auto; max-width: none; height: auto; margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); overflow: visible; }
.composer.inline .composer-head { cursor: default; border-radius: 12px 12px 0 0; }
.composer.inline .editor { min-height: 190px; overflow: visible; }
.composer.inline > :last-child { border-radius: 0 0 12px 12px; }
.composer.inline .win-only, .composer:not(.inline) .inline-only { display: none !important; }
/* Writing a reply takes over the reader: actions + address fields pinned at the top, body scrolls. */
.convo.composing { padding: 0; overflow: hidden; height: 100%; min-height: 0; }
.convo.composing > .convo-inner { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.convo.composing > .convo-inner > :not(.reply-slot) { display: none; }
.convo.composing .reply-slot { flex: 1; min-height: 0; display: flex; }
.convo.composing .composer.inline { flex: 1; min-height: 0; margin: 0; border: 0; border-radius: 0; box-shadow: none; display: flex; flex-direction: column; }
.convo.composing .composer.inline .editor { flex: 1; min-height: 0; overflow: auto; }
.convo.composing .composer.inline .composer-head { display: none; }
.composer-head { display: flex; align-items: center; gap: 6px; padding: 0 8px 0 16px; height: 44px; border-bottom: 1px solid var(--border); cursor: pointer; background: var(--surface-2); flex: none; }
.composer-head .t { font-weight: 600; font-size: 13.5px; }
.cfield { display: flex; align-items: flex-start; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--border); min-height: 46px; flex: none; }
.cfield > .lbl { color: var(--text-2); font-size: 13px; font-weight: 500; width: 52px; flex: none; padding-top: 6px; }
.cfield > .lbl::after { content: ':'; }
.cfield input.bare, .cfield select.bare { border: 0; outline: none; background: transparent; flex: 1; min-width: 80px; height: 30px; padding: 0; }
.cfield select.bare { cursor: pointer; }
.cfield .bare:focus-visible, .editor:focus-visible { box-shadow: none; }
.recips { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; min-width: 0; position: relative; }
.recip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 4px 0 3px; border-radius: 999px; background: var(--bg-sunken); border: 1px solid var(--border); font-size: 13px; max-width: 100%; }
.recip.bad { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.recip button { border: 0; background: none; padding: 0; display: inline-flex; color: var(--text-3); cursor: pointer; border-radius: 50%; }
.recip button:hover { color: var(--text); }
.suggest { position: absolute; top: calc(100% + 6px); left: 0; min-width: 320px; max-width: 420px; z-index: 5; }
.editor-toolbar { display: flex; gap: 1px; padding: 5px 10px; border-bottom: 1px solid var(--border); flex: none; flex-wrap: wrap; }
.editor-toolbar .btn { height: 28px; width: 30px; }
.editor { flex: 1; min-height: 120px; padding: 14px 16px; outline: none; line-height: 1.6; font-size: 14px; overflow: auto; word-wrap: break-word; }
.editor:empty::before { content: attr(data-placeholder); color: var(--text-3); pointer-events: none; }
.editor blockquote { margin: 8px 0 8px 2px; padding-left: 12px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.editor img { max-width: 100%; }
.editor .signature { color: var(--text-2); }
.composer-atts { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; border-top: 1px solid var(--border); flex: none; }
.composer-atts:empty { display: none; }
.composer-atts .att { padding: 5px 8px; max-width: 240px; }
.composer-atts .att .ic { width: 26px; height: 26px; }
.composer-atts .link-days { flex-basis: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 12.5px; color: var(--text-2); }
.composer-atts .link-days .select { width: auto; height: 28px; font-size: 12.5px; }
.composer-actions { display: flex; align-items: center; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--border); flex: none; }
.composer-actions .status { font-size: 12px; color: var(--text-3); margin-left: 6px; }
.composer-actions .cmd { height: 34px; padding: 0 11px; gap: 7px; font-size: 13.5px; border-radius: 9px; }
.composer-actions .cmd .lbl { display: inline; }
.composer-actions .cmd svg.i { width: 18px; height: 18px; }
.composer-actions .cmd svg { color: var(--text-2); }
/* Send: a compact, solid Arcana-lime button with its schedule caret, the same height as the commands beside it. */
.composer-actions .cmd-group { gap: 0; height: 34px; background: var(--accent); border-radius: 10px; padding: 0; margin-right: 8px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 2px rgba(11, 11, 11, 0.2); overflow: hidden; }
.composer-actions .cmd-group .cmd { height: 34px; color: var(--accent-fg); border-radius: 0; transition: background-color 0.12s; }
.composer-actions .cmd.send { padding: 0 14px 0 12px; gap: 7px; font-size: 13.5px; font-weight: 600; letter-spacing: 0.01em; }
.composer-actions .cmd.send svg.i { width: 17px; height: 17px; }
.composer-actions .cmd.send svg, .composer-actions .cmd.caret svg { color: var(--accent-fg); }
.composer-actions .cmd.caret { padding: 0 8px; border-left: 1px solid color-mix(in srgb, var(--accent-fg) 16%, transparent); }
.composer-actions .cmd.caret svg.i { width: 15px; height: 15px; }
.composer-actions .cmd-group .cmd:hover { background: var(--accent-hover); }
.composer-actions .cmd-group .cmd:active { background: color-mix(in srgb, var(--accent-fg) 10%, var(--accent)); }
.composer-actions .cmd-group .cmd:disabled { opacity: 0.6; cursor: default; }
.composer-actions .cmd.danger:hover { color: #d92d20; background: color-mix(in srgb, #d92d20 12%, transparent); }
.composer-actions .cmd.danger:hover svg { color: #d92d20; }
.composer-actions .cmd .kbd { margin-left: 2px; opacity: 0.6; font-size: 11px; }
/* The command bar always fits its window: on a narrower composer the buttons drop their words (the name shows on
   hover), and if it's narrower still they wrap onto a second line rather than disappearing off the edge. */
.composer, .ribbon { container-type: inline-size; }
.composer-actions.cmdbar { flex-wrap: wrap; overflow: visible; row-gap: 4px; }
@container (max-width: 940px) {
  .composer-actions .cmd:not(.send):not(.caret) .lbl { display: none; }
  .composer-actions .cmd:not(.send):not(.caret) { padding: 0 10px; }
}
.drop-hint { position: absolute; inset: 44px 0 0 0; display: grid; place-items: center; background: color-mix(in srgb, var(--accent-soft) 85%, transparent); border: 2px dashed var(--accent); border-radius: 0 0 12px 12px; color: var(--accent-soft-text); font-weight: 600; pointer-events: none; }

/* ---- Menus, popovers, modals, toasts -------------------------------------------------------- */

.menu { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; min-width: 200px; max-height: 70vh; overflow: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: left; color: var(--text); font-size: 13.5px; }
.menu-item:hover, .menu-item.active { background: var(--hover); }
.menu-item .r { margin-left: auto; color: var(--text-3); font-size: 12px; }
.menu-item.danger { color: var(--danger); }
.menu-item svg { color: var(--text-2); }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }
/* Smart compose: the suggested words, in grey after the cursor, with a small "Tab" key hint. */
.sc-ghost { color: var(--text-3); pointer-events: none; -webkit-user-select: none; user-select: none; white-space: pre-wrap; }
.sc-ghost::after { content: 'Tab'; display: inline-block; margin-left: 6px; padding: 0 5px; border: 1px solid var(--border-strong); border-radius: 4px; font-size: 10px; line-height: 15px; vertical-align: 1px; color: var(--text-3); font-family: var(--font, inherit); }
.menu-label { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.menu .sug { height: auto; padding: 7px 10px; }
.menu .sug .e { font-size: 12px; color: var(--text-3); }
.popover-layer { position: fixed; z-index: 90; }

.overlay { position: fixed; inset: 0; background: rgba(10, 10, 14, 0.42); backdrop-filter: blur(2px); z-index: 80; display: grid; place-items: center; padding: 20px; animation: fade 0.14s ease; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.modal.wide { max-width: min(720px, calc(100vw - 32px)); }
/* Nothing inside a dialog may push it wider than itself (no sideways scrolling, at any zoom). */
.modal-body { overflow-x: hidden; }
.modal-body :is(.stack, .field, .row, .grid) { min-width: 0; }
.modal-body :is(.input, .select, .textarea) { min-width: 0; max-width: 100%; }
.modal-body .row > * { min-width: 0; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 6px; }
.modal-head h3 { margin: 0; font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; }
.modal-body { padding: 10px 18px 16px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(0.985); } }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #1c1c21; color: #f4f4f5; padding: 10px 10px 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13.5px; min-width: 260px; max-width: calc(100vw - 32px); animation: toastIn 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
:root[data-theme='dark'] .toast { background: #2a2a31; }
.toast .act { margin-left: auto; background: none; border: 0; color: #b4afff; font-weight: 650; cursor: pointer; padding: 6px 10px; border-radius: 7px; }
.toast .act:hover { background: rgba(255, 255, 255, 0.08); }
.toast .ring { position: relative; width: 24px; height: 24px; flex: none; display: inline-flex; }
.toast .ring svg { width: 100%; height: 100%; display: block; }
.toast .ring .num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1; color: #f4f4f5; }
.toast.error { background: #3b1111; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ---- Calendar -------------------------------------------------------------------------------- */

.cal { display: grid; grid-template-columns: var(--cal-side-w, 250px) 1fr; width: 100%; min-height: 0; position: relative; }
.cal-side { border-right: 1px solid var(--border); background: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 16px; min-height: 0; overflow: auto; }
.mini { user-select: none; }
.mini-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
/* The small month: the days on screen are a rounded band on each week's row; today is a circle. */
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); column-gap: 0; row-gap: 4px; text-align: center; }
.mini-grid .dow { font-size: 11px; color: var(--text-3); font-weight: 500; padding: 3px 0; }
.mini-grid button { border: 0; background: none; height: 30px; padding: 0; cursor: pointer; font-size: 12.5px; color: var(--text); font-variant-numeric: tabular-nums;
  position: relative; display: grid; place-items: center; border-radius: 0; }
.mini-grid button > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.mini-grid button:hover > span { background: var(--hover); }
.mini-grid button.other { color: var(--text-3); }
.mini-grid button.sel { background: var(--selected); }
.mini-grid button.sel-first { border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.mini-grid button.sel-last { border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
.mini-grid button.today > span { background: var(--accent); color: var(--accent-fg); font-weight: 600; }
.mini-grid button.has::after { content: ''; position: absolute; bottom: 1px; left: 50%; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; transform: translateX(-50%); }
.mini-grid button.today.has::after { bottom: 0; }
.add-cal { justify-content: flex-start; width: 100%; color: var(--accent-text); padding: 0 6px; margin-top: -6px; }
.add-cal svg { color: var(--accent-line); }
/* Sections you can fold, each with Show all / Hide all / Move up or down the list. */
.cal-groups { display: flex; flex-direction: column; gap: 6px; }
.cal-section { display: flex; align-items: center; gap: 2px; }
.cal-section-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px; border: 0; background: none; border-radius: var(--radius-sm);
  color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left; }
.cal-section-toggle:hover { background: var(--hover); }
.cal-section-toggle > svg { color: var(--text-3); flex: none; }
.cal-section > .btn { opacity: 0; }
.cal-section:hover > .btn, .cal-section > .btn:focus-visible { opacity: 1; }
.cal-list { display: flex; flex-direction: column; gap: 1px; padding-left: 14px; }
.cal-empty { padding: 2px 6px 4px; }
.cal-item { display: flex; align-items: center; gap: 9px; padding: 4px 6px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px; }
.cal-item:hover { background: var(--hover); }
.cal-item > .btn { opacity: 0; }
.cal-item:hover > .btn { opacity: 1; }
/* Round checkmarks in the calendar's colour. */
.cal-item .box { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--c); display: grid; place-items: center; flex: none; background: transparent; }
.cal-item .box.on { background: var(--c); }
.cal-item .box svg { width: 11px; height: 11px; stroke: #fff; stroke-width: 3.2; }
/* A teammate's busy time: grey, striped, no details. */
.ev.person { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, var(--surface)) 0 6px, color-mix(in srgb, var(--c) 6%, var(--surface)) 6px 12px);
  border-left-color: var(--c); color: var(--text-2); }
.ev.person .t { font-weight: 500; }
.chipev.person { color: var(--text-2); }
.cal-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
.cal-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); min-height: 56px; flex-wrap: wrap; }
.cal-head h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; min-width: 180px; }
.week { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.week-cols { display: grid; grid-template-columns: var(--cols, 66px repeat(var(--days), 1fr)); }
.week-headrow { border-bottom: 1px solid var(--border); }
.week-headrow .dh { padding: 8px 6px 6px; text-align: center; border-left: 1px solid var(--border); }
.week-headrow .dh .d1 { font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.week-headrow .dh .d2 { font-size: 21px; font-weight: 500; line-height: 1.3; font-variant-numeric: tabular-nums; }
/* Today: the date in a circle, on its own line like the other days (the weather goes under it). */
.week-headrow .dh.today .d2 { color: var(--accent-fg); background: var(--accent); border-radius: 50%; width: 38px; height: 38px; margin: 0 auto;
  display: grid; place-items: center; line-height: 1; font-weight: 600; font-size: 19px; }
.allday-row { border-bottom: 1px solid var(--border); min-height: 28px; }
.allday-row .cell { border-left: 1px solid var(--border); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.allday-row .lab { font-size: 11px; color: var(--text-3); text-align: right; padding: 6px 8px 0 0; }
.week-scroll { flex: 1; min-height: 0; overflow: auto; position: relative; }
.week-grid { position: relative; }
.hour-labels { position: relative; }
.hour-labels .hl-short { display: none; }
.hour-labels div { height: var(--hour, 52px); font-size: 11px; white-space: nowrap; color: var(--text-3); text-align: right; padding-right: 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
/* Hour lines, lighter lines for the time scale, and shade outside working hours (Settings → Work schedule). */
.day-col {
  position: relative; border-left: 1px solid var(--border); cursor: crosshair;
  --off: color-mix(in srgb, var(--text) 4.5%, transparent);
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--hour, 52px) - 1px), var(--border) calc(var(--hour, 52px) - 1px) var(--hour, 52px)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--slot, 52px) - 1px), color-mix(in srgb, var(--border) 50%, transparent) calc(var(--slot, 52px) - 1px) var(--slot, 52px)),
    linear-gradient(to bottom, var(--off) 0 var(--ws, 0px), transparent var(--ws, 0px) var(--we, 100%), var(--off) var(--we, 100%));
}
.day-col.today { background-color: color-mix(in srgb, var(--accent-soft) 35%, transparent); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: #ef4444; z-index: 3; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }
.ev { position: absolute; border-radius: 7px; padding: 3px 7px; font-size: 12px; line-height: 1.3; overflow: hidden; cursor: pointer; z-index: 2; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--text); box-shadow: 0 0 0 1px var(--surface); }
.ev:hover { background: color-mix(in srgb, var(--c) 24%, var(--surface)); }
.ev .t { font-weight: 600; }
.ev .tm { color: var(--text-2); font-size: 11.5px; }
.ev.tentative { background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--c) 10%, transparent) 6px 12px); }
.ev.declined, .ev.cancelled { opacity: 0.55; text-decoration: line-through; }
.ev.needs { border-style: dashed; border-width: 1px 1px 1px 3px; border-color: var(--c); background: var(--surface); }
.ev.ghost { background: color-mix(in srgb, var(--accent) 22%, transparent); border-left-color: var(--accent); pointer-events: none; }
.chipev { display: flex; align-items: center; gap: 6px; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 12px; cursor: pointer; background: color-mix(in srgb, var(--c) 16%, var(--surface)); border-left: 3px solid var(--c); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chipev.timed { background: none; border-left: 0; padding-left: 3px; }
.chipev.timed::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.month { flex: 1; display: grid; grid-template-rows: auto 1fr; min-height: 0; }
.month-dows { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); }
.month-dows div { padding: 8px; font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; min-height: 0; }
.month-cell { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 5px; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.month-cell:hover { background: var(--surface-2); }
.month-cell .num { font-size: 12.5px; font-weight: 500; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.month-cell.other .num { color: var(--text-3); }
.month-cell.today .num { background: var(--accent); color: var(--accent-fg); }
.month-cell .more { font-size: 11.5px; color: var(--text-2); padding-left: 4px; font-weight: 500; }
.agenda { padding: 10px 0; }
.agenda-day { display: grid; grid-template-columns: 90px 1fr; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.agenda-day .d { font-weight: 600; }
.upcoming { display: flex; flex-direction: column; gap: 6px; }
.upcoming .u { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; padding: 6px; border-radius: 8px; cursor: pointer; }
.upcoming .u:hover { background: var(--hover); }
.upcoming .bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--c); flex: none; }
.fb-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; font-size: 12px; }
.fb-track { position: relative; height: 16px; background: var(--bg-sunken); border-radius: 5px; overflow: hidden; }
.fb-track .busy { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--danger) 55%, transparent); }
.fb-track .mine { position: absolute; top: 0; bottom: 0; border: 2px solid var(--accent); border-radius: 4px; }

/* ---- Settings & admin ------------------------------------------------------------------------ */

.page { flex: 1; min-width: 0; display: grid; grid-template-columns: 220px 1fr; min-height: 0; }
.page-nav { border-right: 1px solid var(--border); padding: 18px 10px; background: var(--surface); }
.page-nav h2 { margin: 0 10px 12px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.page-body { padding: 28px 36px 80px; background: var(--bg); }
.page-body .inner { max-width: 760px; }
.page-body h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
.page-body > .inner > p.lead { margin: 0 0 24px; color: var(--text-2); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; }
.card-head { padding: 16px 18px 0; display: flex; align-items: center; gap: 10px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head p { margin: 2px 0 0; color: var(--text-2); font-size: 13px; }
/* A card that is only a title and a line (nothing under it) still gets its space at the bottom. */
.card-head:last-child { padding-bottom: 16px; }
.card-body { padding: 16px 18px 18px; }
.setting { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--border); }
.setting:first-child { border-top: 0; }
.setting .txt { flex: 1; min-width: 0; }
.setting .txt b { display: block; font-weight: 500; font-size: 13.5px; }
.setting .txt span { font-size: 12.5px; color: var(--text-3); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); font-weight: 600; padding: 10px 18px; border-bottom: 1px solid var(--border); }
.table td { padding: 11px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13.5px; }
.table tr:last-child td { border-bottom: 0; }
.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .n { font-weight: 500; }
.person .e { font-size: 12px; color: var(--text-3); }
.cropper { position: relative; width: 280px; height: 280px; margin: 0 auto; border-radius: 16px; overflow: hidden; background: var(--bg-sunken); touch-action: none; cursor: grab; }
.cropper img { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; max-width: none; }
.cropper .mask { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 999px rgba(0, 0, 0, 0.45); border-radius: 50%; }
.cropper .ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(10, 10, 14, 0.5); pointer-events: none; }
.copybox { display: flex; gap: 6px; }
.copybox .input { font-family: var(--mono); font-size: 12px; }

/* ---- Auth ------------------------------------------------------------------------------------ */

.auth { min-height: 100%; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent 60%), radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, #8b5cf6 12%, transparent), transparent 60%), var(--bg); overflow: auto; height: 100%; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 30px 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.015em; }
.auth-card p { margin: 0; color: var(--text-2); }
.auth-card .brand { margin-bottom: 6px; }
.auth-card .auth-links { display: flex; gap: 14px; justify-content: center; font-size: 12.5px; }
.auth-card .auth-links a { color: var(--text-3, var(--text-2)); text-decoration: none; }
.auth-card .auth-links a:hover { text-decoration: underline; }
.otp { letter-spacing: 0.4em; font-size: 22px; text-align: center; font-variant-numeric: tabular-nums; height: 48px; }

/* ---- Mobile ---------------------------------------------------------------------------------- */

.mobile-only { display: none !important; }
.tabbar { display: none; }

/* Panes never sit on top of each other, at any window size or zoom (⌘+ / Ctrl+): as room runs out they get
   narrower, then the folder pane turns into a drawer (☰), and only in a really small window does My Day open over
   the mail. */
@media (max-width: 1440px) {
  :root { --sidebar-w: 228px; --myday-w: 272px; }
}
@media (max-width: 1180px) {
  :root { --list-w: 320px; --myday-w: 260px; }
  .shell.with-myday .body, .shell.pane-off.with-myday .body { grid-template-columns: minmax(0, 1fr) var(--myday-w); }
  .shell.with-myday .sidebar { display: none; }
  .shell.with-myday .sidebar.open { display: flex; position: absolute; left: 0; top: 0; bottom: 0; width: 280px; z-index: 40; box-shadow: var(--shadow-lg); }
  .side-panel { position: absolute; right: 0; top: 0; bottom: 0; box-shadow: var(--shadow-lg); z-index: 5; }
  .reader-body { position: relative; }
}

@media (max-width: 960px) {
  /* The folder pane becomes a drawer (☰) */
  .shell .body, .shell.with-myday .body, .shell.pane-off .body, .shell.pane-off.with-myday .body { grid-template-columns: minmax(0, 1fr); }
  /* Too small for three panes: My Day steps aside by itself, and the My Day button opens it as a drawer. */
  .shell.with-myday:not(.myday-peek) .myday { display: none; }
  .shell.with-myday.myday-peek .myday { position: absolute; right: 0; top: 0; bottom: 0; width: min(var(--myday-w), 92%); z-index: 30; box-shadow: var(--shadow-lg); }
  .shell .sidebar { display: none; }
  .shell .sidebar.open { display: flex; position: absolute; left: 0; top: 0; bottom: 0; width: 280px; z-index: 40; box-shadow: var(--shadow-lg); }
  .appbar { grid-template-columns: 1fr auto; }
  .appbar-brand { display: none; }
  .cal { grid-template-columns: 1fr; }
  .cal-side { display: none; }
  .page { grid-template-columns: 1fr; }
  .page-nav { display: flex; gap: 4px; padding: 10px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .page-nav h2 { display: none; }
  .page-nav .nav { flex-direction: row; }
  .page-nav .nav a { white-space: nowrap; }
}

@media (max-width: 760px) {
  body { overflow: auto; }
  .desktop-only { display: none !important; }
  .mobile-only { display: revert !important; }
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; height: 100dvh; }
  .rail, .appbar, .ribbon, .shell.with-myday .myday { display: none !important; }
  /* The Mac app in a narrow window: the top bar stays, as the window's title bar. */
  :root[data-native-inset='on'] .shell { grid-template-rows: auto minmax(0, 1fr) auto; }
  :root[data-native-inset='on'] .shell > .appbar { display: flex !important; }
  :root[data-native-inset='on'] .appbar-search, :root[data-native-inset='on'] .appbar-right { display: none; }
  /* The Windows app too: it's where the window's buttons are. */
  :root[data-native-frame='windows'] .shell { grid-template-rows: auto minmax(0, 1fr) auto; }
  :root[data-native-frame='windows'] .shell > .appbar { display: flex !important; min-height: 48px; }
  :root[data-native-frame='windows'] .appbar-search, :root[data-native-frame='windows'] .appbar-right { display: none; }
  .shell .sidebar.open { position: fixed; inset: 0 25% 0 0; width: auto; z-index: 70; }
  .mail { grid-template-columns: 1fr; }
  .mail.reading .list-pane { display: none; }
  .mail:not(.reading) .reader { display: none; }
  .list-pane { border-right: 0; }
  .convo { padding: 14px 12px 90px; }
  .msg-body { padding: 0 14px 14px; }
  .toolbar { padding: 6px 8px; overflow-x: auto; }
  .side-panel { width: 100%; }
  .composer-dock { right: 0; left: 0; }
  .composer:not(.inline), .composer.max { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; border-radius: 0; }
  .tabbar { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); background: var(--surface); padding-bottom: env(safe-area-inset-bottom); z-index: 30; }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; font-size: 11px; color: var(--text-3); text-decoration: none; font-weight: 500; }
  .tabbar a.on { color: var(--accent-line); }
  .fab { position: fixed; right: 18px; bottom: calc(70px + env(safe-area-inset-bottom)); width: 54px; height: 54px; border-radius: 18px; z-index: 31; box-shadow: var(--shadow-lg); }
  .page-body { padding: 18px 14px 90px; }
  .cal-head h1 { min-width: 0; font-size: 16px; }
  .week { --gutter: 44px; }
  .hour-labels .hl-full { display: none; }
  .hour-labels .hl-short { display: inline; }
  .allday-row .lab { font-size: 9.5px; padding: 7px 4px 0 0; }
  .modal { max-height: 100dvh; border-radius: 16px 16px 0 0; align-self: end; max-width: none; }
  .overlay { padding: 0; place-items: end stretch; }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
  /* Inside the iPhone app the web runs edge to edge (data-native-mobile, set by the wrapper): the app background fills
     the notch and home-indicator areas, and headers, the folder drawer, the full-screen composer and bottom sheets all
     stay clear of them. The bottom nav (.tabbar) already pads for the home indicator, so the shell only pads the top. */
  :root[data-native-mobile] .shell { box-sizing: border-box; padding-top: env(safe-area-inset-top); }
  :root[data-native-mobile] .shell .sidebar.open { box-sizing: border-box; padding-top: env(safe-area-inset-top); }
  :root[data-native-mobile] .composer:not(.inline), :root[data-native-mobile] .composer.max {
    box-sizing: border-box; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  :root[data-native-mobile] .modal { max-height: calc(100dvh - env(safe-area-inset-top)); padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box; }

  /* === Dedicated iPhone look: roomy rows, big tap targets, iOS typography — a native phone mail look, not the
     desktop layout shrunk down. Scoped to the app (data-native-mobile) so the responsive web and Mac app are untouched. */
  :root[data-native-mobile] { --row-avatar: 46px; }
  :root[data-native-mobile] .shell, :root[data-native-mobile] .list-pane { background: var(--surface); } /* clean solid app, not the glass backdrop */
  /* Nav bar: large iOS title, comfortable buttons, roomy rounded search. */
  :root[data-native-mobile] .list-head { padding: 4px 16px 12px; gap: 13px; border-bottom: 0; }
  :root[data-native-mobile] .list-title { gap: 10px; }
  :root[data-native-mobile] .list-title h1 { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; }
  :root[data-native-mobile] .list-sub { font-size: 13.5px; align-self: flex-end; padding-bottom: 3px; }
  :root[data-native-mobile] .list-head .btn.icon { width: 42px; height: 42px; border-radius: 12px; }
  :root[data-native-mobile] .list-head .btn.icon svg { width: 23px; height: 23px; }
  :root[data-native-mobile] .search .input { height: 42px; border-radius: 13px; font-size: 16px; padding-left: 42px; }
  :root[data-native-mobile] .search svg { left: 14px; width: 18px; height: 18px; }
  :root[data-native-mobile] .filters { gap: 8px; }
  :root[data-native-mobile] .filters .btn, :root[data-native-mobile] .filters .pill { height: 34px; padding: 0 16px; font-size: 14px; border-radius: 999px; }
  /* Roomy list rows: top-aligned avatar, bold sender, a 2-line preview, iOS inset separators. */
  :root[data-native-mobile] .thread-row { align-items: start; gap: 13px; padding: 13px 16px; border-bottom: 0; }
  :root[data-native-mobile] .thread-row::after { content: ''; position: absolute; left: calc(16px + var(--row-avatar) + 13px); right: 0; bottom: 0; height: 1px; background: var(--border); }
  :root[data-native-mobile] .thread-row:last-child::after, :root[data-native-mobile] .thread-row.selected::after { display: none; }
  :root[data-native-mobile] .thread-row .who { font-size: 16px; font-weight: 600; }
  :root[data-native-mobile] .thread-row.unread .who { font-weight: 700; }
  :root[data-native-mobile] .thread-row .when { font-size: 13.5px; }
  :root[data-native-mobile] .thread-row .subj { font-size: 15px; margin-top: 2px; line-height: 1.3; }
  :root[data-native-mobile] .thread-row .snip { font-size: 14px; margin-top: 2px; line-height: 1.35; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  :root[data-native-mobile] .list-group { font-size: 12.5px; padding: 12px 16px 6px; background: var(--surface); }
  /* iOS tab bar: taller, bigger icons, a frosted top hairline. */
  :root[data-native-mobile] .tabbar { padding-top: 9px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 86%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); }
  :root[data-native-mobile] .tabbar a { font-size: 11px; gap: 3px; padding: 2px 0 4px; }
  :root[data-native-mobile] .tabbar svg { width: 26px; height: 26px; }
  :root[data-native-mobile] .fab { width: 56px; height: 56px; border-radius: 18px; right: 16px; bottom: calc(64px + env(safe-area-inset-bottom)); }
  /* Reader: comfortable mobile reading size. */
  :root[data-native-mobile] .convo h2, :root[data-native-mobile] .convo-title h2 { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Command bar (open conversation) -------------------------------------------------------------- */

.reader { container-type: inline-size; container-name: reader; }
.cmdbar { gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.cmdbar::-webkit-scrollbar { display: none; }
/* Team panel and More stay in reach on the right while the groups scroll (phones, narrow windows). */
.cmd-end { display: flex; align-items: center; gap: 2px; flex: none; position: sticky; right: 0; padding-left: 8px; background: linear-gradient(to right, transparent, var(--surface) 8px); }
.cmd-group { display: flex; align-items: center; gap: 1px; padding: 0; flex: none; }
.cmd { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 9px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); cursor: pointer; font-size: 12.5px; font-weight: 400; white-space: nowrap; }
.cmd svg { color: var(--text-2); }
.cmd:hover { background: var(--hover); color: var(--text); }
.cmd.on { color: var(--text); background: var(--selected); }
.cmd.on svg { color: var(--accent-line); }
.cmd.urgent svg { color: #d92d20; }
.cmd.star.on svg { color: var(--tone-amber); }
@container reader (max-width: 860px) { .cmd .lbl { display: none; } .cmd { padding: 0 8px; } }

/* ---- List markers ------------------------------------------------------------------------------ */

.thread-row .pinned-ic { color: var(--tone-pink); }
.tag.followup { background: var(--warn-soft); color: var(--warn); }
.tag.opened { background: transparent; color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.banner.followup { background: var(--warn-soft); color: var(--warn); }
.banner.followup .grow { color: var(--text); }
.track-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); background: var(--bg-sunken); border-radius: 8px; padding: 6px 10px; margin: 2px 0 12px; }
.track-line.opened svg:first-child { color: var(--accent-line); }
/* Read status of your sent emails: grey eye until opened, then coloured. */
.read-eye { display: inline-flex; align-items: center; gap: 3px; flex: none; font-size: 11.5px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.read-eye.opened { color: var(--tone-blue); }
.msg-head .read-eye { padding: 2px 7px 2px 5px; border-radius: 999px; background: var(--bg-sunken); font-weight: 500; font-size: 12px; }
.msg-head .read-eye.opened { background: color-mix(in srgb, var(--tone-blue) 14%, transparent); }
.thread-row:hover .read-eye { visibility: hidden; }
.l1 .read-eye { margin-left: auto; }
.l1 .read-eye + .when { margin-left: 6px; }
body.dragging-mail .thread-row { cursor: grabbing; }

/* ---- Sidebar: theme, workspaces, drag targets ---------------------------------------------------- */

.sidebar-top .theme-btn { flex: none; }
.ws-head { display: flex; align-items: center; gap: 2px; border-radius: var(--radius-sm); }
.ws-head.on { background: var(--selected); }
.ws-head:hover { background: var(--hover); }
.ws-chevron { width: 22px; height: 30px; flex: none; display: grid; place-items: center; border: 0; background: none; color: var(--text-3); cursor: pointer; border-radius: 6px; }
.ws-chevron:hover { color: var(--text); }
.ws-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; height: 32px; padding: 0 8px 0 2px; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; text-align: left; }
.ws-head.on .ws-name, .ws-name:hover { color: var(--text); }
.ws-name .badge { margin-left: auto; }
.nav .drop-over, .nav a.drop-over { background: var(--accent-soft) !important; color: var(--accent-soft-text) !important; box-shadow: inset 0 0 0 1.5px var(--accent-text); }
.drop-before { box-shadow: inset 0 2px 0 var(--accent-text) !important; }
.drop-after { box-shadow: inset 0 -2px 0 var(--accent-text) !important; }
.accounts [draggable='true'] { cursor: pointer; }
.composer-actions .btn.on { color: var(--accent-line); background: var(--selected); }
.composer-actions .remind-lbl:empty { display: none; }
.composer-actions .remind-lbl { font-size: 12px; font-weight: 600; margin-left: 2px; }

/* ---- Settings: rich editors, signature toolbar, calendar pieces ----------------------------------- */

.rich-wrap { position: relative; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.rich-wrap .editor-toolbar { background: var(--surface-2); border-radius: 10px 10px 0 0; }
.editor.rich { min-height: 140px; max-height: 480px; overflow: auto; padding: 12px 14px; background: var(--surface); border-radius: 0 0 10px 10px; }

/* Formatting toolbar (lib/editor.js), shared by the composer, signatures and templates */
.rich-toolbar { align-items: center; gap: 2px; row-gap: 3px; }
.rich-toolbar .select.sm { width: auto; height: 28px; font-size: 12.5px; padding: 0 22px 0 8px; margin-right: 2px; max-width: 132px; }
.rich-toolbar .select.size { max-width: 70px; }
.rich-toolbar .tb-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.composer .rich-toolbar { padding: 4px 8px; }
.rich-toolbar .select.style { max-width: 104px; }
.rich-toolbar .btn.on { background: var(--selected); color: var(--text); }
.rich-toolbar .btn.recording { color: #d92d20; animation: recPulse 1.4s ease-in-out infinite; }
@keyframes recPulse { 50% { opacity: 0.45; } }
[contenteditable].painting, [contenteditable].painting * { cursor: copy; }
.tbl-picker { min-width: 0; padding: 10px; }
.tbl-label { font-size: 12.5px; color: var(--text-2); margin: 0 2px 8px; }
.tbl-grid { display: grid; grid-template-columns: repeat(8, 18px); gap: 3px; }
.tbl-cell { width: 18px; height: 18px; border: 1px solid var(--border-strong); border-radius: 3px; background: var(--surface); padding: 0; cursor: pointer; }
.tbl-cell.on { background: color-mix(in srgb, var(--accent) 45%, transparent); border-color: var(--accent); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 34px); gap: 2px; min-width: 0; padding: 8px; }
.emoji-btn { width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; font-size: 20px; cursor: pointer; line-height: 1; }
.emoji-btn:hover { background: var(--hover); }
.spell-menu { width: 320px; padding: 6px; }
.menu-toggle { display: flex; align-items: center; gap: 14px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.menu-toggle:hover { background: var(--hover); }
.menu-toggle .mt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.menu-toggle .mt-text span { font-size: 12px; color: var(--text-2); line-height: 1.35; }
.menu-sep { height: 1px; background: var(--border); margin: 5px 4px; }
.color-grid { padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.color-grid .swatches { display: grid; grid-template-columns: repeat(8, 22px); gap: 4px; }
.swatch-btn { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border-strong); cursor: pointer; padding: 0; }
.swatch-btn:hover { transform: scale(1.12); box-shadow: var(--shadow-sm); }
.color-grid .btn { justify-content: flex-start; }
.color-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.editor img { cursor: pointer; }
.editor img[data-uploading] { min-width: 80px; min-height: 48px; background: var(--bg-sunken); opacity: 0.6; }
.img-select { position: absolute; z-index: 6; pointer-events: none; outline: 2px solid var(--accent-text); outline-offset: 1px; border-radius: 2px; }
.img-handle { position: absolute; right: -7px; bottom: -7px; width: 13px; height: 13px; border-radius: 4px; background: var(--accent); border: 2px solid var(--charcoal); cursor: nwse-resize; pointer-events: auto; touch-action: none; }
.img-bar { position: absolute; z-index: 7; display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-md); white-space: nowrap; }
.img-bar .btn { height: 26px; min-width: 28px; padding: 0 7px; font-size: 12px; font-weight: 600; }
.img-bar .sep { width: 1px; height: 16px; background: var(--border); margin: 0 3px; }
.img-slider { width: 110px; accent-color: var(--accent-text); margin: 0 4px; }
.img-size { font-size: 11.5px; color: var(--text-3); min-width: 42px; font-variant-numeric: tabular-nums; }
.img-missing { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; margin: 2px 0; border: 1.5px dashed var(--border-strong); border-radius: 8px; color: var(--text-2); font-size: 12.5px; cursor: pointer; user-select: none; background: var(--bg-sunken); }
.img-missing:hover { border-color: var(--accent-text); color: var(--text); }
.sig-photo { padding: 12px 14px 0; background: var(--surface); }
.sig-photo img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; display: block; }
.sig-photo-opt { align-items: flex-start; gap: 10px; font-size: 13.5px; }
.sig-photo-opt input { margin-top: 3px; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--border-strong); margin: 0 4px; }
.subscribe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.subscribe-grid .btn { justify-content: flex-start; }
.hours { display: grid; gap: 6px; }
.hours-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hours-row .input { width: 120px; height: 32px; }
.howto { font-size: 13px; color: var(--text-2); background: var(--bg-sunken); border-radius: 8px; padding: 8px 12px; }
.howto summary { cursor: pointer; font-weight: 500; color: var(--text); }
.howto ol { margin: 8px 0 2px; padding-left: 20px; display: grid; gap: 4px; }
.booking-form .textarea { min-height: 70px; }

/* ---- Accent colours (Settings → Appearance) ---------------------------------------------------- */

:root[data-accent='blue'] { --accent: #2563eb; --accent-hover: #1d4ed8; --accent-fg: #fff; --accent-text: #1d4ed8; --accent-soft: #e7efff; --accent-soft-text: #1e40af; --unread: #1d4ed8; --accent-line: #2563eb; }
:root[data-accent='violet'] { --accent: #7c3aed; --accent-hover: #6d28d9; --accent-fg: #fff; --accent-text: #6d28d9; --accent-soft: #f1eaff; --accent-soft-text: #5b21b6; --unread: #6d28d9; --accent-line: #7c3aed; }
:root[data-accent='pink'] { --accent: #db2777; --accent-hover: #be185d; --accent-fg: #fff; --accent-text: #be185d; --accent-soft: #fde7f2; --accent-soft-text: #9d174d; --unread: #be185d; --accent-line: #db2777; }
:root[data-accent='orange'] { --accent: #ea580c; --accent-hover: #c2410c; --accent-fg: #fff; --accent-text: #c2410c; --accent-soft: #fff0e6; --accent-soft-text: #9a3412; --unread: #c2410c; --accent-line: #ea580c; }
:root[data-accent='red'] { --accent: #dc2626; --accent-hover: #b91c1c; --accent-fg: #fff; --accent-text: #b91c1c; --accent-soft: #fdecec; --accent-soft-text: #991b1b; --unread: #b91c1c; --accent-line: #dc2626; }
:root[data-accent='green'] { --accent: #16a34a; --accent-hover: #15803d; --accent-fg: #fff; --accent-text: #15803d; --accent-soft: #e7f7ed; --accent-soft-text: #166534; --unread: #15803d; --accent-line: #16a34a; }
:root[data-accent='mono'] { --accent: #0b0b0b; --accent-hover: #262626; --accent-fg: #fff; --accent-text: #0b0b0b; --accent-soft: #ececea; --accent-soft-text: #0b0b0b; --unread: #0b0b0b; --accent-line: #0b0b0b; }
:root[data-theme='dark'][data-accent='blue'] { --accent: #3b82f6; --accent-hover: #60a5fa; --accent-text: #8ab8ff; --accent-soft: #111c33; --accent-soft-text: #a8c7ff; --unread: #8ab8ff; --accent-line: #8ab8ff; }
:root[data-theme='dark'][data-accent='violet'] { --accent: #8b5cf6; --accent-hover: #a78bfa; --accent-text: #c4a6ff; --accent-soft: #1e1433; --accent-soft-text: #d4bfff; --unread: #c4a6ff; --accent-line: #c4a6ff; }
:root[data-theme='dark'][data-accent='pink'] { --accent: #ec4899; --accent-hover: #f472b6; --accent-text: #ff8cc6; --accent-soft: #2d1020; --accent-soft-text: #ffb3d9; --unread: #ff8cc6; --accent-line: #ff8cc6; }
:root[data-theme='dark'][data-accent='orange'] { --accent: #f97316; --accent-hover: #fb923c; --accent-text: #ffab70; --accent-soft: #2e1a0c; --accent-soft-text: #ffc79e; --unread: #ffab70; --accent-line: #ffab70; }
:root[data-theme='dark'][data-accent='red'] { --accent: #ef4444; --accent-hover: #f87171; --accent-text: #ff8a8a; --accent-soft: #2e1111; --accent-soft-text: #ffb3b3; --unread: #ff8a8a; --accent-line: #ff8a8a; }
:root[data-theme='dark'][data-accent='green'] { --accent: #22c55e; --accent-hover: #4ade80; --accent-text: #6ee7a0; --accent-soft: #0f2618; --accent-soft-text: #9ef0bf; --unread: #6ee7a0; --accent-line: #6ee7a0; }
:root[data-theme='dark'][data-accent='mono'] { --accent: #f4f4f3; --accent-hover: #ffffff; --accent-fg: #0b0b0b; --accent-text: #f4f4f3; --accent-soft: #1e1e1e; --accent-soft-text: #f4f4f3; --unread: #f4f4f3; --accent-line: #f4f4f3; }

/* ---- Background pictures and see-through panes (Settings → Appearance) --------------------------------- */

:root[data-backdrop='aurora'] { --backdrop: radial-gradient(1100px 700px at 8% -10%, #8ff0d8 0%, transparent 62%), radial-gradient(1000px 800px at 95% 5%, #b7a8ff 0%, transparent 60%), radial-gradient(900px 700px at 60% 110%, #9fd8ff 0%, transparent 60%), linear-gradient(160deg, #e3f7f4, #efe9ff); }
:root[data-backdrop='dusk'] { --backdrop: radial-gradient(1000px 600px at 80% -10%, #ffc7a8 0%, transparent 60%), radial-gradient(900px 700px at 0% 100%, #d7b4ff 0%, transparent 60%), linear-gradient(170deg, #fde8dc, #efe1ff); }
:root[data-backdrop='ocean'] { --backdrop: radial-gradient(1000px 600px at 0% 0%, #a9d8ff 0%, transparent 60%), radial-gradient(800px 600px at 100% 100%, #9ef0e0 0%, transparent 60%), linear-gradient(160deg, #e2f1ff, #def8f2); }
:root[data-backdrop='meadow'] { --backdrop: radial-gradient(1000px 600px at 90% 0%, #e7ff9a 0%, transparent 60%), radial-gradient(800px 600px at 0% 100%, #b5f0c8 0%, transparent 60%), linear-gradient(160deg, #f5ffe0, #e3f7ea); }
:root[data-backdrop='blush'] { --backdrop: radial-gradient(1000px 600px at 10% 0%, #ffc2dc 0%, transparent 60%), radial-gradient(800px 600px at 100% 100%, #ffd9c2 0%, transparent 60%), linear-gradient(160deg, #fff0f6, #fff3ea); }
:root[data-theme='dark'][data-backdrop='aurora'] { --backdrop: radial-gradient(1100px 700px at 8% -10%, #13675c 0%, transparent 62%), radial-gradient(1000px 800px at 95% 5%, #4a2fa3 0%, transparent 60%), radial-gradient(900px 700px at 60% 110%, #0e4a6b 0%, transparent 60%), linear-gradient(160deg, #06110f, #0f0b1c); }
:root[data-theme='dark'][data-backdrop='dusk'] { --backdrop: radial-gradient(1000px 600px at 80% -10%, #4a2213 0%, transparent 60%), radial-gradient(900px 700px at 0% 100%, #331a52 0%, transparent 60%), linear-gradient(170deg, #150b08, #110a1c); }
:root[data-theme='dark'][data-backdrop='ocean'] { --backdrop: radial-gradient(1000px 600px at 0% 0%, #0d2f52 0%, transparent 60%), radial-gradient(800px 600px at 100% 100%, #0c3d36 0%, transparent 60%), linear-gradient(160deg, #06101b, #051512); }
:root[data-theme='dark'][data-backdrop='meadow'] { --backdrop: radial-gradient(1000px 600px at 90% 0%, #2c3a07 0%, transparent 60%), radial-gradient(800px 600px at 0% 100%, #0e3320 0%, transparent 60%), linear-gradient(160deg, #0b0f03, #06130c); }
:root[data-theme='dark'][data-backdrop='blush'] { --backdrop: radial-gradient(1000px 600px at 10% 0%, #4a1030 0%, transparent 60%), radial-gradient(800px 600px at 100% 100%, #45200d 0%, transparent 60%), linear-gradient(160deg, #150810, #140b06); }
:root[data-backdrop='custom'] { --backdrop: var(--backdrop-image) center / cover no-repeat, var(--bg); }
/* Scenes (public/backdrops). Light scenes are dimmed in dark mode; night scenes are softened in light mode so dark text on the top bar stays readable. */
:root[data-backdrop='dunes'] { --backdrop: url(../backdrops/dunes.webp) center / cover no-repeat, #e4dfec; }
:root[data-theme='dark'][data-backdrop='dunes'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/dunes.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='still'] { --backdrop: url(../backdrops/still.webp) center / cover no-repeat, #8172b2; }
:root[data-theme='dark'][data-backdrop='still'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/still.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='shore'] { --backdrop: url(../backdrops/shore.webp) center / cover no-repeat, #8685aa; }
:root[data-theme='dark'][data-backdrop='shore'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/shore.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='beach'] { --backdrop: url(../backdrops/beach.webp) center / cover no-repeat, #b9bab2; }
:root[data-theme='dark'][data-backdrop='beach'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/beach.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='reflection'] { --backdrop: url(../backdrops/reflection.webp) center / cover no-repeat, #615c87; }
:root[data-theme='dark'][data-backdrop='reflection'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/reflection.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='tide'] { --backdrop: url(../backdrops/tide.webp) center / cover no-repeat, #54888d; }
:root[data-theme='dark'][data-backdrop='tide'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/tide.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='fog'] { --backdrop: url(../backdrops/fog.webp) center / cover no-repeat, #919993; }
:root[data-theme='dark'][data-backdrop='fog'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/fog.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='dock'] { --backdrop: url(../backdrops/dock.webp) center / cover no-repeat, #4a7a85; }
:root[data-theme='dark'][data-backdrop='dock'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/dock.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='tajmahal'] { --backdrop: url(../backdrops/tajmahal.webp) center / cover no-repeat, #b2a192; }
:root[data-theme='dark'][data-backdrop='tajmahal'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/tajmahal.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='greatwall'] { --backdrop: url(../backdrops/greatwall.webp) center / cover no-repeat, #726c61; }
:root[data-theme='dark'][data-backdrop='greatwall'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/greatwall.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='petra'] { --backdrop: url(../backdrops/petra.webp) center / cover no-repeat, #865c48; }
:root[data-theme='dark'][data-backdrop='petra'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/petra.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='redeemer'] { --backdrop: url(../backdrops/redeemer.webp) center / cover no-repeat, #4c5058; }
:root[data-theme='dark'][data-backdrop='redeemer'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/redeemer.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='machupicchu'] { --backdrop: url(../backdrops/machupicchu.webp) center / cover no-repeat, #788188; }
:root[data-theme='dark'][data-backdrop='machupicchu'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/machupicchu.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='chichenitza'] { --backdrop: url(../backdrops/chichenitza.webp) center / cover no-repeat, #66809a; }
:root[data-theme='dark'][data-backdrop='chichenitza'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/chichenitza.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='colosseum'] { --backdrop: url(../backdrops/colosseum.webp) center / cover no-repeat, #597f94; }
:root[data-theme='dark'][data-backdrop='colosseum'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/colosseum.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='giza'] { --backdrop: url(../backdrops/giza.webp) center / cover no-repeat, #bfb7a5; }
:root[data-theme='dark'][data-backdrop='giza'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/giza.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='mist'] { --backdrop: url(../backdrops/mist.webp) center / cover no-repeat, #dfe7f2; }
:root[data-theme='dark'][data-backdrop='mist'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/mist.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='sunset'] { --backdrop: url(../backdrops/sunset.webp) center / cover no-repeat, #f7dccf; }
:root[data-theme='dark'][data-backdrop='sunset'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/sunset.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='lake'] { --backdrop: url(../backdrops/lake.webp) center / cover no-repeat, #e0dcea; }
:root[data-theme='dark'][data-backdrop='lake'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/lake.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='pines'] { --backdrop: url(../backdrops/pines.webp) center / cover no-repeat, #dfe9e3; }
:root[data-theme='dark'][data-backdrop='pines'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/pines.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='glacier'] { --backdrop: url(../backdrops/glacier.webp) center / cover no-repeat, #e3edf7; }
:root[data-theme='dark'][data-backdrop='glacier'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/glacier.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='night'] { --backdrop: linear-gradient(rgba(244, 242, 248, 0.5), rgba(244, 242, 248, 0.5)), url(../backdrops/night.webp) center / cover no-repeat, #141a3a; }
:root[data-theme='dark'][data-backdrop='night'] { --backdrop: url(../backdrops/night.webp) center / cover no-repeat, #141a3a; }
:root[data-backdrop='curves'] { --backdrop: url(../backdrops/curves.webp) center / cover no-repeat, #ecebe8; }
:root[data-theme='dark'][data-backdrop='curves'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/curves.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='pastel'] { --backdrop: url(../backdrops/pastel.webp) center / cover no-repeat, #dfe6e2; }
:root[data-theme='dark'][data-backdrop='pastel'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/pastel.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='timber'] { --backdrop: url(../backdrops/timber.webp) center / cover no-repeat, #e7d8c6; }
:root[data-theme='dark'][data-backdrop='timber'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/timber.webp) center / cover no-repeat, #15131b; }
:root[data-backdrop='brutalist'] { --backdrop: url(../backdrops/brutalist.webp) center / cover no-repeat, #e1e4e6; }
:root[data-theme='dark'][data-backdrop='brutalist'] { --backdrop: linear-gradient(rgba(12, 11, 20, 0.64), rgba(12, 11, 20, 0.64)), url(../backdrops/brutalist.webp) center / cover no-repeat, #15131b; }
.backdrop-tile.bd-dunes { background-image: url(../backdrops/dunes-thumb.webp); }
.backdrop-tile.bd-still { background-image: url(../backdrops/still-thumb.webp); }
.backdrop-tile.bd-shore { background-image: url(../backdrops/shore-thumb.webp); }
.backdrop-tile.bd-beach { background-image: url(../backdrops/beach-thumb.webp); }
.backdrop-tile.bd-reflection { background-image: url(../backdrops/reflection-thumb.webp); }
.backdrop-tile.bd-tide { background-image: url(../backdrops/tide-thumb.webp); }
.backdrop-tile.bd-fog { background-image: url(../backdrops/fog-thumb.webp); }
.backdrop-tile.bd-dock { background-image: url(../backdrops/dock-thumb.webp); }
.backdrop-tile.bd-tajmahal { background-image: url(../backdrops/tajmahal-thumb.webp); }
.backdrop-tile.bd-greatwall { background-image: url(../backdrops/greatwall-thumb.webp); }
.backdrop-tile.bd-petra { background-image: url(../backdrops/petra-thumb.webp); }
.backdrop-tile.bd-redeemer { background-image: url(../backdrops/redeemer-thumb.webp); }
.backdrop-tile.bd-machupicchu { background-image: url(../backdrops/machupicchu-thumb.webp); }
.backdrop-tile.bd-chichenitza { background-image: url(../backdrops/chichenitza-thumb.webp); }
.backdrop-tile.bd-colosseum { background-image: url(../backdrops/colosseum-thumb.webp); }
.backdrop-tile.bd-giza { background-image: url(../backdrops/giza-thumb.webp); }
.backdrop-tile.bd-mist { background-image: url(../backdrops/mist-thumb.webp); }
.backdrop-tile.bd-sunset { background-image: url(../backdrops/sunset-thumb.webp); }
.backdrop-tile.bd-lake { background-image: url(../backdrops/lake-thumb.webp); }
.backdrop-tile.bd-pines { background-image: url(../backdrops/pines-thumb.webp); }
.backdrop-tile.bd-glacier { background-image: url(../backdrops/glacier-thumb.webp); }
.backdrop-tile.bd-night { background-image: url(../backdrops/night-thumb.webp); }
.backdrop-tile.bd-curves { background-image: url(../backdrops/curves-thumb.webp); }
.backdrop-tile.bd-pastel { background-image: url(../backdrops/pastel-thumb.webp); }
.backdrop-tile.bd-timber { background-image: url(../backdrops/timber-thumb.webp); }
.backdrop-tile.bd-brutalist { background-image: url(../backdrops/brutalist-thumb.webp); }
:root:not([data-backdrop='none']) .shell { background: var(--backdrop); }
:root:not([data-backdrop='none']) .appbar .brand-name { color: var(--text); }
:root[data-glass='on'] { --surface: rgba(255, 255, 255, 0.74); --surface-2: rgba(250, 250, 248, 0.62); --bg: rgba(244, 244, 243, 0.5); --bg-sunken: rgba(11, 11, 11, 0.05); --border: rgba(11, 11, 11, 0.08); --chrome: rgba(241, 241, 238, 0.62); --selected: rgba(11, 11, 11, 0.07); }
:root[data-theme='dark'][data-glass='on'] { --surface: rgba(38, 39, 43, 0.72); --surface-2: rgba(47, 48, 53, 0.62); --bg: rgba(28, 29, 32, 0.5); --bg-sunken: rgba(0, 0, 0, 0.3); --border: rgba(255, 255, 255, 0.07); --chrome: rgba(28, 29, 32, 0.62); --selected: rgba(255, 255, 255, 0.09); }
:root[data-glass='on'] .sidebar, :root[data-glass='on'] .list-pane, :root[data-glass='on'] .reader, :root[data-glass='on'] .myday,
:root[data-glass='on'] .page-nav, :root[data-glass='on'] .page-body { -webkit-backdrop-filter: blur(26px) saturate(1.4); backdrop-filter: blur(26px) saturate(1.4); }
:root[data-glass='on'] .thread-row { background: transparent; }

/* ---- Text size (Settings → Display) --------------------------------------------------------------------- */

/* --ts: the text size; --app-zoom: pinching outside the email; --mail-zoom: pinching over the email (lib/pinch.js). */
:root { --ts: 1; --app-zoom: 1; --mail-zoom: 1; }
:root[data-text-size='smaller'] { --ts: 0.9; }
:root[data-text-size='larger'] { --ts: 1.12; }
:root[data-text-size='largest'] { --ts: 1.25; }
.frame, .composer-dock { zoom: calc(var(--ts) * var(--app-zoom)); }
.reader .convo-inner { zoom: var(--mail-zoom); }
/* Email frames are taken back out of those zooms: Safari and the Mac app enlarge a frame's box but not the page inside
   it, which left emails shrunk with an uncovered (white) edge. The email is enlarged inside its frame instead (mail.js). */
.msg-frame { zoom: calc(1 / (var(--ts) * var(--app-zoom) * var(--mail-zoom))); }

/* ---- Rail (far left): line icons, each app in its own colour ------------------------------------------ */

.rail { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 10px; background: var(--chrome); min-height: 0; overflow-y: auto; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail-group { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rail-sep { width: 24px; height: 1px; background: var(--border-strong); margin: 6px 0; flex: none; }
.rail-btn { position: relative; width: 40px; height: 40px; flex: none; border-radius: 8px; display: grid; place-items: center; border: 0; background: none; color: var(--ic, var(--text-2)); cursor: pointer; padding: 0; }
.rail-btn:hover { background: var(--hover); text-decoration: none; }
.rail-btn.on { background: var(--selected); }
.rail-btn.on::before { content: ''; position: absolute; left: -8px; top: 11px; bottom: 11px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ic, var(--accent-line)); }
.rail-btn svg { width: 19px; height: 19px; }
.rail-btn.on:not(.me) { color: var(--accent-line); }
.rail .ws-tile:not(.photo) { color: inherit; }
.rail .ws-tile.has-icon { box-shadow: none; width: 22px; height: 22px; }
.rail .ws-tile:not(.photo):not(.has-icon) { box-shadow: inset 0 0 0 1.25px currentColor; border-radius: 6px; font-size: 11.5px; }
.rail .ws-tile.has-icon svg { width: 19px; height: 19px; }
.rail .rail-btn.on .ws-tile:not(.photo) { background: none; }
.tone-blue { --ic: var(--tone-blue); }
.tone-teal { --ic: var(--tone-teal); }
.tone-orange { --ic: var(--tone-orange); }
.tone-amber { --ic: var(--tone-amber); }
.tone-violet { --ic: var(--tone-violet); }
.rail-btn.add { border: 1px dashed var(--border-strong); width: 32px; height: 32px; border-radius: 50%; color: var(--text-3); }
/* A workspace: its initial as a line tile in its colour, or its picture. */
.ws-tile { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--c-line, var(--c)); box-shadow: inset 0 0 0 1.5px var(--c-line, var(--c)); font-weight: 600; font-size: 12px; }
.ws-tile.photo { object-fit: cover; box-shadow: none; }
.rail-btn.on .ws-tile:not(.photo) { background: color-mix(in srgb, var(--c) 14%, transparent); }
.ws-tile.has-icon svg { width: 15px; height: 15px; }
/* Workspace dialog: preview, picture, icon grid */
.ws-preview { width: 56px; height: 56px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--bg-sunken); }
.ws-preview .ws-tile { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; }
.ws-preview .ws-tile.has-icon svg { width: 20px; height: 20px; }
.ws-icons { display: grid; grid-template-columns: repeat(auto-fill, 36px); gap: 6px; }
.ws-icon-pick { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text-2); cursor: pointer; padding: 0; }
.ws-icon-pick:hover { border-color: var(--border-strong); color: var(--text); }
.ws-icon-pick.on { border-color: var(--accent-line); color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent-line); }
.ws-letter { font-weight: 600; font-size: 14px; }
:root[data-theme='dark'] :is(.ws-tile, .set-tile) { --c-line: color-mix(in srgb, var(--c) 62%, #fff); }
/* Unread count: a small pill in the accent colour on the button's corner. */
.rail-badge { position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-size: 9px; font-weight: 600; line-height: 1; display: grid; place-items: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 1.5px var(--chrome); pointer-events: none; }
.rail-dot { position: absolute; top: 9px; right: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--unread); }
.rail-btn.me .avatar { width: 28px; height: 28px; }
.rail .drop-before { box-shadow: 0 -3px 0 var(--accent-line); }
.rail .drop-after { box-shadow: 0 3px 0 var(--accent-line); }

/* ---- Top bar (search) and command bar ------------------------------------------------------------------- */

/* Across the whole window. In the Mac app it is the title bar: the traffic lights sit in it (room for them:
   --lights-w, set by the app) and pressing on its empty parts moves the window. */
.shell > .appbar { grid-column: 1 / -1; }
.appbar { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(220px, 600px) minmax(120px, 1fr); align-items: center; gap: 14px; height: 48px; padding: 0 12px 0 18px; background: var(--chrome); -webkit-user-select: none; user-select: none; }
:root[data-native-inset='on'] .appbar { padding-left: max(16px, calc(var(--lights-w, 80px) + 6px)); }
.appbar-brand { display: flex; align-items: center; color: var(--text); min-width: 0; }
.appbar-brand .brand-logo { width: 24px; }
.appbar-brand .brand-lockup { gap: 12px; }
.appbar-search .input { height: 34px; font-size: 14px; background: var(--surface); border-color: var(--border); border-radius: 10px; }
/* The search dropdown (views/searchbox.js): recent searches, then people, mail, files and events as you type. */
.search-drop { position: absolute; top: calc(100% + 6px); left: -40px; right: -40px; z-index: 120; display: flex; flex-direction: column; max-height: min(560px, calc(100vh - 80px)); background: var(--surface-solid); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; color: var(--text); text-align: left; -webkit-app-region: no-drag; app-region: no-drag; }
.search-drop[hidden] { display: none; }
.search-drop svg { position: static; transform: none; color: currentColor; pointer-events: auto; }
.sd-tabs { display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--border); flex: none; }
.sd-tab { border: 0; background: none; color: var(--text-2); font: inherit; font-size: 13px; padding: 7px 10px 9px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sd-tab:hover { color: var(--text); }
.sd-tab.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.sd-body { overflow-y: auto; padding: 4px 0; min-height: 0; }
.sd-head { padding: 10px 14px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-3); }
.sd-row { display: flex; align-items: center; gap: 12px; padding: 7px 14px; cursor: pointer; min-height: 40px; }
.sd-row:hover, .sd-row.hover { background: var(--hover); }
.sd-icon { width: 26px; height: 26px; flex: none; display: grid; place-items: center; color: var(--text-2); }
.sd-text { min-width: 0; flex: 1; }
.sd-main { font-size: 14px; }
.sd-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.sd-row .btn { flex: none; opacity: 0; }
.sd-row:hover .btn, .sd-row.hover .btn { opacity: 1; }
.sd-empty { padding: 16px 14px; color: var(--text-2); font-size: 13px; }
.sd-all { border-top: 1px solid var(--border); flex: none; }
.search-drop .kbd { position: static; transform: none; flex: none; }
@media (max-width: 960px) { .search-drop { left: 0; right: 0; } }
.appbar-right { display: flex; justify-content: flex-end; gap: 2px; }
.appbar-right .btn.icon { width: 34px; height: 34px; }

/* The Windows app: no Windows title bar, so the top bar is the title bar — it moves the window, and
   has Windows' minimize / maximize / close at the far right. See js/lib/winframe.js. */
.wincaps, .win-drag, .win-edge { display: none; }
:root[data-native-frame='windows'] .appbar { padding-right: 150px; -webkit-app-region: drag; app-region: drag; }
:root[data-native-frame='windows'] .appbar :is(button, a, input, select, label, [role='button'], .search) { -webkit-app-region: no-drag; app-region: no-drag; }
:root[data-native-frame='windows'] .wincaps { display: flex; position: fixed; top: 0; right: 0; height: 48px; z-index: 2147483000; -webkit-app-region: no-drag; app-region: no-drag; }
.wincap { width: 46px; height: 100%; border: 0; border-radius: 0; padding: 0; background: transparent; color: var(--text); display: grid; place-items: center; cursor: default; transition: background-color 0.1s; }
.wincap:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }
.wincap:active { background: color-mix(in srgb, var(--text) 6%, transparent); }
.wincap.close:hover { background: #c42b1c; color: #fff; }
.wincap.close:active { background: #c84031; color: #fff; }
:root[data-win-active='off'] .wincap:not(:hover) { color: var(--text-3); }
/* Pages without the top bar (sign-in, set-up): a strip along the top still moves the window. */
:root[data-native-frame='windows'] body:not(:has(.shell)) .win-drag { display: block; position: fixed; top: 0; left: 0; right: 138px; height: 40px; z-index: 2147482999; -webkit-app-region: drag; app-region: drag; }
/* Resizing from the top edge, which the page now covers. Not while maximized. */
:root[data-native-frame='windows']:not([data-win-max='on']) .win-edge { display: block; position: fixed; top: 0; height: 4px; z-index: 2147483001; -webkit-app-region: no-drag; app-region: no-drag; }
.win-edge.top { left: 8px; right: 8px; cursor: n-resize; }
.win-edge.top-left { left: 0; width: 8px; cursor: nw-resize; }
.win-edge.top-right { right: 0; width: 8px; cursor: ne-resize; }
/* Anything that can sit over the top bar takes clicks itself instead of moving the window. */
:root[data-native-frame='windows'] :is(.overlay, .popover-layer, .menu, .toasts, .help-callout, .update-pill, .composer-dock, .sidebar.open) { -webkit-app-region: no-drag; app-region: no-drag; }
/* The update button sits left of the window's buttons. */
:root[data-native-frame='windows'] .update-pill { right: 230px; }
.myday-toggle.on { color: var(--accent-line); background: var(--selected); }
.ribbon { display: flex; align-items: center; gap: 4px; padding: 5px 10px; background: var(--surface); border-bottom: 1px solid var(--border); min-width: 0; -webkit-user-select: none; user-select: none; }
/* While writing a reply, the ribbon hosts the compose actions, aligned over the reader. */
.ribbon.composing { gap: 0; }
.ribbon .rb-left { display: flex; align-items: center; gap: 4px; flex: none; overflow: hidden; }
.ribbon.composing .composer-actions { flex: 1; min-width: 0; border: 0; padding: 0; background: transparent; }
.ribbon.composing .composer-actions .cmd { height: 34px; }
.ribbon .new-email { height: 32px; padding: 0 13px 0 11px; flex: none; gap: 7px; }
.ribbon .new-email svg, .new-event svg { color: var(--accent-line); }
.rb { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 9px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font-size: 13px; font-weight: 400; cursor: pointer; white-space: nowrap; flex: none; }
/* Every command's icon in the same colour, from the theme (no rainbow of icons). */
.rb > svg:first-child { color: var(--text-2); width: 17px; height: 17px; }
.rb:hover:not(:disabled) { background: var(--hover); }
.rb:disabled { opacity: 0.4; cursor: default; }
.rb.on { background: var(--selected); }
.rb .chev { width: 12px; height: 12px; margin-left: -3px; color: var(--text-3); }
.rb.icon-only { padding: 0; width: 32px; justify-content: center; }
/* Each command's line icon in its own colour. */
.rb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 6px; flex: none; }
.rb-items { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow: hidden; }
.rb-items.no-labels .lbl, .rb-items.compact .lbl { display: none; }
.rb-items.no-labels .rb, .rb-items.compact .rb { padding: 0 8px; }
.rb-selected { display: inline-flex; align-items: center; gap: 2px; padding: 0 3px 0 11px; height: 30px; border-radius: 15px; background: var(--selected); color: var(--text); font-size: 12.5px; font-weight: 500; flex: none; margin-right: 6px; }
.rb-selected .btn { color: inherit; }

/* ---- Folder pane ---------------------------------------------------------------------------------------- */

.pane-head { display: flex; align-items: center; margin-top: 10px; border-radius: var(--radius-sm); }
.sidebar-scroll > .pane-head:first-child { margin-top: 2px; }
.pane-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 8px 0 4px; border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; border-radius: var(--radius-sm); }
.pane-toggle:hover { background: var(--hover); }
.pane-toggle > svg:first-child { color: var(--text-3); flex: none; }
.pane-head.account .pane-toggle { font-weight: 500; }
.pane-toggle .badge { margin-left: auto; }
.pane-children { padding-left: 12px; }
.pane-caption { margin: 18px 10px 0; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-3); }
.nav-row { position: relative; }
.nav-row .fav-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border: 0; border-radius: 6px; background: var(--surface); color: var(--text-3); cursor: pointer; display: none; place-items: center; }
.nav-row:hover .fav-toggle { display: grid; }
.nav-row:hover a .count, .nav-row:hover a .badge { visibility: hidden; }
.fav-toggle.on, .fav-toggle:hover { color: var(--tone-amber); }
.fav-toggle svg.filled { fill: currentColor; }
.nav a .caption { display: block; font-size: 11px; color: var(--text-3); font-weight: 480; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; }
.nav a:has(.caption) { height: 40px; }
.pane-tip { margin: 18px 8px 4px; font-size: 12px; color: var(--text-3); display: flex; gap: 6px; align-items: flex-start; line-height: 1.35; }
.pane-head.drop-before { box-shadow: inset 0 2px 0 var(--accent-line); }
.pane-head.drop-after { box-shadow: inset 0 -2px 0 var(--accent-line); }
.pane-mobile { margin-bottom: 6px; }

/* ---- Mail list and reader extras ----------------------------------------------------------------------- */

.list-sub { font-size: 12px; color: var(--text-3); margin-left: 4px; min-width: 0; }
.list-group { position: sticky; top: 0; z-index: 2; padding: 6px 14px 5px; font-size: 11.5px; font-weight: 600; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--border); letter-spacing: 0.02em; }
.chip-sep { width: 1px; background: var(--border); margin: 3px 2px; flex: none; }
.threads.no-avatars .thread-row { grid-template-columns: 20px 1fr; }
.threads.no-avatars .thread-row .avatar { display: none; }
.threads.no-avatars .thread-row .check { width: 18px; height: 18px; inset: 2px 0 0 0; }
.threads.no-preview .thread-row .snip { display: none; }
.mail[data-pane='bottom'] { grid-template-columns: 1fr; grid-template-rows: minmax(180px, 42%) minmax(0, 1fr); }
.mail[data-pane='bottom'] .list-pane { border-right: 0; border-bottom: 1px solid var(--border); }
.mail[data-pane='off'] { grid-template-columns: 1fr; }
.mail[data-pane='off'].reading .list-pane { display: none; }
.mail[data-pane='off']:not(.reading) .reader { display: none; }
.convo-title { display: flex; align-items: flex-start; gap: 12px; }
.convo-title h2 { flex: 1; min-width: 0; }
.convo-actions { display: flex; gap: 2px; flex: none; margin-top: 2px; }
.convo-back { display: none; }
.mail[data-pane='off'] .convo-back { display: inline-flex; }
@media (min-width: 761px) {
  .reader > .reader-bar { display: none; }
  .bulkbar { display: none !important; }
}

/* ---- My Day ------------------------------------------------------------------------------------------- */

.myday { flex-direction: column; min-height: 0; border-left: 1px solid var(--border); background: var(--surface); }
.myday-head { display: flex; align-items: center; gap: 2px; padding: 10px 8px 6px 14px; }
.myday-head h3 { margin: 0; font: 600 15px/1.2 var(--font-display); white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.myday-head > * { flex-shrink: 0; }
.myday-head > h3 { flex-shrink: 0; overflow: visible; }
/* The month is never cut off: the year goes first when the panel is narrow, then the controls tighten up. */
.myday-head { container-type: inline-size; }
.myday-head .md-year { color: var(--text-3); font-weight: 500; }
.myday-head .btn.icon.sm { width: 28px; padding: 0; }
.myday-head .btn.ghost.sm:not(.icon) { padding: 0 8px; }
@container (max-width: 320px) { .myday-head .md-year { display: none; } }
@container (max-width: 250px) { .myday-head .btn.ghost.sm:not(.icon) { padding: 0 4px; font-size: 12px; } .myday-head .btn.icon.sm { width: 24px; } }
.myday { min-width: 0; overflow: hidden; }
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 2px 10px 10px; border-bottom: 1px solid var(--border); }
.mini-dow { text-align: center; font-size: 11px; font-weight: 500; color: var(--text-3); padding: 2px 0 4px; }
.mini-day { position: relative; width: 30px; height: 30px; justify-self: center; border: 0; border-radius: 50%; background: none; font-size: 12.5px; cursor: pointer; color: var(--text); font-variant-numeric: tabular-nums; padding: 0; }
.mini-day:hover { background: var(--hover); }
.mini-day.other { color: var(--text-3); }
.mini-day.today { background: var(--accent); color: var(--accent-fg); font-weight: 600; }
.mini-day.sel:not(.today) { box-shadow: inset 0 0 0 1px var(--accent-line); font-weight: 600; }
.mini-dot { position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent-text); }
.mini-day.today .mini-dot { background: var(--accent-fg); }
.myday-body { flex: 1; min-height: 0; padding: 0 0 20px; }
.ag-day-title { display: flex; align-items: center; gap: 6px; padding: 10px 14px 6px; font-size: 12.5px; color: var(--text-2); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.ag-day-title b { color: var(--accent-text); }
.ag-empty { padding: 2px 14px 8px; font-size: 13px; color: var(--text-3); }
.ag-event { display: flex; align-items: center; gap: 10px; margin: 2px 8px; padding: 7px 8px; border-radius: 10px; color: var(--text); }
.ag-event:hover { background: var(--hover); text-decoration: none; }
.ag-bar { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }
.ag-title { font-weight: 500; font-size: 13.5px; }
.ag-when { font-size: 12px; color: var(--text-3); }
.ag-event.declined .ag-title { text-decoration: line-through; color: var(--text-3); }
.ag-event.tentative .ag-bar { opacity: 0.45; }
.ag-join { height: 26px; padding: 0 9px; font-size: 12px; flex: none; gap: 4px; }
.wx { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dv { padding: 8px 10px 0 4px; }
.dv-col { position: relative; margin-left: 52px; border-left: 1px solid var(--border); }
.dv-hour { position: absolute; left: -52px; right: 0; border-top: 1px solid var(--border); }
.dv-hour span { position: absolute; left: 0; top: -8px; width: 46px; text-align: right; font-size: 11px; color: var(--text-3); background: var(--surface); padding-right: 4px; }
.dv-event { position: absolute; left: 6px; right: 4px; border-left: 3px solid var(--c); border-radius: 6px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--text); padding: 3px 7px; font-size: 12px; overflow: hidden; display: flex; flex-direction: column; }
.dv-event:hover { text-decoration: none; filter: brightness(0.97); }
.dv-event span { color: var(--text-3); font-size: 11px; }
.dv-now { position: absolute; left: -4px; right: 0; height: 2px; background: var(--danger); }

/* ---- Customize toolbar -------------------------------------------------------------------------------- */

.tb-custom { display: flex; flex-direction: column; gap: 1px; max-height: 52vh; overflow: auto; }
.tb-custom .menu-label { padding: 10px 8px 4px; }
.tb-custom-row { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; font-size: 13.5px; cursor: grab; }
.tb-custom-row:hover { background: var(--hover); }
.tb-custom-row.off { cursor: default; color: var(--text-2); }
.tb-custom-row .grip { width: 16px; color: var(--text-3); display: grid; place-items: center; }
.tb-custom-row .faint { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.tb-custom-row.drop-before { box-shadow: inset 0 2px 0 var(--accent-text); }
.tb-custom-row.drop-after { box-shadow: inset 0 -2px 0 var(--accent-text); }

/* ---- Settings --------------------------------------------------------------------------- */

.settings-page { grid-template-columns: 264px 1fr; }
.settings-page .page-nav { padding: 18px 10px 30px; min-height: 0; }
.settings-search { margin: 0 4px 10px; }
.settings-search .input { height: 32px; }
.settings-group { margin: 14px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.settings-nav a { gap: 10px; }
.set-tile { width: 22px; height: 22px; display: grid; place-items: center; flex: none; }
.settings-nav a > .set-tile svg { color: var(--text-2); }
.settings-nav a.on > .set-tile svg { color: var(--accent-line); }
.badge.accent { background: none; color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-line); }

/* Picture pickers (layout, density, mode) */
.choices { display: flex; flex-wrap: wrap; gap: 14px; }
.choice { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--text-2); font: inherit; font-size: 13px; }
.choice-art { width: 132px; height: 84px; border-radius: 12px; border: 1.5px solid var(--border-strong); background: var(--surface-2); display: grid; place-items: center; padding: 8px; transition: box-shadow 0.15s, border-color 0.15s; }
.choice:hover .choice-art { border-color: var(--text-3); }
.choice.on .choice-art { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); }
.choice.on { color: var(--text); font-weight: 600; }
.mini-app { width: 100%; height: 100%; display: grid; grid-template-columns: 12% 32% 1fr; gap: 3px; border-radius: 6px; overflow: hidden; background: #e7e7e3; padding: 3px; }
.mini-app i { display: block; border-radius: 3px; background: #fff; }
.mini-app .m-rail { background: #d6d6d0; }
.mini-app.dark { background: #1c1c1c; }
.mini-app.dark i { background: #2e2e2e; }
.mini-app.dark .m-rail { background: #111; }
.mini-app.system { background: linear-gradient(90deg, #e7e7e3 50%, #1c1c1c 50%); }
.mini-app.system .m-read { background: linear-gradient(90deg, #fff 30%, #2e2e2e 30%); }
.mini-app.bottom { grid-template-columns: 12% 1fr; grid-template-rows: 1fr 1fr; }
.mini-app.bottom .m-rail { grid-row: span 2; }
.mini-app.off { grid-template-columns: 12% 1fr; }
.mini-app.off .m-read { display: none; }
.mini-app.preview { grid-template-columns: 8% 18% 34% 1fr; background: var(--backdrop, var(--bg)); }
.mini-app.preview i { background: var(--surface); }
.mini-app.preview .m-rail { background: transparent; }
.mini-rows { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.mini-rows i { display: block; background: var(--border-strong); border-radius: 4px; }
.mini-rows.roomy i { height: 16px; }
.mini-rows.cozy i { height: 11px; }
.mini-rows.compact i { height: 7px; }
.appearance-preview { height: 150px; max-width: 420px; margin: 0 auto 20px; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-md); border: 1px solid var(--border); }
.appearance-preview .mini-app { border-radius: 0; padding: 8px; gap: 6px; }
.appearance-preview .mini-app i { border-radius: 8px; }
:root[data-glass='on'] .appearance-preview .mini-app i { background: var(--surface); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6); }

/* Colour and background pickers */
.swatch-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.accent-pick { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 84px; padding: 10px 4px 8px; border: 1.5px solid transparent; border-radius: 12px; background: none; cursor: pointer; color: var(--text-2); font: inherit; font-size: 12px; }
.accent-pick:hover { background: var(--hover); }
.accent-pick.on { border-color: var(--accent-line); color: var(--text); font-weight: 600; }
.accent-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.backdrop-pick { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.backdrop-tile { width: 110px; height: 70px; border-radius: 12px; border: 1.5px solid var(--border-strong); cursor: pointer; background-size: cover !important; background-position: center !important; display: flex; align-items: flex-end; padding: 6px 8px; font: inherit; font-size: 12px; font-weight: 600; color: #0b0b0b; }
.backdrop-tile span { background: rgba(255, 255, 255, 0.78); border-radius: 6px; padding: 1px 6px; }
.backdrop-tile.on { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); }
.backdrop-tile.custom { background: repeating-linear-gradient(45deg, var(--bg-sunken), var(--bg-sunken) 8px, var(--surface-2) 8px, var(--surface-2) 16px); }
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.list-preview { margin: 14px 18px 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); pointer-events: none; }
.list-preview .thread-row:last-child { border-bottom: 0; }
.stepper-label { min-width: 70px; text-align: right; font-style: italic; color: var(--text-2); font-size: 13px; }

/* Message list: quick actions */
.qa { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.qa-list { display: flex; flex-direction: column; gap: 6px; }
.qa-row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; cursor: pointer; }
.qa-row.off { color: var(--text-3); cursor: default; }
.qa-preview { flex: 1; min-width: 260px; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.qa-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.qa-lines i { display: block; height: 8px; border-radius: 4px; background: var(--border-strong); }
.qa-lines i:nth-child(1) { width: 40%; }
.qa-lines i:nth-child(2) { width: 70%; }
.qa-lines i:nth-child(3) { width: 55%; opacity: 0.6; }
.qa-icons { display: flex; gap: 8px; color: var(--text-2); }

/* Signatures */
.sig-manager { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 16px; align-items: start; }
.sig-list { display: flex; flex-direction: column; gap: 2px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.sig-item { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 13.5px; }
.sig-list { min-width: 0; }
.sig-item:hover { background: var(--hover); text-decoration: none; }
.sig-item.on { background: var(--selected); color: var(--text); font-weight: 600; }
.sig-item.add { color: var(--text-2); }
.sig-item.add.on { color: var(--text); }
.mini-field { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
@media (max-width: 760px) { .sig-manager { grid-template-columns: 1fr; } }

/* Rules, schedule, weather, categories */
.rule-row { align-items: flex-start; gap: 12px; }
.rule-row .txt span { display: block; }
.rule-cond { gap: 6px; flex-wrap: wrap; }
.rule-cond .input.grow { flex: 1; min-width: 160px; }
.day-toggles { display: inline-flex; gap: 4px; }
.day-toggle { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font: inherit; font-weight: 500; color: var(--text-2); }
.day-toggle.on { background: var(--selected); color: var(--accent-text); border-color: var(--accent-line); font-weight: 600; }
.place-results { display: flex; flex-direction: column; gap: 2px; max-width: 420px; }
.font-sample { padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: 10px; color: var(--text); }
.cat-dot { width: 20px; height: 20px; border-radius: 6px; border: 0; cursor: pointer; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.bare-input { border-color: transparent; background: transparent; padding-left: 6px; }
.bare-input:hover, .bare-input:focus { border-color: var(--border); background: var(--surface); }
.tag.cat { background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--text); box-shadow: inset 3px 0 0 var(--c); }

/* ---- Liquid glass: the picture runs behind the whole window; the top bar and command bar sit right on
   it; the rail is a frosted capsule; folders + list are one frosted panel, My Day and an open email others. ---------- */

:root[data-glass='on'] {
  --glass-fill: rgba(255, 255, 255, 0.7);
  --glass-thin: rgba(255, 255, 255, 0.46);  /* folders and rail: more of the picture shows through */
  --glass-thick: rgba(255, 255, 255, 0.88); /* the list and open emails: easy to read */
  --glass-edge: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(11, 11, 11, 0.06);
  --glass-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.7) inset, 0 1px 0 rgba(255, 255, 255, 0.75) inset, 0 10px 30px rgba(44, 34, 78, 0.1);
  --glass-blur: blur(28px) saturate(1.6);
  --glass-radius: 16px;
  --glass-pick: rgba(255, 255, 255, 0.9);
  --rail-w: 56px; /* the workspaces' capsule nearly fills the rail */
  --rail-glass: rgba(255, 255, 255, 0.3);
  --rail-edge: rgba(255, 255, 255, 0.6);
  --rail-shine: rgba(255, 255, 255, 0.7);
  --rail-drop: 0 8px 24px rgba(44, 34, 78, 0.08);
  --rail-group: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.5));
  --rail-group-edge: rgba(255, 255, 255, 0.95);
  --rail-group-drop: inset 0 1.5px 1px rgba(255, 255, 255, 0.9), inset 0 -1px 2px rgba(255, 255, 255, 0.55), 0 0 0 0.5px rgba(28, 30, 60, 0.1), 0 1px 3px rgba(44, 34, 78, 0.08);
  --rail-hover: rgba(255, 255, 255, 0.5);
  --rail-pick: rgba(255, 255, 255, 0.92);
  --rail-pick-shadow: 0 1px 3px rgba(44, 34, 78, 0.12);
  --rail-chosen: rgba(70, 82, 122, 0.17); /* a blue-grey circle */
  --rail-ring: rgba(28, 30, 60, 0.14);
  --rail-add: rgba(255, 255, 255, 0.75);
  --rail-add-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95), 0 0.5px 2px rgba(44, 34, 78, 0.12);
  --gap: 8px;
}
:root[data-theme='dark'][data-glass='on'] {
  --glass-fill: rgba(30, 30, 36, 0.62);
  --glass-thin: rgba(28, 28, 34, 0.46);
  --glass-thick: rgba(20, 20, 24, 0.84);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --glass-line: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.1) inset, 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 12px 36px rgba(0, 0, 0, 0.42);
  --glass-pick: rgba(255, 255, 255, 0.14);
  --rail-glass: rgba(255, 255, 255, 0.045);
  --rail-edge: rgba(255, 255, 255, 0.09);
  --rail-shine: rgba(255, 255, 255, 0.06);
  --rail-drop: 0 8px 24px rgba(0, 0, 0, 0.35);
  --rail-group: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  --rail-group-edge: rgba(255, 255, 255, 0.12);
  --rail-group-drop: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.35);
  --rail-hover: rgba(255, 255, 255, 0.07);
  --rail-pick: rgba(255, 255, 255, 0.13);
  --rail-pick-shadow: none;
  --rail-chosen: rgba(255, 255, 255, 0.11);
  --rail-ring: rgba(255, 255, 255, 0.16);
  --rail-add: transparent;
  --rail-add-shadow: none;
}
@media (min-width: 761px) {
  /* On the picture: the top bar (in the Mac app, the title bar) and the command bar. */
  :root[data-glass='on'] .appbar { background: transparent; }
  :root[data-glass='on'] .ribbon { background: transparent; border: 0; padding: 2px 10px 6px 2px; }
  :root[data-glass='on'] .ribbon .new-email svg { color: var(--text-2); }
  :root[data-glass='on'] .ribbon .new-email { background: var(--glass-fill); border-color: var(--glass-edge); border-radius: 999px; box-shadow: 0 1px 3px rgba(44, 34, 78, 0.08); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
  :root[data-glass='on'] .rb:hover:not(:disabled) { background: var(--glass-thin); }
  :root[data-glass='on'] .rb.on { background: var(--glass-fill); }
  /* The rail: a frosted capsule with round buttons. */
  /* The rail: see-through glass all the way down with a fine light edge; the workspaces in their own
     capsule, inset by the same few pixels on every side; soft tints for what's chosen. */
  :root[data-glass='on'] .rail { margin: 0 7px var(--gap) 7px; padding: 10px 0 8px; gap: 4px; border-radius: 24px; background: var(--rail-glass);
    box-shadow: 0 0 0 1px var(--rail-edge) inset, 0 1px 0 var(--rail-shine) inset, var(--rail-drop); -webkit-backdrop-filter: blur(30px) saturate(1.7); backdrop-filter: blur(30px) saturate(1.7); }
  :root[data-glass='on'] .rail:has(> .rail-group.scopes) { padding-top: 3px; }
  :root[data-glass='on'] .rail-group { gap: 4px; }
  :root[data-glass='on'] .rail-btn { width: 32px; height: 32px; border-radius: 50%; }
  :root[data-glass='on'] .rail-btn:hover { background: var(--rail-hover); }
  :root[data-glass='on'] .rail-btn.on { background: var(--rail-pick); box-shadow: var(--rail-pick-shadow); }
  :root[data-glass='on'] .rail-btn.on::before { display: none; }
  :root[data-glass='on'] .rail-btn svg { width: 19px; height: 19px; }
  :root[data-glass='on'] .rail-btn.me .avatar { width: 28px; height: 28px; }
  :root[data-glass='on'] .rail-sep { width: 20px; background: var(--glass-line); }
  :root[data-glass='on'] .rail-group.scopes { width: calc(100% - 6px); padding: 3px 0; gap: 6px; border-radius: 19px; background: var(--rail-group);
    box-shadow: 0 0 0 1.5px var(--rail-group-edge) inset, var(--rail-group-drop); }
  :root[data-glass='on'] .rail-group.scopes + .rail-sep { display: none; }
  :root[data-glass='on'] .rail-group.scopes + .rail-sep + .rail-group { margin-top: 8px; }
  :root[data-glass='on'] .rail-group.scopes .rail-btn.on { background: var(--rail-chosen); box-shadow: none; }
  :root[data-glass='on'] .rail-group.scopes .rail-btn:hover:not(.on) { background: var(--rail-hover); }
  :root[data-glass='on'] .rail-btn.add, :root[data-glass='on'] .rail-group.scopes .rail-btn.add { width: 30px; height: 30px; margin: 1px 0; border: 1px solid var(--rail-ring); background: var(--rail-add); box-shadow: var(--rail-add-shadow); color: var(--text-2); }
  :root[data-glass='on'] .rail-btn.add svg { width: 16px; height: 16px; }
  /* Inside the capsule's round top (the first button sits low enough for it), no ring: just a soft shadow. */
  :root[data-glass='on'] .rail-badge { top: -1px; right: -1px; box-shadow: 0 1px 2px rgba(20, 16, 40, 0.18); }
  /* Panels */
  :root[data-glass='on'] .body { gap: var(--gap); padding: 0 var(--gap) var(--gap) 0; }
  :root[data-glass='on'] .sidebar, :root[data-glass='on'] .list-pane, :root[data-glass='on'] .reader, :root[data-glass='on'] .myday,
  :root[data-glass='on'] .page-nav, :root[data-glass='on'] .page-body, :root[data-glass='on'] .cal > * {
    background: var(--glass-fill); border: 0; border-radius: var(--glass-radius); box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  }
  :root[data-glass='on'] .sidebar { background: var(--glass-thin); padding-top: 10px; }
  :root[data-glass='on'] .list-pane, :root[data-glass='on'] .reader { background: var(--glass-thick); overflow: hidden; }
  :root[data-glass='on'] .mail { gap: var(--gap); background: transparent; }
  :root[data-glass='on'] .main, :root[data-glass='on'] .page { background: transparent; gap: var(--gap); }
  :root[data-glass='on'] .shell.with-myday .myday { border-left: 0; }
  /* Nothing open: the reading pane is just the picture. */
  :root[data-glass='on'] .reader:has(> .reader-empty.idle) { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  :root[data-glass='on'] .reader > .reader-empty.idle { visibility: hidden; }
}
/* Folders and the list: one panel. */
@media (min-width: 961px) {
  :root[data-glass='on'] .shell[data-section='mail']:not(.pane-off) .body { column-gap: 0; }
  :root[data-glass='on'] .shell[data-section='mail']:not(.pane-off).with-myday .myday { margin-left: var(--gap); }
  :root[data-glass='on'] .shell[data-section='mail']:not(.pane-off) .sidebar { border-radius: var(--glass-radius) 0 0 var(--glass-radius); }
  :root[data-glass='on'] .shell[data-section='mail']:not(.pane-off) .list-pane { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid var(--glass-line); }
}
:root[data-glass='on'] .list-head, :root[data-glass='on'] .toolbar, :root[data-glass='on'] .list-group { background: transparent; border-color: var(--glass-line); }
:root[data-glass='on'] .thread-row { border-color: var(--glass-line); }
:root[data-glass='on'] .thread-row:hover { background: rgba(11, 11, 11, 0.035); }
:root[data-theme='dark'][data-glass='on'] .thread-row:hover { background: rgba(255, 255, 255, 0.05); }
:root[data-glass='on'] .thread-row.selected { background: var(--selected); }
:root[data-glass='on'] .card, :root[data-glass='on'] .ag-day-title, :root[data-glass='on'] .dv-hour span { background: rgba(255, 255, 255, 0.5); }
:root[data-theme='dark'][data-glass='on'] .card { background: rgba(255, 255, 255, 0.035); }
:root[data-theme='dark'][data-glass='on'] .ag-day-title, :root[data-theme='dark'][data-glass='on'] .dv-hour span { background: transparent; }
:root[data-glass='on'] .card { border-color: var(--glass-line); box-shadow: 0 1px 0 var(--glass-edge) inset; }
:root[data-glass='on'] .msg { border-color: var(--glass-line); }
/* What's picked: a white pill. */
:root[data-glass='on'] .nav a.on, :root[data-glass='on'] .ws-head.on { background: var(--glass-pick); box-shadow: 0 1px 3px rgba(44, 34, 78, 0.08); }
:root[data-theme='dark'][data-glass='on'] .nav a.on, :root[data-theme='dark'][data-glass='on'] .ws-head.on { box-shadow: none; }
:root[data-glass='on'] .nav a:hover:not(.on) { background: rgba(255, 255, 255, 0.4); }
:root[data-theme='dark'][data-glass='on'] .nav a:hover:not(.on) { background: rgba(255, 255, 255, 0.06); }
:root[data-glass='on'] .appbar-search .input { background: var(--glass-fill); border-color: var(--glass-edge); border-radius: 999px; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: 0 1px 3px rgba(44, 34, 78, 0.06); }
:root[data-glass='on'] .overlay { background: rgba(28, 22, 48, 0.2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
:root[data-theme='dark'][data-glass='on'] .overlay { background: rgba(0, 0, 0, 0.4); }
:root[data-glass='on'] .modal { background: var(--glass-thick); }
:root[data-glass='on'] .popover-layer .menu { background: var(--glass-thick); }
:root[data-glass='on'] .popover-layer .menu, :root[data-glass='on'] .modal { -webkit-backdrop-filter: blur(40px) saturate(1.8); backdrop-filter: blur(40px) saturate(1.8); box-shadow: var(--glass-shadow), var(--shadow-lg); }
:root[data-glass='on'] .composer { -webkit-backdrop-filter: blur(40px) saturate(1.8); backdrop-filter: blur(40px) saturate(1.8); }
/* The Send split-button as liquid-glass lime: translucent brand fill, frosted blur, a bright top gloss. */
:root[data-glass='on'] .composer-actions .cmd-group { background: var(--accent); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 2px 6px rgba(11, 11, 11, 0.22); } /* solid lime even on glass: see-through made it look muddy */
/* The Mac app's window turns see-through itself: the desktop shows (blurred by macOS) instead of a picture. */
:root[data-native-glass='on'], :root[data-native-glass='on'] body, :root[data-native-glass='on'] #app, :root[data-native-glass='on'] .shell { background: transparent !important; }
:root[data-glass='on'] .cal { gap: var(--gap); background: transparent; }

.hour-labels.tz div { color: var(--text-3); opacity: 0.75; }
.allday-row .lab.tz { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-num { font-size: 11px; color: var(--text-3); font-weight: 500; display: grid; place-items: end center; padding-bottom: 6px; }
.dh .wx { display: flex; justify-content: center; margin-top: 3px; font-size: 11px; }
.month-cell { position: relative; }
.month-cell .wx { position: absolute; top: 5px; right: 6px; font-size: 11px; }
.month-cell .wk-num { display: inline; padding: 0; }

/* Swipe actions (phones): the colour and word behind the row being swiped */
.threads[data-swipe] { position: relative; }
.thread-row.swiping { z-index: 1; box-shadow: var(--shadow-md); }
.threads[data-swipe='archive'] { background: #16a34a; }
.threads[data-swipe='delete'] { background: #dc2626; }
.threads[data-swipe='read'] { background: #2563eb; }
.threads[data-swipe='star'] { background: #f59e0b; }
.threads[data-swipe='pin'] { background: var(--accent); }
.threads[data-swipe='snooze'] { background: #ea580c; }

.auto-notice { display: flex; align-items: center; gap: 8px; margin: 0 10px 8px; padding: 7px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; }
.auto-notice > svg { color: var(--tone-violet); }
.auto-notice a { color: var(--accent-text); font-weight: 600; margin-left: auto; white-space: nowrap; }
@media (max-width: 960px) {
  .settings-page { grid-template-columns: 1fr; }
  .settings-page .page-nav { flex-direction: row; align-items: center; min-height: auto; padding: 8px 10px; }
  .settings-page .settings-group, .settings-page .page-nav .release, .settings-page .settings-search { display: none; }
  .settings-nav { flex-direction: row; gap: 4px; }
  .settings-nav a { white-space: nowrap; height: 36px; }
}

/* ---- Event editor (calendar): a line icon per row and soft fields ------------------- */

.modal.ev-modal { max-width: 660px; }
.ev-modal .modal-head h3 { font-size: 13px; font-weight: 500; color: var(--text-3); }
.ev-editor { display: flex; flex-direction: column; gap: 2px; }
.ev-head { display: flex; align-items: center; gap: 12px; padding: 0 0 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border); }
.ev-dot { width: 12px; height: 12px; margin: 0 5px; border-radius: 4px; background: var(--c); flex: none; }
.ev-dot-btn { border: 0; cursor: pointer; padding: 0; width: 16px; height: 16px; border-radius: 5px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px color-mix(in srgb, var(--c) 55%, transparent); }
.ev-dot-btn:disabled { cursor: default; opacity: 0.7; box-shadow: none; }
.ev-swatch { width: 14px; height: 14px; border-radius: 4px; background: var(--c); flex: none; display: inline-block; }
.ev-videolink { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 2px; min-width: 0; }
.ev-videolink[hidden] { display: none; }
.ev-videolink > svg { color: var(--tone-blue); flex: none; }
.ev-videolink a { color: var(--link); }
.ev-title { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 21px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); padding: 4px 0; outline: none; }
.ev-title::placeholder { color: var(--text-3); font-weight: 500; }
.ev-title:focus-visible { box-shadow: none; }
.ev-line { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; align-items: start; padding: 7px 0; }
.ev-ic { height: 34px; display: grid; place-items: center; color: var(--text-2); }
.ev-fields { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ev-fields > div:empty { display: none; }
.ev-when { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ev-span { display: inline-flex; gap: 4px; }
.ev-date { width: 150px; }
.ev-time { width: 116px; }
.ev-to { display: inline-grid; color: var(--text-3); }
.ev-allday { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; color: var(--text-2); cursor: pointer; }
.ev-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-inline .select { width: auto; min-width: 210px; }
.ev-sub { display: inline-grid; color: var(--text-3); }
.ev-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ev-pick { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ev-cap { font-size: 11.5px; color: var(--text-3); }
.ev-link { word-break: break-all; }
.ev-tz { display: inline-flex; align-items: center; gap: 6px; }
/* Soft fields: a light wash, a border only when pointed at or typed in. */
.ev-editor .input, .ev-editor .select, .ev-editor .textarea { background-color: var(--field); border-color: transparent; }
.ev-editor .input:hover:not(:disabled), .ev-editor .select:hover:not(:disabled), .ev-editor .textarea:hover:not(:disabled) { border-color: var(--border-strong); }
.ev-editor .input:focus, .ev-editor .select:focus, .ev-editor .textarea:focus { background-color: var(--surface-solid); border-color: var(--accent-line); }
.ev-editor .textarea { min-height: 96px; }
@media (max-width: 640px) {
  .ev-picks { grid-template-columns: 1fr; }
  .ev-allday { margin-left: 0; }
}

/* One-time setup steps (Settings → Integrations) */
.setup-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.5; }
/* Integrations: one row per service, its logo, what it does, Connect. */
.int-list { padding: 4px 0; }
.int-row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; padding: 12px 16px; }
.int-row + .int-row { border-top: 1px solid var(--border); }
.int-row .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.int-row .txt b { font-weight: 600; font-size: 14px; }
.int-row .txt span { color: var(--text-2); font-size: 12.5px; }
.int-logo { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-solid, var(--surface)); box-shadow: inset 0 0 0 1px var(--border); }
.int-logo svg { width: 18px; height: 18px; }
.int-sub { grid-column: 2 / -1; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; padding: 8px 0 0; }
.int-sub .int-logo { width: 22px; height: 22px; border-radius: 6px; box-shadow: none; background: none; }
.int-sub .int-logo svg { width: 20px; height: 20px; }
/* The owner's one-time setup, one step at a time. */
.wizard-dots { display: flex; gap: 6px; }
.wizard-dots span { width: 22px; height: 4px; border-radius: 2px; background: var(--border-strong, var(--border)); }
.wizard-dots span.done { background: color-mix(in srgb, var(--accent-line) 45%, transparent); }
.wizard-dots span.on { background: var(--accent-line); }
.wizard-pane { gap: 10px; font-size: 13.5px; line-height: 1.5; min-height: 190px; }
.wizard-pane h3 { font-size: 16px; font-weight: 600; }
.copy-chip { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border-radius: 8px; background: var(--bg-sunken); max-width: 100%; }
.copy-chip code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; }
.drop-file { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 24px; border: 1.5px dashed var(--border-strong, var(--border)); border-radius: 12px; cursor: pointer; text-align: center; }
.drop-file svg { width: 22px; height: 22px; color: var(--accent-line); }
.drop-file.over { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent-line) 8%, transparent); }
.setup-steps a { display: inline-flex; align-items: center; gap: 3px; font-weight: 500; }
.setup-steps a svg { width: 12px; height: 12px; }

/* ---- Inside the iPhone app (?embed=1): one settings page, styled like iOS Settings -------------------------------- */

:root[data-embed='on'] {
  --bg: #f2f2f7; --bg-sunken: #e9e9ee; --surface: #ffffff; --surface-2: #ffffff; --hover: #e5e5ea; --active: #d9d9de;
  --selected: #e5e5ea; --border: #e5e5ea; --border-strong: #d1d1d6; --radius: 12px;
}
:root[data-embed='on'][data-theme='dark'] {
  --bg: #000000; --bg-sunken: #1c1c1e; --surface: #1c1c1e; --surface-2: #1c1c1e; --hover: #2c2c2e; --active: #3a3a3c;
  --selected: #2c2c2e; --border: #38383a; --border-strong: #48484a;
}
:root[data-embed='on'] body { background: var(--bg); font-size: 15px; }
:root[data-embed='on'] #app, .embed-main { height: 100%; }
.embed-main { display: flex; background: var(--bg); }
.embed-main > .page { height: 100%; }
/* The app has the list of pages and the title bar: here, just the page. */
:root[data-embed='on'] .settings-page { grid-template-columns: minmax(0, 1fr); }
:root[data-embed='on'] .settings-page .page-nav { display: none; }
:root[data-embed='on'] .page-body { padding: 8px 16px 48px; background: var(--bg); -webkit-overflow-scrolling: touch; }
:root[data-embed='on'] .settings-page .page-body > .inner > h1 { display: none; }
:root[data-embed='on'] .page-body > .inner > p.lead { margin: 4px 4px 16px; font-size: 13.5px; color: var(--text-3); }
:root[data-embed='on'] .card { border: 0; box-shadow: none; }
:root[data-embed='on'] .card-head h3 { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-3); }
:root[data-embed='on'] .modal { max-width: none; }

/* Settings rows on phones: wide controls (segmented choices, selects) go under their label; switches stay beside it. */
@media (max-width: 760px) {
  .setting { flex-wrap: wrap; row-gap: 10px; padding: 12px 16px; }
  .setting .txt { min-width: 190px; }
  .segmented { flex-wrap: wrap; }
  .card-head { padding: 14px 16px 0; }
  .card-body { padding: 14px 16px 16px; }
}

/* ---- Reading an email: no card; sender, To:, the full date; attachments; then the email full width ---- */

.reader { background: var(--surface); }
.convo { padding: 16px 24px 60px; }
.convo-title { align-items: center; margin-bottom: 4px; }
.convo h2, .convo-title h2 { font-family: var(--font); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin: 0; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.convo-sub { margin-bottom: 8px; }
.msg { background: none; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; margin: 0; box-shadow: none; overflow: visible; }
.msg:last-of-type { border-bottom: 0; }
.msg-head { padding: 16px 0 10px; gap: 12px; }
.msg.collapsed .msg-head { padding: 12px 0; }
.msg.collapsed .msg-head .avatar { width: 32px; height: 32px; font-size: 12px; }
/* Collapsing a message (click its header) hides the body and recipients and shows a one-line summary. */
.msg:not(.collapsed) .msg-snip { display: none; }
.msg.collapsed .to { display: none; }
.msg.collapsed .msg-body { display: none; }
.msg.collapsed.unseen .who { font-weight: 700; }
.msg.collapsed.unseen .msg-from::before { content: ''; flex: none; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--unread); }
.msg-from { min-width: 0; display: flex; align-items: center; font-size: 14.5px; }
.msg-head .sender { min-width: 0; max-width: 100%; display: inline-flex; align-items: baseline; gap: 0; background: none; border: 0; padding: 2px 5px; margin: -2px -5px; border-radius: 7px; cursor: pointer; font: inherit; color: inherit; text-align: left; overflow: hidden; }
.msg-head .sender:hover { background: var(--hover); }
.msg-head .sender .who { white-space: nowrap; }
.msg-head .sender .addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* The contact menu shows the full address, however long: the address item wraps instead of being cut off. */
.menu.contact { max-width: 320px; }
.menu.contact .addr-item { height: auto; min-height: 34px; padding: 7px 10px; align-items: flex-start; }
.menu.contact .addr-item .grow { min-width: 0; white-space: normal; overflow-wrap: anywhere; word-break: break-all; line-height: 1.35; }
.msg-from .who { font-weight: 600; }
.msg-from .addr { color: var(--text-3); font-size: 13.5px; }
.msg-head .to { color: var(--text-2); font-size: 13px; margin-top: 3px; white-space: normal; line-height: 1.4; }
.msg-head .to .lbl { color: var(--text-3); white-space: pre; }
.msg-head .recip { background: none; border: 0; padding: 1px 4px; margin: 0 -1px; border-radius: 6px; cursor: pointer; font: inherit; color: inherit; }
.msg-head .recip:hover { background: var(--hover); color: var(--text); }
.msg-head .when .d-short { display: none; }
@container reader (max-width: 700px) {
  .msg-head .when .d-long { display: none; }
  .msg-head .when .d-short { display: inline; }
}
.msg-body { padding: 0 0 20px; }
.msg-body .track-line { margin-top: 0; }
/* Summary and translation (done on the device) */
.sum-card { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--tone-violet) 28%, var(--border));
  background: color-mix(in srgb, var(--tone-violet) 6%, var(--surface)); font-size: 13.5px; line-height: 1.55; }
.sum-card.loading { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.sum-card.loading svg { color: var(--tone-violet); animation: sum-pulse 1s ease-in-out infinite; }
@keyframes sum-pulse { 50% { opacity: 0.3; transform: scale(0.85); } }
.sum-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--tone-violet); }
.sum-head b { color: var(--text); font-weight: 600; }
.sum-head .faint { font-size: 12px; }
.sum-list { margin: 0; padding-left: 18px; display: grid; gap: 3px; color: var(--text); }
.sum-list li.next { list-style: none; margin-left: -18px; margin-top: 4px; font-weight: 600; }
.sum-ic svg { color: var(--tone-violet); }
.tr-bar { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); background: var(--bg-sunken); border-radius: 8px; padding: 5px 6px 5px 10px; margin: 0 0 10px; }
.tr-bar svg { color: var(--tone-blue); flex: none; }
.compose-lang { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); background: var(--bg-sunken); border-radius: 8px; padding: 5px 6px 5px 10px; margin: 6px 12px 0; }
.compose-lang[hidden] { display: none; }
.compose-lang > svg { flex: none; }
.menu-icon-space { display: inline-block; width: 16px; flex: none; }
/* Email activity (who opened, clicked, replied) */
.eye-btn { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.ta-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ta-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--bg-sunken); }
.ta-stat b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ta-stat span { font-size: 12px; color: var(--text-2); }
.ta-stat.blue b { color: var(--tone-blue); }
.ta-stat.good b { color: var(--success); }
.ta-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.ta-person, .ta-event, .ta-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 13px; }
.ta-person + .ta-person, .ta-event + .ta-event, .ta-link + .ta-link { border-top: 1px solid var(--border); }
.ta-person .faint, .ta-event .faint { font-size: 12px; }
.ta-chip { flex: none; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg-sunken); color: var(--text-2); }
.ta-chip.blue { background: color-mix(in srgb, var(--tone-blue) 14%, transparent); color: var(--tone-blue); }
.ta-chip.good { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.ta-chip.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.ta-ic { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--tone-blue) 12%, transparent); color: var(--tone-blue); }
.ta-event.auto { opacity: 0.6; }
.ta-event.auto .ta-ic { background: var(--bg-sunken); color: var(--text-3); }
.ta-link a { color: var(--text); }
@media (max-width: 560px) { .ta-stats { grid-template-columns: repeat(2, 1fr); } }
/* The tracker (views/mail.js trackingPanel): header, tiles, sections and a filterable timeline. Solid text throughout. */
.ac-modal .modal-body { gap: 14px; }
.ac-head { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 12px; background: var(--bg-sunken); }
.ac-subject { font-size: 15px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.ac-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 13px; }
.ac-fact { display: contents; }
.ac-k { color: var(--text-2); font-weight: 500; }
.ac-v { color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.ac-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 12px; font-weight: 500; color: var(--text); }
.ac-badge.on { border-color: color-mix(in srgb, var(--tone-blue) 55%, transparent); color: var(--tone-blue); }
.ac-badge svg.i { width: 13px; height: 13px; }
.ac-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.ac-tile { display: flex; flex-direction: column; gap: 1px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); }
.ac-tile b { font-size: 20px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.2; }
.ac-tile span { font-size: 12.5px; color: var(--text); }
.ac-tile small { font-size: 11.5px; color: var(--text-2); }
.ac-tile.blue b { color: var(--tone-blue); }
.ac-tile.good b { color: var(--success); }
.ac-tile.team b { color: #7c3aed; }
.ac-section { display: flex; flex-direction: column; gap: 8px; }
.ac-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); }
.ac-label span { font-size: 11.5px; font-weight: 600; padding: 0 7px; border-radius: 999px; background: var(--bg-sunken); color: var(--text); line-height: 18px; }
.ac-modal .ac-sub { font-size: 12px; color: var(--text-2); }
.ac-modal .ta-person b, .ac-modal .ta-event .ellipsis { color: var(--text); }
.ta-chip.team { background: color-mix(in srgb, #7c3aed 14%, transparent); color: #7c3aed; }
.ac-bar { height: 4px; margin-top: 5px; border-radius: 99px; background: var(--bg-sunken); overflow: hidden; }
.ac-bar span { display: block; height: 100%; border-radius: 99px; background: var(--tone-blue); }
.ac-modal .ta-link > b { flex: none; font-size: 12.5px; color: var(--text); }
.ac-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ac-filter { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.ac-filter span { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--text-2); }
.ac-filter.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.ac-filter.on span { color: var(--bg); }
.ac-auto { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12.5px; color: var(--text); cursor: pointer; }
.ac-timeline { display: flex; flex-direction: column; gap: 6px; }
.ac-day { margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.ta-event.k-sent .ta-ic { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.ta-event.k-team .ta-ic { background: color-mix(in srgb, #7c3aed 14%, transparent); color: #7c3aed; }
.ta-event.k-reply .ta-ic { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.ac-modal .modal-foot { justify-content: space-between; }
/* On white in dark mode: the email as its sender designed it, on a white sheet. */
.mail-body.sheet { background: #ffffff; border-radius: 14px; padding: 18px 22px; color-scheme: light; }
.msg-frame, :root[data-mail-bg='dark'] .msg-frame { background: transparent; border-radius: 0; }
.light-ic { color: var(--tone-amber); }
/* Attachments: file cards, then "Download all · Preview all" */
.att-block { margin: 0 0 16px; }
.att-block .attachments { margin-top: 0; }
.att { cursor: pointer; background: var(--surface); border-color: var(--border-strong); max-width: 300px; padding: 8px 6px 8px 10px; }
.att .ic { background: var(--bg-sunken); }
.att-all { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent-text); font: inherit; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
.modal.att-preview { max-width: min(1100px, 94vw); height: 90vh; }
.att-preview .modal-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.att-preview .modal-body > .stack { flex: 1; min-height: 0; }
.att-stage { flex: 1; min-height: 0; display: grid; place-items: center; background: var(--bg-sunken); border-radius: var(--radius); overflow: hidden; }
.att-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.att-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.att-none { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-2); text-align: center; padding: 40px; }
.att-none .ic svg { width: 48px; height: 48px; }
@media (max-width: 760px) {
  .convo { padding: 12px 14px 90px; }
  .msg-body { padding: 0 0 16px; }
  .mail-body.sheet { padding: 14px; border-radius: 12px; }
}

/* "Update available" (lib/updates.js): top right of the top bar, like other desktop apps. */
.update-pill { position: fixed; top: 8px; right: 92px; z-index: 90; display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px 0 11px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 4px 14px color-mix(in srgb, var(--accent) 45%, transparent); animation: pillIn 0.3s ease-out; -webkit-app-region: no-drag; }
@keyframes pillIn { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.update-pill:hover { filter: brightness(1.05); }
.update-pill:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.update-pill.busy { cursor: progress; opacity: 0.85; }
.update-pill.busy svg { animation: spin 1s linear infinite; }
@media (max-width: 760px) {
  .update-pill { top: auto; right: 50%; transform: translateX(50%); bottom: calc(68px + env(safe-area-inset-bottom)); height: 36px; }
  :root[data-native-inset='on'] .update-pill { top: 8px; bottom: auto; right: 12px; transform: none; }
}

/* Help and what's new (views/whatsnew.js): the ? on the rail, its menu, the guide, release notes, after-update window. */
.help-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--unread); box-shadow: 0 0 0 2px var(--chrome, var(--surface)); }
.help-menu { width: 320px; padding: 6px; }
.help-menu .menu-label { padding-top: 6px; }
.help-update { display: flex; align-items: center; gap: 10px; margin: 2px 2px 6px; padding: 10px 10px 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); font-size: 13px; line-height: 1.35; }
.help-update .faint { font-size: 12px; }
.help-timeline { position: relative; }
.help-timeline::before { content: ''; position: absolute; left: 17px; top: 14px; bottom: 14px; width: 1px; background: var(--border); }
.help-release { gap: 8px; }
.help-release .tl-dot { position: relative; z-index: 1; flex: none; width: 7px; height: 7px; margin: 0 6px 0 4px; border-radius: 50%; background: var(--border-strong, var(--text-3)); }
.help-release .tl-dot.on { background: var(--unread); }
.new-tag { flex: none; padding: 1px 7px; border-radius: 6px; background: color-mix(in srgb, var(--unread) 14%, transparent); color: var(--unread); font-size: 12px; font-weight: 600; }
.help-foot { padding: 8px 10px 4px; font-size: 11.5px; border-top: 1px solid var(--border); margin-top: 4px; }

.releases-modal .modal-body, .docs-modal .modal-body { max-height: min(72vh, 760px); }
.release { padding: 4px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.release:last-child { border-bottom: 0; }
.release-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.release-head h4 { margin: 0; font-size: 15px; }
.release-head .faint { margin-left: auto; font-size: 12px; }
.release-title { font-weight: 650; margin: 10px 0 4px; }
.release ul { margin: 0; padding-left: 20px; line-height: 1.5; font-size: 13.5px; }
.release li + li { margin-top: 4px; }
.release code, .docs-page code { font-size: 12px; padding: 1px 4px; border-radius: 4px; background: var(--hover, rgba(0,0,0,.05)); }

.docs { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; min-height: 420px; }
.docs-nav { display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--border); padding-right: 12px; }
.docs-link { display: flex; align-items: center; gap: 9px; text-align: left; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 13.5px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.docs-link:hover { background: var(--hover, rgba(0,0,0,.05)); }
.docs-link.on { background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--text); font-weight: 600; }
.docs-page { overflow: auto; line-height: 1.6; font-size: 14px; padding-right: 6px; }
.docs-page h2 { margin: 2px 0 10px; font-size: 20px; }
.docs-page ul { padding-left: 20px; }
.docs-page li + li { margin-top: 6px; }
@media (max-width: 760px) {
  .docs { grid-template-columns: 1fr; }
  .docs-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 8px; }
  .docs-link { white-space: nowrap; }
}

.modal.whatsnew { position: relative; width: min(440px, calc(100vw - 32px)); padding: 0; overflow: hidden; border-radius: 22px; }
.modal.whatsnew .modal-head { position: absolute; top: 10px; right: 10px; z-index: 2; padding: 0; border: 0; background: none; }
.modal.whatsnew .modal-head h3 { display: none; }
.modal.whatsnew .modal-head .btn { background: rgba(255, 255, 255, 0.55); border-radius: 50%; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.modal.whatsnew .modal-body { padding: 0; max-height: none; }
.wn-art { position: relative; height: 210px; display: grid; place-items: center; background: radial-gradient(120% 90% at 20% 10%, #f1ffc2 0%, transparent 55%), radial-gradient(110% 100% at 90% 20%, #d9d2ff 0%, transparent 60%), linear-gradient(160deg, #e9f7c9, #cfc6f5 60%, #f6d6e4); }
.wn-icon { width: 96px; height: 96px; border-radius: 26px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.7); box-shadow: 0 10px 30px rgba(60, 40, 120, 0.18); color: #2b2440; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.wn-icon svg { width: 46px; height: 46px; stroke-width: 1.5; }
.wn-badge { position: absolute; top: 14px; left: 16px; font-size: 11.5px; font-weight: 650; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.65); color: #2b2440; }
.wn-copy { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 28px 20px; }
.wn-dots { display: flex; gap: 8px; margin-bottom: 14px; }
/* The other slides' dots: the text colour, lighter, so they're clearly visible on the glass; the current one solid. */
.wn-dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--text) 32%, transparent); cursor: pointer; }
.wn-dot:hover { background: color-mix(in srgb, var(--text) 55%, transparent); }
.wn-dot.on { background: var(--text); width: 18px; border-radius: 999px; }
.wn-title { margin: 0 0 8px; font-size: 21px; line-height: 1.25; }
.wn-text { margin: 0 0 20px; color: var(--text-2); font-size: 14.5px; line-height: 1.5; min-height: 4.5em; }
.wn-next { width: 100%; height: 44px; border-radius: 12px; font-size: 15px; }
.wn-more { margin-top: 8px; }
.help-callout { position: fixed; z-index: 95; display: flex; align-items: center; gap: 10px; width: 330px; padding: 10px 8px 10px 14px; border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg, 0 10px 30px rgba(0,0,0,.18)); border: 1px solid var(--border); font-size: 13px; line-height: 1.35; animation: pillIn 0.3s ease-out; }
.help-callout::before { content: ''; position: absolute; left: -6px; top: 50%; width: 10px; height: 10px; margin-top: -5px; background: var(--surface); border-left: 1px solid var(--border); border-bottom: 1px solid var(--border); transform: rotate(45deg); }
.help-callout b { display: block; margin-bottom: 1px; }
.help-callout .btn.sm { flex: none; }
@media (max-width: 760px) { .help-callout { display: none; } }

/* Folders: an arrow to fold subfolders away, your colour on the icon, and a small label (views/sidebar.js). */
.f-toggle { flex: none; width: 18px; height: 18px; margin: 0 -2px 0 -6px; padding: 0; border: 0; background: none; color: var(--text-3); display: grid; place-items: center; border-radius: 5px; cursor: pointer; }
.f-toggle:hover { background: var(--hover); color: var(--text); }
.f-toggle.spacer { visibility: hidden; pointer-events: none; }
.f-toggle svg { width: 13px; height: 13px; }
.f-chip { flex: none; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 600; line-height: 16px; padding: 0 6px; border-radius: 999px; color: var(--chip, var(--text-2)); background: color-mix(in srgb, var(--chip, var(--text-3)) 16%, transparent); }
.nav-add { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 10px 0 14px; border: 0; background: none; color: var(--text-3); font: inherit; font-size: 13px; border-radius: 8px; cursor: pointer; opacity: 0; transition: opacity 0.12s; }
.pane-children:hover .nav-add, .nav-add:focus-visible { opacity: 1; }
.nav-add:hover { background: var(--hover); color: var(--text); }
.f-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.f-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); display: grid; place-items: center; }
.f-swatch.none { background: var(--surface-2); color: var(--text-3); }
.f-swatch.on { border-color: var(--text); }
@media (hover: none) { .nav-add { opacity: 1; } }

/* Black: true black for OLED screens. The window is pure black; panes, menus and selection sit on it in a few
   near-black steps so the layout still reads clearly without borders shouting. */
:root[data-theme='dark'][data-dark='black'] {
  --bg: #000; --bg-sunken: #000; --chrome: #000; --surface: #0c0c0d; --surface-2: #141416; --surface-solid: #141416;
  --hover: #19191c; --active: #232326; --selected: #1e1e21; --field: rgba(255, 255, 255, 0.07);
  --border: #1d1d20; --border-strong: #2c2c30; --text: #ffffff; --text-2: #e2e2e5; --text-3: #b2b2b8;
  --accent-soft: #1a2008; --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6); --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.7); --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.85);
}
:root[data-theme='dark'][data-dark='black'][data-glass='on'] {
  --surface: rgba(0, 0, 0, 0.8); --surface-2: rgba(12, 12, 13, 0.72); --bg: rgba(0, 0, 0, 0.62); --chrome: rgba(0, 0, 0, 0.7); --border: rgba(255, 255, 255, 0.07);
}
.mini-app.black { background: #000; }
.mini-app.black i { background: #111; }
.mini-app.black .m-rail { background: #000; box-shadow: inset 0 0 0 1px #1a1a1a; }

/* More accent colours. */
:root[data-accent='teal'] { --accent: #0d9488; --accent-hover: #0f766e; --accent-fg: #fff; --accent-text: #0f766e; --accent-soft: #e2f6f3; --accent-soft-text: #115e59; --unread: #0f766e; --accent-line: #0d9488; }
:root[data-accent='indigo'] { --accent: #4f46e5; --accent-hover: #4338ca; --accent-fg: #fff; --accent-text: #4338ca; --accent-soft: #ecebff; --accent-soft-text: #3730a3; --unread: #4338ca; --accent-line: #4f46e5; }
:root[data-accent='amber'] { --accent: #f59e0b; --accent-hover: #d97706; --accent-fg: #1a1200; --accent-text: #b45309; --accent-soft: #fff4dc; --accent-soft-text: #92400e; --unread: #b45309; --accent-line: #d97706; }
:root[data-accent='rose'] { --accent: #e11d48; --accent-hover: #be123c; --accent-fg: #fff; --accent-text: #be123c; --accent-soft: #ffe8ed; --accent-soft-text: #9f1239; --unread: #be123c; --accent-line: #e11d48; }
:root[data-theme='dark'][data-accent='teal'] { --accent: #14b8a6; --accent-hover: #2dd4bf; --accent-fg: #00201c; --accent-text: #5eead4; --accent-soft: #0a2522; --accent-soft-text: #99f6e4; --unread: #5eead4; --accent-line: #5eead4; }
:root[data-theme='dark'][data-accent='indigo'] { --accent: #6366f1; --accent-hover: #818cf8; --accent-text: #a5b4fc; --accent-soft: #15163a; --accent-soft-text: #c7d2fe; --unread: #a5b4fc; --accent-line: #a5b4fc; }
:root[data-theme='dark'][data-accent='amber'] { --accent: #fbbf24; --accent-hover: #fcd34d; --accent-fg: #1a1200; --accent-text: #fcd34d; --accent-soft: #2b2006; --accent-soft-text: #fde68a; --unread: #fcd34d; --accent-line: #fcd34d; }
:root[data-theme='dark'][data-accent='rose'] { --accent: #f43f5e; --accent-hover: #fb7185; --accent-text: #fda4af; --accent-soft: #330d16; --accent-soft-text: #fecdd3; --unread: #fda4af; --accent-line: #fda4af; }

/* More backgrounds: colour washes that suit light mode, and deep ones that suit Dark and Black. */
:root[data-backdrop='sunrise'] { --backdrop: radial-gradient(1000px 600px at 15% 0%, #ffd6a5 0%, transparent 60%), radial-gradient(900px 700px at 100% 100%, #ffadad 0%, transparent 60%), linear-gradient(160deg, #fff3e6, #ffe9ec); }
:root[data-backdrop='lavender'] { --backdrop: radial-gradient(1000px 600px at 80% 0%, #d8c8ff 0%, transparent 60%), radial-gradient(900px 700px at 0% 100%, #f1d4ff 0%, transparent 60%), linear-gradient(160deg, #f3eeff, #fbf0ff); }
:root[data-backdrop='mint'] { --backdrop: radial-gradient(1000px 600px at 10% 0%, #b8f2d8 0%, transparent 60%), radial-gradient(900px 700px at 100% 100%, #c8f0ff 0%, transparent 60%), linear-gradient(160deg, #eefbf5, #ecf9ff); }
:root[data-backdrop='sand'] { --backdrop: radial-gradient(1000px 600px at 90% 0%, #f3dfc1 0%, transparent 60%), radial-gradient(900px 700px at 0% 100%, #e9d8c4 0%, transparent 60%), linear-gradient(160deg, #faf4ea, #f4ece2); }
:root[data-backdrop='midnight'] { --backdrop: radial-gradient(1100px 700px at 10% -10%, #1e3a8a 0%, transparent 60%), radial-gradient(1000px 800px at 100% 100%, #4c1d95 0%, transparent 60%), linear-gradient(160deg, #050816, #0b0620); }
:root[data-backdrop='ember'] { --backdrop: radial-gradient(1100px 700px at 90% -10%, #7c2d12 0%, transparent 60%), radial-gradient(1000px 800px at 0% 100%, #831843 0%, transparent 60%), linear-gradient(160deg, #120605, #14050c); }
:root[data-backdrop='forest'] { --backdrop: radial-gradient(1100px 700px at 0% 0%, #14532d 0%, transparent 60%), radial-gradient(1000px 800px at 100% 100%, #134e4a 0%, transparent 60%), linear-gradient(160deg, #04100a, #03110f); }
:root[data-backdrop='graphite'] { --backdrop: radial-gradient(1100px 700px at 50% -20%, #3f3f46 0%, transparent 60%), linear-gradient(160deg, #0c0c0e, #18181b); }

/* Settings → Appearance → App icon */
.app-icon-pick { display: flex; flex-wrap: wrap; gap: 14px; }
.app-icon-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px; border: 2px solid transparent; border-radius: 16px; background: none; color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.app-icon-tile img { width: 64px; height: 64px; display: block; }
.app-icon-tile:hover { background: var(--hover); }
.app-icon-tile.on { border-color: var(--accent-line); color: var(--text); font-weight: 600; }

/* Support chat (views/support.js): bubbles and the chat window at the lower right. */
.support-dock { position: fixed; right: 20px; bottom: 20px; z-index: 130; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; -webkit-app-region: no-drag; app-region: no-drag; }
.support-dock > * { pointer-events: auto; }
.support-bubble { display: flex; align-items: center; gap: 10px; width: 320px; max-width: calc(100vw - 40px); padding: 10px 8px 10px 12px; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); animation: pillIn 0.2s ease-out; }
.support-bubble .sb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; border: 0; background: none; padding: 0; color: var(--text); font: inherit; cursor: pointer; }
.support-bubble .sb-text { font-size: 12.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sb-logo { width: 30px; height: 30px; border-radius: 8px; flex: none; display: block; }
.support-chat { width: 360px; max-width: calc(100vw - 40px); height: min(520px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--surface-solid); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pillIn 0.2s ease-out; }
.sc-head { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px; border-bottom: 1px solid var(--border); }
.sc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sc-title b { font-size: 14px; }
.sc-sub { font-size: 12px; color: var(--text-3); }
.sc-list { flex: 1; min-height: 0; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.sc-empty { margin: auto; text-align: center; color: var(--text-2); font-size: 13px; line-height: 1.45; padding: 0 10px; }
.sc-msg { max-width: 82%; display: flex; flex-direction: column; gap: 3px; }
.sc-msg.me { align-self: flex-end; align-items: flex-end; }
.sc-msg.them { align-self: flex-start; }
.sc-text { padding: 8px 12px; border-radius: 16px; font-size: 13.5px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.sc-msg.me .sc-text { background: var(--accent); color: var(--accent-fg); border-bottom-right-radius: 5px; }
.sc-msg.them .sc-text { background: var(--bg-sunken); color: var(--text); border-bottom-left-radius: 5px; }
.sc-time { font-size: 11px; color: var(--text-3); padding: 0 4px; }
.sc-foot { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.sc-input { flex: 1; border: 1.5px solid color-mix(in srgb, var(--text) 28%, transparent); border-radius: 16px; padding: 8px 14px; font: inherit; font-size: 13.5px; line-height: 1.35; background: var(--surface); color: var(--text); min-height: 38px; max-height: 60vh; outline: none; resize: vertical; overflow-y: auto; }
/* One clear border, no glow ring on top of it: darker grey at rest, the accent colour (a deep lime-olive in light mode)
   while typing. */
.sc-input:hover { border-color: color-mix(in srgb, var(--text) 40%, transparent); }
.sc-input:focus, .sc-input:focus-visible { border-color: var(--accent-text); box-shadow: none; }
:root[data-theme='dark'] .sc-input:focus, :root[data-theme='dark'] .sc-input:focus-visible { border-color: var(--accent-line); }
.sc-send { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.support-inbox { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
.si-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border: 0; background: none; border-radius: 10px; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.si-row:hover { background: var(--hover); }
.si-text { flex: 1; min-width: 0; }
.si-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.si-last { font-size: 12.5px; color: var(--text-2); }
.si-row.unread .si-last { color: var(--text); font-weight: 600; }
@media (max-width: 760px) { .support-dock { right: 10px; left: 10px; bottom: calc(70px + env(safe-area-inset-bottom)); align-items: stretch; } .support-chat, .support-bubble { width: auto; } }
/* An email being written sits at the lower right: support moves to the lower left so neither covers the other. */
body:has(.composer-dock .composer) .support-dock { right: auto; left: 76px; align-items: flex-start; }

/* A New message window you dragged somewhere: free-floating and resizable from its corner. */
.composer.floating { position: fixed; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); min-width: 380px; min-height: 300px; resize: both; overflow: hidden; border-radius: 14px; border-bottom: 1px solid var(--border); pointer-events: auto; }
.composer-head { -webkit-user-select: none; user-select: none; }
.composer:not(.min):not(.max):not(.inline) .composer-head { cursor: grab; }
.composer.floating .composer-head:active { cursor: grabbing; }
/* The separate email window: the email fills it, and its title bar is the window's. */
:root[data-compose-window='on'] body { overflow: hidden; }
.composer-dock.standalone { position: fixed; inset: 0; display: block; pointer-events: auto; }
.composer-dock.standalone .composer { width: 100%; max-width: none; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
:root[data-compose-window='on'] .composer-head { cursor: default; -webkit-app-region: drag; app-region: drag; height: 48px; }
:root[data-compose-window='on'] .composer-head button { -webkit-app-region: no-drag; app-region: no-drag; }
:root[data-compose-window='on'][data-native-inset='on'] .composer-head { padding-left: max(16px, calc(var(--lights-w, 80px) + 6px)); }
:root[data-compose-window='on'][data-native-frame='windows'] .composer-head { padding-right: 146px; }

/* Help → More flyout, Status, and the apps menu's "Soon" items. */
.help-more { position: relative; }
.help-fly { display: none; position: absolute; left: calc(100% + 4px); bottom: -6px; min-width: 240px; z-index: 2; overflow: visible; }
/* An invisible bridge over the gap, so the pointer never "leaves" on its way across. */
.help-fly::before { content: ''; position: absolute; top: 0; bottom: 0; left: -12px; width: 12px; }
.help-fly.flip { left: auto; right: calc(100% + 4px); }
.help-fly.flip::before { left: auto; right: -12px; }
/* A menu inside a frosted menu can't blur what's behind it, so it gets a solid background to stay readable. */
:root[data-glass="on"] .popover-layer .menu .help-fly, .help-fly { background: var(--surface-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
.help-more.open .help-fly { display: block; }
.help-fly .help-foot { padding: 4px 10px 6px; font-size: 12px; line-height: 1.5; }
.status-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; min-width: 0; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.status-dot.ok { background: #16a34a; }
.status-dot.bad { background: #d92d20; }
.menu-item.soon { color: var(--text-2); }
.menu-item.soon .r { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-text); }

/* Date groups that fold away, and a conversation's emails listed under it. */
.list-group.foldable { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; border-bottom: 1px solid var(--border); text-align: left; cursor: pointer; font-family: inherit; }
.list-group.foldable svg { width: 13px; height: 13px; color: var(--text-3); }
.list-group.foldable:hover { color: var(--text); }
.thread-row { position: relative; }
.thread-fold { position: absolute; left: 2px; top: 19px; width: 18px; height: 22px; padding: 0; border: 0; background: none; color: var(--text-3); display: grid; place-items: center; cursor: pointer; border-radius: 4px; z-index: 1; }
.thread-fold:hover { color: var(--text); background: var(--hover); }
.thread-fold svg { width: 12px; height: 12px; }
.thread-msgs { border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg-sunken) 60%, transparent); }
.thread-msg { padding: 7px 14px 7px calc(var(--row-avatar, 36px) + 30px); border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent); cursor: pointer; font-size: 13px; }
.thread-msg:hover { background: var(--hover); }
.thread-msg.selected { background: var(--selected); }
.thread-msg.unread b { color: var(--text); }
.tm-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tm-top b { font-weight: 500; min-width: 0; }
.thread-msg.unread .tm-top b { font-weight: 700; }
.tm-bottom { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; min-width: 0; }
.tm-bottom > span:first-child { flex: 1; min-width: 0; }
.tm-date { flex: none; color: var(--text-3); font-size: 12px; }
.menu.help-menu { overflow: visible; max-height: none; }

/* Support chat: the conversation list (☰), Open / Resolved labels, and support's Resolve button. */
.sc-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sc-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.sc-tools .btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.sc-status { flex: none; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; padding: 2px 7px; border-radius: 999px; }
.sc-status.open { background: color-mix(in srgb, #0ea5e9 16%, transparent); color: #0369a1; }
.sc-status.resolved { background: color-mix(in srgb, #16a34a 16%, transparent); color: #15803d; }
:root[data-theme='dark'] .sc-status.open { color: #7dd3fc; }
:root[data-theme='dark'] .sc-status.resolved { color: #86efac; }
.sc-note { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 12.5px; color: var(--text-2); background: var(--bg-sunken); border-top: 1px solid var(--border); }
.sc-note[hidden] { display: none; }
.sc-new { display: flex; justify-content: center; padding: 14px; flex: none; }
.sc-new .btn { border-radius: 999px; gap: 8px; }
.sc-convs { flex: 1; min-height: 0; padding: 0 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.sc-conv { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border: 0; background: none; border-radius: 10px; text-align: left; color: var(--text); font: inherit; cursor: pointer; }
.sc-conv:hover { background: var(--hover); }
.sc-conv-text { flex: 1; min-width: 0; }
.sc-conv-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; }
.sc-conv-bottom { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.sc-conv-bottom > span:first-child { flex: 1; min-width: 0; }
.sc-conv.unread .sc-conv-bottom > span:first-child { color: var(--text); font-weight: 600; }
.sc-empty .sb-logo { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 8px; }
.sc-empty b { display: block; margin-bottom: 6px; color: var(--text); }
.sc-empty span { display: block; }

/* About & legal (Help → More, Settings): the pages, read inside Arcana. */
.legal-modal .modal-body { display: flex; flex-direction: column; gap: 12px; height: min(78vh, 820px); }
.legal-body { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.legal-tabs { flex-wrap: wrap; align-self: flex-start; }
.legal-frame { flex: 1; min-height: 0; width: 100%; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
:root[data-theme='dark'] .legal-frame { background: var(--surface); }

/* Support's suggested replies: what kind of issue it is, and replies to send with a click. */
.sc-helper { flex: none; padding: 10px 12px 4px; border-top: 1px solid var(--border); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent); }
.sc-helper[hidden] { display: none; }
.sc-helper-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); min-width: 0; }
.sc-helper-head > svg { color: var(--accent-line); flex: none; }
.sc-summary { flex: 1; min-width: 0; }
.sc-cat { flex: none; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: var(--bg-sunken); color: var(--text-2); }
.sc-cat.bug { background: color-mix(in srgb, #d92d20 14%, transparent); color: #b42318; }
.sc-cat.how-to { background: color-mix(in srgb, #2563eb 14%, transparent); color: #1d4ed8; }
.sc-cat.account { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #b45309; }
.sc-cat.feature-request { background: color-mix(in srgb, #7c3aed 14%, transparent); color: #6d28d9; }
:root[data-theme='dark'] .sc-cat.bug { color: #ff9b8f; }
:root[data-theme='dark'] .sc-cat.how-to { color: #93c5fd; }
:root[data-theme='dark'] .sc-cat.account { color: #fcd34d; }
:root[data-theme='dark'] .sc-cat.feature-request { color: #c4b5fd; }
.sc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 6px; }
.sc-chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.sc-chip:hover { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }

/* Support chat: screenshots, and support's Chats / Issues tabs. */
.sc-foot .sc-clip { width: 36px; height: 36px; flex: none; border-radius: 50%; }
.sc-attach { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 12.5px; flex: none; }
.sc-attach[hidden] { display: none; }
.sc-attach img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.sc-img { display: block; max-width: 220px; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-sunken); }
.sc-img img { display: block; width: 100%; height: auto; max-height: 260px; object-fit: cover; }
.sc-msg.me .sc-img { align-self: flex-end; }
.sc-tabs { flex: none; }
.sc-tabs button { height: 26px; padding: 0 12px; font-size: 12.5px; }
.sc-issue-actions { gap: 8px; justify-content: flex-start; padding: 12px 14px; }
.sc-issue { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; }
.sc-issue:hover { background: var(--hover); }
.sc-issue-status { flex: none; width: auto; height: 28px; font-size: 12px; padding: 0 22px 0 8px; border-radius: 999px; }
.sc-issue-status.new { color: #b45309; }
.sc-issue-status.in-progress { color: #1d4ed8; }
.sc-issue-status.fixed { color: #15803d; }
:root[data-theme='dark'] .sc-issue-status.new { color: #fcd34d; }
:root[data-theme='dark'] .sc-issue-status.in-progress { color: #93c5fd; }
:root[data-theme='dark'] .sc-issue-status.fixed { color: #86efac; }

/* Issues: how serious, and the ones Arcana opened by itself. */
.sev-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; background: var(--text-3); }
.sev-dot.low { background: #94a3b8; }
.sev-dot.medium { background: #f59e0b; }
.sev-dot.high { background: #ea580c; }
.sev-dot.critical { background: #d92d20; box-shadow: 0 0 0 3px color-mix(in srgb, #d92d20 22%, transparent); }
.sc-auto { display: inline-flex; align-items: center; gap: 3px; flex: none; font-size: 11px; font-weight: 600; color: var(--accent-text); }
.sc-auto svg { width: 11px; height: 11px; }
.sc-issue-actions { flex-wrap: wrap; }
/* A conversation's fold arrow gets its own gutter instead of sitting on the sender's photo. */
.thread-row:has(> .thread-fold) { padding-left: 22px; }
/* Date headings (Today, Yesterday…) sit on their own shade, a step darker than the rows, so the groups read at a glance
   (with liquid glass too: a frosted tint rather than see-through). */
.list-group { background: color-mix(in srgb, var(--text) 5%, var(--surface)); color: var(--text-2); }
:root[data-theme='dark'] .list-group { background: color-mix(in srgb, var(--text) 7%, var(--surface)); }
:root[data-glass='on'] .list-group { background: color-mix(in srgb, var(--text) 6%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); }
.list-group.foldable:hover { background: color-mix(in srgb, var(--text) 9%, var(--surface)); }
:root[data-glass='on'] .list-group.foldable:hover { background: color-mix(in srgb, var(--text) 9%, transparent); }
/* A signature logo in dark lettering turns white while you write in dark mode (lib/darkmail.js markDarkLogos). */
:root[data-theme='dark'] .editor img[data-dark-logo] { filter: invert(1) hue-rotate(180deg); }
/* A dialog's main button is focused for Enter without drawing a ring around it (lib/ui.js modal). */
.quiet-focus:focus-visible { box-shadow: none; }
/* Dragging near the buttons never selects their words (the "Send" label showed highlighted after a drag). */
.composer-actions { -webkit-user-select: none; user-select: none; }
.sc-chip { display: inline-flex; align-items: center; gap: 5px; }
.sc-chip svg.i { width: 14px; height: 14px; color: var(--text-2); }
/* The notice on an email with signs of malware or phishing (views/mail.js threatNotice). */
.threat-notice { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid; font-size: 13px; line-height: 1.45; }
.threat-notice.danger { background: color-mix(in srgb, #d92d20 10%, var(--surface)); border-color: color-mix(in srgb, #d92d20 45%, transparent); color: var(--text); }
.threat-notice.warning { background: color-mix(in srgb, #f59e0b 12%, var(--surface)); border-color: color-mix(in srgb, #f59e0b 50%, transparent); color: var(--text); }
.threat-notice .tn-icon { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; }
.threat-notice.danger .tn-icon { background: #d92d20; }
.threat-notice.warning .tn-icon { background: #d97706; }
.threat-notice .tn-icon svg { width: 16px; height: 16px; }
.threat-notice .tn-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.threat-notice b { font-size: 13.5px; }
.threat-notice ul { margin: 0; padding-left: 18px; color: var(--text); }
.threat-notice .tn-advice { color: var(--text-2); }
.threat-notice li { margin: 2px 0; }
/* How sure each warning sign is (CONFIDENCE in views/mail.js): solid text, coloured edge. */
.threat-notice .tn-conf { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 999px; border: 1px solid; font-size: 11.5px; font-weight: 600; line-height: 18px; vertical-align: 1px; color: var(--text); background: var(--surface); cursor: help; }
.threat-notice .tn-conf.high { border-color: #d92d20; }
.threat-notice .tn-conf.medium { border-color: #d97706; }
.threat-notice .tn-conf.low { border-color: var(--border-strong, #8a8f98); }
.att.risky.danger { border-color: color-mix(in srgb, #d92d20 55%, transparent); background: color-mix(in srgb, #d92d20 7%, var(--surface)); }
.att.risky.danger .ic { color: #d92d20; }
.att.risky.warning { border-color: color-mix(in srgb, #f59e0b 60%, transparent); background: color-mix(in srgb, #f59e0b 8%, var(--surface)); }
.att.risky.warning .ic { color: #d97706; }
/* Attachment previews (lib/viewers.js): documents on a white page, spreadsheets with sheet tabs, slides as cards. */
.att-stage video { max-width: 100%; max-height: 100%; background: #000; }
.att-stage .att-audio { padding: 40px; }
.att-stage .att-doc { width: 100%; height: 100%; border: 0; background: #fff; }
.att-stage .att-text { align-self: stretch; justify-self: stretch; margin: 0; padding: 20px 24px; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 12.5px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); background: var(--surface); }
.att-stage .att-sheet { align-self: stretch; justify-self: stretch; display: flex; flex-direction: column; min-height: 0; background: #fff; }
.att-sheet-frame { flex: 1; min-height: 0; display: flex; }
.att-sheet-frame iframe { flex: 1; }
.att-sheet-tabs { display: flex; gap: 2px; padding: 4px 6px; overflow-x: auto; background: var(--surface-2); border-top: 1px solid var(--border); flex: none; }
.att-sheet-tabs button { border: 0; background: none; padding: 5px 12px; border-radius: 6px; font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.att-sheet-tabs button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.att-stage .att-slides { align-self: stretch; justify-self: stretch; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.att-slide { background: #fff; color: #1f2328; border-radius: 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); padding: 18px 22px; }
.att-slide h3 { margin: 4px 0 8px; font-size: 18px; }
.att-slide p { margin: 0 0 6px; font-size: 14px; }
.att-slide-n { font-size: 11px; font-weight: 600; color: #6e7781; text-transform: uppercase; letter-spacing: 0.04em; }
.att-slide-pics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.att-slide-pics img { max-height: 180px; max-width: 100%; border-radius: 6px; }
.att-stage .att-iwork { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; max-height: 100%; }
.att-stage .att-iwork img { max-height: calc(100% - 40px); }
.att-stage .att-zip { align-self: stretch; justify-self: stretch; overflow: auto; padding: 16px 20px; background: var(--surface); }
.att-zip ul { list-style: none; margin: 8px 0 0; padding: 0; }
.att-zip li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.att-note { font-size: 12.5px; color: var(--text-2); }
.att-loading { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; }
.att-loading .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent-line); animation: att-spin 0.8s linear infinite; }
@keyframes att-spin { to { transform: rotate(360deg); } }
/* Sender check card (views/mail.js senderCheckCard), on Junk mail. */
.threat-wrap { display: contents; }
.sender-check { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; line-height: 1.45; }
.sender-check.loading .sc2-head .faint::after { content: ''; display: inline-block; width: 10px; height: 10px; margin-left: 8px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent-line); animation: att-spin 0.8s linear infinite; vertical-align: -1px; }
.sc2-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sc2-head b { font-size: 13.5px; }
.sc2-who { margin-left: auto; font-size: 12px; }
.sc2-badge { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; flex: none; }
.sc2-badge svg { width: 14px; height: 14px; }
.sender-check.ok { border-color: color-mix(in srgb, #16a34a 45%, transparent); background: color-mix(in srgb, #16a34a 7%, var(--surface)); }
.sender-check.ok .sc2-badge { background: #16a34a; }
.sender-check.maybe { border-color: color-mix(in srgb, #f59e0b 50%, transparent); background: color-mix(in srgb, #f59e0b 8%, var(--surface)); }
.sender-check.maybe .sc2-badge { background: #d97706; }
.sender-check.bad { border-color: color-mix(in srgb, #d92d20 45%, transparent); background: color-mix(in srgb, #d92d20 8%, var(--surface)); }
.sender-check.bad .sc2-badge { background: #d92d20; }
.sc2-facts { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.sc2-facts li { display: flex; gap: 8px; align-items: baseline; }
.sc2-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; transform: translateY(-1px); }
.sc2-facts li.good .sc2-dot { background: #16a34a; }
.sc2-facts li.bad .sc2-dot { background: #d92d20; }
.sc2-facts li.meh .sc2-dot { background: #a1a1aa; }
.sc2-ai { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); color: var(--text-2); }
.sc2-ai svg { color: var(--accent-line); flex: none; margin-top: 2px; }
.sc2-foot { margin-top: 8px; font-size: 11.5px; }
.threat-notice .btn { margin-top: 6px; }
/* Spam / Blocked / Subscriptions / Trash: what the folder is for, and whole-folder actions (views/mail.js folderBar). */
.folder-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 10px 8px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; line-height: 1.4; }
.folder-bar > svg { flex: none; color: var(--text-3); }
.folder-bar .fb-text { flex: 1 1 200px; min-width: 0; }
.folder-bar .fb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.folder-bar .btn.danger { color: #d92d20; }
/* Settings → Phone & desktop apps: download steps. */
.dl-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-2); line-height: 1.45; }
.dl-other summary { cursor: pointer; font-size: 13px; color: var(--accent-text); font-weight: 600; }
/* A second button on a note (Send now, next to Undo): a small lime pill, so it reads as "go" beside Undo. */
.toast .act.act-2 { background: #d6ff3f; color: #0b0b0b; font-weight: 650; padding: 5px 12px; border-radius: 999px; }
.toast .act.act-2:hover { background: #e2ff72; }
.toast .act.act-2 + .act { margin-left: 4px; }

/* Undo Send card: frosted glass that follows the theme, a big draining ring with the seconds inside it. */
.toast.toast-card { gap: 14px; padding: 12px 12px 12px 14px; width: min(420px, calc(100vw - 32px)); min-width: 0; border-radius: 16px;
  background: rgba(255, 255, 255, 0.82); color: #0b0b0b; border: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(18px) saturate(1.6); -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18), 0 1px 0 rgba(255, 255, 255, 0.6) inset; }
.toast.toast-card .ring { width: 42px; height: 42px; }
.toast.toast-card .ring circle:not(.p) { stroke: rgba(0, 0, 0, 0.1); }
.toast.toast-card .ring circle.p { stroke: #0b0b0b; }
.toast.toast-card .ring .num { font-size: 15px; font-weight: 700; color: #0b0b0b; }
.toast.toast-card .t-text { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.toast.toast-card .t-title { font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.toast-card .t-detail { font-size: 12.5px; color: rgba(0, 0, 0, 0.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast.toast-card .act { margin-left: 0; color: #0b0b0b; flex: none; }
.toast.toast-card .act:hover { background: rgba(0, 0, 0, 0.06); }
.toast.toast-card .act.act-2 { margin-left: auto; background: #0b0b0b; color: #d6ff3f; padding: 8px 16px; }
.toast.toast-card .act.act-2:hover { background: #26262b; }
:root[data-theme='dark'] .toast.toast-card { background: rgba(30, 30, 35, 0.78); color: #f4f4f5; border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.06) inset; }
:root[data-theme='dark'] .toast.toast-card .ring circle:not(.p) { stroke: rgba(255, 255, 255, 0.14); }
:root[data-theme='dark'] .toast.toast-card .ring circle.p { stroke: #d6ff3f; }
:root[data-theme='dark'] .toast.toast-card .ring .num { color: #f4f4f5; }
:root[data-theme='dark'] .toast.toast-card .t-detail { color: rgba(255, 255, 255, 0.55); }
:root[data-theme='dark'] .toast.toast-card .act { color: #f4f4f5; }
:root[data-theme='dark'] .toast.toast-card .act:hover { background: rgba(255, 255, 255, 0.08); }
:root[data-theme='dark'] .toast.toast-card .act.act-2 { background: #d6ff3f; color: #0b0b0b; }
:root[data-theme='dark'] .toast.toast-card .act.act-2:hover { background: #e2ff72; }
@media (max-width: 520px) { .toast.toast-card { min-width: 0; width: calc(100vw - 32px); } }

/* ---- 1.27.0 ------------------------------------------------------------------------------------ */
.row-gap { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tag.danger { background: var(--danger-soft); color: var(--danger); }

/* Sign in with a passkey */
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.passkey-wrap { gap: 10px; }
.passkey-btn { gap: 8px; }

/* Search: what it was understood as */
.search-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 0 0 6px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-soft-text); font-size: 12.5px; }
.search-bar .sb-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.search-bar .faint { color: inherit; opacity: 0.8; }
.sb-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 550; border: 1px solid var(--border); }
.sb-saved { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }

/* Reading: quick replies, who's here, tasks, offline */
.quick-replies { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 2px; color: var(--accent-text); }
.quick-replies:empty { display: none; }
.qr-chip { display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent-soft-text); font: inherit; font-size: 13px; font-weight: 550; cursor: pointer; transition: transform 0.12s, background 0.12s; }
.qr-chip:hover { background: var(--accent); color: var(--accent-fg); transform: translateY(-1px); }
.presence-slot:empty { display: none; }
.banner.presence.replying { background: var(--warn-soft); color: var(--warn); }
.banner.presence b { color: inherit; }
.presence-line { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 12.5px; color: var(--text-3); }
.banner.task-banner { background: var(--success-soft); color: var(--success); }
.banner.task-banner b { color: var(--text); }
.banner.offline-note { background: var(--bg-sunken); color: var(--text-2); }
.net-pill { position: fixed; left: 50%; top: 10px; transform: translateX(-50%); z-index: 120; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #1c1c21; color: #f4f4f5; font-size: 12.5px; box-shadow: var(--shadow-md); }
.net-pill[hidden] { display: none; }

/* Contact card */
.menu.contact-card { width: 340px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.contact-card .cc-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 10px; }
.contact-card .cc-who { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.contact-card .cc-who b { font-size: 15px; }
.contact-card .cc-addr { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 12.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-card .cc-acts { display: flex; gap: 6px; padding: 0 16px 12px; flex-wrap: nowrap; }
.contact-card .cc-acts .btn { flex: 0 1 auto; min-width: 0; padding-left: 9px; padding-right: 9px; }
.contact-card .cc-acts .btn.icon { flex: none; margin-left: auto; }
.contact-card .cc-body { border-top: 1px solid var(--border); padding: 10px 8px 10px; max-height: 340px; overflow: auto; }
.contact-card .cc-loading { padding: 8px; font-size: 12.5px; }
.contact-card .cc-stats { display: flex; align-items: center; gap: 14px; padding: 2px 8px 8px; flex-wrap: wrap; }
.contact-card .cc-stat { display: flex; flex-direction: column; line-height: 1.2; }
.contact-card .cc-stat b { font-size: 14px; }
.contact-card .cc-stat span { font-size: 11px; color: var(--text-3); }
.contact-card .cc-sec { margin-top: 4px; }
.contact-card h6 { margin: 6px 8px 4px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.contact-card .cc-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; text-decoration: none; }
.contact-card .cc-item:hover { background: var(--hover); }
.contact-card .cc-item.unread { font-weight: 600; }
.contact-card .cc-item .faint { font-size: 11.5px; flex: none; }

/* Link check */
.link-check .lc-dest { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.link-check.danger .lc-dest { color: var(--danger); }
.link-check.warning .lc-dest { color: var(--warn); }
.link-check.ok .lc-dest { color: var(--success); }
.link-check .lc-dest b { color: var(--text); }
.lc-reasons { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.5; }
.lc-url { font-size: 12px; color: var(--text-3); word-break: break-all; background: var(--bg-sunken); padding: 8px 10px; border-radius: var(--radius-sm); max-height: 90px; overflow: auto; }

/* Team notes: @mentions */
.bubble .mention { color: var(--accent-text); font-weight: 600; background: var(--accent-soft); border-radius: 4px; padding: 0 3px; }
.menu.mention-menu { min-width: 240px; }

/* Settings: quiet hours */
.input.time-in { width: 120px; }
.setting.stack-setting { flex-direction: column; align-items: stretch; gap: 8px; }

/* Tools pages */
.tools-page .inner { max-width: 920px; }
.tools-page .segmented { margin-bottom: 14px; }
.tools-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 48px 16px; color: var(--text-3); text-align: center; }
.tools-empty svg { width: 34px; height: 34px; color: var(--text-3); }
.tools-empty h3 { margin: 6px 0 0; color: var(--text); }
.task-add { gap: 10px; }
.task-add .input.task-due { width: 160px; flex: none; }
.task-list { display: flex; flex-direction: column; }
.task-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); }
.task-row:first-child { border-top: 0; }
.task-row .task-main { min-width: 0; }
.task-title { display: block; outline: none; font-size: 14px; line-height: 1.4; border-radius: 4px; padding: 1px 2px; margin: -1px -2px; overflow-wrap: anywhere; }
.task-title:focus { background: var(--field); }
.task-row.done .task-title { text-decoration: line-through; color: var(--text-3); }
.task-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 3px; font-size: 12.5px; color: var(--text-3); }
.task-meta .linkish { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-when { display: inline-flex; align-items: center; gap: 4px; }
.task-when.late { color: var(--danger); font-weight: 600; }
.task-check { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--border-strong); background: none; display: grid; place-items: center; cursor: pointer; color: var(--accent-fg); padding: 0; }
.task-check:hover { border-color: var(--accent); }
.task-check.on { background: var(--accent); border-color: var(--accent); }
.task-check svg { width: 12px; height: 12px; }
.task-done summary { cursor: pointer; list-style: none; }
.task-done summary::-webkit-details-marker { display: none; }
.files-search { gap: 10px; }
.files-search .files-person { max-width: 260px; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 4px; }
.file-tile { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.file-open { display: grid; place-items: center; height: 120px; background: var(--bg-sunken); color: var(--text-3); text-decoration: none; }
.file-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-ic svg { width: 34px; height: 34px; }
.file-ic.k-pdf { color: #dc2626; } .file-ic.k-doc { color: #2563eb; } .file-ic.k-sheet { color: #16a34a; } .file-ic.k-slides { color: #ea580c; } .file-ic.k-zip { color: #78716c; }
.file-info { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 12px; min-width: 0; }
.file-info b { font-size: 13px; }
.file-info .faint { font-size: 11.5px; }
.file-acts { display: flex; gap: 6px; margin-top: 6px; }
.files-more { display: flex; justify-content: center; padding: 16px 0; }
.files-more:empty { display: none; }
.cl-summary { margin: 0 0 10px; }
.cl-list { display: flex; flex-direction: column; }
.cl-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); transition: opacity 0.25s; }
.cl-row:first-child { border-top: 0; }
.cl-row.gone { opacity: 0.35; pointer-events: none; }
.cl-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.cl-main .faint { font-size: 12px; }
.cl-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.cl-stats .low { color: var(--warn); font-weight: 600; }
.cl-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.cl-rule-form { flex-wrap: wrap; gap: 8px; }
.cl-rule-form .input { width: 240px; }
.act-filters { flex-wrap: wrap; gap: 8px; }
.act-list { display: flex; flex-direction: column; }
.act-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 13.5px; }
.act-row:first-child { border-top: 0; }
.act-ic { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-sunken); color: var(--text-2); }
.act-ic.a-trash, .act-ic.a-delete_forever, .act-ic.a-empty, .act-ic.a-to_trash { background: var(--danger-soft); color: var(--danger); }
.act-ic.a-send, .act-ic.a-reply { background: var(--accent-soft); color: var(--accent-soft-text); }
.act-subj { color: var(--text-2); }
.act-meta { font-size: 11.5px; margin-top: 2px; }

/* My Day: tasks due */
.md-tasks { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--bg-sunken); }
.md-tasks-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin-bottom: 6px; }
.md-tasks-head a { font-size: 12px; color: var(--accent-text); }
.md-task { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.md-task .linkish { color: var(--text); text-align: left; }
.md-task.late .linkish { color: var(--danger); }
.md-task .task-check { width: 16px; height: 16px; }

@media (max-width: 760px) {
  .cl-row, .task-row, .act-row { padding: 10px 12px; }
  .cl-acts .btn.sm:not(.icon) { padding: 0 8px; }
  .files-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .search-bar { flex-wrap: wrap; }
}
.banner.task-banner { flex-wrap: wrap; row-gap: 8px; }
.banner.task-banner .grow { min-width: 180px; }
.banner.task-banner .btn { flex: none; }
.qr-chip.ask { gap: 6px; background: none; }
.qr-wait { font-size: 12.5px; }

/* Search: a frosted glass pill in every theme (light, dark, black, with or without a photo), glowing in the accent
   colour while you type. The dropdown under it is frosted to match. */
:root { --search-fill: rgba(255, 255, 255, 0.62); --search-edge: rgba(15, 15, 25, 0.09); --search-hi: rgba(255, 255, 255, 0.9); --search-shadow: 0 1px 2px rgba(20, 20, 40, 0.06), 0 6px 18px rgba(20, 20, 40, 0.06); }
:root[data-theme='dark'] { --search-fill: rgba(255, 255, 255, 0.07); --search-edge: rgba(255, 255, 255, 0.11); --search-hi: rgba(255, 255, 255, 0.07); --search-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25); }
:root[data-theme='dark'][data-dark='black'] { --search-fill: rgba(255, 255, 255, 0.06); --search-edge: rgba(255, 255, 255, 0.1); --search-hi: rgba(255, 255, 255, 0.05); }
.appbar-search .input, :root[data-glass='on'] .appbar-search .input {
  height: 36px; border-radius: 999px; background: var(--search-fill); border: 1px solid var(--search-edge);
  box-shadow: inset 0 1px 0 var(--search-hi), var(--search-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.appbar-search .input:hover { background: color-mix(in srgb, var(--search-fill) 70%, var(--text) 4%); }
.appbar-search .input:focus, :root[data-glass='on'] .appbar-search .input:focus {
  outline: none; border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--search-fill) 85%, var(--surface));
  box-shadow: inset 0 1px 0 var(--search-hi), 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent), var(--search-shadow);
}
.appbar-search .kbd { border-radius: 6px; background: color-mix(in srgb, var(--text) 7%, transparent); border-color: transparent; }
.search-drop { background: color-mix(in srgb, var(--surface-solid) 84%, transparent); border-color: var(--search-edge); border-radius: 16px;
  -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6); }

/* Date headings in the message list (Pinned, Today, Yesterday…): their own clearly lighter band, edge to edge, so the
   days stand apart from the emails — strongest in Dark and Black, where it matters most. */
.list-group, :root[data-glass='on'] .list-group { border-bottom: 0; color: var(--text); font-weight: 600; letter-spacing: 0.01em; }
:root[data-theme='dark'] .list-group { background: #34363c; color: #e9eaec; }
:root[data-theme='dark'][data-dark='black'] .list-group { background: #1b1b1e; }
:root[data-theme='dark'][data-glass='on'] .list-group { background: rgba(255, 255, 255, 0.11); }
:root[data-theme='dark'][data-dark='black'][data-glass='on'] .list-group { background: rgba(255, 255, 255, 0.08); }
:root:not([data-theme='dark']) .list-group { background: color-mix(in srgb, var(--text) 6%, var(--surface)); color: var(--text-2); }
:root:not([data-theme='dark'])[data-glass='on'] .list-group { background: rgba(255, 255, 255, 0.55); }
.list-group.foldable:hover, :root[data-glass='on'] .list-group.foldable:hover { filter: brightness(1.08); }
:root:not([data-theme='dark']) { --search-fill: rgba(255, 255, 255, 0.78); }
:root:not([data-theme='dark'])[data-glass='on'] .list-group { background: rgba(20, 20, 40, 0.06); }
/* Light theme over a photo: the top bar's and command bar's dark text and icons get a soft light halo, so they stay
   readable over a dark sky without a band across the window (a backing strip cut through the side rail). */
:root:not([data-theme='dark'])[data-glass='on'] .shell > .appbar .appbar-brand,
:root:not([data-theme='dark'])[data-glass='on'] .shell > .appbar .appbar-right {
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.95), 0 0 2px rgba(255, 255, 255, 0.9);
}
:root:not([data-theme='dark'])[data-glass='on'] .shell > .appbar svg { filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.95)); }
/* "Folders": your own folders under an address's built-in ones, so they don't look like they're inside Trash. */
.nav-caption { margin: 8px 0 2px 14px; font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
/* Move emails like this */
.fl-kinds { gap: 8px; }
.fl-opt { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.fl-opt b { font-weight: 600; word-break: break-all; }
.fl-subj { display: flex; flex-direction: column; gap: 6px; }
.fl-subj .input { margin-left: 24px; width: calc(100% - 24px); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }

/* Motion (lib/motion.js): Sync spins while it checks; other icons give a short nod when clicked. */
.is-spinning svg[data-icon='refresh'] { animation: spin 0.9s linear infinite; transform-origin: 50% 50%; }
@keyframes ic-pop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 70% { transform: scale(0.92); } 100% { transform: scale(1); } }
@keyframes ic-tilt { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-18deg); } 65% { transform: rotate(10deg); } }
@keyframes ic-fly { 0% { transform: translate(0, 0); } 45% { transform: translate(5px, -5px); opacity: 0.4; } 46% { transform: translate(-4px, 4px); } 100% { transform: translate(0, 0); opacity: 1; } }
@keyframes ic-drop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(3px); } 70% { transform: translateY(-1px); } }
@keyframes ic-tip { 0%, 100% { transform: rotate(0); } 35% { transform: rotate(-12deg) translateY(-1px); } 70% { transform: rotate(6deg); } }
@keyframes ic-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
@keyframes ic-twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.25) rotate(20deg); } }
@keyframes ic-turn { from { transform: rotate(0); } to { transform: rotate(180deg); } }
@keyframes ic-nudge { 0%, 100% { transform: translateX(0); } 40% { transform: translateX(-3px); } 70% { transform: translateX(1px); } }
svg[data-icon].ic-pop { animation: ic-pop 0.45s ease; }
svg[data-icon].ic-tilt { animation: ic-tilt 0.5s ease; transform-origin: 50% 80%; }
svg[data-icon].ic-fly { animation: ic-fly 0.5s ease; }
svg[data-icon].ic-drop { animation: ic-drop 0.45s ease; }
svg[data-icon].ic-tip { animation: ic-tip 0.5s ease; transform-origin: 50% 90%; }
svg[data-icon].ic-ring { animation: ic-ring 0.65s ease; transform-origin: 50% 10%; }
svg[data-icon].ic-twinkle { animation: ic-twinkle 0.55s ease; }
svg[data-icon].ic-turn { animation: ic-turn 0.45s ease; }
svg[data-icon].ic-nudge { animation: ic-nudge 0.4s ease; }
/* Every icon button gives a little when pressed. */
.btn.icon:active svg, .cmd:active svg, .rb:active svg, .rail-btn:active svg { transform: scale(0.88); transition: transform 0.08s; }
@media (prefers-reduced-motion: reduce) { .is-spinning svg[data-icon='refresh'], svg[data-icon][class*='ic-'] { animation: none !important; } }
.dl-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dl-row .hint { margin-top: 3px; }

/* Like Outlook's themes: the photo is shown softened under the whole window, an even wash with no band or edge, so
   the text and icons on it (top bar, command bar, rail) are always the theme's own solid colour and never fight the
   picture. Light: a white wash; Dark and Black: a dark one. The picture still shows clearly, just calmer. */
:root[data-glass='on'] { --photo-wash: rgba(255, 255, 255, 0); } /* Light shows the photo as it is */
/* (Dark photos already carry a 64% dark wash in their --backdrop; Black goes a little further.) */
:root[data-theme='dark'][data-glass='on'] { --photo-wash: rgba(0, 0, 0, 0); }
:root[data-theme='dark'][data-dark='black'][data-glass='on'] { --photo-wash: rgba(0, 0, 0, 0.25); }
:root[data-glass='on']:not([data-backdrop='none']) .shell { background: linear-gradient(var(--photo-wash), var(--photo-wash)), var(--backdrop); }
/* Commands like Outlook's: one solid colour, icons a touch bigger. */
:root[data-glass='on'] .ribbon .rb > svg:first-child { width: 18px; height: 18px; }
.app-orgs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 6px; }


/* The command bar over a background photo: nothing behind it (no box, band or shadow). The commands themselves are
   strong enough to read on any picture: the theme's full text colour, a little heavier, and the ones that need an
   email selected only slightly dimmed. */
:root[data-glass='on'] .ribbon {
  margin: 0; padding: 4px 10px 6px 2px; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
}
:root[data-glass='on'] .ribbon .rb { color: var(--text); font-weight: 500; text-shadow: none; }
:root[data-glass='on'] .ribbon .rb svg { filter: none; }
:root[data-glass='on'] .ribbon .rb > svg:first-child, :root[data-glass='on'] .ribbon .rb .chev { color: var(--text); }
:root[data-glass='on'] .ribbon .rb:disabled { opacity: 0.85; }
:root[data-glass='on'] .ribbon .rb:not(:disabled):hover { background: var(--hover); }

/* The rail over a photo: a solid frosted panel too, so its icons are always the theme's own (dark in light mode,
   light in dark), never lost in the picture. */
:root[data-glass='on'] { --rail-glass: rgba(255, 255, 255, 0.78); }
:root[data-theme='dark'][data-glass='on'] { --rail-glass: rgba(30, 31, 35, 0.8); }
:root[data-theme='dark'][data-dark='black'][data-glass='on'] { --rail-glass: rgba(0, 0, 0, 0.78); }
:root[data-glass='on'] .rail .rail-btn { color: var(--text-2); }
:root[data-glass='on'] .rail .rail-btn.on, :root[data-glass='on'] .rail .rail-btn:hover { color: var(--text); }

/* Shared mailboxes: who on the team has seen an email (separate from read/unread). */
.seen-by-stack { display: inline-flex; align-items: center; margin-left: 4px; flex: none; }
.seen-by-stack .avatar.xs { width: 16px; height: 16px; font-size: 7.5px; box-shadow: 0 0 0 1.5px var(--surface, var(--bg)); }
.seen-by-stack .avatar.xs + .avatar.xs { margin-left: -5px; }
.seen-by-stack .more { font-size: 11px; color: var(--text-3); margin-left: 3px; }
.msg-head .seen-by { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 11.5px; color: var(--text-3); }
.msg.collapsed .msg-head .seen-by { display: none; }

/* Warning cards that fold to their title (email safety notice, sender check). */
.foldable .fold-head { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; border-radius: 6px; outline-offset: 3px; }
.foldable .fold-head b { flex: 0 1 auto; }
.foldable .fold-count { font-size: 12px; color: var(--text-2); }
.foldable .fold-arrow { margin-left: auto; flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--text-2); transition: transform .2s ease, background .15s; }
.foldable .fold-head:hover .fold-arrow { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.foldable:not(.folded) .fold-arrow { transform: rotate(180deg); }
.foldable .fold-body { display: flex; flex-direction: column; gap: 4px; }
.foldable.folded .fold-body { display: none; }
.foldable:not(.folded) .fold-count { display: none; }
.threat-notice.foldable { align-items: center; }
.threat-notice.foldable:not(.folded) { align-items: flex-start; }
.threat-notice.foldable .tn-text { flex: 1; }
.sender-check.foldable .sc2-head { flex-wrap: nowrap; }
.sender-check.foldable .sc2-head .sc2-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sender-check.foldable .fold-body { margin-top: 8px; }

/* Light text on a dark background looks thin and dim with "antialiased" smoothing on a Mac: use the normal,
   fuller rendering in Dark and Black so white text reads as white. */
:root[data-theme='dark'] body { -webkit-font-smoothing: auto; -moz-osx-font-smoothing: auto; }

/* ---- Readability (1.29.1): for everyone, including people who don't see small or faint text well. --------------
   Text a little heavier, secondary greys closer to the main colour, and panels over a photo solid enough that the
   picture never washes the text out. */
body { font-weight: 500; }
.nav a, .nav button.nav-item, .thread-row .who, .cmd, .rb { font-weight: 500; }
.thread-row.unread .who, .thread-row.unread .subj, .nav a.unread-strong, .nav a.unread-strong .count { font-weight: 700; }
/* Colour first: text is real black in Light and real white in Dark and Black; secondary text only a shade off. */
:root { --text: #000000; --text-2: #141414; --text-3: #34342f; }
:root[data-theme='dark'] { --text: #ffffff; --text-2: #f4f5f7; --text-3: #d6d9dd; }
:root[data-theme='dark'][data-dark='black'] { --text: #ffffff; --text-2: #f4f4f6; --text-3: #d6d6da; }
.nav a > svg, .nav button.nav-item > svg { color: var(--text); }
.pane-tip { color: var(--text-2); }
/* Glass panels stay see-through and frosted (the photo shows softly through them); the heavy blur behind is what
   keeps their text readable, together with the true black / white text colours. */
:root[data-glass='on'] {
  --glass-fill: rgba(255, 255, 255, 0.62); --glass-thin: rgba(255, 255, 255, 0.5); --glass-thick: rgba(255, 255, 255, 0.72);
  --surface: rgba(255, 255, 255, 0.64); --surface-2: rgba(250, 250, 248, 0.56); --chrome: rgba(241, 241, 238, 0.56);
  --glass-blur: blur(34px) saturate(1.7);
}
:root[data-theme='dark'][data-glass='on'] {
  --glass-fill: rgba(26, 27, 31, 0.62); --glass-thin: rgba(24, 25, 29, 0.55); --glass-thick: rgba(18, 18, 22, 0.74);
  --surface: rgba(32, 33, 37, 0.66); --surface-2: rgba(42, 43, 48, 0.58); --chrome: rgba(24, 25, 29, 0.58);
}
:root[data-theme='dark'][data-dark='black'][data-glass='on'] {
  --glass-fill: rgba(0, 0, 0, 0.66); --glass-thin: rgba(0, 0, 0, 0.6); --glass-thick: rgba(0, 0, 0, 0.78);
  --surface: rgba(0, 0, 0, 0.7); --surface-2: rgba(12, 12, 13, 0.62); --chrome: rgba(0, 0, 0, 0.62);
}
:root[data-glass='on'] .sidebar, :root[data-glass='on'] .list-pane, :root[data-glass='on'] .reader, :root[data-glass='on'] .myday {
  -webkit-backdrop-filter: blur(34px) saturate(1.7); backdrop-filter: blur(34px) saturate(1.7);
}
/* Sender check → "Who they are": the person's professional profiles, each with what ties it to them. */
.sender-check.someone { border-color: color-mix(in srgb, var(--accent-line) 40%, var(--border)); }
.sender-check.someone .sc2-badge { background: color-mix(in srgb, var(--accent-line) 75%, #3b82f6); }
.sc2-person { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.sc2-person .pc-head { display: flex; align-items: center; gap: 6px; }
.sc2-person .pc-summary { display: flex; gap: 6px; align-items: flex-start; color: var(--text); }
.sc2-person .pc-summary svg { flex: none; margin-top: 2px; color: var(--accent-text); }
.sc2-person .pc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sc2-person .pc-link { display: flex; gap: 10px; align-items: flex-start; padding: 7px 9px; border-radius: 9px; background: color-mix(in srgb, var(--text) 4%, transparent); }
.sc2-person .pc-kind { flex: none; min-width: 74px; font-size: 11.5px; font-weight: 700; color: var(--text-2); padding-top: 1px; }
.sc2-person .pc-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sc2-person .pc-url { color: var(--accent-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.sc2-person .pc-url:hover { text-decoration: underline; }
.sc2-person .pc-why { font-size: 12px; color: var(--text-2); }
.sc2-person .pc-tie { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; font-weight: 700; color: #15803d; }
:root[data-theme='dark'] .sc2-person .pc-tie { color: #4ade80; }
.sc2-person .pc-tie svg { width: 13px; height: 13px; }
.sc2-person .pc-maybe .pc-sub { font-size: 12px; font-weight: 700; color: var(--text-2); margin: 2px 0 6px; }
.sc2-person .tie-weak { opacity: 0.85; }
.sc2-person .pc-search { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sc2-person .pc-note { font-size: 12px; }
.sc2-person .pc-none { font-size: 12.5px; }

/* Zoomed in (or a narrow pane): the subject keeps a readable width and the buttons move under it; the sender's line
   lets the date and buttons wrap below instead of squeezing the name into a column. */
.convo-title { flex-wrap: wrap; }
.convo-title h2 { flex: 1 1 14em; }
.msg-head { flex-wrap: wrap; }
.msg-head > .grow { flex: 1 1 12em; }

/* My Day agenda: two clear shades, so each date heading stands apart from its events: the heading on a lighter band,
   the events on a deeper one (Light: white over soft grey; Dark and Black: a raised grey over the panel's own dark).
   Headings stay solid because they stick to the top while the list scrolls under them. */
.ag-day { background: rgba(28, 28, 40, 0.07); }
.ag-day-title { background: rgba(255, 255, 255, 0.97); }
/* Over a photo: frosted white headings on a slightly darker frost, so the two shades stay but it's still glass. */
:root[data-glass='on'] .ag-day-title { background: rgba(255, 255, 255, 0.66); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
:root[data-glass='on']:not([data-theme='dark']) .ag-day { background: rgba(28, 28, 40, 0.1); }
:root[data-theme='dark'] .ag-day { background: transparent; }
:root[data-theme='dark'] .ag-day-title, :root[data-theme='dark'][data-glass='on'] .ag-day-title { background: rgba(62, 64, 71, 0.97); }
:root[data-theme='dark'][data-dark='black'] .ag-day-title, :root[data-theme='dark'][data-dark='black'][data-glass='on'] .ag-day-title { background: rgba(38, 38, 42, 0.98); }
.ag-day-title { padding-bottom: 8px; }
.ag-day-title + .ag-event, .ag-day-title + .ag-empty { margin-top: 6px; }
.ag-day:last-child { padding-bottom: 6px; }

/* Dark and Black: My Day uses the same two shades as the mail list on the left: the list's panel for the events and
   its date-group band ("Today", "Yesterday") for the day headings. */
:root[data-theme='dark'][data-glass='on'] .myday { background: var(--glass-thick); }
:root[data-theme='dark'] .ag-day { background: transparent; }
:root[data-theme='dark'] .ag-day-title { background: #34363c; }
:root[data-theme='dark'][data-dark='black'] .ag-day-title { background: #1b1b1e; }
:root[data-theme='dark'][data-glass='on'] .ag-day-title { background: rgba(255, 255, 255, 0.11); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); }
:root[data-theme='dark'][data-dark='black'][data-glass='on'] .ag-day-title { background: rgba(255, 255, 255, 0.08); }

/* Text centred in its button or badge by the letters themselves (the font sits a little high or low in its box). */
.btn, .badge, .rail-badge, .update-pill, .rb, .tag, .chip, .segmented button { text-box: trim-both cap alphabetic; }
.rail-badge { line-height: 1; }

/* Month view: the week number sits beside the day number, never under the events. */
.month-cell .mc-top { display: flex; align-items: center; gap: 6px; min-height: 24px; flex: none; }
.month-cell .mc-top .wk-num { display: inline; font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: 0.02em; }

/* Calendar side panel: drag its edge to resize; the mini calendar's days grow with it. */
.cal-resize { position: absolute; top: 0; bottom: 0; left: calc(var(--cal-side-w, 250px) - 4px); width: 8px; cursor: col-resize; z-index: 5; touch-action: none; }
.cal-resize::after { content: ''; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; border-radius: 2px; background: transparent; transition: background 0.15s; }
.cal-resize:hover::after, .resizing .cal-resize::after { background: var(--accent-line); }
.resizing, .resizing * { cursor: col-resize !important; user-select: none !important; }
.cal-side { --mini-cell: clamp(26px, calc((var(--cal-side-w, 250px) - 40px) / 7 - 4px), 46px); }
.cal-side .mini-grid button { height: calc(var(--mini-cell) + 4px); font-size: clamp(12.5px, calc(var(--mini-cell) * 0.42), 16px); }
.cal-side .mini-grid button > span { width: var(--mini-cell); height: var(--mini-cell); }
.cal-side .mini-grid .dow { font-size: clamp(11px, calc(var(--mini-cell) * 0.34), 13px); }
@media (max-width: 760px) { .cal-resize { display: none; } }

/* Who they are: "Verified" (independent evidence) stands apart from links the person only provided. */
.sc2-person .pc-tie.provided { color: var(--text-2); font-weight: 600; }
/* Settings → Profile: photo, sender identity, photos of people who email you (views/settings-identity.js). */
.id-photo { gap: 18px; align-items: center; }
.id-status { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text); max-width: 560px; }
.id-status svg.i { flex: none; margin-top: 2px; width: 15px; height: 15px; }
.id-list { display: flex; flex-direction: column; }
.id-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 0; }
.id-row > .grow { min-width: 220px; }
.id-row > .id-actions { margin-left: auto; }
.id-row + .id-row { border-top: 1px solid var(--border); }
.id-sub { font-size: 12.5px; color: var(--text-2); }
.id-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.id-actions .select { width: auto; min-width: 150px; }
.id-contacts { border-top: 1px solid var(--border); }
.id-contact-head { justify-content: space-between; }
.id-contacts .input { max-width: 320px; }
.id-who { gap: 12px; align-items: center; }
.id-channels { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.id-channel { display: flex; align-items: flex-start; gap: 12px; padding: 11px 13px; font-size: 13px; color: var(--text); }
.id-channel + .id-channel { border-top: 1px solid var(--border); }
.id-chip { flex: none; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text); white-space: nowrap; }
.id-chip.ok { border-color: var(--success); color: var(--success); }
.id-chip.warn { border-color: #d97706; color: #b45309; }
.id-chip.bad { border-color: var(--danger); color: var(--danger); }
@media (max-width: 640px) { .id-row { flex-wrap: wrap; } .id-actions { width: 100%; justify-content: flex-start; } }
