:root {
    color-scheme: dark;
    --bg: #090b10;
    --surface: #11151c;
    --surface-2: #181e28;
    --surface-3: #202836;
    --text: #edf1f7;
    --muted: #9ba6b7;
    --subtle: #697588;
    --border: #29313e;
    --primary: #8aa7ff;
    --primary-strong: #6d8cf8;
    --grad: linear-gradient(135deg, #4d75f5 0%, #785cf2 100%);
    --grad-hover: linear-gradient(135deg, #6085ff 0%, #8b73ff 100%);
    --danger: #ff777f;
    --ok: #43d5a0;
    --glass: rgba(9, 11, 16, 0.92);
    --radius: 18px;
    --radius-sm: 12px;
    --msg-bg: #171b22;
    --msg-text: #e6eaf1;
    --shadow-card: 0 14px 38px rgba(0, 0, 0, 0.16);
    --shadow-float: 0 24px 80px rgba(0, 0, 0, 0.38);
    --focus: 0 0 0 3px rgba(111, 143, 255, 0.28);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f4f6fa;
    --surface: #ffffff;
    --surface-2: #f2f4f9;
    --surface-3: #e9edf5;
    --text: #202736;
    --muted: #687387;
    --subtle: #8993a3;
    --border: #e0e5ee;
    --primary: #475fd5;
    --primary-strong: #354fc8;
    --grad: linear-gradient(135deg, #4a65dd 0%, #7358df 100%);
    --grad-hover: linear-gradient(135deg, #5875f1 0%, #8369ed 100%);
    --danger: #c83849;
    --ok: #0c9067;
    --glass: rgba(255, 255, 255, 0.92);
    --msg-bg: #ffffff;
    --msg-text: #202631;
    --shadow-card: 0 10px 30px rgba(32, 47, 77, 0.055);
    --shadow-float: 0 24px 80px rgba(23, 34, 56, 0.18);
    --focus: 0 0 0 3px rgba(72, 95, 213, 0.19);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    min-width: 320px;
    height: 100%;
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    min-width: 320px;
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 180ms ease, color 180ms ease;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button,
[role="button"],
select {
    touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
[role="button"]:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

button:disabled {
    cursor: wait !important;
    opacity: 0.65;
}

img,
svg,
iframe {
    max-width: 100%;
}

.hidden {
    display: none !important;
}

.truncate {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.material-symbols-outlined {
    font-size: 21px;
    line-height: 1;
    font-weight: normal;
    font-style: normal;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    font-feature-settings: "liga";
    -webkit-font-feature-settings: "liga";
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

.app-wrapper {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1680px;
    height: 100dvh;
    min-height: 0;
    margin: 0 auto;
    overflow: hidden;
    background: var(--bg);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.08);
}

.app-wrapper::before,
.app-wrapper::after {
    position: absolute;
    z-index: -1;
    width: 430px;
    height: 430px;
    border-radius: 50%;
    content: "";
    pointer-events: none;
    filter: blur(95px);
    opacity: 0.13;
}

.app-wrapper::before {
    top: -280px;
    left: -190px;
    background: #526fff;
}

.app-wrapper::after {
    top: 30%;
    right: -320px;
    background: #7a5af8;
}

#toast-container {
    position: fixed;
    z-index: 1000;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary-strong);
    border-radius: 13px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 600;
    box-shadow: var(--shadow-float);
    animation: toastIn 220ms ease-out both;
}

.toast .material-symbols-outlined {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: 19px;
}

.toast-message {
    min-width: 0;
    overflow-wrap: anywhere;
}

.toast-success {
    border-left-color: var(--ok);
}

.toast-success .material-symbols-outlined {
    color: var(--ok);
}

.toast-danger {
    border-left-color: var(--danger);
}

.toast-danger .material-symbols-outlined {
    color: var(--danger);
}

.toast-create {
    border-left-color: #a28bff;
}

.toast-create .material-symbols-outlined {
    color: #a28bff;
}

.toast-leaving {
    animation: toastOut 200ms ease-in both;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-7px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-5px);
    }
}

.topbar {
    position: relative;
    z-index: 20;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    min-height: 74px;
    padding: 15px clamp(18px, 3vw, 34px);
    border-bottom: 1px solid var(--border);
    background: var(--glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.brand-badge {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: var(--grad);
    color: #fff;
    box-shadow: 0 5px 16px rgba(84, 105, 232, 0.28);
    transform: rotate(-4deg);
}

.brand-badge .material-symbols-outlined {
    font-size: 22px;
}

.brand-text {
    overflow: hidden;
    color: var(--text);
    font-family: Sora, Inter, sans-serif;
    font-size: clamp(0.91rem, 2vw, 1.04rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-text b {
    margin-left: 4px;
    color: var(--primary);
}

.brand-subtext {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.topbar-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-quick-otp {
    border-color: rgba(67, 213, 160, 0.3);
    background: rgba(67, 213, 160, 0.09);
    color: var(--ok);
}

.topbar-quick-otp:hover {
    background: rgba(67, 213, 160, 0.16);
    border-color: rgba(67, 213, 160, 0.5);
}

.auto-refresh,
.icon-btn {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.auto-refresh {
    width: 38px;
    height: 38px;
    border-color: var(--border);
    background: var(--surface-2);
    color: var(--muted);
}

.auto-refresh .material-symbols-outlined {
    font-size: 20px;
}

.auto-refresh.is-refreshing {
    border-color: rgba(67, 213, 160, 0.35);
    background: rgba(67, 213, 160, 0.09);
    color: var(--ok);
    box-shadow: 0 0 0 3px rgba(67, 213, 160, 0.055);
}

.auto-refresh.is-refreshing .material-symbols-outlined,
.spinner {
    animation: spin 850ms linear infinite;
}

.icon-btn {
    cursor: pointer;
}

.icon-btn:hover {
    border-color: var(--border);
    background: var(--surface-2);
    color: var(--text);
}

.icon-btn:active {
    transform: scale(0.96);
}

.theme-toggle {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.theme-toggle .material-symbols-outlined {
    font-size: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.main-content {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 24px clamp(16px, 3vw, 34px) 104px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-color: var(--surface-3) transparent;
    scrollbar-width: thin;
}

.main-content::-webkit-scrollbar {
    width: 7px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 8px;
    background: var(--surface-3);
    background-clip: padding-box;
}

.page {
    width: 100%;
    min-width: 0;
    margin: 0 auto;
    animation: pageEnter 220ms ease-out both;
}

@keyframes pageEnter {
    from {
        opacity: 0.55;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    min-width: 0;
    margin: 0 0 18px;
    padding: clamp(18px, 2.2vw, 25px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-card);
    transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 19px;
    color: var(--text);
    font-family: Sora, Inter, sans-serif;
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.3;
}

.card-title .material-symbols-outlined {
    color: var(--primary);
    font-size: 22px;
}

.card-head-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.hero-card {
    position: relative;
    isolation: isolate;
    min-width: 0;
    margin: 0 0 18px;
    padding: clamp(24px, 3vw, 32px) clamp(18px, 2.6vw, 28px) 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 22px;
    background: var(--grad);
    color: #fff;
    box-shadow: 0 14px 36px rgba(74, 93, 210, 0.17);
}

.hero-card::after {
    position: absolute;
    z-index: -1;
    top: -100px;
    right: -70px;
    width: 260px;
    height: 260px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    box-shadow: 0 0 0 34px rgba(255, 255, 255, 0.035), 0 0 0 70px rgba(255, 255, 255, 0.025);
    content: "";
    pointer-events: none;
}

.hero-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.075em;
    text-align: center;
    text-transform: uppercase;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #78f1be;
    box-shadow: 0 0 0 4px rgba(120, 241, 190, 0.13);
}

.hero-email {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 35px;
    margin: 0 auto 25px;
    color: #fff;
    font-family: Sora, Inter, sans-serif;
    font-size: clamp(1.03rem, 3.5vw, 1.45rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
    cursor: pointer;
}

.hero-actions {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.action-btn {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    min-height: 76px;
    padding: 0 4px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: background-color 160ms ease, transform 160ms ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.action-btn:active {
    transform: translateY(1px) scale(0.98);
}

.action-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.14);
    transition: transform 160ms ease, background-color 160ms ease;
}

.action-icon .material-symbols-outlined {
    font-size: 21px;
}

.action-btn span:last-child {
    font-size: 0.75rem;
    font-weight: 600;
}

.danger-btn .action-icon {
    background: rgba(185, 33, 52, 0.27);
    border-color: rgba(255, 255, 255, 0.12);
}

.create-form {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    min-height: 52px;
    padding: 0 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-2);
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.input-group:focus-within {
    border-color: var(--primary);
    box-shadow: var(--focus);
}

.input-group > .material-symbols-outlined {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 20px;
}

.input-group input,
.domain-dropdown {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 12px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 0.9rem;
}

.input-group input::placeholder {
    color: var(--subtle);
    opacity: 1;
}

.domain-dropdown {
    cursor: pointer;
}

.domain-dropdown option,
select option {
    background: var(--surface);
    color: var(--text);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 17px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: var(--grad);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.btn:hover {
    background: var(--grad-hover);
    box-shadow: 0 8px 20px rgba(81, 93, 215, 0.2);
}

.btn:active {
    transform: translateY(1px) scale(0.99);
}

.btn .material-symbols-outlined {
    font-size: 19px;
}

.btn-block {
    width: 100%;
}

.btn-secondary {
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--surface-3);
    box-shadow: none;
}

.btn-soft-danger {
    border-color: rgba(220, 70, 86, 0.23);
    background: rgba(220, 70, 86, 0.1);
    color: var(--danger);
}

.btn-soft-danger:hover {
    border-color: rgba(220, 70, 86, 0.42);
    background: rgba(220, 70, 86, 0.16);
    box-shadow: none;
}

.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 7px 11px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 650;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn-sm:hover {
    border-color: var(--subtle);
    background: var(--surface-3);
}

.btn-sm:active {
    transform: scale(0.98);
}

.btn-sm .material-symbols-outlined {
    font-size: 17px;
}

.btn-sm.btn-danger {
    border-color: rgba(220, 70, 86, 0.25);
    background: rgba(220, 70, 86, 0.09);
    color: var(--danger);
}

.inbox-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.inbox-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.inbox-head .card-title {
    margin: 0;
}

.inbox-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 28px;
    padding: 0 9px;
    border: 1px solid rgba(116, 141, 255, 0.16);
    border-radius: 9px;
    background: rgba(116, 141, 255, 0.1);
    color: var(--primary);
    font-size: 0.77rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.search-field {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    margin-bottom: 14px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--muted);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-field:focus-within {
    border-color: var(--primary);
    box-shadow: var(--focus);
}

.search-field > .material-symbols-outlined {
    flex: 0 0 auto;
    font-size: 19px;
}

.search-field input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 0.84rem;
}

.search-field input::placeholder {
    color: var(--subtle);
}

.search-field kbd {
    flex: 0 0 auto;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--surface);
    color: var(--subtle);
    font-family: inherit;
    font-size: 0.68rem;
}

.email-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.email-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
    padding: 14px 12px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    cursor: pointer;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.email-item:hover {
    border-color: var(--border);
    background: var(--surface-2);
}

.email-item:active {
    transform: scale(0.997);
}

.avatar-circle {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 43px;
    height: 43px;
    margin-top: 1px;
    border: 1px solid rgba(120, 145, 255, 0.18);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(117, 143, 255, 0.16), rgba(148, 105, 245, 0.11));
    color: var(--primary);
    font-size: 0.87rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.email-content {
    flex: 1 1 auto;
    min-width: 0;
}

.em-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    margin-bottom: 4px;
}

.em-sender-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1 1 auto;
    min-width: 0;
}

.unread-dot {
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary-strong);
    box-shadow: 0 0 0 3px rgba(109, 140, 248, 0.11);
}

.em-sender {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 0.87rem;
    font-weight: 650;
    text-overflow: ellipsis;
}

.em-sender.unread-sender {
    font-weight: 800;
}

.em-date {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    max-width: 44%;
    min-height: 23px;
    gap: 4px;
    padding: 3px 7px;
    overflow: hidden;
    border: 1px solid rgba(67, 213, 160, 0.18);
    border-radius: 7px;
    background: rgba(67, 213, 160, 0.08);
    color: var(--ok);
    font-size: 0.67rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.em-date.is-today {
    border-color: rgba(111, 140, 248, 0.18);
    background: rgba(111, 140, 248, 0.08);
    color: var(--primary);
}

.em-date.is-older {
    border-color: var(--border);
    background: var(--surface-2);
    color: var(--muted);
}

.email-item.is-unread {
    border-color: rgba(111, 140, 248, 0.14);
    background: rgba(111, 140, 248, 0.035);
}

.email-item.is-unread:hover {
    border-color: rgba(111, 140, 248, 0.27);
    background: rgba(111, 140, 248, 0.07);
}

.em-sender-email {
    display: block;
    min-width: 0;
    margin-bottom: 5px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 0.73rem;
    line-height: 1.45;
}

.em-subject-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.em-subject {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 550;
    line-height: 1.45;
}

.inline-otp-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    height: 26px;
    padding: 0 8px;
    border: 1px solid rgba(67, 213, 160, 0.3);
    border-radius: 8px;
    background: rgba(67, 213, 160, 0.1);
    color: var(--ok);
    font-family: Sora, ui-monospace, monospace;
    font-size: 0.73rem;
    font-weight: 750;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease;
}

.inline-otp-chip:hover {
    background: rgba(67, 213, 160, 0.22);
    border-color: rgba(67, 213, 160, 0.55);
}

.inline-otp-chip .material-symbols-outlined {
    font-size: 14px;
}

.em-preview {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.attachment-indicator {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 16px;
}

.admin-item {
    align-items: center;
}

.admin-checkbox {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 36px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.admin-checkbox:hover {
    background: var(--surface-3);
}

.check-icon {
    font-size: 22px;
    transition: color 150ms ease;
}

.check-icon.checked {
    color: var(--primary);
}

.admin-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.admin-meta .em-sender-email {
    margin: 0;
}

.admin-last-seen {
    color: var(--muted);
    font-size: 0.7rem;
}

.admin-open-icon {
    flex: 0 0 auto;
    color: var(--subtle);
    font-size: 21px;
}

.history-del-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.empty-state {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 7px;
    padding: 48px 18px;
    color: var(--muted);
    text-align: center;
}

.empty-state strong {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
}

.empty-state p {
    max-width: 280px;
    margin: 0;
    color: var(--muted);
    font-size: 0.79rem;
    line-height: 1.55;
}

.empty-icon {
    margin-bottom: 6px;
    color: var(--subtle);
    font-size: 32px;
    opacity: 0.75;
}

.bottom-nav {
    position: absolute;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 4px;
    min-height: calc(75px + env(safe-area-inset-bottom));
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.nav-item {
    display: flex;
    align-items: center;
    flex: 1 1 0;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    min-height: 54px;
    padding: 7px 5px;
    border: 1px solid transparent;
    border-radius: 13px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 170ms ease, color 170ms ease, border-color 170ms ease;
}

.nav-item .material-symbols-outlined {
    font-size: 22px;
    transition: transform 170ms ease;
}

.nav-item span:last-child {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.67rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-item:hover {
    color: var(--text);
}

.nav-item.active {
    border-color: rgba(121, 144, 255, 0.14);
    background: rgba(111, 137, 255, 0.1);
    color: var(--primary);
}

.nav-item.active .material-symbols-outlined {
    transform: translateY(-1px);
    font-variation-settings: "FILL" 1;
}

.app-footer {
    padding: 16px 0 8px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 500;
    text-align: center;
}

.app-footer .author {
    display: inline-block;
    color: var(--primary);
    font-family: Sora, Inter, sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    background: linear-gradient(100deg, #ff9a3c 0%, #ec4899 32%, #717dff 65%, #39cba0 88%, #ff9a3c 100%);
    background-size: 220% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: authorShine 3.2s linear infinite;
}

@keyframes authorShine {
    to {
        background-position: 220% center;
    }
}

.modal-overlay {
    position: fixed;
    z-index: 200;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    overflow: auto;
    background: rgba(3, 5, 10, 0.66);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    animation: overlayIn 170ms ease-out both;
}

@keyframes overlayIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-full {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg);
    box-shadow: var(--shadow-float);
    animation: modalSlideIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes modalSlideIn {
    from {
        opacity: 0.7;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 66px;
    padding: 10px 14px;
    padding-top: max(10px, env(safe-area-inset-top));
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.modal-header h3 {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    color: var(--text);
    font-family: Sora, Inter, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 17px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg);
}

.loading-body {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    min-height: 260px;
    color: var(--muted);
    font-size: 0.85rem;
}

.loading-body p {
    margin: 0;
}

.loading-icon {
    color: var(--primary);
    font-size: 31px;
}

.message-intro {
    margin: 0 auto 18px;
}

.message-subject {
    margin: 1px 0 19px;
    color: var(--text);
    font-family: Sora, Inter, sans-serif;
    font-size: clamp(1.16rem, 2.4vw, 1.55rem);
    font-weight: 700;
    letter-spacing: -0.055em;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.mail-meta {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    min-width: 0;
    padding: 0 0 18px;
    border-bottom: 1px solid var(--border);
}

.avatar-large {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    font-size: 0.83rem;
}

.meta-details {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.meta-sender {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.meta-email {
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.message-date {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.5;
}

.date-divider {
    color: var(--subtle);
}

.mail-details {
    min-width: 0;
    margin-top: 9px;
}

.mail-details summary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    padding: 4px 8px 4px 0;
    color: var(--primary);
    font-size: 0.77rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.mail-details summary::-webkit-details-marker {
    display: none;
}

.mail-details summary .material-symbols-outlined {
    font-size: 17px;
    transition: transform 150ms ease;
}

.mail-details[open] summary .material-symbols-outlined {
    transform: rotate(180deg);
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin: 8px 0 2px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
}

.detail-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
}

.detail-row:last-child {
    border-bottom: 0;
}

.detail-row-wide {
    grid-column: 1 / -1;
}

.detail-label {
    display: inline-flex;
    align-items: flex-start;
    gap: 5px;
    color: var(--muted);
    font-weight: 650;
}

.detail-label .material-symbols-outlined {
    font-size: 16px;
}

.detail-value {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    color: var(--text);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.detail-value > span,
.detail-value > strong {
    overflow-wrap: anywhere;
}

.address-person {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 5px;
}

.address-person:last-child {
    margin-bottom: 0;
}

.address-name {
    color: var(--text);
    font-weight: 650;
}

.address-email {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.detail-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.7rem;
    word-break: break-all;
}

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.attachment-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
}

.attachment-chip > .material-symbols-outlined {
    flex: 0 0 auto;
    color: var(--primary);
    font-size: 19px;
}

.attachment-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.attachment-copy strong {
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 0.74rem;
    font-weight: 650;
}

.attachment-copy small {
    color: var(--muted);
    font-size: 0.66rem;
    overflow-wrap: anywhere;
}

.otp-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid rgba(36, 183, 132, 0.25);
    border-radius: 14px;
    background: rgba(36, 183, 132, 0.075);
}

.otp-banner-left {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.otp-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(36, 183, 132, 0.13);
    color: var(--ok);
}

.otp-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.otp-label {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.otp-value {
    color: var(--text);
    font-family: Sora, ui-monospace, monospace;
    font-size: clamp(1.2rem, 4vw, 1.55rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    overflow-wrap: anywhere;
}

.btn-copy-otp {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.btn-copy-otp:hover,
.btn-copy-otp.copied {
    border-color: var(--ok);
    color: var(--ok);
}

.msg-content {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--msg-bg);
    box-shadow: var(--shadow-card);
}

.msg-content iframe {
    display: block;
    width: 100%;
    height: min(72vh, 900px);
    min-height: 400px;
    border: 0;
    background: var(--msg-bg);
}

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

.fetcher-btn-group {
    display: flex;
    gap: 8px;
}

.quick-otp-result {
    margin-top: 14px;
}

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

.stat-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
}

.stat-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: rgba(111, 140, 248, 0.1);
    color: var(--primary);
}

.stat-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.stat-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 650;
}

.stat-copy strong {
    color: var(--text);
    font-family: Sora, Inter, sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
}

.admin-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-2);
}

.admin-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 0;
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 0.79rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}

.admin-tab:hover {
    color: var(--text);
}

.admin-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.admin-tab .material-symbols-outlined {
    font-size: 18px;
}

.admin-controls-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.admin-search-box {
    flex: 1 1 240px;
    margin: 0;
}

.admin-sort-select {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 12px;
    outline: none;
    border-radius: 10px;
    height: 44px;
}

.admin-bulk-actions {
    display: flex;
    gap: 8px;
}

.domain-chips-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.domain-chip-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
}

.domain-chip-info {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
}

.domain-chip-info .material-symbols-outlined {
    color: var(--primary);
    font-size: 20px;
}

.playground-grid {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.modal-sheet {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    width: 100%;
    max-height: min(92dvh, 780px);
    padding: 20px 20px calc(22px + env(safe-area-inset-bottom));
    overflow-y: auto;
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background: var(--surface);
    box-shadow: var(--shadow-float);
    animation: sheetIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes sheetIn {
    from {
        opacity: 0.65;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sheet-handle {
    align-self: center;
    width: 38px;
    height: 4px;
    margin: 0 0 20px;
    border-radius: 10px;
    background: var(--subtle);
    opacity: 0.45;
}

.sheet-icon {
    display: grid;
    align-self: center;
    place-items: center;
    width: 48px;
    height: 48px;
    margin: 0 0 13px;
    border: 1px solid rgba(117, 141, 255, 0.2);
    border-radius: 15px;
    background: rgba(117, 141, 255, 0.1);
    color: var(--primary);
}

.sheet-icon .material-symbols-outlined {
    font-size: 24px;
}

.sheet-icon-danger {
    border-color: rgba(220, 70, 86, 0.2);
    background: rgba(220, 70, 86, 0.09);
    color: var(--danger);
}

.modal-sheet h3 {
    margin: 0 0 8px;
    color: var(--text);
    font-family: Sora, Inter, sans-serif;
    font-size: 1.12rem;
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1.35;
    text-align: center;
}

.sheet-description {
    max-width: 420px;
    margin: 0 auto 19px;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
    text-align: center;
}

.confirm-sheet > .btn,
.confirm-sheet > .btn-sheet-close {
    margin-top: 9px;
}

.btn-sheet-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 47px;
    margin-top: 11px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease;
}

.btn-sheet-close:hover {
    border-color: var(--subtle);
    background: var(--surface-3);
}

.qr-frame {
    align-self: center;
    margin: 8px auto 14px;
    padding: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 15px;
    background: #fff;
}

.qr-frame img {
    display: block;
    width: min(240px, 62vw);
    height: auto;
    aspect-ratio: 1;
}

.qr-text {
    margin: 0 0 15px;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.79rem;
    overflow-wrap: anywhere;
    text-align: center;
}

.docs-card {
    max-width: 1050px;
    margin-right: auto;
    margin-left: auto;
}

.docs-intro {
    margin-bottom: 21px;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1.7;
}

.docs-intro strong {
    color: var(--text);
}

.docs-intro code,
.api-desc code,
.api-info-box code {
    border-radius: 5px;
    padding: 2px 5px;
    background: var(--surface-3);
    color: var(--primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    overflow-wrap: anywhere;
}

.api-endpoint {
    margin-bottom: 22px;
    padding-bottom: 23px;
    border-bottom: 1px solid var(--border);
}

.api-endpoint:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.api-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border: 1px solid transparent;
    border-radius: 7px;
    font-size: 0.65rem;
    font-weight: 850;
    letter-spacing: 0.05em;
}

.badge.get {
    border-color: rgba(36, 183, 132, 0.25);
    background: rgba(36, 183, 132, 0.09);
    color: var(--ok);
}

.badge.post {
    border-color: rgba(106, 132, 245, 0.25);
    background: rgba(106, 132, 245, 0.1);
    color: var(--primary);
}

.api-path {
    min-width: 0;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.86rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.api-desc {
    margin: 0 0 15px;
    color: var(--muted);
    font-size: 0.83rem;
    line-height: 1.65;
}

.api-info-box {
    margin: 15px 0;
    padding: 13px 14px;
    border: 1px solid rgba(106, 132, 245, 0.18);
    border-left: 3px solid var(--primary);
    border-radius: 10px;
    background: rgba(106, 132, 245, 0.06);
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.api-info-box strong {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
}

.code-box {
    margin-bottom: 11px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
}

.code-box:last-child {
    margin-bottom: 0;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
    padding: 5px 11px 5px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-3);
}

.code-lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.code-lang .material-symbols-outlined {
    font-size: 16px;
}

.icon-btn-sm {
    display: grid;
    place-items: center;
    width: 33px;
    height: 33px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.icon-btn-sm:hover,
.icon-btn-sm.copied {
    border-color: var(--border);
    background: var(--surface);
    color: var(--ok);
}

.icon-btn-sm .material-symbols-outlined {
    font-size: 17px;
}

.code-box pre {
    margin: 0;
    padding: 15px;
    overflow-x: auto;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.76rem;
    line-height: 1.65;
    tab-size: 4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

@media (min-width: 640px) {
    .main-content {
        padding-top: 28px;
    }
    .hero-card {
        padding-right: 28px;
        padding-left: 28px;
    }
    .email-item {
        padding: 14px 13px;
    }
    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 22px;
        padding-right: 15px;
        padding-left: 15px;
    }
    .detail-row-wide {
        grid-column: 1 / -1;
    }
    .admin-stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 800px) and (max-width: 1039px) {
    .main-content {
        max-width: 1000px;
        margin: 0 auto;
    }
    #view-dashboard:not(.hidden) {
        display: grid;
        grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
        align-items: start;
        gap: 18px;
    }
    #view-dashboard .hero-card,
    #view-dashboard .create-card {
        grid-column: 1;
    }
    #view-dashboard .inbox-card {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
    #view-dashboard .app-footer {
        grid-column: 1 / -1;
    }
    .bottom-nav {
        min-height: 68px;
    }
    .nav-item {
        flex-direction: row;
        flex: 0 1 150px;
        gap: 9px;
        min-height: 44px;
    }
    .nav-item span:last-child {
        font-size: 0.76rem;
    }
}

@media (min-width: 1040px) {
    .app-wrapper {
        max-width: 1920px;
    }
    .topbar {
        min-height: 78px;
        padding-right: 34px;
        padding-left: 30px;
    }
    .main-content {
        width: calc(100% - 224px);
        margin-left: 224px;
        padding: 28px clamp(26px, 3vw, 48px) 24px;
    }
    .bottom-nav {
        top: 78px;
        right: auto;
        bottom: 0;
        left: 0;
        display: flex;
        align-items: stretch;
        flex-direction: column;
        justify-content: flex-start;
        gap: 6px;
        width: 224px;
        min-height: 0;
        padding: 26px 14px;
        border-top: 0;
        border-right: 1px solid var(--border);
        background: var(--bg);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
    .bottom-nav::before {
        margin: 0 12px 12px;
        color: var(--subtle);
        content: "WORKSPACE";
        font-size: 0.65rem;
        font-weight: 800;
        letter-spacing: 0.11em;
    }
    .nav-item {
        align-items: center;
        flex: 0 0 auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 13px;
        width: 100%;
        min-height: 48px;
        padding: 10px 13px;
        border: 1px solid transparent;
        border-radius: 12px;
    }
    .nav-item .material-symbols-outlined {
        font-size: 21px;
    }
    .nav-item span:last-child {
        font-size: 0.81rem;
    }
    .main-content {
        padding-bottom: 28px;
    }
    #view-dashboard:not(.hidden) {
        display: grid;
        grid-template-columns: minmax(300px, 0.78fr) minmax(420px, 1.22fr);
        align-items: start;
        gap: 20px;
        max-width: 1500px;
    }
    #view-dashboard .hero-card {
        grid-column: 1;
        grid-row: 1;
    }
    #view-dashboard .create-card {
        grid-column: 1;
        grid-row: 2;
    }
    #view-dashboard .inbox-card {
        grid-column: 2;
        grid-row: 1 / span 2;
        min-height: 440px;
        margin-bottom: 0;
    }
    #view-dashboard .app-footer {
        grid-column: 1 / -1;
        grid-row: 3;
    }
    #view-fetcher:not(.hidden) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: 20px;
        max-width: 1250px;
    }
    #view-fetcher .fetcher-wide-card {
        grid-column: 1 / -1;
    }
    #view-fetcher .card {
        margin-bottom: 0;
    }
    #view-fetcher .inbox-card,
    #view-fetcher .app-footer {
        grid-column: 1 / -1;
    }
    #view-docs:not(.hidden),
    #view-admin:not(.hidden) {
        max-width: 1250px;
    }
    .modal-overlay {
        align-items: center;
        padding: 26px;
    }
    .modal-full {
        width: min(1120px, 100%);
        height: min(900px, 100%);
        border-radius: 22px;
    }
    .modal-header {
        padding: 12px 20px;
    }
    .modal-body {
        padding: 24px;
    }
    .message-intro {
        max-width: 1040px;
    }
    .msg-content {
        max-width: 1040px;
        width: 100%;
        margin: 0 auto;
    }
    .msg-content iframe {
        height: min(64vh, 900px);
    }
    .modal-sheet {
        width: min(480px, 100%);
        max-height: min(88dvh, 780px);
        border: 1px solid var(--border);
        border-radius: 22px;
        padding: 25px;
    }
}

@media (max-width: 420px) {
    .topbar {
        min-height: 66px;
        padding: 11px 13px;
    }
    .brand {
        gap: 9px;
    }
    .brand-badge {
        width: 34px;
        height: 34px;
        border-radius: 10px;
    }
    .brand-text {
        font-size: 0.85rem;
    }
    .brand-subtext {
        display: none;
    }
    .topbar-tools {
        gap: 5px;
    }
    .auto-refresh,
    .icon-btn,
    .topbar-quick-otp {
        height: 38px;
        border-radius: 11px;
    }
    .topbar-quick-otp {
        padding: 0 8px;
        font-size: 0.73rem;
    }
    .auto-refresh {
        width: 38px;
    }
    .main-content {
        padding: 14px 12px calc(88px + env(safe-area-inset-bottom));
    }
    .hero-card {
        padding: 22px 13px 16px;
        border-radius: 19px;
    }
    .hero-email {
        font-size: clamp(0.9rem, 4vw, 1.12rem);
        margin-bottom: 19px;
    }
    .hero-actions {
        gap: 3px;
    }
    .action-btn {
        min-height: 69px;
        gap: 6px;
    }
    .action-icon {
        width: 42px;
        height: 42px;
        border-radius: 13px;
    }
    .action-btn span:last-child {
        font-size: 0.69rem;
    }
    .card {
        padding: 17px 14px;
        border-radius: 16px;
    }
    .email-item {
        gap: 10px;
        padding: 12px 8px;
    }
    .avatar-circle {
        width: 39px;
        height: 39px;
        border-radius: 12px;
    }
    .em-sender {
        font-size: 0.81rem;
    }
    .em-date {
        font-size: 0.65rem;
    }
    .em-subject {
        font-size: 0.77rem;
    }
    .fetcher-inline-grid {
        grid-template-columns: 1fr;
    }
    .fetcher-btn-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
    .bottom-nav {
        gap: 1px;
        padding-right: 7px;
        padding-left: 7px;
    }
    .nav-item {
        padding-right: 2px;
        padding-left: 2px;
    }
    .modal-body {
        padding: 14px 12px;
    }
    .modal-header {
        gap: 6px;
        padding-right: 9px;
        padding-left: 9px;
    }
    .modal-header h3 {
        font-size: 0.86rem;
    }
    .message-subject {
        margin-bottom: 14px;
        font-size: 1.15rem;
    }
    .mail-meta {
        gap: 10px;
    }
    .detail-grid {
        padding-right: 9px;
        padding-left: 9px;
    }
    .detail-row {
        grid-template-columns: 65px minmax(0, 1fr);
        gap: 8px;
        font-size: 0.72rem;
    }
    .msg-content iframe {
        height: 65vh;
        min-height: 340px;
    }
    .otp-banner {
        padding: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
