:root {
  --bg: #f4f4f1;
  --panel: rgba(255,255,255,.78);
  --panel-solid: #ffffff;
  --side: rgba(250,250,247,.72);
  --line: rgba(20,20,30,.08);
  --line-strong: rgba(20,20,30,.14);
  --text: #17181c;
  --sub: #5f6168;
  --faint: #9a9ca3;
  --accent: #2f3b8f;
  --accent-soft: rgba(47,59,143,.09);
  --accent-text: #ffffff;
  --red: #c23b3b;
  --red-soft: rgba(194,59,59,.1);
  --amber: #a86a12;
  --amber-soft: rgba(196,140,30,.13);
  --green: #2e7d55;
  --green-soft: rgba(46,125,85,.11);
  --seal: #c8332b;   /* 결재 도장 인주색 */
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 28px rgba(20,20,40,.06);
  --shadow-lg: 0 24px 80px rgba(10,10,30,.22);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  /* 다른 화면에서 쓰던 이름 — 위 색에 이어 둔다 (어두울 때도 같이 바뀜) */
  --card: var(--panel-solid);
  --muted: var(--sub);
  --soft: color-mix(in srgb, var(--text) 5%, var(--panel-solid));
  --bg2: color-mix(in srgb, var(--text) 5%, transparent);
  --hover: var(--line);
  --purple: #8a5ac8; --teal: #1f8f8f; --blue: #3b7bd6;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121316; --panel: rgba(30,31,36,.78); --panel-solid: #1d1e23; --side: rgba(24,25,29,.8);
    --line: rgba(255,255,255,.07); --line-strong: rgba(255,255,255,.13);
    --text: #ececef; --sub: #a3a5ad; --faint: #6e7079;
    --accent: #8c9aff; --accent-soft: rgba(140,154,255,.13); --accent-text: #10122a;
    --red: #ff7b7b; --red-soft: rgba(255,123,123,.13); --amber: #e8b04f; --amber-soft: rgba(232,176,79,.14);
    --green: #6fd0a0; --green-soft: rgba(111,208,160,.12); --seal: #ff7a6b;
    --purple: #b893f2; --teal: #5ccbcb; --blue: #7fb0ff;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121316; --panel: rgba(30,31,36,.78); --panel-solid: #1d1e23; --side: rgba(24,25,29,.8);
  --line: rgba(255,255,255,.07); --line-strong: rgba(255,255,255,.13);
  --text: #ececef; --sub: #a3a5ad; --faint: #6e7079;
  --accent: #8c9aff; --accent-soft: rgba(140,154,255,.13); --accent-text: #10122a;
  --red: #ff7b7b; --red-soft: rgba(255,123,123,.13); --amber: #e8b04f; --amber-soft: rgba(232,176,79,.14);
  --green: #6fd0a0; --green-soft: rgba(111,208,160,.12); --seal: #ff7a6b;
  --purple: #b893f2; --teal: #5ccbcb; --blue: #7fb0ff;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent 60%),
                    radial-gradient(900px 500px at 110% 110%, var(--accent-soft), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; letter-spacing: -0.01em;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }

/* ── 뼈대 ── */
.app { display: grid; grid-template-columns: 228px 1fr; height: 100vh; }
.side {
  background: var(--side); backdrop-filter: blur(30px) saturate(1.4); -webkit-backdrop-filter: blur(30px) saturate(1.4);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 12px 12px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 18px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), #5b67c9); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 4px 12px rgba(47,59,143,.3); }
img.brand-mark { background: none; object-fit: cover; display: block; }
.brand-name { font-weight: 650; font-size: 15px; }
.brand-sub { font-size: 11.5px; color: var(--faint); margin-top: -2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--sub); font-weight: 500;
  transition: background .12s, color .12s;
}
.nav a:hover { background: var(--line); color: var(--text); }
.nav a.on { background: var(--panel-solid); color: var(--text); box-shadow: var(--shadow); }
.nav svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav .badge { margin-left: auto; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; cursor: pointer; }
.side-foot:hover { background: var(--line); }

.main { overflow: auto; position: relative; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
}
.top.scrolled { border-bottom-color: var(--line); }
.top h1 { font-size: 20px; font-weight: 680; margin: 0; letter-spacing: -0.02em; }
.top .grow { flex: 1; }
.searchbox {
  display: flex; align-items: center; gap: 8px; width: 300px; padding: 7px 12px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); color: var(--faint); cursor: text;
}
.searchbox kbd { margin-left: auto; font-size: 11px; color: var(--faint); border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 5px; font-family: inherit; }
.page { padding: 8px 28px 60px; max-width: 1680px; }
/* 담당 칸: 이름이 줄바꿈되지 않게 */
.tbl th.who, .tbl td.who { white-space: nowrap; min-width: 84px; }
.tbl td.who .small { white-space: normal; max-width: 200px; }

/* ── 공통 부품 ── */
.card {
  background: var(--panel); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px 10px; flex-wrap: wrap; row-gap: 8px; }
/* 제목은 줄어들지 않게 — 좁은 칸(1150px 의뢰인 탭 '진행 보고')에서 단추에 밀려 한 글자씩 세로로 깨지던 것. 자리가 모자라면 단추가 다음 줄로 */
.card-h h2, .card-h h3 { margin: 0; font-size: 14.5px; font-weight: 650; flex-shrink: 0; max-width: 100%; }
.card-h .count { color: var(--faint); font-weight: 500; }
.card-h .grow { flex: 1; }
/* 머리 단추 묶음: 제목 옆에 다 못 들어가면 묶음째 다음 줄로 (한두 개만 떨어져 흩어지지 않게) */
.card-h .hacts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-left: auto; }
.card-b { padding: 4px 18px 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }   /* 긴 제목이 칸을 밀어내지 않게 */
.g-main > .grid { grid-template-columns: minmax(0, 1fr); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--panel-solid); cursor: pointer; font-weight: 550; font-size: 13px; white-space: nowrap; transition: transform .06s, background .12s;
}
.btn:hover { background: color-mix(in srgb, var(--panel-solid) 90%, var(--text)); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-text); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--sub); }
.btn.ghost:hover { background: var(--line); color: var(--text); }
.btn.danger { color: var(--red); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { width: 30px; height: 30px; padding: 0; justify-content: center; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--line); color: var(--sub); white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.green { background: var(--green-soft); color: var(--green); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.muted { color: var(--sub); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.empty { padding: 28px 10px; text-align: center; color: var(--faint); font-size: 13px; }

input.f, select.f, textarea.f {
  width: 100%; padding: 8px 11px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--panel-solid); outline: none;
  transition: border-color .12s, box-shadow .12s;
}
input.f:focus, select.f:focus, textarea.f:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.f { resize: vertical; min-height: 70px; }
label.l { display: block; font-size: 12px; font-weight: 600; color: var(--sub); margin: 12px 0 5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
/* 사건 고르는 칸 (app.js casePick) — 목록은 body 에 붙여 창 밖으로도 보이게 */
.cpick { position: relative; min-width: 0; }
.cpick .cpick-q { padding-right: 30px; text-overflow: ellipsis; }
.cpick.on .cpick-q:not(:focus) { font-weight: 550; }
.cpick-x { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 13px; padding: 4px 6px; border-radius: 6px; }
.cpick-x:hover { color: var(--text); background: var(--line); }
.cpick-pop { position: fixed; z-index: 70; overflow: auto; padding: 4px; background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); }
.cpick-h { padding: 8px 10px 3px; font-size: 11.5px; font-weight: 650; color: var(--faint); }
.cpick-i { padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.cpick-i .t { font-weight: 560; }
.cpick-i .s { font-size: 12px; color: var(--sub); }
.cpick-i:hover, .cpick-i.hi { background: var(--accent-soft); }
.cpick-i.on .t { color: var(--accent); }
.cpick-foot { padding: 8px 10px; font-size: 12px; color: var(--faint); }

/* 목록 */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-top: 1px solid var(--line); cursor: pointer; border-radius: 8px; }
.item:first-child { border-top: none; }
.item:hover { background: var(--line); }
.item .t { font-weight: 560; }
.item .s { font-size: 12.5px; color: var(--sub); }
.item .grow { flex: 1; min-width: 0; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.when { width: 64px; flex: none; text-align: center; }
.when .d { font-size: 17px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.when .w { font-size: 11px; color: var(--faint); }
.dday { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; color: var(--faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover td { background: var(--line); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }

/* 탭 */
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--line); width: fit-content; }
.tabs button { border: none; background: none; padding: 5px 13px; border-radius: 8px; cursor: pointer; color: var(--sub); font-weight: 560; font-size: 13px; }
.tabs button.on { background: var(--panel-solid); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tabs .badge { margin-left: 4px; }
/* 사건 탭이 많아 좁으면 줄이 쪼개지지 않고 옆으로 밀어 본다 */
#ctabs { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
#ctabs button { white-space: nowrap; flex: 0 0 auto; }

/* 통계 */
.stat { padding: 16px 18px; }
.stat .n { font-size: 26px; font-weight: 720; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12.5px; color: var(--sub); font-weight: 550; }
.greet { font-size: 26px; font-weight: 720; letter-spacing: -0.03em; margin: 6px 0 2px; }

/* 체크 */
.check { width: 18px; height: 18px; border-radius: 6px; border: 1.6px solid var(--line-strong); display: grid; place-items: center; flex: none; cursor: pointer; background: var(--panel-solid); }
.check:hover { border-color: var(--accent); }
.check.on { background: var(--green); border-color: var(--green); }
.check.tick { animation: tick .32s cubic-bezier(.3,1.6,.5,1); }
@keyframes tick { 0% { transform: scale(.6) } 60% { transform: scale(1.2) } 100% { transform: scale(1) } }
.check.on::after { content: ""; width: 5px; height: 9px; border: solid var(--accent-text); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px,-1px); }
.done .t { text-decoration: line-through; color: var(--faint); }

/* 사건 머리 */
.case-head { padding: 20px 22px; display: flex; gap: 18px; align-items: flex-start; }
.case-head h2 { margin: 2px 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.kv { display: grid; grid-template-columns: 76px 1fr; gap: 6px 10px; font-size: 13px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; }
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1.5px; background: var(--line-strong); }
.tl { position: relative; padding: 6px 0 10px; }
.tl::before { content: ""; position: absolute; left: -17px; top: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--panel-solid); border: 2px solid var(--accent); }
.tl.new::before { background: var(--accent); }

/* 자료 */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.file { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel-solid); cursor: pointer; }
.file:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.ficon { width: 34px; height: 40px; border-radius: 6px; flex: none; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; background: #8a8f9c; letter-spacing: 0; }
.ficon.pdf { background: #d0463b; } .ficon.hwp, .ficon.hwpx { background: #2f7ac4; } .ficon.doc, .ficon.docx { background: #2c5aa8; }
.ficon.xls, .ficon.xlsx { background: #2e8b57; } .ficon.jpg, .ficon.jpeg, .ficon.png, .ficon.heic { background: #8b5cc4; }
.drop { border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 18px; text-align: center; color: var(--faint); transition: all .12s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* 대화 */
.chat { display: grid; grid-template-columns: 270px 1fr; height: calc(100vh - 70px); margin: 0 -28px -60px; border-top: 1px solid var(--line); }
.chat-list { border-right: 1px solid var(--line); overflow: auto; padding: 8px; }
.ch { display: flex; gap: 10px; padding: 9px 10px; border-radius: 10px; cursor: pointer; align-items: center; }
.ch:hover { background: var(--line); }
.ch.on { background: var(--panel-solid); box-shadow: var(--shadow); }
.ch .grow { min-width: 0; flex: 1; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 13px; color: #fff; flex: none; position: relative; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--panel-solid); }
.chat-main { display: flex; flex-direction: column; min-height: 0; }
.chat-head { padding: 12px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.msgs { flex: 1; overflow: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; }
.msg { display: flex; gap: 10px; padding: 4px 0; max-width: 760px; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.bubble { padding: 8px 12px; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }
.msg.me .bubble { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.msg .meta { font-size: 11px; color: var(--faint); margin: 0 4px 2px; }
.msg.me .meta { text-align: right; }
.msg.cont .avatar { visibility: hidden; height: 0; }
.msg.cont .meta { display: none; }
.hint { margin-top: 4px; display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 6px 9px; border-radius: 10px; background: var(--amber-soft); color: var(--amber); width: fit-content; }
.hint.made { background: var(--green-soft); color: var(--green); }
.msg-file { display: flex; align-items: center; gap: 10px; min-width: 230px; }
.msg.me .msg-file .s { color: rgba(255,255,255,.75); }
.composer { padding: 12px 20px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 40px; max-height: 160px; resize: none; }
.day-sep { text-align: center; font-size: 11.5px; color: var(--faint); margin: 14px 0 6px; }

/* 모달·알림 */
.overlay { position: fixed; inset: 0; background: rgba(10,10,20,.32); backdrop-filter: blur(3px); display: grid; place-items: start center; padding-top: 9vh; z-index: 50; animation: fade .12s; }
.modal { width: min(620px, calc(100vw - 32px)); max-height: 82vh; overflow: auto; background: var(--panel-solid); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: pop .16s cubic-bezier(.2,.9,.3,1.2); }
.modal.wide { width: min(860px, calc(100vw - 32px)); }
.modal-h { display: flex; align-items: center; padding: 18px 22px 4px; }
.modal-h h3 { margin: 0; font-size: 17px; }
.modal-b { padding: 6px 22px 8px; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; }
/* 긴 창도 저장 단추는 늘 바닥에 (위로 흐리게 이어지는 띠) */
.modal-f { position: sticky; bottom: 0; z-index: 3; background: var(--panel-solid); }
.modal { scroll-padding-bottom: 84px; }   /* Tab 으로 들어간 아래쪽 칸·새로 생긴 카드가 단추 줄 밑에 가려지지 않게 */
.modal-f.wrap { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 700px) { .modal-f.wrap > .btn.primary { flex: 1 1 100%; justify-content: center; } }   /* 폰: 고를 것·닫기 한 줄, 주 단추는 아래 꽉 차게 (갤럭시 SaveBar 처럼) */
.modal-f::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 18px; background: linear-gradient(to bottom, transparent, var(--panel-solid)); pointer-events: none; opacity: 0; transition: opacity .15s; }
.modal.more .modal-f::before { opacity: 1; }
.modal.more .modal-f { box-shadow: 0 -1px 0 var(--line); }
.overlay.under-fv { display: none; }   /* 창에서 연 파일 보기가 떠 있는 동안 */
/* 금액 칸 아래 '= 330만 원' */
.won-ko { font-size: 12px; color: var(--accent); margin-top: 3px; font-weight: 560; font-variant-numeric: tabular-nums; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { transform: scale(.97) translateY(6px); opacity: 0 } }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow-lg); border-radius: 12px; padding: 11px 15px; min-width: 240px; max-width: 360px; animation: pop .18s; cursor: pointer; }
.toast .tt { font-weight: 650; font-size: 13px; }
.toast .tb { font-size: 12.5px; color: var(--sub); }
.toast.err { border-color: var(--red); }
.toast.act { display: flex; align-items: center; gap: 12px; }
.toast.act .btn { flex: none; }
.toast .grow { flex: 1; min-width: 0; }

.palette { width: min(640px, calc(100vw - 32px)); }
.palette input { border: none; font-size: 17px; padding: 18px 22px; width: 100%; background: transparent; outline: none; border-bottom: 1px solid var(--line); }
.palette .res { max-height: 55vh; overflow: auto; padding: 8px; }
.palette .grp { font-size: 11.5px; font-weight: 650; color: var(--faint); padding: 8px 10px 4px; }
.palette .it { padding: 8px 10px; border-radius: 9px; cursor: pointer; display: flex; gap: 10px; align-items: center; }
.palette .it.sel, .palette .it:hover { background: var(--accent-soft); }

.conflict { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; }
.conflict.warn { background: var(--amber-soft); color: var(--amber); }
.conflict.ok { background: var(--green-soft); color: var(--green); }

/* 로그인 */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth .card { width: 380px; padding: 30px 28px 24px; }
.auth h1 { font-size: 22px; margin: 14px 0 2px; letter-spacing: -0.02em; }

.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--green); border-radius: 3px; }

.calc-result { padding: 18px; border-radius: 12px; background: var(--accent-soft); margin-top: 14px; }
.calc-result .big { font-size: 28px; font-weight: 750; letter-spacing: -0.03em; color: var(--accent); }

/* ── 사파리 주소창 높이 변화 대응 ── */
.app { height: 100dvh; }
.chat { height: calc(100dvh - 70px); }
.phone-only { display: none !important; }

/* ── 아이패드 세로 등 중간 크기: 왼쪽 좁은 아이콘 막대 ── */
@media (max-width: 1100px) and (min-width: 701px) {
  .app { grid-template-columns: 84px 1fr; }
  .side { padding: 14px 6px; }
  .brand-name, .brand-sub, .side-foot > div { display: none; }
  .brand { justify-content: center; padding: 2px 0 14px; }
  .side-foot { justify-content: center; padding: 8px 0; }
  .nav a { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 8px 2px; text-align: center; position: relative; }
  .nav svg { width: 21px; height: 21px; }
  .nav .badge { position: absolute; top: 3px; right: 12px; margin: 0; }
  .nav-sep { margin: 8px 10px; }
  .top { padding: 12px 20px; }
  .searchbox { width: 220px; }
  .searchbox kbd { display: none; }
  .page { padding: 6px 20px 40px; }
  .g-main { grid-template-columns: 1fr; }
  .chat { margin: 0 -20px -40px; grid-template-columns: 300px 1fr; }
}
@media (max-width: 900px) and (min-width: 701px) {
  .g3 { grid-template-columns: repeat(3, 1fr); }
  .g2 { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; }
  .chat.open .chat-list { display: none; }
  .chat:not(.open) .chat-main { display: none; }
  .tbl .hide-m { display: none; }
}

/* ── 휴대폰: 아래 탭 막대 ── */
@media (max-width: 700px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; bottom: 0; left: 0; right: 0; top: auto; height: calc(62px + env(safe-area-inset-bottom)); padding: 6px 6px env(safe-area-inset-bottom); flex-direction: row; z-index: 20; border-right: none; border-top: 1px solid var(--line); }
  .brand, .side-foot, .nav-sep { display: none; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; }
  .nav a { flex-direction: column; gap: 1px; font-size: 10.5px; padding: 5px 6px; position: relative; }
  .nav a.opt { display: none; }
  .phone-only { display: flex !important; }
  .nav .badge { position: absolute; top: 0; right: 2px; margin: 0; }
  .main { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .top { padding: 12px 16px; }
  .searchbox { width: auto; flex: 1; }
  .searchbox kbd, .searchbox span { display: none; }
  .page { padding: 6px 16px 40px; }
  .g2, .g3, .g-main, .form-grid { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; margin: 0 -16px; height: calc(100dvh - 140px); }
  .chat.open .chat-list { display: none; }
  .chat:not(.open) .chat-main { display: none; }
  .tbl .hide-m { display: none; }
}

/* ── 손가락 (아이패드·폰): 누르는 곳 크게, 끌어 놓기 안내는 숨김 ── */
@media (hover: none) and (pointer: coarse) {
  .btn { min-height: 38px; }
  .tabs button { padding: 7px 12px; }
  .item, .file, .folder { min-height: 48px; }
  input.f, select.f, textarea.f { font-size: 16px; } /* 사파리 자동 확대 막기 */
  .hide-touch { display: none; }
}

/* ── 자료: 폴더 ── */
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.crumbs button { border: none; background: none; padding: 4px 6px; border-radius: 7px; color: var(--sub); cursor: pointer; font-weight: 550; }
.crumbs button:hover { background: var(--line); }
.crumbs button.on { color: var(--text); font-weight: 680; }
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-bottom: 12px; }
.folder { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line); cursor: pointer; }
.folder:hover { border-color: var(--line-strong); }
.folder.over { border-color: var(--accent); background: var(--accent-soft); }
.folder svg { width: 22px; height: 22px; flex: none; stroke: var(--accent); fill: var(--accent-soft); stroke-width: 1.6; }
.chip.pick { cursor: pointer; padding: 5px 10px; }

/* ── 메일 ── */
.mailbox .chat-list { display: flex; flex-direction: column; }
.mailbox .chat-list .list { overflow: auto; flex: 1; }
.mailbox #mq { margin-top: 2px; }
.mrow { cursor: pointer; align-items: flex-start; }
.mrow.on { background: var(--accent-soft); }
.mrow .dot-u { width: 7px; height: 7px; border-radius: 50%; margin-top: 7px; flex: none; }
.mrow.unread .dot-u { background: var(--accent); }
.mrow:not(.unread) b { font-weight: 550; color: var(--sub); }
.mail-read { padding: 16px 22px 30px; overflow: auto; flex: 1; }
.mail-body { white-space: pre-wrap; word-break: break-word; line-height: 1.65; font-size: 14.5px; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.atts .file { max-width: 280px; padding: 8px 10px; }
.pick-files { max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; margin-top: 6px; display: grid; gap: 4px; }
@media (min-width: 901px) { .mailbox #bk { display: none; } }
@media (min-width: 1101px) { .mailbox { grid-template-columns: 360px 1fr; } }

/* ── 달력 ── */
.cal { padding: 0; overflow: hidden; }
.cal-h { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.cal-h div { padding: 8px 10px; font-size: 12px; color: var(--sub); font-weight: 600; }
.cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-d { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 4px 6px; min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.cal-d:nth-child(7n) { border-right: none; }
.cal-d:hover { background: var(--line); }
.cal-d.out { opacity: .4; }
.cal-n { font-size: 12.5px; font-weight: 600; padding: 2px 4px; display: flex; gap: 4px; align-items: baseline; }
.cal-n .hn { font-size: 10px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sun { color: var(--red); } .sat { color: var(--blue); }
.cal-d.today .cal-n { color: var(--accent); }
.cal-d.today .cal-n::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); align-self: center; }
.cal-e { font-size: 11.5px; line-height: 1.35; padding: 2px 6px; border-radius: 6px; background: var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-e.accent { background: var(--accent-soft); color: var(--accent); }
.cal-e.red { background: var(--red-soft); color: var(--red); }
.cal-e.amber { background: var(--amber-soft); color: var(--amber); }
.cal-e.green { background: var(--green-soft); color: var(--green); }
.cal-e.purple { background: rgba(140, 90, 200, .14); color: var(--purple); }
.cal-e.teal { background: rgba(40, 150, 150, .14); color: var(--teal); }
.cal-e.done { text-decoration: line-through; opacity: .6; }
.cal-more { font-size: 11px; color: var(--sub); padding: 0 6px; }
.chip.purple { background: rgba(140, 90, 200, .14); color: var(--purple); }
.chip.teal { background: rgba(40, 150, 150, .14); color: var(--teal); }
@media (max-width: 700px) {
  .cal-g { grid-template-rows: repeat(6, minmax(64px, 1fr)) !important; }
  .cal-e { font-size: 10px; padding: 1px 3px; }
  .cal-e b { display: none; }
  .cal-n .hn { display: none; }
}

/* 홍보 */
/* 홍보 (사건 탭과 같은 모양) */
.pm-split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 14px; align-items: start; }
.pm-way { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.pm-way span { font-size: 13px; padding: 4px 12px; border-radius: 20px; background: var(--line); color: var(--faint); }
.pm-way span.done { background: var(--green-soft); color: var(--green); }
.pm-way span.now { background: var(--accent); color: #fff; font-weight: 700; }
.pm-way i { width: 14px; height: 2px; background: var(--line-strong); }
.pm-video { overflow: hidden; }
.pm-video video { width: 100%; max-height: 56vh; background: #000; display: block; }
.pm-drop { padding: 30px 16px; text-align: center; }
.pm-big { font-size: 32px; line-height: 1.2; }
.pm-talk { display: flex; flex-direction: column; }
.pm-split .pm-talk { position: sticky; top: 8px; max-height: calc(100vh - 220px); }
.pm-msgs { flex: 1; max-height: 52vh; overflow: auto; padding: 8px 14px; display: flex; flex-direction: column; gap: 8px; }
.pm-msg { background: var(--line); border-radius: 10px; padding: 7px 10px; font-size: 13.5px; max-width: 92%; align-self: flex-start; }
.pm-msg.me { align-self: flex-end; background: var(--accent-soft); }
.pm-msg.ok { border: 1px solid var(--green); }
.pm-sys { align-self: center; font-size: 12px; color: var(--faint); text-align: center; }
.pm-in { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.pm-prog { margin-bottom: 8px; }
.pm-bar { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.pm-bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.pm-steps2 > div { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.pm-steps2 > div > b { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 13px; }
.pm-steps2 .grow { flex: 1; min-width: 0; }
.pm-upbtns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0 6px; }
.pm-upbtns.pm-head { margin: 0; }
.pm-upbtn { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.25; padding: 7px 16px; height: auto; }
.pm-upbtn small { font-size: 11px; font-weight: 400; opacity: .75; }
.pm-dz .pm-dest { color: var(--accent); }
.pm-pick { cursor: pointer; border-radius: 8px; } .pm-pick:hover, .pm-pick.on { background: var(--accent-soft); }
button.chip.pick { border: 0; cursor: pointer; font-size: 12.5px; padding: 4px 11px; }
@media (max-width: 1100px) { .pm-split { grid-template-columns: 1fr; } .pm-split .pm-talk { position: static; max-height: none; } }

/* 좁은 화면: 사건·홍보 편 머리에서 버튼 줄이 제목을 밀어 한 글자씩 세로로 깨지던 것 (2026. 10. 29.) */
/* 머리 첫 칸의 style="min-width:0" 보다 앞서게 !important (그래야 900~1100px 창에서도 제목이 한 글자씩 꺾이지 않음) */
.case-head > div:first-child { min-width: 200px !important; }
@media (max-width: 900px) {
  .case-head { flex-direction: column; gap: 12px; }
  .case-head > div:first-child { min-width: 0 !important; width: 100%; }
  .case-head > .row.wrap { width: 100%; }
  .case-head .pm-upbtns.pm-head { width: 100%; justify-content: stretch; }
  .case-head .pm-upbtns.pm-head .pm-upbtn { flex: 1 1 140px; }
}
/* 좁은 화면: 탭 이름이 한 글자씩 끊기지 않게 한 줄로 두고 옆으로 밀어 보기 */
@media (max-width: 700px) {
  .tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs > button { white-space: nowrap; flex: 0 0 auto; }
}

/* 파일 바로 보기 (화면 가득) — 작은 창(.overlay 50) 아래 */
.fv { position: fixed; inset: 0; z-index: 45; background: #17171b; display: flex; flex-direction: column; color: #fff; animation: fade .12s; }
.fv-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); }
/* 위 막대는 문서 위에 떠 있음 — 들고 나도 문서가 움직이지 않게 (자리를 차지하면 높이가 바뀌어 스크롤이 튐) */
.fv-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 6; background: rgba(23,23,27,.96); transition: transform .22s ease, opacity .18s ease, visibility 0s; }   /* 흐림은 뺌 — 큰 쪽 그림 위에서 매 프레임 다시 계산해 끊김 */
.fv.barhide .fv-bar { transform: translateY(-100%); opacity: 0; pointer-events: none; visibility: hidden; transition: transform .22s ease, opacity .18s ease, visibility 0s .22s; }
.fvp .pg { content-visibility: auto; }   /* 화면 밖 쪽은 그리지 않고 건너뜀 (크기는 폭·비율로 정해져 있음) */
.fv-main > .fv-body > iframe:not(.fv-doc), .fv-main .fv-img, .fv-main .fv-none, .fv-side { margin-top: var(--fvbh, 52px); }
.fv-main .fvp { padding-top: var(--fvbh, 52px); }
.fv-t { flex: 1; min-width: 0; padding: 0 6px; }
.fv-b { min-width: 38px; height: 38px; border-radius: 10px; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 20px; display: inline-grid; place-items: center; cursor: pointer; text-decoration: none; padding: 0 10px; }
.fv-b:hover { background: rgba(255,255,255,.22); }
.fv-b:disabled { opacity: .3; cursor: default; }
.fv-b svg { width: 18px; height: 18px; stroke: #fff; fill: none; stroke-width: 1.8; }
.fv-w { font-size: 13.5px; font-weight: 600; }
.fv-body { flex: 1; min-height: 0; display: flex; padding: 0 12px 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.fv-body iframe { flex: 1; width: 100%; height: 100%; border: 0; border-radius: 8px; background: #fff; }
.fv-img { flex: 1; display: grid; place-items: center; min-height: 0; overflow: auto; }
.fv-img img, .fv-img video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.fv-none { margin: auto; text-align: center; }
@media (max-width: 700px) { .fv-bar { gap: 4px; padding-left: 8px; padding-right: 8px; } .fv-body { padding: 0 0 env(safe-area-inset-bottom); } .fv-body iframe { border-radius: 0; } }
@media (max-width: 700px) { .fv-nw { display: none; } }
.fv-body iframe.fv-doc { background: #17171b; }

/* 협업 등급: 사건 밖 기능 단추 숨김 (서버에서도 막힘) */
.partner #nc, .partner #addR, .partner #nch, .partner #rooms, .partner [data-dm], .partner #conn { display: none !important; }

/* 파일 의견란 */
.fv-main { flex: 1; min-height: 0; display: flex; }
.fv-main .fv-body { flex: 1; min-width: 0; }
.fv-side { width: 360px; flex: none; background: var(--panel-solid); color: var(--text); display: flex; flex-direction: column; border-radius: 10px 0 0 10px; margin: var(--fvbh, 52px) 0 12px; overflow: hidden; }
.fv-n { background: #f59e0b; color: #111; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 2px; }
.fv-b.on { background: rgba(255,255,255,.18); }
.cm-h { display: flex; align-items: center; gap: 6px; padding: 12px; flex-wrap: wrap; }
.cm-h > b { white-space: nowrap; }
.cm-h .spacer { flex: 1; }
.cm-h a.on, .fv-side a.on { font-weight: 700; }
.cm-list { flex: 1; overflow: auto; padding: 0 12px; }
.cm { border-top: 1px solid var(--line, #e5e5e5); padding: 10px 0; }
.cm-r { margin-left: 18px; border-top: 1px dashed var(--line, #e5e5e5); }
.cm-q { font-size: 12.5px; color: var(--sub); border-left: 3px solid var(--line-strong); padding-left: 8px; margin-top: 4px; }
.cm-b { white-space: pre-wrap; margin-top: 4px; font-size: 14px; }
.cm-a { gap: 2px; margin-top: 2px; flex-wrap: wrap; }
.cm-new { border-top: 1px solid var(--line, #e5e5e5); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
@media (max-width: 700px) { .fv-main { flex-direction: column; } .fv-side { width: auto; height: 55%; border-radius: 12px 12px 0 0; margin: 0; } }

/* 보기 화면 PDF (의견란 열림): 쪽 그림 + 누를 수 있는 글줄 */
.fvp { flex: 1; overflow: auto; padding: 0 4px; }
.fvp .pg { -webkit-user-select: none; user-select: none; position: relative; background: #fff; margin: 0 auto 10px; max-width: 900px; }
.fvp .pg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.fvp .pgn { position: absolute; right: 6px; bottom: 4px; font-size: 11px; color: #888; }
.fvp .ln { position: absolute; border-radius: 3px; cursor: text; container-type: size; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.fvp .ln i, .pdfv .ln i { position: absolute; top: 0; height: 100%; font-style: normal; font-size: 82cqh; line-height: 100cqh; color: transparent; -webkit-text-fill-color: transparent; white-space: pre; overflow: hidden; -webkit-user-select: none; user-select: none; }
.fvp ::selection, .fvp::selection { background: rgba(255,255,255,.01); }
.fvp .ln i::selection, .pdfv .ln i::selection { background: rgba(255,255,255,.01); color: transparent; }
.fvp .ln i.on, .pdfv .ln i.on { background: none; }
.fvp .ln b.hl, .pdfv .ln b.hl { position: absolute; top: 0; height: 100%; background: rgba(255,196,0,.45); border-radius: 2px; pointer-events: none; }
.fvp .ln i:hover { background: rgba(47,59,143,.12); }
.fvp .ln.on { background: rgba(255,196,0,.38); outline: 1px solid rgba(200,150,0,.6); }

/* 터치 기기: 파일 칸을 길게 눌러도 글자 선택·미리보기 말풍선이 뜨지 않게 (우리 메뉴가 뜸) */
.file, .item, [data-f], [data-dir] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: rgba(47,59,143,.08); touch-action: manipulation; }

/* 사람마다 색 (comments.js personColor) */
.cm { border-left: 3px solid var(--pc, transparent); padding-left: 8px; }
.cm-qc { border-left-color: var(--pc); background: color-mix(in srgb, var(--pc) 12%, transparent); padding: 3px 8px; border-radius: 0 6px 6px 0; color: inherit; }
/* 문서 위 의견 자리: 고른 글자만 칠하고 끝에 점 (점을 누르면 그 의견으로) */
.fvp .ln b.cmh { position: absolute; top: 0; height: 100%; background: color-mix(in srgb, var(--pc) 24%, transparent); border-bottom: 2px solid var(--pc); border-radius: 2px; pointer-events: none; }
.fvp .cmdot { position: absolute; width: 14px; height: 14px; margin: -10px 0 0 -3px; padding: 0; border-radius: 50%; background: var(--pc); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); cursor: pointer; z-index: 2; }
.fvp .cmdot:hover { transform: scale(1.2); }
@media (max-width: 700px) { .fvp .cmdot { width: 11px; height: 11px; margin: -8px 0 0 -3px; border-width: 1.5px; } }
/* 손가락 화면만 누를 자리를 넓게 (보이지 않는 둘레) — 칠한 줄 쪽(아래)으로는 넓히지 않아 그 줄 끝 글자를 고를 수 있게 */
@media (pointer: coarse) { .fvp .cmdot::before { content: ''; position: absolute; inset: -11px -9px 0 -9px; border-radius: 50%; } }
.fvp .ln b.cmh.flash { animation: cmflash .45s ease-in-out 4; }
@keyframes cmflash { 50% { background: color-mix(in srgb, var(--pc) 65%, transparent); } }
.fvp .pg.flash { outline: 3px solid #f59e0b; outline-offset: 2px; animation: pgflash .45s step-end 4; }
@keyframes pgflash { 50% { outline-color: transparent; } }
.cm-go { cursor: pointer; }
.cm-go:hover { text-decoration: underline; }
.cm.cm-flash { animation: cmflash2 .5s ease-in-out 3; }
@keyframes cmflash2 { 50% { background: color-mix(in srgb, var(--pc) 16%, transparent); } }

/* 기록 탭 */
.ecfs-side { border-top: 1px solid var(--line); padding: 6px 0; }
.ecfs-side:first-child { border-top: 0; }
.ecfs-h { background: none; border: 0; padding: 8px 2px; font-size: 15px; cursor: pointer; color: inherit; display: flex; gap: 6px; align-items: center; }
.ecfs-kind { font-size: 13px; color: var(--sub); margin: 8px 0 6px 4px; font-weight: 600; }

.ecfs-inst button { font-weight: 600; }
/* 기록 탭 머리줄: 심급 탭이 줄어 잘리지 않게 — 넘치면 단추가 다음 줄로, 좁은 화면은 심급 탭이 한 줄 전체 */
.card-h.fh .ecfs-inst { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
@media (max-width: 700px) {
  .card-h.fh .ecfs-inst { flex: 1 1 100%; }
  .card-h.fh .ecfs-inst > button { flex: 1 0 auto; }
}

/* 의견에 붙은 자료 썸네일 */
.cm-att { display: inline-block; vertical-align: top; width: 170px; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); color: inherit; text-decoration: none; }
.cm-att img, .cm-att video { display: block; width: 100%; height: 120px; object-fit: contain; background: #fff; }
.cm-att .an { font-size: 12px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 사건 › 의뢰인 메시지 */
.cmx { max-width: 82%; align-self: flex-start; }
.cmx.me { align-self: flex-end; }
.cmx-w { font-size: 12px; color: var(--faint); margin: 0 4px 2px; }
.cmx.me .cmx-w { text-align: right; }
.cmx-b { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; white-space: pre-wrap; word-break: break-word; }
.cmx.me .cmx-b { background: color-mix(in srgb, var(--accent) 12%, var(--panel-solid)); }
.cmx-file { display: block; color: inherit; text-decoration: none; margin-bottom: 4px; }
.cmx-file img { display: block; max-width: 220px; max-height: 160px; border-radius: 8px; margin-bottom: 4px; background: #fff; }

/* ── 오늘: 한눈에 줄 · 다음 기일 · 날짜 머리 · 끝남 ── */
.today-date { margin-bottom: 14px; }
.glance { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.gl { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 11px; border-radius: 17px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3); box-shadow: var(--shadow); color: var(--text); font-weight: 560; font-size: 13px; cursor: pointer; white-space: nowrap; transition: transform .08s, border-color .12s, background .12s; }
.gl:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--panel-solid); }
.gl:active { transform: scale(.97); }
.gl svg { width: 15px; height: 15px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.gl b { font-size: 14px; font-weight: 720; font-variant-numeric: tabular-nums; }
.gl .gs { font-size: 12px; font-weight: 650; color: var(--sub); padding-left: 6px; border-left: 1px solid var(--line-strong); }
.gl .gs.red { color: var(--red); } .gl .gs.amber { color: var(--amber); }
.gl.hot { border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.gl.calm { cursor: default; color: var(--sub); box-shadow: none; }
.gl.calm:hover { border-color: var(--line); background: var(--panel); }
.glpop { position: absolute; z-index: 45; min-width: 240px; max-width: 340px; padding: 6px; box-shadow: var(--shadow-lg); background: var(--panel-solid); animation: pop .14s; }
.glpop .item { padding: 8px 10px; border-top: none; color: var(--text); }

.nh { display: flex; align-items: center; gap: 16px; padding: 14px 18px; margin-bottom: 16px; }
.nh > .grow { flex: 1; }
.nh-date { width: 60px; flex: none; display: flex; flex-direction: column; align-items: center; padding: 6px 0 7px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); line-height: 1.15; }
.nh-date .m, .nh-date .w { font-size: 11.5px; font-weight: 600; }
.nh-date .d { font-size: 25px; font-weight: 760; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.nh-date.on { background: var(--accent); color: var(--accent-text); }
.nh-k { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--sub); }
.nh-when { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; margin: 2px 0 1px; font-size: 16px; font-weight: 650; }
.nh-when b { font-size: 19px; font-weight: 760; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.nh-room { font-size: 14px; font-weight: 560; color: var(--accent); }
.nh-s { font-size: 13px; color: var(--sub); }
.nh-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
@media (max-width: 700px) {
  .g-main { grid-template-columns: minmax(0, 1fr); }   /* 긴 한 줄 글이 카드를 화면 밖으로 밀지 않게 */
  .glance { gap: 6px; }
  .gl { height: 32px; padding: 0 12px 0 10px; font-size: 12.5px; }
  .nh { flex-wrap: wrap; gap: 12px 14px; padding: 14px; }
  .nh > .grow { flex: 1; }
  .nh-act { width: 100%; }
  .nh-act .btn { flex: 1; justify-content: center; }
}

.dhead { display: flex; align-items: center; gap: 6px; padding: 12px 6px 2px; font-size: 13px; }
.dgroup:first-child .dhead { padding-top: 0; }
.dhead b { font-weight: 700; }
.dhead .spacer, .dtitle .spacer { flex: 1; }
.card-h.dtitle { font-size: 14.5px; gap: 6px; }
.card-h.dtitle b { font-weight: 680; }
.item .tm { width: 54px; flex: none; font-size: 16.5px; font-weight: 740; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.item .tm.sm { font-size: 12px; font-weight: 600; color: var(--faint); }
.item .tm.red { font-size: 12.5px; font-weight: 700; color: var(--red); }
.item.done .tm { color: var(--faint); }

.fin { flex: none; display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 10px 0 8px; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--panel-solid); color: var(--sub); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: color .12s, border-color .12s, background .12s, opacity .12s; }
.fin::before { content: "✓"; font-weight: 800; }
.fin:hover, .item.finish .fin { border-color: var(--green); color: var(--green); background: var(--green-soft); }
@media (hover: hover) { .item .fin { opacity: .5; } .item:hover .fin, .item .fin:focus-visible { opacity: 1; } }
.item.finish, .item.finish:hover { background: var(--green-soft); }
.item.fold { overflow: hidden; transition: height .26s ease, padding .26s ease, opacity .2s ease; }
.item.folded { height: 0 !important; padding-top: 0; padding-bottom: 0; opacity: 0; border-top-color: transparent; }

.past7 .card-h { cursor: pointer; user-select: none; }
.past7 .caret { display: inline-block; color: var(--faint); font-weight: 700; transition: transform .15s; }
.past7.open .caret { transform: rotate(90deg); }
.past7:not(.open) .p7b { display: none; }
.past7 .p7b { opacity: .8; }

/* 손가락: 과제 체크·끝남 단추를 크게 */
@media (pointer: coarse) {
  .check { position: relative; width: 24px; height: 24px; border-radius: 8px; }
  .check::before { content: ""; position: absolute; inset: -10px; }
  .fin { height: 32px; padding: 0 12px 0 10px; border-radius: 16px; }
}

/* 기일 안내 문자 제안: 오늘 화면 한눈에 줄 아래 한 줄 → 누르면 그 자리에서 한 장씩 */
.hn-slot { margin: -4px 0 16px; }
.hn-open { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 16px 0 14px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent); background: color-mix(in srgb, var(--accent) 7%, var(--panel-solid)); box-shadow: var(--shadow); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; transition: border-color .12s, transform .08s; }
.hn-open:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.hn-open:active { transform: scale(.995); }
.hn-open svg { width: 17px; height: 17px; flex: none; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hn-open .grow { flex: 1; min-width: 0; }
.hn-open b { color: var(--accent); }
.hn-open .hn-go { color: var(--accent); font-size: 19px; font-weight: 700; line-height: 1; }
.hn-card { padding: 12px 16px 14px; }   /* 화면이 다시 그려질 때마다 튀지 않게 움직임 없음 */
.hn-card .hn-h { gap: 6px; margin-bottom: 6px; }
.hn-card .hn-q { font-weight: 650; margin-bottom: 8px; }
.hn-card textarea { width: 100%; font-size: 13px; line-height: 1.55; }
.hn-card [data-to] { width: 100%; margin-top: 6px; }
.hn-card .hn-f { justify-content: flex-end; gap: 6px; margin-top: 10px; }
.hn-card .hn-pos { font-variant-numeric: tabular-nums; }
@media (pointer: coarse) { .hn-card .hn-mv { width: 36px; height: 36px; padding: 0; justify-content: center; font-size: 17px; } }

/* ── 일정·과제 다듬기 (plan.js) ── */
/* 달력: 날짜를 누르면 그날 목록 — 넓으면 오른쪽, 좁으면 아래 */
.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
@media (min-width: 1180px) {
  .cal-wrap { grid-template-columns: minmax(0, 1fr) 290px; }
  .cal-side { position: sticky; top: 72px; max-height: calc(100dvh - 96px); overflow: auto; }
}
@media (min-width: 1440px) { .cal-wrap { grid-template-columns: minmax(0, 1fr) 320px; } }
.cal-side { min-width: 0; }
.cal-side .card-b { padding-top: 0; }
.cal-d { position: relative; transition: background .12s; }
.cal-d.sel, .cal-d.sel:hover { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
.cal-d.sel.out { opacity: .7; }
.cal-more { cursor: pointer; }
.cal-add { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: var(--accent); color: var(--accent-text); font: inherit; font-size: 16px; font-weight: 600; line-height: 1; cursor: pointer; opacity: 0; transform: scale(.85); transition: opacity .12s, transform .12s; }
.cal-d:hover .cal-add, .cal-add:focus-visible { opacity: 1; transform: none; }
@media (hover: none) { .cal-add { display: none; } }
.cal-none { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; margin-top: 4px; padding: 24px 10px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: none; color: var(--faint); font: inherit; font-size: 13px; cursor: pointer; transition: border-color .12s, background .12s; }
.cal-none b { color: var(--accent); font-weight: 650; }
.cal-none:hover { border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 700px) {
  .cal-g { grid-template-rows: none !important; grid-auto-rows: minmax(58px, auto); }   /* 폰: 빈 여섯째 줄 없이 — 그날 목록이 바로 아래 보이게 */
  .top:has(#cm) h1 { white-space: nowrap; }   /* '일정' 글자가 두 줄로 쪼개지지 않게 */
  #ne .ne-l { display: none; }   /* 폰: 위 [＋] 는 아이콘만 (그날 칸에 [＋ 일정]이 있음) */
}

/* 빠른 단추 (일정 내용·시각, 과제 기한) */
.qk { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.qk[hidden] { display: none; }
.qk-b { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--panel-solid); color: var(--sub); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; font-variant-numeric: tabular-nums; transition: color .12s, border-color .12s, background .12s; }
.qk-b span { font-weight: 500; color: var(--faint); }
.qk-b:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--text); }
.qk-b.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }
.qk-b.on span { color: inherit; opacity: .75; }
#qkTm { gap: 5px; } #qkTm .qk-b { padding: 0 8px; }   /* 시각 7개가 한 줄에 */
@media (pointer: coarse) { .qk-b { height: 32px; padding: 0 12px; border-radius: 16px; } #qkTm .qk-b { padding: 0 10px; } }
label.l .ev-open { float: right; font-size: 12px; font-weight: 600; }

/* 다음 기일 잡기 */
.nx-ask { display: flex; align-items: center; gap: 12px; margin: 0 18px 8px; padding: 10px 12px 10px 14px; border-radius: 12px; background: var(--accent-soft); }
.nx-ask .grow { flex: 1; min-width: 0; }
.nx-ask b { font-weight: 650; }
.nx-from { margin: 2px 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 600; }

/* 과제: 마감별 묶음 · 탭 숫자 · 맡긴 과제 사람 카드 */
.tabs .tn { margin-left: 5px; font-size: 11.5px; font-weight: 700; color: var(--faint); font-variant-numeric: tabular-nums; }
.tabs .tn:empty { display: none; }
.tabs .tn.r { color: var(--red); }
.tgroups { padding-top: 12px; }
.tgroups .dgroup + .dgroup { margin-top: 6px; }
.dhead b.r { color: var(--red); }
.dhead b.a { color: var(--amber); }
.dhead .tg-n { color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; }
/* 과제 [마감별 | 사건별] 전환 · 사건별 접는 카드 (plan.js caseGroups) */
.tbar { margin-bottom: 12px; flex-wrap: wrap; row-gap: 8px; }
.tbar #tv { margin-left: auto; }
.tbar #tv[hidden] { display: none; }
#tl.cgs { display: flex; flex-direction: column; gap: 10px; }
.cg > .card-h h3.cg-h { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
.cg-name { display: flex; align-items: baseline; gap: 5px; min-width: 0; color: inherit; text-decoration: none; border-radius: 6px; }
.cg-name .ell { min-width: 0; }
.cg-name .cg-go { flex: none; font-size: 12.5px; font-weight: 500; color: var(--faint); transition: transform .15s ease, color .15s ease; }
a.cg-name:hover .cg-go, a.cg-name:focus-visible .cg-go { color: var(--accent); transform: translateX(2px); }
a.cg-name:hover .ell { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.cg-name.none { color: var(--sub); white-space: nowrap; }
.cg-n { flex: none; font-size: 12.5px; font-weight: 500; color: var(--faint); white-space: nowrap; }
.cg-due { flex: none; font-size: 12px; font-weight: 560; color: var(--sub); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cg-due.chip { font-size: 11.5px; font-weight: 650; }
.cg > .fold-b .card-b.list { padding-top: 0; }
.cg.cg-gone { opacity: 0; transform: scale(.985); transition: opacity .24s ease, transform .24s ease; pointer-events: none; }
@media (max-width: 700px) { .tbar #tv { margin-left: 0; } }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 14px; align-items: start; }
.pcard .card-h { gap: 8px; }
.pcard .card-h > b { font-size: 14.5px; font-weight: 680; min-width: 0; }
.pcard .card-h .btn svg { width: 14px; height: 14px; }
/* ── 왼쪽 메뉴: 세 묶음(접은 것 기억), 메뉴만 스크롤, 이름 칸은 바닥에 ── */
.app { grid-template-rows: minmax(0, 1fr); }   /* 메뉴가 길어도 화면 높이 안에서 (메뉴만 스크롤) */
.side { min-height: 0; }
.nav { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; margin: 0 -4px; padding: 0 4px 6px; }
.nav::-webkit-scrollbar { display: none; }
.nav.more-down { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent); }
.nav.more-up { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22px); mask-image: linear-gradient(to bottom, transparent, #000 22px); }
.nav.more-up.more-down { -webkit-mask-image: linear-gradient(to bottom, transparent, #000 22px, #000 calc(100% - 30px), transparent); mask-image: linear-gradient(to bottom, transparent, #000 22px, #000 calc(100% - 30px), transparent); }
.nav-g { display: flex; flex-direction: column; gap: 2px; }
.nav-g + .nav-g { margin-top: 6px; }
.nav-g.flat + .nav-g.flat .nav-sep { display: none; }
.nav-g.flat { margin-top: 0; }
.nav-gh { position: relative; display: flex; align-items: center; gap: 6px; border: none; background: none; padding: 7px 10px 4px; font-size: 11.5px; font-weight: 650; color: var(--sub); opacity: .85; letter-spacing: .01em; cursor: pointer; border-radius: 8px; text-align: left; }
/* 묶음 이름('사건 업무'·'사무실')은 --faint 이면 다크에서 거의 안 보임(P8 검증) → 한 단계 진한 --sub, 메뉴 글보다는 옅게 */
.nav-gh:hover { color: var(--text); opacity: 1; background: var(--line); }
.nav-gh .nav-gt { flex: 1; }
.nav-gh svg { width: 14px; height: 14px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s; }
.nav-g.fold .nav-gh svg { transform: rotate(-90deg); }
.nav-gh .badge { height: 16px; min-width: 16px; font-size: 10px; padding: 0 4px; }
.nav-g:not(.fold) .nav-gh .badge { display: none; }
.nav-gb { display: flex; flex-direction: column; gap: 2px; }
.nav-g.fold .nav-gb > :not(.on) { display: none; }   /* 접혀도 지금 보는 화면 줄은 남김 */
.nav-g:not(.fold) .nav-gb > * { animation: navIn .18s ease-out; }
@keyframes navIn { from { opacity: 0; transform: translateY(-3px); } }
.nav .ndot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--amber); margin-left: auto; margin-right: 5px; box-shadow: 0 0 0 3px var(--amber-soft); }
.side-foot .grow { flex: 1; min-width: 0; }
.side-foot > svg { width: 16px; height: 16px; flex: none; stroke: var(--faint); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s, stroke .15s; }
.side-foot:hover > svg { stroke: var(--sub); transform: rotate(45deg); }

/* ── 🔔 놓친 알림 ── */
.bell { position: relative; width: 36px; height: 36px; flex: none; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); display: grid; place-items: center; color: var(--sub); cursor: pointer; padding: 0; transition: background .12s, color .12s; }
.bell:hover, .bell.on { color: var(--text); background: var(--panel-solid); }
.bell svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bell-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--panel-solid); animation: pop .2s; }
.bellpop { position: fixed; z-index: 65; width: min(400px, calc(100vw - 24px)); max-height: min(72vh, 640px); display: flex; flex-direction: column; overflow: hidden;
  background: color-mix(in srgb, var(--panel-solid) 90%, transparent); backdrop-filter: blur(28px) saturate(1.4); -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop .16s cubic-bezier(.2,.9,.3,1.2); transform-origin: top right; }
.bp-h { display: flex; align-items: center; gap: 8px; padding: 10px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.bp-h b { font-size: 15px; }
.bp-h .grow { flex: 1; }
.bp-h .btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.bp-b { overflow: auto; padding: 2px 6px 8px; overscroll-behavior: contain; }
.bp-g { font-size: 11.5px; font-weight: 650; color: var(--faint); padding: 10px 10px 3px; }
.bp-it { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px 9px 12px; border-radius: 11px; color: var(--text); cursor: pointer; position: relative; }
.bp-it:hover, .bp-it:focus-visible { background: var(--line); outline: none; }
.bp-it.fresh { background: var(--accent-soft); }
.bp-it.fresh::before { content: ''; position: absolute; left: 3px; top: 21px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.bp-it.fresh .t { font-weight: 650; }
.bp-ic { width: 30px; height: 30px; flex: none; border-radius: 9px; background: var(--line); display: grid; place-items: center; color: var(--sub); }
.bp-it.fresh .bp-ic { background: var(--panel-solid); color: var(--accent); }
.bp-it.urgent .bp-ic { color: var(--red); background: var(--red-soft); }
.bp-ic svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bp-it .grow { flex: 1; min-width: 0; }
.bp-it .t { font-size: 13.5px; line-height: 1.35; }
.bp-it .t .chip { font-size: 10.5px; padding: 0 6px; }
.bp-it .s { font-size: 12.5px; color: var(--sub); line-height: 1.4; margin-top: 1px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.bp-tm { font-size: 11.5px; color: var(--faint); white-space: nowrap; padding-top: 1px; font-variant-numeric: tabular-nums; }

/* ── ⌘K 찾기: 찾은 글자 칠하기, 빈 창 바로 하기, 키 안내 ── */
.palette mark { background: rgba(255, 208, 0, .42); color: inherit; border-radius: 3px; padding: 0 1px; }
.pc-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 4px 6px; }
.palette .pc-quick .it { border: 1px solid var(--line); background: var(--panel-solid); padding: 7px 13px 7px 11px; gap: 7px; font-weight: 550; }
.palette .pc-quick .it.sel, .palette .pc-quick .it:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.palette .ficon.sm { width: 22px; height: 27px; font-size: 7px; border-radius: 4px; font-weight: 800; }
.palette .res .empty { padding: 14px 10px; }
.pc-foot { display: flex; gap: 14px; flex-wrap: wrap; padding: 8px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); }
.pc-foot kbd { font-family: inherit; font-size: 10.5px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; margin-right: 3px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .palette mark { background: rgba(255, 200, 0, .3); } }
:root[data-theme="dark"] .palette mark { background: rgba(255, 200, 0, .3); }

/* 아이패드 세로 등 아이콘 막대 */
@media (max-width: 1100px) and (min-width: 701px) {
  .nav-gh { justify-content: center; padding: 8px 2px 3px; font-size: 10px; gap: 2px; }
  .nav-gh .nav-gt { flex: none; }
  .nav-gh svg { width: 11px; height: 11px; }
  .nav-gh .badge { position: absolute; top: -2px; right: 6px; }
  .nav .ndot { position: absolute; top: 7px; right: 18px; margin: 0; }
  .side-foot > svg { display: none; }
}
/* 폰: 아래 탭 막대 (묶음 머리는 숨기고 첫 묶음만), 알림은 위쪽에 */
@media (max-width: 700px) {
  .nav { overflow: visible; margin: 0; padding: 0; -webkit-mask-image: none !important; mask-image: none !important; }
  .nav-g, .nav-gb { display: contents; }
  .nav-gh { display: none; }
  .nav .ndot { position: absolute; top: 4px; right: 9px; margin: 0; }
  .nav-g:not(.fold) .nav-gb > * { animation: none; }
  .bell { width: 38px; height: 38px; }
  .bellpop { top: calc(env(safe-area-inset-top) + 62px); left: 12px; right: 12px; width: auto; max-height: calc(100dvh - 170px); transform-origin: top center; }
  /* 알림 띠는 위에서, 단추 있는 띠(되돌리기 등)는 엄지 닿는 아래 탭 막대 바로 위에 (갤럭시와 같게) */
  .toasts { top: calc(env(safe-area-inset-top) + 10px); bottom: calc(72px + env(safe-area-inset-bottom)); left: 12px; right: 12px; pointer-events: none; }
  .toast { max-width: none; min-width: 0; pointer-events: auto; animation: dropIn .22s cubic-bezier(.2,.9,.3,1.15); }
  .toast.act { order: 1; margin-top: auto; animation-name: riseIn; }
  .toast.act ~ .toast.act { margin-top: 0; }
  .pc-foot { display: none; }
}
@keyframes dropIn { from { transform: translateY(-14px); opacity: 0; } }
@keyframes riseIn { from { transform: translateY(14px); opacity: 0; } }
/* 13인치 노트북처럼 낮은 화면: 메뉴 줄 간격을 조금 줄여 접은 묶음 머리까지 다 보이게 */
@media (min-width: 1101px) and (max-height: 820px) {
  .side { padding-top: 14px; }
  .brand { padding-bottom: 10px; }
  .nav a { padding-top: 6px; padding-bottom: 6px; }
  .nav-gh { padding-top: 5px; }
}
@media (hover: none) { .pc-foot, .palette .it kbd { display: none; } .bp-it { padding-top: 11px; padding-bottom: 11px; } }
/* ═══ 파일: 썸네일 칸 · 작은 메뉴 · 어디든 끌어 놓기 (filekit.js) ═══ */
:root { --dot: #1b74f0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --dot: #4d9bff; } }
:root[data-theme="dark"] { --dot: #4d9bff; }
/* 썸네일: 그림이 오기 전·없으면 확장자 색 네모 */
.fth { position: relative; overflow: hidden; display: grid; place-items: center; --fx: #8a8f9c; }
.fth::before { content: attr(data-x); width: 38px; height: 46px; border-radius: 7px; background: var(--fx); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; letter-spacing: 0; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.fth.has::before { visibility: hidden; }
.fth img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; background: #fff; opacity: 0; transition: opacity .22s; }
.fth img.on { opacity: 1; }
.fth.photo img { object-position: center; }
.fth.pdf { --fx: #d0463b; } .fth.hwp, .fth.hwpx { --fx: #2f7ac4; } .fth.doc, .fth.docx { --fx: #2c5aa8; } .fth.xls, .fth.xlsx, .fth.csv { --fx: #2e8b57; }
.fth.ppt, .fth.pptx { --fx: #d0743b; } .fth.jpg, .fth.jpeg, .fth.png, .fth.heic, .fth.gif, .fth.webp { --fx: #8b5cc4; } .fth.mp4, .fth.mov, .fth.m4a, .fth.mp3 { --fx: #c4495e; }
/* 파일 칸 (크게) */
.files { grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.file { position: relative; flex-direction: column; align-items: stretch; gap: 0; padding: 0; border-radius: 13px; overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.fcov { position: relative; height: 118px; flex: none; background: color-mix(in srgb, var(--text) 4%, var(--panel-solid)); border-bottom: 1px solid var(--line); }
.fcov .fth { position: absolute; inset: 12px 18px 0; border-radius: 6px 6px 0 0; transition: transform .18s; }
.fcov .fth.has { box-shadow: 0 1px 7px rgba(0,0,0,.13); }
.fcov .fth.photo { inset: 0; border-radius: 0; }
.file:hover .fcov .fth.has:not(.photo) { transform: translateY(-3px); }
.fbody { padding: 8px 11px 10px; min-width: 0; }
.fname { font-weight: 560; font-size: 13.5px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; min-height: 2.7em; }
.fmeta { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 11.5px; color: var(--faint); }
.fmeta .ell { flex: 1; min-width: 0; }
.fchips { position: absolute; left: 8px; bottom: 7px; display: flex; gap: 4px; flex-wrap: wrap; z-index: 1; }
.fchips .chip { background: var(--panel-solid); box-shadow: 0 1px 4px rgba(0,0,0,.16); }
.fchips .chip.amber { background: color-mix(in srgb, var(--amber) 16%, var(--panel-solid)); }
.fchips .chip.green { background: color-mix(in srgb, var(--green) 16%, var(--panel-solid)); }
.fchips-l { display: none; }
.fnew { position: absolute; top: 8px; left: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 2px var(--panel-solid); z-index: 2; }
.fmore { position: absolute; top: 6px; right: 6px; z-index: 2; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 9px; display: grid; place-items: center; cursor: pointer; color: var(--sub);
  background: color-mix(in srgb, var(--panel-solid) 86%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 1px 4px rgba(0,0,0,.16); opacity: 0; transition: opacity .12s; }
.fmore svg { width: 18px; height: 18px; stroke: currentColor; fill: currentColor; stroke-width: 1.2; }
.file:hover .fmore, .fmore:focus-visible { opacity: 1; }
.fmore:hover { color: var(--text); }
@media (hover: none) { .fmore { opacity: .92; } }
/* 목록으로 보기 (한 줄) */
.flist .files { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.flist .file { flex-direction: row; align-items: center; gap: 10px; padding: 7px 10px 7px 8px; }
.flist .fcov { position: static; height: auto; width: 38px; background: none; border: 0; }
.flist .fcov .fth { position: relative; inset: auto; width: 38px; height: 46px; border-radius: 6px; transform: none !important; }
.flist .fcov .fth::before { width: 34px; height: 40px; font-size: 10px; }
.flist .fcov .fth.has { box-shadow: 0 0 0 1px var(--line-strong); }
.flist .fbody { flex: 1; padding: 0 30px 0 0; }
.flist .fname { -webkit-line-clamp: 1; min-height: 0; }
.flist .fchips { display: none; }
.flist .fchips-l { display: inline-flex; gap: 4px; flex: none; }
.flist .fnew { top: 5px; left: 5px; }
.flist .fmore { top: 50%; right: 6px; transform: translateY(-50%); width: 28px; height: 28px; box-shadow: none; background: none; }
@media (max-width: 560px) {
  .files { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 10px; }
  .fcov { height: 104px; }
  .flist .files { grid-template-columns: 1fr; }
}
/* 방금 올린 파일: 한 번 반짝 */
.file.fresh { animation: fresh 1.5s ease-out; }
@keyframes fresh { 0% { transform: scale(.95); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); } 25% { transform: scale(1.02); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 22%, transparent); } 100% { transform: none; box-shadow: 0 0 0 14px transparent; } }
.file.fresh::after { content: '✦'; position: absolute; top: 2px; right: 40px; z-index: 3; color: #f5b301; font-size: 18px; pointer-events: none; animation: spark 1.4s ease-out forwards; }
@keyframes spark { 0% { opacity: 0; transform: scale(.3) rotate(-30deg); } 30% { opacity: 1; transform: scale(1.3) rotate(10deg); } 100% { opacity: 0; transform: translateY(-8px) scale(.9) rotate(30deg); } }
/* 차례·보는 모양 단추 */
.tabs.seg { padding: 2px; border-radius: 9px; flex: none; }
.tabs.seg button { padding: 3px 9px; font-size: 12px; display: inline-flex; align-items: center; }
.tabs.seg svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
.card-h.fh { flex-wrap: wrap; row-gap: 8px; }
@media (max-width: 700px) { .card-h.fh #fsq { flex: 1 1 140px; width: auto !important; } }
/* 대화: 파일은 썸네일 (누르면 이 방 파일을 차례로) */
.msg-file { cursor: pointer; }
.msg-file .fth.msg { width: 40px; height: 46px; flex: none; }
.msg-file:has(.fth img) { flex-direction: column; align-items: stretch; width: 240px; min-width: 0; gap: 6px; }
.msg-file .fth.msg:has(img) { width: 100%; height: 150px; border-radius: 10px; background: color-mix(in srgb, var(--text) 5%, var(--panel-solid)); }
.msg.me .msg-file .fth.msg:has(img) { background: rgba(255,255,255,.16); }
.msg-file .mf-t { min-width: 0; }
/* 메일·결재 첨부: 썸네일 칸 */
.atts-t { display: flex; flex-wrap: wrap; gap: 10px; }
.att { width: 132px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); overflow: hidden; cursor: pointer; text-align: left; color: inherit; font: inherit; display: flex; flex-direction: column; transition: box-shadow .15s, border-color .15s; }
.att:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.att .fth { height: 92px; width: 100%; background: color-mix(in srgb, var(--text) 4%, var(--panel-solid)); }
.att .an { font-size: 12px; padding: 6px 8px; }
/* 커서 옆 작은 파일 메뉴 */
.fctx { position: fixed; z-index: 80; min-width: 240px; max-width: 330px; padding: 6px; border-radius: 14px; font-size: 13.5px;
  background: color-mix(in srgb, var(--panel-solid) 92%, transparent); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); animation: ctxin .12s ease-out; }
@keyframes ctxin { from { opacity: 0; transform: scale(.97); } }
.fctx-h { display: flex; gap: 10px; align-items: center; padding: 4px 8px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.fctx-h .fth.sm { width: 32px; height: 40px; border-radius: 5px; flex: none; box-shadow: 0 0 0 1px var(--line); }
.fctx-h .fth.sm::before { width: 32px; height: 40px; font-size: 9px; border-radius: 5px; box-shadow: none; }
.fctx-n { font-weight: 650; font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.fctx-i { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.fctx-i:hover, .fctx-i:focus-visible { background: var(--accent-soft); outline: none; }
.fctx-i svg { width: 16px; height: 16px; flex: none; stroke: var(--sub); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.fctx-i[data-nat]::before { content: ''; width: 16px; flex: none; }
.fctx-i > .chip { margin-left: auto; }
.fctx-i.danger { color: var(--red); } .fctx-i.danger svg { stroke: var(--red); }
.fctx hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
.fctx-ev { cursor: default; } .fctx-ev:hover { background: none; }
.fctx-ev.go { cursor: pointer; } .fctx-ev.go:hover { background: var(--accent-soft); }
.fctx-evs { margin-left: auto; display: flex; gap: 4px; }
.fctx-evs button { border: 1px solid var(--line-strong); background: var(--panel-solid); border-radius: 7px; padding: 2px 7px; font: inherit; font-size: 12px; font-weight: 650; color: var(--accent); cursor: pointer; white-space: nowrap; }
.fctx-evs button:hover, .fctx-evs button:focus-visible { background: var(--accent); color: var(--accent-text); border-color: transparent; outline: none; }
.fctx-rn { padding: 6px 6px 4px; width: 310px; max-width: 100%; }
.fctx.sheet { left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); max-width: none; max-height: 80vh; overflow: auto; border-radius: 18px; animation: sheetin .18s ease-out; }
.fctx.sheet .fctx-rn { width: auto; }
@keyframes sheetin { from { transform: translateY(30px); opacity: 0; } }
@media (hover: none) and (pointer: coarse) { .fctx-i { min-height: 44px; font-size: 15px; } }
/* 올리는 중 · 다 올림 */
.toast.up { min-width: 280px; cursor: default; }
.upbar { height: 4px; border-radius: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.upbar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .2s; }
.toast.up.ok { display: flex; align-items: center; gap: 12px; cursor: pointer; border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.toast.up.ok .tt { color: var(--green); }
/* 어디든 끌어 놓기 안내 */
.gdrop { position: fixed; inset: 8px; z-index: 66; pointer-events: none; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 36px;
  border: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent); border-radius: 18px; background: color-mix(in srgb, var(--accent) 6%, transparent); animation: fade .12s; transition: opacity .12s; }
.gdrop.zone { opacity: 0; }
.gdrop-p { max-width: min(560px, 90vw); padding: 12px 18px; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); font-size: 14px; }
.gd-list { display: grid; gap: 6px; }
.gd-case { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-solid); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.gd-case .grow { flex: 1; display: flex; flex-direction: column; }
.gd-case kbd { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--line-strong); font-family: inherit; font-size: 12px; color: var(--faint); }
.gd-case .gd-go { flex: none; color: var(--accent); font-size: 12.5px; font-weight: 600; white-space: nowrap; opacity: 0; transition: opacity .12s; }
.gd-case:hover, .gd-case:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.gd-case:hover .gd-go, .gd-case:focus-visible .gd-go { opacity: 1; }
@media (hover: none) { .gd-case .gd-go { opacity: 1; } .gd-case kbd { display: none; } }
.fctx-bg { position: fixed; inset: 0; z-index: 79; background: rgba(10,10,20,.22); animation: fade .15s; }

/* ── 사건 머리: 챙길 것 · 단계별 단추 · ⋯ ── */
.ch-main { flex: 1; min-width: 0; }
.case-head h2 { display: flex; align-items: center; gap: 4px; }
.ch-edit { width: 28px; height: 28px; flex: none; opacity: .5; transition: opacity .12s; }
.case-head:hover .ch-edit, .ch-edit:focus-visible { opacity: 1; }
.ch-acts { align-items: center; justify-content: flex-end; }
.ch-todo { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.todo { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 12px 0 10px; border-radius: 14px; border: 1px solid transparent;
  background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: border-color .12s, transform .06s; }
.todo::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.todo b { font-weight: 780; font-variant-numeric: tabular-nums; }
.todo:hover { border-color: color-mix(in srgb, currentColor 45%, transparent); }
.todo:active { transform: scale(.97); }
.todo.red { background: var(--red-soft); color: var(--red); }
@media (hover: none) { .ch-edit { opacity: .8; } .todo { height: 34px; } }
/* 탭: 자주 쓰는 8개 + 더보기, 아래로 내려도 위에 붙어 있음 */
.ctabs-bar { position: sticky; top: 0; z-index: 4; margin: 0 -28px 12px; padding: 6px 28px; border-bottom: 1px solid transparent; transition: background .15s, border-color .15s; }
.ctabs-bar.stuck { background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-bottom-color: var(--line); }
.ctabs-pill { display: flex; align-items: center; max-width: 100%; }
#ctabs { display: flex; gap: 2px; min-width: 0; max-width: none; overflow-x: auto; scrollbar-width: none; }
#ctabs::-webkit-scrollbar { display: none; }
.ct-more { display: inline-flex; align-items: center; gap: 3px; flex: none; white-space: nowrap; margin-left: 2px; }
.ct-more svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.ct-more[aria-expanded="true"] svg { transform: rotate(180deg); }
.ctm-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 2px; }
.tdot { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 5px; margin-left: 5px; border-radius: 9px; background: var(--accent); color: var(--accent-text); font-size: 10.5px; font-weight: 720; font-variant-numeric: tabular-nums; vertical-align: 1px; }
.tdot.red { background: var(--red); color: #fff; }
.tn { margin-left: 5px; color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }
.fctx-i .tdot, .fctx-i .tn { margin-left: auto; }
.fctx-i.on { color: var(--accent); font-weight: 650; }
.fctx-i.cmf { gap: 10px; }
.fctx-i.cmf .fth.sm { width: 26px; height: 32px; border-radius: 4px; flex: none; box-shadow: 0 0 0 1px var(--line); }
.fctx-i.cmf .fth.sm::before { width: 26px; height: 32px; font-size: 8px; border-radius: 4px; box-shadow: none; }
@media (max-width: 1100px) and (min-width: 701px) { .ctabs-bar { margin: 0 -20px 12px; padding: 6px 20px; } }   /* .page 좌우 여백 20px 에 맞춤 (옆으로 밀리지 않게) */
@media (max-width: 700px) { .ctabs-bar { margin: 0 -16px 10px; padding: 6px 16px; } }
/* 당사자 줄: 글자를 누르면 복사, 마우스를 올리면 단추 */
.party .pacts { display: flex; align-items: center; gap: 2px; flex: none; opacity: 0; transition: opacity .12s; }
.party:hover .pacts, .party:focus-within .pacts { opacity: 1; }
.btn.sm.icon-btn { width: 28px; height: 28px; padding: 0; }
.cp { cursor: copy; border-radius: 4px; padding: 0 2px; margin: 0 -2px; transition: background .1s, color .1s; }
.cp:hover { background: var(--accent-soft); color: var(--accent); }
@media (hover: hover) { .tel-only { display: none !important; } }
@media (hover: none) { .party .pacts { opacity: 1; } .party .pedit { display: none; } }
@media (max-width: 560px) { .pacts .pl { display: none; } .item.party { gap: 8px; } .party .pacts { gap: 0; } .party .pacts .btn.sm.icon-btn, .party .pacts .btn.sm { width: 26px; padding: 0; justify-content: center; } }
/* 의뢰인 주소록 연락처: 값 옆 작은 단추 */
.ctc { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 28px; }
.ctc-b { display: inline-flex; gap: 2px; opacity: .7; transition: opacity .12s; }   /* 연락처 카드는 몇 줄뿐이라 늘 보이게 */
.ctc:hover .ctc-b, .ctc:focus-within .ctc-b { opacity: 1; }
.ik-ph { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.ik-ph .btn.sm.icon-btn { width: 24px; height: 24px; }
.ik-ph .btn.sm.icon-btn svg { width: 13px; height: 13px; }
.main:has(.ctabs-bar.stuck) .top { border-bottom-color: transparent; }   /* 제목 띠와 탭 줄이 한 장의 유리처럼 */
#cbody .g-main > *, #cbody .g-main > .grid > * { min-width: 0; }   /* 긴 메일 주소·단추 때문에 폰에서 옆으로 넘치지 않게 */
.party .s { overflow-wrap: anywhere; }
.party .pi + .pi::before { content: ' · '; color: var(--faint); }
@media (max-width: 560px) { .party .s { display: flex; flex-direction: column; } .party .pi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .party .pi + .pi::before { content: none; } }
#ctabs.fade { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent); }
@media (max-width: 900px) {
  .ch-acts { justify-content: flex-start; }
  .ch-acts .btn:not(.icon-btn) { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 560px) { .todo { padding: 0 10px 0 9px; font-size: 12px; } .ch-todo { gap: 5px; margin-top: 10px; } }

/* ── 서면 보기·의견 (편하고 보기 좋게) ── */
/* 의견 카드: ○ 한 번에 반영(초록 ✓, 카드는 흐려짐) · 나머지는 ⋯ 안 */
.cm-top { display: flex; align-items: flex-start; gap: 8px; }
.cm-who { gap: 6px; flex-wrap: wrap; flex: 1; min-width: 0; padding-top: 1px; }
.cm.cm-ckd > :not(.cm-top) { margin-left: 30px; }
.cm-ck { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.6px solid color-mix(in srgb, var(--sub) 70%, transparent); background: var(--panel-solid); color: transparent; display: grid; place-items: center; padding: 0; cursor: pointer; font-size: 12.5px; font-weight: 800; line-height: 1; transition: background .15s, border-color .15s, color .15s; }
.cm-ck:not(.on):not(.keep):hover { border-color: var(--green); color: color-mix(in srgb, var(--green) 60%, transparent); }
.cm-ck:not(.on):not(.keep):hover::before { content: '✓'; }
.cm-ck.on { background: var(--green); border-color: var(--green); color: var(--panel-solid); animation: ckpop .3s cubic-bezier(.2,.9,.3,1.5); }
.cm-ck.keep { background: var(--line-strong); border-color: transparent; color: var(--sub); }
@keyframes ckpop { from { transform: scale(.55); } }
.cm-more { flex: none; width: 28px; height: 24px; margin-top: -2px; border: 0; border-radius: 7px; background: none; color: var(--faint); cursor: pointer; font-size: 17px; line-height: 1; padding: 0; }
.cm-more:hover { background: var(--line); color: var(--text); }
.cm-a { margin-top: 2px; }
.cm-a .btn { padding: 0 7px; }
.cm.cm-done:not(.cm-cur):not(:hover) > :not(.cm-top), .cm.cm-done:not(.cm-cur):not(:hover) .cm-who { opacity: .5; }
.cm.cm-done > :not(.cm-top), .cm.cm-done .cm-who { transition: opacity .2s; }
.cm.cm-cur { background: color-mix(in srgb, var(--pc) 8%, transparent); border-radius: 0 10px 10px 0; }
.cm.cm-fold { overflow: hidden; animation: cmfold .23s ease forwards; }
@keyframes cmfold { from { max-height: 320px; } to { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; } }
.cm-h { gap: 5px; }
.cm-h .btn.sm { padding: 0 8px; }
.cm-only { border: 0; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; }
.cm-only:hover { filter: brightness(.94); }
.cm-f { display: flex; align-items: center; gap: 6px; padding: 0 12px 8px; }
.cm-f .spacer { flex: 1; }
.tabs.sm { padding: 2px; border-radius: 8px; }
.tabs.sm button { padding: 3px 9px; font-size: 12px; border-radius: 6px; }
.cm-alldone { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; padding: 9px 10px 9px 12px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-weight: 650; font-size: 13px; }
.cm-alldone span { flex: 1; }
.cm-alldone.pop { animation: pop .32s cubic-bezier(.2,.9,.3,1.3); }
.cm-menu { position: fixed; z-index: 48; min-width: 170px; padding: 4px; background: var(--panel-solid); color: var(--text); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); animation: fade .1s; }
.cm-menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.cm-menu button:hover, .cm-menu button:focus-visible { background: var(--accent-soft); outline: none; }
.cm-menu button.in { padding-left: 20px; }
.cm-menu button.danger { color: var(--red); }
.cm-menu-h { font-size: 11.5px; color: var(--faint); font-weight: 650; padding: 6px 10px 2px; }
.cm-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
@media (hover: none) { .cm-menu button { padding: 10px 12px; } }
/* 고른 문구 카드 [📍3쪽] “…” [✕] */
.cm-pick { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 6px; padding: 6px 4px 6px 7px; border-radius: 10px; background: rgba(255,196,0,.15); border: 1px solid rgba(214,160,0,.35); animation: fade .15s; }
.cm-pick-pg { flex: none; border: 0; background: var(--panel-solid); color: var(--text); border-radius: 7px; padding: 1px 7px; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cm-pick-q { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cm-pick-x { flex: none; border: 0; background: none; color: var(--sub); cursor: pointer; width: 22px; height: 22px; border-radius: 6px; padding: 0; }
.cm-pick-x:hover { background: var(--line); color: var(--text); }
.cm-attchip { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 4px 4px 8px; border-radius: 10px; background: var(--soft, #f4f5fa); border: 1px solid var(--line); font-size: 12.5px; animation: fade .15s; }
.cm-attn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-attb.on { border-color: var(--accent); color: var(--accent); }
.cm-new.cm-drop { outline: 2px dashed var(--accent); outline-offset: -4px; background: color-mix(in srgb, var(--accent) 6%, transparent); }
.cm-pick-hint { font-size: 12px; color: var(--faint); margin-bottom: 6px; line-height: 1.45; }
.cm-pick-hint button { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
/* 의견란 폭 조절 손잡이 */
.fv-main.with-side > .fv-body { padding-right: 0; }
.fv-body { position: relative; }
.fv-split { flex: none; width: 12px; margin-bottom: 12px; cursor: col-resize; position: relative; touch-action: none; }
.fv-split::after { content: ''; position: absolute; left: 4px; top: 50%; width: 4px; height: 40px; margin-top: -20px; border-radius: 2px; background: rgba(255,255,255,.16); transition: background .15s, height .15s, margin .15s; }
.fv-split:hover::after, .fv-split.on::after { background: rgba(255,255,255,.55); height: 64px; margin-top: -32px; }
.fv-side { min-width: 260px; max-width: 70%; }
@media (max-width: 700px) {
  .fv-split { width: auto; height: 14px; margin: 0; cursor: row-resize; }
  .fv-split::after, .fv-split:hover::after, .fv-split.on::after { left: 50%; top: 5px; width: 44px; height: 4px; margin: 0 0 0 -22px; }
  .fv-side { min-width: 0; max-width: none; max-height: 82%; min-height: 120px; }
  .cm-new #cmBody { height: 64px; }   /* 폰: 의견 목록이 더 보이게 */
}
/* PDF 쪽 표시·확대 "27 / 40쪽 · − 100% +" */
.fvp .pg { width: calc(min(100%, 900px) * var(--fvz, 1)); max-width: none; }
.fvp.two { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; align-items: flex-start; column-gap: 10px; }
.fvp.two .pg { margin: 0 0 10px; }
.fv-seg { display: inline-flex; gap: 1px; padding: 2px; border-radius: 9px; background: rgba(255,255,255,.08); margin-right: 6px; }
.fv-seg button { border: 0; background: none; color: rgba(255,255,255,.72); font: inherit; font-size: 12.5px; font-weight: 600; height: 28px; padding: 0 10px; border-radius: 7px; cursor: pointer; }
.fv-seg button:hover { color: #fff; }
.fv-seg button.on { background: rgba(255,255,255,.18); color: #fff; }
@media (max-width: 700px) { .fv-seg:first-of-type { display: none; } }
.fv-pgbar { position: absolute; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 1px; padding: 3px; border-radius: 999px; background: rgba(28,28,32,.84); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 4px 18px rgba(0,0,0,.35); color: #fff; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; transition: opacity .25s; }
.fv-pgbar button { border: 0; background: none; color: inherit; height: 28px; min-width: 28px; padding: 0 9px; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 600; }
.fv-pgbar button:hover { background: rgba(255,255,255,.15); }
.fv-pgbar i { width: 1px; height: 16px; background: rgba(255,255,255,.22); margin: 0 3px; }
.fv-pgbar .fv-zv { min-width: 50px; opacity: .85; }
.fv-pged { padding: 0 8px 0 2px; font-weight: 600; }
.fv-pgi { width: 44px; height: 28px; border: 0; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff; text-align: center; font: inherit; font-weight: 600; outline: none; }
.fv-pgbar.idle:not(:hover):not(:focus-within) { opacity: .6; }
@media (max-width: 700px) {
  .fv-pgbar { bottom: 10px; }
  .fv-pgbar [data-z], .fv-pgbar i { display: none; }
  .fv-pgbar.idle:not(:focus-within) { opacity: 0; pointer-events: none; }
}
/* PDF에서 고른 자리 바로 아래 [✎ 의견] [🎙 녹음] */
.fvp .fv-pickbar { position: absolute; z-index: 4; transform: translate(-50%, 6px); display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(28,28,32,.92); box-shadow: 0 6px 20px rgba(0,0,0,.3); white-space: nowrap; animation: fade .14s; }
.fv-pickbar button { border: 0; background: none; color: #fff; font: inherit; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 9px; cursor: pointer; }
.fv-pickbar button:hover { background: rgba(255,255,255,.16); }

/* ── 링크 보내기 카드 (의뢰인 안내 링크 · 계약서 서명 링크): 지금 쓰는 링크를 맨 위에, 그 자리에서 [카톡으로] [문자로] [복사] ── */
.lk-card { border: 1px solid var(--line-strong); border-radius: 14px; padding: 12px 14px; background: var(--soft); margin-bottom: 8px; }
.lk-card.fresh { border-color: var(--accent); }
.lk-card.flash { animation: lkflash 1.8s ease-out; }   /* 만든 직후 한 번만 */
@keyframes lkflash { 0% { box-shadow: 0 0 0 0 var(--accent-soft); } 25% { box-shadow: 0 0 0 7px var(--accent-soft); } 100% { box-shadow: 0 0 0 0 transparent; } }
.lk-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lk-meta { font-size: 12.5px; color: var(--sub); }
.lk-url { display: block; max-width: 100%; margin-top: 4px; padding: 2px 0; border: 0; background: none; font: inherit; font-size: 12px; color: var(--faint); text-align: left; cursor: copy; }
.lk-url:hover { color: var(--accent); }
.lk-share { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.lk-share .btn:not(.sm) { height: 36px; padding: 0 16px; }
.btn.kk { background: #FEE500; color: #191919; border-color: #FEE500; }
.btn.kk:hover { background: #f2d900; }
.lk-mk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 4px; }
.lk-mk select.f { width: auto; height: 28px; padding: 0 8px; font-size: 12.5px; border-radius: 8px; }
.lk-none .lk-mk select.f { height: 32px; }
.lk-none { background: transparent; border-style: dashed; }
.lk-none .lk-mk { margin-top: 10px; }
.lk-more { margin: 4px 0 8px; }
.lk-off { margin-top: 6px; }
.lk-off > summary, .ct-new > summary { cursor: pointer; list-style: none; user-select: none; }
.lk-off > summary::-webkit-details-marker, .ct-new > summary::-webkit-details-marker { display: none; }
.lk-off > summary { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--faint); padding: 4px 0; }
.lk-off > summary::after, .ct-new > summary::after { content: '›'; transition: transform .15s; }
.lk-off[open] > summary::after, .ct-new[open] > summary::after { transform: rotate(90deg); }
.ct-h { margin: 4px 0 8px; }
.ct-new { margin-top: 10px; }
.ct-new > summary { display: flex; align-items: center; gap: 6px; padding: 10px 2px; border-top: 1px solid var(--line); font-weight: 650; color: var(--accent); }
.ct-new[open] > summary { margin-bottom: 8px; color: var(--text); }
.ct-new.solo { margin-top: 0; }
.ct-new.solo > summary { display: none; }
@media (max-width: 700px) {
  .lk-share .btn:not(.sm) { flex: 1 1 0; justify-content: center; }
  .lk-share .spacer { flex-basis: 100%; height: 0; }
}

/* ── 상담 접수 창: 이해충돌 경고는 맨 위, 왼쪽 사연·녹음 | 오른쪽 기한·예약·이해충돌·서류 썸네일. 바닥 단추 줄은 늘 보임 ── */
.modal.ik-modal { width: min(1060px, calc(100vw - 32px)); max-height: 88vh; }
.ik-modal .modal-f { position: sticky; bottom: 0; z-index: 3; background: var(--panel-solid); border-top: 1px solid var(--line); padding-top: 12px; padding-bottom: 14px; }
.ik2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; margin: 12px 0 6px; }
.ik-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ik-h { font-size: 12px; font-weight: 650; color: var(--faint); margin: 0 0 5px; }
.ik-story .ik-h:not(:first-child) { margin-top: 16px; }
.ik-txt { white-space: pre-wrap; font-size: 14.5px; line-height: 1.65; }
.ik-audio { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--accent-soft); }
.ik-audio audio { flex: 1; min-width: 0; height: 36px; }
.ik-audio.sm { margin-top: 6px; max-width: 420px; }
.ik-audio.sm audio { height: 30px; }
.ik-stt { margin-top: 6px; }
.ik-stt > summary { cursor: pointer; color: var(--sub); }
.ik-sec { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--soft); }
.ik-dl { background: var(--amber-soft); border-color: transparent; }
.ik-dl .ik-h { color: var(--amber); }
.ik-dlv { font-size: 15px; margin-bottom: 2px; }
.ik-bka { margin-top: 10px; gap: 6px; }
.ik-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.ik-tile { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ik-th { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--panel-solid); transition: transform .12s, box-shadow .12s, border-color .12s; }
.ik-th::before { content: attr(data-x); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: var(--faint); }
.ik-th img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; opacity: 0; transition: opacity .2s; background: #fff; }
.ik-th img.on { opacity: 1; }
.ik-tile:hover .ik-th, .ik-tile:focus-visible .ik-th { border-color: var(--accent); box-shadow: 0 6px 18px rgba(20,20,40,.14); transform: translateY(-1px); }
.ik-tile:focus-visible { outline: none; }
.ik-tn { font-size: 12px; color: var(--sub); }
/* 좁은 화면: 한 줄로 — 기한 → 예약 → 사연 → 서류 → 이해충돌 → 추가 질문 */
@media (max-width: 860px) {
  .ik2 { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .ik-col { display: contents; }
  .ik-dl { order: 1; } .ik-bk { order: 2; } .ik-story { order: 3; } .ik-docs { order: 4; } .ik-cf { order: 5; } .ik-fu { order: 6; }
}
@media (max-width: 700px) {
  .modal.ik-modal { max-height: 92vh; }
  .ik-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 메일 첨부: [📎 첨부] → 내 컴퓨터 / 이 사건 자료, 붙인 것은 [썸네일 | 이름 크기 | ✕] */
.matt { margin-top: 12px; }
.matt-h { position: relative; display: flex; align-items: center; gap: 10px; }
.matt-h .grow { flex: 1; min-width: 0; }
#attsum.over { color: var(--red); font-weight: 600; }
.matt-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 5; min-width: 220px; padding: 4px; display: grid; background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .14s; }
.matt-menu button { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.matt-menu button:hover, .matt-menu button:focus-visible { background: var(--accent-soft); outline: none; }
.matt-menu svg { width: 16px; height: 16px; flex: none; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.matt-menu small { margin-left: auto; color: var(--faint); font-size: 12px; }
.matt-case { margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--accent) 4%, var(--panel-solid)); }
.matt-case .pick-files { background: var(--panel-solid); }
.matt-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; margin-top: 8px; }
.matt-list:empty { display: none; }
.att-chip { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 5px 5px 5px 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-solid); animation: pop .16s; }
.att-th { width: 36px; height: 36px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 8px; background: var(--line); }
.att-th img { width: 100%; height: 100%; object-fit: cover; }
.att-th .ficon { width: 27px; height: 33px; font-size: 8.5px; border-radius: 5px; }
.att-n { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.att-n .ell:first-child { font-weight: 550; font-size: 13px; }
.att-x { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--faint); cursor: pointer; }
.att-x svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.att-x:hover { background: var(--red-soft); color: var(--red); }
/* 창 위로 파일을 끌어 오면 */
.drop-veil { position: fixed; inset: 0; z-index: 3; display: none; place-items: center; pointer-events: none; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.overlay.dropping .drop-veil { display: grid; }
.drop-veil span { padding: 18px 28px; border: 2px dashed var(--accent); border-radius: 16px; background: var(--panel-solid); color: var(--accent); font-weight: 650; box-shadow: var(--shadow-lg); }

/* 대화: 말풍선 옆 안 읽은 사람 수, ⋯ 메뉴, 목록 찾기 칸 */
.brow { display: flex; align-items: flex-end; gap: 6px; }
.msg.me .brow { justify-content: flex-end; }
.brow .bubble { min-width: 0; }
.rd { flex: none; align-self: flex-end; margin-bottom: 2px; font-size: 11px; font-weight: 700; color: var(--amber); cursor: default; font-variant-numeric: tabular-nums; }
.rd:empty { display: none; }
.msg-more { flex: none; align-self: center; width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--faint); cursor: pointer; visibility: hidden; }
.msg-more svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.msg:hover .msg-more, .msg-more:focus-visible { visibility: visible; }
.msg-more:hover { background: var(--line); color: var(--text); }
@media (hover: none) { .msg-more { display: none; } }
.bmenu { position: fixed; z-index: 80; min-width: 160px; padding: 4px; display: grid; background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .12s; }
.bmenu button { padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.bmenu button:hover, .bmenu button:focus-visible { background: var(--accent-soft); outline: none; }
.bmenu button.danger { color: var(--red); }
.bmenu button.danger:hover { background: var(--red-soft); }
.ch-find { padding: 2px 2px 8px; }
.ch-find .f { padding: 7px 11px; }

/* 문자 창: 왼쪽 쓰기, 오른쪽 받는 사람마다 실제 문구 */
.sms-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; margin-top: 8px; align-items: start; }
.sms-pv { padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--accent) 4%, var(--panel-solid)); }
.sms-pv .row { gap: 4px; margin-bottom: 8px; }
.sms-pv .grow { flex: 1; min-width: 0; }
.sms-pv .icon-btn { width: 28px; height: 28px; padding: 0; }
.sms-pv .icon-btn:disabled { opacity: .3; }
.sms-pv-empty { display: grid; place-items: center; min-height: 64px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 16px; text-align: center; margin-left: 12%; }
.sms-bub { padding: 9px 12px; border-radius: 16px 16px 4px 16px; background: var(--accent); color: var(--accent-text, #fff); font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; margin-left: 12%; }
@media (max-width: 760px) { .sms-grid { grid-template-columns: 1fr; } }

/* 청구·입금: 위 숫자 칸은 누르면 거르기, 미수 줄 끝 [✓ 입금] → 작은 입금 확인 창 */
.stat.pick { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.stat.pick:hover { border-color: var(--line-strong); }
.stat.pick:active { transform: scale(.985); }
.stat.pick.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), var(--shadow); }
.stat.pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabs .badge.soft { background: var(--line-strong); color: var(--sub); }
.tbl td.pay { width: 1%; white-space: nowrap; text-align: right; padding-left: 4px; }
.pay-btn { color: var(--green); border-color: color-mix(in srgb, var(--green) 35%, transparent); font-weight: 650; }
.pay-btn:hover { background: var(--green-soft); }
.pay-ok { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 800; font-size: 13px; animation: payok .35s cubic-bezier(.2,.9,.3,1.4); }
@keyframes payok { from { transform: scale(.3); opacity: 0 } }
.bar > i { transition: width .6s cubic-bezier(.2,.8,.2,1); }
.paid-t.ok { color: var(--green); font-weight: 700; }
.tbl tr.just-paid td { animation: paidrow 1.3s ease; }
@keyframes paidrow { 0%, 60% { background: var(--green-soft); } 100% { background: transparent; } }
.paypop { position: fixed; z-index: 70; width: 300px; padding: 12px 14px 12px; display: grid; gap: 10px; background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow-lg); animation: pop .14s cubic-bezier(.2,.9,.3,1.2); }
.paypop .pp-h { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.paypop .pp-h b { flex: none; font-size: 14px; }
.paypop .pp-seg { width: 100%; }
.paypop .pp-seg button { flex: 1; padding: 5px 8px; white-space: nowrap; }
.paypop .pp-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; }
.paypop .f { padding: 7px 10px; }
.paypop .pp-f { display: flex; justify-content: flex-end; gap: 6px; }
@media (max-width: 700px) {
  .paypop { left: 0 !important; right: 0; bottom: 0; top: auto !important; width: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .paypop .pp-f .btn { height: 38px; padding: 0 16px; font-size: 14px; }
}
/* 만든 청구서·영수증·정산서: 그 자리에 썸네일 · [바로 보기] [의뢰인에게 보내기] */
.made-doc { display: flex; gap: 14px; align-items: center; margin-top: 14px; padding: 12px; border: 1px solid color-mix(in srgb, var(--green) 30%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--green) 5%, var(--panel-solid)); animation: pop .2s cubic-bezier(.2,.9,.3,1.2); }
.made-doc .grow { flex: 1; min-width: 0; }
.made-doc .t { font-weight: 650; }
.md-thumb { flex: none; width: 64px; height: 86px; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; overflow: hidden; cursor: zoom-in; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.08); transition: transform .15s; }
.md-thumb:hover { transform: translateY(-2px) rotate(-1deg); }
.md-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* 결재: 종이 결재란 [담당 | 실장 | 대표] + 인주색 도장, 제목 아래 한 줄 요약 */
.apbox { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 38px; flex: none; border: 1px solid var(--line-strong); border-radius: 6px; overflow: hidden; background: var(--panel-solid); }
.apbox > div { display: grid; grid-template-rows: 16px 32px; border-left: 1px solid var(--line-strong); }
.apbox > div:first-child { border-left: 0; }
.apbox .h { font-size: 10px; line-height: 16px; text-align: center; color: var(--sub); background: color-mix(in srgb, var(--line) 70%, transparent); border-bottom: 1px solid var(--line-strong); white-space: nowrap; overflow: hidden; }
.apbox .c { display: grid; place-items: center; }
.seal { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1.6px solid var(--seal); color: var(--seal); font: 700 12.5px/1 "AppleMyungjo", "Nanum Myeongjo", "Batang", "바탕", serif; transform: rotate(-11deg); opacity: .9; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--seal) 18%, transparent); }
.seal.no { width: 28px; height: 20px; border-radius: 3px; font-size: 9.5px; letter-spacing: -.5px; transform: rotate(-7deg); }
.seal.wait { border-style: dashed; border-color: var(--accent); color: var(--accent); opacity: .55; transform: none; box-shadow: none; }
.seal.stamp { animation: stamp .38s cubic-bezier(.3,1.6,.5,1); }
@keyframes stamp { 0% { transform: scale(2.2) rotate(-24deg); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1) rotate(-11deg); } }
.apbox.big { grid-auto-columns: 48px; }
.apbox.big > div { grid-template-rows: 18px 42px; }
.apbox.big .h { font-size: 11px; line-height: 18px; }
.apbox.big .seal { width: 32px; height: 32px; font-size: 16px; }
.apbox.big .seal.no { width: 36px; height: 24px; font-size: 11px; }
.ap-row { gap: 12px; }
.ap-sum { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 1px; font-variant-numeric: tabular-nums; }
.ap-sum.big { font-size: 15px; margin-top: 10px; }
.ap-h { gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.ap-h h3 { flex: 1 1 260px; padding-top: 6px; }
.ap-h .apbox { margin-left: auto; }   /* 종이처럼 오른쪽 위 (폰에서 줄이 바뀌어도) */
.ap-around { margin-top: 8px; padding: 8px 11px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; line-height: 1.6; }
.ap-around a { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); }
.ap-left { margin-right: auto; align-self: center; white-space: nowrap; }
.modal.ap-next { animation: apnext .26s cubic-bezier(.2,.8,.2,1); }
@keyframes apnext { from { transform: translateX(26px); opacity: .3; } }
@media (max-width: 700px) {
  .ap-row .ap-st { display: none; }   /* 폰: 결재란이 상태를 보여 줌 */
  .apbox { grid-auto-columns: 32px; }
  .apbox > div { grid-template-rows: 15px 28px; }
  .apbox .seal { width: 21px; height: 21px; font-size: 11px; }
  .apbox .seal.no { width: 26px; height: 18px; font-size: 9px; }
  .ap-h .apbox.big { grid-auto-columns: 42px; }
  /* 폰: '남은 N건'은 단추 위 한 줄로 (단추 넷과 한 줄이면 글자가 세로로 꺾임) */
  .modal-f:has(> .ap-left) { flex-wrap: wrap; row-gap: 6px; }
  .modal-f > .ap-left { flex-basis: 100%; text-align: right; }
}
.m-kind, .pay-m { display: none; }
.nw { white-space: nowrap; }
.tbl td.paid-c { min-width: 120px; }
.tbl td.paid-c .paid-t { white-space: nowrap; }   /* '1,000,000 / 원'처럼 꺾이지 않게 */
@media (max-width: 700px) {
  .m-kind { display: block; color: var(--sub); margin-top: 1px; }
  .pay-m { display: inline-flex; margin-top: 6px; }
  .tbl td.paid-c { min-width: 80px; }   /* 폰 폭에서 표가 카드 밖으로 나가지 않게 */
  /* 위 숫자 칸: 폰에서는 세 칸 한 줄 (누르면 거르기) */
  .bill-sum.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .bill-sum .stat { padding: 10px 11px; }
  .bill-sum .stat .k { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bill-sum .stat .n { font-size: 15px; letter-spacing: -.02em; }
  .bill-sum .stat .small { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* 새 기능 안내 띠 (오늘 화면 맨 위 · 판을 깐 뒤 7일) */
.wnband { padding: 6px 8px 6px 14px; margin: 0 0 14px; border-radius: 14px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); transition: opacity .2s, transform .2s; }
.wnband.gone { opacity: 0; transform: translateY(-4px); }
.wnband .wn-row { display: flex; align-items: center; gap: 8px; }
.wnband .wn-k { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; padding: 4px 0; background: none; border: 0; font: inherit; font-weight: 700; color: var(--accent); font-size: 14px; text-align: left; cursor: pointer; }
.wnband .wn-k .wn-n { font-weight: 500; font-size: 12.5px; color: var(--muted, inherit); opacity: .8; }
.wnband .wn-k svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.wnband .wn-k[aria-expanded="true"] svg { transform: rotate(180deg); }
.wnband .btn { flex: none; }
.wnband .wn-list { margin: 2px 0 6px; padding-left: 22px; font-size: 13.5px; line-height: 1.65; }

/* 종결 정리 — 의뢰인에게 남은 부탁 */
.ca-band { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 0 0 12px; border-radius: 12px; background: var(--accent-soft); }
.ca-band .grow { min-width: 0; }
@media (max-width: 640px) { .ca-band { flex-wrap: wrap; } .ca-band .grow { flex-basis: 100%; } }

/* ── 접는 카드 (fold.js · 갤럭시 Fold.kt 와 같은 규칙): 제목 줄 + 한 줄 요약, 누르면 펼침 ── */
.card.fx { scroll-margin-top: 108px; }
.card.fx > .card-h { cursor: pointer; user-select: none; -webkit-user-select: none; position: relative; padding-right: 50px; }
/* 펼침 표시는 늘 머리 오른쪽 위 (단추가 많아 머리가 두 줄이 돼도 제자리) */
.card.fx > .card-h .fold-chev { position: absolute; right: 12px; top: 10px; display: inline-grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0;
  border: 0; border-radius: 8px; background: none; color: var(--faint); cursor: pointer; transition: transform .22s cubic-bezier(.2,.7,.2,1), background .15s, color .15s; }
.card.fx > .card-h .fold-chev:hover { background: var(--line); color: var(--text); }
.card.fx > .card-h .fold-chev:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.card.fx.fx-shut > .card-h .fold-chev { transform: rotate(-90deg); }
.card.fx > .card-h .fold-sum { order: 99; flex-basis: 100%; contain: inline-size; margin-top: -6px; font-size: 12.5px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: none; }
.card.fx.fx-shut > .card-h .fold-sum:not(:empty) { display: block; }
.card.fx.fx-shut.fx-hot > .card-h .fold-sum { color: var(--accent); font-weight: 560; }
/* 접혔을 때는 제목·숫자·요약만 (머리 단추는 펼친 뒤에) */
.card.fx.fx-shut > .card-h > :not(h2):not(h3):not(.count):not(.fold-chev):not(.fold-sum) { display: none; }
.card.fx.fx-shut > .card-h { padding-bottom: 14px; }
.card.fx > .fold-b { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr; transition: grid-template-rows .24s cubic-bezier(.2,.7,.2,1); }
.card.fx.fx-shut > .fold-b { grid-template-rows: 0fr; }
.card.fx > .fold-b > .fold-in { min-height: 0; min-width: 0; overflow: hidden; transition: opacity .2s ease, visibility 0s; }
.card.fx.fx-ready > .fold-b > .fold-in { overflow: visible; }
.card.fx.fx-shut > .fold-b > .fold-in { opacity: 0; visibility: hidden; transition: opacity .16s ease, visibility 0s .24s; }
.card.fx.fx-still, .card.fx.fx-still * { transition: none !important; }
@media (prefers-reduced-motion: reduce) { .card.fx > .fold-b, .card.fx > .fold-b > .fold-in, .card.fx > .card-h .fold-chev { transition: none !important; } }
/* 긴 목록: 찾기 칸 + [모두 보기] */
.fold-find { display: flex; align-items: center; gap: 8px; margin: 2px 0 8px; }
.fold-find .f { max-width: 280px; padding: 6px 10px; }
.fold-more { margin-top: 8px; }
.fold-more[hidden], .fold-find [hidden] { display: none; }
[data-long] > [hidden], [data-long] tr[hidden] { display: none !important; }
/* 바로 가기 칩 한 줄 (가로로 밀기) */
.fold-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 10px; margin-bottom: 4px; }
/* 좁은 화면만 옆으로 밀기 — 끝이 잘려 보이지 않게 오른쪽을 흐리게 */
@media (max-width: 700px) { .fold-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; -webkit-mask-image: linear-gradient(to right, #000 86%, transparent); mask-image: linear-gradient(to right, #000 86%, transparent); padding-right: 24px; } }
.fold-chips::-webkit-scrollbar { display: none; }
.fold-chips[hidden] { display: none; }
.fold-chip { flex-shrink: 0; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line-strong); background: var(--panel-solid); color: var(--sub);
  font: inherit; font-size: 12.5px; font-weight: 560; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.fold-chip:hover { color: var(--text); background: var(--line); }
.fold-chip.hot { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.fold-chip.hot::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
@media (max-width: 700px) { .card.fx { scroll-margin-top: 150px; } }
/* 빈 카드 자리(뒤늦게 채우는 칸)가 사이 간격을 두 번 만들지 않게 */
#page .grid > div[id]:empty { display: none; }
/* 설정 칸으로 데려왔을 때 잠깐 강조 */
.f.flash { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); transition: box-shadow .3s; }
/* 고르는 칩: 켜진 것은 꽉 찬 강조색 + ✓, 꺼진 것은 테두리만 — 무엇이 켜졌는지 한눈에 (상담 가능 시간·공동 담당 등) */
.chip.pick:not(.accent) { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong, rgba(0,0,0,.18)); color: var(--sub); }
.chip.pick.accent { background: var(--accent); color: var(--accent-text); }
.chip.pick.accent::before { content: '✓'; font-size: .92em; margin-right: 1px; }

/* 과제에서 초안 (대표만 — caselaw.js taskMarks·draftModal) */
.td-mk { display: inline-flex; align-items: center; gap: 4px; flex: none; margin-left: 6px; }
.td-mk .btn.sm.td-go { padding: 3px 9px; font-size: 12px; white-space: nowrap; }
.td-mk button.chip { cursor: pointer; border: none; font: inherit; font-size: 12px; }
.td-band { display: flex; gap: 10px; padding: 9px 12px; margin-bottom: 10px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 9%, transparent); }
.td-band .t { font-weight: 600; } .td-band .s { font-size: 12.5px; color: var(--sub); margin-top: 2px; }
.td-band .td-order { color: var(--ink, inherit); }
@media (max-width: 560px) { .td-mk .btn.sm.td-go { padding: 3px 7px; } }

/* ── 원고·피고 색 (party.js · 갤럭시 Party.kt 와 같은 값): 원고 = 빨강, 피고 = 파랑, 법원 판단 = 보라 회색 ──
   주장 칸: 왼쪽 띠(우리 4px · 상대 2px) + 옅은 칠, 글씨는 기본 글씨색. 칩: 우리 쪽은 꽉 채움, 상대 쪽은 테두리만 */
:root { --pl: #c4313b; --pl-fill: #fdf5f5; --df: #2a5fc0; --df-fill: #f2f6fd; --ct: #6b6390; --ct-fill: #f4f3f8; --p-on: #ffffff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pl: #ff8088; --pl-fill: #2b181b; --df: #86b2ff; --df-fill: #16213a; --ct: #ada2dc; --ct-fill: #201e2a; --p-on: #15161b; } }
:root[data-theme="dark"] { --pl: #ff8088; --pl-fill: #2b181b; --df: #86b2ff; --df-fill: #16213a; --ct: #ada2dc; --ct-fill: #201e2a; --p-on: #15161b; }
.p-pl { --pc: var(--pl); --pf: var(--pl-fill); } .p-df { --pc: var(--df); --pf: var(--df-fill); } .p-ct { --pc: var(--ct); --pf: var(--ct-fill); }
.pty { border-left: 2px solid var(--pc); background: var(--pf); border-radius: 3px 9px 9px 3px; padding: 6px 10px 7px; color: var(--text); }
.pty.ours { border-left-width: 4px; padding-left: 8px; }
.pty + .pty { margin-top: 5px; }
.list > .item.pty { border-bottom: 0; margin-bottom: 5px; }
.pchip { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; margin-right: 6px; border-radius: 9px; font-size: 11px; font-weight: 700; line-height: 1; white-space: nowrap; vertical-align: 1px;
  color: var(--pc); background: transparent; box-shadow: inset 0 0 0 1.25px var(--pc); }
.pchip.ours { background: var(--pc); color: var(--p-on); box-shadow: none; }
button.pchip { border: 0; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; height: 24px; padding: 0 11px; border-radius: 12px; margin: 0 0 0 6px; }
.pex { color: var(--pc); font-weight: 650; white-space: nowrap; }
.pdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; box-shadow: inset 0 0 0 1.5px var(--pc); }
.pdot.ours { background: var(--pc); box-shadow: none; }
.pbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--sub); padding: 7px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line); }
.pbar .pchip { margin-right: 0; }
.pbar-pick { display: inline-flex; align-items: center; }
th .pchip { margin: 0; }
.ecfs-kind.pty { margin: 10px 0 6px; padding: 3px 9px; font-size: 13px; color: var(--sub); background: transparent; }
.pbar .pchip:not(button) { height: 21px; padding: 0 9px; border-radius: 11px; font-size: 12px; }
/* 기록에서 만든 과제: 과제 줄·과제 창의 📎 이은 기록, 파일 메뉴의 '이 기록의 과제'·제안 칩 (RecordTask.swift) */
.tfile { display: inline-flex; align-items: center; max-width: 100%; margin-right: 6px; padding: 0 7px; border: 0; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.tfile:hover { text-decoration: underline; }
.tfile-band { display: flex; align-items: center; gap: 4px; }
.tfile-band .tfile { padding: 4px 10px; font-size: 13px; }
.tfile-x { border: 0; background: none; color: var(--faint, var(--sub)); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 6px; }
.tfile-x:hover { background: var(--line); color: var(--text); }
.fctx-arr { margin-left: auto; color: var(--sub); transition: transform .15s; }
.fctx-i.on .fctx-arr { transform: rotate(90deg); }
.fctx-tkl[hidden] { display: none; }
.fctx-tkl { display: flex; flex-direction: column; margin: 0 0 4px 26px; border-left: 2px solid var(--line); }
.fctx-tki { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 4px 10px; border: 0; background: none; color: var(--text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; border-radius: 0 8px 8px 0; max-width: 100%; }
.fctx-tki .ell { max-width: 100%; }
.fctx-tki:hover, .fctx-tki:focus-visible { background: var(--accent-soft); outline: none; }
.fctx-tki.done .ell { text-decoration: line-through; color: var(--sub); }
.fctx-sug { padding: 0 8px 4px 36px; }
.fctx-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.fctx-chips button { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; border: 1px dashed var(--accent); background: none; color: var(--accent); border-radius: 12px; padding: 2px 9px; font: inherit; font-size: 12px; cursor: pointer; }
.fctx-chips button .ell { min-width: 0; }
.fctx-chips button b { font-weight: 650; white-space: nowrap; }
.fctx-chips button:hover, .fctx-chips button:focus-visible { background: var(--accent); color: var(--accent-text); border-style: solid; outline: none; }
.fctx-chips button.made { border: 1px solid var(--line); color: var(--sub); }
.fctx-chips button.made:hover { background: var(--line); color: var(--text); }

/* 여러 문서 나란히 보기 (multiview.js) */
.mv { position: fixed; inset: 0; z-index: 44; background: #17171b; color: #fff; display: flex; flex-direction: column; }
.mv-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.mv-t { font-weight: 650; font-size: 14px; opacity: .85; }
.mv-cols { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--mvn, 2), minmax(0, 1fr)); gap: 6px; padding: 0 6px 6px; }
.mv-col { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #202026; border-radius: 10px; overflow: hidden; }
.mv-h { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,.08); }
.mv-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; opacity: .9; }
.mv-hb { border: 0; background: rgba(255,255,255,.08); color: rgba(255,255,255,.8); font: inherit; font-size: 12px; height: 26px; padding: 0 9px; border-radius: 7px; cursor: pointer; }
.mv-hb:hover { background: rgba(255,255,255,.16); color: #fff; }
.mv-b { flex: 1; min-height: 0; position: relative; }
.mv-b > iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #17171b; }
.mv-pdf { position: absolute; inset: 0; overflow: auto; padding: 8px; }
.mv-pg { position: relative; background: #fff; width: 100%; margin: 0 0 8px; }
.mv-pg img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mv-pg span { position: absolute; right: 6px; bottom: 4px; font-size: 11px; color: #888; }
.mv-img { position: absolute; inset: 0; display: grid; place-items: center; overflow: auto; }
.mv-img img { max-width: 100%; max-height: 100%; }
.mv-tray { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 43; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); padding: 8px 10px; border-radius: 14px; background: var(--card, #fff); border: 1px solid var(--line, #ddd); box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.mv-tn { display: flex; gap: 6px; overflow-x: auto; min-width: 0; }
.mv-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--soft, #f2f2f5); font-size: 12.5px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.mv-chip button { border: 0; background: none; cursor: pointer; color: inherit; opacity: .6; padding: 0 2px; }
@media (max-width: 700px) { .mv-cols { grid-template-columns: 1fr; grid-auto-rows: minmax(0, 1fr); } }
.fv-fixchip { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.75); background: rgba(255,255,255,.08); margin-right: 6px; }
button.fv-fixchip.on { color: #fff; background: rgba(255,255,255,.2); }

/* 자료 요청 (docreq.js) — 사건 '의뢰인' 탭 */
.dr-staff .dr-s { border-top: 1px solid var(--line); padding: 10px 0; margin-top: 8px; }
.dr-staff .dr-s.shut { opacity: .7; }
.dr-staff .chip.ok { border-color: var(--green, #1f8a5b); color: var(--green, #1f8a5b); }
.dr-staff .chip.warn { border-color: var(--amber, #9a6a00); color: var(--amber, #9a6a00); }
.dr-staff .chip.faint { opacity: .7; }
.dr-sbar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 6px 0; }
.dr-sbar i { display: block; height: 100%; background: var(--green, #1f8a5b); }
.dr-si { padding: 3px 0; font-size: 13.5px; }
.dr-sf { display: block; margin-left: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-ed { display: grid; gap: 6px; }
.dr-er { display: grid; grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 1.5fr) auto auto; gap: 6px; align-items: center; }
.dr-er.drag { opacity: .45; }
.dr-grip { cursor: grab; color: var(--faint, #888); user-select: none; padding: 0 2px; }
@media (max-width: 700px) { .dr-er { grid-template-columns: auto 1fr auto auto; } .dr-er .dr-eh { grid-column: 2 / -1; grid-row: 2; } }

/* 사건 목록 종류 탭 (CASE_GROUPS) — 폰에서는 가로로 밀어 봄 */
.kind-tabs { margin-bottom: 10px; max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.kind-tabs::-webkit-scrollbar { display: none; }
.kind-tabs button { white-space: nowrap; flex: none; font-size: 14px; padding: 6px 15px; }
.kind-tabs button .n { font-size: 12px; color: var(--faint); font-weight: 600; margin-left: 2px; }
.kind-tabs button.on .n { color: var(--accent); }
.kind-tabs button.zero { opacity: .45; }

/* 형사 사건 '단계' 탭 (crim.js) */
.cs-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; max-width: 100%; }
.cs-tabs { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--line); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.cs-tabs::-webkit-scrollbar { display: none; }
.cs-tabs.cs-side { flex: none; }
.cs-t { border: none; background: none; padding: 6px 13px; border-radius: 8px; cursor: pointer; color: var(--sub); font-weight: 600; font-size: 14px; white-space: nowrap; flex: none; }
.cs-t .n { font-size: 12px; color: var(--faint); margin-left: 2px; }
.cs-t.on { background: var(--panel-solid); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.cs-t.on .n { color: var(--accent); }
.cs-t.zero { opacity: .45; }
.cs-t.small { font-size: 12px; padding: 6px 9px; }
.cs-t.warn .n { color: var(--amber, #9a6a00); font-weight: 800; }
.cs-t.drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.cs-filt { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.cs-ppl { display: flex; flex-wrap: wrap; gap: 4px; }
.cs-who { margin: 4px 0 8px; font-size: 14px; }
.cs-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--amber, #e0a020); flex: none; }
.cs-note .cs-nh { font-size: 14px; }
.cs-note .cs-nw { white-space: pre-wrap; font-size: 13.5px; margin-top: 4px; color: var(--text); }
.cs-sel { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; margin: 6px 0; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--accent); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.cs-sel[hidden] { display: none; }
.cs-sel select { width: auto; max-width: 180px; }
.cs-cat { margin-top: 10px; }
.cs-cat > summary { cursor: pointer; list-style: none; }
.cs-cat > summary::-webkit-details-marker { display: none; }
.cs-cat h3 .n, .cs-sub > summary .n, .cs-dir > summary .n { color: var(--faint); font-size: 12px; font-weight: 600; }
.cs-sub { margin: 4px 0; }
.cs-sub > summary { cursor: pointer; font-weight: 650; font-size: 13.5px; padding: 4px 0; }
.cs-dir { margin-left: 12px; }
.cs-dir > summary { cursor: pointer; font-size: 12.5px; color: var(--sub); padding: 2px 0; }
.cs-f { display: flex; align-items: center; gap: 6px; padding: 5px 2px 5px 12px; border-radius: 8px; min-width: 0; }
.cs-f:hover { background: color-mix(in srgb, var(--line) 60%, transparent); }
.cs-f input { flex: none; }
.cs-n { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; font-size: 13.5px; }
.cs-n:hover { color: var(--accent); }
.cs-m { flex: none; font-size: 12px; color: var(--faint); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-tl .cs-f { padding-left: 4px; border-left: 2px solid var(--line); margin-left: 6px; border-radius: 0 8px 8px 0; }
@media (max-width: 700px) {
  .cs-bar { flex-wrap: wrap; }
  .cs-bar .spacer { display: none; }
  .cs-f { flex-wrap: wrap; padding-left: 4px; }
  .cs-n { flex-basis: calc(100% - 50px); white-space: normal; }
  .cs-docf .cs-n { flex-basis: calc(100% - 100px); }   /* 역할 표시와 이름을 한 줄에 */
  .cs-docf { margin-left: 14px; }
  .cs-m { max-width: none; margin-left: 24px; }
}
.cs-sep { width: 1px; background: var(--line-strong, rgba(0,0,0,.15)); margin: 6px 3px; flex: none; }
.cs-t.common { font-weight: 750; }
/* 같은 문서 묶음 — 문서 한 줄, 펼치면 역할별 파일 */
.cs-doc > summary { list-style: none; cursor: pointer; }
.cs-doc > summary::-webkit-details-marker { display: none; }
.cs-cnt { flex: none; font-size: 11.5px; color: var(--sub); padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); }
.cs-doc[open] .cs-cnt { color: var(--accent); border-color: var(--accent); }
.cs-docf { margin: 0 0 4px 26px; padding-left: 6px; border-left: 2px dotted var(--line); }
.cs-tl .cs-docf .cs-f { border-left: 0; margin-left: 0; }
.cs-role { flex: none; font-size: 11px; padding: 0 6px; border-radius: 6px; background: color-mix(in srgb, var(--line) 70%, transparent); color: var(--sub); }
.cs-role.r-제출본 { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-weight: 650; }
.cs-role.r-초안 { background: color-mix(in srgb, #d08a00 14%, transparent); color: #a86f00; }
.cs-prim { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; font-size: 13px; }
.cs-org { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--line-strong, rgba(0,0,0,.15)); color: var(--sub); }
.cs-dlg { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.cs-dlg label { font-size: 12.5px; color: var(--sub); display: flex; flex-direction: column; gap: 3px; }
.cs-dlr { margin-top: 10px; display: grid; gap: 8px; }
.cs-dli { display: block; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--line) 50%, transparent); }
.cs-dld { font-weight: 800; color: var(--accent); margin-left: 4px; }
.cs-pet tr.late td { background: color-mix(in srgb, var(--red, #c23b3b) 7%, transparent); }
.cs-pet .red { color: var(--red, #c23b3b); }
.amber { color: var(--amber, #9a6a00); }
@media (max-width: 700px) { .cs-pet .tbl { font-size: 12.5px; } .cs-pet td, .cs-pet th { padding: 6px 4px; } .cs-pet { overflow-x: auto; } }
