        :root {
            --bg: #e3f0ff;
            --card-bg: #ffffff;
            --card-muted: #f8fafc;
            --primary: #2563eb;
            --primary-soft: #dbeafe;
            --success: #22c55e;
            --warning: #f59e0b;
            --danger: #ef4444;
            --text-main: #0f172a;
            --text-muted: #64748b;
            --border-subtle: #e2e8f0;
            --shadow-soft: 0 16px 40px rgba(15, 23, 42, 0.15);
        }

        :root[data-theme="dark"] {
            --bg: #020617;
            --card-bg: #020617;
            --card-muted: #020617;
            --primary: #38bdf8;
            --primary-soft: #0ea5e9;
            --success: #22c55e;
            --warning: #fbbf24;
            --danger: #f97373;
            --text-main: #e5e7eb;
            --text-muted: #9ca3af;
            --border-subtle: #1f2937;
            --shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.75);
        }

        * { box-sizing: border-box; }

        body {
            margin: 0;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            background: radial-gradient(circle at top, #dbeafe 0, #e3f0ff 45%, #e0ecff 100%);
            color: var(--text-main);
        }

        :root[data-theme="dark"] body {
            background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
        }

        .page {
            max-width: 1200px;
            margin: 0 auto;
            padding: 32px 16px 56px;
        }

        .topbar {
            background: var(--card-bg);
            border-radius: 999px;
            box-shadow: 0 20px 45px rgba(15, 23, 42, 0.22);
            padding: 10px 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
        }

        .logo {
            font-weight: 800;
            font-size: 24px;
            letter-spacing: .02em;
            color: #111827;
        }
        :root[data-theme="dark"] .logo {
            color: #e5e7eb;
        }

        .logo span {
            color: var(--primary);
        }

        .topbar-right {
            display: flex;
            align-items: center;
            gap: 18px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .chip-group {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 4px;
            border-radius: 999px;
            background: #f9fafb;
        }
        :root[data-theme="dark"] .chip-group {
            background: #020617;
            border: 1px solid #1f2937;
        }

        .chip {
            border-radius: 999px;
            padding: 4px 12px;
            border: 1px solid transparent;
            font-size: 11px;
            cursor: pointer;
            background: transparent;
            color: #475569;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        :root[data-theme="dark"] .chip {
            color: #9ca3af;
        }

        .chip-icon {
            font-size: 13px;
        }

        .chip-dot {
            display: inline-block;
            width: 10px;
            height: 10px;
            border-radius: 999px;
            border: 2px solid #facc15;
            background: #fffbe6;
        }

        .chip.active {
            background: #facc15;
            color: #0f172a;
            border-color: #eab308;
            box-shadow: 0 4px 9px rgba(234, 179, 8, .35);
        }

        .top-links {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 13px;
        }

        .top-links a {
            text-decoration: none;
            color: #475569;
            padding: 6px 10px;
            border-radius: 999px;
            transition: background .2s, color .2s;
        }
        :root[data-theme="dark"] .top-links a {
            color: #9ca3af;
        }

        .top-links a:hover {
            background: #eff6ff;
            color: var(--primary);
        }
        :root[data-theme="dark"] .top-links a:hover {
            background: #0b1120;
        }

        .main-title {
            margin-top: 26px;
            text-align: center;
            font-size: 26px;
            font-weight: 800;
        }

        .subtitle {
            text-align: center;
            margin-top: 4px;
            font-size: 13px;
            color: var(--text-muted);
        }

        .tagline {
            margin: 16px auto 22px;
            border-radius: 999px;
            background: var(--primary);
            color: #e0f2fe;
            padding: 6px 20px;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            box-shadow: 0 14px 30px rgba(37, 99, 235, .35);
        }

        .tagline span {
            white-space: nowrap;
        }

        .layout {
            margin-top: 12px;
            display: grid;
            grid-template-columns: minmax(0, 1fr) 220px;
            gap: 20px;
            align-items: flex-start;
        }

        @media (max-width: 920px) {
            .layout {
                grid-template-columns: minmax(0, 1fr);
            }
            .topbar {
                flex-direction: column;
                align-items: flex-start;
                border-radius: 24px;
            }
            .topbar-right {
                justify-content: flex-start;
            }
        }

        .card {
            background: var(--card-bg);
            border-radius: 26px;
            box-shadow: var(--shadow-soft);
            padding: 22px 26px;
        }
        :root[data-theme="dark"] .card {
            border: 1px solid #1f2937;
        }

        .card + .card {
            margin-top: 18px;
        }

        .email-card {
            padding-top: 26px;
        }

        .side-column {
            display: flex;
            flex-direction: column;
            gap: 14px;
        }

        .side-card {
            background: var(--card-bg);
            border-radius: 18px;
            padding: 16px 14px;
            box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
            text-align: center;
            font-size: 13px;
        }
        :root[data-theme="dark"] .side-card {
            border: 1px solid #1f2937;
        }

        .side-icon {
            width: 40px;
            height: 40px;
            border-radius: 999px;
            background: #f97316;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 8px;
            font-size: 20px;
            color: #fff;
        }

        .side-card:nth-child(2) .side-icon {
            background: var(--primary);
        }

        .side-title {
            font-weight: 700;
            margin-bottom: 4px;
        }

        .side-sub {
            color: var(--text-muted);
            margin-bottom: 10px;
        }

        .side-btn {
            border: none;
            border-radius: 999px;
            padding: 7px 16px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            background: #0ea5e9;
            color: white;
            box-shadow: 0 8px 18px rgba(14, 165, 233, .45);
        }

        .side-btn.secondary {
            background: #4b5563;
            box-shadow: 0 8px 18px rgba(15, 23, 42, .5);
        }

        .email-input-row {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 12px;
        }

        .email-input-row input[type="text"] {
            flex: 1;
            border-radius: 999px;
            border: 1px solid var(--border-subtle);
            padding: 0 16px;
            height: 46px;
            font-size: 14px;
            outline: none;
            background: #f8fafc;
        }
        :root[data-theme="dark"] .email-input-row input[type="text"] {
            background: #020617;
            color: #e5e7eb;
        }

        .email-input-row input[type="text"]:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 1px var(--primary-soft);
            background: #ffffff;
        }
        :root[data-theme="dark"] .email-input-row input[type="text"]:focus {
            background: #020617;
        }

        .email-input-row select {
            border-radius: 999px;
            border: 1px solid var(--border-subtle);
            padding: 0 36px 0 14px;
            height: 46px;
            font-size: 13px;
            outline: none;
            background: #f8fafc;
            appearance: none;
            background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%),
                              linear-gradient(135deg, #94a3b8 50%, transparent 50%);
            background-position: calc(100% - 14px) 18px, calc(100% - 9px) 18px;
            background-size: 7px 7px;
            background-repeat: no-repeat;
        }
        :root[data-theme="dark"] .email-input-row select {
            background: #020617;
            color: #e5e7eb;
        }

        .status-pill {
            border-radius: 999px;
            font-size: 12px;
            padding: 6px 12px;
            border: 1px solid #bbf7d0;
            color: #15803d;
            background: #dcfce7;
            font-weight: 600;
            white-space: nowrap;
        }

        .status-pill.offline {
            border-color: #fecaca;
            background: #fee2e2;
            color: #b91c1c;
        }

        .url-row {
            border-radius: 999px;
            background: #f3f4f6;
            padding: 10px 18px;
            font-size: 13px;
            color: var(--text-muted);
            margin-bottom: 16px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        :root[data-theme="dark"] .url-row {
            background: #020617;
            border: 1px solid #1f2937;
        }

        .url-row a {
            color: #111827;
            text-decoration: none;
            font-weight: 600;
        }
        :root[data-theme="dark"] .url-row a {
            color: #e5e7eb;
        }

        .btn-row {
            display: flex;
            justify-content: center;
            gap: 12px;
            flex-wrap: wrap;
        }

        .btn-pill {
            border: none;
            border-radius: 999px;
            padding: 10px 20px;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            box-shadow: 0 10px 22px rgba(15, 23, 42, 0.22);
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: #ffffff;
        }

        .btn-blue  { background: #2563eb; }
        .btn-amber { background: #f59e0b; }
        .btn-green { background: #22c55e; }
        .btn-red   { background: #ef4444; }

        .btn-pill:disabled {
            opacity: .6;
            cursor: default;
            box-shadow: none;
        }

        .inbox-title {
            font-weight: 700;
            margin-bottom: 16px;
            font-size: 16px;
        }

        .inbox-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 14px;
            font-size: 12px;
            color: var(--text-muted);
        }

        .inbox-left, .inbox-center, .inbox-right {
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }

        .select-small {
            height: 30px;
            border-radius: 999px;
            border: 1px solid var(--border-subtle);
            padding: 0 10px;
            font-size: 12px;
        }
        :root[data-theme="dark"] .select-small {
            background: #020617;
            color: #e5e7eb;
        }

        .search-2fa {
            position: relative;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }

        .search-2fa input {
            border-radius: 999px;
            border: 1px solid var(--border-subtle);
            padding: 0 0 0 12px;
            height: 30px;
            font-size: 12px;
            outline: none;
            background: #f9fafb;
        }
        :root[data-theme="dark"] .search-2fa input {
            background: #020617;
            color: #e5e7eb;
        }

        .search-2fa .search-icon {
            position: absolute;
            right: 28px;
            font-size: 11px;
            color: #9ca3af;
        }

        .btn-2fa {
            border: none;
            border-radius: 999px;
            padding: 6px 14px;
            background: #fbbf24;
            font-size: 11px;
            color: #111827;
            font-weight: 700;
            cursor: pointer;
            box-shadow: 0 8px 18px rgba(245, 158, 11, .4);
        }

        table.mail-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 13px;
        }

        table.mail-table thead {
            background: #f8fafc;
        }
        :root[data-theme="dark"] table.mail-table thead {
            background: #020617;
        }

        table.mail-table th,
        table.mail-table td {
            padding: 8px 10px;
            border-bottom: 1px solid #e5e7eb;
            text-align: left;
            white-space: nowrap;
        }
        :root[data-theme="dark"] table.mail-table th,
        :root[data-theme="dark"] table.mail-table td {
            border-bottom-color: #1f2937;
        }

        table.mail-table th {
            font-weight: 600;
            color: #4b5563;
        }
        :root[data-theme="dark"] table.mail-table th {
            color: #9ca3af;
        }

        table.mail-table tbody tr:hover {
            background: #f1f5f9;
        }
        :root[data-theme="dark"] table.mail-table tbody tr:hover {
            background: #020617;
        }

        .star {
            color: #facc15;
            margin-left: 4px;
        }

        .btn-table {
            border-radius: 999px;
            border: none;
            padding: 5px 10px;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            color: #ffffff;
        }

        .btn-table.view { background: #2563eb; }
        .btn-table.delete { background: #ef4444; }

        .pager {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            color: var(--text-muted);
        }

        .pager button {
            border-radius: 999px;
            border: 1px solid var(--border-subtle);
            padding: 4px 9px;
            font-size: 11px;
            background: #f9fafb;
            cursor: pointer;
        }
        :root[data-theme="dark"] .pager button {
            background: #020617;
            color: #e5e7eb;
        }

        .email-detail {
            margin-top: 18px;
            background: #f9fafb;
            border-radius: 20px;
            padding: 18px 18px 16px;
        }
        :root[data-theme="dark"] .email-detail {
            background: #020617;
            border: 1px solid #1f2937;
        }

        .email-detail-title {
            text-align: center;
            font-weight: 700;
            font-size: 14px;
            margin-bottom: 12px;
        }

        .detail-row {
            display: flex;
            gap: 6px;
            margin-bottom: 4px;
            font-size: 13px;
        }

        .detail-label {
            width: 70px;
            font-weight: 600;
            color: #475569;
        }
        :root[data-theme="dark"] .detail-label {
            color: #9ca3af;
        }

        .detail-value {
            flex: 1;
            color: #0f172a;
        }
        :root[data-theme="dark"] .detail-value {
            color: #e5e7eb;
        }

        .detail-body-box {
            margin-top: 8px;
            background: #ffffff;
            border-radius: 14px;
            border: 1px solid var(--border-subtle);
            padding: 10px 12px;
            min-height: 70px;
            font-size: 13px;
            white-space: pre-wrap;
            color: #0f172a;
        }
        :root[data-theme="dark"] .detail-body-box {
            background: #020617;
            border-color: #1f2937;
            color: #e5e7eb;
        }

        .loading-dot {
            display: none;
            margin-left: 6px;
            font-size: 11px;
        }

        .empty-state {
            margin-top: 24px;
            padding: 46px 10px 40px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: var(--text-muted);
        }
        .empty-icon {
            width: 76px;
            height: 76px;
            border-radius: 999px;
            background: #e5edff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 34px;
            margin-bottom: 12px;
            color: #475569;
        }
        :root[data-theme="dark"] .empty-icon {
            background: #020617;
            border: 1px solid #1f2937;
            color: #9ca3af;
        }

        .empty-title {
            font-size: 14px;
            font-weight: 700;
            color: #374151;
            margin-bottom: 4px;
        }
        :root[data-theme="dark"] .empty-title {
            color: #e5e7eb;
        }

        .empty-sub {
            font-size: 12px;
        }

        .corner-clock {
            position: fixed;
            right: 22px;
            bottom: 18px;
            background: #ffffff;
            border-radius: 999px;
            padding: 6px 14px;
            font-size: 11px;
            color: #4b5563;
            border: 1px solid #e5e7eb;
            box-shadow: 0 12px 26px rgba(15, 23, 42, 0.25);
        }
        .corner-clock span {
            font-weight: 600;
            color: #111827;
        }
        :root[data-theme="dark"] .corner-clock {
            background: #020617;
            border-color: #1f2937;
            color: #e5e7eb;
        }
        :root[data-theme="dark"] .corner-clock span {
            color: #e5e7eb;
        }

        .toast-2fa {
            position: fixed;
            right: 36px;
            top: 140px;
            min-width: 230px;
            max-width: 300px;
            padding: 10px 16px;
            border-radius: 999px;
            font-size: 12px;
            background: #16a34a;
            color: #ecfdf3;
            box-shadow: 0 18px 40px rgba(22, 163, 74, .55);
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transform: translateY(-10px);
            pointer-events: none;
            transition: opacity .25s ease, transform .25s ease;
            z-index: 40;
        }
        .toast-2fa.show {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }