/* Contenedor para las cards */
.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    gap: 2%;
    margin-top: 5%;
}

/* Cards */
.card {
    padding: 20px;
    background-color: var(--bg-accent);
    border-radius: 25px;
    box-shadow: 0 8px 10px 0 rgba(0, 0, 0, 0.5);
    min-width: min-content;
    margin: 1vh;
    text-align: center;
}

.medium-logo {
    width: 25vw;
    height: auto;
    margin: 25px auto;
}

.small-logo {
    max-width: 150px;
    min-width: 15vw;
    height: auto;
    margin: 25px auto;
}

#main-footer {
    display: flex;
}

#main-footer a {
    color: var(--accent);
}

#main-footer a:hover {
    color: var(--active);
}

#main-footer svg:hover {
    fill: var(--active);
}

#main-footer p {
    text-align: left;
}

/*Estilos del boton de cambio de tema*/
.theme-toggle {
    position: relative;
    display: block;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 60px;
    height: 30px;
    background-color: var(--bg-accent, #ccc);
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.theme-toggle .toggle-circle {
    position: absolute;
    width: 30px;
    height: 30px;
    top: 0;
    left: 0;
    background-color: var(--accent, #fff);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.theme-toggle[data-theme="dark"] {
    background-color: var(--default, #333);
}

.theme-toggle[data-theme="dark"] .toggle-circle {
    transform: translateX(30px);
}

.theme-toggle .theme-icon {
    position: absolute;
    font-size: 16px;
    top: 7px;
    pointer-events: none;
}

.theme-toggle .theme-icon.sun {
    right: 10px;
    color: var(--attention, #f39c12);
}

.theme-toggle .theme-icon.moon {
    left: 10px;
    color: var(--attention, #f5f5f5);
}

/* Project mode tweaks */
.in-project .header { background-color: var(--bg-muted); }
.in-project .sidebar-left { background-color: rgba(255,255,255,0.03); }
.menu .project-link { color: var(--accent); }
.menu .project-link:hover { color: var(--active); }

/* Estilos generales */
.checkbox-label {
    padding: 5px 10px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
}

.price-column {
    flex-wrap: nowrap;
    white-space: nowrap;
}

img {
    /*min-width: 20vw;*/
    /*max-width: 100%;*/
    height: auto;
}

section {
    display: flex;
    /*flex-wrap: wrap;*/
    gap: 1rem;
}

article {
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

article img {
    /*display: block;*/
    margin: 0 auto 1rem; /* Centrar la imagen y agregar espacio inferior */
    /*max-width: min(100%, 300px);*/
}

article h2 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

ul {
    padding: 0;
    margin: 0;
    list-style-type: none;
}

ul li {
    margin: 0.5rem 0;
    font-size: 1rem;
}

/* Ajustes de artículos para pantallas pequeñas */
@media (max-width: 768px) {
    section {
        flex-direction: column; /* Cambiar la orientación de los artículos */
    }

    article {
        flex: 1 1 100%;
    }

    article ul {
        padding-left: 0; /* Quitar sangría */
    }

    article ul li {
        font-size: 0.9rem; /* Ajustar el tamaño del texto */
    }
}

/* Ajustes de menú de base.html para pantallas pequeñas */
.menu {
    display: flex;
    z-index: 1;
    justify-content: center;
}

.menu-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--default);
    cursor: pointer;
}

/* Responsive menu */
@media (max-width: 768px) {
    .menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 50px;
        left: 0;
        width: 100%;
        background: var(--bg-default);
        padding: 10px;
    }

    .menu.show {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
}

/* In-project: show hamburger menu when sidebar moves down (1024px) */
@media (max-width: 1024px) {
    .in-project .header .menu {
        display: none !important;
        flex-direction: column;
        position: absolute;
        top: 50px;
        left: 0;
        width: 100%;
        background: var(--bg-default);
        padding: 10px;
        z-index: 100;
    }

    .in-project .header .menu.show {
        display: flex !important;
    }

    .in-project .menu-toggle {
        display: block;
    }
}

/* Mobile sidebar menu - shown only in collapsed menu on small screens */
.mobile-sidebar-menu {
    display: none !important;
}

.mobile-sidebar-menu * {
    display: none !important;
}

/* In-project: show mobile sidebar menu at 1024px (when sidebar moves down) */
@media (max-width: 1024px) {
    .in-project .mobile-sidebar-menu {
        display: block !important;
        width: 100%;
        border-top: 1px solid var(--bd-muted);
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }

    .in-project .mobile-sidebar-menu * {
        display: revert !important;
    }

    .in-project .mobile-sidebar-menu li {
        display: list-item !important;
    }

    .in-project .mobile-sidebar-menu .sidebar-btn {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        border-radius: var(--bd-radius);
        text-decoration: none;
        color: var(--default);
        background: var(--bg-muted);
        border: 1px solid var(--bd-muted);
        transition: background var(--tr-duration), border-color var(--tr-duration);
        font-weight: 500;
        margin-bottom: 0.25rem;
    }

    .in-project .mobile-sidebar-menu .sidebar-btn:hover {
        background: var(--bg-accent);
        border-color: var(--accent);
        color: var(--accent);
    }

    .in-project .mobile-sidebar-menu .sidebar-btn.active {
        background: var(--bg-accent);
        border-color: var(--accent);
        color: var(--accent);
        font-weight: 600;
    }

    .in-project .mobile-sidebar-menu .sidebar-icon {
        font-size: 1.1em;
    }
}

/* Non-project pages: show mobile sidebar menu at 768px */
@media (max-width: 768px) {
    .mobile-sidebar-menu {
        display: block !important;
        width: 100%;
        border-top: 1px solid var(--bd-muted);
        margin-top: 0.5rem;
        padding-top: 0.5rem;
    }

    .mobile-sidebar-menu * {
        display: revert !important;
    }

    .mobile-sidebar-menu li {
        display: list-item !important;
    }

    .mobile-sidebar-menu .sidebar-btn {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        border-radius: var(--bd-radius);
        text-decoration: none;
        color: var(--default);
        background: var(--bg-muted);
        border: 1px solid var(--bd-muted);
        transition: background var(--tr-duration), border-color var(--tr-duration);
        font-weight: 500;
        margin-bottom: 0.25rem;
    }

    .mobile-sidebar-menu .sidebar-btn:hover {
        background: var(--bg-accent);
        border-color: var(--accent);
        color: var(--accent);
    }

    .mobile-sidebar-menu .sidebar-btn.active {
        background: var(--bg-accent);
        border-color: var(--accent);
        color: var(--accent);
        font-weight: 600;
    }

    .mobile-sidebar-menu .sidebar-icon {
        font-size: 1.1em;
    }
}

/* Overwrite matcha.css para convertir en 3 columnas.*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    max-width: 100vw;
    padding: 0;
    margin: 0;
    font-family: var(--ft), sans-serif;
    font-size: 16px;
    line-height: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.header, .footer {
    width: 100%;
    padding: 10px;
    text-align: center;
}

/* New header layout */
.header {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
}
.header-left { justify-self: start; }
.header-right { justify-self: end; display: flex; align-items: center; }
.header .menu { justify-content: center; }
.header-utilities { display: flex; gap: 10px; align-items: center; }

.desktop-only { display: block; }
.mobile-only { display: none; }

@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block; }
}

/* User dropdown */
.user-dropdown { position: relative; }
.user-button { background: none; border: 1px solid var(--bd-muted); border-radius: 16px; padding: 4px 8px; color: var(--default); cursor: pointer; display: flex; align-items: center; gap: 6px; }
.user-icon { font-size: 16px; }
.username { font-size: 0.9rem; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--bg-default); border: 1px solid var(--bd-muted); border-radius: 6px; padding: 8px; display: none; z-index: 10; min-width: 140px; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.dropdown-menu.open { display: block; }
.dropdown-menu a { text-decoration: none; }

.footer {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    border-top: 10px solid var(--bd-muted);
    padding-left: 0;
    padding-right: 0;
}

.contact-footer {
    width: 20%;
    min-width: 170px;
    flex-shrink: 0;
    border-right: 2px solid var(--bd-muted);
    padding-left: 10px;
}

.menu-footer {
    align-items: flex-end;
}

.aside-language {
    border-left: 0;
    width: 35%;
    min-width: 200px;
    flex-shrink: 0;
    margin-left: 0;
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 0.5rem;
}

.language-switcher button.lang-btn {
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid var(--bd-muted);
    border-radius: 4px;
    background-color: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
    opacity: 0.6;
}

.language-switcher button.lang-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    opacity: 1;
}

.language-switcher button.lang-btn--active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
    opacity: 1;
}

.aside-climate-clock {
    border-left: 2px solid var(--bd-muted);
    width: 400px;
    max-width: 400px;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    margin-left: 0;
}

.aside-keep-android {
    border-left: 2px solid var(--bd-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}

/* ── Advocacy banners wrapper ── */
.footer-advocacy {
    display: flex;
    flex-direction: column;
}

.footer-advocacy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0 0.5rem;
    border-top: 1px dashed var(--bd-muted);
    margin-top: 0.25rem;
}

.footer-advocacy-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.footer-advocacy-banners {
    display: flex;
    flex-direction: row;
}

.advocacy-toggle-btn,
.advocacy-restore-btn {
    background: transparent;
    border: 1px solid var(--bd-muted);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    padding: 3px 12px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.advocacy-toggle-btn:hover,
.advocacy-restore-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* Restore button: oculto por defecto, visible solo cuando banners están ocultos */
.advocacy-restore-btn {
    display: none;
    align-self: flex-start;  /* evita que el flex column lo estire al ancho completo */
    margin: 0.5rem 0 0.25rem;
}

html.advocacy-hidden #main-footer .footer-advocacy { display: none; }
html.advocacy-hidden #main-footer .advocacy-restore-btn { display: block; }

.content-wrapper {
    display: flex;
    flex-direction: row;
    flex-grow: 1;
    max-width: 100vw;
}

.sidebar-left {
    flex-shrink: 0;
    width: 20%;
    padding: 0;
    position: relative;
    overflow: visible;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease;
}

.sidebar-right {
    width: 10%;
    padding: 0;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 10px;
}

.main-content {
    order: 2;
}

.sidebar-left {
    order: 1;
    border-left: 0;
    /* El borde se dibuja con ::after para que el botón circular lo interrumpa */
}

/* Línea divisora interrumpida: empieza justo debajo del botón de colapso */
.sidebar-left::after {
    content: '';
    position: absolute;
    top: calc(1rem + 26px + 0.6rem); /* btn_top + btn_height + gap */
    right: -1px;
    bottom: 0;
    width: 2px;
    background-color: var(--bd-muted);
    pointer-events: none;
}

/* En móvil el sidebar apila verticalmente — no se necesita la línea vertical */
@media (max-width: 896px) {
    .sidebar-left::after { display: none; }
}

/* ── Sidebar toggle (círculo estilo Reddit, a caballo del borde sidebar/contenido) ── */
.sidebar-toggle {
    position: absolute;
    top: 1rem;
    left: calc(100% - 13px);
    width: 26px;
    height: 26px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    background: var(--background);
    border: 2px solid var(--bd-muted);
    border-radius: 50%;
    cursor: pointer;
    color: var(--muted);
    z-index: 20;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
    transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

.sidebar-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-accent);
}

.sidebar-inner {
    flex: 1;
    padding: 0.75rem 0.5rem 0.75rem 0.75rem;
    overflow-y: auto;
    transition: opacity 0.15s ease;
}

/* ── Collapsed state ─────────────────────────────────────────────── */
body.sidebar-collapsed .sidebar-left {
    width: 1.75rem;
}

body.sidebar-collapsed .sidebar-inner {
    visibility: hidden;
    overflow: hidden;
    height: 0;
    padding: 0;
    pointer-events: none;
    flex: 0;
}

/* On mobile: hide toggle, always show full sidebar */
@media (max-width: 896px) {
    .sidebar-toggle { display: none; }
    body.sidebar-collapsed .sidebar-left { width: 100%; }
    body.sidebar-collapsed .sidebar-inner {
        visibility: visible;
        overflow: visible;
        height: auto;
        padding: 0.75rem;
        pointer-events: auto;
        flex: 1;
    }
}

/* ── Secciones contraíbles del sidebar ───────────────────────────── */
.sidebar-group {
    margin-bottom: 0.25rem;
}

.sidebar-group .sidebar-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.25rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0;
    box-shadow: none;
    transition: color 0.15s, background-color 0.15s;
}

.sidebar-group .sidebar-group-toggle:hover {
    color: var(--text);
    background: var(--bg-accent);
    box-shadow: none;
}

.sidebar-chevron {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    display: inline-block;
    flex-shrink: 0;
    margin-left: 0.25rem;
}

.sidebar-group.collapsed .sidebar-group-toggle .sidebar-chevron {
    transform: rotate(-90deg);
}

.sidebar-group-content {
    max-height: 800px;
    overflow: hidden;
    padding-right: 0.75rem;
    transition: max-height 0.25s ease, opacity 0.2s ease;
    opacity: 1;
}

.sidebar-group.collapsed .sidebar-group-content {
    max-height: 0;
    opacity: 0;
}

.sidebar-right {
    border-left: 2px solid var(--bd-muted);
    order: 3;
    padding-right: .2rem;
}

@media (max-width: 896px) {
    .content-wrapper {
        flex-direction: column;
    }

    .main-content {
        order: 1;
        width: 100%;
    }

    .sidebar-left {
        order: 2;
        width: 100%;
        border-top: 4px solid var(--bd-muted);
        border-bottom: 1px solid var(--bd-muted);
        border-right: 1px solid var(--bd-muted);
    }

    .sidebar-right {
        order: 3;
        width: 100%;
        border-top: 1px solid var(--bd-muted);
        border-left: 1px solid transparent;
    }
}

/* Pinz mobile adjustments - ensure sidebar doesn't overlap content */
@media (max-width: 1024px) {
    .in-project .content-wrapper {
        flex-direction: column;
    }

    .in-project .main-content {
        order: 1;
        width: 100%;
    }

    .in-project .sidebar-left {
        order: 2;
        width: 100%;
        border-top: 4px solid var(--bd-muted);
        border-right: none;
    }
}

/* Fix: Sidebar menu should NOT inherit header menu's absolute positioning */
@media (max-width: 768px) {
    .sidebar-left .menu {
        display: block;
        position: static;
        width: auto;
        background: transparent;
        padding: 0;
        flex-direction: column;
    }

    .sidebar-left .sidebar-section {
        margin-bottom: 1rem;
    }
}

@media (max-width: 1080px) {
    #main-footer {
        flex-direction: column;
    }

    .contact-footer {
        width: 100%;
    }

    .aside-language {
        width: 100%;
    }

    /*.aside-climate-clock {*/
    /*    width: 50%;*/
    /*}*/

    .aside-keep-android {
        width: 100%;
        border-left: 0;
        border-top: 2px solid var(--bd-muted);
        justify-content: flex-start;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 546px) {
    /*.aside-climate-clock {*/
    /*    width: 100%;*/
    /*}*/
    .menu-footer {
        align-items: flex-start;
    }
}

button {
    word-break: normal;
}

section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
}

/* Style the iframe */
.pure-image-iframe {
    border: none; /* Remove border */
    overflow: hidden; /* Hide scrollbars */
    width: 100%; /* Make it responsive */
    height: 90%; /* Maintain aspect ratio */
    aspect-ratio: 16 / 9; /* Adjust aspect ratio as needed */
    display: block;
    margin-bottom: 1rem;
}

.climate-clock-container {
    bottom: 0;
}

.article-image-file {
    max-width: 50%;
    height: auto;
}

/* Authentication buttons styles */
.auth-buttons {
}

.auth-item {
    margin: 0;
    padding: 0;
}

.auth-menu {
    flex-direction: row-reverse;
    display: flex;
}

.logout-form {
    margin: 0;
    padding: 0;
}

/* Project Inquiry Form Styles - More Compact Version */
.project-inquiry-form-container {
    background-color: var(--bg-accent);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.project-inquiry-form-container h2 {
    color: var(--accent);
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.project-inquiry-form-container p {
    margin-bottom: 10px;
    color: var(--default);
    font-size: 0.8rem;
}

.project-inquiry-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.project-inquiry-form .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.project-inquiry-form label {
    margin-bottom: 2px;
    font-weight: bold;
    color: var(--default);
    font-size: 0.9rem;
}

.project-inquiry-form input[type="text"],
.project-inquiry-form input[type="email"] {
    padding: 6px 8px;
    border: 1px solid var(--bd-muted);
    border-radius: 4px;
    background-color: var(--bg-default);
    color: var(--default);
    font-size: 0.9rem;
}

.project-inquiry-form .project-textarea {
    padding: 6px 8px;
    border: 1px solid var(--bd-muted);
    border-radius: 4px;
    background-color: var(--bg-default);
    color: var(--default);
    min-height: 80px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.project-inquiry-form .form-error {
    color: var(--danger);
    font-size: 0.7rem;
    margin-top: 2px;
}

.project-inquiry-form .form-actions {
    margin-top: 8px;
}

.project-inquiry-form .btn-submit {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

/* Responsive styles for the form */
@media (min-width: 768px) {
    .project-inquiry-form-container {
        padding: 15px 20px;
    }
    
    /* Create a two-column layout for wider screens */
    .project-inquiry-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-gap: 10px;
    }
    
    .project-inquiry-form .message-group {
        grid-column: span 2;
    }
    
    .project-inquiry-form .form-actions {
        grid-column: span 2;
        display: flex;
        justify-content: flex-end;
    }
}

/* Project Inquiry Button Styles */
.sidebar-section {
    margin: 20px 0;
    padding: 10px;
    text-align: center;
}

.inquiry-button {
    display: block;
    text-decoration: none;
    margin-bottom: 15px;
}

.inquiry-button button {
    width: 100%;
    padding: 12px 15px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.inquiry-button button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Make sure the button is visible on all screen sizes */
@media (max-width: 896px) {
    .sidebar-section {
        margin: 15px 0;
    }
    
    .inquiry-button button {
        padding: 10px;
        font-size: 0.9rem;
    }
}

.bitcoin-symbol {
    font-size: 1.5rem;
    color: orange;
}

/* Spacing for donation labels and addresses to avoid collision */
/* Spacing and layout for donation addresses */
.donation-section .address-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.donation-section strong {
    margin-right: 0.35em;
}

.donation-section code {
    margin-left: 0.1em;
}

/* Copy button styling */
.donation-section .copy-btn {
    padding: 2px 8px;
    font-size: 0.8rem;
    border: 1px solid var(--bd-muted);
    border-radius: 4px;
    background-color: var(--bg-default);
    color: var(--default);
    cursor: pointer;
}

.donation-section .copy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.donation-section .copy-btn.copied {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

/* Override reemplazar fondo de tablas en matcha */
tbody > tr:nth-child(2n) {
    background: var(--bg-muted)
}

th {
    background-color: var(--bg-accent);
}

td {
    padding: .375rem .8125rem;
    border: 1px solid var(--bd-muted);
    background-color: var(--bg-default);
}

/* Styles to override matcha.css forms with background and borders */
.mini-form {
    background-color: var(--bg-default);
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
}

/* Styles to override matcha.css labels margin */
label {
    margin: 0;
}

.form-row {
    margin-bottom: 1rem;
}

/* =============================================
   BITCOIN / LIGHTNING ADDRESS CARDS
   ============================================= */

.donation-section {
    border: 1px solid var(--bd-muted);
    border-radius: 9px;
    padding: 12px;
    background: var(--bg-accent);
}

.btc-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f7931a;   /* Bitcoin orange */
    margin: 0 0 2px;
    font-family: monospace;
}

.btc-section-sub {
    font-size: 0.75rem;
    opacity: 0.65;
    margin: 0 0 10px;
    line-height: 1.4;
}

.btc-address-card {
    border: 1px solid var(--bd-muted);
    border-radius: 7px;
    padding: 10px;
    margin: 6px 0 0;
    background: var(--bg-default);
    transition: border-color 0.18s;
}
.btc-address-card:hover {
    border-color: rgba(247, 147, 26, 0.35);
}

.btc-addr-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}
.btc-addr-icon {
    font-size: 0.95rem;
    color: #38bdf8;   /* Lightning = cyan */
}
.btc-addr-icon.btc-orange { color: #f7931a; }

.btc-addr-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.65;
    font-family: monospace;
}

.btc-addr-value {
    display: block;
    font-size: 0.72rem;
    word-break: break-all;
    line-height: 1.45;
    margin-bottom: 8px;
    opacity: 0.8;
}

.btc-addr-actions {
    display: flex;
    gap: 5px;
}

.btc-qr-btn,
.btc-addr-actions .copy-btn {
    flex: 1;
    padding: 4px 6px;
    font-size: 0.72rem;
    border: 1px solid var(--bd-muted);
    border-radius: 5px;
    background: var(--bg-muted);
    color: var(--default);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    text-align: center;
}

.btc-qr-btn:hover {
    border-color: rgba(247, 147, 26, 0.5);
    background: rgba(247, 147, 26, 0.07);
    color: #f7931a;
}

.btc-addr-actions .copy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.btc-addr-actions .copy-btn.copied {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* =============================================
   QR CODE MODAL
   ============================================= */

.qr-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}
.qr-modal-overlay.active {
    display: flex;
}

.qr-modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 28px 24px 20px;
    text-align: center;
    max-width: 270px;
    width: 88%;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    animation: qr-modal-in 0.18s ease;
}
@keyframes qr-modal-in {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.qr-modal-close {
    position: absolute;
    top: 8px; right: 8px;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #555;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
}
.qr-modal-close:hover { background: rgba(0,0,0,0.1); }

.qr-modal-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #222;
    margin: 0 0 14px;
}

#qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
}
#qr-container canvas,
#qr-container img {
    display: block;
    border-radius: 6px;
}

.qr-modal-addr {
    font-size: 0.58rem;
    word-break: break-all;
    color: #777;
    margin: 10px 0 0;
    font-family: monospace;
    line-height: 1.5;
}

/* ── Pinned Apps sidebar section ──────────────────── */
.pinned-apps-section {
    padding-bottom: 0.25rem;
}
.pinned-apps-label {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #38bdf8;
    font-family: monospace;
    margin: 0 0 0.6rem 0;
    opacity: 0.85;
}
.pinned-apps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.pinned-app-item {
    margin: 0;
}
.pinned-app-link {
    display: grid;
    grid-template-columns: 32px 1fr;
    align-items: center;
    gap: 10px;
    padding: 5px 8px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    color: var(--default);
    transition: background 0.15s;
    overflow: hidden;
}
.pinned-app-link:hover {
    background: rgba(56, 189, 248, 0.08);
    text-decoration: none;
    color: #38bdf8;
}
.pinned-app-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    justify-self: center;
}
.pinned-app-icon {
    font-size: 1.4rem;
    text-align: center;
    line-height: 1;
}
.pinned-app-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ── Pin project button ─────────────────────────── */
.pin-project-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 4px 6px;
    color: inherit;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
    margin-top: 2px;
}
.pin-project-btn:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
}
.pin-project-btn.pinned {
    opacity: 1;
}

/* ═══════════════════════════════════════════════════
   NAVIGATION — Glass-pill redesign
   ═══════════════════════════════════════════════════ */

/* Container — structural only, no theme colors here */
header #menu {
    display: flex;
    align-items: center;
    gap: 0.18rem;
    padding: 0.28rem;
    background: rgba(56, 189, 248, 0.04);
    border: 1px solid rgba(56, 189, 248, 0.12);
    border-radius: 100px;
    list-style: none;
    margin: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Each nav item */
header #menu > li:not(.mobile-only):not(.project-nav-intro) {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Nav link — structural base, no color defined here */
header #menu > li:not(.mobile-only):not(.project-nav-intro) > a {
    display: inline-flex;
    align-items: center;
    padding: 0.36rem 0.88rem;
    border-radius: 100px;
    font-size: 0.84rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-decoration: none;
    border: 1px solid transparent;
    transition: color 0.18s, background 0.18s, border-color 0.18s,
                box-shadow 0.18s, transform 0.15s;
    white-space: nowrap;
    position: relative;
}

/*
 * Theme-specific link colors — explicit [data-color-scheme] selectors.
 * Specificity: (1,3,3) — beats any broad article CSS without needing !important.
 */
[data-color-scheme="dark"] header #menu > li:not(.mobile-only):not(.project-nav-intro) > a {
    color: rgba(238, 244, 251, 0.87);
}
[data-color-scheme="light"] header #menu > li:not(.mobile-only):not(.project-nav-intro) > a {
    color: rgba(10, 20, 40, 0.80);
}

/* Hover — shared geometry */
header #menu > li:not(.mobile-only):not(.project-nav-intro) > a:hover {
    background: rgba(56, 189, 248, 0.09);
    border-color: rgba(56, 189, 248, 0.26);
    text-decoration: none;
    transform: translateY(-1px);
}
/* Hover — dark mode color */
[data-color-scheme="dark"] header #menu > li:not(.mobile-only):not(.project-nav-intro) > a:hover {
    color: #38bdf8;
}
/* Hover — light mode color and tint */
[data-color-scheme="light"] header #menu > li:not(.mobile-only):not(.project-nav-intro) > a:hover {
    color: #0284c7;
    background: rgba(2, 132, 199, 0.08);
    border-color: rgba(2, 132, 199, 0.22);
}

/* Active / selected — gradient fill, same in both themes */
header #menu > li.selected > a,
header #menu > li.selected > a:hover {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    color: #05101c;
    font-weight: 700;
    border-color: transparent;
    transform: none;
    text-decoration: none;
    box-shadow:
        0 0 20px rgba(56, 189, 248, 0.5),
        0 2px 14px rgba(129, 140, 248, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Light mode — container and selected glow adjustments */
[data-color-scheme="light"] header #menu {
    background: rgba(10, 20, 35, 0.04);
    border-color: rgba(10, 20, 35, 0.1);
}
[data-color-scheme="light"] header #menu > li.selected > a {
    box-shadow:
        0 0 16px rgba(56, 189, 248, 0.35),
        0 2px 10px rgba(129, 140, 248, 0.25);
}

/* Mobile — vertical layout */
@media (max-width: 768px) {
    header #menu {
        display: none;           /* Oculto por defecto en móvil */
        border-radius: 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
        padding: 0.45rem;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 200;
        background: rgba(6, 12, 24, 0.96);
        border-color: rgba(56, 189, 248, 0.18);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    header #menu.show {
        display: flex;           /* Visible cuando JS añade .show */
    }
    header #menu > li:not(.mobile-only):not(.project-nav-intro) > a {
        border-radius: 9px;
        padding: 0.58rem 1rem;
        font-size: 0.92rem;
        justify-content: flex-start;
    }
    header #menu > li.selected > a {
        box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
    }
    [data-color-scheme="light"] header #menu {
        background: rgba(245, 248, 255, 0.97);
    }
}


/* =========================================================
   BLOG SYSTEM STYLES
   ========================================================= */

/* --- Tag chips --- */
.tag-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    border: 2px solid var(--tag-color, #6c757d);
    color: var(--tag-color, #6c757d);
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}
.tag-chip:hover,
.tag-chip--active {
    background: var(--tag-color, #6c757d);
    color: #fff;
}
.tag-chip--small {
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
}
.tag-chip--manage {
    border-color: #888;
    color: #888;
}

/* --- Blog section — stack everything vertically --- */
.blog-section {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* --- Blog header --- */
.blog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* --- Tag chip nav bar --- */
.blog-tag-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.blog-tag-description {
    opacity: 0.75;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* --- Blog grid --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* --- Blog card --- */
.blog-card {
    border: 1px solid var(--border, rgba(255,255,255,0.12));
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}
.blog-card:hover {
    box-shadow: 0 4px 24px rgba(124,58,237,0.15);
    transform: translateY(-2px);
}
.blog-card__thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}
.blog-card__thumbnail-iframe {
    height: 180px;
    overflow: hidden;
}
.blog-card__thumbnail-iframe iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
}
.blog-card__body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.5rem;
}
.blog-card__title {
    font-size: 1.05rem;
    margin: 0;
    line-height: 1.3;
}
.blog-card__title a {
    text-decoration: none;
    color: inherit;
}
.blog-card__title a:hover {
    color: var(--accent, #7c3aed);
}
.blog-card__desc {
    font-size: 0.88rem;
    opacity: 0.8;
    line-height: 1.5;
    margin: 0;
}
.blog-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: auto;
}
.blog-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    opacity: 0.7;
    border-top: 1px solid var(--border, rgba(255,255,255,0.1));
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}
.blog-card__read-more {
    color: var(--accent, #7c3aed);
    text-decoration: none;
    font-weight: 500;
}

/* --- Blog empty --- */
.blog-empty {
    width: 100%;
    text-align: center;
    opacity: 0.6;
    padding: 3rem 0;
}

/* --- Pagination --- */
.blog-pagination {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
}
.pagination-link {
    padding: 0.4rem 1rem;
    border: 1px solid var(--border, #333);
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}
.pagination-link:hover {
    background: var(--accent, #7c3aed);
    color: #fff;
    border-color: transparent;
}
.pagination-info {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* --- Article detail --- */
.article-section {
    max-width: 780px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}
/* Override matcha.css article card styles within article detail */
.article-section article.article-body {
    flex: none;
    width: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    padding: 0;
    box-sizing: border-box;
}
.article-section article.article-body > header:first-child {
    padding: 0;
    border-bottom: none;
    margin: 0 0 1rem;
}
.article-section article.article-body > footer:last-child {
    padding: 0;
    border-top: none;
    margin: 0;
}
.article-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.article-header {
    margin-bottom: 1.5rem;
}
.article-header h1 {
    margin-bottom: 0.5rem;
}
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.article-figure {
    margin: 1rem 0;
}
.article-image {
    max-width: 100%;
    border-radius: 8px;
}
.article-content {
    line-height: 1.8;
}
.article-footer {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border, rgba(255,255,255,0.12));
    font-size: 0.9rem;
    opacity: 0.8;
}
.back-link {
    text-decoration: none;
    color: inherit;
}
.back-link:hover {
    color: var(--accent, #7c3aed);
}

/* --- Code block copy button --- */
.article-content pre {
    position: relative;
    padding-right: 3.5rem; /* reserve space so code text doesn't slide under the copy button */
}

/*
 * Base = dark mode default. Specificity (0,1,0) beats matcha's `button` (0,0,1)
 * so no !important needed — class selector always wins over element selector.
 */
.code-copy-btn {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    padding: 0.2rem 0.55rem;
    font-size: 0.7rem;
    font-family: inherit;
    background: #334155;
    color: #e2e8f0;
    border: 1px solid #4a5568;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
    z-index: 2;
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
}
.code-copy-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.5);
}
.code-copy-btn.copied {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.5);
    background: rgba(74, 222, 128, 0.15);
}

/* Light mode — specificity (0,2,0), beats matcha's [data-color-scheme] + element */
[data-color-scheme="light"] .code-copy-btn {
    background: #e2e8f0;
    color: #334155;
    border-color: #94a3b8;
}
[data-color-scheme="light"] .code-copy-btn:hover {
    background: rgba(2, 132, 199, 0.12);
    color: #0284c7;
    border-color: rgba(2, 132, 199, 0.4);
}

/* --- Attribution footer --- */
.swd-attribution-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    font-size: 0.85rem;
    opacity: 0.75;
}
.swd-attribution-footer hr {
    margin-bottom: 0.75rem;
}

/* --- Create/Edit article --- */
.create-article-section {
    max-width: 900px;
    margin: 0 auto;
}

/* --- Tag manage --- */
.tag-manage-section { max-width: 860px; margin: 0 auto; }
.tag-manage-section table th,
.tag-manage-section table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.1));
    font-size: 0.9rem;
}

/* =========================================================
   PRINT STYLES
   ========================================================= */
@media print {
    /* Hide navigation, sidebar, header, footer */
    header, aside, .sidebar-left, footer,
    .article-actions, .blog-tag-chips, .back-link,
    #menu-toggle, .header-utilities,
    .blog-card__read-more, .blog-pagination {
        display: none !important;
    }

    body {
        font-size: 11pt;
        color: #000;
        background: #fff;
    }

    .swd-attribution-footer {
        display: block !important;
        border-top: 2px solid #000;
        padding-top: 1rem;
        page-break-inside: avoid;
        opacity: 1;
        color: #000;
    }

    .article-content {
        max-width: 100%;
    }

    body::after {
        content: "Source: smart-web-dev.com";
        display: block;
        text-align: center;
        font-size: 9pt;
        color: #666;
        margin-top: 2rem;
    }

    a[href]::after {
        content: none;
    }
    /* Ocultar nav móvil en impresión */
    .mobile-pinned-nav { display: none !important; }
}

/* =========================================================
   MOBILE PINNED APPS — BOTTOM NAVIGATION BAR
   Visible only on mobile (≤ 896px) when user is authenticated
   and has pinned apps. Pattern: bottom nav bar (Instagram/Reddit style).
   ========================================================= */
.mobile-pinned-nav {
    display: none; /* hidden by default; shown in mobile media query */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: 60px;
    /* Safe area for iPhone home bar */
    padding-bottom: env(safe-area-inset-bottom, 0);
    /* Fondo sólido: misma variable que usa el body en matcha.css */
    background-color: var(--bg-default);
    border-top: 1px solid var(--bd-muted);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.mobile-pinned-nav::-webkit-scrollbar { display: none; }

.mpn-item {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    height: 60px;
    padding: 6px 10px;
    text-decoration: none;
    color: var(--muted);
    gap: 3px;
    flex-shrink: 0;
    transition: color 0.15s, background-color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.mpn-item:hover,
.mpn-item:active {
    color: var(--accent);
    background: var(--bg-accent);
    text-decoration: none;
}
.mpn-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
    border-radius: 5px;
}
.mpn-icon {
    font-size: 22px;
    line-height: 1;
}
.mpn-label {
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 68px;
    text-align: center;
    line-height: 1;
}

@media (max-width: 896px) {
    /* Mostrar la barra de navegación */
    .mobile-pinned-nav {
        display: flex;
        align-items: stretch;
    }

    /* Empujar el contenido hacia arriba para que no quede tapado */
    body.has-mpn .content-wrapper {
        margin-bottom: 60px;
    }
    body.has-mpn footer#main-footer {
        margin-bottom: 60px;
    }
}

/* ========================
   Auth Forms — All pages
   ======================== */

.auth-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 3rem 1rem 4rem;
  min-height: 55vh;
}

.auth-card {
  background-color: #252525;
  border: 1px solid #383838;
  border-top: 3px solid #4a90e2;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  padding: 2rem 2.25rem;
  width: 100%;
  max-width: 440px;
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

/* ── Tabs (login page) ── */
.auth-tabs {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  border-bottom: 1px solid #383838;
}

.auth-tabs li {
  flex: 1;
  text-align: center;
}

.auth-tabs li a {
  display: block;
  padding: 0.75rem;
  color: #888;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease;
}

.auth-tabs li.active a {
  color: #4a90e2;
  border-bottom-color: #4a90e2;
}

.auth-tab-content {
  margin-bottom: 1.5rem;
}

.auth-tab-pane {
  display: none;
}

.auth-tab-pane.active {
  display: block;
}

/* ── Form elements ── */
.auth-form {
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  background-color: #2a2a2a;
  color: #f0f0f0;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.form-control:focus {
  border-color: #4a90e2;
  background-color: #2e2e2e;
  outline: none;
}

/* ── Feedback messages ── */
.error-message {
  color: #e74c3c;
  margin-top: 0.4rem;
  font-size: 0.875rem;
}

.help-text {
  color: #888;
  margin-top: 0.4rem;
  font-size: 0.875rem;
}

.info-text {
  color: #9a9a9a;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ── Auth form buttons ── */
.form-actions {
  margin-top: 1.5rem;
}

.auth-card .btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  border: none;
  width: 100%;
  font-size: 1rem;
  transition: background-color 0.15s ease;
}

.auth-card .btn-primary {
  background-color: #4a90e2;
  color: #fff;
}

.auth-card .btn-primary:hover {
  background-color: #3a80d2;
}

/* ── Auth links footer ── */
.auth-links {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
}

.auth-links p {
  margin: 0.4rem 0;
}

.auth-links a {
  color: #4a90e2;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* ── Social login (Google) ── */
.social-login-section {
  margin-bottom: 1.25rem;
  text-align: center;
}

.social-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  background-color: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.social-login-btn:hover {
  background-color: #f8f9fa;
  box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
  color: #3c4043;
  text-decoration: none;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1rem 0;
  color: #6c757d;
  font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #444;
}

.auth-divider span {
  padding: 0 0.75rem;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem 1.25rem;
    border-top-width: 2px;
  }
}

/* =========================================================
   NEWSFEED — Sistema de noticias
   ========================================================= */

/* --- Badge de categoría (funciona dentro de <a> tags) --- */
.news-card__badge,
.news-carousel__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff !important;
  text-decoration: none !important;
  white-space: nowrap;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

/* --- Barra de filtros por categoría --- */
.news-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.5rem 0;
  padding: 1rem 0;
  border-bottom: 1px solid var(--bd-muted, #333);
  align-items: center;
}

.news-filter-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--default, #e6edf3);
  border: 1px solid var(--bd-muted, #444);
  background: transparent;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
  white-space: nowrap;
  cursor: pointer;
}

.news-filter-tag:hover {
  border-color: var(--accent, #4493f8);
  color: var(--accent, #4493f8);
  background: rgba(68,147,248,0.08);
}

.news-filter-tag.active {
  background: var(--accent, #4493f8);
  color: #fff;
  border-color: var(--accent, #4493f8);
}

/* --- Grid de tarjetas --- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

/* --- News card --- */
.news-card {
  background: var(--bg-subtle, #1e1e1e);
  border: 1px solid var(--bd-muted, #333);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}

.news-card:hover {
  border-color: var(--accent, #4493f8);
  box-shadow: 0 4px 16px rgba(68,147,248,0.12);
  transform: translateY(-2px);
}

.news-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 1.1rem 1.2rem 1rem;
  text-decoration: none;
  color: inherit;
  gap: 0.45rem;
}

.news-card__title {
  margin: 0.3rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--default, #e6edf3);
}

.news-card:hover .news-card__title {
  color: var(--accent, #4493f8);
}

.news-card__excerpt {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted, #848d97);
  flex-grow: 1;
}

.news-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--bd-muted, #333);
  font-size: 0.78rem;
  color: var(--muted, #848d97);
}

.news-card__source {
  font-weight: 500;
  color: var(--accent, #4493f8);
}

/* --- Header de la lista de noticias --- */
.news-list-page { padding: 1.5rem 1rem 3rem; }
.news-list-header { margin-bottom: 0.5rem; }
.news-list-header h1 { font-size: 2rem; font-weight: 700; margin: 0 0 0.3rem; }
.news-list-subtitle { color: var(--muted, #848d97); font-size: 0.95rem; margin: 0; }
.news-empty { color: var(--muted, #848d97); font-style: italic; padding: 2rem 0; text-align: center; }
.news-admin-bar { display: flex; gap: 0.75rem; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--bd-muted, #333); }

/* --- Botones del sistema newsfeed --- */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent, #4493f8); color: #fff; }
.btn-primary:hover { opacity: 0.88; box-shadow: 0 3px 8px rgba(68,147,248,0.3); }
.btn-secondary { background: var(--bg-subtle, #2a2a2a); color: var(--default, #e6edf3); border: 1px solid var(--bd-muted, #444); }
.btn-secondary:hover { border-color: var(--accent, #4493f8); }
.btn-ghost { background: transparent; color: var(--default, #e6edf3); border: 1px solid var(--bd-muted, #444); }
.btn-sm { display: inline-flex; align-items: center; padding: 0.25rem 0.65rem; border-radius: 5px; font-size: 0.8rem; font-weight: 500; text-decoration: none; cursor: pointer; border: 1px solid var(--bd-muted, #444); background: var(--bg-subtle, #2a2a2a); color: var(--default, #e6edf3); transition: opacity 0.15s; }
.btn-sm:hover { opacity: 0.8; }
.btn-sm--warn { border-color: #e57373; color: #e57373; }
.btn-sm--success { border-color: #81c784; color: #81c784; }

/* --- News detail --- */
.news-detail { padding: 2rem 1rem; }
.news-detail__article { max-width: 720px; margin: 0 auto; }
.news-detail__header { margin-bottom: 1.5rem; }
.news-detail__meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.news-detail__source { font-size: 0.82rem; color: var(--muted, #848d97); }
.news-detail__title { font-size: 1.7rem; font-weight: 700; line-height: 1.3; margin: 0.5rem 0; color: var(--default, #e6edf3); }
.news-detail__date { font-size: 0.82rem; color: var(--muted, #848d97); display: block; margin-bottom: 1rem; }
.news-detail__body { font-size: 1rem; line-height: 1.75; color: var(--default, #e6edf3); margin-bottom: 1.5rem; }
.news-detail__original-cta { display: inline-flex; align-items: center; gap: 0.4rem; margin-bottom: 2rem; padding: 0.65rem 1.2rem; background: var(--accent, #4493f8); color: #fff; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: opacity 0.15s; }
.news-detail__original-cta:hover { opacity: 0.85; }
.news-detail__share { margin-top: 2rem; padding: 1.25rem; background: var(--bg-subtle, #1e1e1e); border: 1px solid var(--bd-muted, #333); border-radius: 8px; }
.news-detail__share h3 { margin: 0 0 0.9rem; font-size: 1rem; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-start; }
.btn-copy-link { padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.88rem; cursor: pointer; background: var(--bg-subtle, #2a2a2a); border: 1px solid var(--bd-muted, #444); color: var(--default, #e6edf3); transition: opacity 0.15s; }
.btn-copy-link:hover { opacity: 0.8; }
.btn-share-twitter { padding: 0.5rem 1rem; border-radius: 6px; font-size: 0.88rem; background: #1da1f2; color: #fff; text-decoration: none; font-weight: 500; transition: opacity 0.15s; }
.btn-share-twitter:hover { opacity: 0.85; }
.share-nostr summary { cursor: pointer; font-size: 0.85rem; color: var(--muted, #848d97); margin-bottom: 0.4rem; }
.nostr-text-area, .share-text-area { width: 100%; min-height: 80px; background: var(--bg, #0d1117); border: 1px solid var(--bd-muted, #444); border-radius: 6px; color: var(--default, #e6edf3); padding: 0.5rem; font-size: 0.83rem; font-family: monospace; resize: vertical; box-sizing: border-box; margin-top: 0.4rem; }
.share-text-area.nostr { min-height: 110px; }

/* --- Carousel infinito --- */
.news-more-section { padding: 2rem 0; background: var(--bg-subtle, #1a1a1a); margin-top: 2rem; overflow: hidden; }
.news-more-title { text-align: center; font-size: 1.1rem; margin: 0 0 1rem; padding: 0 1rem; }
.news-carousel { overflow: hidden; position: relative; }
.news-carousel::before, .news-carousel::after { content: ''; position: absolute; top: 0; bottom: 0; width: 60px; z-index: 2; pointer-events: none; }
.news-carousel::before { left: 0; background: linear-gradient(to right, var(--bg-subtle, #1a1a1a), transparent); }
.news-carousel::after { right: 0; background: linear-gradient(to left, var(--bg-subtle, #1a1a1a), transparent); }
.news-carousel__track { display: flex; gap: 1rem; padding: 0.5rem 1rem; animation: newsScroll 35s linear infinite; width: max-content; }
.news-carousel:hover .news-carousel__track { animation-play-state: paused; }
@keyframes newsScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.news-carousel__item { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.8rem 1rem; min-width: 240px; max-width: 280px; background: var(--bg, #0d1117); border: 1px solid var(--bd-muted, #333); border-radius: 8px; text-decoration: none; color: inherit; transition: border-color 0.15s; flex-shrink: 0; }
.news-carousel__item:hover { border-color: var(--accent, #4493f8); }
.news-carousel__title { font-size: 0.87rem; font-weight: 500; line-height: 1.35; color: var(--default, #e6edf3); }
.news-carousel__date { font-size: 0.75rem; color: var(--muted, #848d97); }

/* --- Sección noticias en blog --- */
.blog-news-section { margin-top: 2.5rem; padding: 2rem 0; border-top: 1px solid var(--bd-muted, #333); }
.blog-news-section__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.2rem; flex-wrap: wrap; gap: 0.5rem; }
.blog-news-section__header h2 { margin: 0; font-size: 1.2rem; }
.blog-news-section__all { font-size: 0.88rem; color: var(--accent, #4493f8); text-decoration: none; }
.blog-news-section__all:hover { text-decoration: underline; }

/* --- Manage panel --- */
.news-manage { padding: 2rem 1rem; }
.news-manage__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
.news-manage__header h1 { margin: 0; }
.news-manage__actions { display: flex; gap: 0.75rem; }
.twitter-status { font-size: 0.87rem; padding: 0.4rem 0.9rem; border-radius: 6px; margin-bottom: 1rem; display: inline-block; }
.twitter-status.ok { background: rgba(29,161,242,0.12); color: #1da1f2; }
.twitter-status.off { background: var(--bg-subtle, #2a2a2a); color: var(--muted, #848d97); }
.news-table-wrapper { overflow-x: auto; }
.news-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.news-table thead { border-bottom: 2px solid var(--bd-muted, #444); }
.news-table th { text-align: left; padding: 0.6rem 0.8rem; color: var(--muted, #848d97); font-weight: 600; }
.news-table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--bd-muted, #222); vertical-align: middle; }
.news-table__actions { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.badge-published { padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; background: rgba(129,199,132,0.15); color: #81c784; }
.badge-draft { padding: 0.2rem 0.5rem; border-radius: 4px; font-size: 0.75rem; background: var(--bg-subtle, #2a2a2a); color: var(--muted, #848d97); }

/* --- Formulario crear/editar --- */
.news-create { padding: 2rem 1rem; }
.news-create__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
.news-create__header h1 { margin: 0; }
.news-form { max-width: 720px; display: flex; flex-direction: column; gap: 1.2rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.88rem; font-weight: 500; color: var(--muted, #848d97); }
.form-group input[type="text"], .form-group input[type="url"], .form-group textarea, .form-group select { background: var(--bg-subtle, #1e1e1e); border: 1px solid var(--bd-muted, #444); border-radius: 6px; color: var(--default, #e6edf3); padding: 0.5rem 0.75rem; font-size: 0.9rem; font-family: inherit; width: 100%; box-sizing: border-box; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: 2px solid var(--accent, #4493f8); outline-offset: 1px; }
.news-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group--check { flex-direction: row; align-items: center; gap: 0.5rem; }
.form-group--check label { font-size: 0.9rem; cursor: pointer; color: var(--default, #e6edf3); }
.social-texts-section { border: 1px solid var(--bd-muted, #333); border-radius: 8px; padding: 0.75rem 1rem; }
.social-texts-section summary { cursor: pointer; font-size: 0.88rem; color: var(--muted, #848d97); }
.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; padding-top: 0.5rem; }

/* --- Página post-creación --- */
.news-created { padding: 2rem 1rem; }
.news-created__card { max-width: 600px; margin: 0 auto; background: var(--bg-subtle, #1e1e1e); border: 1px solid var(--bd-muted, #333); border-radius: 12px; padding: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.news-created__subtitle { color: var(--muted, #848d97); margin: -0.5rem 0 0; font-size: 0.95rem; }
.share-section { display: flex; flex-direction: column; gap: 0.75rem; }
.share-section h2 { font-size: 1rem; margin: 0; }
.share-url-row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.share-url { flex: 1; background: var(--bg, #0d1117); border: 1px solid var(--bd-muted, #444); border-radius: 5px; padding: 0.4rem 0.7rem; font-size: 0.82rem; color: var(--muted, #848d97); word-break: break-all; }
.share-note { font-size: 0.85rem; color: var(--muted, #848d97); margin: 0; }
.news-created__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* --- Flash messages --- */
.message { padding: 0.6rem 1rem; border-radius: 6px; margin-bottom: 0.75rem; font-size: 0.88rem; }
.message--success { background: rgba(129,199,132,0.12); color: #81c784; }
.message--error { background: rgba(229,115,115,0.12); color: #e57373; }
.message--warning { background: rgba(255,183,77,0.12); color: #ffb74d; }
.message--info { background: rgba(79,195,247,0.12); color: #4fc3f7; }

/* --- Responsive --- */
@media (max-width: 640px) {
  .news-grid { grid-template-columns: 1fr; }
  .news-form .form-row { grid-template-columns: 1fr; }
  .news-detail__title { font-size: 1.35rem; }
  .blog-news-section__header { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .news-filter-tag { padding: 0.4rem 0.85rem; font-size: 0.83rem; }
}

.news-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  color: var(--muted, #848d97);
  border-color: transparent;
  padding: 0.35rem 0.75rem;
}
.news-back-btn:hover {
  color: var(--accent, #4493f8);
  border-color: var(--bd-muted, #444);
}

/* --- Error pages --- */
.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  padding: 3rem 1rem;
}
.error-page__card {
  text-align: center;
  max-width: 480px;
}
.error-page__code {
  display: block;
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--accent, #4493f8);
  opacity: 0.25;
  margin-bottom: 0.5rem;
}
.error-page__title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 1rem;
}
.error-page__msg {
  font-size: 1rem;
  color: var(--muted, #848d97);
  line-height: 1.7;
  margin: 0 0 0.5rem;
}
.error-page__sub {
  font-size: 0.88rem;
  color: var(--muted, #848d97);
  margin: 0 0 2rem;
}
.error-page__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================================
   TechFacil Guides
   ============================================================ */
.techfacil-section {
  display: flex;
  flex-direction: column;
  max-width: 860px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}
.techfacil-header {
  margin-bottom: 2.5rem;
}
.techfacil-header h1 {
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.techfacil-header__subtitle {
  color: var(--muted, #848d97);
  font-size: 0.95rem;
  margin: 0;
}
.techfacil-group {
  margin-bottom: 2.5rem;
}
.techfacil-group__title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent, #4493f8);
  border-bottom: 1px solid var(--bd-muted, #30363d);
  padding-bottom: 0.4rem;
  margin: 0 0 1rem;
}
.techfacil-guide-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.techfacil-guide-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--default);
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
  border: 1px solid transparent;
}
.techfacil-guide-link:hover {
  background: var(--bg-muted);
  border-color: var(--bd-muted);
  color: var(--accent);
}
.techfacil-guide-link__icon {
  font-size: 1rem;
  flex-shrink: 0;
}
.techfacil-guide-link__title {
  flex: 1;
}
.techfacil-guide-link__ext {
  flex-shrink: 0;
  opacity: 0.4;
}
.techfacil-guide-link:hover .techfacil-guide-link__ext {
  opacity: 0.8;
}
.techfacil-empty {
  color: var(--muted, #848d97);
  font-style: italic;
}

/* Enlaces destacados en la página del blog (TechFacil + Cypherpunk) */
.blog-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.blog-link-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--accent, #4493f8);
  border: 1px solid var(--accent, #4493f8);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.blog-link-card:hover {
  background: var(--accent, #4493f8);
  color: var(--bg-default, #0d1117);
}
.blog-link-card__title {
  display: inline-flex;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 600;
}
.blog-link-card__desc {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted, #848d97);
}
.blog-link-card:hover .blog-link-card__desc {
  color: var(--bg-default, #0d1117);
}

/* =============================================
   PORTAL CYPHERPUNK — /btc/
   ============================================= */

.cypher-portal {
    font-family: 'Courier New', 'Fira Code', 'Cascadia Code', monospace;
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    min-height: 60vh;
    position: relative;
}

/* Scanlines overlay */
.cypher-portal::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0,0,0,0.04) 2px,
        rgba(0,0,0,0.04) 4px
    );
    pointer-events: none;
    z-index: 0;
}

/* — Header — */
.cypher-header {
    text-align: center;
    padding: 3rem 0 2.5rem;
}

.cypher-header-eyebrow {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    color: #00ff41;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
    animation: cypher-blink 2s step-end infinite;
}

@keyframes cypher-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

@keyframes cypher-glow-pulse {
    0%, 100% { text-shadow: 0 0 20px rgba(247,147,26,0.4), 0 0 40px rgba(247,147,26,0.15); }
    50% { text-shadow: 0 0 32px rgba(247,147,26,0.65), 0 0 60px rgba(247,147,26,0.25); }
}

.cypher-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 900;
    font-family: 'Courier New', monospace;
    color: #f7931a;
    animation: cypher-glow-pulse 3s ease-in-out infinite;
    margin: 0 0 0.75rem;
    letter-spacing: 0.05em;
    line-height: 1.1;
}

.cypher-subtitle {
    font-size: 0.88rem;
    color: var(--muted);
    font-family: 'Courier New', monospace;
    letter-spacing: 0.06em;
    opacity: 0.65;
    margin: 0;
}

/* — Divider — */
.cypher-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0,255,65,0.35), transparent);
    margin: 0 0 2.5rem;
}

/* — Sections — */
.cypher-section {
    margin-bottom: 3rem;
    display: block;
}

.cypher-section-header {
    margin-bottom: 1.25rem;
    display: block;
}

.cypher-section-title {
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: #00ff41;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin: 0 0 0.3rem;
    display: block;
}

.cypher-section-sub {
    font-size: 0.76rem;
    color: var(--muted);
    font-family: 'Courier New', monospace;
    opacity: 0.6;
    margin: 0;
    display: block;
}

/* — Resource Cards Grid — */
.cypher-resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.cypher-resource-card {
    border: 1px solid rgba(0, 255, 65, 0.15);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-muted);
    padding: 1.1rem;
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: box-shadow 0.22s, transform 0.15s, border-color 0.22s;
    cursor: pointer;
}

.cypher-resource-card:hover {
    box-shadow: 0 4px 20px rgba(247, 147, 26, 0.12);
    transform: translateY(-2px);
    border-color: rgba(247, 147, 26, 0.45);
    text-decoration: none;
    color: inherit;
}

.cypher-resource-card--nostr {
    border-color: rgba(124, 58, 237, 0.15);
}

.cypher-resource-card--nostr:hover {
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.12);
    border-color: rgba(167, 139, 250, 0.45);
}

.cypher-card-icon {
    font-size: 1.6rem;
    margin-bottom: 0.65rem;
    display: block;
    line-height: 1;
}

.cypher-card-title {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.88rem;
    color: #f7931a;
    margin: 0 0 0.45rem;
    display: block;
    line-height: 1.3;
}

.cypher-resource-card--nostr .cypher-card-title {
    color: #a78bfa;
}

.cypher-card-desc {
    font-size: 0.76rem;
    line-height: 1.55;
    color: var(--muted);
    font-family: 'Courier New', monospace;
    flex: 1;
    margin: 0 0 0.75rem;
    display: block;
}

.cypher-card-cta {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: rgba(0, 255, 65, 0.5);
    display: block;
    transition: color 0.15s;
    margin-top: auto;
}

.cypher-resource-card:hover .cypher-card-cta {
    color: #f7931a;
}

.cypher-resource-card--nostr:hover .cypher-card-cta {
    color: #a78bfa;
}

/* — Address Cards — */
.cypher-addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.cypher-addr-card {
    padding: 1.25rem 1.1rem;
    background: var(--bg-muted);
    border: 1px solid transparent;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cypher-addr-card--lightning { border-color: rgba(56, 189, 248, 0.2); }
.cypher-addr-card--lightning:hover {
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.08);
}

.cypher-addr-card--onchain { border-color: rgba(247, 147, 26, 0.2); }
.cypher-addr-card--onchain:hover {
    border-color: rgba(247, 147, 26, 0.45);
    box-shadow: 0 0 18px rgba(247, 147, 26, 0.08);
}

.cypher-addr-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.cypher-addr-icon { font-size: 1.15rem; }

.cypher-lightning {
    color: #38bdf8;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.cypher-orange {
    color: #f7931a;
    text-shadow: 0 0 10px rgba(247, 147, 26, 0.6);
}

.cypher-addr-label {
    font-family: 'Courier New', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    opacity: 0.7;
}

.cypher-addr-value {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 0.69rem;
    word-break: break-all;
    line-height: 1.55;
    margin-bottom: 0.75rem;
    color: #00ff41;
    opacity: 0.85;
}

.cypher-addr-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* — Cypher Buttons — */
.cypher-btn {
    flex: 1;
    min-width: 80px;
    padding: 0.4rem 0.7rem;
    font-size: 0.71rem;
    font-family: 'Courier New', monospace;
    border: 1px solid var(--bd-muted);
    border-radius: 4px;
    background: var(--bg-default);
    color: var(--default);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    line-height: 1;
}

.cypher-btn:hover {
    border-color: #f7931a;
    background: rgba(247, 147, 26, 0.08);
    color: #f7931a;
    text-decoration: none !important;
}

.cypher-btn.copied {
    background: rgba(0, 255, 65, 0.12);
    color: #00ff41;
    border-color: rgba(0, 255, 65, 0.4);
}

.cypher-btn--nostr:hover {
    border-color: #a78bfa;
    background: rgba(124, 58, 237, 0.08);
    color: #a78bfa;
}

/* — Nostr Card — */
.cypher-nostr-card {
    padding: 1.25rem 1.1rem;
    background: var(--bg-muted);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cypher-nostr-card:hover {
    border-color: rgba(167, 139, 250, 0.45);
    box-shadow: 0 0 18px rgba(124, 58, 237, 0.08);
}

.cypher-nostr-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
}

.cypher-nostr-icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 0 6px rgba(124, 58, 237, 0.5));
}

.cypher-nostr-label {
    font-family: 'Courier New', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #a78bfa;
}

.cypher-nostr-value {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 0.69rem;
    word-break: break-all;
    line-height: 1.55;
    margin-bottom: 0.75rem;
    color: #a78bfa;
    opacity: 0.85;
}

.cypher-nostr-profile-btn {
    padding: 0.4rem 1rem;
    font-size: 0.71rem;
    font-family: 'Courier New', monospace;
    border: 1px solid rgba(124, 58, 237, 0.35);
    border-radius: 4px;
    background: rgba(124, 58, 237, 0.08);
    color: #a78bfa;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    line-height: 1;
    white-space: nowrap;
}

.cypher-nostr-profile-btn:hover {
    border-color: #a78bfa;
    background: rgba(124, 58, 237, 0.18);
    color: #c4b5fd;
    text-decoration: none !important;
}

/* — Portal Footer — */
.cypher-portal-footer {
    text-align: center;
    padding: 2rem 0 0;
    border-top: 1px solid rgba(0, 255, 65, 0.12);
    margin-top: 1rem;
}

.cypher-footer-text {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: rgba(0, 255, 65, 0.35);
    text-transform: uppercase;
}

/* — Responsive — */
@media (max-width: 768px) {
    .cypher-portal { padding: 1.5rem 1rem 3rem; }
    .cypher-resources-grid { grid-template-columns: repeat(2, 1fr); }
    .cypher-addresses-grid { grid-template-columns: 1fr; }
    .cypher-title { font-size: 2rem; }
    .cypher-header { padding: 2rem 0 1.8rem; }
}

@media (max-width: 480px) {
    .cypher-resources-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .cypher-header-eyebrow { animation: none; opacity: 1; }
    .cypher-title { animation: none; text-shadow: 0 0 20px rgba(247,147,26,0.4); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROJECTS GALLERY — /projects  (rediseño profesional, scoped a .projects-gallery)
   ═══════════════════════════════════════════════════════════════════════════ */
.projects-gallery {
    --pg-radius: 16px;
    --pg-accent: var(--accent);
    max-width: 1180px;
    margin: 0 auto;
    padding: 1rem 0 3rem;
}

/* ── Cabecera editorial ──────────────────────────────────────────────────── */
.pg-head {
    position: relative;
    padding: 1.5rem 0 2rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--bd-muted);
}
.pg-eyebrow {
    margin: 0 0 .5rem;
    font-family: var(--ft-mono);
    font-size: .72rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--muted, var(--dark-muted));
    opacity: .85;
}
.pg-title {
    font-family: "Bricolage Grotesque", var(--ft);
    font-weight: 800;
    font-size: clamp(2.6rem, 7vw, 4.4rem);
    line-height: .96;
    letter-spacing: -.03em;
    margin: 0 0 .6rem;
    background: linear-gradient(95deg, var(--default) 30%, var(--pg-accent) 130%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.pg-lede {
    max-width: 46ch;
    margin: 0 0 1.5rem;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--muted, var(--dark-muted));
}

/* ── Leyenda de badges ───────────────────────────────────────────────────── */
.pg-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .55rem;
    max-width: 640px;
}
.pg-legend li {
    display: flex;
    align-items: center;
    gap: .7rem;
    flex-wrap: wrap;
}
.pg-legend-txt {
    font-size: .85rem;
    line-height: 1.4;
    color: var(--muted, var(--dark-muted));
}

/* ── Grid de tarjetas ────────────────────────────────────────────────────── */
.pg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.4rem;
    /* anula el flex de la regla global `section` */
}

/* ── Tarjeta ─────────────────────────────────────────────────────────────── */
.pg-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--bg-muted);
    border: 1px solid var(--bd-muted);
    border-radius: var(--pg-radius);
    overflow: hidden;
    min-width: 0;
    transition: transform .28s cubic-bezier(.2,.7,.2,1),
                border-color .28s ease,
                box-shadow .28s ease;
    opacity: 0;
    transform: translateY(14px);
    animation: pg-rise .6s cubic-bezier(.2,.7,.2,1) forwards;
}
.pg-card:nth-child(1) { animation-delay: .03s; }
.pg-card:nth-child(2) { animation-delay: .09s; }
.pg-card:nth-child(3) { animation-delay: .15s; }
.pg-card:nth-child(4) { animation-delay: .21s; }
.pg-card:nth-child(5) { animation-delay: .27s; }
.pg-card:nth-child(6) { animation-delay: .33s; }
.pg-card:nth-child(7) { animation-delay: .39s; }
.pg-card:nth-child(8) { animation-delay: .45s; }
.pg-card:nth-child(n+9) { animation-delay: .5s; }

@keyframes pg-rise {
    to { opacity: 1; transform: translateY(0); }
}

.pg-card:hover {
    transform: translateY(-6px);
    border-color: hsl(var(--pg-hue, 210) 80% 60% / .55);
    box-shadow: 0 18px 40px -22px hsl(var(--pg-hue, 210) 80% 45% / .65),
                0 2px 0 0 hsl(var(--pg-hue, 210) 80% 60% / .25) inset;
}

/* ── Zona media (imagen o logo por defecto) ──────────────────────────────── */
.pg-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-accent);
    border-bottom: 1px solid var(--bd-muted);
}
.pg-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s cubic-bezier(.2,.7,.2,1);
}
.pg-card:hover .pg-cover { transform: scale(1.05); }

/* logo real sobre fondo neutro */
.pg-logo-wrap {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(120% 100% at 0% 0%, hsl(var(--pg-hue,210) 45% 22% / .35), transparent 60%),
        var(--bg-accent);
}
.pg-logo {
    max-width: 70%;
    max-height: 78%;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,.3));
}

/* logo generado por defecto */
.pg-default-logo {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background:
        radial-gradient(130% 120% at 15% 12%, hsl(var(--pg-hue,210) 85% 58%) 0%, transparent 55%),
        radial-gradient(120% 130% at 100% 100%, hsl(calc(var(--pg-hue,210) + 45) 80% 48%) 0%, transparent 52%),
        linear-gradient(135deg, hsl(var(--pg-hue,210) 60% 16%), hsl(calc(var(--pg-hue,210) + 30) 55% 10%));
    overflow: hidden;
}
.pg-default-logo::before {
    /* trama de puntos sutil */
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.18) 1px, transparent 1.4px);
    background-size: 16px 16px;
    opacity: .35;
    mix-blend-mode: overlay;
}
.pg-monogram {
    position: relative;
    font-family: "Bricolage Grotesque", var(--ft);
    font-weight: 800;
    font-size: clamp(3.2rem, 9vw, 4.6rem);
    line-height: 1;
    color: #fff;
    letter-spacing: -.04em;
    text-shadow: 0 4px 24px rgba(0,0,0,.35);
}
.pg-default-mark {
    position: absolute;
    left: 14px;
    bottom: 12px;
    font-family: var(--ft-mono);
    font-size: .62rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.78);
}

/* ── Badges sobre la media ───────────────────────────────────────────────── */
.pg-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: calc(100% - 60px);
}

/* Sobre la media el fondo es arbitrario (degradados claros/oscuros): los badges
   usan un respaldo opaco oscuro para mantener contraste legible siempre. */
.pg-badges .auth-badge {
    color: #fff;
    background: rgba(13, 17, 23, .82);
    border-color: rgba(255, 255, 255, .22);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}
.pg-badges .auth-badge--public { color: #57e08a; }
.pg-badges .auth-badge--login  { color: #79b8ff; }
.pg-badges .auth-badge--admin  { color: #ff8e86; }

/* estilos base de badges (usados también en la leyenda) */
.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    line-height: 1;
}
.auth-badge--public {
    color: var(--success, var(--dark-success));
    background: color-mix(in srgb, var(--success, #3fb950) 16%, transparent);
    border-color: color-mix(in srgb, var(--success, #3fb950) 45%, transparent);
}
.auth-badge--public::before { content: "✓"; font-weight: 800; }
.auth-badge--login {
    color: var(--accent, var(--dark-accent));
    background: color-mix(in srgb, var(--accent, #4493f8) 16%, transparent);
    border-color: color-mix(in srgb, var(--accent, #4493f8) 45%, transparent);
}
.auth-badge--login::before { content: "🔑"; }
.auth-badge--admin {
    color: var(--danger, var(--dark-danger));
    background: color-mix(in srgb, var(--danger, #f85149) 16%, transparent);
    border-color: color-mix(in srgb, var(--danger, #f85149) 45%, transparent);
}
.auth-badge--admin::before { content: "🛡"; }

.pg-chip-premium {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    border-radius: 999px;
    white-space: nowrap;
    line-height: 1;
    color: #1b1300;
    background: linear-gradient(100deg, #ffd66b, #f7931a);
    border: 1px solid #f7931a;
    box-shadow: 0 2px 10px -2px rgba(247,147,26,.6);
}

/* ── Botón pin ───────────────────────────────────────────────────────────── */
.pg-pin {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    font-size: .95rem;
    border-radius: 50%;
    border: 1px solid var(--bd-muted);
    background: color-mix(in srgb, var(--bg-default) 80%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}
.pg-pin:hover { transform: scale(1.1); }
.pg-pin.pinned { background: color-mix(in srgb, var(--accent) 25%, var(--bg-default)); }

/* ── Cuerpo ──────────────────────────────────────────────────────────────── */
.pg-body {
    padding: 1.05rem 1.15rem .6rem;
    flex: 1 1 auto;
}
.pg-card-title {
    font-family: "Bricolage Grotesque", var(--ft);
    font-weight: 700;
    font-size: 1.28rem;
    line-height: 1.15;
    letter-spacing: -.015em;
    margin: 0 0 .5rem;
    color: var(--default);
}
.pg-card-desc {
    margin: 0;
    font-size: .92rem;
    line-height: 1.55;
    color: var(--muted, var(--dark-muted));
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Pie de tarjeta ──────────────────────────────────────────────────────── */
.pg-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem 1.15rem 1.05rem;
    margin-top: auto;
}
.pg-date {
    font-family: var(--ft-mono);
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted, var(--dark-muted));
    opacity: .8;
}
.pg-access {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .42rem .9rem;
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 999px;
    color: var(--bg-default);
    background: var(--default);
    border: 1px solid var(--default);
    transition: background .2s ease, color .2s ease, gap .2s ease, transform .2s ease;
}
.pg-access:hover {
    background: var(--pg-accent);
    border-color: var(--pg-accent);
    color: #fff;
    gap: .65rem;
}
.pg-access-arrow { transition: transform .2s ease; }
.pg-access:hover .pg-access-arrow { transform: translateX(2px); }

.pg-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted, var(--dark-muted));
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .pg-grid { grid-template-columns: 1fr; gap: 1.1rem; }
    .pg-title { font-size: clamp(2.4rem, 13vw, 3.2rem); }
}

@media (prefers-reduced-motion: reduce) {
    .pg-card { animation: none; opacity: 1; transform: none; }
    .pg-card:hover { transform: none; }
    .pg-cover, .pg-access, .pg-access-arrow { transition: none; }
}
