.rtc-wrap {
    position: relative;
    width: 100%;
    max-width: 100%; /* Исправление выезда за границы */
    margin: 20px auto;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 13px;
    color: #333;
    box-sizing: border-box; /* Критично для старых тем */
}

.rtc-title {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #0000ff;
    margin: 0 0 16px;
}

.rtc-filters {
    text-align: center;
    margin-bottom: 14px;
    line-height: 2;
}
.rtc-filter {
    display: inline-block;
    padding: 4px 14px;
    margin: 2px 3px;
    border: 1px solid #c0c0c0;
    border-radius: 3px;
    background: #f5f5f5;
    color: #3366ff;
    text-decoration: none;
    font-size: 12px;
    transition: background .15s, color .15s;
}
.rtc-filter:hover { background: #e0e8ff; color: #0000cc; }
.rtc-filter-active {
    background: #3366ff;
    color: #fff;
    border-color: #3366ff;
}
.rtc-filter-active:hover { background: #2255dd; color: #fff; }

.rtc-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    gap: 16px;
}
.rtc-month-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    min-width: 180px;
    text-align: center;
    text-transform: capitalize;
}
.rtc-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #c0c0c0;
    border-radius: 3px;
    background: #f5f5f5;
    color: #3366ff;
    text-decoration: none;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    transition: background .15s;
}
.rtc-nav-btn:hover { background: #e0e8ff; }

.rtc-grid-wrap,
.rtc-schedule-wrap {
    width: 100%;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.rtc-calendar-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #d0d0d0;
    table-layout: fixed; /* Предотвращает растягивание ячеек */
}
.rtc-calendar-table th {
    padding: 8px 4px;
    background: #eef2f7;
    font-weight: bold;
    font-size: 12px;
    color: #555;
    text-align: center;
    border: 1px solid #d0d0d0;
}
.rtc-calendar-table td {
    text-align: center;
    vertical-align: top;
    padding: 10px 4px;
    border: 1px solid #e0e0e0;
    min-height: 54px;
    height: 54px;
    position: relative;
    box-sizing: border-box;
}
.rtc-empty { background: #f9f9f9; }

.rtc-day { cursor: default; transition: background .12s; }
.rtc-day-num { font-weight: bold; font-size: 14px; color: #333; }
.rtc-day.rtc-has-events { cursor: pointer; background: #f0f7ff; }
.rtc-day.rtc-has-events:hover { background: #dce8ff; }
.rtc-day.rtc-active { background: #3366ff !important; }
.rtc-day.rtc-active .rtc-day-num { color: #fff; }
.rtc-day.rtc-active .rtc-events-dot { background: #fff; color: #3366ff; }

.rtc-day.rtc-today .rtc-day-num {
    background: #008000;
    color: #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rtc-events-dot {
    display: block;
    margin: 3px auto 0;
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    background: #339966;
    border-radius: 8px;
    padding: 1px 6px;
    line-height: 1.4;
}

.rtc-schedule-wrap {
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    padding: 12px;
    min-height: 200px;
    box-sizing: border-box;
}
.rtc-schedule-placeholder { text-align: center; color: #999; padding: 40px 10px; font-size: 13px; }
.rtc-day-header { font-size: 14px; color: #0000ff; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #e0e0e0; }
.rtc-no-events { text-align: center; color: #999; padding: 30px 10px; }

.rtc-events-list { display: flex; flex-direction: column; gap: 10px; }
.rtc-event-card {
    display: flex;
    gap: 10px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    text-decoration: none;
    color: inherit;
    background: #fafcff;
    transition: border-color .15s, box-shadow .15s;
    box-sizing: border-box;
}
.rtc-event-card:hover { border-color: #3366ff; box-shadow: 0 2px 8px rgba(51, 102, 255, .12); }
.rtc-event-img { flex-shrink: 0; width: 100px; height: 75px; overflow: hidden; border-radius: 2px; }
.rtc-event-thumb { width: 100%; height: 100%; object-fit: cover; }
.rtc-event-info { flex: 1; min-width: 0; }
.rtc-event-title { font-weight: bold; font-size: 13px; color: #3366ff; margin-bottom: 4px; line-height: 1.3; }
.rtc-event-card:hover .rtc-event-title { text-decoration: underline; }
.rtc-event-meta { font-size: 11px; color: #666; margin-bottom: 4px; }
.rtc-event-time { margin-right: 10px; }
.rtc-event-price { font-weight: bold; font-size: 14px; color: #008000; }

.rtc-loading {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, .85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-size: 14px;
    color: #3366ff;
}

@media (max-width: 700px) {
    .rtc-calendar-table th, .rtc-calendar-table td { padding: 6px 2px; font-size: 12px; }
    .rtc-day-num { font-size: 12px; }
    .rtc-event-card { flex-direction: column; }
    .rtc-event-img { width: 100%; height: 120px; }
    .rtc-filters { line-height: 2.2; }
}