:root {
    --bg: #ffffff;
    --ink: #0b2d5b;
    --muted: #5a6b7f;
    --accent: #ff4d8d;
    --accent-soft: rgba(255, 77, 141, 0.14);
    --surface: #ffffff;
    --line: #e4e8f0;
    --shadow: 0 24px 60px rgba(11, 45, 91, 0.08);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --font-main: "Mikado", "Poppins", "Inter", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M60 82c-16-12-28-22-28-36 0-8 6-14 14-14 7 0 12 4 14 9 2-5 7-9 14-9 8 0 14 6 14 14 0 14-12 24-28 36Z' fill='rgba(255,77,141,0.06)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cpath d='M80 110c-22-16-38-30-38-48 0-11 9-20 20-20 10 0 18 6 20 13 3-7 10-13 20-13 11 0 20 9 20 20 0 18-16 32-38 48Z' fill='rgba(11,45,91,0.04)'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cpath d='M70 96c-18-13-32-25-32-40 0-9 7-16 16-16 8 0 14 5 16 10 2-5 8-10 16-10 9 0 16 7 16 16 0 15-14 27-32 40Z' fill='rgba(255,77,141,0.05)'/%3E%3C/svg%3E");
    background-size: 120px 120px, 160px 160px, 140px 140px;
    background-position: 12% 18%, 82% 26%, 72% 78%;
}

.app {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 80px;
    text-align: center;
}

.app-header {
    display: flex;
    justify-content: center;
    margin-bottom: 6px;
}

.brand {
    font-weight: 800;
    font-size: 22px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    padding: 0;
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 18px;
    background: var(--accent);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.brand-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.app-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.view {
    width: 100%;
}

.hidden {
    display: none;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 20px;
}

.hero h1 {
    margin: 0;
    font-size: 46px;
    font-weight: 800;
}

.hero-title {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.hero-heart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: var(--accent);
    color: #ffffff;
    font-size: 22px;
    box-shadow: 0 12px 26px rgba(255, 77, 141, 0.25);
}

.hero p {
    margin: 0;
    color: var(--muted);
    font-size: 18px;
}

.card {
    background: var(--surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 50px rgba(11, 45, 91, 0.08);
    border: 1px solid rgba(11, 45, 91, 0.04);
    max-width: 760px;
    margin: 0 auto;
    text-align: left;
}

.card h2,
.card h3 {
    margin-top: 0;
}

.subtitle {
    margin: 6px 0 0;
    color: var(--muted);
}

.status-note {
    margin-top: 12px;
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    min-height: 18px;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 600;
}

.field-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
}

.field-title-row .btn {
    margin-left: auto;
    pointer-events: auto;
    position: relative;
    z-index: 3;
}

.campaign-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 4;
    pointer-events: auto;
}

.campaign-note {
    margin-bottom: 4px;
}


.field-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.field-note {
    font-size: 12px;
    color: var(--muted);
    font-weight: 500;
}

.field input,
.field textarea {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 16px;
    font-family: var(--font-main);
}

.template-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-chip {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 999px;
}

.image-preview {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #ffffff;
}

.image-preview img {
    width: 100%;
    border-radius: 14px;
    max-height: 260px;
    object-fit: cover;
}

.image-preview-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    color: var(--muted);
    gap: 12px;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.signature {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
}

.form-message {
    min-height: 20px;
    color: var(--accent);
    font-weight: 600;
}

.btn {
    border: none;
    border-radius: 999px;
    padding: 14px 22px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(255, 77, 141, 0.25);
}

.btn-secondary {
    background: var(--accent-soft);
    color: var(--accent);
}

.btn-large {
    padding: 16px 28px;
    font-size: 17px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 12px;
}

.helper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    font-size: 14px;
    color: var(--muted);
}

.helper a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}

.thankyou-card {
    text-align: center;
}

.thankyou-mark {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: var(--accent-soft);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
}

.actions-row.center {
    justify-content: center;
}

.admin-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px;
}

.admin-header h2 {
    font-size: 22px;
    margin-bottom: 4px;
}

.admin-header .subtitle {
    font-size: 14px;
    color: rgba(90, 107, 127, 0.8);
}

#adminBackBtn {
    opacity: 0.75;
}

.section-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
    margin: 12px 0 6px;
}

.admin-intro {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: rgba(90, 107, 127, 0.75);
}

.campaign-summary {
    margin-top: 18px;
}

.summary-list {
    margin: 8px 0 0 18px;
    padding: 0;
    color: rgba(90, 107, 127, 0.85);
    font-size: 14px;
    line-height: 1.5;
}

.summary-list li {
    margin-bottom: 4px;
}

.share-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 10px;
}

#copyLinkBtn {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 10px 26px rgba(255, 77, 141, 0.25);
}

#downloadQrBtn,
#copyAdminBtn,
#copyShortBtn {
    opacity: 0.7;
}

#adminShareLink {
    color: rgba(90, 107, 127, 0.7);
}

.admin-note {
    margin-top: 4px;
}

.share-actions {
    margin-top: 6px;
}

.share-grid {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 16px;
    align-items: start;
    margin-top: 12px;
}

.share-admin .share-row {
    margin-top: 0;
}

.share-row input::placeholder {
    color: var(--muted);
}

.share-row input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 15px;
    font-family: var(--font-main);
    color: var(--muted);
}

.qr-block {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.qr-block img {
    width: 140px;
    height: 140px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #ffffff;
    padding: 6px;
}

.qr-label {
    font-weight: 700;
}

.qr-fallback {
    font-size: 14px;
    color: var(--muted);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 26px 0 30px;
}

.stat-card {
    border: 1px solid rgba(11, 45, 91, 0.08);
    border-radius: var(--radius-md);
    padding: 16px;
    background: #ffffff;
}

.stat-card.primary {
    grid-column: span 2;
    order: -1;
    border-color: rgba(255, 77, 141, 0.2);
    background: rgba(255, 77, 141, 0.06);
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    margin-top: 8px;
}

#deliveryStatus {
    font-size: 30px;
    color: var(--ink);
}

.stat-helper {
    font-size: 12px;
    color: rgba(90, 107, 127, 0.7);
    margin-top: 6px;
}

#unlockBlock .subtitle {
    margin-top: 6px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 14px 0 10px;
}

.comparison-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.comparison-item {
    font-size: 13px;
    color: rgba(90, 107, 127, 0.85);
    margin-bottom: 4px;
}

.chart-note {
    font-size: 12px;
    color: rgba(90, 107, 127, 0.7);
    margin: -6px 0 10px;
}

.settings-group-title {
    font-weight: 700;
    font-size: 14px;
    margin: 16px 0 8px;
    color: var(--ink);
}

.charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.chart-card {
    border: 1px solid rgba(11, 45, 91, 0.08);
    border-radius: var(--radius-md);
    padding: 16px;
    background: #ffffff;
}

.list-card {
    margin-top: 30px;
    border: 1px solid rgba(11, 45, 91, 0.08);
    border-radius: var(--radius-md);
    padding: 16px;
}

.list-card h3 {
    margin-bottom: 6px;
}

.list-card .subtitle {
    font-size: 14px;
    line-height: 1.4;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.settings-grid input {
    padding: 10px 12px;
    border-color: rgba(11, 45, 91, 0.12);
}

.settings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 22px;
}

.settings-row .toggle {
    font-size: 14px;
    color: rgba(90, 107, 127, 0.8);
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.moderation-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px;
    background: #ffffff;
}

.moderation-actions {
    display: flex;
    gap: 10px;
}

.recipient-card {
    text-align: center;
}

.recipient-message {
    font-size: 18px;
    line-height: 1.5;
    margin: 18px 0;
}

.recipient-image img {
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-md);
}

.recipient-signature {
    margin-top: 14px;
    font-weight: 700;
    color: var(--ink);
}

.divider {
    height: 1px;
    background: var(--line);
    margin: 24px 0;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    color: var(--muted);
}

.recent-item strong {
    color: var(--ink);
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

#exportCsvBtn {
    opacity: 0.85;
}

#exportCsvBtn.is-primary {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 10px 26px rgba(255, 77, 141, 0.25);
    opacity: 1;
}

#seedDataBtn,
#clearDataBtn {
    opacity: 0.7;
}

@media (max-width: 720px) {
    .card {
        padding: 24px;
    }

    .helper {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .share-row {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-header {
        flex-direction: column;
    }

    .settings-row {
        flex-direction: column;
    }

    .share-grid {
        grid-template-columns: 1fr;
    }

    .stat-card.primary {
        grid-column: span 1;
    }
}
