:root {
    --bg: #0f1218;
    --panel: #171c26;
    --border: #2a3344;
    --text: #e8ecf3;
    --muted: #9aa3b2;
    --accent: #4f8cff;
    --danger: #e85d5d;
    --radius: 10px;
    font-family: "Segoe UI", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

.top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: #eeeeee;
}
	.top h1{
		color:gray;
	}

h1 {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0;
}

.tagline {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.tagline code {
    color: #b8c7eb;
    background: #1a2230;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.owner-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.owner-session span {
    font-weight: 500;
    color: #9ed4a8;
}

.layout-single {
    max-width: 920px;
    margin: 0 auto;
    padding: 1.25rem;
}

.layout-editor {
    max-width: 1180px;
}

.layout-editor__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 880px) {
    .layout-editor__grid {
        grid-template-columns: 1fr;
    }
}

.layout-editor__form {
    min-width: 0;
}

.layout-editor__albums {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
}

.my-albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
    gap: 0.85rem;
    margin-top: 0.85rem;
}

.layout-editor__albums .my-albums-grid {
    grid-template-columns: 1fr;
}

.my-albums-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #141924;
    cursor: pointer;
    text-align: left;
    color: inherit;
    font: inherit;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.my-albums-card:hover,
.my-albums-card:focus-visible {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.25);
}

.my-albums-card__thumb-wrap {
    aspect-ratio: 1;
    background: #0d1016;
    display: flex;
    align-items: center;
    justify-content: center;
}

.my-albums-card__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.my-albums-card__thumb--empty {
    width: 42%;
    height: 42%;
    opacity: 0.35;
}

.my-albums-card__title {
    margin: 0;
    padding: 0 0.55rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.my-albums-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 0;
}

.my-albums-toolbar .status {
    margin: 0;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.panel h2 {
    margin: 1.5rem 0 0.75rem;
    font-size: 1.05rem;
}

.panel h2:first-of-type {
    margin-top: 0;
}

.panel label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 0.85rem;
}

.panel input,
.panel textarea,
.panel select {
    padding: 0.45rem 0.55rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #12161f;
    color: var(--text);
}

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.category-heading {
    margin: 1rem 0 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.category-cascade .row-cat {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.category-cascade label select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 520px) {
    .row-2 {
        grid-template-columns: 1fr;
    }
}

.hint {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0.5rem 0 1rem;
}

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    background: #10141c;
    cursor: pointer;
    outline: none;
}

.drop-zone:focus-visible {
    border-color: var(--accent);
}

.drop-zone.dragover {
    border-color: var(--accent);
    background: #151b28;
}

.image-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.image-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #12161f;
    cursor: grab;
}

.image-list li.dragging {
    opacity: 0.6;
}

.thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: #000;
}

.img-meta {
    flex: 1;
    font-size: 0.8rem;
    color: var(--muted);
    word-break: break-all;
}

.btn-cover,
.btn-edit,
.btn-remove {
    flex-shrink: 0;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
}

.btn-cover,
.btn-edit {
    border: 1px solid var(--border);
    background: #1e2430;
    color: var(--text);
}

.btn-remove {
    border: 1px solid var(--danger);
    background: transparent;
    color: #ffb4b4;
}

.btn {
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #1e2430;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
}

.btn.primary {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
}

.btn.ghost {
    background: transparent;
	color: white;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.status {
    font-size: 0.85rem;
    color: var(--muted);
}

.status.ok {
    color: #9ed4a8;
}

.status.err {
    color: #ffb4b4;
}

.modal {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text);
    padding: 0;
    max-width: 420px;
}

.modal::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.modal form {
    padding: 1.25rem;
    margin: 0;
}

.modal h3 {
    margin: 0 0 0.5rem;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.modal-actions a.btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-modal {
    max-width: min(96vw, 520px);
    width: 100%;
}

.auth-modal__inner {
    padding: 1.25rem;
}

.auth-modal__inner > h3 {
    margin: 0 0 0.5rem;
}

.auth-modal__intro {
    margin-top: 0.35rem;
}

.auth-google-hero {
    margin: 1rem 0 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid rgba(91, 141, 239, 0.45);
    background: linear-gradient(165deg, rgba(79, 140, 255, 0.12) 0%, rgba(23, 28, 38, 0.95) 55%);
}

.auth-google-hero__title {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #b8c9f5;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 1.1rem;
    border-radius: 10px;
    border: 1px solid #dadce0;
    background: #fff;
    color: #3c4043;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    font-family: inherit;
}

.btn-google:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    border-color: #c6c9ce;
}

.btn-google:active {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.btn-google__mark {
    flex-shrink: 0;
}

.btn-google__label {
    line-height: 1.2;
}

.hint--oauth-hint {
    margin: 0.75rem 0 0.5rem;
    font-size: 0.8rem;
}

.auth-btn-refresh {
    width: 100%;
    margin-top: 0.25rem;
}

.auth-sep {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 1rem 0;
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-sep::before,
.auth-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-inline-form label {
    display: block;
    margin-bottom: 0.65rem;
    font-size: 0.9rem;
}

.auth-inline-form input {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.45rem 0.55rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    box-sizing: border-box;
}

.auth-inline-actions {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.auth-aux {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.auth-aux__lead {
    margin: 0 0 0.65rem;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
}

.auth-aux__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-btn-aux {
    width: 100%;
    text-align: center;
}

.hint--popup-tip {
    margin: 0.65rem 0 0;
    font-size: 0.76rem;
}

.auth-aux__links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.65rem;
}

.auth-aux__link {
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-aux__link:hover {
    color: #7eb0ff;
}

.auth-actions--footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

/* Éditeur d’image intégré (Fabric.js) */
.btn-edit {
    flex-shrink: 0;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    cursor: pointer;
}

.btn-edit:hover {
    background: rgba(91, 141, 239, 0.12);
}

.album-img-editor-dialog {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text);
    padding: 0;
    width: min(96vw, 1200px);
    max-height: 92vh;
}

.album-img-editor-dialog::backdrop {
    background: rgba(0, 0, 0, 0.65);
}

.album-img-editor {
    display: flex;
    flex-direction: column;
    max-height: 92vh;
}

.album-img-editor__head {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.album-img-editor__head h2 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
}

.album-img-editor__grid {
    display: grid;
    grid-template-columns: minmax(140px, 180px) minmax(200px, 1fr) minmax(160px, 220px);
    gap: 0.75rem;
    padding: 0.75rem;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.album-img-editor__toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    font-size: 0.82rem;
}

.album-img-editor__group h3 {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.album-img-editor__group .btn {
    width: 100%;
    margin-bottom: 0.35rem;
    justify-content: center;
}

.album-img-editor__canvas-wrap {
    overflow: auto;
    max-height: min(70vh, 720px);
    background: #0a0c10;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0.5rem;
}

.album-img-editor__canvas-wrap canvas {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.album-img-editor__props {
    overflow-y: auto;
    font-size: 0.82rem;
    border-left: 1px solid var(--border);
    padding-left: 0.75rem;
}

.album-img-editor__props h3 {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
}

.album-editor-property-item {
    margin-bottom: 0.5rem;
}

.album-editor-property-item label {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.album-editor-property-item input,
.album-editor-property-item textarea {
    width: 100%;
    padding: 0.35rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #12161f;
    color: var(--text);
    font-size: 0.82rem;
}

.album-editor-no-selection {
    color: var(--muted);
    font-size: 0.8rem;
    margin: 0;
}

.album-img-editor__foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
    .album-img-editor__grid {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .album-img-editor__props {
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: 0.75rem;
    }

    .album-img-editor__toolbar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .album-img-editor__group {
        flex: 1 1 45%;
    }

    .album-img-editor__group .btn {
        width: auto;
    }
}

/* --- Galerie site (gallery.php) --- */

.gallery-body .gallery-page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 1rem 1.25rem 2rem;
}

.gallery-top-meta {
    margin: 0.35rem 0 0;
    max-width: 36rem;
}

.gallery-global-err {
    margin: 0 1.25rem 1rem;
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    align-items: start;
}

.gallery-viewer {
    width: 100%;
}

.gallery-lower-layout {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(240px, 3fr);
    gap: 1.25rem;
    align-items: start;
}

.gallery-viewer__title {
    margin: 0 0 0.35rem;
    font-size: 1.15rem;
}

.gallery-viewer__descr {
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.45;
    white-space: pre-wrap;
}

.gallery-viewer__descr-box {
    display: grid;
    gap: 0.45rem;
    margin: 0.85rem 0 0;
}

.gallery-viewer__descr-box[hidden] {
    display: none;
}

.gallery-viewer__descr--expanded {
    display: block;
    -webkit-line-clamp: unset;
}

.gallery-viewer__descr-toggle {
    justify-self: start;
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
}

.gallery-download {
    margin: -0.25rem 0 1rem;
}

.gallery-download__toggle {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.gallery-download__panel {
    margin-top: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #12161f;
    padding: 0.65rem;
}

.gallery-download__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 0.55rem;
}

.gallery-download__item {
    display: grid;
    gap: 0.4rem;
    align-content: start;
    min-width: 0;
    padding: 0.35rem;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    background: #0d1016;
}

.gallery-download__item:hover,
.gallery-download__item:focus-visible {
    border-color: var(--accent);
    outline: none;
}

.gallery-download__item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.gallery-download__item span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.78rem;
    text-align: center;
}

.gallery-main-stage {
    background: #0d1016;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-main-img {
    display: block;
    width: 100%;
    max-height: min(72vh, 720px);
    height: auto;
    object-fit: contain;
    cursor: zoom-in;
}

.gallery-empty {
    padding: 2rem;
    text-align: center;
    margin: 0;
}

.gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding: 0;
    list-style: none;
}

.gallery-thumb {
    padding: 0;
    margin: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #12161f;
    width: 76px;
    height: 76px;
    flex-shrink: 0;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-thumb--active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(79, 140, 255, 0.35);
}

.gallery-slideshow-open {
    overflow: hidden;
}

.gallery-slideshow {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(4, 6, 10, 0.94);
    color: var(--text);
}

.gallery-slideshow[hidden] {
    display: none;
}

.gallery-slideshow__bar,
.gallery-slideshow__controls {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
    overflow-x: auto;
}

.gallery-slideshow__bar {
    justify-content: space-between;
}

.gallery-slideshow__title {
    margin: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
    color: var(--muted);
}

.gallery-slideshow__stage {
    position: relative;
    min-height: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #05070b;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.gallery-slideshow__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center;
    transition: transform 0.16s ease;
    user-select: none;
    cursor: zoom-in;
}

.gallery-slideshow__img--zoomed {
    cursor: grab;
    transition: none;
}

.gallery-slideshow__img--zoomed:active {
    cursor: grabbing;
}

.gallery-slideshow__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(12, 16, 24, 0.72);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    transform: translateY(-50%);
    cursor: pointer;
}

.gallery-slideshow__nav--prev {
    left: 0.85rem;
}

.gallery-slideshow__nav--next {
    right: 0.85rem;
}

.gallery-slideshow__controls {
    justify-content: center;
}

.gallery-slideshow__controls .btn,
.gallery-slideshow__bar .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.gallery-slideshow__zoom,
.gallery-slideshow__counter {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 0.84rem;
    min-width: 3.25rem;
    text-align: center;
}

.gallery-engagement {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.gallery-engagement__stats,
.gallery-engagement__actions,
.gallery-share {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
    overflow-x: auto;
    padding-bottom: 0.1rem;
}

.gallery-share__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: #fff;
    font-weight: 800;
    font-size: 0.82rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.gallery-share__btn:hover,
.gallery-share__btn:focus-visible {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.gallery-share__btn--facebook {
    background: #1877f2;
}

.gallery-share__btn--x {
    background: #050505;
}

.gallery-share__btn--whatsapp {
    background: #25d366;
}

.gallery-share__btn--telegram {
    background: #229ed9;
}

.gallery-share__btn--linkedin {
    background: #0a66c2;
}

.gallery-share__btn--pinterest {
    background: #bd081c;
}

.gallery-share__btn--email {
    background: #6b7280;
}

.gallery-share__btn--copy {
    background: #334155;
}

.gallery-engagement__actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.gallery-engagement__actions strong,
.gallery-comment__vote-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #0d1016;
    color: var(--text);
    font-size: 0.72rem;
    line-height: 1;
}

.gallery-engagement__stats span {
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #12161f;
    color: var(--muted);
    font-size: 0.78rem;
}

.gallery-engagement__stats strong {
    color: var(--text);
}

.gallery-vote--active {
    border-color: var(--accent);
    background: #1a2436;
}

.gallery-comment-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: start;
}

.gallery-comment-form textarea {
    width: 100%;
    resize: vertical;
    min-height: 4.5rem;
}

.gallery-comments__list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.gallery-comment {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #12161f;
    padding: 0.65rem;
}

.gallery-comment p {
    margin: 0;
}

.gallery-comment__head,
.gallery-comment__foot {
    color: var(--muted);
    font-size: 0.76rem;
}

.gallery-comment__body {
    margin: 0.35rem 0 !important;
    white-space: pre-wrap;
}

.gallery-comment--reply {
    margin-left: 1rem;
    background: #151b26;
}

.gallery-comment__tools {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    align-items: center;
    overflow-x: auto;
    padding-top: 0.35rem;
}

.gallery-comment__tools .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    padding: 0.35rem 0.55rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.gallery-comment__replies {
    margin-top: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.gallery-reply-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: start;
}

.gallery-reply-form textarea {
    width: 100%;
    resize: vertical;
}

@media (max-width: 640px) {
    .gallery-comment-form {
        grid-template-columns: 1fr;
    }

    .gallery-reply-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .gallery-lower-layout {
        grid-template-columns: 1fr;
    }
}

.gallery-sidebar__title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.gallery-sidebar__hint {
    margin: 0 0 0.85rem;
    font-size: 0.82rem;
}

.gallery-menu {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    max-height: calc(100vh - 11rem);
    overflow-y: auto;
}

.gallery-menu__item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    margin: 0;
    padding: 0.45rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #141924;
    color: inherit;
    font: inherit;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.gallery-menu__item:hover,
.gallery-menu__item:focus-visible {
    border-color: var(--accent);
    outline: none;
}

.gallery-menu__item--active {
    border-color: var(--accent);
    background: #1a2436;
}

.gallery-menu__thumb-wrap {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #0d1016;
}

.gallery-menu__thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-menu__text {
    min-width: 0;
    flex: 1;
}

.gallery-menu__title {
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.top-tools-link {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
}

.top-tools-link a {
    color: var(--accent);
}
