/* adn-frn-server 2.68 – ✉️ N8M: N8-Mail as a web client of its own in the look of Outlook on the web.
 * Top bar (apps · N8M · search · tools · account) over a full-window mail: app bar | folders | list | reading pane as light cards.
 * Light by default (like OWA), dark on request (🌙). The panes themselves come from mail.css. */
body[data-app="n8m"] { margin: 0; min-height: 100vh; overflow: hidden; background: var(--n8m-bg) !important; color: var(--text);
    --n8m-top: 48px; --n8m-bg: #eef1f6; --n8m-card: #ffffff; --n8m-line: rgba(20, 36, 64, .09); --n8m-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --glass-bg: var(--n8m-card); --glass-border: var(--n8m-line); --glass-blur: none; --wm-grp-bg: rgba(255, 255, 255, .97); }
html[data-n8m="dark"] body[data-app="n8m"] { --n8m-bg: #0a0f1d; --n8m-card: #121a2e; --n8m-line: rgba(255, 255, 255, .08); --n8m-shadow: 0 1px 3px rgba(0, 0, 0, .4);
    --wm-grp-bg: rgba(18, 26, 46, .97); }
body[data-app="n8m"]::before, body[data-app="n8m"]::after { display: none !important; }      /* no glow of the dashboard */

/* ---------------------------------------------------------------- top bar */
.n8m-top { position: fixed; inset: 0 0 auto 0; height: var(--n8m-top); z-index: 50; display: flex; align-items: center; gap: 6px; padding: 0 10px 0 4px;
    color: #fff; background: linear-gradient(90deg, #0a2f5c 0%, #0f6cbd 62%, #2b88d8 100%); box-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
html[data-n8m="dark"] .n8m-top { background: linear-gradient(90deg, #070b17 0%, #0b2a4f 60%, #10467d 100%); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.n8m-top .grow { flex: 1; }
.n8m-waffle, .n8m-navbtn, .n8m-tb { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: #fff;
    font: inherit; font-size: 17px; cursor: pointer; flex: none; }
.n8m-waffle svg, .n8m-tb svg { width: 19px; height: 19px; }
.n8m-waffle:hover, .n8m-navbtn:hover, .n8m-tb:hover, .n8m-me:hover { background: rgba(255, 255, 255, .16); }
.n8m-navbtn { display: none; }
.n8m-brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; padding: 0 10px 0 2px; flex: none; }
.n8m-brand img { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.n8m-brand b { font-size: 17px; letter-spacing: .06em; font-weight: 800; }
.n8m-brand .n8m-sub { font-size: 12.5px; opacity: .78; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .35); font-weight: 600; }
.n8m-search { display: flex; align-items: center; gap: 8px; height: 32px; width: min(560px, 40vw); margin-left: 8px;
    padding: 0 12px; border-radius: 6px; background: rgba(255, 255, 255, .92); color: #3b4a63; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }
@media (min-width: 1101px) { .n8m-search { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; } }
.n8m-search svg { width: 16px; height: 16px; flex: none; color: #0f6cbd; }
.n8m-search input { flex: 1; min-width: 0; height: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none;
    color: #1b2433 !important; font: inherit; font-size: 14px; padding: 0 !important; }
.n8m-search input::placeholder { color: #5b6a82; }
.n8m-search:focus-within { background: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, .55); }
html[data-n8m="dark"] .n8m-search { background: rgba(255, 255, 255, .1); color: #cfe0f5; }
html[data-n8m="dark"] .n8m-search input { color: #f2f6fc !important; } html[data-n8m="dark"] .n8m-search input::placeholder { color: rgba(230, 240, 255, .6); }
html[data-n8m="dark"] .n8m-search svg { color: #9bd8ff; }
.n8m-tools { display: flex; align-items: center; gap: 2px; }
.n8m-lang .n8-lang > button, .n8m-lang button { color: #fff !important; background: transparent !important; border-color: rgba(255, 255, 255, .35) !important; }
.n8m-me { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; padding: 0; margin-left: 4px; }
.n8m-me .wm-av { width: 32px; height: 32px; font-size: 12px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }

/* ---------------------------------------------------------------- the mail window: full size, panes as cards */
.n8m-main { position: fixed; inset: var(--n8m-top) 0 0 0; }
body[data-app="n8m"] .wm { margin: 0; height: 100%; min-height: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
    grid-template-columns: 52px 248px minmax(320px, 400px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px; padding: 8px 8px 8px 0; }
body[data-app="n8m"] .wm-rail { background: transparent !important; border: 0; padding: 4px 0; gap: 2px; }
body[data-app="n8m"] .wm-rail-logo, body[data-app="n8m"] #wmDevBtn, body[data-app="n8m"] #wmOofBtn, body[data-app="n8m"] #wmRulesBtn, body[data-app="n8m"] #wmSigBtn { display: none; }
body[data-app="n8m"] .wm-app { width: 46px; padding: 8px 2px; border-radius: 8px; color: var(--text-dim); }
body[data-app="n8m"] .wm-app span { font-size: 19px; }
body[data-app="n8m"] .wm-app small { font-size: 9.5px; }
body[data-app="n8m"] .wm-app.active { background: var(--n8m-card); color: var(--accent); box-shadow: var(--n8m-shadow); }
body[data-app="n8m"] .wm-app.active::before { left: -1px; top: 12px; bottom: 12px; }
body[data-app="n8m"] .wm-ribbon, body[data-app="n8m"] .wm-side, body[data-app="n8m"] .wm-list, body[data-app="n8m"] .wm-read, body[data-app="n8m"] .wm-pim {
    background: var(--n8m-card) !important; border: 1px solid var(--n8m-line); border-radius: 10px; box-shadow: var(--n8m-shadow); }
body[data-app="n8m"] .wm-ribbon { padding: 4px 10px 0; }
body[data-app="n8m"] .wm-rtabs .wm-search { display: none; }              /* the search lives in the top bar */
body[data-app="n8m"] .wm-rtabs { min-height: 28px; }
body[data-app="n8m"] .wm-rb.big { background: var(--accent); color: #fff; border-radius: 8px; }
html[data-n8m="dark"] body[data-app="n8m"] .wm-rb.big { color: #04121c; }
body[data-app="n8m"] .wm-rb { border-radius: 6px; }
body[data-app="n8m"] .wm-side { padding: 8px 6px 8px 6px; }
body[data-app="n8m"] .wm-help { display: none; }
body[data-app="n8m"] .wm-folder { border-radius: 6px; padding: 6px 8px; font-size: 13.5px; }
body[data-app="n8m"] .wm-folder.active { background: var(--theme-accent-soft); }
body[data-app="n8m"] .wm-boxh { font-size: 13px; }
body[data-app="n8m"] .wm-list { overflow: hidden; }
body[data-app="n8m"] .wm-lhead { padding: 10px 12px 8px; }
body[data-app="n8m"] .wm-item { border-left-width: 3px; }
body[data-app="n8m"] .wm-item.active { background: var(--theme-accent-soft); }
body[data-app="n8m"] .wm-read { padding: 16px 22px; }
body[data-app="n8m"] .wm-banner { box-shadow: 0 10px 30px rgba(15, 108, 189, .18); }
body[data-app="n8m"] .wm-pim { padding: 14px 16px; }
html[data-n8m="light"] body[data-app="n8m"] .wm-item.flagged { background: #fff6f5; }
html[data-n8m="light"] body[data-app="n8m"] .wm-item.flagged.active { background: var(--theme-accent-soft); }
html[data-n8m="light"] body[data-app="n8m"] .wm-av { color: #fff; }

/* ---------------------------------------------------------------- toast, splash, login */
.n8m-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 4000; max-width: min(560px, 92vw); padding: 10px 16px; border-radius: 8px;
    font-size: 13.5px; font-weight: 600; color: #fff; background: #1b2433; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: n8m-in .18s ease-out; }
.n8m-toast.ok::before { content: "✓ "; color: #6ee7a0; } .n8m-toast.bad { background: #a4262c; }
@keyframes n8m-in { from { opacity: 0; transform: translate(-50%, 8px); } }
.n8m-splash { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px;
    background: radial-gradient(1200px 600px at 20% -10%, #cfe4fa 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #e6dcfb 0%, transparent 55%), #f3f6fb; }
html[data-n8m="dark"] .n8m-splash { background: radial-gradient(1200px 600px at 20% -10%, #0b2a4f 0%, transparent 60%), #070b17; }
.n8m-splash[hidden] { display: none; }
.n8m-splash-logo { width: min(440px, 86vw); border-radius: 18px; box-shadow: 0 18px 50px rgba(15, 60, 120, .22); }
.n8m-splash-t { font-size: 15px; font-weight: 650; color: var(--text-dim); text-align: center; max-width: 520px; }
body.n8m-out .n8m-main, body.n8m-out .n8m-search, body.n8m-out .n8m-tools, body.n8m-out .n8m-waffle { visibility: hidden; }

/* ---------------------------------------------------------------- smaller windows */
@media (max-width: 1250px) { body[data-app="n8m"] .wm { grid-template-columns: 52px 220px minmax(280px, 340px) minmax(0, 1fr); } .n8m-brand .n8m-sub { display: none; } }
@media (max-width: 1100px) { body[data-app="n8m"] .wm { grid-template-columns: 52px 220px minmax(0, 1fr); } }
@media (max-width: 900px) {
    .n8m-navbtn { display: grid; } .n8m-waffle { display: none; }
    body[data-app="n8m"] .wm { grid-template-columns: 52px minmax(0, 1fr); }
    body[data-app="n8m"] .wm-side { position: fixed; z-index: 45; top: calc(var(--n8m-top) + 8px); bottom: 8px; left: 8px; width: min(300px, 82vw); transform: translateX(-110%);
        transition: transform .2s ease; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); max-height: none !important; }
    body.n8m-nav[data-app="n8m"] .wm-side { transform: none; }
    body[data-app="n8m"] .wm-list, body[data-app="n8m"] .wm.reading .wm-read, body[data-app="n8m"] .wm-pim { grid-column: 2 !important; }
    body[data-app="n8m"] .wm-ribbon { grid-column: 2; }
}
@media (max-width: 760px) {
    body[data-app="n8m"] { --n8m-top: 52px; }
    .n8m-search { width: auto; flex: 1; margin: 0 4px; } .n8m-top .grow, .n8m-brand .n8m-sub, #n8mMode, .n8m-lang { display: none; }
    .n8m-brand b { display: none; }
    body[data-app="n8m"] .wm { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); padding: 6px; gap: 6px; }
    body[data-app="n8m"] .wm-rail { grid-row: 1; flex-direction: row; justify-content: center; padding: 0; }
    body[data-app="n8m"] .wm-ribbon { grid-column: 1; grid-row: 2; }
    body[data-app="n8m"] .wm-list, body[data-app="n8m"] .wm.reading .wm-read, body[data-app="n8m"] .wm-pim { grid-column: 1 !important; grid-row: 3; }
}
html[data-n8m="light"] body[data-app="n8m"] .wm-qbar { background: rgba(15, 40, 80, .1); }
body[data-app="n8m"] .wm-quota { padding: 4px 6px 0; }
