:root{
    --bg:#080a12;
    --surface:#101421;
    --surface2:#161b2b;
    --surface3:#1c2235;
    --text:#f5f7ff;
    --muted:#9ca6c3;
    --border:#293149;
    --accent:#766cff;
    --accent2:#9d65ff;
    --success:#4fd5a3;
    --danger:#ff6f82;
    --warning:#ffcc66;
    --shadow:0 22px 70px rgba(0,0,0,.28);
}

[data-theme="light"]{
    --bg:#f5f7fd;
    --surface:#ffffff;
    --surface2:#f5f7fc;
    --surface3:#eef1f9;
    --text:#171a26;
    --muted:#677087;
    --border:#dfe4ef;
    --shadow:0 20px 55px rgba(40,50,80,.11);
}

*{
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    margin:0;
    min-height:100vh;
    background:
        radial-gradient(
            circle at 50% -20%,
            rgba(118,108,255,.18),
            transparent 35%
        ),
        var(--bg);
    color:var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input,
select{
    font:inherit;
}

button{
    cursor:pointer;
}

a{
    color:inherit;
}

.shell{
    width:min(
        1180px,
        calc(100% - 28px)
    );
    margin:auto;
}

.topbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    min-height:72px;
}

.brand{
    display:flex;
    align-items:center;
    gap:11px;
    text-decoration:none;
    font-weight:850;
}

.logo{
    width:35px;
    height:35px;
    border-radius:11px;
    display:grid;
    place-items:center;
    background:
        linear-gradient(
            135deg,
            var(--accent),
            var(--accent2)
        );
    color:white;
    box-shadow:
        0 10px 30px
        rgba(118,108,255,.28);
}

.top-actions{
    display:flex;
    align-items:center;
    gap:8px;
}

.icon-btn{
    min-width:40px;
    height:40px;
    border:1px solid var(--border);
    border-radius:11px;
    background:var(--surface);
    color:var(--text);
}

.hero{
    text-align:center;
    padding:52px 0 28px;
}

.hero h1{
    font-size:
        clamp(39px,7vw,68px);
    line-height:1;
    letter-spacing:-.05em;
    margin:0;
}

.hero p{
    max-width:680px;
    margin:18px auto 0;
    color:var(--muted);
    line-height:1.7;
    font-size:17px;
}

.dev-pill{
    display:inline-flex;
    margin-top:18px;
    border:1px solid var(--border);
    padding:7px 12px;
    border-radius:999px;
    color:var(--muted);
    font-size:12px;
}

.workspace{
    display:grid;
    grid-template-columns:
        minmax(0,1fr)
        320px;
    gap:20px;
    align-items:start;
    padding-bottom:50px;
}

.main-column{
    min-width:0;
}

.card{
    background:
        color-mix(
            in srgb,
            var(--surface) 96%,
            transparent
        );
    border:1px solid var(--border);
    border-radius:21px;
    box-shadow:var(--shadow);
}

.address-card{
    padding:22px;
    margin-bottom:18px;
}

.address-row{
    display:grid;
    grid-template-columns:
        minmax(0,1fr)
        auto;
    gap:10px;
}

.address-display{
    min-width:0;
    border:1px solid var(--border);
    background:var(--surface2);
    border-radius:14px;
    display:flex;
    align-items:center;
    min-height:54px;
    padding:0 16px;
    font-weight:700;
    overflow:hidden;
}

.address-display span{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.primary{
    border:0;
    border-radius:13px;
    padding:0 19px;
    min-height:48px;
    background:
        linear-gradient(
            135deg,
            var(--accent),
            var(--accent2)
        );
    color:white;
    font-weight:800;
}

.secondary{
    border:1px solid var(--border);
    border-radius:13px;
    min-height:44px;
    padding:0 15px;
    background:var(--surface2);
    color:var(--text);
    font-weight:700;
}

.danger{
    color:var(--danger);
}

.toolbar{
    display:flex;
    flex-wrap:wrap;
    gap:9px;
    margin-top:13px;
}

.mailbox-stats{
    display:flex;
    flex-wrap:wrap;
    justify-content:space-between;
    gap:10px 20px;
    margin-top:15px;
    color:var(--muted);
    font-size:13px;
}

.progress{
    height:4px;
    background:var(--surface3);
    border-radius:999px;
    overflow:hidden;
    margin-top:15px;
}

.progress > span{
    display:block;
    height:100%;
    width:0%;
    background:
        linear-gradient(
            90deg,
            var(--accent),
            var(--accent2)
        );
    transition:width .4s ease;
}

.inbox-card{
    overflow:hidden;
}

.section-head{
    min-height:72px;
    padding:0 21px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    border-bottom:
        1px solid var(--border);
}

.section-head h2{
    margin:0;
    font-size:20px;
}

.badge{
    min-width:27px;
    height:27px;
    padding:0 7px;
    display:inline-grid;
    place-items:center;
    border-radius:999px;
    background:
        rgba(118,108,255,.15);
    color:#afa9ff;
    font-size:12px;
    font-weight:800;
}

.search-row{
    padding:13px 16px;
    border-bottom:
        1px solid var(--border);
}

.search-row input{
    width:100%;
    border:1px solid var(--border);
    background:var(--surface2);
    color:var(--text);
    border-radius:12px;
    padding:12px 14px;
    outline:none;
}

.message-list{
    min-height:250px;
}

.message-row{
    width:100%;
    text-align:left;
    border:0;
    border-bottom:
        1px solid var(--border);
    background:transparent;
    color:var(--text);
    padding:16px 19px;
    display:grid;
    grid-template-columns:
        minmax(130px,.8fr)
        minmax(0,1.7fr)
        auto;
    gap:18px;
    align-items:center;
}

.message-row:hover{
    background:
        rgba(118,108,255,.07);
}

.message-row.unread{
    background:
        rgba(118,108,255,.055);
}

.from{
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    font-weight:750;
}

.subject{
    min-width:0;
}

.subject strong{
    display:block;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
}

.subject small{
    color:var(--muted);
}

.time{
    color:var(--muted);
    font-size:12px;
    white-space:nowrap;
}

.empty{
    min-height:250px;
    display:grid;
    place-items:center;
    text-align:center;
    color:var(--muted);
    padding:30px;
}

.empty strong{
    display:block;
    color:var(--text);
    font-size:19px;
    margin-bottom:6px;
}

.side{
    position:sticky;
    top:18px;
}

.side-card{
    padding:19px;
    margin-bottom:15px;
}

.side-card h3{
    margin:0 0 14px;
    font-size:15px;
}

.side-card p{
    color:var(--muted);
    line-height:1.6;
    font-size:13px;
}

.saved-list{
    display:grid;
    gap:8px;
}

.saved-box{
    width:100%;
    text-align:left;
    border:1px solid var(--border);
    background:var(--surface2);
    color:var(--text);
    padding:11px;
    border-radius:11px;
    overflow:hidden;
}

.saved-box.active{
    border-color:var(--accent);
}

.saved-box strong{
    display:block;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    font-size:12px;
}

.saved-box small{
    color:var(--muted);
}

.qr-wrap{
    background:white;
    display:grid;
    place-items:center;
    width:180px;
    height:180px;
    border-radius:15px;
    margin:0 auto 13px;
    overflow:hidden;
}

.qr-wrap canvas,
.qr-wrap img{
    max-width:150px;
    max-height:150px;
}

.modal-backdrop{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.7);
    backdrop-filter:blur(5px);
    display:none;
    place-items:center;
    padding:18px;
    z-index:100;
}

.modal-backdrop.show{
    display:grid;
}

.modal{
    width:min(520px,100%);
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:20px;
    box-shadow:var(--shadow);
    padding:23px;
}

.modal h2{
    margin-top:0;
}

.form-grid{
    display:grid;
    gap:13px;
}

.field label{
    display:block;
    color:var(--muted);
    font-size:12px;
    margin-bottom:7px;
}

.field input,
.field select{
    width:100%;
    min-height:46px;
    border:1px solid var(--border);
    border-radius:12px;
    background:var(--surface2);
    color:var(--text);
    padding:0 13px;
    outline:none;
}

.modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:8px;
    margin-top:18px;
}

.viewer-backdrop{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.7);
    backdrop-filter:blur(6px);
    z-index:120;
    display:none;
}

.viewer-backdrop.show{
    display:block;
}

.viewer-panel{
    position:absolute;
    right:0;
    top:0;
    height:100%;
    width:min(760px,100%);
    background:var(--surface);
    border-left:1px solid var(--border);
    display:flex;
    flex-direction:column;
}

.viewer-head{
    padding:17px 20px;
    display:flex;
    justify-content:space-between;
    gap:15px;
    border-bottom:
        1px solid var(--border);
}

.viewer-head h2{
    margin:0;
    font-size:19px;
}

.viewer-meta{
    color:var(--muted);
    font-size:12px;
    margin-top:5px;
    line-height:1.6;
}

.viewer-actions{
    display:flex;
    gap:7px;
    align-items:flex-start;
}

.viewer-body{
    overflow:auto;
    padding:21px;
    flex:1;
}

.mode-tabs{
    display:flex;
    gap:7px;
    margin-bottom:15px;
}

.mode-tab.active{
    border-color:var(--accent);
}

.text-body{
    white-space:pre-wrap;
    overflow-wrap:anywhere;
    line-height:1.7;
}

.html-frame{
    width:100%;
    min-height:450px;
    border:1px solid var(--border);
    border-radius:12px;
    background:white;
}

.attachments{
    margin-top:20px;
    border-top:1px solid var(--border);
    padding-top:16px;
}

.attachment{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding:10px 0;
    border-bottom:
        1px solid var(--border);
}

.footer{
    border-top:1px solid var(--border);
    padding:30px 0 45px;
    color:var(--muted);
    font-size:13px;
}

.footer-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    flex-wrap:wrap;
}

.footer-links{
    display:flex;
    gap:16px;
    flex-wrap:wrap;
}

.footer a{
    text-decoration:none;
}

.toast{
    position:fixed;
    left:50%;
    bottom:24px;
    transform:
        translate(-50%,30px);
    opacity:0;
    pointer-events:none;
    background:var(--text);
    color:var(--bg);
    font-weight:750;
    padding:11px 16px;
    border-radius:999px;
    z-index:500;
    transition:.25s ease;
}

.toast.show{
    opacity:1;
    transform:
        translate(-50%,0);
}

.hidden{
    display:none !important;
}

@media(max-width:900px){

    .workspace{
        grid-template-columns:1fr;
    }

    .side{
        position:static;
    }

    .side-card.qr-card{
        display:none;
    }
}

@media(max-width:650px){

    .hero{
        padding-top:28px;
    }

    .address-row{
        grid-template-columns:1fr;
    }

    .primary.copy-btn{
        min-height:48px;
    }

    .message-row{
        grid-template-columns:1fr auto;
        gap:7px 12px;
    }

    .from{
        grid-column:1/2;
    }

    .subject{
        grid-column:1/2;
    }

    .time{
        grid-column:2/3;
        grid-row:1/3;
        align-self:center;
    }

    .viewer-panel{
        width:100%;
    }

    .viewer-head{
        flex-direction:column;
    }
}


/* =========================================================
   Production content / SEO section
   ========================================================= */

.seo-content{
    padding:12px 0 58px;
}

.seo-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;
    margin-bottom:18px;
}

.seo-card{
    padding:24px;
    box-shadow:none;
}

.seo-card h2{
    margin:0 0 10px;
    font-size:20px;
}

.seo-card p{
    margin:0;
    line-height:1.75;
    color:var(--muted);
}

.faq-card{
    padding:25px;
    box-shadow:none;
}

.faq-card h2{
    margin:0 0 15px;
}

.faq-card details{
    border-top:1px solid var(--border);
    padding:15px 0;
}

.faq-card details:last-child{
    padding-bottom:0;
}

.faq-card summary{
    cursor:pointer;
    font-weight:750;
}

.faq-card p{
    margin:10px 0 0;
    line-height:1.7;
    color:var(--muted);
}

.learn-links{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:18px;
}

.learn-links a{
    text-decoration:none;
    border:1px solid var(--border);
    border-radius:999px;
    padding:10px 14px;
    background:var(--surface);
    color:var(--muted);
    transition:.2s ease;
}

.learn-links a:hover{
    border-color:var(--accent);
    color:var(--text);
}

.beta-badge{
    display:inline-flex;
    align-items:center;
    padding:3px 7px;
    margin-left:5px;
    border:1px solid var(--border);
    border-radius:999px;
    color:var(--muted);
    font-size:10px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
}

.article-shell{
    width:min(850px,calc(100% - 28px));
    margin:50px auto 70px;
}

.article-shell h1{
    font-size:clamp(34px,6vw,54px);
    letter-spacing:-.04em;
}

.article-shell h2{
    margin-top:34px;
}

.article-shell p,
.article-shell li{
    line-height:1.8;
    color:var(--muted);
}

.article-shell .card{
    padding:28px;
}

.article-shell a{
    color:var(--text);
}

@media(max-width:700px){
    .seo-grid{
        grid-template-columns:1fr;
    }
}
