:root {
    --wm-sidebar-bg: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    --wm-sidebar-text: #9ca3af;
    --wm-sidebar-active: rgba(20, 184, 166, 0.15);
    --wm-accent: #14b8a6;
    --wm-accent-dark: #0d9488;
    --wm-bg: #eef1f6;
    --wm-panel: #ffffff;
    --wm-text: #111827;
    --wm-muted: #6b7280;
    --wm-line: #e5e7eb;
    --wm-shadow: 0 1px 3px rgba(17, 24, 39, 0.05), 0 6px 20px rgba(17, 24, 39, 0.05);
    --wm-radius: 14px;
    --wm-radius-sm: 10px;
    --gmail-font-family: "Google Sans", Roboto, RobotoDraft, Helvetica, Arial, sans-serif;
    --gmail-font-size: 14px;
    --gmail-line-height: 20px;
    --gmail-text: #202124;
    --gmail-muted: #5f6368;
    font-family: var(--gmail-font-family);
    font-size: var(--gmail-font-size);
    line-height: var(--gmail-line-height);
}

* { box-sizing: border-box; }

html:has(body.webmail-app:not(.webmail-auth)) {
    height: 100%;
    overflow: hidden;
}

body.webmail-app {
    margin: 0;
    background: var(--wm-bg);
    color: var(--wm-text);
}

/* Lock the shell to the viewport so the page itself never scrolls.
   Only intentional panes (folder list, mail list, reading pane) scroll. */
body.webmail-app:not(.webmail-auth) {
    height: 100%;
    overflow: hidden;
}

.wm-app {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
    position: relative;
    transition: grid-template-columns 0.18s ease;
}

.wm-app.is-sidebar-expanded {
    grid-template-columns: 232px minmax(0, 1fr);
}

@supports (height: 100dvh) {
    body.webmail-app:not(.webmail-auth) {
        height: 100dvh;
    }

    .wm-app {
        height: 100dvh;
        max-height: 100dvh;
    }
}

/* Sidebar — matches admin panel */
.wm-sidebar {
    background: var(--wm-sidebar-bg);
    color: #fff;
    color-scheme: dark;
    padding: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    min-height: 0;
    height: 100%;
    overflow: hidden;
    position: relative;
    z-index: 1;
    width: 100%;
    min-width: 0;
    max-width: none;
}

/* Desktop icon-rail (default) vs expanded labels */
.wm-sidebar-toggle {
    display: none;
}

@media (min-width: 901px) {
    .wm-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: #5f6368;
        cursor: pointer;
        margin-right: 2px;
    }

    .wm-sidebar-toggle:hover,
    .wm-sidebar-toggle:focus-visible {
        background: rgba(60, 64, 67, 0.08);
        outline: none;
    }

    .wm-app.is-sidebar-expanded .wm-sidebar-toggle svg {
        transform: scaleX(-1);
    }

    .wm-app:not(.is-sidebar-expanded) .wm-sidebar-logo-panel {
        padding: 10px 8px;
        display: flex;
        justify-content: center;
    }

    .wm-app:not(.is-sidebar-expanded) .wm-brand-logo {
        display: none;
    }

    .wm-app:not(.is-sidebar-expanded) .wm-brand-icon {
        display: inline-flex !important;
    }

    .wm-app:not(.is-sidebar-expanded) .wm-sidebar-body {
        padding: 10px 6px 12px;
        align-items: stretch;
    }

    .wm-app:not(.is-sidebar-expanded) .wm-compose-btn {
        width: 44px;
        height: 44px;
        margin: 0 auto 12px;
        padding: 0;
        border-radius: 50%;
        gap: 0;
    }

    .wm-app:not(.is-sidebar-expanded) .wm-compose-label,
    .wm-app:not(.is-sidebar-expanded) .wm-nav-heading,
    .wm-app:not(.is-sidebar-expanded) .wm-nav-empty,
    .wm-app:not(.is-sidebar-expanded) .wm-accounts-subgroup-label,
    .wm-app:not(.is-sidebar-expanded) .wm-folder-label,
    .wm-app:not(.is-sidebar-expanded) .wm-label-name,
    .wm-app:not(.is-sidebar-expanded) .wm-label-add,
    .wm-app:not(.is-sidebar-expanded) .wm-folder-badge,
    .wm-app:not(.is-sidebar-expanded) .wm-account-new-count {
        display: none !important;
    }

    .wm-app:not(.is-sidebar-expanded) .wm-folder-nav a,
    .wm-app:not(.is-sidebar-expanded) .wm-accounts-nav .wm-account-switch-item {
        justify-content: center;
        padding: 10px 0;
        gap: 0;
    }

    .wm-app:not(.is-sidebar-expanded) .wm-folder-icon {
        margin: 0;
    }

    .wm-app:not(.is-sidebar-expanded) .wm-nav-section {
        margin-bottom: 10px;
    }

    .wm-app:not(.is-sidebar-expanded) .wm-nav-heading-row {
        justify-content: center;
        min-height: 0;
        padding: 0;
    }
}

.wm-sidebar-logo-panel {
    padding: 8px 10px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.wm-sidebar-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 12px 10px 16px;
}

.wm-sidebar-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0 -4px;
    padding: 0 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}

.wm-sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}

.wm-sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.wm-sidebar-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    border-radius: 999px;
}

.wm-sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.38);
}

.wm-sidebar-scroll::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.wm-nav-section {
    margin-bottom: 18px;
}

.wm-nav-heading {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    font-weight: 700;
    padding: 0 12px 8px;
}

.wm-nav-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.wm-label-add {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease;
}

.wm-label-add:hover {
    background: rgba(20, 184, 166, 0.25);
    color: #fff;
}

.wm-nav-empty {
    padding: 8px 12px;
    color: #6b7280;
    font-size: 0.76rem;
    font-style: italic;
}

.wm-label-icon {
    color: #5eead4;
}

.wm-label-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wm-label-nav a {
    font-weight: 500;
}

.wm-brand {
    display: block;
    line-height: 0;
    text-decoration: none;
}

.wm-brand-logo,
.wm-brand-logo-auth {
    display: block;
    width: 100%;
    height: auto;
}

.wm-auth-logo-panel {
    margin-bottom: 20px;
    line-height: 0;
    text-align: center;
}

.wm-brand-icon {
    display: none; /* mobile drawer only */
    width: 36px;
    height: 36px;
    border-radius: 11px;
    place-items: center;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: #fff;
    flex-shrink: 0;
}

.wm-brand strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
}

.wm-brand span {
    color: #9ca3af;
    font-size: 0.72rem;
}

.wm-compose-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 4px 12px;
    padding: 11px 14px;
    border: 0;
    width: calc(100% - 16px);
    cursor: pointer;
    font-family: inherit;
    border-radius: 24px;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.86rem;
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.35);
    transition: transform .15s ease, box-shadow .15s ease;
}

.wm-compose-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(20, 184, 166, 0.4);
    color: #fff;
}

.wm-compose-btn.active {
    outline: 2px solid rgba(255, 255, 255, 0.25);
}

.wm-folder-nav {
    display: grid;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.wm-folder-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--wm-radius-sm);
    color: var(--wm-sidebar-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.86rem;
    transition: .15s ease;
}

.wm-folder-label {
    flex: 1;
    min-width: 0;
}

.wm-folder-badge {
    margin-left: auto;
    min-width: 1.5rem;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(147, 197, 253, 0.16);
    color: #bfdbfe;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

.wm-folder-badge[hidden] {
    display: none;
}

.wm-folder-nav a.active .wm-folder-badge {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.wm-folder-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #f3f4f6;
}

.wm-folder-nav a.active {
    background: var(--wm-sidebar-active);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--wm-accent);
}

.wm-folder-icon {
    width: 18px;
    text-align: center;
    font-size: 0.8rem;
}

/* Main area */
.wm-main {
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    background: var(--wm-panel);
    border-bottom: 1px solid var(--wm-line);
}

.wm-search {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 60%;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 46px;
    padding: 0 8px 0 8px;
    background: #eaf1fb;
    border-radius: 24px;
    border: 1px solid transparent;
    box-shadow: none;
}

.wm-search:focus-within {
    background: #fff;
    border-color: transparent;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}

.wm-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
}

.wm-search-icon:hover {
    background: rgba(60, 64, 67, 0.08);
    color: #202124;
}

.wm-search-icon svg {
    display: block;
}

.wm-search input[type="search"] {
    flex: 1;
    border: 0;
    background: transparent;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 400;
    outline: none;
    color: #202124;
    min-width: 0;
    padding: 10px 0;
}

.wm-search input[type="search"]::placeholder {
    color: #5f6368;
    opacity: 1;
    font-size: 16px;
    font-weight: 400;
}

.wm-search input[type="search"]::-webkit-search-decoration,
.wm-search input[type="search"]::-webkit-search-cancel-button,
.wm-search input[type="search"]::-webkit-search-results-button,
.wm-search input[type="search"]::-webkit-search-results-decoration {
    display: none;
}

.wm-search-filter-wrap {
    position: static;
    flex-shrink: 0;
}

.wm-search-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
}

.wm-search-filter-btn:hover,
.wm-search-filter-btn[aria-expanded="true"] {
    background: rgba(60, 64, 67, 0.08);
    color: #202124;
}

.wm-search-filter-btn.is-active {
    color: #0b57d0;
    background: rgba(11, 87, 208, 0.1);
}

.wm-search-filter-btn svg {
    display: block;
}

.wm-search-filter-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: auto;
    right: 0;
    z-index: 90;
    width: 75%;
    max-width: none;
    padding: 16px 18px 14px;
    background: #eef0f2;
    border: 1px solid #3c4043;
    border-radius: 16px;
    box-shadow: 0 10px 32px rgba(32, 33, 36, 0.18), 0 1px 3px rgba(60, 64, 67, 0.12);
    isolation: isolate;
}

.wm-search-filter-popup[hidden] {
    display: none !important;
}

.wm-search-filter-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #202124;
    margin-bottom: 14px;
}

.wm-search-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.wm-search-filter-row-3 {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px 16px;
    min-width: 0;
}

.wm-search-filter-field {
    display: grid;
    gap: 6px;
    margin-bottom: 0;
    font-size: 0.78rem;
    color: #5f6368;
    min-width: 0;
}

.wm-search-filter-field-span {
    grid-column: 1 / -1;
}

.wm-search-filter-attach .wm-search-filter-check-box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    background: #fff;
    color: #202124;
    font-size: 0.92rem;
    font-weight: 500;
    box-sizing: border-box;
    cursor: pointer;
}

.wm-search-filter-attach .wm-search-filter-check-box input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #0d9488;
    cursor: pointer;
    flex-shrink: 0;
}

.wm-search-filter-field input[type="date"],
.wm-search-filter-field .wm-date-input,
.wm-search-filter-field .wm-filter-text-input,
.wm-search-filter-field .wm-filter-select {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    background: #fff;
    color: #202124;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
}

.wm-search-filter-field .wm-filter-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235f6368' d='M1.4 0.6L6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.wm-search-filter-field .wm-filter-to-select {
    width: 100%;
    max-width: none;
}

.wm-search-filter-field .wm-filter-to-select .gmail-from-select-trigger {
    width: 100%;
    justify-content: space-between;
    min-height: 40px;
    padding: 8px 10px 8px 12px;
    border-radius: 10px;
    border: 1px solid #dadce0;
    background: #fff;
}

.wm-search-filter-field .wm-filter-to-select .gmail-from-select-trigger:hover,
.wm-search-filter-field .wm-filter-to-select .gmail-from-select-trigger[aria-expanded="true"] {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.wm-search-filter-field .wm-filter-to-select .gmail-from-select-current {
    flex: 1;
    min-width: 0;
}

.wm-search-filter-field .wm-filter-to-select .gmail-from-select-name {
    max-width: 9rem;
}

.wm-search-filter-field .wm-filter-to-select .gmail-from-select-menu {
    left: 0;
    right: 0;
    min-width: 100%;
    max-width: none;
    z-index: 80;
}

.gmail-from-select-badge[hidden] {
    display: none !important;
}

.wm-search-filter-field .wm-date-input:focus,
.wm-search-filter-field .wm-filter-text-input:focus,
.wm-search-filter-field .wm-filter-select:focus,
.wm-search-filter-field .flatpickr-alt-input:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* Flatpickr hides the original input; style the visible alt field */
.wm-search-filter-field input.flatpickr-input[type="hidden"],
.wm-search-filter-field input.flatpickr-input:not(.flatpickr-alt-input) {
    display: none !important;
}

.wm-search-filter-field .flatpickr-alt-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #dadce0;
    border-radius: 10px;
    background: #fff;
    color: #202124;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
}

.wm-search-filter-field .wm-date-input::placeholder {
    color: #9aa0a6;
    letter-spacing: 0.04em;
}

/* Flatpickr — teal theme matching webmail */
.flatpickr-calendar {
    border-radius: 14px !important;
    border: 1px solid #e8eaed !important;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.16) !important;
    font-family: inherit;
    width: 308px !important;
}

.flatpickr-months {
    padding-top: 6px;
}

.flatpickr-months .flatpickr-month {
    color: #202124;
    fill: #202124;
}

.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    font-weight: 600;
    color: #202124;
}

.flatpickr-weekdays {
    background: transparent;
}

span.flatpickr-weekday {
    color: #5f6368;
    font-weight: 600;
}

.flatpickr-day {
    border-radius: 999px;
    color: #202124;
}

.flatpickr-day:hover,
.flatpickr-day:focus {
    background: #ccfbf1;
    border-color: #ccfbf1;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
    background: #0d9488 !important;
    border-color: #0d9488 !important;
    color: #fff !important;
}

.flatpickr-day.today {
    border-color: #0d9488;
}

.flatpickr-day.today:hover,
.flatpickr-day.today:focus {
    background: #ccfbf1;
    border-color: #0d9488;
    color: #0f766e;
}

.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
    fill: #0d9488;
}

.flatpickr-calendar.open {
    z-index: 120 !important;
}

.wm-search-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 0;
}

.wm-search-filter-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 14px;
    padding-top: 4px;
}

.wm-search-filter-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 0.88rem;
    font-weight: 500;
    color: #202124;
    cursor: pointer;
    user-select: none;
}

.wm-search-filter-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #0d9488;
    cursor: pointer;
}

@media (max-width: 720px) {
    .wm-search-filter-grid,
    .wm-search-filter-row-3 {
        grid-template-columns: 1fr;
    }

    .wm-search-filter-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .wm-search-filter-actions {
        justify-content: flex-end;
    }
}

.wm-search-filter-clear,
.wm-search-filter-apply {
    border: 0;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.wm-search-filter-clear {
    background: transparent;
    color: var(--wm-muted);
}

.wm-search-filter-clear:hover {
    color: var(--wm-text);
    background: rgba(15, 23, 42, 0.05);
}

.wm-search-filter-apply {
    background: var(--wm-accent, #0d9488);
    color: #fff;
}

.wm-search-filter-apply:hover {
    filter: brightness(0.96);
}

.wm-topbar-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}


.wm-new-mail-toast {
    position: relative;
    display: none;
    flex-direction: column;
    align-items: stretch;
    max-width: min(360px, 52vw);
}

.wm-new-mail-toast.is-visible {
    display: inline-flex;
}

.wm-new-mail-toast-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 4px;
    border-radius: 999px;
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.wm-new-mail-toast-main {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    text-align: left;
}

.wm-new-mail-toast-main:hover {
    background: rgba(255, 255, 255, 0.08);
}

.wm-new-mail-toast-text {
    white-space: nowrap;
}

.wm-new-mail-toast-close {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    margin-right: 4px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.wm-new-mail-toast-close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.wm-new-mail-toast-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 90;
    min-width: 260px;
    max-width: min(360px, 90vw);
    padding: 8px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.wm-new-mail-toast-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;
}

.wm-new-mail-toast-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 10px;
    padding: 9px 10px;
    cursor: pointer;
    font: inherit;
    color: #0f172a;
    text-align: left;
}

.wm-new-mail-toast-item:hover {
    background: #f1f5f9;
}

.wm-new-mail-toast-item-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.82rem;
    font-weight: 600;
}

.wm-new-mail-toast-item-count {
    flex-shrink: 0;
    min-width: 1.6rem;
    padding: 2px 7px;
    border-radius: 999px;
    background: #0f172a;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
}

.wm-new-mail-toast.is-ping .wm-new-mail-toast-bar {
    animation: wm-new-mail-chip-pop 0.55s ease;
}

@keyframes wm-new-mail-chip-pop {
    0% { opacity: 0; transform: scale(0.82); }
    55% { opacity: 1; transform: scale(1.06); }
    100% { opacity: 1; transform: scale(1); }
}

.wm-topbar-signout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.78rem;
    box-shadow: 0 2px 10px rgba(244, 63, 94, 0.28);
    transition: transform .15s ease, box-shadow .15s ease;
    white-space: nowrap;
}

.wm-topbar-signout:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.38);
    color: #fff;
}

.wm-pill {
    padding: 5px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #0f766e;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.wm-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    background: #f9fafb;
    border: 1px solid var(--wm-line);
}

.wm-account-menu-wrap {
    position: relative;
}



.wm-account-toggle {
    border: 1px solid var(--wm-line);
    background: #f9fafb;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.wm-account-toggle:hover,
.wm-account-toggle[aria-expanded="true"] {
    background: #fff;
    border-color: #99f6e4;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.wm-account-caret {
    display: inline-flex;
    align-items: center;
    color: var(--wm-muted);
    margin-right: 2px;
}

.wm-account-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    padding: 6px 0;
    background: #fff;
    border: 1px solid var(--wm-line);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    z-index: 1200;
}

.wm-account-menu[hidden] {
    display: none;
}

.wm-account-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 0.84rem;
    color: var(--wm-text);
    text-decoration: none;
    cursor: pointer;
}

.wm-account-menu-item:hover,
.wm-account-menu-item:focus-visible {
    background: rgba(20, 184, 166, 0.08);
    outline: none;
}

.wm-account-menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--wm-muted);
    flex-shrink: 0;
}

.wm-account-menu-icon svg {
    width: 18px;
    height: 18px;
}

.wm-account-menu-divider {
    height: 1px;
    margin: 6px 0;
    background: var(--wm-line);
}

.wm-account-menu-signout {
    color: #be123c;
}

.wm-account-menu-signout .wm-account-menu-icon {
    color: #e11d48;
}

.wm-password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.wm-password-field input {
    width: 100%;
    padding: 10px 42px 10px 12px;
    border: 1px solid var(--wm-line);
    border-radius: 10px;
    font: inherit;
    font-size: 0.9rem;
}

.wm-password-field input:focus {
    outline: none;
    border-color: #99f6e4;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.wm-password-toggle {
    position: absolute;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--wm-muted);
    cursor: pointer;
}

.wm-password-toggle:hover {
    background: #f3f4f6;
    color: var(--wm-text);
}

.wm-password-toggle svg {
    width: 18px;
    height: 18px;
}

.wm-password-toggle .wm-password-eye-hide {
    display: none;
}

.wm-password-toggle.is-visible .wm-password-eye-show {
    display: none;
}

.wm-password-toggle.is-visible .wm-password-eye-hide {
    display: block;
}

.wm-form-error {
    margin: 4px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.82rem;
}

.wm-form-error[hidden] {
    display: none;
}

.wm-placeholder-note {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f0fdfa;
    color: #0f766e;
    font-size: 0.82rem;
}

.wm-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: #fff;
    font-weight: 800;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.wm-avatar-lg {
    width: 42px;
    height: 42px;
    font-size: 1rem;
}

.wm-user-text strong {
    display: block;
    font-size: 0.78rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wm-user-text span {
    display: block;
    color: var(--wm-muted);
    font-size: 0.68rem;
}

.wm-content {
    flex: 1;
    min-height: 0;
    padding: 16px 20px 24px;
    overflow: auto;
    overscroll-behavior: contain;
    transition: opacity 0.12s ease;
}

.wm-content.wm-content-loading {
    opacity: 0.72;
    pointer-events: none;
}

.wm-flash {
    padding: 10px 12px;
    border-radius: var(--wm-radius-sm);
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 0.82rem;
}

.wm-flash-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.wm-flash-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.wm-toast {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.wm-toast.is-visible {
    opacity: 1;
}

.wm-toast-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(32, 33, 36, 0.16);
    backdrop-filter: blur(3px);
}

.wm-toast-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: 220px;
    max-width: min(92vw, 320px);
    padding: 28px 32px 24px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid rgba(232, 234, 237, 0.9);
    box-shadow:
        0 24px 64px rgba(60, 64, 67, 0.18),
        0 8px 24px rgba(60, 64, 67, 0.1);
    transform: scale(0.9) translateY(10px);
    transition: transform 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.wm-toast.is-visible .wm-toast-card {
    transform: scale(1) translateY(0);
}

.wm-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(145deg, #e6f4ea 0%, #ceead6 100%);
    color: #137333;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.wm-toast-icon svg {
    width: 28px;
    height: 28px;
}

.wm-toast-message {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.35;
    color: #202124;
    text-align: center;
    letter-spacing: -0.01em;
}

/* Panel card */
.wm-panel {
    background: var(--wm-panel);
    border: 1px solid var(--wm-line);
    border-radius: var(--wm-radius);
    box-shadow: var(--wm-shadow);
    overflow: hidden;
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.wm-panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--wm-line);
    background: #fafbfc;
    flex-shrink: 0;
}

.wm-toolbar-left,
.wm-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wm-toolbar-title {
    font-weight: 800;
    font-size: 0.92rem;
}

.wm-toolbar-title-truncate {
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wm-toolbar-count,
.wm-page-label {
    color: var(--wm-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.wm-check {
    width: 16px;
    height: 16px;
    accent-color: var(--wm-accent);
}

.wm-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    background: transparent;
    color: var(--wm-muted);
    text-decoration: none;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background .15s ease;
}

.wm-icon-btn:hover {
    background: #f3f4f6;
    color: var(--wm-text);
}

/* Gmail-style mail list */
.wm-mail-list {
    flex: 1;
    overflow-y: auto;
}

.wm-mail-row {
    display: grid;
    grid-template-columns: 36px minmax(120px, 200px) 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: var(--wm-text);
    transition: box-shadow .12s ease, background .12s ease;
}

.wm-mail-row:hover {
    background: #f9fafb;
    box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px rgba(60, 64, 67, 0.1);
    z-index: 1;
    position: relative;
}

.wm-mail-row.unread .wm-mail-from,
.wm-mail-row.unread .wm-mail-subject strong {
    font-weight: 800;
    color: #111827;
}

.wm-mail-row.unread {
    background: rgba(20, 184, 166, 0.04);
}

.wm-mail-from {
    font-size: 0.84rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--wm-text);
}

.wm-mail-subject {
    font-size: 0.84rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--wm-muted);
}

.wm-mail-subject strong {
    color: var(--wm-text);
    font-weight: 600;
}

.wm-mail-date {
    font-size: 0.74rem;
    color: var(--wm-muted);
    white-space: nowrap;
    font-weight: 600;
}

.wm-empty {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 64px 24px;
    color: var(--wm-muted);
}

.wm-empty-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #f0fdfa;
    color: #0d9488;
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.wm-empty strong {
    display: block;
    color: var(--wm-text);
    font-size: 1rem;
    margin-bottom: 4px;
}

.wm-empty p { margin: 0; font-size: 0.84rem; }

/* Message view */
.wm-message-view {
    padding: 20px 24px 32px;
    overflow-y: auto;
    flex: 1;
}

.wm-message-header h1 {
    margin: 0 0 16px;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.3;
}

.wm-message-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--wm-line);
    margin-bottom: 20px;
}

.wm-message-sender {
    display: flex;
    gap: 12px;
    align-items: center;
}

.wm-message-sender strong {
    display: block;
    font-size: 0.9rem;
}

.wm-message-sender span {
    display: block;
    color: var(--wm-muted);
    font-size: 0.78rem;
    margin-top: 2px;
}

.wm-message-meta time {
    color: var(--wm-muted);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.wm-message-body {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #374151;
    word-break: break-word;
}

.wm-message-body img { max-width: 100%; height: auto; }

/* Compose */
.wm-compose-form {
    padding: 8px 0 0;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.wm-compose-field {
    display: grid;
    grid-template-columns: 72px 1fr;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.wm-compose-body-field {
    align-items: start;
    flex: 1;
    display: grid;
    grid-template-columns: 72px 1fr;
}

.wm-compose-field label {
    margin: 0;
    color: var(--wm-muted);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wm-compose-field input,
.wm-compose-field textarea {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 8px 0;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--wm-text);
    outline: none;
}

.wm-compose-field textarea {
    min-height: 280px;
    resize: vertical;
    line-height: 1.6;
}

.wm-compose-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--wm-line);
    background: #fafbfc;
}

/* Buttons */
.wm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--wm-radius-sm);
    border: 0;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}

.wm-btn-primary {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: #fff;
}

.wm-btn-secondary {
    background: #fff;
    color: var(--wm-text);
    border: 1px solid var(--wm-line);
}

.wm-btn-danger {
    background: #ef4444;
    color: #fff;
}

.wm-btn-block { width: 100%; }

.wm-inline-form { display: inline; margin: 0; }

/* Auth login */
body.webmail-auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(160deg, #0f172a 0%, #134e4a 100%);
    padding: 24px;
}

.wm-auth-wrap {
    width: min(400px, 100%);
}

.wm-auth-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 28px;
    color: #fff;
    backdrop-filter: blur(8px);
}

.wm-auth-brand {
    display: block;
    margin-bottom: 20px;
    text-align: center;
    line-height: 0;
}

.wm-auth-brand strong {
    display: block;
    font-size: 0.95rem;
}

.wm-auth-brand span {
    color: #cbd5e1;
    font-size: 0.75rem;
}

.wm-auth-card h1 {
    margin: 0 0 6px;
    text-align: center;
    font-size: 1.3rem;
}

.wm-auth-card > p {
    text-align: center;
    color: #cbd5e1;
    font-size: 0.86rem;
    margin: 0 0 20px;
}

.wm-auth-card label {
    display: block;
    margin: 12px 0 5px;
    color: #cbd5e1;
    font-size: 0.76rem;
    font-weight: 600;
}

.wm-auth-card input {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--wm-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    font-size: 0.9rem;
}

.wm-auth-card input:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.2);
}

.wm-auth-card .wm-btn {
    margin-top: 20px;
}

.wm-auth-flash {
    margin: 0 0 16px;
    text-align: left;
}

.wm-auth-footer {
    text-align: center;
    margin: 20px 0 0;
    font-size: 0.84rem;
}

.wm-auth-footer a {
    color: #99f6e4;
    text-decoration: none;
}

.wm-auth-footer a:hover { text-decoration: underline; }

.wm-auth-switch {
    text-align: center;
    margin: 16px 0 0;
    font-size: 0.84rem;
}

.wm-auth-switch a {
    color: #99f6e4;
    text-decoration: none;
}

.wm-auth-switch a:hover { text-decoration: underline; }

/* Create label modal */
body.wm-modal-open { overflow: hidden; }

.wm-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    padding: 20px;
}

.wm-modal[hidden] { display: none; }

.wm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    backdrop-filter: blur(2px);
}

.wm-modal-panel {
    position: relative;
    width: min(420px, 100%);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(17, 24, 39, 0.2);
    border: 1px solid var(--wm-line);
    overflow: hidden;
}

.wm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--wm-line);
}

.wm-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.wm-modal-close {
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--wm-muted);
    cursor: pointer;
}

.wm-modal-body {
    padding: 16px 18px;
    display: grid;
    gap: 8px;
}

.wm-modal-body label {
    margin: 0;
    color: var(--wm-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.wm-modal-body input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--wm-line);
    border-radius: var(--wm-radius-sm);
    font-size: 0.9rem;
}

.wm-compose-link-panel {
    width: min(440px, 100%);
}

.wm-compose-link-form .wm-modal-body {
    gap: 8px;
}

.wm-compose-link-form .wm-modal-body input:focus {
    outline: none;
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15);
}

.wm-compose-link-popover {
    position: fixed;
    z-index: 10050;
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: min(480px, calc(100vw - 16px));
    padding: 6px 8px 6px 12px;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
}

.wm-compose-link-popover[hidden] {
    display: none !important;
}

.wm-compose-link-popover-url {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: #5f6368;
}

.wm-compose-link-popover-edit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
}

.wm-compose-link-popover-edit:hover {
    background: #f1f3f4;
    color: #202124;
}

.wm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid var(--wm-line);
    background: #fafbfc;
}

.wm-confirm-modal .wm-confirm-panel {
    width: min(440px, 100%);
    padding-top: 8px;
    text-align: center;
}

.wm-confirm-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 18px auto 0;
    border-radius: 50%;
    background: #fef2f2;
    color: #dc2626;
}

.wm-confirm-icon svg {
    width: 28px;
    height: 28px;
}

.wm-confirm-content {
    padding: 16px 24px 8px;
}

.wm-confirm-content h3 {
    margin: 0 0 8px;
    font-size: 1.125rem;
    font-weight: 700;
    color: #202124;
}

.wm-confirm-content p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #5f6368;
}

.wm-confirm-footer {
    justify-content: center;
    padding: 16px 24px 20px;
    border-top: 0;
    background: transparent;
}

.wm-notice-modal .wm-notice-panel {
    width: min(420px, 100%);
    border-radius: 24px;
    overflow: hidden;
    box-shadow:
        0 28px 80px rgba(15, 23, 42, 0.18),
        0 8px 24px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.9);
    animation: wm-notice-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes wm-notice-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wm-notice-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 22px auto 0;
    border-radius: 20px;
    background: linear-gradient(160deg, #eef2ff 0%, #e0e7ff 100%);
    color: #4338ca;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.wm-notice-icon svg {
    width: 30px;
    height: 30px;
}

.wm-notice-modal[data-variant="error"] .wm-notice-icon,
.wm-notice-modal[data-variant="blocked"] .wm-notice-icon {
    background: linear-gradient(160deg, #fff1f2 0%, #ffe4e6 100%);
    color: #e11d48;
}

.wm-notice-modal[data-variant="success"] .wm-notice-icon {
    background: linear-gradient(160deg, #ecfdf5 0%, #d1fae5 100%);
    color: #059669;
}

.wm-notice-modal .wm-confirm-content h3 {
    letter-spacing: -0.02em;
}

.wm-notice-modal .wm-confirm-content p {
    font-size: 0.92rem;
    line-height: 1.55;
    color: #475569;
}

.wm-notice-footer {
    padding-bottom: 22px;
}

.wm-notice-footer .wm-btn {
    min-width: 118px;
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 600;
}


.wm-keep-unread-modal .wm-confirm-panel {
    width: min(460px, calc(100% - 32px));
    border: 1px solid rgba(26, 115, 232, 0.12);
    box-shadow:
        0 24px 48px rgba(32, 33, 36, 0.18),
        0 8px 16px rgba(26, 115, 232, 0.08);
    animation: wm-keep-unread-in 0.22s ease-out;
}

.wm-keep-unread-modal .wm-modal-backdrop {
    backdrop-filter: blur(4px);
    background: rgba(32, 33, 36, 0.38);
}

.wm-keep-unread-icon {
    background: linear-gradient(180deg, #e8f0fe 0%, #d2e3fc 100%);
    color: #14b8a6;
    box-shadow: inset 0 0 0 1px rgba(26, 115, 232, 0.12);
}

.wm-keep-unread-footer {
    gap: 10px;
}

.wm-keep-unread-footer .wm-btn {
    min-width: 112px;
    border-radius: 999px;
    font-weight: 600;
}

.wm-btn-primary {
    background: #14b8a6;
    border: 1px solid #14b8a6;
    color: #fff;
}

.wm-btn-primary:hover {
    background: #1765cc;
    border-color: #1765cc;
}

@keyframes wm-keep-unread-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Delete progress modal */
.wm-progress-modal .wm-confirm-panel {
    padding-bottom: 24px;
}

.wm-progress-icon {
    position: relative;
}

.wm-progress-spinner {
    position: absolute;
    inset: -4px;
    border: 2px solid #fecaca;
    border-top-color: #dc2626;
    border-radius: 50%;
    animation: wm-progress-spin 0.8s linear infinite;
}

.wm-progress-icon.is-complete .wm-progress-spinner {
    display: none;
}

.wm-progress-icon.is-complete {
    background: #ecfdf5;
    color: #059669;
}

.wm-progress-trash-icon,
.wm-progress-done-icon {
    width: 28px;
    height: 28px;
}

.wm-progress-icon.is-complete .wm-progress-trash-icon {
    display: none;
}

.wm-progress-icon.is-complete .wm-progress-done-icon {
    display: block !important;
}

.wm-progress-track {
    height: 4px;
    margin-top: 18px;
    background: #e8eaed;
    border-radius: 999px;
    overflow: hidden;
}

.wm-progress-bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
    border-radius: 999px;
    transition: width 0.25s ease;
}

.wm-progress-modal.is-complete .wm-progress-bar {
    background: linear-gradient(90deg, #34d399 0%, #059669 100%);
}

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

.wm-confirm-footer .wm-btn {
    min-width: 120px;
    padding: 10px 18px;
    border-radius: 999px;
}

.wm-btn-danger:hover {
    background: #dc2626;
}

.wm-btn-danger:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Gmail-style inbox */
.wm-content-inbox {
    padding: 0;
    overflow: hidden;
    overscroll-behavior: none;
    display: flex;
    flex-direction: column;
    position: relative;
    flex: 1;
    min-height: 0;
}

.wm-content-inbox > .gmail-open {
    position: static;
    min-height: 0;
    height: 100%;
    flex: 1;
}

.gmail-inbox {
    --gi-pad-l: 16px;
    --gi-pad-r: 16px;
    --gi-check: 36px;
    --gi-star: 32px;
    --gi-sender: 228px;
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    min-height: 0;
    border-radius: 16px 0 0 0;
    overflow: hidden;
}

/* Split-pane inbox + reading view */
.gmail-split-layout {
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
    background: #fff;
    border-radius: 16px 0 0 0;
}

.gmail-split-list {
    width: 600px;
    min-width: 420px;
    max-width: 48%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e8eaed;
    overflow: hidden;
}

.gmail-split-list .gmail-inbox {
    min-height: 0;
    border-radius: 0;
    --gi-pad-l: 8px;
    --gi-pad-r: 12px;
    --gi-check: 22px;
    --gi-star: 22px;
}

.gmail-split-list .gmail-snippet {
    display: none;
}

.gmail-split-list .gmail-toolbar {
    grid-template-columns: var(--gi-check) var(--gi-star) minmax(0, 1fr) 18px auto;
}

.gmail-split-list .gmail-row {
    grid-template-columns: var(--gi-check) var(--gi-star) minmax(0, 1fr) 18px auto;
    grid-template-rows: auto auto;
    row-gap: 1px;
    align-items: start;
    min-height: 52px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.gmail-split-list .gmail-col-check {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
    justify-content: flex-start;
    margin-left: -2px;
}

.gmail-split-list .gmail-col-star {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    justify-content: flex-start;
    margin-left: -6px;
}

.gmail-split-list .gmail-check-label {
    width: 24px;
    height: 24px;
}

.gmail-split-list .gmail-star {
    width: 28px;
    height: 28px;
}

.gmail-split-list .gmail-col-sender {
    grid-column: 3;
    grid-row: 1;
    gap: 8px;
    padding-left: 2px;
}

.gmail-split-list .gmail-col-attach {
    grid-column: 4;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    display: flex;
    color: #5f6368;
}

.gmail-split-list .gmail-col-date {
    grid-column: 5;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    padding-left: 12px;
    color: var(--gmail-muted);
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
}

.gmail-split-list .gmail-col-line {
    grid-column: 3 / 6;
    grid-row: 2;
    color: var(--gmail-muted);
}

.gmail-split-list .gmail-subject {
    font-weight: 400;
}

.gmail-split-reading {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
    position: relative;
}

.gmail-split-reading > .gmail-open {
    position: static;
    min-height: 0;
    height: 100%;
    border-radius: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gmail-split-reading.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.55);
    pointer-events: none;
}

.gmail-split-reading .gmail-open-scroll {
    min-height: 0;
}

.gmail-reading-empty {
    flex: 1;
    display: grid;
    place-items: center;
    color: #5f6368;
    font-size: var(--gmail-font-size);
    line-height: var(--gmail-line-height);
}

.gmail-row.is-active {
    background: #c2dbff;
}

.gmail-row.is-active.is-selected {
    background: #c2dbff;
}

.gmail-row.is-active.unread .gmail-sender-name,
.gmail-row.is-active.unread .gmail-subject {
    font-weight: 700;
}

.gmail-toolbar,
.gmail-row {
    display: grid;
    align-items: center;
    column-gap: 8px;
    padding-left: var(--gi-pad-l);
    padding-right: var(--gi-pad-r);
}

.gmail-toolbar {
    grid-template-columns: var(--gi-check) var(--gi-star) var(--gi-sender) 1fr auto;
    padding-top: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e8eaed;
    min-height: 48px;
    flex-shrink: 0;
}

.gmail-row {
    grid-template-columns: var(--gi-check) var(--gi-star) var(--gi-sender) minmax(0, 1fr) 28px 72px;
    min-height: 40px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    color: var(--gmail-text);
    font-size: var(--gmail-font-size);
    line-height: var(--gmail-line-height);
    transition: box-shadow .1s ease, background .1s ease;
}

.gmail-col-actions {
    display: flex;
    align-items: center;
    min-width: 0;
}

.gmail-actions-idle,
.gmail-bulk-form {
    display: flex;
    align-items: center;
    gap: 2px;
}

.gmail-actions-idle[hidden],
.gmail-actions-bulk[hidden],
.gmail-more-menu[hidden] {
    display: none !important;
}

.gmail-actions-bulk {
    display: flex;
    align-items: center;
}

.gmail-more-wrap {
    position: relative;
}

.gmail-more-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    min-width: 160px;
    padding: 6px 0;
    background: #fff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(60, 64, 67, 0.18);
}

.gmail-more-item {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 10px 16px;
    font: inherit;
    font-size: 0.84rem;
    color: #202124;
    cursor: pointer;
}

.gmail-more-item:hover {
    background: #f1f3f4;
}

.gmail-toolbar-divider {
    width: 1px;
    height: 24px;
    background: #dadce0;
    margin: 0 6px;
}

.gmail-col-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
}

.gmail-pagination {
    gap: 0;
}

.gmail-pagination .gmail-range {
    margin-right: 4px;
}

.gmail-pagination .gmail-icon-btn {
    width: 28px;
    height: 28px;
}

.gmail-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
    transition: background .12s ease, color .12s ease;
}

.gmail-read-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.gmail-read-toggle-icon[hidden] {
    display: none;
}

.gmail-icon-btn:hover:not(.disabled):not(:disabled) {
    background: #f1f3f4;
    color: #000;
}

.gmail-icon-btn.disabled,
.gmail-icon-btn:disabled {
    opacity: 0.38;
    cursor: default;
    pointer-events: none;
}

.gmail-icon-btn svg {
    display: block;
    width: 18px;
    height: 18px;
}

.gmail-icon-btn svg [stroke]:not([stroke="none"]),
.gmail-compose-tool-btn svg [stroke]:not([stroke="none"]),
.gmail-compose-header-btn svg [stroke]:not([stroke="none"]),
.gmail-compose-fmt-btn svg [stroke]:not([stroke="none"]),
.gmail-open-reply-btn svg [stroke]:not([stroke="none"]),
.gmail-attach svg [stroke]:not([stroke="none"]) {
    stroke-width: 2;
}

.gmail-col-star .gmail-star svg [stroke]:not([stroke="none"]) {
    stroke-width: 1.5;
}

.gmail-range {
    color: #5f6368;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    margin-right: 8px;
    user-select: none;
}

.gmail-search-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    padding: 10px var(--gi-pad-r) 10px var(--gi-pad-l);
    background: #f8fafc;
    border-bottom: 1px solid #e8eaed;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #5f6368;
}

.gmail-search-banner a {
    margin-left: 0;
    color: #0d9488;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}

.gmail-date-filter-summary {
    margin-left: 0;
    color: #80868b;
}

.gmail-mailbox-error {
    background: #fef7f7;
    color: #b3261e;
}

.gmail-mail-list {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    background: #fff;
}

/* Gmail classic list: flat white rows, hairline separators (no zebra). */
.gmail-mail-list > .gmail-row {
    background: #fff;
}

.gmail-row:hover {
    box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    z-index: 1;
    position: relative;
    background: #f2f6fc;
}

.gmail-row .gmail-col-sender,
.gmail-row .gmail-sender-name,
.gmail-row .gmail-subject {
    font-weight: 400;
    color: var(--gmail-text);
    font-size: var(--gmail-font-size);
    line-height: var(--gmail-line-height);
}

.gmail-row .gmail-col-date {
    font-weight: 400;
    font-size: 0.8125rem;
    line-height: var(--gmail-line-height);
    color: #5f6368;
}

.gmail-row.unread .gmail-col-sender,
.gmail-row.unread .gmail-sender-name,
.gmail-row.unread .gmail-subject {
    font-weight: 700;
    color: #202124;
}

.gmail-row.unread .gmail-thread-count {
    font-weight: 400;
    color: var(--gmail-muted);
}

.gmail-row.unread .gmail-col-date {
    font-weight: 700;
    color: #202124;
}

.gmail-row.unread {
    background: #fff;
}

.gmail-row.is-selected,
.gmail-row.unread.is-selected {
    background: #c2dbff;
}

.gmail-row.is-selected:hover {
    background: #c2dbff;
    box-shadow: inset 1px 0 0 #aecbfa, inset -1px 0 0 #aecbfa, 0 1px 2px rgba(60, 64, 67, 0.15);
}

/* Full-width list (Gmail 1): sender names only, no avatars. */
.wm-content-inbox > .gmail-inbox .gmail-sender-avatar {
    display: none;
}

.wm-content-inbox > .gmail-inbox {
    --gi-sender: 196px;
}

.wm-content-inbox > .gmail-inbox .gmail-col-sender {
    gap: 0;
}

.gmail-snippet {
    color: #5f6368;
    font-weight: 400;
}

.gmail-col-check {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gmail-check-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0;
    cursor: pointer;
}

.gmail-check-input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: #14b8a6;
    cursor: pointer;
}

.gmail-col-star {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: -4px;
}

.gmail-star {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #dadce0;
    cursor: pointer;
    padding: 0;
    transition: color .12s ease, background .12s ease;
}

.gmail-row:hover .gmail-star:not(.starred) {
    color: #5f6368;
}

.gmail-star:hover {
    background: rgba(95, 99, 104, 0.08);
    color: #f4b400;
}

.gmail-star.starred {
    color: #f4b400;
}

.gmail-star.starred:hover {
    color: #f4b400;
}

.gmail-col-star .gmail-star svg,
.gmail-col-star .gmail-star-icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

.gmail-star-icon[hidden] {
    display: none;
}

.gmail-col-sender {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: var(--gmail-font-size);
    line-height: var(--gmail-line-height);
    overflow: hidden;
    color: var(--gmail-text);
}

.gmail-sender-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.gmail-sender-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
}

.gmail-thread-count {
    color: var(--gmail-muted);
    font-size: 12px;
    font-weight: 400;
    margin-left: 0;
    flex-shrink: 0;
}

.gmail-row-updated {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
    color: var(--gmail-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
}

.gmail-row-updated-sep {
    width: 1px;
    height: 14px;
    background: #dadce0;
    flex-shrink: 0;
}

.gmail-row-updated-time {
    white-space: nowrap;
}

.gmail-row.unread .gmail-row-updated {
    color: var(--gmail-muted);
    font-weight: 400;
}

.gmail-row.unread .gmail-row-updated-time {
    font-weight: 500;
    color: var(--gmail-text);
}

.gmail-sender-avatar {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--avatar-bg, #5f6368);
    flex-shrink: 0;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.gmail-sender-avatar-lg {
    width: 42px;
    height: 42px;
}

.gmail-sender-avatar-lg .gmail-sender-initial {
    font-size: 1rem;
}

.gmail-sender-photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #fff;
    opacity: 0;
    transition: opacity .15s ease;
}

.gmail-sender-photo.is-loaded {
    opacity: 1;
}

.gmail-sender-avatar:has(.gmail-sender-photo.is-loaded) .gmail-sender-initial {
    opacity: 0;
}

.gmail-sender-initial {
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    user-select: none;
    transition: opacity .15s ease;
    z-index: 1;
}

.wm-message-from-full {
    display: block;
    color: #5f6368;
    font-size: 0.78rem;
    font-weight: 500;
}

.gmail-col-line {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--gmail-font-size);
    line-height: var(--gmail-line-height);
    min-width: 0;
}

.gmail-subject {
    color: var(--gmail-text);
}

.gmail-snippet {
    color: var(--gmail-muted);
    font-weight: 400;
    font-size: var(--gmail-font-size);
    line-height: var(--gmail-line-height);
}

.gmail-col-attach {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
}

.gmail-col-date {
    text-align: right;
    font-size: var(--gmail-font-size);
    line-height: var(--gmail-line-height);
    font-weight: 400;
    color: var(--gmail-text);
    white-space: nowrap;
}

.gmail-col-date time {
    font-size: inherit;
}

.gmail-inbox-date {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    line-height: 1.25;
}

.gmail-inbox-date-primary {
    font-weight: 500;
    color: inherit;
}

.gmail-inbox-date-year {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #3c4043;
}

.gmail-row.unread .gmail-inbox-date-year {
    color: #202124;
}

.gmail-inbox-date:not(.gmail-inbox-date-split) .gmail-inbox-date-year {
    display: none;
}

.gmail-inbox-date:not(.gmail-inbox-date-split) .gmail-inbox-date-primary {
    font-weight: inherit;
}

.gmail-empty {
    display: grid;
    place-items: center;
    text-align: center;
    padding: 72px 24px;
    color: #5f6368;
}

.gmail-empty strong {
    display: block;
    color: #202124;
    font-size: 1rem;
    margin-bottom: 4px;
}

.gmail-message-shell .wm-message-view {
    padding: 20px 24px 40px;
}

/* Gmail open message view */
.gmail-open {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    min-height: 0;
    border-radius: 16px 0 0 0;
    overflow: hidden;
}

.gmail-open-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    border-bottom: 1px solid #e8eaed;
    min-height: 48px;
    flex-shrink: 0;
}

.gmail-open-toolbar-main {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
    min-width: 0;
}

.gmail-open-action-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

.gmail-open-toolbar-meta {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.gmail-open-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-anchor: none;
    overscroll-behavior: contain;
    padding: 16px 24px 24px;
}

.gmail-open-scroll-actions {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px 24px 14px;
    border-top: 1px solid #e8eaed;
    background: #fff;
}

.gmail-scroll-jump {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #c4c7c5;
    border-radius: 50%;
    background: #fff;
    color: #3c4043;
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.28);
    cursor: pointer;
    transition: background .12s ease, box-shadow .12s ease, color .12s ease;
}

.gmail-scroll-jump.is-hidden {
    display: none !important;
}

.gmail-scroll-jump:hover {
    background: #f6f8fc;
    color: #202124;
    box-shadow: 0 2px 6px rgba(60, 64, 67, 0.22);
}

.gmail-scroll-jump-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.gmail-scroll-jump-icon[hidden] {
    display: none !important;
}

.gmail-scroll-jump-icon svg {
    width: 22px;
    height: 22px;
}

.gmail-thread {
    display: flex;
    flex-direction: column;
    gap: 24px;
    overflow-anchor: none;
}

.gmail-open-header {
    margin-bottom: 20px;
}

.gmail-open-thread-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #e8eaed;
    color: #5f6368;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 6px;
}

.gmail-thread-conversation {
    gap: 0;
}

.gmail-thread-message {
    padding-top: 0;
}

.gmail-thread-message.is-from-me {
    background: #f5f7fa;
    border-radius: 8px;
    padding: 12px;
}

.gmail-thread-message.is-from-me .gmail-thread-detail {
    background: transparent;
    padding: 0;
}

.gmail-thread-message.is-from-me .gmail-open-body {
    background: transparent;
}


.gmail-thread-message.is-collapsed .gmail-thread-detail {
    display: none;
}

.gmail-thread-message.is-collapsed .gmail-thread-card {
    display: block;
}

.gmail-thread-message.is-thread-trimmed {
    display: none;
}

.gmail-thread.is-middle-expanded .gmail-thread-trim {
    display: none;
}

.gmail-thread-trim {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 10px var(--gi-pad-l, 16px);
    border: 0;
    border-top: 1px solid #e8eaed;
    border-bottom: 1px solid #e8eaed;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.gmail-thread-trim:hover {
    background: #f8f9fa;
}

.gmail-thread-trim-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e8eaed;
    color: #3c4043;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
}

.gmail-thread-message.is-expanded .gmail-thread-card {
    display: none;
}

.gmail-thread-card {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid #e8eaed;
    border-radius: 0;
    background: #fff;
    cursor: pointer;
    text-align: left;
    box-shadow: none;
}

.gmail-thread-card:hover {
    border-color: #e8eaed;
    background: #f8fbff;
    box-shadow: none;
}

.gmail-thread-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    min-width: 0;
}

.gmail-thread-card-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.gmail-thread-card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.gmail-thread-card-sender {
    font-size: 0.875rem;
    font-weight: 600;
    color: #202124;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gmail-thread-card-date {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: #5f6368;
    white-space: nowrap;
}

.gmail-thread-card-preview {
    display: block;
    font-size: var(--gmail-font-size);
    line-height: var(--gmail-line-height);
    color: #5f6368;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gmail-thread-detail {
    padding-top: 4px;
}

.gmail-thread-message.is-expanded.is-latest .gmail-thread-detail {
    border: 0;
    border-radius: 0;
    padding: 4px 0 0;
    background: transparent;
}

.gmail-thread-message.is-expanded:not(.is-latest) .gmail-thread-detail {
    border: 1px solid #e8eaed;
    border-top: 0;
    border-radius: 0 0 12px 12px;
    padding: 0 16px 12px;
    background: #fff;
}

.gmail-thread-collapse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    padding: 0;
}

.gmail-thread-collapse:hover {
    background: rgba(95, 99, 104, 0.08);
    color: #202124;
}

.gmail-thread-message:not(.is-latest) .gmail-open-body {
    color: #3c4043;
}

.gmail-open-to-label {
    font-size: 0.76rem;
    color: #5f6368;
}

.gmail-open-subject-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.gmail-open-subject {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 400;
    line-height: 1.35;
    color: #202124;
    flex: 1;
    min-width: 0;
}

.gmail-open-label {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 6px;
    border-radius: 4px;
    background: #e8eaed;
    color: #5f6368;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    margin-top: 6px;
}

.gmail-open-sender-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.gmail-open-sender-left {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
    flex: 0 1 auto;
}

.gmail-thread-header-hit {
    flex: 1 1 auto;
    min-width: 32px;
    min-height: 44px;
    align-self: stretch;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
}

.gmail-open-sender-text {
    min-width: 0;
    padding-top: 2px;
}

.gmail-open-sender-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.gmail-open-sender-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #202124;
}

.gmail-open-sender-email {
    font-size: 0.76rem;
    color: #5f6368;
    font-weight: 400;
}

.gmail-open-to-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 0;
    background: transparent;
    padding: 0;
    color: #5f6368;
    font-size: 0.76rem;
    cursor: pointer;
}

.gmail-open-to-toggle:hover {
    color: #202124;
}

.gmail-open-caret {
    font-size: 0.65rem;
    line-height: 1;
}

.gmail-open-recipient-wrap {
    position: relative;
    display: inline-block;
    margin-top: 2px;
}

.gmail-open-to-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #5f6368;
    font: inherit;
    cursor: pointer;
}

.gmail-open-to-btn:hover .gmail-open-to-label,
.gmail-open-to-btn:hover .gmail-open-to-caret {
    color: #202124;
}

.gmail-open-to-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
}

.gmail-open-to-caret svg {
    width: 12px;
    height: 12px;
}

.gmail-open-action-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 16px 0 12px;
    border: 1px solid #dadce0;
    border-radius: 16px;
    background: #fff;
    color: #3c4043;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
}

.gmail-open-action-chip:hover {
    background: #f6f8fc;
    border-color: #d2e3fc;
}

.gmail-open-action-chip svg {
    width: 18px;
    height: 18px;
}

.gmail-open-action-icon {
    width: 32px;
    height: 32px;
}

.gmail-open-sender-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding-top: 4px;
}

.gmail-open-sender-right .gmail-open-action-chip {
    height: 32px;
    padding: 0 16px 0 12px;
    gap: 8px;
    font-size: 0.8125rem;
}

.gmail-open-sender-right .gmail-open-action-chip svg {
    width: 18px;
    height: 18px;
}

.gmail-open-date {
    color: #5f6368;
    font-size: 0.76rem;
    white-space: nowrap;
}

.gmail-thread-message.is-latest .gmail-open-sender-right .gmail-open-date {
    margin-left: 0;
}

.gmail-open-star {
    width: 36px;
    height: 36px;
}

.gmail-open-details {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 30;
    min-width: 440px;
    max-width: min(560px, calc(100vw - 48px));
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #dadce0;
    box-shadow: 0 4px 16px rgba(60, 64, 67, 0.18);
}

.gmail-open-details[hidden] {
    display: none;
}

.gmail-open-details-list {
    margin: 0;
    display: grid;
    gap: 8px;
}

.gmail-open-details-list div {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.gmail-open-details-list dt {
    margin: 0;
    color: #5f6368;
    font-weight: 400;
    text-align: right;
}

.gmail-open-details-list dd {
    margin: 0;
    color: #202124;
    word-break: break-word;
}

.gmail-open-details-from-name {
    font-weight: 700;
    color: #202124;
}

.gmail-open-details-from-email {
    color: #202124;
}

.gmail-open-details-email {
    color: #14b8a6;
}

.gmail-open-body {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #202124;
    word-break: break-word;
    margin-top: 16px;
    /* Keep wide/leaky email markup from reflowing the app chrome */
    overflow-x: auto;
    max-width: 100%;
    isolation: isolate;
    contain: content;
}

.gmail-open-attachments {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed #dadce0;
}

.gmail-open-attachments-heading {
    margin-bottom: 12px;
    font-size: 0.8125rem;
    color: #5f6368;
}

.gmail-attachment-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.gmail-attachment-card {
    display: flex;
    flex-direction: column;
    width: 168px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    background: #fff;
    color: #202124;
    text-decoration: none;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
    transition: box-shadow .15s ease, border-color .15s ease;
}

.gmail-attachment-card:hover {
    border-color: #c6cace;
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.14);
}

.wm-attachment-viewer-modal .wm-attachment-viewer-panel {
    width: min(960px, calc(100vw - 32px));
    max-height: min(92vh, 920px);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
}

.wm-attachment-viewer-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid #e8eaed;
    background: #fff;
    flex-shrink: 0;
}

.wm-attachment-viewer-heading {
    min-width: 0;
    flex: 1;
}

.wm-attachment-viewer-heading h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
    color: #202124;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wm-attachment-viewer-sub {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: #5f6368;
}

.wm-attachment-viewer-sub[hidden] {
    display: none !important;
}

.wm-attachment-viewer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.wm-attachment-viewer-body {
    position: relative;
    flex: 1;
    min-height: min(70vh, 720px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #202124;
    padding: 20px;
    overflow: auto;
}

.wm-attachment-viewer-image {
    display: block;
    max-width: 100%;
    max-height: min(70vh, 720px);
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    border-radius: 8px;
    background: transparent;
}

.wm-attachment-viewer-frame {
    display: block;
    width: 100%;
    height: min(70vh, 720px);
    border: 0;
    border-radius: 8px;
    background: #fff;
}

.wm-attachment-viewer-empty {
    display: grid;
    gap: 14px;
    justify-items: center;
    text-align: center;
    color: #e8eaed;
    padding: 32px 16px;
    max-width: 360px;
}

.wm-attachment-viewer-empty p {
    margin: 0;
    font-size: 0.95rem;
}

.wm-attachment-viewer-image[hidden],
.wm-attachment-viewer-frame[hidden],
.wm-attachment-viewer-empty[hidden] {
    display: none !important;
}

.gmail-attachment-preview {
    position: relative;
    height: 126px;
    background: #f8f9fa;
    overflow: hidden;
}

.gmail-attachment-preview-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    background: #fff;
}

.gmail-attachment-preview-image[hidden] {
    display: none !important;
}

.gmail-attachment-preview-fallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #f8f9fa 0%, #eef1f4 100%);
}

.gmail-attachment-preview-fallback[hidden] {
    display: none !important;
}

.gmail-attachment-dogear {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 18px;
    height: 18px;
    background: linear-gradient(225deg, #f1f3f4 50%, #dadce0 50%, #fff 50%);
    border-top: 1px solid #dadce0;
    border-left: 1px solid #dadce0;
}

.gmail-attachment-card-footer {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0 8px;
    align-items: center;
    min-height: 44px;
    padding: 8px 10px;
    background: #f1f3f4;
    border-top: 1px solid #e8eaed;
}

.gmail-attachment-type-badge {
    grid-row: 1 / 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 16px;
    padding: 0 4px;
    border-radius: 2px;
    background: #5f6368;
    color: #fff;
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
}

.gmail-attachment-type-badge.is-pdf {
    background: #d93025;
}

.gmail-attachment-type-badge.is-image {
    background: #14b8a6;
}

.gmail-attachment-card-footer .gmail-attachment-name {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gmail-attachment-card-footer .gmail-attachment-size {
    grid-column: 2;
    font-size: 0.6875rem;
    color: #5f6368;
}

/* Legacy chip layout fallback */
.gmail-attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
    max-width: 280px;
    padding: 10px 12px;
    border: 1px solid #dadce0;
    border-radius: 12px;
    background: #f8f9fa;
    color: #202124;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease;
}

.gmail-attachment-chip:hover {
    background: #f1f3f4;
    border-color: #c6cace;
}

.gmail-attachment-icon svg {
    width: 18px;
    height: 18px;
}

.gmail-attachment-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.gmail-attachment-name {
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gmail-attachment-size {
    font-size: 0.75rem;
    color: #5f6368;
}

.gmail-open-body img {
    max-width: 100%;
    height: auto;
}

.gmail-open-body table {
    max-width: 100%;
}

.gmail-open-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
    padding-top: 8px;
    padding-bottom: 0;
}

.gmail-thread-message-footer {
    margin-top: 20px;
    margin-left: -4px;
    margin-right: -4px;
    padding: 14px 16px;
    border-top: 1px solid #e0e3e7;
    border-radius: 0 0 12px 12px;
    background: #f1f3f4;
}

.gmail-thread-message.is-expanded:not(.is-latest) .gmail-thread-message-footer {
    margin-top: 16px;
}

.gmail-thread-message-footer .gmail-open-reply-btn {
    background: #fff;
    border-color: #dadce0;
    box-shadow: 0 1px 1px rgba(60, 64, 67, 0.08);
}

.gmail-thread-message-footer .gmail-open-reply-btn:hover {
    background: #fff;
    border-color: #c4c7c5;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.16);
}

.gmail-message-more-wrap .gmail-more-menu {
    left: auto;
    right: 0;
    min-width: 148px;
}

.gmail-open-reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 36px;
    padding: 0 20px 0 16px;
    border: 1px solid #dadce0;
    border-radius: 18px;
    background: #fff;
    color: #5f6368;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .12s ease, box-shadow .12s ease;
}

.gmail-open-reply-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
    color: #202124;
}

.gmail-star svg {
    width: 21px;
    height: 21px;
}

.gmail-attach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #5f6368;
    opacity: 0.92;
}

.gmail-attach svg {
    width: 19px;
    height: 19px;
}

.gmail-open-reply-btn svg {
    display: block;
    width: 21px;
    height: 21px;
}

.gmail-inline-reply {
    margin-top: 12px;
    border: 1px solid #c4c7c5;
    border-radius: 16px;
    background: #fff;
    overflow: visible;
}

.gmail-inline-reply-form {
    display: flex;
    flex-direction: column;
}

.gmail-inline-reply-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 36px;
    padding: 4px 14px 8px 16px;
}

.gmail-inline-reply-mode-icon {
    display: flex;
    align-items: center;
    color: #444746;
    flex-shrink: 0;
    margin-top: 10px;
}

.gmail-inline-reply-mode-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}

.gmail-inline-reply-recipient {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #1f1f1f;
}

.gmail-inline-reply-addr-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 2px 0;
}

.gmail-inline-reply-addr-label {
    flex: 0 0 28px;
    margin-top: 10px;
    color: #5f6368;
    font-size: 0.8rem;
    font-weight: 600;
}

.gmail-inline-reply-recipient-edit {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 2px;
}

.gmail-inline-reply-recipient-wrap {
    width: 100%;
}

.gmail-inline-reply-recipient-wrap .gmail-compose-recipient-box {
    min-height: 36px;
    padding: 4px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.gmail-inline-reply-recipient-wrap .gmail-compose-recipient-box:focus-within {
    box-shadow: none;
}


.gmail-inline-reply-recipient-wrap {
    width: 100%;
}

.gmail-inline-reply-recipient-wrap .gmail-compose-recipient-box {
    min-height: 24px;
    padding: 2px 0;
}

.gmail-inline-reply-popout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: auto;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #444746;
    cursor: pointer;
    flex-shrink: 0;
}

.gmail-inline-reply-popout:hover {
    background: #f2f2f2;
}

.gmail-inline-reply-popout svg {
    display: block;
    width: 16px;
    height: 16px;
}

.gmail-inline-reply-editor {
    position: relative;
    padding: 4px 0 0;
}

.gmail-inline-reply-body {
    display: block;
    width: 100%;
    min-height: 152px;
    max-height: 320px;
    overflow: auto;
    padding: 8px 16px 12px;
    border: 0;
    outline: none;
    resize: none;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #1f1f1f;
    background: transparent;
    box-sizing: border-box;
}

.gmail-inline-reply-body:empty:before {
    content: attr(data-placeholder);
    color: #9aa0a6;
    pointer-events: none;
}

.gmail-inline-reply .gmail-compose-attachments {
    margin: 0 16px 8px;
}

.gmail-inline-reply .gmail-compose-toolbar-modern {
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 10px;
}

.gmail-inline-reply .gmail-compose-send {
    min-height: 36px;
    padding: 0 14px;
}

.gmail-inline-reply-quote-toggle {
    position: relative;
    left: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 22px;
    margin: 4px 0 8px;
    padding: 0 8px;
    border: 0;
    border-radius: 4px;
    background: #f2f2f2;
    color: #444746;
    cursor: pointer;
}

.gmail-inline-reply-quote-dots {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 1px;
}

.gmail-inline-reply-quote-toggle:hover,
.gmail-inline-reply-quote-toggle[aria-pressed="true"] {
    background: #e8eaed;
    color: #1f1f1f;
}

.gmail-inline-reply-quote {
    margin: 0;
    padding: 8px 16px 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #202124;
    word-break: break-word;
}

.gmail-inline-reply-quote .gmail-quoted-meta,
.gmail-inline-reply-quote .gmail-forward-meta {
    color: #5f6368;
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.gmail-inline-reply-quote .gmail-quoted-content {
    margin: 0;
    padding: 0 0 0 12px;
    border-left: 2px solid #ccc;
}

.gmail-inline-reply-quote img {
    max-width: 100%;
    height: auto;
}

.gmail-inline-reply-quote table {
    max-width: 100%;
}

.gmail-inline-reply .gmail-compose-bottom {
    border-top: 1px solid #e8eaed;
    padding: 10px 12px 12px;
}

.gmail-inline-reply .gmail-compose-toolbar {
    min-height: 40px;
    overflow-x: auto;
}

.gmail-toolbar-message {
    grid-template-columns: 1fr auto;
}

.wm-btn-compact {
    height: 36px;
    padding: 0 16px;
    font-size: 0.82rem;
}

    @media (max-width: 900px) {
    .gmail-open-scroll {
        padding: 12px 16px 24px;
    }

    .gmail-open-details {
        min-width: min(440px, calc(100vw - 32px));
    }

    .gmail-open-sender-row {
        flex-direction: column;
    }

    .gmail-open-sender-right {
        padding-top: 0;
        padding-left: 56px;
    }

    .gmail-open-toolbar-main .gmail-icon-btn:nth-child(n+8) {
        display: none;
    }

    .gmail-inbox {
        --gi-sender: 120px;
        --gi-pad-l: 12px;
        --gi-pad-r: 12px;
    }

    .gmail-row {
        grid-template-columns: 36px 1fr 56px;
        grid-template-rows: auto auto;
        row-gap: 2px;
        padding-top: 10px;
        padding-bottom: 10px;
        padding-left: 8px;
    }

    .gmail-col-check { display: none !important; }
    .gmail-col-star { grid-column: 1; grid-row: 1 / 3; align-self: center; }
    .gmail-col-sender { grid-column: 2; grid-row: 1; }
    .gmail-col-line { grid-column: 2; grid-row: 2; }
    .gmail-col-attach { display: none; }
    .gmail-col-date { grid-row: 1; grid-column: 3; }
    .wm-app { grid-template-columns: 1fr; }
    /* sidebar becomes drawer — see mobile shell below */
}

/* Compose popup — Nex Stack Mail 2026 style */
.gmail-compose {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
}

.gmail-compose[hidden] {
    display: none;
}

.gmail-compose::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(4px);
    z-index: 0;
    pointer-events: auto;
}

.gmail-compose.is-minimized::before,
.gmail-compose.is-docked::before {
    display: none;
}

.gmail-compose-window {
    --compose-sidebar: 232px;
    --compose-gap: calc(var(--compose-sidebar) / 2 + 5vw);
    position: fixed;
    top: 7.5vh;
    left: var(--compose-gap);
    right: var(--compose-gap);
    width: auto;
    height: 85vh;
    background: var(--wm-panel);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: var(--wm-radius);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1;
    pointer-events: auto;
    animation: gmail-compose-in 0.24s ease-out;
    transition: top 0.2s ease, left 0.2s ease, right 0.2s ease, bottom 0.2s ease, width 0.2s ease, height 0.2s ease, border-radius 0.2s ease;
}

@keyframes gmail-compose-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gmail-compose.is-minimized .gmail-compose-window {
    display: none;
}

.gmail-compose.is-docked .gmail-compose-window {
    top: auto;
    left: auto;
    right: 24px;
    bottom: 0;
    width: min(560px, calc(100vw - 48px));
    height: min(520px, 70vh);
    border-radius: var(--wm-radius) var(--wm-radius) 0 0;
    animation: none;
}

.gmail-compose-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 0;
    padding: 14px 16px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 2px solid var(--wm-accent);
    flex-shrink: 0;
    cursor: move;
}

.gmail-compose-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.gmail-compose-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(20, 184, 166, 0.18);
    color: #5eead4;
    flex-shrink: 0;
}

.gmail-compose-title-icon svg {
    width: 18px;
    height: 18px;
}

.gmail-compose-title-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.gmail-compose-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.25;
}

.gmail-compose-subtitle {
    font-size: 0.72rem;
    font-weight: 500;
    color: #94a3b8;
    line-height: 1.2;
}

.gmail-compose-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gmail-compose-header-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.gmail-compose-header-btn svg {
    width: 16px;
    height: 16px;
}

.gmail-compose-header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.gmail-compose-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: visible;
    font-size: 14px;
    line-height: 20px;
}

.gmail-compose-fields {
    flex-shrink: 0;
    position: relative;
    z-index: 20;
    overflow: visible;
}

.gmail-compose-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 1ch;
    padding: 10px 18px;
    border-bottom: 1px solid var(--wm-line);
    min-height: 40px;
}

.gmail-compose-row-to {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.gmail-compose-row-from {
    grid-template-columns: auto minmax(0, max-content);
    justify-content: start;
    align-items: center;
    overflow: visible;
    position: relative;
    z-index: 30;
}

.gmail-from-select {
    position: relative;
    min-width: 0;
    max-width: min(100%, 40rem);
}

.gmail-from-select-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-height: 32px;
    padding: 3px 8px 3px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    color: var(--wm-text, #202124);
    font: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.gmail-from-select-trigger:hover,
.gmail-from-select-trigger[aria-expanded="true"] {
    background: #fff;
    border-color: rgba(20, 184, 166, 0.35);
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.12);
}

.gmail-from-select-trigger.is-static {
    cursor: default;
    padding-right: 12px;
}

.gmail-from-select-trigger.is-static:hover {
    background: rgba(15, 23, 42, 0.04);
    border-color: transparent;
    box-shadow: none;
}

.gmail-from-select-current {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    text-align: left;
}

.gmail-from-select-name {
    font-size: 0.88rem;
    font-weight: 650;
    line-height: 1.2;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 12rem;
}

.gmail-from-select-name.is-empty,
.gmail-from-select-name[hidden] {
    display: none;
}

.gmail-from-select-email {
    font-size: 0.88rem;
    line-height: 1.2;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.gmail-from-select-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.gmail-from-select-badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.12);
    color: #0f766e;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.gmail-from-select-chevron {
    display: inline-flex;
    color: #64748b;
    transition: transform 0.15s ease;
}

.gmail-from-select-trigger[aria-expanded="true"] .gmail-from-select-chevron {
    transform: rotate(180deg);
    color: #0f766e;
}

.gmail-from-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 60;
    min-width: max(100%, 320px);
    max-width: min(92vw, 420px);
    padding: 6px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.gmail-from-select-menu[hidden] {
    display: none;
}

.gmail-from-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.gmail-from-select-option:hover,
.gmail-from-select-option.is-active {
    background: rgba(20, 184, 166, 0.08);
}

.gmail-from-select-option.is-selected {
    background: rgba(20, 184, 166, 0.14);
}

.gmail-from-select-option-main {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
}

.gmail-from-select-option-name {
    font-size: 0.88rem;
    font-weight: 650;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 10rem;
}

.gmail-from-select-option-email {
    font-size: 0.88rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.gmail-from-select-option-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.gmail-from-select-option.is-selected .gmail-from-select-option-badge {
    background: rgba(20, 184, 166, 0.15);
    color: #0f766e;
}

.gmail-compose-from-select,
.gmail-compose-from-static {
    display: none;
}

.gmail-inline-reply-from-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 8px 0 0;
    border-bottom: 1px solid var(--wm-line, #e0e3e7);
    overflow: visible;
    position: relative;
    z-index: 28;
}

.gmail-inline-reply-from-row .gmail-compose-row {
    flex: 1;
    min-width: 0;
    padding: 2px 6px 8px 16px;
    min-height: 0;
    border-bottom: none;
    grid-template-columns: auto minmax(0, max-content);
    overflow: visible;
}

.gmail-inline-reply-from-row .gmail-compose-label {
    color: var(--wm-muted, #5f6368);
    font-size: 0.85rem;
}

.gmail-inline-reply-from-row .gmail-inline-reply-popout {
    flex-shrink: 0;
    margin-right: 6px;
}

.gmail-compose-row-to,
.gmail-compose-row-recipient {
    align-items: flex-start;
    overflow: visible;
}

.gmail-compose-row-to .gmail-compose-label,
.gmail-compose-row-recipient .gmail-compose-label {
    padding-top: 2px;
}

.gmail-compose-input-wrap {
    position: relative;
    min-width: 0;
    z-index: 25;
    overflow: visible;
}

.gmail-compose-recipient-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 2px 0;
    cursor: text;
}

.gmail-compose-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.gmail-compose-recipient-input {
    flex: 1 1 120px;
    min-width: 80px;
    border: 0;
    background: transparent;
    padding: 2px 0;
    font-size: 14px;
    line-height: 20px;
    font-family: inherit;
    color: var(--wm-text);
    outline: none;
}

.gmail-compose-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 2px 8px 2px 2px;
    border: 1px solid rgba(20, 184, 166, 0.35);
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.08);
    font-size: 13px;
    line-height: 20px;
    color: var(--wm-text);
}

.gmail-compose-chip-avatar {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.gmail-compose-chip-avatar .gmail-sender-initial {
    font-size: 0.58rem;
}

.gmail-compose-chip-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.gmail-compose-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}

.gmail-compose-chip-remove:hover {
    background: #f1f3f4;
    color: #202124;
}

.gmail-compose-suggest {
    position: absolute;
    top: calc(100% - 2px);
    left: 0;
    width: 50%;
    min-width: 220px;
    max-width: 320px;
    z-index: 50;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--wm-line);
    border-radius: 0 0 var(--wm-radius-sm) var(--wm-radius-sm);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    max-height: 240px;
    overflow-y: auto;
}

.gmail-compose-suggest[hidden] {
    display: none;
}

.gmail-compose-suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 8px 14px;
    cursor: pointer;
    font-family: inherit;
}

.gmail-compose-suggest-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.gmail-compose-suggest-avatar .gmail-sender-initial {
    font-size: 0.8rem;
}

.gmail-compose-suggest-text {
    min-width: 0;
    flex: 1;
}

.gmail-compose-suggest-item:hover,
.gmail-compose-suggest-item.is-active {
    background: rgba(20, 184, 166, 0.08);
}

.gmail-compose-suggest-name {
    display: block;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gmail-compose-suggest-email {
    display: block;
    font-size: 14px;
    line-height: 20px;
    color: #5f6368;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gmail-compose-row[hidden] {
    display: none;
}

.gmail-compose-label {
    font-size: 13px;
    line-height: 20px;
    font-weight: 600;
    color: var(--wm-muted);
    white-space: nowrap;
}

.gmail-compose-input {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 2px 0;
    font-size: 14px;
    line-height: 20px;
    font-family: inherit;
    color: var(--wm-text);
    outline: none;
}

.gmail-compose-recipient-links {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.gmail-compose-link-btn {
    border: 0;
    background: transparent;
    color: var(--wm-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.gmail-compose-link-btn:hover {
    color: var(--wm-accent-dark);
    background: rgba(20, 184, 166, 0.1);
}

.gmail-compose-editor-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    background: #f8fafc;
}

.gmail-compose-quote-toggle {
    position: relative;
    left: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    min-width: 34px;
    height: 22px;
    margin: 0 0 10px;
    padding: 0 8px;
    border: 0;
    border-radius: 4px;
    background: #e8eaed;
    color: #444746;
    cursor: pointer;
    flex-shrink: 0;
}

.gmail-compose-quote-dots {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 1px;
}

.gmail-compose-quote-toggle:hover,
.gmail-compose-quote-toggle[aria-pressed="true"] {
    background: #dadce0;
    color: #1f1f1f;
}

.gmail-compose-quote {
    margin: 0;
    padding: 0 20px 16px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #202124;
    word-break: break-word;
    flex-shrink: 0;
}

.gmail-compose-quote .gmail-quoted-meta,
.gmail-compose-quote .gmail-forward-meta {
    color: #5f6368;
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.gmail-compose-quote .gmail-quoted-content {
    margin: 0;
    padding: 0 0 0 12px;
    border-left: 2px solid #ccc;
}

.gmail-compose-quote img {
    max-width: 100%;
    height: auto;
}

.gmail-compose-quote table {
    max-width: 100%;
}

.gmail-compose-body {
    width: 100%;
    flex: 1;
    min-height: 120px;
    border: 0;
    resize: none;
    padding: 18px 20px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--wm-text);
    background: transparent;
    outline: none;
    box-sizing: border-box;
}

.gmail-compose-rte {
    overflow-wrap: break-word;
    word-break: break-word;
    cursor: text;
}

.gmail-compose-rte:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
}

.gmail-compose-rte:focus {
    outline: none;
}

.gmail-compose-rte a {
    color: #14b8a6;
    text-decoration: underline;
}

.gmail-compose-rte [data-email-section-heading] {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 17px;
    line-height: 24px;
    font-weight: 700;
    color: #222222;
    margin: 24px 0 10px 0;
}

.gmail-compose-body-plain {
    display: none !important;
}

.gmail-compose-attachments {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    gap: 2px;
    max-height: 132px;
    overflow-y: auto;
    padding: 0;
    background: #fff;
    border-top: 1px solid var(--wm-line);
}

.gmail-compose-attachment-row {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 40px;
    padding: 10px 16px;
    background: #f1f3f4;
    box-sizing: border-box;
}

.gmail-compose-attachment-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

.gmail-compose-attachment-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
    color: #14b8a6;
    flex-shrink: 1;
    min-width: 0;
}

.gmail-compose-attachment-size {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 400;
    color: #5f6368;
}

.gmail-compose-attachment-remove {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 2px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #5f6368;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
}

.gmail-compose-attachment-remove:hover {
    color: #202124;
    background: rgba(60, 64, 67, 0.08);
}

.gmail-compose-font-size-select {
    min-width: 52px;
    max-width: 64px;
    padding-right: 4px;
}

.gmail-compose-fmt-btn.is-active,
.gmail-compose-tool-btn.is-active {
    background: #e8f0fe;
    color: #14b8a6;
}

.gmail-compose-body::placeholder {
    color: #94a3b8;
}

.gmail-compose-font-sans-serif { font-family: var(--gmail-font-family); }
.gmail-compose-font-serif { font-family: 'Merriweather', 'Times New Roman', Times, serif; }
.gmail-compose-font-fixed-width { font-family: 'Roboto Mono', 'Courier New', Courier, monospace; }
.gmail-compose-font-wide { font-family: 'Archivo Black', 'Arial Black', sans-serif; }
.gmail-compose-font-narrow { font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif; }
.gmail-compose-font-comic-sans { font-family: 'Comic Neue', 'Comic Sans MS', cursive; }
.gmail-compose-font-garamond { font-family: 'EB Garamond', Garamond, serif; }
.gmail-compose-font-georgia { font-family: Georgia, 'Source Serif 4', serif; }
.gmail-compose-font-tahoma { font-family: Tahoma, 'Roboto', sans-serif; }
.gmail-compose-font-trebuchet { font-family: 'Fira Sans', 'Trebuchet MS', sans-serif; }
.gmail-compose-font-verdana { font-family: 'Carlito', Verdana, sans-serif; }
.gmail-compose-font-inter { font-family: 'Inter', Roboto, sans-serif; }
.gmail-compose-font-open-sans { font-family: 'Open Sans', Roboto, sans-serif; }
.gmail-compose-font-lato { font-family: 'Lato', Roboto, sans-serif; }
.gmail-compose-font-montserrat { font-family: 'Montserrat', Roboto, sans-serif; }
.gmail-compose-font-poppins { font-family: 'Poppins', Roboto, sans-serif; }
.gmail-compose-font-nunito { font-family: 'Nunito', Roboto, sans-serif; }
.gmail-compose-font-raleway { font-family: 'Raleway', Roboto, sans-serif; }
.gmail-compose-font-ubuntu { font-family: 'Ubuntu', Roboto, sans-serif; }
.gmail-compose-font-oswald { font-family: 'Oswald', Roboto, sans-serif; }
.gmail-compose-font-playfair-display { font-family: 'Playfair Display', Georgia, serif; }
.gmail-compose-font-pt-sans { font-family: 'PT Sans', Roboto, sans-serif; }
.gmail-compose-font-source-sans-3 { font-family: 'Source Sans 3', Roboto, sans-serif; }
.gmail-compose-font-roboto-slab { font-family: 'Roboto Slab', Georgia, serif; }
.gmail-compose-font-libre-baskerville { font-family: 'Libre Baskerville', Georgia, serif; }
.gmail-compose-font-bitter { font-family: 'Bitter', Georgia, serif; }
.gmail-compose-font-dancing-script { font-family: 'Dancing Script', cursive; }

.gmail-compose-font-opt-sans-serif { font-family: var(--gmail-font-family); }
.gmail-compose-font-opt-serif { font-family: 'Merriweather', 'Times New Roman', Times, serif; }
.gmail-compose-font-opt-fixed-width { font-family: 'Roboto Mono', 'Courier New', Courier, monospace; }
.gmail-compose-font-opt-wide { font-family: 'Archivo Black', 'Arial Black', sans-serif; font-weight: 700; }
.gmail-compose-font-opt-narrow { font-family: 'Roboto Condensed', 'Arial Narrow', sans-serif; }
.gmail-compose-font-opt-comic-sans { font-family: 'Comic Neue', 'Comic Sans MS', cursive; }
.gmail-compose-font-opt-garamond { font-family: 'EB Garamond', Garamond, serif; }
.gmail-compose-font-opt-georgia { font-family: Georgia, 'Source Serif 4', serif; }
.gmail-compose-font-opt-tahoma { font-family: Tahoma, 'Roboto', sans-serif; }
.gmail-compose-font-opt-trebuchet { font-family: 'Fira Sans', 'Trebuchet MS', sans-serif; }
.gmail-compose-font-opt-verdana { font-family: 'Carlito', Verdana, sans-serif; }
.gmail-compose-font-opt-inter { font-family: 'Inter', Roboto, sans-serif; }
.gmail-compose-font-opt-open-sans { font-family: 'Open Sans', Roboto, sans-serif; }
.gmail-compose-font-opt-lato { font-family: 'Lato', Roboto, sans-serif; }
.gmail-compose-font-opt-montserrat { font-family: 'Montserrat', Roboto, sans-serif; }
.gmail-compose-font-opt-poppins { font-family: 'Poppins', Roboto, sans-serif; }
.gmail-compose-font-opt-nunito { font-family: 'Nunito', Roboto, sans-serif; }
.gmail-compose-font-opt-raleway { font-family: 'Raleway', Roboto, sans-serif; }
.gmail-compose-font-opt-ubuntu { font-family: 'Ubuntu', Roboto, sans-serif; }
.gmail-compose-font-opt-oswald { font-family: 'Oswald', Roboto, sans-serif; }
.gmail-compose-font-opt-playfair-display { font-family: 'Playfair Display', Georgia, serif; }
.gmail-compose-font-opt-pt-sans { font-family: 'PT Sans', Roboto, sans-serif; }
.gmail-compose-font-opt-source-sans-3 { font-family: 'Source Sans 3', Roboto, sans-serif; }
.gmail-compose-font-opt-roboto-slab { font-family: 'Roboto Slab', Georgia, serif; }
.gmail-compose-font-opt-libre-baskerville { font-family: 'Libre Baskerville', Georgia, serif; }
.gmail-compose-font-opt-bitter { font-family: 'Bitter', Georgia, serif; }
.gmail-compose-font-opt-dancing-script { font-family: 'Dancing Script', cursive; }

.gmail-compose-bottom {
    flex-shrink: 0;
    border-top: 1px solid var(--wm-line);
    background: #fff;
    padding: 12px 16px 14px;
    position: relative;
}

.gmail-compose-menu-wrap {
    position: relative;
    flex-shrink: 0;
}

.gmail-compose-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 30;
    min-width: 196px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--wm-line);
    border-radius: var(--wm-radius-sm);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

.gmail-compose-menu[hidden] {
    display: none;
}

.gmail-compose-menu-heading {
    padding: 6px 10px 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--wm-muted);
}

.gmail-compose-menu-item {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 9px 10px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.86rem;
    color: var(--wm-text);
    cursor: pointer;
    transition: background 0.15s ease;
}

.gmail-compose-menu-item:hover {
    background: rgba(20, 184, 166, 0.1);
    color: var(--wm-accent-dark);
}

.gmail-compose-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    min-height: 44px;
}

.gmail-compose-toolbar-modern {
    gap: 6px;
}

.gmail-compose-toolbar .gmail-compose-send-wrap {
    flex-shrink: 0;
    margin-right: 2px;
}

.gmail-compose-toolbar .gmail-compose-discard {
    margin-left: auto;
    flex-shrink: 0;
}

.gmail-compose-fmt-group-muted .gmail-compose-fmt-btn:disabled,
.gmail-compose-fmt-group-muted .gmail-compose-tool-btn:disabled {
    opacity: 0.45;
}

.gmail-compose-fmt-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.gmail-compose-fmt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--wm-text);
    cursor: pointer;
    padding: 0 6px;
    font-size: 14px;
    line-height: 20px;
    transition: background 0.15s ease;
}

.gmail-compose-fmt-btn svg {
    width: 19px;
    height: 19px;
    color: currentColor;
}

.gmail-compose-fmt-btn:hover:not(:disabled) {
    background: #f1f5f9;
}

.gmail-compose-fmt-btn:disabled {
    color: var(--wm-muted);
    cursor: default;
}

.gmail-compose-fmt-text {
    font-family: Georgia, 'Times New Roman', serif;
    min-width: 28px;
    font-weight: 700;
}

.gmail-compose-fmt-text strong {
    font-weight: 800;
}

.gmail-compose-fmt-tt {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    min-width: 36px;
}

.gmail-compose-fmt-align {
    gap: 0;
    padding-right: 2px;
}

.gmail-compose-fmt-caret {
    display: inline-flex;
    margin-left: -4px;
}

.gmail-compose-fmt-caret svg {
    width: 15px;
    height: 15px;
}

.gmail-compose-fmt-select {
    height: 34px;
    border: 1px solid var(--wm-line);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--wm-text);
    font-family: var(--gmail-font-family);
    font-size: 13px;
    line-height: 20px;
    padding: 0 8px;
    margin: 0;
    max-width: 128px;
    cursor: pointer;
}

.gmail-compose-toolbar-modern .gmail-compose-fmt-select {
    border-color: transparent;
    background: transparent;
}

.gmail-compose-fmt-divider {
    width: 1px;
    height: 24px;
    background: var(--wm-line);
    margin: 0 4px;
    flex-shrink: 0;
}

.gmail-compose-send-wrap {
    display: inline-flex;
    align-items: stretch;
    flex-shrink: 0;
}

.gmail-compose-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: #fff;
    font-size: 14px;
    line-height: 20px;
    font-weight: 700;
    padding: 0 22px;
    height: 38px;
    border-radius: 24px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gmail-compose-send svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.gmail-compose-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(20, 184, 166, 0.42);
}

.gmail-compose-send.is-sending,
.gmail-compose-send.is-busy,
button.is-busy {
    opacity: 0.8;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.gmail-compose-send.is-sending .gmail-compose-send-label {
    letter-spacing: 0.01em;
}

.gmail-compose-toolbar:not(.gmail-compose-toolbar-modern) .gmail-compose-send {
    border-radius: 18px 0 0 18px;
    background: #0d9488;
    box-shadow: none;
    transform: none;
    font-weight: 500;
}

.gmail-compose-toolbar:not(.gmail-compose-toolbar-modern) .gmail-compose-send:hover {
    background: #0f766e;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transform: none;
}

.gmail-compose-send-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 36px;
    border: 0;
    background: #0d9488;
    color: #fff;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0 18px 18px 0;
    cursor: pointer;
    padding: 0;
}

.gmail-compose-send-menu:disabled {
    opacity: 0.55;
    cursor: default;
}

.gmail-compose-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--wm-text);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.gmail-compose-tool-btn svg {
    width: 20px;
    height: 20px;
    color: currentColor;
}

.gmail-compose-tool-btn:hover:not(:disabled) {
    background: #f1f5f9;
    color: var(--wm-text);
}

.gmail-compose-tool-btn:disabled {
    color: var(--wm-muted);
    cursor: default;
}

.gmail-compose-tool-btn.is-active {
    background: rgba(20, 184, 166, 0.12);
    color: var(--wm-accent-dark);
}

.gmail-compose-discard:hover:not(:disabled) {
    background: #fef2f2;
    color: #dc2626;
}

.gmail-compose-fmt-label {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;
}

.gmail-compose-discard {
    margin-left: auto;
}

.gmail-compose-minibar {
    position: fixed;
    left: 80px;
    bottom: 0;
    border: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f8fafc;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: var(--wm-radius-sm) var(--wm-radius-sm) 0 0;
    border-top: 2px solid var(--wm-accent);
    cursor: pointer;
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.35);
    pointer-events: auto;
    z-index: 10001;
}

.gmail-compose-minibar[hidden] {
    display: none;
}

.gmail-compose.is-minimized .gmail-compose-minibar {
    display: block;
}

body.gmail-compose-open .wm-content {
    filter: none;
}

@media (max-width: 900px) {
    .gmail-compose-window {
        --compose-gap: 9vw;
        left: var(--compose-gap);
        right: var(--compose-gap);
        height: 85vh;
        top: 7.5vh;
    }

    .gmail-compose.is-docked .gmail-compose-window {
        left: auto;
        right: 12px;
        width: calc(100vw - 24px);
        height: min(480px, 70vh);
    }

    .gmail-compose-minibar {
        left: 12px;
        z-index: 10001;
    }
}

/* ── Infinite scroll loader ── */
.gmail-scroll-sentinel {
    height: 1px;
}

.gmail-scroll-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
    font-size: 0.8rem;
    color: var(--muted);
}

.gmail-scroll-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Reply templates */
.wm-modal-stacked {
    z-index: 10060;
}

.wm-templates-panel {
    width: min(860px, 100%);
}

.wm-templates-body {
    gap: 12px;
}

.wm-templates-intro {
    margin: 0;
    color: var(--wm-muted);
    font-size: 0.86rem;
}

.wm-templates-toolbar {
    display: flex;
    justify-content: flex-end;
}

.wm-templates-table-wrap {
    max-height: min(52vh, 420px);
    overflow: auto;
    border: 1px solid var(--wm-line);
    border-radius: var(--wm-radius-sm);
}

.wm-templates-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.wm-templates-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--wm-line);
    color: var(--wm-muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wm-templates-table tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--wm-line);
    vertical-align: middle;
}

.wm-templates-table tbody tr:last-child td {
    border-bottom: 0;
}

.wm-templates-table tbody tr:hover {
    background: #f8fafc;
}

.wm-templates-subject,
.wm-templates-name {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wm-templates-created {
    white-space: nowrap;
    color: var(--wm-muted);
}

.wm-templates-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    white-space: nowrap;
}

.wm-templates-actions-col {
    width: 150px;
    text-align: right;
}

.wm-templates-empty-row td {
    text-align: center;
    color: var(--wm-muted);
    padding: 28px 12px;
}

/* Inbox rules */
.wm-rules-panel {
    width: min(860px, 100%);
}

.wm-rules-body {
    gap: 12px;
}

.wm-rules-intro {
    margin: 0;
    color: var(--wm-muted);
    font-size: 0.86rem;
}

.wm-rules-toolbar {
    display: flex;
    justify-content: flex-end;
}

.wm-rules-table-wrap {
    max-height: min(52vh, 420px);
    overflow: auto;
    border: 1px solid var(--wm-line);
    border-radius: var(--wm-radius-sm);
}

.wm-rules-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.wm-rules-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--wm-line);
    color: var(--wm-muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.wm-rules-table tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--wm-line);
    vertical-align: middle;
}

.wm-rules-table tbody tr:last-child td {
    border-bottom: 0;
}

.wm-rules-table tbody tr:hover {
    background: #f8fafc;
}

.wm-rules-name {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.wm-rules-enabled {
    width: 52px;
}

.wm-rules-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    white-space: nowrap;
}

.wm-rules-actions-col {
    width: 220px;
    text-align: right;
}

.wm-rules-empty-row td {
    text-align: center;
    color: var(--wm-muted);
    padding: 28px 12px;
}

.wm-rules-switch {
    display: inline-flex;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.wm-rules-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.wm-rules-switch span {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: #d1d5db;
    position: relative;
    transition: background 0.15s ease;
}

.wm-rules-switch span::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: transform 0.15s ease;
}

.wm-rules-switch input:checked + span {
    background: #0d9488;
}

.wm-rules-switch input:checked + span::after {
    transform: translateX(16px);
}

.wm-rule-editor-panel {
    width: min(560px, 100%);
}

.wm-rule-view-panel {
    width: min(520px, 100%);
}

.wm-rule-view-body {
    gap: 14px;
}

.wm-rule-view-status {
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.86rem;
    font-weight: 600;
}

.wm-rule-view-status.is-off {
    background: #f3f4f6;
    color: #6b7280;
}

.wm-rule-view-block {
    display: grid;
    gap: 6px;
}

.wm-rule-view-list {
    margin: 0;
    padding: 0 0 0 18px;
    color: var(--wm-text);
    font-size: 0.9rem;
    line-height: 1.45;
}

.wm-rule-view-summary {
    margin: 4px 0 0;
    color: var(--wm-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.wm-rule-editor-form .wm-modal-body {
    gap: 8px;
}

.wm-optional-label {
    font-weight: 500;
    color: var(--wm-muted);
}

.wm-rule-section-label {
    margin: 10px 0 2px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--wm-text);
}

.wm-rule-actions {
    display: grid;
    gap: 8px;
    margin-bottom: 4px;
}

.wm-rule-action-choice,
.wm-rule-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--wm-text);
    cursor: pointer;
}

.wm-rule-action-choice input,
.wm-rule-check input {
    width: auto;
    margin: 0;
}

#rule-editor-forward-fields {
    display: grid;
    gap: 8px;
}

#rule-editor-forward-fields[hidden] {
    display: none;
}

.wm-btn-sm {
    padding: 6px 10px;
    font-size: 0.78rem;
}

.wm-template-editor-panel {
    width: min(720px, 100%);
    display: flex;
    flex-direction: column;
    max-height: min(92vh, 860px);
}

.wm-template-editor-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.wm-template-editor-fields {
    display: grid;
    gap: 10px;
    padding: 14px 18px 0;
}

.wm-template-editor-row {
    display: grid;
    gap: 6px;
}

.wm-template-editor-row label {
    margin: 0;
    color: var(--wm-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.wm-template-editor-row input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--wm-line);
    border-radius: var(--wm-radius-sm);
    font-size: 0.9rem;
}

.wm-template-editor-body-wrap {
    margin: 12px 18px 0;
    min-height: 220px;
    max-height: 36vh;
}

.wm-template-editor-body-wrap .gmail-compose-body {
    min-height: 220px;
    max-height: 36vh;
}

.wm-template-editor-form .gmail-compose-attachments {
    margin: 0 18px;
}

.wm-template-editor-footer {
    margin-top: auto;
    border-top: 1px solid var(--wm-line);
}

.wm-template-editor-footer .gmail-compose-toolbar {
    padding: 10px 14px;
}

.wm-template-save-btn {
    min-width: 84px;
}

.wm-template-cancel-btn {
    margin-left: auto;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--wm-muted);
}

.wm-template-editor-error {
    margin: 0 18px 14px;
}

.gmail-compose-menu-empty {
    margin: 0;
    padding: 10px 14px;
    color: var(--wm-muted);
    font-size: 0.82rem;
}

/* Compose template picker — shared overlay for compose + reply */
.gmail-compose-template-picker {
    position: fixed;
    inset: 0;
    z-index: 10070;
    display: grid;
    place-items: center;
    padding: 20px;
}

.gmail-compose-template-picker[hidden] {
    display: none;
}

.gmail-compose-template-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
}

.gmail-compose-template-picker-panel {
    position: relative;
    width: min(500px, 100%);
    max-height: min(72vh, 560px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--wm-line);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.gmail-compose-template-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--wm-line);
}

.gmail-compose-template-picker-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
}

.gmail-compose-template-picker-close {
    border: 0;
    background: transparent;
    font-size: 1.35rem;
    line-height: 1;
    color: var(--wm-muted);
    cursor: pointer;
}

.gmail-compose-template-picker-search-wrap {
    padding: 12px 16px 0;
}

.gmail-compose-template-picker-search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--wm-line);
    border-radius: var(--wm-radius-sm);
    font-size: 0.9rem;
}

.gmail-compose-template-picker-search:focus {
    outline: none;
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.gmail-compose-template-picker-list {
    margin: 10px 8px 8px;
    padding: 0 4px 4px;
    overflow: auto;
    max-height: min(52vh, 420px);
}

.gmail-compose-template-picker-item {
    display: grid;
    gap: 2px;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease;
}

.gmail-compose-template-picker-item:hover,
.gmail-compose-template-picker-item.is-active {
    background: #eff6ff;
}

.gmail-compose-template-picker-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--wm-text);
}

.gmail-compose-template-picker-subject {
    font-size: 0.8rem;
    color: var(--wm-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gmail-compose-template-picker-loading {
    margin: 0;
    padding: 18px 16px 20px;
    text-align: center;
    color: var(--wm-muted);
    font-size: 0.86rem;
}

/* Email signature editor */
.wm-profile-panel {
    width: min(720px, 100%);
    max-height: min(94vh, 900px);
    display: flex;
    flex-direction: column;
}

.wm-profile-editor-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 8px;
}

.wm-profile-editor-intro {
    margin: 0;
    padding: 12px 18px 0;
    color: var(--wm-muted);
    font-size: 0.84rem;
}

.wm-profile-fields-panel {
    display: grid;
    gap: 14px;
    max-height: min(62vh, 620px);
    overflow: auto;
    padding: 14px 18px 0;
}

.wm-profile-footer-bar {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    padding: 12px 18px 0;
    border-top: 1px solid var(--wm-line);
}

.wm-profile-editor-error {
    margin: 8px 18px 0;
}

.wm-signature-profile-hint {
    margin: 0 0 10px;
    color: var(--wm-muted);
    font-size: 0.84rem;
}

.wm-link-btn {
    border: 0;
    background: none;
    padding: 0;
    color: #2563eb;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

.wm-signature-plain-panel:not([hidden]) {
    padding: 14px 18px 0;
}

.wm-signature-editor-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-bottom: 8px;
}

.wm-signature-editor-intro {
    margin: 0;
    padding: 12px 18px 0;
    color: var(--wm-muted);
    font-size: 0.84rem;
}

.wm-signature-section-label {
    margin: 0 0 8px;
    color: var(--wm-text);
    font-size: 0.82rem;
    font-weight: 700;
}

.wm-signature-details-block,
.wm-signature-style-block,
.wm-signature-preview-block {
    padding: 14px 18px 0;
}

.wm-signature-details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.wm-signature-details-header .wm-signature-section-label {
    margin: 0;
}

.wm-signature-details-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.wm-signature-summary-panel {
    border: 1px solid var(--wm-line);
    border-radius: 12px;
    background: #f8fafc;
    padding: 12px 14px;
}

.wm-signature-summary-empty {
    color: var(--wm-muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.wm-signature-summary-layout {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.wm-signature-summary-media {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.wm-signature-summary-thumb {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--wm-line);
    background: #fff;
}

.wm-signature-summary-thumb.is-logo {
    width: auto;
    max-width: 88px;
    height: 36px;
    border-radius: 6px;
    object-fit: contain;
    padding: 2px 6px;
}

.wm-signature-summary-list {
    display: grid;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.wm-signature-summary-row {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    font-size: 0.86rem;
}

.wm-signature-summary-label {
    color: var(--wm-muted);
    font-weight: 700;
}

.wm-signature-summary-value {
    color: var(--wm-text);
    word-break: break-word;
}

.wm-signature-fields-panel:not([hidden]) {
    margin-top: 4px;
    border: 1px solid var(--wm-line);
    border-radius: 12px;
    background: #fff;
    padding: 12px;
}

.wm-signature-carousel {
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    gap: 8px;
    align-items: center;
    padding: 0;
}

.wm-signature-fields-panel {
    display: grid;
    gap: 14px;
    max-height: min(38vh, 380px);
    overflow: auto;
    padding-right: 4px;
}

.wm-signature-fields-panel[hidden],
.wm-signature-plain-panel[hidden],
.wm-signature-summary-panel[hidden],
.wm-signature-preview-block[hidden],
.wm-signature-style-block[hidden],
#signature-details-edit[hidden],
#signature-details-done[hidden] {
    display: none !important;
}

.wm-signature-field-group-title {
    margin: 0 0 8px;
    color: var(--wm-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wm-signature-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.wm-signature-field-wide {
    grid-column: 1 / -1;
}

.wm-signature-preview-block .wm-signature-preview {
    max-height: min(34vh, 360px);
}

.wm-signature-workspace {
    display: none;
}

.wm-signature-fields-col,
.wm-signature-preview-col {
    min-width: 0;
}

@media (max-width: 760px) {
    .wm-signature-field-grid {
        grid-template-columns: 1fr;
    }
}

.wm-signature-carousel-arrow {
    width: 36px;
    height: 36px;
    border: 1px solid var(--wm-line);
    border-radius: 50%;
    background: #fff;
    color: var(--wm-text);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.wm-signature-carousel-arrow:hover {
    background: #f8fafc;
}

.wm-signature-carousel-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 4px 2px 8px;
    scrollbar-width: thin;
}

.wm-signature-carousel-item {
    flex: 0 0 108px;
    scroll-snap-align: start;
    display: grid;
    gap: 6px;
    justify-items: center;
    border: 1px solid var(--wm-line);
    border-radius: 12px;
    background: #fff;
    padding: 10px 8px;
    cursor: pointer;
    font-family: inherit;
}

.wm-signature-carousel-item:hover {
    border-color: #93c5fd;
}

.wm-signature-carousel-item.is-selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    background: #eff6ff;
}

.wm-signature-carousel-thumb {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
}

.wm-signature-carousel-item.is-selected .wm-signature-carousel-thumb {
    background: #dbeafe;
    color: #1d4ed8;
}

.wm-signature-carousel-name {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--wm-text);
    text-align: center;
}

.wm-signature-field {
    display: grid;
    gap: 5px;
}

.wm-signature-field label,
.wm-signature-plain-label,
.wm-signature-preview-label {
    margin: 0;
    color: var(--wm-muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.wm-signature-field input,
.wm-signature-field textarea {
    width: 100%;
    padding: 9px 11px;
    border: 1px solid var(--wm-line);
    border-radius: var(--wm-radius-sm);
    font-size: 0.88rem;
    font-family: inherit;
    box-sizing: border-box;
}

.wm-signature-field textarea {
    min-height: 72px;
    resize: vertical;
    line-height: 1.4;
}

.wm-signature-photo-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wm-signature-photo-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--wm-line);
}

.wm-signature-photo-thumb.is-logo {
    width: auto;
    max-width: 96px;
    height: 36px;
    border-radius: 6px;
    object-fit: contain;
    background: #fff;
    padding: 2px 6px;
}

.wm-signature-plain-panel {
    display: grid;
    gap: 8px;
}

.wm-signature-plain-panel[hidden] {
    display: none !important;
}

.wm-signature-editor-body-wrap {
    margin: 0;
    min-height: 180px;
    max-height: 32vh;
}

.wm-signature-editor-body-wrap .gmail-compose-body {
    min-height: 180px;
    max-height: 32vh;
}

.wm-signature-plain-tools {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.wm-signature-preview {
    min-height: 180px;
    max-height: min(42vh, 420px);
    overflow: auto;
    padding: 14px;
    border: 1px solid var(--wm-line);
    border-radius: 12px;
    background: #fafafa;
}

.wm-signature-preview-empty {
    color: var(--wm-muted);
    font-size: 0.84rem;
}

.wm-signature-footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding: 12px 18px 0;
    border-top: 1px solid var(--wm-line);
}

.wm-signature-auto-insert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.84rem;
    color: var(--wm-text);
}

.wm-signature-auto-insert input {
    width: auto;
}

.wm-signature-footer-actions {
    display: flex;
    gap: 8px;
}

.wm-signature-editor-error {
    margin: 8px 18px 0;
}

@media (max-width: 760px) {
    .wm-signature-field-grid {
        grid-template-columns: 1fr;
    }
}

.wm-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.gmail-compose-body img {
    max-width: 180px;
    height: auto;
}


.gmail-mobile-folder-bar {
    display: none;
}

/* ===== Gmail-like mobile shell (businessmail) ===== */
.wm-mobile-menu-btn,
.wm-mobile-compose-fab,
.wm-mobile-backdrop {
    display: none;
}

@media (max-width: 900px) {
    .wm-sidebar-toggle {
        display: none !important;
    }

    .wm-app,
    .wm-app.is-sidebar-expanded {
        grid-template-columns: 1fr;
    }

    .wm-mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        border: 0;
        border-radius: 50%;
        background: transparent;
        color: #5f6368;
        cursor: pointer;
        margin-right: 2px;
    }

    .wm-mobile-menu-btn:hover,
    .wm-mobile-menu-btn:focus-visible {
        background: rgba(60, 64, 67, 0.08);
        outline: none;
    }

    .wm-mobile-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(32, 33, 36, 0.46);
        border: 0;
        padding: 0;
        margin: 0;
        cursor: pointer;
    }

    .wm-mobile-backdrop[hidden] {
        display: none !important;
    }

    .wm-app {
        grid-template-columns: 1fr;
        min-height: 100dvh;
    }

    .wm-sidebar {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(244px, 73vw);
        min-width: 0;
        max-width: min(244px, 73vw);
        z-index: 100;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.22);
        min-height: 100dvh;
    }

    body.wm-mobile-nav-open .wm-sidebar {
        transform: translateX(0);
    }

    /* Mobile drawer sized for easy touch (~25% larger than compact) */
    .wm-sidebar .wm-compose-btn {
        display: none !important;
    }

    .wm-sidebar {
        width: min(244px, 73vw);
    }

    .wm-sidebar-logo-panel {
        display: block !important;
        padding: 12px 12px 8px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .wm-sidebar .wm-brand-logo {
        display: none !important;
    }

    .wm-sidebar .wm-brand-icon {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.12);
        color: #e2e8f0;
    }

    .wm-sidebar .wm-brand-icon svg {
        width: 22px;
        height: 22px;
    }

    .wm-sidebar-body {
        padding: 8px 8px 12px;
    }

    .wm-nav-section {
        margin-bottom: 14px;
    }

    .wm-nav-heading {
        font-size: 0.72rem;
        padding: 0 10px 6px;
    }

    .wm-folder-nav a {
        padding: 11px 12px;
        font-size: 1rem;
        gap: 10px;
        border-radius: 10px;
        min-height: 44px;
        align-items: center;
    }

    .wm-folder-icon {
        font-size: 1.05rem;
        width: 1.35rem;
        text-align: center;
    }

    .wm-folder-badge {
        font-size: 0.75rem;
        padding: 2px 7px;
        min-width: 20px;
    }

    .wm-label-add {
        width: 26px;
        height: 26px;
        font-size: 1rem;
    }

    .wm-nav-empty {
        font-size: 0.85rem;
        padding: 8px 10px;
    }


    body.wm-mobile-nav-open {
        overflow: hidden;
    }

    .wm-topbar {
        position: sticky;
        top: 0;
        z-index: 40;
        gap: 6px;
        padding: 8px 10px;
        min-height: 56px;
    }

    .wm-search {
        flex: 1;
        min-width: 0;
        max-width: none;
    }

    .wm-user-text,
    .wm-account-caret {
        display: none !important;
    }

    .wm-user-chip {
        padding: 2px;
        gap: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .wm-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }

    /* Hide settings menus on mobile — keep Sign out only */
    .wm-account-menu-desktop-only {
        display: none !important;
    }

    .wm-account-menu {
        right: 8px;
        min-width: 160px;
    }

    .wm-mobile-compose-fab {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        right: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        width: 56px;
        height: 56px;
        border: 0;
        border-radius: 16px;
        background: #c2e7ff;
        color: #001d35;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.14);
        z-index: 50;
        cursor: pointer;
    }

    body.gmail-compose-open .wm-mobile-compose-fab,
    body.wm-mobile-nav-open .wm-mobile-compose-fab {
        display: none !important;
    }

    /* One pane at a time like Gmail mobile */
    .gmail-split-layout {
        display: block !important;
        height: auto;
        min-height: calc(100dvh - 56px);
    }

    .gmail-split-list,
    .gmail-split-reading {
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        min-height: calc(100dvh - 56px);
        border: 0 !important;
    }

    .gmail-split-layout:has(.gmail-open) .gmail-split-list {
        display: none !important;
    }

    .gmail-split-layout:has(.gmail-reading-empty) .gmail-split-reading,
    .gmail-split-layout:not(:has(.gmail-open)) .gmail-split-reading {
        display: none !important;
    }

    .gmail-split-layout:has(.gmail-open) .gmail-split-reading {
        display: block !important;
    }

    /* Hide list toolbar (refresh + pagination) on mobile */
    .gmail-toolbar {
        display: none !important;
    }

    /* Folder title fills former toolbar gap; taller rows */
    .gmail-mobile-folder-bar {
        display: flex !important;
        align-items: center;
        min-height: 44px;
        padding: 6px 14px 8px;
        background: #fff;
        border-bottom: 1px solid #e8eaed;
        flex-shrink: 0;
    }

    .gmail-mobile-folder-title {
        margin: 0;
        font-size: 1.25rem;
        font-weight: 700;
        color: #202124;
        letter-spacing: -0.01em;
        line-height: 1.2;
    }

    .gmail-inbox,
    .gmail-split-layout {
        border-radius: 0 !important;
    }

    .gmail-inbox .gmail-row,
    .gmail-row {
        min-height: 96px !important;
        padding-top: 16px !important;
        padding-bottom: 16px !important;
        align-items: center;
    }

    .gmail-col-sender {
        font-size: 1.02rem;
    }

    .gmail-col-line {
        font-size: 0.95rem;
    }

    .gmail-snippet {
        -webkit-line-clamp: 2;
    }

    /* Mobile inbox dates: hide year; JS shows time-only for today */
    .gmail-inbox-date-year {
        display: none !important;
    }

    .gmail-inbox-date-primary {
        white-space: nowrap;
    }

    /* Hide message checkboxes on mobile */
    .gmail-col-check,
    .gmail-check-label,
    .gmail-check-input {
        display: none !important;
    }

    .gmail-inbox .gmail-row {
        grid-template-columns: 36px 1fr 56px !important;
    }

    .gmail-inbox .gmail-col-star {
        grid-column: 1 !important;
        grid-row: 1 / 3 !important;
    }

    .gmail-inbox .gmail-col-sender {
        grid-column: 2 !important;
        grid-row: 1 !important;
    }

    .gmail-inbox .gmail-col-line {
        grid-column: 2 !important;
        grid-row: 2 !important;
    }

    .gmail-inbox .gmail-col-date {
        grid-column: 3 !important;
        grid-row: 1 !important;
    }

    .gmail-open-toolbar {
        position: sticky;
        top: 0;
        z-index: 25;
        background: #fff;
        padding-left: 4px;
        padding-right: 4px;
    }

    .gmail-open-toolbar-main .gmail-icon-btn:nth-child(n+6),
    .gmail-open-toolbar-meta {
        display: none !important;
    }

    .gmail-row {
        min-height: 96px;
        padding-top: 16px;
        padding-bottom: 16px;
    }

    .gmail-col-sender {
        font-size: 0.95rem;
    }

    .gmail-snippet {
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* Full-screen compose on phones */
    .gmail-compose-window {
        --compose-gap: 0 !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100dvh !important;
        max-height: none !important;
        border-radius: 0 !important;
        border: 0 !important;
    }

    .gmail-compose.is-docked .gmail-compose-window,
    .gmail-compose.is-minimized .gmail-compose-window {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100dvh !important;
    }

    .gmail-compose-header-btn#gmail-compose-minimize,
    .gmail-compose-header-btn#gmail-compose-fullscreen {
        display: none !important;
    }

    .gmail-compose-toolbar-modern .gmail-compose-fmt-group,
    .gmail-compose-toolbar-modern .gmail-compose-fmt-divider,
    .gmail-compose-toolbar-modern [data-open-compose-template-picker],
    .gmail-compose-toolbar-modern [data-compose-signature-insert] {
        display: none !important;
    }

    .gmail-compose-toolbar-modern {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .wm-modal-panel,
    .wm-templates-panel,
    .wm-rules-panel,
    .wm-rule-editor-panel,
    .wm-rule-view-panel,
    .wm-compose-link-panel,
    .wm-signature-panel,
    .wm-template-editor-panel {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }

    .wm-content-inbox {
        padding: 0;
    }

    .gmail-reading-empty {
        display: none !important;
    }
}


/* Multi-account switcher */
.wm-account-switch-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.wm-accounts-nav .wm-account-switch-item {
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--wm-sidebar-text);
}

.wm-accounts-nav .wm-account-switch-item:hover,
.wm-accounts-nav .wm-account-switch-item:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.wm-accounts-nav .wm-account-switch-item.active {
    background: var(--wm-sidebar-active);
    color: #fff;
}

.wm-account-menu-heading {
    padding: 8px 14px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--wm-muted);
}

.wm-account-switch-email {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wm-account-current-tag {
    font-size: 0.68rem;
    color: var(--wm-muted);
    font-weight: 600;
}

.wm-account-menu-item.is-current {
    opacity: 0.75;
    cursor: default;
}

@media (max-width: 900px) {
    .wm-accounts-nav-section {
        display: block !important;
    }
}


.wm-progress-account-icon {
    width: 28px;
    height: 28px;
}

.wm-progress-icon.is-complete .wm-progress-account-icon {
    display: none;
}

.wm-progress-modal.is-error .wm-progress-bar {
    background: linear-gradient(90deg, #f87171 0%, #dc2626 100%);
}


.wm-accounts-subgroup-label {
    padding: 10px 12px 4px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
}

.wm-account-primary-badge {
    display: none;
    background: rgba(20, 184, 166, 0.25) !important;
    color: #5eead4 !important;
}

.wm-account-switch-item.wm-account-primary .wm-folder-label {
    font-weight: 600;
}


/* Accounts list: never show horizontal scrollbar */
.wm-accounts-nav {
    overflow-x: hidden;
    overflow-y: visible;
    max-width: 100%;
}

.wm-accounts-nav .wm-account-switch-item {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.wm-accounts-nav .wm-folder-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.wm-accounts-nav .wm-folder-badge,
.wm-accounts-nav .wm-account-primary-badge {
    flex-shrink: 0;
    white-space: nowrap;
}

.wm-sidebar-scroll,
.wm-sidebar-body,
.wm-nav-section.wm-accounts-nav-section {
    overflow-x: hidden;
    max-width: 100%;
}

.wm-folder-nav {
    overflow-x: hidden;
}

.wm-accounts-nav .wm-account-switch-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wm-accounts-nav .wm-folder-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
    line-height: 1.25;
}

.wm-account-new-count {
    flex-shrink: 0;
    color: #5eead4;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: opacity .2s ease, transform .2s ease;
}

.wm-account-new-count.is-updated {
    animation: wm-account-count-pop 0.45s ease;
}

@keyframes wm-account-count-pop {
    0% { opacity: 0.35; transform: scale(0.85); }
    60% { opacity: 1; transform: scale(1.08); }
    100% { opacity: 1; transform: scale(1); }
}

.wm-accounts-nav .wm-account-switch-item.has-new-mail .wm-folder-label {
    max-width: calc(100% - 2.5rem);
}
