*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --available-bg:     #c8e6c9;
    --available-text:   #1b5e20;
    --available-border: #81c784;
    --busy-bg:          #ffcdd2;
    --busy-text:        #b71c1c;
    --busy-border:      #e57373;
    --card-bg:          rgba(255, 255, 255, 0.88);
    --radius:           22px;
    --shadow:           0 24px 72px rgba(0, 0, 0, 0.38);
}

body {
    min-height: 100svh;
    background: #2d2d2d url('photo.jpg') center / cover no-repeat fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    padding: 24px 16px;
}

/* Dark overlay for photo readability */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
    pointer-events: none;
}

/* ── Card ──────────────────────────────────────────────────────── */

.card {
    position: relative;
    background: var(--card-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: var(--radius);
    padding: 36px 30px 28px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 390px;
    animation: fadeUp 0.4s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.family-name {
    text-align: center;
    font-size: 1.65rem;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.subtitle {
    text-align: center;
    color: #777;
    font-size: 0.88rem;
    margin-bottom: 28px;
}

/* ── Calendar header ───────────────────────────────────────────── */

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.cal-header button {
    background: none;
    border: none;
    cursor: pointer;
    color: #444;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    line-height: 1;
    transition: background 0.15s;
    user-select: none;
    -webkit-user-select: none;
}

.cal-header button:hover  { background: rgba(0, 0, 0, 0.07); }
.cal-header button:active { background: rgba(0, 0, 0, 0.14); }

#month-year {
    font-weight: 600;
    font-size: 1rem;
    color: #222;
    letter-spacing: 0.01em;
}

/* ── Weekday labels ────────────────────────────────────────────── */

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 6px;
}

.weekdays span {
    font-size: 0.7rem;
    font-weight: 700;
    color: #aaa;
    padding: 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Day cells ─────────────────────────────────────────────────── */

.days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.88rem;
    font-weight: 500;
    transition: transform 0.12s ease;
    cursor: default;
    position: relative;
}

.day.past {
    color: #ccc;
}

.day.today::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.6;
}

.day.available {
    background: var(--available-bg);
    color: var(--available-text);
}

.day.available:hover { transform: scale(1.12); }

.day.busy {
    background: var(--busy-bg);
    color: var(--busy-text);
}

.day.busy:hover { transform: scale(1.12); }

/* ── Loading skeleton ──────────────────────────────────────────── */

.day.loading {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Legend ────────────────────────────────────────────────────── */

.legend {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

.dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot.available { background: var(--available-bg); border: 1.5px solid var(--available-border); }
.dot.busy      { background: var(--busy-bg);      border: 1.5px solid var(--busy-border);      }

/* ── Language switcher ─────────────────────────────────────────── */

.lang-switch {
    position: absolute;
    top: 14px;
    right: 18px;
    display: flex;
    align-items: center;
    gap: 1px;
}

.lang-divider {
    color: #ddd;
    font-size: 0.72rem;
    pointer-events: none;
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 7px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #bbb;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

.lang-btn:hover  { color: #555; }

.lang-btn.active {
    background: rgba(0, 0, 0, 0.07);
    color: #222;
}

/* ── Notice banner (config / error states) ─────────────────────── */

.notice {
    margin-top: 16px;
    padding: 10px 14px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: 10px;
    font-size: 0.78rem;
    color: #5d4037;
    text-align: center;
    line-height: 1.4;
}

/* ── Responsive tweaks ─────────────────────────────────────────── */

@media (max-width: 400px) {
    .card          { padding: 28px 18px 22px; }
    .family-name   { font-size: 1.35rem; }
    .day           { font-size: 0.8rem; }
}
