/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #1a1a1a;
    color: #f5f5f5;
    line-height: 1.6;
    font-family: 'Alegreya', serif;
    font-size: 16px; /* text-base */
}

/* Typography utilities (Tailwind-like) */
.text-2xl { font-size: 24px; }
.text-lg  { font-size: 18px; }
.text-base{ font-size: 16px; }
.text-sm  { font-size: 14px; }
.text-xs  { font-size: 12px; }

.font-belleza { font-family: 'Belleza', 'Alegreya', system-ui, sans-serif; }
.font-alegreya { font-family: 'Alegreya', serif; }

/* Headline defaults */
h1, h2 { font-family: 'Belleza', 'Alegreya', system-ui, sans-serif; font-size: 24px; }

/* Centered layout just for landing page */
body.home .app-container {
    max-width: 1200px;
    margin: 0 auto;
    /* Add top padding so content clears fixed header */
    padding: 88px 24px 0;
}

/* Smooth, full-page gradient (toggled by JS) */
body.gradient-bg {
    /* Custom properties are set by JS for user-picked colors */
    --bg1: #1a1a1a;
    --bg2: #333333;
    background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 100%);
    /* Keep gradient steady during scroll for smoother look */
    background-attachment: fixed;
}

.app-container {
    max-width: none;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header Styles */
.main-header {
    --main-header-height: 72px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 24px;
    height: var(--main-header-height);
    /* Translucent glassy panel so content shows through while scrolling */
    background: rgba(15, 15, 15, 0.20);
    border-bottom: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1200; /* keep header above any canvas/overlays */
    pointer-events: auto;
}

/* Tighter header-to-content spacing on project pages */
/* Space below headers is handled by content padding when fixed */
body:not(.home) {
    --main-header-height: 72px;
    --sub-header-height: 52px;
}
body:not(.home) .main-header { margin-bottom: 0; }

/* Mobile header rules live below header defaults for proper override */

.logo {
    position: absolute;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-shell {
    position: relative;
    display: flex;
    align-items: center;
}

#avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    object-fit: cover;
    border: 2px solid #f5f5f5;
    /* Hide until real Google image loads to avoid flash of old avatar */
    opacity: 0; transition: opacity .15s ease;
}
#avatar.ready { opacity: 1; }

.avatar-dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    background: #11151d;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(0,0,0,0.35);
    padding: 6px;
    min-width: 160px;
    display: none;
    z-index: 1400;
}

.avatar-dropdown.open { display: block; }

.avatar-dropdown-item {
    width: 100%;
    display: block;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: #f3f4f6;
    cursor: pointer;
    border-radius: 10px;
    font-weight: 600;
    text-align: left;
}

.avatar-dropdown-item:hover {
    background: rgba(103,232,249,0.12);
}

.avatar-dropdown-group {
    display: grid;
    gap: 4px;
}

.avatar-dropdown-item--has-submenu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.avatar-dropdown-caret {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid rgba(148,163,184,0.9);
    transition: transform 0.2s ease;
}

.avatar-dropdown-item--has-submenu[aria-expanded="true"] .avatar-dropdown-caret {
    transform: rotate(180deg);
}

.avatar-dropdown-submenu {
    display: none;
    padding-left: 8px;
    border-left: 1px solid rgba(255,255,255,0.08);
}

.avatar-dropdown-submenu.open {
    display: block;
}

.avatar-dropdown-subitem {
    font-size: 13px;
    padding: 8px 10px;
}

.avatar-dropdown-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.avatar-dropdown-title {
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(148,163,184,0.9);
    padding: 2px 10px 4px;
}

.avatar-dropdown-subtitle {
    font-size: 12px;
    font-weight: 600;
    color: #e5e7eb;
    padding: 0 10px 6px;
}

.avatar-donor-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 8px 6px;
}

.avatar-donor-empty {
    font-size: 11px;
    color: rgba(148,163,184,0.9);
    padding: 2px 2px 6px;
}

.avatar-donor-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 10px;
    background: rgba(15,23,42,0.6);
    border: 1px solid rgba(255,255,255,0.06);
}

.avatar-donor-row.is-placeholder {
    opacity: 0.7;
}

.avatar-donor-name {
    font-size: 12px;
    color: #e2e8f0;
    word-break: break-all;
}

.avatar-donor-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.avatar-donor-btn {
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.06);
    color: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.avatar-donor-btn:hover {
    background: rgba(255,255,255,0.12);
}

.avatar-donor-sent {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(148,163,184,0.9);
}

.notification-shell {
    position: relative;
    display: flex;
    align-items: center;
}

.notification-bell-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: none;
    background: transparent;
    color: #facc15;
    cursor: pointer;
    margin-left: 6px;
}

.notification-bell-btn:hover {
    color: #fde047;
    background: transparent;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #111;
}

.notification-panel {
    position: absolute;
    top: 110%;
    left: 0;
    right: auto;
    min-width: 260px;
    max-width: 320px;
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.45);
    padding: 10px;
    display: none;
    z-index: 1450;
}

.notification-panel.open { display: block; }

.notification-panel-header {
    font-size: 13px;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 8px;
}

.notification-list {
    max-height: 280px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(15,23,42,0.7);
    border: 1px solid rgba(255,255,255,0.06);
}

.notification-item-title {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 2px;
}

.notification-item-body {
    font-size: 12px;
    color: rgba(226,232,240,0.85);
}

.notification-link {
    color: #facc15;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.notification-link:hover {
    color: #fde047;
}

.notification-item-time {
    font-size: 11px;
    color: rgba(148,163,184,0.9);
    margin-top: 4px;
}

.notification-more-btn {
    width: 100%;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: #e2e8f0;
    cursor: pointer;
    font-weight: 600;
}

.notification-more-btn:hover {
    background: rgba(255,255,255,0.12);
}

.integrations-panel {
    position: fixed;
    top: 88px;
    left: 20px;
    width: 320px;
    background: #0f172a;
    border: 1px solid rgba(103,232,249,0.25);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.45);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 1450;
}

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

.income-panel {
    position: fixed;
    top: 88px;
    left: 20px;
    width: 760px;
    height: 250px;
    min-width: 320px;
    min-height: 220px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 140px);
    background: linear-gradient(180deg, #0c1424 0%, #0a101d 100%);
    border: 1px solid rgba(59,130,246,0.35);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(5,10,20,0.6), 0 0 0 1px rgba(255,255,255,0.04);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 1450;
    display: flex;
    flex-direction: column;
    resize: both;
    overflow: hidden;
}

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

.income-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(11,17,32,0.75);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.income-panel__title {
    font-size: 14px;
    font-weight: 700;
    color: #f8fafc;
}

.income-panel__close {
    border: none;
    background: transparent;
    color: #cbd5f5;
    cursor: pointer;
    font-size: 14px;
}

.income-panel__body {
    padding: 12px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.income-panel__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.income-panel__subtitle {
    font-size: 12px;
    font-weight: 600;
    color: rgba(226,232,240,0.9);
}

.income-panel__search {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(6,10,20,0.65);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(203,213,245,0.9);
}

.income-panel__search input {
    border: none;
    background: transparent;
    color: #e2e8f0;
    font-size: 12px;
    outline: none;
    width: 180px;
    max-width: 40vw;
}

.income-panel__search input::placeholder {
    color: rgba(148,163,184,0.7);
}

.income-panel__table-wrap {
    max-height: none;
    flex: 1;
    min-height: 0;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid rgba(59,130,246,0.2);
    background: rgba(7,12,22,0.55);
    overscroll-behavior: contain;
}

.income-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: #e2e8f0;
}

.income-table th,
.income-table td {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    vertical-align: middle;
}

.income-table thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(148,163,184,0.95);
    background: rgba(8,13,24,0.95);
    position: sticky;
    top: 0;
    z-index: 1;
}

.income-table th.is-sortable {
    cursor: pointer;
    user-select: none;
}

.income-table th.is-sorted-asc::after,
.income-table th.is-sorted-desc::after {
    content: '';
    display: inline-block;
    margin-left: 6px;
    border: 4px solid transparent;
}

.income-table th.is-sorted-asc::after {
    border-bottom-color: #38bdf8;
    transform: translateY(-2px);
}

.income-table th.is-sorted-desc::after {
    border-top-color: #38bdf8;
    transform: translateY(2px);
}

.income-table th.is-dragging {
    opacity: 0.6;
}

.income-table th.is-drop-target {
    outline: 1px dashed rgba(56,189,248,0.8);
    outline-offset: -4px;
}

.income-table tbody tr {
    background: rgba(12,18,32,0.55);
}

.income-table tbody tr:nth-child(even) {
    background: rgba(9,15,28,0.7);
}

.income-table tbody tr:hover {
    background: rgba(15,23,42,0.85);
}

.income-table .donor-empty td {
    text-align: center;
    color: rgba(148,163,184,0.9);
    padding: 18px 12px;
}

.donor-send-btn {
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(15,23,42,0.65);
    color: #f8fafc;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.donor-send-btn:hover {
    background: rgba(255,255,255,0.12);
}

.donor-sent {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    font-size: 10px;
    color: rgba(148,163,184,0.85);
}

.donor-sent input {
    accent-color: #38bdf8;
}

.donor-date {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.donor-action-cell {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 720px) {
    .income-panel {
        top: 64px;
        left: 10px;
        width: calc(100vw - 20px);
        height: 52vh;
        min-width: 0;
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 90px);
    }

    .income-panel__toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .income-panel__search {
        width: 100%;
        justify-content: flex-start;
    }

    .income-panel__search input {
        width: 100%;
        max-width: 100%;
    }

    .income-table th,
    .income-table td {
        padding: 6px 8px;
        font-size: 11px;
    }
}

.integrations-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(103,232,249,0.12), rgba(255,255,255,0.04));
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.integrations-panel__title {
    font-weight: 700;
    letter-spacing: 0.3px;
}

.integrations-panel__close {
    background: transparent;
    border: none;
    color: #e5e7eb;
    cursor: pointer;
    font-size: 14px;
    padding: 6px;
    border-radius: 8px;
}

.integrations-panel__close:hover {
    background: rgba(255,255,255,0.06);
}

.integrations-panel__body {
    padding: 16px;
    display: grid;
    gap: 12px;
}

.integrations-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.integrations-tab {
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(15,23,42,0.55);
    color: #e2e8f0;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.integrations-tab.is-active {
    background: linear-gradient(135deg, #38bdf8, #4f46e5);
    color: #0f172a;
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(56,189,248,0.25);
}

.integrations-tab:not(.is-active):hover {
    transform: translateY(-1px);
}

.integrations-section {
    display: none;
    gap: 12px;
}

.integrations-section.is-active {
    display: grid;
}

.integration-card {
    border: 1px solid rgba(103,232,249,0.25);
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    padding: 12px;
    display: grid;
    gap: 6px;
}

.integration-card--secret {
    background: rgba(76,29,149,0.32);
    border: 1px solid rgba(167,139,250,0.35);
}

.integration-card--secret h4 {
    color: #ede9fe;
}

.integration-card h4 {
    margin: 0;
    font-size: 15px;
}

.integration-card p {
    margin: 0;
    color: #cbd5e1;
    font-size: 13px;
}

.integration-card button {
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    color: #0b1020;
    background: linear-gradient(135deg, #67e8f9, #22c55e);
    box-shadow: 0 10px 24px rgba(103,232,249,0.28);
}

.integration-card button:hover {
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent !important;
    color: #e5e7eb !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    box-shadow: none !important;
}

.btn-danger {
    background: rgba(248,113,113,0.18);
    color: #fee2e2;
    border: 1px solid rgba(248,113,113,0.45);
    box-shadow: none;
}

.btn-danger:hover {
    background: rgba(248,113,113,0.28);
}

.integration-status {
    font-size: 13px;
    color: #cbd5e1;
    display: grid;
    gap: 6px;
}

.integration-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.integration-tag {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(103,232,249,0.16);
    color: #e0f2fe;
}

.integration-tag.danger {
    background: rgba(248,113,113,0.15);
    color: #fecdd3;
}

.fundraiser-secret-modal .modal-content {
    background: radial-gradient(circle at top, #4c1d95 0%, #2e1065 55%, #1e1b4b 100%);
    border: 1px solid rgba(168,85,247,0.35);
    box-shadow: 0 30px 70px rgba(88,28,135,0.45);
}

.fundraiser-secret-modal .fundraiser-credentials-group {
    border: 1px solid rgba(168,85,247,0.35);
    border-radius: 14px;
    padding: 14px;
    background: rgba(88,28,135,0.22);
    display: grid;
    gap: 10px;
}

.fundraiser-secret-modal.is-credentials-only .fundraiser-secret-create {
    display: none;
}

.fundraiser-help-link {
    font-size: 12px;
    color: #67e8f9;
    text-decoration: underline;
    align-self: flex-start;
}

.fundraiser-help-link:hover {
    color: #a5f3fc;
}

.fundraiser-secret-modal input[type="text"],
.fundraiser-secret-modal input[type="password"],
.fundraiser-secret-modal input[type="email"],
.fundraiser-secret-modal input[type="number"],
.fundraiser-secret-modal select {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(196,181,253,0.35);
    background: rgba(30,27,75,0.6);
    color: #f8fafc;
    padding: 9px 12px;
    font-size: 14px;
    height: 44px;
    box-sizing: border-box;
}

.fundraiser-secret-modal input[type="number"] {
    -moz-appearance: textfield;
}

.fundraiser-secret-modal input[type="number"]::-webkit-outer-spin-button,
.fundraiser-secret-modal input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fundraiser-secret-modal select {
    padding-right: 36px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: rgba(30,27,75,0.6);
    background-image: linear-gradient(45deg, transparent 50%, #ddd6fe 50%), linear-gradient(135deg, #ddd6fe 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 4px), calc(100% - 12px) calc(50% - 4px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.fundraiser-secret-modal input::placeholder {
    color: rgba(196,181,253,0.7);
}

.fundraiser-secret-modal input:focus,
.fundraiser-secret-modal select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(167,139,250,0.45);
    border-color: rgba(196,181,253,0.55);
}

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

.site-title {
    text-align: center;
}

.site-title h1 {
    font-size: 24px;
    margin-bottom: 5px;
    text-align: center;
}

.site-title p {
    font-size: 12px; /* text-xs */
    color: #aaa;
    font-family: 'Alegreya', serif;
    font-style: normal;
}

.settings-icon {
    position: static;
}

.settings-icon i {
    font-size: 20px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s;
}

.settings-icon i:hover {
    color: #f5f5f5;
}

/* Header action buttons (undo/redo + gear) */
.header-actions {
    position: absolute;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

@media (max-width: 1024px) {
    body:not(.home) .main-header {
        padding: 6px 16px;
    }
    body:not(.home) .site-title h1 {
        font-size: 20px;
    }
    body:not(.home) .site-title p {
        font-size: 11px;
    }
    body:not(.home) .header-actions {
        gap: 6px;
    }
    body:not(.home) .main-header .icon-btn {
        width: 30px;
        height: 30px;
    }
    body:not(.home) .breadcrumbs-left {
        max-width: 240px;
        overflow: hidden;
        white-space: nowrap;
    }
    body:not(.home) .breadcrumbs-left .crumb a,
    body:not(.home) .breadcrumbs-left .crumb span {
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }
    body:not(.home) .project-header.sub-header {
        padding: 6px 16px;
    }
}

/* Mobile header: stack into three rows (title, breadcrumbs, toolbar) */
@media (max-width: 720px) {
    body:not(.home) {
        --main-header-height: 160px;
        --sub-header-height: 52px;
    }
    body:not(.home) .main-header {
        height: auto;
        padding: 10px 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    body:not(.home) .site-title {
        order: 1;
        display: block;
        text-align: center;
        margin: 0;
    }
    body:not(.home) .site-title h1 {
        margin: 0;
        line-height: 1.1;
    }
    body:not(.home) .site-title p {
        margin: 0;
        line-height: 1.1;
    }
    body:not(.home) .logo {
        order: 2;
        position: static;
        width: 100%;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }
    body:not(.home) .avatar-shell {
        display: flex;
        align-items: center;
    }
    body:not(.home) .breadcrumbs-left {
        width: auto;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        row-gap: 4px;
        overflow: hidden;
        white-space: nowrap;
    }
    body:not(.home) .breadcrumbs-left .crumb a,
    body:not(.home) .breadcrumbs-left .crumb span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
        max-width: 200px;
    }
    body:not(.home) .header-actions {
        order: 3;
        position: static;
        right: auto;
        width: 100%;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px;
    }
    body:not(.home) .project-header.sub-header {
        margin: 0 !important;
        padding-left: 12px;
        padding-right: 12px;
    }
    body:not(.home) .project-header .title-rail {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    body:not(.home) .project-title {
        text-align: center;
    }
    body:not(.home) .content {
        padding-top: calc(var(--main-header-height, 72px) + var(--sub-header-height, 48px) + 8px) !important;
    }
}
@media (max-height: 520px) and (orientation: landscape) and (pointer: coarse) {
    body:not(.home) {
        --main-header-height: 64px;
        --sub-header-height: 44px;
    }
    body:not(.home) .main-header {
        height: auto;
        min-height: var(--main-header-height, 64px);
        padding: 6px 12px;
        gap: 8px;
        justify-content: space-between;
        flex-wrap: nowrap;
    }
    body:not(.home) .logo {
        position: static;
        left: auto;
        width: auto;
        gap: 8px;
    }
    body:not(.home) .header-actions {
        position: static;
        right: auto;
        max-width: 48vw;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        gap: 6px;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    body:not(.home) .header-actions::-webkit-scrollbar {
        height: 0;
    }
    body:not(.home) .main-header .icon-btn {
        width: 28px;
        height: 28px;
    }
    body:not(.home) .main-header .icon-btn.live-stream-btn {
        width: 46px;
    }
    body:not(.home) .live-tv-icon {
        width: 28px;
        height: 16px;
    }
    body:not(.home) .live-tv-text {
        font-size: 8px;
    }
    body:not(.home) .site-title {
        flex: 1 1 auto;
        min-width: 0;
    }
    body:not(.home) .site-title h1 {
        font-size: 18px;
        line-height: 1.05;
    }
    body:not(.home) .site-title p {
        display: none;
    }
    body:not(.home) #avatar {
        width: 32px;
        height: 32px;
    }
    body:not(.home) .breadcrumbs-left {
        max-width: 160px;
        font-size: 11px;
        gap: 6px;
        overflow: hidden;
        white-space: nowrap;
    }
    body:not(.home) .breadcrumbs-left .crumb a,
    body:not(.home) .breadcrumbs-left .crumb span {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: inline-block;
    }
    body:not(.home) .project-header.sub-header {
        padding: 6px 12px;
    }
    body:not(.home) .creation-canvas {
        margin: 0 12px 16px;
    }
    .zoom-hud {
        right: 8px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
        padding: 6px 8px;
        gap: 4px;
    }
    .zoom-hud button {
        padding: 6px 8px;
        font-size: 11px;
    }
    .zoom-hud .zoom-label {
        min-width: 48px;
        font-size: 12px;
    }
    .zoom-slider {
        width: 96px;
        height: 5px;
    }
    .zoom-slider::-webkit-slider-thumb,
    .zoom-slider::-moz-range-thumb {
        width: 14px;
        height: 14px;
    }
    .zoom-tip-toggle {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
    .zoom-tip {
        min-width: 180px;
        max-width: 220px;
        font-size: 11px;
    }
}
.icon-btn {
    background: rgba(255,255,255,0.06);
    color: #f5f5f5;
    border: 1px solid rgba(255,255,255,0.12);
    width: 32px; height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto; /* ensure clickable even if a sibling overlay exists */
}
.icon-btn:hover { background: rgba(255,255,255,0.12); }
.icon-btn.active { background: rgba(255,255,255,0.16); box-shadow: 0 0 0 1px rgba(255,255,255,0.18) inset; }

/* Live stream button (project toolbar, TV with LIVE label) */
.icon-btn.live-stream-btn {
    width: 52px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(120% 120% at 50% 45%, rgba(248,113,113,0.78), rgba(248,250,252,0.04));
    border-color: rgba(248,250,252,0.45);
    box-shadow: 0 6px 14px rgba(239,68,68,0.38);
}
.icon-btn.live-stream-btn:hover {
    background: radial-gradient(120% 120% at 50% 45%, rgba(248,113,113,0.92), rgba(248,250,252,0.12));
}
.live-tv-icon {
    position: relative;
    width: 34px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.9);
    background: radial-gradient(circle at top left, #1f2937, #020617);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(15,23,42,0.9);
}
.live-tv-icon::after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 3px;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
}
.live-tv-text {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

/* Artist Profile */
.artist-profile {
    text-align: center;
    margin-bottom: 40px;
}

.artist-name {
    font-size: 24px; /* text-2xl */
    margin-bottom: 10px;
}

.artist-quote {
    font-style: italic;
    color: #aaa;
    font-family: 'Alegreya', serif;
    font-size: 18px; /* text-lg */
}

/* Section Styles */
section {
    margin-bottom: 30px;
}

section h3 {
    font-size: 24px; /* text-2xl */
    font-family: 'Belleza', 'Alegreya', system-ui, sans-serif;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.section-description {
    color: #aaa;
    font-style: italic;
    font-family: 'Alegreya', serif;
    font-size: 14px; /* text-sm */
    margin-bottom: 15px;
}

/* Projects Container */
.projects-container {
    display: flex;
    flex-wrap: nowrap; /* horizontal lane */
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 8px; /* room for scrollbar */
}

/* Delete Project Button Styles */
.delete-project-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #666;
    cursor: pointer;
    transition: color 0.3s;
    font-size: 14px;
    opacity: 0;
}

.project-card:hover .delete-project-btn {
    opacity: 1;
}

.delete-project-btn:hover {
    color: #d32f2f;
}

.project-card {
    width: 220px;
    background-color: #222;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s, background-color 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto; /* keep cards fixed width in horizontal scroller */
    scroll-snap-align: start;
}

.project-card:hover {
    transform: translateY(-5px);
    background-color: #2a2a2a;
}

.project-folder-area {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #333;
}

.project-info {
    padding: 10px;
    text-align: center;
}
.project-info p { font-size: 12px; /* text-xs */; font-family: 'Alegreya', serif; }
.project-name-inline[contenteditable="true"]:focus {
    outline: 2px solid rgba(255,255,255,0.2);
    border-radius: 4px;
}

.folder-icon i {
    font-size: 50px;
    margin-bottom: 15px;
    color: #aaa;
}

.new-project .project-folder-area {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #333;
}

.new-project .project-info {
    padding: 10px;
    text-align: center;
}

.new-project .folder-icon i {
    color: #666;
}

.new-project:hover .folder-icon i {
    color: #aaa;
}

/* Add Item Button */
.add-item-btn {
    background-color: transparent;
    color: #aaa;
    border: 1px solid #333;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.add-item-btn:hover {
    background-color: #333;
    color: #f5f5f5;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overscroll-behavior: contain;
}

html.modal-open,
body.modal-open {
    overflow: hidden;
    height: 100%;
}

body.modal-open {
    touch-action: none;
}

.modal-content {
    background-color: #222;
    margin: 60px auto;
    padding: 30px;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: auto;
}

/* Modern translucent modal variant */
.modal-content.modern {
    background: rgba(20,20,20,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(8px) saturate(130%);
}

/* Keep media player dialog below fixed headers */
#mediaPlayerModal {
    top: calc(var(--main-header-height, 72px) + var(--sub-header-height, 60px));
    height: calc(100% - (var(--main-header-height, 72px) + var(--sub-header-height, 60px)));
}

#imgbbUploadModal {
    top: calc(var(--main-header-height, 72px) + var(--sub-header-height, 60px));
    height: calc(100% - (var(--main-header-height, 72px) + var(--sub-header-height, 60px)));
}

/* Multi Media Player modal */
.media-player-modal {
    max-width: 560px;
    padding: 24px 26px 22px;
    border-radius: 18px;
    background: radial-gradient(circle at top left, #1f2937 0%, #020617 55%);
    border: 1px solid rgba(148,163,184,0.45);
    box-shadow: 0 22px 60px rgba(15,23,42,0.8);
}
.media-player-title-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}
.media-player-accent {
    width: 4px;
    height: 36px;
    border-radius: 999px;
    background: linear-gradient(180deg, #22c55e, #38bdf8);
    box-shadow: 0 0 0 1px rgba(15,23,42,0.9);
}
.media-player-title {
    margin: 0;
    font-size: 20px;
    letter-spacing: 0.02em;
}
.media-player-subtitle {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #e5e7eb;
    text-align: left;
}
.media-player-section {
    margin-top: 14px;
    padding: 14px 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(148,163,184,0.85);
    background: radial-gradient(circle at top left, rgba(15,23,42,0.96), rgba(15,23,42,0.88));
    box-shadow: 0 0 0 1px rgba(15,23,42,0.9), 0 10px 28px rgba(15,23,42,0.85);
}
.media-player-body-intro {
    margin: 4px 0 14px;
    font-size: 13px;
    color: #cbd5e1;
    max-width: 440px;
}
#mediaPlayerForm .media-player-input,
#mediaPlayerForm .media-player-textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(148,163,184,0.5);
    background: radial-gradient(circle at top left, rgba(15,23,42,0.98), #020617);
    color: #e5e7eb;
    padding: 11px 13px;
    font-size: 14px;
    box-shadow: 0 0 0 1px rgba(15,23,42,0.9) inset;
}
#mediaPlayerForm .media-player-input::placeholder,
#mediaPlayerForm .media-player-textarea::placeholder {
    color: rgba(148,163,184,0.8);
}
#mediaPlayerForm .media-player-input:focus,
#mediaPlayerForm .media-player-textarea:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow:
        0 0 0 1px rgba(59,130,246,0.8),
        0 0 0 3px rgba(59,130,246,0.35);
}
#mediaPlayerForm .media-player-textarea {
    min-height: 120px;
    resize: vertical;
}
.media-player-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}
.media-player-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #020617;
    background: linear-gradient(135deg, #22c55e, #38bdf8);
    box-shadow: 0 14px 34px rgba(56,189,248,0.55);
}
.media-player-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(56,189,248,0.65);
}
.media-player-btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 10px 26px rgba(15,23,42,0.9);
}
.media-player-btn-primary i {
    color: inherit;
}
.media-player-btn-secondary {
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.6);
    background: transparent;
    color: #e5e7eb;
    cursor: pointer;
    font-size: 14px;
}
.media-player-btn-secondary:hover {
    background: rgba(15,23,42,0.9);
}

.imgbb-file-input {
    padding: 10px 12px;
    color: transparent;
    font-size: 0;
}
.imgbb-file-input::file-selector-button {
    border: 1px solid rgba(148,163,184,0.6);
    background: rgba(15,23,42,0.7);
    color: #e5e7eb;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    margin-right: 8px;
    font-size: 13px;
}
.imgbb-file-input::-webkit-file-upload-button {
    border: 1px solid rgba(148,163,184,0.6);
    background: rgba(15,23,42,0.7);
    color: #e5e7eb;
    padding: 6px 12px;
    border-radius: 10px;
    cursor: pointer;
    margin-right: 8px;
    font-size: 13px;
}

.drawer-integration__config.is-nudge {
    position: relative;
}

.drawer-integration__config.is-nudge::after {
    content: '';
    position: absolute;
    right: -16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid #67e8f9;
    animation: imgbb-nudge 1.2s ease-in-out infinite;
}

@keyframes imgbb-nudge {
    0% { transform: translate(0, -50%); opacity: 0.6; }
    50% { transform: translate(4px, -50%); opacity: 1; }
    100% { transform: translate(0, -50%); opacity: 0.6; }
}

/* Elegant UI elements for PayPal modals */
.ui-helper-card {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(10,10,10,0.35);
  border-radius: 10px;
  padding: 12px 14px;
}
.ui-helper-title { color: #dfe7ef; font-weight: 700; margin-bottom: 6px; display:flex; align-items:center; gap:8px; }
.ui-helper-title .fa-circle-question { color: #7cc7ff; }
.badge { display:inline-flex; align-items:center; gap:6px; padding:2px 8px; border-radius:999px; font-weight:700; font-size:12px; }
.badge-live { background:#064e3b; color:#a7f3d0; border:1px solid #10b981; }
.badge-sandbox { background:#1e40af; color:#bfdbfe; border:1px solid #60a5fa; }
.ui-steps { margin-left: 18px; color: #b8c2cf; font-size: 14px; line-height: 1.5; }
.ui-steps li { margin: 4px 0; }
.ui-steps a { color: #7cc7ff; text-decoration: underline; }

.ui-input { width: 100%; padding: 12px 14px; background: #0d0f14; color: #e8eef7; border: 1px solid rgba(255,255,255,0.14); border-radius: 10px; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
.ui-input:focus { border-color: #7cc7ff; box-shadow: 0 0 0 3px rgba(124,199,255,0.20); }

.ui-btn { display: inline-flex; align-items: center; gap: 10px; border: 1px solid transparent; background: transparent; color: #e8eef7; padding: 10px 16px; border-radius: 10px; cursor: pointer; }
.ui-btn-large { padding: 14px 18px; border-radius: 999px; width: 100%; justify-content: center; font-weight: 700; }
.ui-btn-primary { background: #1f2937; border-color: rgba(255,255,255,0.12); }
.ui-btn-primary:hover { background: #2a3648; }
.ui-btn-primary .fa-paypal, .ui-btn-primary .fa-dollar-sign { color: #f0f3f7; }

/* Positioned modal for social links */
.modal.positioned {
    background: none;
}
.modal.positioned .modal-content {
    position: fixed;
    margin: 0;
    /* left and top set in JS */
}

/* Tabs styling for create-topic */
.tabs { display: flex; gap: 8px; margin: 12px 0 16px; }
.tab { background: rgba(255,255,255,0.06); color:#f5f5f5; border:1px solid rgba(255,255,255,0.1); padding:8px 12px; border-radius:6px; cursor:pointer; }
.tab.active { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.18); }
.tab-panels .tab-panel label { color:#aaa; display:block; margin-bottom:6px; }
.tab-panels .tab-panel input[type="text"], .tab-panels .tab-panel textarea { width:100%; padding:10px; background:#333; border:none; border-radius:6px; color:#f5f5f5; }

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #aaa;
}

.close-modal:hover {
    color: #f5f5f5;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #aaa;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    background-color: #333;
    border: none;
    border-radius: 4px;
    color: #f5f5f5;
}

.form-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 4px;
    background-color: #333;
    cursor: pointer;
}

.radio-group {
    display: flex;
    gap: 15px;
}

.radio-group input[type="radio"] {
    margin-right: 5px;
}

.btn-primary {
    background-color: #444;
    color: #f5f5f5;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #555;
}

.hidden {
    display: none;
}

/* Project Page Styles */
.project-header {
    text-align: center;
    margin-bottom: 12px; /* more minimal */
}

.project-header-row {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.sub-header {
  --sub-header-height: 60px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 10px 24px;
  min-height: var(--sub-header-height);
  /* Fixed below main header with translucent backdrop */
  position: fixed;
  top: var(--main-header-height, 72px);
  left: 0;
  right: 0;
  background: rgba(20,20,20,0.16);
  backdrop-filter: saturate(150%) blur(8px);
  -webkit-backdrop-filter: saturate(150%) blur(8px);
  z-index: 110;
}

.sub-header-inner {
  position: relative;
  width: 100%;
  min-height: var(--sub-header-height);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.sub-header-inner .title-rail {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.integrations-drawer {
  position: fixed;
  top: calc(var(--main-header-height, 72px) + var(--sub-header-height, 52px));
  left: 0;
  height: calc(100vh - (var(--main-header-height, 72px) + var(--sub-header-height, 52px)));
  width: clamp(220px, 25vw, 360px);
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, rgba(20, 24, 22, 0.86), rgba(10, 12, 12, 0.65));
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  transform: translateX(-100%);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  pointer-events: none;
  z-index: 9500;
}

.integrations-drawer.is-open {
  transform: translateX(0);
  box-shadow: 12px 0 28px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
}

.integrations-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.integrations-drawer__header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.integrations-drawer__close {
  border: 0;
  background: rgba(255, 255, 255, 0.08);
  color: #f3f3f3;
  width: 32px;
  height: 32px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.integrations-drawer__close:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.integrations-drawer__body {
  flex: 1;
  padding: 12px 18px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer-integrations {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-integration-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 10, 10, 0.35);
  flex-wrap: wrap;
  row-gap: 8px;
}

.drawer-integration__logo {
  min-width: 108px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: none;
  background: transparent;
  flex: 1 1 0%;
  min-width: 0;
}

.paypal-mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #003087, #009cde);
  color: #ffffff;
  font-size: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.paypal-wordmark {
  font-family: 'Belleza', sans-serif;
  font-size: clamp(16px, 2.2vw, 20px);
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
}

.paypal-wordmark__pay { color: #003087; }
.paypal-wordmark__pal { color: #009cde; }

.imgbb-logo {
  display: inline-flex;
  align-items: center;
}

.imgbb-logo svg {
  width: auto;
  height: 20px;
  display: block;
}

.drawer-integration__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f8fafc;
  font-size: 12px;
  letter-spacing: 0.2px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}

.drawer-integration__status i {
  font-size: 12px;
}

.drawer-integration__status-label,
.drawer-integration__status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.drawer-integration__status-label {
  font-weight: 600;
}

.drawer-integration__status-icon {
  width: 18px;
  height: 18px;
  font-size: 12px;
}

.drawer-integration__status[data-state="connected"] {
  border-color: rgba(255, 255, 255, 0.6);
  color: #bbf7d0;
}

.drawer-integration__status[data-state="disconnected"] {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fecaca;
}

.drawer-integration__config {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  color: #f8fafc;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.drawer-integration__actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  justify-content: flex-end;
}
@container (max-width: 340px) {
  .drawer-integration-row {
    align-items: flex-start;
  }
  .drawer-integration__logo {
    flex: 1 1 100%;
    min-width: 0;
  }
  .drawer-integration__actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
  }
}

.drawer-integration__config:hover {
  transform: translateY(-1px);
  color: rgba(255, 255, 255, 0.75);
}

.integrations-drawer__open {
  --drawer-switch-width: 48px;
  --drawer-switch-height: 26px;
  --drawer-switch-padding: 3px;
  --drawer-switch-knob: 20px;
  --drawer-switch-travel: 24px;
  position: relative;
  margin-left: 10px;
  transform: none;
  z-index: 2;
  padding: 0;
  width: var(--drawer-switch-width);
  height: var(--drawer-switch-height);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.7);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  transition: transform 0.25s ease, opacity 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}

.integrations-drawer__open:hover {
  border-color: rgba(255, 255, 255, 1);
  transform: translateX(2px);
}

.integrations-drawer__open.is-hidden {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.drawer-switch {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: var(--drawer-switch-padding);
}

.drawer-switch__knob {
  width: var(--drawer-switch-knob);
  height: var(--drawer-switch-knob);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.integrations-drawer__open.is-active {
  border-color: rgba(255, 255, 255, 1);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.integrations-drawer__open.is-active .drawer-switch__knob {
  transform: translateX(var(--drawer-switch-travel));
}

.fb-safari-bulb {
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  font-size: 14px;
  transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.2s ease;
}
.fb-safari-bulb:hover {
  transform: translateY(-1px);
}
.fb-safari-bulb.is-on {
  color: #facc15;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.55);
}
.fb-safari-bulb.is-hidden {
  display: none;
}

@media (max-width: 1280px) {
  .integrations-drawer {
    width: auto;
  }
}

@media (max-width: 760px) {
  .integrations-drawer {
    width: auto;
  }
}

/* Offset project page content so it doesn't hide under fixed headers */
body:not(.home) .content {
  padding-top: calc(var(--main-header-height, 56px) + var(--sub-header-height, 48px) + 8px);
}
.co-avatars { display: inline-flex; align-items: center; gap: 6px; justify-content: center; margin-top: 0; }
.avatar-stack { display: inline-flex; align-items: center; gap: 4px; position: relative; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; color: #fff; background: #666;
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: transform .15s ease, box-shadow .15s ease;
  transform-origin: center;
  cursor: pointer;
}
.avatar img { width:100%; height:100%; border-radius:50%; object-fit: cover; }
.avatar:hover { transform: scale(1.02); z-index: 20; box-shadow: 0 4px 12px rgba(0,0,0,0.35); }

/* Add co-creator avatar with plus sign */
#addCoCreatorAvatar {
    background: rgba(255,255,255,0.1);
    border: 2px dashed rgba(255,255,255,0.3);
    color: #f5f5f5;
    font-weight: bold;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#addCoCreatorAvatar:hover {
    background: rgba(255,255,255,0.2);
    border: 2px dashed rgba(255,255,255,0.5);
    transform: scale(1.05);
}

/* Delete button for collaborator avatars */
.avatar .avatar-delete {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #000;
    color: white;
    border: 1px solid #fff;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    z-index: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.avatar:hover .avatar-delete {
    display: flex;
}

.avatar#addCoCreatorAvatar .avatar-delete {
    display: none !important;
}

/* Red delete button for social link avatars */
.social-link-avatar .avatar-delete {
    background: #c62828; /* red */
    border-color: rgba(255,255,255,0.85);
    color: #fff;
}

/* Red delete button for co‑creator avatars */
#coCreatorAvatars .avatar-delete {
    background: #c62828; /* red */
    border-color: rgba(255,255,255,0.85);
    color: #fff;
}

/* Tooltip styles for avatar info */
.avatar-tooltip-container {
    position: relative;
    display: inline-block;
}

.avatar-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    pointer-events: none;
}

.avatar-tooltip-container:hover .avatar-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(4px);
}

.avatar-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-bottom-color: rgba(0,0,0,0.9);
}

/* Keep title centered while avatars are centered in remaining space */
.title-rail { position: relative; min-height: 48px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; }
.title-rail .project-title {
  margin: 0; width: max-content;
}
.title-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.top-expand-btn,
.select-mode-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.85);
  background: transparent;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}
.top-expand-btn i { font-size: 12px; }
.top-expand-btn:hover,
.select-mode-btn:hover { background: rgba(255,255,255,0.1); }
.select-mode-btn.is-active {
  background: rgba(255,255,255,0.16);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.select-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-block;
}
.select-icon .fa-square {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 18px;
  transform: translate(-50%, -50%);
  opacity: 0.7;
}
.select-icon .fa-mouse-pointer {
  position: absolute;
  left: 50%;
  top: 50%;
  font-size: 13px;
  transform: translate(-20%, -20%);
}
.add-links-avatar {
  position: absolute;
  top: 50%;
  left: 25%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border: 2px dashed rgba(255,255,255,0.3);
  border-radius: 6px;
  color: #f5f5f5;
  font-weight: bold;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.add-links-avatar:hover {
  background: rgba(255,255,255,0.2);
  border: 2px dashed rgba(255,255,255,0.5);
  transform: translateY(-50%) scale(1.05);
}
.add-links-avatar::before {
  content: '+';
}
.avatar-inline-stack { position: absolute; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 12px; justify-content: center; width: auto; }

/* Tiny wing labels above avatar stacks */
.wing-label {
  position: absolute;
  top: -11px; /* balanced midway between avatars and header edge */
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  line-height: 1;
  color: #bdbdbd; /* light grey */
  font-family: 'Alegreya', serif;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0.95;
}
.sub-header .co-avatars { margin-top: 0; }

/* Social Link Avatars */
#socialLinkAvatars {
  /* left positioned dynamically */
  transform: translateY(-50%);
}
.social-link-avatar {
  width: 40px;
  height: 40px;
  border-radius: 6px; /* Square with rounded corners */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
  /* Removed margin-right to use gap from avatar-inline-stack */
}
.social-link-avatar:hover {
  transform: scale(1.02);
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
}

.project-title {
    font-family: 'Belleza', 'Alegreya', system-ui, sans-serif;
    font-size: 32px; /* align with headline scale */
    line-height: 1.2;
    margin-bottom: 2px;
}

.project-subtitle {
    font-size: 12px; /* subtler */
    color: #bdbdbd;
    margin-top: 2px;
}

.project-subtitle button.linklike {
    background: none;
    border: none;
    color: #7cc7ff;
    text-decoration: underline;
    cursor: pointer;
    font-size:10px;
    padding: 0;
}

/* Seamless in-canvas toolbar: only as wide as its content */
.project-toolbar {
    position: sticky;
    top: 0;
    margin-left: 12px;
    width: max-content;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 6px 10px;
    background: rgba(20,20,20,0.28);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    backdrop-filter: saturate(140%) blur(8px);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.18);
    z-index: 20;
}
.project-toolbar .project-title { margin: 0; }
.project-toolbar .project-subtitle { margin: 0; }
.project-toolbar #coCreatorsContainer { margin-top: 0; justify-content: flex-start; }

.cocreators {
    margin-top: 6px; /* closer to title */
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.cocreator-chip {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #f5f5f5;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cocreator-chip .remove {
    background: transparent;
    border: none;
    color: #ddd;
    cursor: pointer;
    font-size: 12px;
}

.creation-canvas {
    position: relative;
    -webkit-tap-highlight-color: transparent;
    margin: 0 24px 24px;
    margin-left: calc(24px + var(--drawer-offset, 0px));
    min-height: 60vh;
    z-index: 0;
    isolation: isolate;
}
.fb-safari-notice {
    position: absolute;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    z-index: 7000;
    margin: 0;
    padding: 10px 36px 10px 14px;
    display: inline-block;
    width: auto;
    max-width: min(760px, calc(100% - 24px));
    border-radius: 14px;
    background: rgba(15,23,42,0.92);
    border: 1px solid rgba(148,163,184,0.35);
    color: #f8fafc;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.fb-safari-notice__main {
    text-align: center;
}
.fb-safari-notice__toggle {
    background: transparent;
    border: 0;
    color: #38bdf8;
    font-weight: 700;
    text-decoration: underline;
    padding: 0;
    cursor: pointer;
}
.fb-safari-notice__close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.35);
    background: rgba(15,23,42,0.9);
    color: #e2e8f0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fb-safari-notice__close:hover {
    border-color: rgba(148,163,184,0.6);
    color: #fff;
}
.fb-safari-notice__details {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(148,163,184,0.25);
    font-size: 13px;
    line-height: 1.45;
    max-height: 40vh;
    overflow-y: auto;
    text-align: left;
}
.fb-safari-notice__details[hidden] {
    display: none;
}
.fb-safari-notice__list {
    margin: 6px 0 0 18px;
    padding: 0;
}
.creation-canvas,
.creation-canvas * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
.creation-canvas [contenteditable="true"],
.creation-canvas input,
.creation-canvas textarea {
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}
.creation-canvas.select-mode {
    cursor: crosshair;
}
.creation-canvas.select-mode .embedded-item,
.creation-canvas.select-mode .fundraiser-widget {
    cursor: grab;
}
#workspace {
    position: relative;
    min-height: 60vh;
}
.canvas-selection-box {
    position: absolute;
    border: 1px dashed rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.08);
    border-radius: 6px;
    pointer-events: none;
    z-index: 35;
}
.embedded-item.is-selected,
.fundraiser-widget.is-selected {
    outline: 2px solid rgba(255,255,255,0.85) !important;
    outline-offset: 3px;
    box-shadow:
        0 0 0 3px rgba(255,255,255,0.18),
        0 0 18px rgba(255,255,255,0.45),
        0 0 36px rgba(255,255,255,0.25) !important;
}
.embedded-item.folder-item.is-selected {
    outline: 2px solid rgba(255,255,255,0.85) !important;
    outline-offset: 3px;
    box-shadow:
        0 0 0 3px rgba(255,255,255,0.18),
        0 0 18px rgba(255,255,255,0.45),
        0 0 36px rgba(255,255,255,0.25) !important;
}

.canvas-guide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 32px;
    pointer-events: none;
    text-align: center;
    font-family: 'Alegreya', 'Cormorant Garamond', serif;
    font-size: clamp(16px, 1.6vw, 24px);
    font-weight: 600;
    letter-spacing: 0.05em;
    color: rgba(235, 236, 238, 0.65);
    -webkit-text-stroke: 0.15px rgba(0, 0, 0, 0.3);
    text-shadow:
        0 1px 2px rgba(0, 0, 0, 0.45),
        0 -1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(18px);
    text-transform: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 40;
    text-rendering: geometricPrecision;
}

.canvas-guide.is-visible {
    opacity: 0.92;
}

.canvas-guides {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    pointer-events: none;
    display: none;
    z-index: 1;
    opacity: 0.65;
}

.canvas-guides.is-visible {
    display: block;
}

.canvas-guide-line {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(248, 250, 252, 0.25);
}
@media (max-width: 720px), (max-height: 520px) and (orientation: landscape) and (pointer: coarse) {
    .canvas-guides {
        opacity: 0.82;
    }
    .canvas-guide-line {
        width: 2px;
        background: rgba(248, 250, 252, 0.45);
    }
    .fb-safari-notice {
        top: 8px;
        padding: 9px 30px 9px 12px;
        max-width: calc(100% - 16px);
        font-size: 13px;
        line-height: 1.45;
    }
    .fb-safari-notice__close {
        top: 5px;
        right: 6px;
    }
    .fb-safari-notice__details {
        font-size: 12px;
        line-height: 1.45;
    }
}

.topics-container {
    position: relative;
    height: calc(100vh - 180px); /* fill screen minus header + project header */
    min-height: 480px;
    overflow: auto;
    border: none;
    cursor: grab;
    /* Allow JS-driven panning in all directions (prevents browser gestures) */
    touch-action: none;
}

/* Inner canvas that scales for zoom */
.canvas-inner {
    position: relative;
    /* Width/height set dynamically to fit content; start minimal */
    width: 0;
    height: 0;
    transform-origin: 0 0;
    cursor: inherit; /* show grab/grabbing from parent */
    touch-action: none;
}

.topics-container.panning {
    cursor: grabbing;
    user-select: none;
}

/* While dragging items, prevent text selection */
.topics-container.dragging {
    cursor: grabbing;
    user-select: none;
}

.topic {
    /* Make cards translucent so page gradient shows through */
    background-color: rgba(34, 34, 34, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 20px;
    backdrop-filter: saturate(160%) blur(2px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.35);
    position: absolute;
    width: 520px;
    min-height: 240px;
}

/* Topic delete affordance */
.topic .topic-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s ease;
}
.topic:hover .topic-delete { opacity: 1; }

.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    cursor: move;
    user-select: none;
}

.topic-title {
    font-size: 20px;
}

.topic-content {
    min-height: 200px;
    position: relative;
    border: none;
    padding: 10px;
    margin-bottom: 10px;
}

.resize-handle {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 5px;
    background-color: #444;
    cursor: ns-resize;
    border-radius: 2px;
}

/* Corner resize for topic card */
.topic-resize {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 14px;
    height: 14px;
    border-right: 2px solid rgba(255,255,255,0.3);
    border-bottom: 2px solid rgba(255,255,255,0.3);
    cursor: nwse-resize;
}

.embedded-item {
    position: absolute;
    border: 1px solid transparent;
    background: rgba(20,20,20,0.25);
    min-width: 200px;
    min-height: 150px;
    resize: both;
    overflow: hidden;
    box-sizing: border-box;
    touch-action: none; /* enable pointer dragging on touch */
}

.embedded-item.folder-item {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0;
    min-width: 0;
    min-height: 0;
    overflow: visible;
}
.embedded-item.folder-item .embed-drag-handle {
    top: 12px;
    right: 10px;
    left: auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    background: rgba(0,0,0,0.35);
}
.embedded-item.folder-item:hover .embed-drag-handle,
.embedded-item.folder-item.dragging-item .embed-drag-handle {
    display: flex;
}
.embedded-item.folder-item .resize-corner {
    right: 10px;
    bottom: 10px;
}

.embedded-item.stretch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    resize: none;
}

/* Remove visible header chrome for embeds */
.embedded-item .item-header { display: none; }

.embedded-item .item-content {
    padding: 0;
    height: 100%;
}

.embedded-item iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.embedded-item.media-item {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1px solid rgba(148,163,184,0.35);
    background: radial-gradient(circle at top left, rgba(15,23,42,0.92), rgba(2,6,23,0.92));
    overflow: hidden;
    resize: none;
}
.embedded-item.media-item .item-content {
    height: auto;
    flex: 0 0 auto;
}
.media-embed-clip {
    position: relative;
    flex: 0 0 auto;
    min-height: 140px;
    overflow: hidden;
}
.media-embed-content {
    position: absolute;
    inset: 0;
    transform-origin: 0 0;
}
.embedded-item.media-item.is-replace-open .media-embed-content {
    filter: blur(4px);
}
.media-embed-content iframe,
.media-embed-content img,
.media-embed-content video,
.media-embed-content object,
.media-embed-content embed {
    width: 100% !important;
    height: 100% !important;
    border: 0;
    display: block;
}
.embedded-item.media-item .media-embed-clip,
.embedded-item.media-item .media-embed-clip iframe {
    touch-action: manipulation;
}
.media-embed-fallback {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    font-size: 13px;
    background: rgba(15,23,42,0.7);
}
.media-replace-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(2,6,23,0.55);
    z-index: 3;
}
.media-replace-card {
    width: 100%;
    max-width: 360px;
    background: rgba(15,23,42,0.92);
    border: 1px solid rgba(148,163,184,0.25);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 18px 40px rgba(15,23,42,0.45);
}
.media-replace-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
}
.media-replace-header-left {
    display: flex;
    align-items: center;
}
.media-replace-header-right {
    display: flex;
    justify-content: flex-end;
}
.media-replace-title {
    font-size: 14px;
    font-weight: 700;
    color: #f8fafc;
    text-align: center;
}
.media-replace-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.media-replace-row .media-replace-url {
    width: 100%;
}
.media-replace-btn {
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #34d399, #22c55e);
    color: #0f172a;
}
.media-replace-drop {
    width: 120px;
    height: 82px;
    border-radius: 12px;
    border: 1px dashed rgba(148,163,184,0.45);
    background: rgba(2,6,23,0.5);
    color: rgba(226,232,240,0.8);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.media-replace-drop.is-dragover {
    border-color: rgba(56,189,248,0.9);
    color: #e2e8f0;
    background: rgba(56,189,248,0.12);
}
.media-replace-btn.secondary {
    background: rgba(15,23,42,0.7);
    border: 1px solid rgba(148,163,184,0.35);
    color: #e2e8f0;
}
.media-replace-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.media-replace-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    height: 26px;
    margin: 2px 0;
}
.media-replace-divider::before,
.media-replace-divider::after {
    content: '';
    height: 1px;
    flex: 1 1 auto;
    background: rgba(148,163,184,0.25);
}
.media-replace-divider span {
    padding: 4px 10px;
    margin: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.35);
    background: rgba(15,23,42,0.8);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #e2e8f0;
}
.media-replace-url {
    flex: 1 1 auto;
    min-width: 120px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.3);
    background: rgba(2,6,23,0.6);
    color: #e2e8f0;
    font-size: 12px;
}
.media-replace-status {
    font-size: 11px;
    color: #93c5fd;
    display: none;
}
.media-replace-status.is-error {
    color: #fca5a5;
}
.media-replace-preview {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(148,163,184,0.25);
    background: rgba(2,6,23,0.6);
}
.media-replace-preview img {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(148,163,184,0.3);
}
.media-replace-preview-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
}
.media-replace-preview-name {
    font-size: 12px;
    font-weight: 600;
    color: #f8fafc;
    word-break: break-word;
}
.media-replace-preview-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.media-replace-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.35);
    background: rgba(15,23,42,0.7);
    color: #e2e8f0;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.media-text-embed {
    width: 100%;
    height: 100%;
    overflow: auto;
    padding: 14px 16px;
    color: #e2e8f0;
    font-size: 14px;
    line-height: 1.5;
    background: rgba(2,6,23,0.6);
}
.media-text-embed__body {
    white-space: normal;
}
.media-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 8px 12px;
    background: rgba(2,6,23,0.7);
    border-top: 1px solid rgba(148,163,184,0.2);
}
.media-info-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #f8fafc;
    font-size: 15px;
    font-weight: 600;
    flex: 1 1 auto;
    min-width: 0;
}
.media-info-name-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(148,163,184,0.9);
}
.media-info-name-value {
    font-size: 18px;
    color: #f8fafc;
    word-break: break-word;
}
.media-info-name-value[contenteditable="true"] {
    outline: none;
    border-bottom: 1px solid rgba(56,189,248,0.7);
}
.media-info-controls {
    display: inline-flex;
    gap: 8px;
    margin-left: auto;
}
.media-info-toggle,
.media-url-toggle,
.media-crop-lock {
    border: 1px solid rgba(148,163,184,0.35);
    background: rgba(15,23,42,0.6);
    color: #e2e8f0;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.media-info-toggle:hover,
.media-url-toggle:hover,
.media-crop-lock:hover {
    border-color: rgba(56,189,248,0.7);
    color: #f8fafc;
}
.media-info-toggle:disabled,
.media-url-toggle:disabled,
.media-crop-lock:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.media-crop-lock.is-active {
    background: rgba(56,189,248,0.25);
    border-color: rgba(56,189,248,0.8);
    color: #e2e8f0;
}
.media-info-panel {
    display: none;
    padding: 10px 12px 12px;
    background: rgba(2,6,23,0.85);
    border-top: 1px solid rgba(148,163,184,0.22);
}
.embedded-item.media-item.is-info-open .media-info-panel {
    display: block;
}
.media-info-title {
    font-size: 16px;
    letter-spacing: 0.08em;
    text-transform: none;
    color: #ffffff;
    font-weight: 700;
    margin-bottom: 8px;
}
.media-info-text {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,0.35);
    background: rgba(15,23,42,0.7);
    color: #e2e8f0;
    font-size: 20px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
.media-info-text:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56,189,248,0.25);
}
.media-info-text.is-readonly {
    border-color: transparent;
    background: transparent;
    padding: 4px 0;
}
.media-info-text:empty::before {
    content: attr(data-placeholder);
    color: rgba(148,163,184,0.7);
}
.media-crop-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.6);
    background: rgba(15,23,42,0.85);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.media-crop-handle.is-top {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}
.media-crop-handle.is-right {
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}
.media-crop-handle.is-bottom {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    cursor: ns-resize;
}
.media-crop-handle.is-left {
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    cursor: ew-resize;
}
.media-crop-scale {
    position: absolute;
    right: 26px;
    bottom: 26px;
    width: 14px;
    height: 14px;
    border-radius: 4px;
    border: 1px solid rgba(56,189,248,0.9);
    background: rgba(2,6,23,0.9);
    cursor: nwse-resize;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.embedded-item.media-item:hover .media-crop-handle,
.embedded-item.media-item:hover .media-crop-scale,
.embedded-item.media-item.is-selected .media-crop-handle,
.embedded-item.media-item.is-selected .media-crop-scale {
    opacity: 1;
}
.embedded-item.media-item.is-crop-locked .media-crop-handle,
.embedded-item.media-item.is-crop-locked .media-crop-scale,
.embedded-item.media-item.is-viewer .media-crop-handle,
.embedded-item.media-item.is-viewer .media-crop-scale {
    display: none;
}
.embedded-item.media-item .media-crop-handle,
.embedded-item.media-item .media-crop-scale {
    display: none !important;
    pointer-events: none;
}
.embedded-item.media-item.is-viewer .resize-corner,
.embedded-item.media-item.is-viewer .embed-drag-handle,
.embedded-item.media-item.is-viewer .embed-drag-bar,
.embedded-item.media-item.is-viewer .item-delete {
    display: none;
}
.is-ios .embedded-item.media-item.is-facebook .embed-drag-handle,
.is-ios .embedded-item.media-item.is-facebook .embed-drag-bar {
    display: none !important;
}
.is-ios .embedded-item.media-item.is-facebook .drag-surface {
    display: none !important;
    pointer-events: none !important;
}
.is-ipad .embedded-item.media-item.is-facebook.is-fb-portal .media-embed-content {
    visibility: hidden;
}
.fb-portal-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 6000;
}
.fb-portal-layer .fb-portal {
    position: absolute;
    pointer-events: auto;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: #000;
}
.fb-portal-layer.is-passive .fb-portal {
    pointer-events: none;
}
.fb-portal-layer .fb-portal iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
.is-ios .embedded-item.media-item.is-facebook .media-embed-content {
    transform: none !important;
}
.is-ios .drag-tool-active .embedded-item.media-item.is-facebook .drag-surface {
    display: none !important;
    pointer-events: none;
}
.is-ios .embedded-item.media-item.is-facebook .media-info-bar.is-drag-handle {
    cursor: move;
    touch-action: none;
}
/* Full-surface invisible drag layer over embeds */
/* Small drag handle for embed items (so media remains clickable) */
.embedded-item .embed-drag-handle {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 18px;
    height: 18px;
    background: rgba(0,0,0,0.35);
    border-radius: 999px;
    cursor: move;
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
}
.embedded-item .embed-drag-handle::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255,255,255,0.65) 1px, transparent 2px) 0 0/4px 4px;
    opacity: 0.9;
}
.embedded-item:hover .embed-drag-handle { display: flex; opacity: 1; background: rgba(0,0,0,0.55); }
@media (hover: none) {
  .embedded-item .embed-drag-handle { display: flex; }
}

/* Optional full-width drag bar for easy grabbing */
.embedded-item .embed-drag-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 22px;
    background: rgba(0,0,0,0.28);
    border-bottom: 1px solid rgba(255,255,255,0.12);
    cursor: move;
    z-index: 3;
    display: none;
}
.embedded-item:hover .embed-drag-bar { display: block; }

/* Small drag handle for text items */
.text-item .drag-handle {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 18px;
    height: 18px;
    background: rgba(0,0,0,0.35);
    border-radius: 50%;
    cursor: move;
    display: none;
}
.text-item:hover .drag-handle { display: block; }

/* Minimal delete affordance without framing */
.embedded-item .item-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease, transform .12s ease;
    z-index: 50; /* above drag surfaces */
}
.embedded-item:hover .item-delete { opacity: 1; transform: scale(1.15); }

/* Make folder delete consistent and prominent on hover */
.folder-item:hover .item-delete { opacity: 1; transform: scale(1.2); }

/* Drag surface (covers embed so iframes don't eat the pointer) */
.embedded-item .drag-surface {
    position: absolute;
    inset: 0;
    background: transparent;
    cursor: move;
    z-index: 2;
    display: none;
    pointer-events: none;
}

.drag-tool-active .embedded-item .drag-surface {
    display: block;
    pointer-events: auto;
}
.drag-tool-active .creation-canvas,
.drag-tool-active .embedded-item {
    cursor: move;
}

/* Subtle card hover and while dragging */
.embedded-item:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.35); }
.embedded-item.dragging-item { box-shadow: 0 12px 28px rgba(0,0,0,0.45); }

/* Custom smooth resize handle */
.embedded-item .resize-corner {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 20px;
    height: 20px;
    border-right: 2px solid rgba(255,255,255,0.6);
    border-bottom: 2px solid rgba(255,255,255,0.6);
    cursor: nwse-resize;
    z-index: 4;
}

.topics-container.resizing, .topics-container.dragging {
    user-select: none;
    cursor: grabbing;
}

/* Special folder visual to distinguish from plain embeds */
.folder-item {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible; /* allow label under the folder */
  resize: none; /* rely on custom resize corner */
  --folder-scale: 1;
  /* Folder proportions */
  --folder-radius: clamp(18px, 18%, 30px);
  --tab-left: clamp(10px, 6%, 22px);
  --tab-rise: clamp(10%, 16%, 24%); /* portion of folder height */
  --tab-overlap: clamp(5%, 7%, 12%);
  --tab-w: clamp(48px, 32%, 200px);
  --tab-r-top: clamp(14px, 14%, 24px);
  --tab-r-bot: clamp(10px, 10%, 18px);
}

.folder-item::before {
  content: '';
  position: absolute;
  left: var(--tab-left);
  top: calc(-1 * var(--tab-rise));
  width: var(--tab-w);
  height: calc(var(--tab-rise) + var(--tab-overlap));
  border-top-left-radius: var(--tab-r-top);
  border-top-right-radius: var(--tab-r-top);
  border-bottom-right-radius: var(--tab-r-bot);
  border-bottom-left-radius: var(--tab-r-bot);
  background: linear-gradient(180deg, #fdeca0 0%, #e9c15a 95%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.65),
    0 2px 6px rgba(0,0,0,0.12);
  z-index: 2;
  pointer-events: none;
}
.folder-item:hover,
.folder-item.dragging-item {
  box-shadow: none;
  background: transparent;
  border: none;
}

/* Folder "body" is the rounded surface with a left tab */
.folder-item .folder-body {
  position: absolute;
  inset: 0;
  border-radius: var(--folder-radius);
  background: linear-gradient(180deg, #fff0b8 0%, #f2c96a 45%, #d6a84d 100%);
  border: 1px solid rgba(0,0,0,0.22);
  box-shadow:
    0 18px 36px rgba(0,0,0,0.48),
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -1px 0 rgba(0,0,0,0.08);
  overflow: hidden;
  isolation: isolate;
  z-index: 1;
}
.folder-item:hover .folder-body,
.folder-item.dragging-item .folder-body {
  box-shadow:
    0 18px 36px rgba(0,0,0,0.48),
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -1px 0 rgba(0,0,0,0.08),
    0 0 0 2px rgba(255,255,255,0.45);
}

/* Highlight glaze + preview well */
.folder-item .folder-body::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.00) 35%),
    radial-gradient(140% 120% at 100% 100%, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.00) 60%);
  pointer-events: none;
  z-index: 1;
}
.folder-item .folder-body::after {
  content: 'Preview';
  position: absolute;
  left: 6%;
  right: 6%;
  top: calc(var(--tab-overlap) + 10%);
  bottom: 6%;
  border-radius: clamp(16px, 14%, 28px);
  border: 2px dashed rgba(255,255,255,0.4);
  background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(0,0,0,0.05) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -3px 8px rgba(0,0,0,0.18);
  color: rgba(255,255,255,0.65);
  font-size: clamp(13px, 1.8vw, 18px);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.folder-item .folder-tab-title {
  display: none;
}
.folder-item .folder-tab-title[contenteditable="true"] {
  cursor: text;
  user-select: text;
  outline: none;
}
.folder-item .folder-tab-title[contenteditable="true"]:focus {
  box-shadow: 0 0 0 2px rgba(59,130,246,0.55);
  background: rgba(255,255,255,0.10);
}

.folder-item .folder-preview {
  display: none;
}

.folder-item .folder-menu-trigger {
  position: absolute;
  bottom: clamp(2px, 2%, 8px);
  left: clamp(2px, 2%, 8px);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.25);
  background: rgba(0,0,0,0.45);
  color: #f8f8f8;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  z-index: 4;
  opacity: 1;
  pointer-events: auto;
}
.folder-item:hover .folder-menu-trigger {
  pointer-events: auto;
}
.folder-item.dragging-item .folder-menu-trigger {
  opacity: 1;
  pointer-events: auto;
}
.folder-item .folder-menu-trigger:hover {
  background: rgba(0,0,0,0.26);
}
@media (hover: none) {
  .folder-item .folder-menu-trigger { opacity: 1; pointer-events: auto; }
}

/* Title + description always under the folder (not inside the body) */
.folder-item .folder-meta-under {
  position: absolute;
  left: 0;
  right: 0;
  width: auto;
  transform: none;
  top: 100%;
  margin-top: 16px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 6px 8px;
  box-sizing: border-box;
  box-shadow: 0 10px 24px rgba(0,0,0,0.55);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.folder-item .resize-corner { z-index: 20; }
.folder-item .folder-title {
  font-size: calc(18px * var(--folder-scale));
  color: #f8fafc;
  margin: 0;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.folder-item .folder-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}
.folder-item .folder-title-pen {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(calc(-50% - 50px), -110%);
  z-index: 7;
  border: 1px solid rgba(0,0,0,0.7);
  background: rgba(0,0,0,0.85);
  color: #ff4d4f;
  border-radius: 999px;
  width: 18px;
  height: 18px;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.folder-item .folder-title-pen:hover {
  background: rgba(0,0,0,1);
}
.folder-item .folder-desc {
  font-size: calc(11px * var(--folder-scale));
  color: rgba(226,232,240,0.78);
  margin: 2px 0 0 0;
  display: none;
}
.folder-item .folder-category {
  margin-top: 6px;
  display: flex;
  justify-content: center;
  position: relative;
}
.folder-item .folder-category-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.45);
  color: #f8fafc;
  border-radius: 999px;
  padding: 4px 16px;
  font-size: calc(8px * var(--folder-scale));
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.folder-item .folder-category-toggle:hover {
  background: rgba(255,255,255,0.2);
  color: #0f172a;
}
.folder-item .folder-category-menu {
  position: absolute;
  top: calc(100% + 4px);
  min-width: 140px;
  background: rgba(15,15,20,0.95);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
  padding: 4px 0;
  display: none;
  z-index: 30;
}
.folder-item .folder-category-menu.is-open {
  display: block;
}
.folder-item .folder-category-menu button {
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: none;
  color: #f1f5f9;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}
.folder-item .folder-category-menu button:hover {
  background: rgba(255,255,255,0.08);
}

.folder-item .folder-color-picker {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(calc(-50% + 50px), -110%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.7);
  background: rgba(0,0,0,0.85);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 7;
}
.folder-item .folder-color-picker input[type="color"] {
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
}
.folder-item .folder-color-picker input[type="color"]::-webkit-color-swatch,
.folder-item .folder-color-picker input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 50%;
  padding: 0;
}
.folder-item .folder-color-picker input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}

/* Folder context menu on tap/click */
.folder-context-menu {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 150px;
  background: rgba(15,15,20,0.96);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.75);
  padding: 4px 0;
  z-index: 60;
}
.folder-context-menu button {
  width: 100%;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: #f5f5f5;
  text-align: left;
  font-size: 12px;
  cursor: pointer;
}
.folder-context-menu button:hover:not(:disabled) {
  background: rgba(255,255,255,0.06);
}
.folder-context-menu button:disabled {
  opacity: 0.4;
  cursor: default;
}

.text-item {
    position: absolute;
    min-width: 100px;
    min-height: 30px;
    cursor: move;
    user-select: none;
}

.text-item .text-content {
    outline: none;
    padding: 5px;
    user-select: text;
}

/* Zoom HUD */
.zoom-hud {
    position: fixed;
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    display: flex;
    gap: 6px;
    align-items: center;
    background: rgba(20,20,20,0.6);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(8px) saturate(130%);
    padding: 6px 8px;
    border-radius: 8px;
    z-index: 9000;
    user-select: none;
}
.zoom-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.zoom-hud button { background: rgba(255,255,255,0.06); color:#f5f5f5; border:1px solid rgba(255,255,255,0.1); padding:8px 10px; border-radius:7px; cursor:pointer; touch-action: manipulation; }
.zoom-hud button.is-active { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.35); color:#ffffff; }
.zoom-hud .zoom-label { min-width: 64px; text-align: center; color:#ccc; font-size: 18px; }
.zoom-slider-wrap {
  display: inline-flex;
  align-items: center;
  padding: 0 2px;
}
.zoom-slider {
  width: 120px;
  height: 6px;
  appearance: none;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  outline: none;
}
.zoom-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f5f5f5;
  border: 2px solid rgba(0,0,0,0.35);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  cursor: pointer;
}
.zoom-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f5f5f5;
  border: 2px solid rgba(0,0,0,0.35);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  cursor: pointer;
}
.zoom-tip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 3;
}
.zoom-tip-toggle {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  font-weight: 800;
  line-height: 1;
  background: rgba(255,255,255,0.08) !important;
  color: #f5f5f5 !important;
  border: 1px solid rgba(255,255,255,0.15);
  font-size: 11px;
  box-shadow:
    0 2px 6px rgba(0,0,0,0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.zoom-tip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  min-width: 220px;
  max-width: 240px;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(20,20,20,0.95);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: #f5f5f5;
  font-size: 12px;
  line-height: 1.3;
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
  z-index: 2;
}
.zoom-tip-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.zoom-tip-text span {
  position: relative;
  padding-left: 12px;
}
.zoom-tip-text span::before {
  content: ".";
  position: absolute;
  left: 0;
  top: 0;
}
.zoom-tip.is-open { display: flex; }

@media (max-width: 720px) {
  .zoom-hud {
    left: 8px;
    right: 8px;
    bottom: env(safe-area-inset-bottom, 0px);
    padding: 10px 12px 12px;
    min-height: 60px;
    gap: 4px;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    border-radius: 10px 10px 0 0;
  }
  .zoom-row {
    display: contents;
  }
  .zoom-hud button {
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 7px;
    line-height: 1;
  }
  .zoom-hud .zoom-label {
    min-width: 56px;
    font-size: 13px;
  }
  .zoom-slider {
    width: 140px;
    height: 8px;
  }
  .zoom-slider::-webkit-slider-thumb,
  .zoom-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
  }
  .zoom-tip-toggle {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }
  .zoom-tip {
    min-width: 200px;
    max-width: 220px;
    font-size: 11px;
  }
}

.is-ipad .zoom-hud {
  padding: 10px 12px;
  gap: 8px;
}
.is-ipad .zoom-hud button {
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 8px;
}
.is-ipad .zoom-hud .zoom-label {
  min-width: 72px;
  font-size: 16px;
}
.is-ipad .zoom-slider {
  width: 160px;
  height: 8px;
}
.is-ipad .zoom-slider::-webkit-slider-thumb,
.is-ipad .zoom-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
}
.is-ipad .zoom-tip-toggle {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

/* Horizontal scrollbar indicator */
.h-scrollbar {
  position: fixed;
  left: 16px;
  right: 140px; /* leave room for zoom HUD */
  bottom: 12px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(4px) saturate(120%);
  z-index: 111;
  pointer-events: auto;
}
.h-scrollbar .h-thumb {
  height: 100%;
  width: 60px;
  border-radius: inherit;
  background: rgba(255,255,255,0.35);
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transform: translateX(0);
  transition: width .12s ease;
}

/* Breadcrumbs */
.breadcrumbs {
    margin-top: 6px;
    color: #aaa;
    font-size: 12px;
}

/* Creative breadcrumb next to avatar */
.breadcrumbs-left {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #bdbdbd;
    font-size: 13px;
}
.breadcrumbs-left .crumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.breadcrumbs-left .crumb a {
    color: inherit;
    text-decoration: none;
}
.breadcrumbs-left .crumb a:hover { color: #ffffff; text-decoration: underline; }
.breadcrumbs-left .sep { opacity: 0.6; }
.breadcrumbs-left .fa-folder { color: #ffd166; }

.text-item .text-controls {
    display: none;
    position: absolute;
    top: -30px;
    left: 0;
    background-color: #333;
    padding: 5px;
    border-radius: 4px;
}

.text-item:hover .text-controls {
    display: flex;
    gap: 5px;
}

.text-controls input[type="color"],
.text-controls select {
    background-color: #444;
    border: none;
    border-radius: 2px;
    color: #f5f5f5;
}

/* Version Management Styles */
.version-controls {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 10px;
}

.version-list {
    max-height: 400px;
    overflow-y: auto;
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.02);
}

.version-item:hover {
    background: rgba(255,255,255,0.05);
}

.version-info {
    flex: 1;
}

.version-name {
    font-weight: 500;
    color: #f5f5f5;
    margin-bottom: 4px;
}

.version-timestamp {
    font-size: 12px;
    color: #aaa;
}

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

.version-restore {
    background: rgba(100, 149, 237, 0.2);
    color: #7cc7ff;
    border: 1px solid rgba(100, 149, 237, 0.3);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.version-restore:hover {
    background: rgba(100, 149, 237, 0.3);
    border-color: rgba(100, 149, 237, 0.5);
}

.version-delete {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b7d;
    border: 1px solid rgba(220, 53, 69, 0.3);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.version-delete:hover {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.5);
}

/* ——— Fund Me (PayPal) fancy widget ——— */
/* Make embed container transparent for Fund Me so card styling shines */
.embedded-item.fundme-embed { background: transparent; border-color: transparent; box-shadow: none; }
/* Keep the wide drag bar hidden to preserve clean look */
.embedded-item.fundme-embed .embed-drag-bar { display: none; }
/* Show a small draggable handle so the card can be moved */
.embedded-item.fundme-embed .embed-drag-handle {
  display: block;
  position: absolute;
  top: 6px;
  left: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  cursor: move;
  z-index: 3;
}
/* Subtle hover to hint draggability */
.embedded-item.fundme-embed .embed-drag-handle:hover { background: rgba(255,255,255,0.28); }

.fundme-widget.fancy .fundme-card {
  background: radial-gradient(120% 120% at 0% 0%, rgba(124, 58, 237, 0.18) 0%, rgba(20, 24, 32, 0.65) 45%, rgba(15, 18, 26, 0.85) 100%);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
}

.fundme-widget .donut {
  position: relative;
  box-shadow: 0 4px 16px rgba(91, 183, 126, 0.25), inset 0 0 0 4px rgba(0,0,0,0.35);
}
.fundme-widget .donut-hole {
  box-shadow: inset 0 0 8px rgba(0,0,0,0.6);
}
.fundme-widget .donut-label {
  color: #bfe9c5;
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
}

.fundme-widget .fundme-amount-input {
  background: rgba(9,11,15,0.9);
  border: 1px solid rgba(255,255,255,0.12);
  color: #e8eef7;
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.fundme-widget .fundme-amount-input:focus {
  border-color: #7bd88f;
  box-shadow: 0 0 0 3px rgba(123,216,143,0.20);
}

.fundme-widget .fundme-amounts button {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #e9eef5;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
}
.fundme-widget .fundme-amounts button:hover {
  background: rgba(255,255,255,0.12);
}

.fundme-widget .paypal-buttons iframe { border-radius: 8px; }

/* Big visible fallback donate button (when SDK cannot load) */
.fundme-widget .ui-donate-fallback {
  background: linear-gradient(180deg,#f8fafc,#e2e8f0);
  color: #0f172a;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-family: 'Alegreya', serif;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.fundme-widget .ui-donate-fallback:hover { filter: brightness(0.98); }
