@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

.eal-dash {
    --ink: #19191a;
    --muted: #6b6560;
    --line: #e8dcd3;
    --accent: rgba(248, 237, 235, 0.62);
    --accent-dark: rgba(240, 219, 213, 0.85);
    --accent-text: #19191a;
    --bg: #fffdf5;
    --card: rgba(248, 237, 235, 0.62);
    --card-solid: #fffdf5;
    --radius: 16px;
    --font-display: 'Manrope', -apple-system, Segoe UI, Roboto, Arial, sans-serif;

    width: 100%;
    box-sizing: border-box;
    padding: 32px 20px 60px;
    background: var(--bg);
    font-family: 'Manrope', -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--ink);
}
/* The background itself spans full width (no max-width above), but the
 * actual content still reads as a centered column — each direct child is
 * centered individually rather than wrapping everything in an inner div. */
.eal-dash > * {
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}

.eal-dash h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    margin: 32px 0 14px;
    color: var(--ink);
}
.eal-dash h2:first-of-type { margin-top: 0; }
.eal-dash-hint { font-size: 13px; color: var(--muted); margin: -6px 0 10px; }
.eal-dash-hint code { background: #f1ece3; padding: 2px 6px; border-radius: 4px; }

/* ---- Cards ---- */
.eal-dash-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 22px;
    box-shadow: 0 4px 20px rgba(36, 33, 29, 0.04);
}
/* "Wide" cards no longer need a special rule — the base .eal-dash > * rule
 * above already gives every card the same comfortable 780px width now that
 * the background itself is unconstrained. */

.eal-dash-auth { padding-top: 60px; }
.eal-dash-auth-card { max-width: 420px; margin: 0 auto; }
.eal-dash-auth > .eal-dash-success,
.eal-dash-auth > .eal-dash-error {
    max-width: 420px; margin-left: auto; margin-right: auto;
}
.eal-dash-tabs { display: flex; gap: 4px; background: #f1ece3; border-radius: 999px; padding: 4px; margin-bottom: 24px; }
.eal-dash-tab {
    flex: 1; border: none; background: none; padding: 10px 16px; border-radius: 999px;
    font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.eal-dash-tab.is-active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(36, 33, 29, 0.08); }

/* ---- Forms ---- */
.eal-dash-card form,
form.eal-dash-card,
.eal-dash-account-form { display: flex; flex-direction: column; gap: 16px; }
.eal-dash label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.eal-dash input[type="text"], .eal-dash input[type="email"], .eal-dash input[type="password"],
.eal-dash input[type="date"], .eal-dash input[type="time"], .eal-dash select, .eal-dash textarea {
    font: inherit; font-size: 14px; color: var(--ink); font-weight: 400;
    padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
    width: 100%; box-sizing: border-box; background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.eal-dash input:focus, .eal-dash select:focus, .eal-dash textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(140, 91, 77, 0.14);
}
.eal-dash textarea { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

.eal-pw-wrap { position: relative; }
.eal-pw-wrap input { padding-right: 42px; }
.eal-pw-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    background: none; border: none; border-radius: 8px; color: var(--muted); cursor: pointer;
    transition: color .15s ease, background .15s ease;
}
.eal-pw-toggle:hover { color: var(--accent-text); background: #f6f1ea; }

.eal-dash input::placeholder { color: #b7ac9d; }
.eal-dash-topbar-title strong { letter-spacing: .01em; }

.eal-dash button[type="submit"], .eal-dash-card > form button:not(.eal-pw-toggle) {
    align-self: center; background: var(--ink); color: #fff; border: none;
    border-radius: 999px; padding: 12px 28px; font-weight: 400; font-size: 14px; cursor: pointer;
    transition: opacity .15s ease;
}
.eal-dash button[type="submit"]:hover { opacity: .85; }

/* Auth screen (login/register): full-width button to match the inputs above it, not a small left-aligned pill. */
.eal-dash-auth-card form button[type="submit"] {
    align-self: stretch;
    padding: 14px 24px;
    font-size: 15px;
    margin-top: 4px;
}
.eal-dash-auth-card .eal-dash-hint {
    margin-top: 14px;
    text-align: center;
}

/* ---- Cover Photo / Extra Photos upload widgets ---- */
.eal-dash-image-upload, .eal-dash-gallery-upload {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.eal-dash-image-preview, .eal-dash-gallery-thumb {
    position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden;
    border: 1px solid var(--line); background: #fff; flex: none;
}
.eal-dash-image-preview img, .eal-dash-gallery-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.eal-dash-gallery-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.eal-dash-image-remove {
    position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; line-height: 18px;
    border-radius: 50%; border: none; background: rgba(25, 25, 26, 0.75); color: #fff;
    font-size: 14px; cursor: pointer; padding: 0; text-align: center;
}
.eal-dash-image-remove:hover { background: var(--ink); }
.eal-dash-image-pick-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    background: #fff; border: 1px dashed var(--line); border-radius: 10px;
    padding: 11px 18px; font-size: 13px; font-weight: 600; color: var(--muted);
    cursor: pointer; transition: border-color .15s ease, color .15s ease;
}
.eal-dash-image-pick-btn:hover { border-color: var(--accent-text); color: var(--accent-text); }
.eal-dash-image-status { font-size: 12px; color: var(--muted); }

.eal-dash-template-choices { display: flex; gap: 12px; flex-wrap: wrap; }
.eal-dash-template-option {
    flex-direction: row; align-items: center; gap: 8px; border: 1px solid var(--line);
    border-radius: 10px; padding: 12px 16px; font-weight: 400; color: var(--ink); cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.eal-dash-template-option:has(input:checked) { border-color: var(--accent); background: rgba(140, 91, 77, 0.06); }

/* ---- Topbar + account menu ---- */
.eal-dash-topbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line);
    gap: 16px; flex-wrap: wrap;
}
.eal-dash-topbar-title { display: flex; flex-direction: column; gap: 3px; }
.eal-dash-eyebrow { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.eal-dash-topbar-title strong { font-family: var(--font-display); font-size: 24px; line-height: 1.1; }
.eal-dash-topbar-actions { display: flex; align-items: center; gap: 14px; }

.eal-dash-view-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: var(--accent-text);
    text-decoration: none; white-space: nowrap;
    padding: 9px 16px; border: 1px solid var(--ink); border-radius: 999px;
    transition: background .15s ease, color .15s ease;
}
.eal-dash-view-link:hover { background: var(--ink); color: #fff; }

.eal-dash-account { position: relative; display: flex; }
.eal-dash-account-btn {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--ink);
    background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: 15px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background .15s ease, box-shadow .15s ease;
}
.eal-dash-account-btn:hover { background: var(--accent-dark); }
.eal-dash-account-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(140, 91, 77, 0.25); }
.eal-dash-account-menu {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 30;
    width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 12px 30px rgba(36, 33, 29, 0.12); padding: 8px;
}
.eal-dash-account-email { font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; word-break: break-all; }
.eal-dash-account-item {
    display: block; padding: 10px; border-radius: 8px; font-size: 14px; color: var(--ink);
    text-decoration: none; cursor: pointer;
}
.eal-dash-account-item:hover { background: #f6f1ea; }
.eal-dash-account-item summary { list-style: none; font-weight: 500; }
.eal-dash-account-item summary::-webkit-details-marker { display: none; }
.eal-dash-account-form { padding: 12px 4px 4px; }
.eal-dash-account-form button:not(.eal-pw-toggle) { font-size: 13px; padding: 10px 18px; }
.eal-dash-account-logout { color: var(--accent-text); font-weight: 500; }

/* ---- Banners ---- */
.eal-dash-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px;
}
.eal-dash-banner-warn { background: #f8edeb99; border: 1px solid #f8edeb; color: #8a5a1f; }
.eal-dash-error { background: #fdecea; color: #b42318; border-radius: 10px; padding: 12px 16px; margin-top: 16px; margin-bottom: 16px; font-size: 14px; }
.eal-dash-success { background: #eaf6ec; color: #217a37; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.eal-dash-link-btn { background: none; border: none; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

/* ---- RSVP table ---- */
.eal-dash-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.eal-dash-table th {
    text-align: left; padding: 10px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted); border-bottom: 1px solid var(--line);
}
.eal-dash-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); font-size: 14px; }

/* ---- App-shell editor layout ---- */
.eal-dash-app { max-width: 1400px; margin-left: auto; margin-right: auto; }
/* The base ".eal-dash > *" rule above caps every direct child at 780px for
 * simple single-column layouts — the app-shell needs its topbar/body to use
 * the full 1400px width instead, so override that here for its children specifically. */
.eal-dash-app > .eal-dash-topbar,
.eal-dash-app > .eal-dash-banner,
.eal-dash-app > .eal-dash-app-body,
.eal-dash-app > .eal-dash-success,
.eal-dash-app > .eal-dash-error {
    max-width: 100%;
}
.eal-dash-status-line { font-size: 12px; color: var(--muted); margin-top: 2px; }
.eal-dash-status-badge { font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.eal-dash-status-badge.is-published { background: #eaf6ec; color: #217a37; }
.eal-dash-status-badge.is-draft { background: #f1ece3; color: var(--muted); }

.eal-dash-publish-btn {
    background: var(--ink); color: #fff; border: none; border-radius: 999px;
    padding: 9px 18px; font-weight: 400; font-size: 13px; cursor: pointer;
}
.eal-dash-publish-btn.is-published { background: var(--accent); color: var(--accent-text); border: 1px solid var(--ink); }
.eal-dash-publish-btn:hover { opacity: .85; }

.eal-dash-app-body {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 1100px) {
    .eal-dash-app-body { grid-template-columns: 1fr; }
    .eal-dash-preview-pane { position: static; margin-top: 20px; }
    .eal-dash-preview-frame-wrap { height: 480px; }
}

.eal-dash-main-col { display: flex; flex-direction: column; gap: 0; min-width: 0; }

.eal-dash-tabs-row {
    display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 2px solid var(--line);
    padding: 0 4px 2px;
}
.eal-dash-section-tab {
    background: none; border: none; padding: 11px 18px; font: inherit; font-size: 13px;
    letter-spacing: .02em; color: var(--muted); cursor: pointer; position: relative; top: 2px;
    border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0;
    transition: color .15s ease, background .15s ease;
}
.eal-dash-section-tab:hover { color: var(--ink); background: rgba(140, 91, 77, 0.06); }
.eal-dash-section-tab.is-active { color: var(--accent-text); font-weight: 700; border-bottom-color: var(--accent-dark); }

.eal-dash-main-panel {
    background: var(--card-solid); border: 1px solid var(--line); border-top: none;
    border-radius: 0 0 var(--radius) var(--radius); padding: 32px; display: flex; flex-direction: column; gap: 16px;
    box-shadow: 0 6px 24px rgba(36, 33, 29, 0.05);
}
.eal-dash-save-btn { align-self: center; margin-top: 8px; }

.eal-dash-preview-pane {
    background: var(--card-solid); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; position: sticky; top: 20px;
    box-shadow: 0 6px 24px rgba(36, 33, 29, 0.05);
}
.eal-dash-preview-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted);
}
.eal-dash-preview-controls { display: flex; align-items: center; gap: 4px; }
.eal-dash-preview-size {
    background: none; border: 1px solid var(--line); border-radius: 999px;
    padding: 5px 12px; font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.eal-dash-preview-size.is-active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.eal-dash-preview-refresh { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--muted); margin-left: 4px; }
.eal-dash-preview-refresh:hover { color: var(--accent-text); }

.eal-dash-preview-frame-wrap {
    height: 640px; overflow-y: auto; overflow-x: auto;
    display: flex; justify-content: center; align-items: flex-start; background: #ececec;
    padding: 16px 0;
}
.eal-dash-preview-scale-box {
    position: relative; overflow: hidden; flex-shrink: 0; background: #fff;
}
.eal-dash-preview-scale-box.is-desktop { box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.eal-dash-preview-scale-box.is-mobile { border-radius: 20px; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.eal-dash-preview-frame {
    border: none; display: block; position: absolute; top: 0; left: 0;
    transform-origin: top left;
}

.eal-dash-template-switcher {
    display: flex; align-items: center; gap: 8px;
    background: #fff; border: 1px solid var(--line); border-radius: 999px;
    padding: 6px 14px 6px 16px;
}
.eal-dash-template-switcher label { font-size: 12px; font-weight: 600; color: var(--muted); }
.eal-dash-template-switcher select {
    border: none; background: none; font: inherit; font-size: 13px; font-weight: 600;
    color: var(--ink); padding: 2px 4px; cursor: pointer;
}
.eal-dash-template-switcher select:focus { outline: none; }

.eal-dash-template-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
@media (max-width: 900px) {
    .eal-dash-template-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
.eal-dash-language-field { max-width: 320px; margin-top: 24px; }
.eal-dash-language-hint { padding-right: 12px; margin-top: 10px; }
@media (max-width: 480px) {
    .eal-dash-template-grid { grid-template-columns: 1fr; gap: 14px; }
    .eal-dash-language-field { max-width: 100%; margin-top: 20px; margin-right: 12px; }
    .eal-dash-language-hint { padding-right: 20px; }
}
.eal-dash-template-card {
    position: relative; display: flex; flex-direction: column;
    border: 2px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer;
    background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
.eal-dash-template-card:hover { border-color: rgba(140, 91, 77, 0.4); }
.eal-dash-template-card:has(.eal-dash-template-radio:checked),
.eal-dash-template-card.is-selected {
    border-color: var(--accent); box-shadow: 0 4px 16px rgba(140, 91, 77, 0.18);
}
.eal-dash-template-radio { position: absolute; opacity: 0; pointer-events: none; }
.eal-dash-template-preview { display: block; width: 100%; aspect-ratio: 1280 / 804; overflow: hidden; background: #eee; }
.eal-dash-template-preview img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.eal-dash-template-card-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.eal-dash-template-card-body strong { font-size: 14px; color: var(--ink); }
.eal-dash-template-card-body span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.eal-dash-template-check {
    position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%;
    background: var(--accent); color: var(--accent-text); display: flex; align-items: center; justify-content: center;
    font-size: 12px; opacity: 0; transform: scale(0.6); transition: opacity .15s ease, transform .15s ease;
}
.eal-dash-template-card:has(.eal-dash-template-radio:checked) .eal-dash-template-check,
.eal-dash-template-card.is-selected .eal-dash-template-check {
    opacity: 1; transform: scale(1);
}

.eal-dash-package-choices { display: flex; gap: 12px; flex-wrap: wrap; }
.eal-dash-package-option {
    flex-direction: column; align-items: flex-start; gap: 4px; border: 1px solid var(--line);
    border-radius: 10px; padding: 14px 18px; font-weight: 400; color: var(--ink); cursor: pointer;
    min-width: 120px; transition: border-color .15s ease, background .15s ease;
}
.eal-dash-package-option:has(input:checked) { border-color: var(--accent); background: rgba(140, 91, 77, 0.06); }
.eal-dash-package-option span { font-size: 18px; font-weight: 700; color: var(--accent-text); }

.eal-dash-status-badge.is-package { background: rgba(140, 91, 77, 0.12); color: var(--accent-text); }

.eal-dash-upgrade-prompt {
    background: #f8edeb99; border: 1px solid #f8edeb; border-radius: 12px;
    padding: 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.eal-dash-upgrade-prompt p { margin: 0; font-size: 14px; color: #8a5a1f; }
.eal-dash-upgrade-btn {
    display: inline-block; background: var(--ink); color: #fff; text-decoration: none;
    border-radius: 999px; padding: 12px 24px; font-weight: 400; font-size: 14px;
}
.eal-dash-upgrade-btn:hover { opacity: .85; }
