/* Explicit semantic palettes keep calendar states legible in both themes. */
#calendar-section{--cal-card:#222a25;--cal-rest:#2c372e;--cal-rest-ink:#c3d0bb;--cal-holiday:#4c302b;--cal-holiday-ink:#ffc3b3;--cal-custom:#413a26;--cal-custom-ink:#f1d58e;--cal-feast:#dec5f4;--cal-leave:#bdd8a9;--cal-leave-ink:#213a20;--cal-names:#9dc6cd;--cal-selected:#ed9b83}
:root[data-theme="light"] #calendar-section{--cal-card:#fff;--cal-rest:#f0f3ed;--cal-rest-ink:#53664d;--cal-holiday:#fbe3dd;--cal-holiday-ink:#993b2a;--cal-custom:#fff0cc;--cal-custom-ink:#76530b;--cal-feast:#71478b;--cal-leave:#d6eac9;--cal-leave-ink:#28521e;--cal-names:#24727e;--cal-selected:#365c42}
#calendar-section .calendar-toolbar{padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--cal-card);align-items:center;gap:16px 24px}
#calendar-section .calendar-toolbar .calendar-name-search{background:transparent;border:0}
#calendar-section .calendar-controls>select{font-size:18px;font-weight:700;background:var(--bg);color:var(--text);border-color:var(--line)}
#calendar-section .calendar-name-search :is(label,input){font-size:14px;color:var(--text)}
#calendar-section .calendar-name-search input{background:var(--bg);border-color:var(--line)}
#calendar-section .calendar-legend{gap:10px 18px;font-size:12px;color:var(--text);margin:0 0 20px;line-height:1.6}
#calendar-section .calendar-legend>span{display:inline-flex;align-items:center}
#calendar-section .calendar-legend>span:before{width:9px;height:9px;flex-shrink:0}
#calendar-section .calendar-legend>.national:before{background:var(--cal-holiday-ink)}
#calendar-section .calendar-legend>.custom:before{background:var(--cal-custom-ink)}
#calendar-section .calendar-legend>.feast:before{background:var(--cal-feast)}
#calendar-section .calendar-legend>.leave:before{background:var(--cal-leave);border:1px solid var(--cal-leave-ink)}
#calendar-section .calendar-legend>.names:before{background:var(--cal-names)}
#calendar-section .calendar-legend>.today:before{border:2px solid var(--cal-selected)}
#calendar-section .calendar-month{background:var(--cal-card);border:1px solid var(--line);padding:20px 16px;border-radius:14px}
#calendar-section .calendar-month h3{color:var(--text);font-size:17px;font-weight:700;margin-bottom:18px}
#calendar-section .calendar-grid{gap:5px}
#calendar-section .calendar-weekday{font-size:11px;font-weight:600;color:var(--muted);padding-bottom:10px}
#calendar-section .calendar-day{height:36px;font-size:14px;color:var(--text);background:transparent;border-radius:8px}
#calendar-section .calendar-day.rest{background:var(--cal-rest);color:var(--cal-rest-ink)}
#calendar-section .calendar-day.feast{color:var(--cal-feast)}
#calendar-section .calendar-day:is(.custom,.pending){background:var(--cal-custom);color:var(--cal-custom-ink);font-weight:650}
#calendar-section .calendar-day.national{background:var(--cal-holiday);color:var(--cal-holiday-ink);font-weight:750}
#calendar-section .calendar-day.leave{background:var(--cal-leave);color:var(--cal-leave-ink);font-weight:750}
#calendar-section .calendar-day.today{border:2px solid var(--cal-selected)}
#calendar-section .calendar-day[aria-pressed=true]{outline:2px solid var(--cal-selected);outline-offset:1px;font-weight:800}
#calendar-section .calendar-day:hover{box-shadow:inset 0 0 0 1px var(--cal-selected)}
#calendar-section .calendar-day.has-namedays:before{background:var(--cal-names);width:3px;height:3px;bottom:3px}
#calendar-section .calendar-detail{background:var(--cal-card);border:1px solid var(--line);border-radius:14px;padding:22px;max-height:calc(100dvh - 135px)}
#calendar-section .calendar-detail h3{font-size:21px;color:var(--text);line-height:1.45}
#calendar-section .calendar-namedays{border-color:var(--line)}
#calendar-section .calendar-namedays h4{font-size:14px;font-weight:700;color:var(--cal-names)}
#calendar-section .nameday-chips{gap:7px}
#calendar-section .nameday-chips span{background:var(--bg);color:var(--text);border:1px solid var(--line);padding:5px 9px;border-radius:7px;font-size:13px}
#calendar-section :is(.calendar-note,.calendar-rest-list small,.calendar-rest-list span){color:var(--muted);font-size:12px}
#calendar-section .calendar-event{border-color:var(--line)}
#calendar-section .calendar-event strong{font-size:15px}
#calendar-section .calendar-event small{font-size:12px;color:var(--cal-custom-ink)}
#calendar-section .calendar-event.national small{color:var(--cal-holiday-ink)}
#calendar-section .calendar-detail .secondary{font-size:13px;padding:12px;background:var(--cal-leave);color:var(--cal-leave-ink);border:1px solid var(--line);border-radius:9px}
#calendar-section .calendar-rest-periods h4{font-size:14px;font-weight:650}
#calendar-section .calendar-rest-list li{font-size:13px;padding:12px 0}
#calendar-section .calendar-settings summary{color:var(--text);font-size:14px}
#calendar-section .calendar-settings select{background:var(--cal-card);color:var(--text);border-color:var(--line)}
@media(min-width:1101px){#calendar-section .calendar-layout{grid-template-columns:minmax(0,1fr) 300px}}
@media(max-width:1100px){#calendar-section .calendar-detail{max-height:none}}
@media(max-width:700px){#calendar-section .calendar-toolbar{padding:14px}#calendar-section .calendar-day{height:38px}#calendar-section .calendar-detail{padding:18px}}
#calendar-section .calendar-leave>.calendar-settings{margin:4px 0 16px;padding:10px 0 14px;border-top:0}#calendar-section .calendar-detail .calendar-settings-body>label:first-child{flex-direction:column;align-items:flex-start;width:100%}#calendar-section .calendar-detail .calendar-settings select{max-width:100%;font-size:13px}#calendar-section .calendar-detail .calendar-settings summary{font-size:13px}
