:root {
    --bg: #07111f;
    --bg-soft: #0d1728;
    --panel: rgba(12, 20, 34, 0.94);
    --panel-strong: #101c31;
    --panel-border: rgba(148, 163, 184, 0.14);
    --text: #e5eefb;
    --muted: #94a3b8;
    --muted-2: #cbd5e1;
    --accent: #60a5fa;
    --accent-2: #5eead4;
    --danger: #fb7185;
    --success: #34d399;
    --shadow: 0 24px 60px rgba(2, 6, 23, 0.35);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}

* {
    box-sizing: border-box;
}

button,
a,
input,
select,
textarea,
[role="button"] {
    -webkit-tap-highlight-color: transparent;
}

button,
.btn,
a.btn,
.topbar-btn,
.publisher-fab-button,
.publisher-fab-item,
.side-nav a,
.publisher-settings-btn,
.publisher-logout-btn,
.btn-settings,
.btn-logout {
    overflow: hidden;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

button:active,
.btn:active,
a.btn:active,
.topbar-btn:active,
.publisher-fab-button:active,
.publisher-fab-item:active,
.side-nav a:active,
.publisher-settings-btn:active,
.publisher-logout-btn:active,
.btn-settings:active,
.btn-logout:active {
    transform: translateY(1px);
    filter: brightness(0.96);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid rgba(96, 165, 250, 0.72);
    outline-offset: 3px;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    margin: 0;
    max-width: 100vw;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(96, 165, 250, 0.22), transparent 36%),
        radial-gradient(circle at 85% 10%, rgba(94, 234, 212, 0.16), transparent 28%),
        linear-gradient(180deg, #030712 0%, #08101d 46%, #040a13 100%);
}

body.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

body.auth-page .auth-shell {
    min-height: auto;
}

a {
    color: inherit;
}

code,
pre,
textarea {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, 420px);
    width: min(1080px, calc(100% - 32px));
    margin: 0 auto;
    align-items: stretch;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: linear-gradient(180deg, rgba(16, 28, 49, 0.96), rgba(11, 19, 34, 0.98));
    box-shadow: var(--shadow);
}

.auth-aside {
    padding: 40px;
    background:
        radial-gradient(circle at top right, rgba(94, 234, 212, 0.16), transparent 28%),
        linear-gradient(180deg, rgba(8, 15, 28, 0.96), rgba(7, 12, 22, 0.96));
    border-right: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.22), rgba(94, 234, 212, 0.28));
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #dbeafe;
    font-size: 1.3rem;
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.3);
}

.eyebrow {
    display: block;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
}

.title {
    font-size: clamp(1.8rem, 3vw, 3rem);
    line-height: 1.06;
    letter-spacing: -0.04em;
    margin: 0;
}

.copy {
    color: var(--muted-2);
    line-height: 1.7;
    max-width: 52ch;
}

.points {
    display: grid;
    gap: 10px;
    margin-top: auto;
}

.point {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted-2);
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(148, 163, 184, 0.06);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.point i {
    color: #8ec5ff;
}

.auth-panel {
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    width: 100%;
    max-width: 100%;
}

.card h1,
.card h2 {
    margin: 0 0 10px;
    letter-spacing: -0.03em;
}

.subtitle {
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 22px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted-2);
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 15px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(7, 12, 22, 0.65);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: rgba(96, 165, 250, 0.38);
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.12);
    background: rgba(7, 12, 22, 0.82);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 14px;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.btn-primary {
    width: 100%;
    padding: 13px 16px;
    background: linear-gradient(135deg, #5eead4, #60a5fa);
    color: #08101d;
    box-shadow: 0 14px 30px rgba(96, 165, 250, 0.22);
}

.publisher-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1500;
}

.publisher-fab-button {
    width: 62px;
    height: 62px;
    border: 0;
    border-radius: 22px;
    display: grid;
    place-items: center;
    color: #06111f;
    background: linear-gradient(135deg, #5eead4, #60a5fa);
    box-shadow: 0 22px 42px rgba(2, 6, 23, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
    cursor: pointer;
    font-size: 1.45rem;
    transition: transform 0.18s ease, filter 0.18s ease;
}

.publisher-fab-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
}

.publisher-fab.open .publisher-fab-button {
    transform: scale(0.94);
}

.publisher-fab-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    display: none;
    background: rgba(2, 6, 23, 0.34);
    backdrop-filter: blur(6px);
}

.publisher-fab.open .publisher-fab-overlay {
    display: block;
}

.publisher-fab-panel {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: min(360px, calc(100vw - 28px));
    max-height: min(560px, calc(100vh - 124px));
    overflow: auto;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 26px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(7, 12, 22, 0.96)),
        radial-gradient(circle at top right, rgba(94, 234, 212, 0.14), transparent 34%);
    box-shadow: 0 28px 70px rgba(2, 6, 23, 0.52);
    opacity: 0;
    pointer-events: none;
    transform: translateY(14px) scale(0.98);
    transform-origin: bottom right;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.publisher-fab.open .publisher-fab-panel {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.publisher-fab-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 4px 2px 14px;
}

.publisher-fab-head span {
    display: block;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.publisher-fab-head strong {
    display: block;
    margin-top: 3px;
    color: #f8fafc;
    font-size: 1.05rem;
}

.publisher-fab-close {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.08);
    cursor: pointer;
}

.publisher-fab-list {
    display: grid;
    gap: 10px;
}

.publisher-fab-item {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 9px 12px 9px 9px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 18px;
    color: #e5eefb;
    background: rgba(15, 23, 42, 0.72);
    text-decoration: none;
    font-weight: 800;
    transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.publisher-fab-item:hover {
    border-color: rgba(94, 234, 212, 0.3);
    background: rgba(30, 41, 59, 0.88);
    transform: translateY(-1px);
}

.publisher-fab-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: #08101d;
    background: linear-gradient(135deg, #dbeafe, #99f6e4);
    font-size: 1.25rem;
}

.publisher-fab-arrow {
    color: #93c5fd;
    font-size: 0.95rem;
}

@media (max-width: 620px) {
    .publisher-fab {
        right: 14px;
        bottom: 14px;
    }

    .publisher-fab-button {
        width: 58px;
        height: 58px;
        border-radius: 20px;
    }

    .publisher-fab-panel {
        bottom: 72px;
    }
}

.btn-secondary {
    padding: 13px 16px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: #dbeafe;
}

.btn-ghost {
    padding: 13px 16px;
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: #dbeafe;
}

.message,
.error {
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    line-height: 1.55;
}

.message {
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(52, 211, 153, 0.18);
    color: #bbf7d0;
}

.error {
    background: rgba(251, 113, 133, 0.12);
    border-color: rgba(251, 113, 133, 0.18);
    color: #fecdd3;
}

.login-footer,
.form-actions,
.script-actions,
.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
}

.login-footer {
    flex-direction: column;
    align-items: stretch;
    margin-top: 8px;
}

.note {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.auth-links {
    display: flex;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 14px;
    text-align: center;
    font-size: 0.92rem;
    color: var(--muted-2);
}

.auth-links a {
    font-weight: 800;
    color: #dbeafe;
}

.dashboard-shell {
    min-height: 100vh;
    max-width: 100%;
}

.side {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    overflow-y: auto;
    padding: 28px 22px;
    border-right: 1px solid var(--panel-border);
    background: linear-gradient(180deg, rgba(8, 15, 28, 0.98) 0%, rgba(7, 12, 22, 0.94) 100%);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    gap: 22px;
    z-index: 100;
}

.side-nav {
    display: grid;
    gap: 8px;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border-radius: 14px;
    text-decoration: none;
    color: var(--muted-2);
    background: rgba(148, 163, 184, 0.05);
    border: 1px solid transparent;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.side-nav a:hover,
.side-nav a.active {
    transform: translateX(3px);
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(96, 165, 250, 0.22);
    color: #fff;
}

.side-footer {
    margin-top: auto;
    display: grid;
    gap: 12px;
}

.side .publisher-account-card {
    display: grid;
    gap: 14px;
    width: 100%;
    padding: 22px;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.88)),
        radial-gradient(circle at top, rgba(96, 165, 250, 0.11), transparent 35%);
    border: 1px solid rgba(96, 165, 250, 0.16);
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.24);
}

.side .publisher-account-head {
    display: grid;
    justify-items: center;
    gap: 6px;
    text-align: center;
}

.side .publisher-account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 999px;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.18);
    border: 3px solid #60a5fa;
    font-size: 1.8rem;
}

.side .publisher-account-name,
.side .publisher-account-email {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side .publisher-account-name {
    margin-top: 4px;
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 800;
}

.side .publisher-account-email {
    color: #94a3b8;
    font-size: 0.82rem;
}

.side .publisher-account-actions {
    display: grid;
    gap: 10px;
    padding-top: 4px;
}

.side .publisher-settings-btn,
.side .publisher-logout-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 800;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.side .publisher-settings-btn {
    color: #dbeafe;
    background: rgba(96, 165, 250, 0.11);
    border: 1px solid rgba(96, 165, 250, 0.24);
}

.side .publisher-settings-btn:hover {
    color: #fff;
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.42);
}

.side .publisher-logout-btn {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.25);
}

.side .publisher-logout-btn:hover {
    color: #fff;
    transform: translateY(-1px);
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(248, 113, 113, 0.42);
}

.main {
    min-width: 0;
    padding: 26px;
    margin-left: 300px;
    overflow-x: hidden;
}

.surface {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    gap: 22px;
    overflow: hidden;
}

.hero,
.panel,
.metric-card,
.info-card,
.script-card {
    background: linear-gradient(180deg, rgba(16, 28, 49, 0.95), rgba(11, 19, 34, 0.96));
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
    max-width: 100%;
    min-width: 0;
}

.hero {
    border-radius: var(--radius-xl);
    padding: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
    gap: 22px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: -1px;
    background:
        radial-gradient(circle at top right, rgba(94, 234, 212, 0.18), transparent 22%),
        radial-gradient(circle at bottom left, rgba(96, 165, 250, 0.14), transparent 26%);
    pointer-events: none;
}

.hero-content,
.hero-side {
    position: relative;
    z-index: 1;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.12);
    color: #dbeafe;
    border: 1px solid rgba(96, 165, 250, 0.2);
    font-size: 0.86rem;
}

.hero-title {
    font-size: clamp(1.8rem, 2.4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.hero-text {
    max-width: 62ch;
    color: var(--muted-2);
    line-height: 1.7;
    font-size: 1rem;
}

.hero-meta {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: var(--muted-2);
    font-size: 0.88rem;
}

.hero-side {
    display: grid;
    gap: 12px;
    align-content: start;
}

.hero-side-card {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(94, 234, 212, 0.16));
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.hero-side-card.accent {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(94, 234, 212, 0.16));
}

.hero-side-card .label {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.hero-side-card .value {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.hero-side-card .hint {
    display: block;
    margin-top: 8px;
    color: var(--muted-2);
    font-size: 0.88rem;
    line-height: 1.5;
}

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

.metrics-grid-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
    border-radius: var(--radius-lg);
    padding: 18px;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(94, 234, 212, 0.16));
}

.metric-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.metric-label {
    color: var(--muted);
    font-size: 0.84rem;
    margin-bottom: 10px;
}

.metric-value {
    font-size: clamp(1.6rem, 2vw, 2.15rem);
    letter-spacing: -0.04em;
}

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.16), rgba(94, 234, 212, 0.16));
    color: #eaf2ff;
    flex: 0 0 auto;
}

.metric-meta {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric-subtitle,
.metric-trend {
    color: var(--muted-2);
    font-size: 0.88rem;
}

.metric-trend {
    color: #a7f3d0;
}

.panel {
    border-radius: var(--radius-xl);
    padding: 22px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.panel-head h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.06rem;
    letter-spacing: -0.02em;
}

.panel-note {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: right;
}

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

.info-card {
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(94, 234, 212, 0.16));
    min-width: 0;
}

.info-card .label {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.info-card .value {
    color: #fff;
    word-break: break-word;
    line-height: 1.5;
}

.script-card {
    border-radius: var(--radius-xl);
    padding: 22px;
}

.ad-blocks-hero {
    grid-template-columns: minmax(0, 1fr);
}

.ad-block-card {
    display: grid;
    gap: 16px;
    min-width: 0;
    padding: 20px;
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(16, 28, 49, 0.95), rgba(11, 19, 34, 0.96));
    border: 1px solid var(--panel-border);
    box-shadow: var(--shadow);
}

.ad-block-card-featured {
    padding: 22px;
}

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

.ad-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
}

.ad-block-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ad-block-title h2,
.ad-block-title h3,
.ad-block-title p {
    margin: 0;
}

.ad-block-title h2,
.ad-block-title h3 {
    color: #f8fafc;
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.ad-block-title p,
.ad-block-description {
    color: var(--muted);
    line-height: 1.55;
    font-size: 0.9rem;
}

.ad-block-description {
    margin: 0;
}

.ad-block-icon {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #dbeafe;
    background: rgba(96, 165, 250, 0.14);
    border: 1px solid rgba(96, 165, 250, 0.22);
}

.ad-block-icon i {
    font-size: 1.12rem;
}

.ad-block-icon-rotate i {
    transform: rotate(90deg);
}

.ad-code-block {
    min-height: 74px;
    font-size: 0.86rem;
}

.ad-block-actions {
    display: flex;
    justify-content: flex-start;
}

.ad-copy-btn {
    justify-self: start;
    white-space: nowrap;
}

.ad-usage-tip {
    display: grid;
    grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.25fr);
    align-items: start;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(45, 212, 191, 0.06)),
        rgba(7, 12, 22, 0.28);
    border: 1px solid rgba(96, 165, 250, 0.2);
}

.ad-usage-copy {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.ad-usage-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #f8fafc;
    font-size: 0.95rem;
}

.ad-usage-title i {
    color: #67e8f9;
}

.ad-usage-tip p {
    margin: 0;
    color: var(--muted-2);
    font-size: 0.92rem;
    line-height: 1.55;
}

.ad-usage-tip code {
    color: #dbeafe;
}

.ad-usage-example {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.ad-usage-label {
    width: fit-content;
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(219, 234, 254, 0.08);
    border: 1px solid rgba(219, 234, 254, 0.12);
    color: #bfdbfe;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ad-usage-tip pre {
    margin: 0;
    overflow-x: auto;
    padding: 12px;
    border-radius: 12px;
    background: rgba(7, 12, 22, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.12);
    color: #dbeafe;
    font-size: 0.86rem;
    line-height: 1.55;
    white-space: pre;
    word-break: normal;
}

.script-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.script-toolbar h2 {
    font-size: 1.06rem;
    letter-spacing: -0.02em;
}

.script-toolbar p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.script-box {
    display: grid;
    gap: 12px;
}

.code-block {
    width: 100%;
    min-height: 86px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(94, 234, 212, 0.16));
    color: #dbeafe;
    resize: none;
}

.copy-btn {
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #5eead4, #60a5fa);
    color: #08101d;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(94, 234, 212, 0.16));
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(7, 12, 22, 0.35);
}

thead th {
    position: sticky;
    top: 0;
    background: rgba(12, 20, 34, 0.98);
    color: #dbeafe;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 15px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    white-space: nowrap;
}

tbody td {
    padding: 15px 16px;
    color: var(--muted-2);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    vertical-align: middle;
}

tbody tr:hover {
    background: rgba(96, 165, 250, 0.06);
}

tbody tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.84rem;
    background: rgba(52, 211, 153, 0.12);
    color: #bbf7d0;
    border: 1px solid rgba(52, 211, 153, 0.18);
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 32px 20px;
    border-radius: 18px;
    border: 1px dashed rgba(148, 163, 184, 0.18);
    background: rgba(148, 163, 184, 0.04);
}

.clicks-list {
    display: grid;
    gap: 10px;
}

.click-item {
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(94, 234, 212, 0.16));
    display: grid;
    gap: 8px;
}

.click-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.click-label {
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-weight: 600;
}

.click-value {
    color: #fff;
    font-size: 0.92rem;
    line-height: 1.4;
    word-break: break-word;
}

.click-value.tiny {
    font-size: 0.8rem;
    color: var(--muted-2);
}

.tiny {
    font-size: 0.85rem;
    color: var(--muted);
}

/* Top navbar (mobile only) */
.topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    height: 56px;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    background: rgba(8, 15, 28, 0.95);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--panel-border);
}

.topbar-title {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--muted-2);
}

.topbar-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(148, 163, 184, 0.06);
    color: #dbeafe;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.18s ease;
}

.topbar-btn:hover {
    background: rgba(96, 165, 250, 0.12);
}

/* Profile modal */
.profile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(2, 6, 23, 0.5);
    backdrop-filter: blur(4px);
}

.profile-overlay.open {
    display: block;
}

.profile-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2001;
    width: min(360px, calc(100% - 32px));
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(16, 28, 49, 0.98), rgba(11, 19, 34, 0.99));
    border: 1px solid var(--panel-border);
    box-shadow: 0 32px 80px rgba(2, 6, 23, 0.5);
    overflow: hidden;
}

.profile-modal.open {
    display: block;
}

.profile-modal-head {
    padding: 28px 24px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.profile-avatar {
    font-size: 2.8rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.profile-modal-head h3 {
    margin: 0 0 4px;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.profile-modal-email {
    color: var(--muted);
    font-size: 0.88rem;
    margin: 0;
}

.profile-modal-body {
    padding: 16px 24px;
}

.profile-modal-item {
    padding: 10px 0;
}

.profile-modal-label {
    display: block;
    font-size: 0.74rem;
    color: var(--muted);
    letter-spacing: 0.02em;
    margin-bottom: 3px;
}

.profile-modal-value {
    color: #fff;
    font-size: 0.92rem;
    line-height: 1.4;
    word-break: break-word;
}

.profile-modal-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    display: grid;
    gap: 10px;
}

.btn-settings,
.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 16px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: background-color 0.18s ease;
}

.btn-settings {
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.22);
    color: #bfdbfe;
}

.btn-settings:hover {
    background: rgba(96, 165, 250, 0.16);
}

.btn-logout {
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.2);
    color: var(--danger);
}

.btn-logout:hover {
    background: rgba(251, 113, 133, 0.18);
}

.side-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(4px);
}

.side-overlay.open {
    display: block;
}

@media (max-width: 1200px) {
    .topbar {
        display: flex;
    }

    .dashboard-shell {
        grid-template-columns: 1fr;
    }

    [id] {
        scroll-margin-top: 72px;
    }

    .side {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1200;
        height: 100vh;
        width: 300px;
        border-right: 1px solid var(--panel-border);
        border-bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
    }

    .side.open {
        transform: translateX(0);
    }

    .side-footer {
        display: none;
    }

    .main {
        padding: 16px;
        padding-top: 72px;
        margin-left: 0;
    }

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

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

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

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
        width: min(720px, calc(100% - 24px));
        min-height: auto;
    }

    .auth-aside {
        border-right: 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    }

    .auth-panel {
        padding: 28px;
    }
}

@media (max-width: 760px) {
    body {
        padding: 0;
    }

    .main {
        padding: 16px;
        padding-top: 72px;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 18px;
        border-radius: var(--radius-lg);
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-text {
        font-size: 0.92rem;
    }

    .hero-meta {
        flex-direction: column;
        gap: 8px;
    }

    .meta-chip {
        font-size: 0.82rem;
        padding: 8px 10px;
    }

    .hero-side-card .value {
        font-size: 1.4rem;
    }

    .metrics-grid,
    .info-grid,
    .ad-blocks-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid-four {
        grid-template-columns: 1fr;
    }

    .metric-table-wrap {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .metric-table-wrap table,
    .metric-table-wrap tbody,
    .metric-table-wrap tr,
    .metric-table-wrap td {
        display: block;
        width: 100%;
    }

    .metric-table-wrap thead {
        display: none;
    }

    .metric-table-wrap table {
        background: transparent;
    }

    .metric-table-wrap tr {
        margin-bottom: 12px;
        padding: 12px;
        border: 1px solid rgba(148, 163, 184, 0.14);
        border-radius: 16px;
        background: linear-gradient(135deg, rgba(96, 165, 250, 0.14), rgba(94, 234, 212, 0.1));
    }

    .metric-table-wrap tr:last-child {
        margin-bottom: 0;
    }

    .metric-table-wrap td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 9px 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    }

    .metric-table-wrap td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 800;
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }

    .metric-table-wrap td:first-child {
        display: block;
        padding-top: 0;
        color: #f8fafc;
        font-weight: 800;
        word-break: break-word;
    }

    .metric-table-wrap td:first-child::before {
        display: block;
        margin-bottom: 4px;
    }

    .metric-table-wrap td:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .metric-table-wrap .badge {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .metric-card {
        border-radius: var(--radius-md);
        padding: 14px;
    }

    .metric-value {
        font-size: 1.4rem;
    }

    .panel {
        padding: 14px;
        border-radius: var(--radius-lg);
    }

    .panel-head,
    .script-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .ad-usage-tip {
        grid-template-columns: 1fr;
    }

    .panel-note {
        text-align: left;
    }

    .script-card {
        padding: 14px;
        border-radius: var(--radius-lg);
    }

    .ad-block-card,
    .ad-block-card-featured {
        padding: 14px;
        border-radius: var(--radius-lg);
    }

    .ad-block-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .surface {
        gap: 16px;
    }

    table {
        font-size: 0.82rem;
    }

    thead th,
    tbody td {
        padding: 10px 8px;
        font-size: 0.82rem;
    }

    tbody td {
        word-break: break-word;
    }

    .hero-kicker {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .copy-btn {
        width: 100%;
    }
}
