/* ================= EderveenGroup ================= */
:root {
    --accent: #4c8dff;
    --on-accent: #ffffff;
    --bg: #0b0d12;
    --surface: #12151c;
    --surface-2: #181c25;
    --surface-3: #1f2430;
    --hover: rgba(150, 175, 230, 0.045);
    --active: rgba(150, 175, 230, 0.085);
    --line: rgba(160, 185, 235, 0.08);
    --line-2: rgba(160, 185, 235, 0.14);
    --text: #f1f4f9;
    --text-2: #a3acbd;
    --text-3: #6b7487;
    --danger: #ff6b7a;
    --success: #34d399;
    --warn: #fbbf24;
    --accent-ink: color-mix(in srgb, var(--accent) 82%, #fff);
    --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
    --accent-line: color-mix(in srgb, var(--accent) 42%, transparent);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--line);
    --shadow-md: 0 12px 32px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--line);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ui: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --display: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
    --row-pad: 12px;
    --grain-opacity: 0.035;
    color-scheme: dark;
}
:root[data-theme='light'] {
    --bg: #eef1f6;
    --surface: #ffffff;
    --surface-2: #f5f7fa;
    --surface-3: #eaeef4;
    --hover: rgba(15, 23, 42, 0.035);
    --active: rgba(15, 23, 42, 0.06);
    --line: rgba(15, 23, 42, 0.08);
    --line-2: rgba(15, 23, 42, 0.14);
    --text: #0f172a;
    --text-2: #475569;
    --text-3: #8a94a6;
    --danger: #e5394d;
    --success: #059669;
    --warn: #d97706;
    --shadow-lg: 0 30px 80px -24px rgba(15, 23, 42, 0.25), 0 0 0 1px var(--line);
    --shadow-md: 0 12px 30px -14px rgba(15, 23, 42, 0.2), 0 0 0 1px var(--line);
    --grain-opacity: 0.03;
    --accent-ink: color-mix(in srgb, var(--accent) 85%, #000);
    color-scheme: light;
}
:root[data-density='compact'] { --row-pad: 7px; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    font-family: var(--ui);
    font-size: 14px;
    letter-spacing: -0.006em;
    color: var(--text);
    background:
        radial-gradient(1100px 520px at 12% -12%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 62%),
        radial-gradient(900px 600px at 110% 120%, color-mix(in srgb, var(--accent) 5%, transparent), transparent 60%),
        var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
    overflow: hidden;
}
body::before {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
.hidden { display: none !important; }
.i { width: 18px; height: 18px; flex: none; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--text-3); }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.serif { font-family: var(--display); font-weight: 400; letter-spacing: 0; }

/* ---------- controls ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 36px; padding: 0 14px; border-radius: 10px; font-weight: 500; white-space: nowrap;
    background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
    transition: background .2s var(--ease), box-shadow .2s var(--ease), transform .12s var(--ease), color .2s;
}
.btn:hover { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn:active { transform: scale(.97); }
.btn .i { width: 16px; height: 16px; }
.btn-primary {
    background: var(--accent); color: var(--on-accent); font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 22px -10px var(--accent);
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 10px 26px -10px var(--accent); }
.btn-danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.icon-btn {
    display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
    color: var(--text-2); position: relative; transition: background .18s var(--ease), color .18s, transform .12s var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.active { color: var(--accent-ink); }
.icon-btn:disabled { opacity: .35; pointer-events: none; }
.icon-btn[data-tip]:hover::after {
    content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 7px;
    white-space: nowrap; z-index: 50; pointer-events: none; box-shadow: var(--shadow-md); animation: tipIn .18s var(--ease) .35s both;
}
@keyframes tipIn { from { opacity: 0; transform: translate(-50%, -3px); } }
.input {
    width: 100%; height: 40px; padding: 0 13px; border-radius: 10px; background: var(--surface-2);
    border: 0; box-shadow: inset 0 0 0 1px var(--line); outline: none; transition: box-shadow .2s var(--ease), background .2s;
}
.input::placeholder { color: var(--text-3); }
.input:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.input:focus { background: var(--surface); box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 0 4px var(--accent-soft); }
kbd {
    font-family: var(--ui); font-size: 10.5px; font-weight: 500; min-width: 20px; height: 20px; padding: 0 5px;
    display: inline-grid; place-items: center; border-radius: 5px; color: var(--text-3);
    background: var(--surface-3); box-shadow: inset 0 -1px 0 var(--line-2), inset 0 0 0 1px var(--line);
}
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 32px; height: 32px; flex: none; display: block; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.wordmark { font-family: var(--display); font-size: 22px; line-height: 1; letter-spacing: -0.01em; white-space: nowrap; }
.wordmark em { color: var(--accent-ink); }

/* ---------- login ---------- */
.login-split { position: relative; z-index: 1; height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; overflow: auto; }
.login-art {
    position: relative; overflow: hidden; padding: 44px 56px; display: flex; flex-direction: column; justify-content: space-between;
    border-right: 1px solid var(--line);
    background: radial-gradient(700px 500px at 30% 70%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
}
.login-art .rings { position: absolute; right: -22%; top: 50%; width: 120%; aspect-ratio: 1; transform: translateY(-50%); color: var(--accent-ink); opacity: .6; pointer-events: none; }
@keyframes turn { to { transform: rotate(360deg); } }
.login-art h1 { font-family: var(--display); font-weight: 400; font-size: clamp(48px, 6vw, 84px); line-height: .98; letter-spacing: -0.02em; margin: 0 0 22px; position: relative; }
.login-art h1 em { color: var(--accent-ink); }
.login-art p { color: var(--text-2); max-width: 400px; font-size: 15px; line-height: 1.6; margin: 0; position: relative; }
.login-art .foot { display: flex; gap: 22px; color: var(--text-3); font-size: 12px; position: relative; }
.login-art .foot span { display: inline-flex; align-items: center; gap: 7px; }
.login-art .foot .i { width: 14px; height: 14px; }
.login-main { display: grid; place-items: center; padding: 40px 24px; }
.login-form { width: 100%; max-width: 380px; transition: opacity .4s var(--ease), transform .5s var(--ease), filter .5s; }
.login-form .brand { display: none; margin-bottom: 40px; }
.login-form h2 { font-family: var(--display); font-weight: 400; font-size: 40px; letter-spacing: -0.01em; margin: 0 0 6px; }
.login-form .sub { color: var(--text-2); margin: 0 0 32px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-bottom: 7px; }
.login-form .input { height: 46px; font-size: 15px; }
.pw-wrap { position: relative; }
.pw-wrap .icon-btn { position: absolute; right: 6px; top: 6px; }
.check { display: flex; align-items: center; gap: 10px; color: var(--text-2); margin: 6px 0 26px; cursor: pointer; user-select: none; }
.check input { appearance: none; width: 18px; height: 18px; margin: 0; border-radius: 5px; box-shadow: inset 0 0 0 1.5px var(--line-2); display: grid; place-items: center; transition: .2s var(--ease); cursor: pointer; }
.check input:checked { background: var(--accent); box-shadow: none; }
.check input:checked::after { content: ''; width: 9px; height: 5px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.login-form .btn-primary { width: 100%; height: 48px; font-size: 15px; border-radius: 12px; }
.form-error { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 25%, transparent); border-radius: 10px; padding: 11px 13px; margin-bottom: 18px; font-size: 13px; }
.shake { animation: shake .45s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.login-note { margin-top: 26px; display: flex; gap: 9px; color: var(--text-3); font-size: 12.5px; line-height: 1.5; }
.login-note .i { width: 15px; height: 15px; margin-top: 2px; }
@media (max-width: 900px) {
    .login-split { grid-template-columns: 1fr; }
    .login-art { display: none; }
    .login-form .brand { display: flex; }
}

/* ---------- app shell ---------- */
.app { position: relative; z-index: 1; height: 100%; display: grid; grid-template-columns: 236px 1fr; }
.sidebar { display: flex; flex-direction: column; min-height: 0; padding: 18px 12px 12px; }
.sidebar .brand { padding: 2px 8px 22px; }
.compose-btn { width: 100%; height: 42px; border-radius: 11px; margin-bottom: 18px; justify-content: flex-start; padding: 0 14px; }
.compose-btn kbd { margin-left: auto; background: rgba(0, 0, 0, .14); box-shadow: none; color: inherit; opacity: .7; }
.folders { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.folder {
    display: flex; align-items: center; gap: 11px; width: 100%; height: 34px; padding: 0 10px; border-radius: 9px;
    color: var(--text-2); font-weight: 450; text-align: left; position: relative;
    transition: background .18s var(--ease), color .18s;
}
.folder .i { width: 17px; height: 17px; color: var(--text-3); transition: color .18s; }
.folder:hover { background: var(--hover); color: var(--text); }
.folder.active { background: var(--active); color: var(--text); font-weight: 500; }
.folder.active .i { color: var(--accent-ink); }
.folder .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder .count { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.folder .count.unread { color: var(--accent-ink); font-weight: 600; }
.folder.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.folder-section { font-size: 11px; font-weight: 500; color: var(--text-3); letter-spacing: .04em; padding: 20px 10px 6px; display: flex; align-items: center; text-transform: uppercase; }
.folder-section button { margin-left: auto; color: var(--text-3); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; }
.folder-section button:hover { color: var(--text); background: var(--hover); }
.folder-section .i { width: 14px; height: 14px; }
.side-foot { padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--line); }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px 8px; }
.me .who { flex: 1; min-width: 0; }
.me .who b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who small { color: var(--text-3); font-size: 11.5px; display: flex; align-items: center; gap: 6px; margin-top: 1px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.live-dot.on { background: var(--success); box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 5px transparent; } }
.side-actions { display: flex; gap: 2px; }

/* the sheet holds list + reader */
.sheet {
    margin: 10px 10px 10px 0; min-height: 0; display: grid; grid-template-columns: minmax(320px, 400px) 1fr;
    background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-md); overflow: hidden;
}
.list-pane, .reader { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.list-pane { border-right: 1px solid var(--line); }

/* avatars: tinted monochrome */
.avatar {
    --h: 40; width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center;
    font-weight: 600; font-size: 12.5px; letter-spacing: .02em; text-transform: uppercase;
    background: hsl(var(--h) 22% 20%); color: hsl(var(--h) 55% 78%); box-shadow: inset 0 0 0 1px hsl(var(--h) 30% 30% / .6);
}
:root[data-theme='light'] .avatar { background: hsl(var(--h) 45% 90%); color: hsl(var(--h) 40% 32%); box-shadow: inset 0 0 0 1px hsl(var(--h) 30% 80%); }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.check { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.avatar.check .i { width: 16px; height: 16px; }

/* list */
.list-head { padding: 18px 16px 10px; }
.list-title { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.list-title h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: -0.01em; line-height: 1; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-title .sub { font-family: var(--ui); color: var(--text-3); font-size: 13px; margin-left: 8px; letter-spacing: 0; }
.search { position: relative; }
.search .i { position: absolute; left: 12px; top: 11px; color: var(--text-3); width: 16px; height: 16px; pointer-events: none; }
.search .input { padding-left: 36px; height: 38px; }
.search kbd { position: absolute; right: 9px; top: 9px; }
.chips { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.chip { height: 28px; padding: 0 11px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--text-3); white-space: nowrap; transition: .18s var(--ease); }
.chip:hover { color: var(--text); background: var(--hover); }
.chip.active { color: var(--text); background: var(--active); }
.bulk { display: flex; align-items: center; gap: 2px; padding: 6px 10px; margin: 0 8px 6px; border-radius: 10px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); animation: rise .25s var(--ease); }
.bulk .count { font-weight: 500; margin: 0 auto 0 6px; font-size: 13px; }
.messages { flex: 1; overflow-y: auto; padding: 2px 8px 8px; position: relative; }
.msg {
    display: flex; gap: 12px; padding: var(--row-pad) 12px var(--row-pad) 14px; border-radius: 11px; cursor: pointer; position: relative;
    transition: background .16s var(--ease);
}
.msg + .msg::after { content: ''; position: absolute; left: 62px; right: 12px; top: -1px; height: 1px; background: var(--line); transition: opacity .16s; }
.msg:hover::after, .msg:hover + .msg::after, .msg.selected::after, .msg.selected + .msg::after, .msg.checked::after, .msg.checked + .msg::after { opacity: 0; }
.msg.enter { animation: rowIn .45s var(--ease) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }
.msg:hover { background: var(--hover); }
.msg.selected { background: var(--active); }
.msg.checked { background: var(--accent-soft); }
.sel-toggle { position: relative; }
.sel-toggle .avatar { transition: transform .2s var(--ease); }
.msg:hover .sel-toggle .avatar:not(.check) { transform: scale(.94); }
.msg-body { flex: 1; min-width: 0; }
.msg-top { display: flex; align-items: center; gap: 8px; }
.msg-from { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); font-weight: 450; }
.msg-date { font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.msg-subject { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; color: var(--text-2); }
.msg-preview { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
:root[data-density='compact'] .msg-preview { display: none; }
.msg.unread .msg-from, .msg.unread .msg-subject { color: var(--text); font-weight: 600; }
.msg.unread::before { content: ''; position: absolute; left: 4px; top: calc(var(--row-pad) + 15px); width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.msg-meta { display: flex; align-items: center; gap: 5px; color: var(--text-3); }
.msg-meta .i { width: 13px; height: 13px; }
.star-btn { color: var(--text-3); display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; opacity: 0; transition: opacity .15s, color .15s, transform .2s var(--ease); }
.star-btn .i { width: 15px; height: 15px; }
.msg:hover .star-btn { opacity: 1; }
.star-btn:hover { color: var(--warn); transform: scale(1.12); }
.star-btn.on { opacity: 1; color: var(--warn); }
.star-btn.on .i { fill: currentColor; }
.list-foot { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 6px 16px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.empty { height: 100%; display: grid; place-items: center; text-align: center; color: var(--text-3); padding: 30px; }
.empty .big { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; color: var(--accent-ink); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.empty .big .i { width: 26px; height: 26px; stroke-width: 1.5; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-family: var(--display); font-weight: 400; font-size: 26px; }
.empty p { margin: 0 0 4px; line-height: 1.6; }
.skeleton { padding: var(--row-pad) 12px var(--row-pad) 14px; display: flex; gap: 12px; }
.skeleton .b { background: linear-gradient(90deg, var(--hover), var(--active), var(--hover)); background-size: 200% 100%; animation: shimmer 1.6s ease-in-out infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* reader */
.reader-bar { display: flex; align-items: center; gap: 2px; height: 56px; padding: 0 12px; border-bottom: 1px solid var(--line); flex: none; }
.reader-bar .sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 6px; }
.reader-bar .spacer { flex: 1; }
.reader-scroll { flex: 1; overflow-y: auto; }
.reader-content { max-width: 820px; margin: 0 auto; padding: 36px 40px 64px; animation: readIn .4s var(--ease) both; }
@keyframes readIn { from { opacity: 0; transform: translateY(8px); } }
.reader h1 { font-family: var(--display); font-weight: 400; font-size: 36px; line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 26px; word-break: break-word; }
.sender { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sender .info { flex: 1; min-width: 0; }
.sender .name { font-weight: 600; }
.sender .addr { color: var(--text-3); margin-left: 6px; }
.sender .to { color: var(--text-3); font-size: 13px; margin-top: 3px; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
.sender .to .i { width: 14px; height: 14px; }
.sender .to:hover { color: var(--text-2); }
.sender .details { flex-basis: 100%; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; padding: 12px 14px; margin: 4px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; animation: rise .25s var(--ease); }
.sender .details dt { color: var(--text-3); }
.sender .details dd { margin: 0; word-break: break-all; }
.sender .when { color: var(--text-3); font-size: 12.5px; white-space: nowrap; align-self: flex-start; margin-top: 3px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 11px; margin-bottom: 14px; font-size: 13px; color: var(--text-2); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.banner .i { width: 16px; height: 16px; color: var(--accent-ink); }
.banner span { flex: 1; }
.banner button { color: var(--text); font-weight: 500; padding: 5px 10px; border-radius: 7px; white-space: nowrap; }
.banner button:hover { background: var(--hover); }
.body-frame { width: 100%; border: 0; border-radius: 14px; background: #fff; min-height: 120px; display: block; box-shadow: 0 0 0 1px var(--line); }
.body-text { white-space: pre-wrap; word-wrap: break-word; line-height: 1.7; font-size: 15px; color: var(--text); }
.attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 24px; }
.att { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; color: var(--text); transition: .2s var(--ease); }
.att:hover { box-shadow: inset 0 0 0 1px var(--accent-line); transform: translateY(-1px); }
.att .ext { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--accent-ink); background: var(--accent-soft); flex: none; text-transform: uppercase; }
.att .meta { min-width: 0; flex: 1; }
.att .meta b { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att .meta small { color: var(--text-3); font-size: 12px; }
.quick-reply { margin-top: 32px; display: flex; gap: 8px; flex-wrap: wrap; }
.back-btn { display: none; }

/* ---------- composer ---------- */
.composer {
    position: fixed; right: 20px; bottom: 20px; width: 620px; max-width: calc(100vw - 32px); height: min(660px, calc(100vh - 40px));
    z-index: 40; display: flex; flex-direction: column; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
    animation: composeIn .45s var(--ease); transition: height .3s var(--ease);
}
@keyframes composeIn { from { transform: translateY(24px) scale(.98); opacity: 0; } }
.composer.minimized { height: 48px; overflow: hidden; }
.composer.minimized > :not(.composer-head) { display: none; }
.composer.maximized { right: 50%; bottom: 50%; transform: translate(50%, 50%); width: min(980px, 92vw); height: 88vh; animation: none; }
.composer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 39; backdrop-filter: blur(4px); animation: fade .25s; }
.composer-head { display: flex; align-items: center; gap: 2px; height: 48px; flex: none; padding: 0 8px 0 18px; cursor: pointer; border-bottom: 1px solid var(--line); }
.composer-head b { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-head .status { color: var(--text-3); font-size: 12px; margin-right: 6px; }
.composer-head .icon-btn { width: 30px; height: 30px; }
.composer-head .icon-btn .i { width: 16px; height: 16px; }
.c-field { display: flex; align-items: flex-start; gap: 8px; padding: 3px 18px; border-bottom: 1px solid var(--line); min-height: 44px; position: relative; }
.c-field label { color: var(--text-3); width: 54px; padding-top: 11px; font-size: 13px; flex: none; }
.c-field .toggles { padding-top: 10px; display: flex; gap: 10px; }
.c-field .toggles button { color: var(--text-3); font-size: 13px; }
.c-field .toggles button:hover { color: var(--text); }
.c-field input.plain { flex: 1; border: 0; outline: none; background: none; height: 38px; min-width: 120px; font-weight: 500; }
.recips { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; padding: 6px 0; align-items: center; }
.recip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 3px 0 10px; border-radius: 7px; font-size: 13px; font-weight: 500; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line); animation: pop .2s var(--ease); }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.recip.invalid { color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 45%, transparent); }
.recip button { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; color: var(--text-3); }
.recip button:hover { background: var(--hover); color: var(--text); }
.recip button .i { width: 12px; height: 12px; }
.recips input { flex: 1; min-width: 140px; border: 0; outline: none; background: none; height: 28px; }
.suggest { position: absolute; left: 72px; right: 18px; top: calc(100% - 4px); z-index: 5; background: var(--surface-2); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; animation: rise .2s var(--ease); }
.suggest button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 7px 9px; border-radius: 8px; text-align: left; }
.suggest button.on, .suggest button:hover { background: var(--active); }
.suggest b { font-weight: 500; }
.suggest small { color: var(--text-3); display: block; font-size: 12px; }
.toolbar { display: flex; gap: 1px; padding: 6px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.toolbar .icon-btn { width: 30px; height: 30px; border-radius: 7px; }
.toolbar .i { width: 16px; height: 16px; }
.toolbar .sep { width: 1px; height: 16px; background: var(--line-2); margin: 0 5px; }
.toolbar select, .composer-foot select, .select {
    appearance: none; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23888' stroke-width='1.5'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
    border: 0; box-shadow: inset 0 0 0 1px var(--line); border-radius: 8px; height: 30px; padding: 0 28px 0 10px; outline: none; cursor: pointer; font-size: 13px;
}
.editor { flex: 1; overflow-y: auto; padding: 18px 20px; outline: none; line-height: 1.65; font-size: 15px; word-wrap: break-word; }
.editor:empty::before { content: attr(data-placeholder); color: var(--text-3); }
.editor blockquote, .sig-editor blockquote { border-left: 2px solid var(--accent-line); margin: 10px 0; padding: 2px 14px; color: var(--text-2); }
.editor .pm-quote { color: var(--text-2); font-size: 14px; }
.editor img, .sig-editor img { max-width: 100%; }
.c-attachments { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 10px; }
.c-attachments:empty { display: none; }
.c-att { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 4px 0 10px; border-radius: 8px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; animation: pop .2s var(--ease); }
.c-att .i { width: 14px; height: 14px; color: var(--text-3); }
.composer-foot { display: flex; align-items: center; gap: 6px; padding: 10px 12px 12px 14px; border-top: 1px solid var(--line); }
.composer-foot .spacer { flex: 1; }
.composer-foot select { height: 36px; max-width: 180px; border-radius: 10px; }
.send-btn { padding: 0 18px; }
.drop-hint { position: absolute; inset: 8px; z-index: 10; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 85%, var(--accent)); box-shadow: inset 0 0 0 1.5px var(--accent-line); border-radius: 12px; font-family: var(--display); font-size: 26px; color: var(--accent-ink); }

/* ---------- modals ---------- */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
:root[data-theme='light'] .modal-back { background: rgba(40, 30, 15, .25); }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 780px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: modalIn .4s var(--ease); overflow: hidden; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-head { display: flex; align-items: center; padding: 18px 18px 18px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 28px; flex: 1; }
.settings { display: grid; grid-template-columns: 190px 1fr; min-height: 480px; min-width: 0; }
.settings nav { border-right: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.settings nav button { display: flex; gap: 10px; align-items: center; height: 36px; padding: 0 11px; border-radius: 9px; color: var(--text-2); text-align: left; transition: .18s var(--ease); }
.settings nav button .i { width: 16px; height: 16px; color: var(--text-3); }
.settings nav button:hover { background: var(--hover); color: var(--text); }
.settings nav button.active { background: var(--active); color: var(--text); font-weight: 500; }
.settings nav button.active .i { color: var(--accent-ink); }
.settings section { padding: 24px 28px; overflow-y: auto; max-height: calc(100vh - 120px); min-width: 0; animation: readIn .3s var(--ease); }
.settings h3 { margin: 0 0 4px; font-family: var(--display); font-weight: 400; font-size: 26px; }
.settings p.hint { color: var(--text-3); margin: 0 0 20px; font-size: 13px; line-height: 1.5; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .lbl b { display: block; font-weight: 500; }
.row .lbl small { color: var(--text-3); font-size: 12.5px; }
.row .input { max-width: 230px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); transition: .25s var(--ease); }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .25s var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch input:checked + span { background: var(--accent); box-shadow: none; }
.switch input:checked + span::after { transform: translateX(16px); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.swatch { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); transition: transform .2s var(--ease), box-shadow .2s; }
.swatch:hover { transform: scale(1.1); }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text-2); }
.swatch-custom { position: relative; overflow: hidden; background: conic-gradient(#e5484d, #e8b85c, #5fd49a, #4fb3e8, #8b7cf6, #e26d8f, #e5484d); cursor: pointer; }
.swatch-custom input { position: absolute; inset: -8px; opacity: 0; cursor: pointer; }
.seg { display: inline-flex; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; padding: 3px; }
.seg button { height: 28px; padding: 0 12px; border-radius: 7px; color: var(--text-3); font-weight: 500; font-size: 13px; transition: .2s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .2), 0 0 0 1px var(--line); }
.sig-list { display: flex; flex-direction: column; gap: 12px; }
.sig-card { border-radius: 14px; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.sig-card-head { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 14px; border-bottom: 1px solid var(--line); }
.sig-card-head input { flex: 1; background: none; border: 0; outline: none; font-weight: 500; }
.sig-card .toolbar { padding: 4px 8px; }
.sig-editor { min-height: 96px; padding: 14px 16px; outline: none; line-height: 1.5; background: var(--surface); }
.sig-templates { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.sig-pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.sig-pickers .select { width: 100%; height: 38px; }

/* palette */
.palette { max-width: 580px; align-self: start; margin-top: 14vh; }
.palette input { border: 0; border-bottom: 1px solid var(--line); height: 58px; font-size: 16px; padding: 0 22px; background: none; width: 100%; outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow-y: auto; }
.palette li { display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 14px; border-radius: 10px; cursor: pointer; color: var(--text-2); }
.palette li .i { width: 17px; height: 17px; color: var(--text-3); }
.palette li.on { background: var(--active); color: var(--text); }
.palette li.on .i { color: var(--accent-ink); }
.palette li kbd { margin-left: auto; }
.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.shortcuts div { display: flex; justify-content: space-between; align-items: center; height: 40px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.shortcuts kbd { margin-left: 3px; }

/* toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
    pointer-events: auto; display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 0 8px 0 18px; border-radius: 13px; min-width: 240px; max-width: calc(100vw - 32px);
    background: var(--surface-3); color: var(--text); font-weight: 500; box-shadow: var(--shadow-lg); animation: toastIn .45s var(--ease); position: relative; overflow: hidden;
}
.toast:not(:has(button)) { padding-right: 18px; }
.toast.error { box-shadow: var(--shadow-lg), inset 3px 0 0 var(--danger); }
.toast button { font-weight: 600; color: var(--accent-ink); margin-left: auto; height: 32px; padding: 0 10px; border-radius: 8px; }
.toast button:hover { background: var(--hover); }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); animation: bar linear forwards; opacity: .8; }
@keyframes bar { from { width: 100%; } to { width: 0; } }
@keyframes toastIn { from { transform: translateY(16px) scale(.96); opacity: 0; } }

/* menus */
.menu { position: fixed; z-index: 70; min-width: 210px; background: var(--surface-2); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; animation: menuIn .18s var(--ease); transform-origin: top left; }
@keyframes menuIn { from { opacity: 0; transform: scale(.96); } }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border-radius: 8px; text-align: left; color: var(--text-2); }
.menu button .i { width: 16px; height: 16px; color: var(--text-3); }
.menu button:hover { background: var(--active); color: var(--text); }
.menu button:hover .i { color: var(--text-2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.menu .danger, .menu .danger .i { color: var(--danger) !important; }

.menu-btn { display: none; }
.fab { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
    .app { grid-template-columns: 68px 1fr; }
    .sidebar { padding: 18px 10px 12px; align-items: center; }
    .sidebar .brand { padding: 2px 0 22px; }
    .wordmark, .folder .name, .folder .count, .folder-section, .compose-btn span, .compose-btn kbd, .me .who { display: none; }
    .folders { width: 100%; }
    .folder { justify-content: center; padding: 0; height: 38px; }
    .folder .count.unread { display: block; position: absolute; top: 5px; right: 8px; font-size: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
    .compose-btn { width: 44px; padding: 0; justify-content: center; }
    .side-actions { flex-direction: column; align-items: center; }
    .me { justify-content: center; padding: 4px 0 8px; }
}
@media (max-width: 760px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 284px; z-index: 30; background: var(--surface); padding: 20px 14px 14px; align-items: stretch; transform: translateX(-100%); transition: transform .35s var(--ease); }
    .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    .app.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 29; animation: fade .25s; }
    .wordmark, .folder .name, .me .who { display: initial; }
    .folder .count { display: initial; }
    .folder .count.unread { position: static; font-size: 12px; width: auto; height: auto; background: none; }
    .folder { justify-content: flex-start; padding: 0 10px; }
    .folder-section { display: flex; }
    .compose-btn { width: 100%; padding: 0 14px; justify-content: flex-start; }
    .compose-btn span { display: initial; }
    .sidebar .brand { padding-left: 8px; }
    .side-actions { flex-direction: row; }
    .me { justify-content: flex-start; padding-left: 6px; }
    .sheet { margin: 0; border-radius: 0; grid-template-columns: 1fr; box-shadow: none; background: var(--surface); }
    .list-pane { border-right: 0; }
    .list-pane, .reader { grid-row: 1; grid-column: 1; height: 100vh; height: 100dvh; }
    .app[data-view='reader'] .list-pane { display: none; }
    .app:not([data-view='reader']) .reader { display: none; }
    .back-btn { display: inline-grid; }
    .menu-btn { display: inline-grid; margin-left: -8px; }
    .list-title h2 { font-size: 28px; }
    .list-foot { padding-right: 90px; }
    .reader-bar { padding: 0 6px; gap: 0; }
    .reader-bar .icon-btn { width: 32px; }
    .reader-bar .sep { margin: 0 2px; }
    .reader-content { padding: 22px 18px 90px; }
    .reader h1 { font-size: 30px; }
    .sender .when { display: none; }
    .composer, .composer.maximized { inset: 0; width: 100%; max-width: none; height: 100%; border-radius: 0; transform: none; }
    .settings { grid-template-columns: 1fr; }
    .settings nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .settings nav button { flex: none; }
    .settings section { max-height: none; padding: 20px; }
    .row { flex-wrap: wrap; }
    .sig-pickers, .shortcuts { grid-template-columns: 1fr; }
    .search kbd { display: none; }
    .fab {
        display: grid; place-items: center; position: fixed; right: 18px; bottom: calc(20px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 18px; z-index: 20;
        background: var(--accent); color: var(--on-accent); box-shadow: 0 16px 34px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .3); transition: transform .15s var(--ease);
    }
    .fab:active { transform: scale(.94); }
    .fab .i { width: 22px; height: 22px; }
    .app[data-view='reader'] ~ .fab, .app.nav-open ~ .fab { display: none; }
}

::view-transition-old(reader), ::view-transition-new(reader) { animation-duration: .28s; animation-timing-function: var(--ease); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ================= flair ================= */

/* ambient light drifting behind everything */
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.ambient span { position: absolute; border-radius: 50%; filter: blur(110px); opacity: .16; background: var(--accent); animation: float 38s ease-in-out infinite alternate; }
.ambient span:nth-child(1) { width: 46vmax; height: 46vmax; left: -14vmax; top: -18vmax; }
.ambient span:nth-child(2) { width: 34vmax; height: 34vmax; right: -12vmax; bottom: -16vmax; opacity: .09; animation-delay: -19s; }
:root[data-theme='light'] .ambient span { opacity: .12; }
@keyframes float { to { transform: translate(10vmax, 8vmax) scale(1.12); } }

/* splash: the mark assembles itself */
.splash { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--bg); transition: opacity .6s var(--ease), visibility .6s; }
.splash .brand-mark { width: 64px; height: 64px; }
.splash .wordmark { font-size: 30px; opacity: 0; animation: rise .8s var(--ease) .35s forwards; }
.splash .brand-mark g rect { transform-box: fill-box; transform-origin: left center; animation: bar .7s var(--ease) both; }
.splash .brand-mark g rect:nth-child(2) { animation-delay: .08s; }
.splash .brand-mark g rect:nth-child(3) { animation-delay: .16s; }
.splash .brand-mark g rect:nth-child(4) { animation-delay: .24s; }
.splash .brand-mark g rect:nth-child(5) { animation-delay: .32s; transform-origin: center top; }
.splash .brand-mark { animation: markIn .7s var(--ease) both; }
@keyframes markIn { from { opacity: 0; transform: scale(.85) rotate(-8deg); } }
.splash.out { opacity: 0; visibility: hidden; }
.splash.out .brand-mark { transform: scale(1.08); transition: transform .6s var(--ease); }
@keyframes bar { from { transform: scaleX(0); opacity: 0; } }

/* greeting */
.greet { display: flex; align-items: center; gap: 9px; margin: -6px 0 14px; color: var(--text-3); font-size: 13px; animation: rise .5s var(--ease) both; }
.greet b { color: var(--accent-ink); font-weight: 600; }
.greet .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

/* date groups */
.group-label {
    position: sticky; top: 0; z-index: 2; padding: 12px 14px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
    background: linear-gradient(var(--surface) 70%, transparent);
}
.group-label + .msg::after { display: none; }

/* spotlight */
.msg:hover { background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%), var(--hover); }
.msg.selected:hover { background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%), var(--active); }

/* hover quick actions */
.row-actions {
    position: absolute; right: 8px; top: calc(var(--row-pad) - 4px); display: flex; gap: 1px; padding: 2px; border-radius: 9px; z-index: 1;
    background: var(--surface-3); box-shadow: var(--shadow-md); opacity: 0; transform: translateY(-3px) scale(.96); pointer-events: none;
    transition: opacity .16s var(--ease), transform .2s var(--ease);
}
.row-actions button { width: 28px; height: 26px; display: grid; place-items: center; border-radius: 7px; color: var(--text-2); }
.row-actions button:hover { background: var(--active); color: var(--text); }
.row-actions button[data-row='delete']:hover { color: var(--danger); }
.row-actions .i { width: 15px; height: 15px; }
@media (hover: hover) {
    .msg:hover .row-actions { opacity: 1; transform: none; pointer-events: auto; }
    .msg:hover .msg-date, .msg:hover .msg-meta { opacity: 0; }
}
.msg-date, .msg-meta { transition: opacity .15s; }
.msg-date.until { color: var(--accent-ink); display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.msg-date.until .i { width: 12px; height: 12px; }

/* menu hints */
.menu button small { margin-left: auto; padding-left: 16px; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.snooze-pick { max-width: 380px; }
.snooze-pick .modal-body { padding: 20px 24px 24px; }
.snooze-pick input { color-scheme: inherit; }

/* swipe */
.msg.swiping { transition: none; background: var(--surface); z-index: 1; box-shadow: 0 0 0 1px var(--line); }
.swipe-bg { position: absolute; left: 8px; right: 8px; border-radius: 11px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; font-weight: 600; color: #fff; background: var(--text-3); transition: background .2s; }
.swipe-bg .i { width: 18px; height: 18px; }
.swipe-bg span { display: inline-flex; gap: 8px; align-items: center; opacity: .6; transition: opacity .2s, transform .2s var(--ease); }
.swipe-bg[data-dir='right'] .r, .swipe-bg[data-dir='left'] .l { visibility: hidden; }
.swipe-bg.armed span { opacity: 1; transform: scale(1.06); }
.swipe-bg.armed[data-dir='right'] { background: var(--success); }
.swipe-bg.armed[data-dir='left'] { background: var(--danger); }

/* inbox zero */
.zero .zero-art { width: 220px; color: var(--accent-ink); display: block; margin: 0 auto 10px; overflow: visible; }
.zero .sun { transform-box: fill-box; transform-origin: center; animation: sunrise 1.4s var(--ease) both; }
.zero .rays line { stroke-dasharray: 14; stroke-dashoffset: 14; animation: ray .7s var(--ease) both; animation-delay: .7s; }
@keyframes sunrise { from { transform: translateY(26px); opacity: 0; } }
@keyframes ray { to { stroke-dashoffset: 0; } }
.zero h3 { font-size: 40px; animation: rise .8s var(--ease) .4s both; }
.zero p { animation: rise .8s var(--ease) .55s both; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 90; }

/* send: the composer flies off */
.composer.fly-out { animation: flyOut .52s cubic-bezier(.55, 0, .2, 1) forwards; pointer-events: none; }
@keyframes flyOut {
    30% { transform: translateY(6px) scale(.97); opacity: 1; }
    to { transform: translate(18vw, -90vh) scale(.35) rotate(-6deg); opacity: 0; }
}

/* compose button shine */
.btn-primary { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary::after {
    content: ''; position: absolute; inset: 0; z-index: -1; transform: translateX(-120%);
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%);
}
.btn-primary:hover::after { transform: translateX(120%); transition: transform .8s var(--ease); }

/* theme reveal */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
.theme-swap * { transition: none !important; }

/* login: staggered headline + parallax */
.stagger span { display: inline-block; animation: wordUp 1s var(--ease) both; }
.stagger em span { animation-delay: .18s; }
@keyframes wordUp { from { opacity: 0; transform: translateY(40%); filter: blur(6px); } }
.login-art p { animation: rise 1s var(--ease) .35s both; }
.login-art .rings { translate: var(--px, 0) var(--py, 0); transition: translate .6s var(--ease); }
.login-form .btn-primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 14px 34px -12px var(--accent); }

/* welcome panel in the empty reader */
.welcome { height: 100%; display: grid; place-items: center; padding: 32px; position: relative; overflow: hidden; }
.welcome::before {
    content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -58%);
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 10%, transparent), transparent 65%); pointer-events: none;
}
.welcome-inner { position: relative; text-align: center; max-width: 520px; }
.w-time { font-family: var(--display); font-size: clamp(72px, 9vw, 120px); line-height: .9; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; animation: rise .8s var(--ease) both; }
.w-date { color: var(--accent-ink); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin-top: 14px; animation: rise .8s var(--ease) .08s both; }
.w-hi { font-family: var(--display); font-weight: 400; font-size: 28px; margin: 26px 0 26px; color: var(--text-2); animation: rise .8s var(--ease) .16s both; }
.w-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; animation: rise .8s var(--ease) .24s both; }
.w-stats button {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px; border-radius: 14px; text-align: left;
    background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.w-stats button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--accent-line), 0 14px 30px -18px var(--accent); }
.w-stats button:disabled { opacity: .5; cursor: default; }
.w-stats .i { width: 16px; height: 16px; color: var(--accent-ink); margin-bottom: 10px; }
.w-stats b { font-family: var(--display); font-weight: 400; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.w-stats span { color: var(--text-3); font-size: 12.5px; }
.w-tip { margin-top: 28px; color: var(--text-3); font-size: 13px; animation: rise .8s var(--ease) .32s both; }
.w-tip kbd { margin: 0 1px; }

/* ================= profile photos ================= */
.avatar { position: relative; overflow: hidden; }
.av-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; background: #fff; opacity: 0; transition: opacity .3s var(--ease); }
.av-img.ok { opacity: 1; }
.avatar.xl { width: 96px; height: 96px; font-size: 30px; }
.me { cursor: pointer; border-radius: 10px; transition: background .18s; }
.me:hover { background: var(--hover); }

.profile-card { display: flex; align-items: center; gap: 22px; padding: 20px; margin-bottom: 8px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.profile-photo { position: relative; cursor: pointer; border-radius: 50%; flex: none; }
.profile-photo .avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent-line); }
.profile-photo-edit { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .2s; }
.profile-photo:hover .profile-photo-edit, .profile-photo.drag .profile-photo-edit { opacity: 1; }
.profile-photo.drag .avatar { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }
.profile-meta { min-width: 0; }
.profile-meta b { display: block; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.1; }
.profile-meta small { color: var(--text-3); }
.profile-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

.cropper { max-width: 420px; }
.crop-stage { position: relative; width: 280px; height: 280px; margin: 4px auto 0; border-radius: 16px; overflow: hidden; background: var(--surface-3); touch-action: none; }
.crop-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.crop-stage canvas:active { cursor: grabbing; }
.crop-ring { position: absolute; inset: 0; pointer-events: none; border-radius: 16px; background: radial-gradient(circle at center, transparent 139px, rgba(0, 0, 0, .55) 140px); }
.crop-ring::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85); }
.crop-zoom { display: flex; align-items: center; gap: 12px; margin: 18px auto 0; max-width: 280px; color: var(--text-3); }
.crop-zoom .i:first-child { width: 14px; height: 14px; }
.crop-zoom input { flex: 1; accent-color: var(--accent); }
@media (max-width: 760px) { .profile-card { flex-direction: column; text-align: center; } .profile-actions { justify-content: center; } }
.modal-body { padding: 20px 24px 24px; overflow-y: auto; }

/* ================= login animations ================= */

/* artwork: rings draw themselves, dots orbit, light runs along the guides */
.rings .r-dotted { transform-origin: 50% 50%; animation: fade 1.6s ease .2s both, turn 140s linear infinite; }
.rings .r-solid, .rings .r-lines { opacity: .75; }
.rings .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawIn 2.4s var(--ease) .15s forwards; }
.rings .draw.d2 { animation-delay: .45s; }
.rings .draw.d3, .rings .draw.d4 { opacity: .45; animation-duration: 1.8s; animation-delay: .9s; }
.rings .draw.d4 { animation-delay: 1.05s; }
@keyframes drawIn { to { stroke-dashoffset: 0; } }
.rings .pulse { stroke-dasharray: .07 .93; stroke-dashoffset: 1; opacity: 0; animation: run 7s linear 2.2s infinite; }
.rings .pulse.p2 { animation-duration: 9s; animation-delay: 4.5s; }
.rings .pulse.p3 { stroke-dasharray: .05 .95; animation-duration: 11s; animation-delay: 3s; }
@keyframes run { 0% { stroke-dashoffset: 1; opacity: 0; } 8% { opacity: 1; } 70% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.rings .orbit { transform-origin: 50% 50%; animation: fade 1s ease both, turn linear infinite; }
.rings .o1 { animation-duration: 1s, 46s; animation-delay: 1.6s, 0s; }
.rings .o2 { animation-duration: 1s, 30s; animation-delay: 1.9s, 0s; animation-direction: normal, reverse; }
.rings .o3 { animation-duration: 1s, 18s; animation-delay: 2.2s, 0s; }
.rings .planet { filter: drop-shadow(0 0 4px currentColor) drop-shadow(0 0 10px currentColor); }
.rings .core { transform-origin: 50% 50%; transform-box: fill-box; animation: fade 1s ease 1.2s both, beat 2.8s ease-in-out 1.2s infinite; filter: drop-shadow(0 0 6px currentColor); }
@keyframes beat { 50% { transform: scale(2.2); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }

.login-art .stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; animation: fade 2s ease .4s both; }
.login-art .brand { position: relative; animation: rise .8s var(--ease) both; }
.login-art .foot { animation: fade 1s ease 1.4s both; }

/* "refined." gets a light sheen sweeping across it */
.stagger .sheen {
    padding-right: .12em; margin-right: -.12em; color: transparent; -webkit-background-clip: text; background-clip: text;
    background-image: linear-gradient(100deg, var(--accent-ink) 0%, var(--accent-ink) 42%, #fff 50%, var(--accent-ink) 58%, var(--accent-ink) 100%);
    background-size: 260% 100%; background-position: 100% 0;
    animation: wordUp 1s var(--ease) .18s both, sheen 5.5s ease-in-out 1.6s infinite;
}
:root[data-theme='light'] .stagger .sheen { background-image: linear-gradient(100deg, var(--accent-ink) 0%, var(--accent-ink) 42%, color-mix(in srgb, var(--accent) 35%, #fff) 50%, var(--accent-ink) 58%, var(--accent-ink) 100%); }
@keyframes sheen { 0%, 55% { background-position: 100% 0; } 100% { background-position: -60% 0; } }

/* form rows arrive one after another */
.login-form > * { animation: rowUp .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 120ms); }
@keyframes rowUp { from { opacity: 0; transform: translateY(14px); filter: blur(3px); } }
.field > span { transition: color .2s; }
.field:focus-within > span { color: var(--accent-ink); }
.login-form .input { transition: box-shadow .25s var(--ease), background .25s, transform .25s var(--ease); }
.login-form .input:focus { transform: translateY(-1px); }

/* caps lock hint */
.field > .caps { display: block; height: 0; margin: 0; overflow: hidden; font-size: 12px; font-weight: 500; color: var(--warn); opacity: 0; transition: height .25s var(--ease), opacity .2s, margin .25s var(--ease); }
.field > .caps.on { height: 16px; margin-top: 7px; opacity: 1; }

/* sign-in button breathes, and reacts to its states */
.submit-wrap { position: relative; }
.submit-wrap::before {
    content: ''; position: absolute; inset: 6px 10% -4px; border-radius: 14px; background: var(--accent); filter: blur(18px); opacity: .35; z-index: 0;
    animation: breathe 3.6s ease-in-out infinite; pointer-events: none;
}
.submit-wrap:hover::before { opacity: .6; }
@keyframes breathe { 50% { opacity: .55; transform: scaleX(1.04); } }
.submit-wrap .btn-primary { position: relative; z-index: 1; transition: transform .2s var(--ease), background .3s, box-shadow .3s; }
.submit-wrap .btn-primary:hover { transform: translateY(-1px); }
.submit-wrap .btn-primary.busy { background-image: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%); background-size: 200% 100%; animation: busy 1.1s linear infinite; }
@keyframes busy { from { background-position: 150% 0; } to { background-position: -50% 0; } }
.submit-wrap .btn-primary.done { background: var(--success); color: #fff; }
.submit-wrap .btn-primary.done .i { animation: pop .35s var(--ease); }

/* wrong password: inputs flash red */
.login-form.error .input { animation: errFlash 1s var(--ease); }
@keyframes errFlash { 0%, 40% { box-shadow: inset 0 0 0 1px var(--danger), 0 0 0 4px color-mix(in srgb, var(--danger) 22%, transparent); } }
.form-error { animation: rowUp .4s var(--ease) both; }

/* success: a circle grows from the button into the app */
.login-form.leaving { opacity: 0; transform: translateY(-12px) scale(.98); filter: blur(4px); }
.warp {
    position: fixed; z-index: 200; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle closest-side, var(--bg) 78%, color-mix(in srgb, var(--accent) 35%, var(--bg)) 95%, var(--accent) 99%, transparent 100%);
    transform: scale(0);
}
.warp.go { animation: warp .9s cubic-bezier(.65, 0, .35, 1) forwards; }
@keyframes warp { to { transform: scale(var(--s, 60)); } }

/* phones: no artwork panel, so give the form its own glow */
@media (max-width: 900px) {
    .login-main { position: relative; overflow: hidden; }
    .login-main::before {
        content: ''; position: absolute; width: 140vw; height: 140vw; left: -20vw; top: -90vw; border-radius: 50%; pointer-events: none;
        background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%); animation: float 18s ease-in-out infinite alternate;
    }
    .login-form .brand-mark { animation: markIn .9s var(--ease) both; }
}

/* ================= two-step check ================= */
.login-form.hidden { display: none; }
.tf-badge { position: relative; width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 22px; color: var(--accent-ink); }
.tf-badge .i { width: 24px; height: 24px; animation: pop .6s var(--ease) .3s both; }
.tf-badge::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; background: var(--accent-soft); box-shadow: 0 0 40px -6px var(--accent); }
.tf-timer { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); fill: none; stroke-width: 2.5; }
.tf-timer .track { stroke: var(--line-2); }
.tf-timer .left { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset .25s linear; filter: drop-shadow(0 0 3px var(--accent)); }
.login-form.twofa .sub b { color: var(--text); font-weight: 500; }

.otp { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.otp input {
    width: 0; flex: 1; min-width: 0; height: 58px; text-align: center; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; caret-color: var(--accent);
    border: 0; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); outline: none;
    transition: box-shadow .2s var(--ease), transform .25s var(--ease), background .2s;
    animation: rowUp .6s var(--ease) both;
}
.otp input:nth-child(1) { animation-delay: .35s; } .otp input:nth-child(2) { animation-delay: .4s; } .otp input:nth-child(3) { animation-delay: .45s; }
.otp input:nth-child(5) { animation-delay: .5s; } .otp input:nth-child(6) { animation-delay: .55s; } .otp input:nth-child(7) { animation-delay: .6s; }
.otp input:focus { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--accent-soft); transform: translateY(-2px); }
.otp input.filled { box-shadow: inset 0 0 0 1px var(--accent-line); animation: digit .28s var(--ease); }
@keyframes digit { 40% { transform: scale(1.08); } }
.otp-gap { width: 10px; height: 2px; border-radius: 2px; background: var(--line-2); flex: none; }
.otp.ok input { box-shadow: inset 0 0 0 1.5px var(--success); color: var(--success); transition-delay: calc(var(--d, 0) * 1ms); }
.login-form.error .otp input { animation: errFlash 1s var(--ease); }
.tf-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.tf-links button { color: var(--text-3); font-size: 13px; transition: color .2s; }
.tf-links button:hover { color: var(--accent-ink); }

/* settings: security tab */
.tf-status { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 16px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 18px; }
.tf-status .shield { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-3); }
.tf-status.on .shield { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); box-shadow: 0 0 30px -8px var(--success); }
.tf-status .meta { flex: 1; min-width: 0; }
.tf-status .meta b { display: block; font-weight: 600; }
.tf-status .meta small { color: var(--text-3); }
.tf-setup { display: grid; grid-template-columns: 180px 1fr; gap: 22px; align-items: start; animation: rise .4s var(--ease) both; }
.tf-qr { width: 180px; height: 180px; padding: 10px; border-radius: 14px; background: #fff; box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .5); }
.tf-qr svg { width: 100%; height: 100%; display: block; }
.tf-steps { margin: 0 0 14px; padding-left: 18px; color: var(--text-2); line-height: 1.7; font-size: 13.5px; }
.tf-secret { display: flex; align-items: center; gap: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; letter-spacing: .06em; padding: 8px 6px 8px 12px; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 14px; word-break: normal; }
.tf-secret span { flex: 1; }
.tf-confirm { display: flex; gap: 8px; }
.tf-confirm .input { max-width: 160px; letter-spacing: .3em; font-variant-numeric: tabular-nums; text-align: center; font-size: 16px; }
.tf-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.tf-codes code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; letter-spacing: .08em; text-align: center; padding: 10px; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); animation: pop .3s var(--ease) both; }
.tf-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 760px) { .tf-setup { grid-template-columns: 1fr; justify-items: center; } }

/* ================= landing (work in progress) ================= */
body.landing { overflow: hidden; height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
.landing .stars { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; animation: fade 2s ease .4s both; }
.landing .rings {
    position: fixed; left: 50%; top: 50%; width: min(118vmin, 1100px); aspect-ratio: 1; z-index: 0; pointer-events: none;
    transform: translate(-50%, -50%); color: var(--accent-ink); opacity: .55;
    translate: var(--px, 0) var(--py, 0); transition: translate .6s var(--ease);
}
.landing::after {
    content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background: radial-gradient(closest-side at 50% 50%, color-mix(in srgb, var(--bg) 70%, transparent), transparent 75%);
}
.l-top, .l-hero, .l-foot { position: relative; z-index: 1; }
.l-top { display: flex; align-items: center; justify-content: space-between; padding: 28px clamp(18px, 4vw, 48px); animation: rise .8s var(--ease) both; }
.l-mail { height: 38px; border-radius: 11px; color: var(--text); text-decoration: none; background: color-mix(in srgb, var(--surface-2) 70%, transparent); backdrop-filter: blur(8px); }
.l-mail .i { width: 16px; height: 16px; }
.l-hero { align-self: center; justify-self: center; text-align: center; padding: 0 20px; max-width: 900px; }
.l-pill {
    display: inline-flex; align-items: center; gap: 10px; height: 32px; padding: 0 14px; border-radius: 99px; font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--accent-ink); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); backdrop-filter: blur(8px);
    animation: rowUp .8s var(--ease) .1s both;
}
.l-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: livePulse 2s ease-out infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); } 100% { box-shadow: 0 0 0 10px transparent; } }
.l-hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(64px, 12vw, 168px); line-height: .92; letter-spacing: -0.03em; margin: 26px 0 26px; }
.l-hero h1 em { color: var(--accent-ink); }
.l-hero p { color: var(--text-2); font-size: clamp(15px, 1.6vw, 18px); line-height: 1.6; margin: 0 auto; animation: rise 1s var(--ease) .45s both; }
.l-progress { width: min(320px, 70vw); height: 3px; margin: 36px auto 0; border-radius: 3px; background: var(--line-2); overflow: hidden; animation: fade 1s ease .7s both; }
.l-progress span { display: block; height: 100%; width: 38%; border-radius: inherit; background: linear-gradient(90deg, transparent, var(--accent), color-mix(in srgb, var(--accent) 40%, #fff)); box-shadow: 0 0 12px var(--accent); animation: building 2.4s cubic-bezier(.65, 0, .35, 1) infinite; }
@keyframes building { from { transform: translateX(-110%); } to { transform: translateX(290%); } }
.l-foot { display: flex; justify-content: space-between; gap: 16px; padding: 22px clamp(18px, 4vw, 48px) 26px; color: var(--text-3); font-size: 12.5px; animation: fade 1s ease 1s both; }
.l-foot a { color: var(--text-3); text-decoration: none; transition: color .2s; }
.l-foot a:hover { color: var(--accent-ink); }
@media (max-width: 600px) { .landing .rings { width: 150vmin; opacity: .4; } .l-hero h1 { margin: 22px 0; } }

/* ================= extra motion ================= */
/* ripple */
.btn, .folder, .chip, .w-stats button, .menu button, .palette li { position: relative; }
.ripple-box { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .18; transform: scale(0); animation: ripple .6s cubic-bezier(.22, 1, .36, 1) forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* rows slide out and collapse when archived / deleted / moved */
.msg.out { animation: rowOut .3s cubic-bezier(.55, 0, .2, 1) forwards; overflow: hidden; pointer-events: none; }
@keyframes rowOut {
    40% { opacity: 0; transform: translateX(36px); }
    to { opacity: 0; transform: translateX(36px); height: 0; padding-top: 0; padding-bottom: 0; }
}

/* star burst */
.star-btn.burst .i { animation: starPop .5s cubic-bezier(.34, 1.56, .64, 1); }
.star-btn.burst::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--warn); animation: starRing .5s ease-out forwards; pointer-events: none; }
.star-btn { position: relative; }
@keyframes starPop { 0% { transform: scale(.4) rotate(-30deg); } 60% { transform: scale(1.35) rotate(8deg); } }
@keyframes starRing { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }

/* folders cascade in on load; badges bump when they grow */
.folders.intro .folder { animation: rowUp .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 120ms); }
.folder .count.bump { animation: bump .6s cubic-bezier(.34, 1.56, .64, 1); display: inline-block; }
@keyframes bump { 30% { transform: scale(1.5); } }

/* opening a message */
.reader-content h1 { animation: focusIn .6s var(--ease) both; }
@keyframes focusIn { from { opacity: 0; filter: blur(8px); transform: translateY(6px); letter-spacing: .02em; } }
.reader-content .sender .avatar { animation: pop .5s cubic-bezier(.34, 1.56, .64, 1) .08s both; }
.reader-content .sender .info { animation: rise .5s var(--ease) .12s both; }
.reader-content #body-host { animation: rise .6s var(--ease) .18s both; }
.reader-content .att { animation: rowUp .5s var(--ease) both; }
.reader-content .att:nth-child(2) { animation-delay: .06s; } .reader-content .att:nth-child(3) { animation-delay: .12s; } .reader-content .att:nth-child(n+4) { animation-delay: .18s; }
.reader-content .quick-reply .btn { animation: rowUp .5s var(--ease) both; }
.reader-content .quick-reply .btn:nth-child(1) { animation-delay: .22s; } .reader-content .quick-reply .btn:nth-child(2) { animation-delay: .28s; } .reader-content .quick-reply .btn:nth-child(3) { animation-delay: .34s; }

/* springier toasts, menus, modals */
.toast { animation: toastIn .55s cubic-bezier(.34, 1.56, .64, 1); }
.menu { animation: menuIn .28s cubic-bezier(.34, 1.4, .64, 1); }
.modal { animation: modalIn .45s cubic-bezier(.34, 1.3, .64, 1); }

/* little hover touches */
.compose-btn:hover > .i { animation: wiggle .5s ease; }
@keyframes wiggle { 25% { transform: rotate(-14deg); } 60% { transform: rotate(10deg); } }
#theme-btn:hover .i { transform: rotate(40deg); transition: transform .4s var(--ease); }
.list-head #refresh-btn:active .i { transform: rotate(-180deg); transition: transform .4s var(--ease); }
