:root {
    --bg: #111;
    --surface: #1a1a1a;
    --surface2: #222;
    --border: #2e2e2e;
    --orange: #ff6a00;
    --orange2: #ff9900;
    --orange-dim: #7a3200;
    --orange-glow: rgba(255, 106, 0, 0.15);
    --text: #f5e6d0;
    --text-dim: #8a7a6a;
    --text-muted: #3a3028;
    --diamond: #4dd9e8;
    --dg: rgba(77, 217, 232, 0.2);
    --danger: #e74c3c;
    --success: #2ecc71;
    --r: 12px;
}

@import url(https://fonts.googleapis.com/css2?family=Jaro:opsz@6..72&family=Passero+One&display=swap);

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "Passero One", sans-serif;
    padding: 28px;
    font-size: 18px;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255, 106, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 106, 0, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: -1;
    animation: gridDriftX 60s ease-in-out infinite alternate, gridDriftY 43s ease-in-out infinite alternate;
}

@keyframes gridDriftX {
    0% {
        background-position-x: 0px;
    }

    100% {
        background-position-x: 1024px;
    }
}

@keyframes gridDriftY {
    0% {
        background-position-y: 0px;
    }

    100% {
        background-position-y: 1024px;
    }
}

.app {
    display: grid;
    gap: 18px;
    max-width: 1280px;
    margin: 0 auto;
}

.topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.1), rgba(77, 217, 232, 0.08));
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.35), inset 0 0 18px rgba(255, 106, 0, 0.08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 0 12px var(--orange-glow);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-title {
    font-family: "Jaro", sans-serif;
    font-size: 26px;
    letter-spacing: 1px;
}

.brand-sub {
    color: var(--text-dim);
    font-size: 14px;
}

.search {
    display: flex;
    gap: 8px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 999px;
}

.search input {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 16px;
    width: 100%;
    outline: none;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: thin;
}

button {
    font-family: "Passero One", sans-serif;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

button:hover {
    transform: translateY(-1px);
    border-color: var(--orange);
    box-shadow: 0 0 12px var(--orange-glow);
}

button.primary {
    background: linear-gradient(135deg, var(--orange), var(--orange2));
    color: #1a120c;
    border: none;
    box-shadow: 0 0 16px var(--orange-glow);
}

button.ghost {
    background: transparent;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.button-link:hover {
    transform: translateY(-1px);
    border-color: var(--orange);
    box-shadow: 0 0 12px var(--orange-glow);
}

.button-link.primary {
    background: linear-gradient(135deg, var(--orange), var(--orange2));
    color: #1a120c;
    border: none;
    box-shadow: 0 0 16px var(--orange-glow);
}

.button-link.ghost {
    background: transparent;
}

button.danger,
.button-link.danger {
    border-color: rgba(231, 76, 60, 0.6);
    color: #f4b0a9;
}

button.tiny {
    padding: 4px 10px;
    font-size: 13px;
}

.layout {
    display: grid;
    grid-template-columns: 280px 1fr 1.2fr;
    gap: 18px;
    min-height: 70vh;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 16px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.25);
}

.sidebar {
    display: grid;
    gap: 18px;
}

.account {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: rgba(255, 106, 0, 0.05);
}

.avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 22px;
    background: linear-gradient(145deg, var(--orange-dim), var(--orange));
    color: #120a04;
}

.account-name {
    font-size: 18px;
}

.account-email {
    color: var(--text-dim);
    font-size: 13px;
}

.account-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dim);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.6);
}

.folder-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    margin-bottom: 10px;
}

.folder-item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    background: var(--surface2);
}

.folder-item.active {
    border-color: var(--orange);
    background: rgba(255, 106, 0, 0.08);
}

.alias-list {
    display: grid;
    gap: 6px;
}

.folder-item.danger {
    border-color: rgba(231, 76, 60, 0.6);
}

.count {
    color: var(--text-dim);
    font-size: 13px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.tabs {
    display: flex;
    gap: 8px;
}

.tab {
    padding: 6px 12px;
    font-size: 15px;
}

.tab.active {
    border-color: var(--diamond);
    box-shadow: 0 0 12px var(--dg);
}

.list-meta {
    color: var(--text-dim);
    font-size: 14px;
}

.message-list {
    display: grid;
    gap: 10px;
}

.message-item {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.message-item:hover {
    border-color: var(--orange);
    transform: translateX(2px);
}

.message-item.active {
    border-color: var(--diamond);
    box-shadow: 0 0 14px var(--dg);
}

.message-item.unread {
    background: rgba(255, 106, 0, 0.08);
}

.message-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.message-from {
    font-size: 16px;
}

.message-time {
    color: var(--text-dim);
    font-size: 12px;
}

.message-subject {
    font-size: 17px;
    margin-bottom: 4px;
}

.message-preview {
    color: var(--text-dim);
    font-size: 14px;
}

.message-badges {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

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

.badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-dim);
}

.badge.starred {
    border-color: var(--diamond);
    color: var(--diamond);
}

.reader-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.reader-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: thin;
}

.reader-subject {
    font-family: "Jaro", sans-serif;
    font-size: 28px;
    letter-spacing: 1px;
}

.reader-from {
    color: var(--text-dim);
    font-size: 15px;
}

.reader-meta {
    margin: 12px 0;
    color: var(--text-dim);
    font-size: 14px;
}

.reader-body {
    line-height: 1.6;
    font-size: 16px;
    min-height: 200px;
}

.attachments {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.attachment {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(77, 217, 232, 0.08);
    color: var(--diamond);
    font-size: 13px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    place-items: center;
    padding: 20px;
    z-index: 10;
}

.modal.show {
    display: grid;
}

.modal-card {
    width: min(600px, 92vw);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 16px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.modal-body {
    display: grid;
    gap: 12px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 14px;
    color: var(--text-dim);
}

input,
textarea {
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px;
    border-radius: 10px;
    font-family: "Passero One", sans-serif;
}

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

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--text);
    display: none;
}

.toast.show {
    display: block;
    box-shadow: 0 0 12px var(--orange-glow);
}

.page-shell {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    gap: 24px;
}

.landing-hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 24px;
    align-items: center;
    padding: 24px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.12), rgba(77, 217, 232, 0.08));
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.25);
}

.hero-title {
    font-family: "Jaro", sans-serif;
    font-size: 48px;
    letter-spacing: 1px;
}

.hero-subtitle {
    color: var(--text-dim);
    margin-top: 10px;
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: nowrap;
}

.hero-card {
    padding: 16px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: var(--surface);
    display: grid;
    gap: 12px;
}

.hero-stat {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-radius: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
}

.hero-note {
    font-size: 13px;
    color: var(--text-dim);
    text-align: right;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.feature-card {
    padding: 16px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    display: grid;
    gap: 8px;
}

.feature-title {
    font-size: 20px;
}

.feature-body {
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.5;
}

.cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: rgba(77, 217, 232, 0.08);
}

.cta-title {
    font-size: 22px;
}

.landing-footer {
    display: flex;
    justify-content: space-between;
    color: var(--text-dim);
    font-size: 14px;
}

.login-shell {
    max-width: 420px;
    margin: 0 auto;
    padding-top: 80px;
    display: grid;
    gap: 16px;
}

.login-card {
    padding: 20px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.25);
}

.login-title {
    font-family: "Jaro", sans-serif;
    font-size: 34px;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.login-sub {
    color: var(--text-dim);
    margin-bottom: 16px;
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.login-actions label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-dim);
}

.helper-link {
    color: var(--diamond);
    text-decoration: none;
    font-size: 14px;
}

.doc-shell {
    gap: 20px;
}

.doc-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 16px;
    display: grid;
    gap: 10px;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.2);
}

.doc-title {
    font-family: \"Jaro\", sans-serif;
    font-size: 24px;
    letter-spacing: 1px;
}

.doc-steps {
    display: grid;
    gap: 8px;
    color: var(--text-dim);
    font-size: 15px;
}

.doc-step {
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.doc-callout {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 153, 0, 0.5);
    background: rgba(255, 106, 0, 0.08);
    font-size: 14px;
    color: var(--text);
}

.doc-code {
    display: grid;
    gap: 6px;
    font-family: \"Passero One\", sans-serif;
    font-size: 14px;
}

.doc-code code {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface2);
}

.doc-input {
    width: 100%;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px;
    border-radius: 10px;
    font-family: \"Passero One\", sans-serif;
    resize: vertical;
}

.doc-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

@media (max-width: 980px) {
    .landing-hero {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 240px 1fr;
    }

    .reader {
        grid-column: 1 / -1;
    }
}

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

    .actions {
        justify-content: flex-start;
        flex-wrap: nowrap;
    }

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