:root {
    color-scheme: light;
    --frame: #f4f4f6;
    --surface: #ffffff;
    --ink: #1c1c1f;
    --ink-2: #4a4a51;
    --ink-3: #6b6b73;
    --line: #e6e6e9;
    --line-strong: #d9d9de;
    --hover: rgba(20, 20, 30, 0.045);
    --red: #e3372d;
    --red-strong: #c92a20;
    --red-ink: #c4291e;
    --red-tint: #fdeeec;
    --red-chip: #f9d3ce;
    --blue: #2f6fe4;
    --blue-ink: #1d5fd0;
    --blue-tint: #f3f5f9;
    --blue-chip: #dce8fb;
    --green: #1f9d57;
    --amber: #c27803;
    --amber-ink: #8f5600;
    --amber-tint: #fdf5e6;
    --accent: #c92a20;
    --accent-strong: #ad241c;
    --accent-ink: #b1231b;
    --accent-tint: #fdeeec;
    --accent-chip: #f9d3ce;
    --radius-card: 18px;
    --shadow-card: 0 1px 2px rgba(20, 20, 30, 0.04), 0 10px 30px -18px rgba(20, 20, 30, 0.22);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; height: 100%; background: var(--frame); }

button, input, select { font: inherit; color: inherit; }

button { cursor: pointer; }

button:disabled { cursor: not-allowed; }

h1, h2, h3, p { margin: 0; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.fa-fw { flex: none; }

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes panel-in {
    from { opacity: 0; transform: translateX(14px); }
    to { opacity: 1; transform: none; }
}

.spinning { display: inline-flex; animation: spin 0.9s linear infinite; }

/* Shell */

.app-root { min-height: 100dvh; background: var(--frame); }

.app-root[data-accent="coral"], .accent-choice[data-accent="coral"] {
    --accent: #c92a20;
    --accent-strong: #ad241c;
    --accent-ink: #b1231b;
    --accent-tint: #fdeeec;
    --accent-chip: #f9d3ce;
}
.app-root[data-accent="blue"], .accent-choice[data-accent="blue"] {
    --accent: #2867cf;
    --accent-strong: #2055ac;
    --accent-ink: #1d5bbd;
    --accent-tint: #edf3fd;
    --accent-chip: #dce8fb;
}
.app-root[data-accent="teal"], .accent-choice[data-accent="teal"] {
    --accent: #087c78;
    --accent-strong: #066762;
    --accent-ink: #086c68;
    --accent-tint: #edf8f6;
    --accent-chip: #cdece7;
}
.app-root[data-accent="violet"], .accent-choice[data-accent="violet"] {
    --accent: #7351bc;
    --accent-strong: #5e3d9e;
    --accent-ink: #6543aa;
    --accent-tint: #f4f0fb;
    --accent-chip: #e7ddf6;
}
.app-root[data-accent="berry"], .accent-choice[data-accent="berry"] {
    --accent: #ad3970;
    --accent-strong: #902c5c;
    --accent-ink: #9c3064;
    --accent-tint: #fceff5;
    --accent-chip: #f4d8e6;
}
.app-root[data-accent="graphite"], .accent-choice[data-accent="graphite"] {
    --accent: #535b6b;
    --accent-strong: #414856;
    --accent-ink: #49515f;
    --accent-tint: #f0f2f5;
    --accent-chip: #dfe3ea;
}

.app-root.centered { display: grid; place-items: center; padding: 24px; }

.app-frame {
    --rail-w: 252px;
    --panel-w: 0px;
    position: relative;
    height: 100dvh;
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--panel-w);
    overflow: hidden;
}

.app-frame.rail-closed { --rail-w: 0px; }
.app-frame.panel-open { --panel-w: 344px; }
.app-frame.reading.panel-open { --panel-w: clamp(400px, 38vw, 580px); }

/* Expanded reader: the conversation takes over the list column. */
.app-frame.reader-expanded { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
.app-frame.reader-expanded .main-card { display: none; }
.app-frame.reader-expanded .side-panel { padding: 18px clamp(20px, 4vw, 56px) 32px; }
.app-frame.reader-expanded .side-panel > * { width: 100%; max-width: 880px; margin-inline: auto; }
.app-frame.reader-expanded .reader-subject { font-size: 26px; }

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink-3);
    transition: background-color 120ms, color 120ms;
}

.icon-button:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.icon-button:disabled { opacity: 0.4; }

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 18px -10px color-mix(in srgb, var(--accent) 85%, transparent);
    transition: background-color 140ms, transform 140ms var(--ease-out);
}

.cta-button:hover:not(:disabled) { background: var(--accent-strong); }
.cta-button:active:not(:disabled) { transform: translateY(1px); }
.cta-button:disabled { opacity: 0.55; box-shadow: none; }
.cta-button.wide { width: 100%; }

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-ink);
    font-weight: 600;
}

.link-button:hover:not(:disabled) { text-decoration: underline; }

/* Rail */

.rail {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 20px 14px 18px 18px;
    overflow-x: hidden;
    overflow-y: auto;
}

.rail-closed .rail { visibility: hidden; padding: 0; }

.rail-top { display: flex; align-items: center; gap: 4px; margin-bottom: 18px; }

.profile-wrap { position: relative; flex: 1; min-width: 0; }

.profile {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 4px 6px 4px 2px;
    border: 0;
    border-radius: 12px;
    background: none;
    text-align: left;
}

.profile:hover { background: var(--hover); }
.profile > .fa-fw { color: var(--ink-3); font-size: 11px; }

.avatar {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 50%;
    background: linear-gradient(160deg, #6a7579, #3f4a4d);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.owner-avatar { position: relative; overflow: hidden; }
.owner-avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.profile-text { display: flex; flex-direction: column; min-width: 0; }
.profile-text strong { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-text span { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    min-width: 180px;
    padding: 6px;
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 0 0 1px rgba(20, 20, 30, 0.06), 0 16px 32px -12px rgba(20, 20, 30, 0.3);
}

.profile-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    text-align: left;
}

.profile-menu button:hover { background: var(--hover); }

.search-block { position: relative; margin-bottom: 18px; }

.search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 12px;
    border-radius: 13px;
    background: var(--surface);
    color: var(--ink-3);
    box-shadow: 0 1px 2px rgba(20, 20, 30, 0.05);
    transition: box-shadow 140ms;
}

.search-field:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }

.search-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: none;
    color: var(--ink);
    font-size: 14px;
}

.search-field input::placeholder { color: var(--ink-3); }
.search-field input::-webkit-search-cancel-button { display: none; }

.search-help-toggle {
    display: grid;
    place-items: center;
    flex: none;
    width: 24px;
    height: 24px;
    margin-right: -6px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--ink-3);
    line-height: 1;
    transition: background-color 140ms, color 140ms;
}

.search-help-toggle > i { display: grid; place-items: center; }

.search-help-toggle:hover, .search-help-toggle[aria-expanded="true"] { background: var(--hover); color: var(--ink); }

.dialog.advanced-search {
    position: fixed;
    inset: 114px auto auto 20px;
    width: min(520px, calc(100vw - 40px));
    max-height: calc(100dvh - 138px);
    margin: 0;
    padding: 22px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 16px 32px -12px rgba(20, 20, 30, 0.3);
}

.advanced-search input::placeholder { color: var(--ink-3); opacity: 1; }
.advanced-search-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.advanced-search-fields input { min-width: 0; width: 100%; }
.advanced-search-hint { color: var(--ink-3); font-size: 12px; line-height: 1.45; }
.advanced-search-checks { display: grid; gap: 10px; padding-block: 4px; }
.advanced-search-error { color: var(--red-ink); font-size: 13px; }
.search-operators { color: var(--ink-2); font-size: 12.5px; }
.search-operators summary { width: fit-content; cursor: pointer; }
.search-operators dl { display: grid; gap: 3px; margin: 10px 0 0; }
.search-operators dt { margin-top: 6px; }
.search-operators dt code { color: var(--blue-ink); font-size: 12px; }
.search-operators dd { margin: 0; color: var(--ink-3); }
.search-scope { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.search-scope span { min-width: 0; overflow-wrap: anywhere; }
.search-scope .link-button { flex: none; font-size: inherit; }

.search-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }

.search-chip {
    max-width: 100%;
    overflow: hidden;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--accent-chip);
    color: var(--accent-ink);
    font-size: 12px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-chip.negated { background: var(--red-tint); color: var(--red-ink); }

.rail-nav { display: flex; flex-direction: column; gap: 2px; }
.rail-nav.secondary { margin-top: 18px; }
.rail-more > summary { list-style: none; cursor: pointer; }
.rail-more > summary::-webkit-details-marker { display: none; }
.rail-more[open] > summary .rail-icon { transform: rotate(180deg); }
.rail-more-views { padding-left: 12px; }

.rail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--ink-2);
    font-size: 14px;
    text-align: left;
    transition: background-color 120ms;
}

.rail-item:hover:not(:disabled) { background: var(--hover); }
.rail-item:disabled { opacity: 0.5; }

.rail-item.selected {
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(20, 20, 30, 0.05), 0 1px 3px rgba(20, 20, 30, 0.08);
}

.rail-icon { display: inline-grid; place-items: center; width: 20px; flex: none; color: var(--ink-3); font-size: 15px; }
.rail-icon.accent, .rail-item.selected > .rail-icon:not(.account) { color: var(--accent-ink); }
.rail-icon.account { color: var(--account); }

.rail-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.rail-count { color: var(--ink-3); font-size: 12.5px; font-weight: 400; font-variant-numeric: tabular-nums; }

.rail-alert { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.rail-alert.warn { background: var(--amber); }

.rail-folders { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 20px; padding-left: 8px; border-left: 2px solid color-mix(in srgb, var(--account) 30%, transparent); }
.rail-item.rail-folder { min-height: 30px; font-size: 13px; }
.rail-item.rail-folder .rail-icon { width: 16px; font-size: 13px; }

.rail-section { margin-top: 22px; }

.rail-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 6px;
    padding: 4px 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 600;
}

.rail-section-heading .fa-fw { color: var(--ink-3); font-size: 10px; }
.rail-section-heading:hover { background: var(--hover); }

.rail-empty { padding: 4px 10px; color: var(--ink-3); font-size: 13px; }

.rail-footer {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 22px;
    background: linear-gradient(to bottom, transparent, var(--frame) 18px);
}

.rail-footer .cta-button { width: 100%; }
.rail-footer p { color: var(--ink-3); font-size: 12.5px; text-align: center; }

.rail-scrim { display: none; }

/* Main card */

.main-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    margin: 12px 0;
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.rail-closed .main-card { margin-left: 12px; }
.app-frame:not(.panel-open) .main-card { margin-right: 12px; }

.main-header { padding: 34px 44px 16px; }

.title-row { display: flex; align-items: center; gap: 10px; min-width: 0; }

.title-row h1 {
    min-width: 0;
    overflow: hidden;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-menu { display: none; }

.header-actions { display: flex; flex: none; gap: 10px; margin-left: auto; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 17px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 120ms, border-color 120ms;
}

.pill.filled { border: 0; background: var(--accent-tint); color: var(--accent-ink); }
.pill.filled:hover:not(:disabled) { background: var(--accent-chip); }
.pill.outline { border: 1px solid var(--line-strong); background: var(--surface); }
.pill.outline:hover:not(:disabled), .pill.outline.active { border-color: #bdbdc4; background: #fafafb; }
.pill:disabled { opacity: 0.6; }

.meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    min-height: 36px;
    margin-top: 12px;
    color: var(--ink-3);
    font-size: 13px;
}

.meta-item { display: inline-flex; align-items: center; gap: 6px; }
.meta-item strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.meta-sep { color: #b4b4ba; }

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 44px 10px;
    padding: 10px 12px 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
}

.toast > span { flex: 1; padding-top: 1px; }
.toast > .fa-fw { margin-top: 3px; }
.toast button { padding: 2px 4px; border: 0; border-radius: 6px; background: none; color: inherit; opacity: 0.7; }
.toast button:hover { opacity: 1; background: rgba(0, 0, 0, 0.05); }
.toast.error { background: var(--red-tint); color: #9f2117; }
.toast.attention { background: var(--amber-tint); color: var(--amber-ink); }
.toast.notice { background: #eef3fd; color: #1b4a96; }
.toast.ephemeral-toast {
    position: fixed;
    z-index: 1000;
    right: 22px;
    bottom: 22px;
    max-width: min(460px, calc(100vw - 32px));
    margin: 0;
    box-shadow: 0 8px 28px rgba(20, 27, 44, 0.18);
}
.toast .toast-action {
    padding: 3px 8px;
    border: 1px solid currentColor;
    border-radius: 6px;
    font-weight: 650;
    opacity: 1;
}
.toast .toast-action:hover { background: rgba(0, 0, 0, 0.06); }

.restore-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 44px 12px;
    padding: 12px 12px 12px 14px;
    border-radius: 14px;
    background: var(--amber-tint);
    color: var(--amber-ink);
    font-size: 13.5px;
}

.restore-banner-icon {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(194, 120, 3, 0.14);
    color: var(--amber);
}

.restore-banner-text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.restore-banner-text strong { font-weight: 650; }
.restore-banner-text span { color: var(--amber-ink); opacity: 0.85; }
.restore-banner .pill.filled { flex: none; background: var(--surface); color: var(--amber-ink); box-shadow: 0 0 0 1px rgba(194, 120, 3, 0.25); }
.restore-banner .pill.filled:hover:not(:disabled) { background: #fffaf0; }

.main-scroll { flex: 1; min-height: 0; padding: 10px 26px 40px; overflow-y: auto; }

/* Groups */

.group { margin-bottom: 16px; padding: 12px 24px 12px; border-radius: 16px; }
.group.tone-red { background: var(--red-tint); }
.group.tone-blue { background: var(--blue-tint); }
.group.plain { padding-top: 8px; }
.group.plain .group-header { padding-bottom: 6px; border-bottom: 1px solid var(--line); }

.group-header { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }

.group-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 2px 4px 2px 0;
    border: 0;
    background: none;
    color: var(--ink);
}

.group-toggle .fa-fw { color: var(--ink-3); font-size: 10px; }
.group-toggle h2 { font-size: 15px; font-weight: 650; letter-spacing: -0.005em; }
.tone-red .group-toggle h2, .tone-red .group-toggle .fa-fw { color: var(--red-ink); }
.tone-blue .group-toggle h2, .tone-blue .group-toggle .fa-fw { color: var(--blue-ink); }

.group-chip {
    padding: 2px 10px;
    border-radius: 999px;
    background: #efeff1;
    color: var(--ink-2);
    font-size: 12.5px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tone-red .group-chip { background: var(--red-chip); color: var(--red-ink); }
.tone-blue .group-chip { background: var(--blue-chip); color: var(--blue-ink); }

.group-action {
    margin-left: auto;
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--red-ink);
    font-size: 13px;
    font-weight: 500;
}

.group-action:hover:not(:disabled) { text-decoration: underline; }

/* Rows */

.mail-row {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 12px;
    width: calc(100% + 16px);
    margin: 0 -8px;
    padding: 11px 8px;
    border: 0;
    border-radius: 11px;
    background: none;
    text-align: left;
    transition: background-color 120ms;
}

.mail-row.selectable { grid-template-columns: 34px minmax(0, 1fr); gap: 4px; padding: 0; }
.mail-row.selectable:hover { background: var(--hover); }
.tone-red .mail-row.selectable:hover, .tone-blue .mail-row.selectable:hover { background: rgba(255, 255, 255, 0.7); }
.mail-row.active { background: var(--accent-tint); }
.tone-blue .mail-row.active, .tone-red .mail-row.active { background: var(--surface); box-shadow: 0 1px 3px rgba(20, 20, 30, 0.08); }
.mail-row.checked { background: var(--accent-chip); }
.mail-selection { display: flex; align-items: flex-start; padding: 12px 8px; cursor: pointer; }
.mail-selection:has(input:disabled) { cursor: not-allowed; }
.mail-selection .mail-mark { appearance: auto; margin: 0; padding: 0; accent-color: var(--accent); cursor: inherit; }
.mail-open { width: 100%; padding: 11px 8px 11px 0; border: 0; border-radius: 8px; background: none; text-align: left; }
.mail-row.selectable.has-done { grid-template-columns: 34px minmax(0, 1fr) 40px; }
.mail-done {
    display: inline-grid;
    place-items: center;
    align-self: start;
    width: 32px;
    height: 32px;
    margin-top: 6px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--ink-3);
    opacity: 0;
    transition: opacity 120ms, background-color 120ms, color 120ms;
}
.mail-row:hover .mail-done, .mail-row:focus-within .mail-done, .mail-row.active .mail-done { opacity: 1; }
.mail-done:hover:not(:disabled) { background: var(--surface); color: var(--accent); }
.mail-done:disabled { cursor: not-allowed; }
@media (hover: none) { .mail-done { opacity: 1; } }
.selection-page { display: inline-flex; align-items: center; min-height: 34px; padding-right: 2px; cursor: pointer; }
.selection-page input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: inherit; }
.selection-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.meta-row .selection-actions { align-items: center; gap: 10px; }
.meta-row .conversation-action-group { gap: 2px; padding-left: 10px; }
.meta-row .icon-button { width: 34px; height: 34px; }
.selection-actions .pill { height: 34px; padding-inline: 12px; font-size: 12.5px; }
.selection-results { position: fixed; right: 24px; bottom: 0; z-index: 100; display: flex; flex-direction: column; width: min(440px, calc(100vw - 48px)); height: min(420px, calc(100dvh - 72px)); overflow: hidden; border-radius: 16px 16px 0 0; background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 24px 60px -18px rgba(20, 20, 30, 0.42); font-size: 13px; }
.selection-results.alongside-composer { right: 588px; }
.selection-results-heading { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 6px 12px 6px 18px; background: #1f1f24; color: #f4f4f6; }
.selection-results-heading .icon-button { color: inherit; }
.selection-results-heading .icon-button:hover { background: rgba(255, 255, 255, 0.1); }
.selection-results h2 { font-size: 14px; font-weight: 620; }
.selection-progress { flex: none; padding: 14px 18px 12px; border-bottom: 1px solid var(--line); }
.selection-progress p { margin-bottom: 8px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.selection-progress progress { display: block; width: 100%; height: 6px; accent-color: var(--accent); }
.selection-results-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 18px; overscroll-behavior: contain; }
.selection-result { display: flex; gap: 10px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.selection-result:last-child { border-bottom: none; }
.selection-result-icon { flex: none; padding-top: 2px; color: var(--ink-2); }
.selection-result-icon.success { color: var(--green); }
.selection-result-icon.warning { color: var(--red-ink); }
.selection-result-detail { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.selection-result .link-button { width: fit-content; max-width: 100%; text-align: left; overflow-wrap: anywhere; }
.selection-result-detail > span { color: var(--ink-2); overflow-wrap: anywhere; }
.selection-result-detail > .action-error { color: var(--red-ink); }
.selection-results-footer { flex: none; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

@media (max-width: 1099px) {
    .selection-results.alongside-composer { right: 24px; }
}
@media (max-width: 520px) {
    .selection-results, .selection-results.alongside-composer { right: 12px; width: calc(100vw - 24px); }
}

.mail-mark {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    border: 1.7px solid var(--account);
    border-radius: 5px;
    background: color-mix(in srgb, var(--account) 8%, transparent);
}

.mail-mark.alert { border-color: var(--red); }

.mail-body { display: flex; flex-direction: column; min-width: 0; }

.mail-subject, .mail-snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-subject { color: var(--ink); font-size: 14.5px; font-weight: 500; }
.mail-row.unread .mail-subject { font-weight: 700; }
.mail-unread-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-ink); }
@media (forced-colors: active) { .mail-unread-dot { background: CanvasText; forced-color-adjust: none; } }
.read-state { flex: none; font-size: 11px; font-weight: 650; }
.unknown-state { color: var(--ink-2); }
.mail-subject-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mail-subject-line .mail-subject { min-width: 0; }
.mail-state-tag { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--ink-3); font-size: 10.5px; font-weight: 650; }

.thread-count {
    flex: none;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--accent-chip);
    color: var(--accent-ink);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 16px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.mail-snippet { margin-top: 3px; color: var(--ink-3); font-size: 13px; }

.mail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    margin-top: 7px;
    color: var(--ink-3);
    font-size: 12.5px;
}

.mail-meta > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.meta-time { font-variant-numeric: tabular-nums; }
.meta-time.today { color: var(--red-ink); }
.meta-sender { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-tag { color: var(--account); font-weight: 600; }
.account-tag.removed { text-decoration: line-through; text-decoration-color: var(--ink-3); opacity: 0.7; }
.meta-retained { display: inline-flex; align-items: center; gap: 4px; color: var(--amber-ink); font-weight: 600; }
.meta-snoozed { color: var(--blue-ink); font-weight: 600; }
.retained-note { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; color: var(--amber-ink); font-size: 12.5px; font-weight: 600; }

[data-density="cozy"] .mail-open { padding-block: 8px; }
[data-density="cozy"] .mail-selection { padding-block: 10px; }
[data-density="cozy"] .mail-meta { margin-top: 4px; gap: 3px 12px; }
[data-density="compact"] .mail-open {
    display: grid;
    grid-template-columns: minmax(0, 0.65fr) minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding-block: 7px;
}
[data-density="compact"] .mail-selection { align-items: center; padding-block: 7px; }
[data-density="compact"] .mail-subject { font-size: 13px; }
[data-density="compact"] .mail-subject-line { gap: 5px; }
[data-density="compact"] .mail-state-label { display: none; }
[data-density="compact"] .thread-count { min-width: 16px; padding-inline: 4px; font-size: 10px; }
.mail-compact-sender { overflow: hidden; color: var(--ink-2); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.mail-compact-flags { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); }
.mail-compact-time { color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 6px 0;
    color: var(--ink-3);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 72px 24px;
    text-align: center;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin-bottom: 6px;
    border-radius: 50%;
    background: var(--frame);
    color: var(--ink-3);
}

.empty-state h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.015em; text-wrap: balance; }
.empty-state p { max-width: 44ch; margin-bottom: 8px; color: var(--ink-3); }

.draft-list { display: flex; flex-direction: column; gap: 7px; }
.draft-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    text-align: left;
    transition: border-color 120ms, background-color 120ms;
}
.draft-row:hover { border-color: var(--line-strong); background: #fcfcfd; }
.draft-row-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--accent-tint); color: var(--accent-ink); }
.draft-row-content { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.draft-row-content strong, .draft-row-content > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-row-content strong { font-size: 14px; font-weight: 650; }
.draft-row-content > span { color: var(--ink-2); font-size: 12.5px; }
.draft-row-content small { color: var(--ink-3); font-size: 11.5px; }
.draft-row-date { display: none; }
[data-density="cozy"] .draft-row { padding-block: 10px; }
[data-density="compact"] .draft-row { align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; }
[data-density="compact"] .draft-row-icon { width: 24px; height: 24px; border-radius: 6px; }
[data-density="compact"] .draft-row-content { display: grid; flex: 1; grid-template-columns: minmax(0, 0.65fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; }
[data-density="compact"] .draft-row-content strong { grid-column: 2; grid-row: 1; font-size: 13px; }
[data-density="compact"] .draft-row-content > span { grid-column: 1; grid-row: 1; }
[data-density="compact"] .draft-row-content small { display: none; }
[data-density="compact"] .draft-row-date { display: block; grid-column: 3; color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }

.reminders-view { --account: var(--accent); }
.settings-dialog.reminder-dialog { width: min(520px, calc(100vw - 32px)); }
.reminder-dialog .settings-heading { padding-bottom: 0; }
.reminder-form input { width: 100%; min-width: 0; }
.reminder-form textarea { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
.reminder-form textarea { resize: vertical; }
.reminder-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.reminder-form .muted { color: var(--ink-3); font-weight: 450; }
.reminder-group-heading h2 { font-size: 15px; font-weight: 650; letter-spacing: -0.005em; }
.mail-row.reminder-row { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 4px; padding: 0; }
.reminder-row:hover, .reminder-row:focus-within { background: var(--hover); }
.reminder-content { padding: 11px 8px 11px 0; }
.reminder-due.overdue { color: var(--accent-ink); font-weight: 650; }
.reminder-actions { display: flex; align-items: flex-start; padding-top: 6px; padding-right: 8px; opacity: 0; transition: opacity 120ms; }
.reminder-row:hover .reminder-actions, .reminder-row:focus-within .reminder-actions { opacity: 1; }
.reminder-actions .icon-button.danger { color: var(--red-ink); }
.reminder-actions .icon-button.danger:hover:not(:disabled) { background: var(--red-tint); color: var(--red-ink); }
@media (hover: none) { .reminder-actions { opacity: 1; } }
.completed-reminders .mail-subject { color: var(--ink-3); }
[data-density="cozy"] .reminder-content { padding-block: 8px; }
[data-density="compact"] .reminder-content { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding-block: 7px; }
[data-density="compact"] .reminder-content .mail-meta { margin: 0; }
[data-density="compact"] .reminder-actions { align-items: center; padding-top: 0; }
.reminder-empty { padding-block: 52px; }
@media (max-width: 520px) {
    [data-density="compact"] .reminder-content { display: flex; align-items: stretch; gap: 0; }
    [data-density="compact"] .reminder-content .mail-meta { margin-top: 4px; }
}

/* Side panel */

.side-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 14px 16px 18px;
    overflow-y: auto;
    animation: panel-in 260ms var(--ease-out);
}

.panel-head {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 32px;
    margin-bottom: 8px;
    padding-left: 6px;
    color: var(--ink-3);
    font-size: 13px;
}

.panel-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-head-actions { display: flex; flex: none; align-self: flex-start; gap: 2px; margin-left: auto; }

.composer-error { padding: 9px 11px; border-radius: 9px; background: var(--red-tint); color: var(--red-ink); font-size: 12px; overflow-wrap: anywhere; }
.composer-field { display: flex; flex-direction: column; gap: 5px; color: var(--ink-2); font-size: 11.5px; font-weight: 600; }
.composer-field input, .composer-field select {
    width: 100%;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 400;
}

/* Floating composer: compact (docked bottom-right), minimised (title bar only) and expanded (centred sheet). */
.compose-window {
    position: fixed;
    right: 24px;
    bottom: 0;
    z-index: 90;
    display: flex;
    flex-direction: column;
    width: min(540px, calc(100vw - 48px));
    height: min(600px, calc(100dvh - 72px));
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: var(--surface);
    box-shadow: 0 0 0 1px rgba(20, 20, 30, 0.06), 0 24px 60px -18px rgba(20, 20, 30, 0.42);
    animation: compose-rise 240ms var(--ease-out);
}

.compose-window.mode-minimized { width: min(320px, calc(100vw - 48px)); height: auto; animation: none; }

.compose-window.mode-expanded {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    z-index: 110;
    width: min(960px, calc(100vw - 64px));
    height: min(820px, calc(100dvh - 64px));
    border-radius: 20px;
    transform: translate(-50%, -50%);
    animation: compose-grow 220ms var(--ease-out);
}

.compose-backdrop { position: fixed; inset: 0; z-index: 105; background: rgba(24, 24, 30, 0.32); animation: fade-in 160ms ease-out; }

@keyframes compose-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes compose-grow { from { opacity: 0; transform: translate(-50%, -48%) scale(0.985); } }

.compose-window-bar {
    display: flex;
    flex: none;
    align-items: center;
    gap: 4px;
    min-height: 44px;
    padding: 0 6px 0 4px;
    background: #1f1f24;
    color: #f4f4f6;
}

.mode-expanded .compose-window-bar { min-height: 52px; padding: 0 10px 0 8px; background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); }

.compose-window-title {
    display: flex;
    flex: 1;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.compose-window-title > span { overflow: hidden; font-size: 13.5px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; line-height: 36px; }
.mode-expanded .compose-window-title > span { font-size: 16px; font-weight: 680; letter-spacing: -0.015em; }
.compose-window-title > small { flex: none; opacity: 0.62; font-size: 11.5px; white-space: nowrap; }

.compose-window-controls { display: flex; flex: none; gap: 2px; }

.compose-control {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: inherit;
    opacity: 0.78;
    transition: background-color 120ms, opacity 120ms;
}

.compose-control:hover, .compose-window-title:hover { background: rgba(255, 255, 255, 0.1); opacity: 1; }
.mode-expanded .compose-control:hover, .mode-expanded .compose-window-title:hover { background: var(--hover); }
.compose-control:focus-visible, .compose-window-title:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.compose-window-body { display: flex; flex: 1; flex-direction: column; gap: 10px; min-height: 0; padding: 4px 18px 14px; overflow-y: auto; }
.mode-expanded .compose-window-body { padding: 6px 32px 20px; }
.compose-window-body > .composer-error { margin-top: 10px; }
.compose-inline-action { align-self: flex-start; }
.compose-preparing { display: flex; align-items: center; gap: 10px; margin: auto; color: var(--ink-3); font-size: 13px; }
.spinner.small { width: 14px; height: 14px; }

.compose-fields { display: flex; flex: none; flex-direction: column; }

.compose-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    border-bottom: 1px solid var(--line);
    color: var(--ink-3);
    font-size: 13px;
}

.compose-row > span:first-child, .compose-row > label { flex: none; min-width: 38px; }
.compose-row input, .compose-row select {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 13.5px;
}

.compose-row select { cursor: pointer; }
.compose-row select.unchosen { color: var(--amber-ink); font-weight: 560; }
.compose-row input:focus, .compose-row select:focus, .compose-body:focus { outline: none; }
.compose-row:focus-within { border-bottom-color: var(--ink-3); }
.compose-subject { font-weight: 560; }
.compose-subject::placeholder, .compose-body::placeholder { color: var(--ink-3); font-weight: 400; }

.compose-cc-toggle { flex: none; padding: 4px 6px; border: 0; border-radius: 6px; background: none; color: var(--ink-3); font-size: 12.5px; }
.compose-cc-toggle:hover { background: var(--hover); color: var(--ink); }

.compose-body {
    flex: 1;
    min-height: 140px;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    line-height: 1.6;
    overflow-y: auto;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    cursor: text;
}

.compose-body:empty::before { color: var(--ink-3); content: attr(data-placeholder); pointer-events: none; }
.compose-body:focus { outline: none; }
.compose-body a { color: var(--accent-strong); text-decoration: underline; }
.compose-body ul, .compose-body ol { margin: 4px 0; padding-left: 24px; }
.compose-formatting { display: flex; flex: none; align-items: center; gap: 2px; min-height: 34px; padding: 2px 0; }
.compose-format-button {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-2);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}
.compose-format-button:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.compose-format-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.compose-format-button:disabled { opacity: 0.45; cursor: default; }
.compose-format-divider { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }

.mode-expanded .compose-body { font-size: 15px; line-height: 1.65; }

.compose-footer { display: flex; flex: none; align-items: center; gap: 6px; padding-top: 6px; }
.compose-footer .cta-button { min-height: 38px; padding: 0 20px; font-size: 14px; }
.compose-hint { flex: 1; min-width: 0; padding-left: 6px; color: var(--amber-ink); font-size: 12px; line-height: 1.35; }

.compose-tool {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--ink-2);
    cursor: pointer;
}

.compose-tool:hover { background: var(--hover); color: var(--ink); }
.compose-tool.danger:hover:not(:disabled) { background: var(--red-tint); color: var(--red-ink); }
.compose-tool:disabled { opacity: 0.4; cursor: default; }
.compose-tool input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.composer-attachments, .outbox-recipients { display: flex; flex-direction: column; gap: 5px; margin: 0; padding: 0; list-style: none; }
.composer-attachments li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 8px; background: var(--blue-tint); font-size: 11.5px; }
.composer-attachments li > span { display: flex; align-items: center; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.composer-attachments small { color: var(--ink-3); white-space: nowrap; }
.outbox-status { display: flex; flex-direction: column; gap: 9px; padding: 13px; border-radius: 12px; background: var(--blue-tint); color: var(--ink-2); font-size: 12px; }
.outbox-status h3 { color: var(--ink); font-size: 14px; font-weight: 680; }
.outbox-status p { line-height: 1.5; overflow-wrap: anywhere; }
.outbox-status.state-success { background: #eef8f1; }
.outbox-status.state-error { background: var(--red-tint); }
.outbox-status.state-warning { background: var(--amber-tint); }
.outbox-filing, .outbox-response { color: var(--ink-3); font-size: 11.5px; }
.outbox-recipients { gap: 0; padding-top: 4px; border-top: 1px solid rgba(80, 80, 90, 0.12); }
.outbox-recipients li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 7px 0; border-bottom: 1px solid rgba(80, 80, 90, 0.08); }
.outbox-recipient-address { display: flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.outbox-recipient-address input, .outbox-confirm input { accent-color: var(--accent); }
.outbox-recipients li strong { font-size: 11px; font-weight: 650; }
.outbox-recipients li small { grid-column: 1 / -1; color: var(--ink-3); font-size: 10.5px; }
.outbox-confirm { display: flex; align-items: flex-start; gap: 7px; color: var(--amber-ink); font-size: 11.5px; }
.outgoing-success { color: var(--green); font-size: 11.5px; }

.insights { display: flex; flex-direction: column; gap: 12px; }

.panel-card { padding: 16px 18px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(20, 20, 30, 0.04); }
.panel-card.tone-red { background: var(--red-tint); box-shadow: none; }

.panel-card h3 {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 650;
}

.tone-red h3 { color: var(--red-ink); }
.card-count { font-size: 17px; font-weight: 650; }

.stale-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.stale-list li { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; }
.stale-list .bullet { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--red); }
.stale-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stale-age { color: var(--red-ink); font-weight: 650; font-variant-numeric: tabular-nums; }

.card-foot { margin-top: 10px; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
.tone-red .card-foot { color: #8f4a44; }

.ring-card { display: flex; align-items: center; gap: 16px; }

.ring {
    position: relative;
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    flex: none;
    border-radius: 50%;
    background: conic-gradient(var(--blue) calc(var(--value) * 1%), #e8e8ec 0);
}

.ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.ring-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 13px; color: var(--ink-2); }
.ring-text strong { color: var(--ink); font-size: 16px; font-weight: 650; }
.ring-text .muted { color: var(--ink-3); font-size: 12.5px; line-height: 1.35; }

.card-label { color: var(--ink-2); font-size: 12.5px; font-weight: 650; }

.card-figure {
    margin-top: 2px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
}

.card-figure span { color: var(--ink-2); font-size: 13px; font-weight: 400; letter-spacing: 0; }

.luma-account-distribution { display: flex; gap: 3px; height: 8px; margin: 12px 0 10px; }
.luma-account-distribution span { min-width: 6px; border-radius: 3px; background: var(--account); }

.luma-account-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 12.5px; }
.luma-account-legend li { display: inline-flex; align-items: center; gap: 6px; }
.luma-account-legend .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--account); }
.luma-account-legend strong { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }

.bar-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 130px; margin-top: 14px; }
.bar-col { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.bar-track { display: flex; flex: 1; align-items: flex-end; min-height: 0; }
.bar { display: block; width: 100%; min-height: 3px; border-radius: 3px 3px 0 0; background: #9ca2ad; transition: height 400ms var(--ease-out); }
.bar.today { background: #e8564c; }
.bar-label { color: var(--ink-3); font-size: 11px; text-align: center; }

/* Reader */

.reader { display: flex; flex: 0 0 auto; flex-direction: column; gap: 14px; padding: 0 4px; container: reader / inline-size; }

.reader-subject { min-width: 0; margin: 0; color: var(--ink); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; text-wrap: balance; overflow-wrap: anywhere; }

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

.sender-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 50%;
    background: color-mix(in srgb, var(--account) 15%, white);
    color: color-mix(in srgb, var(--account) 80%, black);
    font-size: 13px;
    font-weight: 650;
}

.reader-from-text { display: flex; flex-direction: column; min-width: 0; }
.reader-from-text strong { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.reader-from-text > span { overflow: hidden; color: var(--ink-3); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }

.reader-date { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12.5px; }

.conversation-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 2px 0 6px; }
.conversation-actions .pill { height: 34px; padding: 0 12px; font-size: 12.5px; }
.conversation-action-group { display: flex; align-items: center; gap: 4px; padding-left: 12px; border-left: 1px solid var(--line); }
.conversation-actions .icon-button { width: 38px; height: 38px; }
.conversation-actions .icon-button[aria-pressed="true"] { background: var(--accent-chip); color: var(--accent-ink); }
.reader-toolbar { align-items: flex-start; gap: 8px; margin-bottom: 0; padding-left: 0; }
.reader-toolbar .conversation-actions { flex: 1; min-width: 0; gap: 8px; padding: 0; }
.reader-toolbar .panel-head-actions .icon-button { width: 38px; height: 38px; }
.reader-action-chevron { display: inline-flex; }

@container reader (max-width: 620px) {
    .reader-toolbar .conversation-actions { gap: 2px; }
    .reader-toolbar .conversation-actions .icon-button,
    .reader-toolbar .conversation-actions .pill,
    .reader-toolbar .panel-head-actions .icon-button { width: 32px; height: 34px; padding: 0; }
    .reader-toolbar .conversation-actions .pill { justify-content: center; }
    .reader-toolbar .reader-action-label, .reader-toolbar .reader-action-chevron { display: none; }
    .reader-toolbar .conversation-action-group { gap: 1px; padding-left: 4px; }
}
.snooze-editor { display: flex; flex-direction: column; gap: 9px; max-width: 460px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--frame); }
.snooze-editor label { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12.5px; font-weight: 600; }
.snooze-editor input { min-height: 36px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit; }
.snooze-editor > span { color: var(--ink-3); font-size: 11.5px; line-height: 1.45; }
.snooze-editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.conversation-more-trigger { anchor-name: --conversation-more; }
.conversation-more-actions {
    position: fixed;
    position-anchor: --conversation-more;
    position-area: bottom span-left;
    inset: auto;
    width: 190px;
    margin: 6px 0 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 8px 24px rgba(20, 20, 30, 0.12);
}
.conversation-more-actions button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: inherit; text-align: left; font-size: 13px; }
.conversation-more-actions button:hover:not(:disabled) { background: var(--hover); }
.conversation-more-actions button.danger { color: #a53d3d; }
.conversation-more-actions button.danger:hover:not(:disabled) { background: #fff1ef; }
.conversation-more-actions hr { margin: 6px 4px; border: 0; border-top: 1px solid var(--line); }
.newsletter-menu-trigger { anchor-name: --newsletter-menu; }
.newsletter-menu { position-anchor: --newsletter-menu; position-try-fallbacks: flip-inline; width: min(340px, calc(100vw - 24px)); max-height: min(480px, calc(100dvh - 100px)); overflow-y: auto; }
.newsletter-message-picker { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; font-size: 12px; font-weight: 600; }
.newsletter-message-picker select { width: 100%; min-width: 0; min-height: 36px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px; background: var(--surface); font: inherit; }
.newsletter-menu-sender { padding: 6px 10px; font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.pill.outline.danger { color: #a53d3d; }
.pill.outline.danger:hover:not(:disabled) { border-color: #e2baba; background: #fff8f7; }

.action-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 9px;
    background: #edf2fb;
    color: #46618b;
    font-size: 12px;
}
.action-attention { display: flex; flex-direction: column; gap: 8px; }
.action-attention-entry { padding: 10px 12px; border: 1px solid #e8d4b8; border-radius: 10px; background: #fff9f0; }
.action-attention-heading { display: flex; align-items: center; gap: 7px; color: #754d1d; }
.action-attention-heading strong { flex: 1; font-size: 12.5px; font-weight: 650; }
.action-attention-heading button { padding: 3px; border: 0; border-radius: 5px; background: transparent; color: inherit; }
.action-attention-heading button:hover { background: rgba(117, 77, 29, 0.08); }
.action-attention-entry p { margin-top: 5px; color: #754d1d; font-size: 11.5px; line-height: 1.5; }
.action-attention-entry .action-error { color: #8b3c2b; }
.conversation-action-history { padding: 12px 0 4px; border-top: 1px solid var(--line); }
.conversation-action-history > summary { display: flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.conversation-action-history > summary span { padding: 2px 6px; border-radius: 999px; background: #f0f0f2; color: var(--ink-2); font-size: 10px; letter-spacing: 0; }
.conversation-action-history > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.conversation-action-list { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
.conversation-action-entry { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.action-entry-heading { display: flex; align-items: center; gap: 8px; }
.action-entry-heading strong { font-size: 13px; font-weight: 600; }
.action-state { margin-left: auto; padding: 3px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 650; }
.state-success { background: #edf5ef; color: #38664a; }
.state-warning { background: #fff3e5; color: #875521; }
.state-running { background: #edf2fb; color: #46618b; }
.state-pending { background: #f0f0f2; color: #666873; }
.conversation-action-entry p { margin-top: 5px; color: var(--ink-3); font-size: 11.5px; line-height: 1.5; }
.conversation-action-entry .action-error { color: #875521; }
.link-button { margin: 8px 12px 0 0; padding: 0; border: 0; background: transparent; color: #4b5e91; font-size: 12px; font-weight: 600; cursor: pointer; }
.link-button:hover:not(:disabled) { text-decoration: underline; }
.link-button:disabled { opacity: 0.55; cursor: default; }
.link-button.quiet { color: var(--ink-3); }

.thread { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }

.thread-message { padding-inline-start: 2px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(20, 20, 30, 0.04); }
.thread-message.unread { padding-inline-start: 0; border-inline-start: 2px solid var(--accent-ink); }
@media (forced-colors: active) { .thread-message.unread { border-inline-start-color: CanvasText; } }

.thread-head {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 16px;
    background: none;
    color: inherit;
    text-align: left;
}

.thread-message.expanded .thread-head { border-radius: 16px 16px 0 0; }
.thread-message .sender-avatar { width: 34px; height: 34px; font-size: 12px; }
.thread-head-text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.thread-head-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.thread-head-top strong { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.thread-head-top .unknown-state { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-head-top time { flex: none; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.thread-sub { overflow: hidden; color: var(--ink-3); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.thread-message.expanded .thread-head-top strong,
.thread-message.expanded .thread-address { white-space: normal; overflow-wrap: anywhere; }

.thread-content { display: flex; flex-direction: column; gap: 12px; padding: 0 14px 14px; }
.thread-content .panel-card.attachments { background: var(--frame); box-shadow: none; }
.thread-content .reader-body { padding: 4px 2px 0; background: none; box-shadow: none; }

.panel-card.attachments { padding: 12px; }
.panel-card.attachments h3 { margin: 2px 6px 6px; justify-content: flex-start; gap: 8px; }
.panel-card.attachments h3 span { color: var(--ink-3); font-weight: 500; }

.attachment {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px;
    border-radius: 10px;
    color: var(--ink-2);
    font-size: 13px;
    text-decoration: none;
}

.attachment:hover { background: var(--frame); color: var(--ink); }

.file-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 8px;
    background: color-mix(in srgb, var(--account) 12%, white);
    color: color-mix(in srgb, var(--account) 80%, black);
}

.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }

.reader-body { padding: 22px 24px; border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(20, 20, 30, 0.04); }

.reader-body pre {
    max-width: 72ch;
    margin: 0;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.body-unavailable { color: var(--ink-3); }
.body-loading { min-height: 120px; margin: 0; color: var(--ink-3); font-size: 12.5px; }

.body-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 0 0 12px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--frame);
    font-size: 12.5px;
}
.body-toolbar:not(:has(.remote-notice)) { justify-content: flex-end; padding: 0; background: none; }
.remote-notice { display: flex; flex: 1 1 220px; align-items: center; gap: 6px; margin: 0; color: var(--ink-2); }
.body-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.body-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 4px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.body-action:hover { background: var(--hover); }
.body-action.quiet { border-color: transparent; background: transparent; color: var(--ink-3); font-weight: 500; }
.body-action.quiet:hover { color: var(--ink); background: var(--hover); }
.body-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.image-privacy-choice { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--frame); color: var(--ink-2); font-size: 12.5px; overflow-wrap: anywhere; }
.image-privacy-choice .body-actions { margin-left: 0; }

.html-body {
    display: block;
    width: 100%;
    height: 160px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color-scheme: light;
}

/* Dialog */

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(24, 24, 30, 0.32);
    animation: fade-in 160ms ease-out;
}

@keyframes fade-in { from { opacity: 0; } }

.dialog {
    width: min(460px, 100%);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    padding: 24px;
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 30px 70px -20px rgba(20, 20, 30, 0.45);
}

.dialog-heading { display: flex; align-items: center; justify-content: space-between; }
.dialog-heading h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.dialog-copy { margin: 6px 0 18px; color: var(--ink-3); font-size: 13.5px; }

.dialog form { display: flex; flex-direction: column; gap: 14px; }
.dialog label { display: flex; flex-direction: column; gap: 6px; }
.dialog label > span { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }

.dialog input, .dialog select {
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    font-size: 14px;
    transition: border-color 120ms, box-shadow 120ms;
}

.dialog input:focus, .dialog select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

.server-address {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--frame);
    color: var(--ink-2);
    font-size: 12.5px;
}

.fixture-note { color: var(--ink-3); font-size: 12.5px; }
.fixture-note code { padding: 1px 5px; border-radius: 5px; background: var(--frame); font-size: 12px; }

.dialog-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.dialog-footer span { color: var(--ink-3); font-size: 12px; }

.settings-dialog { width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 0; }
.settings-dialog::backdrop { background: rgba(20, 20, 30, 0.36); }
.settings-heading { display: flex; align-items: center; gap: 12px; padding: 24px 24px 18px; }
.settings-heading > div { flex: 1; min-width: 0; }
.settings-heading h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.settings-heading p { margin-top: 2px; color: var(--ink-3); font-size: 13px; overflow-wrap: anywhere; }
.settings-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.settings-tabs button { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-3); }
.settings-tabs button[aria-pressed="true"] { border-bottom-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.settings-tabs button > span { font-size: 12px; }
.settings-content { padding: 22px 24px 24px; }
.settings-copy { margin-bottom: 18px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.settings-content > .inline-error, .settings-feedback { margin-bottom: 16px; }
.settings-feedback { color: var(--ink-2); font-size: 14px; }
.settings-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; min-width: 0; margin: 0; padding: 0; border: 0; }
.settings-choices legend { margin-bottom: 8px; padding: 0; color: var(--ink-2); font-size: 13px; font-weight: 600; }
.settings-dialog label.settings-choice { display: flex; flex-direction: row; align-items: center; gap: 10px; min-height: 44px; padding: 8px; border-radius: 8px; cursor: pointer; }
.settings-choice:hover { background: var(--hover); }
.settings-dialog .settings-choice > span { flex: 1; min-width: 0; color: var(--ink); font-size: 14px; font-weight: 500; }
.settings-choice > .fa-fw { color: var(--ink-3); }
.settings-dialog .settings-choice input { flex: none; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--accent); }
.settings-dialog label.settings-accounts-choice { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); border-radius: 0; }
.settings-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.settings-footer > span { color: var(--ink-2); font-size: 13px; }
.profile-field-help { color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.profile-facts { margin: 4px 0; }
.profile-facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.profile-facts dt { color: var(--ink-3); }
.profile-facts dd { margin: 0; color: var(--ink-2); }
.profile-section-title { margin-bottom: 8px; font-size: 15px; font-weight: 600; }
.profile-security-state { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 4px 20px; }
.profile-security-state > div { flex: 1; min-width: 200px; }
.profile-security-state strong { font-size: 14px; }
.profile-security-state p { margin-top: 5px; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.profile-passkeys { margin: 0; padding: 0; list-style: none; }
.profile-passkeys li { padding: 14px 0; border-bottom: 1px solid var(--line); }
.profile-passkeys li:last-child { border-bottom: 0; }
.profile-passkeys li form { margin-top: 14px; }
.profile-passkey-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.profile-passkey-row > div { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.profile-passkey-row strong { font-size: 14px; }
.profile-passkey-row p { margin-top: 4px; color: var(--ink-3); font-size: 13px; }
.profile-recovery { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.profile-recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 18px; padding: 16px; border-radius: 12px; background: var(--frame); list-style: none; }
.profile-recovery-codes code, .profile-shared-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; letter-spacing: 0.04em; color: var(--ink); }
.profile-shared-key { padding: 2px 6px; border-radius: 6px; background: var(--frame); overflow-wrap: anywhere; }
.profile-setup-steps { display: flex; flex-direction: column; gap: 20px; margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.profile-setup-steps li::marker { color: var(--ink-3); font-weight: 600; }
.profile-setup-steps > li > p { margin-bottom: 12px; }
.profile-qr { width: 176px; height: 176px; margin-bottom: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.profile-qr svg { display: block; width: 100%; height: 100%; }
@media (max-width: 520px) { .profile-recovery-codes { grid-template-columns: 1fr; } }
.appearance-options { min-width: 0; margin: 0; padding: 0; border: 0; }
.appearance-options legend { margin-bottom: 12px; padding: 0; font-size: 14px; font-weight: 600; }
.appearance-settings > .appearance-options + .appearance-options { margin-top: 10px; }
.density-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.settings-dialog .density-choice { gap: 10px; min-width: 0; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; }
.density-choice:hover { background: var(--hover); }
.density-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.density-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.settings-dialog .density-choice-caption { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.settings-dialog .density-choice input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--accent); box-shadow: none; }
.settings-dialog .density-description { color: var(--ink-3); font-size: 12px; font-weight: 400; }
.settings-dialog .density-example { display: flex; flex-direction: column; justify-content: center; gap: 7px; height: 106px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.density-example-row { display: grid; grid-template-columns: 7px minmax(0, 1fr); align-items: center; gap: 4px 6px; padding-block: 3px; }
.density-example-check { grid-row: span 3; align-self: start; width: 6px; height: 6px; border: 1px solid var(--ink-3); border-radius: 1px; }
.density-example-subject { height: 4px; width: 80%; border-radius: 1px; background: var(--ink-2); }
.density-example-preview { height: 3px; border-radius: 1px; background: var(--line-strong); }
.density-example-meta { height: 3px; width: 55%; border-radius: 1px; background: var(--ink-3); }
.density-example-cozy .density-example-check { grid-row: span 2; }
.density-example-cozy .density-example-preview, .density-example-compact .density-example-preview { display: none; }
.density-example-compact .density-example-row { grid-template-columns: 6px minmax(0, 1fr) minmax(0, 2fr); gap: 6px; }
.density-example-compact .density-example-check { grid-row: auto; align-self: center; }
.density-example-compact .density-example-subject { height: 3px; width: 100%; }
.density-example-compact .density-example-meta { width: 100%; background: var(--line-strong); }
.appearance-hint { margin: -4px 0 16px; color: var(--ink-3); font-size: 12.5px; }
.accent-choices { display: flex; flex-wrap: wrap; gap: 18px; padding: 4px; }
.settings-dialog .accent-choice { position: relative; align-items: center; gap: 10px; min-width: 54px; cursor: pointer; }
.settings-dialog .accent-choice input { position: absolute; inset: 0 auto auto 50%; width: 36px; height: 36px; margin: 0; padding: 0; opacity: 0; transform: translateX(-50%); cursor: pointer; }
.settings-dialog .accent-swatch { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: white; }
.accent-swatch > i { opacity: 0; }
.accent-choice:has(input:checked) .accent-swatch { outline: 2px solid var(--accent); outline-offset: 3px; }
.accent-choice:has(input:checked) .accent-swatch > i { opacity: 1; }
.accent-choice:has(input:focus-visible) .accent-swatch { outline: 2px solid var(--ink); outline-offset: 5px; }
.accent-choice:hover .accent-swatch { outline: 2px solid var(--line-strong); outline-offset: 3px; }
.settings-dialog .accent-choice > span:last-child { color: var(--ink-2); font-size: 12px; font-weight: 400; }
.appearance-options:disabled label { opacity: 0.6; cursor: not-allowed; }
.settings-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.settings-section-heading h3 { font-size: 16px; font-weight: 600; }
.settings-account-list { display: flex; flex-direction: column; }
.settings-account { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.settings-account:last-child { border-bottom: 0; }
.settings-account:hover { background: var(--hover); }
.settings-account > span:not(.avatar) { display: flex; flex: 1; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.settings-account strong { font-size: 14px; font-weight: 600; }
.settings-account small { margin-top: 2px; color: var(--ink-3); font-size: 13px; }
.settings-account > .fa-fw { color: var(--ink-3); }
.settings-account > .rail-alert { flex: none; }
.settings-account-summary { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.settings-account-summary .avatar { background: var(--account); }
.settings-account-summary > div { flex: 1; min-width: 0; }
.settings-account-summary h3 { font-size: 18px; font-weight: 700; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.settings-account-summary p { margin-top: 2px; color: var(--ink-3); font-size: 13px; overflow-wrap: anywhere; }
.settings-account-summary .pill { flex: none; }
.settings-accordions { margin-top: 22px; border-bottom: 1px solid var(--line); }
.settings-accordion { border-top: 1px solid var(--line); }
.settings-accordion > summary { display: flex; align-items: center; gap: 12px; min-height: 48px; color: var(--ink-2); cursor: pointer; list-style: none; }
.settings-accordion > summary::-webkit-details-marker { display: none; }
.settings-accordion > summary::marker { content: ""; }
.settings-accordion > summary h4 { flex: 1; margin: 0; color: inherit; font-size: 14px; font-weight: 600; }
.settings-accordion > summary:hover { color: var(--ink); }
.settings-accordion-warning { color: var(--amber-ink); font-size: 12px; font-weight: 600; }
.settings-accordion-warning.error { color: var(--red-ink); }
.settings-accordion-chevron { display: inline-flex; color: var(--ink-3); transition: transform 120ms ease; }
.settings-accordion[open] > summary .settings-accordion-chevron { transform: rotate(180deg); }
.settings-accordion-panel { padding-bottom: 18px; }
.settings-accordion .folder-list { margin: 6px -8px 8px; }
.settings-dialog .settings-accordion label.settings-choice { margin-inline: -8px; }
.settings-outgoing > label { margin-top: 12px; }
.settings-outgoing .settings-footer { margin-top: 14px; }
.settings-outgoing .settings-footer > span:empty { display: none; }
.settings-outgoing .settings-footer .link-button { margin-left: auto; }
.settings-outgoing-summary > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.settings-outgoing-summary .outgoing-success { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.settings-outgoing-summary .settings-copy { margin: 8px 0 0; }
.settings-remove-account { border-color: color-mix(in srgb, var(--red-ink) 24%, var(--line)); }
.settings-remove-account .settings-accordion-panel > .pill { margin-top: 6px; }
.settings-remove-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 14px; margin-top: 10px; }
.held-outbox { display: grid; gap: 8px; margin: 20px 0; }
.held-outbox h2 { margin: 0; font-size: 15px; }
.held-outbox > p { margin: 0 0 4px; color: var(--ink-2); font-size: 13px; }
.settings-account-form fieldset { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-width: 0; margin: 0; padding: 0; border: 0; }
.settings-account-form .server-address, .settings-account-form .toggle-row, .settings-account-form .fixture-note,
.settings-account-form .outgoing-password { grid-column: 1 / -1; }
.settings-account-form label { min-width: 0; }
.settings-account-form input, .settings-account-form select { min-width: 0; width: 100%; }

@media (prefers-reduced-motion: reduce) {
    .settings-accordion-chevron { transition: none; }
}

@media (max-width: 520px) {
    .settings-heading { padding: 18px 16px 14px; }
    .settings-heading > .icon-button { width: 40px; height: 40px; }
    .settings-tabs { padding-inline: 16px; }
    .settings-content { padding: 18px 16px; }
    .settings-choices, .settings-account-form fieldset { grid-template-columns: minmax(0, 1fr); }
    .settings-account-form input, .settings-account-form select { font-size: 16px; }
    .settings-account-form .dialog-footer { flex-wrap: wrap; }
}

/* Sign-in and loading */

.sign-in-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: min(420px, 100%);
    padding: 40px 36px 32px;
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.sign-in-logo { display: block; width: min(230px, 100%); height: auto; margin-bottom: 2px; }

.sign-in-card h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; }
.sign-in-copy { max-width: 34ch; margin-bottom: 10px; color: var(--ink-3); }
.sign-in-card .cta-button { width: 100%; }
.sign-in-footnote { color: var(--ink-3); font-size: 12.5px; }

.inline-error { width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--red-tint); color: #9f2117; font-size: 13px; }

.account-page { min-height: 100dvh; }
.account-card .inline-error { text-align: left; }
.account-form { display: flex; flex-direction: column; gap: 14px; width: 100%; margin-top: 4px; text-align: left; }
.account-form label { display: flex; flex-direction: column; gap: 6px; }
.account-form label > span { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }

.account-form input:not([type="checkbox"]) {
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    transition: border-color 120ms, box-shadow 120ms;
}

.account-form input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.account-form input.invalid { border-color: var(--red); }
.account-form .cta-button { width: 100%; margin-top: 4px; }

.account-form label.account-check { flex-direction: row; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13.5px; cursor: pointer; }
.account-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.account-passkey { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%; }
.account-passkey[hidden], .account-passkey [hidden] { display: none; }
.account-passkey-divider { color: var(--ink-3); font-size: 13px; }
.account-passkey-button { justify-content: center; min-height: 42px; }

.field-help { color: var(--ink-3); font-size: 12px; }
.field-error, .account-form .validation-message { color: #9f2117; font-size: 12px; }
.account-form .validation-errors { display: none; }

.account-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.account-link:hover { text-decoration: underline; }
.account-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.loading-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 28px;
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
    color: var(--ink-2);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #f2cdc9;
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Responsive */

/* Sync progress and account details */

.rail-sync { display: flex; flex-direction: column; gap: 4px; margin: -2px 0 6px; padding: 0 10px 0 40px; color: var(--ink-3); font-size: 12px; }
.rail-sync.failed { color: var(--red-ink); }
.rail-sync-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }

.rail-sync-track { position: relative; display: block; height: 3px; overflow: hidden; border-radius: 2px; background: var(--line); }
.rail-sync-track.wide { height: 4px; margin: 10px 0 2px; }

.rail-sync-bar {
    display: block;
    height: 100%;
    min-width: 4px;
    border-radius: inherit;
    background: var(--account, var(--blue));
    transition: width 400ms var(--ease-out);
}

.rail-sync-bar.indeterminate { position: absolute; width: 35% !important; animation: sync-slide 1.4s var(--ease-out) infinite; }

@keyframes sync-slide {
    from { left: -35%; }
    to { left: 100%; }
}

.account-status { margin-top: 10px; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.account-status.failed { color: var(--red-ink); }

.account-error {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--red-tint);
    color: var(--red-ink);
    font-size: 12.5px;
    overflow-wrap: anywhere;
}

.folder-list { display: flex; flex-direction: column; gap: 2px; margin: 12px -8px 4px; padding: 0; list-style: none; }

.folder-row {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    grid-template-areas: "icon name count" "icon role status";
    align-items: center;
    column-gap: 8px;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--ink-2);
    font-size: 13px;
    text-align: left;
}

.folder-row.excluded { opacity: 0.55; }

.folder-icon { grid-area: icon; color: var(--ink-3); }
.folder-name { grid-area: name; overflow: hidden; color: var(--ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.folder-role { grid-area: role; color: var(--ink-3); font-size: 11.5px; }
.folder-count { grid-area: count; color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.folder-status { grid-area: status; color: var(--ink-3); font-size: 11.5px; text-align: right; }
.folder-status.status-ok { color: var(--green); }
.folder-status.status-importing { color: var(--blue-ink); }
.folder-status.status-failed { color: var(--red-ink); }

.folder-status.status-missing { color: var(--ink-3); font-style: italic; }
.folder-status.status-removalpaused { color: var(--amber-ink); font-weight: 600; }

.folder-removals {
    margin: 4px 8px 6px 36px;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--amber-tint);
    color: var(--ink-2);
    font-size: 12px;
    line-height: 1.45;
}

.folder-removals p { margin: 0; }
.folder-removals strong { display: block; color: var(--amber-ink); }
.folder-removal-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.link-button.quiet { color: var(--ink-2); }
.folder-missing { margin: 2px 8px 4px 36px; color: var(--ink-3); font-size: 11.5px; }

.folder-gaps { margin: 2px 8px 4px 36px; color: var(--red-ink); font-size: 11.5px; }

.toggle-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 12px; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.toggle-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--red); }

.dialog label.toggle-row { flex-direction: row; margin: 0; }
.dialog label.toggle-row > span { font-weight: 500; }
.dialog .toggle-row input { height: 16px; padding: 0; }

@media (max-width: 1279px) {
    .app-frame { --rail-w: 232px; }
    .app-frame.panel-open { --panel-w: 312px; }
    .app-frame.reading.panel-open { --panel-w: 420px; }
    .main-header { padding: 28px 32px 14px; }
    .toast, .restore-banner { margin-inline: 32px; }
    .main-scroll { padding-inline: 18px; }
}

@media (max-width: 1099px) {
    .app-frame.panel-open, .app-frame.reading.panel-open { --panel-w: 0px; }
    .app-frame.panel-open .main-card { margin-right: 12px; }

    .side-panel {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
        width: min(380px, 100%);
        background: var(--frame);
        box-shadow: -24px 0 48px -24px rgba(20, 20, 30, 0.35);
    }

    .reading .side-panel { width: min(560px, 100%); }
    .reader-expanded .side-panel { position: static; width: auto; box-shadow: none; }
}

@media (max-width: 899px) {
    .app-frame, .app-frame.rail-closed { --rail-w: 0px; grid-template-columns: minmax(0, 1fr); }

    .rail, .rail-closed .rail {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 30;
        width: min(290px, 86vw);
        padding: 20px 14px 18px 18px;
        background: var(--frame);
        visibility: visible;
        transform: translateX(-100%);
        transition: transform 260ms var(--ease-out), visibility 0s 260ms;
    }

    .rail-closed .rail { visibility: hidden; }

    .rail-open .rail {
        transform: none;
        box-shadow: 24px 0 48px -24px rgba(20, 20, 30, 0.35);
        transition: transform 260ms var(--ease-out);
    }

    .rail-open .rail-scrim { position: absolute; inset: 0; z-index: 25; display: block; background: rgba(24, 24, 30, 0.28); }

    .main-card, .rail-closed .main-card, .app-frame.panel-open .main-card,
    .app-frame:not(.panel-open) .main-card { margin: 0; border-radius: 0; box-shadow: none; }

    .rail-toggle { display: none; }
    .mobile-menu { display: inline-grid; margin-left: -6px; }

    .main-header { padding: 16px 18px 10px; }
    .title-row h1 { font-size: 23px; }
    .pill { height: 34px; padding: 0 13px; }
    .toast, .restore-banner { margin-inline: 14px; }
    .main-scroll { padding: 6px 8px 28px; }
    .group { padding: 10px 14px 8px; margin-bottom: 10px; }
    .meta-sender { max-width: 160px; }

    .side-panel, .reading .side-panel { width: 100%; }
}

@media (max-width: 720px) {
    .compose-window, .compose-window.mode-expanded {
        inset: 0;
        width: 100%;
        height: 100dvh;
        border-radius: 0;
        transform: none;
        animation: compose-rise 220ms var(--ease-out);
    }

    .compose-window.mode-minimized { inset: auto 12px 0; width: auto; height: auto; border-radius: 14px 14px 0 0; }
    .compose-window .compose-control[aria-label$="full view"] { display: none; }
    .compose-backdrop { display: none; }
    .compose-window-body, .mode-expanded .compose-window-body { padding: 4px 16px calc(14px + env(safe-area-inset-bottom)); }
}

@media (max-width: 520px) {
    .pill-label { display: none; }
    .conversation-actions { gap: 6px; }
    .conversation-actions .pill { padding-inline: 12px; }
    .restore-banner { flex-wrap: wrap; }
    .restore-banner-text { flex-basis: calc(100% - 44px); }
    .restore-banner .pill { margin-left: 44px; }
    .header-actions .pill { padding: 0 12px; }
}

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