:root {
  --yellow: #fee500;
  --brown: #3c1e1e;
  --bg: #ffffff;
  --chat-bg: #b2c7da;
  --text: #191919;
  --muted: #8a8a8a;
  --line: #ececec;
  --mine: #fee500;
  --theirs: #ffffff;
  --red: #fa5a3c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1e1e;
    --chat-bg: #2a3440;
    --text: #f1f1f1;
    --muted: #9a9a9a;
    --line: #333;
    --theirs: #3a3a3a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 520px;
  margin: 0 auto;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.screen { height: 100%; height: 100dvh; display: flex; flex-direction: column; }

/* auth */
.auth { background: var(--yellow); justify-content: center; justify-content: safe center; align-items: center; color: #191919; overflow-y: auto; }
.auth-box { width: 100%; max-width: 320px; padding: 16px; text-align: center; }
.logo { width: 72px; height: 72px; }
.auth h1 { margin: 8px 0 24px; color: var(--brown); }
.auth input {
  display: block; width: 100%; padding: 12px; margin-bottom: 8px;
  border: 1px solid #e0d24c; border-radius: 6px; background: #fff; color: #191919;
}
.btn-primary {
  width: 100%; padding: 12px; border: 0; border-radius: 6px;
  background: var(--brown); color: #fff; font-weight: 600;
}
.dialog-actions .btn-primary { width: auto; background: var(--yellow); color: #191919; }
.link { background: none; border: 0; margin-top: 12px; color: var(--brown); text-decoration: underline; }
.error { color: #c0392b; min-height: 1.2em; font-size: 14px; margin: 4px 0; }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.topbar h2 { margin: 0; font-size: 20px; }
.actions { display: flex; gap: 4px; }
.icon-btn { background: none; border: 0; font-size: 20px; padding: 4px 8px; color: inherit; }
.banner { background: #fff8c4; color: #5a4a00; padding: 10px 16px; font-size: 14px; }
.banner button { margin-left: 6px; border: 0; background: var(--brown); color: #fff; border-radius: 4px; padding: 4px 8px; }

.tab-body { flex: 1; min-height: 0; overflow-y: auto; }
.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; cursor: pointer;
}
.list li:active { background: var(--line); }
.avatar {
  width: 44px; height: 44px; border-radius: 16px; flex: none;
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 18px;
}
.me-card .avatar { width: 56px; height: 56px; border-radius: 20px; font-size: 22px; }
.li-main { flex: 1; min-width: 0; }
.li-name { font-weight: 600; }
.li-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-side { text-align: right; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.badge {
  background: var(--red); color: #fff; border-radius: 10px; padding: 1px 6px;
  font-size: 11px; font-weight: 700; font-style: normal; min-width: 18px; text-align: center;
}
.me-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.section-label { padding: 12px 16px 4px; font-size: 12px; color: var(--muted); }
.req-actions { display: flex; gap: 6px; }
.req-actions button { border: 0; border-radius: 4px; padding: 6px 10px; font-size: 13px; }
.req-actions .accept { background: var(--yellow); color: #191919; }
.req-actions .decline { background: var(--line); color: var(--text); }
.empty { color: var(--muted); text-align: center; padding: 40px 16px; font-size: 14px; }

.tabbar { display: flex; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar button {
  flex: 1; background: none; border: 0; padding: 8px 0; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; font-size: 12px; position: relative;
}
.tabbar button span { font-size: 20px; filter: grayscale(1); opacity: .6; }
.tabbar button.active { color: var(--text); }
.tabbar button.active span { filter: none; opacity: 1; }
.tabbar .badge { position: absolute; top: 4px; left: calc(50% + 6px); }

/* room */
.room { background: var(--chat-bg); }
.room-bar { background: var(--chat-bg); border: 0; }
.room-bar .icon-btn { font-size: 30px; line-height: 1; }
.room-bar h2 { font-size: 17px; }
.spacer { width: 40px; }
.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px; }
.date-sep { text-align: center; margin: 12px 0; }
.date-sep span { background: rgba(0,0,0,.15); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 10px; }
.row { display: flex; align-items: flex-end; gap: 4px; margin: 4px 0; }
.row.mine { flex-direction: row-reverse; }
.row .avatar { width: 36px; height: 36px; border-radius: 14px; font-size: 14px; align-self: flex-start; }
.row .avatar.ghost { visibility: hidden; }
.col { display: flex; flex-direction: column; max-width: 70%; }
.row .sender { font-size: 12px; margin: 0 0 3px 2px; }
.bubble {
  padding: 7px 10px; border-radius: 12px; white-space: pre-wrap; word-break: break-word;
  background: var(--theirs); font-size: 15px; line-height: 1.4;
}
.row.mine .bubble { background: var(--mine); color: #191919; }
.meta { font-size: 10px; color: rgba(0,0,0,.55); display: flex; flex-direction: column; align-items: flex-end; }
.row:not(.mine) .meta { align-items: flex-start; }
@media (prefers-color-scheme: dark) { .meta { color: rgba(255,255,255,.6); } }
.unread-1 { color: #e6b800; font-weight: 700; }
.row.pending .bubble { opacity: .6; }
.typing { font-size: 12px; color: rgba(0,0,0,.6); padding: 0 16px 4px; }
.composer { display: flex; gap: 8px; padding: 8px; background: var(--bg); padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
.composer textarea {
  flex: 1; resize: none; border: 0; outline: 0; padding: 8px; max-height: 120px;
  background: transparent;
}
.send { border: 0; background: var(--yellow); color: #191919; border-radius: 6px; padding: 0 14px; font-weight: 600; }

/* dialog */
dialog { border: 0; border-radius: 12px; padding: 20px; width: min(90vw, 340px); background: var(--bg); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog h3 { margin: 0 0 8px; }
dialog input { display: block; width: 100%; padding: 10px; margin: 8px 0; border: 1px solid var(--line); border-radius: 6px; background: transparent; }
.hint { color: var(--muted); font-size: 13px; margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dialog-actions button { border: 0; border-radius: 6px; padding: 8px 14px; background: var(--line); color: var(--text); }

.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%);
  background: rgba(0,0,0,.8); color: #fff; padding: 10px 16px; border-radius: 20px;
  font-size: 14px; max-width: 90vw; z-index: 10; cursor: pointer;
}

/* 워크톡 추가 */
.logo { display: block; margin: 0 auto; }
.icon-btn svg { display: block; }
.icon-btn { color: var(--text); }
.tabbar button span { display: block; height: 26px; filter: none; opacity: 1; color: var(--muted); }
.tabbar button.active span { color: var(--text); }
.room-head { text-align: center; min-width: 0; }
#room-sub { font-size: 12px; color: rgba(0,0,0,.55); }
@media (prefers-color-scheme: dark) { #room-sub { color: rgba(255,255,255,.6); } }
.li-dept { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 4px; }

/* ===== v4: 단체방, 첨부, 출퇴근, 업무보고 ===== */
.icon-btn svg { width: 24px; height: 24px; }
.tabbar button svg { width: 26px; height: 26px; color: var(--muted); margin-bottom: 2px; }
.tabbar button.active svg { color: var(--text); }
.room-bar .icon-btn svg { width: 24px; height: 24px; }
.muted { color: var(--muted); }
.avatar { overflow: hidden; }
.avatar.has-img { background: #ddd; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.small { width: 34px; height: 34px; border-radius: 13px; font-size: 14px; }
.avatar.group { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #d7dde3; padding: 2px; }
.avatar.group[data-n="1"] { grid-template-columns: 1fr; }
.avatar.group .mini { display: grid; place-items: center; font-size: 10px; color: #fff; border-radius: 6px; overflow: hidden; min-height: 0; }
.avatar.group[data-n="2"] .mini { grid-row: span 2; }
.avatar.group[data-n="3"] .mini:first-child { grid-column: span 2; }
.avatar.group .mini img { width: 100%; height: 100%; object-fit: cover; }
.avatar.group-icon svg { width: 24px; height: 24px; color: #fff; }
.li-count { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 4px; }

/* 메시지 종류 */
.system-msg { text-align: center; margin: 8px 0; }
.system-msg span, .system-msg { font-size: 12px; color: rgba(0,0,0,.6); }
@media (prefers-color-scheme: dark) { .system-msg, .system-msg span { color: rgba(255,255,255,.65); } }
.bubble.image { padding: 0; overflow: hidden; background: transparent; }
.row.mine .bubble.image { background: transparent; }
.bubble.image img { display: block; max-width: 220px; max-height: 300px; border-radius: 12px; cursor: zoom-in; }
.bubble.image .caption { padding: 6px 2px 0; white-space: pre-wrap; }
.col-inner { display: flex; flex-direction: column; gap: 4px; }
.row.mine .col-inner { align-items: flex-end; }
.bubble.file { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 180px; }
.bubble.file svg { width: 32px; height: 32px; flex: none; color: #6b7c8f; }
.file-info { min-width: 0; }
.file-name { font-weight: 600; word-break: break-all; }
.file-size { font-size: 12px; opacity: .65; }

/* 함께 보낼 방 */
.also-bar { display: flex; gap: 6px; align-items: center; padding: 6px 10px; background: var(--bg); overflow-x: auto; border-top: 1px solid var(--line); }
.also-label { font-size: 12px; color: var(--muted); flex: none; }
.chip { flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 14px; padding: 4px 10px; font-size: 13px; }
.chip::before { content: "＋ "; }
.chip.on::before { content: "✓ "; }
.chip.on { background: var(--yellow); border-color: var(--yellow); color: #191919; text-decoration: none; }
.upload-progress { background: var(--bg); color: var(--muted); font-size: 13px; padding: 6px 12px; }

/* 첨부 */
.attach { border: 0; background: transparent; color: var(--muted); padding: 0 4px; display: grid; place-items: center; }
.attach svg { width: 26px; height: 26px; }
.attach-menu { display: flex; justify-content: space-around; background: var(--bg); padding: 12px 8px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.attach-menu button { background: none; border: 0; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; }
.attach-menu svg { width: 28px; height: 28px; padding: 12px; box-sizing: content-box; border-radius: 18px; background: var(--line); }

/* 설정 화면 */
.page { background: var(--bg); }
.page .topbar h2 { font-size: 18px; flex: 1; text-align: center; }
.page-body { flex: 1; overflow-y: auto; padding-bottom: 24px; }
.form-box { padding: 14px 16px; border-bottom: 8px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.form-box > label { font-weight: 700; font-size: 15px; }
.form-box input, .form-box textarea, .report-editor textarea, .report-row input, .report-row select {
  width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--text);
}
.form-box textarea { resize: vertical; }
.small-btn { align-self: flex-start; border: 0; border-radius: 6px; padding: 8px 14px; background: var(--yellow); color: #191919; font-weight: 600; flex: none; }
.small-btn.plain { background: var(--line); color: var(--text); font-weight: 400; }
.danger-btn { border: 0; border-radius: 6px; padding: 10px 14px; background: transparent; color: var(--red); font-weight: 600; text-align: left; }
.profile-box { align-items: center; }
.set-avatar .avatar { width: 88px; height: 88px; border-radius: 32px; font-size: 34px; }
.avatar-actions { display: flex; gap: 8px; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-list.scroll { max-height: 45vh; overflow-y: auto; margin: 8px 0; }
.check-list label { display: flex; align-items: center; gap: 10px; padding: 8px 2px; cursor: pointer; }
.check-list input[type=checkbox] { width: 20px; height: 20px; accent-color: #3c1e1e; flex: none; margin: 0; }
.check-list .empty { padding: 16px; }
.list.compact li { padding: 6px 0; cursor: default; }

/* 출퇴근 */
.attend-card { margin: 16px; padding: 20px 16px; border-radius: 16px; background: var(--yellow); color: #191919; text-align: center; }
.attend-date { font-size: 15px; opacity: .75; }
.attend-clock { font-size: 40px; font-weight: 800; letter-spacing: 1px; margin: 4px 0 14px; font-variant-numeric: tabular-nums; }
.attend-status { display: flex; justify-content: center; gap: 28px; margin-bottom: 16px; }
.attend-status div { display: flex; flex-direction: column; gap: 2px; }
.attend-status span { font-size: 12px; opacity: .7; }
.attend-status b { font-size: 18px; }
.attend-buttons { display: flex; gap: 10px; }
.big-btn { flex: 1; border: 0; border-radius: 12px; padding: 16px 0; font-size: 18px; font-weight: 800; }
.big-btn.in { background: var(--brown); color: #fff; }
.big-btn.out { background: #fff; color: var(--brown); }
.big-btn:disabled { opacity: .35; }
.attend-table { width: calc(100% - 32px); margin: 0 16px 24px; border-collapse: collapse; font-size: 14px; }
.attend-table th { font-weight: 600; color: var(--muted); font-size: 12px; text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.attend-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }

/* 업무보고 */
.report-editor { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; border-bottom: 8px solid var(--line); }
.report-row { display: flex; gap: 8px; align-items: center; }
.report-row input, .report-row select { flex: 1; min-width: 0; }
.report-editor textarea { min-height: 220px; resize: vertical; line-height: 1.5; }
.btn-primary.small { width: auto; padding: 10px 18px; flex: none; }
.report-item { cursor: pointer; }

/* 사진 보기 */
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: calc(100% - 80px); object-fit: contain; }
.viewer-actions { display: flex; gap: 12px; margin-top: 16px; }
.viewer-actions button { border: 0; border-radius: 18px; padding: 8px 20px; background: rgba(255,255,255,.2); color: #fff; }
.via { font-size: 12px; font-weight: 700; color: rgba(0,0,0,.7); margin: 0 2px 3px; display: flex; align-items: center; gap: 4px; }
.row.mine .via { justify-content: flex-end; }
.via::before { content: "!"; flex: none; width: 15px; height: 15px; border-radius: 50%; background: #ff8a00; color: #fff; font-size: 11px; font-weight: 900; line-height: 15px; text-align: center; }
.row.mine .via { text-align: right; }
@media (prefers-color-scheme: dark) { .via { color: rgba(255,255,255,.8); } }

/* 단체방 아이콘 */
.avatar.group-icon svg { width: 26px; height: 26px; color: #fff; }
.avatar.text-icon { color: #fff; font-weight: 800; letter-spacing: -0.5px; line-height: 1; }
.avatar.text-icon.len1 { font-size: 20px; }
.avatar.text-icon.len2 { font-size: 16px; }
.avatar.text-icon.len3 { font-size: 12px; }
.mini-label { display: block; font-size: 13px; color: var(--muted); margin: 6px 0 4px; }
.icon-grid { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; padding-bottom: 6px; scrollbar-width: thin; }
.icon-grid .icon-opt { flex: 0 0 auto; min-width: 54px; scroll-snap-align: start; }
.icon-opt { background: none; border: 2px solid transparent; border-radius: 12px; padding: 4px 0; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.icon-opt .ic { width: 38px; height: 38px; border-radius: 13px; background: #8e9aa8; display: grid; place-items: center; }
.icon-opt svg { width: 22px; height: 22px; color: #fff; }
.icon-opt small { font-size: 11px; white-space: nowrap; }
.icon-opt.on { border-color: var(--brown); background: rgba(254,229,0,.35); }
@media (prefers-color-scheme: dark) { .icon-opt.on { border-color: var(--yellow); } }
.icon-text { width: 100%; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--text); }
dialog .icon-opt .ic { width: 34px; height: 34px; }
.owner-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 8px; background: var(--yellow); color: #191919; font-size: 11px; font-weight: 700; vertical-align: 2px; }
#rs-icon-hint:empty { display: none; }
.attend-mode { margin-top: 12px; font-size: 13px; font-weight: 600; opacity: .8; }
.attend-mode::before { content: "🔔 "; }
.attend-mode.quiet::before { content: "🔕 "; }
.cake { display: inline-block; vertical-align: -2px; margin-left: 4px; }
.cake svg { width: 18px; height: 18px; display: block; }
.sender .cake svg { width: 14px; height: 14px; }
.bday-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bday-label { font-size: 14px; color: var(--muted); }
.bday-row select { padding: 9px 8px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--text); font: inherit; }
.bday-row .hint { flex-basis: 100%; }
.update-notes { white-space: pre-wrap; font-size: 14px; margin: 8px 0; }
.emoji-menu { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; background: var(--bg); padding: 10px 8px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.emoji-opt { background: none; border: 0; font-size: 26px; line-height: 1; padding: 6px 0; border-radius: 10px; }
.emoji-opt:active { background: var(--line); }
.composer .attach + .attach { margin-left: -6px; }
.keep-alerts { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 14px; font-weight: 700; cursor: pointer; }
.keep-alerts input { width: 20px; height: 20px; accent-color: #3c1e1e; margin: 0; }
.keep-alerts small { font-weight: 400; opacity: .7; }

/* 배너 · 공지 */
#board-top { padding: 10px 12px 2px; display: flex; flex-direction: column; gap: 8px; }
#board-top:has(.hidden + .hidden) { display: none; }
.banner-box { display: block; border-radius: 12px; overflow: hidden; background: var(--line); }
.banner-box img { display: block; width: 100%; max-height: 150px; object-fit: cover; }
.banner-box.linked { cursor: pointer; }
.notice-line { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; border-radius: 10px; padding: 9px 12px; background: #FEE500; color: #191919; text-align: left; }
.notice-line b { flex: none; font-size: 12px; color: #fff; background: #3c1e1e; border-radius: 6px; padding: 2px 7px; }
.notice-line span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.notice-line i { font-style: normal; color: var(--muted); }
@media (prefers-color-scheme: dark) { .notice-line { background: #FEE500; } }
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list li { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.notice-body { white-space: pre-wrap; word-break: break-word; font-size: 15px; line-height: 1.5; }
.notice-meta { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.link-btn { background: none; border: 0; color: var(--red); font-size: 12px; padding: 0; }
#admin-banner-preview:empty { display: none; }
#admin-banner-preview .hint { padding: 12px; }
.top-banner { margin: 10px 12px 2px; }
.banner-admin { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.banner-admin .banner-box .hint { padding: 12px; }

/* 연차·월차 */
.leave-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: #e6e8eb; color: #5f6670; font-size: 11px; font-weight: 700; vertical-align: 2px; }
.avatar.leave-avatar { background: #eceef1; display: grid; place-items: center; }
.avatar.leave-avatar .leave-ico { width: 100%; height: 100%; margin: 0; vertical-align: 0; }
.avatar.leave-avatar .leave-ico img { border-radius: 0; }
@media (prefers-color-scheme: dark) { .avatar.leave-avatar { background: #3a3d42; } }
.leave-card { margin: 16px; padding: 14px 12px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-head b { font-size: 17px; }
.cal-head .icon-btn { font-size: 26px; line-height: 1; color: var(--text); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-wd:first-child { color: #e5484d; }
.cal-wd:nth-child(7) { color: #3b82f6; }
.cal-day { height: 62px; min-width: 0; border: 0; border-radius: 10px; background: transparent; color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 6px 0 0; gap: 2px; font-size: 15px; }
.cal-day.sun .cal-num { color: #e5484d; }
.cal-day.sat .cal-num { color: #3b82f6; }
.cal-day.today .cal-num { background: var(--text); color: var(--bg); border-radius: 50%; width: 24px; height: 24px; line-height: 24px; text-align: center; }
.cal-day:active { background: var(--line); }
.cal-day.has.k-year { background: #e3f6eb; }
.cal-day.has.k-month { background: #e8eefc; }
.cal-kind { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 6px; color: #fff; background: #12B85A; }
.cal-day.k-month .cal-kind { background: #4f7be0; }
.leave-item { align-items: center; }
.leave-item .leave-tag { margin-left: 0; }
.leave-item .small-btn { align-self: center; }
@media (prefers-color-scheme: dark) {
  .leave-tag { background: #3a3d42; color: #c4c8ce; }
  .cal-day.has.k-year { background: #1f3a2a; }
  .cal-day.has.k-month { background: #232f4a; }
}
.leave-card .hint { margin: 12px 4px 0; }
.leave-ico { display: inline-block; width: 26px; height: 26px; margin-right: 4px; vertical-align: -7px; }
.leave-ico img { width: 100%; height: 100%; display: block; border-radius: 22%; }
.cal-day .leave-ico { width: 28px; height: 28px; margin: 0; }
.leave-item .leave-ico { width: 34px; height: 34px; margin-right: 0; }
.cal-day.has.k-vac { background: #fff1dc; }
@media (prefers-color-scheme: dark) { .cal-day.has.k-vac { background: #3e3020; } }
.leave-card + .leave-card { margin-top: 0; }
.leave-title { font-weight: 700; font-size: 15px; margin: 2px 4px 10px; }
.leave-now { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.leave-now button { border: 2px solid transparent; border-radius: 14px; background: var(--line); color: var(--text); padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; }
.leave-now button img, .leave-now .work-dot { width: 44px; height: 44px; border-radius: 12px; display: block; }
.leave-now .work-dot { background: #12B85A url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6V5a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1h3a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2zm2 0h2V5h-2z' fill='%23fff'/%3E%3C/svg%3E") center / 28px no-repeat; }
.leave-now button.on { border-color: #12B85A; background: #e3f6eb; }
@media (prefers-color-scheme: dark) { .leave-now button.on { background: #1f3a2a; } }
#leave-dialog .leave-now { margin: 6px 0 4px; }
.cal-day.has.k-off { background: #fdeee2; }
@media (prefers-color-scheme: dark) { .cal-day.has.k-off { background: #3e2c20; } }
/* 동료 목록: 휴가 중이면 비활성처럼 회색 */
#friend-list li.on-leave .li-name, #me-card.on-leave .li-name { color: #c4c7cc; }
@media (prefers-color-scheme: dark) { #friend-list li.on-leave .li-name, #me-card.on-leave .li-name { color: #5c5f64; } }
#friend-list li.on-leave .li-sub, #me-card.on-leave .li-sub, #friend-list li.on-leave .leave-tag, #me-card.on-leave .leave-tag { opacity: .5; }

/* 답글 */
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 14px; background: var(--bg); border-top: 1px solid var(--line); }
.reply-info { flex: 1; min-width: 0; display: flex; flex-direction: column; border-left: 3px solid #12B85A; padding-left: 8px; }
.reply-info b { font-size: 12px; color: #12B85A; }
.reply-info span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-bar .icon-btn { font-size: 22px; color: var(--muted); }
.reply-quote { max-width: 260px; margin: 0 0 3px; padding: 5px 9px; border-radius: 10px; background: rgba(0,0,0,.06); border-left: 3px solid #12B85A; display: flex; flex-direction: column; cursor: pointer; }
.row.mine .reply-quote { align-self: flex-end; }
.reply-quote b { font-size: 11px; color: #0f8a45; }
.reply-quote span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-color-scheme: dark) { .reply-quote { background: rgba(255,255,255,.08); } .reply-quote b { color: #4fd18a; } }
.row.flash .bubble { animation: flash 1.4s ease; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px #12B85A; } 100% { box-shadow: 0 0 0 0 transparent; } }
.bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.msg-menu { padding: 8px; width: min(80vw, 280px); }
.msg-menu-text { margin: 6px 8px 8px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-menu button { display: block; width: 100%; border: 0; background: none; color: var(--text); text-align: left; padding: 13px 12px; font-size: 16px; border-radius: 8px; }
.msg-menu button:active { background: var(--line); }
#msg-menu-close { color: var(--muted); }

/* 방 달력 */
.rc-grid .cal-day { height: 64px; }
.rc-grid .cal-day.sel { box-shadow: inset 0 0 0 2px #12B85A; }
.rc-count { max-width: 92%; font-size: 10px; line-height: 1.3; padding: 1px 4px; border-radius: 5px; background: #12B85A; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-item { align-items: center; }
.rc-time { flex: none; min-width: 44px; text-align: center; font-size: 13px; font-weight: 700; color: #12B85A; }
.rc-item .small-btn { align-self: center; }
.rc-form { border-top: 8px solid var(--line); }
.pending-list li { padding: 8px 0; }
.room-bar .room-head { flex: 1; }
.room-bar #room-cal-btn { margin-right: -6px; }

/* 앱 시작 인트로 */
.intro { position: fixed; inset: 0; z-index: 9999; background: #000; display: flex; align-items: center; justify-content: center; transition: opacity .25s; }
.intro img { width: 100%; height: 100%; object-fit: cover; display: block; }
.intro.fade { opacity: 0; }
.intro-skip { position: absolute; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); padding: 6px 12px; border-radius: 16px; background: rgba(0,0,0,.45); color: #fff; font-size: 13px; }
.banner-box.intro-preview img { width: 120px; height: 213px; object-fit: cover; border-radius: 10px; }
.banner-box.intro-preview { height: auto; background: none; aspect-ratio: auto; }

.notice-line i { color: #5a4a00; }

/* 그룹명 (탭 제목 앞) */
.group-name { display: inline-block; margin-right: 6px; color: #F7C600; font-weight: 800; }
/* 방 설정 스위치 */
.form-box > label.switch-row, #user-admin label.switch-row { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 15px; }
.switch-row input { width: 22px; height: 22px; accent-color: #3c1e1e; }
.owner-only-note { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: 14px; background: var(--bg); border-top: 1px solid var(--line); }
.mute-ico { display: inline-block; vertical-align: -2px; margin-left: 4px; color: var(--muted); }
.mute-ico svg { width: 14px; height: 14px; display: block; }
.req-actions .accept.guest { background: #e8eefc; color: #2c4a9a; }

.aud-seg { display: flex; gap: 6px; margin: 4px 0 8px; }
.aud-seg button { flex: 1; padding: 8px 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 14px; color: #555; }
.aud-seg button.on { background: #FEE500; border-color: #FEE500; color: #3c1e1e; font-weight: 700; }
.aud-tag { padding: 1px 7px; border-radius: 9px; font-size: 11px; background: #eef0f3; color: #555; }
.aud-tag.aud-1 { background: #FEE500; color: #3c1e1e; }
.aud-tag.aud-2 { background: #dbe8ff; color: #23467a; }

.tabbar .req-badge { position: absolute; top: 3px; left: calc(50% + 8px); background: #FEE500; color: #3c1e1e; border-radius: 6px; padding: 0 4px; font-size: 9px; font-weight: 800; font-style: normal; line-height: 14px; }
.pending-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--line); background: #fffbe0; font-size: 14px; text-align: left; color: var(--text); }
.pending-row b { background: #FEE500; color: #3c1e1e; border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.pending-row span { flex: 1; }
.pending-row i { font-style: normal; color: var(--muted); }

.manage-btn { flex: 0 0 auto; border: 0; background: #FEE500; color: #3c1e1e; border-radius: 5px; padding: 1px 5px; font-size: 10px; font-weight: 700; line-height: 16px; }
.guest-tag { display: inline-block; margin-left: 8px; color: #F7C600; font-size: 10px; font-weight: 700; vertical-align: 1px; }
.ua-staff { display: contents; }
.aud-seg .kick-btn { color: var(--red); border-color: var(--red); font-weight: 700; }

.app-promo { margin-top: 22px; padding: 16px; border-radius: 14px; background: rgba(255,255,255,.75); text-align: left; color: #3c1e1e; }
.app-promo b { display: block; font-size: 15px; margin-bottom: 6px; }
.app-promo ul { list-style: none; margin: 0 0 12px; padding: 0; font-size: 13px; line-height: 1.8; }
.app-download { display: block; text-align: center; padding: 12px; border-radius: 8px; background: #3c1e1e; color: #FEE500; font-weight: 700; text-decoration: none; }
.app-ver { display: block; margin-top: 6px; font-size: 11px; color: #6b5a3a; text-align: center; }
#set-app-download { display: block; text-align: center; text-decoration: none; }
#set-app-download.hidden { display: none; }

.sms-search { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sms-search input { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text); font-size: 14px; }
.sms-list { list-style: none; margin: 0; padding: 0; }
.sms-item { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sms-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.sms-sender { flex: 1; font-size: 15px; }
.sms-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sms-body { font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sms-item.open .sms-body { display: block; }
.tabbar button { min-width: 0; }
#ua-sms-row { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
#ua-sms-row.hidden, #ua-sms-hint.hidden { display: none; }

.sms-hide-btn { flex: 0 0 auto; border: 0; border-radius: 5px; padding: 1px 6px; font-size: 11px; font-weight: 700; background: #eef0f3; color: #555; }
.sms-hidden-tag { flex: 0 0 auto; padding: 0 5px; border-radius: 5px; font-size: 10px; font-weight: 700; background: #F7C600; color: #3c1e1e; }
.sms-item.sms-hidden .sms-body, .sms-item.sms-hidden .sms-sender { opacity: .45; }

/* 음성 통화 */
.call-screen { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; justify-content: space-between; align-items: center; padding: 70px 24px 60px; background: linear-gradient(180deg, #3c3a36 0%, #1e1d1b 100%); color: #fff; }
.call-screen.hidden { display: none; }
.call-top { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.call-avatar .avatar { width: 108px; height: 108px; border-radius: 40px; font-size: 40px; }
.call-name { font-size: 26px; font-weight: 700; margin-top: 8px; }
.call-status { font-size: 15px; color: #d8d4cc; }
.call-actions { display: flex; justify-content: center; gap: 44px; width: 100%; }
.call-actions.hidden { display: none; }
.call-btn { display: flex; flex-direction: column; align-items: center; gap: 8px; background: none; border: 0; color: #fff; font-size: 13px; }
.call-btn svg { width: 66px; height: 66px; padding: 18px; border-radius: 50%; box-sizing: border-box; color: #fff; }
.call-btn.red svg { background: #ff4d4f; transform: rotate(135deg); }
.call-btn.green svg { background: #2ecc71; }
.call-btn.ghost svg { background: rgba(255,255,255,.18); }
.call-btn.ghost.on svg { background: #FEE500; color: #3c1e1e; }

/* 통합 아이디 */
.shared-tag { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: 4px; background: #E8F1FF; color: #2F6FD6; font-size: 10px; font-weight: 700; line-height: 16px; vertical-align: 1px; }
.duty-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-weight: 700; font-size: 15px; }
.duty-row small { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.shared-list li { padding: 8px 0; }
.shared-list .li-sub { white-space: normal; }
/* 하단 통합업무 켜기/끄기 */
.tabbar button.duty-tab em { font-style: normal; max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar .duty-state { position: absolute; top: 3px; left: calc(50% + 6px); padding: 0 4px; border-radius: 6px; background: #C9C9C9; color: #fff; font-size: 9px; font-weight: 800; line-height: 14px; }
.tabbar button.duty-tab.on, .tabbar button.duty-tab.on svg { color: #1E9E5A; }
.tabbar button.duty-tab.on .duty-state { background: #1E9E5A; }
#duty-dialog-list { min-width: 240px; }
.kick-btn { margin-left: auto; padding: 2px 8px; border: 0; border-radius: 6px; background: #FEE500; color: #3c1e1e; font-size: 11px; font-weight: 700; line-height: 18px; }

/* 입차등록 */
.park-cam { position: relative; margin: 12px 16px 0; height: 230px; border-radius: 14px; overflow: hidden; background: #111; }
.park-cam video, .park-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.park-guide { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.park-box { width: 84%; aspect-ratio: 4.2 / 1; border: 3px solid #FEE500; border-radius: 8px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.park-guide p { margin: 10px 0 0; color: #fff; font-size: 13px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.6); position: relative; }
.park-shot:not(.hidden) ~ .park-guide .park-box { box-shadow: none; }
.park-cam-msg { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 8px 10px; border-radius: 8px; background: rgba(0,0,0,.65); color: #fff; font-size: 13px; }
.park-actions { display: flex; gap: 8px; align-items: center; margin: 10px 16px 0; }
.park-actions .park-capture { flex: 1; }
.park-pick { cursor: pointer; }
.park-ocr { margin: 8px 16px 0; min-height: 18px; }
.park-form { margin-top: 6px; }
.park-form .park-plate { font-size: 22px; font-weight: 800; letter-spacing: 1px; text-align: center; }
.park-today { padding: 0 16px 16px; }
.park-list li { padding: 10px 0; }
.park-no { font-size: 17px; font-weight: 800; }
.park-tag { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 5px; font-size: 10px; font-weight: 700; line-height: 16px; vertical-align: 2px; }
.park-tag.ok { background: #E3F5EA; color: #1E9E5A; }
.park-tag.fail { background: #FDE8E8; color: #E5484D; }
/* 하단 메뉴가 많을 때 글자 줄이기 */
.tabbar button { min-width: 0; font-size: 11px; letter-spacing: -0.3px; white-space: nowrap; }
.park-cam.shot .park-guide { display: none; }
