:root {
    --navy: #1a2b3c;
    --navy-dark: #111820;
    --orange: #c67a2e;
    --bg: #e8ebef;
    --white: #fff;
    --border: #c5ccd4;
    --muted: #5a6570;
    --danger: #b52b27;
    --row-alt: #f9f9f9;
    --warm-bg: #ffffff;
    --warm-border: #ececec;
    --warm-surface: #ffffff;
    --card-fill: #f9f9f9;
    --app-brand-height: 72px;
    --font-ui: 'Avenir Next', 'Avenir', 'Segoe UI', system-ui, sans-serif;
    --font-heading: var(--font-ui);
    --font-form-label: var(--font-ui);
    --font-form-input: var(--font-ui);
    --form-label-color: var(--navy-dark);
    --form-input-color: #222;
    --form-input-size: 0.875rem;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-ui);
    color: var(--navy-dark);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

.login-screen {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 420px);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(15, 57, 82, 0.08);
}

.login-card__brand {
    margin-bottom: 20px;
}

.login-card__brand img {
    max-width: 100%;
    height: auto;
    display: block;
}

.login-submit {
    width: 100%;
    margin-top: 4px;
}

.login-card h1,
.topbar h1,
.card h2,
.card h3 {
    margin: 0 0 12px;
    color: var(--navy);
}

.btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.btn.is-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: cw-btn-spin 0.7s linear infinite;
    flex-shrink: 0;
}

.btn-secondary .btn-spinner {
    border-color: rgba(26, 58, 92, 0.25);
    border-top-color: currentColor;
}

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

[hidden] {
    display: none !important;
}

.login-card p,
.muted {
    color: var(--muted);
    line-height: 1.5;
}

.admin-alert {
    padding: 12px 14px;
    border-radius: 8px;
    line-height: 1.5;
}

.admin-alert--warning {
    background: #fff4e5;
    border: 1px solid #f0c36d;
    color: #7a4d00;
}

.chatbot-enable-field {
    font-size: 1.05rem;
}

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: var(--font-form-label);
    font-size: 1rem;
    font-weight: 700;
    color: var(--form-label-color);
    margin-bottom: 16px;
}

input,
textarea,
select {
    font-family: var(--font-form-input);
    font-size: var(--form-input-size);
    font-weight: 400;
    color: var(--form-input-color);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
}

input::placeholder,
textarea::placeholder {
    color: #7a8694;
    font-weight: 400;
}

.password-field {
    position: relative;
    display: block;
}

.password-field input {
    width: 100%;
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
}

.password-toggle:hover {
    color: var(--navy);
    background: #eef3f7;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.password-toggle[aria-pressed="true"] .icon-eye { display: none; }
.password-toggle[aria-pressed="true"] .icon-eye-off { display: block !important; }
.password-toggle[aria-pressed="false"] .icon-eye-off { display: none; }

.secret-saved-hint {
    margin-top: -8px;
    font-size: 0.92rem;
}

.password-field.is-saved input {
    border-color: #1f6b3f;
    background: #f7fcf9;
}

textarea { resize: vertical; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    background: var(--orange);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-sizing: border-box;
    line-height: 1.25;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease;
}

a.btn {
    text-decoration: none;
}

a.btn:hover {
    color: #fff;
}

.btn:not(:disabled):hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(26, 58, 92, 0.16);
}

.btn:not(:disabled):active {
    transform: translateY(0);
    filter: brightness(0.96);
    box-shadow: none;
}

.btn--saved {
    background: #1f6b3f !important;
    box-shadow: 0 4px 14px rgba(31, 107, 63, 0.22);
}

.btn--error {
    background: #c0392b !important;
}

.btn-save-check {
    font-weight: 800;
    line-height: 1;
}

.btn-secondary {
    background: var(--navy);
}

.btn-danger {
    background: #b42318;
    color: #fff;
}

.btn-small {
    padding: 8px 20px;
    font-size: inherit;
}

.admin-url-link {
    color: var(--navy);
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-word;
}

.admin-url-link:hover {
    color: var(--orange);
}

.error,
.status {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
}

.error {
    background: #fdecea;
    color: var(--danger);
}

.status {
    background: #eaf5ee;
    color: #1f6b3f;
}

.app {
    min-height: 100vh;
    background: #fff;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--navy);
    border-right: none;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 30;
}

.app-sidebar__brand {
    min-height: var(--app-brand-height);
    padding: 16px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.app-sidebar__brand img {
    max-width: 100%;
    height: auto;
    display: block;
}

.app-sidebar__user {
    display: none;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    flex-shrink: 0;
}

.app-sidebar__user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.app-sidebar__user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 700;
}

.app-sidebar__user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-sidebar__user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-sidebar__user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-sidebar__user-email {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-sidebar__user-actions {
    display: grid;
    gap: 2px;
}

.app-sidebar__user-actions button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font: inherit;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
}

.app-sidebar__user-actions button:hover {
    background: rgba(255, 255, 255, 0.08);
}

.app-sidebar__user-logout {
    color: #f5a8a0 !important;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0 !important;
    padding-top: 12px !important;
}

.app-sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 8px;
    background: var(--navy);
}

.app-sidebar__footer {
    padding: 14px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--navy);
}

.app-sidebar__footer-link {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
}

.app-sidebar__footer-link:hover {
    color: #fff;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: none;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 2px;
}

.sidebar-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: var(--orange);
    color: var(--orange);
    opacity: 1;
}

.sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-nav-item.is-active {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-weight: 600;
}

.sidebar-nav-item.is-active svg {
    opacity: 1;
    color: var(--orange);
    fill: var(--orange);
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: var(--app-brand-height);
    padding: 0 24px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}

.app-header__left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex-shrink: 0;
}

.app-header__titles {
    min-width: 0;
}

.app-header__right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.app-header__logo {
    display: none;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}

.app-header__logo img {
    display: block;
    height: 34px;
    width: auto;
    max-width: min(160px, 52vw);
}

.app-menu-btn {
    display: none;
    border: 1px solid var(--border);
    background: var(--white);
    border-radius: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    cursor: pointer;
    color: var(--navy);
}

.app-menu-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.app-breadcrumb {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--orange);
}

.app-page-title {
    margin: 2px 0 0;
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 400;
    color: var(--navy);
    line-height: 1.15;
}

.app-page-subtitle {
    flex: 1;
    margin: 0;
    padding: 0 16px;
    font-size: 0.9rem;
    line-height: 1.45;
    min-width: 0;
}

.app-user-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--navy);
}

.app-user-menu {
    position: relative;
}

.app-user-menu__trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 10px 5px 6px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    max-width: min(320px, 70vw);
}

.app-user-menu__trigger:hover,
.app-user-menu.is-open .app-user-menu__trigger {
    border-color: var(--navy);
    box-shadow: 0 4px 14px rgba(15, 57, 82, 0.08);
}

.app-user-menu__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--navy);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 700;
}

.app-user-menu__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-user-menu__info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    text-align: left;
}

.app-user-menu__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--navy);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.app-user-menu__email {
    font-size: 0.78rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.app-user-menu__chevron {
    width: 18px;
    height: 18px;
    fill: var(--muted);
    flex-shrink: 0;
}

.app-user-menu__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 57, 82, 0.12);
    padding: 6px;
    z-index: 50;
}

.app-user-menu__dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font: inherit;
    color: var(--navy);
    cursor: pointer;
}

.app-user-menu__dropdown button:hover {
    background: #f3f7fa;
}

.app-user-menu__logout {
    color: #c0392b !important;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    border-radius: 0 0 8px 8px !important;
}

.profile-modal__body {
    padding: 0 24px 8px;
}

.profile-panel {
    display: grid;
    gap: 14px;
}

.profile-avatar-editor {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

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

.profile-avatar-initials {
    font-size: 1.5rem;
    font-weight: 700;
}

.notifications-fieldset {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0;
}

.notifications-fieldset legend {
    padding: 0 6px;
    font-weight: 600;
    color: var(--navy);
}

.notification-row {
    display: grid;
    grid-template-columns: 1fr minmax(200px, 280px);
    gap: 12px 16px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.notification-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.notification-row .checkbox {
    margin: 0;
}

@media (max-width: 720px) {
    .notification-row {
        grid-template-columns: 1fr;
    }
}

.app-logout-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
}

.app-content {
    flex: 1;
    padding: 0 24px 32px 0;
    overflow-x: hidden;
    background: var(--warm-bg);
}

.admin-panels {
    max-width: 1200px;
}

.section-header {
    text-align: center;
    margin-bottom: 24px;
}

.section-header--left {
    text-align: left;
    margin-bottom: 20px;
}

.display-heading {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    color: var(--navy);
    margin: 0 0 8px;
    line-height: 1.15;
}

.section-subtitle {
    color: var(--muted);
    margin: 0;
    line-height: 1.5;
}

.admin-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.admin-nav-card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 4px;
    min-height: 108px;
    padding: 18px 20px;
    border: none;
    border-radius: 18px;
    color: #fff;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15, 57, 82, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-nav-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.2) 0%, transparent 42%);
    pointer-events: none;
}

.admin-nav-card:hover,
.admin-nav-card.is-active {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(15, 57, 82, 0.18);
}

.admin-nav-card.is-active {
    outline: 3px solid rgba(230, 145, 64, 0.55);
    outline-offset: 2px;
}

.admin-nav-card__tag {
    position: relative;
    z-index: 1;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.9;
}

.admin-nav-card__title {
    position: relative;
    z-index: 1;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.2;
}

.admin-nav-card--dashboard { background: linear-gradient(135deg, #0f3952 0%, #1a5f7a 100%); }
.admin-nav-card--site { background: linear-gradient(135deg, #1a5f7a 0%, #3b77ac 100%); }
.admin-nav-card--cookie { background: linear-gradient(135deg, #5c4d7a 0%, #3d3560 100%); }
.admin-nav-card--accessibility { background: linear-gradient(135deg, #2f6b5c 0%, #1a4d42 100%); }
.admin-nav-card--chatbot-settings { background: linear-gradient(135deg, #1a5f7a 0%, #0f3952 100%); }
.admin-nav-card--smtp { background: linear-gradient(135deg, #2f5f9c 0%, #4a8fb8 100%); }
.admin-nav-card--recaptcha { background: linear-gradient(135deg, #0f3952 0%, #2f5f9c 100%); }
.admin-nav-card--security { background: linear-gradient(135deg, #2a2a2a 0%, #0a1f2c 100%); }
.admin-nav-card--cache { background: linear-gradient(135deg, #4a6fa5 0%, #2f5f9c 100%); }
.admin-nav-card--custom-code { background: linear-gradient(135deg, #1a5f7a 0%, #0f3952 100%); }
.admin-nav-card--seo { background: linear-gradient(135deg, #e69140 0%, #c97428 100%); }
.admin-nav-card--reviews { background: linear-gradient(135deg, #3b77ac 0%, #1a5f7a 100%); }
.admin-nav-card--leads { background: linear-gradient(135deg, #0a1f2c 0%, #0f3952 100%); }
.admin-nav-card--chat { background: linear-gradient(135deg, #1a5f7a 0%, #0f3952 100%); }

.admin-panels {
    position: relative;
}

.admin-panel {
    display: none;
}

.admin-panel.is-visible {
    display: block;
}

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

.admin-subnav-card {
    min-height: 72px;
    padding: 14px 16px;
    border: none;
    border-radius: 14px;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(15, 57, 82, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-subnav-card:hover,
.admin-subnav-card.is-active {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(15, 57, 82, 0.16);
}

.admin-subnav-card.is-active {
    outline: 3px solid rgba(230, 145, 64, 0.5);
    outline-offset: 2px;
}

.admin-subnav-card--global { background: linear-gradient(135deg, #0f3952 0%, #1a5f7a 100%); }
.admin-subnav-card--schema { background: linear-gradient(135deg, #3a3a3a 0%, #1f1f1f 100%); }
.admin-subnav-card--sitemap { background: linear-gradient(135deg, #2f5f9c 0%, #4a8fb8 100%); }
.admin-subnav-card--pages { background: linear-gradient(135deg, #e69140 0%, #c97428 100%); }
.admin-subnav-card--redirects { background: linear-gradient(135deg, #4a4a4a 0%, #2d2d2d 100%); }
.admin-subnav-card--internal-links { background: linear-gradient(135deg, #1f6b4f 0%, #2d8a66 100%); }
.admin-subnav-card--files { background: linear-gradient(135deg, #0a1f2c 0%, #0f3952 100%); }

.seo-panel {
    display: none;
}

.seo-panel.is-visible {
    display: block;
}

.redirect-add-form {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.redirects-import-export {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.redirects-import-export h4 {
    margin: 0 0 6px;
}

.redirects-import-export__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.redirects-import-filename {
    margin-top: 8px;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.redirects-table-wrap code {
    font-size: 0.85rem;
    word-break: break-all;
}

.redirects-table-wrap .btn-small {
    white-space: nowrap;
}

.internal-links-toolbar,
.linking-strategy-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.linking-strategy-search,
.linking-strategy-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
    flex: 1 1 180px;
}

.linking-strategy-search input,
.linking-strategy-filter select {
    width: 100%;
}

.linking-strategy-tree details,
.internal-links-tree details {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
    background: var(--surface);
}

.linking-badge--type {
    background: #e8eef8;
    color: #1e3a5f;
}

.linking-strategy-page__section--excluded {
    opacity: 0.85;
}

.linking-strategy-page__path {
    font-family: var(--mono, ui-monospace, monospace);
    font-size: 0.85rem;
}

.linking-strategy-page__path a {
    color: var(--accent);
    text-decoration: none;
}

.linking-strategy-page__section {
    margin-top: 14px;
}

.linking-strategy-page__section h4 {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.linking-strategy-cached-at {
    margin: -8px 0 12px;
}

.linking-strategy-table-head {
    display: none;
}

.linking-nav-section {
    margin-bottom: 24px;
}

.linking-nav-section__title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.linking-nav-section__rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.linking-nav-row {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.linking-nav-row--depth-1 {
    margin-left: 1.25rem;
}

.linking-nav-row--depth-2 {
    margin-left: 2.5rem;
}

.linking-nav-row__children {
    padding: 0 0 8px;
}

.linking-nav-row summary {
    cursor: pointer;
    padding: 12px 14px;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    justify-content: space-between;
}

.linking-nav-row__label {
    font-weight: 600;
    min-width: 140px;
}

.linking-nav-metrics {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-left: auto;
    font-size: 0.88rem;
}

.linking-nav-metrics--missing {
    color: var(--muted);
    font-style: italic;
}

.linking-nav-metric--good {
    color: #1f6b4f;
}

.linking-nav-metric--average {
    color: #9a4a12;
}

.linking-nav-metric--needs-improvement {
    color: #b42318;
}

.linking-nav-row summary::-webkit-details-marker {
    display: none;
}

.linking-ignore-panel {
    margin-bottom: 16px;
    padding: 12px 14px;
}

.linking-ignore-panel summary {
    cursor: pointer;
    margin-bottom: 8px;
}

.linking-ignore-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.linking-ignore-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

.linking-ignore-item code {
    font-size: 0.9rem;
}

.linking-ignore-add {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.linking-ignore-add input {
    flex: 1 1 220px;
    min-width: 180px;
}

.card--nested {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
}

.linking-strategy-result-count {
    margin: 0 0 12px;
}

.linking-strategy-tree summary::-webkit-details-marker,
.internal-links-tree summary::-webkit-details-marker {
    display: none;
}

.linking-strategy-page__meta,
.internal-links-tree .internal-links-page-meta {
    padding: 0 14px 14px;
}

.linking-strategy-tree table,
.internal-links-tree table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.linking-strategy-tree th,
.linking-strategy-tree td,
.internal-links-tree th,
.internal-links-tree td {
    text-align: left;
    padding: 8px 10px;
    border-top: 1px solid var(--border);
    vertical-align: top;
}

.linking-badge--ok,
.internal-links-badge--ok {
    background: #1f6b4f;
}

.linking-badge--warn,
.internal-links-badge--warn {
    background: #b45309;
}

.linking-gaps-list__items {
    margin: 12px 0 0;
    padding-left: 1.2rem;
}

.linking-gaps-list__items li {
    margin-bottom: 6px;
}

#dashboard-linking-card {
    margin-bottom: 20px;
}

#custom-code-form textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.45;
}

.featured-image-field .field-label {
    display: block;
    font-family: var(--font-form-label);
    font-size: 1rem;
    font-weight: 700;
    color: var(--form-label-color);
    margin-bottom: 6px;
}

.featured-image-preview {
    margin: 12px 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    max-width: 360px;
    background: #f8fafc;
}

.featured-image-preview img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
}

.featured-image-preview--avatar {
    max-width: 120px;
    border-radius: 50%;
    overflow: hidden;
}

.featured-image-preview--avatar img {
    max-height: 120px;
    aspect-ratio: 1;
    object-fit: cover;
}

.featured-image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.feature-toggle-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 16px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 14px;
}

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

@media (max-width: 520px) {
    .feature-toggle-grid {
        grid-template-columns: 1fr;
    }
}

.admin-section {
    margin-bottom: 0;
}

.section-title {
    margin: 0 0 20px;
    color: var(--navy);
    font-size: 1.5rem;
}

.topbar {
    display: none;
}

.card h2,
.card h3 {
    margin: 0 0 12px;
    color: var(--navy);
}

.card {
    background: var(--warm-surface);
    border: 1px solid var(--warm-border);
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 16px 24px;
    margin-bottom: 0;
    border-top: none;
}

.card + .card {
    border-top: 1px solid var(--warm-border);
}

.admin-panel.is-visible > .card:first-child {
    border-top: 1px solid var(--warm-border);
}

.cache-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.cache-status-value {
    margin: 6px 0 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--navy);
    word-break: break-all;
}

.cache-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

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

.stats-grid--metrics {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
    background: var(--card-fill);
    border: 1px solid var(--warm-border);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 1px 2px rgba(26, 43, 60, 0.04);
}

.stat-card__label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--orange);
    margin-bottom: 8px;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    color: var(--navy);
    line-height: 1.1;
}

.stat-card__meta {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--muted);
}

.conversions-sections {
    display: grid;
    gap: 24px;
}

.conversions-group {
    border: 1px solid var(--warm-border);
    border-radius: 14px;
    padding: 18px 20px;
    background: var(--warm-surface);
}

.conversions-group__header {
    margin-bottom: 16px;
}

.conversions-group__header h4 {
    margin: 0 0 6px;
    color: var(--navy);
    font-size: 1.05rem;
}

.conversions-group__header p {
    margin: 0;
}

.conversions-group--paid-combined {
    border-color: var(--warm-border);
    background: var(--warm-surface);
}

.stats-grid--conversions {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.conversions-group--landing {
    border-color: rgba(15, 57, 82, 0.12);
}

.conversions-panel__filters,
.statistics-panel__filters {
    margin-left: auto;
}

.conversions-period-label,
.analytics-period-label {
    font-weight: 600;
    color: var(--navy);
}

.conversions-period-dates,
.analytics-period-dates {
    margin-left: 8px;
}

.traffic-report-sync-note {
    margin-top: 4px;
    font-size: 0.85rem;
}

.conversions-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.conversions-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
}

.conversions-filter select {
    min-width: 160px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--navy);
}

.analytics-chart-block {
    margin-top: 24px;
    padding-top: 8px;
}

.analytics-chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.analytics-chart-toolbar h4 {
    margin: 0;
}

.analytics-chart-toolbar .analytics-filter {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.analytics-chart-toolbar .analytics-filter .muted {
    white-space: nowrap;
    margin: 0;
}

.traffic-block-toolbar {
    padding-top: 16px;
}

.traffic-block-toolbar .btn {
    margin: 0;
}

#traffic-report-card .analytics-block-header__copy h3 {
    margin-top: 10px;
}

.analytics-chart-canvas {
    height: 320px;
    max-height: 320px;
    position: relative;
    overflow: hidden;
}

.analytics-chart-block h4 {
    margin: 0 0 12px;
    color: var(--navy);
    font-size: 1rem;
}

.analytics-block-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.analytics-block-header__copy h3 {
    margin: 0 0 6px;
}

.analytics-block-header__copy p {
    margin: 0;
    max-width: 720px;
}

.analytics-block-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.analytics-block-filters > .analytics-filter:not(.analytics-filter--date) {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.analytics-block-filters > .analytics-filter:not(.analytics-filter--date) .muted {
    white-space: nowrap;
    margin: 0;
}

.analytics-block-filters .btn-small {
    align-self: center;
}

.analytics-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.analytics-toolbar__copy h3 {
    margin: 0 0 6px;
}

.analytics-toolbar__copy p {
    margin: 0;
    max-width: 720px;
}

.analytics-toolbar__filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.analytics-toolbar__filters > .analytics-filter:not(.analytics-filter--date) {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.analytics-toolbar__filters > .analytics-filter:not(.analytics-filter--date) .muted {
    white-space: nowrap;
    margin: 0;
}

.analytics-toolbar__filters .btn-small {
    align-self: center;
}

.analytics-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
}

.analytics-filter select,
.analytics-filter input[type="date"] {
    min-width: 160px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    color: var(--navy);
    box-sizing: border-box;
}

.analytics-filter--date input[type="date"] {
    min-width: 150px;
}

.analytics-section__header {
    margin-bottom: 16px;
}

.analytics-section__header h3 {
    margin: 0 0 6px;
}

.analytics-section__header p {
    margin: 0;
}

.analytics-table-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.analytics-table-toolbar .leads-search {
    flex: 1 1 220px;
    min-width: 200px;
}

#traffic-stats-grid,
#conversions-stats-grid {
    margin-bottom: 16px;
}

.stat-card__change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.82rem;
    font-weight: 600;
}

.stat-card__change.is-up {
    color: #1f6b3f;
}

.stat-card__change.is-down {
    color: #b42318;
}

.stat-card__change.is-flat {
    color: var(--muted);
}

.stat-card__prev {
    display: block;
    margin-top: 4px;
    font-size: 0.78rem;
    color: var(--muted);
}

.admin-panel > .stats-grid,
.admin-panel > .quick-access-section {
    padding: 16px 24px 0;
}

.quick-access-section {
    margin-bottom: 28px;
}

.quick-access-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    color: var(--navy);
    font-weight: 400;
}

.quick-access-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--orange);
    flex-shrink: 0;
}

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

.quick-access-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    text-align: left;
    background: var(--card-fill);
    border: 1px solid var(--warm-border);
    border-radius: 14px;
    padding: 20px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    position: relative;
    box-shadow: 0 1px 2px rgba(26, 43, 60, 0.04);
    transition: border-color 0.15s, background 0.15s;
}

.quick-access-card:hover {
    border-color: #e0e0e0;
    background: #fff;
}

.quick-access-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f0f0f0;
    color: var(--orange);
    display: grid;
    place-items: center;
}

.quick-access-card__icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.quick-access-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
}

.quick-access-card__desc {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.45;
}

.quick-access-card__arrow {
    position: absolute;
    top: 16px;
    right: 16px;
    color: #c5d4e0;
    font-size: 1.1rem;
    line-height: 1;
}

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

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

.form-grid .full,
.form-grid h2,
.form-grid h3,
.form-grid .actions,
.form-grid .status,
.form-grid .notice {
    grid-column: 1 / -1;
}

.checkbox {
    flex-direction: row;
    align-items: center;
}

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

.notice {
    background: #f7fbff;
    border: 1px solid #d7e7f5;
    border-radius: 16px;
    padding: 16px 18px;
}

.notice ol {
    margin: 12px 0 0;
    padding-left: 20px;
    line-height: 1.6;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    background: #eef3f7;
    color: var(--navy);
}

.badge.ok {
    background: #eaf5ee;
    color: #1f6b3f;
}

.badge.warn {
    background: #fff4e8;
    color: #9a5b13;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--white);
}

.users-role-select {
    max-width: 11rem;
    font: inherit;
}

.users-actions {
    white-space: nowrap;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.users-create-mode {
    border: 0;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.users-create-mode legend {
    font-weight: 600;
    margin-bottom: 6px;
    width: 100%;
    padding: 0;
}

.users-permissions-fieldset {
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 12px 14px 14px;
    margin: 0;
}

.users-permissions-fieldset legend {
    padding: 0 4px;
    font-weight: 600;
}

.users-permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 8px 12px;
    margin-top: 8px;
}

.users-permissions-grid label.checkbox {
    margin: 0;
}

.users-access-summary {
    color: var(--muted, #667);
    font-size: 0.75rem;
    max-width: 14rem;
}

table,
table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

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

th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--white);
    background: var(--navy);
    font-weight: 600;
    white-space: nowrap;
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

table.data-table tbody tr:nth-child(even) {
    background: var(--card-fill);
}

table.data-table tbody tr:nth-child(odd) {
    background: var(--white);
}

table.data-table tbody tr:hover {
    background: #f3f3f3;
}

table.data-table code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

td.num,
th.num {
    text-align: right;
}

.table-sort {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.table-sort:hover {
    text-decoration: underline;
}

.table-sort.is-active {
    color: var(--white);
}

.table-sort__arrow {
    color: var(--orange);
    font-weight: 700;
    text-decoration: none;
}

td.table-index,
th.table-index {
    width: 2.5rem;
    text-align: center;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.debug-log {
    background: #0f1720;
    color: #d7e2ec;
    border-radius: 14px;
    padding: 16px;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    font-size: 0.85rem;
}

.code-editor {
    font-family: Consolas, 'Courier New', monospace;
    font-size: calc(0.85rem + 2px);
    color: var(--form-input-color);
    line-height: 1.5;
    min-height: 180px;
    resize: vertical;
}

.seo-page-toolbar {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 16px;
    margin: 16px 0 20px;
}

.seo-pages-table {
    max-height: 420px;
}

.seo-page-editor {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
}

.seo-page-editor__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    margin-bottom: 20px;
}

.seo-page-form {
    margin-top: 8px;
}

.seo-row {
    cursor: pointer;
}

.seo-row:hover,
.seo-row.is-selected {
    background: #f7fafc;
}

.seo-score-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.seo-score {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    border: 4px solid transparent;
}

.seo-score--good {
    background: #eaf5ee;
    color: #1f6b3f;
    border-color: #b8e0c8;
}

.seo-score--ok {
    background: #fff4e8;
    color: #9a5b13;
    border-color: #f5d9b8;
}

.seo-score--poor {
    background: #fdecea;
    color: #b42318;
    border-color: #f5c2c0;
}

.seo-grade-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
}

.seo-grade-pill--good { background: #eaf5ee; color: #1f6b3f; }
.seo-grade-pill--ok { background: #fff4e8; color: #9a5b13; }
.seo-grade-pill--poor { background: #fdecea; color: #b42318; }

.seo-scan-results {
    margin-top: 20px;
    padding: 18px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.seo-scan-results__header {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8edf2;
}

.seo-scan-check {
    display: flex;
    gap: 12px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid #e8edf2;
}

.seo-scan-check:last-child {
    border-bottom: none;
}

.seo-scan-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.seo-scan-dot--good { background: #2e9b5f; }
.seo-scan-dot--warn { background: #e69140; }
.seo-scan-dot--bad { background: #d64545; }

.type-pill {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #eef3f7;
    color: var(--navy);
}

.type-pill--post {
    background: #eef5ff;
    color: #2f5f9c;
}

code {
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.88em;
    background: #eef3f7;
    padding: 2px 6px;
    border-radius: 6px;
}

.card--full {
    margin-bottom: 0;
}

.show-archived-toggle {
    margin: 12px 0 16px;
    flex-direction: row;
    align-items: center;
}

.lead-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.lead-pill--hot {
    background: #fdecea;
    color: #b42318;
    border: 1px solid #f5c2c0;
}

.lead-pill--high {
    background: #eaf5ee;
    color: #1f6b3f;
    border: 1px solid #b8e0c8;
}

.lead-pill--medium {
    background: #fff4e8;
    color: #9a5b13;
    border: 1px solid #f5d9b8;
}

.lead-pill--low {
    background: #eef3f7;
    color: var(--muted);
    border: 1px solid var(--border);
}

.topic-pill {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eef3f7;
    color: var(--navy);
    font-size: 0.8rem;
    font-weight: 700;
}

.chat-row {
    cursor: pointer;
}

.chat-row:hover {
    background: #f7fafc;
}

.chat-row.is-archived {
    opacity: 0.65;
}

.chat-sessions-table .chat-col-select {
    width: 36px;
    text-align: center;
    vertical-align: middle;
}

.chat-sessions-table .chat-col-select input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.chat-sessions-table .chat-col-actions {
    width: 96px;
    white-space: nowrap;
}

.chat-sessions-table .chat-archive-btn {
    padding: 4px 10px;
    font-size: 0.82rem;
}

.chat-modal {
    border: none;
    border-radius: 20px;
    padding: 0;
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    box-shadow: 0 24px 60px rgba(15, 57, 82, 0.2);
}

.chat-modal::backdrop {
    background: rgba(10, 31, 44, 0.55);
}

.chat-modal__inner {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 32px);
    min-height: 0;
    overflow: hidden;
}

.chat-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex: 0 0 auto;
}

.chat-modal__header h3 {
    margin: 0 0 8px;
    color: var(--navy);
}

.chat-modal__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-modal__close {
    border: none;
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    flex-shrink: 0;
    align-self: flex-start;
    padding: 0 4px;
}

.chat-modal__contact {
    flex: 0 0 auto;
    margin: 0 24px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f7fbff;
    border: 1px solid #d7e7f5;
}

.chat-modal__contact strong {
    display: block;
    margin-bottom: 6px;
    color: var(--navy);
}

.contact-copy-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.contact-copy-row__link {
    color: var(--navy);
    text-decoration: none;
    word-break: break-word;
}

.contact-copy-row__link:hover {
    text-decoration: underline;
}

.contact-copy-row__text {
    color: var(--navy-dark);
}

.copy-to-clipboard {
    border: none;
    background: transparent;
    color: var(--muted);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.copy-to-clipboard:hover {
    color: var(--navy);
    background: #eef3f7;
}

.copy-to-clipboard.is-copied {
    color: #1f6b3f;
    background: #e8f5ec;
}

.copy-to-clipboard svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.chat-modal__transcript {
    padding: 20px 24px;
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    gap: 12px;
    background: #f8fafc;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 14px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.chat-bubble--user {
    justify-self: end;
    background: var(--navy);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-bubble--assistant {
    justify-self: start;
    background: #fff;
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.chat-bubble__header {
    margin-bottom: 6px;
}

.chat-bubble__body {
    white-space: pre-wrap;
}

.chat-bubble__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin-top: 8px;
    font-size: 0.78rem;
}

.chat-source-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e8f1f8;
    color: var(--navy);
    font-weight: 600;
}

.chat-source-pill--lead {
    background: #e8f6ef;
    color: #1f6b45;
}

.chat-bubble__lead-prompt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.chat-lead-prompt-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--navy);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
}

.chat-lead-prompt-note {
    font-size: 0.78rem;
    color: #64748b;
}

.chat-modal__routing-lead-btn {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.chat-source-detail {
    color: #64748b;
}

.chat-row {
    cursor: pointer;
}

.chat-row:hover td {
    background: #f5f9fc;
}

.chat-modal__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border);
    flex: 0 0 auto;
}

.chat-modal__footer-start,
.chat-modal__footer-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.chat-modal__footer-actions {
    margin-left: auto;
}

.chat-modal__status-field {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.chat-modal__status-label {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.chat-modal__footer label {
    margin-bottom: 0;
    flex: 0 1 auto;
}

.chat-modal__footer .btn {
    flex: 0 0 auto;
    width: auto;
    align-self: center;
}

.chat-modal__routing {
    flex: 0 0 auto;
    margin: 0 24px 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    max-height: 220px;
    overflow: auto;
}

.chat-modal__routing summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.chat-modal__routing pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.45;
    color: #334155;
}

.chat-modal__routing-turn {
    padding: 8px 0;
    border-top: 1px solid #e2e8f0;
}

.chat-modal__routing-turn:first-child {
    border-top: none;
    padding-top: 0;
}

.chat-modal__routing-turn strong {
    display: block;
    margin-bottom: 4px;
}

.chat-modal__routing-meta {
    font-size: 12px;
    color: #64748b;
}

.lead-row {
    cursor: pointer;
}

.lead-row:hover td {
    background: #f5f9fc;
}

.lead-row:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.lead-preview {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--accent);
}

.lead-modal__body {
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.6;
}

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

.traffic-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin: 18px 0 8px;
}

.traffic-stat {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px 12px;
}

.traffic-stat strong {
    display: block;
    font-size: 1.35rem;
    margin-top: 4px;
}

.traffic-stat .stat-card__change {
    margin-top: 8px;
}

.analytics-connect-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.seo-fieldset {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px 8px;
    margin: 0;
}

.seo-fieldset legend {
    font-weight: 600;
    padding: 0 8px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    background: #fafcfd;
}

.faq-item__actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.chatbot-company-save-row {
    align-items: center;
    gap: 12px;
}

.save-indicator {
    font-size: 13px;
    font-weight: 600;
}

.save-indicator--ok {
    color: #1f6b3f;
}

.save-indicator--error {
    color: #c0392b;
}

.chatbot-faq-toolbar {
    margin-bottom: 8px;
}

.chatbot-faq-table-wrap {
    margin-bottom: 16px;
}

.chatbot-faq-table {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.chatbot-faq-table-head {
    display: grid;
    grid-template-columns: 1fr 120px 88px;
    gap: 12px;
    padding: 10px 14px;
    background: #f3f6f8;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.chatbot-faq-col-actions {
    text-align: right;
}

.chatbot-faq-entry {
    border-bottom: 1px solid var(--border);
}

.chatbot-faq-entry:last-child {
    border-bottom: none;
}

.chatbot-faq-header {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: var(--ink);
}

.chatbot-faq-header:hover {
    background: #f8fafb;
}

.chatbot-faq-entry--expanded .chatbot-faq-header {
    background: #f8fafb;
}

.chatbot-faq-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.chatbot-faq-entry--expanded .chatbot-faq-toggle {
    transform: rotate(90deg);
}

.chatbot-faq-toggle:hover {
    background: #e8edf0;
}

.chatbot-faq-question {
    width: 100%;
    min-width: 0;
    margin: 0;
    font-weight: 500;
    line-height: 1.4;
    box-sizing: border-box;
}

.chatbot-faq-question--readonly {
    border-color: transparent;
    background: transparent;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatbot-faq-entry--expanded .chatbot-faq-question--readonly,
.chatbot-faq-question:not(.chatbot-faq-question--readonly) {
    white-space: normal;
}

.chatbot-faq-header-status {
    justify-self: end;
    min-width: 72px;
    text-align: right;
}

.chatbot-faq-remove-header {
    border: 1px solid #d7e0e8;
    background: #fff;
    color: #9b1c1c;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.chatbot-faq-remove-header:hover {
    background: #fff5f5;
    border-color: #efb4b4;
}

.chatbot-faq-save-indicator {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.chatbot-faq-save-indicator--saved {
    color: #1f6b3f;
}

.chatbot-faq-save-indicator--dirty {
    color: #b86e00;
}

.chatbot-faq-save-indicator--saving {
    color: var(--muted);
}

.chatbot-faq-save-indicator--error {
    color: #c0392b;
}

.chatbot-faq-body {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border);
    background: #fafcfd;
}

.chatbot-faq-answer-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin: 0;
}

.chatbot-faq-body .chatbot-faq-answer {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 120px;
}

.chatbot-faq-meta {
    margin: 8px 0 0;
    font-size: 12px;
}

.chatbot-faq-empty {
    margin: 0;
    padding: 12px 0;
}

.chatbot-knowledge-summary {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafb;
    margin-bottom: 8px;
}

.chatbot-knowledge-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 20px;
    margin: 0;
}

.chatbot-knowledge-summary-grid div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chatbot-knowledge-summary-grid dt {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.chatbot-knowledge-summary-grid dd {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
}

.chatbot-knowledge-summary-meta {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.chatbot-knowledge-summary-empty {
    margin: 0;
}

#chatbot-knowledge-status.status--multiline {
    white-space: pre-line;
}

.chatbot-intent-table-wrap {
    margin-bottom: 16px;
    max-height: 640px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

.chatbot-intent-empty {
    margin: 0;
    padding: 12px 14px;
}

.chatbot-intent-table-head,
.chatbot-intent-header {
    display: grid;
    grid-template-columns: 28px minmax(100px, 1.1fr) 110px 72px 80px 100px minmax(120px, 1.4fr) auto;
    align-items: center;
    gap: 10px;
}

.chatbot-intent-table-head {
    padding: 10px 14px;
    background: #f3f6f8;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    position: sticky;
    top: 0;
    z-index: 1;
}

.chatbot-intent-entry {
    border-bottom: 1px solid var(--border);
}

.chatbot-intent-entry:last-child {
    border-bottom: none;
}

.chatbot-intent-header {
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: var(--ink);
}

.chatbot-intent-header:hover,
.chatbot-intent-entry--expanded .chatbot-intent-header {
    background: #f8fafb;
}

.chatbot-intent-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.chatbot-intent-entry--expanded .chatbot-intent-toggle {
    transform: rotate(90deg);
}

.chatbot-intent-col-intent {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatbot-intent-welcome-badge {
    display: inline-block;
    margin-right: 0.35rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: #e8f4f8;
    color: #0f3952;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    vertical-align: middle;
}

.chatbot-intent-col-category,
.chatbot-intent-col-lead,
.chatbot-intent-col-routing,
.chatbot-intent-col-patterns {
    font-size: 13px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatbot-intent-col-preview {
    font-size: 13px;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatbot-intent-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.chatbot-intent-col-actions {
    text-align: right;
}

.chatbot-intent-remove-header {
    border: 1px solid #d7e0e8;
    background: #fff;
    color: #9b1c1c;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.chatbot-intent-remove-header:hover {
    background: #fff5f5;
    border-color: #efb4b4;
}

.chatbot-intent-save-indicator {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.chatbot-intent-save-indicator--saved { color: #1f6b3f; }
.chatbot-intent-save-indicator--dirty { color: #b86e00; }
.chatbot-intent-save-indicator--saving { color: var(--muted); }
.chatbot-intent-save-indicator--error { color: #c0392b; }

.chatbot-intent-body {
    padding: 0 14px 14px 52px;
    border-top: 1px solid var(--border);
    background: #fcfdfd;
}

.chatbot-intent-form {
    padding-top: 14px;
}

.knowledge-import-actions {
    flex-wrap: wrap;
}

.knowledge-json-details {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    background: #fafcfd;
}

.knowledge-json-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--ink);
}

.code-textarea {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    resize: vertical;
    min-height: 200px;
}

.knowledge-schema-example {
    max-height: 320px;
    margin: 8px 0 16px;
}

.knowledge-validation-results {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafb;
}

.knowledge-validation--ok {
    border-color: #2e7d32;
    background: #f1f8f2;
}

.knowledge-validation--error {
    border-color: #c62828;
    background: #fff5f5;
}

.knowledge-validation-list {
    margin: 8px 0 0;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.5;
}

.knowledge-validation-list li {
    margin-bottom: 4px;
}

.seo-preview-panel,
.seo-validation-results {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafb;
}

.code-preview {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    max-height: 420px;
    overflow: auto;
}

.validation-item {
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}

.validation-item--error { background: #fdecea; color: #a12622; }
.validation-item--warn { background: #fff8e6; color: #8a6100; }

.forms-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.form-pages-list {
    margin: 0;
    padding-left: 1.25rem;
    columns: 2;
    column-gap: 2rem;
}

.form-pages-list li {
    break-inside: avoid;
    margin-bottom: 0.35rem;
}

.form-pages-list a {
    color: var(--color-primary, #0f3952);
    text-decoration: none;
}

.form-pages-list a:hover {
    text-decoration: underline;
}

.form-pages-cell {
    max-width: 280px;
    font-size: 13px;
    line-height: 1.45;
}

.form-pages-cell .muted {
    display: block;
    margin-top: 0.25rem;
}

.export-mode-banner {
    background: #fff8e6;
    color: #8a6100;
    padding: 12px 20px;
    border-bottom: 1px solid #f0e2b6;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-update-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: center;
    justify-content: space-between;
    background: #e8f1f8;
    color: #0f3952;
    padding: 12px 20px;
    border-bottom: 1px solid #c5d9e8;
    position: sticky;
    top: 0;
    z-index: 99;
}

.app-update-banner[hidden] {
    display: none !important;
}

.app-update-banner-text {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.app-update-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.forms-storage-note {
    margin: 0 0 12px;
}

.about-meta {
    display: grid;
    gap: 10px 24px;
    margin: 16px 0 20px;
}

.about-meta > div {
    display: grid;
    grid-template-columns: minmax(7rem, auto) 1fr;
    gap: 8px 16px;
    align-items: baseline;
}

.about-meta dt {
    margin: 0;
    font-weight: 600;
    color: #0f3952;
}

.about-meta dd {
    margin: 0;
}

.about-meta code {
    background: #f3f6f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.about-divider {
    border: 0;
    border-top: 1px solid #e5e9ee;
    margin: 24px 0;
}

body.export-mode .app {
    padding-top: 0;
}

.export-mode-banner code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
}

@media (max-width: 900px) {
    .analytics-toolbar__filters {
        width: 100%;
    }
}

.empty {
    color: var(--muted);
    font-style: italic;
}

@media (max-width: 1100px) {
    .stats-grid,
    .stats-grid--dashboard,
    .quick-access-grid,
    .grid-2,
    .seo-page-toolbar,
    .admin-subnav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 900px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    }

    .app-sidebar.is-open {
        transform: translateX(0);
    }

    .app-sidebar:not(.is-open) {
        box-shadow: none;
    }

    .app-sidebar__brand {
        display: none;
    }

    .app-sidebar__user {
        display: block;
    }

    .app-header {
        background: var(--navy);
        border-bottom: none;
        padding: 10px 16px;
        flex-wrap: nowrap;
        gap: 12px;
    }

    .app-header__logo {
        display: flex;
        width: 25%;
        min-width: 0;
    }

    .app-header__logo img {
        width: 100%;
        height: auto;
        max-width: none;
    }

    .app-header__left {
        margin-left: auto;
        gap: 0;
    }

    .app-header__titles,
    .app-page-subtitle,
    .app-header__right {
        display: none;
    }

    .app-menu-btn {
        display: grid;
        place-items: center;
        border: none;
        background: transparent;
        color: #fff;
    }

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

    .app-content {
        padding: 0 16px 28px 0;
    }
}

@media (max-width: 640px) {
    .quick-access-grid,
    .admin-subnav {
        grid-template-columns: 1fr;
    }

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

.leads-panel {
    padding: 20px;
}

.leads-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.leads-toolbar__row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.leads-search {
    flex: 1 1 260px;
    margin-bottom: 0;
}

.leads-search input {
    width: 100%;
    max-width: 420px;
}

.lead-message-btn {
    border: none;
    background: transparent;
    color: var(--navy);
    font: inherit;
    text-align: left;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(15, 57, 82, 0.35);
}

.leads-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.leads-toolbar__actions .show-archived-toggle {
    margin-bottom: 0;
}

.activity-log-panel {
    padding: 20px;
}

.activity-log-toolbar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.activity-log-search input {
    width: 100%;
    max-width: 420px;
}

.activity-log-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.activity-chip {
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--navy);
    border-radius: 999px;
    padding: 6px 14px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.activity-chip.is-active {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

.activity-log-row {
    cursor: pointer;
}

.activity-log-row:hover {
    background: #f4f8fb;
}

.activity-detail-list {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px 16px;
    margin: 16px 0;
}

.activity-detail-list dt {
    font-weight: 700;
    color: var(--muted);
    margin: 0;
}

.activity-detail-list dd {
    margin: 0;
}

.activity-json-block {
    margin-top: 12px;
}

.activity-json-block pre {
    background: #f4f7fa;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    overflow: auto;
    font-size: 0.82rem;
    max-height: 200px;
}

.activity-log-modal__body {
    padding: 0 4px 8px;
    max-height: 60vh;
    overflow: auto;
}

.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;
}

.oauth-secret-status {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.85rem;
}

.oauth-secret-status.is-saved {
    color: #1b7f3b;
}

.oauth-secret-status.is-missing {
    color: var(--muted);
}

.google-connection-card {
    grid-column: 1 / -1;
    display: grid;
    gap: 1rem;
}

.google-connection-card .card-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.connection-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem 1.25rem;
    margin: 0;
}

.connection-meta__row {
    display: grid;
    gap: 0.15rem;
}

.connection-meta dt {
    margin: 0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.connection-meta dd {
    margin: 0;
    font-weight: 600;
}

.analytics-property-manual {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2, rgba(0, 0, 0, 0.02));
}

.analytics-property-manual label {
    margin: 0;
}

.analytics-property-manual .btn {
    justify-self: start;
}

/* Reusable website report builder and print document */
.reports-panel {
    --report-ink: var(--navy);
    --report-accent: var(--orange);
    --report-paper: #ffffff;
    --report-rule: #d8dde3;
    --report-soft: #f2f4f6;
    --report-copy: #26323d;
}

.reports-workspace {
    display: grid;
    grid-template-columns: minmax(290px, 350px) minmax(640px, 1fr);
    gap: 24px;
    align-items: start;
}

.reports-builder {
    position: sticky;
    top: calc(var(--app-brand-height) + 20px);
    max-height: calc(100vh - var(--app-brand-height) - 40px);
    overflow-y: auto;
    padding: 24px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.reports-builder::-webkit-scrollbar {
    width: 8px;
}

.reports-builder::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 8px;
}

.reports-builder__header {
    padding-bottom: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.reports-builder__header h2 {
    margin: 0 0 8px;
    color: var(--navy);
    font-size: 1.28rem;
    letter-spacing: -0.02em;
}

.reports-builder__header p {
    max-width: 42ch;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.reports-builder__fields {
    display: grid;
    gap: 18px;
}

.reports-builder__fields label {
    margin: 0;
}

.reports-builder__fields textarea {
    min-height: 104px;
    resize: vertical;
    line-height: 1.5;
}

.reports-builder__date-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.reports-builder__actions {
    position: sticky;
    bottom: -24px;
    display: grid;
    gap: 12px;
    margin: 0 -24px -24px;
    padding: 18px 24px 24px;
    background: var(--white);
    border-top: 1px solid var(--border);
}

.reports-builder__actions .btn {
    width: 100%;
    justify-content: center;
}

.reports-builder__actions .status {
    margin: 0;
    line-height: 1.45;
}

.reports-preview-shell {
    min-width: 0;
    padding: 18px;
    background: #dfe3e8;
    border-radius: 12px;
}

.reports-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 16px;
    padding: 0 2px;
}

.reports-preview-toolbar > div {
    display: grid;
    gap: 2px;
}

.reports-preview-toolbar strong {
    color: var(--navy);
    font-size: 0.92rem;
}

.reports-preview-toolbar span {
    color: var(--muted);
    font-size: 0.8rem;
}

.reports-preview-toolbar .btn {
    flex-shrink: 0;
}

.reports-preview-toolbar .btn svg {
    width: 18px;
    height: 18px;
    margin-right: 7px;
    fill: currentColor;
}

.reports-preview-empty {
    min-height: 620px;
    display: grid;
    place-content: center;
    justify-items: center;
    padding: 48px;
    text-align: center;
    background: #f8f9fa;
    color: var(--muted);
}

.reports-preview-empty svg {
    width: 58px;
    height: 58px;
    margin-bottom: 18px;
    fill: #aeb7c0;
}

.reports-preview-empty h2 {
    margin: 0 0 8px;
    color: var(--navy);
    font-size: 1.25rem;
}

.reports-preview-empty p {
    max-width: 48ch;
    margin: 0;
    line-height: 1.6;
}

.website-report {
    width: min(100%, 880px);
    margin: 0 auto;
    background: var(--report-paper);
    color: var(--report-copy);
    box-shadow: 0 14px 38px rgba(17, 24, 32, 0.14);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
}

.website-report ::selection {
    background: color-mix(in srgb, var(--report-accent) 30%, white);
    color: var(--report-ink);
}

.website-report__cover {
    min-height: 330px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.55fr);
    grid-template-rows: auto 1fr auto;
    gap: 28px 46px;
    padding: 54px 58px 48px;
    background: var(--report-ink);
    color: #fff;
}

.website-report__brand {
    grid-column: 1 / -1;
    min-height: 36px;
    display: flex;
    align-items: center;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.website-report__brand img {
    display: block;
    max-width: 210px;
    max-height: 58px;
    object-fit: contain;
    object-position: left center;
    padding: 8px 10px;
    background: #fff;
}

.website-report__cover-copy {
    align-self: end;
}

.website-report__cover-copy h1 {
    max-width: 13ch;
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 400;
    letter-spacing: -0.035em;
    line-height: 1.02;
    text-wrap: balance;
}

.website-report__cover-copy p {
    margin: 0;
    color: color-mix(in srgb, #fff 78%, var(--report-ink));
    font-size: 1rem;
}

.website-report__cover-meta {
    align-self: end;
    margin: 0;
}

.website-report__cover-meta div {
    display: grid;
    gap: 2px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.24);
}

.website-report__cover-meta dt {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.website-report__cover-meta dd {
    margin: 0;
    color: #fff;
    font-weight: 600;
}

.website-report__section {
    padding: 48px 58px;
    border-bottom: 1px solid var(--report-rule);
}

.website-report__section-heading {
    margin-bottom: 28px;
}

.website-report__section-heading--split {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
}

.website-report__section-heading h2 {
    margin: 0 0 8px;
    color: var(--report-ink);
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: -0.025em;
}

.website-report__section-heading p,
.website-report__section-heading a {
    max-width: 68ch;
    margin: 0;
    color: #596775;
}

.website-report__section-heading a {
    text-underline-offset: 3px;
}

.website-report__prose {
    max-width: 70ch;
    font-size: 1rem;
    line-height: 1.75;
}

.website-report__prose p {
    margin: 0 0 1em;
}

.website-report__metrics {
    display: grid;
    gap: 0;
    border-top: 2px solid var(--report-ink);
    border-bottom: 1px solid var(--report-rule);
}

.website-report__metrics--five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.website-report__metrics--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.website-report__metric {
    min-width: 0;
    padding: 20px 16px 18px;
    border-right: 1px solid var(--report-rule);
}

.website-report__metric:last-child {
    border-right: none;
}

.website-report__metric > span:first-child {
    display: block;
    min-height: 36px;
    color: #5e6b77;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.35;
    text-transform: uppercase;
}

.website-report__metric strong {
    display: block;
    margin-top: 8px;
    color: var(--report-ink);
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: -0.025em;
    line-height: 1;
}

.website-report__change {
    display: block;
    margin-top: 9px;
    color: #66727e;
    font-size: 0.68rem;
    line-height: 1.3;
}

.website-report__change.is-positive {
    color: #16704b;
}

.website-report__change.is-negative {
    color: #a34138;
}

.website-report__security-score {
    flex: 0 0 130px;
    padding-top: 2px;
    text-align: right;
}

.website-report__security-score strong {
    display: block;
    color: var(--report-ink);
    font-size: 2.4rem;
    font-weight: 500;
    line-height: 1;
}

.website-report__security-score span {
    display: block;
    margin-top: 6px;
    color: #63717d;
    font-size: 0.72rem;
    line-height: 1.35;
}

.website-report__security-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
    border-top: 1px solid var(--report-rule);
}

.website-report__control {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    padding: 16px 0;
    border-bottom: 1px solid var(--report-rule);
}

.website-report__control-mark {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    margin-top: 1px;
    border-radius: 50%;
    background: #e5f2eb;
    color: #16704b;
}

.website-report__control.needs-attention .website-report__control-mark {
    background: #f7e8e5;
    color: #a34138;
}

.website-report__control-mark svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.website-report__control strong {
    display: block;
    color: var(--report-ink);
    font-size: 0.84rem;
}

.website-report__control p {
    margin: 3px 0 0;
    color: #63717d;
    font-size: 0.72rem;
    line-height: 1.45;
}

.website-report__notes {
    margin-top: 30px;
    padding: 24px 26px;
    background: var(--report-soft);
}

.website-report__notes h3,
.website-report__table-block h3,
.website-report__chart figcaption {
    margin: 0 0 10px;
    color: var(--report-ink);
    font-size: 1rem;
    font-weight: 700;
}

.website-report__notes p {
    margin: 0 0 0.7em;
}

.website-report__notes p:last-child {
    margin-bottom: 0;
}

.website-report__coverage {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin-top: 24px;
    background: var(--report-rule);
    border: 1px solid var(--report-rule);
}

.website-report__coverage div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
}

.website-report__coverage span {
    color: #63717d;
    font-size: 0.74rem;
}

.website-report__coverage strong {
    color: var(--report-ink);
}

.website-report__chart {
    margin: 32px 0 0;
}

.website-report__chart svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.website-report__chart text {
    fill: #687581;
    font: 11px var(--font-ui);
}

.website-report__chart-axis {
    stroke: #9ca7b1;
    stroke-width: 1;
}

.website-report__chart-grid {
    stroke: #dfe3e7;
    stroke-width: 1;
}

.website-report__chart-area {
    fill: color-mix(in srgb, var(--report-accent) 18%, white);
}

.website-report__chart-line {
    fill: none;
    stroke: var(--report-accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.website-report__table-block {
    margin-top: 30px;
}

.website-report__table-block table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
}

.website-report__table-block th {
    padding: 10px 8px;
    border-bottom: 2px solid var(--report-ink);
    color: #5c6874;
    font-size: 0.64rem;
    letter-spacing: 0.05em;
    text-align: right;
    text-transform: uppercase;
}

.website-report__table-block th:first-child,
.website-report__table-block td:first-child {
    padding-left: 0;
    text-align: left;
}

.website-report__table-block td {
    padding: 11px 8px;
    border-bottom: 1px solid var(--report-rule);
    text-align: right;
    vertical-align: top;
}

.website-report__table-block td strong,
.website-report__table-block td span {
    display: block;
}

.website-report__table-block td strong {
    max-width: 44ch;
    overflow: hidden;
    color: var(--report-ink);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.website-report__table-block td span {
    max-width: 50ch;
    overflow: hidden;
    margin-top: 2px;
    color: #71808d;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.website-report__empty-data {
    padding: 18px 20px;
    background: var(--report-soft);
    color: #5e6b77;
}

.website-report__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 58px 28px;
    color: #71808d;
    font-size: 0.68rem;
}

@media (max-width: 1320px) {
    .reports-workspace {
        grid-template-columns: 1fr;
    }

    .reports-builder {
        position: static;
        max-height: none;
    }

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

    .reports-builder__fields > label:nth-last-child(-n + 3),
    .reports-builder__date-grid {
        grid-column: 1 / -1;
    }

    .reports-builder__actions {
        position: static;
        margin: 0;
        padding: 24px 0 0;
        border-top: 0;
    }
}

@media (max-width: 760px) {
    .reports-builder__fields,
    .reports-builder__date-grid {
        grid-template-columns: 1fr;
    }

    .reports-preview-shell {
        padding: 10px;
    }

    .reports-preview-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .website-report__cover {
        min-height: 0;
        grid-template-columns: 1fr;
        padding: 38px 30px;
    }

    .website-report__brand {
        grid-column: 1;
    }

    .website-report__cover-copy h1 {
        font-size: 2.35rem;
    }

    .website-report__section {
        padding: 36px 30px;
    }

    .website-report__metrics--five,
    .website-report__metrics--four,
    .website-report__metrics--three,
    .website-report__security-grid,
    .website-report__coverage {
        grid-template-columns: 1fr;
    }

    .website-report__metric {
        border-right: 0;
        border-bottom: 1px solid var(--report-rule);
    }

    .website-report__section-heading--split {
        display: block;
    }

    .website-report__security-score {
        margin-top: 18px;
        text-align: left;
    }

    .website-report__footer {
        padding: 24px 30px;
        align-items: flex-start;
        flex-direction: column;
    }

    .website-report__table-block {
        overflow-x: hidden;
    }

    .website-report__table-block th:nth-child(2),
    .website-report__table-block td:nth-child(2),
    .website-report__table-block th:nth-child(4),
    .website-report__table-block td:nth-child(4) {
        display: none;
    }

    .website-report__table-block th:last-child,
    .website-report__table-block td:last-child {
        padding-right: 0;
    }
}

@media print {
    @page {
        size: letter portrait;
        margin: 0.45in;
    }

    body.website-report-printing {
        background: #fff !important;
        color: #111 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    body.website-report-printing #login-screen,
    body.website-report-printing .export-mode-banner,
    body.website-report-printing .app-sidebar,
    body.website-report-printing .app-header,
    body.website-report-printing .reports-builder,
    body.website-report-printing .reports-preview-toolbar,
    body.website-report-printing .reports-preview-empty,
    body.website-report-printing dialog,
    body.website-report-printing .admin-panel:not(#reports) {
        display: none !important;
    }

    body.website-report-printing #app,
    body.website-report-printing .app-shell,
    body.website-report-printing .app-main,
    body.website-report-printing .app-content,
    body.website-report-printing .admin-panels,
    body.website-report-printing #reports,
    body.website-report-printing .reports-workspace,
    body.website-report-printing .reports-preview-shell,
    body.website-report-printing .website-report {
        display: block !important;
        width: auto !important;
        max-width: none !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        background: #fff !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    body.website-report-printing .website-report {
        font-size: 10.5pt;
    }

    body.website-report-printing .website-report__cover {
        min-height: 3.5in;
        padding: 0.55in 0.62in;
    }

    body.website-report-printing .website-report__section {
        padding: 0.45in 0.62in;
    }

    body.website-report-printing .website-report__page-break {
        break-before: page;
        page-break-before: always;
        padding-top: 0.6in !important;
    }

    body.website-report-printing .website-report__metric,
    body.website-report-printing .website-report__control,
    body.website-report-printing .website-report__notes,
    body.website-report-printing .website-report__chart,
    body.website-report-printing tr {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.website-report-printing .website-report__footer {
        display: none;
    }

    body.website-report-printing .website-report__table-block tbody tr:nth-child(n + 5) {
        display: none;
    }
}

.gbp-location-picker {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2, rgba(0, 0, 0, 0.02));
}

.gbp-location-picker .table-wrap {
    margin: 0;
}

.advanced-settings summary {
    cursor: pointer;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

