/* 2026 선거준비 — 색은 「선관위 학교 대본」 아티팩트의 청록·슬레이트 팔레트(사용자 요청, 2026-09-29).
   밝은 청회색 바탕 · 흰 면 · 청록 강조 · 호박색 표시. 시스템이 다크 모드면 같은 계열의 어두운 판을 쓴다.
   글꼴은 그대로 Pretendard 고딕(명조는 쓰지 않는다).
   허브 공통 스타일(style.css)의 색 변수를 **이 페이지에서만** 덮어쓴다 — 다른 실험 화면은 그대로. */

body:has(.el-layout), body:has(.el-login), body:has(.el-admin) {
  --bg: #E4E9EA;
  --surface: #FBFCFC;
  --surface-2: #EEF2F3;
  --sunken: #D9E1E2;
  --border: #CBD6D8;
  --border-strong: #A7B7BA;
  --text: #0F2226;
  --muted: #5C7176;
  --el: #0B6B75;          /* 청록 강조 */
  --el-ink: #0B6B75;
  --on-el: #FFFFFF;       /* 강조색 위 글자 */
  --warn: #A33A2A;
  --mark: #C98416;
  --shadow: rgba(15, 34, 38, .10);
  --neon: #12B5C4;
  --accent: var(--el);
  color-scheme: light;
  /* 제목·본문 모두 Pretendard(웹 글꼴, 템플릿 head 에서 불러옴) — 명조 대신 세련된 고딕(사용자 요청). */
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", system-ui, sans-serif;
  --display: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
/* 다크 — 시스템 설정을 따르되, 오른쪽 위 버튼으로 고른 값(html[data-theme])이 있으면 그쪽이 이긴다 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body:has(.el-layout), :root:not([data-theme="light"]) body:has(.el-login), :root:not([data-theme="light"]) body:has(.el-admin) {
    --bg: #0A1214;
    --surface: #121E21;
    --surface-2: #1A292D;
    --sunken: #070D0F;
    --border: #2B3E42;
    --border-strong: #3F575C;
    --text: #E6EDED;
    --muted: #8AA0A3;
    --el: #5FC4CE;
    --el-ink: #5FC4CE;
    --on-el: #0A1214;
    --warn: #E08573;
    --mark: #E8B255;
    --shadow: rgba(0, 0, 0, .35);
    --neon: #7FF3FF;
    
  }
}
:root[data-theme="dark"] body:has(.el-layout), :root[data-theme="dark"] body:has(.el-login), :root[data-theme="dark"] body:has(.el-admin) {
  --bg: #0A1214;
  --surface: #121E21;
  --surface-2: #1A292D;
  --sunken: #070D0F;
  --border: #2B3E42;
  --border-strong: #3F575C;
  --text: #E6EDED;
  --muted: #8AA0A3;
  --el: #5FC4CE;
  --el-ink: #5FC4CE;
  --on-el: #0A1214;
  --warn: #E08573;
  --mark: #E8B255;
  --shadow: rgba(0, 0, 0, .35);
  --neon: #7FF3FF;
  
}
body:has(.el-layout) .site-header, body:has(.el-login) .site-header, body:has(.el-admin) .site-header {
  background: var(--bg); border-bottom: 1px solid var(--border); padding: .75rem 1.5rem;
}
body:has(.el-layout) .brand, body:has(.el-login) .brand { font-weight: 600; font-size: 1rem; }
/* 머리줄 제목 — 네온 빛이 글씨 위를 좌우로 오간다(사용자 요청, 2026-09-29). 이모지는 밖에 둬서 색이 빠지지 않게 */
.el-neon {
  background: linear-gradient(90deg, var(--text) 0%, var(--text) 33%, var(--neon) 50%, var(--text) 67%, var(--text) 100%);
  background-size: 280% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: el-neon-sweep 3.2s ease-in-out infinite alternate, el-neon-glow 1.6s ease-in-out infinite alternate;
}
@keyframes el-neon-sweep { from { background-position: 100% 0; } to { background-position: 0% 0; } }
@keyframes el-neon-glow {
  from { filter: drop-shadow(0 0 2px color-mix(in srgb, var(--neon) 35%, transparent)); }
  to   { filter: drop-shadow(0 0 7px color-mix(in srgb, var(--neon) 75%, transparent)); }
}
@media (prefers-reduced-motion: reduce) { .el-neon { animation: none; color: var(--text); background: none; } }
.page:has(.el-layout) { max-width: 1440px; padding-top: 1.6rem; }

::selection { background: color-mix(in srgb, var(--el) 40%, transparent); }
.el-layout *::-webkit-scrollbar { width: 10px; height: 10px; }
.el-layout *::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
.el-layout *::-webkit-scrollbar-thumb:hover { background: var(--border-strong); background-clip: content-box; }

/* ---------- 공통 조각 ---------- */

/* display 를 준 요소도 hidden 이면 숨는다(JS 가 hidden 으로 여닫는다) */
.el-top [hidden], .el-layout [hidden] { display: none !important; }

.el-linkbtn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer; border-radius: 6px; }
.el-linkbtn:hover { color: var(--text); }
.el-linkbtn:disabled { opacity: .5; cursor: default; }

/* 버튼: 기본은 테두리만, 주 버튼(.el-primary)만 점토색 */
body:has(.el-layout) .btn, body:has(.el-login) .btn {
  font: inherit; font-size: .9rem; font-weight: 500; padding: .55rem 1rem; border-radius: 10px; cursor: pointer;
  background: transparent; color: var(--text); border: 1px solid var(--border-strong); transition: background .15s, border-color .15s;
}
body:has(.el-layout) .btn:hover, body:has(.el-login) .btn:hover { background: var(--surface-2); }
body:has(.el-layout) .btn:disabled { opacity: .5; cursor: default; }
body:has(.el-layout) .btn.el-primary, body:has(.el-login) .btn.el-primary { background: var(--el); border-color: var(--el); color: var(--on-el); }
body:has(.el-layout) .btn.el-primary:hover, body:has(.el-login) .btn.el-primary:hover { background: color-mix(in srgb, var(--el) 88%, var(--text)); }

/* 입력: 한 단계 밝은 면, 초점은 테두리만 밝게 */
.el-layout input[type=search], .el-layout input[type=text], .el-layout input[type=date], .el-layout select, .el-layout textarea, .el-login input {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: .6rem .85rem; transition: border-color .15s, background .15s; 
}
.el-layout input:focus, .el-layout select:focus, .el-layout textarea:focus, .el-login input:focus { outline: none; border-color: var(--border-strong); background: var(--surface-2); }
.el-layout ::placeholder { color: var(--muted); opacity: .8; }

mark { background: color-mix(in srgb, var(--mark) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.el-empty { color: var(--muted); padding: 3rem 0; text-align: center; font-size: .95rem; }
.el-none { font-size: .85rem; color: var(--muted); padding: .3rem .2rem; }
.el-chat-note { font-size: .82rem; color: var(--muted); margin: 0 0 .8rem; line-height: 1.6; }
.el-status { margin: .6rem 0 0; font-size: .85rem; color: var(--muted); white-space: pre-line; }
.el-busy::before { content: ""; display: inline-block; width: .7rem; height: .7rem; margin-right: .45rem; vertical-align: -1px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: el-spin .8s linear infinite; }
@keyframes el-spin { to { transform: rotate(360deg); } }

/* ---------- 들어가기 ---------- */

body:has(.el-login) .hero h1 { font-family: var(--display); font-weight: 700; font-size: 1.95rem; letter-spacing: -.03em; }
body:has(.el-login) .hero-desc { color: var(--muted); }
.el-login { max-width: 380px; margin: 0 auto; display: grid; gap: .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1.4rem; box-shadow: 0 10px 40px var(--shadow); }
.el-login label { font-size: .85rem; color: var(--muted); }
.el-error { color: var(--warn); margin: 0; font-size: .9rem; }

/* ---------- 머리 · 탭 ---------- */

.el-head-links { display: flex; align-items: center; gap: 1.2rem; }
.el-head-links form { margin: 0; }
.el-theme { background: none; border: 1px solid var(--border); border-radius: 999px; padding: .3rem .75rem; font: inherit; font-size: .8rem; color: var(--muted); cursor: pointer; white-space: nowrap; transition: border-color .15s, color .15s; }
.el-theme:hover { border-color: var(--el); color: var(--el-ink); }
@media (max-width: 560px) { .el-theme .el-theme-label { display: none; } }
.el-top { margin-bottom: 1.2rem; }
.el-titlebar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.1rem; }
.el-titlebar h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.7rem; letter-spacing: -.03em; }
.el-titlebar .el-linkbtn { padding: .35rem .75rem; border: 1px solid var(--border); border-radius: 999px; font-size: .82rem; }
.el-titlebar .el-linkbtn:hover { background: var(--surface); }

/* 탭: 알약 모양 세그먼트 */
.el-tabs { display: inline-flex; gap: 2px; padding: 4px; background: var(--sunken); border: 1px solid var(--border); border-radius: 14px; }
.el-tab { background: none; border: 0; padding: .45rem 1rem; border-radius: 10px; color: var(--muted); font: inherit; font-size: .9rem; cursor: pointer; transition: background .15s, color .15s; }
.el-tab:hover { color: var(--text); }
.el-tab.is-on { background: var(--surface-2); color: var(--text); font-weight: 500; box-shadow: 0 1px 3px var(--shadow); }

.el-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 2rem; align-items: start; }
.el-layout.no-memo { grid-template-columns: minmax(0, 1fr); }
.el-layout.no-memo .el-right { display: none; }
@media (max-width: 900px) { .el-layout { grid-template-columns: 1fr; } }

/* ---------- 문서 관리 ---------- */

.el-docs { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem 1.2rem; margin-bottom: 1.1rem; }
.el-doclist { list-style: none; margin: 0 0 .9rem; padding: 0; display: grid; gap: 2px; }
.el-doclist li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; font-size: .9rem; padding: .45rem .6rem; border-radius: 8px; }
.el-doclist li:hover { background: var(--surface-2); }
.el-doclist small { color: var(--muted); margin-left: .3rem; }
.el-rank { color: var(--el-ink); font-weight: 600; }
.el-rank.is-none { color: var(--muted); font-weight: 400; }
.el-drop { display: block; border: 1.5px dashed var(--border-strong); border-radius: 14px; padding: 1.1rem; text-align: center; color: var(--muted); cursor: pointer; font-size: .9rem; transition: border-color .15s, background .15s; }
.el-drop:hover, .el-drop.is-over { border-color: var(--el); background: color-mix(in srgb, var(--el) 6%, transparent); color: var(--text); }
.el-drop input { display: none; }

/* ---------- 규정 검색 ---------- */

#search-pane { max-width: 900px; }
.el-search { display: flex; gap: .5rem; padding: .35rem; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 4px 20px var(--shadow); }
.el-search:focus-within { border-color: var(--border-strong); }
.el-layout .el-search input { flex: 1; border: 0; background: transparent; font-size: 1.02rem; padding: .55rem .8rem; }
.el-layout .el-search input:focus { background: transparent; }
.el-search .btn { border-radius: 13px; }
#search-form { margin-bottom: 1.3rem; }
/* 규정별 타원 버튼 */
.el-reg-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.5rem 0 1.1rem; }
.el-reg { font: inherit; font-size: .8rem; padding: .22rem .75rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; transition: all .12s; }
.el-reg span { opacity: .7; font-variant-numeric: tabular-nums; margin-left: .15rem; }
.el-reg:hover { color: var(--text); border-color: var(--border-strong); }
.el-reg.is-on { color: var(--text); border-color: color-mix(in srgb, var(--el) 65%, var(--border)); background: color-mix(in srgb, var(--el) 16%, transparent); }

.el-summary { color: var(--muted); font-size: .85rem; margin: 0 0 .4rem; }
.el-group h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.015em; font-size: 1.02rem; margin: 1.6rem 0 .4rem; color: var(--text); }
.el-hit { position: relative; padding: .8rem 1rem; margin: 0 -1rem; border-radius: 12px; transition: background .12s; }
.el-hit:hover { background: var(--surface); }
.el-hit + .el-hit { border-top: 1px solid var(--border); }
.el-hit:hover + .el-hit, .el-hit:hover { border-top-color: transparent; }
.el-hit-loc { font-size: .76rem; color: var(--el-ink); margin-bottom: .25rem; letter-spacing: .01em; }
.el-hit-text { font-size: .96rem; line-height: 1.7; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.el-hit-text + .el-hit-text { margin-top: .35rem; }
.el-hit-n { color: var(--muted); }
/* 원문에서 보기 · ＋ 메모로: 자리를 차지하지 않고 카드 오른쪽 위에 겹쳐 뜬다 */
.el-hit-actions { position: absolute; top: .55rem; right: .8rem; display: flex; gap: 2px; padding: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; opacity: 0; transition: opacity .12s; }
.el-hit:hover .el-hit-actions, .el-hit:focus-within .el-hit-actions { opacity: 1; }
.el-hit-actions .el-linkbtn { font-size: .78rem; padding: .15rem .55rem; border-radius: 7px; }
.el-hit-actions .el-linkbtn:hover { background: var(--surface); }
@media (hover: none) { .el-hit-actions { position: static; opacity: 1; margin-top: .4rem; background: none; border: 0; padding: 0; } }

/* ---------- 원문 보기 ---------- */

.el-viewer { max-width: 900px; }
.el-viewer-bar { position: sticky; top: 0; display: flex; gap: 1rem; align-items: center; padding: .8rem 0; background: var(--bg); z-index: 1; border-bottom: 1px solid var(--border); }
.el-viewer-bar strong { font-family: var(--display); font-weight: 600; letter-spacing: -.015em; font-size: 1.05rem; }
.el-viewer-bar .el-linkbtn { padding: .3rem .7rem; border: 1px solid var(--border); border-radius: 999px; font-size: .82rem; }
#viewer-body { padding: .8rem 0 3rem; }
.el-para { padding: .3rem .6rem; border-radius: 8px; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; font-size: .97rem; line-height: 1.75; position: relative; }
.el-para:hover { background: var(--surface); }
.el-para.is-target { background: color-mix(in srgb, var(--el) 16%, transparent); box-shadow: inset 3px 0 0 var(--el); }
.el-para.is-head { font-family: var(--display); font-weight: 600; margin-top: 1rem; }
.el-para .el-linkbtn { display: none; position: absolute; right: .5rem; top: .3rem; font-size: .75rem; background: var(--surface-2); padding: .1rem .5rem; border-radius: 999px; }
.el-para:hover .el-linkbtn { display: inline; }

/* ---------- 메모 ----------
   한 장의 흰 판 안에서 줄로 나누는 목록형(사용자가 시안 B 를 골랐다, 2026-09-29).
   작성칸은 한 상자 — 위에 글, 아랫줄에 종류·기한·추가. 칸 제목은 이름 + 개수 배지 + 가는 선. */

.el-right { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1rem 1rem .9rem; }
@media (max-width: 900px) { .el-right { position: static; max-height: none; } }
.el-memo-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .8rem; }
.el-memo-head strong { font-family: var(--display); font-weight: 650; font-size: 1rem; letter-spacing: -.02em; }

.el-memo-form { display: grid; grid-template-columns: auto 1fr; align-items: center; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: .5rem .55rem; transition: border-color .15s; }
.el-memo-form:focus-within { border-color: color-mix(in srgb, var(--el) 55%, var(--border)); }
.el-memo-form .el-ref { grid-column: 1 / -1; margin-bottom: .4rem; }
.el-layout .el-memo-form textarea { grid-column: 1 / -1; order: -1; width: 100%; min-height: 3.2rem; resize: none; border: 0; background: transparent; padding: .35rem .4rem .5rem; font-size: .92rem; line-height: 1.55; }
.el-layout .el-memo-form textarea:focus { background: transparent; }
.el-kind { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 10px; font-size: .78rem; justify-self: start; }
.el-kind label { padding: .2rem .5rem; white-space: nowrap; border-radius: 7px; cursor: pointer; color: var(--muted); }
.el-kind label:has(input:checked) { background: var(--surface); box-shadow: 0 1px 2px var(--shadow); color: var(--el-ink); font-weight: 600; }
.el-kind input { display: none; }
.el-memo-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .3rem; min-width: 0; }
.el-due { display: inline-flex; align-items: center; font-size: 0; }   /* 「기한」 글자는 숨기고 날짜칸만 */
.el-memo-form .btn.el-primary { padding: .35rem .75rem; font-size: .8rem; border-radius: 8px; white-space: nowrap; flex-shrink: 0; }
.el-ref { font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; gap: .5rem; padding: .4rem .6rem; background: var(--surface-2); border-radius: 8px; }

.el-right h2 { display: flex; align-items: center; gap: .45rem; width: 100%; font-size: .74rem; font-weight: 600; letter-spacing: .06em; color: var(--muted); margin: 1.4rem 0 .3rem; }
.el-right h2::after { content: ""; order: 2; flex: 1; height: 1px; background: var(--border); }
.el-count:not(:empty) { order: 1; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .7rem; font-weight: 500; color: var(--mark); background: color-mix(in srgb, var(--mark) 14%, transparent); border-radius: 999px; padding: 0 .45rem; }
.el-right .el-none { font-size: .8rem; padding: .4rem .3rem; }

.el-memos { list-style: none; margin: 0; padding: 0; display: grid; }
.el-memo { position: relative; display: grid; grid-template-columns: auto 1fr; gap: .6rem; padding: .6rem .3rem; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); transition: background .12s; }
.el-memo:last-child { border-bottom: 0; }
.el-memo:hover { background: color-mix(in srgb, var(--el) 5%, transparent); }
.el-memo input[type=checkbox] { appearance: none; margin: .2rem 0 0; width: 1.1rem; height: 1.1rem; border: 1.5px solid var(--border-strong); border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.el-memo input[type=checkbox]:hover { border-color: var(--el); }
.el-memo input[type=checkbox]:checked { background: var(--el); border-color: var(--el); }
.el-memo input[type=checkbox]:checked::after { content: ""; width: .3rem; height: .55rem; border: solid var(--on-el); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.el-memo .el-bullet { width: 1.1rem; position: relative; color: transparent; }   /* 기억할 것 — 글자 「•」 대신 호박색 점 */
.el-memo .el-bullet::before { content: ""; position: absolute; left: 50%; top: .5rem; width: .45rem; height: .45rem; border-radius: 50%; background: var(--mark); transform: translateX(-50%); }
.el-memo-text { font-size: .92rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.el-memo.is-done .el-memo-text { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }
.el-memo-meta { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .74rem; color: var(--muted); margin-top: .2rem; }
.el-memo-meta:empty { display: none; }
.el-memo-meta .el-linkbtn { font-size: .74rem; color: var(--el-ink); }
.el-layout .el-memos textarea { width: 100%; resize: vertical; font-size: .92rem; line-height: 1.55; }
.el-layout .el-memos input[type=date] { font-size: .8rem; padding: .25rem .45rem; border-radius: 8px; }
/* 고치기·지우기: 자리를 차지하지 않고 오른쪽 위에 겹쳐 뜬다 */
.el-memo-tools { position: absolute; top: .35rem; right: .3rem; display: flex; gap: 2px; padding: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 2px 8px var(--shadow); opacity: 0; transition: opacity .12s; }
.el-memo:hover .el-memo-tools, .el-memo-tools:focus-within { opacity: 1; }
.el-memo-tools .el-linkbtn { font-size: .72rem; padding: .12rem .45rem; border-radius: 6px; }
.el-memo-tools .el-linkbtn:hover { background: var(--surface-2); }
@media (hover: none) { .el-memo-tools { position: static; opacity: 1; grid-column: 2; justify-self: start; background: none; border: 0; box-shadow: none; padding: 0; } }
.el-late { color: var(--warn); font-weight: 600; }
.el-soon { color: var(--mark); font-weight: 600; }
.el-done-box summary { cursor: pointer; list-style: none; }
.el-done-box summary::-webkit-details-marker { display: none; }
.el-done-box summary h2::before { content: "▸"; font-size: .7rem; transition: transform .15s; }
.el-done-box[open] summary h2::before { transform: rotate(90deg); }
.el-memo-io { display: grid; gap: .45rem; margin-top: 1.3rem; padding-top: .9rem; border-top: 1px solid var(--border); font-size: .75rem; color: var(--muted); }
.el-memo-io-btns { display: flex; gap: .9rem; }   /* 내보내기·가져오기는 안내 아랫줄에 */
.el-memo-io .el-linkbtn { font-size: .75rem; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--border-strong); }

/* ---------- 날짜 고르기(달력) ----------
   「2026 선관위 학교」 슬라이드 14장의 달력을 이 페이지 색 변수로 옮겼다(2026-09-29).
   칸 전체가 버튼이라 연·월·일·아이콘 어디를 눌러도 열린다. 달력은 body 에 fixed 로 뜬다(메모 판에 잘리지 않게). */
.el-dp-btn { display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-size: .8rem; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: .28rem .45rem .28rem .55rem;
  cursor: pointer; white-space: nowrap; transition: border-color .15s, background .15s; }
.el-dp-btn:hover { background: var(--surface-2); }
.el-dp-btn.open { border-color: var(--el); background: var(--surface); }
.el-dp-btn .wd { font-size: .9em; font-weight: 500; color: var(--muted); }
.el-dp-btn.is-empty .wd { font-size: 1em; }
.el-dp-btn svg { width: 15px; height: 15px; fill: none; stroke: var(--el); stroke-width: 2.5; transition: transform .2s; }
.el-dp-btn.open svg { transform: rotate(180deg); }
.el-memos .el-dp-btn { border-color: var(--border); }

.el-dp-pop { position: fixed; z-index: 200; width: 300px; padding: 14px 14px 10px; background: var(--surface);
  border: 1.5px solid color-mix(in srgb, var(--el) 40%, transparent); border-radius: 16px; box-shadow: 0 18px 50px var(--shadow); font-family: var(--sans); }
.el-dp-pop[hidden] { display: none; }
.el-dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.el-dp-head b { font-size: 1rem; color: var(--text); font-variant-numeric: tabular-nums; }
.el-dp-nav { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); background: transparent; cursor: pointer; }
.el-dp-nav:hover { border-color: var(--el); }
.el-dp-nav svg { width: 18px; height: 18px; fill: none; stroke: var(--text); stroke-width: 2.5; }
.el-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.el-dp-wk i { font-style: normal; text-align: center; font-size: .75rem; color: var(--muted); padding: 3px 0; }
.el-dp-wk i:first-child { color: var(--warn); } .el-dp-wk i:last-child { color: var(--el-ink); }
.el-dp-d { height: 36px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--text); font: inherit;
  font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; position: relative; cursor: pointer; }
.el-dp-d:hover { background: color-mix(in srgb, var(--el) 14%, transparent); }
.el-dp-d.hol { color: var(--warn); } .el-dp-d.sat { color: var(--el-ink); }
.el-dp-d.out { opacity: .3; }
.el-dp-d.today::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--el); }
.el-dp-d.on { background: var(--el); color: var(--on-el); font-weight: 800; }
.el-dp-d.on::after { background: var(--on-el); }
.el-dp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: .78rem; color: var(--muted); }
.el-dp-foot > span:last-child { display: flex; gap: 4px; }
.el-dp-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); margin-right: 5px; vertical-align: 1px; }
.el-dp-foot button { font: inherit; font-size: .78rem; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.el-dp-foot button:hover { border-color: var(--el); color: var(--el-ink); }

/* ---------- 처음 오신 분(지부·이름) ---------- */
.el-me { background: none; border: 0; font: inherit; font-size: .8rem; color: var(--muted); cursor: pointer; padding: .3rem .2rem; white-space: nowrap; }
.el-me:hover { color: var(--el-ink); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) { .el-me { display: none; } }
.el-welcome { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); }
.el-welcome[hidden] { display: none; }
.el-welcome-card { width: min(420px, 100%); display: grid; gap: .8rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 1.5rem 1.4rem 1.3rem; box-shadow: 0 20px 60px var(--shadow); }
.el-welcome-card h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.02em; color: var(--text); }
.el-welcome.is-change .el-welcome-card h2::after { content: " — 지부·이름 바꾸기"; font-size: .8rem; font-weight: 500; color: var(--muted); }
.el-welcome-lead { margin: 0 0 .2rem; font-size: .9rem; color: var(--muted); }
.el-welcome-card label { display: grid; gap: .3rem; font-size: .82rem; font-weight: 600; color: var(--text); }
.el-welcome-card input { font: inherit; font-size: .95rem; font-weight: 400; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: .6rem .8rem; }
.el-welcome-card input:focus { outline: none; border-color: var(--el); }
.el-welcome-note { margin: .1rem 0 .2rem; font-size: .76rem; line-height: 1.6; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: .6rem .75rem; }
.el-welcome-note b { color: var(--text); font-weight: 600; }
.el-welcome-card .btn.el-primary { justify-self: stretch; padding: .65rem; font-size: .95rem; }

/* ---------- 운영자: 사용 현황(/admin) ---------- */
.page:has(.el-admin) { max-width: 1200px; padding-top: 1.6rem; }
.el-admin { color: var(--text); }
.el-admin h1 { margin: 0 0 1rem; font-size: 1.5rem; letter-spacing: -.03em; }
.el-admin h2 { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 600; letter-spacing: .06em; color: var(--muted); margin: 2rem 0 .6rem; }
.el-admin h2::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.el-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.el-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .8rem 1rem; }
.el-stat b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; color: var(--text); }
.el-stat span { font-size: .78rem; color: var(--muted); }
.el-table-box { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.el-admin table { border-collapse: collapse; width: 100%; font-size: .86rem; }
.el-admin th, .el-admin td { padding: .55rem .8rem; text-align: left; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); vertical-align: top; }
.el-admin tbody tr:last-child td { border-bottom: 0; }
.el-admin th { font-size: .74rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); white-space: nowrap; }
.el-admin td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.el-admin td.when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.el-admin td.q { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 18rem; }
.el-admin tr.is-on td { background: color-mix(in srgb, var(--el) 8%, transparent); }
.el-admin a { color: var(--el-ink); text-decoration: none; }
.el-admin a:hover { text-decoration: underline; }
.el-admin-tabs { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: .6rem; font-size: .84rem; }
.el-admin-tabs a { padding: .3rem .75rem; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); }
.el-admin-tabs a.is-on { border-color: var(--el); color: var(--el-ink); background: color-mix(in srgb, var(--el) 10%, transparent); font-weight: 600; }
.el-admin-tabs a:hover { text-decoration: none; border-color: var(--el); }
.el-admin .el-none { color: var(--muted); padding: 1rem; }

/* ---------- 선거 챗봇 ---------- */

.el-chat { max-width: 780px; margin: 0 auto; min-height: calc(100vh - 250px); display: flex; flex-direction: column; }
.el-chat[hidden], .el-chat-empty[hidden] { display: none; }
.el-chat-top { display: flex; gap: .5rem; justify-content: flex-end; margin-bottom: .4rem; }
.el-pill { font: inherit; font-size: .8rem; padding: .3rem .85rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; }
.el-pill:hover { color: var(--text); background: var(--surface); }

.el-chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem 1rem; }
.el-chat-mark { font-size: 2.4rem; line-height: 1; }
.el-chat-empty h2 { font-family: var(--display); font-weight: 650; font-size: 1.85rem; margin: .9rem 0 .45rem; letter-spacing: -.035em; }
.el-chat-empty p { color: var(--muted); font-size: .9rem; margin: 0; }
.el-suggest { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; margin-top: 1.7rem; max-width: 640px; }
.el-suggest button { font: inherit; font-size: .88rem; padding: .55rem .95rem; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s; }
.el-suggest button:hover { border-color: var(--border-strong); background: var(--surface-2); }

.el-chat-log { display: grid; gap: 1.8rem; margin: .6rem 0 1rem; align-content: start; flex: 1 0 auto; }
.el-q { justify-self: end; max-width: 80%; background: var(--surface-2); border-radius: 18px; padding: .6rem 1rem; font-size: .98rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.el-a { padding: 0 .15rem; font-size: 1rem; line-height: 1.8; word-break: keep-all; overflow-wrap: anywhere; }
.el-a p { margin: 0 0 .8rem; }
.el-a ul { margin: 0 0 .8rem; padding-left: 1.3rem; }
.el-a li { margin: .25rem 0; }
.el-a li::marker { color: var(--muted); }
.el-a strong { font-weight: 650; }
.el-a > :last-child { margin-bottom: 0; }
.el-a-when { font-size: .74rem; color: var(--muted); margin-bottom: .35rem; }
.el-cite { display: inline-block; font: inherit; font-size: .72rem; line-height: 1.35; vertical-align: 1px; margin: 0 1px; padding: .02rem .5rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); transition: all .12s; }
.el-cite:hover { color: var(--text); border-color: var(--el); background: color-mix(in srgb, var(--el) 14%, var(--surface)); }
.el-cite.is-bad { border-style: dashed; background: none; cursor: help; }
.el-thinking { font-size: .9rem; color: var(--muted); animation: el-pulse 1.6s ease-in-out infinite; }
.el-thinking::before { content: "✻ "; color: var(--el); }
@keyframes el-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.el-work { font-size: .8rem; color: var(--muted); margin-top: .6rem; }
.el-work summary { cursor: pointer; }
.el-work ol { margin: .3rem 0 0; padding-left: 1.3rem; }
.el-a-actions { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; margin-top: .4rem; font-size: .76rem; color: var(--muted); opacity: .7; transition: opacity .12s; }
.el-a:hover .el-a-actions { opacity: 1; }
.el-a-actions .el-linkbtn { font-size: .76rem; }
.el-a-err { color: var(--warn); }
.el-a-stopped { color: var(--muted); font-size: .85rem; font-style: italic; }

.el-composer-wrap { position: sticky; bottom: 0; padding: .9rem 0 .8rem; background: linear-gradient(to bottom, transparent, var(--bg) 28%); z-index: 2; }
.el-composer { border: 1px solid var(--border); border-radius: 22px; background: var(--surface); padding: .85rem .75rem .55rem 1.15rem; box-shadow: 0 6px 28px var(--shadow); transition: border-color .15s; }
.el-composer:focus-within { border-color: var(--border-strong); }
.el-layout .el-composer textarea { display: block; width: 100%; border: 0; border-radius: 0; resize: none; background: transparent; font-size: 1rem; line-height: 1.55; min-height: 1.55em; max-height: 40vh; padding: 0; }
.el-layout .el-composer textarea:focus { background: transparent; }
.el-composer-bar { display: flex; justify-content: space-between; align-items: center; margin-top: .45rem; }
.el-composer-hint { font-size: .72rem; color: var(--muted); }
.el-send { width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--el); color: var(--on-el); cursor: pointer; transition: background .15s, transform .1s; }
.el-send:hover:not(:disabled) { transform: scale(1.05); }
.el-send:disabled { background: var(--surface-2); color: var(--muted); cursor: default; }
.el-send svg { width: 18px; height: 18px; }
.el-send .el-ico-stop { display: none; }
.el-send.is-busy { background: var(--text); color: var(--bg); }
.el-send.is-busy .el-ico-send { display: none; }
.el-send.is-busy .el-ico-stop { display: block; }
.el-chat-disclaimer { text-align: center; font-size: .72rem; color: var(--muted); margin: .55rem 0 0; }

/* ---------- 서식 찾기·받기 ---------- */

.el-forms-need { background: color-mix(in srgb, var(--mark) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--mark) 30%, var(--border)); border-radius: 14px; padding: .9rem 1.1rem; font-size: .9rem; line-height: 1.65; margin-bottom: 1.1rem; }
.el-forms-need ol { margin: .4rem 0 0; padding-left: 1.3rem; }
.el-forms { display: grid; grid-template-columns: 600px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 1180px) { .el-forms { grid-template-columns: 1fr; } }
.el-forms-side { position: sticky; top: 1rem; display: grid; gap: .5rem; }
.el-layout .el-forms-side input[type=search] { width: 100%; border-radius: 14px; padding: .65rem .95rem; }
.el-forms-count { margin: 0 .2rem; font-size: .76rem; color: var(--muted); }
.el-forms-list { list-style: none; margin: 0; padding: 4px; max-height: calc(100vh - 15rem);   /* JS(fitPreview)가 실제 자리에 맞춰 다시 잰다 */ overflow-y: auto; border: 1px solid var(--border); border-radius: 16px; background: var(--sunken); }
.el-forms-list li { padding: .5rem .75rem; border-radius: 10px; cursor: pointer; font-size: .88rem; line-height: 1.45; transition: background .1s; }
.el-forms-list li:hover { background: var(--surface); }
.el-forms-list li.is-on { background: var(--surface-2); }
.el-forms-list b { color: var(--el-ink); font-weight: 600; margin-right: .4rem; font-variant-numeric: tabular-nums; }
.el-forms-list small { color: var(--muted); }
.el-snip { display: block; font-size: .76rem; color: var(--muted); margin-top: .15rem; }
.el-form-title { margin: 0 0 .35rem; font-family: var(--display); font-weight: 650; font-size: 1.25rem; letter-spacing: -.025em; }
.el-form-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem .9rem; margin: .8rem 0; }
.el-form-fields label { display: grid; gap: .3rem; font-size: .8rem; color: var(--muted); }
.el-layout .el-form-fields input, .el-layout .el-form-fields select { width: 100%; min-width: 0; font-size: .95rem; padding: .5rem .7rem; border-radius: 10px; }
.el-form-actions { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; margin: .6rem 0 1.1rem; }
.el-btn-ghost { background: none; }
.el-form-preview { display: grid; gap: 1.1rem; }
#forms-pane .el-form-preview img { width: auto; max-width: 100%; max-height: var(--fit-h, calc(100vh - 2rem)); background: #fff; border-radius: 6px; box-shadow: 0 8px 30px var(--shadow); }
.el-form-preview .el-busy, .el-form-preview .el-a-err { font-size: .88rem; color: var(--muted); }

/* 작성 모드: 왼쪽(목록 자리)에 입력칸, 오른쪽에 미리보기 */
.el-fill-side { display: grid; gap: .35rem; align-content: start; max-height: calc(100vh - 2rem); overflow-y: auto; padding: 1.1rem 1.2rem; background: var(--sunken); border: 1px solid var(--border); border-radius: 18px; }
.el-fill-side #fill-back { justify-self: start; font-size: .82rem; padding: .3rem .75rem; border: 1px solid var(--border); border-radius: 999px; margin-bottom: .4rem; }
.el-fill-side #fill-back:hover { background: var(--surface); }
.el-fill-side .el-form-fields { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin: .4rem 0 .8rem; }

/* 좁은 창: 목록은 통째로 흐르게, 고른 서식 아래에 미리보기·입력칸을 펼친다 */
@media (max-width: 1180px) {
  .el-forms-side { position: static; }
  .el-forms-list { max-height: none; overflow: visible; }
  .el-forms-list li.el-forms-inline { cursor: default; padding: 1rem .9rem 1.2rem; background: var(--bg); margin: 4px 0; }
  .el-forms-list li.el-forms-inline:hover { background: var(--bg); }
  .el-forms > .el-forms-main { display: none; }
  .is-filling .el-forms > .el-forms-main { display: block; }
  .el-fill-side { max-height: none; overflow: visible; }
}

/* 폰 폭 — 탭 이름이 글자 중간에서 꺾이지 않게 */
@media (max-width: 560px) {
  .el-tabs { display: flex; }
  .el-tab { flex: 1; white-space: nowrap; padding-left: .4rem; padding-right: .4rem; font-size: .85rem; }
}
