/* =====================================================================
   WELV 영업 웹앱 — 삼성웰스토리 홈페이지 디자인 기준
   색: 주황 #FF5624(강조) · 짙은 회색 #424342 · 회색 #767575 · 따뜻한 회색 #C0BDB9 · 배경 #F5F5F5
   형태: 작은 모서리(8px) + 한쪽만 크게 둥근 '잎 모서리', 알약형 버튼, 2px 주황 밑줄
   ===================================================================== */
:root {
  --orange: #FF5624; --orange-2: #F36941; --orange-dk: #E2481A;
  --tint: #FFF4EF; --tint-line: #FFD9CB;
  --ink: #222222; --char: #424342; --gray: #767575; --gray-2: #9E9C9B; --warm: #C0BDB9;
  --line: #E6E3E0; --bg: #F5F5F5; --surface: #FFFFFF; --soft: #F0EFEE;
  --teal: #23A0B1; --teal-tint: #E6F5F7; --danger: #D93A2B;
  --text: var(--ink); --muted: var(--gray);
  --leaf: 26px; --r: 8px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #EDEBE9; --char: #D9D6D3; --gray: #A5A3A1; --gray-2: #8C8A88; --warm: #6E6B68;
    --line: #333231; --bg: #161616; --surface: #222222; --soft: #2C2B2A;
    --tint: #3A2620; --tint-line: #5A3427; --teal-tint: #173438;
  }
}
:root[data-theme="dark"] {
  --ink: #EDEBE9; --char: #D9D6D3; --gray: #A5A3A1; --gray-2: #8C8A88; --warm: #6E6B68;
  --line: #333231; --bg: #161616; --surface: #222222; --soft: #2C2B2A;
  --tint: #3A2620; --tint-line: #5A3427; --teal-tint: #173438;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5;
  word-break: keep-all; overflow-wrap: anywhere; letter-spacing: -0.2px;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
#app { height: 100dvh; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; background: var(--bg); position: relative; }

/* ---------- 상단 ---------- */
.top { background: var(--surface); color: var(--ink); padding: calc(10px + var(--safe-t)) 16px 10px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); position: relative; }
.top::after { content: ""; position: absolute; left: 16px; bottom: -1px; width: 28px; height: 2px; background: var(--orange); }
.top .logo { width: 32px; height: 32px; border-radius: var(--r); }
.theme-saide .top .logo { border-radius: 50%; }
.top h1 { font-size: 18px; margin: 0; font-weight: 700; flex: 1; letter-spacing: -0.4px; color: var(--ink); }
.top .sub { font-size: 12px; font-weight: 500; display: block; color: var(--gray); letter-spacing: -0.1px; }
.theme-saide .top .sub { color: var(--orange); font-weight: 600; }
.top .act { white-space: nowrap; background: var(--soft); border: 0; border-radius: var(--r); padding: 7px 9px; color: var(--char); display: inline-flex; align-items: center; }
.top .act svg { width: 20px; height: 20px; }
.flagbtn { background: var(--soft); border: 0; border-radius: var(--r); padding: 7px 9px; display: grid; place-items: center; }

/* ---------- 본문 ---------- */
.main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll { flex: 1; overflow-y: auto; padding: 14px 16px; -webkit-overflow-scrolling: touch; }
.scroll.withfab { padding-bottom: 84px; }

/* ---------- 대화 ---------- */
.msg { display: flex; margin: 6px 0; }
.msg.in { justify-content: flex-end; }
.bubble { max-width: 84%; padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; font-size: 14.5px; }
.msg.in .bubble { background: var(--orange); color: #fff; border-radius: 16px 16px 4px 16px; }
.msg.out .bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; color: var(--ink); }
.msg .time { font-size: 11px; color: var(--gray-2); align-self: flex-end; margin: 0 6px; white-space: nowrap; }
.bubble a { color: inherit; text-decoration: underline; }
.day { text-align: center; margin: 16px 0 8px; font-size: 12px; color: var(--gray-2); font-weight: 500; }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25 } 40% { opacity: 1 } }
.empty { text-align: center; color: var(--gray); padding: 44px 12px; font-size: 14px; }
.empty svg { width: 52px; height: 52px; color: var(--warm); display: block; margin: 0 auto 12px; }
.more { display: block; margin: 0 auto 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 35px; padding: 5px 14px; font-size: 13px; color: var(--gray); }

/* ---------- 입력창 ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips[hidden] { display: none; }
.chip { flex: none; background: var(--surface); color: var(--char); border: 1px solid var(--warm); border-radius: 35px; padding: 6px 13px; font-size: 13px; font-weight: 600; display: inline-flex; gap: 5px; align-items: center; }
.chip svg { width: 15px; height: 15px; color: var(--orange); }
.chip:active { border-color: var(--orange); color: var(--orange); }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--warm); background: var(--surface); border-radius: 22px; padding: 9px 15px; max-height: 140px; min-height: 42px; outline: none; font-size: 15px; }
.composer textarea:focus { border-color: var(--orange); caret-color: var(--orange); }
.composer textarea::placeholder { color: var(--gray-2); }
.icon-btn { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--char); display: grid; place-items: center; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.send { background: var(--orange); border-color: var(--orange); color: #fff; }
.icon-btn:disabled { opacity: .45; }
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px 0; background: var(--surface); }
.attach-list:empty { display: none; }
.att { background: var(--soft); border-radius: var(--r); padding: 4px 6px 4px 10px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.att svg { width: 16px; height: 16px; color: var(--orange); }
.att span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.att button { border: 0; background: none; padding: 0 4px; color: var(--gray); font-size: 16px; line-height: 1; }
.progress { height: 3px; background: var(--orange); width: 0; transition: width .2s; }

/* ---------- 탭(알약형) · 카드 ---------- */
.seg { display: flex; gap: 6px; margin: 12px 16px 0; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; border: 1px solid var(--warm); background: var(--surface); padding: 7px 14px; border-radius: 35px; font-size: 13.5px; font-weight: 600; color: var(--gray); }
.seg button.on { background: var(--orange); border-color: var(--orange); color: #fff; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.ficon { width: 42px; height: 42px; border-radius: var(--r) var(--r) 18px var(--r); display: grid; place-items: center; flex: none; color: #fff; }
.ficon svg { width: 22px; height: 22px; }
.fthumb { width: 42px; height: 42px; border-radius: var(--r) var(--r) 18px var(--r); object-fit: cover; flex: none; cursor: zoom-in; background: var(--soft); }
.grow { flex: 1; min-width: 0; }
.title { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.meta { font-size: 12px; color: var(--gray); }
.dl { border: 1px solid var(--line); background: var(--surface); color: var(--char); border-radius: var(--r); padding: 7px 9px; display: inline-flex; align-items: center; text-decoration: none; }
.dl svg { width: 20px; height: 20px; }
.dl:active { border-color: var(--orange); color: var(--orange); }
button.dl { cursor: pointer; }
.card .dl + .dl { margin-left: 6px; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 1px 6px; margin-right: 6px; vertical-align: 1px; }
.tag.zalo, .tag.bot { background: var(--soft); color: var(--char); }
.tag.web, .tag.saide { background: var(--tint); color: var(--orange); }
.tag.file { background: var(--teal-tint); color: var(--teal); }
.note { white-space: pre-wrap; font-size: 14px; margin-top: 6px; color: var(--ink); }
.note.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.link { background: none; border: 0; color: var(--orange); font-size: 13px; padding: 4px 0 0; font-weight: 600; }

/* ---------- 하단 탭 ---------- */
.tabs { display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs button { flex: 1; border: 0; background: none; padding: 9px 0 7px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--gray-2); position: relative; font-weight: 600; }
.tabs button svg { width: 24px; height: 24px; }
.tabs button.on { color: var(--orange); }
.tabs button.on::before { content: ""; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px; background: var(--orange); }
.badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--orange); color: #fff; font-size: 10.5px; min-width: 17px; height: 17px; border-radius: 9px; padding: 0 5px; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--surface); box-sizing: content-box; }

/* ---------- 언어 선택 · 로그인 ---------- */
.flag { width: 30px; height: 20px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); flex: none; display: block; }
.langpick { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; gap: 6px; text-align: center; background: var(--surface); }
.lp-logo { width: 84px; height: 84px; border-radius: 22px; }
.langpick h2 { margin: 14px 0 0; font-size: 26px; letter-spacing: 1px; font-weight: 800; color: var(--ink); }
.langpick p { margin: 0 0 20px; color: var(--gray); font-size: 13.5px; line-height: 1.6; }
.lp-list { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.lp-list button { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--warm); border-radius: var(--r) var(--r) var(--leaf) var(--r); padding: 14px 18px; font-size: 17px; font-weight: 600; text-align: left; color: var(--ink); transition: border-color .15s, background .15s; }
.lp-list button span { flex: 1; }
.lp-list button > svg:last-child { width: 22px; height: 22px; color: var(--orange); opacity: 0; }
.lp-list button.on, .lp-list button:active { border-color: var(--orange); background: var(--tint); }
.lp-list button.on > svg:last-child { opacity: 1; }
.lp-flag { width: 54px; height: 36px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0,0,0,.12); flex: none; }
.login { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 24px; gap: 14px; background: var(--surface); }
.login .hero { text-align: center; margin-bottom: 10px; }
.login .hero img { width: 76px; height: 76px; border-radius: 20px; }
.login h2 { margin: 14px 0 4px; font-size: 22px; font-weight: 700; color: var(--ink); }
.login p { margin: 0; color: var(--gray); font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--char); }
.field input { border: 0; border-bottom: 1px solid var(--warm); background: transparent; border-radius: 0; padding: 12px 2px; font-size: 17px; outline: none; }
.field input:focus { border-bottom: 2px solid var(--orange); caret-color: var(--orange); }
.code { letter-spacing: 10px; text-align: center; font-size: 26px !important; font-weight: 700; }
.btn { border: 0; background: var(--orange); color: #fff; border-radius: 35px; padding: 15px; font-size: 16px; font-weight: 700; }
.btn:active { background: var(--orange-dk); }
.btn:disabled { opacity: .45; }
.btn.ghost { background: none; color: var(--gray); font-weight: 600; padding: 8px; font-size: 14px; }
.err { color: var(--danger); font-size: 13.5px; min-height: 20px; text-align: center; white-space: pre-wrap; }
.steps { display: flex; gap: 10px; justify-content: center; color: var(--gray); font-size: 12.5px; }
.steps span { display: inline-flex; align-items: center; gap: 4px; }
.steps svg { width: 16px; height: 16px; color: var(--orange); }
.lang-row { display: flex; justify-content: center; gap: 8px; margin-top: 8px; }
.lang-row button { padding: 5px; border-radius: 6px; border: 2px solid transparent; background: none; }
.lang-row button.on { border-color: var(--orange); }
.lang-row .flag { width: 36px; height: 24px; }
.langmenu { position: fixed; top: calc(58px + var(--safe-t)); right: max(12px, calc(50vw - 348px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r) var(--r) var(--leaf) var(--r); box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 6px; z-index: 40; min-width: 210px; }
.langmenu button { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: none; padding: 10px 12px; border-radius: 6px; font-size: 15px; text-align: left; color: var(--ink); }
.langmenu button.on { background: var(--tint); color: var(--orange); font-weight: 700; }

/* ---------- 시트 · 알림 ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet { background: var(--bg); width: 100%; max-width: 720px; max-height: 86dvh; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; padding-bottom: var(--safe-b); overflow: hidden; }
.sheet header { display: flex; align-items: center; padding: 15px 16px; border-bottom: 1px solid var(--line); gap: 8px; background: var(--surface); }
.sheet header h3 { margin: 0; font-size: 16px; flex: 1; font-weight: 700; }
.sheet header select, .sheet header button { border: 1px solid var(--warm); background: var(--surface); border-radius: 35px; padding: 5px 11px; font-size: 13px; }
.sheet header .sx { border: 0; background: none; font-size: 18px; color: var(--gray); }
.sheet-body { overflow-y: auto; padding: 18px 16px; }
.toast { position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translateX(-50%); background: rgba(34,34,34,.94); color: #fff; padding: 9px 18px; border-radius: 35px; font-size: 13.5px; z-index: 60; max-width: 90%; text-align: center; }

/* ---------- Saide ---------- */
.upill { display: flex; align-items: center; gap: 6px; background: var(--tint); color: var(--char); border-radius: 35px; padding: 5px 11px; font-size: 12px; white-space: nowrap; }
.upill b { color: var(--orange); font-size: 13px; }
.upill i { width: 34px; height: 4px; border-radius: 2px; background: var(--tint-line); position: relative; overflow: hidden; }
.upill i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--orange); }
.upill em { font-style: normal; color: var(--gray); }
.welcome { text-align: center; padding: 20px 4px 10px; }
.welcome .wav { width: 64px; height: 64px; border-radius: 50%; }
.welcome h2 { font-size: 21px; margin: 14px 0 4px; letter-spacing: -0.5px; font-weight: 700; color: var(--ink); }
.welcome p { margin: 0 0 20px; color: var(--gray); font-size: 14px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
.qcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r) var(--r) var(--leaf) var(--r); padding: 15px 13px; display: flex; flex-direction: column; gap: 4px; min-height: 122px; transition: background .25s, border-color .25s, color .25s; color: var(--ink); }
.qcard .qi { width: 38px; height: 38px; border-radius: var(--r) var(--r) 16px var(--r); background: var(--tint); color: var(--orange); display: grid; place-items: center; margin-bottom: 6px; transition: background .25s, color .25s; }
.qcard .qi svg { width: 22px; height: 22px; }
.qcard b { font-size: 15px; }
.qcard small { color: var(--gray); font-size: 12.5px; line-height: 1.4; }
.qcard:active { background: var(--orange); border-color: var(--orange); color: #fff; }
.qcard:active small { color: rgba(255,255,255,.85); }
.qcard:active .qi { background: rgba(255,255,255,.2); color: #fff; }
.welcome .grade { margin-top: 16px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--gray); }
.welcome .grade svg { width: 14px; height: 14px; color: var(--orange); }
.msg.s { align-items: flex-start; gap: 8px; }
.msg.s .av { width: 30px; height: 30px; border-radius: 50%; flex: none; margin-top: 2px; }
.msg.s .sbody { max-width: 84%; min-width: 0; }
.msg.s .bubble { max-width: 100%; white-space: normal; line-height: 1.6; }
.msg.s .bubble .h { font-weight: 700; color: var(--char); margin-top: 10px; display: flex; gap: 7px; }
.msg.s .bubble .h:first-child { margin-top: 0; }
.msg.s .bubble .h::before { content: ""; width: 8px; height: 8px; background: var(--orange); border-radius: 0 0 6px 0; flex: none; margin-top: 7px; }
.msg.s .bubble .b1 { padding-left: 14px; position: relative; }
.msg.s .bubble .b1::before { content: ""; position: absolute; left: 3px; top: .75em; width: 5px; height: 2px; background: var(--orange-2); }
.msg.s .bubble .b2 { padding-left: 26px; position: relative; color: var(--gray); font-size: 13.5px; }
.msg.s .bubble .b2::before { content: ""; position: absolute; left: 16px; top: .7em; width: 4px; height: 4px; background: var(--warm); border-radius: 50%; }
.msg.s .bubble .gap { height: 6px; }
.sfoot { display: flex; align-items: center; gap: 2px; margin-top: 2px; }
.sfoot .time { margin-left: 4px; }
.cp { border: 0; background: none; color: var(--warm); padding: 3px; display: grid; place-items: center; border-radius: 4px; }
.cp svg { width: 15px; height: 15px; }
.cp:active { color: var(--orange); }
.bubble.think { display: inline-flex; align-items: center; gap: 8px; color: var(--gray); font-size: 13.5px; white-space: nowrap; }

/* ---------- 첨부 ---------- */
.attmenu { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.attmenu button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.attmenu .ai { width: 60px; height: 60px; border-radius: 12px 12px var(--leaf) 12px; display: grid; place-items: center; color: #fff; }
.attmenu .ai svg { width: 28px; height: 28px; }
.ai-camera { background: var(--orange); } .ai-video { background: #424342; } .ai-gallery { background: var(--orange-2); } .ai-file { background: var(--gray); }
.hint { text-align: center; color: var(--gray); font-size: 12.5px; margin: 16px 0 0; }
.thumb { position: relative; width: 74px; height: 74px; border-radius: var(--r) var(--r) 20px var(--r); overflow: hidden; background: var(--soft); flex: none; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 20px; text-shadow: 0 1px 4px rgba(0,0,0,.5); pointer-events: none; }
.thumb .tfile { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 4px; color: var(--orange); }
.thumb .tfile svg { width: 24px; height: 24px; }
.thumb .tfile small { font-size: 10px; color: var(--gray); max-width: 66px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb > button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(34,34,34,.6); color: #fff; font-size: 14px; line-height: 1; padding: 0; }
.tprog { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(0,0,0,.25); }
.tprog i { display: block; height: 100%; background: var(--orange); transition: width .2s; }
.inbody { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 84%; }
.inbody .bubble { max-width: 100%; }
.mgrid { display: grid; gap: 3px; border-radius: 12px 12px 4px 12px; overflow: hidden; width: 240px; max-width: 100%; }
.mgrid.n2 { grid-template-columns: 1fr 1fr; } .mgrid.n3 { grid-template-columns: 1fr 1fr 1fr; }
.mgrid img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: zoom-in; background: var(--soft); }
.mgrid.n1 img { aspect-ratio: auto; max-height: 280px; width: 100%; }
.mgrid video { width: 100%; max-height: 280px; background: #000; display: block; grid-column: 1 / -1; }
.mfile { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); padding: 8px 10px; color: var(--ink); text-decoration: none; grid-column: 1 / -1; font-size: 13px; }
.mfile svg { width: 20px; height: 20px; color: var(--orange); flex: none; }
.mfile span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mfile small { color: var(--gray); }
.card .mgrid { margin-top: 8px; border-radius: var(--r); }
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.94); z-index: 50; display: grid; place-items: center; }
.viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .vbar { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; display: flex; gap: 8px; }
.viewer .vbar a, .viewer .vbar button { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; border: 0; display: grid; place-items: center; font-size: 18px; }
.viewer .vbar svg { width: 22px; height: 22px; }

/* ---------- 파일함 · 자료실 · 보내기 ---------- */
.fab { position: absolute; right: 16px; bottom: calc(78px + var(--safe-b)); background: var(--orange); color: #fff; border: 0; border-radius: 35px; padding: 13px 20px; display: flex; align-items: center; gap: 8px; font-weight: 700; box-shadow: 0 6px 18px rgba(255,86,36,.35); z-index: 5; }
.fab svg { width: 20px; height: 20px; }
.libgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.libf { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r) var(--r) var(--leaf) var(--r); padding: 15px 13px; text-align: left; display: flex; flex-direction: column; gap: 3px; color: var(--ink); transition: background .25s, border-color .25s; }
.libf .lfi { width: 36px; height: 36px; border-radius: var(--r) var(--r) 14px var(--r); background: var(--tint); color: var(--orange); display: grid; place-items: center; margin-bottom: 6px; }
.libf .lfi svg { width: 20px; height: 20px; }
.libf b { font-size: 14.5px; } .libf small { color: var(--gray); font-size: 12px; }
.libf:active { background: var(--orange); border-color: var(--orange); color: #fff; }
.libf:active small { color: rgba(255,255,255,.85); }
.libup { border: 0; background: none; color: var(--orange); font-weight: 700; padding: 0 0 6px; font-size: 14px; }
.crumb { font-size: 12px; color: var(--gray); margin-bottom: 8px; }
.libdir { cursor: pointer; } .chev { color: var(--warm); font-size: 22px; }
.doctext { white-space: pre-wrap; font-family: inherit; font-size: 13.5px; line-height: 1.65; margin: 0; color: var(--ink); }
.sendf { display: flex; flex-direction: column; gap: 14px; }
.btn.ghostline { background: var(--surface); color: var(--orange); border: 1.5px dashed var(--orange); border-radius: var(--r) var(--r) var(--leaf) var(--r); display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; }
.btn.ghostline svg { width: 20px; height: 20px; }
.sendf .attach-list { padding: 0; background: none; }
.sflabel { display: flex; justify-content: space-between; align-items: center; font-size: 14px; border-bottom: 1px solid var(--warm); padding-bottom: 8px; }
.sflabel label { color: var(--gray); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.sfstaff { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-height: 36dvh; overflow-y: auto; }
.sfstaff label { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 10px; font-size: 14px; }
.sfstaff label:has(input:checked) { border-color: var(--orange); background: var(--tint); }
.sfstaff label small { color: var(--gray); font-size: 11px; margin-left: auto; }
.sfstaff input, .sflabel input { width: 18px; height: 18px; accent-color: var(--orange); }
.sendf textarea { border: 1px solid var(--warm); border-radius: var(--r); padding: 10px 12px; resize: none; background: var(--surface); outline: none; }
.sendf textarea:focus { border-color: var(--orange); }

/* ---------- 사전손익 간편 계산기 ---------- */
.pnl { padding: 0 12px 30px; }
.pkpi { position: sticky; top: 0; z-index: 4; display: grid; grid-template-columns: 1.35fr 1fr; gap: 8px; padding: 10px 0 10px; background: var(--bg); }
.pkpi > div { border-radius: var(--r) var(--r) 22px var(--r); padding: 11px 13px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pkpi small { font-size: 11.5px; font-weight: 600; opacity: .9; line-height: 1.3; }
.pkpi b { font-size: 26px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pkpi b em { font-style: normal; font-size: 12.5px; font-weight: 600; margin-left: 4px; letter-spacing: 0; }
.pkpi span { font-size: 12px; }
.pkpi strong { font-size: 15px; }
.k1 { background: var(--orange); color: #fff; }
.k2 { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.k1.g { background: #1F8A5B; } .k1.y { background: #C98A00; } .k1.r { background: var(--orange); }
.k2.g { border-color: #1F8A5B; box-shadow: inset 0 -3px 0 #1F8A5B; } .k2.r { border-color: var(--tint-line); box-shadow: inset 0 -3px 0 var(--orange); }
.psec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r) var(--r) var(--leaf) var(--r); margin-bottom: 10px; overflow: hidden; }
.psec > header { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.psec > header .pn { width: 24px; height: 24px; border-radius: 6px 6px 12px 6px; background: var(--orange); color: #fff; font-size: 12.5px; font-weight: 800; display: grid; place-items: center; flex: none; }
.psec.star > header .pn, .psec.detail > header .pn { background: var(--char); }
.psec > header b { font-size: 15px; color: var(--ink); }
.psec > header small { margin-left: auto; font-size: 11.5px; color: var(--gray); text-align: right; }
.pb { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.pi { border: 0; border-bottom: 1px solid var(--warm); background: transparent; padding: 7px 4px; font-size: 15px; text-align: right; outline: none; min-width: 0; width: 100%; border-radius: 0; color: var(--ink); caret-color: var(--orange); font-variant-numeric: tabular-nums; }
.pi:focus { border-bottom: 2px solid var(--orange); }
.pi:disabled { color: var(--gray); background: var(--soft); border-bottom-style: dashed; }
.pi.wide { font-size: 16px; font-weight: 600; }
.pi.sm { width: 54px; text-align: center; }
.pb select { border: 0; border-bottom: 1px solid var(--warm); background: transparent; padding: 7px 2px; font-size: 15px; color: var(--ink); outline: none; border-radius: 0; }
.pb select.wide { width: 100%; font-weight: 600; }
.two2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.two2 label { display: flex; flex-direction: column; gap: 2px; }
.two2 small { font-size: 12px; color: var(--gray); font-weight: 600; }
.pgrid { display: grid; grid-template-columns: 52px 1fr 1fr; gap: 6px 10px; align-items: center; }
.pgrid > em, .mgrid4 > em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--char); text-align: right; padding-right: 4px; }
.pgrid > span, .mgrid4 > span { font-size: 12.5px; color: var(--gray); font-weight: 600; }
.psub { border-top: 1px dashed var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.rowx { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rowx > span, .rowx > b { font-size: 13.5px; color: var(--char); flex: none; }
.rowx .u { display: flex; align-items: center; gap: 6px; flex: 1; justify-content: flex-end; min-width: 0; }
.rowx .u .pi.num { max-width: 150px; }
.rowx .u em { font-style: normal; font-size: 12px; color: var(--gray); white-space: nowrap; }
.rowx .u em i { font-style: normal; }
.note { margin: 0; font-size: 12px; color: var(--gray); }
.note.center { text-align: center; padding: 8px 0; }
.dayb { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
.dayb + .dayb { margin-top: 2px; }
.dh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dh b { font-size: 13.5px; color: var(--ink); margin-right: auto; }
.dp { font-size: 12px; color: var(--gray); display: inline-flex; align-items: center; gap: 4px; }
.same { font-size: 12px; color: var(--gray); display: inline-flex; align-items: center; gap: 4px; }
.same input { accent-color: var(--orange); width: 16px; height: 16px; }
.mgrid4 { display: grid; grid-template-columns: 62px repeat(4, 1fr); gap: 6px 6px; align-items: center; }
.mgrid4 .pi { font-size: 14px; padding: 6px 2px; }
.staff { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.srow { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; display: flex; align-items: center; gap: 8px; }
.srow > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.srow b { font-size: 13px; color: var(--ink); }
.srow small { font-size: 11.5px; color: var(--gray); }
.srow .pi.w { font-size: 13px; padding: 4px 2px; text-align: left; }
.srow select { border: 1px solid var(--warm) !important; border-radius: 6px !important; padding: 5px 6px !important; font-size: 14px !important; width: 58px; text-align: center; }
.srow.ssum { background: var(--tint); border-color: var(--tint-line); }
.srow.ssum > div { flex-direction: column; }
.srow.ssum b { color: var(--orange); font-size: 15px; }
.lsum { display: flex; justify-content: space-between; align-items: center; background: var(--soft); border-radius: var(--r); padding: 9px 12px; font-size: 13px; color: var(--char); }
.lsum b { color: var(--ink); font-size: 15px; }
.vtabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.vtabs::-webkit-scrollbar { display: none; }
.vtabs button { flex: none; border: 1px solid var(--warm); background: var(--surface); border-radius: 35px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--gray); }
.vtabs button.on { background: var(--char); border-color: var(--char); color: #fff; }
.ptable { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.ptable td { padding: 8px 2px; border-bottom: 1px solid var(--line); }
.ptable td:nth-child(2) { text-align: right; color: var(--gray); font-size: 12.5px; width: 64px; }
.ptable td:nth-child(3) { text-align: right; font-weight: 600; width: 96px; }
.ptable tr.minor td { font-size: 12.5px; color: var(--gray); padding-top: 4px; padding-bottom: 4px; }
.ptable tr.minor td:first-child { padding-left: 10px; }
.ptable tr.mid td { font-weight: 700; color: var(--char); background: var(--soft); }
.ptable tr.total td { font-weight: 800; color: var(--orange); font-size: 15.5px; border-bottom: 0; border-top: 2px solid var(--orange); }
.ptable tr.neg td:nth-child(3) { color: var(--danger); }
.pbtns { display: flex; gap: 8px; }
.pbtns .btn { flex: 1; padding: 13px; font-size: 15px; }
.psave { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding: 9px 0; }
.psave > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.psave b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psave .nat { font-size: 10.5px; background: var(--soft); color: var(--char); border-radius: 4px; padding: 1px 5px; margin-right: 6px; vertical-align: 1px; }
.psave small { font-size: 11.5px; color: var(--gray); }
.psave small strong { color: var(--orange); }
.psave button { border: 1px solid var(--warm); background: var(--surface); border-radius: 35px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; color: var(--char); }
.psave button.del { color: var(--gray); }
body.capturing .pkpi { position: static; }
.seg2 { display: inline-flex; border: 1px solid var(--warm); border-radius: 35px; padding: 2px; flex: none; }
.seg2 button { border: 0; background: none; border-radius: 35px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; color: var(--gray); white-space: nowrap; }
.seg2 button.on { background: var(--orange); color: #fff; }

/* ---------- 알림 지우기 ---------- */
.ibar { display: flex; justify-content: flex-end; gap: 6px; padding: 10px 16px 0; }
.ibar button { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--warm); background: var(--surface); color: var(--char); border-radius: 35px; padding: 6px 12px; font-size: 12.5px; font-weight: 600; }
.ibar button svg { width: 15px; height: 15px; color: var(--orange); }
.ibar button:active { border-color: var(--orange); color: var(--orange); }
.icard .meta { display: flex; align-items: center; }
.ix { margin-left: auto; border: 0; background: none; color: var(--warm); padding: 2px; border-radius: 4px; display: grid; place-items: center; }
.ix svg { width: 18px; height: 18px; }
.ix:active { color: var(--orange); background: var(--tint); }
.cq { margin: 0 0 16px; font-size: 15px; line-height: 1.6; color: var(--ink); text-align: center; }

/* ---------- 홈 · 떠 있는 뒤로/홈 버튼 ---------- */
.home { padding: 18px 16px 24px; }
.hhello { display: flex; align-items: center; gap: 12px; margin: 4px 2px 18px; }
.hhello img { width: 48px; height: 48px; border-radius: 50%; }
.hhello b { display: block; font-size: 19px; font-weight: 800; color: var(--ink); letter-spacing: -0.4px; }
.hhello small { font-size: 13px; color: var(--gray); }
.hgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r) var(--r) var(--leaf) var(--r); padding: 16px 14px 18px; text-align: left; display: flex; flex-direction: column; gap: 3px; min-height: 128px; color: var(--ink); transition: background .2s, border-color .2s; }
.hcard.wide { grid-column: 1 / -1; min-height: 110px; background: var(--orange); border-color: var(--orange); color: #fff; }
.hcard .hi { width: 42px; height: 42px; border-radius: var(--r) var(--r) 18px var(--r); background: var(--tint); color: var(--orange); display: grid; place-items: center; margin-bottom: 8px; }
.hcard.wide .hi { background: rgba(255,255,255,.2); color: #fff; }
.hcard .hi svg { width: 24px; height: 24px; }
.hcard b { font-size: 16px; font-weight: 700; }
.hcard small { font-size: 12.5px; color: var(--gray); line-height: 1.4; }
.hcard.wide small { color: rgba(255,255,255,.88); }
.hcard .hb { position: absolute; top: 12px; right: 12px; font-style: normal; background: var(--orange); color: #fff; font-size: 11.5px; font-weight: 700; border-radius: 35px; padding: 2px 9px; }
.hcard.wide .hb { background: #fff; color: var(--orange); }
.hcard:active { border-color: var(--orange); background: var(--tint); }
.hcard.wide:active { background: var(--orange-dk); }
.navf { position: absolute; left: 12px; bottom: calc(70px + var(--safe-b)); z-index: 15; display: flex; align-items: center; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 35px; box-shadow: 0 6px 18px rgba(0,0,0,.14); padding: 3px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.navf button { width: 40px; height: 40px; border: 0; background: none; border-radius: 50%; color: var(--char); display: grid; place-items: center; }
.navf button svg { width: 22px; height: 22px; }
.navf button:active { background: var(--tint); color: var(--orange); }
.navf span { width: 1px; height: 20px; background: var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .navf { background: rgba(34,34,34,.94); } }
.navf.chat { bottom: calc(176px + var(--safe-b)); }
.navf.moved { bottom: auto; }
.navf .grip { width: 22px; height: 40px; cursor: grab; touch-action: none; color: var(--gray-2); border-radius: 20px 0 0 20px; }
.navf .grip svg { width: 14px; height: 18px; }
.navf.dragging { opacity: .8; box-shadow: 0 10px 26px rgba(0,0,0,.22); }
.navf.dragging .grip { cursor: grabbing; color: var(--orange); }

/* ---------- 권한 관리 (관리자) ---------- */
.psearch { padding: 12px 16px 0; }
.psearch input { width: 100%; border: 1px solid var(--warm); border-radius: 35px; padding: 9px 15px; background: var(--surface); outline: none; }
.psearch input:focus { border-color: var(--orange); }
.pnote { font-size: 12.5px; color: var(--char); background: var(--tint); border: 1px solid var(--tint-line); border-radius: var(--r) var(--leaf) var(--r) var(--r); padding: 10px 12px; }
.phead { font-size: 13px; font-weight: 700; color: var(--char); margin: 16px 2px 8px; padding-left: 8px; border-left: 3px solid var(--orange); }
.puser .title { font-weight: 700; }
.lv { font-size: 11px; font-weight: 700; border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px; }
.lv-admin { background: var(--orange); color: #fff; }
.lv-leader { background: var(--teal-tint); color: var(--teal); }
.lv-staff { background: var(--soft); color: var(--gray); }
.pall { margin-top: 8px; display: flex; align-items: center; gap: 5px; color: var(--orange); font-weight: 600; }
.pall svg { width: 15px; height: 15px; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pc { position: relative; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--warm); background: var(--surface); color: var(--gray); border-radius: 35px; padding: 5px 11px 5px 9px; font-size: 12.5px; font-weight: 600; }
.pc svg { width: 14px; height: 14px; }
.pc.on { background: var(--orange); border-color: var(--orange); color: #fff; }
.pc.ov::after { content: ""; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--teal); border: 2px solid var(--surface); }
.pc:disabled { opacity: .6; }
.homeout { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 22px auto 6px; }
.homeout svg { width: 16px; height: 16px; }
.pc.lock { opacity: .45; text-decoration: line-through; }
.lv-exec { background: var(--char); color: #fff; }
.lv-team { background: var(--tint); color: var(--orange-dk); }
.pc:disabled:not(.lock) { opacity: 1; cursor: default; }

/* 일정 탭 (2026-10-16) */
.shead { font-size: 14px; font-weight: 700; color: var(--char); margin: 14px 2px 8px; display: flex; align-items: center; gap: 6px; }
.shead small { font-size: 12px; color: var(--gray); font-weight: 600; }
.shead.late { color: var(--orange); }
.shead.undated { color: var(--gray); }
.shead2 { margin: 8px 2px 6px; font-weight: 700; }
.shead2.late { color: var(--orange); }
.scard .note { font-size: 14.5px; line-height: 1.45; margin-top: 4px; white-space: pre-wrap; }
.scard .meta b { color: var(--char); font-weight: 700; }
.scard { display: flex; gap: 10px; align-items: stretch; }
.scard .sbody { flex: 1; min-width: 0; }
.sbtns { display: flex; flex-direction: column; gap: 6px; justify-content: center; flex: none; }
.sb { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 64px; height: 34px; padding: 0 10px; border-radius: 35px; border: 1px solid transparent; font-size: 13px; font-weight: 700; color: #fff; }
.sb svg { width: 15px; height: 15px; }
.sb.done { background: #1F9D55; border-color: #1F9D55; }
.sb.delay { background: var(--orange); border-color: var(--orange); }
.sb.cancel { background: var(--surface); color: var(--gray); border-color: var(--warm); }
.sb:active { filter: brightness(.92); transform: scale(.97); }
@media (max-width: 360px) { .sb span { display: none; } .sb { min-width: 40px; padding: 0; width: 40px; } }

/* 제안서 요청 탭 (2026-10-17) */
.prform { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px 24px; }
.prform select, .prform textarea { border: 0; border-bottom: 1px solid var(--warm); background: transparent; border-radius: 0; padding: 10px 2px; font-size: 16px; font-family: inherit; outline: none; width: 100%; }
.prform textarea:focus, .prform select:focus { border-bottom: 2px solid var(--orange); }
.prform .field input { font-size: 15px; padding: 9px 2px; }
.prgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.prchk { cursor: pointer; }
.prchk input { width: 20px; height: 20px; accent-color: var(--orange); flex: none; }
.prchk em { font-style: normal; margin-left: 6px; }
.prform .psub > b { font-size: 14px; color: var(--char); }
.sbtns a.link { text-decoration: none; }
