.contest-calendar-ui { overflow-wrap: anywhere; }
.contest-calendar-ui [hidden] { display: none !important; }
.contest-calendar-ui :is(a, button):focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
.cc-card { min-width: 0; overflow: hidden; border: 1px solid #e5e7eb; border-radius: 0.75rem; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 5%); }
.cc-card-header { padding: 1rem 1.5rem; border-bottom: 1px solid #e5e7eb; }
.cc-button { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 0.5rem; background: #fff; color: #374151; font-size: 0.875rem; cursor: pointer; }
.cc-button:hover { background: #f3f4f6; }
.cc-button:disabled { opacity: 0.4; cursor: default; }
.cc-link { color: #2563eb; }
.cc-link:hover { text-decoration: underline; }
.cc-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.cc-table th { padding: 0.875rem 0.25rem; background: #f9fafb; color: #6b7280; font-size: 0.75rem; text-align: center; font-weight: 600; }
.cc-day { height: 9rem; padding: 0.5rem; border-top: 1px solid #e5e7eb; vertical-align: top; }
.cc-day + .cc-day { border-left: 1px solid #e5e7eb; }
.cc-day-number { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 9999px; font-size: 0.875rem; font-weight: 600; }
button.cc-day-number { cursor: pointer; }
button.cc-day-number:hover { background: #eff6ff; color: #2563eb; }
.cc-pad { background: #f9fafb; color: #9ca3af; }
.cc-today .cc-day-number { background: #2563eb; color: #fff; }
.cc-day[data-selected="true"] { background: #eff6ff; }
.cc-day-number[aria-pressed="true"] { outline: 2px solid #2563eb; outline-offset: 2px; }
.cc-events { display: flex; flex-direction: column; gap: 0.375rem; margin-top: 0.5rem; }
.cc-event { display: block; border-left: 3px solid #2563eb; border-radius: 0.25rem; padding: 0.375rem 0.5rem; background: #eff6ff; color: #1d4ed8; font-size: 0.75rem; }
.cc-event:hover { text-decoration: underline; }
.cc-event-time { display: block; font-size: 0.6875rem; opacity: 0.85; }
.cc-event-name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 0.125rem; font-weight: 600; }
.cc-event[data-kind="start"] { border-color: #059669; background: #ecfdf5; color: #047857; }
.cc-event[data-kind="end"] { border-color: #dc2626; background: #fef2f2; color: #b91c1c; }
.cc-event[data-kind="ongoing"] { border-color: #7c3aed; background: #f5f3ff; color: #6d28d9; }
.cc-dot { width: 0.5rem; height: 0.5rem; border-radius: 9999px; background: #2563eb; }
.cc-dot[data-kind="start"] { background: #059669; }
.cc-dot[data-kind="end"] { background: #dc2626; }
.cc-dot[data-kind="ongoing"] { background: #7c3aed; }
.cc-weekday-short, .cc-day-count { display: none; }
.cc-contest-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cc-contest { padding: 1.25rem 1.5rem; border-bottom: 1px solid #e5e7eb; }
.cc-contest:nth-child(odd) { border-right: 1px solid #e5e7eb; }
.cc-state { display: inline-flex; border: 1px solid #d1d5db; border-radius: 9999px; padding: 0.125rem 0.5rem; font-size: 0.75rem; white-space: nowrap; }
.cc-state[data-state="ongoing"] { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.cc-state[data-state="upcoming"] { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.cc-empty { padding: 2.5rem 1.5rem; text-align: center; font-size: 0.875rem; color: #6b7280; }
#calendar-contests { position: relative; scroll-margin-top: 5rem; }
.dark .cc-card { border-color: #404040; background: #262626; }
.dark .cc-card-header, .dark .cc-day, .dark .cc-contest { border-color: #404040; }
.dark .cc-table th, .dark .cc-pad { background: #171717; }
.dark .cc-table th, .dark .cc-empty { color: #a3a3a3; }
.dark .cc-pad { color: #737373; }
.dark .cc-button { border-color: #525252; background: #262626; color: #e5e5e5; }
.dark .cc-button:hover { background: #404040; }
.dark .cc-link { color: #60a5fa; }
.dark .cc-day[data-selected="true"] { background: #172554; }
.dark button.cc-day-number:hover { background: #1e3a8a; color: #bfdbfe; }
.dark .cc-event { border-color: #60a5fa; background: #172554; color: #bfdbfe; }
.dark .cc-event[data-kind="start"] { border-color: #34d399; background: #022c22; color: #6ee7b7; }
.dark .cc-event[data-kind="end"] { border-color: #f87171; background: #450a0a; color: #fca5a5; }
.dark .cc-event[data-kind="ongoing"] { border-color: #a78bfa; background: #2e1065; color: #ddd6fe; }
.dark .cc-state { border-color: #525252; }
.dark .cc-state[data-state="ongoing"] { border-color: #065f46; background: #022c22; color: #6ee7b7; }
.dark .cc-state[data-state="upcoming"] { border-color: #1e40af; background: #172554; color: #bfdbfe; }
@media (max-width: 767px) {
    .cc-day { height: 4.5rem; padding: 0.375rem 0.125rem; text-align: center; }
    .cc-weekday-full, .cc-events { display: none; }
    .cc-weekday-short { display: inline; text-decoration: none; }
    .cc-day-count { display: block; width: max-content; margin: 0.25rem auto 0; border-radius: 9999px; padding: 0.0625rem 0.375rem; background: #eff6ff; color: #2563eb; font-size: 0.6875rem; }
    .dark .cc-day-count { background: #172554; color: #93c5fd; }
    .cc-contest-list { grid-template-columns: minmax(0, 1fr); }
    .cc-contest:nth-child(odd) { border-right: 0; }
}
