:root {
    --bg: #070708;
    --bg-elevated: #0d0d10;
    --surface: #121216;
    --surface-hover: #17171c;
    --border: #23232b;
    --border-soft: #1a1a21;
    --text: #ececef;
    --text-muted: #8b8b96;
    --text-dim: #5e5e68;
    --accent: #8fd4c4;
    --accent-dim: rgba(143, 212, 196, 0.12);
    --danger: #d98a8a;
    --danger-dim: rgba(217, 138, 138, 0.12);
    --ok: #8fd4c4;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    --radius: 16px;
    --tap: 44px;
    --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border-soft);
    background: #09090b;
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    color: var(--text);
    font-weight: 600;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    text-decoration: none;
}

.brand:hover {
    text-decoration: none;
    color: var(--text);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a,
.nav-links button {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.92rem;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.nav-links a:hover,
.nav-links button:hover,
.nav-links a.active {
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    width: var(--tap);
    height: var(--tap);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 12px;
    cursor: pointer;
}

.wrap {
    width: min(920px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0 64px;
    flex: 1;
}

.home-page {
    background:
        radial-gradient(900px 480px at 12% -10%, rgba(143, 212, 196, 0.12), transparent 55%),
        radial-gradient(700px 420px at 90% 10%, rgba(143, 212, 196, 0.05), transparent 50%),
        var(--bg);
}

.home-wrap {
    width: min(1100px, calc(100% - 32px));
    display: flex;
    align-items: center;
}

.home-hero {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 48px;
    align-items: center;
    padding: 64px 0 48px;
}

.hero-brand {
    margin: 0 0 18px;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.22em;
}

.home-hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    line-height: 1.08;
    margin: 0 0 18px;
}

.home-hero .lede {
    font-size: 1.08rem;
    line-height: 1.6;
    max-width: 34rem;
    margin: 0 0 30px;
}

.lede-email {
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.95em;
}

.nav-cta {
    color: var(--text) !important;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px !important;
}

.nav-cta:hover {
    background: var(--surface);
    text-decoration: none !important;
}

.hero-preview {
    min-width: 0;
}

.preview-window {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #121218 0%, #0d0d12 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.04) inset,
        0 24px 60px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    animation: preview-rise 0.7s ease both;
}

.preview-top {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.02);
}

.preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2a2a33;
}

.preview-dot:nth-child(1) { background: #5a5a66; }
.preview-dot:nth-child(2) { background: #3f3f4a; }

.preview-address {
    margin-left: auto;
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.75rem;
}

.preview-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-soft);
}

.preview-row:last-child {
    border-bottom: 0;
}

.preview-row.is-unread {
    background: rgba(143, 212, 196, 0.05);
}

.preview-sender {
    color: var(--text);
    font-weight: 500;
    font-size: 0.92rem;
}

.preview-subject {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.preview-time {
    color: var(--text-dim);
    font-size: 0.78rem;
    white-space: nowrap;
}

@keyframes preview-rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero {
    padding: 72px 0 40px;
}

.hero h1,
.auth-card h1,
.inbox-head h1,
.account-card h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin: 0 0 12px;
}

.lede {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 38rem;
    margin: 0 0 28px;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap);
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #08110f;
}

.btn-primary:hover {
    filter: brightness(1.05);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: var(--surface);
}

.btn-danger {
    background: var(--danger-dim);
    color: var(--danger);
    border-color: transparent;
}

.btn-danger:hover {
    background: rgba(217, 138, 138, 0.2);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.auth-card,
.account-card,
.message-view,
.empty-state {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-card {
    width: min(460px, 100%);
    margin: 48px auto;
    padding: 28px 24px 24px;
}

.auth-card-register {
    width: min(520px, 100%);
}

.auth-card .lede {
    margin: -4px 0 18px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.field-label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.field-hint {
    margin: 0;
    font-size: 0.78rem;
    color: var(--text-dim);
    line-height: 1.35;
}

label {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

input,
select {
    width: 100%;
    min-height: var(--tap);
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #0b0b0e;
    color: var(--text);
    font: inherit;
    padding: 0 14px;
    outline: none;
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-dim) 50%),
        linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 34px;
    cursor: pointer;
}

select:invalid {
    color: var(--text-dim);
}

select option {
    color: var(--text);
    background: #121216;
}

input:focus,
select:focus {
    border-color: #3d5e57;
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.dob-row {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr 1fr;
    gap: 10px;
}

.username-input {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0b0b0e;
    overflow: hidden;
}

.username-input:focus-within {
    border-color: #3d5e57;
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.username-input input {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    min-width: 0;
    flex: 1;
}

.username-input input:focus {
    border: 0;
    box-shadow: none;
}

.username-suffix {
    display: flex;
    align-items: center;
    padding: 0 12px 0 0;
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.82rem;
    white-space: nowrap;
    user-select: none;
}

.username-domain {
    border: 0;
    border-left: 1px solid var(--border);
    border-radius: 0;
    background: #101014;
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.82rem;
    padding: 0 10px;
    max-width: 54%;
    min-width: 9.5rem;
    cursor: pointer;
}

.username-domain:focus {
    outline: none;
    color: var(--text);
}

.hint,
.preview,
.meta {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.preview {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.84rem;
    line-height: 1.45;
}

.preview strong {
    color: var(--text);
    font-family: var(--mono);
    font-weight: 500;
    font-size: 0.9rem;
}

.error {
    color: var(--danger);
    background: var(--danger-dim);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.92rem;
    margin: 0 0 14px;
    display: none;
}

.error.show {
    display: block;
}

.ok {
    color: var(--ok);
    font-size: 0.82rem;
    margin: 0;
}

#username-availability.hint {
    margin: 0;
    font-size: 0.82rem;
    color: var(--danger);
}

.auth-foot {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.inbox-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 22px;
}

.inbox-head p {
    margin: 0;
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.92rem;
}

.inbox-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(143, 212, 196, 0.06);
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    user-select: none;
}

.inbox-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.inbox-search {
    flex: 1;
    min-width: min(100%, 240px);
}

.inbox-search input {
    width: 100%;
}

.inbox-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inbox-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(143, 212, 196, 0.55);
    animation: live-pulse 1.8s ease-out infinite;
}

@keyframes live-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(143, 212, 196, 0.45);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(143, 212, 196, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(143, 212, 196, 0);
    }
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px 14px;
    padding: 16px 16px 16px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: inherit;
    text-decoration: none;
    background: linear-gradient(180deg, #121218 0%, #0e0e13 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
    cursor: pointer;
    text-align: left;
    font: inherit;
    width: 100%;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.message-row:hover {
    background: linear-gradient(180deg, #16161d 0%, #121218 100%);
    border-color: #2e2e38;
    text-decoration: none;
}

.message-row.is-new {
    animation: message-in 0.35s ease;
}

@keyframes message-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-row.unread {
    border-color: rgba(143, 212, 196, 0.28);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.03) inset,
        0 0 0 1px rgba(143, 212, 196, 0.08);
}

.message-row.unread .sender,
.message-row.unread .subject {
    color: var(--text);
    font-weight: 600;
}

.message-row-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.sender {
    color: var(--text);
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subject {
    color: var(--text-muted);
    font-size: 0.94rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.when {
    color: var(--text-dim);
    font-size: 0.8rem;
    white-space: nowrap;
    align-self: center;
}

.message-delete {
    appearance: none;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    line-height: 1;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.message-delete svg {
    width: 16px;
    height: 16px;
    display: block;
}

.message-delete:hover,
.message-delete:focus-visible {
    color: var(--danger);
    background: var(--danger-dim);
    border-color: rgba(217, 138, 138, 0.28);
    outline: none;
}

.message-delete:disabled {
    opacity: 0.5;
    cursor: wait;
}

.unread-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    display: inline-block;
    margin-right: 8px;
    flex-shrink: 0;
}

.empty-state {
    padding: 56px 24px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
}

.empty-state h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}

.empty-state p {
    margin: 0;
    color: var(--text-muted);
}

.message-view {
    padding: 24px;
}

.message-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.kv {
    display: grid;
    gap: 8px;
    margin-bottom: 22px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.kv span {
    color: var(--text);
}

.body-text {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 1rem;
}

.body-html {
    display: block;
    width: 100%;
    min-height: 280px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: #fff;
}

.dev-banner {
    border: 1px solid #3d3420;
    background: #16130c;
    color: #d8c79a;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.88rem;
    margin-bottom: 16px;
}

.account-card {
    padding: 24px;
}

.account-lede {
    margin: -4px 0 8px;
}

.account-section {
    padding: 20px 0;
    border-top: 1px solid var(--border-soft);
}

.account-section:first-of-type {
    border-top: 0;
    padding-top: 8px;
}

.account-section h2 {
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.account-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-muted);
}

.account-section .account-row:last-of-type {
    border-bottom: 0;
}

.account-row span {
    color: var(--text);
    text-align: right;
    font-family: var(--mono);
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.account-value-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.account-form {
    max-width: 420px;
}

.account-form .field {
    margin-bottom: 12px;
}

.account-form .btn {
    margin-top: 4px;
}

.account-flash {
    min-height: 1.2em;
    margin: 10px 0 0;
    font-size: 0.88rem;
}

.account-danger h2 {
    color: var(--danger);
}

.btn-compact {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 0.85rem;
}

.loading {
    color: var(--text-muted);
    padding: 24px 0;
}

.hidden {
    display: none !important;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
    justify-content: center;
    padding: 28px 16px 40px;
    border-top: 1px solid var(--border-soft);
    color: var(--text-dim);
    font-size: 0.88rem;
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--text);
    text-decoration: none;
}

.legal-card {
    width: min(720px, 100%);
    margin: 24px auto 0;
    padding: 28px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.legal-eyebrow {
    margin: 0 0 10px;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.legal-card h1 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    letter-spacing: -0.03em;
}

.legal-card > .lede {
    margin-bottom: 18px;
}

.legal-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
}

.legal-section h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.legal-section p,
.legal-section li {
    color: var(--text-muted);
    line-height: 1.6;
}

.legal-section ul {
    margin: 0;
    padding-left: 1.15rem;
    display: grid;
    gap: 8px;
}

.legal-section code {
    font-family: var(--mono);
    font-size: 0.88em;
    color: var(--text);
}

.auth-legal {
    margin-top: 10px;
    font-size: 0.82rem;
}

.account-legal {
    text-align: center;
    margin: 18px 0 0;
    font-size: 0.88rem;
}

.account-legal a {
    color: var(--text-muted);
}

.admin-wrap {
    width: min(1100px, calc(100% - 32px));
}

/* ── Admin shell layout ── */
.admin-page .page {
    min-height: 100vh;
}

.admin-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 0;
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto 40px;
    min-height: calc(100vh - 88px);
    align-items: start;
}

.admin-loading {
    grid-column: 1 / -1;
    padding: 48px 24px;
    text-align: center;
}

.admin-sidebar {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 14px;
    margin-right: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: calc(100vh - 104px);
    overflow-y: auto;
}

.admin-sidebar-head {
    padding: 4px 10px 14px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 6px;
}

.admin-sidebar-eyebrow {
    margin: 0 0 4px;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.admin-sidebar-head h2 {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.admin-nav-item:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.admin-nav-item.is-active {
    background: var(--accent-dim);
    border-color: rgba(143, 212, 196, 0.25);
    color: var(--accent);
    font-weight: 500;
}

.admin-nav-icon {
    width: 18px;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.85;
    flex-shrink: 0;
}

.admin-nav-badge {
    margin-left: auto;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--danger-dim);
    color: var(--danger);
}

.admin-main {
    min-width: 0;
}

.admin-topbar {
    margin-bottom: 18px;
    padding: 4px 2px;
}

.admin-topbar h1 {
    margin: 0 0 6px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: -0.03em;
}

.admin-topbar .lede {
    margin: 0;
    max-width: 62ch;
}

.admin-sections {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.admin-section {
    display: block;
}

.admin-section[hidden] {
    display: none !important;
}

.admin-panel {
    padding: 24px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.admin-panel + .admin-panel {
    margin-top: 16px;
}

.admin-section .account-section.admin-panel {
    border-top: 0;
    padding-top: 0;
}

.admin-panel-head {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
}

.admin-panel-head h2 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text);
}

.admin-panel-head p {
    margin: 0;
}

.gmail-stock-editor {
    width: 100%;
    min-height: 280px;
    font-family: "JetBrains Mono", "IBM Plex Mono", monospace;
    font-size: 0.82rem;
    line-height: 1.5;
}

.gmail-aged-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.admin-stat {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-elevated);
}

.admin-stat-label {
    margin: 0 0 6px;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.admin-stat-value {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-family: var(--mono);
}

.admin-stat-sub {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.admin-presence {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.admin-presence-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-dim);
    flex-shrink: 0;
}

.admin-presence.is-online {
    color: #6ee7b7;
}

.admin-presence.is-online .admin-presence-dot {
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
    animation: admin-pulse 2s ease-in-out infinite;
}

.admin-presence.is-offline .admin-presence-dot {
    background: var(--text-dim);
}

@keyframes admin-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.admin-card {
    width: 100%;
    margin: 0 auto;
    padding: 28px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.admin-card h1 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    letter-spacing: -0.03em;
}

.admin-toggles {
    display: grid;
    gap: 12px;
    margin: 16px 0 18px;
}

.admin-toggle {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-elevated);
    cursor: pointer;
}

.admin-toggle input {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.admin-toggle strong {
    display: block;
    color: var(--text);
}

.admin-toggle small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    line-height: 1.45;
}

.admin-variable-stock {
    display: grid;
    gap: 4px;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg-elevated) 80%, transparent);
}

.admin-variable-stock[hidden] {
    display: none;
}

.admin-domain-weights {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.admin-domain-weight-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-elevated);
    font-family: var(--mono);
    font-size: 0.9rem;
}

.admin-domain-weight-row span:first-child {
    flex: 1;
    min-width: 0;
    color: var(--text);
}

.admin-domain-weight-row input {
    width: 88px;
    margin: 0;
}

.admin-gift-form {
    display: grid;
    gap: 0;
    max-width: 520px;
}

.admin-search-row {
    display: flex;
    gap: 10px;
    margin: 12px 0 16px;
    align-items: center;
}

.admin-filter-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

.admin-search-row select {
    min-width: 220px;
    max-width: 100%;
}

.admin-search-row input {
    flex: 1;
}

.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: top;
}

.admin-table th {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-dim);
    background: var(--bg-elevated);
}

.admin-table tr:last-child td {
    border-bottom: 0;
}

.admin-mail {
    font-family: var(--mono);
    font-size: 0.9rem;
}

.admin-sub {
    margin-top: 2px;
    color: var(--text-dim);
    font-size: 0.82rem;
}

.admin-actions {
    white-space: nowrap;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    background: var(--surface-hover);
    color: var(--text-muted);
}

.admin-badge-danger {
    background: var(--danger-dim);
    color: var(--danger);
}

.admin-badge-accent {
    background: var(--accent-dim);
    color: var(--accent);
}

.admin-empty {
    color: var(--text-muted);
    text-align: center !important;
    padding: 28px 14px !important;
}

.docs-code {
    overflow-x: auto;
    padding: 14px 16px;
    border-radius: 12px;
    background: #0a0a0c;
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.82rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

.docs-steps {
    margin: 0;
    padding-left: 1.2rem;
    display: grid;
    gap: 8px;
    color: var(--text-muted);
}

.admin-card textarea {
    width: 100%;
    resize: vertical;
    min-height: 84px;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
}

.admin-bulk-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.admin-check-col {
    width: 42px;
}

.admin-check-col input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.site-banner {
    padding: 12px 18px;
    text-align: center;
    background: var(--accent-dim);
    color: var(--accent);
    border-bottom: 1px solid rgba(143, 212, 196, 0.25);
    font-size: 0.92rem;
    line-height: 1.45;
}

@media (max-width: 960px) {
    .admin-shell {
        grid-template-columns: 1fr;
        width: min(100%, calc(100% - 24px));
    }

    .admin-sidebar {
        position: static;
        max-height: none;
        margin-right: 0;
        margin-bottom: 12px;
    }

    .admin-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .admin-nav-item {
        font-size: 0.82rem;
        padding: 9px 10px;
    }
}

@media (max-width: 720px) {
    .admin-card {
        padding: 22px 16px;
    }

    .admin-search-row,
    .admin-bulk-row {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 720px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 73px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        background: #09090b;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a,
    .nav-links button {
        min-height: var(--tap);
        justify-content: flex-start;
        display: flex;
        align-items: center;
    }

    .inbox-head,
    .message-toolbar,
    .account-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .message-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "main delete"
            "when delete";
        gap: 6px 10px;
        padding: 14px;
    }

    .message-row-main {
        grid-area: main;
    }

    .when {
        grid-area: when;
    }

    .message-delete {
        grid-area: delete;
        align-self: start;
    }

    .account-row span {
        text-align: left;
    }

    .hero {
        padding-top: 40px;
    }

    .home-hero {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 40px 0 32px;
    }

    .home-hero h1 {
        font-size: clamp(2rem, 9vw, 2.6rem);
    }

    .preview-window {
        max-width: 100%;
    }

    .dob-row {
        grid-template-columns: 1fr;
    }

    .username-suffix {
        display: none;
    }

    .username-domain {
        max-width: 48%;
        min-width: 0;
        font-size: 0.75rem;
        padding: 0 8px;
    }

    .auth-card {
        margin: 28px auto;
        padding: 22px 18px 18px;
    }
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
    display: none !important;
}

body.modal-open {
    overflow: hidden;
}

.modal-card {
    position: relative;
    width: min(720px, 100%);
    max-height: min(90vh, 900px);
    overflow-y: auto;
    padding: 24px 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.proof-modal-card {
    width: min(860px, 100%);
}

.modal-close {
    position: absolute;
    top: 10px;
    inset-inline-end: 12px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}

.modal-title {
    margin: 0 0 12px;
    font-size: 1.25rem;
}

.proof-image-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 120px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-elevated);
}

.proof-image-wrap img {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    width: auto;
    height: auto;
    object-fit: contain;
}
