/*
 * Greeting Personalization — Pass 1 foundation.
 * Client-side editor only. Export, persistence and sharing remain deferred.
 */
#greeting-editor-root { display:none; }
#greeting-editor-root.ge-open { position:fixed;inset:0;z-index:2100;display:block;width:100%;height:100dvh; }
.ge-editor {
    position:fixed;
    inset:0;
    z-index:2100;
    display:flex;
    flex-direction:column;
    min-height:100dvh;
    background:#21110c;
    color:#fffaf2;
    overscroll-behavior:contain;
    width:100%;
    max-width:100%;
    box-sizing:border-box;
    overflow:hidden;
}
.ge-editor *, .ge-editor *::before, .ge-editor *::after { box-sizing:border-box; }
.ge-editor[hidden] { display:none; }
.ge-header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    min-height:58px;
    padding:8px max(12px,env(safe-area-inset-left)) 8px max(12px,env(safe-area-inset-right));
    background:#32160f;
    border-bottom:1px solid rgba(229,182,108,.28);
    flex:0 0 auto;
}
.ge-header-title { min-width:0;text-align:center; }
.ge-header-title strong { display:block;font-family:Georgia,'Times New Roman',serif;font-size:17px;line-height:1.1;color:#fff4dd; }
.ge-header-title span { display:block;margin-top:3px;font-size:10px;color:#eacb96;letter-spacing:.06em;text-transform:uppercase; }
.ge-head-actions { display:flex;align-items:center;gap:7px; }
.ge-head-btn, .ge-icon-btn {
    min-width:44px;
    min-height:44px;
    padding:8px 11px;
    border:1px solid rgba(229,182,108,.38);
    border-radius:9px;
    background:rgba(255,250,242,.08);
    color:#fff8ea;
    font:600 12px/1.1 Poppins,Arial,sans-serif;
    cursor:pointer;
}
.ge-head-btn:hover, .ge-icon-btn:hover { background:rgba(255,250,242,.16); }
.ge-head-btn:focus-visible, .ge-icon-btn:focus-visible, .ge-control:focus-visible, .ge-layer-btn:focus-visible, .ge-text-layer-select:focus-visible, .ge-layer-action:focus-visible, .ge-canvas:focus-visible { outline:3px solid #f6cb79;outline-offset:2px; }
.ge-head-btn:disabled, .ge-icon-btn:disabled { opacity:.38;cursor:not-allowed; }
.ge-main {
    min-height:0;
    min-width:0;
    width:100%;
    max-width:100%;
    flex:1 1 auto;
    display:flex;
    flex-direction:column;
}
.ge-preview-panel {
    min-height:0;
    min-width:0;
    flex:1 1 auto;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:9px;
    padding:12px;
    background:radial-gradient(circle at 50% 35%,#60311e 0%,#2a140e 62%,#1d0d09 100%);
}
.ge-canvas-frame {
    width:min(100%,720px);
    height:min(100%,calc(100dvh - 190px));
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:160px;
}
.ge-canvas {
    display:block;
    max-width:100%;
    max-height:100%;
    width:auto;
    height:auto;
    border:1px solid rgba(241,202,132,.52);
    border-radius:8px;
    box-shadow:0 16px 36px rgba(0,0,0,.34);
    background:#fffaf0;
    touch-action:none;
    user-select:none;
    -webkit-user-select:none;
    cursor:grab;
}
.ge-canvas.is-dragging { cursor:grabbing; }
.ge-preview-note { margin:0;text-align:center;font-size:11px;color:rgba(255,244,220,.62); }
.ge-controls {
    flex:0 0 auto;
    min-width:0;
    max-height:43dvh;
    display:flex;
    flex-direction:column;
    overflow:hidden;
    background:#fffaf1;
    color:#3b241a;
    border-radius:18px 18px 0 0;
    box-shadow:0 -8px 28px rgba(0,0,0,.24);
}
.ge-controls-scroll { flex:1 1 auto;min-height:0;overflow:auto;padding:12px max(14px,env(safe-area-inset-right)) 14px max(14px,env(safe-area-inset-left)); }
.ge-layers { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:12px; }
.ge-layer-btn {
    min-height:44px;
    padding:8px 5px;
    border:1px solid #e2c38d;
    border-radius:9px;
    background:#fffdf8;
    color:#69301f;
    font:700 11px/1.2 Poppins,Arial,sans-serif;
    cursor:pointer;
}
.ge-layer-btn.is-active { color:#fff9ef;background:#7e221f;border-color:#7e221f;box-shadow:0 4px 12px rgba(126,34,31,.2); }
.ge-text-manager { margin:0 0 12px;padding:10px;border:1px solid #ead4a9;border-radius:12px;background:#fff8e8; }
.ge-manager-heading { display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px; }
.ge-manager-heading strong { display:block;color:#7e221f;font:700 14px/1.2 Georgia,'Times New Roman',serif; }
.ge-manager-heading span { display:block;margin-top:2px;color:#886f61;font-size:10px; }
.ge-add-text-btn { min-height:40px;padding-inline:10px;white-space:nowrap; }
.ge-text-layer-list { display:flex;flex-direction:column;gap:6px; }
.ge-text-layer-row { display:block;padding:6px;border:1px solid #ead4a9;border-radius:9px;background:#fffdf8; }
.ge-text-layer-row.is-selected { border-color:#b66c36;box-shadow:0 0 0 2px rgba(182,108,54,.14); }
.ge-text-layer-main { display:flex;align-items:flex-start;min-width:0;gap:8px;cursor:text; }
.ge-text-layer-number { display:grid;place-items:center;flex:0 0 25px;width:25px;height:25px;border-radius:50%;background:#f3e0bb;color:#8e3b24;font-size:11px;font-weight:800; }
.ge-text-layer-input { flex:1 1 auto;min-width:0;min-height:42px;max-height:92px;resize:none;padding:8px 9px;border:1px solid #dcc49b;border-radius:7px;background:#fff;color:#3b241a;font:13px/1.35 Poppins,Arial,sans-serif; }
.ge-text-layer-input::placeholder { color:#a78973;opacity:1; }
.ge-text-layer-input:focus { border-color:#b66c36;box-shadow:0 0 0 2px rgba(182,108,54,.12);outline:0; }
.ge-text-layer-actions { display:flex;flex-wrap:wrap;gap:5px;margin:6px 0 0 33px; }
.ge-layer-action { min-width:44px;min-height:44px;padding:7px 9px;border:1px solid #e0c087;border-radius:6px;background:#fff;color:#733020;font:700 11px/1 Poppins,Arial,sans-serif;cursor:pointer; }
.ge-layer-action:hover { background:#fff1d7; }
.ge-layer-action.danger { color:#a32626;border-color:#e2aaaa; }
.ge-text-layer-empty { margin:3px 0;padding:8px;color:#886f61;font-size:11px;line-height:1.35; }
.ge-empty-text { margin:8px 0;padding:10px;border:1px dashed #d9bd8b;border-radius:8px;background:#fff8e8;color:#886f61;font-size:11px;line-height:1.4; }
.ge-export-btn { min-height:46px;padding:10px 8px;border:1px solid #a43a2d;border-radius:9px;background:#fff;color:#7e221f;font:700 12px/1.1 Poppins,Arial,sans-serif;cursor:pointer; }
.ge-export-btn.primary { color:#fff9ef;background:#8e231f;box-shadow:0 4px 12px rgba(126,34,31,.18); }
.ge-export-btn:hover { background:#fff0d6; }
.ge-export-btn.primary:hover { background:#a12d24; }
.ge-export-btn:disabled { opacity:.55;cursor:wait; }
.ge-share-fallback { display:flex;flex-direction:column;gap:7px;margin-top:9px;padding:10px;border:1px solid #e2c38d;border-radius:9px;background:#fffdf8;color:#674d40;font-size:11px;line-height:1.35; }
.ge-share-fallback[hidden] { display:none; }
.ge-share-fallback strong { color:#7e221f; }
.ge-share-fallback .ge-tool-btn { align-self:flex-start; }
.ge-global-action-bar { display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:8px;flex:0 0 auto;padding:10px max(14px,env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));border-top:1px solid #ead4a9;background:#fff8e8;box-shadow:0 -5px 15px rgba(81,38,20,.08); }
.ge-global-action-bar .ge-export-status { grid-column:1 / -1;margin:0;color:#7e221f;font-size:11px;font-weight:600;line-height:1.35; }
.ge-global-action-bar .ge-export-status:empty { display:none; }
.ge-global-action-bar .ge-export-btn { min-height:46px; }
.ge-share-sheet-backdrop { position:fixed;inset:0;z-index:10;display:flex;align-items:flex-end;justify-content:center;background:rgba(30,12,8,.52);padding:16px; }
.ge-share-sheet-backdrop[hidden] { display:none; }
.ge-share-sheet { width:min(100%,430px);max-height:min(88dvh,620px);overflow:auto;padding:18px;border:1px solid #e1bd7f;border-radius:18px 18px 12px 12px;background:#fffaf1;color:#3b241a;box-shadow:0 18px 60px rgba(20,7,3,.34); }
.ge-share-sheet-header { display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px; }
.ge-share-sheet-header h2 { margin:0;color:#7e221f;font:700 22px/1.1 Georgia,'Times New Roman',serif; }
.ge-share-sheet-header p { margin:5px 0 0;color:#886f61;font-size:11px; }
.ge-share-sheet .ge-icon-btn { color:#7e221f;background:#fff;border-color:#e0c087; }
.ge-share-image-btn { display:grid;grid-template-columns:34px 1fr;column-gap:8px;width:100%;min-height:68px;padding:12px;border:1px solid #9a2d22;border-radius:10px;background:#8e231f;color:#fff9ef;text-align:left;cursor:pointer; }
.ge-share-image-btn span { grid-row:span 2;font-size:24px;align-self:center;text-align:center; }
.ge-share-image-btn strong { align-self:end;font:700 14px/1.2 Poppins,Arial,sans-serif; }
.ge-share-image-btn small { align-self:start;margin-top:3px;color:#f9dfb5;font-size:10px;line-height:1.35; }
.ge-share-image-btn:hover { background:#a12d24; }
.ge-share-image-btn:disabled { opacity:.55;cursor:wait; }
.ge-share-group { margin-top:16px; }
.ge-share-label { display:block;margin-bottom:7px;color:#886f61;font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase; }
.ge-share-quick { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px; }
.ge-share-option, .ge-share-copy, .ge-share-cancel { min-height:44px;padding:9px 8px;border:1px solid #dfc18f;border-radius:8px;background:#fff;color:#633022;font:700 11px/1.1 Poppins,Arial,sans-serif;cursor:pointer; }
.ge-share-option span, .ge-share-copy span { margin-right:5px;font-size:15px;vertical-align:-1px; }
.ge-share-option.whatsapp { color:#207b45; }
.ge-share-option.facebook { color:#315da8; }
.ge-share-option.x { color:#1f1f1f; }
.ge-share-copy { width:100%;margin-top:9px;text-align:left; }
.ge-share-cancel { width:100%;margin-top:10px;background:#fff4df; }
.ge-share-note { margin:12px 0 0;color:#886f61;font-size:10px;line-height:1.4; }
.ge-share-status { min-height:16px;margin:9px 0 0;color:#7e221f;font-size:11px;font-weight:700;line-height:1.35; }
.ge-share-fallback { margin-top:12px; }
.ge-share-fallback .ge-tool-btn + .ge-tool-btn { margin-left:6px; }
.ge-panel { display:none; }
.ge-panel.is-active { display:block; }
.ge-panel-title { display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 9px;color:#7e221f;font:700 15px/1.2 Georgia,'Times New Roman',serif; }
.ge-control-row { display:flex;align-items:center;gap:8px;margin:9px 0; }
.ge-control-row label { flex:0 0 76px;color:#745b4d;font-size:11px;font-weight:700; }
.ge-control { min-height:42px; }
.ge-control[type=text] { flex:1 1 auto;min-width:0;padding:9px 11px;border:1px solid #dcc49b;border-radius:8px;background:#fff;color:#3b241a;font:13px Poppins,Arial,sans-serif; }
.ge-textarea { display:block;width:100%;min-height:78px;resize:vertical;padding:10px 11px;border:1px solid #dcc49b;border-radius:8px;background:#fff;color:#3b241a;font:16px/1.4 Poppins,Arial,sans-serif; }
.ge-field-label { display:block;margin:2px 0 5px;color:#745b4d;font-size:11px;font-weight:700; }
.ge-field-hint { margin:5px 0 7px;color:#886f61;font-size:10px;line-height:1.35; }
.ge-field-hint.is-warning { color:#9a2d22;font-weight:700; }
.ge-select { flex:1 1 auto;min-width:0;padding:9px 10px;border:1px solid #dcc49b;border-radius:8px;background:#fff;color:#3b241a;font:13px Poppins,Arial,sans-serif; }
.ge-color-input { flex:0 0 44px;width:44px;height:44px;padding:3px;border:1px solid #dcc49b;border-radius:8px;background:#fff;cursor:pointer; }
.ge-color-presets { display:flex;align-items:center;gap:5px;flex-wrap:wrap; }
.ge-color-presets button { width:30px;height:30px;padding:0;border:2px solid #fff;border-radius:50%;background:var(--preset);box-shadow:0 0 0 1px #d9bd8b;cursor:pointer; }
.ge-color-presets button:focus-visible { outline:3px solid #f6cb79;outline-offset:2px; }
.ge-style-group { margin:9px 0;border:1px solid #ead4a9;border-radius:10px;background:#fffaf0;overflow:hidden; }
.ge-style-toggle { display:flex;align-items:center;justify-content:space-between;width:100%;min-height:44px;padding:8px 11px;border:0;background:transparent;color:#7e221f;text-align:left;font:700 12px/1.2 Poppins,Arial,sans-serif;cursor:pointer; }
.ge-style-toggle:hover { background:#fff1d7; }
.ge-style-toggle:focus-visible { outline:3px solid #f6cb79;outline-offset:-3px; }
.ge-style-toggle span:last-child { font-size:16px;line-height:1; }
.ge-style-body { padding:1px 10px 7px;border-top:1px solid #f0dfbd; }
.ge-style-body[hidden] { display:none; }
.ge-style-body .ge-control-row { margin:6px 0; }
.ge-style-body .ge-control-row label { flex-basis:82px; }
.ge-check-row { display:flex;align-items:center;gap:8px;min-height:42px;color:#745b4d;font-size:11px;font-weight:700;cursor:pointer; }
.ge-check-row input { width:18px;height:18px;accent-color:#9a2d22; }
.ge-range { flex:1 1 auto;accent-color:#9a2d22; }
.ge-range { min-height:44px; }
.ge-value { flex:0 0 42px;text-align:right;color:#8b321f;font-size:11px;font-weight:700; }
.ge-tool-row { display:flex;flex-wrap:wrap;gap:7px;margin-top:10px; }
.ge-tool-btn { min-height:44px;padding:9px 12px;border:1px solid #e0c087;border-radius:8px;background:#fff;color:#733020;font:700 12px/1 Poppins,Arial,sans-serif;cursor:pointer; }
.ge-tool-btn:hover { background:#fff1d7; }
.ge-tool-btn:disabled { opacity:.48;cursor:not-allowed; }
.ge-tool-btn.danger { color:#a32626;border-color:#e2aaaa; }
.ge-file-btn { flex:1 1 145px; }
.ge-file-input { display:none; }
.ge-media-picker { margin:0 0 12px;padding:11px;border:1px solid #ead4a9;border-radius:10px;background:#fff8e8;color:#745b4d; }
.ge-media-picker > strong { display:block;color:#7e221f;font-size:13px; }
.ge-media-picker > span { display:block;margin-top:3px;font-size:11px;line-height:1.35; }
.ge-media-picker-actions { display:flex;flex-wrap:wrap;gap:7px;margin-top:9px; }
.ge-media-picker-actions .ge-tool-btn { flex:1 1 120px; }
.ge-media-picker-help { margin:8px 0 0;color:#886f61;font-size:10px;line-height:1.4; }
.ge-media-picker-error { margin:8px 0 0;color:#9a2d22;font-size:11px;font-weight:700;line-height:1.35; }
.ge-help { margin:8px 0 0;color:#886f61;font-size:11px;line-height:1.45; }
.ge-desktop-export-note { display:none; }
body.ge-editor-open { overflow:hidden; }
html.ge-editor-open { overflow:hidden; }

@media (min-width:900px) {
    .ge-header { min-height:64px;padding-inline:20px; }
    .ge-header-title strong { font-size:19px; }
    .ge-main { display:grid;grid-template-columns:minmax(0,1fr) minmax(310px,390px); }
    .ge-preview-panel { padding:24px; }
    .ge-canvas-frame { width:100%;height:100%;max-height:calc(100dvh - 88px); }
    .ge-controls { max-height:none;overflow:hidden;border-radius:0;padding:0;box-shadow:-8px 0 28px rgba(0,0,0,.2); }
    .ge-controls-scroll { padding:22px 20px 24px; }
    .ge-desktop-export-note { display:block;margin-top:18px;padding:11px 12px;border:1px solid #ead5ad;border-radius:8px;background:#fff8e8;color:#836b57;font-size:11px;line-height:1.45; }
}
@media (min-width:1100px) {
    .ge-main { grid-template-columns:minmax(0,1fr) 410px; }
    .ge-preview-panel { padding:28px; }
    .ge-controls-scroll { padding-inline:26px; }
}
@media (max-width:699px) {
    .ge-head-actions:first-child .ge-head-btn { padding-inline:9px; }
    .ge-header-title span { display:none; }
}
@media (prefers-reduced-motion:reduce) {
    .ge-head-btn, .ge-icon-btn, .ge-layer-btn, .ge-tool-btn { transition:none; }
}
