/* Barra de recorte de exportação */
#export-crop-bar {
    position: absolute;
    top: 46px;
    left: calc(50% - var(--right-sidebar-width) / 2);
    transform: translateX(-50%);
    z-index: 15;
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 36px;
}
#export-crop-bar button {
    width: 44px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}
#export-crop-bar button:hover {
    background-color: #f0f0f0;
}
#export-crop-bar button img {
    width: 22px;
    height: 22px;
}

/* Modal de confirmação */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: #ffffff;
    border-radius: 14px;
    padding: 28px 28px 22px;
    width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: 'Huninn', Arial, sans-serif;
}

.modal-title {
    font-size: 16px;
    font-weight: 400;
    color: #000;
}

.modal-message {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.70);
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.modal-btn {
    flex: 1;
    height: 34px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Huninn', Arial, sans-serif;
    font-weight: 400;
    transition: filter 160ms ease;
}

.modal-btn:hover { filter: brightness(0.92); }

.modal-btn-primary {
    background: #f7cf4e;
    color: #000;
}

.modal-btn-danger {
    background: #ff5c5c;
    color: #fff;
}

.modal-btn-secondary {
    background: rgba(0,0,0,0.08);
    color: #000;
}

/* Modal de Configurações */
.modal-settings-box {
    width: 420px;
    max-width: 92vw;
}

.modal-settings-section {
    margin-bottom: 4px;
}

.modal-settings-label {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 8px;
}

.modal-settings-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.modal-settings-option-inactive {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    background: rgba(0,0,0,0.05);
    color: #aaa;
    font-size: 13px;
    cursor: not-allowed;
    user-select: none;
}

.modal-settings-lang-btn {
    padding: 6px 18px;
    border-radius: 8px;
    border: 1.5px solid rgba(0,0,0,0.12);
    background: transparent;
    color: #444;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Huninn', Arial, sans-serif;
    transition: background 160ms, color 160ms, border-color 160ms;
    letter-spacing: 0.04em;
}
.modal-settings-lang-btn:hover {
    background: rgba(0,0,0,0.06);
}
.modal-settings-lang-btn.active {
    background: #f7cf4e;
    color: #1a1a2e;
    border-color: #f7cf4e;
    font-weight: 400;
}

.modal-settings-divider {
    height: 1px;
    background: rgba(0,0,0,0.08);
    margin: 16px 0;
}

/* Toggle switch nas configurações */
.modal-settings-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    user-select: none;
}
.modal-settings-toggle input[type="checkbox"] {
    width: 38px;
    height: 22px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(0,0,0,0.15);
    border-radius: 11px;
    cursor: pointer;
    transition: background 200ms;
    flex-shrink: 0;
    position: relative;
}
.modal-settings-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: transform 200ms;
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.modal-settings-toggle input[type="checkbox"]:checked {
    background: #40B7E3;
}
.modal-settings-toggle input[type="checkbox"]:checked::after {
    transform: translateX(16px);
}

/* Slider expandido: track e hint mais visíveis sobre o gradiente */
.sidebar-slider-row[data-slider-expanded] .sidebar-control[type="range"] {
    border-color: rgba(255,255,255,0.65);
    background: rgba(255,255,255,0.40);
}
.sidebar-slider-row[data-slider-expanded] .sidebar-control[type="range"]::-webkit-slider-thumb {
    box-shadow: 0 2px 10px rgba(0,0,0,0.28);
}
.sidebar-slider-row[data-slider-expanded] .sidebar-control[type="range"]::-moz-range-thumb {
    box-shadow: 0 2px 10px rgba(0,0,0,0.28);
}
.sidebar-slider-row[data-slider-expanded] .sidebar-hint {
    background: rgba(255,255,255,0.88);
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
}

.modal-settings-about {
    font-size: 13px;
    color: #444;
    line-height: 1.6;
}

.modal-settings-about p {
    margin-bottom: 12px;
}

.modal-settings-meta {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #666;
    background: rgba(0,0,0,0.04);
    border-radius: 8px;
    padding: 10px 14px;
    padding-right: 100px;
}

.modal-settings-devlogo {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: 80px;
    object-fit: contain;
}

/* ── Tela de login ─────────────────────────────────────────────────────────── */
#login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    overflow: hidden;
    z-index: 9999;
    font-family: 'Huninn', Arial, sans-serif;
}

/* ── Hero — lado esquerdo, tema azul ─────────────────────────────────────── */
#login-hero {
    flex: 1;
    background: #40B7E3;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Círculos decorativos de fundo */
#login-hero::before,
#login-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.10);
    pointer-events: none;
}
#login-hero::before {
    width: 520px;
    height: 520px;
    bottom: -180px;
    left: -130px;
}
#login-hero::after {
    width: 320px;
    height: 320px;
    top: -90px;
    right: -90px;
}

/* HEADER */
#lh-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 72px;
    position: relative;
    z-index: 2;
    border-bottom: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    flex-shrink: 0;
}
#lh-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: -2vw;
}
#lh-brand-logo {
    width: clamp(60px, 9.375vw, 180px);
    height: clamp(60px, 9.375vw, 180px);
    object-fit: contain;
}
#lh-appname {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
}
#lh-right {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1vw, 16px);
}
#lh-gallery-btn {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.30);
    color: #fff;
    font-family: 'Huninn', Arial, sans-serif;
    font-size: clamp(11px, 0.9vw, 14px);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 150ms;
}
#lh-gallery-btn:hover {
    background: rgba(255,255,255,0.30);
}

/* ── Overlay Galeria ─────────────────────────────────────────────── */
#gallery-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0,0,0,0.55);
    align-items: center;
    justify-content: center;
}
#gallery-overlay.open {
    display: flex;
}
#gallery-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.30);
    width: clamp(320px, 44vw, 500px);
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#gallery-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    border-bottom: 1px solid #eee;
}
#gallery-modal-title {
    font-family: 'Huninn', Arial, sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}
#gallery-close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 150ms;
}
#gallery-close-btn:hover {
    background: #f0f0f0;
    color: #333;
}
#gallery-grid-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}
#gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    color: #999;
    font-size: 15px;
    text-align: center;
}
#gallery-empty-logo {
    width: 52px;
    opacity: 0.25;
}
#gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.gallery-status-msg {
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 40px 0;
}
#gallery-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    margin-right: 12px;
}
#gallery-admin-tabs {
    display: flex;
    gap: 4px;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 3px;
}
.gallery-tab {
    background: none;
    border: none;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Huninn', Arial, sans-serif;
    cursor: pointer;
    color: #666;
    transition: background 150ms, color 150ms;
}
.gallery-tab.active {
    background: #fff;
    color: #1a1a1a;
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}
#gallery-open-submit-btn {
    background: #3a7c45;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 16px;
    font-size: 13px;
    font-family: 'Huninn', Arial, sans-serif;
    cursor: pointer;
    transition: background 150ms;
}
#gallery-open-submit-btn:hover { background: #2d6337; }

/* ── Cards ─────────────────────────────────────────────── */
.gallery-card {
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
    transition: box-shadow 150ms;
}
.gallery-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.gallery-card-thumb {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f0;
}
.gallery-card-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    cursor: pointer;
    transition: transform 200ms;
}
.gallery-card-img:hover { transform: scale(1.04); }
.gallery-card-info {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.gallery-card-title {
    font-size: 13px;
    font-weight: 400;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gallery-card-author {
    font-size: 12px;
    color: #666;
}
.gallery-card-date {
    font-size: 11px;
    color: #aaa;
}
.gallery-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.gallery-approve-btn,
.gallery-reject-btn {
    flex: 1;
    border: none;
    border-radius: 6px;
    padding: 5px 0;
    font-size: 12px;
    font-family: 'Huninn', Arial, sans-serif;
    cursor: pointer;
    transition: background 150ms;
}
.gallery-approve-btn { background: #e6f4ea; color: #2d6337; }
.gallery-approve-btn:hover { background: #c8e6c9; }
.gallery-reject-btn  { background: #fdecea; color: #b71c1c; }
.gallery-reject-btn:hover  { background: #ffcdd2; }

/* ── Submit panel ───────────────────────────────────────── */
#gallery-submit-wrap {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
#gallery-submit-preview-area {
    border: 2px dashed #ddd;
    border-radius: 10px;
    min-height: 100px;
    max-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fafafa;
}
#gallery-submit-preview {
    width: 100%;
    max-height: 160px;
    object-fit: contain;
}
#gallery-submit-hint {
    color: #aaa;
    font-size: 14px;
    text-align: center;
    padding: 20px;
}
#gallery-submit-actions {
    display: flex;
    justify-content: flex-end;
}
#gallery-file-label {
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 11px;
    font-family: 'Huninn', Arial, sans-serif;
    cursor: pointer;
    background: #f5f5f5;
    color: #444;
    transition: background 150ms;
    user-select: none;
}
#gallery-file-label:hover { background: #e8e8e8; }
#gallery-submit-title {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: 'Huninn', Arial, sans-serif;
    outline: none;
    transition: border-color 150ms;
    width: 240px;
    align-self: flex-start;
}
#gallery-submit-title:focus { border-color: #3a7c45; }
#gallery-submit-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
#gallery-submit-cancel {
    background: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 13px;
    font-family: 'Huninn', Arial, sans-serif;
    cursor: pointer;
    color: #666;
    transition: background 150ms;
}
#gallery-submit-cancel:hover { background: #f0f0f0; }
#gallery-submit-btn {
    background: #3a7c45;
    border: none;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 13px;
    font-family: 'Huninn', Arial, sans-serif;
    cursor: pointer;
    color: #fff;
    transition: background 150ms;
}
#gallery-submit-btn:hover:not(:disabled) { background: #2d6337; }
#gallery-submit-btn:disabled { opacity: 0.45; cursor: default; }

/* ── Lightbox ───────────────────────────────────────────── */
#gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0,0,0,0.82);
    align-items: center;
    justify-content: center;
}
#gallery-lightbox.open { display: flex; }
#gallery-lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
#gallery-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    transition: background 150ms;
}
#gallery-lightbox-close:hover { background: rgba(255,255,255,0.28); }
#gallery-lightbox-img {
    max-width: 88vw;
    max-height: 80vh;
    border-radius: 8px;
    object-fit: contain;
}
#gallery-lightbox-title {
    color: rgba(255,255,255,0.80);
    font-size: 14px;
    font-family: 'Huninn', Arial, sans-serif;
}
#lh-contacts {
    position: relative;
}
#lh-contact-btn {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.30);
    color: #fff;
    font-family: 'Huninn', Arial, sans-serif;
    font-size: clamp(11px, 0.9vw, 14px);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 150ms;
}
#lh-contact-btn:hover {
    background: rgba(255,255,255,0.30);
}
#lh-contact-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    padding: 8px 0;
    min-width: 220px;
    z-index: 100;
}
#lh-contact-dropdown.open {
    display: flex;
    flex-direction: column;
}
.lh-contact-item {
    display: flex;
    flex-direction: column;
    padding: 10px 18px;
    text-decoration: none;
    transition: background 120ms;
}
.lh-contact-item:hover {
    background: rgba(0,0,0,0.05);
}
.lh-contact-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}
.lh-contact-item > span:last-child {
    font-size: 13px;
    color: #222;
}
.lh-contact-divider {
    height: 1px;
    background: rgba(0,0,0,0.08);
    margin: 4px 0;
}
#lh-contact-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 18px 14px;
}
#lh-contact-form-title {
    font-size: 12px;
    font-weight: 700;
    color: #333;
    margin: 0 0 2px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
#lh-contact-form input,
#lh-contact-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 7px;
    padding: 7px 10px;
    font-size: 13px;
    font-family: 'Huninn', Arial, sans-serif;
    color: #222;
    background: #f7f7f7;
    outline: none;
    resize: none;
    transition: border-color 150ms;
}
#lh-contact-form input:focus,
#lh-contact-form textarea:focus {
    border-color: #40B7E3;
    background: #fff;
}
#lh-contact-send {
    align-self: flex-end;
    background: #40B7E3;
    color: #fff;
    border: none;
    border-radius: 7px;
    padding: 7px 18px;
    font-size: 13px;
    font-family: 'Huninn', Arial, sans-serif;
    cursor: pointer;
    transition: filter 150ms;
}
#lh-contact-send:hover {
    filter: brightness(0.92);
}
#lh-lang {
    position: relative;
}
#lh-lang-btn {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.30);
    color: #fff;
    font-family: 'Huninn', Arial, sans-serif;
    font-size: clamp(11px, 0.9vw, 14px);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: background 150ms;
}
#lh-lang-btn:hover {
    background: rgba(255,255,255,0.30);
}
#lh-lang-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    padding: 6px 0;
    min-width: 140px;
    z-index: 100;
    flex-direction: column;
}
#lh-lang-dropdown.open {
    display: flex;
}
.lh-lang-option {
    background: transparent;
    border: none;
    text-align: left;
    padding: 10px 18px;
    font-size: 13px;
    font-family: 'Huninn', Arial, sans-serif;
    color: #222;
    cursor: pointer;
    transition: background 120ms;
}
.lh-lang-option:hover {
    background: rgba(0,0,0,0.05);
}
.lh-lang-option.active {
    font-weight: 700;
    color: #40B7E3;
}
#lh-socials {
    display: flex;
    gap: 8px;
}
.lh-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(30px, 2.5vw, 48px);
    height: clamp(30px, 2.5vw, 48px);
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.30);
    transition: background 150ms, transform 150ms;
    text-decoration: none;
}
.lh-social-btn:hover {
    background: rgba(255,255,255,0.32);
    transform: scale(1.08);
}
.lh-social-btn img {
    width: clamp(16px, 1.4vw, 26px);
    height: clamp(16px, 1.4vw, 26px);
    object-fit: contain;
    opacity: 0.90;
}

/* CONTEÚDO CENTRAL */
#lh-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
#lh-scroll::-webkit-scrollbar { width: 4px; }
#lh-scroll::-webkit-scrollbar-track { background: transparent; }
#lh-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.20); border-radius: 2px; }
#lh-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 24px 48px 16px 48px;
    position: relative;
    z-index: 1;
    text-align: center;
}
#lh-tagline {
    font-size: 18px;
    color: rgba(255,255,255,0.92);
    margin: 0 0 28px;
    line-height: 1.55;
    font-weight: 400;
}
#lh-tagline strong {
    color: #fff;
    font-weight: 700;
}
#login-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-width: none;
    width: 100%;
    align-self: stretch;
    text-align: left;
}
#login-features li {
    display: flex;
    align-items: center;
    gap: 16px;
    color: rgba(255,255,255,0.88);
    font-size: 14px;
    line-height: 1.5;
}
.login-feat-icon {
    color: rgba(255,255,255,0.55);
    font-size: 22px;
    flex-shrink: 0;
}
.feat-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex: 1;
}
.feat-tool-icons {
    position: relative;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}
.fti-wrap {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    z-index: 1;
}
.fti-wrap:nth-child(1) { top:  3%; left: 52%; animation: fti1  3.2s ease-in-out infinite; }
.fti-wrap:nth-child(2) { top: 20%; left: 75%; animation: fti2  2.8s ease-in-out infinite; }
.fti-wrap:nth-child(3) { top: 52%; left: 68%; animation: fti3  3.5s ease-in-out infinite; }
.fti-wrap:nth-child(4) { top: 70%; left: 38%; animation: fti4  3.0s ease-in-out infinite; }
.fti-wrap:nth-child(5) { top: 58%; left:  2%; animation: fti5  2.6s ease-in-out infinite; }
.fti-wrap:nth-child(6) { top: 12%; left:  2%; animation: fti6  3.8s ease-in-out infinite; }
.fti-wrap:nth-child(7) { top: 33%; left: 30%; animation: fti7  2.9s ease-in-out infinite; }
.fti-wrap:nth-child(8) { top: 68%; left: 72%; animation: fti8  3.3s ease-in-out infinite; }
.fti-wrap:nth-child(9) { top: 38%; left: 55%; animation: fti9  3.1s ease-in-out infinite; }
.fti-wrap:nth-child(10){ top:  8%; left: 28%; animation: fti10 2.7s ease-in-out infinite; }
.fti-wrap:hover { z-index: 10; animation-play-state: paused; }
.fti {
    width: 40px;
    height: 40px;
    filter: brightness(0) invert(1);
    opacity: 0.80;
    display: block;
    transition: transform 200ms cubic-bezier(0.34,1.56,0.64,1), opacity 150ms;
}
.fti-wrap:hover .fti {
    transform: scale(1.6);
    opacity: 1;
}
.fti-wrap::after {
    content: attr(data-name);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(0,0,0,0.78);
    color: #fff;
    font-size: 11px;
    font-family: 'Huninn', Arial, sans-serif;
    padding: 3px 9px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease, transform 150ms ease;
}
.fti-wrap:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@keyframes fti1 { 0%,100%{transform:translate(0,0)  rotate(0deg)}   50%{transform:translate( 3px,-5px) rotate( 4deg)} }
@keyframes fti2 { 0%,100%{transform:translate(0,0)  rotate(0deg)}   50%{transform:translate(-4px, 4px) rotate(-5deg)} }
@keyframes fti3 { 0%,100%{transform:translate(0,0)  rotate(0deg)}   50%{transform:translate( 5px, 3px) rotate( 3deg)} }
@keyframes fti4 { 0%,100%{transform:translate(0,0)  rotate(0deg)}   50%{transform:translate(-3px,-6px) rotate(-4deg)} }
@keyframes fti5 { 0%,100%{transform:translate(0,0)  rotate(0deg)}   50%{transform:translate( 4px, 5px) rotate( 6deg)} }
@keyframes fti6 { 0%,100%{transform:translate(0,0)  rotate(0deg)}   50%{transform:translate(-5px, 2px) rotate(-3deg)} }
@keyframes fti7 { 0%,100%{transform:translate(0,0)  rotate(0deg)}   50%{transform:translate( 3px,-4px) rotate( 5deg)} }
@keyframes fti8  { 0%,100%{transform:translate(0,0)  rotate(0deg)}   50%{transform:translate(-4px,-3px) rotate(-6deg)} }
@keyframes fti9  { 0%,100%{transform:translate(0,0)  rotate(0deg)}   50%{transform:translate( 4px,-4px) rotate( 5deg)} }
@keyframes fti10 { 0%,100%{transform:translate(0,0)  rotate(0deg)}   50%{transform:translate(-3px, 5px) rotate(-4deg)} }
@keyframes ftiSpin {
    0%   { transform: scale(1.6) rotate(0deg); }
    100% { transform: scale(1.6) rotate(360deg); }
}
.fti-wrap.fti-spin .fti {
    animation: ftiSpin 0.9s ease-out forwards !important;
}
.fti-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 14px;
    width: 200px;
    height: 200px;
}
.fti-grid > .fti-wrap {
    position: static;
}

.feat-content > span {
    font-size: 20px;
    line-height: 1.3;
    flex: 1;
    color: rgba(255,255,255,0.92);
}
.feat-img {
    width: 300px;
    flex-shrink: 0;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.30);
    display: block;
    position: relative;
    z-index: 1;
    transition: transform 250ms cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 250ms ease,
                z-index 0ms;
    cursor: zoom-in;
}
.feat-img:hover {
    transform: scale(2);
    transform-origin: right center;
    box-shadow: 0 16px 48px rgba(0,0,0,0.55);
    z-index: 10;
}
.feat-lake-slider {
    width: 300px;
    aspect-ratio: 1934 / 1802;
    flex-shrink: 0;
    position: relative;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.30);
    overflow: hidden;
    cursor: zoom-in;
    z-index: 1;
    transition: transform 250ms cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 250ms ease;
}
.feat-lake-slider:hover {
    transform: scale(2);
    transform-origin: right center;
    box-shadow: 0 16px 48px rgba(0,0,0,0.55);
    z-index: 10;
}
.feat-lake-slider img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    animation: lake-fade 6s infinite;
}
.feat-lake-slider img:nth-child(1) { animation-delay:  0s; }
.feat-lake-slider img:nth-child(2) { animation-delay: -4s; }
.feat-lake-slider img:nth-child(3) { animation-delay: -2s; }
@keyframes lake-fade {
    0%, 16.67% { opacity: 1; }
    25%, 91.67% { opacity: 0; }
    100%        { opacity: 1; }
}
.feat-asset-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.45);
    display: block;
    transition: transform 200ms cubic-bezier(0.34,1.56,0.64,1);
}
.fti-wrap:hover .feat-asset-img {
    transform: scale(1.6);
}
.fti-wrap.fti-spin .feat-asset-img {
    animation: ftiSpin 0.9s ease-out forwards !important;
}
@keyframes ati1 { 0%,100%{transform:translate(0,0)} 50%{transform:translate( 3px,-5px)} }
@keyframes ati2 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-4px, 4px)} }
@keyframes ati3 { 0%,100%{transform:translate(0,0)} 50%{transform:translate( 5px, 3px)} }
@keyframes ati4 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-3px,-6px)} }
@keyframes ati5 { 0%,100%{transform:translate(0,0)} 50%{transform:translate( 4px, 5px)} }
@keyframes ati6 { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-5px, 2px)} }
@keyframes ati7 { 0%,100%{transform:translate(0,0)} 50%{transform:translate( 3px,-4px)} }
.feat-img-left {
    width: 200px;
}
.feat-img-left:hover {
    transform: scale(1.07) translateY(-5px);
    transform-origin: center bottom;
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}

/* BANNER HERO */
#lh-hero-banner {
    position: relative;
    height: clamp(220px, 34vh, 380px);
    flex-shrink: 0;
    overflow: hidden;
}
#lh-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
}
#lh-banner-overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 48px;
}
#lh-banner-title {
    color: #fff;
    font-size: clamp(17px, 2vw, 28px);
    font-weight: 400;
    line-height: 1.7;
    text-align: center;
    margin: 0;
    padding: 18px 40px;
    background: transparent;
    border: none;
    text-shadow:
        0 0  3px rgba(0,0,0,0.90),
        0 0  8px rgba(0,0,0,0.70),
        0 0 18px rgba(0,0,0,0.50),
        0 0 36px rgba(0,0,0,0.30),
        0 0 60px rgba(0,0,0,0.15);
}
#lh-banner-title strong {
    font-weight: 700;
    color: #f7cf4e;
}

/* CARROSSEL */
#lh-body {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    min-height: 0;
}

#login-showcase {
    display: flex;
    flex-direction: row;
    width: 110px;
    flex-shrink: 0;
    overflow: hidden;
    padding: 12px 8px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 8%, black 92%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 8%, black 92%, transparent);
}
.showcase-track {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: max-content;
    flex: 1;
}
.showcase-track-up { animation: showcaseUp 32s linear infinite; }
.showcase-img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 3px 14px rgba(0,0,0,0.28);
    cursor: zoom-in;
}
.showcase-track:has(.showcase-img:hover) {
    animation-play-state: paused;
}

/* Overlay de zoom — posicionado via JS */
#showcase-zoom-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease;
    background: rgba(0,0,0,0.45);
}
#showcase-zoom-backdrop.active { opacity: 1; }

#showcase-zoom-img {
    position: fixed;
    z-index: 10001;
    border-radius: 14px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.65);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 250ms cubic-bezier(0.34,1.56,0.64,1),
                transform 250ms cubic-bezier(0.34,1.56,0.64,1);
    object-fit: cover;
}
#showcase-zoom-img.active {
    opacity: 1;
    transform: scale(1);
}
@keyframes showcaseUp {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}
@keyframes showcaseDown {
    0%   { transform: translateY(-50%); }
    100% { transform: translateY(0); }
}

/* BADGE MAPE STUDIO */
#mape-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
    padding: 10px 20px 10px 10px;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 50px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
#mape-badge-logo {
    width: 66px;
    height: 66px;
    border-radius: 10%;
    object-fit: contain;
    background: #fff;
    padding: 3px;
    box-sizing: border-box;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.20);
}
#mape-badge-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-align: left;
}
#mape-badge-by {
    font-size: 10px;
    color: rgba(255,255,255,0.60);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}
#mape-badge-name {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.2px;
}

/* FOOTER */
#lh-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: rgba(0,0,0,0.10);
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.12);
}
#mape-copyright {
    font-size: 11px;
    color: rgba(255,255,255,0.40);
}

/* ── Lado direito — card de login ────────────────────────────────────────── */
#login-side {
    width: 400px;
    flex-shrink: 0;
    background: #f4f6f8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    box-sizing: border-box;
    height: 100%;
    overflow-y: auto;
}

#login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px 32px;
    width: 100%;
    box-shadow: 0 4px 24px rgba(0,0,0,0.09);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

#login-logo {
    width: 156px;
    height: 156px;
    object-fit: contain;
    margin-bottom: 4px;
}

#login-title {
    font-size: 20px;
    font-weight: 600;
    color: #000;
    margin: 0;
    font-family: 'Huninn', Arial, sans-serif;
}

#login-desc {
    font-size: 13px;
    color: rgba(0,0,0,0.50);
    text-align: center;
    margin: 0 0 8px;
    line-height: 1.5;
}

#login-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 46px;
    border: 1.5px solid rgba(0,0,0,0.15);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Huninn', Arial, sans-serif;
    color: #333;
    transition: background 160ms, box-shadow 160ms;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
#login-google-btn:hover {
    background: #f7f7f7;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
#login-google-btn:disabled,
#login-google-btn.loading {
    opacity: 0.6;
    cursor: default;
}
#login-google-btn img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

#login-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    color: rgba(0,0,0,0.30);
    font-size: 12px;
}
#login-divider span:first-child,
#login-divider span:last-child {
    flex: 1;
    height: 1px;
    background: rgba(0,0,0,0.12);
}

#login-email-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}
#login-email-form input {
    width: 100%;
    box-sizing: border-box;
    height: 42px;
    border: 1.5px solid rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    font-family: 'Huninn', Arial, sans-serif;
    color: #222;
    outline: none;
    transition: border-color 150ms;
}
#login-email-form input:focus {
    border-color: #40B7E3;
}
#login-name,
#login-confirm-password {
    display: none;
}
#login-email-btn {
    width: 100%;
    height: 42px;
    background: #40B7E3;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Huninn', Arial, sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: filter 150ms;
    margin-top: 2px;
}
#login-email-btn:hover { filter: brightness(0.92); }
#login-email-btn:disabled { opacity: 0.6; cursor: not-allowed; }

#login-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
#login-toggle-btn {
    background: none;
    border: none;
    color: #40B7E3;
    font-size: 13px;
    font-family: 'Huninn', Arial, sans-serif;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
#login-toggle-btn:hover { color: #2a9bc4; }
#login-forgot-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 12px;
    font-family: 'Huninn', Arial, sans-serif;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
#login-forgot-btn:hover { color: #666; }

#login-demo-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    color: rgba(0,0,0,0.30);
    font-size: 12px;
    margin-top: 4px;
}
#login-demo-divider span:first-child,
#login-demo-divider span:last-child {
    flex: 1;
    height: 1px;
    background: rgba(0,0,0,0.12);
}
#login-demo-btn {
    width: 100%;
    height: 42px;
    border: none;
    border-radius: 8px;
    background: #27ae60;
    color: #fff;
    font-size: 14px;
    font-family: 'Huninn', Arial, sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: filter 150ms;
}
#login-demo-btn:hover { filter: brightness(0.92); }


#login-error {
    font-size: 12px;
    color: #c0392b;
    text-align: center;
    display: none;
    margin: 0;
}
#login-error.login-success {
    color: #27ae60;
}

#login-signup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(0,0,0,0.55);
}
#login-signup-btn {
    background: none;
    border: none;
    color: #40B7E3;
    font-size: 13px;
    font-family: 'Huninn', Arial, sans-serif;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
#login-signup-btn:hover {
    color: #2a9bc4;
}

#login-footer {
    font-size: 11px;
    color: rgba(0,0,0,0.35);
    text-align: center;
    margin: 4px 0 0;
    line-height: 1.6;
}

/* ── Widget de usuário (canto superior direito) ────────────────────────────── */
#user-widget {
    position: relative;
}

#user-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.7);
    background: rgba(0,0,0,0.1);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 160ms;
}
#user-btn:hover { border-color: #fff; }

#user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

#user-initials {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
}

#user-dropdown {
    position: absolute;
    top: 42px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.16);
    padding: 10px 14px;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: 'Huninn', Arial, sans-serif;
}

#user-name {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#btn-logout {
    background: rgba(0,0,0,0.06);
    border: none;
    border-radius: 7px;
    padding: 7px 12px;
    font-size: 13px;
    cursor: pointer;
    font-family: 'Huninn', Arial, sans-serif;
    text-align: left;
    color: #333;
    transition: background 160ms;
}
#btn-logout:hover { background: rgba(0,0,0,0.12); }

/* Fonte personalizada Huninn (arquivo TTF) */
@font-face {
    font-family: 'Huninn';
    src: url('assets/fonts/Huninn-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

html {
    height: 100%;
    overflow-x: auto;   /* scroll horizontal quando janela < min-width */
    overflow-y: hidden; /* sem scroll vertical na página */
}

body {
    margin: 0;
    font-family: 'Huninn', Arial, sans-serif;
    min-width: 900px;   /* largura mínima antes de aparecer scroll */
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    --app-header-height: 58px;
    --left-sidebar-width: clamp(210px, 17vw, 270px);
    --right-sidebar-width: clamp(210px, 17vw, 270px);
    --canvas-bg: #ffffff;
    --grid-line: rgba(180, 180, 180, 0.5);
}

body.theme-dark {
    --canvas-bg: #4d4d4d;
    --grid-line: rgba(255, 255, 255, 0.18);
}
#page-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    border: 1px solid #000000; /* moldura externa preta conforme screenshot */
    position: relative;
}
/* Cabeçalho amarelo com título à esquerda */
#app-header {
    background: #40B7E3;
    padding: 0 12px;
    width: var(--left-sidebar-width);
    box-sizing: border-box;
    height: var(--app-header-height);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20;
}
#app-logo       { justify-self: start; height: clamp(32px, 3.5vw, 52px); width: auto; }
#user-widget    { justify-self: center; margin-left: clamp(4px, 1.2vw, 18px); }
.menu-toggle-btn { justify-self: end; }

.menu-toggle-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    flex-shrink: 0;
    position: absolute;
    right: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: background 160ms ease;
}

.menu-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.10);
}

.menu-toggle-btn img {
    width: 20px;
    height: 20px;
    display: block;
}

/* Alerta de projeto não salvo (> 5 MB, não cabe no autosave) */
@keyframes unsaved-warn-pulse {
    0%, 100% { background-color: transparent; }
    50%       { background-color: #cc0000; }
}

.menu-toggle-btn.unsaved-warn {
    animation: unsaved-warn-pulse 1.2s ease-in-out infinite;
    border-radius: 6px;
}

#menu-save-project.unsaved-warn {
    animation: unsaved-warn-pulse 1.2s ease-in-out infinite;
    border-radius: 6px;
}

.sidebar-menu {
    display: none;
    flex-direction: column;
    padding: 8px 0;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
}

.sidebar-menu.open {
    display: flex;
}

.sidebar-menu-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 8px;
    margin: 2px 8px;
    transition: background 160ms ease;
    font-size: 13px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.85);
}

.sidebar-menu-item:hover {
    background: rgba(255, 255, 255, 0.45);
}

.sidebar-menu-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    opacity: 0.75;
}

.sidebar-menu-sub {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.50);
    margin-left: 2px;
}

#container {
    display: flex; /* linha: sidebar esquerda + área canvas + propriedades */
    height: 100%;
    min-height: 0;
}

/* Área principal: sidebar esquerda + canvas + propriedades */
.main-row {
    position: relative;
    flex: 1;
    display: flex;
    min-height: 0;
    overflow: hidden;
}

/* Sidebar esquerda azul clara - Agora flutuante */
#left-sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--left-sidebar-width);
    background: #40B7E3;
    border-right: 0;
    box-sizing: border-box;
    z-index: 15;
    display: flex;
    flex-direction: column;
    padding-top: var(--app-header-height);
}


/* Sidebar direita para Camadas - Agora flutuante e transparente */
#right-sidebar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 56px;
    width: var(--right-sidebar-width);
    background: transparent;
    border-left: none;
    z-index: 15;
    pointer-events: none;
    transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

#right-sidebar.collapsed {
    transform: translateX(calc(var(--right-sidebar-width) - 50px));
}

#layers-toggle {
    position: absolute;
    left: 20px;
    top: 10px;
    width: 30px;
    height: 44px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 1;
}

#layers-toggle:hover {
    background: transparent;
}

#layers-toggle-icon {
    width: 28px;
    height: 28px;
    display: block;
    object-fit: contain;
    transform: rotate(180deg);
    transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

#right-sidebar.collapsed #layers-toggle-icon {
    transform: rotate(0deg);
}

#layers-expand {
    position: absolute;
    left: 20px;
    top: 10px;
    width: 30px;
    height: 44px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    cursor: col-resize;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 1;
    user-select: none;
}

#layers-expand:hover {
    background: transparent;
}

#layers-expand-icon {
    width: 28px;
    height: 28px;
    display: block;
    object-fit: contain;
    pointer-events: none;
    transition: transform 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

#right-sidebar.layers-widened #layers-expand-icon {
    transform: rotate(180deg);
}

#right-sidebar.collapsed #layers-panel {
    pointer-events: none;
}

#layers-panel {
    width: 100%;
    min-width: 0;
}

#layers-panel {
    height: 100%;
    padding: 10px 10px 10px 54px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background: transparent;
    pointer-events: auto; /* Reativa eventos para os controles das camadas */
}

#layers-panel h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #000000;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    text-align: center;
}

/* Conteúdo do painel de propriedades dentro da barra lateral azul */
#sidebar-content {
    flex: 1;
    min-height: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
    overflow-y: auto;
}

#sidebar-content h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: #000000;
}

.sidebar-card {
    background: transparent;
    border: 2px solid #ffffffa7;
    border-radius: 12px;
    padding: 0;
    box-shadow: none;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-card-title {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.55);
    background: transparent;
    padding: 8px 12px;
    text-align: center;
    border-radius: 12px 12px 0 0;
}

.sidebar-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 12px;
}

.sidebar-field:last-child {
    margin-bottom: 12px;
}

#linear-asset-properties .sidebar-field:first-child {
    margin-top: 1px;
}

.sidebar-label {
    font-size: 13px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.85);
}

.sidebar-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.seed-btn {
    background: rgba(255,255,255,0.22);
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: 6px;
    color: rgba(0,0,0,0.75);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 1px 5px;
    transition: background 0.15s, transform 0.15s;
    flex-shrink: 0;
}

.seed-btn:hover {
    background: rgba(255,255,255,0.45);
}

.seed-btn.seed-spin {
    animation: seed-spin 0.35s ease-out;
}

@keyframes seed-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.sidebar-control {
    width: 100%;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.60);
    background: rgba(255, 255, 255, 0.12);
    padding: 6px 10px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.85);
    outline: none;
}

.sidebar-control:focus {
    border-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.20);
}

.sidebar-control[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
}

.sidebar-control[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.20);
}

.sidebar-control[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    border: 0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.20);
}

.sidebar-control[type="range"]::-moz-range-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.45);
}

.sidebar-control[type="color"] {
    padding: 0;
    height: 34px;
    border-radius: 10px;
    overflow: hidden;
}

.sidebar-control[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.sidebar-control[type="color"]::-webkit-color-swatch { border: none; border-radius: 10px; }
.sidebar-control[type="color"]::-moz-color-swatch { border: none; border-radius: 10px; }

.sidebar-color {
    width: 110px;
    max-width: 110px;
}

.fill-swatch-row {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.fill-color-swatch {
    width: 80px;
    max-width: 80px;
    height: 28px;
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
}

.sidebar-control.fill-color-swatch[type="color"] {
    height: 28px;
}

.fill-color-swatch::-webkit-color-swatch-wrapper { padding: 0; }
.fill-color-swatch::-webkit-color-swatch { border: none; border-radius: 10px; }
.fill-color-swatch::-moz-color-swatch { border: none; border-radius: 10px; }

.fill-texture-btn {
    width: 80px;
    height: 28px;
    border-radius: 10px;
    border: 1.5px solid #cccccc;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    background-image: url('assets/Solo/Água/agua1.webp');
    background-size: cover;
    background-position: center;
    transition: border-color 0.15s;
}

.fill-texture-btn:hover {
    border-color: #40B7E3;
}

.sidebar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sidebar-row-nowrap {
    flex-wrap: nowrap;
}

.sidebar-row-nowrap .sidebar-button {
    padding: 0 6px;
    font-size: 13px;
}

.sidebar-row-nowrap .sidebar-button#linear-asset-use-last,
.sidebar-row-nowrap .sidebar-button#linear-asset-remove {
    flex: 0 0 auto;
}

/* Row do linear asset: permite quebra para o input não sumir em telas menores */
#linear-asset-properties .sidebar-row {
    flex-wrap: wrap;
    gap: 6px;
}

#linear-asset-properties .sidebar-button {
    flex: 1 1 62px;
    min-width: 56px;
}

#remove-texture {
    width: 62px;
    padding: 0 6px;
    font-size: 13px;
    display: block;
    margin: 0 auto;
}

.sidebar-row-nowrap #linear-count,
#linear-asset-properties #linear-count {
    height: 30px;
    padding: 0 6px;
    font-size: 14px;
    line-height: 30px;
    width: 60px;
    flex: 0 0 60px;
}

.sidebar-field-inline {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sidebar-field-inline .sidebar-label {
    flex: 1;
    min-width: 0;
}

.sidebar-field-inline .sidebar-control {
    flex: 0 0 auto;
}

.sidebar-inline-right {
    margin-left: auto;
}

.sidebar-grid-row {
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: space-between;
}

.sidebar-grid-row .sidebar-label {
    flex-shrink: 0;
}

.sidebar-grid-input {
    flex: 1;
    min-width: 0;
    width: auto;
}

.sidebar-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.85);
}

.sidebar-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0b6cfb;
}

.sidebar-button {
    height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.60);
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.85);
    transform: translateZ(0);
    transition: box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease, filter 160ms ease;
}

.sidebar-button:hover {
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgb(255, 255, 255), 0 6px 14px rgba(0, 0, 0, 0.14);
    background: #ffffff;
    color: #000;
}

.sidebar-icon-button {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 4px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.60);
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    cursor: pointer;
    transform: translateZ(0);
    transition: transform 120ms ease, box-shadow 160ms ease, border-color 160ms ease, background-color 160ms ease, filter 160ms ease;
}

.sidebar-icon-button img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    filter: brightness(30%) saturate(100%) invert(10%);
}

.sidebar-icon-button:hover {
    transform: none;
    border-color: #ffffff;
    box-shadow: 0 0 0 3px rgb(255, 255, 255), 0 6px 14px rgba(0, 0, 0, 0.14);
    background: #ffffff;
}

.sidebar-icon-button:hover img {
    filter: brightness(0) saturate(100%) invert(15%);
}

.sidebar-icon-button:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.sidebar-icon-button.active {
    border-color: #005a9e;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.22);
    background: #0078d4;;
}

.sidebar-icon-button.active img {
    filter: invert(100%) brightness(200%);
}

.sidebar-icon-button.active:hover img {
    filter: invert(100%) brightness(200%);
}

#node-edit-tool.active img,
#node-edit-tool.active:hover img {
    filter: brightness(0) invert(1);
}

.sidebar-icon-button.active:hover {
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.22), 0 0 0 6px rgb(255, 255, 255), 0 6px 14px rgba(0, 0, 0, 0.14);
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-button {
        transition: none;
    }
    .sidebar-icon-button {
        transition: none;
    }
    .sidebar-icon-button:hover,
    .sidebar-icon-button:active {
        transform: none;
    }
}

.sidebar-small {
    width: 40px;
    flex: 0 0 40px;
}

.sidebar-hint {
    font-size: 13px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.65);
}

.sidebar-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}


.sidebar-slider-row .sidebar-control[type="range"] {
    flex: 1;
    min-width: 0;
}

.sidebar-slider-row .sidebar-hint {
    flex: 0 0 36px;
    text-align: right;
    white-space: nowrap;
}

.sidebar-slider-row .seed-btn {
    flex: 0 0 auto;
}

.sidebar-slider-row .sidebar-hint[contenteditable] {
    cursor: text;
    border-radius: 3px;
    padding: 1px 3px;
    outline: none;
    transition: background 0.15s, box-shadow 0.15s;
}
.sidebar-slider-row .sidebar-hint[contenteditable]:hover {
    background: rgba(0, 0, 0, 0.06);
}
.sidebar-slider-row .sidebar-hint[contenteditable]:focus {
    background: rgba(64, 183, 227, 0.12);
    box-shadow: 0 0 0 1px #40B7E3;
}

.sidebar-unit {
    font-size: 13px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.75);
}

.sidebar-asset-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 12px 0;
}

.sidebar-asset-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(255,255,255,0.10);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-asset-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-asset-name {
    font-size: 13px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.85);
    line-height: 1.2;
}

#sidebar-content .snap-title {
    font-size: 13px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.85);
}
#canvas-area {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    margin-left: var(--left-sidebar-width);
    margin-right: 0;
}

#metaball-card {
    position: absolute;
    top: 46px;
    left: calc(50% - var(--right-sidebar-width) / 2);
    transform: translateX(-50%);
    z-index: 15;
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 36px;
}

#metaball-card button {
    width: 44px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

#metaball-card button:hover {
    background-color: #f0f0f0;
}

#metaball-card button img {
    width: 22px;
    height: 22px;
}

#fill-areas-card {
    position: absolute;
    top: 46px;
    left: calc(50% - var(--right-sidebar-width) / 2);
    transform: translateX(-50%);
    z-index: 15;
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 36px;
}

#fill-areas-card button {
    width: 44px;
    height: 36px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

#fill-areas-card button:hover {
    background-color: #f0f0f0;
}

.fill-areas-card-divider {
    width: 1px;
    height: 22px;
    background: #cccccc;
    flex-shrink: 0;
}

#fill-areas-card button img {
    width: 22px;
    height: 22px;
}

#toolbar {
    position: fixed;
    z-index: 10;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100vw - 440px);
    background-color: transparent;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, 36px);
    gap: 4px;
    justify-content: center;
    align-content: start;
    border-radius: 6px;
    box-shadow: none;
    border: 1px solid transparent;
}

#toolbar button {
    width: 36px; 
    height: 36px; 
    padding: 0;
    border: 1px solid #ffffff;
    background-color: #40B7E3;
    cursor: pointer;
    border-radius: 4px;
    display: flex; 
    justify-content: center;
    align-items: center;
}

/* NOVO ESTILO: Garante que a imagem SVG se ajuste ao botão */
#toolbar button img {
    width: 24px; /* Tamanho do ícone SVG */
    height: 24px;
    pointer-events: none; /* Impede que a imagem interfira no evento de clique do botão */
}
/*seleção ao passar o mouse por cima*/
#toolbar button:hover {
    background-color: #f7cf4e;
}
/*seleção do botão ao ser clicado*/
#toolbar button.active {
    background-color: #b6b4b4;
    border-color: #a0a0a0;
}
/* Grupos expansíveis da toolbar */
.toolbar-group {
    position: relative;
    width: 36px;
    height: 36px;
}

.toolbar-group > .icon-button {
    position: relative;
}

/* Indicador de grupo: pequeno triângulo no canto inferior direito */
.toolbar-group > .icon-button::after {
    content: '';
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-bottom: 4px solid rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.toolbar-group-popup {
    display: none;
    position: absolute;
    top: 36px;
    left: 50%;
    transform: translateX(-50%);
    grid-template-columns: repeat(2, 36px);
    gap: 4px;
    padding-top: 4px;
    z-index: 100;
}

.toolbar-group:hover .toolbar-group-popup {
    display: grid;
}

/* Melhorias gerais de UI */
.icon-button {
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#properties-panel {
    width: 220px;
    background-color: #ffffff;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-left: 3px solid #000000; /* linha preta da moldura interna */
}

#properties-panel input {
    width: 100%;
}

/* Painel de blocos desativado neste layout */
#blocks-panel { display: none; }
/*seleção ao clicar no botão*/
.block-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #000000;
    border-radius: 6px;
    padding: 6px;
    background: #ffffff;
    cursor: grab;
    user-select: none;
    transition: transform 0.12s ease, opacity 0.12s ease;
}

.block-item:active {
    cursor: grabbing;
    transform: scale(0.97);
}

.block-item img {
    max-width: 100%;
    max-height: 70px;
    object-fit: contain;
    pointer-events: none;
}

.block-item span {
    margin-top: 4px;
    font-size: 12px;
    color: #555;
}

/* Wrapper do canvas com rolagem para acomodar dimensões A1 */
#canvas-wrapper {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--canvas-bg);
    touch-action: none;
}

/* Removemos fundo/borda do elemento canvas; a "folha" A1 será um retângulo desenhado pelo Fabric, afetado pelo zoom */
/* Garante que o canvas não tenha margens/paddings que causem deslocamento de ponteiro */
#main-canvas, canvas {
    display: block;
    margin: 0;
    padding: 0;
    touch-action: none;
}

/* Feedback visual durante drag-over no canvas */
#main-canvas.drag-over {
    outline: 2px dashed #4aa3df;
    outline-offset: -2px;
}
.upper-canvas.drag-over {
    outline: 2px dashed #4aa3df;
    outline-offset: -2px;
}

/* Garante que os painéis laterais ocupem 100% da altura */
#properties-panel { height: 100%; min-height: 0; }

/* Barra inferior de categorias */
#categories-bar {
    position: fixed;
    z-index: 10;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100vw - var(--right-sidebar-width) - 8px);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px;
    background: rgba(235, 232, 232, 0.80);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 999px;
    box-shadow: none;
    overflow-x: auto;
}

body.theme-dark #categories-bar {
    background: rgba(99, 99, 99, 0.8);
}

/* Rosa dos ventos — decorativa, fixa no canto inferior esquerdo do canvas */
#compass-rose {
    position: fixed;
    bottom: 10px;
    left: calc(var(--left-sidebar-width) + 12px);
    width: 100px;
    height: 100px;
    pointer-events: none;
    user-select: none;
    z-index: 9;
    opacity: 0.8;
}

/* Painel de Configurações de Caminho */
#path-settings {
    position: absolute;
    right: 8px;
    top: 6px;
    width: 260px;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    padding: 8px;
    z-index: 11;
    display: none;
}

#path-settings.open { display: block; }

#path-settings .path-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
#path-settings .path-header span { font-weight: 600; }
#path-settings .path-header button { border: none; background: #f0f0f0; width: 24px; height: 24px; border-radius: 4px; cursor: pointer; }

#path-settings .path-types { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 6px; }
#path-settings .path-type { padding: 6px; border: 1px solid #000; background: #fff; cursor: pointer; border-radius: 4px; }
#path-settings .path-type.active { background: #f7cf4e; }

#path-settings .path-width { display: grid; grid-template-columns: 1fr; gap: 4px; margin-bottom: 6px; }
#path-settings .path-width input[type="range"] { width: 100%; }
#path-settings .path-actions { display: flex; gap: 6px; }
#path-settings .path-actions button { flex: 1; padding: 6px; border: 1px solid #000; background: #40B7E3; cursor: pointer; border-radius: 4px; }
#path-settings .path-hint { margin-top: 6px; font-size: 12px; color: #555; }


#categories-bar .category {
    background: transparent;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 400;
    color: #000;
    cursor: pointer;
    padding: 6px 16px;
    font-family: 'Huninn', Arial, sans-serif;
    transition: background 0.18s ease-in-out;
    white-space: nowrap;
}

#categories-bar .category:hover {
    background: #f7cf4e;
}

#categories-bar .category.active {
    background: #f7cf4e;
}

/* Overlay de blocos (abre ao clicar nas categorias) */
#blocks-overlay {
    position: absolute;
    z-index: 20;
    left: calc(50% - var(--right-sidebar-width) / 2);
    transform: translateX(-50%);
    bottom: 60px; /* um pouco acima da barra de categorias */
    width: auto;
    min-width: 300px;
    max-width: calc(100% - var(--right-sidebar-width) - 8px);
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Huninn', Arial, sans-serif;
}

#blocks-overlay.open { display: flex; }

#overlay-search-row {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    background: #fdfdfd;
}

#overlay-search {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Huninn', Arial, sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

#overlay-search:focus {
    border-color: #40B7E3;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #fdfdfd;
    border-bottom: 1px solid #f0f0f0;
}

.overlay-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.overlay-title-hint {
    font-size: 13px;
    font-weight: 400;
}

#overlay-close {
    background: transparent;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #bbb;
    padding: 4px;
    transition: color 0.2s, transform 0.2s;
}

#overlay-close:hover {
    color: #666;
    transform: scale(1.1);
}

/* Abas de subcategorias */
.tabs-container {
    display: flex;
    background: #f9f9f9;
    padding: 0 8px;
    border-bottom: 1px solid #eee;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

.tabs-container::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.tab-button {
    padding: 6px 14px;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: #888;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    transition: all 0.2s;
    margin-top: 6px;
    white-space: nowrap;
}

.tab-button:hover {
    color: #333;
    background: #f0f0f0;
}

.tab-button.active {
    background: #ffffff;
    color: #000;
    font-weight: bold;
    border-color: #eee;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
}

.blocks-grid {
    padding: 12px;
    max-height: 60vh;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    justify-items: center;
    min-width: 280px;
}

/* Container de itens dentro de cada categoria - unificado com .blocks-grid */
#blocos-plantas,
#blocos-madeiras,
#blocos-pedras,
#blocos-forracoes,
#blocos-texturas,
#blocos-itens {
    display: contents; /* Usa o grid do pai (.blocks-grid) */
}

/* Cada item (imagem + nome) */
.block-item {
    width: 100%;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fff;
    cursor: grab;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-sizing: border-box;
}

.block-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    border-color: #40B7E3;
}

.block-item:active {
    cursor: grabbing;
    transform: scale(0.95);
    opacity: 1;
}

/* Imagem dentro do bloco */
.block-item img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    pointer-events: none;
    margin-bottom: 8px;
}

/* Nome abaixo da imagem */
.block-item span {
    width: 100%;
    text-align: center;
    font-size: 11px;
    color: #444;
    font-weight: 500;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

/* Nome científico no grid de assets */
.block-item-sci {
    display: block;
    font-style: normal;
    font-size: 11px;
    color: #888;
    font-weight: 400;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Multi-select no picker de assets (linear asset) */
.block-item.la-multi-selected {
    border-color: #40B7E3;
    background: #eef9fd;
    box-shadow: 0 0 0 2px #40B7E3;
}
.block-item.la-multi-selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #40B7E3;
    line-height: 1;
}
.block-item {
    position: relative;
}

#la-multi-confirm-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    position: sticky;
    bottom: 0;
}
#la-multi-count {
    font-size: 13px;
    color: #555;
}
#la-multi-confirm {
    padding: 6px 16px;
    background: #40B7E3;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
#la-multi-confirm:hover {
    background: #2da3cf;
}

/* Nome científico no painel lateral */
.asset-name-sci {
    display: block;
    font-style: normal;
    font-size: 12px;
    color: #111;
    font-weight: 400;
    margin-top: 1px;
}

body.theme-dark .block-item-sci { color: #bbb; }
body.theme-dark .asset-name-sci { color: #111; }



#layers-list {
    flex: 1;
    overflow-y: auto;
    background: transparent;
    padding: 0;
    border-radius: 4px;
}

.layer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 5px;
    margin-bottom: 2px;
    background: #ffffff;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.1s, transform 0.1s;
}

.layer-item:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateX(-2px);
}

.layer-item.active {
    background: rgba(0, 120, 212, 0.18);
    font-weight: 600;
}

/* Drag vertical customizado */
.layer-drag-handle {
    width: 10px;
    min-width: 10px;
    height: 14px;
    background-image: radial-gradient(circle, #aaa 1px, transparent 1px);
    background-size: 3px 4px;
    background-repeat: repeat;
    cursor: ns-resize;
    margin-right: 4px;
    opacity: 0.45;
    flex-shrink: 0;
}
.layer-item:hover .layer-drag-handle {
    opacity: 0.9;
}
.layer-item.dragging {
    opacity: 0.3;
    transform: none !important;
}
.layer-item.drop-before {
    border-top: 2px solid #40B7E3 !important;
}
.layer-item.drop-after {
    border-bottom: 2px solid #40B7E3 !important;
}
.layer-ghost {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.8;
    box-shadow: 0 4px 14px rgba(0,0,0,0.22);
    border-radius: 4px;
    background: #fff;
}

.layer-item span {
    font-size: 12px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 8px;
}

.layer-rename-input {
    flex: 1;
    font-size: 14px;
    border: 1px solid #40B7E3;
    border-radius: 3px;
    padding: 2px 4px;
    margin-right: 8px;
    outline: none;
    background: #fff;
}

.layer-controls {
    display: flex;
    gap: 5px;
}

.layer-controls button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    font-size: 12px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.layer-controls button img {
    width: 14px;
    height: 14px;
    display: block;
    opacity: 0.7;
}

.layer-controls button:hover img {
    opacity: 1;
}

.layer-item.collapsed + .layer-copy {
    display: none;
}

/* Tema escuro — cards das camadas */
body.theme-dark .layer-drag-handle {
    background-image: radial-gradient(circle, #888 1px, transparent 1px);
}
body.theme-dark .layer-ghost {
    background: rgba(80, 85, 90, 0.97);
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}
body.theme-dark .layer-item {
    background: rgba(80, 85, 90, 0.15);
    border: none;
}
body.theme-dark .layer-item:hover {
    background: rgba(95, 100, 106, 0.95);
}
body.theme-dark .layer-item.active {
    background: rgba(247, 207, 78, 0.65);
}
body.theme-dark .layer-item span {
    color: #e8e8e8;
}
body.theme-dark .layer-rename-input {
    background: #3a3f44;
    color: #e8e8e8;
    border-color: #40B7E3;
}

.layer-item.layer-locked > span {
    opacity: 0.5;
}

/* Estilo para o botão de toggle (caret) */
.layer-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    margin-right: 4px;
    font-size: 10px;
    color: #666;
    transition: transform 0.2s;
    display: inline-block;
    width: 18px;
    text-align: center;
}

.layer-toggle:hover {
    color: #000;
}

.layer-item.collapsed .layer-toggle {
    transform: rotate(-90deg);
}

.layer-copy {
    margin-left: 50px !important;
}

/* Cabeçalhos de grupo */
.layer-group-header {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 6px;
    margin-top: 6px;
    margin-bottom: 2px;
    background: #E8E8E8;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    position: relative;
    z-index: 1;
}
.layer-group-header:hover {
    background: #ffffff;
}
.layer-group-header:first-child {
    margin-top: 0;
}
.layer-group-caret {
    font-size: 9px;
    color: #888;
    width: 10px;
    flex-shrink: 0;
}
.layer-group-label {
    font-size: 11px;
    font-weight: 600;
    color: #333;
    flex: 1;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.layer-group-badge {
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #888;
    border-radius: 9px;
    padding: 0 6px;
    min-width: 18px;
    text-align: center;
    line-height: 16px;
}
.layer-group-items {
    padding-left: 4px;
}

body.theme-dark .layer-group-header {
    background: #444444;
}

body.theme-dark .layer-group-header:hover {
    background: rgba(255, 255, 255, 0.14);
}
body.theme-dark .layer-group-label {
    color: #ccc;
}

/* =========================================================
   TEMA ESCURO — janelas flutuantes
   ========================================================= */

/* Overlay de assets (blocks-overlay) */
body.theme-dark #blocks-overlay {
    background: #4d4d4d;
    border-color: rgba(255,255,255,0.14);
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    color: #e8e8e8;
}
body.theme-dark .overlay-header {
    background: #444444;
    border-bottom-color: rgba(255,255,255,0.10);
}
body.theme-dark .overlay-header h3 {
    color: #f0f0f0;
}
body.theme-dark .overlay-title-hint {
    color: #bbb;
}
body.theme-dark #overlay-close {
    color: #aaa;
}
body.theme-dark #overlay-close:hover {
    color: #e0e0e0;
}
body.theme-dark #overlay-search-row {
    background: #444444;
    border-bottom-color: rgba(255,255,255,0.10);
}
body.theme-dark #overlay-search {
    background: #3a3a3a;
    border-color: rgba(255,255,255,0.15);
    color: #e8e8e8;
}
body.theme-dark #overlay-search:focus {
    border-color: #40B7E3;
}

/* Abas de subcategoria */
body.theme-dark .tabs-container {
    background: #444444;
    border-bottom-color: rgba(255,255,255,0.10);
}
body.theme-dark .tab-button {
    color: #bbb;
}
body.theme-dark .tab-button:hover {
    color: #f0f0f0;
    background: rgba(255,255,255,0.08);
}
body.theme-dark .tab-button.active {
    background: #4d4d4d;
    color: #fff;
    border-color: rgba(255,255,255,0.12);
    border-bottom-color: #4d4d4d;
}

/* Grid de itens */
body.theme-dark .blocks-grid {
    background: #4d4d4d;
}
body.theme-dark .block-item {
    background: #575757;
    border-color: rgba(255,255,255,0.10);
    color: #e8e8e8;
}
body.theme-dark .block-item:hover {
    background: #606060;
    border-color: #40B7E3;
}
body.theme-dark .block-item span {
    color: #ddd;
}

/* Painel de configuração de caminho (path-settings) */
body.theme-dark #path-settings {
    background: #4d4d4d;
    border-color: rgba(255,255,255,0.15);
    color: #e8e8e8;
}
body.theme-dark #path-settings .path-header span {
    color: #f0f0f0;
}
body.theme-dark #path-settings .path-header button {
    background: #575757;
    color: #e8e8e8;
}
body.theme-dark #path-settings .path-type {
    background: #575757;
    border-color: rgba(255,255,255,0.15);
    color: #e8e8e8;
}
body.theme-dark #path-settings .path-type.active {
    background: #f7cf4e;
    color: #000;
}
body.theme-dark #path-settings .path-actions button {
    background: #575757;
    border-color: rgba(255,255,255,0.20);
    color: #e8e8e8;
}
body.theme-dark #path-settings .path-hint {
    color: #bbb;
}

/* Popup dos grupos da toolbar */
body.theme-dark .toolbar-group-popup button {
    background-color: #575757;
    border-color: rgba(255,255,255,0.15);
}
body.theme-dark .toolbar-group-popup button:hover {
    background-color: #f7cf4e;
}

/* ── Responsividade desktop ─────────────────────────────── */

/* Telas até 1280px: sidebars mais compactas */
/* ── Scaling para telas menores: apenas font-size e tamanho de botões/ícones ── */

/* 1600px */
@media (max-width: 1600px) {
    #toolbar { grid-template-columns: repeat(auto-fit, 34px); gap: 3px; }
    #toolbar button, .toolbar-group           { width: 34px; height: 34px; }
    #toolbar button img                       { width: 22px; height: 22px; }
    .toolbar-group-popup                      { top: 34px; grid-template-columns: repeat(2, 34px); }

    /* Sidebar esquerda — escala proporcional ~85% */
    #sidebar-content                          { padding: 8px; gap: 10px; }
    .sidebar-card-title                       { font-size: 10px; padding: 7px 10px; }
    .sidebar-field                            { gap: 8px; margin: 8px 10px; }
    .sidebar-field:last-child                 { margin-bottom: 10px; }
    .sidebar-asset-row                        { gap: 8px; margin: 8px 10px 0; }
    .sidebar-asset-thumb                      { width: 36px; height: 36px; }
    .sidebar-slider-row                       { gap: 7px; }
    .sidebar-slider-row .sidebar-hint         { flex: 0 0 30px; }
    .sidebar-button                           { height: 26px; }
    .sidebar-icon-button                      { width: 26px; height: 26px; min-width: 26px; min-height: 26px; }
    .sidebar-label, .sidebar-hint,
    .sidebar-unit, .sidebar-asset-name,
    .sidebar-checkbox, .sidebar-control       { font-size: 12px; }
    .sidebar-menu-item                        { font-size: 12px; padding: 10px 14px; }
    .sidebar-menu-icon                        { width: 24px; height: 24px; }

    #categories-bar .category                { font-size: 13px; }
    .overlay-header h3                        { font-size: 15px; }
    #layers-panel h3                          { font-size: 16px; }
    .layer-item span                          { font-size: 11px; }
    .block-item span                          { font-size: 10px; }
    #layers-toggle-icon, #layers-expand-icon  { width: 24px; height: 24px; }
}

/* 1366px — notebook pequeno — escala proporcional ~75% */
@media (max-width: 1366px) {
    #toolbar { grid-template-columns: repeat(auto-fit, 30px); gap: 2px; }
    #toolbar button, .toolbar-group           { width: 30px; height: 30px; }
    #toolbar button img                       { width: 19px; height: 19px; }
    .toolbar-group-popup                      { top: 30px; grid-template-columns: repeat(2, 30px); }

    /* Sidebar esquerda — escala proporcional ~75% */
    #sidebar-content                          { padding: 6px; gap: 8px; }
    .sidebar-card-title                       { font-size: 9px; padding: 6px 8px; }
    .sidebar-field                            { gap: 7px; margin: 7px 8px; }
    .sidebar-field:last-child                 { margin-bottom: 8px; }
    .sidebar-asset-row                        { gap: 7px; margin: 7px 8px 0; }
    .sidebar-asset-thumb                      { width: 32px; height: 32px; }
    .sidebar-slider-row                       { gap: 6px; }
    .sidebar-slider-row .sidebar-hint         { flex: 0 0 26px; }
    .sidebar-button                           { height: 23px; }
    .sidebar-icon-button                      { width: 23px; height: 23px; min-width: 23px; min-height: 23px; }
    .sidebar-label, .sidebar-hint,
    .sidebar-unit, .sidebar-asset-name,
    .sidebar-checkbox, .sidebar-control       { font-size: 11px; }
    .sidebar-menu-item                        { font-size: 11px; padding: 8px 12px; }
    .sidebar-menu-icon                        { width: 21px; height: 21px; }

    #categories-bar .category                { font-size: 12px; }
    .overlay-header h3                        { font-size: 14px; }
    #overlay-search                           { font-size: 12px; }
    #layers-panel h3                          { font-size: 14px; }
    .layer-item span                          { font-size: 10px; }
    .block-item span                          { font-size: 10px; }
    #layers-toggle-icon, #layers-expand-icon  { width: 21px; height: 21px; }
}

/* 1280px */
@media (max-width: 1280px) {
    body {
        --left-sidebar-width:  clamp(210px, 16vw, 240px);
        --right-sidebar-width: clamp(210px, 16vw, 240px);
    }

    #toolbar { grid-template-columns: repeat(auto-fit, 28px); gap: 2px; }
    #toolbar button, .toolbar-group           { width: 28px; height: 28px; }
    #toolbar button img                       { width: 18px; height: 18px; }
    .toolbar-group-popup                      { top: 28px; grid-template-columns: repeat(2, 28px); }

    .sidebar-label, .sidebar-hint,
    .sidebar-unit, .sidebar-asset-name,
    .sidebar-checkbox, .sidebar-control,
    .sidebar-button, .sidebar-card-title      { font-size: 10px; }

    #categories-bar .category                { font-size: 11px; }
    #layers-panel h3                          { font-size: 13px; }
    .sidebar-menu-item                        { font-size: 10px; }
    .sidebar-menu-icon                        { width: 20px; height: 20px; }
}

/* 1100px */
@media (max-width: 1100px) {
    body {
        --left-sidebar-width:  210px;
        --right-sidebar-width: 210px;
    }

    #app-header { font-size: 18px; padding: 0 8px; }

    #toolbar { grid-template-columns: repeat(auto-fit, 26px); gap: 1px; }
    #toolbar button, .toolbar-group           { width: 26px; height: 26px; }
    #toolbar button img                       { width: 16px; height: 16px; }
    .toolbar-group-popup                      { top: 26px; grid-template-columns: repeat(2, 26px); }
}

/* Sidebar direita recolhida: libera espaço nos elementos flutuantes */
#container:has(#right-sidebar.collapsed) #blocks-overlay {
    left: calc(50% - 22px);
    max-width: calc(100% - 52px);
}


/* Modal: login necessário (demo mode) */
#mlr-box {
    width: 360px;
    max-width: 92vw;
    text-align: center;
    gap: 10px;
    padding: 32px 28px 24px;
}
#mlr-icon {
    font-size: 40px;
    line-height: 1;
}
#mlr-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a5276;
    margin: 0;
}
#mlr-desc {
    font-size: 13px;
    color: rgba(0,0,0,0.65);
    line-height: 1.6;
    margin: 0;
}
#mlr-desc strong { color: #1a7a3c; }
#mlr-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
#mlr-login-btn {
    width: 100%;
    height: 42px;
    background: #40B7E3;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Huninn', Arial, sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: filter 150ms;
}
#mlr-login-btn:hover { filter: brightness(0.92); }
#mlr-later-btn {
    width: 100%;
    height: 38px;
    background: transparent;
    color: rgba(0,0,0,0.45);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Huninn', Arial, sans-serif;
    cursor: pointer;
    transition: color 150ms;
}
#mlr-later-btn:hover { color: rgba(0,0,0,0.75); }

/* ── SEO content block ───────────────────────────────────────────────────── */
#seo-content {
    width: 100%;
    max-width: 780px;
    margin: 48px auto 0;
    padding: 0 32px 48px;
    box-sizing: border-box;
    color: #222;
    font-family: 'Huninn', Arial, sans-serif;
}
#seo-h1 {
    font-size: clamp(20px, 2.4vw, 28px);
    font-weight: 700;
    color: #1a5276;
    margin: 0 0 16px;
    line-height: 1.3;
}
#seo-intro {
    font-size: 15px;
    line-height: 1.75;
    color: #333;
    margin: 0 0 36px;
}
.seo-h2 {
    font-size: clamp(15px, 1.8vw, 20px);
    font-weight: 700;
    color: #1a5276;
    margin: 36px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e8f0f7;
}
#seo-steps {
    padding-left: 20px;
    margin: 0 0 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#seo-steps li,
#seo-audience li {
    font-size: 14px;
    line-height: 1.7;
    color: #333;
}
#seo-audience {
    padding-left: 20px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#seo-faq {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
#seo-faq dt {
    font-size: 14px;
    font-weight: 700;
    color: #1a5276;
    margin: 18px 0 4px;
}
#seo-faq dd {
    font-size: 14px;
    line-height: 1.7;
    color: #444;
    margin: 0;
}
