:root {
    --bg: #07080c;
    --panel: #10131b;
    --panel-2: #151a24;
    --panel-3: #1d2330;
    --text: #f4f7fb;
    --muted: #8b95a7;
    --line: #2a3141;
    --green: #1fd18b;
    --green-2: #0f9f6b;
    --red: #ff4d6d;
    --amber: #f4b860;
    --blue: #6ea8fe;
    --radius: 8px;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
}

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

button,
.button-link {
    min-height: 42px;
    border: 0;
    border-radius: var(--radius);
    background: var(--green);
    color: #06100c;
    cursor: pointer;
    font-weight: 800;
    padding: 0 16px;
    text-decoration: none;
}

button:hover,
.button-link:hover {
    background: #36e5a0;
}

button:disabled {
    cursor: wait;
    opacity: .65;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #0b0e14;
    color: var(--text);
    padding: 11px 12px;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus,
button:focus,
a:focus {
    outline: 2px solid rgba(31, 209, 139, .42);
    outline-offset: 2px;
}

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.muted {
    color: var(--muted);
}

.public-page {
    overflow-x: hidden;
}

.public-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.link-panel {
    width: min(100%, 430px);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(16, 19, 27, .94);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
    padding: 22px;
}

.unsubscribe-panel {
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
}

.unsubscribe-panel h1,
.unsubscribe-panel p {
    margin: 0;
}

.unsubscribe-panel p {
    color: var(--muted);
    line-height: 1.6;
}

.brand-lockup,
.admin-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-lockup h1,
.admin-topbar h1,
.login-card h1 {
    margin: 0;
}

.access-box {
    display: grid;
    gap: 14px;
    margin: 22px 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #0c1017;
}

.access-box h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.access-box p {
    margin: 0;
    color: var(--muted);
}

.email-form {
    display: grid;
    gap: 10px;
}

.form-message {
    min-height: 0;
    margin: 0;
    font-size: 13px;
}

.form-message:empty {
    display: none;
}

.trust-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    color: #9fb6d7;
    font-size: 13px;
    text-align: center;
}

.shield-icon {
    position: relative;
    display: inline-block;
    width: 13px;
    height: 15px;
    background: var(--green);
    clip-path: polygon(50% 0, 92% 18%, 84% 68%, 50% 100%, 16% 68%, 8% 18%);
    flex: 0 0 auto;
}

.shield-icon::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 3px;
    width: 3px;
    height: 7px;
    border: solid #06100c;
    border-width: 0 2px 2px 0;
    transform: rotate(40deg);
}

.form-message.error,
.notice.error {
    color: #ffd5dc;
}

.form-message.success,
.notice.success {
    color: #c8ffe8;
}

.form-message.processing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 18px;
    color: #9fb6d7;
}

.form-message.processing::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(31, 209, 139, .32);
    animation: processing-pulse 1s ease-in-out infinite;
}

.email-form.is-processing input {
    opacity: .72;
}

.email-form.is-processing button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    overflow: hidden;
    position: relative;
}

.email-form.is-processing button::after {
    content: "";
    width: 14px;
    height: 14px;
    border: 2px solid rgba(6, 16, 12, .28);
    border-top-color: #06100c;
    border-radius: 50%;
    flex: 0 0 auto;
    animation: processing-spin .75s linear infinite;
}

@keyframes processing-pulse {
    0%,
    100% {
        opacity: .58;
        transform: scale(.9);
    }

    50% {
        opacity: 1;
        transform: scale(1.18);
    }
}

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

.notice {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #0c1017;
    color: var(--muted);
}

.notice.success {
    border-color: rgba(31, 209, 139, .45);
    background: rgba(31, 209, 139, .12);
}

.notice.error {
    border-color: rgba(255, 77, 109, .48);
    background: rgba(255, 77, 109, .12);
}

.notice.warning {
    border-color: rgba(244, 184, 96, .48);
    background: rgba(244, 184, 96, .11);
    color: #ffe0aa;
}

.notice strong,
.notice span {
    display: block;
}

.notice strong {
    margin-bottom: 6px;
    color: var(--text);
    font-size: 18px;
}

.links-stack {
    display: grid;
    gap: 10px;
}

.section-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.channel-link {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-2);
    padding: 8px 12px 8px 8px;
    text-decoration: none;
}

.channel-link:hover {
    border-color: rgba(31, 209, 139, .62);
    background: var(--panel-3);
}

.channel-icon {
    display: grid;
    place-items: center;
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: #090c12;
    color: var(--green);
    font-size: 12px;
    font-weight: 900;
}

.channel-icon::before {
    content: "";
    display: none;
    width: 22px;
    height: 22px;
    background: currentColor;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
}

.channel-icon--discord::before {
    display: block;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.4 7.7c1.2-.6 2.3-.9 3.3-1l.4.8a9.6 9.6 0 0 1 1.8 0l.4-.8c1 .1 2.1.4 3.3 1 1.5 2.2 2.2 4.8 2 7.7a7.8 7.8 0 0 1-4.8 2.2l-.8-1.2c.8-.2 1.5-.5 2.1-1-.3.1-.6.3-.9.4a7.2 7.2 0 0 1-4.4 0c-.3-.1-.6-.3-.9-.4.6.5 1.3.8 2.1 1l-.8 1.2a7.8 7.8 0 0 1-4.8-2.2c-.2-2.9.5-5.5 2-7.7Zm2.2 5.8c.7 0 1.2-.6 1.2-1.3s-.5-1.3-1.2-1.3-1.2.6-1.2 1.3.5 1.3 1.2 1.3Zm4.8 0c.7 0 1.2-.6 1.2-1.3s-.5-1.3-1.2-1.3-1.2.6-1.2 1.3.5 1.3 1.2 1.3Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.4 7.7c1.2-.6 2.3-.9 3.3-1l.4.8a9.6 9.6 0 0 1 1.8 0l.4-.8c1 .1 2.1.4 3.3 1 1.5 2.2 2.2 4.8 2 7.7a7.8 7.8 0 0 1-4.8 2.2l-.8-1.2c.8-.2 1.5-.5 2.1-1-.3.1-.6.3-.9.4a7.2 7.2 0 0 1-4.4 0c-.3-.1-.6-.3-.9-.4.6.5 1.3.8 2.1 1l-.8 1.2a7.8 7.8 0 0 1-4.8-2.2c-.2-2.9.5-5.5 2-7.7Zm2.2 5.8c.7 0 1.2-.6 1.2-1.3s-.5-1.3-1.2-1.3-1.2.6-1.2 1.3.5 1.3 1.2 1.3Zm4.8 0c.7 0 1.2-.6 1.2-1.3s-.5-1.3-1.2-1.3-1.2.6-1.2 1.3.5 1.3 1.2 1.3Z'/%3E%3C/svg%3E");
}

.channel-icon--reddit::before {
    display: block;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 4.2c.5 0 1 .4 1 1 0 .2-.1.5-.2.7l2 .6a1.7 1.7 0 1 1-.4 1.2l-2.6-.8c-.6-.2-.9-.7-.8-1.3l-1.5-.3-.5 2.6c1.9.1 3.6.7 4.7 1.6a2 2 0 1 1 2.1 3.2v.4c0 2.9-3 5.2-6.8 5.2s-6.8-2.3-6.8-5.2v-.4a2 2 0 1 1 2.1-3.2c1-.8 2.5-1.4 4.2-1.6l.7-3.5 2.4.5c.1-.4.5-.7.9-.7ZM9.5 12a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4Zm5 0a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4Zm-5.2 3.4c.6.7 1.5 1.1 2.7 1.1s2.1-.4 2.7-1.1c.2-.2.2-.5 0-.7-.2-.2-.5-.2-.7 0-.4.5-1.1.8-2 .8s-1.6-.3-2-.8c-.2-.2-.5-.2-.7 0-.2.2-.2.5 0 .7Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M15 4.2c.5 0 1 .4 1 1 0 .2-.1.5-.2.7l2 .6a1.7 1.7 0 1 1-.4 1.2l-2.6-.8c-.6-.2-.9-.7-.8-1.3l-1.5-.3-.5 2.6c1.9.1 3.6.7 4.7 1.6a2 2 0 1 1 2.1 3.2v.4c0 2.9-3 5.2-6.8 5.2s-6.8-2.3-6.8-5.2v-.4a2 2 0 1 1 2.1-3.2c1-.8 2.5-1.4 4.2-1.6l.7-3.5 2.4.5c.1-.4.5-.7.9-.7ZM9.5 12a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4Zm5 0a1.2 1.2 0 1 0 0 2.4 1.2 1.2 0 0 0 0-2.4Zm-5.2 3.4c.6.7 1.5 1.1 2.7 1.1s2.1-.4 2.7-1.1c.2-.2.2-.5 0-.7-.2-.2-.5-.2-.7 0-.4.5-1.1.8-2 .8s-1.6-.3-2-.8c-.2-.2-.5-.2-.7 0-.2.2-.2.5 0 .7Z'/%3E%3C/svg%3E");
}

.channel-icon--telegram::before {
    display: block;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.7 4.4c.4-.2.8.2.7.6l-3.1 14.6c-.1.6-.8.8-1.3.5l-4.4-3.2-2.2 2.1c-.4.4-1.1.2-1.2-.4l-.8-4.5-4.1-1.3c-.6-.2-.6-1 0-1.3L20.7 4.4Zm-4.2 4.4-6.7 4.1.5 2.9.3-1.8c.1-.3.2-.5.5-.7l5.4-4.5Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.7 4.4c.4-.2.8.2.7.6l-3.1 14.6c-.1.6-.8.8-1.3.5l-4.4-3.2-2.2 2.1c-.4.4-1.1.2-1.2-.4l-.8-4.5-4.1-1.3c-.6-.2-.6-1 0-1.3L20.7 4.4Zm-4.2 4.4-6.7 4.1.5 2.9.3-1.8c.1-.3.2-.5.5-.7l5.4-4.5Z'/%3E%3C/svg%3E");
}

.channel-icon--link::before {
    display: block;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.6 13.4a1 1 0 0 1 0-1.4l2.8-2.8a1 1 0 1 1 1.4 1.4L12 13.4a1 1 0 0 1-1.4 0Z'/%3E%3Cpath d='M8.5 16.9a4.5 4.5 0 0 1-3.2-7.7l2.2-2.2a4.5 4.5 0 0 1 6.4 0 1 1 0 0 1-1.4 1.4 2.5 2.5 0 0 0-3.5 0l-2.2 2.2a2.5 2.5 0 1 0 3.5 3.5 1 1 0 0 1 1.4 1.4 4.5 4.5 0 0 1-3.2 1.4Z'/%3E%3Cpath d='M13.3 18.3a4.5 4.5 0 0 1-3.2-1.3 1 1 0 1 1 1.4-1.4 2.5 2.5 0 0 0 3.5 0l2.2-2.2a2.5 2.5 0 1 0-3.5-3.5 1 1 0 0 1-1.4-1.4 4.5 4.5 0 0 1 6.4 6.4l-2.2 2.2a4.5 4.5 0 0 1-3.2 1.2Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10.6 13.4a1 1 0 0 1 0-1.4l2.8-2.8a1 1 0 1 1 1.4 1.4L12 13.4a1 1 0 0 1-1.4 0Z'/%3E%3Cpath d='M8.5 16.9a4.5 4.5 0 0 1-3.2-7.7l2.2-2.2a4.5 4.5 0 0 1 6.4 0 1 1 0 0 1-1.4 1.4 2.5 2.5 0 0 0-3.5 0l-2.2 2.2a2.5 2.5 0 1 0 3.5 3.5 1 1 0 0 1 1.4 1.4 4.5 4.5 0 0 1-3.2 1.4Z'/%3E%3Cpath d='M13.3 18.3a4.5 4.5 0 0 1-3.2-1.3 1 1 0 1 1 1.4-1.4 2.5 2.5 0 0 0 3.5 0l2.2-2.2a2.5 2.5 0 1 0-3.5-3.5 1 1 0 0 1-1.4-1.4 4.5 4.5 0 0 1 6.4 6.4l-2.2 2.2a4.5 4.5 0 0 1-3.2 1.2Z'/%3E%3C/svg%3E");
}

.channel-icon--discord span,
.channel-icon--reddit span,
.channel-icon--telegram span,
.channel-icon--link span {
    display: none;
}

.channel-arrow {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.login-page,
.admin-page {
    --bg: #1a1a1a;
    --panel: #262626;
    --panel-2: #303030;
    --panel-3: #3a3a3a;
    --text: #ededed;
    --muted: #9ca3af;
    --line: #333333;
    --green: #e56a4a;
    --green-2: #cc5236;
    --admin-sidebar: rgba(30, 30, 30, .86);
    --admin-sidebar-active: rgba(229, 106, 74, .1);
    --field: #1f1f1e;
    --field-hover: #303030;
    --admin-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 2px rgba(0, 0, 0, .4), 0 16px 48px -8px rgba(0, 0, 0, .55);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-warm: 0 2px 12px -2px rgba(229, 106, 74, .25);
    --shadow-focus: 0 0 0 3px rgba(229, 106, 74, .18);
    background: var(--bg);
    color: var(--text);
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 370px);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--admin-shadow);
    padding: 26px;
}

.login-page input,
.login-page textarea,
.login-page select,
.admin-page input,
.admin-page textarea,
.admin-page select {
    border-color: var(--line);
    border-radius: 10px;
    background: var(--field);
    color: var(--text);
}

.login-page input::placeholder,
.login-page textarea::placeholder,
.admin-page input::placeholder,
.admin-page textarea::placeholder {
    color: #817d76;
}

.login-page input:focus,
.login-page textarea:focus,
.login-page select:focus,
.login-page button:focus,
.login-page a:focus,
.admin-page input:focus,
.admin-page textarea:focus,
.admin-page select:focus,
.admin-page button:focus,
.admin-page a:focus {
    outline: 0;
    box-shadow: var(--shadow-focus);
}

.login-page .notice,
.admin-page .notice {
    background: var(--field);
}

.login-page .notice.success,
.admin-page .notice.success {
    background: rgba(31, 209, 139, .12);
}

.login-page .notice.error,
.admin-page .notice.error {
    background: rgba(255, 77, 109, .12);
}

.login-page .notice.warning,
.admin-page .notice.warning {
    background: rgba(244, 184, 96, .1);
}

.login-page button,
.login-page .button-link,
.admin-page button,
.admin-page .button-link {
    border-radius: 10px;
    background: var(--green);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .32);
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.login-page button:hover,
.login-page .button-link:hover,
.admin-page button:hover,
.admin-page .button-link:hover {
    background: var(--green-2);
}

.login-page button:active,
.admin-page button:active {
    transform: scale(.97);
}

.admin-page {
    display: grid;
    grid-template-columns: 288px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid #2a2a2a;
    background: var(--admin-sidebar);
    padding: 20px 18px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.admin-sidebar::before {
    content: "";
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    margin: 0 0 18px 6px;
    background: #ff5f56;
    box-shadow: 20px 0 0 #ffbd2e, 40px 0 0 #27c93f;
}

.admin-brand {
    margin-bottom: 26px;
    color: var(--text);
    font-weight: 700;
    text-decoration: none;
}

.admin-brand img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #e56a4a, #a64027);
    box-shadow: var(--shadow-warm);
}

.admin-brand span {
    display: grid;
    gap: 2px;
    font-size: 18px;
    letter-spacing: -.01em;
}

.admin-nav {
    display: grid;
    gap: 2px;
}

.admin-nav a,
.ghost-link,
.action-list a,
.pagination a {
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--muted);
    padding: 8px 12px;
    text-decoration: none;
}

.admin-nav a:hover,
.admin-nav a.active,
.ghost-link:hover,
.action-list a:hover,
.pagination a.active {
    border-color: transparent;
    background: var(--admin-sidebar-active);
    color: var(--green);
}

.logout-form {
    margin-top: 24px;
}

.logout-form button {
    width: 100%;
    border: 1px solid rgba(255, 77, 109, .22);
    background: rgba(255, 77, 109, .1);
    color: #ffd5dc;
}

.admin-main {
    position: relative;
    isolation: isolate;
    width: min(100%, 1360px);
    margin: 0 auto;
    padding: 24px 32px 40px;
}

.admin-main::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(to right, rgba(229, 106, 74, .04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(229, 106, 74, .04) 1px, transparent 1px);
    background-size: 40px 40px;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 56px;
    margin-bottom: 24px;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 12px;
}

.ghost-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card,
.panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
    box-shadow: var(--shadow-soft);
}

.metric-card {
    padding: 20px;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.metric-card:hover,
.panel:hover {
    border-color: rgba(229, 106, 74, .3);
    box-shadow: var(--shadow-warm);
}

.metric-card span,
.status-grid span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.metric-card strong,
.status-grid strong {
    display: block;
    margin-top: 8px;
    color: var(--text);
    font-size: 30px;
    letter-spacing: -.02em;
}

.status-grid small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
}

.metric-card small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.panel {
    margin-bottom: 20px;
    padding: 22px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.panel-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.panel-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.status-grid div {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--field);
    padding: 16px;
}

.action-list,
.compact-list,
.stack-form,
.settings-form fieldset {
    display: grid;
    gap: 12px;
}

.compact-list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
}

.compact-list div:last-child {
    border-bottom: 0;
}

.compact-list em,
table small {
    color: var(--muted);
    font-style: normal;
}

.stack-form label,
.field-label,
.grid-form label,
.settings-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.stack-form button,
.settings-form > button {
    width: max-content;
}

.grid-form {
    display: grid;
    grid-template-columns: 1.2fr 2fr 1fr 110px auto;
    gap: 12px;
    align-items: end;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

tbody tr {
    transition: background .15s ease;
}

tbody tr:hover {
    background: rgba(255, 255, 255, .025);
}

td a {
    color: var(--green);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 9px;
    background: var(--panel-3);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.badge.active,
.badge.completed {
    background: rgba(34, 197, 94, .14);
    color: #86efac;
}

.badge.inactive,
.badge.sending,
.badge.queued,
.badge.paused {
    background: rgba(244, 184, 96, .14);
    color: #ffe0aa;
}

.badge.unsubscribed,
.badge.failed,
.badge.stopped {
    background: rgba(255, 77, 109, .14);
    color: #ffd5dc;
}

.inline-filter {
    width: 180px;
}

.list-controls {
    display: flex;
    align-items: end;
    gap: 10px;
}

.list-controls label {
    display: grid;
    gap: 6px;
    min-width: 140px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.pagination-spread {
    align-items: center;
    justify-content: space-between;
}

.pagination-meta {
    color: var(--muted);
    font-size: 13px;
}

.pagination-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination-pages span {
    color: var(--muted);
    padding: 10px 4px;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.row-actions form {
    display: inline;
}

.row-actions button,
.secondary-button,
.icon-button {
    min-height: 32px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--field);
    color: var(--text);
    padding: 6px 10px;
    box-shadow: none;
}

.secondary-button:hover,
.icon-button:hover {
    background: var(--field-hover);
    color: var(--text);
}

.danger-button {
    border-color: rgba(255, 77, 109, .32);
    color: #ffd5dc;
}

.mail-progress-panel {
    position: relative;
}

.mail-progress-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
}

.mail-progress-main {
    display: grid;
    gap: 10px;
}

.progress-track {
    height: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--field);
}

.progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--green-2), var(--green));
    transition: width .25s ease;
}

.progress-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    color: var(--muted);
    font-size: 13px;
}

.progress-meta strong {
    color: var(--text);
}

.mail-progress-error {
    margin: 0;
    color: #ffd5dc;
}

.mail-progress-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(18, 18, 17, .72);
    backdrop-filter: blur(8px);
}

.modal-card {
    width: min(100%, 520px);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel-2);
    box-shadow: var(--admin-shadow);
    padding: 18px;
}

.modal-header,
.modal-actions,
.modal-grid {
    display: flex;
    gap: 12px;
}

.modal-header {
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-header h2 {
    margin: 0;
}

.modal-grid {
    align-items: start;
}

.modal-grid label {
    flex: 1;
}

.modal-actions {
    justify-content: flex-end;
}

.checkbox-label {
    display: flex !important;
    grid-template-columns: auto 1fr;
    align-items: center;
}

.checkbox-label input {
    width: auto;
}

.mail-links-field,
.mail-links,
.mail-exclude-field {
    display: grid;
    gap: 10px;
}

.mail-link-row {
    display: grid;
    grid-template-columns: minmax(140px, .8fr) minmax(220px, 1.2fr) auto;
    gap: 10px;
    align-items: end;
}

.mail-link-row label {
    min-width: 0;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.mail-exclude-list {
    display: grid;
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--field);
}

.mail-exclude-list .checkbox-label {
    gap: 10px;
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
}

.mail-exclude-list .checkbox-label:last-child {
    border-bottom: 0;
}

.mail-exclude-list strong,
.mail-exclude-list small {
    display: block;
}

.mail-exclude-list small {
    margin-top: 3px;
    color: var(--muted);
}

.table-action {
    text-decoration: none;
}

.mail-preview-frame {
    width: 100%;
    min-height: 680px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--field);
}

.mail-template-preview {
    display: grid;
    gap: 10px;
}

.live-mail-preview-frame {
    min-height: 590px;
}

.mail-preview-error {
    margin: 0;
    color: #ffd5dc;
}

.settings-form {
    display: grid;
    gap: 18px;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin: 0;
    padding: 16px;
}

legend {
    color: var(--green);
    font-weight: 900;
    padding: 0 8px;
}

.empty-state {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    padding: 28px;
}

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

    .admin-sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .admin-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .metric-grid,
    .split-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 640px) {
    .public-shell,
    .admin-main {
        padding: 14px;
    }

    .admin-topbar,
    .panel-header,
    .mail-progress-row,
    .list-controls,
    .compact-list div,
    .modal-header,
    .modal-actions,
    .modal-grid {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-nav,
    .metric-grid,
    .split-grid,
    .status-grid,
    .grid-form,
    .mail-link-row {
        grid-template-columns: 1fr;
    }

    .stack-form button,
    .settings-form > button,
    .inline-filter,
    .list-controls,
    .list-controls label,
    .form-actions,
    .form-actions button,
    .mail-progress-actions,
    .mail-progress-actions form,
    .mail-progress-actions button,
    .modal-actions,
    .modal-actions button {
        width: 100%;
    }

    .mail-preview-frame {
        min-height: 520px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .form-message.processing::before,
    .email-form.is-processing button::before,
    .email-form.is-processing button::after {
        animation: none;
    }

    .form-message.processing::before {
        opacity: 1;
        transform: none;
    }
}
