﻿/* wwwroot/css/MaverickMail.css */

/* =========================
   Layout refactor support
   ========================= */

/* Ensure SweetAlert2 displays above our wizard modal overlay */
.swal2-container {
    z-index: 30000 !important;
}

/* Make the document capable of full-height layouts */
html, body {
    height: 100%;
}

body {
    margin: 0; /* remove default browser margin */
}

/* Flex shell: header + main (fills) + footer */
.mm-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Prevent Bootstrap spacing from stealing height */
.navbar {
    margin-bottom: 0 !important; /* your original layout had mb-3; this replaces it */
}

/* Main area fills remaining height */
.mm-main {
    flex: 1 1 auto;
    min-height: 0; /* critical for nested scroll regions */
    display: flex; /* allow inner to stretch */
    background: transparent;
}

/* Small padding around the view content */
.mm-main-inner {
    flex: 1 1 auto;
    min-width: 0; /* critical for wide content */
    min-height: 0;
    padding: 10px; /* <= small padding you asked for */
}

/* Footer stays at bottom, does not overlap content */
.mm-footer {
    flex: 0 0 auto;
}

/* =========================
   Email Manager page styles
   (from your HTML page; safe to keep globally)
   ========================= */

:root {
    --bg: #f3f4f6;
    --panel: #ffffff;
    --panel2: #fbfbfc;
    --border: #e5e7eb;
    --border2: #edf0f4;
    --text: #111827;
    --muted: #6b7280;
    --muted2: #9aa3af;
    --btn: #ffffff;
    --btnHover: #f9fafb;
    --shadow: 0 1px 0 rgba(17,24,39,.03);
    --radius: 10px;
    --sidebarW: 320px;
    --selBg: #eef2f7;
    --selBorder: #e6ebf3;
    --hover: #f5f6f8;
    --indent: 18px;
    --colHeaderBg: #fbfbfc;
    --pillBg: #f3f4f6;
}

/*
  IMPORTANT CHANGE vs your standalone HTML:
  The .app now fills the available RenderBody area
  (mm-main-inner provides the small padding).
*/
.app {
    width: 100%;
    height: 100%;
    margin: 0; /* remove the “20px auto” centering */
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

/* Header */
.topbar {
    height: 72px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fbfbfc;
    border-bottom: 1px solid var(--border);
}

.titleWrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 280px;
}

.title {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: .2px;
}

.subtitle {
    font-size: 13px;
    color: var(--muted);
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--btn);
    color: #111827;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

    .btn:hover {
        background: var(--btnHover);
    }

    .btn:disabled {
        opacity: .6;
        cursor: not-allowed;
    }

    .btn svg {
        width: 16px;
        height: 16px;
        color: #6b7280;
    }

/* Body */
.body {
    flex: 1;
    display: flex;
    min-height: 0;
    background: var(--bg);
}

/* Sidebar */
.sidebar {
    width: var(--sidebarW);
    background: var(--panel2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebarHeader {
    padding: 14px 16px;
    font-weight: 700;
    border-bottom: 1px solid var(--border2);
    background: #ffffff;
}

.tree {
    padding: 10px 0;
    overflow: auto;
}

/* =========================
   FIX: Sidebar tree rows must NOT use Bootstrap .row
   Use .mm-tree-row instead.
   ========================= */

.mm-tree-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    /* Critical: prevent wrapping that pushes the count below */
    flex-wrap: nowrap;
    padding: 9px 14px 9px 10px;
    margin: 0 10px;
    border-radius: 10px;
    cursor: pointer;
    color: #1f2937;
    border: 1px solid transparent;
}

    .mm-tree-row:hover {
        background: var(--hover);
    }

    .mm-tree-row.selected {
        background: var(--selBg);
        border-color: var(--selBorder);
    }

    /* Ensure left side can shrink and ellipsis instead of wrapping */
    .mm-tree-row .left {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0; /* allows ellipsis */
        flex: 1 1 auto; /* take remaining space */
    }

    /* Ensure label never forces the right side onto another line */
    .mm-tree-row .label {
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Ensure the count never wraps / drops */
    .mm-tree-row .meta {
        flex: 0 0 auto; /* do not shrink into a wrap */
        white-space: nowrap; /* keep “2” on same line */
        line-height: 1; /* avoid extra vertical gap */
    }

.chev {
    width: 16px;
    height: 16px;
    color: #9aa3af;
    flex: 0 0 auto;
}

.indent-0 {
    padding-left: 0px;
}

.indent-1 {
    padding-left: calc(var(--indent) * 1);
}

.indent-2 {
    padding-left: calc(var(--indent) * 2);
}

/* Icons */
.icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: #94a3b8;
}

.iconHost {
    color: #64748b;
}

.iconUser {
    color: #0f172a;
    opacity: .75;
}

.iconFolder {
    color: #f59e0b;
}

/* Main area */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    background: var(--bg);
}

.mainPadding {
    padding: 16px 16px 18px 16px;
    width: 100%;
    height: 100%;
    display: flex;
    min-height: 0;
}

.mainPanel {
    flex: 1;
    border-radius: 8px;
    background: var(--bg);
    display: flex;
    min-height: 0;
    overflow: hidden;
}

.col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

.divider {
    width: 1px;
    background: var(--border);
}

.colHeader {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--colHeaderBg);
}

.colTitle {
    font-weight: 700;
    font-size: 13px;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.pill {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--pillBg);
    border: 1px solid var(--border);
    color: var(--muted);
    font-weight: 600;
    flex: 0 0 auto;
}

.colBody {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 10px 10px 12px 10px;
}

.emptyState {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--muted);
    text-align: center;
    transform: translateY(-10px);
}

    .emptyState .label2 {
        font-size: 14px;
        color: #7b8592;
    }

.mailIcon {
    width: 58px;
    height: 58px;
    color: #c6ceda;
    opacity: .9;
}

/* Email list */
.emailItem {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 0 0 10px 0;
    cursor: pointer;
}

    .emailItem:hover {
        background: #fafafa;
    }

    .emailItem.selected {
        border-color: #cbd5e1;
        box-shadow: 0 0 0 2px rgba(203,213,225,.35) inset;
    }

.emailTop {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.emailSubject {
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.emailDate {
    font-size: 12px;
    color: var(--muted2);
    flex: 0 0 auto;
}

.emailFrom {
    font-size: 12.5px;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emailSnippet {
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.showMoreWrap {
    display: flex;
    justify-content: center;
    padding: 8px 0 2px 0;
}

.showMoreBtn {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
}

    .showMoreBtn:hover {
        background: var(--btnHover);
    }

/* Email viewer */
.viewerCard {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}

.viewerSubject {
    font-size: 15px;
    font-weight: 900;
    margin: 0 0 10px 0;
}

.viewerMeta {
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

.viewerBody {
    font-size: 13px;
    color: #374151;
    line-height: 1.55;
    white-space: normal;
}

/* Scrollbars */
.tree::-webkit-scrollbar,
.colBody::-webkit-scrollbar {
    width: 10px;
}

.tree::-webkit-scrollbar-thumb,
.colBody::-webkit-scrollbar-thumb {
    background: #e6e9ef;
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.tree::-webkit-scrollbar-track,
.colBody::-webkit-scrollbar-track {
    background: transparent;
}

@media (max-width: 900px) {
    :root {
        --sidebarW: 260px;
    }

    .topbar {
        height: auto;
        gap: 12px;
        flex-wrap: wrap;
    }

    .actions {
        width: 100%;
        justify-content: flex-end;
    }
}
    
/* =========================
   FIX: Stop default template footer from overlaying content
   (site.css often sets .footer { position:absolute; bottom:0; })
   ========================= */

/* =========================
   Footer: in-flow + compact (prevents overlap/bleed)
   Place at very end of MaverickMail.css
   ========================= */

footer.footer,
.footer,
.mm-footer {
    /* keep it in normal flow (beats template absolute/fixed footers) */
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    /* compact sizing */
    padding: 4px 0 !important; /* try 4px; bump to 6px if too tight */
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    /* remove template fixed sizing */
    height: auto !important;
    min-height: 0 !important;
}

/* =========================
   DisplayEmailView only: fixed footer + internal pane scrolling
   ========================= */

.mm-email-page {
    height: 100%;
    overflow: hidden; /* page does not scroll */
}

    .mm-email-page .mm-shell {
        height: 100vh; /* lock layout to viewport */
        min-height: 0;
    }

    /* main area does not scroll; panes inside will */
    .mm-email-page .mm-main,
    .mm-email-page .mm-main-inner {
        overflow: hidden;
    }

    /* allow flex children to shrink so scrollbars appear where intended */
    .mm-email-page .app,
    .mm-email-page .body,
    .mm-email-page .sidebar,
    .mm-email-page .main,
    .mm-email-page .mainPadding,
    .mm-email-page .mainPanel,
    .mm-email-page .col {
        min-height: 0;
    }

    /* Explicit: each pane scrolls independently */
    .mm-email-page .tree {
        overflow: auto;
    }

    .mm-email-page #listBody.colBody {
        overflow: auto;
    }

    .mm-email-page #viewerBody.colBody {
        overflow: auto;
    }

/* =========================
   Column 2 actions + selection UI
   ========================= */

.mm-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Delete button styling (uses your existing .btn base) */
.btn.mm-danger {
    border-color: #fecaca; /* light red border */
}

    .btn.mm-danger:disabled {
        opacity: .45;
    }

/* small bubble number inside Delete */
.mm-selectedCount {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    padding: 0 6px;
    margin-left: 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--pillBg);
    color: var(--muted);
    font-weight: 800;
    font-size: 12px;
}

/* Email list item layout: add checkbox column */
.emailItem {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.emailCheck {
    margin-top: 2px;
    flex: 0 0 auto;
}

    .emailCheck input[type="checkbox"] {
        width: 16px;
        height: 16px;
        cursor: pointer;
    }

.emailContent {
    flex: 1 1 auto;
    min-width: 0;
}

/* Slightly stronger selection indication for multi-select */
.emailItem.selected {
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(148,163,184,.25) inset;
}

/* =========================
   Fix Column 2 header layout
   ========================= */

.colHeader {
    flex-wrap: nowrap; /* prevent wrapping */
}

.mm-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto; /* do not stretch */
}

/* Prevent the folder pill from stretching */
#folderPill {
    flex: 0 0 auto;
}

/* Ensure delete button never stretches */
#deleteBtn {
    flex: 0 0 auto;
}
/* Column 2 action bar layout */
.mm-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
}

.colHeader {
    flex-wrap: nowrap;
}

/* Optional: keep action buttons compact */
#selectAllBtn, #deleteBtn {
    padding: 8px 10px;
}

/* =========================
   Email list: checkbox without pushing content right
   ========================= */

/* Stop using flex layout for the whole card */
.emailItem{
    position: relative;
    display: block;              /* override flex */
    padding-left: 40px;          /* reserve a small gutter for checkbox */
}

/* Pin checkbox in the gutter */
.emailCheck{
    position: absolute;
    left: 12px;
    top: 12px;
    margin: 0;
}

/* Content returns to normal full width */
.emailContent{
    width: 100%;
}

/* =========================
   Disabled button visual consistency
   ========================= */

/* All disabled buttons */
.app .btn:disabled,
.app .btn[disabled] {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    /* Make border visually neutral when disabled */
    border-color: #e5e7eb !important;
    background: #f3f4f6 !important;
    color: #9aa3af !important;
}

/* Ensure Delete keeps red border only when enabled */
.app .btn.mm-danger:not(:disabled) {
    border-color: #fecaca !important;
}

/* =========================
   Home Page: Full-Viewport Layout
   ========================= */

.mm-home-wrapper {
    height: calc(100vh - 120px);
    /* subtract approx header + footer height
       adjust slightly if needed */

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mm-home-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    width: 100%;
    height: 100%;
}

/* Logo scales based on available height */
.mm-home-logo {
    max-height: 90%;
    max-width: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Keep buttons from stretching */
.mm-home-btn {
    white-space: nowrap;
}

/* =========================
   HOME ONLY: lock header/footer, no scroll, content resizes
   ========================= */

/* Prevent page scrolling ONLY on home */
.mm-home-page {
    overflow: hidden;
    height: 100%;
}

    /* Ensure the layout shell is viewport-locked (header top, footer bottom) */
    .mm-home-page .mm-shell {
        height: 100vh;
        min-height: 0;
    }

    /* The main area must not scroll; content must fit */
    .mm-home-page .mm-main {
        overflow: hidden;
    }

    /* IMPORTANT: your mm-main-inner has padding; keep it but prevent it from causing scroll */
    .mm-home-page .mm-main-inner {
        overflow: hidden;
        min-height: 0;
    }

    /* Home view fills the available main-inner space */
    .mm-home-page .mm-home {
        height: 100%;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    /* Title always visible */
    .mm-home-page .mm-home-title {
        flex: 0 0 auto;
    }

    /* Content consumes remaining space and does not overflow */
    .mm-home-page .mm-home-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 40px;
    }

    /* Logo scales to fit remaining space without forcing scroll */
    .mm-home-page .mm-home-logo {
        max-height: 100%;
        max-width: 80%;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .mm-home-page .mm-home-btn {
        white-space: nowrap;
    }

/* =========================
   Global: header + footer fixed, only main content scrolls
   ========================= */

html, body {
    height: 100%;
}

body {
    margin: 0;
    overflow: hidden; /* page never scrolls */
}

/* Shell is viewport-locked */
.mm-shell {
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Main region becomes the ONLY scroll container */
.mm-main {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto; /* main scrolls, not the page */
}

/* Keep your padding wrapper but allow it to size correctly */
.mm-main-inner {
    min-height: 0;
}

/* =========================
   MaintainUserHosts (IMAP Accounts) screen
   ========================= */

.mm-imap-page .mm-main {
    overflow: auto; /* allow this page to scroll if viewport is small */
}

.mm-imap {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 22px 10px;
}

.mm-imap-top {
    margin-bottom: 14px;
}

.mm-imap-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #111827;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

    .mm-imap-back:hover {
        text-decoration: underline;
    }

.mm-imap-backIcon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    color: #111827;
}

.mm-imap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.mm-imap-titleBlock {
    min-width: 0;
}

.mm-imap-title {
    margin: 0;
    font-size: 34px;
    font-weight: 900;
    letter-spacing: .2px;
    color: #0f172a;
}

.mm-imap-subtitle {
    margin-top: 6px;
    font-size: 15px;
    color: #6b7280;
}

.mm-imap-addBtn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #111827;
    background: #111827;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

    .mm-imap-addBtn:hover {
        filter: brightness(1.05);
    }

.mm-imap-plus {
    font-size: 16px;
    line-height: 1;
}

.mm-imap-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 1px 0 rgba(17,24,39,.03);
    padding: 26px;
}

.mm-imap-empty {
    height: 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    color: #6b7280;
}

.mm-imap-emptyIcon {
    width: 56px;
    height: 56px;
    color: #c6ceda;
}

.mm-imap-emptyTitle {
    font-weight: 800;
    color: #4b5563;
    font-size: 15px;
}

.mm-imap-emptySub {
    color: #9aa3af;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 720px) {
    .mm-imap-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* =========================
   IMAP Modal
========================= */

.mm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

    .mm-modal-overlay.active {
        display: flex;
    }

.mm-modal {
    width: 900px;
    max-width: 95%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
    display: flex;
    flex-direction: column;
}

.mm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid #e5e7eb;
}

.mm-modal-title {
    font-weight: 800;
    font-size: 18px;
}

.mm-modal-close {
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
}

.mm-modal-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mm-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.mm-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .mm-form-group label {
        font-size: 13px;
        font-weight: 600;
    }

    .mm-form-group input {
        padding: 10px 12px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
    }

.mm-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.mm-toggle-title {
    font-weight: 700;
}

.mm-toggle-sub {
    font-size: 12px;
    color: #6b7280;
}

/* Switch */
.mm-switch {
    appearance: none;
    width: 42px;
    height: 24px;
    background: #d1d5db;
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    transition: .2s;
}

    .mm-switch:checked {
        background: #111827;
    }

    .mm-switch::after {
        content: "";
        position: absolute;
        top: 3px;
        left: 3px;
        width: 18px;
        height: 18px;
        background: #fff;
        border-radius: 50%;
        transition: .2s;
    }

    .mm-switch:checked::after {
        transform: translateX(18px);
    }

.mm-modal-footer {
    padding: 18px 22px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.mm-btn-primary {
    padding: 10px 16px;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    border: none;
    font-weight: 700;
}

.mm-btn-secondary {
    padding: 10px 16px;
    border-radius: 8px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

/* =========================
   Subscribe Wizard Modal
   ========================= */

.mm-wiz-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2500;
}

    .mm-wiz-overlay.active {
        display: flex;
    }

.mm-wiz {
    width: 980px;
    max-width: 96%;
    max-height: 92vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mm-wiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.mm-wiz-title {
    font-weight: 900;
    font-size: 18px;
}

.mm-wiz-subtitle {
    font-size: 12.5px;
    color: #6b7280;
    margin-top: 2px;
}

.mm-wiz-titleWrap {
    display: flex;
    flex-direction: column;
}

.mm-wiz-close {
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
}

.mm-wiz-progress {
    padding: 10px 20px 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: #fbfbfc;
}

.mm-wiz-progressBar {
    height: 8px;
    background: #eef2f7;
    border-radius: 999px;
    overflow: hidden;
}

.mm-wiz-progressFill {
    height: 100%;
    width: 0%;
    background: #111827;
    border-radius: 999px;
    transition: width .2s ease;
}

.mm-wiz-steps {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    color: #6b7280;
    font-size: 12px;
}

.mm-wiz-stepPill {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-weight: 700;
}

    .mm-wiz-stepPill.active {
        border-color: #111827;
        color: #111827;
    }

.mm-wiz-body {
    padding: 14px 16px;
    overflow: auto;
    min-height: 0;
}

.mm-wiz-step {
    display: none;
}

    .mm-wiz-step.active {
        display: block;
    }

.mm-wiz-stepTitle {
    font-weight: 900;
    font-size: 16px;
    margin-bottom: 12px;
    color: #0f172a;
}

.mm-wiz-note {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    background: #fbfbfc;
    border-radius: 10px;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 14px;
}

.mm-fieldError {
    color: #b91c1c;
    font-size: 12px;
    min-height: 16px;
}

.mm-wiz-actionsRow {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.mm-wiz-inlineStatus {
    font-size: 12.5px;
    color: #6b7280;
}

.mm-wiz-verifyBox {
    display: none;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.mm-wiz-verifyTitle {
    font-weight: 900;
    margin-bottom: 6px;
    color: #111827;
}

.mm-wiz-verifyText {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

.mm-wiz-footer {
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #fbfbfc;
}

.mm-wiz-footerRight {
    display: flex;
    gap: 10px;
}

/* Reuse existing mm modal form styles you already added */
.mm-form-group input,
.mm-form-group select {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.mm-imap-mini {
    display: flex;
    gap: 16px;
}

.mm-imap-miniList {
    width: 320px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px;
    background: #fff;
    min-height: 260px;
    max-height: 420px;
    overflow: auto;
}

.mm-imap-miniForm {
    flex: 1;
    min-width: 0;
}

.mm-imap-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    background: #fbfbfc;
}

.mm-imap-itemTop {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.mm-imap-itemName {
    font-weight: 900;
    font-size: 13px;
    color: #111827;
}

.mm-imap-itemMeta {
    font-size: 12px;
    color: #6b7280;
}

.mm-imap-itemRemove {
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-weight: 800;
    font-size: 12px;
}

.mm-wiz-complete {
    height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
}

.mm-wiz-completeTitle {
    font-weight: 900;
    font-size: 18px;
}

.mm-wiz-completeSub {
    color: #6b7280;
    font-size: 13px;
}

@media (max-width: 900px) {
    .mm-form-grid {
        grid-template-columns: 1fr;
    }

    .mm-imap-mini {
        flex-direction: column;
    }

    .mm-imap-miniList {
        width: 100%;
    }
}
/* =========================
   Wizard Step 2: Two-column layout + Square card area
   ========================= */

.mm-wiz-twoCol {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 18px;
    align-items: start;
}

.mm-wiz-left,
.mm-wiz-right {
    min-width: 0;
}

.mm-pay-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    background: #fbfbfc;
}

.mm-pay-title {
    font-weight: 900;
    font-size: 13px;
    color: #111827;
    margin-bottom: 10px;
}

/* Payment wrapper spacing */
/* Payment wrapper */
.mm-pay-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px; /* slightly tighter spacing */
    width: 100%;
}

/* Square card container */
.mm-pay-squareCard {
    width: 100%;
    min-height: auto; /* remove fixed minimum */
    padding: 8px 5px; /* reduce internal padding */
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
}

    /* Remove bottom margin Square sometimes injects */
    .mm-pay-squareCard iframe {
        margin-bottom: 0 !important;
    }

/* Step 2 needs more vertical room without feeling cramped */
.mm-wiz-step[data-step="2"] .mm-form-grid {
    gap: 10px;
}

/* Responsive: stack payment below address */
@media (max-width: 900px) {
    .mm-wiz-twoCol {
        grid-template-columns: 1fr;
    }
}

/* Wizard Step 1: single-column grouping */
.mm-wiz-group {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}

/* Use a tighter grid for Step 1 so it fits well */
.mm-wiz-step[data-step="1"] .mm-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* On narrower screens, stack fields */
@media (max-width: 900px) {
    .mm-wiz-step[data-step="1"] .mm-form-grid {
        grid-template-columns: 1fr;
    }
}

.treeRow {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    cursor: pointer;
    user-select: none;
}

.treeIndent {
    flex: 0 0 auto;
}

.treeChevron {
    width: 18px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #111;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

    .treeChevron.isDisabled {
        opacity: 0.25;
        cursor: default;
    }

.treeIcon {
    flex: 0 0 auto;
    display: inline-flex;
}

.treeContent {
    flex: 1 1 auto;
    min-width: 0;
}

.treeLabel {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.treeMeta {
    font-size: 12px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mm-search {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mm-searchInput {
    height: 30px;
    padding: 0 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    width: 220px;
}

    .mm-searchInput:focus {
        outline: none;
        border-color: #6366f1;
        box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
    }

.mm-empty {
    padding: 18px;
    color: #6b7280;
}

.mm-emptyIcon {
    font-size: 28px;
    margin-bottom: 8px;
    opacity: .7;
}

.mm-emptyTitle {
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.mm-emptySub {
    font-size: 13px;
}