:root {
    /* Paleta por defecto: fondo cálido rosado, header en amarillo anaranjado, botones en azul oscuro */
    --cs-theme-color: #c06d75;
    --cs-accent-color: #2621c5;
    --cs-button-text-color: #1d252b;
    --cs-text-color: #322129;
    --cs-bg-color: #ecaab8;
    --cs-global-bg-image: none;

    /* Z-index scale */
    --z-base: 1;
    --z-overlay: 50;
    --z-dropdown: 100;
    --z-tooltip: 200;
    --z-editor-maximized: 500;
    --z-editor-toolbar: 510;
    --z-editor-tools: 520;
    --z-editor-orientation: 530;
    --z-modal: 600;
    --z-chat-widget-backdrop: 700;
    --z-chat-widget-panel: 710;
    --z-chat-widget: 720;
}

/* Utility classes (replacing inline styles) */

.u-text-center { text-align: center; }
.u-mt-4 { margin-top: 4px; }
.u-mt-8 { margin-top: 8px; }
.u-mt-12 { margin-top: 12px; }
.u-mt-24 { margin-top: 24px; }
.u-mt-32 { margin-top: 32px; }
.u-mb-4 { margin-bottom: 4px; }
.u-hidden { display: none; }
.u-gap-8 { gap: 8px; }
.u-flex-center { display: flex; justify-content: center; flex-wrap: wrap; }

.u-text-secondary { font-size: 0.875rem; color: #555; }
.u-text-small { font-size: 0.85rem; }
.u-text-xs { font-size: 0.8125rem; }

.btn-pill { border-radius: 999px; padding: 6px 16px; }
.u-ml-6 { margin-left: 6px; }
.u-ml-4 { margin-left: 4px; }

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
}

body {
    font-family: system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--cs-bg-color, #f0f0f0);
    color: var(--cs-text-color, #333333);
    overflow-x: hidden;
}

body[data-cs-disable-custom-bg="true"] {
    --cs-global-bg-image: none !important;
}

header {
    background-color: var(--cs-theme-color, #ce365a);
    color: white;
    padding: 15px 16px;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 1.4rem;
    text-align: center;
}

header nav {
    margin-top: 6px;
    display: flex;
    justify-content: center;
}

header nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 0;
    margin: 6px 0 0;
}

header nav li {
    margin: 0;
}

.nav-link {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.9rem;
    color: #2b1a10;
    text-decoration: none;
    background-color: rgba(255, 255, 255, 0.85);
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 1);
}

.nav-link-active {
    background-color: #ffffff;
    color: #2b1a10;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    font-weight: 600;
}

.search-container {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

#user-search-form {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    padding: 2px 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    padding: 4px 8px;
    font-size: 0.85rem;
    width: 150px;
    color: #333;
}

.search-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 4px;
    color: #555;
}

.search-button:hover {
    color: #000;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.user-card {
    background-color: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s ease;
}

.user-card:hover {
    transform: translateY(-4px);
}

.user-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-bottom: 12px;
}

.user-info h3 {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
}

.user-stats {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: #666;
}

.follow-btn-small {
    padding: 6px 16px;
    font-size: 0.85rem;
    border-radius: 999px;
    width: 100%;
    max-width: 150px;
}

.user-card-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    margin-top: 4px;
}

.user-card-actions .follow-btn-small {
    flex: 1;
    min-width: 0;
    max-width: none;
}

.container {
    width: min(1120px, calc(100% - 24px));
    margin: 0 auto;
    overflow: visible;
}

h1, h2 {
    color: var(--cs-text-color, #333333);
}

.button {
    background-color: var(--cs-accent-color, #249ba6);
    color: var(--cs-button-text-color, #1d252b);
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    margin: 0;
}

.button:hover {
    filter: brightness(0.92);
}

.button:focus-visible,
.button-secondary:focus-visible,
.post-like-button:focus-visible,
.reaction-button:focus-visible,
.profile-page button:focus-visible,
.meta-right button:focus-visible,
.nav-link:focus-visible,
.search-button:focus-visible,
.notifications-button:focus-visible {
    outline: 3px solid var(--cs-accent-color, #2453a6);
    outline-offset: 2px;
}

.button-secondary {
    background-color: rgba(255, 255, 255, 0.92);
    color: #2b1a10;
}

.button-secondary:hover {
    filter: brightness(0.92);
}

.button-compact {
    padding: 6px 10px;
    font-size: 0.82rem;
    line-height: 1.1;
}

.button-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.button-share-icon {
    font-size: 0.95em;
    line-height: 1;
}

.share-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    transform: translate(-50%, -115%);
    background: rgba(26, 26, 26, 0.94);
    color: #ffffff;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    line-height: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s ease-out;
    z-index: var(--z-tooltip, 200);
}

.share-tooltip.is-visible {
    opacity: 1;
}

.button.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.button.is-loading::after,
.post-like-button.is-loading::after,
.reaction-button.is-loading::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: button-loading-spinner 0.6s linear infinite;
}

.post-like-button.is-loading,
.reaction-button.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.post-like-button.is-loading::after,
.reaction-button.is-loading::after {
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #2b1a10;
}

.button-secondary.is-loading::after {
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #2b1a10;
}

@keyframes button-loading-spinner {
    to {
        transform: rotate(360deg);
    }
}

.footer {
    text-align: center;
    padding: 10px;
    background-color: var(--cs-theme-color, #ce365a);
    color: white;
    position: relative;
    bottom: 0;
    width: 100%;
}

.footer-logout {
    margin: 6px 0 0;
}

.footer .logout-button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 14px;
    cursor: pointer;
    border-radius: 999px;
    font-size: 0.78rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.footer .logout-button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Editor & profile status messages */

.editor-status {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #555;
}

.auth-copy {
    font-size: 0.95rem;
    color: #444;
    margin: 6px 0 12px;
}

/* Responsive layout tweaks for small screens */

@media (max-width: 768px) {
    header {
        padding: 10px 8px;
    }

    header h1 {
        font-size: 1.2rem;
    }

    .container {
        width: min(100%, calc(100% - 16px));
        padding: 0;
    }

    #hero {
        padding: 16px 14px;
    }

    #hero h2 {
        font-size: 1.3rem;
    }

    .hero-summary {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
        padding: 8px;
    }

    .hero-actions .button {
        width: 100%;
        text-align: center;
    }

    #feed {
        padding: 12px 12px 14px;
        margin-top: 18px;
    }

    #feed h2 {
        font-size: 1.12rem;
    }

    #posts-container,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-page {
        padding: 16px 0 32px;
    }

    .profile-edit-panel,
    .profile-legend {
        margin-left: 0;
        margin-right: 0;
    }

    form button.button {
        width: 100%;
    }
}

/* Home page hero and feed */

#hero {
    margin: 20px 0;
    padding: 22px 22px 20px;
    background: linear-gradient(135deg, rgba(253, 168, 49, 0.18), rgba(255, 255, 255, 0.98));
    border-radius: 14px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(253, 168, 49, 0.22);
    position: relative;
    overflow: hidden;
}

#hero::after {
    content: "";
    position: absolute;
    right: -36px;
    top: -36px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.9), rgba(253, 168, 49, 0.18));
    pointer-events: none;
}

#hero h2,
#hero .hero-summary,
#hero .hero-actions {
    position: relative;
    z-index: 1;
}

#hero h2 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1.2;
}

.hero-steps {
    margin: 10px 0 16px;
    padding-left: 20px;
    font-size: 0.95rem;
    color: #444444;
}

.hero-summary {
    margin: 10px 0 16px;
    font-size: 1rem;
    color: #444444;
    max-width: 580px;
}

.hero-daily-word {
    margin: 6px 0 0;
    font-size: 0.92rem;
    color: var(--cs-accent-color, #2453a6);
    font-weight: 600;
}

.hero-steps li {
    margin-bottom: 6px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.hero-actions .button {
    margin: 0;
    flex: 1 1 180px;
    min-height: 42px;
    border-radius: 999px;
}

#hero-create-button {
    font-weight: 700;
    box-shadow: 0 6px 12px rgba(36, 83, 166, 0.22);
}

#hero-create-button:hover {
    transform: translateY(-1px);
}

#feed {
    margin: 22px 0 40px;
    padding: 16px 16px 18px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#feed h2 {
    margin: 0 0 10px;
    font-size: 1.22rem;
}

.feed-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.feed-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.feed-status {
    margin: 10px 0;
    color: #666666;
}

#posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 280px));
    justify-content: center;
    gap: 16px;
}

.post-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: grid;
    gap: 0;
}

.post-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    object-position: center;
    background-color: #f9f9f9;
}

.post-image-wrap {
    position: relative;
}

.post-image-sensitive {
    filter: blur(22px) saturate(0.35) brightness(0.9) contrast(0.9);
    transform: scale(1.08);
}

.post-image-wrap.is-sensitive-hidden .post-image,
.post-card-link:hover .post-image-wrap.is-sensitive-hidden .post-image {
    filter: blur(22px) saturate(0.35) brightness(0.9) contrast(0.9) !important;
    transform: scale(1.08);
}

.post-image-wrap.is-sensitive-visible .post-image {
    filter: none !important;
    transform: none;
}

.post-sensitive-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: linear-gradient(160deg, rgba(253, 168, 49, 0.28), rgba(255, 255, 255, 0.3));
}

.post-sensitive-text {
    margin: 0;
    color: #2b1a10;
    font-size: 0.84rem;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.post-image-wrap.is-sensitive-visible .post-sensitive-text {
    background: rgba(255, 255, 255, 0.78);
    padding: 4px 8px;
    border-radius: 999px;
}

.post-sensitive-toggle {
    margin: 0;
    padding: 6px 10px;
    min-height: auto;
}

.creation-image-sensitive {
    filter: blur(14px) brightness(0.74);
}

.creation-sensitive-toggle {
    margin-top: 10px;
}

.post-meta {
    padding: 10px 12px 12px;
    display: grid;
    gap: 3px;
}

.post-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.post-card-link:hover .post-image {
    filter: brightness(0.97);
}

.post-date {
    margin: 0;
    font-size: 0.85rem;
    color: #666666;
}

.post-author {
    margin: 0;
    font-size: 0.84rem;
    color: #444;
}

.post-title {
    margin: 2px 0 2px;
    font-size: 1rem;
    font-weight: 800;
    color: #222;
    line-height: 1.25;
}

.post-author a {
    color: var(--cs-accent-color, #2453a6);
    text-decoration: none;
}

.post-author a:hover {
    text-decoration: underline;
}

.post-stats {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: #777777;
}

.post-stats-strong {
    font-weight: 600;
    color: #444444;
}

.post-like-button {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px;
    margin-top: 4px;
    font-size: 1.1rem;
    line-height: 1;
    color: #999999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.post-like-button:hover {
    color: var(--cs-accent-color, #2453a6);
    transform: translateY(-1px);
}

.post-like-button.liked {
    color: #ffffff;
    background-color: var(--cs-accent-color, #2453a6);
    border-radius: 999px;
}

/* Profile gallery */

.profile-page {
    padding: 24px 0 40px;
}

.profile-content-layout {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.profile-sidebar {
    position: sticky;
    top: 12px;
    display: grid;
    gap: 10px;
}

.profile-main-content {
    min-width: 0;
}

@media (max-width: 1100px) {
    .profile-content-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .profile-sidebar {
        position: static;
    }
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 280px));
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

.card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 10px 10px 12px;
}

.card img.thumb {
    width: 100%;
    height: 180px;
    object-fit: contain;
    object-position: center;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.card-title {
    margin-top: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.row {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.meta-left {
    font-size: 0.8rem;
    color: #666;
}

.meta-right button {
    font-size: 0.8rem;
    padding: 4px 8px;
}

/* Profile theming and editor */

.profile-page button {
    background-color: var(--cs-accent-color, #2453a6);
    color: var(--cs-button-text-color, #1d252b);
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.profile-page button:hover {
    filter: brightness(0.95);
}

.profile-info {
    margin: 16px auto 0;
    max-width: 960px;
    padding: 0 16px 12px;
    position: relative;
    isolation: isolate;
    border-radius: 14px;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-areas:
        "header header"
        "bio actions"
        "editor editor";
    gap: 18px;
    align-items: start;
}

.profile-info::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: var(--cs-profile-bg-image, none);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

.profile-info.has-custom-background::before {
    opacity: 0.32;
}

.profile-info > * {
    position: relative;
    z-index: 1;
}

.profile-legend {
    max-width: none;
    margin: 0;
    padding: 14px 16px 16px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-size: 0.9rem;
}

.profile-legend ul {
    margin: 8px 0 0;
    padding-left: 20px;
}

.profile-legend li {
    margin-bottom: 4px;
}

.profile-legend-subtitle {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: #444;
}

.profile-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.profile-summary-item {
    padding: 10px 12px;
    border-radius: 10px;
    background-color: #fff;
    border: 1px solid rgba(36, 83, 166, 0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.profile-summary-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
}

.profile-summary-item strong {
    font-size: 0.95rem;
    color: #222;
}

.profile-legend-note {
    margin: 10px 0 0;
    font-size: 0.83rem;
    color: #555;
}

/* Friends list in profile */
.profile-friends-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.profile-friend-chip {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    color: var(--cs-text-color, #333);
    background: var(--cs-accent-color, #e0e0e0);
    opacity: 0.85;
    transition: opacity 0.15s, transform 0.15s;
}

.profile-friend-chip:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.profile-header-visual {
    grid-area: header;
    margin: 0;
    max-width: none;
    height: 160px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0,0,0,0.03), rgba(0,0,0,0.08));
    overflow: hidden;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.profile-header-visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background-color: #ffffff;
    display: block;
}

@media (max-width: 768px) {
    .profile-content-layout {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .profile-sidebar {
        position: static;
    }

    .profile-info {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "bio"
            "actions"
            "editor";
    }

    .profile-view-switch {
        display: flex;
        width: 100%;
        box-sizing: border-box;
    }

    .profile-view-button {
        flex: 1 1 0;
        text-align: center;
    }

    .profile-header-visual {
        height: auto;
        min-height: 120px;
    }

    .profile-header-visual img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .profile-bio-text {
        text-align: center;
    }
}

.profile-bio-text {
    grid-area: bio;
    text-align: left;
    max-width: none;
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.45;
    color: #444;
}

.profile-quick-actions {
    grid-area: actions;
    max-width: none;
    margin: 0;
}

.profile-edit-highlight {
    width: 100%;
    margin: 0;
    padding: 18px 18px;
    background: linear-gradient(135deg, rgba(253, 168, 49, 0.2), rgba(255, 255, 255, 0.98));
    border: 1px solid rgba(253, 168, 49, 0.28);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.profile-edit-kicker {
    margin: 0 0 6px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cs-accent-color, #2453a6);
}

.profile-edit-highlight h2 {
    margin: 0 0 8px;
    font-size: 1.4rem;
    line-height: 1.2;
}

.profile-edit-summary {
    margin: 0 0 12px;
    color: #3f3f3f;
    line-height: 1.4;
}

.profile-edit-benefits {
    margin: 0 0 12px;
    padding-left: 20px;
    display: grid;
    gap: 4px;
}

.profile-edit-benefits li {
    font-size: 0.92rem;
}

.profile-edit-cta {
    min-height: 48px;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 6px 14px rgba(36, 83, 166, 0.24);
}

.profile-empty-cta {
    margin-top: 10px;
}

.profile-view-switch {
    margin: 0;
    width: 100%;
    max-width: none;
    display: grid;
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
    background-color: rgba(36, 83, 166, 0.1);
    grid-column: 1 / -1;
}

.profile-view-button {
    border: none;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    background-color: transparent;
    color: #2b1a10;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.profile-view-button.is-active {
    background-color: var(--cs-accent-color, #2453a6);
    color: #ffffff;
}

.profile-view-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 0.78rem;
    line-height: 1;
    background-color: rgba(36, 83, 166, 0.14);
    color: #1d3f7a;
}

.profile-view-button.is-active .profile-view-count {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.profile-edit-panel {
    max-width: none;
    margin: 0 0 24px;
    padding: 16px 18px 18px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    font-size: 0.9rem;
    grid-area: editor;
}

.profile-edit-panel h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.08rem;
}

.profile-edit-panel label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
}

.profile-edit-panel textarea {
    width: 100%;
    min-height: 78px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

.profile-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 10px 0 14px;
}

.profile-colors label {
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    font-weight: 600;
}

.profile-colors input[type="color"] {
    margin-top: 4px;
    width: 48px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
}

.profile-header-editor {
    margin: 10px 0 14px;
}

#profile-header-canvas {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    cursor: crosshair;
    display: block;
}

#profile-bg-drawing-canvas {
    width: 100%;
    max-width: 100%;
    border-radius: 8px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    cursor: crosshair;
    display: block;
}

.profile-header-tools {
    margin-top: 8px;
    display: flex;
    gap: 10px;
}

.profile-header-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 8px;
}

.profile-auth-required-overlay {
    position: fixed;
    top: 82px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: var(--z-overlay, 50);
    margin: 0;
    border-radius: 16px;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: var(--cs-bg-color, #fff5f7);
    background-image: linear-gradient(135deg, rgba(253, 168, 49, 1), rgba(255, 255, 255, 1));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(253, 168, 49, 0.22);
}

.profile-auth-required-overlay h2 {
    margin: 0 0 10px;
    font-size: 1.5rem;
}

.profile-auth-required-overlay p {
    margin: 0;
    max-width: 680px;
    font-size: 1.05rem;
}

@media (max-width: 768px) {
    .profile-auth-required-overlay {
        top: 70px;
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 18px 14px;
    }

    .profile-auth-required-overlay h2 {
        font-size: 1.28rem;
    }

    .profile-auth-required-overlay p {
        font-size: 0.98rem;
    }
}

/* Daily event */

.event-page {
    padding-bottom: 40px;
    margin-left: auto;
    margin-right: auto;
}

.event-page .event-hero,
.event-page .event-gallery,
.event-page .event-history {
    margin-left: auto;
    margin-right: auto;
}

.event-hero {
    margin: 20px 0;
    padding: 18px 20px 16px;
    background: linear-gradient(135deg, rgba(253, 168, 49, 0.16), rgba(255, 255, 255, 0.95));
    border-radius: 16px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
}

.event-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.9), rgba(253, 168, 49, 0.18));
    opacity: 0.9;
    pointer-events: none;
}

.event-hero-main {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr);
    gap: 20px;
    align-items: center;
}

.event-hero-copy h2 {
    margin: 0 0 6px;
    font-size: 1.55rem;
    line-height: 1.15;
}

.event-prompt-hint {
    margin: 6px 0 0;
    font-size: 0.84rem;
    color: #7a6a5a;
    font-style: italic;
}

.event-prompt-card {
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(206, 54, 90, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 1px 4px rgba(0, 0, 0, 0.08);
}

.event-prompt {
    font-size: 1.02rem;
    margin: 0;
    font-weight: 600;
    display: grid;
    gap: 2px;
}

.event-prompt-date {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b4a56;
}

.event-hero-visual {
    position: relative;
    justify-self: center;
    width: 200px;
    height: 160px;
    transform: rotate(-2deg);
}

.event-hero-badge-button {
    appearance: none;
    border: none;
    background: transparent;
    padding: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    position: relative;
}

.event-hero-badge-button:hover .event-hero-badge,
.event-hero-badge-button:focus-visible .event-hero-badge {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
}

.event-hero-badge-button:focus-visible {
    outline: 3px solid rgba(36, 155, 166, 0.55);
    outline-offset: 3px;
    border-radius: 18px;
}

.event-hero-badge {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    transition: transform 0.14s ease-out, box-shadow 0.14s ease-out;
}

.event-hero-emoji {
    font-size: 2.2rem;
    margin-bottom: 6px;
    animation: badge-pulse 2.5s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.event-hero-text {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.event-hero-scribble {
    position: absolute;
    inset: 14px;
    border-radius: 14px;
    border: 2px dashed rgba(36, 83, 166, 0.3);
    pointer-events: none;
}

.daily-admin-tools {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}

.daily-admin-tools .button {
    margin: 0;
}

.event-gallery {
    margin-top: 24px;
}

#event-grid.profile-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 280px));
    justify-content: center;
}

.event-card {
    position: relative;
    border-radius: 12px;
    border: 2px solid rgba(36, 83, 166, 0.22);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
    overflow: hidden;
    background: linear-gradient(145deg, rgba(253, 168, 49, 0.06), #ffffff);
    padding: 0 0 4px;
}

.event-card-clickable {
    cursor: pointer;
}

.event-card-clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

.event-card-clickable:focus-visible {
    outline: 3px solid var(--cs-accent-color, #2453a6);
    outline-offset: 2px;
}

.event-card .post-image-wrap {
    margin: 0;
    border-radius: 0;
}

.event-card .thumb {
    width: 100%;
    height: 200px;
    object-fit: contain;
    object-position: center;
    background-color: #f9f9f9;
    border-radius: 0;
    display: block;
}

.event-card .event-title,
.event-card .event-identity,
.event-card .event-meta-row {
    padding-left: 10px;
    padding-right: 10px;
}

.event-card::before {
    content: "Evento diario";
    position: absolute;
    top: 8px;
    left: -4px;
    padding: 4px 10px;
    background: var(--cs-accent-color, #2453a6);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 0 999px 999px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.event-meta-row {
    align-items: flex-end;
}

.event-identity {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #555;
}

.event-identity a {
    color: var(--cs-accent-color, #2453a6);
    text-decoration: none;
}

.event-identity a:hover {
    text-decoration: underline;
}

.event-title {
    margin-top: 9px;
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.25;
}

.event-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    padding-left: 8px;
}

.reaction-button {
    border: none;
    background: #f3f4ff;
    color: #333;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out, background-color 0.1s ease-out;
}

.reaction-button .reaction-emoji {
    font-size: 1.05rem;
}

.reaction-button .reaction-count {
    min-width: 1.2em;
    text-align: center;
}

.reaction-button.reacted {
    background-color: var(--cs-accent-color, #2453a6);
    color: var(--cs-button-text-color, #1d252b);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

.reaction-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
}

@media (max-width: 768px) {
    .event-hero {
        padding: 16px 14px 14px;
    }

    .event-hero-main {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .event-hero-copy h2 {
        font-size: 1.34rem;
    }

    .event-hero-visual {
        width: 170px;
        height: 130px;
    }

    #event-grid.profile-grid {
        grid-template-columns: 1fr;
    }
}

/* Creation detail and comments */

.creation-image-wrap {
    margin: 20px 0 12px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 12px;
}

#creation-image {
    width: 100%;
    max-height: 480px;
    object-fit: contain;
    display: block;
    background-color: #f9f9f9;
}

.creation-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 24px;
}

.creation-author {
    margin: 0;
    font-size: 0.95rem;
}

.creation-title {
    width: 100%;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.25;
}

.creation-nickname {
    margin: 0;
    font-size: 0.9rem;
    color: #4a4a4a;
}

.profile-username {
    text-align: center;
    margin: 6px 0 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2b1a10;
}

.creation-date {
    margin: 0;
    font-size: 0.85rem;
    color: #666;
}

.likes-count {
    font-size: 0.9rem;
    color: #444;
}

.creation-activity-summary {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: #555;
}

/* Notifications dropdown */

.notifications-button {
    margin-left: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.2rem;
    position: relative;
    padding: 4px 6px;
    border-radius: 50%;
    transition: background-color 0.15s ease;
}

.notifications-button:hover {
    background-color: rgba(0, 0, 0, 0.06);
}

.notifications-button.has-new {
    animation: notif-bell-shake 3s ease-in-out infinite;
}

.notifications-button.has-new::after {
    content: attr(data-count);
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background-color: #e53935;
    border: 2px solid white;
    color: white;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    padding: 0 4px;
    box-shadow: 0 0 8px rgba(229, 57, 53, 0.5);
    animation: notif-pulse 2s ease-in-out infinite;
}

@keyframes notif-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 4px rgba(229,57,53,0.4); }
    50% { transform: scale(1.15); box-shadow: 0 0 12px rgba(229,57,53,0.7); }
}

@keyframes notif-bell-shake {
    0%, 90%, 100% { transform: rotate(0deg); }
    92% { transform: rotate(12deg); }
    94% { transform: rotate(-10deg); }
    96% { transform: rotate(8deg); }
    98% { transform: rotate(-6deg); }
}

.notifications-panel {
    position: absolute;
    right: 0;
    margin-top: 8px;
    min-width: 300px;
    max-width: 380px;
    max-height: 400px;
    overflow-y: auto;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 6px 0;
    z-index: var(--z-dropdown, 100);
    font-size: 0.88rem;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.12s ease;
    border-left: 3px solid transparent;
}

.notification-item:hover {
    background-color: #f4f0ff;
}

.notification-unread {
    background-color: #f0f4ff;
    border-left-color: var(--cs-accent-color, #2453a6);
}

.notification-unread:hover {
    background-color: #e6ecff;
}

.notification-icon {
    flex-shrink: 0;
    font-size: 1.3rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f3ff;
    border-radius: 50%;
}

.notification-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-text {
    line-height: 1.35;
}

.notification-text strong {
    color: var(--cs-accent-color, #2453a6);
}

.notification-time {
    font-size: 0.78rem;
    color: #999;
}

.comments-section {
    margin-bottom: 40px;
}

.comments-section h2 {
    margin-top: 0;
}

.comment-item {
    background-color: #ffffff;
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.8rem;
    color: #666;
}

.comment-author a {
    color: var(--cs-accent-color, #2453a6);
    text-decoration: none;
}

.comment-author a:hover {
    text-decoration: underline;
}

.comment-body {
    margin: 4px 0 0;
    font-size: 0.9rem;
}

.comment-form-wrap textarea {
    width: 100%;
    resize: vertical;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-family: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.comment-form-wrap button.button {
    margin-top: 6px;
}

/* Daily event history */

.event-history {
    margin-top: 32px;
}

.event-history-intro {
    font-size: 0.9rem;
    color: #555;
    margin: 4px 0 10px;
}

.event-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.event-history-day {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 6px 10px 10px;
}

.event-history-day[open] {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.event-history-summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.event-history-summary::marker {
    color: #444;
}

.event-history-entries {
    margin-top: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 180px));
    justify-content: center;
    gap: 8px;
}

.event-history-entries .event-card .thumb {
    height: 130px;
}

.event-history-entries .event-card .event-title,
.event-history-entries .event-card .event-identity,
.event-history-entries .event-card .event-meta-row {
    padding-left: 8px;
    padding-right: 8px;
}

@media (max-width: 768px) {
    .event-history-day {
        padding: 6px 8px 10px;
    }

    .event-history-summary {
        font-size: 0.9rem;
    }

    .post-meta {
        padding: 10px 10px 12px;
        gap: 4px;
    }

    .card {
        padding: 10px 10px 12px;
    }

    .event-card {
        padding-bottom: 4px;
    }

    .event-history-entries {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .post-title,
    .event-title {
        font-size: 1rem;
        line-height: 1.3;
    }

    .post-author,
    .post-date,
    .event-identity {
        font-size: 0.86rem;
    }

    .creation-meta {
        display: grid;
        gap: 7px;
        align-items: start;
    }

    .creation-title {
        font-size: 1.08rem;
        line-height: 1.3;
    }

    .creation-nickname,
    .creation-author,
    .creation-date,
    .likes-count,
    .creation-activity-summary,
    .profile-username {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .post-meta {
        padding: 9px 9px 11px;
        gap: 4px;
    }

    .card {
        padding: 9px 9px 11px;
    }

    .post-title,
    .event-title {
        font-size: 0.98rem;
    }

    .post-author,
    .post-date,
    .event-identity {
        font-size: 0.84rem;
    }

    .creation-title {
        font-size: 1rem;
    }
}

/* Playful style pass (infantil amable, más limpio) */

body {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)),
        var(--cs-global-bg-image, none),
        radial-gradient(circle at 14% 18%, rgba(253, 168, 49, 0.12), transparent 35%),
        radial-gradient(circle at 86% 10%, rgba(36, 83, 166, 0.09), transparent 32%),
        radial-gradient(circle at 80% 88%, rgba(253, 168, 49, 0.1), transparent 30%);
    background-attachment: fixed;
    background-size: cover, cover, auto, auto, auto;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
    background-position: center, center, center, center, center;
}

header {
    border-bottom: 3px dashed rgba(255, 255, 255, 0.65);
}

header h1 {
    letter-spacing: 0.01em;
}

.nav-link {
    position: relative;
    isolation: isolate;
    border: 1px solid rgba(43, 26, 16, 0.2);
    background: #ffe7a9;
    color: #2b1a10;
    clip-path: polygon(2% 26%, 10% 10%, 22% 9%, 34% 13%, 46% 9%, 59% 11%, 72% 14%, 85% 12%, 96% 20%, 97% 74%, 90% 90%, 77% 94%, 61% 91%, 45% 94%, 29% 92%, 15% 94%, 4% 82%);
    box-shadow: 0 2px 0 rgba(43, 26, 16, 0.14), 0 3px 9px rgba(0, 0, 0, 0.09);
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}

.nav-link::before {
    content: "";
    position: absolute;
    inset: auto 6% 2px 6%;
    height: 5px;
    background: repeating-linear-gradient(90deg, rgba(43, 26, 16, 0.14) 0 2px, rgba(43, 26, 16, 0) 2px 5px);
    opacity: 0.14;
    z-index: -1;
}

.nav-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 0 rgba(43, 26, 16, 0.14), 0 5px 11px rgba(0, 0, 0, 0.12);
}

.nav-link-active {
    background: #ffd56f;
    color: #2b1a10;
    border-color: rgba(43, 26, 16, 0.28);
    box-shadow: 0 3px 0 rgba(43, 26, 16, 0.2), 0 4px 10px rgba(0, 0, 0, 0.14);
}

#hero,
#feed,
.profile-legend,
.profile-edit-panel,
.event-hero,
.event-history-day,
.creation-image-wrap,
.comments-section {
    border-radius: 16px;
}

.button {
    border-radius: 999px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.16);
    transition: transform 0.12s ease-out, filter 0.12s ease-out;
}

.button:hover {
    transform: translateY(-1px);
}

.button,
.profile-page button,
.meta-right button,
.reaction-button,
.post-like-button {
    --brush-shape-1: polygon(3% 24%, 11% 11%, 23% 10%, 36% 13%, 50% 9%, 63% 11%, 76% 14%, 88% 12%, 97% 20%, 98% 74%, 90% 90%, 77% 93%, 61% 91%, 45% 93%, 30% 92%, 17% 93%, 5% 82%);
    --brush-shape-2: polygon(4% 28%, 12% 12%, 25% 8%, 38% 14%, 52% 10%, 66% 13%, 79% 9%, 90% 15%, 97% 24%, 97% 72%, 89% 88%, 76% 94%, 62% 90%, 47% 94%, 33% 90%, 19% 94%, 7% 84%);
    --brush-shape-3: polygon(2% 22%, 9% 9%, 21% 12%, 34% 8%, 48% 13%, 60% 9%, 73% 13%, 86% 10%, 96% 19%, 98% 76%, 91% 92%, 79% 89%, 64% 94%, 49% 90%, 35% 94%, 21% 89%, 6% 86%);
    clip-path: var(--brush-shape, var(--brush-shape-1));
    border-radius: 14px;
    border: 1px solid rgba(43, 26, 16, 0.2);
}

.hero-actions .button:nth-child(3n + 2),
.buttons button:nth-child(3n + 2),
.meta-right button:nth-child(3n + 2),
.profile-page button:nth-child(3n + 2),
.event-reactions .reaction-button:nth-child(3n + 2) {
    --brush-shape: var(--brush-shape-2);
}

.hero-actions .button:nth-child(3n),
.buttons button:nth-child(3n),
.meta-right button:nth-child(3n),
.profile-page button:nth-child(3n),
.event-reactions .reaction-button:nth-child(3n) {
    --brush-shape: var(--brush-shape-3);
}

.button,
.profile-page button,
.meta-right button {
    background-color: var(--cs-accent-color, #2453a6);
    color: var(--cs-button-text-color, #1d252b);
}

.reaction-button,
.post-like-button {
    background-color: #ffe7a9;
    color: #2b1a10;
    box-shadow: 0 2px 0 rgba(43, 26, 16, 0.12), 0 2px 6px rgba(0, 0, 0, 0.12);
}

.post-like-button {
    padding: 5px 9px;
    min-width: 34px;
    min-height: 30px;
}

.post-like-button:hover,
.reaction-button:hover,
.meta-right button:hover,
.profile-page button:hover,
.button:hover {
    transform: translateY(-1px);
}

.post-like-button.liked,
.reaction-button.reacted {
    background-color: var(--cs-accent-color, #2453a6);
    color: var(--cs-button-text-color, #1d252b);
    border-color: rgba(24, 56, 115, 0.7);
}

#posts-container .post-card,
.profile-grid .card,
.event-card {
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}

#posts-container .post-card:hover,
.profile-grid .card:hover,
.event-card:hover {
    transform: translateY(-2px);
}

.post-title,
.event-title,
.creation-title {
    letter-spacing: 0.01em;
}

@media (max-width: 768px) {
    .nav-link {
        clip-path: polygon(4% 24%, 11% 12%, 24% 11%, 36% 14%, 49% 10%, 62% 12%, 74% 14%, 87% 12%, 96% 20%, 97% 74%, 89% 90%, 76% 93%, 61% 91%, 45% 93%, 30% 92%, 17% 93%, 5% 82%);
        border-radius: 14px;
    }

    #hero,
    #feed,
    .profile-legend,
    .profile-edit-panel,
    .event-hero,
    .event-history-day,
    .creation-image-wrap,
    .comments-section {
        border-radius: 14px;
    }

    /* Mobile personalization: keep custom global background visible behind content */
    body {
        background-attachment: scroll;
        background-size: cover, cover, auto, auto, auto;
    }

    #feed,
    .profile-legend,
    .profile-edit-panel,
    .event-hero,
    .event-history-day,
    .creation-image-wrap,
    .comments-section,
    .post-card,
    .card,
    .user-card,
    .profile-summary-item,
    .event-prompt-card,
    #user-search-form,
    #hero,
    .profile-edit-highlight,
    .profile-auth-required-overlay {
        background-color: rgba(255, 255, 255, 0.84);
        border: 1px solid rgba(36, 83, 166, 0.35);
    }

    body.has-custom-drawing-theme #feed,
    body.has-custom-drawing-theme .profile-legend,
    body.has-custom-drawing-theme .profile-edit-panel,
    body.has-custom-drawing-theme .event-hero,
    body.has-custom-drawing-theme .event-history-day,
    body.has-custom-drawing-theme .creation-image-wrap,
    body.has-custom-drawing-theme .comments-section,
    body.has-custom-drawing-theme .post-card,
    body.has-custom-drawing-theme .card,
    body.has-custom-drawing-theme .user-card,
    body.has-custom-drawing-theme .profile-summary-item,
    body.has-custom-drawing-theme .event-prompt-card,
    body.has-custom-drawing-theme #user-search-form,
    body.has-custom-drawing-theme #hero,
    body.has-custom-drawing-theme .profile-edit-highlight,
    body.has-custom-drawing-theme .profile-auth-required-overlay {
        background-image:
            linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.8)),
            var(--cs-global-bg-image, none);
        background-size: cover, cover;
        background-position: center, center;
        background-repeat: no-repeat, no-repeat;
    }

    .post-card,
    .card,
    .profile-legend,
    .profile-edit-panel,
    .event-history-day {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
    }

    .post-title,
    .event-title,
    .profile-summary-item strong,
    .profile-edit-highlight h2 {
        color: var(--cs-accent-color, #2453a6);
    }

    .button,
    .profile-page button {
        border: 1px solid rgba(25, 52, 99, 0.65);
    }
}

.profile-header-controls select {
    margin-top: 4px;
    min-height: 32px;
    border-radius: 6px;
    border: 1px solid #cfcfcf;
    padding: 4px 8px;
    font-size: 0.85rem;
    background-color: #ffffff;
    color: #333;
}

/* Chat */

.chat-page {
    margin: 20px auto 40px;
}

.chat-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.chat-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.chat-topbar select {
    min-width: 220px;
    padding: 6px 8px;
}

.chat-messages {
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    background: #fafafa;
    padding: 12px;
    min-height: 240px;
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-bubble {
    max-width: min(80%, 560px);
    padding: 8px 10px;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.chat-bubble.is-me {
    align-self: flex-end;
    background: rgba(36, 83, 166, 0.12);
}

.chat-bubble.is-them {
    align-self: flex-start;
    background: #ffffff;
}

.chat-text {
    margin: 0;
    white-space: pre-wrap;
}

.chat-time {
    display: block;
    margin-top: 6px;
    opacity: 0.65;
    font-size: 0.78rem;
}

.chat-drawing-image {
    display: block;
    width: 100%;
    max-width: 340px;
    border-radius: 8px;
    border: 1px solid #dcdcdc;
    margin-top: 6px;
    background: #fff;
}

.chat-compose {
    margin-top: 12px;
}

.chat-compose textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    margin-top: 4px;
}

.chat-compose-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chat-drawing-card {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #ececec;
}

.chat-drawing-card h2 {
    margin: 0 0 6px;
    font-size: 1.06rem;
}

.chat-drawing-tools {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 8px 0;
}

.chat-drawing-tools button {
    padding: 8px 12px;
}

#chat-draw-canvas {
    width: 100%;
    max-width: 520px;
    height: auto;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #ffffff;
    touch-action: none;
    display: block;
}

@media (max-width: 768px) {
    .chat-card {
        padding: 10px;
    }

    .chat-bubble {
        max-width: 94%;
    }
}

.profile-friend-chip-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.profile-friend-chat-link {
    font-size: 0.78rem;
    color: #2453a6;
    text-decoration: none;
    background: rgba(36, 83, 166, 0.12);
    border-radius: 999px;
    padding: 3px 8px;
}

.profile-friend-chat-link:hover {
    background: rgba(36, 83, 166, 0.2);
}

/* Floating chat widget */

.chat-widget-root {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: var(--z-chat-widget, 720);
}

body.chat-widget-open {
    overflow: hidden;
}

.chat-widget-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    z-index: var(--z-chat-widget-backdrop, 700);
}

.chat-widget-toggle {
    border: none;
    border-radius: 999px;
    padding: 13px 18px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--cs-accent-color, #2453a6);
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.chat-widget-root.is-open .chat-widget-toggle {
    opacity: 0;
    pointer-events: none;
}

.chat-widget-panel {
    position: fixed;
    right: 14px;
    bottom: 72px;
    width: min(92vw, 390px);
    height: min(78vh, 700px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
    padding: 10px;
    z-index: var(--z-chat-widget-panel, 710);
    overflow: hidden;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
}

.chat-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.chat-widget-header h2 {
    margin: 0;
    font-size: 1rem;
}

.chat-widget-close {
    border: none;
    background: #efefef;
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
}

.chat-widget-friends-head {
    margin: 6px 0 8px;
}

.chat-widget-friends-view,
.chat-widget-conversation-view {
    flex: 1;
    min-height: 0;
}

.chat-widget-backdrop[hidden],
.chat-widget-panel[hidden],
.chat-widget-friends-view[hidden],
.chat-widget-conversation-view[hidden] {
    display: none !important;
}

.chat-widget-conversation-view {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-widget-friends-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    overflow-y: auto;
}

.chat-widget-friend-item {
    border: 1px solid #e0e0e0;
    border-radius: 9px;
    background: #fff;
    text-align: left;
    padding: 10px 12px;
    cursor: pointer;
}

.chat-widget-friend-item:hover {
    background: #f8f8f8;
}

.chat-widget-friend-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-widget-friend-preview {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 0.78rem;
    text-align: left;
}

.chat-widget-unread-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2f6dfd;
    flex: 0 0 auto;
}

.chat-widget-back {
    border: none;
    background: #f1f1f1;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
}

.chat-widget-active-friend {
    font-size: 0.9rem;
    margin: 8px 0;
    color: #444;
}

.chat-widget-messages {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    min-height: 140px;
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-widget-bubble {
    max-width: 84%;
    padding: 7px 8px;
    border-radius: 9px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.chat-widget-bubble.is-me {
    align-self: flex-end;
    background: rgba(36, 83, 166, 0.12);
}

.chat-widget-bubble.is-them {
    align-self: flex-start;
    background: #fff;
}

.chat-widget-text {
    margin: 0;
    white-space: pre-wrap;
    font-size: 0.92rem;
}

.chat-widget-time {
    display: block;
    margin-top: 5px;
    font-size: 0.72rem;
    opacity: 0.68;
}

.chat-widget-image {
    display: block;
    width: 100%;
    max-width: 240px;
    border-radius: 8px;
    border: 1px solid #dedede;
    margin-top: 6px;
    background: #fff;
}

.chat-widget-compose {
    margin-top: 8px;
}

.chat-widget-compose textarea {
    width: 100%;
    resize: vertical;
    min-height: 60px;
    margin-top: 4px;
}

.chat-widget-actions {
    margin-top: 6px;
    display: flex;
    gap: 6px;
}

.chat-widget-drawing {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #ededed;
}

.chat-widget-drawing-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

#chat-widget-canvas {
    width: 100%;
    height: 150px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    touch-action: none;
    display: block;
}

@media (max-width: 768px) {
    .chat-widget-root {
        right: 10px;
        bottom: 10px;
    }

    .chat-widget-toggle {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .chat-widget-panel {
        left: 8px;
        right: 8px;
        bottom: 8px;
        top: 8px;
        width: auto;
        height: auto;
        border-radius: 14px;
        padding: 10px;
    }

    .chat-widget-friends-list {
        max-height: none;
    }

    .chat-widget-messages {
        min-height: 120px;
    }

    #chat-widget-canvas {
        height: 130px;
    }
}