/*  새 디자인의 이벤트 캘린더 화면 (Controls/V2/V2Events). 색과 폭은 V2.css 의 변수를 쓴다.
    제목 줄, 상자, 꼬리표 같은 공통 조각은 V2Home.css 와 같은 이름을 쓰되 여기에 다시 적는다 -
    이 화면에는 V2Home.css 가 실리지 않는다. */

.v2-events { font-family: var(--v2-font); color: var(--v2-text); padding-top: 22px; }
.v2-events a { color: inherit; text-decoration: none; }
.v2-events .v2-box { border: 1px solid var(--v2-line); border-radius: var(--v2-radius); background: #fff; padding: 20px; }
.v2-events .v2-sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.v2-events .v2-sec-title { margin: 0; font-size: 20px; font-weight: 900; color: var(--v2-navy); padding-left: 12px; border-left: 4px solid var(--v2-primary); line-height: 1.2; }

/* 두 칸: 왼쪽에 달력·빠른 검색·행사 카드, 오른쪽에 BIZ 이벤트. */
.v2-ev-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.v2-ev-main, .v2-ev-side { min-width: 0; }
.v2-ev-top { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; align-items: start; }

/* ---------- 오른쪽: BIZ 이벤트 ---------- */
.v2-events .v2-more { font-size: 13px; color: var(--v2-muted); }
.v2-events .v2-more:hover { color: var(--v2-primary); }
.v2-biz { padding: 18px 16px 8px; }
.v2-biz .v2-sec-title { font-size: 18px; }
.v2-biz-list { list-style: none; margin: 0; padding: 0; }
.v2-biz-list li a { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--v2-line); }
.v2-biz-list li:last-child a { border-bottom: 0; }
.v2-biz-img { flex: 0 0 auto; width: 84px; height: 64px; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, var(--v2-primary-soft), #fdeef4); }
.v2-biz-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.v2-biz-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.v2-biz-tag { align-self: flex-start; font-size: 10.5px; font-weight: 700; color: #c8004f; background: #fde8ef; border-radius: 10px; padding: 1px 8px; }
.v2-biz-text b { font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.v2-biz-list li a:hover b { color: var(--v2-primary); }
.v2-biz-when { font-size: 12px; font-weight: 700; color: var(--v2-primary); }
.v2-biz-where { font-size: 11.5px; color: var(--v2-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 큰 달력 ---------- */
.v2-ev-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.v2-ev-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 24px; font-weight: 900; color: var(--v2-navy); }
.v2-ev-title svg { color: var(--v2-primary); }
.v2-ev-sub { margin: 6px 0 0; font-size: 13px; color: var(--v2-muted); }
.v2-ev-nav { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.v2-ev-month { font-size: 18px; font-weight: 900; margin-right: 6px; white-space: nowrap; }
.v2-ev-nav button { height: 34px; min-width: 34px; border: 1px solid var(--v2-line); border-radius: 8px; background: #fff; font: inherit; font-size: 16px; cursor: pointer; color: var(--v2-text); }
.v2-ev-nav button:disabled { opacity: .35; cursor: default; }
.v2-ev-nav .v2-ev-today { font-size: 13px; font-weight: 700; padding: 0 12px; }
.v2-ev-nav button:not(:disabled):hover { border-color: var(--v2-primary); color: var(--v2-primary); }

.v2-ev-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--v2-line); border-left: 1px solid var(--v2-line); }
.v2-ev-dow { padding: 9px 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--v2-muted); background: var(--v2-bg); border-right: 1px solid var(--v2-line); border-bottom: 1px solid var(--v2-line); }
.v2-ev-dow.is-sun, .v2-ev-day.is-sun .v2-ev-num { color: #d33; }
.v2-ev-dow.is-sat, .v2-ev-day.is-sat .v2-ev-num { color: #2a5bd7; }
.v2-ev-day { min-height: 86px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; padding: 10px 4px 8px; border: 0; border-right: 1px solid var(--v2-line); border-bottom: 1px solid var(--v2-line); background: #fff; font: inherit; cursor: pointer; color: var(--v2-text); }
.v2-ev-day:hover { background: #faf8ff; }
.v2-ev-day.is-blank { cursor: default; background: #fcfcfd; }
.v2-ev-day.is-past .v2-ev-num { opacity: .5; }
.v2-ev-num { font-size: 15px; font-weight: 700; width: 30px; height: 30px; line-height: 30px; text-align: center; border-radius: 50%; }
.v2-ev-day.is-today .v2-ev-num { background: var(--v2-primary); color: #fff !important; opacity: 1; }
.v2-ev-day.is-picked { background: var(--v2-primary-soft); box-shadow: inset 0 0 0 2px var(--v2-primary); }
.v2-ev-dots { display: flex; gap: 3px; }
.v2-ev-dots i { width: 7px; height: 7px; border-radius: 50%; }
.v2-ev-n { font-size: 12px; color: var(--v2-muted); }

.v2-events .k-biz { background: var(--v2-pink); } .v2-events .k-group { background: var(--v2-primary); }
.v2-events .k-local { background: #2a9d8f; } .v2-events .k-culture { background: #f4a100; } .v2-events .k-etc { background: #9aa0ad; }
.v2-ev-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--v2-muted); }
.v2-ev-legend span { background: none !important; display: inline-flex; align-items: center; gap: 6px; }
.v2-ev-legend span::before { content: ''; width: 9px; height: 9px; border-radius: 50%; }
.v2-ev-legend .k-all::before { background: var(--v2-navy); }
.v2-ev-legend .k-biz::before { background: var(--v2-pink); } .v2-ev-legend .k-group::before { background: var(--v2-primary); }
.v2-ev-legend .k-local::before { background: #2a9d8f; } .v2-ev-legend .k-culture::before { background: #f4a100; }

/* ---------- 빠른 검색 ---------- */
.v2-ev-search { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.v2-ev-search-title { margin: 0; font-size: 18px; font-weight: 900; color: var(--v2-navy); }
.v2-ev-search label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: #4b5162; }
.v2-ev-search select, .v2-ev-search input { height: 42px; border: 1px solid var(--v2-line); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 14px; font-weight: 400; color: var(--v2-text); background: #fff; }
.v2-ev-search select:focus, .v2-ev-search input:focus { outline: 0; border-color: var(--v2-primary); box-shadow: 0 0 0 3px rgba(107, 63, 224, .15); }
.v2-ev-go { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 0; border-radius: 12px; background: var(--v2-primary); color: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 4px; }
.v2-ev-go:hover { background: #5a30c8; }
.v2-ev-reset { border: 0; background: none; color: var(--v2-muted); font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; padding: 0; }

/* ---------- 행사 카드 ---------- */
.v2-ev-list { margin-top: 30px; }
.v2-ev-count { font-size: 13px; color: var(--v2-muted); }
.v2-ev-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 16px; }
.v2-ev-card { display: flex; flex-direction: column; gap: 6px; }
.v2-ev-img { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, var(--v2-primary-soft), #fdeef4); }
.v2-ev-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.v2-ev-card:hover .v2-ev-img img { transform: scale(1.04); }
.v2-events .v2-tag { position: absolute; top: 10px; left: 10px; color: #fff; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 12px; }
.v2-ev-live { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 12px; }
.v2-ev-when { font-size: 13px; font-weight: 700; color: var(--v2-primary); }
.v2-ev-name { font-size: 15px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.v2-ev-card:hover .v2-ev-name { color: var(--v2-primary); }
.v2-ev-where { font-size: 12.5px; color: var(--v2-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-ev-empty { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--v2-muted); }
.v2-ev-more { grid-column: 1 / -1; justify-self: center; border: 1px solid var(--v2-line); background: #fff; border-radius: 22px; padding: 10px 26px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.v2-ev-more:hover { border-color: var(--v2-primary); color: var(--v2-primary); }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 1200px) {
    .v2-ev-page { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1000px) {
    .v2-ev-top { grid-template-columns: minmax(0, 1fr); }
    .v2-ev-search { position: static; }
    .v2-ev-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .v2-ev-head { flex-direction: column; }
    .v2-ev-day { min-height: 58px; padding: 6px 2px; }
    .v2-ev-n { display: none; }
    .v2-ev-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- members' own events (Core/MemberEvents) ---------- */

/* the quick search and the add box, one under the other */
.v2-ev-sidecol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.v2-ev-sidecol .v2-ev-search { position: static; }

.v2-ev-add { display: flex; flex-direction: column; gap: 10px; background: linear-gradient(160deg, #f5f1ff, #fff 70%); border-color: #e3d9fc; }
.v2-ev-add-title { margin: 0; font-size: 17px; font-weight: 900; color: var(--v2-navy); }
.v2-ev-add p { margin: 0; font-size: 13px; line-height: 1.6; color: #4b5162; }
.v2-ev-add-go { display: flex; align-items: center; justify-content: center; height: 44px; border: 0; border-radius: 12px; background: var(--v2-navy, #1b1f4b); color: #fff !important; font: inherit; font-size: 14.5px; font-weight: 800; cursor: pointer; text-decoration: none; }
.v2-ev-add-go:hover { background: var(--v2-primary); }
.v2-ev-add small { font-size: 12px; color: var(--v2-muted); text-align: center; }
.v2-ev-mine h3 { margin: 6px 0 6px; font-size: 13px; font-weight: 800; color: #4b5162; }
.v2-ev-mine ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.v2-ev-mine button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--v2-line); border-radius: 10px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.v2-ev-mine button:hover { border-color: var(--v2-primary); }
.v2-ev-mine b { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.v2-ev-mine span { flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.v2-ev-mine .is-on { background: #e3f7ee; color: #0f7a4f; }
.v2-ev-mine .is-waiting { background: #fff1de; color: #b45d00; }
.v2-ev-mine .is-hidden { background: #eef0f4; color: #6b7180; }

/* the members' events under the cards: text, one under another */
.v2-ev-members { margin-top: 34px; }
.v2-ev-mlist { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--v2-navy, #1b1f4b); }
.v2-ev-mlist li { border-bottom: 1px solid var(--v2-line); }
.v2-ev-mlist a { display: flex; align-items: center; gap: 14px; padding: 14px 6px; color: inherit; text-decoration: none; }
.v2-ev-mlist a:hover b { color: var(--v2-primary); }
.v2-ev-mwhen { flex: 0 0 150px; font-size: 13px; font-weight: 800; color: var(--v2-primary); }
.v2-ev-mlist .v2-tag { position: static; flex: 0 0 auto; }
.v2-ev-mtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.v2-ev-mtext b { font-size: 15px; font-weight: 700; color: var(--v2-text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.v2-ev-mtext small { font-size: 12.5px; color: var(--v2-muted); }
.v2-ev-mlist li.v2-ev-mmore { border-bottom: 0; display: flex; justify-content: center; padding-top: 16px; }

/* the form */
body.v2-evf-on { overflow: hidden; }
.v2-evf { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(17, 20, 40, .55); }
.v2-evf[hidden] { display: none; }
.v2-evf-box { display: flex; flex-direction: column; width: min(760px, 100%); max-height: calc(100vh - 40px); background: #fff; border-radius: 18px; box-shadow: 0 24px 60px rgba(17, 20, 40, .3); overflow: hidden; }
.v2-evf-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--v2-line); }
.v2-evf-head h2 { margin: 0; font-size: 19px; font-weight: 900; color: var(--v2-navy); }
.v2-evf-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f3f4f8; font-size: 22px; line-height: 1; cursor: pointer; }
.v2-evf-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 18px 22px; overflow-y: auto; }
.v2-evf-body label, .v2-evf-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: #4b5162; }
.v2-evf-body label b { color: #e6005c; }
.v2-evf-wide { grid-column: 1 / -1; }
.v2-evf-body input[type=text], .v2-evf-body input[type=datetime-local], .v2-evf-body select { height: 42px; border: 1px solid var(--v2-line); border-radius: 10px; padding: 0 12px; font: inherit; font-size: 14px; font-weight: 400; color: var(--v2-text); background: #fff; }
.v2-evf-body input:focus, .v2-evf-body select:focus, .v2-evf-editor:focus { outline: 0; border-color: var(--v2-primary); box-shadow: 0 0 0 3px rgba(107, 63, 224, .15); }
.v2-evf-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 6px; }
.v2-evf-tools button, .v2-evf-photo { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--v2-line); border-radius: 8px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; color: #3d4354; cursor: pointer; }
.v2-evf-tools button:hover, .v2-evf-photo:hover { border-color: var(--v2-primary); color: var(--v2-primary); }
.v2-evf-photo { flex-direction: row !important; margin-left: auto; background: #f5f1ff; border-color: #d9ccfb; color: #5a30c8 !important; }
.v2-evf-photo input { display: none; }
.v2-evf-editor { min-height: 200px; max-height: 320px; overflow-y: auto; padding: 12px 14px; border: 1px solid var(--v2-line); border-radius: 10px; font-size: 14.5px; line-height: 1.7; color: var(--v2-text); background: #fff; }
.v2-evf-editor p { margin: 0 0 8px; }
/* pictures stay small while writing, so the text stays easy to edit; the event page shows them full size */
.v2-evf-editor img { display: block; max-width: 220px; max-height: 160px; width: auto; height: auto; border-radius: 8px; border: 1px solid var(--v2-line); }
.v2-evf-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--v2-muted); }
.v2-evf-msg { grid-column: 1 / -1; margin: 0; padding: 10px 12px; border-radius: 10px; background: #fdecea; color: #b42318; font-size: 13.5px; font-weight: 700; }
.v2-evf-msg.is-ok { background: #f3efff; color: #5a30c8; }
.v2-evf-foot { display: flex; align-items: center; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--v2-line); background: #fafbfd; }
.v2-evf-foot > span { flex: 1; }
.v2-evf-foot button { height: 42px; padding: 0 20px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.v2-evf-cancel { border: 1px solid var(--v2-line); background: #fff; color: #4b5162; }
.v2-evf-save { border: 0; background: var(--v2-primary); color: #fff; }
.v2-evf-save:hover { background: #5a30c8; }
.v2-evf-save:disabled { opacity: .6; cursor: default; }
.v2-evf-del { border: 1px solid #f3c1bd; background: #fff; color: #b42318; }

@media (max-width: 700px) {
    .v2-evf { padding: 0; align-items: stretch; }
    .v2-evf-box { max-height: none; border-radius: 0; }
    .v2-evf-body { grid-template-columns: minmax(0, 1fr); }
    .v2-ev-mlist a { flex-wrap: wrap; gap: 6px 10px; }
    .v2-ev-mwhen { flex-basis: auto; }
    .v2-ev-mtext { flex-basis: 100%; }
}

/* With no day picked: 오늘 시작하는 이벤트 / 진행 중인 이벤트, and 전체 보기 (the next three months, by month) */
.v2-ev-grp { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 6px 0 -8px; font-size: 16px; font-weight: 800; color: var(--v2-navy); }
.v2-ev-grp::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--v2-primary); }
.v2-ev-grp span { font-size: 13px; font-weight: 700; color: var(--v2-muted); }
.v2-ev-grp ~ .v2-ev-grp { margin-top: 18px; }
.v2-ev-more.v2-ev-all { border-color: var(--v2-primary); color: var(--v2-primary); }
.v2-ev-more.v2-ev-all:hover { background: var(--v2-primary); color: #fff; }
.v2-ev-mlist li.v2-ev-mnone { padding: 22px 0; text-align: center; font-size: 14px; color: var(--v2-muted); }
@media (max-width: 700px) {
    .v2-ev-grp { font-size: 15px; margin-bottom: -4px; }
    .v2-ev-more.v2-ev-all { width: 100%; padding: 11px 12px; }
}
