/* Organisation menu, domain wizard and footer toggles.
   Plain CSS: the Tailwind build cannot run on the server. */
[x-cloak] { display: none !important; }

/* ---------- Darker text in every tab ----------
   Pale grey text is moved a step or two darker on light backgrounds.
   Dark areas (menus, top bars, dark cards) keep their light text. */
:is(.gm-app, .gm-wizard) :is(.text-slate-400, .text-gray-400):not(:is(.gm-side, .gm-topbar-dark, .gm-rail, .gm-admin-rail, .zm-rail, .bg-slate-800, .bg-slate-900, .bg-slate-950, .from-teal-600, .from-slate-900:not(.gm-light-card)) *) { color: #475569; }
:is(.gm-app, .gm-wizard) :is(.text-slate-500, .text-gray-500):not(:is(.gm-side, .gm-topbar-dark, .gm-rail, .gm-admin-rail, .zm-rail, .bg-slate-800, .bg-slate-900, .bg-slate-950, .from-teal-600, .from-slate-900:not(.gm-light-card)) *) { color: #334155; }
:is(.gm-app, .gm-wizard) :is(.text-slate-600, .text-gray-600, .text-slate-700, .text-gray-700):not(:is(.gm-side, .gm-topbar-dark, .gm-rail, .gm-admin-rail, .zm-rail, .bg-slate-800, .bg-slate-900, .bg-slate-950, .from-teal-600, .from-slate-900:not(.gm-light-card)) *) { color: #1e293b; }
:is(.gm-app, .gm-wizard) :is(.text-slate-400, .text-slate-500, .text-slate-600, .text-gray-400, .text-gray-500, .text-gray-600):not(.font-medium, .font-semibold, .font-bold, :is(.gm-side, .gm-topbar-dark, .gm-rail, .gm-admin-rail, .zm-rail, .bg-slate-800, .bg-slate-900, .bg-slate-950, .from-teal-600, .from-slate-900:not(.gm-light-card)) *) { font-weight: 500; }
:is(.gm-app, .gm-wizard) :is(input, textarea):not(:is(.gm-side, .gm-topbar-dark, .gm-rail, .gm-admin-rail, .zm-rail) *)::placeholder { color: #64748b; opacity: 1; }

/* Pale greys set directly in the theme and admin styles */
.gm-app .gm-endpoints-head p,
.gm-app .gm-endpoint-hint,
.gm-app .gm-gs-sub,
.gm-app .gm-gs-note,
.gm-app .zm-users-email,
.gm-app .zm-metric-label,
.gm-app .zm-org-meta .k,
.gm-app .zm-modal-hint { color: #475569; }
.gm-app .gm-light-card p.uppercase,
.gm-app .gm-light-card [class*="text-teal-100"],
.gm-app .gm-light-card [class*="text-teal-50"],
.gm-app .gm-list-pane .sticky { color: #475569 !important; }

/* ---------- Organisation menu ---------- */
.gm-appnav {
    border-radius: 14px;
    background: #fff;
    box-shadow: inset 0 0 0 1px #dbe2ec;
}
.gm-appnav summary {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 8px 14px;
    color: #0b1220;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.gm-appnav summary::-webkit-details-marker { display: none; }
.gm-appnav-burger { flex: 0 0 20px; color: #b47204; }
.gm-appnav-title { display: flex; flex: 1; flex-direction: column; min-width: 0; line-height: 1.25; }
.gm-appnav-title span { font-size: 12px; color: #64748b; }
.gm-appnav-title strong {
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gm-appnav-chevron { flex: 0 0 18px; color: #64748b; transition: transform .25s ease; }
.gm-appnav[open] .gm-appnav-chevron { transform: rotate(180deg); }
.gm-appnav-panel {
    max-height: 70vh;
    overflow-y: auto;
    padding: 4px 14px 14px;
    border-top: 1px solid #edf1f6;
}
.gm-appnav-groups { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.gm-appnav-group {
    margin: 12px 0 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #94712a;
}
.gm-appnav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    text-decoration: none;
    transition: background .2s ease;
}
.gm-appnav-link svg { flex: 0 0 18px; color: #64748b; }
.gm-appnav-link:hover { background: #f1f5f9; }
.gm-appnav-link.is-active { background: #fbf6ea; font-weight: 700; color: #0b1220; }
.gm-appnav-link.is-active svg { color: #b47204; }
.gm-appnav-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #edf1f6;
}
.gm-appnav-mail {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    background: #0b1220;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}
.gm-appnav-exit {
    min-height: 44px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
}

/* Inside the workspace the wrapper already gives the white strip. */
.gm-orgnav-mobile { padding: 8px 12px; }

/* ---------- Domain wizard ---------- */
.gm-wizard { width: 100%; max-width: 48rem; margin-inline: auto; padding: 16px 16px 40px; }
.gm-wizard-head { margin: 22px 0 18px; }
.gm-wizard-head h1 { margin: 0; font-size: 1.75rem; font-weight: 700; color: #0b1220; }
.gm-wizard-head p { margin: 6px 0 0; font-size: 1rem; line-height: 1.5; color: #475569; }
.gm-wizard-trial {
    display: inline-block;
    margin-top: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #fbf6ea;
    font-size: 13px;
    font-weight: 600;
    color: #8a5a08;
}
.gm-steps { margin-bottom: 16px; }
.gm-steps-text { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 8px; font-size: 14px; }
.gm-steps-text strong { color: #0b1220; }
.gm-steps-text span { color: #64748b; white-space: nowrap; }
.gm-steps-bar { display: grid; gap: 4px; grid-auto-columns: 1fr; grid-auto-flow: column; }
.gm-steps-bar i { height: 6px; border-radius: 999px; background: #e2e8f0; }
.gm-steps-bar i.is-done { background: #0d9488; }
.gm-steps-bar i.is-now { background: #e7ae23; }
.gm-wizard-input { font-size: 16px !important; } /* below 16px iPhones zoom the page in */

/* DNS steps: only the step at hand stays open */
.gm-dns-toggle { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; color: #64748b; }
.gm-dns-toggle svg { transition: transform .25s ease; }
.gm-dns-toggle.is-open svg { transform: rotate(180deg); }

/* An old message stays faded for the moment the new one loads */
.gm-reader-busy > :not(.gm-reader-back) { opacity: .25; transition: opacity .1s ease; }

/* ---------- Add to home screen hint (iPhone) ---------- */
.gm-pwa-hint {
    display: flex;
    flex-shrink: 0;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 8px 10px 14px;
    border-bottom: 1px solid #f2dfae;
    background: #fbf6ea;
    color: #1e293b;
}
.gm-pwa-hint[hidden] { display: none; }
.gm-pwa-hint p { flex: 1; margin: 0; font-size: 14px; line-height: 1.4; }
.gm-pwa-hint button { flex: 0 0 36px; height: 36px; font-size: 15px; color: #475569; }
.gm-pwa-hint .gm-push-yes { flex: 0 0 auto; padding: 0 16px; border-radius: 10px; background: #0f2135; font-weight: 700; color: #fff; }

/* ---------- Webmail on phones ---------- */
.gm-phone-only, .gm-rail-label, .gm-drawer-backdrop { display: none; }

@media (max-width: 767px) {
    .gm-hide-phone { display: none !important; }
    .gm-phone-only { display: flex; }
    body.gm-app:has(.gm-rail) { height: 100dvh; }
    body.gm-app:has(.gm-rail) > .flex.h-full { padding-bottom: 60px; }

    /* Left icons become a bottom bar with names */
    .gm-rail {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 40;
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: space-around;
        gap: 0;
        padding: 0 2px;
        border-top: 1px solid rgba(255, 255, 255, .1);
    }
    .gm-rail .gm-rail-tile {
        flex: 1 1 0;
        flex-direction: column;
        gap: 2px;
        width: auto;
        min-width: 0;
        height: 52px;
        background: transparent !important;
        box-shadow: none;
        opacity: .68;
    }
    .gm-rail .gm-rail-tile-active { opacity: 1; background: rgba(255, 255, 255, .12) !important; }
    .gm-rail-label { display: block; font-size: 10px; font-weight: 600; line-height: 1.1; }

    /* Top bar: menu, search, initial */
    .gm-topbar-dark { gap: 8px; padding-inline: 8px; }
    .gm-topbar-burger { flex: 0 0 40px; align-items: center; justify-content: center; height: 40px; color: #fff; }

    /* Folders slide in from the left */
    .gm-mail-drawer {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 45;
        display: flex !important;
        width: min(84vw, 320px) !important;
        min-width: 0 !important;
        max-width: none !important;
        transform: translateX(-105%);
        transition: transform .25s ease;
    }
    html.gm-drawer-open .gm-mail-drawer { transform: none; }
    .gm-drawer-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(15, 23, 42, .5); }
    .gm-mail-drawer nav button { min-height: 44px; font-size: 15px; }
    .gm-drawer-foot {
        flex-direction: column;
        flex-shrink: 0;
        padding: 8px 12px 12px;
        border-top: 1px solid rgba(255, 255, 255, .12);
    }
    .gm-drawer-foot > * { padding: 10px 8px; font-size: 14px; font-weight: 600; text-align: left; color: rgba(255, 255, 255, .85); }

    /* List, then a tapped message takes the whole screen */
    .gm-list-pane input[type="checkbox"],
    .gm-list-pane .border-b > button[wire\:click="selectAllVisible"] { display: none; }
    .gm-list-pane .h-10 { height: 48px; }
    .gm-list-pane .h-7.w-7 { width: 38px; height: 38px; }
    .gm-list-pane [role="button"] { padding-block: 14px; }
    .gm-list-pane [role="button"] p.truncate { font-size: 15px; }
    /* On the page root, because every server update repaints the mail area */
    html.gm-reading .gm-list-pane { display: none !important; }
    /* The whole message scrolls as one: title, text, then comments and buttons at the end */
    html.gm-reading .gm-reader-pane { display: block !important; width: 100%; min-width: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #fff; }
    .gm-reader-pane .gm-reader-scroll { flex: none; overflow: visible; padding: 0; background: #fff; }
    .gm-reader-pane .gm-reader-body { max-width: none; padding: 12px 16px; border-radius: 0; box-shadow: none !important; }
    .gm-reader-pane .gm-mail-frame { display: block; min-height: 120px; border: 0; border-radius: 0; }
    .gm-reader-pane .gm-reader-body pre { font-size: 16px; line-height: 1.5; }
    .gm-reader-move { display: none; }
    html.gm-tools-open .gm-reader-move { display: flex; }
    .gm-reader-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 12px 16px 20px; }
    .gm-reader-actions button { min-height: 44px; padding: 8px 6px; border-radius: 10px; background: #f1f5f9; font-size: 14px; }
    html.gm-reading .gm-fab { display: none !important; }
    .gm-reader-back {
        position: sticky;
        top: 0;
        z-index: 10;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
        gap: 8px;
        min-height: 48px;
        padding: 0 8px;
        border-bottom: 1px solid #e2e8f0;
        background: #fff;
        color: #0f172a;
    }
    .gm-reader-back > button { display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 6px; font-size: 15px; font-weight: 600; }
    .gm-reader-wait { font-size: 13px; color: #475569; }
    .gm-reader-tools { display: none; width: 100%; }
    html.gm-tools-open .gm-reader-tools { display: flex; }
    .gm-reader-tools button { padding: 8px 10px; font-size: 13px; }

    /* Pull down to refresh */
    .gm-list-scroll { overscroll-behavior-y: contain; }
    .gm-pull { flex-shrink: 0; align-items: center; justify-content: center; overflow: hidden; background: #f1f5f9; font-size: 13px; font-weight: 600; color: #334155; }

    /* Round button for a new email */
    .gm-fab {
        position: fixed;
        right: 16px;
        bottom: 76px;
        z-index: 35;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 56px;
        border-radius: 999px;
        background: #2b7de9;
        color: #fff;
        box-shadow: 0 8px 20px rgba(15, 39, 68, .35);
    }
}

/* ---------- Footer toggles ---------- */
.gm-fgroup-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-align: left;
}
.gm-fgroup-btn svg { display: none; color: #94a3b8; transition: transform .25s ease; }

@media (max-width: 767px) {
    /* iPhones zoom the whole page on fields below 16px and stay zoomed,
       which cuts everything off on the right after the sign-up form. */
    input, select, textarea { font-size: 16px !important; }

    .gm-footer-main { padding-block: 2.25rem 1rem !important; }
    .gm-fgrid { gap: 0 !important; margin-top: 1.5rem !important; }
    .gm-fgroup { border-top: 1px solid rgba(255, 255, 255, .1); }
    .gm-fgrid .gm-fgroup:last-child { border-bottom: 1px solid rgba(255, 255, 255, .1); }
    .gm-fgroup--narrow { border-top: 0; }
    .gm-fgroup-btn { min-height: 52px; }
    .gm-fgroup-btn svg { display: block; }
    .gm-fgroup-list { display: none; margin: 0 !important; padding-bottom: 1rem; }
    .gm-fgroup.is-open .gm-fgroup-list { display: block; }
    .gm-fgroup.is-open nav.gm-fgroup-list { display: flex; }
    .gm-fgroup.is-open .gm-fgroup-btn svg { transform: rotate(180deg); }
    .gm-fgroup-list a { display: inline-block; padding-block: 5px; }

    .gm-marketing-header .gm-container { padding-block: .6rem; }
}

/* ---------- Reading on a computer: same logic as the phone ----------
   The whole message scrolls as one and follows the width of the pane;
   the buttons come after the text, then the team comments. */
@media (min-width: 768px) {
    .gm-reader-pane { overflow-y: auto; }
    .gm-reader-pane > * { flex-shrink: 0; }
    .gm-reader-pane .gm-reader-scroll { flex: none; overflow: visible; padding: 0; background: #fff; }
    .gm-reader-pane .gm-reader-body { max-width: none; padding: 16px 20px; border-radius: 0; box-shadow: none !important; }
    .gm-reader-pane .gm-mail-frame { display: block; min-height: 120px; border: 0; border-radius: 0; }
    .gm-reader-pane .gm-reader-body pre { font-size: 15px; line-height: 1.6; }
    .gm-reader-head h1 { flex: 1 0 100%; }
    .gm-reader-pane .gm-reader-actions { order: 1; }
    .gm-reader-pane .gm-reader-comments { order: 2; }
}

@media (min-width: 768px) {
    .gm-appnav-groups { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .gm-fgroup-btn { pointer-events: none; }
    .gm-fgroup--narrow .gm-fgroup-btn { display: none; }
    .gm-wizard { padding: 28px 24px 56px; }
    .gm-wizard-head h1 { font-size: 2.25rem; }
}
