/* 세이프비즈 워크 — 공통 스타일 (디자인 시안 토큰 그대로)
   잉크 #14171D · 세이프티 옐로 #FFC21A · 배경 #F3F4F6
   페이지 전용 스타일은 web/css/pages/<페이지>.css */

:root {
  --ink: #14171D;
  --yellow: #FFC21A;
  --yellow-hover: #F5B500;
  --yellow-soft: #FFF6DB;
  --yellow-softer: #FFFBEB;
  --yellow-line: #F2D27A;
  --bg: #F3F4F6;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --line: #E3E6EA;
  --line-strong: #D5D9DF;
  --line-soft: #EEF0F3;
  --text: #14171D;
  --text-2: #4B5260;
  --muted: #646B77;
  --faint: #9AA1AC;
  --blue: #1D5FD1;
  --blue-hover: #174EA6;
  --blue-soft: #E8F0FE;
  --red: #B42318;
  --red-strong: #D13438;
  --red-soft: #FDECEA;
  --orange: #9A4A00;
  --orange-soft: #FEF0DC;
  --green: #1A6E3F;
  --green-soft: #E6F4EC;
  --green-dot: #3FB772;
  --purple: #6236C4;
  --purple-soft: #F1EBFD;
  --side-bg: #14171D;
  --side-text: #C9CED6;
  --side-muted: #8E95A1;
  --side-line: #2C323C;
  --side-panel: #1B1F26;
  --side-active: #262B35;
  --font: 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Pretendard', 'Malgun Gothic', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 8px;
  --side-w: 240px;
  --tabbar-h: 64px;
  --shadow-pop: 0 10px 30px rgba(20, 23, 29, .14), 0 2px 6px rgba(20, 23, 29, .08);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }
input[type=checkbox], input[type=radio] { accent-color: var(--ink); width: 17px; height: 17px; margin: 0; flex: none; }
::selection { background: #FFE59A; }

/* ── 글자 ── */
.mono { font-family: var(--mono); font-size: 11.5px; letter-spacing: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.xsmall { font-size: 12px; }
.strong { font-weight: 600; }
.bold { font-weight: 700; }
.danger-text { color: var(--red); }
.ok-text { color: var(--green); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mention { color: var(--blue); font-weight: 600; }
.mono-link { font-family: var(--mono); font-size: .92em; }
/* 화면 읽기용 글. top/left 0 — 긴 스크롤 칸 끝에 놓여 칸·문서 높이를 늘리지 않게 */
.sr-only { position: absolute; top: 0; left: 0; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
kbd, .kbd { font-family: var(--mono); font-size: 11px; color: var(--side-muted); border: 1px solid var(--side-line); border-radius: 4px; padding: 0 5px; }

/* ── 앱 틀 ── */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
.app-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.page { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* 메신저처럼 화면에 꽉 차는 페이지: root(#page) 에 page-fill.
   위쪽 안내 띠(2단계 인증 등)가 있어도 넘치지 않게, 앱 본문을 화면 높이로 고정하고 페이지가 남은 높이를 채운다. */
.app-main:has(> .page-fill) { height: 100vh; height: 100dvh; min-height: 0; position: relative; overflow: hidden; }
.page-fill { flex: 1 1 0; min-height: 0; height: auto; overflow: hidden; position: relative; }
.page-fill > .panes, .page-fill .panes { height: auto; flex: 1 1 0; min-height: 0; }
.app.fullscreen { display: block; }

/* 페이지 머리 (홈·일감·관리자) */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 20px; line-height: 1.3; font-weight: 700; }
.page-head .sub { margin-top: 2px; font-size: 13px; color: var(--muted); }
.page-body { width: 100%; max-width: 1280px; padding: 24px 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }

/* 여러 칸 화면(목록 | 본문 | 정보) */
.panes { flex: 1; min-height: 0; display: flex; height: 100vh; }
.pane { min-width: 0; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); }
.pane:last-child { border-right: 0; }
.pane-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.pane-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; }
.pane-head h1 { font-size: 20px; font-weight: 700; flex: 1; }
.pane-gray { background: var(--surface-2); }

/* ── 카드 ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-head h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h2 .count { color: var(--muted); font-weight: 500; }
.card-head a { font-size: 13px; font-weight: 500; }
.card-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.list > li { border-top: 1px solid var(--line-soft); }
.section-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.section-label { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 4px 4px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

/* ── 버튼 ── */
.btn {
  height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
  color: var(--text); font-weight: 600; font-size: 13px; white-space: nowrap; text-decoration: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.btn-primary:hover { background: var(--yellow-hover); border-color: var(--yellow-hover); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #262B35; color: #fff; }
.btn-danger { border-color: var(--red); color: var(--red); background: #fff; }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--line-soft); }
.btn-lg { height: 40px; padding: 0 16px; font-size: 14px; }
.btn-xl { height: 48px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; font-weight: 500; }
.btn-block { width: 100%; }
.btn-soft { background: var(--line-soft); border-color: var(--line-soft); }
.btn-soft:hover { background: var(--line); }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.lg { width: 40px; height: 40px; }
.icon-btn.plain { border-color: transparent; background: transparent; }
.icon-btn.plain:hover { background: var(--line-soft); }
.icon-btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.icon-btn.yellow { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.count-badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red-strong); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue); font-weight: 500; font-size: 13px; }
.link-btn:hover { color: var(--blue-hover); }

/* ── 입력 ── */
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 14px; outline: none; transition: border-color .12s, box-shadow .12s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 194, 26, .35); }
.input.soft { background: var(--surface-2); border-color: var(--line); }
.input.sm, .select.sm { height: 34px; font-size: 13px; }
textarea.input, .textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2314171D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; }
.field-hint { font-size: 12px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form { display: flex; flex-direction: column; gap: 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search-box .input { padding-left: 34px; }

/* ── 칩 · 배지 ── */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--line-soft); color: var(--text-2); flex: none; }
.chip-sm { height: 20px; padding: 0 6px; font-size: 11.5px; }
.chip-lg { height: 26px; padding: 0 10px; }
.chip-gray { background: var(--line-soft); color: var(--text-2); }
.chip-blue { background: var(--blue-soft); color: var(--blue); }
.chip-purple { background: var(--purple-soft); color: var(--purple); }
.chip-red { background: var(--red-soft); color: var(--red); }
.chip-orange { background: var(--orange-soft); color: var(--orange); }
.chip-green { background: var(--green-soft); color: var(--green); }
.chip-yellow { background: var(--yellow); color: var(--ink); }
.chip-yellow-soft { background: #FFF1C7; color: #6E3500; }
.chip-dark { background: var(--ink); color: var(--yellow); }
.chip-outline { background: #fff; border: 1px solid var(--line-strong); color: var(--text); font-weight: 500; }
.chip-x { border: 0; background: none; padding: 0; margin-left: 2px; display: inline-grid; place-items: center; color: inherit; opacity: .7; }
.chip-x:hover { opacity: 1; }
.status-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; }
.status-dot i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.nbadge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--yellow); color: var(--ink); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.nbadge.red { background: var(--red-strong); color: #fff; }
.nbadge.gray { background: var(--line-soft); color: var(--text-2); }

/* ── 아바타 ── */
.avatar { position: relative; flex: none; border-radius: 50%; color: #fff; display: inline-grid; place-items: center; font-weight: 600; line-height: 1; user-select: none; }
.avatar-dot { position: absolute; right: -1px; bottom: -1px; width: 30%; height: 30%; min-width: 9px; min-height: 9px; border-radius: 50%; border: 2px solid #fff; }
.avatar-stack { display: inline-flex; align-items: center; }
.avatar-stack > .avatar + .avatar { margin-left: -6px; }
.avatar-more { background: var(--line) !important; color: var(--ink); font-size: 11px; }

/* ── 탭 · 세그먼트 ── */
.tabs { display: flex; align-items: flex-end; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-2); font-size: 13.5px; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.on, .tab[aria-selected=true] { border-bottom-color: var(--ink); color: var(--ink); font-weight: 600; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 15px; background: #fff; font-size: 13px; color: var(--text); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.pill:hover { background: var(--surface-2); }
.pill.on, .pill[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.seg { display: inline-flex; padding: 3px; background: var(--line-soft); border-radius: 9px; gap: 2px; }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; font-size: 13px; color: var(--text-2); }
.seg button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(20,23,29,.08); }

/* ── 목록 행 ── */
.item { display: flex; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; cursor: pointer; }
.item:hover { background: var(--surface-2); color: var(--text); }
.item.on { background: var(--yellow-soft); }
.item.on:hover { background: #FFF1C7; }
.unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); flex: none; }

/* ── 파일 ── */
.file-badge { flex: none; border-radius: 8px; display: inline-grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 700; }
.file-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 0; }
.file-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-card-name { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card-name:hover { color: var(--blue); }
.thumb { border-radius: 10px; background: #D9DDE3; display: grid; place-items: center; color: #646B77; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── 상태 표시 ── */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 32px 16px; color: var(--muted); text-align: center; font-size: 13px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px; color: var(--muted); font-size: 13px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid #F3C1BC; background: var(--red-soft); color: var(--red); border-radius: 8px; font-size: 13px; }
.notice-bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 8px; background: var(--orange-soft); color: var(--orange); font-size: 13px; }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.progress.yellow > i { background: var(--yellow); }
.skeleton { background: linear-gradient(90deg, #EEF0F3 25%, #F7F8FA 37%, #EEF0F3 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── 사이드바 ── */
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side-bg); color: var(--side-text); padding: 14px 12px 12px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; scrollbar-color: #2C323C transparent; }
.sidebar > * { flex-shrink: 0; }  /* 낮은 화면에서 검색창 등이 눌리지 않게 — 넘치면 사이드바가 스크롤 */
.ws-switch { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: transparent; color: #fff; text-align: left; }
.ws-switch:hover { background: var(--side-panel); }
.ws-name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.ws-sub { font-size: 12px; color: var(--side-muted); line-height: 1.35; }
.side-search { display: flex; align-items: center; gap: 8px; width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--side-line); border-radius: 8px; background: var(--side-panel); color: var(--side-muted); text-align: left; font-size: 13px; }
.side-search:hover { border-color: #3A414C; }
.side-nav { display: flex; flex-direction: column; gap: 14px; }
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-group-label { padding: 0 10px 4px; font-size: 12px; font-weight: 600; color: var(--side-muted); }
.side-link { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 7px; color: var(--side-text); font-weight: 500; text-decoration: none; }
.side-link svg { color: var(--side-muted); flex: none; }
.side-link:hover { background: var(--side-panel); color: #fff; }
.side-link[aria-current=page] { background: var(--side-active); color: #fff; font-weight: 600; }
.side-link[aria-current=page] svg { color: var(--yellow); }
.side-link .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--yellow); color: var(--ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side-badge.neutral { background: var(--side-line); color: #E6E8EC; }
.side-badge.red { background: var(--red-strong); color: #fff; }
.side-live { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: #8BD3A6; }
.side-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-dot); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--side-line); }
.work-box { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--side-panel); }
.work-state { font-size: 12px; font-weight: 600; color: #8BD3A6; }
.work-state.off { color: var(--side-muted); }
.work-time { font-size: 12px; color: var(--side-text); }
.work-box > .col { min-width: 0; }
.work-time { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-btn { height: 30px; padding: 0 10px; border: 1px solid #3A414C; border-radius: 7px; background: transparent; color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; flex: none; }
.work-btn:hover { background: var(--side-active); }
.work-btn.go { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.me-box { display: flex; align-items: center; gap: 10px; padding: 2px 4px; }
.me-box .avatar-dot { border-color: var(--side-bg); }
.me-name { color: #fff; font-weight: 600; font-size: 13.5px; }
.me-sub { font-size: 12px; color: var(--side-muted); }
.side-icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--side-muted); }
.side-icon-btn:hover { background: var(--side-panel); color: #fff; }

/* ── 모바일 하단 탭 ── */
.tabbar { display: none; }
.mobile-only { display: none !important; }

/* ── 모달 · 메뉴 · 토스트 ── */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(20, 23, 29, .45); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px; animation: fadein .12s ease; }
.modal-backdrop.out { opacity: 0; transition: opacity .15s; }
.modal { width: 100%; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: #fff; border-radius: 12px; box-shadow: var(--shadow-pop); outline: none; animation: popin .15s ease; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.modal-head h2 { flex: 1; font-size: 17px; font-weight: 700; }
.modal-head .icon-btn { border-color: transparent; }
.modal-body { padding: 12px 20px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid var(--line-soft); }
.confirm-msg { white-space: pre-line; color: var(--text-2); }
@keyframes fadein { from { opacity: 0; } }
@keyframes popin { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.menu { position: fixed; z-index: 120; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 6px; display: flex; flex-direction: column; animation: popin .12s ease; max-height: 70vh; overflow-y: auto; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 7px; background: none; text-align: left; font-size: 13.5px; color: var(--text); }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item.danger { color: var(--red); }
.menu-item:disabled { opacity: .45; cursor: default; }
.menu-item svg { color: var(--text-2); flex: none; }
.menu-hint { margin-left: auto; color: var(--faint); font-size: 12px; }
.menu-sep { height: 1px; background: var(--line-soft); margin: 4px 2px; }
.menu-header { padding: 6px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.toast-root { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; min-height: 42px; max-width: min(520px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13.5px; box-shadow: var(--shadow-pop); animation: popin .15s ease; transition: opacity .25s, transform .25s; }
.toast svg { color: #8BD3A6; flex: none; }
.toast-error svg { color: #FFB4B0; }
.toast-info svg { color: var(--yellow); }
.toast.out { opacity: 0; transform: translateY(6px); }
.toast-action { border: 0; background: none; color: var(--yellow); font-weight: 700; padding: 0 0 0 6px; }

/* 사람 고르기 */
.picker-list { display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; margin: 0 -8px; }
.picker-row { display: flex; align-items: center; gap: 10px; padding: 8px; border: 0; border-radius: 8px; background: none; text-align: left; width: 100%; }
.picker-row:hover { background: var(--surface-2); }
.picker-row.on { background: var(--blue-soft); }
.picker-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.picker-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.picker-chips:empty { display: none; }

/* 통합 검색 · 알림 패널 */
.palette { position: fixed; inset: 0; z-index: 110; background: rgba(20, 23, 29, .4); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.palette-box { width: 100%; max-width: 640px; background: #fff; border-radius: 12px; box-shadow: var(--shadow-pop); overflow: hidden; display: flex; flex-direction: column; max-height: 72vh; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.palette-input input { flex: 1; border: 0; outline: none; font-size: 16px; background: none; }
.palette-results { overflow-y: auto; padding: 8px; }
.palette-group { padding: 8px 8px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.palette-item:hover, .palette-item.on { background: var(--yellow-soft); color: var(--text); }
.palette-item .t { font-weight: 500; }
.panel-pop { position: fixed; z-index: 105; width: 380px; max-width: calc(100vw - 16px); max-height: 70vh; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); overflow: hidden; }
.panel-pop-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line-soft); }
.panel-pop-head h3 { flex: 1; font-size: 15px; }
.panel-pop-body { overflow-y: auto; }
.notif { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); color: var(--text); }
.notif:hover { background: var(--surface-2); color: var(--text); }
.notif.unread { background: var(--yellow-softer); }
.notif-title { font-weight: 600; font-size: 13.5px; }
.notif-body { font-size: 12.5px; color: var(--muted); }

/* 2단계 인증 안내 띠 */
.top-banner { display: flex; align-items: center; gap: 10px; padding: 10px 28px; background: var(--yellow-soft); border-bottom: 1px solid var(--yellow-line); font-size: 13px; color: #6E3500; }
.top-banner b { color: var(--ink); }
.offline-banner { position: fixed; z-index: 150; top: 0; left: 50%; transform: translateX(-50%); margin-top: 8px; padding: 6px 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12.5px; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-pop); }

/* ── 반응형 ── */
@media (max-width: 1100px) {
  :root { --side-w: 208px; }
}
@media (max-width: 768px) {
  .app { display: block; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .app.fullscreen { padding-bottom: 0; }
  .app > .sidebar { display: none; }
  .mobile-only { display: revert !important; }
  .desktop-only { display: none !important; }
  .page-head { padding: 14px 16px; }
  .page-body { padding: 16px; gap: 14px; }
  .app-main:has(> .page-fill) { height: calc(100dvh - var(--tabbar-h) - env(safe-area-inset-bottom)); }
  .app.fullscreen .app-main:has(> .page-fill) { height: 100dvh; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; position: fixed; z-index: 90; left: 0; right: 0; bottom: 0;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding: 4px 6px env(safe-area-inset-bottom);
    background: #fff; border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 56px; border: 0; background: none; color: var(--muted); font-size: 11.5px; position: relative; text-decoration: none; }
  .tabbar a[aria-current=page] { color: var(--ink); font-weight: 700; }
  .tabbar a[aria-current=page] svg { color: var(--yellow-hover); }
  .tabbar .tab-plus { justify-self: center; width: 52px; height: 52px; border-radius: 16px; background: var(--yellow); color: var(--ink); }
  .tabbar .tab-badge { position: absolute; top: 2px; left: calc(50% + 4px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red-strong); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
  .top-banner { padding: 10px 16px; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
  .toast-root { bottom: calc(var(--tabbar-h) + 16px); }
  .panel-pop { left: 8px !important; right: 8px; top: 64px !important; width: auto; }
}

/* 모바일 '전체' 서랍 */
.drawer-backdrop { position: fixed; inset: 0; z-index: 95; background: rgba(20, 23, 29, .45); }
.drawer { position: fixed; z-index: 96; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); background: var(--side-bg); overflow-y: auto; animation: slidein .18s ease; }
.drawer .sidebar { position: static; height: auto; min-height: 100%; }
@keyframes slidein { from { transform: translateX(-100%); } }

/* 모바일 화면 캡처 막기 정책(보안 정책 '모바일 화면 캡처 차단'): 글 복사·길게 눌러 저장을 막고,
   앱을 벗어나는 순간(작업 전환 화면 미리보기) 내용을 가린다. 운영체제 스크린샷 자체는 웹에서 막을 수 없다. */
body.no-capture .page { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.no-capture .page input, body.no-capture .page textarea { -webkit-user-select: text; user-select: text; }
body.no-capture.app-hidden .page { filter: blur(16px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
  .sidebar, .tabbar, .page-head .btn, .toast-root, [data-banner] { display: none !important; }
  .app { display: block; }
  .app-main, .app-main:has(> .page-fill), .page-fill { height: auto !important; overflow: visible !important; }
  body { background: #fff; }
}
