.moon-calendar,
.moon-calendar * { box-sizing: border-box; }

.moon-calendar {
    --mc-ink: #172036;
    --mc-muted: #778097;
    --mc-line: #e8ebf2;
    --mc-soft: #f6f7fb;
    --mc-accent: #6657d9;
    --mc-accent-soft: #eeecff;
    --mc-night: #171a32;
    width: 100%;
    margin: 32px auto;
    color: var(--mc-ink);
    font-family: inherit;
}

.mc-shell {
    overflow: hidden;
    max-width: 1080px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--mc-line);
    border-radius: 26px;
    box-shadow: 0 18px 60px rgba(28, 34, 57, .08);
}

.mc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 30px 32px 24px;
}

.mc-heading { min-width: 0; }
.mc-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--mc-accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.mc-title { margin: 0; color: var(--mc-ink); font-size: clamp(25px, 3vw, 34px); line-height: 1.15; font-weight: 750; }
.mc-location { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; color: var(--mc-muted); font-size: 13px; }
.mc-location svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.mc-navigation { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.mc-nav, .mc-today-button {
    border: 1px solid var(--mc-line) !important;
    background: #fff !important;
    color: var(--mc-ink) !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: .2s ease;
}
.mc-nav { display: grid; place-items: center; width: 42px; height: 42px; padding: 0 !important; border-radius: 12px !important; }
.mc-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.mc-today-button { min-height: 42px; padding: 0 16px !important; border-radius: 12px !important; font: inherit; font-size: 13px; font-weight: 700; }
.mc-nav:hover, .mc-today-button:hover { border-color: #cbc6f6 !important; background: var(--mc-accent-soft) !important; color: var(--mc-accent) !important; transform: translateY(-1px); }

.mc-feature {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) minmax(340px, 1.4fr);
    align-items: center;
    gap: 24px;
    margin: 0 32px 28px;
    padding: 24px 26px;
    color: #fff;
    background: var(--mc-night);
    border-radius: 20px;
    box-shadow: inset 0 1px rgba(255,255,255,.08);
}
.mc-feature-visual { display: grid; place-items: center; width: 82px; height: 82px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.mc-feature-moon { width: 54px; height: 54px; }
.mc-feature-label { color: #aaa4f7; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.mc-feature-copy h3 { margin: 3px 0 3px; color: #fff; font-size: 22px; line-height: 1.25; }
.mc-feature-copy p { margin: 0; color: rgba(255,255,255,.64); font-size: 13px; }
.mc-feature-stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; overflow: hidden; }
.mc-stat { padding: 14px 16px; border-left: 1px solid rgba(255,255,255,.1); }
.mc-stat:first-child { border-left: 0; }
.mc-stat span { display: block; margin-bottom: 4px; color: rgba(255,255,255,.55); font-size: 11px; }
.mc-stat strong { color: #fff; font-size: 18px; font-weight: 750; }

.mc-calendar-wrap { position: relative; padding: 0 32px 30px; min-height: 500px; }
.mc-weekdays, .mc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.mc-weekdays { margin-bottom: 8px; }
.mc-weekdays span { padding: 9px 4px; color: #9a9fb0; text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

.mc-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    min-height: 124px;
    padding: 10px 8px 9px !important;
    overflow: hidden;
    border: 1px solid var(--mc-line) !important;
    border-radius: 15px !important;
    background: #fff !important;
    color: var(--mc-ink) !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}
.mc-day:not(.mc-day-empty):hover { z-index: 2; border-color: #cfcaf7 !important; box-shadow: 0 10px 25px rgba(55, 45, 130, .09) !important; transform: translateY(-2px); }
.mc-day.is-selected { border-color: var(--mc-accent) !important; background: var(--mc-accent-soft) !important; box-shadow: 0 0 0 2px rgba(102,87,217,.1) !important; }
.mc-day.is-today:after { position: absolute; top: 0; right: 0; width: 24px; height: 24px; border-radius: 0 14px 0 16px; background: var(--mc-accent); content: ''; }
.mc-day-empty { visibility: hidden; pointer-events: none; }
.mc-day-top { display: flex; align-items: center; justify-content: space-between; width: 100%; line-height: 1; }
.mc-day-top strong { font-size: 14px; font-weight: 800; }
.mc-day-top em { color: var(--mc-accent); font-size: 8px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.mc-day.is-today .mc-day-top em { display: none; }
.mc-day-phase { display: block; width: 100%; margin-top: 7px; overflow: hidden; color: #626a80; font-size: 9px; font-weight: 650; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.mc-day-light { margin-top: 2px; color: #a0a5b3; font-size: 9px; }

.mc-moon, .mc-feature-moon, .mc-mini-moon {
    position: relative;
    display: inline-block;
    overflow: hidden;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #f4f0d6;
    box-shadow: inset -4px -3px 8px rgba(65, 58, 44, .22), 0 2px 8px rgba(11,15,30,.18);
}
.mc-moon { width: 42px; height: 42px; margin-top: 10px; }
.mc-mini-moon { width: 15px; height: 15px; box-shadow: inset -2px -1px 3px rgba(65,58,44,.22); vertical-align: -3px; }
.mc-moon:after, .mc-feature-moon:after, .mc-mini-moon:after { position: absolute; inset: 0; border-radius: inherit; background: #23263f; content: ''; }
.mc-phase-new:after { transform: translateX(0); }
.mc-phase-waxing-crescent:after { transform: translateX(-32%); }
.mc-phase-first-quarter:after { transform: translateX(-50%); border-radius: 0; }
.mc-phase-waxing-gibbous:after { transform: translateX(-78%); }
.mc-phase-full:after { transform: translateX(-110%); }
.mc-phase-waning-gibbous:after { transform: translateX(78%); }
.mc-phase-last-quarter:after { transform: translateX(50%); border-radius: 0; }
.mc-phase-waning-crescent:after { transform: translateX(32%); }

.mc-loading { position: absolute; inset: 0 32px 30px; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--mc-muted); background: rgba(255,255,255,.92); border-radius: 16px; font-size: 13px; }
.mc-loading[hidden] { display: none; }
.mc-spinner { width: 34px; height: 34px; border: 3px solid #e8e6f8; border-top-color: var(--mc-accent); border-radius: 50%; animation: mc-spin .8s linear infinite; }
@keyframes mc-spin { to { transform: rotate(360deg); } }
.mc-error { grid-column: 1 / -1; padding: 50px 20px; color: #a33; background: #fff6f6; border: 1px solid #f3d7d7; border-radius: 15px; text-align: center; }

.mc-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 32px; background: var(--mc-soft); border-top: 1px solid var(--mc-line); }
.mc-legend { display: flex; flex-wrap: wrap; gap: 16px; }
.mc-legend span { color: #6f7689; font-size: 10px; font-weight: 650; }
.mc-attribution { color: #969baa !important; font-size: 9px; text-decoration: none !important; white-space: nowrap; }
.mc-attribution:hover { color: var(--mc-accent) !important; }

@media (max-width: 860px) {
    .mc-feature { grid-template-columns: auto 1fr; }
    .mc-feature-stats { grid-column: 1 / -1; }
    .mc-day { min-height: 112px; }
    .mc-day-phase { display: none; }
}

@media (max-width: 640px) {
    .moon-calendar { margin: 20px auto; }
    .mc-shell { border-radius: 20px; }
    .mc-header { align-items: flex-end; padding: 22px 18px 18px; }
    .mc-eyebrow { font-size: 9px; }
    .mc-title { font-size: 22px; }
    .mc-location { margin-top: 5px; font-size: 11px; }
    .mc-today-button { display: none; }
    .mc-nav { width: 38px; height: 38px; }
    .mc-feature { grid-template-columns: auto 1fr; gap: 14px; margin: 0 14px 20px; padding: 17px; border-radius: 17px; }
    .mc-feature-visual { width: 62px; height: 62px; }
    .mc-feature-moon { width: 42px; height: 42px; }
    .mc-feature-copy h3 { font-size: 17px; }
    .mc-feature-stats { gap: 0; }
    .mc-stat { padding: 10px 7px; text-align: center; }
    .mc-stat strong { font-size: 14px; }
    .mc-calendar-wrap { min-height: 380px; padding: 0 8px 20px; overflow-x: auto; }
    .mc-weekdays, .mc-grid { gap: 3px; }
    .mc-weekdays span { padding: 6px 0; font-size: 8px; }
    .mc-day { min-height: 82px; padding: 7px 2px 6px !important; border-radius: 10px !important; }
    .mc-day.is-today:after { width: 16px; height: 16px; border-radius: 0 9px 0 10px; }
    .mc-day-top strong { font-size: 11px; }
    .mc-moon { width: 28px; height: 28px; margin-top: 8px; }
    .mc-day-light { font-size: 8px; }
    .mc-footer { display: block; padding: 15px 18px; }
    .mc-legend { gap: 8px 13px; }
    .mc-legend span { font-size: 8px; }
    .mc-attribution { display: inline-block; margin-top: 10px; }
    .mc-loading { inset: 0 8px 20px; }
}
