/* 일정 반복 설정 (삼성 캘린더 반복 화면을 참고한 라디오 목록 + 요일 칩) */
.rep { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 6px; margin: 0; min-width: 0; }
.rep legend { padding: 0 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.rep-sum { margin: 0 0 8px; font-size: 13px; color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }
.rep-list { display: flex; flex-direction: column; }
.rep .rep-opt { display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; min-height: 44px; padding: 4px 0; border-top: 1px solid var(--line); cursor: pointer; font-size: 13.5px; flex-wrap: wrap; }
.rep .rep-list > .rep-opt:first-child { border-top: 0; }
.rep .rep-opt > input[type=radio] { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--accent); }
.rep .rep-n { display: inline-flex; }
.rep .rep-n .input { width: 64px; height: 32px; padding: 0 8px; text-align: center; font-variant-numeric: tabular-nums; }
.rep .rep-until { width: auto; min-width: 0; flex: 1 1 150px; max-width: 200px; height: 32px; }
.rep-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; padding: 6px 0 10px 28px; }
.rep-days[hidden], .rep-end[hidden] { display: none; }
.rep .rep-day { display: grid; place-items: center; gap: 0; cursor: pointer; position: relative; }
.rep .rep-day input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rep .rep-day span { display: grid; place-items: center; width: 36px; height: 36px; max-width: 100%; aspect-ratio: 1; border-radius: 50%; border: 1px solid transparent; font-size: 13px; color: var(--text-2); transition: background .15s, border-color .15s; }
.rep .rep-day.sun span { color: var(--red); }
.rep .rep-day.sat span { color: var(--blue); }
.rep .rep-day input:checked + span { border-color: var(--accent); background: var(--accent-tint, color-mix(in srgb, var(--accent) 14%, transparent)); color: var(--accent-text, var(--accent)); font-weight: 700; }
.rep .rep-day input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rep-end { margin-top: 6px; }
.rep-cap { font-size: 12px; color: var(--text-3); padding: 6px 0 2px; }
.rep-note { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--bg-sunken, var(--line)); color: var(--text-2); }
.rep-tag { display: block; margin-top: 2px; font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-del { display: flex; flex-direction: column; gap: 8px; }
.rep-del .btn { justify-content: center; min-height: 44px; }
@media (max-width: 420px) {
  .rep { padding: 10px 10px 4px; }
  .rep .rep-days { padding-left: 0; gap: 2px; }
  .rep .rep-day span { width: 34px; height: 34px; }
}
/* 폼 공통 규칙(.form label 세로 배치·글자 크기)을 반복 영역에서는 쓰지 않는다 */
.rep .rep-opt > span { color: var(--text); font-size: 13.5px; font-weight: 500; }
/* 일정 폼 참석자 칩: 폼 공통 .form label(세로 배치)을 받아 체크박스와 이름이 위아래로 갈라지던 문제 */
#ef label.chip { flex-direction: row; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; white-space: nowrap; }
#ef label.chip input { margin: 0; }

/* ===== 캘린더 모바일 사용성 (2026-10-16) ===== */
/* 작성 폼: 반복은 접어 두고 요약만 한 줄로 */
.rep-wrap { border: 1px solid var(--line); border-radius: 12px; }
.rep-wrap > summary { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; cursor: pointer; list-style: none; font-size: 13.5px; }
.rep-wrap > summary::-webkit-details-marker { display: none; }
.rep-wrap > summary > span { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.rep-wrap > summary > span svg { width: 15px; height: 15px; color: var(--text-3); }
.rep-wrap > summary > b { margin-left: auto; font-weight: 500; color: var(--text-2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rep-wrap > summary::after { content: '›'; flex: none; color: var(--text-3); font-size: 18px; transition: transform .15s; }
.rep-wrap[open] > summary::after { transform: rotate(90deg); }
.rep-wrap[open] > summary { border-bottom: 1px solid var(--line); }
.rep-wrap .rep { border: 0; border-radius: 0; }
.rep-wrap .rep legend { display: none; }
/* 언제: 종일 스위치 + 시작·종료 */
.ev-when { display: flex; flex-direction: column; gap: 10px; }
.form .ev-allday { flex-direction: row; align-items: center; gap: 8px; min-height: 40px; align-self: flex-start; font-size: 13.5px; color: var(--text); cursor: pointer; }
.ev-allday input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.ev-form .form-row.ev-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* 종류·알림은 휴대폰에서도 한 줄에 둘 */

/* 떠 있는 + 버튼 (휴대폰 전용) */
.cal-fab { display: none; }
@media (max-width: 640px) {
  .cal-fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); box-shadow: 0 8px 22px rgba(0,0,0,.32); cursor: pointer; }
  .cal-fab svg { width: 24px; height: 24px; }
  /* 상단 압축: 설명 문구와 머리말 버튼은 숨기고(+ 버튼이 대신) 달력이 첫 화면에 들어오게 */
  .page-title-row:has(+ .content .cal-layout) .page-sub,
  .page-title-row:has(+ .content .cal-layout) .pagehead-right { display: none; }
  .page-title-row:has(+ .content .cal-layout) { padding-bottom: 4px; }
  .calendar-main .cal-head { gap: 6px; margin-bottom: 8px; }
  .calendar-main .cal-head b { font-size: 16px; }
  .calendar-main .cal-head .segmented { padding: 2px; }
  .calendar-main .cal-head .segmented button { min-height: 36px; padding: 4px 8px; }
  /* 날짜 칸을 낮춰 6주 달력과 '선택한 날' 목록이 한 화면에 */
  .cal-grid .cal-cell { min-height: 54px; padding: 4px 3px; }
  .cal-grid .cal-dow { padding-block: 6px; }
  .cal-more { font-size: 9.5px; }
  /* 선택한 날 목록 카드는 달력 바로 아래, 색 안내는 맨 아래로 */
  .cal-layout .stack { gap: 10px !important; }
  /* 작성 화면은 전체 화면 시트 + 하단 버튼 고정 */
  .modal-wrap:has(.ev-modal) { padding: 0; place-items: stretch; }
  .modal.ev-modal { width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; display: flex; flex-direction: column; }
  .modal.ev-modal .modal-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding-bottom: 24px; }
  .modal.ev-modal .modal-foot { border-radius: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .ev-form .form-row.ev-times { grid-template-columns: 1fr; }
  .ev-form .input, .ev-form .select { min-height: 44px; font-size: 16px; }   /* iOS 확대 방지(16px) · 손가락 크기 */
}

/* 주간 보기(휴대폰): 요일별 세로 목록 */
.cal-wlist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.wl-day { border-top: 1px solid var(--line); padding: 10px 12px 12px; }
.wl-day:first-child { border-top: 0; }
.wl-day > header { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.wl-day > header b { font-size: 18px; font-weight: 700; min-width: 26px; font-variant-numeric: tabular-nums; }
.wl-day > header span { font-size: 12.5px; color: var(--text-3); }
.wl-day.weekend > header b, .wl-day.weekend > header span { color: var(--red); }
.wl-day > header em { font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; }
.wl-day > header .icon-btn { margin-left: auto; width: 40px; height: 40px; }
.wl-day.today { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.wl-day ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wl-day li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: baseline; min-height: 44px; padding: 8px 10px 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--c) 12%, transparent); border-left: 3px solid var(--c); cursor: pointer; }
.wl-time { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wl-title { font-size: 14px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.wl-rep { font-style: normal; color: var(--text-3); font-weight: 400; }
.wl-sub { grid-column: 2; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-empty { margin: 2px 0 0 34px; font-size: 12.5px; color: var(--text-4, var(--text-3)); }
@media (max-width: 640px) { .cal-layout.cal-mode-week .stack > .card:has(#agenda) { display: none; } }   /* 주 목록이 날짜별 일정을 이미 보여준다 */
