/**
 * コミュニティ参加の導線（メンバーのメリット・参加カード・お知らせ切り替え）
 * と、プロフィールの共通点・タイムライン・おすすめ。
 */

/* =========================================================
   メンバーになるメリット「(!)」
   ========================================================= */
.oe-member-benefits {
    position: relative;
    display: inline-block;
    font-size: 13px;
    line-height: 1.6;
    text-align: left;
}

.oe-member-benefits__summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 2px;
    color: #be185d;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.oe-member-benefits__summary::-webkit-details-marker {
    display: none;
}

.oe-member-benefits__summary:focus-visible {
    outline: 2px solid #be185d;
    outline-offset: 2px;
    border-radius: 6px;
}

.oe-member-benefits__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.oe-member-benefits__label {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.oe-member-benefits__body {
    margin-top: 6px;
    padding: 12px 14px;
    border: 1px solid #fbcfe8;
    border-radius: 12px;
    background: #fdf2f8;
    color: #374151;
}

.oe-member-benefits__list {
    margin: 0;
    padding-left: 1.2em;
}

.oe-member-benefits__list li + li {
    margin-top: 4px;
}

.oe-member-benefits__note {
    margin: 8px 0 0;
    color: #6b7280;
    font-size: 12px;
}

/* 下に重ねて開く（ヘッダーなど狭い場所用） */
.oe-member-benefits--popover .oe-member-benefits__body {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 50;
    width: min(300px, calc(100vw - 32px));
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
}

/* =========================================================
   参加ボタン・状態
   ========================================================= */
.oe-join-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: #ff7e94;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.oe-join-btn:hover,
.oe-join-btn:focus-visible {
    background: #e85d76;
    color: #ffffff;
}

.oe-join-btn[disabled] {
    opacity: 0.6;
    cursor: wait;
}

.oe-join-status {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: #f3f4f6;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
}

/* =========================================================
   参加カード
   ========================================================= */
.oe-join-card {
    margin: 16px 0;
    padding: 16px;
    border: 1px solid #fbcfe8;
    border-radius: 14px;
    background: #ffffff;
    text-align: left;
}

.oe-join-card__group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: #111827;
    font-weight: 700;
    text-decoration: none;
}

.oe-join-card__avatar,
.oe-join-card__group img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.oe-join-card__heading {
    margin: 0 0 4px;
    color: #111827;
    font-size: 15px;
    font-weight: 700;
}

.oe-join-card__text,
.oe-join-card__member {
    margin: 0 0 12px;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.7;
}

.oe-join-card__check {
    color: #059669;
    font-weight: 800;
}

/* ボタン類（メンバーになる・申請中・お知らせスイッチ）は中央寄せ。
   「メンバーになると？」はその下に全幅で出す */
.oe-join-card__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 8px 16px;
}

.oe-join-card__actions .oe-member-benefits {
    flex: 1 1 100%;
}

.oe-join-card__actions .oe-notify-toggle-wrap {
    align-items: center;
    text-align: center;
}

/* メンバーの状態表示もボタンと同じく中央に */
.oe-join-card__member {
    text-align: center;
}

.oe-join-card__message:empty {
    display: none;
}

.oe-join-card__message {
    margin: 10px 0 0;
    color: #065f46;
    font-size: 13px;
    font-weight: 600;
}

.oe-join-card__message.is-error {
    color: #b91c1c;
}

/* 予約完了モーダル・レビューモーダルの中では余白を詰める */
.oe-join-card--booking_success,
.oe-join-card--review_prompt {
    margin: 16px 0 0;
}

/* =========================================================
   お知らせの切り替え（コミュニティ単位）
   ========================================================= */
.oe-notify-toggle-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* ラベルは固定。オン／オフはスイッチと右の文字で示す */
.oe-notify-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #ffffff;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.oe-notify-toggle__switch {
    position: relative;
    flex-shrink: 0;
    width: 32px;
    height: 18px;
    border-radius: 999px;
    background: #d1d5db;
    transition: background-color 0.2s ease;
}

.oe-notify-toggle__knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.oe-notify-toggle__state {
    min-width: 2em;
    color: #6b7280;
}

.oe-notify-toggle.is-on .oe-notify-toggle__switch {
    background: #10b981;
}

.oe-notify-toggle.is-on .oe-notify-toggle__knob {
    transform: translateX(14px);
}

.oe-notify-toggle.is-on .oe-notify-toggle__state {
    color: #065f46;
}

.oe-notify-toggle:focus-visible {
    outline: 2px solid #10b981;
    outline-offset: 2px;
}

.oe-notify-toggle__icon img.oe-icon {
    width: 14px;
    height: 14px;
}

.oe-notify-toggle:not(.is-on) .oe-notify-toggle__icon {
    opacity: 0.45;
}

.oe-notify-toggle[disabled] {
    opacity: 0.6;
    cursor: wait;
}

.oe-notify-toggle__message {
    color: #4b5563;
    font-size: 12px;
}

.oe-notify-toggle__message:empty {
    display: none;
}

/* グループヘッダーの右側 */
.oe-group-hero__cta-wrap .oe-member-status {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.oe-group-hero__join {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

/* =========================================================
   プロフィール: 共通点
   ========================================================= */
.oe-common-ground {
    margin: 12px 0 0;
    padding: 12px 14px;
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    background: #f5f7ff;
    font-size: 13px;
    line-height: 1.7;
    color: #374151;
}

.oe-common-ground__title {
    margin: 0 0 6px;
    color: #3730a3;
    font-size: 13px;
    font-weight: 700;
}

.oe-common-ground__row {
    margin: 0;
}

.oe-common-ground__row + .oe-common-ground__row {
    margin-top: 4px;
}

.oe-common-ground__row a {
    color: #1d4ed8;
}

/* =========================================================
   プロフィール: 活動タイムライン
   ========================================================= */
.oe-timeline-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 16px;
}

.oe-timeline-summary__item {
    padding: 10px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    text-align: center;
}

.oe-timeline-summary__value {
    display: block;
    color: #111827;
    font-size: 20px;
    font-weight: 800;
}

.oe-timeline-summary__label {
    display: block;
    color: #6b7280;
    font-size: 11px;
}

.oe-timeline {
    position: relative;
    margin: 0;
    padding: 0 0 0 20px;
    list-style: none;
}

.oe-timeline::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: #e5e7eb;
}

.oe-timeline__item {
    position: relative;
    padding: 0 0 16px 12px;
}

.oe-timeline__item::before {
    content: "";
    position: absolute;
    left: -19px;
    top: 6px;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #9ca3af;
    box-shadow: 0 0 0 1px #d1d5db;
}

.oe-timeline__item--attended::before { background: #0ea5e9; }
.oe-timeline__item--booked::before { background: #7dd3fc; }
.oe-timeline__item--hosted::before { background: #f59e0b; }
.oe-timeline__item--review::before { background: #ec4899; }
.oe-timeline__item--joined_group::before,
.oe-timeline__item--created_group::before { background: #10b981; }

.oe-timeline__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    color: #6b7280;
    font-size: 12px;
}

.oe-timeline__label {
    color: #374151;
    font-weight: 700;
}

.oe-timeline__title {
    display: block;
    margin-top: 2px;
    color: #111827;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

a.oe-timeline__title:hover {
    color: #1d4ed8;
}

.oe-timeline__note {
    color: #db2777;
    letter-spacing: 0.05em;
}

@media (max-width: 480px) {
    .oe-timeline-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================================
   マイページ: おすすめ
   ========================================================= */
.oe-recommend-group + .oe-recommend-group {
    margin-top: 18px;
}

.oe-recommend-group__title {
    margin: 0 0 4px;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
}

.oe-recommend-group__desc,
.oe-recommend-empty {
    margin: 0 0 10px;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.7;
}

.oe-recommend-empty a {
    font-weight: 700;
}

/* プロフィール「参加コミュニティ」が空のとき */
.profile-empty-benefits {
    margin: 0 auto 16px;
    max-width: 480px;
}

/* =========================================================
   コミュニティの主催者・コアメンバー
   ========================================================= */
.oe-membership-badge--representative {
    background: #fef3c7;
    color: #92400e;
}

.oe-membership-badge--core,
.oe-role-badge--core {
    background: #fce7f3;
    color: #9d174d;
}

.oe-role-badge--pending {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px dashed #9ca3af;
}

.oe-member-admin-row[hidden] {
    display: none;
}

.oe-member-admin-row--pending {
    background: #fafafa;
    border-style: dashed;
}

.oe-member-search {
    margin: 0 0 12px;
}

.oe-core-admin__duties {
    margin: 0 0 16px;
    padding: 12px 14px 12px 32px;
    border-radius: 10px;
    background: #fdf2f8;
    color: #374151;
    font-size: 13px;
    line-height: 1.7;
}

/* 任命された本人への確認 */
.oe-core-invite {
    margin: 16px auto;
    padding: 18px 20px;
    max-width: 1140px;
    border: 2px solid #f9a8d4;
    border-radius: 14px;
    background: #fff7fb;
    color: #374151;
}

.oe-core-invite__title {
    margin: 0 0 8px;
    color: #111827;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
}

.oe-core-invite__text,
.oe-core-invite__note {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.7;
}

.oe-core-invite__list {
    margin: 0 0 8px;
    padding-left: 1.4em;
    font-size: 13px;
    line-height: 1.8;
}

.oe-core-invite__note {
    color: #6b7280;
}

.oe-core-invite__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.oe-core-btn {
    min-height: 40px;
    padding: 0 20px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #ffffff;
    color: #374151;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.oe-core-btn--primary {
    border-color: #ff7e94;
    background: #ff7e94;
    color: #ffffff;
}

.oe-core-btn[disabled],
.oe-core-resign[disabled] {
    opacity: 0.6;
    cursor: wait;
}

.oe-core-invite__message {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #065f46;
}

.oe-core-invite__message:empty {
    display: none;
}

.oe-core-invite__message.is-error {
    color: #b91c1c;
}

/* コアメンバー本人の「降りる」 */
.oe-core-resign-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.oe-core-resign {
    padding: 4px 2px;
    border: 0;
    background: none;
    color: #6b7280;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

/* 管理タブ: コアメンバー枠の中の操作ボタンは控えめに */
.oe-core-admin .oe-member-admin-actions .oe-action-btn {
    padding: 6px 14px;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #ffffff;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.oe-core-admin .oe-member-admin-actions .oe-action-btn:hover {
    border-color: #9ca3af;
    background: #f9fafb;
}

.oe-core-admin + .oe-admin-section {
    margin-top: 32px;
}
