.m4cd {
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: #fff;
    color: #192231;
    box-shadow: 0 30px 80px rgba(77, 11, 23, .35);
    overflow: auto;
    font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
}
.m4cd::backdrop { background: rgba(25, 14, 18, .45); }
.m4cd[open] { animation: m4cd-in .28s ease-out; }
@keyframes m4cd-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.m4cd p { margin: 0; }
.m4cd-card { position: relative; }

.m4cd-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.m4cd-close:hover { background: rgba(255, 255, 255, .28); }

.m4cd-head {
    padding: 22px 22px 20px;
    background: linear-gradient(112deg, #8e1825 0%, #b41f2e 55%, #d8463f 100%);
    color: #fff;
    text-align: center;
}
.m4cd-eyebrow { font-size: .8rem; font-weight: 800; letter-spacing: .02em; color: #ffe1d6; }
.m4cd-count { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-top: 4px !important; font-weight: 800; font-size: 1.15rem; }
.m4cd-count b { font-size: clamp(3.2rem, 14vw, 4.4rem); line-height: 1.05; color: #ffe1a3; font-variant-numeric: tabular-nums; }
.m4cd-date { font-size: .86rem; color: #fff1ec; }

.m4cd-body { padding: 18px 20px 4px; }
.m4cd-loading { color: #566273; text-align: center; padding: 14px 0; }

.m4cd-cheer {
    padding: 11px 14px;
    border-radius: 14px;
    background: #fff5ec;
    border-left: 4px solid #e58a2e;
    font-weight: 600;
}
.m4cd-cheer p + p { margin-top: 4px; font-weight: 500; color: #566273; font-size: .9rem; }

.m4cd-section { margin-top: 16px !important; font-weight: 800; font-size: .9rem; color: #8e1825; }
.m4cd-time {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 9px 12px;
    border-radius: 14px;
    background: #fff0f1;
    border: 1px solid #f3cfd2;
}
.m4cd-time-icon { font-size: 1.5rem; line-height: 1; }
.m4cd-time div { flex: 1; min-width: 0; }
.m4cd-time div span { display: block; font-size: .78rem; color: #566273; }
.m4cd-time strong { display: block; font-size: 1.3rem; line-height: 1.25; color: #8e1825; font-variant-numeric: tabular-nums; }
.m4cd-time small { font-size: .78rem; color: #566273; white-space: nowrap; }

.m4cd-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.m4cd-tile { padding: 10px 12px; border: 1px solid #efe3df; border-radius: 14px; background: #fffdfa; }
.m4cd-tile strong { display: block; font-size: 1.35rem; line-height: 1.2; color: #8e1825; font-variant-numeric: tabular-nums; }
.m4cd-tile span { font-size: .78rem; color: #566273; }

.m4cd-goal { margin-top: 12px; }
.m4cd-goal-label { display: flex; justify-content: space-between; font-size: .82rem; color: #566273; }
.m4cd-goal-label b { color: #192231; }
.m4cd-track { height: 9px; margin-top: 5px; border-radius: 99px; background: #f3e9e5; overflow: hidden; }
.m4cd-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f07c6a, #c92532); }

.m4cd-actions { display: flex; gap: 8px; padding: 16px 20px 6px; }
.m4cd-go, .m4cd-later {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 18px;
    border-radius: 999px;
    font-weight: 800;
    font-size: .95rem;
    text-decoration: none;
    cursor: pointer;
}
.m4cd-go { flex: 1; background: #c92532; color: #fff; border: 2px solid #c92532; }
.m4cd-go:hover { background: #8e1825; border-color: #8e1825; color: #fff; }
.m4cd-later { background: #fff; color: #8e1825; border: 2px solid #e4c3c6; }
.m4cd-later:hover { background: #fff0f1; }
.m4cd-note { padding: 0 20px 16px; text-align: center; font-size: .75rem; color: #8a94a3; }

/* Short screens (landscape phones, small laptops): keep everything visible without scrolling. */
@media (max-height: 760px) {
    .m4cd { font-size: 14px; }
    .m4cd-head { padding: 14px 20px 12px; }
    .m4cd-count b { font-size: 3rem; }
    .m4cd-body { padding-top: 12px; }
    .m4cd-cheer { padding: 8px 12px; }
    .m4cd-section { margin-top: 10px !important; }
    .m4cd-tile { padding: 6px 10px; }
    .m4cd-tile strong { font-size: 1.15rem; }
    .m4cd-actions { padding-top: 12px; }
    .m4cd-go, .m4cd-later { min-height: 40px; }
    .m4cd-note { padding-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) { .m4cd[open] { animation: none; } }
@media print { .m4cd { display: none !important; } }
