﻿/* ── Reset ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

:root {
    --rose: #e85d6e;
    --green: #44693d;
    --rose-d: #c94a5b;
    --gold: #c9964a;
    --ink: #1a1a2e;
    --ink2: #3d3d5c;
    --muted: #7a7a9a;
    --border: #e8e0f0;
    --surface: #ffffff;
    --page: #f7faf9;
    --red: #d94040;
    --amber: #d97706;
    --blue: #2563eb;
    --purple: #7c3aed;
    --r: 14px;
    --shadow: 0 2px 16px rgba(26,26,46,.07);
    --shadow-lg: 0 8px 40px rgba(26,26,46,.13);
}
img {
    max-width: 100%
}

 ── Typography ── 
h1 {
    font-family: 'Playfair Display',serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2
}

h2 {
    font-family: 'Playfair Display',serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--ink)
}

h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink)
}



 ── Buttons ── 
.celeb-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;

    padding: 10px 22px;
    border: none;
    border-radius: 999px;

    background-color: var(--rose);
    color: #fff;

    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;

    cursor: pointer;
    transition: background-color 0.2s ease,
                transform 0.2s ease,
                box-shadow 0.2s ease;
}

.celeb-btn-primary:hover {
    background-color: var(--rose-d);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.celeb-btn-primary:active {
    transform: translateY(0);
}

.celeb-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.celeb-btn-ghost-lg {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: var(--ink);
    border: 2px solid var(--border);
    padding: 12px 28px;
    border-radius: 100px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none
}

    .celeb-btn-ghost-lg:hover {
        border-color: var(--ink);
        color: var(--ink)
    }

.celeb-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--green);
    color: #fff;
    border: none;
    padding: 7px 16px;
    border-radius: 100px;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none;
    font-family: 'Inter',sans-serif
}

    .celeb-btn-sm:hover {
        background: var(--rose-d);
        color: #fff
    }

.celeb-btn-sm-ghost {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    color: var(--ink2);
    border: 1px solid var(--border);
    padding: 7px 14px;
    border-radius: 100px;
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    text-decoration: none;
    font-family: 'Inter',sans-serif
}

    .celeb-btn-sm-ghost:hover {
        border-color: var(--ink);
        color: var(--ink)
    }

.celeb-btn-icon {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: .85rem;
    transition: all .15s
}

    .celeb-btn-icon:hover {
        background: var(--border);
        color: var(--ink)
    }

    .celeb-btn-icon.danger:hover {
        background: #fee2e2;
        color: var(--red)
    }

.celeb-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fee2e2;
    color: var(--red);
    border: 1px solid #fecaca;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter',sans-serif
}

    .celeb-btn-danger:hover {
        background: var(--red);
        color: #fff
    }

.celeb-btn-submit {
    width: 100%;
    background: var(--rose);
    color: #fff;
    border: none;
    padding: 13px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    font-family: 'Inter',sans-serif;
    margin-top: 6px
}

    .celeb-btn-submit:hover {
        background: var(--rose-d)
    }

.celeb-btn-wa {
    background: #25d366;
    color: #fff;
    padding: 9px 18px;
    border-radius: 100px;
    font-size: .85rem;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none
}

    .celeb-btn-wa:hover {
        background: #1ebe5d;
        color: #fff
    }

/* ── Toast ── */
.toast {
    position: fixed;
    top: 70px;
    right: 18px;
    z-index: 999;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: .88rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: slideIn .3s ease
}

    .toast.success {
        background: #ecfdf5;
        color: #065f46;
        border: 1px solid #a7f3d0
    }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* ── Forms ── */
.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 18px
}

    .field label {
        font-size: .84rem;
        font-weight: 600;
        color: var(--ink2)
    }

input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], input[type=datetime-local], input[type=time], input[type=date], input[type=file], select, textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: .9rem;
    font-family: 'Inter',sans-serif;
    background: #fff;
    color: var(--ink);
    transition: border-color .15s;
    outline: none
}

    input:focus, select:focus, textarea:focus {
        border-color: var(--rose)
    }

textarea {
    resize: vertical
}

.inp-lg {
    font-size: 1rem;
    padding: 12px 15px
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}

.inp-prefix-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff
}

.inp-prefix {
    padding: 10px 11px;
    background: #f3eff8;
    color: var(--muted);
    font-size: .78rem;
    white-space: nowrap;
    border-right: 1px solid var(--border)
}

.inp-prefix-wrap input {
    border: none;
    border-radius: 0;
    background: transparent
}

    .inp-prefix-wrap input:focus {
        border: none
    }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
    align-items: center
}

.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px;
    box-shadow: var(--shadow)
}

.form-section {
    font-size: .76rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 28px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border)
}

    .form-section.danger-zone {
        color: var(--red)
    }

.file-drop {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 28px;
    text-align: center;
    cursor: pointer;
    color: var(--muted);
    font-size: .88rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: border-color .15s
}

    .file-drop:hover {
        border-color: var(--rose)
    }

    .file-drop i {
        font-size: 1.8rem
    }

    .file-drop input {
        display: none
    }

.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .9rem;
    cursor: pointer;
    padding: 6px 0;
    border-bottom: 1px solid var(--border)
}

    .toggle-row:last-child {
        border-bottom: none
    }

    .toggle-row input[type=checkbox] {
        width: 18px;
        height: 18px;
        cursor: pointer;
        accent-color: var(--green)
    }

.val-err {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: .84rem
}

    .val-err ul {
        padding-left: 14px
    }

/* ── Page layout ── */
.page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 24px
}

.page-narrow {
    max-width: 700px
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px
}

    .page-head h1 {
        margin-bottom: 4px
    }

.pg-sub {
    color: var(--muted);
    font-size: .88rem
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 70px 24px
}

.empty-ico {
    font-size: 3.5rem;
    margin-bottom: 14px
}

.empty-state h3 {
    margin-bottom: 8px
}

.empty-state p {
    color: var(--muted);
    margin-bottom: 20px
}

.empty-inline {
    color: var(--muted);
    font-size: .88rem;
    padding: 36px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 12px;
    margin-top: 8px
}

/* ── Hero ── */
.hero {
    max-width: 800px;
    margin: 0 auto;
    padding: 90px 24px 70px;
    text-align: center
}

.hero-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: .78rem;
    font-weight: 600;
    margin-bottom: 22px;
    letter-spacing: .04em
}

.hero-title {
    font-size: clamp(2.8rem,5.5vw,5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 20px
}

    .hero-title em {
        font-style: italic;
        color: var(--rose)
    }

.hero-sub {
    font-size: 1.05rem;
    color: var(--muted);
    max-width: 500px;
    margin: 0 auto 36px;
    line-height: 1.7
}

.hero-cta {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 40px
}

.hero-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center
}

.pill {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 5px 13px;
    border-radius: 100px;
    font-size: .8rem;
    color: var(--ink2)
}

.demo-banner {
    background: #fef9c3;
    border: 1px solid #fde68a;
    padding: 10px 20px;
    text-align: center;
    font-size: .88rem;
    color: #854d0e;
    margin: 0 24px 24px
}

    .demo-banner code {
        background: #fff;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: .82rem
    }

.demo-hint {
    background: #fef9c3;
    border: 1px solid #fde68a;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: .82rem;
    color: #854d0e;
    margin-bottom: 16px
}

    .demo-hint code {
        background: #fff;
        padding: 1px 5px;
        border-radius: 4px
    }

/* ── Features ── */
.features {
    max-width: 1100px;
    margin: 0 auto;
    padding: 60px 24px
}

.feat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(300px,1fr));
    gap: 20px
}

.feat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 28px;
    transition: box-shadow .2s
}

    .feat:hover {
        box-shadow: var(--shadow)
    }

.feat-icon {
    font-size: 1.8rem;
    margin-bottom: 12px
}

.feat h3 {
    margin-bottom: 8px
}

.feat p {
    color: var(--muted);
    font-size: .88rem
}

.cta-strip {
    background: var(--ink);
    color: #fff;
    padding: 70px 24px;
    text-align: center
}

    .cta-strip h2 {
        color: #fff;
        margin-bottom: 10px
    }

    .cta-strip a {
        margin-top: 24px;
        display: inline-flex
    }

/* ── Footer ── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: .8rem
}

/* ── Auth ── */
.auth-page {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 44px 38px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow)
}

.auth-logo {
    font-family: 'Playfair Display',serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--rose);
    margin-bottom: 20px
}

.auth-card h2 {
    margin-bottom: 5px
}

.auth-sub {
    color: var(--muted);
    font-size: .88rem;
    margin-bottom: 24px
}

.auth-switch {
    text-align: center;
    color: var(--muted);
    font-size: .84rem;
    margin-top: 18px
}

/* ── Event cards ── */
.ev-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(290px,1fr));
    gap: 20px
}

.ev-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .2s,box-shadow .2s
}

    .ev-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-lg)
    }

.ev-cover {
    height: 150px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px
}

.ev-type-birthday {
    background: linear-gradient(135deg,#fce4ec,#f3e5f5)
}

.ev-type-wedding {
    background: linear-gradient(135deg,#fff8e1,#fce4ec)
}

.ev-type-anniversary {
    background: linear-gradient(135deg,#f3e5f5,#e8eaf6)
}

.ev-type-babyshower {
    background: linear-gradient(135deg,#e3f2fd,#e1f5fe)
}

.ev-type-housewarming {
    background: linear-gradient(135deg,#e8f5e9,#f1f8e9)
}

.ev-type-corporate {
    background: linear-gradient(135deg,#eceff1,#e8eaf6)
}

.ev-type-custom {
    background: linear-gradient(135deg,#fce4ec,#e3f2fd)
}

.ev-type-badge {
    background: rgba(255,255,255,.88);
    color: var(--ink);
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 100px
}

.ev-status {
    font-size: .7rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 100px
}

    .ev-status.live {
        background: #ecfdf5;
        color: #065f46
    }

    .ev-status.draft {
        background: #fef9c3;
        color: #854d0e
    }

.ev-body {
    padding: 16px
}

    .ev-body h3 {
        margin-bottom: 6px;
        font-size: .95rem
    }

.ev-meta {
    color: var(--muted);
    font-size: .78rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px
}

.ev-actions {
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 7px
}

/* ── Manage ── */
.manage-wrap {
    max-width: 1300px;
    margin: 0 auto;
    /*padding: 28px 20px*/
}

.manage-hdr {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px
}

.back-lnk {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: .8rem;
    margin-bottom: 5px
}

    .back-lnk:hover {
        color: var(--ink)
    }

.manage-hdr h1 {
    font-size: 1.8rem;
    margin-bottom: 7px
}

.manage-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap
}

.meta-item {
    color: var(--muted);
    font-size: .8rem;
    display: flex;
    align-items: center;
    gap: 5px
}

.manage-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

/* ── Stats row ── */
.stats-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap
}

.stat-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    flex: 1;
    min-width: 90px;
    text-align: center
}

.stat-n {
    font-family: 'Playfair Display',serif;
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1
}

.stat-l {
    color: var(--muted);
    font-size: .72rem;
    margin-top: 4px
}

.stat-box.green .stat-n {
    color: var(--green)
}

.stat-box.red .stat-n {
    color: var(--red)
}

.stat-box.amber .stat-n {
    color: var(--amber)
}

.stat-box.purple .stat-n {
    color: var(--purple)
}

.stat-box.blue .stat-n {
    color: var(--blue)
}

/* ── Tabs ── */
.tab-bar {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 22px;
    overflow-x: auto
}

.tab {
    background: none;
    border: none;
    padding: 9px 16px;
    font-size: .86rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
    font-family: 'Inter',sans-serif;
    white-space: nowrap
}

    .tab:hover {
        color: var(--ink)
    }

    .tab.active {
        color: var(--rose);
        border-bottom-color: var(--rose)
    }

.tab-panel {
    display: none
}

    .tab-panel.active {
        display: block
    }

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px
}

    .panel-head h3 {
        margin: 0
    }

/* ── Table ── */
.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border)
}

.data-table {
    width: 100%;
    border-collapse: collapse
}

    .data-table th {
        background: #f8f5ff;
        padding: 9px 14px;
        font-size: .75rem;
        font-weight: 600;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: .05em;
        text-align: left
    }

    .data-table td {
        padding: 10px 14px;
        border-top: 1px solid var(--border);
        font-size: .86rem
    }

.td-name {
    font-weight: 600
}

.td-note {
    color: var(--muted);
    font-size: .78rem;
    max-width: 160px
}

.rsvp {
    padding: 2px 9px;
    border-radius: 100px;
    font-size: .72rem;
    font-weight: 600
}

.rsvp-attending {
    background: #ecfdf5;
    color: #065f46
}

.rsvp-declined {
    background: #fef2f2;
    color: #991b1b
}

.rsvp-pending {
    background: #fef9c3;
    color: #854d0e
}

.rsvp-maybe {
    background: #eff6ff;
    color: #1d4ed8
}

.inline-share-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding: 12px 16px;
    background: #f8f5ff;
    border-radius: 10px;
    font-size: .82rem
}

.share-hint {
    color: var(--muted)
}

.inline-share-row code {
    color: var(--rose);
    font-size: .78rem
}

/* ── Photo grid ── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(150px,1fr));
    gap: 10px
}

.photo-item {
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 1;
    cursor: pointer
}

    .photo-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform .2s
    }

    .photo-item:hover img {
        transform: scale(1.05)
    }

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent,rgba(0,0,0,.7));
    color: #fff;
    font-size: .68rem;
    padding: 18px 7px 5px
}

.photo-meta {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: .62rem;
    padding: 2px 6px;
    border-radius: 100px
}

.photo-del {
    position: absolute;
    top: 5px;
    left: 5px;
    opacity: 0;
    transition: opacity .15s
}

.photo-item:hover .photo-del {
    opacity: 1
}

/* ── Registry ── */
.registry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(210px,1fr));
    gap: 14px
}

.reg-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    transition: box-shadow .15s
}

    .reg-card:hover {
        box-shadow: var(--shadow)
    }

    .reg-card.claimed {
        opacity: .7
    }

.reg-name {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: .9rem
}

.reg-price {
    color: var(--gold);
    font-weight: 600;
    font-size: .88rem;
    margin-bottom: 6px
}

.reg-status {
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 100px;
    display: inline-block;
    background: #ecfdf5;
    color: #065f46;
    margin-bottom: 6px
}

.reg-card.claimed .reg-status {
    background: #f3f4f6;
    color: var(--muted)
}

.reg-link {
    font-size: .78rem;
    color: var(--rose);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px
}

/* ── Timeline ── */
.timeline-list {
    display: flex;
    flex-direction: column
}

.tl-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding-bottom: 20px;
    position: relative
}

    .tl-item:last-child {
        padding-bottom: 0
    }

.tl-time {
    width: 56px;
    flex-shrink: 0;
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    padding-top: 2px
}

.tl-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--rose);
    flex-shrink: 0;
    margin-top: 4px;
    position: relative
}

.tl-item:not(:last-child) .tl-dot::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 1.5px;
    height: calc(100% + 20px - 10px);
    background: var(--border)
}

.tl-content {
    flex: 1
}

.tl-title {
    font-weight: 600;
    font-size: .88rem
}

.tl-desc {
    color: var(--muted);
    font-size: .8rem;
    margin-top: 3px
}

/* ── Poster designer ── */
.designer-layout {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 200px;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    min-height: 640px
}

.d-left {
    background: #fafafa;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding-bottom: 16px
}

.d-right {
    background: #fafafa;
    border-left: 1px solid var(--border);
    overflow-y: auto;
    padding-bottom: 16px
}

.d-section-title {
    font-size: .68rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 10px 10px 5px
}

.tmpl-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 0 8px 8px
}

.tmpl {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    height: 58px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .7rem;
    font-weight: 600;
    overflow: hidden;
    transition: border-color .15s;
    padding: 4px
}

    .tmpl:hover, .tmpl.sel {
        border-color: var(--rose);
        border-width: 2px
    }

    .tmpl span {
        text-align: center;
        line-height: 1.3;
        font-size: .68rem
    }

.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 0 8px 8px
}

.tool-tile {
    border: 0.5px solid var(--border);
    background: #fff;
    border-radius: 8px;
    padding: 8px 4px;
    cursor: pointer;
    font-size: .68rem;
    color: var(--ink2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all .15s
}

    .tool-tile:hover {
        border-color: var(--rose);
        background: #fff5f6
    }

    .tool-tile i {
        font-size: 14px;
        color: var(--rose)
    }

.sticker-grid {
    display: grid;
    grid-template-columns: repeat(5,1fr);
    gap: 3px;
    padding: 0 8px 8px
}

.stk {
    border: 0.5px solid var(--border);
    background: #fff;
    border-radius: 6px;
    padding: 4px;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s
}

    .stk:hover {
        border-color: var(--rose);
        transform: scale(1.1)
    }

.bg-colors {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    padding: 0 8px 8px
}

.bg-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color .15s;
    flex-shrink: 0
}

    .bg-dot:hover, .bg-dot.active {
        border-color: var(--rose)
    }

.d-canvas-wrap {
    display: flex;
    flex-direction: column;
    background: #e8e8e8;
    min-width: 0
}

.d-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 7px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap
}

.d-tb-btn {
    border: 0.5px solid var(--border);
    background: none;
    padding: 5px 8px;
    border-radius: 7px;
    font-size: .78rem;
    cursor: pointer;
    color: var(--ink2);
    display: flex;
    align-items: center;
    gap: 3px;
    transition: all .15s;
    font-family: 'Inter',sans-serif
}

    .d-tb-btn:hover {
        background: var(--border);
        color: var(--ink)
    }

.d-tb-sep {
    width: 1px;
    height: 18px;
    background: var(--border);
    flex-shrink: 0;
    margin: 0 2px
}

.d-canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: auto
}

#posterCanvas {
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,.2)
}

.d-tb-select {
    border: 0.5px solid var(--border);
    background: #fff;
    padding: 5px 6px;
    border-radius: 7px;
    font-size: .74rem;
    color: var(--ink2);
    font-family: 'Inter',sans-serif;
    cursor: pointer
}

.d-tb-num {
    width: 54px;
    border: 0.5px solid var(--border);
    background: #fff;
    padding: 5px 6px;
    border-radius: 7px;
    font-size: .74rem;
    color: var(--ink2);
    font-family: 'Inter',sans-serif
}

.d-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 10px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: .72rem;
    color: var(--muted);
    flex-shrink: 0
}

.page-strip {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    overflow-x: auto;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0
}

.page-thumb {
    position: relative;
    flex-shrink: 0;
    width: 46px;
    height: 62px;
    border: 2px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s
}

    .page-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block
    }

    .page-thumb.active {
        border-color: var(--rose)
    }

.page-num {
    position: absolute;
    bottom: 2px;
    left: 3px;
    font-size: .58rem;
    color: #fff;
    background: rgba(0,0,0,.55);
    padding: 0 4px;
    border-radius: 3px;
    line-height: 1.4
}

.page-act {
    position: absolute;
    top: 2px;
    background: rgba(0,0,0,.55);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: .55rem;
    width: 15px;
    height: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .15s
}

.page-thumb:hover .page-act {
    opacity: 1
}

.page-act.dup {
    right: 18px
}

.page-act.del {
    right: 2px
}

.page-act:hover {
    background: var(--rose)
}

.page-thumb.add-page {
    display: flex;
    align-items: center;
    justify-content: center;
    border-style: dashed;
    color: var(--muted);
    font-size: 1rem;
    background: none
}

    .page-thumb.add-page:hover {
        border-color: var(--rose);
        color: var(--rose)
    }

.ai-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    margin: 8px
}

.ai-title {
    font-size: .78rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px
}

    .ai-title i {
        color: var(--rose)
    }

.ai-panel textarea {
    height: 56px;
    font-size: .78rem;
    resize: none;
    margin-bottom: 6px
}

.ai-panel input[type=password] {
    font-size: .78rem;
    margin-bottom: 6px
}

.ai-btn {
    width: 100%;
    background: var(--ink);
    color: #fff;
    border: none;
    padding: 8px;
    border-radius: 8px;
    font-size: .8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-family: 'Inter',sans-serif;
    transition: background .2s
}

    .ai-btn:hover {
        background: #2d2d4a
    }

    .ai-btn:disabled {
        opacity: .6;
        cursor: not-allowed
    }

.prop-group {
    margin-bottom: 10px
}

.prop-empty {
    padding: 10px 12px;
    font-size: .78rem;
    color: var(--muted)
}

.prop-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px
}

    .prop-row label {
        font-size: .72rem;
        color: var(--muted);
        width: 46px;
        flex-shrink: 0
    }

    .prop-row input[type=range] {
        flex: 1;
        height: 3px
    }

    .prop-row input[type=color] {
        width: 26px;
        height: 22px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        padding: 0;
        flex-shrink: 0
    }

    .prop-row input[type=text] {
        flex: 1;
        font-size: .78rem;
        padding: 4px 7px
    }

    .prop-row select {
        flex: 1;
        font-size: .78rem;
        padding: 3px 6px
    }

.prop-val {
    font-size: .7rem;
    color: var(--muted);
    min-width: 32px;
    text-align: right
}

.quick-styles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 0 8px 8px
}

.qs-btn {
    border: 0.5px solid var(--border);
    background: #fff;
    padding: 6px;
    border-radius: 7px;
    font-size: .7rem;
    cursor: pointer;
    color: var(--ink2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all .15s;
    font-family: 'Inter',sans-serif
}

    .qs-btn:hover {
        background: var(--rose);
        color: #fff;
        border-color: var(--rose)
    }

.layer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    cursor: pointer;
    border-bottom: 0.5px solid var(--border);
    font-size: .75rem;
    color: var(--muted);
    overflow: hidden
}

    .layer-item:hover {
        background: #fff;
        color: var(--ink)
    }

    .layer-item i {
        font-size: 11px;
        flex-shrink: 0
    }

    .layer-item span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis
    }

/* ── Share tab ── */
.share-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    max-width: 600px
}

.share-url-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--page);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 18px;
    flex-wrap: wrap
}

    .share-url-box code {
        font-size: .82rem;
        color: var(--rose);
        flex: 1;
        word-break: break-all
    }

.share-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: 100px;
    font-size: .86rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s
}

    .share-btn.wa {
        background: #25d366;
        color: #fff
    }

        .share-btn.wa:hover {
            background: #1ebe5d;
            color: #fff
        }

    .share-btn.email {
        background: var(--blue);
        color: #fff
    }

        .share-btn.email:hover {
            background: #1d4ed8;
            color: #fff
        }

.share-qr-wrap {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border)
}

.share-qr-label {
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: 10px
}

/* ── Chat ── */
.chat-box {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 420px;
    overflow-y: auto;
    padding: 4px
}

.chat-msg {
    background: var(--page);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    position: relative
}

    .chat-msg.host {
        background: #fff5f6;
        border-color: #fde0e3
    }

.chat-msg-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px
}

.chat-msg-sender {
    font-size: .78rem;
    font-weight: 600;
    color: var(--ink2)
}

.chat-msg-time {
    font-size: .7rem;
    color: var(--muted)
}

.chat-msg-text {
    font-size: .88rem;
    color: var(--ink);
    word-wrap: break-word;
    white-space: pre-wrap
}

.chat-msg-del {
    position: absolute;
    top: 6px;
    right: 6px;
    opacity: 0;
    transition: opacity .15s
}

.chat-msg:hover .chat-msg-del {
    opacity: 1
}

.chat-input-row, .chat-name-row {
    display: flex;
    gap: 8px
}

    .chat-input-row input, .chat-name-row input {
        flex: 1
    }

/* ── Wishes ── */
.wish-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill,minmax(220px,1fr));
    gap: 14px
}

.wish-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    position: relative
}

.wish-text {
    font-size: .88rem;
    color: var(--ink);
    font-style: italic;
    margin-bottom: 8px
}

.wish-meta {
    font-size: .76rem;
    color: var(--muted);
    font-weight: 600
}

/* ── Modals ── */
/* z-index: 2000 keeps our overlay above Bootstrap's navbar/sidebar (z≈1030) */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26,26,46,.45);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px
}

    .modal-overlay.open {
        display: flex
    }

/*
 * Bootstrap also defines .modal { display:none; position:fixed; z-index:1055 }
 * Using .modal-overlay .modal (higher specificity) ensures our styles win.
 */
.modal-overlay .modal {
    display: block;
    position: relative;
    z-index: auto;
    width: 100%;
    max-width: 460px;
    height: auto;
    background: var(--surface);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden
}

.modal-overlay .modal-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px
}

    .modal-overlay .modal-hdr h3 {
        margin: 0
    }

.modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
    line-height: 1
}

    .modal-close:hover {
        color: var(--ink)
    }

.modal-overlay .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 20px
}

/* ── Responsive ── */
@media(max-width:900px) {
    .designer-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto
    }

    .d-canvas-wrap {
        min-width: 0
    }

    .d-left, .d-right {
        max-height: none;
        overflow-y: visible;
        border-right: none;
        border-left: none;
        border-bottom: 1px solid var(--border)
    }
}

@media(max-width:640px) {
    .navbar {
        padding: 0 14px
    }

    h1 {
        font-size: 1.8rem
    }

    .hero {
        padding: 60px 16px 50px
    }

    .field-row {
        grid-template-columns: 1fr
    }

    .stats-row {
        gap: 8px
    }

    .stat-box {
        padding: 12px 14px
    }

    .stat-n {
        font-size: 1.5rem
    }

    .auth-card {
        padding: 28px 20px
    }

    .form-card {
        padding: 24px 18px
    }
}
