/* 교구 작업공간 — 앱 고유 디자인 언어 (docs/design-language.md).
   값은 app-tokens.css 의 토큰만 쓴다. 구획은 상자가 아니라 여백과 가로 구분선 하나로 나눈다.
   순서: 1 바탕 · 2 뼈대 · 3 공통 부품 · 4 화면 · 5 좁은 화면 · 6 움직임. 회의록(목록·문서 화면)은 meeting.css 에 있다.
   토큰은 HTML 이 app-tokens.css 를 이 파일보다 먼저 link 로 부른다(주소 해시가 붙도록 여기서 가져오지 않는다). */

/* ── 1. 바탕 ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html { overflow-y: scroll; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--c-bg); color: var(--c-text);
  font: var(--w-body) var(--fs-body)/var(--lh-body) var(--font); word-break: keep-all; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: var(--w-title); }
h2 { font-size: var(--fs-head); line-height: var(--lh-head); font-weight: var(--w-strong); }
h3 { font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--w-strong); }
strong, b { font-weight: var(--w-strong); }
small { font-size: var(--fs-meta); line-height: var(--lh-meta); }
a { color: var(--c-accent-strong); text-decoration: none; border-radius: var(--r-chip); }
::selection { background: var(--c-select); }
table { width: 100%; border-collapse: collapse; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }
img, canvas { max-width: 100%; }
:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
:is(h1, h2, h3)[tabindex="-1"]:focus-visible { box-shadow: none; }
.small { font-size: var(--fs-meta); line-height: var(--lh-meta); color: var(--c-text-2); }
.measure { color: var(--c-danger); }
.icon { flex: none; width: 16px; height: 16px; }

/* ── 2. 뼈대: 모든 화면이 같은 단(960) ─────────────────── */
.wrap { width: min(100% - 2 * var(--page-gutter), var(--page-max)); margin-inline: auto; }
/* 아래 여백은 떠 있는 알림(두 줄 68px + 아래 24px)보다 크다 — 끝까지 내리면 마지막 조작부가 알림에 가리지 않는다. */
main.wrap { padding-block-end: calc(2 * var(--sp-48) + var(--sp-8)); }
.mast { border-block-end: 1px solid var(--c-line); background: var(--c-bg); }
.mast-inner { display: flex; align-items: center; gap: var(--sp-24); min-height: var(--mast-h); }
.workspace-header { display: contents; }
.brand { display: flex; align-items: baseline; gap: var(--sp-8); white-space: nowrap; }
.brand span { color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); }
#workspace-menu { flex: 1; min-width: 0; order: 1; }
#public-access-admin { order: 2; }
#google-account, #public-account { order: 3; }
.mast nav { display: flex; align-items: stretch; }
.mast nav a { display: inline-flex; align-items: center; justify-content: center; min-height: var(--mast-h);
  padding-inline: var(--sp-12); border-radius: 0; color: var(--c-text-2); font-weight: var(--w-body); white-space: nowrap; }
.mast nav a[aria-current] { font-weight: var(--w-strong); }
.mast nav a[aria-current] { color: var(--c-text); box-shadow: inset 0 -2px 0 var(--c-text); }
.mast nav a[aria-current]:focus-visible { box-shadow: var(--focus-ring), inset 0 -2px 0 var(--c-text); }
.weekbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-8) var(--sp-16); margin-block: var(--sp-32) var(--sp-24); }
.weekbar-title { display: grid; gap: var(--sp-4); min-width: 0; }
#week-title { overflow-wrap: anywhere; }
#event-summary { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.weekbar-title:has(#meeting-back-event:not([hidden])) #week-title { font-size: var(--fs-head); line-height: var(--lh-head); font-weight: var(--w-strong); }
.week-selector { display: flex; align-items: center; gap: var(--sp-4); }
#week-context { flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
#week-context::after { content: ""; width: 6px; height: 6px; margin-inline-start: var(--sp-4); border: solid var(--c-text-2);
  border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
#week-context:disabled::after { display: none; }
/* 이번 주를 보고 있을 때의 '이번 주': 상단 탭의 현재 표시와 같은 말(600 + 아래 2px 줄). 다른 주에서는 보통 버튼이다. */
#current[aria-current] { border-radius: 0; box-shadow: inset 0 -2px 0 var(--c-text); font-weight: var(--w-strong); }
#current[aria-current]:focus-visible { box-shadow: var(--focus-ring), inset 0 -2px 0 var(--c-text); }
#event-breadcrumb, .page-back { display: flex; flex-wrap: wrap; gap: 0 var(--sp-16); }
:is(#event-breadcrumb, .page-back) a { display: inline-flex; align-items: center; gap: var(--sp-4); min-height: var(--h-control);
  color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); }
#event-breadcrumb a > span { display: inline-flex; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-8) var(--sp-12); min-height: var(--h-control); margin-block-end: var(--sp-8); }
/* 구획 제목에 붙는 수(0/6 완료 · 7개 중 2개 완료): 제목 바로 옆, 같은 글줄에. */
.section-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--sp-8); min-width: 0; }
.section-title > .small { font-variant-numeric: tabular-nums; }
/* 버튼 없이 제목과 수만 있는 구획 머리: 제목만 있는 구획(main section > h2)과 같은 간격. */
section > .section-title { margin-block-end: var(--sp-8); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); }
.week-controls, .month-nav .actions { flex: none; flex-wrap: nowrap; gap: 0; }
main section > h2 { margin-block-end: var(--sp-8); }

/* ── 3. 공통 부품 ─────────────────────────────────────── */
/* 버튼: 기본(바탕 없음) · 주요(파랑 바탕) · 위험(붉은 글자) */
button, a:where(.action-link, [download]), :where(.mix-result-action) {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-8);
  min-height: var(--h-control); max-width: 100%; margin: 0; padding: 0 var(--sp-12);
  border: 0; border-radius: var(--r-control); background: var(--btn-bg, transparent); color: var(--c-text);
  font: var(--btn-weight, var(--w-body)) var(--fs-body)/var(--lh-body) var(--font); text-align: center; text-decoration: none;
  overflow-wrap: anywhere; cursor: pointer;
}
button:disabled { color: var(--c-text-3); cursor: default; }
button:active:not(:disabled), a.action-link:active, a[download]:active { background: var(--btn-bg-hover, var(--c-bg-3)); }
/* 조작 줄(.actions) 안의 기본 버튼은 옅은 면을 깔아, 나란히 놓여도 글자 나열이 아니라 버튼으로 읽히게 한다.
   도구 띠(주간 작업 도구·주·달 이동)와 목록 행·메뉴 안의 조작, 아이콘 버튼은 면 없이 둔다. */
/* 굵기도 자리를 따른다: 면 있는 버튼(조작 줄·빈 상태)과 주요 버튼은 600, 면 없는 글자 버튼(도구 띠·행·메뉴)은 400. */
.actions { --btn-bg: var(--c-bg-3); --btn-bg-hover: var(--c-line); --btn-weight: var(--w-strong); }
.week-actions, .week-controls, .month-nav .actions, .row .actions, .result-file .actions, .task-workspace-links, .row-menu-options,
.icon-button, .row-menu-toggle, .agenda-add, .text-action { --btn-bg: transparent; --btn-bg-hover: var(--c-hover); --btn-weight: var(--w-body); }
button.primary, a.primary { background: var(--c-accent-strong); color: var(--c-on-accent); font-weight: var(--w-strong); }
button.primary:active:not(:disabled), a.primary:active { background: var(--c-accent-hover); }
button.primary:disabled { background: var(--c-bg-3); color: var(--c-text-3); }
#empty-trash, #stop-mix, .remove-published-song, button.danger { color: var(--c-danger); }
/* 내용(회의록·할 일·첨부)이 있어 지울 수 없는 행사의 [삭제]: 붉지 않은 보조 글자색. 누르면 남은 것을 알린다(app.js showEventDeletable). */
#delete-event.unavailable { color: var(--c-text-2); }
/* 행마다 놓이는 빼기·권한 해제는 평소에 보조 글자색이다(붉은 글자가 행 수만큼 늘어서지 않게). hover·초점에서만 붉어진다. */
.remove-published-song, .row .actions button.danger, #delete-slide, #delete-closing-slide { color: var(--c-text-2); }
:is(.remove-published-song, .row .actions button.danger, #delete-slide, #delete-closing-slide):focus-visible { color: var(--c-danger); }
/* 위험한 동작을 확정하는 버튼(확인 대화상자·휴지통 비우기·회의록 삭제): 붉은 바탕의 주요 버튼. */
button.primary-danger { background: var(--c-danger); color: var(--c-on-accent); font-weight: var(--w-strong); }
button.primary-danger:active:not(:disabled) { background: var(--c-danger-hover); }
button.primary-danger:disabled { background: var(--c-bg-3); color: var(--c-text-3); }
.icon-button, .row-menu-toggle, .agenda-add { flex: none; min-width: var(--h-control); padding: 0; color: var(--c-text-2); }
@media (hover: hover) {
  button:hover:not(:disabled), a.action-link:hover, a[download]:hover { background: var(--btn-bg-hover, var(--c-hover)); }
  summary:hover, .row:hover { background: var(--c-hover); }
  button.primary:hover:not(:disabled), a.primary:hover { background: var(--c-accent-hover); }
  :is(#empty-trash, #stop-mix, .remove-published-song, button.danger, #delete-slide, #delete-closing-slide):hover:not(:disabled) { background: var(--c-danger-bg); }
  button.primary-danger:hover:not(:disabled) { background: var(--c-danger-hover); }
  :is(.remove-published-song, .row .actions button.danger, #delete-slide, #delete-closing-slide):hover:not(:disabled) { color: var(--c-danger); }
  a:not([class], [download], nav a):hover { text-decoration: underline; }
}

/* 입력·선택·날짜·파일 — 한 틀 */
label { display: grid; gap: var(--sp-4); min-width: 0; color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); }
/* 필수 칸 표시: 이름표 글 바로 뒤, 같은 줄에 '필수'(저장을 눌러 봐야 아는 것이 아니게). 마크업이 아니라 여기서 그려 칸의 이름표 글은 그대로다. */
label:has(> :required) { grid-template-columns: auto minmax(0, 1fr); column-gap: var(--sp-4); }
label:has(> :required) > * { grid-column: 1 / -1; }
label:has(> :required)::after { content: "필수"; grid-area: 1 / 2; color: var(--c-danger); }
input, select, textarea { margin: 0; color: var(--c-text); font: var(--w-body) var(--fs-body)/var(--lh-body) var(--font); }
input:not([type="checkbox"], [type="radio"], [type="color"], [type="hidden"]), select, textarea {
  width: 100%; min-height: var(--h-control); padding: var(--sp-4) var(--sp-12);
  border: 1px solid var(--c-edge); border-radius: var(--r-control); background-color: var(--c-bg);
}
/* 자리표시 글은 읽혀야 한다(4.5:1) — 보조 글자색. --c-text-3 은 비활성 글자에만 쓴다. */
input::placeholder, textarea::placeholder { color: var(--c-text-2); opacity: 1; }
:is(input, select, textarea):focus-visible { border-color: var(--c-accent); }
:is(input, select, textarea)[aria-invalid="true"] { border-color: var(--c-danger); }
textarea { display: block; padding-block: var(--sp-8); resize: vertical; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="date"]::-webkit-calendar-picker-indicator { margin: 0; padding: var(--sp-4); border-radius: var(--r-chip); cursor: pointer; opacity: .6; }
select { -webkit-appearance: none; appearance: none; padding-inline-end: var(--sp-32); cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--c-text-2) 50%), linear-gradient(135deg, var(--c-text-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="file"] { padding: 0; overflow: hidden; color: var(--c-text-2); font-size: var(--fs-meta); cursor: pointer; }
input::file-selector-button { min-height: calc(var(--h-control) - 2px); margin: 0 var(--sp-12) 0 0; padding: 0 var(--sp-12);
  border: 0; border-inline-end: 1px solid var(--c-line); background: var(--c-bg-2); color: var(--c-text);
  font: var(--w-body) var(--fs-meta)/var(--lh-meta) var(--font); cursor: pointer; }
input[type="color"] { width: 52px; height: var(--h-control); padding: var(--sp-4); border: 1px solid var(--c-edge);
  border-radius: var(--r-control); background: var(--c-bg); cursor: pointer; }
input[type="checkbox"] { -webkit-appearance: none; appearance: none; flex: none; display: inline-grid; place-content: center;
  width: 18px; height: 18px; border: 1.5px solid var(--c-edge); border-radius: var(--r-chip); background: var(--c-bg); cursor: pointer; }
input[type="checkbox"]::after { content: ""; width: 5px; height: 9px; margin-block-start: -2px; border: solid var(--c-on-accent);
  border-width: 0 2px 2px 0; transform: rotate(45deg); opacity: 0; }
input[type="checkbox"]:checked { border-color: var(--c-accent-strong); background: var(--c-accent-strong); }
input[type="checkbox"]:checked::after { opacity: 1; }
.confirm { display: flex; align-items: center; gap: var(--sp-8); min-height: var(--h-control);
  color: var(--c-text); font-size: var(--fs-body); line-height: var(--lh-body); cursor: pointer; }
.form-stack { display: grid; gap: var(--sp-16); min-width: 0; }
.form-stack .section-head { margin: 0; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-12); }
progress { -webkit-appearance: none; appearance: none; display: block; width: min(100%, 240px); height: 4px; border: 0;
  border-radius: var(--r-chip); overflow: hidden; background: var(--c-bg-3); }
progress::-webkit-progress-bar { background: var(--c-bg-3); }
progress::-webkit-progress-value { background: var(--c-accent-strong); }
progress::-moz-progress-bar { background: var(--c-accent-strong); }

/* 접기 */
summary { display: flex; align-items: center; gap: var(--sp-8); min-height: var(--h-control); border-radius: var(--r-control);
  font-weight: var(--w-strong); list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::before { content: ""; flex: none; width: 6px; height: 6px; margin-inline: var(--sp-4); border: solid var(--c-text-2);
  border-width: 0 1.5px 1.5px 0; transform: rotate(-45deg); }
details[open] > summary::before { transform: translateY(-2px) rotate(45deg); }

/* 조각 전환 — 한 가지 모양(자료함의 주차 고르기도 같은 띠다) */
#task-filters, .calendar-views, .library-views, .library-weeks { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-control); background: var(--c-bg-2); }
/* 고른 조각만 굵다. 굵기가 바뀌어도 폭이 달라지지 않게, 굵은 글자의 폭을 보이지 않는 겹글자(::after, data-label)로 미리 잡아 둔다. */
:is(#task-filters, .calendar-views, .library-views, .library-weeks) button { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; }
:is(#task-filters, .calendar-views, .library-views, .library-weeks) button::before, :is(#task-filters, .calendar-views, .library-views, .library-weeks) button::after { content: attr(data-label); flex: none; height: 0; overflow: hidden; visibility: hidden; }
:is(#task-filters, .calendar-views, .library-views, .library-weeks) button::before { font-weight: var(--w-body); }
:is(#task-filters, .calendar-views, .library-views, .library-weeks) button::after { font-weight: var(--w-strong); }
:is(#task-filters, .calendar-views, .library-views, .library-weeks) button { min-height: calc(var(--h-seg) - 4px); min-width: var(--h-row); border-radius: var(--r-chip); padding-inline: var(--sp-12);
  color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); white-space: nowrap; }
/* 고른 조각: 흰 면 + 그림자에 더해 굵은 글자와 3:1 테두리(바탕 차이만으로는 1.05:1 이라 고른 것이 안 보인다). */
:is(#task-filters, .calendar-views, .library-views, .library-weeks) button[aria-pressed="true"] { background: var(--c-bg); color: var(--c-text); font-weight: var(--w-strong);
  box-shadow: var(--shadow-seg), inset 0 0 0 1px var(--c-edge); }
:is(#task-filters, .calendar-views, .library-views, .library-weeks) button[aria-pressed="true"]:focus-visible { box-shadow: var(--focus-ring); }

/* 목록 행 */
.rows { border-block-start: 1px solid var(--c-line); }
.rows:has(> :is(.empty, .empty-line):only-child) { border-block-start: 0; }
.row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12);
  min-height: var(--h-row); padding: var(--sp-4) var(--sp-8); border-block-end: 1px solid var(--c-line); }
.row-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row-meta { display: block; color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); }
.row-meta.measure { color: var(--c-danger); }
.state { white-space: nowrap; }

/* 칩 — 상태·담당자·종류가 같은 틀 */
.task-status, .owner-tag, .file-kind, .song-status, .song-reviewed, .event-location-pill, .mix-state, #music-mix-status[data-state="done"], .final-state[data-state="final"] > span, .access-state[data-state] {
  display: inline-flex; align-items: center; gap: var(--sp-4); min-height: var(--h-chip); max-width: 100%; padding: 2px 6px;
  border-radius: var(--r-chip); background: var(--c-bg-3); color: var(--c-text);
  font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: var(--w-body); overflow-wrap: anywhere;
}
.task-status { white-space: nowrap; }
.task-status[data-state="진행 중"] { background-color: var(--c-info-bg); color: var(--c-accent-strong); }
.task-status[data-state="검토 중"], .song-status[data-review="pending"], .access-state[data-state="review"] { background-color: var(--c-warn-bg); color: var(--c-warn); }
.task-status[data-state="완료"], .song-status[data-review="done"], .song-reviewed, .access-state[data-state="done"], #music-mix-status[data-state="done"], .final-state[data-state="final"] > span { background-color: var(--c-ok-bg); color: var(--c-ok); }
.mix-state { background-color: var(--c-danger-bg); color: var(--c-danger); }
select.task-status { --chip-hit: calc((var(--h-control) - 24px) / 2); width: auto; min-height: 0; height: var(--h-control);
  margin: 0 calc(-1 * var(--chip-hit)); padding: 2px 6px; border: var(--chip-hit) solid transparent; font-size: var(--fs-meta);
  border-radius: calc(var(--r-chip) + var(--chip-hit)); background-clip: padding-box; background-origin: padding-box; max-width: none; text-align: start;
  padding-inline-end: 18px; background-repeat: no-repeat; background-size: 4px 4px; background-position: calc(100% - 10px) 50%, calc(100% - 6px) 50%;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); }

/* 선택 칩은 글자 칩과 같은 13px 로 보이고, 눌러서 고르는 동안에만 16px 가 된다(아이폰은 16px 미만 입력을 누르면 화면을 확대한다). */
select.task-status:focus { font-size: var(--fs-chip-select); }

/* 메뉴·팝오버 */
.row-menu { position: relative; flex: none; }
.row-menu-options, .account-options { position: absolute; z-index: 8; inset-inline-end: 0; top: calc(100% + var(--sp-4)); min-width: 180px;
  padding: var(--sp-4); border-radius: var(--r-surface); background: var(--c-bg); box-shadow: var(--shadow-menu); }
.row-menu-options { white-space: nowrap; }
.row-menu-options :is(button, a) { display: flex; justify-content: flex-start; width: 100%; font-weight: var(--w-body); text-align: start; }

/* 대화상자 — 한 틀. 휴대폰에서는 아래 시트(5 참조) */
dialog { width: min(100% - 2 * var(--sp-16), var(--dialog-w, 480px)); max-height: min(92dvh, 100% - 2 * var(--sp-16)); padding: var(--sp-24);
  border: 0; border-radius: var(--r-surface); background: var(--c-bg); color: var(--c-text);
  box-shadow: var(--shadow-dialog); overscroll-behavior: contain; }
dialog::backdrop { background: var(--c-backdrop); }
dialog .section-head { flex-wrap: nowrap; align-items: flex-start; margin-block-end: var(--sp-16); }
dialog .section-head h2, .assignee-head h2 { min-width: 0; overflow-wrap: anywhere; }
dialog > .form-stack > .actions, .assignee-footer { justify-content: flex-end; }
dialog > .form-stack > ul { margin: 0; padding-inline-start: var(--sp-24); overflow-wrap: anywhere; }
dialog > .form-stack > .actions { margin-block-start: var(--sp-8); }
/* 폭은 값만 바꾼다 — width 를 id 로 다시 쓰면 휴대폰의 전체 폭 시트 규칙(dialog)을 이겨 오른쪽이 32px 빈다. */
#rules-dialog, #weekly-source-dialog { --dialog-w: 620px; }
#week-picker, #scope-dialog, #empty-trash-dialog, #meeting-trash-dialog, #confirm-dialog { --dialog-w: 400px; }
/* 확인 대화상자(app-ui.js confirmDialog): 본문은 문단마다 한 줄 간격, 다른 대화상자 위에 뜨면 덮개를 겹쳐 어둡게 하지 않는다. */
.confirm-body { display: grid; gap: var(--sp-8); overflow-wrap: anywhere; }
.confirm-body ul { margin: 0; padding-inline-start: var(--sp-24); }
body:has(dialog:modal:not(#confirm-dialog)) #confirm-dialog::backdrop { background: transparent; }
#weekly-source-text { max-block-size: 48dvh; }
#editor-error:not([hidden]) { font-size: var(--fs-meta); line-height: var(--lh-meta); }
/* 작업 삭제: 저장·취소와 다른 줄, 왼쪽에 둔다(자주 누르는 버튼 옆에 지우는 버튼을 두지 않는다). */
#editor-extra { display: flex; justify-content: flex-start; }
#delete-task { margin-inline-start: calc(-1 * var(--sp-12)); font-weight: var(--w-body); }
/* 칸 아래 오류 문구(app-ui.js): 틀린 칸 바로 아래 13px 붉은 한 줄. */
.field-error { color: var(--c-danger); font-size: var(--fs-meta); line-height: var(--lh-meta); }
.form-stack > label + .field-error { margin-block-start: calc(-1 * var(--sp-12)); }
/* 겹쳐 뜨는 대화상자: 위에 편집 창이 뜨면 아래 대화상자는 숨겼다가, 닫으면 다시 보인다(덮개가 두 겹으로 어두워지지 않는다). */
body:has(#editor:modal) #rules-dialog { visibility: hidden; }

/* 빈 상태 — 두 줄(무슨 화면인지 16px + 다음에 할 일 13px) + 그 일을 하는 버튼 1개. 문구는 마크업(app.js emptyState)에 있다. */
/* 글은 구획 제목과 같은 왼쪽 선에서 시작하고(안쪽으로 들이지 않는다), 제목 바로 아래에 붙는다 — 떨어져 있으면 다른 구획의 글로 읽힌다. */
.empty, .page-empty { display: grid; justify-items: start; gap: var(--sp-4); padding: var(--sp-4) 0 var(--sp-24); color: var(--c-text-2); }
/* 화면의 본문이 아닌 곳의 빈 상태(자료함의 올린 파일): 작은 한 줄. */
.empty-line { padding-block-end: var(--sp-16); }
.empty > :is(button, a) { --btn-bg: var(--c-bg-3); --btn-bg-hover: var(--c-line); --btn-weight: var(--w-strong); margin-block-start: var(--sp-8); color: var(--c-text); }

/* 떠 있는 알림 — 화면을 밀지 않는다. 아래쪽 가운데에 어두운 한 줄로 뜬다(컴퓨터는 아래에서 24px, 휴대폰은 안전 영역 + 16px).
   위쪽에 두면 주 선택·제목을 가렸다. 본문 단은 아래 여백(main.wrap)을 알림 높이보다 크게 둬서, 끝까지 내리면 마지막 조작부가 알림 위로 올라온다.
   --vv-bottom: 화면 키보드가 가린 높이(app-ui.js 가 잰다). --toast-clear: 그 자리에 붙어 있는 막대(회의록의 서식 막대) 높이.
   누르기를 가로채지 않고(닫기 버튼만 눌린다), 오류는 붉은 표시와 닫기 버튼이 붙는다(app-ui.js). */
#feedback, .toast { position: fixed; z-index: 20; inset: auto auto calc(var(--vv-bottom, 0px) + var(--toast-clear, 0px) + var(--toast-gap)) 50%;
  --toast-gap: var(--sp-24); transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--sp-8); width: max-content; max-width: min(100% - 2 * var(--sp-16), 560px);
  min-height: var(--h-row); padding: var(--sp-8) var(--sp-16); border-radius: var(--r-surface);
  background: var(--c-stage); color: var(--c-on-accent); box-shadow: var(--shadow-dialog); pointer-events: none; overflow-wrap: anywhere; }
/* 빈 알림 칸: 숨기지 않고(낭독기에 등록된 채) 크기만 0 으로 둔다. */
:is(#feedback, .toast):empty { min-height: 0; padding: 0; box-shadow: none; }
:is(#feedback, .toast).error { padding-inline-end: var(--sp-4); }
:is(#feedback, .toast).error::before { content: "!"; flex: none; display: inline-grid; place-content: center; width: var(--h-chip); height: var(--h-chip);
  border-radius: 50%; background: var(--c-danger); font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: var(--w-strong); }
.toast-close { flex: none; margin-inline-start: auto; min-height: var(--h-control); min-width: var(--h-control); color: var(--c-on-accent); pointer-events: auto; }
/* 알림 안의 버튼(되돌리기): 어두운 면 위의 밝은 글자, 누르기 영역은 조작부 높이. */
.toast-action { flex: none; margin-inline-start: var(--sp-8); min-height: var(--h-control); color: var(--c-on-accent); text-decoration: underline; text-underline-offset: 3px; pointer-events: auto; }
@media (hover: hover) { :is(.toast-close, .toast-action):hover:not(:disabled) { background: var(--c-backdrop); } }
.feedback.error:not(#feedback, .toast) { color: var(--c-danger); }

/* ── 4. 화면 ─────────────────────────────────────────── */
/* 주간 작업 */
.week-grid { display: grid; }
.week-tasks { min-width: 0; container-type: inline-size; }
.checklist-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-4) var(--sp-12); margin-block-end: var(--sp-12); }
.checklist-progress { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-8);
  color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); font-variant-numeric: tabular-nums; }
#week-completion-meter { width: 64px; margin: 0; }
/* 구분점은 앞 글 뒤에 붙인다 — 좁은 화면에서 줄이 바뀔 때 점이 다음 줄 맨 앞에 오지 않게. */
.checklist-progress:has(#overdue-note:not([hidden])) #weekly-progress::after { content: "·"; margin-inline-start: var(--sp-8); }
/* '마감 지남 n'은 줄이 바뀌어도 통째로 내려간다. */
#overdue-note { white-space: nowrap; }
.task-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-8); margin-block-end: var(--sp-8); }
.week-actions { margin-inline-start: auto; gap: var(--sp-4); }
.week-actions button:not(.primary) { color: var(--c-text-2); }
.scope-trigger::after { content: ""; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.scope-trigger[data-active] { background: var(--c-bg-3); color: var(--c-text); }
.week-task { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.5fr) 76px 92px minmax(0, 1.1fr);
  align-items: center; column-gap: var(--sp-12); min-width: 0; padding-inline: var(--sp-8); }
.week-task > * { display: flex; align-items: center; gap: var(--sp-8); min-width: 0; }
#task-columns { min-height: var(--sp-32); border-block-end: 1px solid var(--c-line); color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); }
#task-columns > :first-child { padding-inline-start: 31px; }
#task-list { border-block-start: 0; }
.week-task.row { padding-block: 0; }
.week-task:has(.task-title[aria-expanded="true"]) { background: var(--c-bg-2); }
.work-check { display: inline-flex; align-items: center; justify-content: center; align-self: stretch; flex: none;
  width: 28px; min-height: var(--h-row); margin-inline-start: -5px; cursor: pointer; }
.week-task .work-name { gap: var(--sp-8); }
.week-task .row-main:has(.row-meta:empty) .row-meta { display: none; }
/* 여러 줄 작업명이 위아래 구분선에 붙지 않게 위아래 6px. 한 줄 행은 그대로 45px(36 + 선). */
.task-title { justify-content: flex-start; padding: 6px 0; text-align: start; }
.week-task:has(.work-check input:checked) .task-title { color: var(--c-text-2); font-weight: var(--w-body); text-decoration: line-through; }
/* 이름(작업명·곡 이름)은 누르는 글자여도 600 이다. */
:is(.task-title, .select-song) { font-weight: var(--w-strong); }
.task-cell-edit { justify-content: flex-start; max-width: 100%; padding: 0; font-weight: var(--w-body); text-align: start; }
.task-owner { flex-wrap: wrap; gap: var(--sp-4); padding-block: var(--sp-4); color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); }
.work-due { position: relative; }
.work-due .task-cell-edit::after { content: ""; position: absolute; inset: 0; }
.task-due { white-space: nowrap; font-variant-numeric: tabular-nums; }
.task-due.measure { color: var(--c-danger); font-weight: var(--w-strong); }
.weekly-work-action { display: inline-flex; align-items: center; gap: var(--sp-8); min-height: var(--h-control); border-radius: var(--r-control);
  font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: var(--w-body); white-space: nowrap; }
.weekly-work-action::after { content: ""; width: 5px; height: 5px; border: solid currentColor; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.weekly-work-action[download]::after { transform: rotate(135deg); }
.week-progress-label { display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-12); padding: var(--sp-8);
  color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); font-variant-numeric: tabular-nums; }
#task-scope-totals { display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-12); }
/* 지금 필터에 맞지 않게 됐지만 자리를 지키는 행(방금 체크한 일): 이름을 보조 글자색으로 흐리게. 다음 정렬 때 빠진다. */
[data-leaving="true"] .task-title { color: var(--c-text-2); }
/* 행사 준비 묶음(행사에 연결한 할 일): 위 표와 같은 행·같은 열. 구획은 여백 32px + 구획 제목. */
#event-task-group { margin-block-start: var(--sp-32); }
#event-task-group .section-head { margin-block-end: 0; }
#event-task-list { border-block-start: 1px solid var(--c-line); }
/* 글자 사이에 놓이는 작은 조작(자동으로 되돌리기): 링크 색으로 누를 수 있음을 알린다. */
.text-action { color: var(--c-accent-strong); font-weight: var(--w-strong); }
/* 낡은 최종본 표시: 달라진 칸 이름이 붙으면 길어지므로 띄어쓰기에서 줄이 바뀌게 둔다(링크만 한 덩어리). */
.stale-mark { min-inline-size: 0; }
.stale-mark a { white-space: nowrap; }
@media (hover: hover) {
  :is(.weekly-work-action, .task-cell-edit, .task-title, .select-song):hover:not(:disabled) { background: var(--c-hover); box-shadow: 0 0 0 4px var(--c-hover); }
}
@container (max-width: 675px) {
  #task-columns { display: none; }
  #task-list { border-block-start: 1px solid var(--c-line); }
  .week-task { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 0 var(--sp-8); padding: var(--sp-4) var(--sp-8) var(--sp-4) 39px; }
  .week-task .work-name { flex: 0 0 calc(100% + 44px); margin-inline-start: -44px; gap: 0; }
  .work-check { width: 44px; margin: 0; }
  .task-title { min-height: var(--h-row); }
  .week-task > :not(.work-name) { min-height: var(--h-control); }
  .week-task .work-assignment { flex: 0 1 auto; }
  .week-task .work-action { margin-inline-start: auto; }
  .week-task .work-action:empty { display: none; }
}

/* 대화상자: 작업 편집·담당자·직책·반복·주 선택 */
#editor[data-presentation="side"] { position: fixed; z-index: 4; inset: 0 0 0 auto; width: var(--editor-width); height: 100dvh; max-height: 100dvh;
  margin: 0; border-inline-start: 1px solid var(--c-line); border-radius: 0; box-shadow: none; }
#editor[data-presentation="side"] #editor-form { display: flex; flex-direction: column; height: 100%; }
#editor[data-presentation="side"] #editor-fields { flex: 1; min-height: 0; overflow: auto; padding: 3px; }
#editor[data-presentation="side"] .editor-actions { flex: none; }
#editor-title { overflow-wrap: anywhere; }
body.task-panel-open main.wrap { width: auto; max-width: var(--page-max);
  margin-inline: max(var(--page-gutter), (100% - var(--page-max)) / 2) calc(var(--editor-width) + var(--sp-24)); }
/* 자주 쓰는 이름(행사 추가): 이름 칸에 딸린 줄 — 13px 이름표 + 칩 모양 버튼. 칸 사이 간격 없이 이름 칸 바로 아래에 붙는다.
   보이는 높이는 칩 24px 이고 누르는 영역은 위아래로 넓혀 조작부 높이(36px · 터치 44px)다. */
.name-presets { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-8); min-height: var(--h-control);
  --btn-bg: var(--c-bg-3); --btn-bg-hover: var(--c-line); --btn-weight: var(--w-body); }
.form-stack > label + .name-presets { margin-block-start: calc(-1 * var(--sp-16)); }
.name-presets button { position: relative; min-height: var(--h-chip); padding: 2px var(--sp-8); border-radius: var(--r-chip);
  font-size: var(--fs-meta); line-height: var(--lh-meta); }
.name-presets button::after { content: ""; position: absolute; inset: calc((var(--h-chip) - var(--h-control)) / 2) 0; }
.event-location-field legend { margin-block-end: var(--sp-4); color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); }
/* 입력칸 오른쪽 같은 줄에 '태그 추가'(면 있는 버튼). 좁은 화면에서도 줄을 바꾸지 않는다. */
.event-location-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-8); --btn-bg: var(--c-bg-3); --btn-bg-hover: var(--c-line); --btn-weight: var(--w-strong); }
.event-location-entry input { min-inline-size: 0; }
/* 장소 칩(지우기): 보이는 높이는 칩 24px, 누르는 영역은 위아래로 넓혀 44px. */
.event-location-field .event-location-pill { position: relative; margin-block: calc(var(--sp-8) + 10px) 10px; }
.event-location-field .event-location-pill::after { content: ""; position: absolute; inset: -10px 0; }
.event-location-pill.replaced { visibility: hidden; }
.event-location-pill span:first-child { min-inline-size: 0; }
.event-location-pill button { min-height: var(--h-chip); min-width: var(--h-chip); padding: 0; }
.task-workspace { display: grid; gap: var(--sp-8); padding-block-end: var(--sp-16); border-block-end: 1px solid var(--c-line); }
.task-workspace-links { gap: var(--sp-4) var(--sp-16); }
.task-workspace-links a { display: inline-flex; align-items: center; min-height: var(--h-control);
  font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: var(--w-body); }
#assignee-picker { position: fixed; inset: auto; width: min(344px, 100% - 2 * var(--sp-8)); max-height: calc(100dvh - 2 * var(--sp-8));
  margin: 0; padding: var(--sp-12); overflow: auto; box-shadow: var(--shadow-menu); }
#assignee-picker[open] { display: flex; flex-direction: column; }
#assignee-picker > :not(#assignee-options) { flex-shrink: 0; }
#assignee-picker::backdrop { background: transparent; }
.assignee-head, .assignee-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8); }
.assignee-head h2 { font-size: var(--fs-body); line-height: var(--lh-body); }
#assignee-selected { display: flex; flex-wrap: wrap; gap: var(--sp-4); max-height: 84px; margin-block: var(--sp-8) 0; overflow: auto; }
#assignee-selected:empty { display: none; }
.remove-owner { min-height: var(--h-chip); padding: 0; }
#assignee-search { margin-block: var(--sp-8); }
#assignee-options { min-height: var(--h-row); max-height: min(248px, 38dvh); overflow: auto; }
#assignee-options button { display: flex; justify-content: flex-start; width: 100%; padding-inline: var(--sp-8); font-weight: var(--w-body); text-align: start; }
#assignee-options [aria-pressed="true"] { background: var(--c-bg-2); }
#assignee-options [aria-pressed="true"]::after { content: ""; width: 5px; height: 10px; margin-inline: auto var(--sp-8); border: solid var(--c-accent-strong);
  border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.assignee-footer { margin-block-start: var(--sp-8); padding-block-start: var(--sp-8); border-block-start: 1px solid var(--c-line); }
/* 아래 줄: 고른 수는 왼쪽, [취소][적용]은 오른쪽(주요 버튼이 맨 끝). */
.assignee-footer > .actions { flex-wrap: nowrap; margin-inline-start: auto; }
.scope-choices { display: grid; gap: 2px; }
.scope-choices button { justify-content: space-between; padding-inline: var(--sp-8); font-weight: var(--w-body); text-align: start; }
.scope-choices button[aria-pressed="true"] { background: var(--c-bg-3); font-weight: var(--w-strong); }
.rule-options { margin-block-end: var(--sp-12); }
/* 알림 줄: 방금 한 일 + (있으면) 되돌리기. 글과 버튼이 한 줄에 놓이고, 좁으면 버튼이 아래로 내려간다. */
#rules-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--sp-8); min-height: var(--h-control); margin-block: var(--sp-8); }
#rules-feedback .text-action { padding-inline: var(--sp-4); }
/* 중지한 반복: 목록 아래 접힌 묶음(행사의 '완료한 일'과 같은 접기). 이름은 보조 글자색 — 뜻은 줄의 '중지됨' 글자가 싣는다. */
#rule-stopped { margin-block-start: var(--sp-8); }
#rule-stopped .row-main strong { color: var(--c-text-2); font-weight: var(--w-body); }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8); margin-block-end: var(--sp-8); }
.month-nav > strong, .month-nav > h2 { font-size: var(--fs-head); line-height: var(--lh-head); font-weight: var(--w-strong); font-variant-numeric: tabular-nums; }

.picker-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.picker-days span { padding-block: var(--sp-4); color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); }
#week-picker .month-nav > strong { font-size: var(--fs-body); line-height: var(--lh-body); }
#picker-dates { gap: 2px 0; }
#picker-dates button { min-height: var(--h-control); padding: 0; border-radius: 0; font-weight: var(--w-body); font-variant-numeric: tabular-nums; }
#picker-dates .outside-month { color: var(--c-text-2); }
#picker-dates button[data-term-sunday] { font-weight: var(--w-strong); }
#picker-dates button[aria-pressed="true"] { background: var(--c-bg-3); }
#picker-dates button[aria-current="date"] { color: var(--c-accent-strong); font-weight: var(--w-strong); }
#picker-jump-month { width: auto; }
.picker-hint { margin-block-start: var(--sp-12); }

/* 일정 */
.agenda-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); margin-block-end: var(--sp-16); }
/* 일정 화면의 주요 버튼: 보기 전환 띠와 같은 줄의 오른쪽 끝(주간 작업의 '+ 항목 추가'와 같은 자리). */
#calendar-add { flex: none; margin-inline-start: auto; }
#agenda-empty { margin-block-end: var(--sp-12); }
#week-agenda { border-block-start: 1px solid var(--c-line); }
.agenda-day { display: grid; grid-template-columns: 124px minmax(0, 1fr); border-block-end: 1px solid var(--c-line); }
.agenda-day h2 { font-size: var(--fs-body); line-height: var(--lh-body); }
.agenda-day-trigger { justify-content: flex-start; align-items: center; flex-wrap: nowrap; gap: 0 var(--sp-8); width: 100%; min-height: var(--h-dense);
  padding-inline: var(--sp-8); border-radius: 0; text-align: start; }
.agenda-day-trigger time, .agenda-day-count { color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: var(--w-body); font-variant-numeric: tabular-nums; }
.agenda-day-trigger .agenda-day-count { margin-inline-start: auto; }
/* 오늘은 색만으로 알리지 않는다: 요일과 날짜가 굵다(600). */
.agenda-day-trigger[aria-current="date"], .agenda-day-trigger[aria-current="date"] time { color: var(--c-accent-strong); font-weight: var(--w-strong); }
.agenda-day-dots { display: none; }
.agenda-day-trigger[aria-pressed="true"] { background: var(--c-bg-3); }
/* 일정 있는 날: 요일 표와 + 를 첫 항목과 같은 높이(44px)로 맞춰 한 줄에 놓는다. */
.agenda-day:has(.agenda-item) :is(.agenda-day-trigger, .agenda-add) { min-height: var(--h-row); }
.agenda-day h2 { align-self: start; }
.agenda-items { display: grid; align-content: start; min-width: 0; }
.agenda-entry { min-width: 0; }
/* 하루에 일정이 여럿이면 항목 사이에 가는 선. 일정 칸 안에서만 그어, 날짜 사이의 선(전체 폭)과 구별된다. */
#week-agenda .agenda-entry + .agenda-entry { border-block-start: 1px solid var(--c-line); }
.agenda-add { justify-self: end; align-self: start; min-height: var(--h-dense); font-weight: var(--w-body); }
.agenda-item { justify-content: space-between; gap: var(--sp-12); width: 100%; min-height: var(--h-row); padding-inline: var(--sp-8);
  border-radius: 0; font-weight: var(--w-body); text-align: start; }
.agenda-item > strong { min-width: 0; font-weight: var(--w-body); overflow-wrap: anywhere; }
.agenda-item:is([data-kind="event"], [data-kind="service"]) > strong { font-weight: var(--w-strong); }
.agenda-item > span { flex: none; }
:is(.agenda-item, .month-entry)[data-kind="event"] { box-shadow: inset 2px 0 0 var(--c-accent-strong); color: var(--c-accent-strong); }
:is(.agenda-item, .month-entry)[data-kind="event"]:focus-visible { box-shadow: var(--focus-ring); }
#week-agenda:not([data-focus-day]) .agenda-items { grid-template-columns: minmax(0, 1fr) auto; }
#week-agenda:not([data-focus-day]) .agenda-entry { grid-column: 1; }
#week-agenda:not([data-focus-day]) .agenda-add { grid-column: 2; grid-row: 1; }
/* 주일의 '특별한 예배로 정하기': 일정 추가(+)보다 낮은 보조 조작. 좁은 칸에서는 두 줄로 넘어간다. */
.service-set { justify-self: start; min-height: var(--h-dense); padding-inline: var(--sp-8); font-weight: var(--w-body); text-align: start; white-space: normal; }
#week-agenda:not([data-focus-day]) .service-set { grid-column: 1 / -1; }
.month-entry[data-kind="service"] { font-weight: var(--w-strong); }
#week-agenda[data-focus-day] { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-block-end: 1px solid var(--c-line); }
#week-agenda[data-focus-day] .agenda-day { display: block; border: 0; }
#week-agenda[data-focus-day] .agenda-day-trigger { justify-content: center; min-height: var(--h-row); padding-inline: var(--sp-4); }
#week-agenda[data-focus-day] .agenda-day-trigger[aria-pressed="true"] { box-shadow: inset 0 -2px 0 var(--c-text); background: transparent; }
#week-agenda[data-focus-day] .agenda-day-trigger[aria-pressed="true"]:focus-visible { box-shadow: var(--focus-ring), inset 0 -2px 0 var(--c-text); }
#week-agenda[data-focus-day] .agenda-day-count { margin-inline-start: 0; }
#week-day-details { margin-block-start: var(--sp-24); }
#week-day-items, #month-date-items { border-block-start: 1px solid var(--c-line); }
:is(#week-day-items, #month-date-items) .agenda-item { border-block-end: 1px solid var(--c-line); }
:is(#week-day-items, #month-date-items) .agenda-add { justify-self: start; min-height: var(--h-control); padding-inline: var(--sp-8); }
#month-date-items { display: grid; }
#month-agenda-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-block-end: 1px solid var(--c-line); }
.month-cell { position: relative; isolation: isolate; display: grid; align-content: start; gap: 2px; min-height: var(--h-cell); padding: var(--sp-4);
  border-block-start: 1px solid var(--c-line); }
.month-day-trigger { justify-content: flex-start; min-height: var(--h-chip); padding: 0; background: transparent; font-weight: var(--w-body); }
.month-day-trigger::before { position: absolute; inset: 0; content: ""; }
.month-day-number { display: inline-grid; place-content: center; min-width: var(--h-chip); height: var(--h-chip); padding-inline: var(--sp-4); border-radius: var(--h-chip);
  font-size: var(--fs-meta); line-height: var(--lh-meta); font-variant-numeric: tabular-nums; white-space: nowrap; }
.month-cell.outside-month .month-day-number { color: var(--c-text-2); }
.month-day-trigger[aria-current="date"] .month-day-number { background: var(--c-accent-strong); color: var(--c-on-accent); font-weight: var(--w-strong); }
.month-cell:has(.month-day-trigger[aria-pressed="true"]) { background: var(--c-bg-2); }
.month-cell:has(.month-day-trigger:focus-visible) { box-shadow: var(--focus-ring); }
.month-day-trigger:focus-visible { box-shadow: none; }
.month-entry { position: relative; z-index: 1; display: block; min-width: 0; min-height: var(--h-chip); padding: 2px 6px; border-radius: var(--r-chip);
  background: var(--c-bg-2); color: var(--c-text); font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: var(--w-body); text-align: start; }
.month-entry[data-kind="event"] { background: var(--c-info-bg); font-weight: var(--w-strong); }
.month-entry-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 칸에는 일정 3개까지, 나머지는 '외 N'(누르면 아래에 그날 목록). 요일 머리는 날짜 숫자와 같은 왼쪽 선에서 시작한다. */
.month-more { position: relative; z-index: 1; justify-content: flex-start; justify-self: start; min-height: var(--h-chip); padding: 0 6px; color: var(--c-text-2);
  font-size: var(--fs-meta); line-height: var(--lh-meta); }
.month-weekdays { text-align: start; }
.month-weekdays span { padding-inline-start: var(--sp-8); }
#month-agenda-status { padding-block: var(--sp-8); color: var(--c-danger); }
#month-date-details, #month-date-hint { margin-block-start: var(--sp-24); }
/* 넓은 화면의 월간: 그날 목록을 달력 옆 단에 두고 자리를 늘 잡아 둔다. 날짜를 눌러도 달력이 움직이지 않아(두 번 눌러 추가가 같은 칸에 떨어진다)
   6주짜리 달이나 낮은 화면에서도 그날 일정과 '+ 일정 추가'가 달력과 한 화면에 보인다. 옆 편집 창이 열려 본문이 좁아지면 아래로 내린다. */
@media (min-width: 821px) {
  body:not(.task-panel-open) #month-agenda { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); grid-template-rows: repeat(4, auto) 1fr;
    column-gap: var(--sp-24); align-items: start; }
  body:not(.task-panel-open) #month-agenda > * { grid-column: 1; }
  body:not(.task-panel-open) #month-agenda > .month-nav { grid-column: 1 / -1; }
  body:not(.task-panel-open) #month-agenda > :is(#month-date-details, #month-date-hint) { grid-column: 2; grid-row: 2 / -1; position: sticky; top: var(--sp-16);
    max-height: calc(100dvh - 2 * var(--sp-16)); overflow: auto; }
  /* 굴리는 상자가 안쪽 줄의 초점 고리(4px)를 자르지 않게 그만큼 안으로 들이고 밖으로 낸다. */
  body:not(.task-panel-open) #month-agenda > #month-date-details { margin: calc(-1 * var(--sp-4)); padding: var(--sp-4); }
  body:not(.task-panel-open) #month-agenda > #month-date-hint { margin-block-start: 0; }
}
#year-agenda-months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-8); }
.year-note { margin-block-end: var(--sp-8); }
.year-month { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0; min-height: var(--h-row-2); padding: var(--sp-8) var(--sp-12);
  color: var(--c-text-2); font-weight: var(--w-body); text-align: start; }
.year-month strong { font-weight: var(--w-body); }
.year-month-event { max-width: 100%; overflow: hidden; color: var(--c-accent-strong); text-overflow: ellipsis; white-space: nowrap; }
.year-month-event:first-of-type, .year-month .small + .year-month-event { margin-block-start: 0; }
.year-month:has(.small) { color: var(--c-text); }
.year-month:has(.small) strong { font-weight: var(--w-strong); }
.year-month[aria-current="date"] { background: var(--c-bg-2); }
.year-month[aria-current="date"] strong { color: var(--c-accent-strong); font-weight: var(--w-strong); }
#view-calendar [draggable="true"] { cursor: grab; }
.calendar-drop-target { background: var(--c-info-bg); box-shadow: inset 0 0 0 2px var(--c-accent); }

/* 행사 */
#event-list { border-block-start: 1px solid var(--c-line); }
#event-list:has(> .event-detail, > .empty) { border-block-start: 0; }
.event-open { position: relative; justify-content: space-between; gap: var(--sp-16); width: 100%; min-height: var(--h-row-2);
  padding: var(--sp-8) var(--sp-32) var(--sp-8) var(--sp-8); border-block-end: 1px solid var(--c-line); border-radius: 0; text-align: start; }
.event-open::after { content: ""; position: absolute; inset-inline-end: var(--sp-12); top: 50%; width: 6px; height: 6px;
  border: solid var(--c-text-2); border-width: 1.5px 1.5px 0 0; transform: translateY(-50%) rotate(45deg); }
.event-open-info { display: grid; min-width: 0; overflow-wrap: anywhere; }
.event-open-meta { font-weight: var(--w-body); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* 회의록 수 · 할 일 진행: 좁은 폭에서 줄이 바뀌어도 낱말 가운데서 꺾이지 않는다. */
.event-open-count { white-space: nowrap; }
/* 지난 행사: 다가올 행사 아래 구획 하나(여백 32px + 구획 제목). 다가올 행사가 없으면 빈 상태 아래에 온다. */
.event-past { margin-block-start: var(--sp-32); }
#event-list > .empty + .event-past { margin-block-start: var(--sp-8); }
#view-events > section:not([hidden]), .event-detail { margin-block-end: var(--sp-32); min-inline-size: 0; }
.event-detail-title { overflow-wrap: anywhere; }
.event-detail > h2 { margin-block-end: var(--sp-8); }
.event-notes { white-space: pre-wrap; overflow-wrap: anywhere; }
.event-attachments, .event-legacy-decisions { margin-block-start: var(--sp-24); }
.event-detail ul { margin-block: var(--sp-8); padding-inline-start: var(--sp-24); overflow-wrap: anywhere; }
.event-legacy-decisions li { white-space: pre-wrap; }

/* 작업공간 */
.workspace-tools { display: flex; overflow-x: auto; margin-block-end: var(--sp-24); border-block-end: 1px solid var(--c-line); scrollbar-width: none; }
.workspace-tools::-webkit-scrollbar { display: none; }
.workspace-tools a { flex: none; display: inline-flex; align-items: center; min-height: var(--h-row); margin-inline-end: var(--sp-16); border-radius: 0;
  color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: var(--w-body); white-space: nowrap; }
.workspace-tools a:last-child { margin-inline-end: 0; }
.workspace-tools a[aria-current="page"] { font-weight: var(--w-strong); position: sticky; z-index: 1; inset-inline: calc(-1 * var(--sp-12)); padding-inline: var(--sp-12);
  margin-inline: calc(-1 * var(--sp-12)) var(--sp-4); color: var(--c-text);
  background: linear-gradient(var(--c-text), var(--c-text)) bottom / calc(100% - 2 * var(--sp-12)) 2px no-repeat var(--c-bg); }
.workspace-tools.measuring a[aria-current="page"] { position: static; }
.tool-state { display: none; }
/* 첫 화면: 두 줄 행 — 도구 이름(16/600) 아래 이번 주 상태(13px). 상태는 링크 다음 요소라, 제 높이만큼 끌어올려 링크의 둘째 줄 자리에 놓는다. */
#view-workspace[data-landing="true"] .workspace-tools { display: grid; overflow: visible; border-block: 1px solid var(--c-line) 0; counter-reset: tool; }
#view-workspace[data-landing="true"] .workspace-tools a { grid-column: 1; align-items: flex-start; gap: var(--sp-12); min-height: var(--h-row-2); margin: 0; padding: var(--sp-8) var(--sp-8) 0;
  border-block-end: 1px solid var(--c-line); color: var(--c-text); font-size: var(--fs-body); line-height: var(--lh-body); font-weight: var(--w-strong); counter-increment: tool; }
#view-workspace[data-landing="true"] .workspace-tools a::after { align-self: center; margin-block-start: calc(-1 * var(--sp-8)); }
#view-workspace[data-landing="true"] .tool-state { position: relative; display: block; justify-self: start;
  margin: calc(-1 * (var(--lh-meta) + var(--sp-8))) 0 var(--sp-8) calc(var(--sp-8) + 16px + var(--sp-12)); white-space: nowrap; pointer-events: none; }
.tool-state[data-state="draft"] { color: var(--c-text); }
.tool-state[data-state="final"] { color: var(--c-ok); }
.tool-state[data-state="stale"] { color: var(--c-danger); font-weight: var(--w-strong); }
#view-workspace[data-landing="true"] .workspace-tools a::before { content: counter(tool); min-width: 16px; color: var(--c-text-2);
  font-size: var(--fs-meta); line-height: var(--lh-body); font-weight: var(--w-body); font-variant-numeric: tabular-nums; text-align: center; }
#view-workspace[data-landing="true"] .workspace-tools a::after { content: ""; width: 6px; height: 6px; margin-inline: auto var(--sp-4);
  border: solid var(--c-text-2); border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
#workspace-versions { margin-block-start: var(--sp-32); scroll-margin-block-start: 6rem; }
.version-group { padding-block: var(--sp-12); }
.version-group > h3 { margin-block-end: var(--sp-4); }
.version-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); }
.version-row > .row-main { flex: 1 1 12rem; min-inline-size: 0; overflow-wrap: anywhere; }
.version-row > img { flex: none; object-fit: cover; border-radius: var(--r-chip); }
.version-row .actions { margin-inline-start: auto; }
/* 도구 화면의 작업 파일: 받기는 링크 글자색 — 같은 줄의 '완료'·메뉴(먹 글자)와 갈린다. */
section[id^="view-"]:not(#view-files, #view-music) > #workspace-versions .publication-downloads > a[download] { color: var(--c-accent-strong); }
.version-row textarea { width: 100%; }
@media (hover: hover) {
  .mast nav a:hover, .workspace-tools a:hover { color: var(--c-text); }
  #view-workspace[data-landing="true"] .workspace-tools a:hover { background: var(--c-hover); }
}

/* 작업공간 도구: 찬양 목록·영상·자막·주보 */
.song-source { display: inline-flex; align-items: center; gap: var(--sp-8); min-height: var(--h-control); max-width: 100%; min-width: 0;
  color: var(--c-text); font-weight: var(--w-strong); overflow-wrap: anywhere; }
.song-source::after { content: "↗" / ""; color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: var(--w-body); }
#mix-playlist, #mix-editor-songs { margin: 0; padding-inline-start: var(--sp-24); font-variant-numeric: tabular-nums; }
/* 영상 곡 순서: 찬양 자막의 곡 목록과 같은 행 — 선은 구획 제목과 같은 왼쪽 선에서 시작하고 번호(13px 보조색)는 줄 안에 둔다. */
#mix-playlist { padding: 0; border-block-start: 1px solid var(--c-line); list-style: none; counter-reset: mix-song; }
#mix-playlist li { display: flex; align-items: center; gap: var(--sp-8); padding-inline: var(--sp-8); border-block-end: 1px solid var(--c-line); counter-increment: mix-song; }
#mix-playlist li::before { content: counter(mix-song); flex: none; min-width: 16px; color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); text-align: center; }
#mix-playlist .mix-track { flex: 1; min-width: 0; }
#mix-playlist-empty { padding-block-end: var(--sp-8); }
#mix-editor-songs:empty, #mix-playlist:empty { display: none; }
/* 이번 주 찬양 목록 — 위에서 아래로 일의 순서: 곡 순서(목록이 주인, 제목 옆 '콘티 붙여넣기') → 그림은 온라인 주보가 만든다는 한 줄.
   구획 사이는 32px, 구획 제목과 내용 사이는 12px. 곡이 없는 주에는 붙여넣기 칸이 펼쳐진 채 주인이다(app.js renderPublishForm).
   온라인 주보의 찬양 탭에도 같은 묶음이 들어가므로, 줄 모양은 화면 폭이 아니라 이 묶음의 폭으로 바꾼다. */
#worship-publishing { display: flex; flex-direction: column; min-width: 0; container-type: inline-size; }
#weekly-songs-saved .section-head { margin-block-end: var(--sp-12); }
.publish-song-heading { display: flex; align-items: baseline; gap: var(--sp-8); min-width: 0; }
#publish-song-count { font-variant-numeric: tabular-nums; }
/* 번호는 제 칸(두 자리 고정 폭)에 두어 구획 제목과 같은 왼쪽 선에서 시작한다. 구분선도 그 선에서 끝까지 간다. */
#publish-song-order { margin: 0; padding: 0; border-block-start: 1px solid var(--c-line); list-style: none; font-variant-numeric: tabular-nums; }
#publish-song-order li { border-block-end: 1px solid var(--c-line); }
.publish-song-row { display: flex; align-items: center; gap: var(--sp-4); min-height: var(--h-row); }
.publish-song-main { display: flex; flex: 1 1 auto; align-items: baseline; gap: var(--sp-8); min-width: 0; }
.publish-song-number { flex: none; min-inline-size: 2ch; color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); }
.publish-song-description { min-width: 0; }
.publish-song-title { font-weight: var(--w-strong); overflow-wrap: anywhere; }
.publish-song-nolink { flex: none; }
/* 제목 아래 작은 글: 같은 영상 표시 · 조·가수·메모. 메모는 한 줄로 줄이고 누르면 편다. */
.publish-song-sub { display: flex; align-items: baseline; gap: var(--sp-8); min-width: 0; }
.publish-song-same-video { flex: none; }
.publish-song-conti { --btn-bg: transparent; --btn-bg-hover: transparent; display: block; flex: 0 1 auto; min-width: 0; min-height: 0; padding: 0;
  border-radius: 0; color: inherit; font: inherit; text-align: start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.publish-song-conti[aria-expanded="true"] { flex-basis: 100%; white-space: normal; overflow-wrap: anywhere; }
.publish-song-sub:has(.publish-song-conti[aria-expanded="true"]) { flex-wrap: wrap; row-gap: 0; }  /* 편 메모는 '같은 영상' 아래 줄에서 폭을 다 쓴다 */
.publish-song-conti { position: relative; }
.publish-song-conti::after { content: ""; position: absolute; inset: calc(-1 * var(--sp-4)) 0 calc(-1 * var(--sp-8)); }  /* 누르는 자리를 위아래로 넓힌다 */
/* 조작부: 위·아래는 아이콘 버튼, 바꾸기·빼기는 줄 메뉴(⋯) 안. 맨 끝 단추는 글리프가 오른쪽 선에 닿도록 제 여백만큼 밖으로 낸다
   (누르는 자리는 그대로 44px). 그래야 390px 에서 한글 12자 제목이 한 줄에 들어간다. */
.publish-song-actions { display: flex; align-items: center; flex: none; margin-inline-end: calc((var(--sp-16) - var(--h-control)) / 2); }
.publish-song-row .song-source { gap: var(--sp-4); }
@container (min-width: 560px) {
  /* 자리가 넉넉하면 줄 메뉴를 접지 않고 펼쳐 둔다: 같은 두 단추가 옅은 면의 버튼으로 줄에 놓인다(글자 나열로 읽히지 않게). */
  .publish-song-row { gap: var(--sp-16); }
  .publish-song-row .song-source { gap: var(--sp-8); }
  .publish-song-actions { gap: var(--sp-4); margin-inline-end: 0; }
  .publish-song-actions .row-menu { margin-inline-start: var(--sp-8); }
  .publish-song-actions .row-menu-toggle { display: none; }
  .publish-song-actions .row-menu-options, .publish-song-actions .row-menu-options[hidden] { position: static; display: flex !important; gap: var(--sp-8);
    min-width: 0; padding: 0; border-radius: 0; background: none; box-shadow: none; --btn-bg: var(--c-bg-3); --btn-bg-hover: var(--c-line); }
  .publish-song-actions .row-menu-options button { width: auto; }
}
#publish-feedback:not(:empty) { margin-block-start: var(--sp-8); }
#worship-publishing:has(#publish-paste:not([hidden])) #publish-feedback { order: 1; }
#publish-paste { margin-block-start: var(--sp-12); }
#weekly-songs-saved[hidden] ~ #publish-paste { margin-block-start: 0; }
#publish-paste-warning { color: var(--c-warn); font-weight: var(--w-body); }
.publish-song-field { display: grid; gap: var(--sp-4); min-width: 0; }
/* 미리 읽기(콘티 붙여넣기 창 · 빈 주의 붙여넣기 칸): 붙인 글을 무엇으로 읽었는지 보인다. 곡 순서 목록과 같은 줄(번호 13px 두 자리 칸 · 구분선)이되
   조작이 없어 줄이 낮다. 링크가 없는 곡 · 곡으로 넣지 않는 줄은 그 아래 13px. 다시 읽는 동안(aria-busy)에는 앞 결과를 둔 채 흐리지 않는다. */
.conti-reading { display: grid; gap: var(--sp-8); min-width: 0; overflow-wrap: anywhere; }
.conti-reading > * { margin: 0; }
.conti-reading-head { display: flex; align-items: baseline; gap: var(--sp-8); font-weight: var(--w-strong); }
.conti-reading-head .small { font-weight: var(--w-body); font-variant-numeric: tabular-nums; }
.conti-reading-songs, .conti-reading-lines { padding: 0; list-style: none; }
.conti-reading-songs { border-block-start: 1px solid var(--c-line); font-variant-numeric: tabular-nums; }
.conti-reading-songs li { display: flex; align-items: baseline; gap: var(--sp-8); padding-block: var(--sp-8); border-block-end: 1px solid var(--c-line); }
.conti-reading-song { display: grid; flex: 1 1 auto; gap: var(--sp-4); min-width: 0; justify-items: start; }
.conti-reading-song > * { margin: 0; }
.conti-reading-title { width: 100%; min-width: 0; }
.conti-reading-check strong { font-weight: var(--w-strong); }
.conti-reading-alt { --btn-bg: var(--c-bg-3); --btn-bg-hover: var(--c-line); max-width: 100%; overflow-wrap: anywhere; text-align: start; white-space: normal; }
.conti-reading-lines { display: grid; gap: var(--sp-4); margin-block-start: calc(-1 * var(--sp-4)); color: var(--c-text); font-size: var(--fs-meta); line-height: var(--lh-meta); }
/* 콘티 붙여넣기 창: 읽은 곡이 많아도 [취소][뒤에 더하기][목록 바꾸기] 줄은 늘 보인다 — 칸과 미리 읽기만 굴린다(작업 편집 시트와 같은 방식).
   굴리는 상자가 글 칸의 초점 고리(4px)를 자르지 않게 그만큼 안으로 들이고 밖으로 낸다. 알림 줄은 비어 있어도 그려 둔다(자리는 차지하지 않는다). */
#conti-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
#conti-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#conti-fields { flex: 1 1 auto; min-height: 0; overflow: auto; margin: calc(-1 * var(--sp-4)); padding: var(--sp-4); overscroll-behavior: contain; }
#conti-form > :not(#conti-fields) { flex: none; }
#conti-status:empty { margin-block-start: calc(-1 * var(--sp-16)); }
#conti-text { max-block-size: 40dvh; }
/* 찬양 리스트 그림은 온라인 주보가 만든다는 한 줄(곡 목록 아래), 찬양예배가 아닌 주에 주소로 들어온 영상 화면의 한 줄(맨 위). */
#song-picture-note { margin-block: var(--sp-16) 0; }
#music-off-week { margin-block: 0 var(--sp-8); }
/* 안내 글 아래 줄의 링크: 누르는 높이는 조작 높이(터치 44px)다. */
:is(#song-picture-note, #music-off-week) a { display: block; inline-size: fit-content; padding-block: calc((var(--h-control) - var(--lh-meta)) / 2); }
.publication-downloads { padding-block: var(--sp-8); }
.mix-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-8) var(--sp-16); }
#mix-editor { margin-block-start: var(--sp-16); padding: var(--sp-16); border-radius: var(--r-surface); background: var(--c-bg-2); }
#mix-editor :is(input, textarea) { min-width: 0; }
.mix-design-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: var(--sp-24); }
.mix-design-grid fieldset { align-content: start; }
.mix-design-grid legend, .score-book-song legend { margin-block-end: var(--sp-8); font-weight: var(--w-strong); overflow-wrap: anywhere; }
.mix-image-drop { position: relative; display: grid; gap: var(--sp-4); padding: var(--sp-12); border: 1px dashed var(--c-edge);
  border-radius: var(--r-control); background: var(--c-bg); color: var(--c-text); font-size: var(--fs-body); line-height: var(--lh-body);
  overflow-wrap: anywhere; cursor: pointer; }
/* 끌어다 올릴 때와 키보드 초점에서 표시한다. 가리킴(hover)은 가리킬 수 있는 기기에서만 — 터치로 누른 뒤 표시가 남지 않게
   :focus-within 대신 안쪽 입력의 :focus-visible 을 본다. */
.mix-image-drop:is(.drag-over, :has(input:focus-visible)) { border-color: var(--c-accent); background: var(--c-info-bg); }
@media (hover: hover) { .mix-image-drop:hover { border-color: var(--c-accent); background: var(--c-info-bg); } }
/* 결단 찬양의 올린 악보 받기: 왼쪽 선에서 시작하는 링크(가운데에 놓인 설명 글처럼 보이지 않게). */
#closing-score-source { justify-self: start; margin-inline-start: calc(-1 * var(--sp-12)); color: var(--c-accent-strong); }
.mix-image-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; border: 0; opacity: 0; }
.mix-design-frame { aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-control); background: var(--c-bg-3); }
.mix-design-preview { display: block; width: 100%; height: 100%; object-fit: contain; }
#mix-preview-status { min-height: var(--lh-meta); overflow-wrap: anywhere; }
#music-mix:has(#mix-editor:not([hidden])) :is(#start-mix, .mix-weekly-link) { display: none; }
/* 만드는 동안: 상태 글이 한 줄을 쓰고, 그 아래 줄에 진행 막대와 [제작 중단] — 시작 버튼이 있던 자리와 겹치지 않는다. */
#mix-progress { flex: 1 1 0; min-width: 0; }
.mix-production:has(#mix-progress:not([hidden])) > p { display: flex; align-items: center; flex-basis: 100%; min-height: var(--h-control); }
/* 끝남·실패는 칩으로: 칩이 줄 폭만큼 늘어나지 않게 제 폭만 쓴다. 실패 사유는 붉은 글자. */
#music-mix-status[data-state="done"] { flex: 0 1 auto; margin-inline-end: auto; }
#music-mix-status[data-state="error"] { color: var(--c-danger); }
.mix-state { margin-inline-end: var(--sp-8); }
.mix-stage { margin-block-start: var(--sp-32); }
.mix-stage h3 { margin-block-end: var(--sp-8); }
.mix-production { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8) var(--sp-12); margin-block-start: var(--sp-16); }
.mix-production > p { flex: 1 1 180px; overflow-wrap: anywhere; }
.mix-production > :empty:not(progress):not(button) { display: none; }
.mix-track { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-8); min-height: var(--h-row); }
.mix-track > :first-child { grid-column: 1; min-width: 0; overflow-wrap: anywhere; }
.mix-track time { color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); }
.mix-missing-link { grid-column: 1 / -1; }
.mix-file-links { margin-block-start: var(--sp-8); }
.mix-result-actions { row-gap: var(--sp-8); }
#mix-thumbnail-preview { display: block; width: min(100%, 34rem); height: auto; margin-block-start: var(--sp-24); border-radius: var(--r-control); }
#mix-chapter-warnings { margin: var(--sp-8) 0 0; padding-inline-start: var(--sp-16); }
.saved-setlist { margin-block-start: var(--sp-32); }
.setlist-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); padding-block: var(--sp-8); }
.setlist-settings { margin-block-end: var(--sp-12); }
#score-book { margin-block-start: var(--sp-16); }
#score-book-form { padding-block: var(--sp-8) var(--sp-12); }
.score-book-song { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--sp-8); padding-block: var(--sp-8); }
.score-book-song button { align-self: end; justify-self: start; }
#music-handoff { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); padding-block: var(--sp-12); }
.crop-panel canvas { display: block; width: auto; height: auto; max-height: 360px; background: var(--c-bg-3); touch-action: none; cursor: crosshair; }
.crop-coordinates { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
.setlist-source { max-height: 200px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.video-status-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-8); }
#video-jobs { margin-block: var(--sp-8); }
#deck-check-issues { margin-block: var(--sp-12); padding: var(--sp-12) var(--sp-16); border-radius: var(--r-control); background: var(--c-bg-2); }
#deck-check-list { margin: var(--sp-4) 0 0; padding: 0; list-style: none; }
#deck-check-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-8); }
#deck-check-list button { justify-content: flex-start; padding-inline: 0; font-weight: var(--w-body); text-align: start; }
#song-list .row { gap: var(--sp-8); }
/* 곡 목록 아래: 끝으로 가는 주요 버튼 하나와, 그 버튼이 무엇을 하는지 한 줄. */
#deck-next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-8) var(--sp-16); margin-block-start: var(--sp-16); }
#deck-next-hint { flex: 1 1 16rem; min-width: 0; }
#preview-deck { --btn-bg: var(--c-bg-3); --btn-bg-hover: var(--c-line); --btn-weight: var(--w-strong); flex: none; margin-inline-start: auto; }
.song-number { min-width: 16px; color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); font-variant-numeric: tabular-nums; text-align: center; }
.select-song { justify-content: flex-start; padding: 0; text-align: start; }
#song-list .selected-song { background: var(--c-bg-2); }
.song-row-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-4); }
.song-row-tools > button { font-weight: var(--w-body); }
#song-panel { min-width: 0; margin-block-start: var(--sp-32); padding-block-start: var(--sp-24); border-block-start: 1px solid var(--c-line); }
.song-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-8); margin-block-end: var(--sp-16); }
.song-panel-header h2, .slide-side h2 { overflow-wrap: anywhere; }
.slide-side + #slide-form:not([hidden]) { margin-block-start: var(--sp-24); padding-block-start: var(--sp-24); border-block-start: 1px solid var(--c-line); }
.slide-side .section-head:has(h2[hidden]) { display: none; }
.projection { display: grid; place-items: center; aspect-ratio: 16 / 9; padding: var(--sp-12); border-radius: var(--r-control);
  background: var(--c-stage); color: var(--c-on-accent); text-align: center; }
.projection p { font-size: var(--fs-head); line-height: var(--lh-head); font-weight: var(--w-strong); white-space: pre-line; overflow-wrap: anywhere; }
/* 곡별 점검의 장은 눌러서 그 자리에서 고친다. 고치는 동안에는 가는 고리로 알린다(글꼴·크기·정렬은 송출 장 그대로). */
#slide-stage[data-editable] { cursor: text; }
#slide-content { min-width: 0; max-width: 100%; }
/* 고치는 동안의 초점 표시는 장 둘레의 고리 하나다(글 둘레에 고리를 하나 더 그리지 않는다). */
#slide-content:is(:focus, :focus-visible) { outline: 0; box-shadow: none; }
#slide-stage[data-editable] #slide-content:empty::before { content: "빈 장"; color: var(--c-text-3); font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: var(--w-body); }
#slide-stage.editing { outline: 2px solid var(--c-accent); outline-offset: 2px; }
#slide-stage.editing #slide-content { min-width: 50%; min-height: var(--lh-head); cursor: text; }
#slide-stage.editing #slide-content:empty::before { content: none; }
#slide-preview[aria-busy="true"] .projection { opacity: .7; }
#slide-issue { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-12); margin-block-end: var(--sp-8); color: var(--c-warn); overflow-wrap: anywhere; }
#slide-issue-text { flex: 1 1 12rem; min-width: 0; }
#slide-issue button, #next-issue-slide { --btn-bg: var(--c-bg-3); --btn-bg-hover: var(--c-line); flex: none; }
#slide-edit-note, #slide-edit-error { margin-block-start: var(--sp-8); }
/* 고치는 동안에는 조작 줄 자리에 [이 장 저장][취소]가 놓인다(아래 내용이 밀리지 않게 같은 자리). */
#slide-ops, #slide-edit-bar { margin-block: var(--sp-8) var(--sp-16); }
@media (pointer: coarse) { .slide-edit-keys { display: none; } }
.slide-controls { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); margin-block: var(--sp-8); }
.slide-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4) var(--sp-12); }
.slide-meta:not(:has(> :not([hidden]))) { display: none; }
#slide-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-12); }
#slide-edited:not([hidden]) + #slide-issue-count::before { content: "· "; }
/* 삭제는 다른 조작과 떨어뜨려 줄 끝에 둔다. 평소에는 보조 글자색, 가리키면 붉다. */
#delete-slide { margin-inline-start: auto; }
.slide-controls output { color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); font-variant-numeric: tabular-nums; }
#slide-video-time { display: inline-flex; align-items: center; min-height: var(--h-control); }
.video-gap { flex-wrap: wrap; gap: var(--sp-4) var(--sp-12); }
/* 공백 점검 줄은 줄 어디를 눌러도 원본이 열린다(글자 높이만 눌리지 않게). */
.video-gap > a { display: flex; flex: 1 1 100%; align-items: center; min-height: var(--h-control); }
#deck-spans:empty { display: none; }
#deck-spans button { justify-content: flex-start; width: 100%; border-block-end: 1px solid var(--c-line); border-radius: 0; font-weight: var(--w-body); text-align: start; }
/* 확인 문구와 [곡 검토 완료]는 조작 줄 바로 아래 한 줄(좁으면 버튼이 아래로 내려간다). */
.slide-review { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-8) var(--sp-12); }
.slide-review .confirm { flex: 1 1 12rem; min-width: 0; align-items: flex-start; padding-block: calc((var(--h-control) - var(--lh-body)) / 2); }
.slide-review .confirm input { margin-block-start: 3px; }
#song-text-editor > summary { flex-wrap: wrap; row-gap: 0; }
#song-list .song-reviewed { margin-inline-end: var(--sp-4); }
#selected-performance-order { padding: var(--sp-8) var(--sp-12); border-radius: var(--r-control); background: var(--c-bg-2); overflow-wrap: anywhere; }
#song-text-editor > div { padding-block-start: var(--sp-8); }
.caption-preview { display: grid; gap: var(--sp-8); margin: 0; padding-inline-start: var(--sp-24); }
.caption-preview li { padding: var(--sp-8) var(--sp-12); border-radius: var(--r-control); background: var(--c-bg-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.caption-preview li::marker { color: var(--c-text-2); font-size: var(--fs-meta); }
/* 결단 찬양의 장은 눌러서 그 자리에서 고친다(곡별 점검과 같은 손놀림). 고치는 장은 흰 면에 가는 고리, 그 아래에 [이 장 저장][취소] … [이 장 삭제]. */
/* 고치는 칸은 브라우저가 overflow-wrap 을 break-word 로 되돌린다 — 끊을 곳 없는 긴 줄이 화면을 옆으로 밀지 않게 다시 적는다. */
#closing-preview { margin-block-start: var(--sp-8); }
#closing-preview li { min-width: 0; }
.closing-slide-text { display: block; min-height: var(--lh-body); border-radius: var(--r-chip); overflow-wrap: anywhere; cursor: text; }
.closing-slide-text[contenteditable]:is(:focus, :focus-visible) { outline: 0; box-shadow: none; }
#closing-preview li.editing { outline: 2px solid var(--c-accent); background: var(--c-bg); }
#closing-preview[aria-busy="true"] li.editing { opacity: .7; }
#closing-edit-note, #closing-edit-error, #closing-edit-bar { margin-block-start: var(--sp-8); }
#delete-closing-slide { margin-inline-start: auto; }
#delete-closing-slide:disabled { color: var(--c-text-3); }
@media (hover: hover) { .closing-slide-text:not([contenteditable]):hover { background: var(--c-hover); box-shadow: 0 0 0 4px var(--c-hover); } }
/* 예배 자막 · 결단 찬양의 확정 상태: 조작 줄 맨 위 한 줄 — 완료 칩 ‘최종 확정됨’ 또는 붉은 ‘원본이 바뀜’. */
.final-state { flex: 0 0 100%; }
.final-state[data-state="stale"] > span { color: var(--c-danger); font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: var(--w-strong); }
/* 화면별 미리보기: 기도·봉독 화면 목록과 자막 목록이 한 목록처럼 이어진다. */
#service-preview-section > .section-title { margin-block-end: var(--sp-8); }
#service-lead:not([hidden]) + p, #service-lead:not([hidden]) ~ #service-preview { margin-block-start: var(--sp-8); }
#service-screen { display: block; width: 100%; height: auto; border-radius: var(--r-control); background: var(--c-stage); }
#service-screen-picker { width: auto; max-width: 100%; }
/* 원문에서 읽은 것: 구획·화면·구절 수 한 줄과 그 아래 13px 줄들. 확인할 줄은 붉은 글자의 수 + 두 줄 행(줄 번호 버튼·그 줄의 글 / 까닭). */
#service-outline { display: grid; gap: var(--sp-4); min-width: 0; overflow-wrap: anywhere; }
#service-outline > .section-title { margin-block-end: var(--sp-4); }
#service-outline > div:not(.section-title) { margin-block-start: var(--sp-8); }
#service-outline ul { display: grid; gap: var(--sp-4); margin: 0; padding: 0; list-style: none; }
#service-outline li { display: grid; min-width: 0; }
#service-outline li > span:first-child { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--sp-4); min-width: 0; }
#service-outline .text-action { flex: none; margin-inline-start: calc(-1 * var(--sp-12)); }
/* 예배 자막 조작 줄: 고치는 묶음(초안 저장·미리보기)과 만드는 묶음(파일 만들기·최종 확정) 사이를 한 칸 더 띄운다. */
/* 저장·미리보기와 만들기·확정 사이를 한 칸 띄운다(넓은 화면에서만 — 좁은 화면에서 줄이 바뀌면 둘째 줄이 들여쓰기처럼 보인다). */
@media (min-width: 821px) { #export-service-slides { margin-inline-start: var(--sp-8); } }
#service-screens label { display: inline-flex; align-items: center; }
#bulletin-feedback { margin: 0; }
#bulletin-feedback.warn { color: var(--c-warn); }
/* 원고 대화상자의 이름표 목록: 이름표는 먹 글자로 두드러지고, 하나가 줄 끝에서 둘로 갈리지 않는다. */
#weekly-source-help > span { color: var(--c-text); white-space: nowrap; }
#cards-actions { margin-block-end: var(--sp-8); }
#cards-status { overflow-wrap: anywhere; }
.online-bulletin-gallery { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); grid-template-rows: auto 1fr;
  grid-template-areas: "pages editor" "preview editor"; align-items: start; gap: var(--sp-16) var(--sp-32); margin-block-start: var(--sp-16); overflow-anchor: none; }
.online-bulletin-tabs { grid-area: pages; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-8); }
.online-bulletin-tab { flex-direction: column; justify-content: flex-start; gap: var(--sp-4); padding: var(--sp-8) var(--sp-4);
  color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); }
/* 고른 장: 옅은 면만으로는 보이지 않는다(1.15:1) — 조각 전환과 같이 굵은 글자와 3:1 테두리를 더한다. */
.online-bulletin-tab[aria-selected="true"] { background: var(--c-bg-3); color: var(--c-text); font-weight: var(--w-strong); box-shadow: inset 0 0 0 1px var(--c-edge); }
.online-bulletin-tab[aria-selected="true"]:focus-visible { box-shadow: var(--focus-ring); }
/* 장 이름 아래 한 줄: 비어 있음(보조 글자) · 입력됨(먹 글자). 굵기는 고른 탭에서도 400. */
.online-page-state { min-block-size: var(--lh-meta); color: var(--c-text-2); font-weight: var(--w-body); }
.online-page-state[data-filled="true"] { color: var(--c-text); }
.online-bulletin-thumbnail { display: block; width: min(100%, 60px); aspect-ratio: 4 / 5; border-radius: var(--r-chip); overflow: hidden; background: var(--c-bg-3); }
.online-bulletin-thumbnail img { display: block; width: 100%; height: auto; }
.online-bulletin-preview { grid-area: preview; min-width: 0; }
/* 좁은 화면에서만: 편집칸 위에서 아래의 확대 사진으로 가는 버튼(순서는 썸네일 · 편집 · 확대 사진 그대로). */
#jump-card-preview { display: none; grid-area: jump; justify-self: start; }
#online-cover-empty .text-action { margin-inline-start: calc(-1 * var(--sp-12)); }
.online-bulletin-preview { scroll-margin-block-start: var(--sp-16); }
[data-online-editor] { grid-area: editor; min-width: 0; }
.online-editor-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--sp-4) var(--sp-12); }
/* 넓은 화면에서는 썸네일과 같은 왼쪽 선에서 시작하고, 좁은 화면(한 단)에서는 가운데에 둔다. */
.online-bulletin-photo { width: min(100%, 360px, 44dvh); margin-inline: 0 auto; }
.online-bulletin-photo:empty::before { content: ""; display: block; aspect-ratio: 4 / 5; background: var(--c-bg-3); }
.online-bulletin-photo figure { margin: 0; }
.online-bulletin-photo canvas { display: block; width: 100%; height: auto; }
.online-bulletin-photo figcaption { margin-block: var(--sp-8); }
.online-bulletin-photo figure:only-child figcaption { display: none; }
.online-bulletin-photo figure + figure { margin-block-start: var(--sp-12); }
#online-songs-editor-host { margin-block-start: var(--sp-12); }
/* 온라인 주보 안에 옮겨 심긴 곡 목록 저장: 이 화면의 주요 버튼은 '최종 확정' 하나라, 다른 두 탭의 저장 버튼과 같은 조작 줄 기본 버튼으로 둔다. */
#online-songs-editor-host #save-post-list:not(:disabled) { background: var(--btn-bg); color: var(--c-text); }
#online-songs-editor-host #save-post-list:active:not(:disabled) { background: var(--btn-bg-hover); }
@media (hover: hover) { #online-songs-editor-host #save-post-list:hover:not(:disabled) { background: var(--btn-bg-hover); } }

/* 자료함 */
.library-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-12) var(--sp-24); margin-block-end: var(--sp-16); }
.library-toolbar-actions { display: flex; flex: 1; align-items: center; justify-content: flex-end; gap: var(--sp-8); min-inline-size: 0; }
#file-search { flex: 0 1 20rem; min-inline-size: 0; }
#library-upload { flex: none; white-space: nowrap; }
.library-upload-inactive { visibility: hidden; }
#backup-link, #invite-hint > a { display: flex; align-items: center; min-height: var(--h-control); padding-inline: var(--sp-12); border-radius: var(--r-control); color: var(--c-text); }
/* 백업 상태 한 줄: 위 항목과 같은 안쪽 여백, 항목 사이(·)에서만 줄이 바뀐다. */
#ops-status, #ops-notes > p, #invite-hint > p { inline-size: min(18rem, 70vw); padding: 0 var(--sp-12) var(--sp-8); white-space: normal; overflow-wrap: anywhere; }
#invite-hint > p { padding-block: var(--sp-8) 0; border-block-start: 1px solid var(--c-line); }
#ops-status > span { white-space: nowrap; }
#ops-status > span.warn { color: var(--c-warn); }
/* 백업 경고: 정리 보류는 주의 색 글자. 넣지 않은 파일 안내는 보조 글자 그대로. */
#ops-notes > p.warn { color: var(--c-warn); }
.library-period { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); min-inline-size: 0; margin-block-end: var(--sp-24); }
#file-month { flex: none; width: auto; max-width: 100%; }
/* 주차 고르기: 위 '주간 자료/휴지통'과 같은 조각 전환 띠(3 참조) — 고르지 않은 주도 띠 안의 조각이라 조작부로 보인다. */
.library-weeks { flex: 0 1 auto; flex-wrap: wrap; min-inline-size: 0; max-inline-size: 100%; }
.library-weeks button { font-variant-numeric: tabular-nums; }
#file-final { margin-block-end: var(--sp-32); }
/* 자료함의 글·목록은 구획 제목과 같은 왼쪽 선에서 시작한다(행을 안쪽으로 들이지 않는다). */
#view-files :is(.row, #file-columns) { padding-inline: 0; }
#file-final-list:not(:has(> .empty)) { border-block-start: 1px solid var(--c-line); }
/* 주간 결과물: 그 주에 있어야 할 줄. 완료한 줄은 굵은 이름 + 받기, 아직 없는 줄은 보조색 이름 + '아직 없음' + 만들러 가기. */
.result-file, .result-missing { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4) var(--sp-16);
  min-height: var(--h-row); min-inline-size: 0; padding-block: var(--sp-4); border-block-end: 1px solid var(--c-line); }
.result-file > strong { flex: 1 1 9rem; min-inline-size: 0; overflow-wrap: anywhere; }
/* 받기 조작은 안쪽 여백(12px)만큼 양옆으로 당긴다: 오른쪽 끝의 글자가 '만들러 가기'와 같은 선에 오고,
   좁은 화면에서 아랫줄로 내려가거나 이름 없이 조작으로 시작하는 줄(첨부)은 글자가 왼쪽 선에서 시작한다. 위아래 여백은 행이 갖는다. */
.result-file > .actions { min-inline-size: 0; margin-inline: calc(-1 * var(--sp-12)); padding-block: 0; }
.result-missing { flex-wrap: nowrap; }
.result-name { flex: 1 1 auto; min-inline-size: 0; color: var(--c-text-2); overflow-wrap: anywhere; }
.result-missing > :is(.result-state, a) { flex: none; white-space: nowrap; }
#file-final a:not([class]) { display: inline-flex; align-items: center; min-height: var(--h-control); }
.publish-share-actions { margin-block: var(--sp-12); }
#file-final[data-searching] .publish-share-actions,
#file-final .publish-share-actions:has(button[hidden]):has([role="status"]:empty) { display: none; }
#uploaded-files .version-group { padding-block: 0; }
#file-trash-actions { display: flex; justify-content: flex-end; }
.library-row { display: grid; grid-template-columns: minmax(130px, 2fr) minmax(80px, .8fr) 112px 80px 136px; align-items: center; column-gap: var(--sp-12); min-width: 0; }
.library-row > * { display: flex; align-items: center; gap: var(--sp-8); min-width: 0; }
#file-columns { min-height: var(--sp-32); padding-inline: var(--sp-8); border-block-end: 1px solid var(--c-line); color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); }
#file-list { border-block-start: 0; }
.library-week, .library-size { color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); font-variant-numeric: tabular-nums; }
.library-actions { justify-content: flex-end; }
.library-actions button { font-weight: var(--w-body); }

/* 내 계정 · 로그인 안내 */
#google-account, #public-account { position: relative; }
:is(#google-account, #public-account) > summary { padding-inline: var(--sp-4) var(--sp-8); color: var(--c-text-2); font-size: var(--fs-meta); line-height: var(--lh-meta); white-space: nowrap; }
#public-access-admin { display: inline-flex; align-items: center; min-height: var(--h-control); color: var(--c-accent-strong);
  font-size: var(--fs-meta); line-height: var(--lh-meta); font-weight: var(--w-strong); white-space: nowrap; }
.account-options { display: grid; gap: var(--sp-8); width: min(280px, 80vw); max-height: 65dvh; padding: var(--sp-16); overflow: auto; overscroll-behavior: contain; }
.account-options p:empty { display: none; }
.account-options h2 { font-size: var(--fs-body); line-height: var(--lh-body); }
.account-options button { justify-self: start; margin-inline-start: calc(-1 * var(--sp-12)); }
.account-member { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-8); padding-block: var(--sp-8); border-block-end: 1px solid var(--c-line); }
.account-member strong { flex-basis: 100%; overflow-wrap: anywhere; }
#public-account-name, #google-email { overflow-wrap: anywhere; }
/* 판 번호: 화면 맨 아래 작은 한 줄. */
#app-version { padding: var(--sp-8) var(--sp-12) var(--sp-4); border-block-start: 1px solid var(--c-line); }
/* 안내 띠(초대받아 처음 들어온 사람에게 한 번): 눌린 면 위 한 묶음, 닫기는 오른쪽. */
.notice { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 var(--sp-12);
  margin-block-start: var(--sp-16); padding: var(--sp-8) var(--sp-8) var(--sp-8) var(--sp-16); border-radius: var(--r-control); background: var(--c-bg-2); }
.notice > * { grid-column: 1; }
.notice > button { grid-column: 2; grid-row: 1 / span 3; }
/* 백업 문제 알림(관리자에게만, 문제가 있을 때만): 같은 안내 띠. 닫기가 없어 오른쪽 여백을 왼쪽과 맞춘다. */
#ops-alert { padding-inline-end: var(--sp-16); overflow-wrap: anywhere; }

/* 로그인 전 화면(로그인 안내 · 초대받은 사람의 첫 화면): 가운데 한 단, 한 화면, 주요 버튼 하나.
   위 여백은 안쪽 여백으로 준다 — 바깥 여백이면 body 밖으로 새어 세로 스크롤이 생긴다. */
.account-page { display: grid; align-content: start; justify-items: start; gap: var(--sp-8);
  width: min(100% - 2 * var(--page-gutter), 400px); margin-inline: auto; padding-block: 16vh var(--sp-32); overflow-wrap: anywhere; }
.account-page > .small:first-child { margin-block-end: calc(-1 * var(--sp-4)); }
.account-page > .actions, .account-page > button { margin-block-start: var(--sp-16); }
.account-page #access-message:empty { display: none; }

/* 팀원 초대: 운영 화면과 같은 단. 구획은 여백 32px + 구획 제목, 사람은 목록 행. */
.access-admin > :is(form, section) { margin-block-end: var(--sp-32); }
.access-admin .row-main strong { display: block; overflow-wrap: anywhere; }
/* 전체 복사는 보조 동작: 사람별 목록 아래에, 무엇을 복사하는지 한 줄과 함께. */
.copy-all-row { margin-block-start: var(--sp-12); }
.copy-all-row .small { flex: 1 1 12rem; min-inline-size: 0; }
/* 초대를 열 수 없을 때: 빈 상태 틀에 이유(16px)와 켜는 순서(13px 목록). */
.access-off { gap: var(--sp-8); max-width: 640px; padding-inline: 0; overflow-wrap: anywhere; }
.access-off > p:first-child { color: var(--c-text); }
.access-off ol { display: grid; gap: var(--sp-4); margin: 0; padding-inline-start: var(--sp-24); }
.access-admin .row .actions { flex: none; gap: var(--sp-4); }
.access-admin .row .actions :is(button, a) { font-weight: var(--w-body); }
#invite-text { margin-block-start: var(--sp-12); }
#invite-note { margin-block-end: var(--sp-8); }
/* 팀원 접속의 상태 칩과 그 뒤에 붙는 말(마지막 접속·기한): 칩과 글 사이를 한 칸 띄운다. */
.access-state[data-state] { margin-inline-end: var(--sp-4); white-space: nowrap; }

/* ── 5. 좁은 화면 (분기점: 1100 · 820 · 600) ───────────── */
@media (min-width: 1100px) {
  #view-slides.has-song-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(385px, 46%); gap: var(--sp-32); align-items: start; }
  #song-panel { position: sticky; top: var(--sp-16); display: flex; flex-direction: column; max-height: calc(100dvh - 2 * var(--sp-16));
    margin: 0; padding: 0 0 0 var(--sp-32); border-block-start: 0; border-inline-start: 1px solid var(--c-line); }
  .song-panel-body { overflow: auto; scrollbar-gutter: stable; }
}
@media (max-width: 820px) {
  .mast-inner { display: block; width: 100%; }
  .workspace-header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8); min-height: var(--sp-32); padding-inline: var(--page-gutter); }
  .brand { font-size: var(--fs-meta); line-height: var(--lh-meta); }
  :is(#google-account, #public-account) > summary, #public-access-admin { margin-block: -6px; }
  .mast nav a { flex: 1 1 auto; min-width: 44px; padding-inline: var(--sp-4); }
  /* 화면 머리: 컴퓨터(위 32 · 아래 24)와 같은 위계로 절반 — 상단 탭과 제목 사이 16, 제목 묶음과 본문 사이 12. */
  .weekbar { gap: var(--sp-4) var(--sp-16); margin-block: var(--sp-16) var(--sp-12); }
  .weekbar-title:has(#event-summary:not([hidden])) { margin-block-end: var(--sp-12); }
  .week-selector { flex: 1 1 100%; flex-wrap: wrap; justify-content: space-between; }
  #week-context, #current { padding-inline: var(--sp-8); }
  #week-context { margin-inline-start: calc(-1 * var(--sp-8)); }
  .weekbar > .page-action, #event-actions { margin-inline-start: auto; }
  /* 행사 상세의 [편집][삭제]: 제목 길이와 상관없이 늘 요약 줄(날짜 · 장소) 아래 한 줄, 오른쪽 끝. */
  #event-actions { flex-basis: 100%; justify-content: flex-end; }
  dialog, #editor[data-presentation] { position: fixed; inset: auto 0 0; width: 100%; max-width: 100%; height: auto; max-height: 90dvh; margin: 0;
    padding: var(--sp-24) var(--sp-16) max(var(--sp-16), env(safe-area-inset-bottom)); border: 0; border-radius: var(--r-surface) var(--r-surface) 0 0; }
  /* 담당자 선택도 다른 시트와 같은 틀: 안쪽 여백 24 · 16, 제목 20px. */
  #assignee-picker { inset: auto 0 0 !important; width: 100%; max-height: 85dvh;
    padding: var(--sp-24) var(--sp-16) max(var(--sp-16), env(safe-area-inset-bottom)); }
  .assignee-head h2 { font-size: var(--fs-head); line-height: var(--lh-head); }
  body:has(#assignee-picker:modal) #editor:modal { visibility: hidden; }
  #assignee-picker::backdrop { background: var(--c-backdrop); }
  /* 편집 시트: 칸만 굴리고 [취소][저장] 줄은 굴리는 영역 밖에 둔다(옆 편집 창과 같은 방식) — 줄이 시트 아래끝까지 덮어 그 밑으로 입력칸이 비치지 않는다.
     줄 위의 가는 선이 잘린 칸과의 경계다. */
  #editor[data-presentation][open] { display: flex; flex-direction: column; overflow: hidden; }
  #editor[data-presentation] #editor-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; height: auto; }
  #editor[data-presentation] #editor-fields { flex: 1 1 auto; min-height: 0; overflow: auto; margin: -3px; padding: 3px; }
  #editor[data-presentation] .editor-actions { flex: none; margin-block-start: 0; padding-block-start: var(--sp-8); border-block-start: 1px solid var(--c-line); }
  /* 콘티 붙여넣기 시트도 같다: 버튼 줄 위의 가는 선이 굴러 잘린 미리 읽기와의 경계다. */
  #conti-form > .actions { margin-block-start: 0; padding-block-start: var(--sp-8); border-block-start: 1px solid var(--c-line); }
  body.task-panel-open main.wrap { width: min(100% - 2 * var(--page-gutter), var(--page-max)); margin-inline: auto; }
  .checklist-heading h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .week-tasks { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0 var(--sp-4); }
  .checklist-heading, .task-toolbar, .week-actions { display: contents; }
  .checklist-progress { grid-area: 1 / 1; }
  #week-completion-meter { display: none; }
  /* 첫 줄: 진행 문구 · 마감 요약 복사 · 직책 필터. 카톡방에 붙이는 복사는 휴대폰에서 가장 자주 쓰므로 목록 위에 둔다. */
  #copy-deadline-summary { grid-area: 1 / 2; margin-block: -4px; }
  #task-scope-toggle { grid-area: 1 / 3; margin-block: -4px; }
  #task-filters { grid-area: 2 / 1 / 3 / 4; justify-self: start; }
  .week-actions [data-new="entry"] { grid-area: 2 / 1 / 3 / 4; justify-self: end; }
  .work-database { grid-area: 3 / 1 / 4 / 4; margin-block-start: var(--sp-4); }
  /* 건수 줄과 반복 설정(가끔 쓰는 설정)이 목록 아래 한 줄을 나눠 쓴다. 건수 줄은 제 글자 폭만 차지하고, 버튼이 위에 놓여 늘 눌린다. */
  .week-progress-label { grid-area: 4 / 1 / 5 / 4; align-self: center; justify-self: start; }
  #open-rules { grid-area: 4 / 1 / 5 / 4; justify-self: end; position: relative; z-index: 1; }
  #event-task-group { grid-area: 5 / 1 / 6 / 4; min-width: 0; }
  .agenda-day { grid-template-columns: 76px minmax(0, 1fr); }
  /* 좁은 화면: 항목이 바로 옆에 보이므로 건수는 숨긴다(날짜 아래로 줄이 바뀌지 않게). */
  #week-agenda:not([data-focus-day]) .agenda-day-count { display: none; }
  #event-actions { margin-block-end: var(--sp-24); }
  .agenda-tools .calendar-views { display: flex; flex: 1; }
  .agenda-tools .calendar-views button { flex: 1; }
  #week-agenda[data-focus-day] .agenda-day-trigger { flex-direction: column; align-items: center; gap: 0; padding: var(--sp-4) 0; }
  /* 320px 에서 한 칸이 41px 다 — 날짜(11.25)가 두 줄로 꺾이지 않게 좌우 여백을 없애고 한 줄로 둔다. */
  #week-agenda[data-focus-day] .agenda-day-trigger time { white-space: nowrap; }
  #week-agenda[data-focus-day] .agenda-day-count { display: none; }
  /* 그날 보기의 요일 띠: 건수 대신 날짜 아래 6px 점(월간과 같은 표시 — 최대 3개, 행사는 속이 빈 고리). */
  #week-agenda[data-focus-day] .agenda-day-dots { display: flex; justify-content: center; gap: 3px; min-height: 6px; margin-block-start: 2px; }
  .agenda-day-dots > span { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c-text-2); }
  .agenda-day-dots > [data-kind="event"] { border: 1.5px solid var(--c-accent-strong); background: transparent; }
  .month-day-trigger { min-height: var(--h-row); }
  #year-agenda-months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .workspace-tools { margin-inline: calc(-1 * var(--page-gutter)); padding-inline: var(--page-gutter); }
  .workspace-tools a { font-size: var(--fs-body); line-height: var(--lh-body); }
  #view-workspace[data-landing="true"] .workspace-tools { margin-inline: 0; padding-inline: 0; }
  .online-bulletin-gallery { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "pages" "jump" "editor" "preview"; }
  #jump-card-preview { display: inline-flex; }
  .online-bulletin-photo { margin-inline: auto; }
  .library-controls { display: grid; grid-template-columns: minmax(0, 1fr); }
  .library-views { justify-self: start; }
  #file-search { flex: 1 1 auto; }
  .library-weeks { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .library-weeks::-webkit-scrollbar { display: none; }
  .library-weeks button { flex: none; }
  #file-columns { display: none; }
  #file-list { border-block-start: 1px solid var(--c-line); }
  .library-row { grid-template-columns: auto auto minmax(0, 1fr); gap: 0 var(--sp-8); padding-block: var(--sp-8); }
  .library-name { grid-area: 1 / 1 / 2 / -1; }
  .library-actions { grid-area: 3 / 1 / 4 / -1; }
  .projection p { font-size: var(--fs-body); line-height: var(--lh-body); }
  /* 찬양 자막의 곡 목록: 두 줄 행 — 1줄 번호 + 제목(행의 폭 전부), 2줄 상태 칩과 곡별 점검(주간 작업의 휴대폰 행과 같은 틀). */
  #song-list .row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 var(--sp-8); }
  #song-list .song-row-tools { grid-column: 2; justify-content: flex-start; }
  #song-list .song-row-tools > button { margin-inline-start: auto; }
  #feedback, .toast { --toast-gap: calc(env(safe-area-inset-bottom, 0px) + var(--sp-16)); }
  /* 회의록을 쓰는 동안에는 키보드 위 서식 막대(45px) 위에 뜬다. */
  body:has(.mn-touch-toolbar) #feedback { --toast-clear: 45px; }
}
@media (max-width: 600px) {
  /* 일정은 6px 점(최대 3개)으로, 숫자 아래 가운데에 모은다(한 개여도 가운데). 점은 장식이고, 행사는 속이 빈 고리로 모양을 달리한다. */
  .month-cell { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 3px; min-height: 0; padding: 0 0 var(--sp-8); }
  .month-day-trigger { flex: 0 0 100%; justify-content: center; }
  .month-entry { flex: none; width: 6px; min-height: 0; height: 6px; padding: 0; border-radius: 50%; background: var(--c-text-2); box-shadow: none; pointer-events: none; }
  .month-entry[data-kind="event"] { background: transparent; border: 1.5px solid var(--c-accent-strong); box-shadow: none; }
  /* 특별한 예배(찬양예배·아날로그)는 점이 아니라 짧은 막대다 — 모양으로 가른다. */
  .month-entry[data-kind="service"] { width: 12px; border-radius: 3px; background: var(--c-accent-strong); }
  .month-more { display: none; }
  .month-weekdays { text-align: center; }
  .month-weekdays span { padding-inline-start: 0; }
  .month-entry-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .month-cell > .month-entry:nth-of-type(n + 5) { display: none; }
  .field-pair { grid-template-columns: 1fr; }
  .row { flex-wrap: wrap; }
  .row .actions { margin-inline-start: auto; }
  /* 좁은 화면의 줄: 이름 줄 아래에 조작 줄(조작이 이름을 몇 글자 폭으로 밀어내지 않게). */
  :is(.access-admin, .rule-row) .row-main { flex-basis: 100%; }
  /* 도구 화면의 작업 파일: 아랫줄로 내려간 조작은 안쪽 여백만큼 당겨, 받기 글자가 줄 제목과 같은 왼쪽 선에서 시작한다.
     조작 사이는 저마다의 안쪽 여백으로 띄운다(가로 틈 0) — 틈까지 더하면 390 폭에서 메뉴(⋯)만 혼자 아랫줄로 떨어진다. */
  section[id^="view-"]:not(#view-files, #view-music) > #workspace-versions .version-row > .publication-downloads { flex-basis: 100%; margin-inline-start: calc(-1 * var(--sp-12)); column-gap: 0; }
  .account-page > .actions, .account-page > .actions > *, .account-page > .actions form button, .account-page > button { width: 100%; }
}

/* ── 6. 움직임: hover·눌림에만 120ms. 등장 애니메이션 없음 ── */
@media (prefers-reduced-motion: no-preference) {
  button, a, summary, .row, input, select, textarea { transition: background-color var(--t-fast) ease-out, color var(--t-fast) ease-out, border-color var(--t-fast) ease-out; }
}
@media (forced-colors: active) {
  :focus-visible { outline: 2px solid Highlight; outline-offset: 2px; }
}
