/* 우림교회 관리(주보실): 공개 사이트와 같은 색 역할(흰색에 옅은 쿨톤 그린을 섞은 바탕·로고 그린 계열)을 쓰되,
   매주 고치는 일(영상·소식·예배 시간)에 맞춘 작업대 구성 */
@font-face { font-family: "SUIT"; src: url("/assets/fonts/SUIT-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --paper: #f3faf7; --paper-2: #e4f2ec; --card: #ffffff; --ink: #1d2a27; --muted: #55625e; --line: rgba(24, 52, 46, .13);
  --brand: #0b6b60; --brand-deep: #0a4a43; --teal: #17a99a; --mint: #9ad9ce; --lime: #e6fd67; --danger: #a3332a;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "SUIT", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; font-size: 16px; line-height: 1.6; word-break: keep-all; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.boot { padding: 40px; color: var(--muted); }

/* 버튼 */
.btn, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; transition: background-color .2s, color .2s, border-color .2s, transform .15s; }
.btn { border: 0; background: var(--brand); color: #fff; }
.btn:hover { background: var(--brand-deep); }
.btn:active, .btn-ghost:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.danger { background: var(--danger); }
.btn-ghost { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-ghost.danger:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--paper); font-size: 24px; line-height: 1; cursor: pointer; }

/* 들어가기 */
.gate { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); /* 칸 너비를 화면에 고정: 카드의 min(100%, 420px) 가 화면 기준이 되게 */ place-items: center; padding: 24px; background:
  radial-gradient(50% 50% at 90% 0%, rgba(23, 169, 154, .14), transparent 70%), radial-gradient(40% 50% at 0% 100%, rgba(186, 236, 222, .32), transparent 70%), var(--paper); }
.gate-card { width: min(100%, 420px); display: grid; gap: 12px; padding: 36px 32px; border-radius: 28px; background: var(--card); box-shadow: 0 0 0 1px var(--line), 0 30px 60px -36px rgba(34, 39, 42, .5); animation: rise .6s var(--ease-out) both; }
.gate-card img { width: 150px; }
.gate-card h1 { font-size: 26px; letter-spacing: -.03em; margin-top: 8px; }
.gate-card p { color: var(--muted); font-size: 15px; }
.gate-card label { margin-top: 10px; font-weight: 700; font-size: 14px; }
.gate-card input { height: 50px; min-width: 0; /* 입력칸 기본 너비가 좁은 화면 카드를 밀어내지 않게 */ padding: 0 16px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; }
.gate-card .btn { margin-top: 6px; }
.back-link { justify-self: center; margin-top: 6px; color: var(--muted); font-size: 14px; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* 작업대 */
.app { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .app { grid-template-columns: 248px 1fr; } }
.rail { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 16px; background: var(--brand-deep); color: #fff; }
@media (min-width: 900px) { .rail { height: 100vh; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; padding: 24px 16px; } }
.rail-brand { display: block; padding: 8px 10px; border-radius: 14px; background: var(--card); width: 108px; }
@media (min-width: 900px) { .rail-brand { width: auto; padding: 14px 16px; } }
.rail-title { font-weight: 800; font-size: 13px; letter-spacing: .14em; color: var(--mint); }
@media (min-width: 900px) { .rail-title { margin: 22px 10px 10px; } }
.rail-nav { display: flex; gap: 4px; width: 100%; overflow-x: auto; order: 3; scrollbar-width: none; }
@media (min-width: 900px) { .rail-nav { flex-direction: column; order: 0; } }
.rail-nav a { position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; color: rgba(255,255,255,.82); text-decoration: none; font-weight: 700; white-space: nowrap; transition: background-color .2s, color .2s; }
.rail-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.rail-nav a[aria-current] { background: var(--card); color: var(--brand-deep); }
.rail-nav a b { margin-left: auto; min-width: 26px; padding: 0 7px; border-radius: 99px; background: rgba(154, 217, 206, .18); color: var(--mint); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.rail-nav a[aria-current] b { background: rgba(13, 91, 82, .1); color: var(--brand); }
.ri { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid currentColor; opacity: .85; }
.ri-play { border-radius: 5px; } .ri-news { border-radius: 4px; border-width: 2px 2px 6px; } .ri-clock { border-style: solid; } .ri-pen { border-radius: 2px 50% 2px 50%; }
.rail-foot { display: flex; gap: 6px; margin-left: auto; }
@media (min-width: 900px) { .rail-foot { margin: auto 0 0; flex-direction: column; } }
.rail-foot .btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
.rail-foot .btn-ghost:hover { border-color: var(--mint); color: var(--mint); }

.work { padding: clamp(20px, 4vw, 48px); outline: none; min-width: 0; }
.panel.is-in .panel-head, .panel.is-in .rows, .panel.is-in .board, .panel.is-in .card { animation: rise .5s var(--ease-out) both; }
.panel.is-in .rows, .panel.is-in .board, .panel.is-in .card { animation-delay: .06s; }
.panel-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.kicker { font-size: 13px; font-weight: 800; color: var(--brand); letter-spacing: .02em; }
.panel-head h1 { margin-top: 6px; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.03em; line-height: 1.3; max-width: 22em; }

/* 목록 */
.rows { display: grid; gap: 10px; }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.list-tools input, .list-tools select { height: 42px; min-width: 0; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; }
.list-tools input { flex: 1 1 220px; }
.list-shown { color: var(--muted); font-size: 13px; }
.more { display: block; margin: 14px auto 0; }
.form-note { margin: 4px 0 12px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "a b c" "d d d"; align-items: center; gap: 10px 16px; padding: 14px 16px; border-radius: 18px; background: var(--card); box-shadow: 0 0 0 1px var(--line); animation: rise .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); transition: box-shadow .3s, opacity .28s, transform .28s; }
@media (min-width: 760px) { .row { grid-template-areas: "a b c d"; grid-template-columns: auto minmax(0, 1fr) auto auto; } }
.row-thumb { grid-area: a; width: 112px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: linear-gradient(150deg, #2b3330, #1d2220); }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-thumb img.is-broken, .yt-preview img.is-broken { visibility: hidden; }
.row-date { grid-area: a; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; min-width: 6.4em; }
.row-main { grid-area: b; display: grid; min-width: 0; }
.row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .tag { grid-area: c; }
.row-act { grid-area: d; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.tag { display: inline-flex; padding: 1px 9px; border-radius: 99px; font-size: 12px; font-weight: 800; }
.tag.on { background: rgba(23, 169, 154, .14); color: var(--brand); }
.tag.off { background: var(--paper-2); color: var(--muted); }
.tag.pin { background: var(--brand); color: #fff; }
.is-saved { box-shadow: 0 0 0 2px var(--teal), 0 0 0 8px rgba(23, 169, 154, .12) !important; }
.is-leaving { opacity: 0; transform: translateX(24px); }
.rows-empty { display: grid; justify-items: center; gap: 4px; padding: 48px 20px; border: 1.5px dashed var(--line); border-radius: 18px; text-align: center; }
.rows-empty span { color: var(--muted); font-size: 14px; }

/* 예배 시간: 주보처럼 세 칸 */
.board { display: grid; gap: 14px; }
@media (min-width: 1100px) { .board { grid-template-columns: repeat(3, 1fr); } }
.board-col { padding: 18px; border-radius: 20px; background: var(--card); box-shadow: 0 0 0 1px var(--line); }
.board-col h2 { padding-bottom: 10px; margin-bottom: 6px; border-bottom: 2px solid var(--teal); font-size: 15px; color: var(--brand); }
.slot { display: grid; grid-template-columns: 4.6em 1fr; gap: 4px 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); animation: rise .45s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); transition: box-shadow .3s; border-radius: 10px; }
.slot b { font-variant-numeric: tabular-nums; color: var(--brand-deep); }
.slot > span:not(.row-act) { display: grid; font-weight: 700; }
.slot small { font-weight: 500; color: var(--muted); }
.slot .row-act { grid-column: 1 / -1; justify-content: flex-start; }
.slot.is-off { opacity: .55; }
.board-empty { color: var(--muted); font-size: 14px; padding: 12px 4px; }

/* 서랍 편집 */
.drawer-wrap { position: fixed; inset: 0; z-index: 30; }
.drawer-dim { position: absolute; inset: 0; background: rgba(20, 23, 22, .45); opacity: 0; transition: opacity .3s; }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(100%, 560px); display: flex; flex-direction: column; background: var(--card); box-shadow: -30px 0 60px -30px rgba(0,0,0,.4); transform: translateX(100%); transition: transform .38s var(--ease-out); }
.drawer-wrap.is-open .drawer { transform: none; }
.drawer-wrap.is-open .drawer-dim { opacity: 1; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 20px; }
.drawer .sheet-form { flex: 1; overflow-y: auto; padding: 22px; }
body.drawer-open { overflow: hidden; }

.sheet-form { display: grid; gap: 16px; align-content: start; }
.card { padding: clamp(20px, 3vw, 30px); border-radius: 22px; background: var(--card); box-shadow: 0 0 0 1px var(--line); max-width: 760px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 700; font-size: 14px; }
.field label small { font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13, 91, 82, .14); }
[aria-invalid="true"] { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(163, 51, 42, .12) !important; }
.field-msg, .form-error { color: var(--danger); font-size: 13px; font-weight: 700; min-height: 0; }
.field-msg:empty, .form-error:empty { display: none; }
.field-row { display: grid; gap: 16px; }
@media (min-width: 520px) { .field-row { grid-template-columns: 1fr 1fr; } }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.checks { display: flex; flex-wrap: wrap; gap: 18px; }
.form-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.yt-preview { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: var(--paper); animation: rise .35s var(--ease-out) both; }
.yt-preview img { border-radius: 8px; aspect-ratio: 16 / 9; object-fit: cover; background: #1d2220; }
.yt-preview span { font-size: 14px; color: var(--muted); }

/* 확인창 · 알림 */
.confirm { width: min(92vw, 420px); padding: 26px; border: 0; border-radius: 22px; background: var(--card); box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); }
.confirm::backdrop { background: rgba(20, 23, 22, .45); }
.confirm h2 { font-size: 20px; margin-bottom: 8px; }
.confirm p { color: var(--muted); margin-bottom: 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 40; max-width: min(92vw, 560px); padding: 14px 20px; border-radius: 16px; background: var(--brand-deep); color: #fff; font-weight: 700; box-shadow: 0 20px 40px -20px rgba(0,0,0,.5); opacity: 0; transform: translate(-50%, 16px); transition: opacity .3s, transform .4s var(--ease-out); }
.toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--danger); }
.toast a { color: var(--mint); margin-left: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}

/* 첫 로그인 비밀번호 변경 · 계정 */
.gate-step { justify-self: start; padding: 2px 10px; border-radius: 99px; background: rgba(23, 169, 154, .14); color: var(--brand); font-size: 12px; font-weight: 800; }
.gate-card .field { gap: 4px; }
.gate-card .field label { margin-top: 4px; }
.gate-card .field-msg { margin-top: 2px; }
.gate-card .btn-ghost { margin-top: -4px; }
.pw-rules { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--paper); font-size: 13px; color: var(--muted); }
.pw-rules li { position: relative; padding-left: 22px; transition: color .25s; }
.pw-rules li::before { content: ""; position: absolute; left: 0; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .6; transition: background-color .25s, border-color .25s, transform .3s var(--ease-out); }
.pw-rules li.is-ok { color: var(--brand); font-weight: 700; }
.pw-rules li.is-ok::before { opacity: 1; background: var(--teal); border-color: var(--teal); transform: scale(1.05); }
.ri-key { border-radius: 50% 50% 50% 2px; }
.muted { color: var(--muted); font-size: 14px; }

/* 비밀번호 보기/숨기기: 기본은 숨김. 누르면 글자로 보이고 단추가 ‘숨기기’로 바뀐다 */
.pw-wrap { position: relative; display: grid; }
.pw-wrap input { width: 100%; padding-right: 92px !important; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 11px; border: 0; border-radius: 10px; background: var(--paper); color: var(--brand); font-size: 13px; font-weight: 800; cursor: pointer; transition: background-color .2s, color .2s; }
.pw-toggle:hover { background: var(--paper-2); }
.pw-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.pw-toggle .slash { stroke-dasharray: 23; stroke-dashoffset: 23; transition: stroke-dashoffset .3s var(--ease-out); }
.pw-toggle[aria-pressed="true"] { background: var(--brand); color: #fff; }
.pw-toggle[aria-pressed="true"] .slash { stroke-dashoffset: 0; }

/* 레일 아이콘 추가분 */
.ri-home { border-radius: 3px 3px 5px 5px; border-top-width: 5px; }
.ri-menu { border-radius: 2px; border-width: 2px 0; height: 12px; }
.ri-photo { border-radius: 5px; box-shadow: inset 0 -5px 0 -2px currentColor; }

/* 홈 화면 편집 */
.panel-lead { margin: -8px 0 18px; max-width: 46em; color: var(--muted); font-size: 15px; }
.panel-lead b { color: var(--ink); }
.group-jump { position: sticky; top: 0; z-index: 3; display: flex; gap: 6px; margin: 0 calc(clamp(20px, 4vw, 48px) * -1) 18px; padding: 10px clamp(20px, 4vw, 48px); overflow-x: auto; scrollbar-width: none; background: linear-gradient(var(--paper) 70%, rgba(243, 250, 247, 0)); }
.jump-chip { flex: none; min-height: 36px; padding: 0 14px; border: 0; border-radius: 99px; background: var(--card); box-shadow: 0 0 0 1px var(--line); font-size: 13px; font-weight: 700; cursor: pointer; transition: box-shadow .2s, color .2s; }
.jump-chip:hover { box-shadow: 0 0 0 1.5px var(--brand); color: var(--brand); }
.cgroups { display: grid; gap: 18px; }
.cgroup { max-width: 860px; scroll-margin-top: 70px; transition: box-shadow .3s; }
.cgroup.is-dirty { box-shadow: 0 0 0 1.5px var(--teal); }
.cgroup.is-saved { box-shadow: 0 0 0 2px var(--teal), 0 0 0 8px rgba(23, 169, 154, .12); }
.cgroup-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 4px; }
.cgroup-head h2 { font-size: 20px; letter-spacing: -.02em; outline: none; }
.cgroup-fields { display: grid; gap: 16px; margin: 12px 0 4px; }
@media (min-width: 760px) { .cgroup-fields { grid-template-columns: 1fr 1fr; column-gap: 20px; } .cgroup-fields > .img-field, .cgroup-fields > .links-field, .cgroup-fields > .field:has(textarea) { grid-column: 1 / -1; } }
.dirty-note { padding: 1px 9px; border-radius: 99px; background: rgba(230, 253, 103, .7); color: var(--brand-deep); font-size: 12px; font-weight: 800; }
.field { position: relative; }
.field .count { justify-self: end; margin-top: -2px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.field .count.near { color: var(--danger); font-weight: 700; }
.was { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 12px; color: var(--muted); }
.was span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.link-btn { padding: 0; border: 0; background: none; color: var(--brand); font-size: 13px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
fieldset.field { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; font-weight: 700; font-size: 14px; }
fieldset.field legend small, .field-label small { font-weight: 500; color: var(--muted); }
.field-label { font-weight: 700; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }

/* 연결 고르기 */
.href-pick { display: grid; gap: 6px; min-width: 0; }
.href-pick select, .href-pick input, .link-row > input, .sub-item > input { width: 100%; min-width: 0; min-height: 46px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; }
.href-pick input { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.href-pick select:focus, .href-pick input:focus, .link-row > input:focus, .sub-item > input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11, 107, 96, .14); }

/* 켜고 끄기 */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; font-weight: 700; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; }
.switch-ui { position: relative; flex: none; width: 44px; height: 26px; border-radius: 99px; background: #c4d4cf; transition: background-color .25s; }
.switch-ui::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .3s var(--ease-out); }
.switch input:checked + .switch-ui { background: var(--brand); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--teal); outline-offset: 2px; }

/* 고르기 단추 줄(사진 초점) */
.seg-row { display: inline-flex; flex-wrap: wrap; padding: 4px; gap: 4px; border-radius: 14px; background: var(--paper); }
.seg-row label { position: relative; cursor: pointer; }
.seg-row input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.seg-row span { display: block; padding: 8px 16px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--muted); transition: background-color .2s, color .2s, box-shadow .2s; }
.seg-row input:checked + span { background: var(--card); color: var(--brand-deep); box-shadow: 0 1px 4px rgba(10, 74, 67, .18); }
.seg-row input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 1px; }

/* 사진 고르기: 미리보기는 공개 화면 사진 틀과 같은 비율 */
.img-field { display: grid; gap: 10px; }
.img-preview { position: relative; overflow: hidden; border-radius: 16px; background: var(--paper-2); aspect-ratio: 16 / 9; box-shadow: 0 0 0 1px var(--line); }
.img-preview.is-hero { aspect-ratio: 1600 / 829; }
.img-preview.is-community { aspect-ratio: 1200 / 481; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; transition: object-position .5s var(--ease-out); }
.img-preview[data-pos="top"] img { object-position: 50% 15%; }
.img-preview[data-pos="bottom"] img { object-position: 50% 85%; }
.img-frame-note { position: absolute; left: 10px; bottom: 10px; padding: 2px 9px; border-radius: 99px; background: rgba(10, 30, 27, .6); color: #fff; font-size: 12px; font-weight: 700; }
.img-choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.img-choice { position: relative; display: grid; gap: 6px; padding: 6px; border-radius: 14px; background: var(--card); box-shadow: 0 0 0 1px var(--line); cursor: pointer; font-size: 12px; font-weight: 700; line-height: 1.4; transition: box-shadow .2s, transform .2s var(--ease-out); }
.img-choice input { position: absolute; opacity: 0; }
.img-choice img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 9px; background: var(--paper-2); }
.img-choice em { font-style: normal; color: var(--brand); }
.img-choice:has(input:checked) { box-shadow: 0 0 0 2.5px var(--brand); }
.img-choice:has(input:checked)::after { content: "✓"; position: absolute; right: 12px; top: 12px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; }
.img-choice:has(input:focus-visible) { outline: 3px solid var(--teal); outline-offset: 2px; }
@media (hover: hover) { .img-choice:hover { transform: translateY(-2px); } }
.file-btn { position: relative; justify-self: start; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file-btn:focus-within { outline: 3px solid var(--teal); outline-offset: 2px; }
.file-btn.is-busy { pointer-events: none; opacity: .6; }
.file-btn.is-busy::after { content: " 올리는 중…"; }

/* 바로가기 · 메뉴 줄 */
.link-rows, .sub-list { display: grid; gap: 8px; margin-bottom: 10px; }
.link-row, .sub-item { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px; border-radius: 14px; background: var(--paper); }
@media (min-width: 640px) { .link-row, .sub-item { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; align-items: start; } }
.mini-act { display: inline-flex; gap: 4px; justify-self: end; }
.icon-sm { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--card); box-shadow: 0 0 0 1px var(--line); font-size: 16px; font-weight: 800; cursor: pointer; transition: box-shadow .2s, color .2s; }
.icon-sm:hover:not(:disabled) { box-shadow: 0 0 0 1.5px var(--brand); color: var(--brand); }
.icon-sm.danger:hover { box-shadow: 0 0 0 1.5px var(--danger); color: var(--danger); }
.icon-sm:disabled { opacity: .35; cursor: default; }
.is-moved { animation: moved .7s var(--ease-out); }
@keyframes moved { from { box-shadow: 0 0 0 2px var(--teal), 0 0 0 8px rgba(23, 169, 154, .14); } }
.menu-list { display: grid; gap: 14px; margin-bottom: 16px; }
.menu-item { max-width: 960px; display: grid; gap: 12px; transition: box-shadow .3s; }
.menu-item.has-error { box-shadow: 0 0 0 2px var(--danger); }
.menu-top { display: grid; gap: 12px; grid-template-columns: auto minmax(0, 1fr); align-items: end; }
.menu-top > .field, .menu-top > .mini-act { grid-column: 2; }
.menu-no { grid-row: 1 / span 4; align-self: start; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; }
@media (min-width: 900px) { .menu-top { grid-template-columns: auto minmax(0, .9fr) minmax(0, .8fr) minmax(0, 1.4fr) auto; } .menu-top > .field, .menu-top > .mini-act { grid-column: auto; } .menu-no { grid-row: auto; align-self: end; margin-bottom: 6px; } }
.sub-list { margin: 0 0 0 46px; }
.menu-item > .btn-ghost { justify-self: start; margin-left: 46px; }
.sub-none { margin-left: 46px; margin-top: -6px; font-size: 13px; }
@media (max-width: 520px) { .sub-list, .menu-item > .btn-ghost, .sub-none { margin-left: 0; } }
.sticky-foot { position: sticky; bottom: 0; z-index: 3; align-items: center; padding: 12px 0; background: linear-gradient(rgba(243, 250, 247, 0), var(--paper) 30%); }

/* 사진 */
.upload-card { margin-bottom: 26px; }
.upload-card input[type="file"] { padding: 9px 10px; }
.upload-preview { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: var(--paper); animation: rise .35s var(--ease-out) both; }
.upload-preview img { border-radius: 8px; aspect-ratio: 16 / 10; object-fit: cover; }
.upload-preview span { font-size: 13px; color: var(--muted); }
.sub-head { margin: 8px 0 12px; font-size: 17px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 28px; }
.media-card { display: grid; gap: 10px; align-content: start; padding: 10px; border-radius: 18px; background: var(--card); box-shadow: 0 0 0 1px var(--line); animation: rise .45s var(--ease-out) both; }
.media-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; background: var(--paper-2); }
.media-meta { display: grid; gap: 4px; justify-items: start; }
.media-meta small { color: var(--muted); }
.media-card .row-act { justify-content: flex-start; }
.btn-ghost:disabled { opacity: .45; cursor: not-allowed; }
.media-grid .rows-empty { grid-column: 1 / -1; }
@media (max-width: 899px) { .group-jump { position: static; } .cgroup { scroll-margin-top: 140px; } }

/* 쪽별 내용: 쪽 고르기 · 목록 항목 */
.ri-pages { border-radius: 3px; box-shadow: inset 0 -4px 0 -2px currentColor, inset 0 4px 0 -2px currentColor; }
.panel-lead code { padding: 1px 6px; border-radius: 6px; background: var(--card); box-shadow: 0 0 0 1px var(--line); font-size: 13px; color: var(--brand-deep); white-space: nowrap; }
.page-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.page-pick .jump-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; }
.page-pick .jump-chip b { min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--teal); color: #fff; font-size: 11px; text-align: center; }
.page-pick .jump-chip[aria-current] { background: var(--brand); box-shadow: none; color: #fff; }
.page-pick .jump-chip[aria-current] b { background: #fff; color: var(--brand-deep); }
.cgroup-note .form-note { margin: 6px 0 12px; }
.cgroup-fields > .list-field { grid-column: 1 / -1; }
.item-rows { display: grid; gap: 10px; margin-bottom: 10px; }
.item-row { display: grid; gap: 10px; padding: 12px; border-radius: 16px; background: var(--paper); min-width: 0; }
.item-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.item-no { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; font-weight: 800; }
.item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 14px; color: var(--muted); }
.item-fields { display: grid; gap: 10px; min-width: 0; }
@media (min-width: 640px) { .item-fields { grid-template-columns: 1fr 1fr; column-gap: 14px; } .item-fields > .field-wide, .item-fields > .item-img { grid-column: 1 / -1; } }
.item-img { display: grid; gap: 8px; }
.item-img-row { display: flex; gap: 10px; align-items: center; min-width: 0; }
.item-img-row select { flex: 1; min-width: 0; }
.item-img-row img { flex: none; width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: var(--paper-2); box-shadow: 0 0 0 1px var(--line); }