/* board2 gallery only. Keep the site's existing night palette and native links. */
.tc-gallery-board2 .tc-gallery-profile-panel {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 18px 0 4px;
    padding: 18px;
    border: 1px solid var(--tc-line, #3b555d);
    border-radius: 16px;
    background: var(--tc-surface, #1b303c);
}
.tc-gallery-board2 .tc-gallery-profile-avatar {
    display: grid;
    flex: 0 0 56px;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: var(--tc-accent, #83d8bd);
    color: #112b2d;
    font-size: 25px;
    font-weight: 800;
}
.tc-gallery-board2 .tc-gallery-profile-panel h2 {
    margin: 0;
    color: var(--tc-ink, #edf5f1);
    font-size: 19px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.tc-gallery-board2 .tc-gallery-profile-panel p {
    margin: 6px 0 0;
    color: var(--tc-muted, #b1c5bd);
    font-size: 12px;
}
@media (max-width: 760px) {
    .tc-gallery-board2 .tc-gallery-profile-panel {gap: 12px; padding: 14px; margin-top: 10px;}
    .tc-gallery-board2 .tc-gallery-profile-avatar {flex-basis: 44px; width: 44px; height: 44px; border-radius: 14px; font-size: 21px;}
    .tc-gallery-board2 .tc-gallery-profile-panel h2 {font-size: 16px;}
}
.feed-layout:has(.tc-gallery-board2) {
    --tc-gallery-rail: 112px;
    --tc-gallery-gap: 18px;
    background: #111e29;
    font-family: "Segoe UI", "Malgun Gothic", sans-serif;
}

.feed-layout:has(.tc-gallery-board2) *,
.feed-layout:has(.tc-gallery-board2) *::before,
.feed-layout:has(.tc-gallery-board2) *::after {
    box-sizing: border-box;
}

.feed-layout:has(.tc-gallery-board2) [hidden] {
    display: none !important;
}

.feed-layout:has(.tc-gallery-board2) .feed-sidebar {
    z-index: 120;
    width: var(--tc-gallery-rail);
    padding: 26px 12px 22px;
    gap: 10px;
    align-items: stretch;
}

.feed-layout:has(.tc-gallery-board2) .feed-logo {
    align-self: center;
    margin: 0 0 24px;
    line-height: 1;
    padding: 10px;
}

.feed-layout:has(.tc-gallery-board2) .feed-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 6px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
}

.feed-layout:has(.tc-gallery-board2) .feed-user {
    align-items: center;
    gap: 12px;
    text-align: center;
    overflow-wrap: anywhere;
}

.feed-layout:has(.tc-gallery-board2) .feed-user a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 7px;
}

.feed-layout:has(.tc-gallery-board2) .feed-main {
    width: calc(100% - var(--tc-gallery-rail));
    margin-left: var(--tc-gallery-rail);
    min-width: 0;
}

.feed-layout:has(.tc-gallery-board2) .tc-board-local {
    min-height: 100vh;
    padding: 0 28px 28px;
    border-radius: 0;
}

.feed-layout:has(.tc-gallery-board2) .tc-board-split {
    display: block;
}

.feed-layout:has(.tc-gallery-board2) .tc-board-content {
    width: 100%;
    min-width: 0;
}

.feed-layout:has(.tc-gallery-board2) .board > .cTab {
    display: none;
}

.feed-layout:has(.tc-gallery-board2) .tc-unified-scene {
    display: none;
    position: fixed;
    z-index: 130;
    top: auto;
    right: 24px;
    bottom: 24px;
    width: 320px;
    padding: 12px;
    border: 1px solid var(--tc-line, #3b555d);
    border-radius: 22px;
    background: var(--tc-bg, #111e29);
    box-shadow: 0 18px 60px rgba(0, 0, 0, .4);
}

.feed-layout.tc-gallery-scene-open:has(.tc-gallery-board2) .tc-unified-scene {
    display: block;
}

.feed-layout:has(.tc-gallery-board2) .tc-unified-scene .tc-scene,
.feed-layout:has(.tc-gallery-board2) .tc-unified-scene canvas,
.feed-layout:has(.tc-gallery-board2) .tc-unified-scene .tc-scene-fallback {
    height: 220px;
    min-height: 220px;
}

.feed-layout:has(.tc-gallery-board2) .tc-unified-scene > p {
    display: block;
    margin: 7px 0 2px;
}

.feed-layout:has(.tc-gallery-board2) .tc-unified-scene > button {
    display: none;
}

.feed-layout:has(.tc-gallery-board2) .pin-layout,
.feed-layout:has(.tc-gallery-board2) .pin-main {
    min-height: 0;
    padding: 0;
    background: transparent;
}

.feed-layout:has(.tc-gallery-board2) .tc-gallery-topbar {
    position: sticky;
    z-index: 100;
    top: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 92px;
    margin-bottom: 12px;
    padding: 18px 0;
    background: var(--tc-bg, #111e29);
}

.feed-layout:has(.tc-gallery-board2) .pin-search {
    position: relative;
    top: auto;
    z-index: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    margin: 0;
    padding: 0 8px 0 0;
    border: 1px solid #496269;
    border-radius: 16px;
    background: #172b36;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.feed-layout:has(.tc-gallery-board2) .pin-search:focus-within {
    border-color: var(--tc-focus, #94e8cd);
    box-shadow: 0 0 0 3px rgba(131, 216, 189, .12);
}

.feed-layout:has(.tc-gallery-board2) .pin-search input[type="text"] {
    flex: 1;
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 54px;
    padding: 0 18px;
    border: 0;
    border-radius: 16px;
    outline: 0;
    background: transparent;
    color: var(--tc-ink, #edf5f1);
    font-size: 15px;
    box-shadow: none;
}

.feed-layout:has(.tc-gallery-board2) .pin-search input[type="text"]:focus-visible {
    outline: 0 !important;
}

.feed-layout:has(.tc-gallery-board2) .pin-search button,
.feed-layout:has(.tc-gallery-board2) .pin-search .tc-gallery-search-clear {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 8px 10px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--tc-muted, #b1c5bd);
    font: inherit;
    font-size: 13px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.feed-layout:has(.tc-gallery-board2) .pin-search button:hover,
.feed-layout:has(.tc-gallery-board2) .pin-search .tc-gallery-search-clear:hover {
    background: var(--tc-soft, #263e48);
    color: var(--tc-ink, #edf5f1);
}

.feed-layout:has(.tc-gallery-board2) .tc-gallery-scene-toggle {
    min-height: 48px;
    padding: 12px 15px;
    border: 1px solid var(--tc-line, #3b555d);
    border-radius: 14px;
    background: var(--tc-surface, #1b303c);
    color: var(--tc-muted, #b1c5bd);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.feed-layout:has(.tc-gallery-board2) .tc-gallery-scene-toggle:hover,
.feed-layout:has(.tc-gallery-board2) .tc-gallery-scene-toggle[aria-expanded="true"] {
    border-color: #83d8bd;
    color: #83d8bd;
    background: var(--tc-soft, #263e48);
}

.feed-layout:has(.tc-gallery-board2) .pin-category {
    gap: 9px;
    margin: 0 0 20px;
    padding: 0 0 5px;
    scrollbar-width: thin;
    scrollbar-color: #3b555d transparent;
}

.feed-layout:has(.tc-gallery-board2) .pin-category a {
    flex: 0 0 auto;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--tc-muted, #b1c5bd);
}

.feed-layout:has(.tc-gallery-board2) .pin-category a:hover {
    background: var(--tc-soft, #263e48);
    color: var(--tc-ink, #edf5f1);
}

.feed-layout:has(.tc-gallery-board2) .pin-category a.active {
    border-color: var(--tc-line, #3b555d);
    background: var(--tc-soft, #263e48);
    color: var(--tc-accent, #83d8bd);
}

/* CSS columns keep the listing usable before or without the masonry script. */
.feed-layout:has(.tc-gallery-board2) .pin-feed {
    column-count: auto;
    column-width: 230px;
    column-gap: var(--tc-gallery-gap);
    min-width: 0;
}

.feed-layout:has(.tc-gallery-board2) .pin-feed.tc-masonry-ready {
    display: grid;
    grid-template-columns: repeat(var(--tc-gallery-columns), minmax(0, 1fr));
    grid-auto-rows: 1px;
    gap: 0 var(--tc-gallery-gap);
    align-items: start;
}

.feed-layout:has(.tc-gallery-board2) .pin-card {
    display: block;
    width: 100%;
    min-width: 0;
    height: auto;
    margin: 0 0 var(--tc-gallery-gap);
    border: 1px solid var(--tc-line, #3b555d);
    border-radius: 17px;
    background: var(--tc-surface, #1b303c);
    color: var(--tc-ink, #edf5f1);
    break-inside: avoid;
    overflow: hidden;
    backdrop-filter: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.feed-layout:has(.tc-gallery-board2) .pin-feed.tc-masonry-ready .pin-card {
    margin: 0;
}

.feed-layout:has(.tc-gallery-board2) .pin-card:hover {
    transform: none;
    border-color: rgba(94, 234, 255, .45);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
}

.feed-layout:has(.tc-gallery-board2) .pin-card:focus-visible {
    outline: 3px solid var(--tc-focus, #94e8cd) !important;
    outline-offset: 3px;
}

.feed-layout:has(.tc-gallery-board2) .pin-thumb {
    width: 100%;
    height: auto;
    overflow: hidden;
    background: #11131c;
}

.feed-layout:has(.tc-gallery-board2) .pin-card:nth-child(n) .pin-thumb img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    object-fit: contain;
    transform: none;
    transition: filter .2s ease;
}

.feed-layout:has(.tc-gallery-board2) .pin-card:hover .pin-thumb img {
    filter: brightness(.94);
    transform: none;
}

.feed-layout:has(.tc-gallery-board2) .pin-card-body {
    padding: 11px 13px 13px;
    background: var(--tc-surface, #1b303c);
}

.feed-layout:has(.tc-gallery-board2) .pin-title {
    display: block;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.5;
    color: var(--tc-ink, #edf5f1);
}

.feed-layout:has(.tc-gallery-board2) .pin-meta {
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
    color: var(--tc-muted, #b1c5bd);
    font-size: 11px;
    line-height: 1.5;
}

.feed-layout:has(.tc-gallery-board2) .pin-no-thumb {
    min-height: 170px;
    height: auto;
    padding: 30px 15px;
    background: linear-gradient(135deg, #1a3342, #284e50);
    color: var(--tc-muted, #b1c5bd);
}

.feed-layout:has(.tc-gallery-board2) .tc-board-toolbar,
.feed-layout:has(.tc-gallery-board2) .tc-board-pages {
    margin: 22px 0 0;
    gap: 8px;
}

.feed-layout:has(.tc-gallery-board2) .tc-board-pages {
    justify-content: center;
}

.feed-layout:has(.tc-gallery-board2) .tc-board-toolbar a,
.feed-layout:has(.tc-gallery-board2) .tc-board-pages a {
    min-width: 40px;
    min-height: 40px;
    padding: 7px 12px;
    text-align: center;
}

.feed-layout:has(.tc-gallery-board2) .tc-gallery-more {
    display: block;
    min-width: 140px;
    min-height: 44px;
    margin: 24px auto 0;
    padding: 10px 22px;
    border: 1px solid var(--tc-line, #3b555d);
    border-radius: 12px;
    background: var(--tc-soft, #263e48);
    color: var(--tc-ink, #edf5f1);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

.feed-layout:has(.tc-gallery-board2) .tc-gallery-more:hover {
    border-color: var(--tc-accent, #83d8bd);
}

.feed-layout:has(.tc-gallery-board2) .tc-gallery-more:disabled {
    cursor: wait;
}

.feed-layout:has(.tc-gallery-board2) .tc-gallery-status {
    margin: 12px 0 0;
    color: var(--tc-muted, #b1c5bd);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

.feed-layout:has(.tc-gallery-board2) .tc-gallery-status:empty {
    display: none;
}

.feed-layout:has(.tc-gallery-board2) .tc-gallery-empty {
    margin: 24px 0;
    padding: 50px 20px;
    border: 1px solid var(--tc-line, #3b555d);
    border-radius: 16px;
    background: var(--tc-surface, #1b303c);
    color: var(--tc-muted, #b1c5bd);
    font-size: 14px;
    line-height: 1.7;
    text-align: center;
}

@media (max-width: 900px) and (min-width: 761px) {
    .feed-layout:has(.tc-gallery-board2) {
        --tc-gallery-rail: 96px;
    }

    .feed-layout:has(.tc-gallery-board2) .tc-board-local {
        padding-right: 20px;
        padding-left: 20px;
    }
}

@media (max-width: 760px) {
    .feed-layout:has(.tc-gallery-board2) {
        --tc-gallery-rail: 0px;
        --tc-gallery-gap: 12px;
        display: block;
        padding-top: 64px;
    }

    .feed-layout:has(.tc-gallery-board2) .feed-sidebar {
        top: 0;
        right: 0;
        bottom: auto;
        width: 100%;
        height: 64px;
        flex-direction: row;
        align-items: center;
        gap: 5px;
        padding: 8px 10px;
        border-right: 0;
        border-bottom: 1px solid rgba(94, 234, 255, .18);
    }

    .feed-layout:has(.tc-gallery-board2) .feed-logo {
        flex: 0 0 34px;
        margin: 0 4px 0 0;
        padding: 3px;
        font-size: 27px;
        text-align: center;
    }

    .feed-layout:has(.tc-gallery-board2) .feed-nav {
        flex: 0 0 auto;
        min-height: 42px;
        padding: 10px;
        border-radius: 12px;
        font-size: 12px;
    }

    .feed-layout:has(.tc-gallery-board2) .feed-user {
        flex-direction: row;
        justify-content: flex-end;
        min-width: 0;
        margin: 0 0 0 auto;
        gap: 2px;
        font-size: 11px;
    }

    .feed-layout:has(.tc-gallery-board2) .feed-user > span {
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .feed-layout:has(.tc-gallery-board2) .feed-user a {
        min-height: 42px;
        padding: 5px;
        white-space: nowrap;
    }

    .feed-layout:has(.tc-gallery-board2) .feed-main {
        width: 100%;
        margin-left: 0;
    }

    .feed-layout:has(.tc-gallery-board2) .tc-board-local {
        min-height: calc(100vh - 64px);
        padding: 0 12px 24px;
    }

    .feed-layout:has(.tc-gallery-board2) .tc-gallery-topbar {
        top: 64px;
        gap: 8px;
        min-height: 80px;
        margin-bottom: 10px;
        padding: 12px 0;
    }

    .feed-layout:has(.tc-gallery-board2) .pin-search {
        padding-right: 4px;
        border-radius: 14px;
    }

    .feed-layout:has(.tc-gallery-board2) .pin-search input[type="text"] {
        height: 50px;
        padding-right: 5px;
        padding-left: 13px;
        font-size: 16px;
    }

    .feed-layout:has(.tc-gallery-board2) .pin-search button,
    .feed-layout:has(.tc-gallery-board2) .pin-search .tc-gallery-search-clear {
        min-width: 34px;
        padding: 8px;
        font-size: 12px;
    }

    .feed-layout:has(.tc-gallery-board2) .tc-gallery-scene-toggle {
        min-height: 44px;
        padding: 10px;
        border-radius: 12px;
        font-size: 11px;
    }

    .feed-layout:has(.tc-gallery-board2) .pin-feed {
        column-count: 2;
        column-width: auto;
    }

    .feed-layout:has(.tc-gallery-board2) .pin-feed.tc-masonry-ready {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .feed-layout:has(.tc-gallery-board2) .pin-card {
        border-radius: 14px;
    }

    .feed-layout:has(.tc-gallery-board2) .pin-card-body {
        padding: 9px 10px 11px;
    }

    .feed-layout:has(.tc-gallery-board2) .pin-title {
        font-size: 13px;
    }

    .feed-layout:has(.tc-gallery-board2) .pin-meta {
        font-size: 10px;
        gap: 4px;
    }

    .feed-layout:has(.tc-gallery-board2) .pin-no-thumb {
        min-height: 145px;
        padding: 25px 10px;
    }

    .feed-layout:has(.tc-gallery-board2) .tc-unified-scene {
        right: 12px;
        bottom: 12px;
        width: min(320px, calc(100vw - 24px));
    }

    .feed-layout:has(.tc-gallery-board2) .tc-unified-scene .tc-scene,
    .feed-layout:has(.tc-gallery-board2) .tc-unified-scene canvas,
    .feed-layout:has(.tc-gallery-board2) .tc-unified-scene .tc-scene-fallback {
        height: 180px;
        min-height: 180px;
    }
}

@media (max-width: 360px) {
    .feed-layout:has(.tc-gallery-board2) .feed-sidebar {
        gap: 2px;
        padding-right: 6px;
        padding-left: 6px;
    }

    .feed-layout:has(.tc-gallery-board2) .feed-logo {
        flex-basis: 28px;
        margin-right: 0;
    }

    .feed-layout:has(.tc-gallery-board2) .feed-nav {
        padding-right: 8px;
        padding-left: 8px;
    }

    .feed-layout:has(.tc-gallery-board2) .feed-user > span {
        max-width: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .feed-layout:has(.tc-gallery-board2) .pin-card,
    .feed-layout:has(.tc-gallery-board2) .pin-thumb img,
    .feed-layout:has(.tc-gallery-board2) .pin-search {
        transition: none;
    }
}
