/* =============================================
   polaroid3.css — v3.00
   § 1.  Reset e base
   § 2.  Topbar
   § 3.  Botões
   § 4.  Painel esquerdo + accordion
   § 5.  Área de preview e polaroid
   § 6.  Área de legenda
   § 7.  Painel de camadas
   § 8.  Painel histórico
   § 9.  Toast / Tooltip / Loading
   § 10. Modais (layouts, fontes, símbolos)
   § 11. Font dropdown
   § 12. Gradientes e filtros
   § 13. Barra de atalhos / layouts
   § 14. Responsivo
   ============================================= */

/* ─────────────────────────────────────────────
   § 1. RESET E BASE
───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    font-family: Inter, system-ui, Arial, sans-serif;
    font-size: 13px;
    color: #1f1f1f;
    background: #e8e8e8;
    display: flex;
    overflow: hidden;
}

/* ─────────────────────────────────────────────
   § 2. TOPBAR
───────────────────────────────────────────── */
.topbar {
    position: fixed;
    top: 10px; left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: flex; gap: 8px; align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    padding: 6px 12px;
    white-space: nowrap;
}
#zoom-label { font-size: 12px; color: #555; min-width: 120px; }
.badge-done {
    background: #2fb380; color: #fff;
    border-radius: 50%; width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   § 3. BOTÕES
───────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 5px; height: 34px; padding: 0 14px;
    border-radius: 999px; border: 1px solid #ddd;
    background: #111; color: #fff;
    cursor: pointer; font-size: 13px; font-family: inherit;
    white-space: nowrap; transition: opacity .12s;
}
.btn:hover { opacity: .85; }
.btn.secondary { background: #fff; color: #111; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.secondary.active { background: #111 !important; color: #fff !important; border-color: #111 !important; }
.btn-link {
    background: none; border: none;
    color: #aaa; font-size: 10px; cursor: pointer;
    padding: 2px 4px; width: 100%; text-align: right;
    font-family: inherit;
}
.btn-link:hover { color: #555; }

/* ─────────────────────────────────────────────
   § 4. PAINEL ESQUERDO + ACCORDION
───────────────────────────────────────────── */
.panel {
    width: clamp(220px, 18vw, 320px);
    flex-shrink: 0; height: 100vh;
    overflow-y: auto; overflow-x: hidden;
    background: #fff; border-right: 1px solid #eee;
    box-shadow: 2px 0 8px rgba(0,0,0,.06);
    z-index: 10; display: flex; flex-direction: column;
    transition: width .2s;
}
.panel-top {
    padding: 52px 14px 10px;
    border-bottom: 1px solid #eee;
    display: flex; flex-direction: column; gap: 6px;
    flex-shrink: 0;
}
.panel-footer {
    padding: 10px 14px 16px;
    margin-top: auto;
    display: flex; flex-direction: column; gap: 8px;
}
.path-row {
    display: flex; align-items: center; gap: 5px;
}
.acc-section { border-bottom: 1px solid #eee; flex-shrink: 0; }
.acc-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; cursor: pointer;
    background: none; border: none; width: 100%;
    font-family: inherit; text-align: left;
    transition: background .12s; user-select: none;
}
.acc-header:hover { background: #f8f8f8; }
.acc-step {
    width: 20px; height: 20px; border-radius: 50%;
    border: 1px solid #ddd; background: #f5f5f5;
    font-size: 10px; font-weight: 600; color: #aaa;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: all .2s;
}
.acc-step.active { background: #111; border-color: #111; color: #fff; }
.acc-step.done   { background: #2fb380; border-color: #2fb380; color: #fff; }
.acc-title {
    flex: 1; font-size: 12px; font-weight: 600; color: #888;
    text-transform: uppercase; letter-spacing: .08em; transition: color .2s;
}
.acc-title.active { color: #111; }
.acc-arrow { font-size: 12px; color: #ccc; transition: transform .2s, color .2s; flex-shrink: 0; }
.acc-arrow.open { transform: rotate(180deg); color: #888; }
.acc-body { display: none; flex-direction: column; gap: 8px; padding: 4px 14px 14px; }
.acc-body.open { display: flex; }

/* Elementos do painel */
.panel .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel .row label { font-size: 12px; color: #555; min-width: 52px; }
.panel .row input[type="range"] { flex: 1; min-width: 0; }
.panel .seg { height: 1px; background: #eee; margin: 4px 0; }
.panel .btn-row { display: flex; flex-wrap: wrap; gap: 5px; }
.panel .mini { font-size: 11px; color: #aaa; line-height: 1.5; margin: 0; }
.lbl-sm { font-size: 11px; color: #555; white-space: nowrap; }
.unit { font-size: 10px; color: #aaa; }
.num-input { width: 50px; font-size: 11px; border: 1px solid #ddd; border-radius: 6px; padding: 2px 4px; text-align: right; }
.select-sm { flex: 1; font-size: 11px; border: 1px solid #ddd; border-radius: 6px; padding: 3px 6px; }
.color-input { width: 32px; height: 26px; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; padding: 0; }
.full-input {
    width: 100%; font-size: 12px;
    border: 1px solid #ddd; border-radius: 8px;
    padding: 5px 8px; outline: none; font-family: inherit;
}
.full-input:focus { border-color: #333; }
.path-hint { font-size: 10px; color: #bbb; word-break: break-all; flex: 1; margin: 0; cursor: pointer; }

/* Upload zone */
.upload-zone {
    border: 2px dashed #ddd; border-radius: 10px;
    padding: 14px 10px; text-align: center;
    color: #bbb; font-size: 12px; cursor: pointer;
    transition: border-color .15s, background .15s;
}
.upload-zone:hover, .upload-zone.active { border-color: #555; background: #f5f5f5; color: #555; }
.upload-zone.loaded { border-color: #2fb380; border-style: solid; background: #f0fdf8; color: #2fb380; }
.upload-zone i { font-size: 20px; display: block; margin-bottom: 4px; }

/* Swatches */
.color-swatch {
    display: inline-flex; align-items: center; gap: 5px;
    height: 28px; padding: 0 8px; border-radius: 8px;
    border: 1px solid #ddd; background: #fff;
    cursor: pointer; font-size: 11px; color: #444;
    font-family: inherit; transition: border-color .12s;
}
.color-swatch:hover { border-color: #888; }
.swatch-dot {
    width: 12px; height: 12px; border-radius: 50%;
    border: 1px solid rgba(0,0,0,.15); flex-shrink: 0;
}

/* Borda controles */
.border-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.border-toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #555; cursor: pointer; }
#border-options { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

/* Padrão fixado */
#pinned-bar { display: none; flex-direction: column; gap: 4px; margin-top: 6px; }
#pinned-bar.visible { display: flex; }
#btn-pinned-apply {
    width: 100%; justify-content: center; font-size: 11px;
    border-color: #b8860b; color: #7a5800; background: #fffbee;
}

/* ─────────────────────────────────────────────
   § 5. ÁREA DE PREVIEW E POLAROID
───────────────────────────────────────────── */
.preview-wrap {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 32px 16px; overflow: auto; overflow-x: hidden;
    min-width: 0; min-height: 0; background: #e8e8e8;
}
#page-outer { position: relative; flex-shrink: 0; }
#polaroid {
    position: absolute; top: 0; left: 0;
    width: 1051px; height: 1205px;
    background: #fff; padding: 43px;
    box-sizing: border-box;
    box-shadow: 4px 4px 24px rgba(0,0,0,.30);
    transform-origin: top left;
}
#photo-wrapper {
    width: 944px; height: 914px;
    overflow: hidden; position: relative;
    background: #222; cursor: grab;
    user-select: none; touch-action: none;
    outline: 3px solid transparent;
    transition: outline-color .15s;
}
#photo-wrapper.is-drop {
    outline-color: #2fb380;
    box-shadow: 0 0 0 4px rgba(47,179,128,.18) inset;
}
#photo-wrapper:active { cursor: grabbing; }
#photo-img {
    position: absolute; top: 50%; left: 50%;
    max-width: none; max-height: none;
    width: auto; height: auto;
    display: block; pointer-events: none; user-select: none;
}
#photo-placeholder {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    color: #555; font-size: 15px; gap: 8px;
    pointer-events: none;
}
#photo-placeholder small { color: #777; }

/* ─────────────────────────────────────────────
   § 6. ÁREA DE LEGENDA
───────────────────────────────────────────── */
#caption-area {
    position: absolute; left: 0; bottom: 0; right: 0;
    height: 225px; display: flex; flex-direction: column;
    align-items: stretch; justify-content: center;
    pointer-events: all; overflow: visible;
}
.caption-line-wrap {
    display: none; align-items: center;
    position: relative; touch-action: none;
}
.caption-line-wrap.visible { display: flex; }
.caption-line-wrap.line0   { display: flex; }
.caption-drag-handle {
    position: absolute; left: 4px; top: 50%;
    transform: translateY(-50%);
    width: 20px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    cursor: ns-resize; color: rgba(0,0,0,.3);
    font-size: 13px; user-select: none; touch-action: none;
    opacity: 0; transition: opacity .15s; z-index: 2;
}
#caption-area:hover .caption-drag-handle,
.caption-line-wrap:focus-within .caption-drag-handle { opacity: 1; }
.caption-line {
    flex: 1; background: transparent; border: none; outline: none;
    text-align: center; padding: 6px 32px; cursor: text;
    font-family: 'Dancing Script', cursive; font-size: 72px;
    color: #000; line-height: 1.4;
    transition: box-shadow .12s; overflow: visible; width: 100%;
}
.caption-line:focus { box-shadow: 0 0 0 1px rgba(0,0,0,.08); border-radius: 4px; }
.caption-line::placeholder { color: rgba(0,0,0,.18); }

/* Elementos de imagem extra no caption-area */
.layer-img-el { position: absolute; }
.img-resize-handle {
    position: absolute; width: 12px; height: 12px;
    background: #fff; border: 2px solid #333;
    border-radius: 2px; z-index: 10;
}

/* ─────────────────────────────────────────────
   § 7. PAINEL DE CAMADAS
───────────────────────────────────────────── */
#layers-panel {
    width: clamp(150px, 13vw, 210px);
    flex-shrink: 0; height: 100vh; overflow-y: auto;
    background: #fff; border-left: 1px solid #ddd;
    box-shadow: -2px 0 10px rgba(0,0,0,.08);
    padding: 52px 8px 16px; z-index: 10;
    display: flex; flex-direction: column; gap: 5px;
}
#layers-panel h3 {
    margin: 0 0 6px; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .1em; color: #888; flex-shrink: 0;
}
.layer-item {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 8px; border-radius: 8px;
    border: 1px solid #eee; background: #fafafa;
    cursor: pointer; transition: border-color .12s, background .12s;
    flex-shrink: 0;
}
.layer-item:hover   { border-color: #bbb; background: #f5f5f5; }
.layer-item.selected{ border-color: #111; background: #f0f0f0; }
.layer-icon  { font-size: 14px; flex-shrink: 0; width: 18px; text-align: center; }
.layer-label { flex: 1; font-size: 11px; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-actions { display: flex; gap: 2px; flex-shrink: 0; }
.layer-btn {
    width: 22px; height: 22px; border: none; background: none;
    border-radius: 4px; cursor: pointer; font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    transition: background .1s; color: #666;
}
.layer-btn:hover { background: #e8e8e8; }
.layer-btn.danger:hover { background: #ffeeee; color: #c00; }
.layer-item.dragging   { opacity: .4; }
.layer-item.drag-over  { border-color: #111; background: #f0f0f0; box-shadow: 0 0 0 2px rgba(0,0,0,.15); }
#caption-center-guide  { transition: opacity .2s; }
#caption-area:hover #caption-center-guide { opacity: 1; }

/* ─────────────────────────────────────────────
   § 8. PAINEL HISTÓRICO
───────────────────────────────────────────── */
.hist-panel {
    width: clamp(140px, 12vw, 200px);
    flex-shrink: 0; height: 100vh; overflow-y: auto;
    background: #fff; border-left: 1px solid #ddd;
    box-shadow: -2px 0 10px rgba(0,0,0,.08);
    padding: 52px 8px 16px; z-index: 10;
    display: flex; flex-direction: column; gap: 6px;
}
.hist-panel h3 {
    margin: 0 0 6px; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .1em; color: #888; flex-shrink: 0;
}
.badge {
    background: #eee; border-radius: 999px;
    padding: 1px 7px; font-size: 10px; font-weight: 400; color: #888; margin-left: 4px;
}
.hist-empty { font-size: 12px; color: #bbb; text-align: center; padding: 20px 0; }
.hist-card {
    border: 1px solid #eee; border-radius: 10px; overflow: hidden;
    cursor: pointer; transition: border-color .15s, box-shadow .15s;
    background: #fafafa; flex-shrink: 0;
}
.hist-card:hover  { border-color: #bbb; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.hist-card.active { border-color: #111; box-shadow: 0 0 0 2px rgba(0,0,0,.12); }
.hist-thumb {
    width: 100%; aspect-ratio: 1051 / 1205;
    object-fit: cover; display: block; background: #eee;
}
.hist-thumb-placeholder {
    width: 100%; aspect-ratio: 1051/1205;
    background: linear-gradient(135deg,#f0f0f0,#e0e0e0);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #ccc;
}
.hist-info  { padding: 6px 8px 8px; }
.hist-name  { font-size: 11px; font-weight: 600; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-caption { font-size: 10px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.hist-date  { font-size: 10px; color: #aaa; margin-top: 3px; }
.hist-actions { display: flex; gap: 3px; margin-top: 4px; }
.hist-btn {
    flex: 1; font-size: 10px; padding: 3px 0;
    border: 1px solid #ddd; border-radius: 6px;
    background: #fff; color: #444; cursor: pointer;
    text-align: center; transition: background .1s;
}
.hist-btn:hover { background: #f0f0f0; }
.hist-btn.danger:hover { background: #fff0f0; border-color: #ffaaaa; color: #c00; }
.hist-group-header {
    display: flex; align-items: center; gap: 4px;
    padding: 6px 4px 3px; cursor: pointer;
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .08em; color: #888; user-select: none;
    border-radius: 6px; transition: background .1s; margin-top: 4px;
}
.hist-group-header:hover { background: #f5f5f5; color: #555; }
.hist-group-count { background: #eee; border-radius: 999px; padding: 1px 5px; font-size: 9px; color: #888; }
.hist-group-arrow { margin-left: auto; font-size: 10px; }
#hist-refresh {
    font-size: 11px; border: 1px solid #eee; border-radius: 8px;
    padding: 5px; background: #fff; color: #555; cursor: pointer;
    text-align: center; transition: background .1s; flex-shrink: 0;
}
#hist-refresh:hover { background: #f5f5f5; }

/* ─────────────────────────────────────────────
   § 9. TOAST / TOOLTIP / LOADING / CAPA
───────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 14px; left: 50%;
    transform: translateX(-50%);
    background: #111; color: #fff; border-radius: 999px;
    padding: 8px 16px; font-size: 12px; z-index: 40;
    display: none; box-shadow: 0 4px 14px rgba(0,0,0,.25);
    pointer-events: none;
}
.tooltip-floating {
    position: fixed; z-index: 99999; pointer-events: none;
    background: #111; color: #fff; font-size: 11px;
    line-height: 1; padding: 5px 8px; border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    opacity: 0; transform: translate(-50%,-6px);
    transition: opacity .1s, transform .1s; white-space: nowrap;
}
.tooltip-floating[data-place="bottom"] { transform: translate(-50%,6px); }
.tooltip-floating.show { opacity: .96; transform: translate(-50%,0); }
#loading-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.52);
    z-index: 9999; display: none; align-items: center;
    justify-content: center; flex-direction: column; gap: 14px;
    color: #fff; font-size: 15px; font-family: Inter,sans-serif;
    pointer-events: none;
}
#loading-overlay .spin {
    width: 44px; height: 44px;
    border: 3px solid rgba(255,255,255,.3); border-top-color: #fff;
    border-radius: 50%; animation: lo-spin .7s linear infinite;
}
@keyframes lo-spin { to { transform: rotate(360deg); } }

#capa-confirm-bar {
    position: fixed; top: 58px; left: 50%; transform: translateX(-50%);
    z-index: 50; background: rgba(255,255,255,.92);
    border: 1px solid #e0e0e0; border-radius: 999px;
    padding: 4px 8px 4px 12px; box-shadow: 0 2px 8px rgba(0,0,0,.10);
    gap: 8px; align-items: center; white-space: nowrap;
    backdrop-filter: blur(4px);
}

/* ─────────────────────────────────────────────
   § 10. MODAIS (layouts, fontes, símbolos)
───────────────────────────────────────────── */
.layouts-overlay {
    position: fixed; inset: 0; z-index: 200;
    pointer-events: none; display: flex;
}
.layouts-overlay.open { pointer-events: all; }
.layouts-overlay::before {
    content: ''; position: absolute; inset: 0;
    background: rgba(0,0,0,.3); opacity: 0;
    transition: opacity .22s; pointer-events: none;
}
.layouts-overlay.open::before { opacity: 1; }
.layouts-sheet {
    position: relative; width: clamp(340px,30vw,480px);
    flex-shrink: 0; height: 100%; background: #fff;
    border-right: 1px solid #ddd; display: flex; flex-direction: column;
    transform: translateX(-100%);
    transition: transform .24s cubic-bezier(.22,1,.36,1);
    overflow: hidden; box-shadow: 4px 0 24px rgba(0,0,0,.15); z-index: 1;
}
.layouts-overlay.open .layouts-sheet { transform: translateX(0); }
.layouts-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px 10px; border-bottom: 1px solid #eee; flex-shrink: 0;
}
.layouts-header h2 { margin: 0; font-size: 15px; font-weight: 600; }
.layouts-header button {
    background: #f0f0f0; border: none; border-radius: 50%;
    width: 28px; height: 28px; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #555; transition: background .1s;
}
.layouts-header button:hover { background: #e0e0e0; }
.layouts-cats {
    display: flex; gap: 6px; padding: 8px 12px;
    overflow-x: auto; flex-shrink: 0;
    border-bottom: 1px solid #f0f0f0; scrollbar-width: thin;
}
.cat-pill {
    flex-shrink: 0; height: 30px; padding: 0 12px;
    border-radius: 999px; border: 1px solid #ddd;
    background: #fafafa; color: #444; font-size: 11px;
    font-family: inherit; cursor: pointer; white-space: nowrap;
    transition: background .12s, border-color .12s, color .12s;
    display: flex; align-items: center; gap: 4px;
}
.cat-pill:hover  { background: #f0f0f0; border-color: #bbb; }
.cat-pill.active { background: #111; color: #fff; border-color: #111; }
.layouts-grid {
    display: grid; grid-template-columns: repeat(2,1fr);
    gap: 10px; padding: 14px 12px 80px;
    overflow-y: auto; flex: 1; align-content: start;
}
.preset-card {
    border: 2px solid #eee; border-radius: 12px; cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .12s;
    background: #fff;
}
.preset-card:hover  { border-color: #bbb; box-shadow: 0 4px 14px rgba(0,0,0,.12); transform: translateY(-1px); }
.preset-card.active { border-color: #111; box-shadow: 0 0 0 3px rgba(0,0,0,.1); }
.preset-preview {
    width: 100%; height: 80px; min-height: 80px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 8px 10px; text-align: center;
    line-height: 1.2; overflow: hidden; gap: 2px;
}
.preset-meta { padding: 6px 8px 8px; border-top: 1px solid #f0f0f0; background: #fafafa; }
.preset-meta-name { font-size: 10px; font-weight: 600; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-pin-preset {
    width: 100%; margin-top: 4px; padding: 4px 0;
    border: 1px solid #ddd; border-radius: 6px;
    background: #fff; color: #555; font-size: 10px;
    font-family: inherit; cursor: pointer;
    transition: background .1s, color .1s, border-color .1s;
}
.btn-pin-preset:hover, .btn-pin-preset.pinned { background: #111; color: #fff; border-color: #111; }
.confirm-bar {
    pointer-events: all; padding: 12px;
    background: #fff; border-top: 1px solid #eee;
    width: clamp(340px,30vw,480px);
    display: flex; gap: 8px;
}
.fonts-grid {
    overflow-y: auto; flex: 1; padding: 8px 12px;
    display: flex; flex-direction: column; gap: 4px;
}
.icons-grid {
    padding: 12px; display: flex; flex-wrap: wrap;
    gap: 6px; overflow-y: auto; flex: 1; align-content: start;
}

/* ─────────────────────────────────────────────
   § 11. FONT DROPDOWN + ICON BTN
───────────────────────────────────────────── */
.font-dropdown { position: relative; width: 100%; }
.font-dropdown-btn {
    width: 100%; display: flex; align-items: center;
    justify-content: space-between; padding: 5px 10px;
    border: 1px solid #ccc; border-radius: 8px;
    background: #fff; cursor: pointer;
    font-size: 13px; font-family: inherit; gap: 6px;
}
.font-dropdown-btn:hover { border-color: #888; }
.font-dropdown-preview { flex: 1; font-size: 16px; overflow: hidden; white-space: nowrap; }
.icon-btn {
    width: 44px; height: 44px; border: 2px solid #eee;
    border-radius: 10px; background: #fafafa; font-size: 22px;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: background .1s, border-color .1s;
    user-select: none;
}
.icon-btn:hover { background: #f0f0f0; border-color: #bbb; }

/* ─────────────────────────────────────────────
   § 12. GRADIENTES E FILTROS
───────────────────────────────────────────── */
.grad-row { display: flex; gap: 5px; flex-wrap: wrap; }
.gradient-swatch {
    width: 28px; height: 28px; border-radius: 6px;
    border: 2px solid transparent; cursor: pointer;
    transition: transform .1s, border-color .1s; flex-shrink: 0;
}
.gradient-swatch:hover  { transform: scale(1.1); }
.gradient-swatch.active { border-color: #111; }
#gradient-photo-row {
    align-items: center; gap: 5px;
    margin: 4px 0 2px; flex-wrap: wrap;
}
.palette-dot {
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid transparent; cursor: pointer;
    transition: border-color .1s, transform .1s; flex-shrink: 0;
}
.palette-dot:hover  { transform: scale(1.2); }
.palette-dot.active { border-color: #111; }
.filter-btn { margin: 2px; }

/* ─────────────────────────────────────────────
   § 13. BARRA DE ATALHOS / OPEN LAYOUTS
───────────────────────────────────────────── */
#btn-open-layouts {
    width: 100%; justify-content: center;
}
#btn-collapse-panels {
    position: fixed; bottom: 14px; right: 14px; z-index: 50;
    width: 38px; height: 38px; border-radius: 50%;
    border: 1px solid #ddd; background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
    font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .12s;
}
#btn-collapse-panels:hover { background: #f5f5f5; }
#btn-open-panel-mobile {
    display: none; align-items: center; justify-content: center;
    position: fixed; bottom: 70px; left: 14px; z-index: 98;
    width: 42px; height: 42px; border-radius: 50%;
    border: 1px solid #ddd; background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
    font-size: 18px; cursor: pointer;
}

/* ─────────────────────────────────────────────
   § 14. RESPONSIVO
───────────────────────────────────────────── */
.panel.collapsed,
.hist-panel.collapsed,
#layers-panel.collapsed {
    width: 0 !important; padding: 0 !important;
    overflow: hidden !important; border: none !important;
}

@media (max-width: 1200px) {
    .panel { width: 230px; }
    .hist-panel, #layers-panel { width: 160px; }
}
@media (max-width: 1060px) {
    .hist-panel { display: none; }
    #layers-panel { width: clamp(130px,13vw,170px); }
}
@media (max-width: 820px) {
    .panel {
        position: fixed !important; left: 0; top: 0; bottom: 0;
        width: 280px !important; padding: 52px 14px 80px !important;
        z-index: 100 !important; transform: translateX(-100%);
        transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s !important;
        box-shadow: none; overflow: hidden !important;
    }
    .panel.drawer-open {
        transform: translateX(0) !important;
        box-shadow: 4px 0 24px rgba(0,0,0,.2) !important;
        overflow-y: auto !important;
    }
    .hist-panel, #layers-panel { display: none !important; }
    #drawer-overlay {
        display: none; position: fixed; inset: 0;
        background: rgba(0,0,0,.4); z-index: 99;
    }
    #drawer-overlay.show { display: block; }
    #btn-open-panel-mobile { display: flex !important; }
    #btn-collapse-panels   { display: none; }
}
@media (min-width: 821px) {
    #btn-open-panel-mobile { display: none !important; }
    #drawer-overlay        { display: none !important; }
}
@media (max-width: 700px) {
    .btn { height: 28px; padding: 0 10px; font-size: 11px; }
    .topbar { padding: 4px 8px; gap: 5px; }
    #zoom-label { display: none; }
    .preview-wrap { align-items: flex-start; padding-top: 56px; overflow-y: auto; }
}
@media print {
    .topbar, .panel, .hist-panel, #layers-panel, .toast { display: none !important; }
}