:root {
    --bg: #eef1f6;
    --bg-accent: #eef1f6;
    --surface: #ffffff;
    --ink: #1a2332;
    --muted: #6b7785;
    --line: #e6ebf2;
    --brand: #0b6e4f;
    --brand-dark: #08553c;
    --accent: #0b6e4f;
    --danger: #b42318;
    --ok: #0b6e4f;
    --warn: #b54708;
    --shadow: 0 8px 24px rgba(26, 35, 50, 0.06);
    --shadow-sm: 0 1px 2px rgba(26, 35, 50, 0.04);
    --radius: 14px;
    --radius-sm: 10px;
    --font: Lato, Helvetica, sans-serif;
    --display: Lato, Helvetica, sans-serif;
    --content-max: 1224px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    font-weight: 400;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
    font-family: var(--display);
    font-weight: 700;
    margin: 0 0 0.4rem;
    letter-spacing: -0.015em;
    color: var(--ink);
}

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
code {
    background: #f0f3f7;
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
    font-size: 0.9em;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
    transition: grid-template-columns 0.2s ease;
    background: var(--bg);
}
.app-shell.is-collapsed {
    grid-template-columns: 80px 1fr;
}

.nav-overlay {
    display: none;
}

.sidebar {
    background: #101820;
    color: #e8eef2;
    padding: 1.25rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 40;
    transition: width 0.2s ease, transform 0.25s ease, padding 0.2s ease;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 0.35rem;
}

.nav-close {
    display: none;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: #e8eef2;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.nav-close .icon { font-size: 1.25rem; color: inherit; }

.brand { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.brand-mark {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--brand);
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    font-family: var(--font);
}
.brand-mark-img {
    width: 2.15rem;
    height: 2.15rem;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}
.brand-logo {
    display: block;
    height: 2.35rem;
    width: auto;
    max-width: min(220px, 55vw);
    object-fit: contain;
}
.brand-name {
    font-family: var(--display);
    font-size: 1.02rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
}

.nav { display: flex; flex-direction: column; gap: 0.2rem; }
.nav a {
    color: #a8b7c3;
    padding: 0.6rem 0.75rem;
    border-radius: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 400;
    font-size: 0.94rem;
}
.nav a:hover,
.nav a.is-active {
    background: rgba(255, 255, 255, 0.07);
    text-decoration: none;
    color: #fff;
}
.nav a.is-active {
    background: rgba(11, 110, 79, 0.32);
    color: #fff;
    font-weight: 700;
}
.nav a .icon {
    font-size: 1.25rem;
    color: inherit;
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.35rem;
}
.user-chip {
    font-size: 0.85rem;
    color: #c5d2dc;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.owner-manage-list { gap: 0; }
.owner-manage-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem 1rem;
    flex-wrap: wrap;
    padding: 0.85rem 0;
    min-width: 0;
}
.owner-manage-main { min-width: 0; flex: 1 1 12rem; }
.owner-manage-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    margin-bottom: 0.2rem;
}
.owner-manage-name {
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
}
.owner-manage-name:hover { color: var(--brand-dark); text-decoration: underline; }
.owner-manage-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    flex: 0 1 auto;
    max-width: 100%;
    justify-content: flex-end;
}
.admin-plan-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    max-width: 100%;
}
.admin-plan-inline select {
    flex: 1 1 6.5rem;
    min-width: 0;
    max-width: 100%;
    padding: 0.35rem 0.5rem;
    font-size: 0.88rem;
}
.admin-plan-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 0.75rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
}
.admin-plan-form label {
    margin: 0;
    flex: 1 1 12rem;
    min-width: 0;
}
.admin-plan-form select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.usage-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.85rem;
}
.usage-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
    padding: 0.95rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f7f9f8;
}
.usage-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
}
.usage-card-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 400;
}
.usage-card-label .icon {
    flex-shrink: 0;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--brand);
}
.usage-card-values {
    flex-shrink: 0;
    text-align: right;
    line-height: 1.2;
}
.usage-card-used {
    display: block;
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.usage-card-limit {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: var(--muted);
}
.usage-card-bar {
    height: 6px;
    border-radius: 999px;
    background: #e2e8e5;
    overflow: hidden;
}
.usage-card-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
    transition: width 0.25s ease;
}
.usage-card.is-warn .usage-card-fill { background: #c9862a; }
.usage-card.is-full .usage-card-fill { background: var(--danger); }
.usage-card.is-unlimited .usage-card-fill {
    width: 100% !important;
    background: linear-gradient(90deg, var(--brand), #7bb89a);
    opacity: 0.45;
}
.owner-stat-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    margin-top: 0.55rem;
    font-size: 0.82rem;
    color: var(--muted);
}
.owner-stat-strip strong {
    color: var(--ink);
    font-weight: 700;
}

@media (max-width: 900px) {
    .usage-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .usage-card-grid {
        grid-template-columns: 1fr;
    }
}

.workspace-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.7rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0 0.15rem;
}
.workspace-label {
    font-size: 0.82rem;
    color: #d5e2ea;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
}
.workspace-switcher {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: -0.35rem;
}
.workspace-switch-btn {
    width: 100%;
    justify-content: flex-start;
    color: #9db0bd;
}

.content-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100vh;
    background: var(--bg);
}

.topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 30;
}
.topbar-title {
    font-family: var(--display);
    font-size: 1.02rem;
    font-weight: 700;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}
@media (min-width: 961px) {
    .topbar-title { visibility: hidden; }
}

.nav-toggle {
    display: none;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.nav-toggle .icon { font-size: 1.35rem; color: var(--ink); }

.topbar-collapse {
    display: inline-flex;
}

/* Desktop collapsed rail */
.app-shell.is-collapsed .brand-name,
.app-shell.is-collapsed .user-chip,
.app-shell.is-collapsed .sidebar-footer form,
.app-shell.is-collapsed .nav-label,
.app-shell.is-collapsed .workspace-chip,
.app-shell.is-collapsed .workspace-switcher .nav-label {
    display: none;
}
.app-shell.is-collapsed .sidebar {
    padding: 1rem 0.65rem;
    align-items: center;
}
.app-shell.is-collapsed .nav {
    width: 100%;
    align-items: center;
}
.app-shell.is-collapsed .nav a {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
}
.app-shell.is-collapsed .nav a .icon {
    font-size: 1.35rem;
}

.main {
    padding: 1.5rem 1.5rem 2.75rem;
    min-width: 0;
    overflow-x: hidden;
    flex: 1;
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
}

.campaign-editor {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
    min-width: 0;
    max-width: 100%;
}
.draft-status-row {
    margin: 0;
    align-items: center;
}
#draft-status {
    margin: 0;
}
#draft-status.is-ok { color: var(--ok); }
#draft-status.is-error { color: var(--danger); }
.campaign-editor > * {
    min-width: 0;
    max-width: 100%;
}
.editor-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}
.campaign-send-actions {
    margin: 0;
    align-items: center;
    flex-wrap: wrap;
}
.campaign-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.85rem 0 1rem;
}
.campaign-filter {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    font-size: 0.9rem;
    text-decoration: none;
}
.campaign-filter:hover {
    color: var(--ink);
    text-decoration: none;
    border-color: #c5d0c9;
}
.campaign-filter.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    font-weight: 700;
}
.campaign-row-draft td {
    background: #f7fbf8;
}

.preview-panel {
    position: sticky;
    top: 1rem;
    min-width: 0;
    max-width: 100%;
}
.preview-frame-wrap {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: auto;
    background: #e9eef2;
    min-height: 480px;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
#email-preview,
.email-preview-frame {
    width: 100%;
    min-width: 100%;
    height: 640px;
    border: 0;
    background: #e9eef2;
    display: block;
}

.page-header { margin-bottom: 1.35rem; }
.page-header h1 {
    font-size: 1.55rem;
    letter-spacing: -0.02em;
}
.page-header .muted {
    margin: 0.25rem 0 0;
}
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.row { display: flex; align-items: center; }
.gap { gap: 0.6rem; flex-wrap: wrap; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    min-width: 0;
    max-width: 100%;
}
.panel h2 {
    font-size: 1.02rem;
    margin-bottom: 0.75rem;
}

.panel-inline {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.narrow { max-width: 480px; }
.grid-2 {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1rem;
}

.ai-bar { margin-bottom: 1rem; }
.ai-header { margin-bottom: 1rem; }
.ai-title-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.ai-title-row h2 { margin: 0; }
.ai-title-icon {
    color: var(--brand);
    font-size: 1.45rem;
}
.ai-header-copy .muted { margin: 0.35rem 0 0; }
.ai-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.9fr);
    gap: 1rem;
    align-items: stretch;
}
.ai-brief textarea {
    min-height: 7.5rem;
}
.ai-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.ai-actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: auto;
}
.ai-actions .btn { width: 100%; }

.template-picker { margin-bottom: 1rem; }
.template-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.template-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
}
.template-chip:hover {
    border-color: var(--brand);
    color: var(--brand-dark);
    text-decoration: none;
}
.template-chip.is-active {
    border-color: var(--brand);
    background: rgba(11, 110, 79, 0.1);
    color: var(--brand-dark);
}
.template-chip .icon { font-size: 1.05rem; }
.template-delete { margin-top: 1rem; }

.invite-pending {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.invite-link-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.invite-link {
    flex: 1;
    min-width: 12rem;
    font-size: 0.75rem;
    word-break: break-all;
    background: rgba(20, 33, 43, 0.05);
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
}

.bulk-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    padding: 0.7rem 0.9rem;
    background: #102028;
    color: #e8eef2;
    border-radius: 12px;
    box-shadow: var(--shadow);
}
.bulk-bar-count { margin-right: 0.25rem; }
.bulk-bar .btn-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff !important;
    font-weight: 700;
}
.bulk-bar .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}
.bulk-bar .btn-danger {
    color: #fff !important;
}
.bulk-bar .btn-danger .icon {
    color: #fff !important;
}
.bulk-bar form { display: inline-flex; }

.selectable-table .col-check {
    width: 2.5rem;
    vertical-align: middle;
}
.check-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    cursor: pointer;
}
.check-wrap input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--brand);
    cursor: pointer;
}
.selectable-table tr.is-selected td {
    background: rgba(11, 110, 79, 0.08);
}
.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;
}

.preview-header { margin-bottom: 0.75rem; }
.preview-as {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--muted);
}
.preview-subject {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.65rem 0.8rem;
    margin-bottom: 0.75rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.image-tools {
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 0.75rem 0.85rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.image-tools-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.image-tools-row input[type="url"],
.image-tools-row input[type="file"] {
    flex: 1;
    min-width: 180px;
}

.is-hidden { display: none !important; }

.editor-tabs,
.preview-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.2rem;
    background: #e7eef3;
    border-radius: 8px;
}
.editor-tab,
.preview-tab {
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
}
.editor-tab.is-active,
.preview-tab.is-active {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 2px rgba(20, 33, 43, 0.08);
}

.builder-pane,
.code-pane {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.module-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    padding: 0.55rem 0.65rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.module-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.module-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}
.module-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    background: #f3f7f9;
    border-bottom: 1px solid var(--line);
}
.module-card-actions { display: flex; gap: 0.25rem; }
.module-card-body {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.module-image-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.preview-text-wrap {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    min-height: 480px;
    overflow: auto;
}
.text-preview {
    margin: 0;
    padding: 1.25rem 1.35rem;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--ink);
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--muted);
}

input, textarea, select {
    font: inherit;
    font-weight: 400;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
    background: white;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #9dceb8;
    box-shadow: 0 0 0 3px rgba(11, 110, 79, 0.12);
}

textarea { resize: vertical; min-height: 100px; }
.checkbox { flex-direction: row; align-items: center; gap: 0.5rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.58rem 0.95rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn .icon { font-size: 1.15rem; line-height: 1; }
.btn-sm .icon { font-size: 1.05rem; }
.btn-icon { gap: 0.4rem; }
.btn-primary { background: var(--brand); color: #fff !important; }
.btn-primary:hover { background: var(--brand-dark); color: #fff !important; }
.btn-primary .icon { color: #fff !important; }
.btn-secondary { background: #1a2332; color: #fff !important; }
.btn-secondary:hover { color: #fff !important; }
.btn-secondary .icon { color: #fff !important; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink) !important; font-weight: 400; }
.btn-ghost:hover { background: #f7f9fc; color: var(--ink) !important; }
.btn-ghost .icon { color: inherit; }
a.btn { text-decoration: none; }
a.btn:hover { text-decoration: none; }
.sidebar .btn-ghost {
    border-color: rgba(255, 255, 255, 0.12);
    color: #e8eef2 !important;
    background: transparent;
}
.sidebar .btn-ghost:hover { background: rgba(255, 255, 255, 0.06); color: #fff !important; }
.btn-danger { background: var(--danger); color: #fff !important; }
.btn-danger:hover { color: #fff !important; }
.btn-danger .icon { color: #fff !important; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.85rem; }

.material-symbols-outlined.icon {
    font-family: "Material Symbols Outlined", sans-serif;
    font-weight: normal;
    font-style: normal;
    font-size: 1.25rem;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
    user-select: none;
    vertical-align: middle;
}

.flash-stack,
.alert-stack,
.toast-stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 80;
    width: min(380px, calc(100vw - 1.5rem));
    margin: 0;
    pointer-events: none;
}
.toast {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: start;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    border: 1px solid transparent;
    background: #fff;
    box-shadow: 0 16px 40px rgba(20, 33, 43, 0.16);
    pointer-events: auto;
    animation: toast-in 0.28s ease;
}
.toast-icon {
    width: 2.15rem;
    height: 2.15rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: inherit;
}
.toast-icon .icon { font-size: 1.25rem; }
.toast-body { min-width: 0; padding-top: 0.1rem; }
.toast-title {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}
.toast-message {
    margin: 0;
    color: var(--ink);
    font-size: 0.95rem;
    line-height: 1.4;
    word-break: break-word;
}
.toast-dismiss {
    border: 0;
    background: transparent;
    color: var(--muted);
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}
.toast-dismiss:hover {
    background: rgba(20, 33, 43, 0.06);
    color: var(--ink);
}
.toast-dismiss .icon { font-size: 1.1rem; }
.toast.is-hiding {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-success { color: var(--ok); border-color: #c6e6d5; background: #f7fcf9; }
.toast-success .toast-icon { background: rgba(11, 110, 79, 0.12); }
.toast-error { color: var(--danger); border-color: #f0c7bf; background: #fff8f6; }
.toast-error .toast-icon { background: rgba(163, 59, 43, 0.12); }
.toast-warning { color: var(--warn); border-color: #f0dfb3; background: #fffaf0; }
.toast-warning .toast-icon { background: rgba(154, 107, 18, 0.12); }
.toast-info { color: #1f4f73; border-color: #c5d8e6; background: #f5f9fc; }
.toast-info .toast-icon { background: rgba(31, 79, 115, 0.12); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Confirm modal */
.modal-root {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 1rem;
}
.modal-root[hidden] { display: none !important; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 32, 40, 0.48);
    backdrop-filter: blur(2px);
}
.modal {
    position: relative;
    width: min(420px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.35rem 1.35rem 1.2rem;
    box-shadow: 0 24px 60px rgba(16, 32, 40, 0.22);
    animation: modal-in 0.22s ease;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.modal-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(154, 107, 18, 0.12);
    color: var(--warn);
}
.modal-icon .icon { font-size: 1.45rem; }
.modal-root.is-danger .modal-icon {
    background: rgba(163, 59, 43, 0.12);
    color: var(--danger);
}
.modal-root.is-primary .modal-icon {
    background: rgba(11, 110, 79, 0.12);
    color: var(--brand);
}
.modal-title {
    margin: 0;
    font-size: 1.25rem;
}
.modal-message {
    margin: 0.35rem 0 0;
    color: var(--muted);
    line-height: 1.45;
    white-space: pre-wrap;
}
.account-delete-warning {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid #f0b4ac;
    background: #fcedea;
    color: #7a271a;
}
.account-delete-warning p { margin: 0 0 0.45rem; }
.account-delete-warning ul {
    margin: 0;
    padding-left: 1.2rem;
}
.account-delete-warning li { margin-bottom: 0.35rem; }
.account-delete-warning li:last-child { margin-bottom: 0; }

.settings-page-header { margin-bottom: 1.5rem; }
.settings-layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: stretch;
}
.settings-aside {
    min-width: 0;
}
.settings-nav {
    position: sticky;
    top: 4.75rem; /* below sticky topbar */
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.settings-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    color: var(--muted);
    font-weight: 400;
    text-decoration: none;
}
.settings-nav-link:hover {
    background: #f4f7f5;
    color: var(--ink);
    text-decoration: none;
}
.settings-nav-link .icon { font-size: 1.1rem; color: inherit; }
.settings-nav-danger { color: #9b3a2e; }
.settings-nav-danger:hover {
    background: #fcedea;
    color: #7a271a;
}
.settings-main {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    min-width: 0;
}
.settings-section {
    margin-bottom: 0;
    scroll-margin-top: 1rem;
}
.settings-section-head {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
}
.settings-section-head h2 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}
.settings-section-head .muted {
    margin: 0;
    font-size: 0.9rem;
}
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.settings-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
}
.settings-span-2 { grid-column: 1 / -1; }
.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding-top: 0.15rem;
}
.settings-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.settings-list-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfc;
}
.settings-list-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.55rem;
    min-width: 0;
}
.settings-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.settings-subpanel {
    margin-top: 0.35rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}
.settings-subpanel h3,
.settings-subtitle {
    margin: 0 0 0.55rem;
    font-size: 0.95rem;
}
.settings-empty { margin: 0 0 0.75rem; }
.settings-status { margin: 0 0 0.75rem; }
.settings-danger {
    border-color: #e0b4ac;
}
.settings-danger .settings-section-head {
    border-bottom-color: #f0d0ca;
}

@media (max-width: 900px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }
    .settings-nav {
        position: sticky;
        top: 4.25rem;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    .settings-nav-link {
        padding: 0.45rem 0.65rem;
        font-size: 0.9rem;
    }
    .settings-form-grid {
        grid-template-columns: 1fr;
    }
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.55rem;
    margin-top: 0.35rem;
}
body.modal-open { overflow: hidden; }

@keyframes modal-in {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
    .toast-stack {
        top: auto;
        bottom: 1rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }
    .modal-actions {
        flex-direction: column-reverse;
    }
    .modal-actions .btn { width: 100%; }
}

/* Legacy alert/flash kept for safety */
.alert-stack { margin-bottom: 1.15rem; }
.alert {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.75rem;
    align-items: start;
    padding: 0.85rem 0.9rem;
    border-radius: 12px;
    border: 1px solid transparent;
    background: #fff;
    box-shadow: 0 8px 24px rgba(20, 33, 43, 0.06);
}
.flash-stack { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1rem; }
.flash {
    padding: 0.8rem 0.95rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: white;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
    font-weight: 400;
}
.flash-success { border-color: #9dceb8; background: #eaf7f0; color: var(--ok); }
.flash-error { border-color: #f0b4ac; background: #fcedea; color: var(--danger); }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.15rem;
}
.stat-grid.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.05rem;
    box-shadow: var(--shadow-sm);
}
.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 400;
    margin-bottom: 0.3rem;
}
.stat-value {
    font-family: var(--display);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; }
th, td {
    text-align: left;
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.92rem;
}
th {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #f7f9fc;
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #eef1f6;
    color: #44515e;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-draft { background: #eef1f6; color: #44515e; }
.badge-scheduled { background: #fff4df; color: #8a5a00; }
.badge-sending, .badge-queued { background: #e5f0fb; color: #1849a9; }
.badge-sent, .badge-active { background: #e3f5eb; color: #08553c; }
.badge-cancelled, .badge-failed, .badge-bounced { background: #fde8e6; color: #912018; }
.badge-unsubscribed { background: #eef1f6; color: #44515e; }

.usage-stack { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 0.75rem; }
.usage-row { display: flex; flex-direction: column; gap: 0.35rem; }
.usage-meter {
    height: 0.45rem;
    border-radius: 999px;
    background: #e7edf2;
    overflow: hidden;
}
.usage-meter > span {
    display: block;
    height: 100%;
    background: var(--accent, #2f6fed);
    border-radius: inherit;
}
.usage-meter.is-over > span { background: var(--danger); }

.plan-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}
.plan-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    box-shadow: var(--shadow-sm);
}
.plan-card.is-current {
    border-color: var(--brand);
    background: #f3faf6;
    box-shadow: 0 0 0 1px #b7decc inset, var(--shadow-sm);
}
.billing-test-panel h2 { margin-bottom: 0.35rem; }
.billing-test-steps {
    margin: 0.75rem 0 0;
    padding-left: 1.25rem;
    color: var(--muted);
    line-height: 1.55;
}
.billing-test-steps li { margin-bottom: 0.45rem; }
.billing-test-steps code,
.billing-test-panel code {
    font-size: 0.85em;
}
.billing-test-code {
    margin: 0.65rem 0;
    padding: 0.85rem 1rem;
    background: #152028;
    color: #e8eef2;
    border-radius: 10px;
    font-size: 0.82rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
}
.billing-test-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.85rem 0 0.5rem;
}
.billing-test-cards > div {
    padding: 0.75rem 0.85rem;
    background: #f4f7f5;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.billing-test-cards strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
}
.billing-test-cards code {
    display: block;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    color: var(--ink);
    background: transparent;
    padding: 0;
}

.billing-pay {
    max-width: 640px;
    margin: 0 auto;
}
.billing-pay-brand {
    margin-bottom: 1.25rem;
    text-align: center;
}
.billing-pay-brand .brand {
    display: inline-flex;
    justify-content: center;
}
.billing-pay-brand .brand-logo {
    height: 3.25rem;
    max-width: min(320px, 100%);
}
.billing-pay-tagline {
    margin: 0.55rem 0 0;
}
.billing-pay-panel {
    padding: 1.35rem 1.25rem 1.5rem;
}
.billing-pay-summary {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}
.billing-pay-summary h1 {
    margin: 0 0 0.35rem;
    font-size: 1.45rem;
}
.billing-pay-amount {
    margin: 0 0 0.65rem;
    font-size: 1.6rem;
}
.billing-pay-stripe {
    min-height: 280px;
}
#stripe-checkout-error {
    margin-top: 1rem;
}

.plan-price {
    font-family: var(--font);
    font-size: 1.55rem;
    font-weight: 700;
    margin: 0;
}
.plan-limits {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.email-preview {
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 1rem;
    background: white;
    max-height: 360px;
    overflow: auto;
}

.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.list li { padding: 0.5rem 0; border-bottom: 1px solid var(--line); }

.guest-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 2.5rem 1.25rem;
    background: #fff;
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: 400;
}
.guest-body h1,
.guest-body h2,
.guest-body h3,
.guest-body .brand-name {
    font-family: var(--font);
    font-weight: 700;
}
.guest-shell {
    width: min(380px, 100%);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}
.guest-brand {
    text-decoration: none;
    color: inherit;
}
.guest-brand:hover { text-decoration: none; }
.guest-content h1 {
    font-size: 1.55rem;
    letter-spacing: -0.01em;
    margin-bottom: 0.35rem;
    font-weight: 700;
}
.guest-lead {
    margin: 0 0 1.25rem;
    font-size: 0.95rem;
    line-height: 1.45;
    font-weight: 400;
}
.guest-body .stack { gap: 0.9rem; }
.guest-body label {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 700;
}
.guest-body input {
    border-radius: 8px;
    border-color: #d9e0e6;
    background: #fff;
    font-family: inherit;
    font-weight: 400;
}
.guest-body .btn-primary {
    width: 100%;
    justify-content: center;
    margin-top: 0.25rem;
}
.guest-meta {
    margin: 1rem 0 0;
    font-size: 0.9rem;
    font-weight: 400;
}
.guest-meta + .guest-meta { margin-top: 0.45rem; }
.guest-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.55rem;
    align-items: center;
    font-size: 0.8rem;
    color: var(--muted);
    padding-top: 0.25rem;
    font-weight: 400;
}
.guest-footer a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 400;
}
.guest-footer a:hover { color: var(--ink); text-decoration: none; }

.totp-setup {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: start;
}
.totp-secret {
    display: inline-block;
    letter-spacing: 0.08em;
    word-break: break-all;
    padding: 0.45rem 0.6rem;
}
.recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    list-style: none;
    padding: 0.5rem 0 0;
    margin: 0;
}

.marketing-body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    background: var(--bg);
    font-family: var(--font);
    font-weight: 400;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.marketing-body h1,
.marketing-body h2,
.marketing-body h3,
.marketing-body .brand-name,
.marketing-body strong,
.marketing-body b {
    font-family: var(--font);
    font-weight: 700;
}
.marketing-body em,
.marketing-body i:not(.material-symbols-outlined) {
    font-style: normal;
    font-weight: 400;
}
.mkt-wrap {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
}
.mkt-header {
    width: 100%;
    background: #fff;
    border-bottom: 1px solid #e6ebf2;
}
.mkt-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
}
.mkt-brand {
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
}
.mkt-brand:hover { text-decoration: none; }
.mkt-brand .brand-logo {
    height: 3rem;
    max-width: min(280px, 58vw);
}
.guest-brand .brand-logo {
    height: 3.25rem;
    max-width: min(320px, 100%);
}
.mkt-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem 1rem;
}
.mkt-nav > a:not(.btn) {
    color: var(--muted);
    font-weight: 400;
    font-size: 0.95rem;
    text-decoration: none;
    padding: 0.35rem 0.15rem;
    border-bottom: 2px solid transparent;
}
.mkt-nav > a:not(.btn):hover {
    color: var(--ink);
    text-decoration: none;
}
.mkt-nav > a:not(.btn).is-active {
    color: var(--brand-dark);
    font-weight: 700;
    border-bottom-color: var(--brand);
}
.mkt-nav .btn-primary,
.mkt-nav a.btn-primary {
    color: #fff !important;
}
.mkt-nav .btn-primary:hover,
.mkt-nav a.btn-primary:hover {
    color: #fff !important;
}
.mkt-footer-links a.is-active,
.mkt-footer-meta a.is-active {
    color: var(--brand-dark);
    font-weight: 700;
}
.guest-footer a.is-active {
    color: var(--brand-dark);
    font-weight: 700;
}
.guest-body .btn-primary,
.guest-body .btn-primary span {
    color: #fff !important;
}
.mkt-main {
    width: 100%;
    padding: 2rem 0 3rem;
}
.mkt-eyebrow {
    display: inline-flex;
    align-items: center;
    margin: 0 0 0.85rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: #e8f5ef;
    color: var(--brand-dark);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.mkt-hero {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    gap: 2rem;
    align-items: center;
    padding: 0.75rem 0 1.75rem;
}
.mkt-hero-copy { max-width: 32rem; }
.mkt-kicker {
    margin: 0 0 0.65rem;
    font-size: clamp(2.4rem, 5vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--brand);
}
.mkt-headline {
    margin: 0 0 0.75rem;
    font-family: var(--font);
    font-size: clamp(1.2rem, 2.2vw, 1.45rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.35;
    color: #1a2332;
}
.mkt-lede {
    margin: 0;
    font-size: 1rem;
    line-height: 1.55;
    color: #6b7785;
    font-weight: 400;
}
.mkt-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.4rem;
}
.mkt-cta-row .btn-primary,
.mkt-cta-row a.btn-primary {
    color: #fff !important;
}
.mkt-cta-row .btn-primary span {
    color: #fff !important;
}
.mkt-price-card .btn-primary {
    color: #fff !important;
}
.mkt-btn-soft {
    background: #fff;
    color: #1a2332;
    border: 1px solid #d8dee6;
}
.mkt-btn-soft:hover {
    background: #f7f9fc;
    text-decoration: none;
}

.mkt-dash {
    display: grid;
    grid-template-columns: 64px 1fr;
    min-height: 360px;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e6ebf2;
    box-shadow: 0 16px 40px rgba(26, 35, 50, 0.07);
    animation: mkt-rise 0.6s ease both;
}
.mkt-dash-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem 0.65rem;
    background: #152028;
}
.mkt-dash-logo {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: transparent;
    display: grid;
    place-items: center;
    margin-bottom: 0.4rem;
    overflow: hidden;
}
.mkt-dash-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.mkt-dash-side span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
}
.mkt-dash-side span.is-on { background: #7dcea0; }
.mkt-dash-main { padding: 1.15rem 1.2rem 1.25rem; }
.mkt-dash-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.mkt-dash-top strong {
    font-family: var(--font);
    font-size: 0.98rem;
    font-weight: 700;
}
.mkt-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: #e8f5ef;
    color: var(--brand-dark);
    font-size: 0.72rem;
    font-weight: 700;
}
.mkt-pill-accent {
    background: #dff3ea;
    margin-bottom: 0.75rem;
}
.mkt-stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
}
.mkt-stat {
    background: #f7f9fc;
    border: 1px solid #e8edf3;
    border-radius: 14px;
    padding: 0.75rem 0.8rem;
}
.mkt-stat span {
    display: block;
    color: #8a96a3;
    font-size: 0.72rem;
    font-weight: 400;
    margin-bottom: 0.2rem;
}
.mkt-stat strong {
    font-family: var(--font);
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    font-weight: 700;
}
.mkt-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    height: 90px;
    padding: 0.65rem 0.5rem 0;
    margin-bottom: 0.85rem;
    background: #f7f9fc;
    border: 1px solid #e8edf3;
    border-radius: 14px;
}
.mkt-chart i {
    flex: 1;
    height: var(--h);
    border-radius: 8px 8px 4px 4px;
    background: #0b6e4f;
    opacity: 0.85;
    font-style: normal;
    animation: mkt-bar 0.7s ease both;
}
.mkt-chart i:nth-child(2) { animation-delay: 0.05s; }
.mkt-chart i:nth-child(3) { animation-delay: 0.1s; }
.mkt-chart i:nth-child(4) { animation-delay: 0.15s; }
.mkt-chart i:nth-child(5) { animation-delay: 0.2s; }
.mkt-chart i:nth-child(6) { animation-delay: 0.25s; }
.mkt-chart i:nth-child(7) { animation-delay: 0.3s; }
.mkt-dash-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.mkt-dash-list div {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.7rem;
    background: #f7f9fc;
    border: 1px solid #e8edf3;
    border-radius: 10px;
    font-size: 0.82rem;
}
.mkt-dash-list span { font-weight: 700; color: #1a2332; }
.mkt-dash-list em {
    font-style: normal;
    color: #8a96a3;
    font-weight: 400;
    font-size: 0.75rem;
}

.mkt-section {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e5ec;
}
.mkt-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.1rem;
}
.mkt-section-head h2 {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    font-weight: 700;
}
.mkt-section-head p {
    margin: 0;
    color: #6b7785;
    font-size: 0.92rem;
    font-weight: 400;
}
.mkt-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}
.mkt-tiles-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.mkt-tile {
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 16px;
    padding: 1.05rem 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mkt-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(26, 35, 50, 0.06);
}
.mkt-tile-icon {
    display: inline-flex;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    background: #e8f5ef;
    color: var(--brand);
    margin-bottom: 0.7rem;
}
.mkt-tile-icon .material-symbols-outlined { font-size: 1.15rem; }
.mkt-tile h3 {
    margin: 0 0 0.35rem;
    font-size: 0.98rem;
    font-weight: 700;
}
.mkt-tile p {
    margin: 0;
    color: #6b7785;
    font-size: 0.88rem;
    line-height: 1.45;
    font-weight: 400;
}

.mkt-page-head {
    max-width: 40rem;
    margin-bottom: 1.5rem;
}
.mkt-page-head h1 {
    margin: 0 0 0.55rem;
    font-size: clamp(1.7rem, 3.5vw, 2.2rem);
    letter-spacing: -0.02em;
    font-weight: 700;
}
.mkt-price-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}
.mkt-price-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 18px;
    padding: 1.25rem 1.15rem;
    min-height: 100%;
}
.mkt-price-card.is-featured {
    border-color: #b7decc;
    box-shadow: 0 14px 34px rgba(11, 110, 79, 0.12);
    transform: translateY(-4px);
}
.mkt-price-card h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}
.mkt-price-amount {
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
}
.mkt-price-amount strong {
    font-family: var(--font);
    font-size: 2rem;
    letter-spacing: -0.02em;
    font-weight: 700;
}
.mkt-price-amount span {
    color: #8a96a3;
    font-weight: 400;
}
.mkt-price-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex: 1;
}
.mkt-price-card li {
    color: #6b7785;
    font-size: 0.9rem;
    padding-left: 1rem;
    position: relative;
    font-weight: 400;
}
.mkt-price-card li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
}
.mkt-price-card .btn {
    width: 100%;
    justify-content: center;
}

.mkt-prose {
    max-width: 40rem;
    margin: 0;
    padding: 0.25rem 0 0.5rem;
    background: transparent;
    border: none;
    border-radius: 0;
}
.mkt-prose h1 {
    font-size: clamp(1.7rem, 3.5vw, 2.2rem);
    letter-spacing: -0.02em;
    margin: 0 0 0.65rem;
    font-weight: 700;
}
.mkt-prose h2 {
    margin-top: 1.75rem;
    margin-bottom: 0.45rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
}
.mkt-prose p,
.mkt-prose li {
    line-height: 1.65;
    color: #6b7785;
    font-weight: 400;
}
.mkt-prose .mkt-lede {
    color: #6b7785;
    font-size: 1.05rem;
    max-width: 36rem;
}
.mkt-prose strong { color: #1a2332; font-weight: 700; }
.mkt-prose ul { padding-left: 1.1rem; }
.mkt-prose a { font-weight: 700; }

.mkt-about-intro {
    position: relative;
    margin: -2rem -1.5rem 0;
    padding: 2.25rem 1.5rem 2rem;
    background:
        radial-gradient(ellipse 80% 70% at 0% 0%, rgba(11, 110, 79, 0.09), transparent 55%),
        radial-gradient(ellipse 60% 50% at 100% 20%, rgba(11, 110, 79, 0.05), transparent 50%),
        linear-gradient(180deg, #f4f7f5 0%, var(--bg) 100%);
    border-bottom: 1px solid #e0e5ec;
    animation: mkt-rise 0.45s ease both;
}
.mkt-about-intro h1 {
    margin: 0 0 0.65rem;
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    letter-spacing: -0.025em;
    font-weight: 700;
    max-width: 28rem;
}
.mkt-about-intro .mkt-lede {
    margin: 0;
    max-width: 34rem;
    font-size: 1.08rem;
    line-height: 1.55;
}
.mkt-about-beliefs {
    margin-top: 0;
    padding-top: 1.75rem;
    border-top: none;
}
.mkt-about-beliefs .mkt-tile {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0.35rem 0.25rem 0.35rem 0;
    box-shadow: none;
}
.mkt-about-beliefs .mkt-tile:hover {
    transform: none;
    box-shadow: none;
}
.mkt-about-beliefs .mkt-tile + .mkt-tile {
    border-left: 1px solid #e0e5ec;
    padding-left: 1.15rem;
}
.mkt-about-company {
    margin-top: 1.75rem;
    padding: 1.5rem 0;
    border-top: 1px solid #e0e5ec;
    max-width: 40rem;
    animation: mkt-rise 0.5s ease 0.08s both;
}
.mkt-about-company h2 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
    font-weight: 700;
}
.mkt-about-company p {
    margin: 0;
    color: #6b7785;
    line-height: 1.6;
    font-size: 1rem;
}
.mkt-about-cta {
    margin-top: 0.5rem;
    padding: 1.75rem 0 0.5rem;
    border-top: 1px solid #e0e5ec;
    animation: mkt-rise 0.55s ease 0.12s both;
}
.mkt-about-cta h2 {
    margin: 0 0 0.45rem;
    font-size: 1.35rem;
    font-weight: 700;
}
.mkt-about-cta .mkt-lede {
    margin: 0 0 1.1rem;
    max-width: 32rem;
}
.mkt-about-cta .mkt-cta-row {
    margin-top: 0;
}
.mkt-about-cta .btn-primary,
.mkt-about-cta a.btn-primary,
.mkt-about-cta .btn-primary span {
    color: #fff !important;
}
.mkt-back-home {
    margin: 1.1rem 0 0;
    font-size: 0.92rem;
}
.mkt-back-home a {
    color: var(--muted);
    font-weight: 400;
    text-decoration: none;
}
.mkt-back-home a:hover {
    color: var(--brand-dark);
    text-decoration: none;
}

.mkt-footer {
    width: 100%;
    border-top: 1px solid #e0e5ec;
    background: #fff;
    padding: 1.1rem 0;
}
.mkt-footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: #8a96a3;
    font-weight: 400;
}
.mkt-footer-meta a {
    color: #8a96a3;
    text-decoration: none;
    font-weight: 400;
}
.mkt-footer-meta a:hover { color: #1a2332; text-decoration: none; }
.mkt-footer-links {
    display: flex;
    gap: 1rem;
}

@keyframes mkt-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
@keyframes mkt-bar {
    from { transform: scaleY(0.25); transform-origin: bottom; opacity: 0.45; }
    to { transform: none; opacity: 0.85; }
}

@media (max-width: 960px) {
    .mkt-hero { grid-template-columns: 1fr; }
    .mkt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mkt-tiles-3 { grid-template-columns: 1fr; }
    .mkt-about-beliefs .mkt-tile + .mkt-tile {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid #e0e5ec;
        padding-top: 1rem;
        margin-top: 0.35rem;
    }
    .mkt-price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mkt-price-card.is-featured { transform: none; }
    .billing-test-cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .mkt-header-inner { flex-direction: column; align-items: flex-start; }
    .mkt-tiles,
    .mkt-tiles-3,
    .mkt-price-grid { grid-template-columns: 1fr; }
    .mkt-about-intro {
        margin-left: -1.5rem;
        margin-right: -1.5rem;
    }
    .mkt-stat-row { grid-template-columns: 1fr; }
    .totp-setup { grid-template-columns: 1fr; }
}

#sendsChart {
    width: 100%;
    max-width: 100%;
    height: auto;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--line);
}

@media (max-width: 960px) {
    .app-shell,
    .app-shell.is-collapsed {
        grid-template-columns: 1fr;
    }

    .nav-toggle {
        display: inline-flex;
    }
    .topbar-collapse {
        display: none;
    }
    .nav-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(16, 32, 40, 0.45);
        z-index: 45;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    .app-shell.nav-open .nav-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(280px, 86vw);
        height: 100vh;
        transform: translateX(-105%);
        box-shadow: none;
        z-index: 50;
    }
    .app-shell.is-collapsed .sidebar {
        padding: 1.25rem 1rem;
        align-items: stretch;
    }
    .app-shell.is-collapsed .brand-name,
    .app-shell.is-collapsed .user-chip,
    .app-shell.is-collapsed .sidebar-footer form,
    .app-shell.is-collapsed .nav-label {
        display: revert;
    }
    .app-shell.is-collapsed .nav a {
        display: flex;
        width: auto;
        height: auto;
        padding: 0.55rem 0.7rem;
        font-size: inherit;
        color: #c9d6df;
    }
    .app-shell.nav-open .sidebar {
        transform: translateX(0);
        box-shadow: 12px 0 40px rgba(0, 0, 0, 0.25);
    }

    body.nav-locked {
        overflow: hidden;
    }

    .main {
        padding: 1rem 1rem 2rem;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .owner-manage-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
    }
    .owner-manage-main,
    .owner-manage-actions {
        flex: 0 0 auto;
        width: 100%;
    }
    .owner-manage-actions {
        justify-content: flex-start;
    }
    .owner-manage-actions .btn,
    .admin-plan-inline .btn {
        flex: 0 1 auto;
    }
    .admin-plan-inline {
        width: 100%;
    }
    .admin-plan-inline select {
        flex: 1 1 auto;
        width: auto;
        min-width: 7rem;
    }
    .admin-plan-form {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-plan-form label,
    .admin-plan-form select,
    .admin-plan-form .btn {
        width: 100%;
        max-width: 100%;
    }
    .panel {
        overflow-x: clip;
    }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: 1fr; }
    .campaign-editor { grid-template-columns: 1fr; }
    .ai-layout { grid-template-columns: 1fr; }
    .preview-panel { position: static; }
    .editor-tabs { width: 100%; }
    .editor-tab { flex: 1; }
    .table-wrap { margin: 0 -0.25rem; }
    .actions { flex-wrap: wrap; }
}

@media (max-width: 560px) {
    .plan-grid { grid-template-columns: 1fr; }
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }
    .stat {
        padding: 0.7rem 0.75rem;
    }
    .stat-value {
        font-size: 1.35rem;
    }
    .topbar { padding: 0.65rem 0.85rem; }
}
