:root {
    --bg-dark: #141726;
    --bg-dark-card: #1e2235;
    --bg-light: #f4f6f9;
    --primary: #00c896;
    --primary-hover: #00b084;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Hero */
.hero {
    background: linear-gradient(135deg, #121524 0%, #1d2238 100%);
    color: #fff;
    padding-bottom: 54px;
}

.navbar {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lang-switch {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px;
    border-radius: 8px;
}

.lang-btn {
    color: #cbd5e1;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: 0.2s;
}

.lang-btn.active {
    background: var(--primary);
    color: #0b141a;
}

.lang-btn:hover:not(.active) {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.hero-content {
    max-width: 760px;
    margin: 18px auto 0;
    padding: 0 20px;
    text-align: center;
}

.hero-content h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 22px;
}

.email-box-wrapper {
    background: var(--bg-dark-card);
    border: 1px dashed rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.email-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 1.08rem;
    font-weight: 600;
    padding: 11px 16px;
    outline: none;
    transition: border-color 0.2s;
}

.email-input:focus {
    border-color: var(--primary);
}

.email-input::placeholder {
    color: #64748b;
    font-weight: 400;
}

.btn-primary {
    background: var(--primary);
    color: #0b141a;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: 0.2s;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.09);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: 0.2s;
    white-space: nowrap;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.hero-desc {
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 18px;
}

/* Action & Search Bar */
.action-bar {
    max-width: 900px;
    margin: -24px auto 26px;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.search-group {
    flex: 1;
    min-width: 240px;
    display: flex;
    gap: 8px;
    background: #fff;
    padding: 6px;
    border-radius: 50px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 6px 14px;
    font-size: 0.9rem;
    background: transparent;
    color: var(--text-dark);
}

.action-btn {
    background: #fff;
    color: var(--text-dark);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 50px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: 0.2s;
}

.action-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary-hover);
}

.action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.action-btn.compact {
    box-shadow: none;
    padding: 7px 14px;
    border-radius: 30px;
}

/* Main Inbox Card */
.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto 40px;
    padding: 0 20px;
    flex: 1;
}

.card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    overflow: hidden;
}

.inbox-header {
    background: #1e2235;
    color: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.6px;
}

.inbox-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.retention-pill {
    background: rgba(0, 200, 150, 0.16);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: 0;
}

.refresh-badge {
    font-weight: 500;
    color: #94a3b8;
    font-size: 0.82rem;
    letter-spacing: 0;
}

.refresh-badge span {
    color: var(--primary);
    font-weight: 700;
}

/* Table */
.mail-table {
    width: 100%;
    border-collapse: collapse;
}

.mail-table th {
    text-align: left;
    padding: 13px 22px;
    background: #f8fafc;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}

.mail-table td {
    padding: 15px 22px;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
    vertical-align: middle;
}

.mail-row {
    transition: background 0.15s;
    cursor: pointer;
}

.mail-row:hover {
    background: #f8fafc;
}

.sender-cell {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: #111827;
}

.subject-cell {
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.date-cell {
    color: var(--text-muted);
    font-size: 0.84rem;
    white-space: nowrap;
}

.btn-view {
    color: var(--primary-hover);
    font-weight: 600;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(0, 200, 150, 0.12);
    font-size: 0.84rem;
}

.btn-view:hover {
    background: var(--primary);
    color: #0b141a;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* States */
.state-box {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.spinner {
    width: 42px;
    height: 42px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.state-box h3 {
    color: var(--text-dark);
    margin-bottom: 6px;
    font-size: 1.08rem;
}

.error-text {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 6px;
    word-break: break-word;
}

/* Reader View */
.msg-toolbar {
    padding: 14px 22px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.msg-meta {
    padding: 22px;
    border-bottom: 1px solid var(--border);
}

.msg-subject {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #111827;
    word-break: break-word;
}

.msg-info {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
    word-break: break-all;
}

.msg-info strong {
    color: var(--text-dark);
}

.msg-body-text {
    padding: 24px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.96rem;
    color: #374151;
}

.msg-body-iframe {
    width: 100%;
    height: 560px;
    border: none;
    display: block;
    background: #fff;
}

.mode-tabs {
    display: inline-flex;
    gap: 6px;
}

.tab-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
}

.tab-btn.active {
    background: #1e2235;
    color: #fff;
    border-color: #1e2235;
}

.hidden {
    display: none !important;
}

footer {
    text-align: center;
    padding: 20px;
    font-size: 0.83rem;
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .email-box-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-primary,
    .btn-ghost {
        justify-content: center;
    }
    .hide-mobile {
        display: none;
    }
    .sender-cell {
        max-width: 140px;
    }
    .subject-cell {
        max-width: 160px;
    }
}
.action-buttons-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn.accent {
    background: var(--bg-dark-card);
    color: #fff;
    border-color: var(--bg-dark-card);
}

.action-btn.accent:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #0b141a;
}
/* Navbar API button & API Docs page */
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: 0.2s;
}

.nav-pill:hover,
.nav-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #0b141a;
}

.hero-compact {
    padding-bottom: 38px;
}

.api-base-box {
    margin-top: 20px;
    background: var(--bg-dark-card);
    border: 1px dashed rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    padding: 12px 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.api-base-box code {
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9rem;
    word-break: break-all;
}

.method-badge {
    background: rgba(0, 200, 150, 0.18);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.btn-copy-sm {
    background: var(--primary);
    color: #0b141a;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.api-container {
    margin-top: 26px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.api-card-body {
    padding: 20px 24px;
    font-size: 0.92rem;
    line-height: 1.6;
}

.code-line {
    margin-top: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
}

.endpoint-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.endpoint-item:first-child { padding-top: 0; }
.endpoint-item:last-child { border-bottom: none; padding-bottom: 0; }

.endpoint-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.endpoint-head code {
    background: #f1f5f9;
    color: #0f172a;
    padding: 5px 10px;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.83rem;
    word-break: break-all;
}

.endpoint-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
}

.tester-grid {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tester-input {
    flex: 1;
    min-width: 170px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.9rem;
    outline: none;
    background: #fff;
    color: var(--text-dark);
}

.tester-input:focus {
    border-color: var(--primary);
}

.tester-url-preview {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    word-break: break-all;
}

.code-tabs {
    display: flex;
    gap: 6px;
}

.code-tab {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    border: none;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.code-tab.active {
    background: var(--primary);
    color: #0b141a;
}

.code-block {
    background: #0f172a;
    color: #e2e8f0;
    padding: 18px;
    border-radius: 10px;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.84rem;
    line-height: 1.55;
    max-height: 420px;
}

.btn-copy-code {
    position: absolute;
    top: 30px;
    right: 34px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-copy-code:hover {
    background: var(--primary);
    color: #0b141a;
    border-color: var(--primary);
}
.navbar {
    flex-wrap: wrap;
    gap: 12px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
/* Top-right usage statistics pill */
.top-stats-bar {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px 20px 0;
    display: flex;
    justify-content: flex-end;
}

.stats-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    padding: 5px 13px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 500;
}

.stats-pill strong {
    color: #fff;
    font-weight: 700;
}

.stats-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

.stats-sep {
    color: rgba(255, 255, 255, 0.25);
}