/* 학사 일정 — 2026-10 앱형(Figma 시안 v8)으로 새로 쓴 판
   style.css 토큰 위에서 동작. 달력 칸 안에 일정 이름, 시험은 진한 칩·대학 일정은 옅은 칩(--c = 종류 색, JS 가 넣음).
   여러 날 이어지는 진행 중 일정은 달력 아래 띠(진행 막대), 오른쪽은 다가오는 일정. */

.cal-page { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 18px 28px 64px; }
.cal-page .legal__head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; padding: 0; border: 0; }
.cal-page #calendar, .cal-page #listView { scroll-margin-top: 16px; }
#grid:empty { min-height: 560px; }
.cal-page .cal-empty { color: var(--ink-4); padding: 60px 20px; text-align: center; font-size: 13.5px; line-height: 1.6; }

/* 도구 줄 — [‹ 2026년 10월 ›][오늘] ······ [일정 종류][대학][달력|목록] */
.pl-toolbar { margin: 0 0 12px; }
.pl-toolbar__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pl-monthnav { display: flex; align-items: center; gap: 4px; min-width: 0; }
.pl-navbtn { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm); background: var(--fill); color: var(--ink-2); transition: background var(--t); }
.pl-navbtn:hover { background: var(--fill-2); color: var(--ink); }
.pl-navbtn svg { width: 16px; height: 16px; }
.pl-month { font-size: 20px; font-weight: 700; letter-spacing: -.03em; line-height: 1; padding: 0 8px; white-space: nowrap; min-width: 124px; text-align: center; font-variant-numeric: tabular-nums; }
.pl-todaywrap { display: inline-flex; align-items: center; flex: none; margin-left: 4px; }
.pl-vsep { display: none; }
.pl-today { height: 34px; padding: 0 12px; border-radius: var(--r-sm); background: var(--fill); font-size: 13px; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: background var(--t); }
.pl-today:hover { background: var(--fill-2); color: var(--ink); }
.pl-tools { display: flex; align-items: center; gap: 6px; flex: none; min-width: 0; }
.pl-filterwrap { position: relative; }
.pl-filter { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: var(--r-sm); background: var(--fill); color: var(--ink-2); transition: background var(--t); }
.pl-filter:hover, .pl-filter[aria-expanded="true"] { background: var(--fill-2); }
.pl-filter__label { font-size: 11.5px; font-weight: 500; color: var(--ink-4); white-space: nowrap; }
.pl-filter__value { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pl-filter__dot { width: 7px; height: 7px; border-radius: 2px; background: var(--c); flex: none; }
.pl-filter__dot[hidden] { display: none; }
.pl-filter svg { width: 13px; height: 13px; color: var(--ink-4); flex: none; transition: rotate var(--t); }
.pl-filter[aria-expanded="true"] svg { rotate: 180deg; }
.pl-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; width: 236px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); max-height: min(420px, calc(100dvh - 220px)); overflow: auto; }
.pl-menu[hidden] { display: none; }
.pl-menu__head { padding: 7px 9px 5px; font-size: 11px; font-weight: 600; color: var(--ink-4); }
.pl-menu__sep { height: 1px; background: var(--line-soft); margin: 4px 0; }
.pl-option { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 0 10px; border-radius: var(--r-sm); color: var(--ink-2); font-size: 13px; text-align: left; }
.pl-option:hover, .pl-option:focus-visible { background: var(--fill); }
.pl-option[aria-selected="true"] { background: var(--fill); color: var(--ink); font-weight: 650; }
.pl-option__dot { width: 7px; height: 7px; border-radius: 2px; background: var(--c); flex: none; }
.pl-option__check { width: 14px; height: 14px; margin-left: auto; color: var(--ink); opacity: 0; flex: none; }
.pl-option[aria-selected="true"] .pl-option__check { opacity: 1; }
/* 달력|목록 = 세그먼트 */
.pl-views { display: flex; gap: 2px; padding: 2px; border-radius: var(--r-sm); background: var(--fill); flex: none; }
.pl-view { display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 6px; color: var(--ink-4); font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: background var(--t), color var(--t); }
.pl-view:hover { color: var(--ink); }
.pl-view[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-lift); }
.pl-view svg { width: 15px; height: 15px; }

/* 본문 — 달력(+ 아래 진행 중 띠) | 다가오는 일정 */
.pl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: 20px; align-items: start; }
.pl-monthwrap { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.pl-cal { --cell-h: 112px; --date-h: 32px; --bar-h: 22px; --bar-ht: 19px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.pl-dow { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--sunken); border-bottom: 1px solid var(--line); }
.pl-dow__c { padding: 8px 0; text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-4); }
.pl-dow__c[data-wd="0"] { color: var(--t5); }
.pl-dow__c[data-wd="6"] { color: var(--tb-suneung); }
.pl-week { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); height: var(--cell-h); border-bottom: 1px solid var(--line-soft); }
.pl-week:last-child { border-bottom: 0; }
.pl-cell { position: relative; min-width: 0; padding: 6px 6px 0; border-right: 1px solid var(--line-soft); cursor: pointer; transition: background 120ms linear; }
.pl-week > .pl-cell:nth-child(7) { border-right: 0; }
.pl-cell:hover { background: var(--sunken); }
.pl-cell[data-out="1"] .pl-date { opacity: .45; }
.pl-cell[data-selected="1"] { box-shadow: inset 0 0 0 1.5px var(--ink); z-index: 1; }
.pl-cell:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ink); z-index: 4; }
.pl-date { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 4px; border-radius: 6px; font-family: var(--mono); font-size: 12px; font-weight: 500; line-height: 1; color: var(--ink-2); }
.pl-cell[data-wd="0"] .pl-date { color: var(--t5); }
.pl-cell[data-wd="6"] .pl-date { color: var(--tb-suneung); }
.pl-cell[data-today="1"] .pl-date { background: var(--tb-suneung); color: #fff; font-weight: 600; }

/* 칸 안 일정 — 여러 날 막대 / 하루 칩 */
.pl-bars { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.pl-bar {
  position: absolute; pointer-events: none; display: flex; align-items: center; overflow: hidden;
  top: calc(var(--date-h) + var(--lane) * var(--bar-h));
  left: calc(var(--c0) / 7 * 100% + var(--il)); width: calc(var(--span) / 7 * 100% - var(--il) - var(--ir));
  height: var(--bar-ht); padding: 0 6px 0 8px; border-radius: 5px;
  background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: color-mix(in srgb, var(--c) 62%, var(--ink));
  font-size: 11.5px; font-weight: 650; white-space: nowrap;
}
.pl-bar::before { content: ''; position: absolute; left: 0; top: 3px; bottom: 3px; width: 2.5px; border-radius: 2px; background: var(--c); }
.pl-bar[data-cont~="l"] { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.pl-bar[data-cont~="l"]::before { display: none; }
.pl-bar[data-cont~="r"] { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.pl-bar__t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pl-bar__tag { display: inline-flex; align-items: center; height: 14px; padding: 0 4px; margin-right: 4px; flex: none; border-radius: 3px; background: var(--c); color: #fff; font-size: 9px; font-weight: 700; }
.pl-more { position: absolute; right: 5px; bottom: 4px; z-index: 3; pointer-events: none; font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--ink-4); padding: 1px 4px; line-height: 1.4; }
.pl-minis { position: absolute; left: 3px; right: 3px; top: 26px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.pl-mini { position: relative; display: flex; align-items: center; gap: 2px; height: 14px; padding: 0 3px 0 5px; border-radius: 3px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: color-mix(in srgb, var(--c) 62%, var(--ink)); font-size: 9.5px; font-weight: 650; line-height: 1; white-space: nowrap; overflow: hidden; }
.pl-mini::before { content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--c); }
.pl-mini__t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pl-mini__arrow { font-size: 8px; line-height: 1; opacity: .7; flex: none; }

/* 고른 날 — 달력 아래 카드 */
.pl-daypanel { background: var(--sunken); border-top: 1px solid var(--line); padding: 14px 16px 16px; }
.pl-daypanel[hidden] { display: none; }
.pl-daypanel__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.pl-daypanel__date { font-size: 15px; font-weight: 700; letter-spacing: -.015em; }
.pl-daypanel__year, .pl-daypanel__count { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.pl-daypanel__today { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; background: var(--tb-suneung-bg); color: var(--tb-suneung); font-size: 10.5px; font-weight: 700; }
.pl-daypanel__close { position: relative; margin-left: auto; min-height: 30px; padding: 0 10px; border-radius: var(--r-sm); background: var(--fill); font-size: 12px; font-weight: 600; color: var(--ink-3); }
.pl-daypanel__close:hover { background: var(--fill-2); color: var(--ink); }
.pl-daypanel__list { display: flex; flex-direction: column; }
.pl-dayitem { display: grid; grid-template-columns: 4px minmax(0, 1fr); gap: 10px; align-items: stretch; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.pl-dayitem:last-child { border-bottom: 0; padding-bottom: 2px; }
.pl-dayitem__dot { width: 4px; border-radius: 2px; background: var(--c); }
.pl-dayitem__title { display: block; font-size: 14px; font-weight: 650; line-height: 1.45; }
.pl-dayitem__tag { display: inline-flex; align-items: center; height: 16px; padding: 0 5px; margin-left: 5px; border-radius: 4px; background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 62%, var(--ink)); font-size: 10px; font-weight: 700; vertical-align: 1px; }
.pl-dayitem__meta { display: block; margin-top: 2px; font-size: 12px; line-height: 1.5; color: var(--ink-4); }
.pl-dayitem__link { color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-strong); white-space: nowrap; }
.pl-dayitem__link:hover { color: var(--ink); }
.pl-daypanel__empty { padding: 14px 0 2px; font-size: 12.5px; line-height: 1.6; color: var(--ink-4); }

/* 진행 중(달력 아래) · 다가오는 일정(오른쪽) — 카드 */
.pl-rail { min-width: 0; position: sticky; top: 16px; display: flex; flex-direction: column; gap: 12px; }
.pl-railsec { padding: 12px 14px 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.pl-railsec__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 6px; }
.pl-railsec__head h2 { font-size: 14px; font-weight: 700; }
.pl-railsec__now { font-size: 11px; font-weight: 500; color: var(--ink-4); margin-left: 4px; }
.pl-railsec__head > span { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.pl-up { display: flex; flex-direction: column; }
.pl-up__item { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; }
.pl-up__item + .pl-up__item { border-top: 1px solid var(--line-soft); }
.pl-up__date { font-family: var(--mono); font-size: 11px; line-height: 1.35; color: var(--ink-4); }
.pl-up__date b { display: block; font-size: 13px; font-weight: 500; color: var(--ink); letter-spacing: -.02em; }
.pl-up__date span { display: block; font-family: 'SUITE Variable', sans-serif; font-size: 10.5px; }
.pl-up__body { min-width: 0; }
.pl-up__title { display: -webkit-box; font-size: 13.5px; font-weight: 650; line-height: 1.4; color: var(--ink); overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pl-up__org { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.4; color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-up__side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.pl-dday { display: inline-flex; align-items: center; justify-content: center; min-height: 22px; padding: 0 7px; border-radius: 6px; background: var(--fill); color: var(--ink-2); font-family: var(--mono); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pl-dday--next { background: var(--tb-suneung-bg); color: var(--tb-suneung); }
.pl-dday--ongoing { background: transparent; color: var(--ink-4); padding: 0; font-family: inherit; font-size: 11px; font-weight: 500; }
.pl-up__cat { font-size: 10.5px; color: var(--ink-4); white-space: nowrap; }
/* 진행 중 띠 — 종류 색 바탕 + 지난 만큼 막대 */
.pl-monthwrap > #ongoingSec { padding: 10px 12px 4px; }
.pl-monthwrap > #ongoingSec .pl-up__item { grid-template-columns: 64px minmax(0, 1fr) auto; margin-bottom: 6px; padding: 8px 10px; border: 0; border-radius: var(--r-md); background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.pl-up__track { display: block; height: 4px; margin-top: 6px; border-radius: 2px; background: color-mix(in srgb, var(--c) 18%, transparent); overflow: hidden; }
.pl-up__track b { display: block; height: 100%; border-radius: 2px; background: var(--c); }
.pl-emptysmall { padding: 14px 0; font-size: 12.5px; color: var(--ink-4); line-height: 1.6; }
.pl-source { padding: 4px 4px 0; font-size: 11px; color: var(--ink-4); line-height: 1.7; }
.pl-source a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-strong); }
.pl-source a:hover { color: var(--ink-3); }

/* 목록 보기 */
.pl-list { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.pl-list__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--sunken); border-bottom: 1px solid var(--line); }
.pl-list__head h2 { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.pl-list__head span { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.pl-list__rows { display: flex; flex-direction: column; }
.pl-list__mhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 16px; background: var(--sunken); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line-soft); }
.pl-list__mhead:first-child { border-top: 0; }
.pl-list__mhead h3 { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.pl-list__mhead span { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.pl-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.pl-row:first-child, .pl-list__mhead + .pl-row { border-top: 0; }
.pl-row__date { font-family: var(--mono); font-size: 12px; line-height: 1.45; color: var(--ink-2); }
.pl-row__date b { display: block; font-weight: 600; }
.pl-row__date span { display: block; font-size: 11px; color: var(--ink-4); margin-top: 1px; }
.pl-row__body { min-width: 0; }
.pl-row__title { display: block; font-size: 14px; font-weight: 650; line-height: 1.45; color: var(--ink); }
.pl-row__meta { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; margin-top: 3px; min-width: 0; }
.pl-cat { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.pl-cat::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--c); flex: none; }
.pl-row__org-inline { font-size: 12px; line-height: 1.45; color: var(--ink-4); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-row__grade { font-size: 11px; line-height: 1.45; color: var(--ink-4); white-space: nowrap; }
.pl-row__status-inline { display: none; }
.pl-row__side { display: flex; align-items: center; gap: 8px; padding-top: 2px; }
.pl-list__empty { padding: 52px 20px; text-align: center; border-top: 1px solid var(--line-soft); }
.pl-list__empty h3 { font-size: 14px; font-weight: 650; }
.pl-list__empty p { margin-top: 4px; font-size: 12.5px; color: var(--ink-4); }
.pl-list__empty .pl-btn { margin-top: 14px; }
.pl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: var(--r-sm); background: var(--fill); color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; transition: background var(--t); }
.pl-btn:hover { background: var(--fill-2); }
.pl-btn svg { width: 15px; height: 15px; flex: none; }

/* JS 없이 보는 전체 일정(검색엔진·폴백) */
.cal-page h2.cal-sec { margin: 32px 0 0; font-size: 18px; font-weight: var(--h2-weight); letter-spacing: var(--h2-track); }
.cal-page h3.cal-sec-month { margin: 20px 0 0; font-size: 15px; font-weight: 700; }
.cal-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.cal-item { display: flex; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: inset 3px 0 0 var(--line-strong); }
.cal-item__date { font-family: var(--mono); font-size: 13px; font-weight: 500; min-width: 96px; color: var(--ink); }
.cal-item__body { flex: 1; min-width: 0; }
.cal-item__title { font-size: 14px; font-weight: 650; }
.cal-item__sub { font-size: 12.5px; color: var(--ink-4); margin-top: 2px; }
.cal-empty { color: var(--ink-4); padding: 16px; text-align: center; list-style: none; }
.cal-all-fallback { margin-top: 28px; }
body.cal-js .cal-all-fallback { display: none; }

/* 반응형 */
@media (max-width: 1179px) {
  .pl-layout { grid-template-columns: minmax(0, 1fr); }
  .pl-rail { position: static; }
  .pl-cal { --cell-h: 104px; }
}
@media (max-width: 960px) { .cal-page { padding-left: 20px; padding-right: 20px; } }
@media (max-width: 760px) {
  .pl-view__text { display: none; }
  .pl-view { padding: 0 8px; }
  .pl-row { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px 14px; }
  .pl-row__side { display: none; }
  .pl-row__status-inline { display: inline-flex; }
  .pl-row__org-inline { white-space: normal; }
}
@media (max-width: 700px) {
  .cal-page { padding: 10px 12px 40px; }
  .pl-toolbar__row { flex-wrap: wrap; gap: 8px; }
  .pl-monthnav { width: 100%; }
  .pl-month { font-size: 18px; min-width: 0; flex: 1; text-align: left; padding-left: 6px; }
  .pl-tools { width: 100%; }
  .pl-filterwrap:first-child { flex: 1; }
  .pl-filter { width: 100%; justify-content: space-between; }
  .pl-menu { left: 0; right: auto; width: min(240px, calc(100vw - 32px)); max-height: min(480px, calc(100dvh - 250px)); }
  .pl-cal { --cell-h: 74px; --date-h: 26px; border-radius: var(--r); }
  .pl-dow__c { padding: 6px 0; font-size: 11px; }
  .pl-cell { padding: 4px 2px 0; }
  .pl-date { min-width: 20px; height: 20px; font-size: 11px; }
  .pl-bars { display: none; }
  .pl-more { right: 2px; bottom: 2px; font-size: 9.5px; }
  .pl-daypanel { padding: 12px 12px 14px; }
  .pl-row { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 11px 13px; }
  .cal-item { flex-direction: column; gap: 2px; }
  #grid:empty { min-height: 360px; }
}
@media (pointer: coarse) {
  .pl-navbtn, .pl-today, .pl-filter { position: relative; }
  .pl-navbtn::after, .pl-today::after, .pl-filter::after { content: ''; position: absolute; inset: -5px; border-radius: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
