.ses-cal-event-item {
    position: relative;
    display: block;
    color: #fff !important;
    padding: 3px 6px;
    font-size: 0.8em;
    border-radius: 3px;
    text-decoration: none !important;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: opacity 0.2s;
}
.ses-cal-event-item:hover {
    opacity: 0.85;
}

.ses-cat-live { background-color: #0275d8 !important; }
.ses-cat-session { background-color: #5cb85c !important; }
.ses-cat-workshop { background-color: #f0ad4e !important; }
.ses-cat-default { background-color: #6c757d !important; }

.ses-calendar-legend {
    display: flex;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 0.85em;
    align-items: center;
    flex-wrap: wrap;
}
.ses-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.ses-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

/* アジェンダ表示初期設定 */
.ses-calendar-mobile-agenda {
    display: none;
}

/* カレンダー表のラッパー（スマホでは横スクロールさせず、画面幅に収める） */
.ses-calendar-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* カレンダーの予定チップ: 時刻を上の段に小さく、タイトルを下の段に最大2行で見せる */
.ses-cal-event-item {
    white-space: normal;
    line-height: 1.3;
    padding: 4px 7px;
}
.ses-cal-time {
    display: block;
    font-size: 0.85em;
    font-weight: bold;
    opacity: 0.9;
    letter-spacing: 0.02em;
}
.ses-cal-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* 日付の数字: 控えめに、日曜は赤・土曜は青、今日は丸いバッジで目立たせる */
.ses-calendar-desktop td.ses-cal-day > div:first-child {
    font-size: 0.95em !important;
    font-weight: 600 !important;
    color: #444;
}
.ses-calendar-desktop td.ses-sun > div:first-child { color: #c0504d; }
.ses-calendar-desktop td.ses-sat > div:first-child { color: #2a6fc4; }
.ses-calendar-desktop td.ses-cal-today > div:first-child {
    display: inline-block;
    min-width: 1.9em;
    line-height: 1.9em;
    text-align: center;
    border-radius: 50%;
    background: #0073aa;
    color: #fff !important;
}

/* PC幅: 予定チップは、薄い色の背景 + 左の濃い色の線で軽やかに見せる（スマホの点表示には影響させない） */
@media screen and (min-width: 769px) {
    .ses-cal-event-item {
        color: #333 !important;
        border-left: 4px solid transparent;
        border-radius: 4px;
        box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    }
    .ses-cal-event-item:hover {
        opacity: 1;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    }
    .ses-cal-event-item.ses-cat-live     { background-color: #e6f0fa !important; border-left-color: #0275d8; }
    .ses-cal-event-item.ses-cat-session  { background-color: #e9f5e9 !important; border-left-color: #5cb85c; }
    .ses-cal-event-item.ses-cat-workshop { background-color: #fdf1dc !important; border-left-color: #f0ad4e; }
    .ses-cal-event-item.ses-cat-default  { background-color: #eceff1 !important; border-left-color: #6c757d; }
    .ses-cal-event-item.ses-cat-live .ses-cal-time     { color: #0a5aa8; }
    .ses-cal-event-item.ses-cat-session .ses-cal-time  { color: #3d8b3d; }
    .ses-cal-event-item.ses-cat-workshop .ses-cal-time { color: #a8690a; }
    .ses-cal-event-item.ses-cat-default .ses-cal-time  { color: #555; }
}

/* 説明文の、URLだけの行のボタン */
.ses-link-btn {
    display: inline-block;
    padding: 8px 16px;
    margin: 4px 0;
    border: 1px solid #0073aa;
    border-radius: 6px;
    background: #fff;
    color: #0073aa !important;
    font-weight: bold;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s;
}
.ses-link-btn:hover {
    background: #0073aa;
    color: #fff !important;
}

/* 予定が4件以上の日: 4件目以降は隠し、「+N件」で開く（JSが付け外しする） */
.ses-chip-over {
    display: none !important;
}
.ses-calendar-desktop td.is-expanded .ses-chip-over {
    display: block !important;
}
.ses-cal-more {
    display: block;
    margin: 2px 0 0;
    padding: 1px 4px;
    border: 0;
    background: none;
    color: #0073aa;
    font-size: 0.75em;
    cursor: pointer;
    text-decoration: underline;
}
/* 凡例で絞り込んだ時に隠す */
.ses-chip-filtered {
    display: none !important;
}

/* 凡例（クリックで絞り込み） */
.ses-legend-item {
    background: none;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 2px 8px;
    font: inherit;
    color: inherit;
    cursor: pointer;
}
.ses-legend-item:hover { background: #f1f3f5; }
.ses-legend-item.is-off { opacity: 0.35; }
.ses-legend-item[aria-pressed="true"] { border-color: #888; background: #f1f3f5; font-weight: bold; }
.ses-legend-hint { color: #888; font-size: 0.8em; }

/* 過去の日を薄くする */
.ses-calendar-desktop td.ses-past-day > div:first-child { color: #a3a3a3 !important; }
.ses-calendar-desktop td.ses-past-day .ses-cal-event-item { opacity: 0.6; }

/* 「今月に戻る」と、予定のない月の案内 */
.ses-cal-today-link {
    display: block;
    margin-top: 4px;
    font-size: 0.8em;
    color: #0073aa;
    text-decoration: none;
}
.ses-cal-empty {
    margin: 0 0 12px;
    padding: 10px 14px;
    background: #f6f7f7;
    border: 1px solid #e3e5e8;
    border-radius: 6px;
    color: #555;
}
.ses-cal-empty a { color: #0073aa; font-weight: bold; }
.ses-cal-empty a.ses-cal-empty-month { font-weight: normal; }

/* 一覧: 月の見出しとカード */
.ses-list-month {
    margin: 22px 0 8px;
    padding: 4px 0 4px 10px;
    border-left: 4px solid #0073aa;
    font-size: 1.05em;
}
.ses-event-list { list-style: none; margin: 0 0 8px; padding-left: 0; }
.ses-event-card { margin: 0 0 8px; padding: 0; list-style: none; }
.ses-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 12px;
    border: 1px solid #e3e5e8;
    border-radius: 8px;
    background: #fff;
    color: inherit !important;
    text-decoration: none !important;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.ses-card:hover { border-color: #0073aa; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.ses-card-date { flex: 0 0 52px; text-align: center; line-height: 1.1; }
.ses-card-day { display: block; font-size: 1.9em; font-weight: bold; color: #333; }
.ses-card-dow { display: block; font-size: 0.8em; color: #666; margin-top: 2px; }
.ses-card-date.is-sun .ses-card-day, .ses-card-date.is-sun .ses-card-dow { color: #c0504d; }
.ses-card-date.is-sat .ses-card-day, .ses-card-date.is-sat .ses-card-dow { color: #2a6fc4; }
.ses-card-body { flex: 1 1 auto; min-width: 0; }
.ses-card-title { font-weight: bold; font-size: 1.05em; color: #0b4f82; margin-right: 6px; }
.ses-card-cat { display: inline-block; font-size: 0.72em; background: #e8eaed; color: #444; padding: 1px 6px; border-radius: 3px; vertical-align: middle; }
.ses-card-meta { display: block; margin-top: 3px; font-size: 0.85em; color: #666; }
.ses-archive-select { max-width: 100%; }

.ses-agenda-day-group {
    margin-bottom: 15px;
}

.ses-agenda-date-header {
    font-weight: bold;
    padding: 6px 10px;
    background: #f0f4f8;
    border-left: 4px solid #0073aa;
    font-size: 0.95em;
    color: #333;
    margin-bottom: 6px;
    border-radius: 0 4px 4px 0;
}

.ses-agenda-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: #fff !important;
    border-radius: 5px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.2s;
}

.ses-agenda-item:active {
    transform: scale(0.98);
}

.ses-agenda-time {
    font-weight: bold;
    font-size: 0.9em;
    background: rgba(0, 0, 0, 0.2);
    padding: 3px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.ses-agenda-title {
    font-size: 0.95em;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ses-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.65);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.ses-modal-overlay.active {
    display: flex;
}
.ses-modal-content {
    background: #fff;
    width: 100%;
    max-width: 550px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 8px;
    padding: 25px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    font-family: sans-serif;
    color: #333;
    animation: sesModalFadeIn 0.25s ease-out;
    box-sizing: border-box;
}
@keyframes sesModalFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.ses-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
}
.ses-modal-close:hover { color: #000; }
.ses-modal-header-badge {
    display: inline-block;
    color: #fff;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: bold;
    margin-bottom: 10px;
}
.ses-modal-title {
    margin: 0 0 15px 0;
    font-size: 1.3em;
    line-height: 1.4;
    color: #111;
    padding-right: 25px;
}
.ses-modal-row {
    margin-bottom: 10px;
    font-size: 0.95em;
    line-height: 1.5;
}
.ses-modal-row strong {
    color: #444;
}
.ses-modal-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: right;
}
.ses-modal-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
    transition: background 0.2s;
}
.ses-modal-btn:hover { background: #005177; }

/* レスポンシブ（画面幅768px以下） */
@media screen and (max-width: 768px) {
    /* カレンダー表を画面幅に収め（横スクロールなし）、下にアジェンダを並べる */
    .ses-calendar-mobile-agenda {
        display: block !important;
        margin-top: 16px;
    }
    .ses-calendar-scroll {
        overflow-x: visible;
    }
    .ses-calendar-desktop table {
        min-width: 0 !important;
        width: 100% !important;
        table-layout: fixed;
    }
    .ses-calendar-desktop th {
        padding: 6px 0 !important;
        font-size: 0.75em;
    }
    .ses-calendar-desktop td {
        height: 52px !important;
        padding: 2px !important;
        text-align: center;
        vertical-align: top !important;
    }
    .ses-calendar-desktop td > div {
        margin-bottom: 2px !important;
        font-size: 0.85em;
    }
    .ses-calendar-desktop td.ses-has-events {
        cursor: pointer;
    }
    /* 予定は文字ではなく、カテゴリー色の点で見せる（最大3つ。日付のセルをタップして使う） */
    .ses-calendar-desktop .ses-cal-event-item {
        display: inline-block;
        width: 8px;
        height: 8px;
        padding: 0 !important;
        margin: 1px !important;
        border-radius: 50%;
        font-size: 0 !important;
        line-height: 0;
        vertical-align: middle;
        pointer-events: none;
    }
    .ses-calendar-desktop td.ses-cal-day .ses-chip-over {
        display: none !important;
    }
    .ses-cal-more {
        display: inline-block;
        margin: 0;
        padding: 0;
        font-size: 0.65em;
        color: #666;
        text-decoration: none;
        vertical-align: middle;
        pointer-events: none;
    }
    /* 日付をタップした時にアジェンダの該当日を目立たせる */
    .ses-agenda-day-group {
        scroll-margin-top: 60px;
    }
    .ses-agenda-day-group.ses-day-highlight {
        background: #fffde7;
        transition: background 0.3s;
    }

    .ses-calendar-legend {
        gap: 8px;
        font-size: 0.8em;
    }

    .ses-modal-overlay {
        padding: 10px;
    }

    .ses-modal-content {
        padding: 18px;
        max-height: 90vh;
    }

    .ses-modal-btn {
        display: block;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
    }
}