/* ==========================================================================
   TMPMailer — Nebula v2 design system
   Goals: ad-viewability + UX-first + SEO/Core-Web-Vitals friendly.
   Scoped under body.tm2 to avoid collisions with legacy stylesheets.
   ========================================================================== */

body.tm2 {
    --tm-brand:        #4f46e5;
    --tm-brand-2:      #7c3aed;
    --tm-brand-dark:   #3730a3;
    --tm-brand-soft:   #eef2ff;
    --tm-accent:       #f59e0b;
    --tm-bg:           #f5f6fa;
    --tm-surface:      #ffffff;
    --tm-surface-2:    #f8faff;
    --tm-border:       #e5e8f0;
    --tm-border-2:     #d8dcea;
    --tm-ink:          #0f172a;
    --tm-ink-2:        #475569;
    --tm-muted:        #8a94a6;
    --tm-success:      #16a34a;
    --tm-danger:       #dc2626;
    --tm-radius:       14px;
    --tm-radius-lg:    20px;
    --tm-radius-xl:    28px;
    --tm-shadow-sm:    0 1px 2px rgba(15, 23, 42, .05);
    --tm-shadow:       0 6px 24px -6px rgba(15, 23, 42, .10);
    --tm-shadow-lg:    0 24px 60px -12px rgba(15, 23, 42, .18);
    --tm-ring:         0 0 0 4px rgba(79, 70, 229, .16);
    --tm-font-display: 'Poppins', 'Inter', system-ui, sans-serif;
    --tm-font-body:    'Inter', system-ui, -apple-system, sans-serif;
    --tm-font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    margin: 0;
    background: var(--tm-bg);
    color: var(--tm-ink);
    font-family: var(--tm-font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

body.tm2 *, body.tm2 *::before, body.tm2 *::after { box-sizing: border-box; }
body.tm2 img { max-width: 100%; height: auto; }
body.tm2 a { color: var(--tm-brand); text-decoration: none; transition: color .2s ease; }
body.tm2 a:hover { color: var(--tm-brand-dark); }
body.tm2 :focus-visible { outline: none; box-shadow: var(--tm-ring); border-radius: 8px; }
body.tm2 button { font-family: inherit; }

@media (prefers-reduced-motion: reduce) {
    body.tm2 *, body.tm2 *::before, body.tm2 *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Layout primitives ---------- */
.tm2-container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 20px; }
@media (min-width: 768px)  { .tm2-container { padding-inline: 28px; } }
@media (min-width: 1440px) { .tm2-container { max-width: 1240px; } }

.tm2-section { margin-top: 56px; }
@media (min-width: 768px) { .tm2-section { margin-top: 80px; } }

.tm2-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: var(--tm-brand);
}
.tm2-eyebrow::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--tm-brand), var(--tm-brand-2)); }

.tm2-h1, .tm2-h2, .tm2-h3 { font-family: var(--tm-font-display); font-weight: 600; line-height: 1.15; color: var(--tm-ink); margin: 0; letter-spacing: -.02em; }
.tm2-h1 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); }
.tm2-h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
.tm2-h3 { font-size: 1.125rem; }
.tm2-lead { color: var(--tm-ink-2); font-size: clamp(1rem, 1.6vw, 1.125rem); line-height: 1.7; margin: 0; }

.tm2-panel {
    background: var(--tm-surface);
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius-xl);
    box-shadow: var(--tm-shadow-sm);
}

/* ---------- Buttons ---------- */
.tm2-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 12px 22px;
    border: 0; border-radius: 14px; cursor: pointer;
    font-size: 15px; font-weight: 600; line-height: 1;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
    -webkit-tap-highlight-color: transparent; user-select: none;
}
.tm2-btn:active { transform: translateY(1px) scale(.99); }
.tm2-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--tm-brand) 0%, var(--tm-brand-2) 100%);
    box-shadow: 0 10px 24px -8px rgba(79, 70, 229, .55);
}
.tm2-btn-primary:hover { color: #fff; box-shadow: 0 14px 30px -8px rgba(79, 70, 229, .65); transform: translateY(-1px); }
.tm2-btn-soft { color: var(--tm-brand-dark); background: var(--tm-brand-soft); }
.tm2-btn-soft:hover { color: var(--tm-brand-dark); background: #e2e9ff; }
.tm2-btn-ghost { color: var(--tm-ink-2); background: var(--tm-surface-2); border: 1px solid var(--tm-border); }
.tm2-btn-ghost:hover { color: var(--tm-ink); background: var(--tm-surface); border-color: var(--tm-border-2); }
.tm2-btn-danger-ghost { color: var(--tm-danger); background: transparent; }
.tm2-btn-danger-ghost:hover { color: var(--tm-danger); background: #fef2f2; }
.tm2-btn-sm { min-height: 42px; padding: 10px 16px; font-size: 14px; border-radius: 12px; }

/* ---------- Header ---------- */
.tm2-header {
    position: sticky; top: 0; z-index: 60;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.tm2-header.is-scrolled { border-bottom-color: var(--tm-border); box-shadow: 0 8px 30px -12px rgba(15, 23, 42, .12); }
.tm2-header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }

.tm2-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--tm-ink); }
.tm2-brand:hover { color: var(--tm-ink); }
.tm2-brand-mark {
    width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--tm-brand), var(--tm-brand-2));
    box-shadow: 0 8px 18px -6px rgba(79, 70, 229, .55); overflow: hidden; flex: 0 0 auto;
}
.tm2-brand-mark img { width: 26px; height: 26px; object-fit: contain; filter: brightness(0) invert(1); }
.tm2-brand-name { font-family: var(--tm-font-display); font-weight: 700; font-size: 1.22rem; letter-spacing: -.02em; }
.tm2-brand-name b { color: var(--tm-brand); font-weight: 700; }

.tm2-nav { display: none; align-items: center; gap: 4px; }
@media (min-width: 1024px) { .tm2-nav { display: flex; } }
.tm2-nav-link {
    position: relative; display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 14px; border-radius: 12px; border: 0; background: transparent; cursor: pointer;
    font-size: 14.5px; font-weight: 600; color: var(--tm-ink-2);
    transition: color .2s ease, background .2s ease;
}
.tm2-nav-link:hover, .tm2-nav-link.is-active { color: var(--tm-brand-dark); background: var(--tm-brand-soft); }
.tm2-nav-link i { font-size: 11px; transition: transform .2s ease; }

.tm2-popover { position: relative; }
.tm2-popover-menu {
    position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(6px);
    width: min(560px, 92vw); padding: 14px; z-index: 70;
    background: var(--tm-surface); border: 1px solid var(--tm-border); border-radius: 20px;
    box-shadow: var(--tm-shadow-lg);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
.tm2-popover.is-open .tm2-popover-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.tm2-popover.is-open > .tm2-nav-link i { transform: rotate(180deg); }
.tm2-popover-item { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 14px; transition: background .18s ease; }
.tm2-popover-item:hover { background: var(--tm-surface-2); }
.tm2-popover-item .pi { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 11px; background: var(--tm-brand-soft); color: var(--tm-brand); font-size: 15px; }
.tm2-popover-item .pt { font-weight: 600; font-size: 14.5px; color: var(--tm-ink); }
.tm2-popover-item .pd { font-size: 12.5px; color: var(--tm-muted); margin-top: 2px; }

.tm2-header-actions { display: flex; align-items: center; gap: 10px; }
.tm2-locale { position: relative; display: none; }
@media (min-width: 768px) { .tm2-locale { display: block; } }
.tm2-locale select {
    appearance: none; border: 1px solid var(--tm-border); background: var(--tm-surface-2);
    border-radius: 12px; padding: 10px 34px 10px 14px; font-size: 13.5px; font-weight: 600;
    color: var(--tm-ink-2); cursor: pointer; transition: border-color .2s ease, box-shadow .2s ease;
}
.tm2-locale select:hover { border-color: var(--tm-border-2); }
.tm2-locale::after { content: "\f078"; font-family: "Font Awesome 5 Free"; font-weight: 900; font-size: 10px; color: var(--tm-muted); position: absolute; right: 13px; top: 50%; transform: translateY(-50%); pointer-events: none; }

.tm2-header-cta { display: none; }
@media (min-width: 640px) { .tm2-header-cta { display: inline-flex; } }

.tm2-burger {
    width: 46px; height: 46px; border: 1px solid var(--tm-border); border-radius: 13px;
    background: var(--tm-surface); cursor: pointer; display: grid; place-items: center; padding: 0;
}
@media (min-width: 1024px) { .tm2-burger { display: none; } }
.tm2-burger span { display: block; width: 20px; height: 2px; margin: 2.5px 0; border-radius: 2px; background: var(--tm-ink); transition: transform .25s ease, opacity .2s ease; }
.tm2-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.tm2-burger.is-open span:nth-child(2) { opacity: 0; }
.tm2-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.tm2-mobile-menu {
    position: fixed; inset: 68px 0 auto 0; z-index: 55; padding: 10px 20px 22px;
    background: rgba(255,255,255,.97); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--tm-border); box-shadow: var(--tm-shadow-lg);
}
.tm2-mobile-menu a.tm2-mm-link {
    display: flex; align-items: center; gap: 14px; padding: 15px 12px; min-height: 52px;
    border-radius: 14px; color: var(--tm-ink); font-weight: 600; font-size: 16px;
    border-bottom: 1px solid var(--tm-border);
}
.tm2-mobile-menu a.tm2-mm-link:last-of-type { border-bottom: 0; }
.tm2-mobile-menu a.tm2-mm-link:hover, .tm2-mobile-menu a.tm2-mm-link.is-active { background: var(--tm-brand-soft); color: var(--tm-brand-dark); }
.tm2-mobile-menu a.tm2-mm-link .n { font-family: var(--tm-font-mono); font-size: 11px; color: var(--tm-muted); width: 22px; }
.tm2-mobile-menu a.tm2-mm-link i { margin-left: auto; font-size: 13px; color: var(--tm-muted); }
.tm2-mm-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px 0; }
.tm2-mm-foot select { border: 1px solid var(--tm-border); border-radius: 12px; padding: 10px 12px; background: var(--tm-surface-2); font-weight: 600; color: var(--tm-ink-2); }
.tm2-mm-socials { display: flex; gap: 14px; font-size: 18px; }
.tm2-mm-socials a { color: var(--tm-ink-2); }
.tm2-mm-socials a:hover { color: var(--tm-brand); }

/* Mobile menu backdrop overlay */
.tm2-mobile-backdrop {
    position: fixed; inset: 68px 0 0 0; z-index: 54;
    background: rgba(0, 0, 0, .35);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}

/* ---------- Hero ---------- */
.tm2-hero { position: relative; padding: 44px 0 10px; overflow: hidden; }
@media (min-width: 768px) { .tm2-hero { padding: 64px 0 16px; } }
.tm2-hero::before {
    content: ""; position: absolute; inset: -20% -10% auto -10%; height: 560px; z-index: -1;
    background:
        radial-gradient(520px 300px at 12% 20%, rgba(79, 70, 229, .14), transparent 65%),
        radial-gradient(480px 280px at 85% 12%, rgba(124, 58, 237, .12), transparent 65%),
        radial-gradient(420px 260px at 55% 45%, rgba(245, 158, 11, .07), transparent 60%);
    pointer-events: none;
}
.tm2-hero-inner { max-width: 820px; margin-inline: auto; text-align: center; }
.tm2-chips, .tm2-hero-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 20px; }
.tm2-chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px;
    border-radius: 999px; background: var(--tm-surface); border: 1px solid var(--tm-border);
    font-size: 12.5px; font-weight: 600; color: var(--tm-ink-2); box-shadow: var(--tm-shadow-sm);
}
.tm2-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tm-success); box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.tm2-chip i { color: var(--tm-brand); font-size: 12px; }
.tm2-hero .tm2-h1 { margin-top: 6px; }
.tm2-hero .tm2-h1 .grad {
    background: linear-gradient(120deg, var(--tm-brand) 10%, var(--tm-brand-2) 60%, #a855f7 95%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
}
.tm2-hero-sub { max-width: 640px; margin: 18px auto 0; }

/* ---------- Address bar (email actions) ---------- */
.tm2-mailbox { padding: 18px 0 0; }
.tm2-address-card {
    position: relative; padding: 22px; min-height: 140px;
    background: linear-gradient(180deg, var(--tm-surface), var(--tm-surface-2));
    border: 1px solid var(--tm-border); border-radius: var(--tm-radius-xl);
    box-shadow: var(--tm-shadow); width: 100%;
}
@media (min-width: 768px) { .tm2-address-card { padding: 26px 28px; } }
.tm2-address-card::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 5px;
    border-radius: var(--tm-radius-xl) 0 0 var(--tm-radius-xl);
    background: linear-gradient(180deg, var(--tm-brand), var(--tm-brand-2));
}
.tm2-address-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tm2-address-label .t { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tm-muted); }
.tm2-live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--tm-success); }
.tm2-live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tm-success); animation: tm2-pulse 1.8s ease-out infinite; }
@keyframes tm2-pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.45); } 70% { box-shadow: 0 0 0 8px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }

.tm2-address-bar {
    display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px;
    background: var(--tm-surface-2); border: 1.5px solid var(--tm-border-2);
    border-radius: 16px; transition: border-color .2s ease, box-shadow .2s ease;
}
.tm2-address-bar:focus-within { border-color: var(--tm-brand); box-shadow: var(--tm-ring); background: var(--tm-surface); }
.tm2-address-bar .env { color: var(--tm-brand); font-size: 18px; flex: 0 0 auto; }
.tm2-address-bar #email_id {
    flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-family: var(--tm-font-mono); font-size: clamp(14px, 2.6vw, 17px); font-weight: 600;
    color: var(--tm-ink); letter-spacing: -.01em;
}
.tm2-address-bar .tm2-btn { flex: 0 0 auto; }

.tm2-action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
@media (min-width: 640px) { .tm2-action-grid { grid-template-columns: repeat(4, 1fr); } }
.tm2-action-grid .tm2-btn { width: 100%; }

.tm2-quick-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin-top: 16px; font-size: 13px; }
.tm2-quick-links a { color: var(--tm-muted); font-weight: 500; }
.tm2-quick-links a:hover { color: var(--tm-brand); }

.tm2-create-form input[type="text"], .tm2-create-form select {
    width: 100%; min-height: 50px; padding: 12px 16px; margin-bottom: 10px;
    border: 1.5px solid var(--tm-border-2); border-radius: 14px; background: var(--tm-surface);
    font-size: 15px; color: var(--tm-ink); transition: border-color .2s ease, box-shadow .2s ease;
}
.tm2-create-form input[type="text"]:focus { border-color: var(--tm-brand); box-shadow: var(--tm-ring); outline: none; }

/* ---------- Inbox ---------- */
.tm2-inbox-wrap { margin: 26px auto 0; }
.tm2-inbox-card { overflow: hidden; min-height: 280px; }
.tm2-inbox-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 18px 22px; border-bottom: 1px solid var(--tm-border);
    background: linear-gradient(180deg, var(--tm-surface), var(--tm-surface-2));
}
.tm2-inbox-head .tm2-h3 { display: flex; align-items: center; gap: 10px; }
.tm2-inbox-head .ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--tm-brand-soft); color: var(--tm-brand); font-size: 14px; }
.tm2-refresh-hint { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--tm-muted); font-weight: 600; }
.tm2-refresh-hint svg { animation: tm2-spin 2.2s linear infinite; }
.pause-spinner { animation-play-state: paused !important; }
@keyframes tm2-spin { to { transform: rotate(360deg); } }

.tm2-msg-cols { display: none; }
@media (min-width: 640px) {
    .tm2-msg-cols { display: flex; gap: 12px; padding: 12px 22px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--tm-muted); border-bottom: 1px solid var(--tm-border); background: var(--tm-surface); }
}
.tm2-msg-cols .c-from { width: 34%; } .tm2-msg-cols .c-subj { flex: 1; } .tm2-msg-cols .c-time { width: 90px; text-align: right; }

.tm2-msg { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 22px; background: var(--tm-surface); border: 0; border-bottom: 1px solid var(--tm-border); cursor: pointer; text-align: left; transition: background .15s ease; }
.tm2-msg:hover { background: var(--tm-surface-2); }
.tm2-msg:last-child { border-bottom: 0; }
.tm2-msg.unread { background: linear-gradient(90deg, rgba(79,70,229,.08), var(--tm-surface) 40%); }
.tm2-msg.unread .s-name::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: var(--tm-brand); }
.tm2-msg .c-from { width: 34%; min-width: 0; }
.tm2-msg .s-name { display: block; font-weight: 700; font-size: 14.5px; color: var(--tm-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm2-msg .s-mail { display: block; font-size: 12px; color: var(--tm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm2-msg .c-subj { flex: 1; min-width: 0; font-size: 14px; color: var(--tm-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm2-msg .c-time { width: 90px; flex: 0 0 auto; text-align: right; font-size: 12px; color: var(--tm-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 639px) {
    .tm2-msg { flex-wrap: wrap; }
    .tm2-msg .c-from { width: calc(100% - 100px); }
    .tm2-msg .c-subj { flex-basis: 100%; padding-left: 15px; }
}

.tm2-inbox-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 52px 22px 56px; text-align: center; color: var(--tm-muted); }
.tm2-inbox-empty .ring { position: relative; width: 84px; height: 84px; margin-bottom: 12px; display: grid; place-items: center; border-radius: 50%; background: var(--tm-brand-soft); color: var(--tm-brand); font-size: 30px; }
.tm2-inbox-empty .ring::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px dashed rgba(79,70,229,.35); animation: tm2-spin 14s linear infinite; }
.tm2-inbox-empty .t1 { font-size: 17px; font-weight: 700; color: var(--tm-ink-2); }
.tm2-inbox-empty .t2 { font-size: 14px; max-width: 380px; }

.tm2-detail-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--tm-border); background: var(--tm-surface-2); }
.tm2-detail-meta { padding: 20px 22px 0; }
.tm2-detail-meta .sub { font-family: var(--tm-font-display); font-size: 19px; font-weight: 600; color: var(--tm-ink); line-height: 1.35; }
.tm2-detail-meta .from { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13.5px; color: var(--tm-ink-2); }
.tm2-detail-meta .avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--tm-brand), var(--tm-brand-2)); color: #fff; font-weight: 700; font-size: 15px; flex: 0 0 auto; }
.tm2-detail-body { padding: 14px 22px 24px; }
.tm2-detail-body iframe { width: 100%; min-height: 400px; border: 1px solid var(--tm-border); border-radius: 14px; background: #fff; }
.tm2-attach { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tm2-attach a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; background: var(--tm-surface-2); border: 1px solid var(--tm-border); font-size: 13px; font-weight: 600; color: var(--tm-ink-2); transition: all .18s ease; }
.tm2-attach a:hover { border-color: var(--tm-brand); color: var(--tm-brand-dark); background: var(--tm-brand-soft); }

/* ---------- Ad slots (viewability-first) ---------- */
.ad-slot-wrapper { position: relative; width: 100%; }
.ad-slot-container {
    position: relative; width: 100%; display: flex; justify-content: center; align-items: flex-start;
    background: repeating-linear-gradient(45deg, #f4f6fb 0 12px, #eef1f8 12px 24px);
    border: 1px dashed var(--tm-border-2); border-radius: var(--tm-radius);
    overflow: hidden;
}
.ad-slot-label {
    display: block; text-align: center; font-size: 10px; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase; color: #aab2c5; margin-bottom: 6px;
}
.ad-slot-container ins.adsbygoogle { max-width: 100% !important; }
.tm2-ad-inline { margin: 30px auto 0; }
.tm2-ad-band { margin: 34px auto 0; }
.tm2-ad-band .ad-slot-container { border-radius: var(--tm-radius-lg); }

/* Collapse genuinely empty ad containers only (no ins element rendered) */
.ad-slot-container:empty {
    min-height: 0 !important; height: 0; overflow: hidden; border: 0; padding: 0;
}
.tm2-collapsible-ad .ad-slot-wrapper:has(.ad-slot-container:empty) { display: none; }

/* ---------- Content sections ---------- */
.tm2-main-grid { display: grid; gap: 26px; margin-top: 26px; }
@media (min-width: 1024px) { .tm2-main-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; } }
.tm2-stack { display: grid; gap: 26px; }
.tm2-side { display: grid; gap: 22px; }
@media (min-width: 1024px) { .tm2-side { position: sticky; top: 92px; } }

.tm2-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.tm2-section-head .tm2-h2 { margin-top: 8px; }
.tm2-section-head p { margin: 8px 0 0; color: var(--tm-ink-2); max-width: 620px; }

.tm2-steps { display: grid; gap: 14px; }
@media (min-width: 768px) { .tm2-steps { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.tm2-step { position: relative; padding: 24px; overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.tm2-step:hover { transform: translateY(-3px); box-shadow: var(--tm-shadow); }
.tm2-step .num { font-family: var(--tm-font-display); font-size: 44px; font-weight: 700; line-height: 1; background: linear-gradient(135deg, var(--tm-brand), var(--tm-brand-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; opacity: .9; }
.tm2-step .tm2-h3 { margin-top: 12px; }
.tm2-step p { margin: 8px 0 0; font-size: 14px; color: var(--tm-ink-2); }

.tm2-cards { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .tm2-cards { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.tm2-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--tm-radius-lg); background: var(--tm-surface); border: 1px solid var(--tm-border); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.tm2-card:hover { transform: translateY(-3px); box-shadow: var(--tm-shadow); border-color: var(--tm-border-2); color: var(--tm-ink); }
.tm2-card .ci { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--tm-brand-soft); color: var(--tm-brand); font-size: 16px; margin-bottom: 6px; }
.tm2-card .ct { font-weight: 700; font-size: 15px; color: var(--tm-ink); }
.tm2-card .cd { font-size: 13px; color: var(--tm-muted); line-height: 1.55; }

.tm2-list-panel { padding: 22px; }
.tm2-list-panel ul { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.tm2-list-panel ul a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; font-weight: 600; color: var(--tm-ink-2); transition: all .15s ease; }
.tm2-list-panel ul a:hover { background: var(--tm-brand-soft); color: var(--tm-brand-dark); padding-left: 16px; }
.tm2-list-panel ul a i { font-size: 11px; color: var(--tm-muted); margin-left: auto; }

.tm2-faq details { border-bottom: 1px solid var(--tm-border); }
.tm2-faq details:last-child { border-bottom: 0; }
.tm2-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 4px; cursor: pointer; list-style: none; font-weight: 600; font-size: 15.5px; color: var(--tm-ink); transition: color .15s ease; }
.tm2-faq summary::-webkit-details-marker { display: none; }
.tm2-faq summary::after { content: "\f078"; font-family: "Font Awesome 5 Free"; font-weight: 900; font-size: 12px; color: var(--tm-muted); transition: transform .2s ease; flex: 0 0 auto; }
.tm2-faq details[open] summary { color: var(--tm-brand-dark); }
.tm2-faq details[open] summary::after { transform: rotate(180deg); }
.tm2-faq details p { margin: 0; padding: 0 4px 18px; font-size: 14.5px; color: var(--tm-ink-2); line-height: 1.7; }

.tm2-split { display: grid; gap: 26px; }
@media (min-width: 1024px) { .tm2-split { grid-template-columns: 1.25fr 1fr; gap: 28px; align-items: start; } }

/* ---------- Footer ---------- */
.tm2-footer { margin-top: 90px; background: #0d1226; color: #b7bfd6; position: relative; overflow: hidden; }
.tm2-footer::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--tm-brand), var(--tm-brand-2), #a855f7); }
.tm2-footer-grid { display: grid; gap: 34px; padding: 60px 0 40px; }
@media (min-width: 768px) { .tm2-footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; } }
.tm2-footer h4 { margin: 0 0 16px; font-family: var(--tm-font-display); font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.tm2-footer a { color: #b7bfd6; font-size: 14px; }
.tm2-footer a:hover { color: #fff; }
.tm2-footer .flinks { display: grid; gap: 10px; }
.tm2-footer-brand .tm2-brand-name { color: #fff; font-size: 1.35rem; }
.tm2-footer-brand p { margin: 14px 0 0; font-size: 14px; line-height: 1.7; color: #93a; color: #98a1bd; max-width: 300px; }
.tm2-footer select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #e7eaf5; font-size: 14px; font-weight: 600; cursor: pointer; }
.tm2-footer select option { color: #0f172a; }
.tm2-footer .fsocials { display: flex; gap: 14px; margin-top: 18px; font-size: 18px; }
.tm2-footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 22px 0 26px; border-top: 1px solid rgba(255,255,255,.08); font-size: 13px; color: #7e88a5; }
.tm2-footer-bottom a { color: #98a1bd; }

/* ---------- Prose / content pages ---------- */
.tm2-prose { color: var(--tm-ink-2); font-size: 16px; line-height: 1.8; }
.tm2-prose h1, .tm2-prose h2, .tm2-prose h3, .tm2-prose h4 { font-family: var(--tm-font-display); color: var(--tm-ink); line-height: 1.3; margin: 1.6em 0 .6em; letter-spacing: -.01em; }
.tm2-prose h2 { font-size: 1.55rem; } .tm2-prose h3 { font-size: 1.25rem; }
.tm2-prose p { margin: 0 0 1.15em; }
.tm2-prose a { color: var(--tm-brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(79,70,229,.35); }
.tm2-prose a:hover { text-decoration-color: var(--tm-brand); }
.tm2-prose ul, .tm2-prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.tm2-prose li { margin-bottom: .45em; }
.tm2-prose img { border-radius: var(--tm-radius-lg); }
.tm2-prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--tm-brand); color: var(--tm-ink); font-style: italic; background: var(--tm-brand-soft); border-radius: 0 14px 14px 0; padding: 14px 18px; }
.tm2-prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 14.5px; }
.tm2-prose th, .tm2-prose td { padding: 11px 14px; border: 1px solid var(--tm-border); text-align: left; }
.tm2-prose th { background: var(--tm-surface-2); font-weight: 700; color: var(--tm-ink); }
.tm2-prose code { font-family: var(--tm-font-mono); font-size: .88em; background: var(--tm-brand-soft); color: var(--tm-brand-dark); padding: 2px 7px; border-radius: 7px; }
.tm2-prose pre { background: #0d1226; color: #dbe2f4; padding: 18px; border-radius: var(--tm-radius-lg); overflow-x: auto; }
.tm2-prose pre code { background: none; color: inherit; padding: 0; }

/* ---------- Misc utilities ---------- */
.tm2-skip { position: fixed; top: -60px; left: 16px; z-index: 9999; background: var(--tm-ink); color: #fff; padding: 10px 18px; border-radius: 0 0 12px 12px; font-size: 13px; font-weight: 700; transition: top .2s ease; }
.tm2-skip:focus { top: 0; color: #fff; }

.tm2-reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.tm2-reveal.is-in { opacity: 1; transform: none; }

.tm2-skeleton { position: relative; overflow: hidden; background: #e9edf5; border-radius: 12px; }
.tm2-skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: tm2-shimmer 1.4s infinite; }
@keyframes tm2-shimmer { to { transform: translateX(100%); } }

#copy-toast {
    position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 16px); z-index: 9990;
    display: inline-flex; align-items: center; gap: 9px; padding: 13px 22px;
    background: var(--tm-ink); color: #fff; border-radius: 999px; box-shadow: var(--tm-shadow-lg);
    font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
#copy-toast.show { opacity: 1; transform: translate(-50%, 0); }
#copy-toast .ok { color: #4ade80; }

.tm2-cookie { position: fixed; inset: auto 0 0 0; z-index: 9980; padding: 14px; }
.tm2-cookie-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; max-width: 880px; margin-inline: auto; padding: 18px 22px; background: var(--tm-surface); border: 1px solid var(--tm-border); border-radius: 20px; box-shadow: var(--tm-shadow-lg); }
.tm2-cookie-inner p { margin: 0; font-size: 13.5px; color: var(--tm-ink-2); line-height: 1.6; flex: 1 1 320px; }

.tm2-imap-error { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 300px; padding: 30px; text-align: center; }
.tm2-imap-error .box { max-width: 420px; }
.tm2-imap-error .ic { width: 52px; height: 52px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: #fef2f2; color: var(--tm-danger); font-size: 20px; }

.tm2-anchor-pad { display: none; }
@media (max-width: 1023px) { body.tm2.has-anchor .tm2-anchor-pad { display: block; height: 64px; } }

body.tm2 [x-cloak] { display: none !important; }


/* ==========================================================================
   Dark theme — toggled via <html class="tm2-dark"> (persisted in localStorage)
   Only the design tokens change; every component inherits through var().
   ========================================================================== */
html.tm2-dark { color-scheme: dark; }
html.tm2-dark body.tm2 {
    --tm-brand:        #818cf8;
    --tm-brand-2:      #a78bfa;
    --tm-brand-dark:   #c7d2fe;
    --tm-brand-soft:   rgba(129, 140, 248, .16);
    --tm-accent:       #fbbf24;
    --tm-bg:           #0a0f1e;
    --tm-surface:      #111a30;
    --tm-surface-2:    #0d1526;
    --tm-border:       #22304e;
    --tm-border-2:     #2d3f63;
    --tm-ink:          #e8edf8;
    --tm-ink-2:        #a4b1cc;
    --tm-muted:        #66748f;
    --tm-shadow-sm:    0 1px 2px rgba(0, 0, 0, .4);
    --tm-shadow:       0 6px 24px -6px rgba(0, 0, 0, .5);
    --tm-shadow-lg:    0 24px 60px -12px rgba(0, 0, 0, .6);
    --tm-ring:         0 0 0 4px rgba(129, 140, 248, .25);
}
html.tm2-dark body.tm2 .tm2-cookie-inner { background: var(--tm-surface); }
html.tm2-dark body.tm2 .tm2-imap-error .ic { background: rgba(220, 38, 38, .15); }

/* Theme toggle button in the header */
.tm2-theme-toggle {
    width: 38px; height: 38px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--tm-border); border-radius: 12px;
    background: var(--tm-surface); color: var(--tm-ink-2);
    cursor: pointer; font-size: 15px;
    transition: color .2s ease, border-color .2s ease, transform .2s ease;
}
.tm2-theme-toggle:hover { color: var(--tm-brand); border-color: var(--tm-brand); transform: translateY(-1px); }
.tm2-theme-toggle .fa-sun { display: none; }
html.tm2-dark .tm2-theme-toggle .fa-sun { display: inline-block; }
html.tm2-dark .tm2-theme-toggle .fa-moon { display: none; }

/* New-mail toast */
#tm2-mail-toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 9995;
    display: flex; align-items: center; gap: 10px;
    background: var(--tm-ink); color: var(--tm-bg);
    padding: 12px 18px; border-radius: 14px; box-shadow: var(--tm-shadow-lg);
    font-size: 14px; font-weight: 600;
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
}
#tm2-mail-toast.show { opacity: 1; transform: translateY(0); }
#tm2-mail-toast .ic { color: var(--tm-brand-2); }

/* ==========================================================================
   Inbox skeleton — matches live inbox metrics (no layout jump on swap)
   ========================================================================== */
.tm2-skel { padding: 14px 22px 22px; min-height: 300px; }
.tm2-skel-row {
    height: 58px; margin-bottom: 12px; border-radius: 14px;
    background: linear-gradient(90deg,
        var(--tm-surface-2) 25%,
        var(--tm-border) 50%,
        var(--tm-surface-2) 75%);
    background-size: 200% 100%;
    animation: tm2-skel-shimmer 1.4s ease infinite;
}
.tm2-skel-row:nth-child(2) { animation-delay: .12s; }
.tm2-skel-row:nth-child(3) { animation-delay: .24s; }
@keyframes tm2-skel-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.tm2-skel-noscript { margin-top: 16px; padding: 18px; text-align: center; background: #fef3c7; border-radius: 12px; }
.tm2-skel-noscript p { color: #92400e; font-weight: 600; margin: 0; }

/* ==========================================================================
   Ad slots — collapse unfilled / blocked units (no ghost vertical space)
   ========================================================================== */
/* AdSense marks no-fill units with data-ad-status="unfilled"; ad blockers
   remove the ins entirely. In both cases the wrapper must give its space
   back. The :has() rule covers modern browsers; the .is-unfilled class is
   added by nebula-v2.js as a fallback. */
.ad-slot-wrapper:has(ins.adsbygoogle[data-ad-status="unfilled"]),
.ad-slot-wrapper.is-unfilled {
    display: none !important;
}
.ad-slot-container:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
    min-height: 0 !important; height: 0 !important; border: 0; padding: 0;
}
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
