:root {
    --app-bg: linear-gradient(180deg, #f4f7fb 0%, #eaf1f8 100%);
    --card-bg: rgba(255, 255, 255, 0.9);
    --line: #d9e1ea;
    --text-soft: #637083;
    --today: #d9ebff;
    --weekend: #f7f1eb;
    --holiday: #f7f1eb;
    --filled: #d9ece3;
    --outside: #f6f8fb;
}

body {
    min-height: 100vh;
    background: var(--app-bg);
    color: #1e293b;
}

.flash-host {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1085;
    width: min(420px, calc(100vw - 2rem));
    pointer-events: none;
}

.flash-host .alert {
    pointer-events: auto;
}

.page-shell {
    max-width: 1440px;
}

.hero,
.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
}

.eyebrow {
    letter-spacing: 0.18em;
    color: #7b8798;
    font-size: 0.72rem;
    font-weight: 700;
}

.status-panel {
    min-width: 280px;
    padding: 1rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.72);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.6rem;
}

.calendar-head-cell {
    padding: 0.75rem 0.9rem;
    border-radius: 0.85rem;
    background: #edf3f9;
    color: #4c5d73;
    font-size: 0.92rem;
    font-weight: 700;
    text-align: center;
}

.calendar-day {
    min-height: 124px;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-align: left;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.75rem 2rem rgba(15, 23, 42, 0.08);
    border-color: #b7c8db;
}

.calendar-day.is-weekend {
    background: var(--weekend);
}

.calendar-day.is-holiday {
    background: var(--holiday);
}

.calendar-day.is-today {
    outline: 2px solid #4f8edc;
    background: var(--today);
}

.calendar-day.is-filled {
    box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--filled) 84%, transparent);
    border-color: #b9d2c3;
}

.calendar-day.is-outside {
    background: var(--outside);
    color: #8190a3;
}

.calendar-day:disabled {
    opacity: 0.75;
}

.day-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
}

.day-number {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.day-weekday {
    color: var(--text-soft);
    font-size: 0.8rem;
}

.day-holiday {
    color: #866657;
    font-size: 0.8rem;
    font-weight: 600;
    min-height: 2.2em;
    line-height: 1.15;
    overflow: hidden;
    text-align: right;
    flex: 1 1 auto;
    max-width: 62%;
}

.day-entry {
    margin-top: auto;
    padding: 0.5rem 0.65rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.82);
    border: 1px dashed #c3d0de;
    min-height: 46px;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.2;
}

.day-entry.is-empty {
    color: #a7b1bf;
    font-weight: 400;
    border-color: #d7dee7;
    background: rgba(255, 255, 255, 0.66);
}

.calendar-day.is-filled .day-entry {
    background: rgba(242, 250, 246, 0.92);
    border-color: #a8c4b2;
}

.legend-swatch {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border-radius: 0.3rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    margin-right: 0.35rem;
    vertical-align: text-bottom;
}

.legend-swatch.is-today { background: var(--today); }
.legend-swatch.is-weekend { background: var(--weekend); }
.legend-swatch.is-holiday { background: var(--holiday); }
.legend-swatch.is-filled { background: var(--filled); }
.legend-swatch.is-outside { background: var(--outside); }

.token-cell {
    max-width: 240px;
    word-break: break-all;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.85rem;
}

.token-display {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

#latestLinkPanel {
    background: rgba(255, 255, 255, 0.85);
}

.footer-signature {
    color: #263445;
    font-size: 0.95rem;
}

.mi-signature {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 85px;
    height: 25px;
    text-decoration: none;
    background-color: #707070;
    mask-image: url("img/signature.svg");
    -webkit-mask-image: url("img/signature.svg");
    mask-size: cover;
    -webkit-mask-size: cover;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    transition: transform 0.14s ease, background-color 0.14s ease;
}

.mi-signature:hover {
    transform: translateY(-1px);
    background-color: #c3001a;
}

@media (max-width: 991.98px) {
    .calendar-grid {
        gap: 0.5rem;
    }

    .calendar-day {
        min-height: 116px;
        padding: 0.68rem;
    }
}

@media (max-width: 767.98px) {
    .calendar-head {
        display: none;
    }

    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-day {
        min-height: 108px;
    }

    .footer-signature .row > div {
        justify-content: center !important;
        text-align: center;
    }

    .footer-signature p {
        justify-content: center !important;
    }
}
