:root {
  --ink: #2c4b63;
  --ink-soft: #6a8aa3;
  --blue: #36a3dc;
  --blue-deep: #1f86c1;
  --sky: #a3d8f2;
  --sky-pale: #e4f4fc;
  --sky-mist: #f2fafe;
  --paper: #fffefa;
  --rule: #e2f0f8;
  --line: #83bfe0;
  --red: #d7637a;
  --pink: #c2408f;
  --plan: #2f97d3;
  --done: #c99317;
  --drop: #d7637a;
  --r: 18px;
  /* 손으로 그린 듯 살짝 찌그러진 모서리 */
  --pill: 24px 16px 22px 18px / 18px 22px 16px 24px;
  --box: 22px 30px 18px 34px / 30px 18px 34px 22px;
  /* 물감 붓질 질감 (흰 붓자국 / 진한 붓자국 / 종이 결) */
  --tex-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='840'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' stitchTiles='stitch' baseFrequency='.014 .028' numOctaves='4' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 .9 0 0 0 -.38'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --tex-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='840'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' stitchTiles='stitch' baseFrequency='.01 .03' numOctaves='3' seed='9'/%3E%3CfeColorMatrix values='0 0 0 0 .05 0 0 0 0 .35 0 0 0 0 .6 0 1 0 0 -.5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --tex-paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' stitchTiles='stitch' baseFrequency='.8' numOctaves='2' seed='2'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .5 0 0 0 0 .6 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --flower-sky: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-50 -50 100 100'%3E%3Cg fill='%2336a3dc'%3E%3Ccircle r='22' cy='-24'/%3E%3Ccircle r='22' cx='22.8' cy='-7.4'/%3E%3Ccircle r='22' cx='14.1' cy='19.4'/%3E%3Ccircle r='22' cx='-14.1' cy='19.4'/%3E%3Ccircle r='22' cx='-22.8' cy='-7.4'/%3E%3Ccircle r='24'/%3E%3C/g%3E%3C/svg%3E");
  --dot-sky: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Ccircle cx='5' cy='5' r='5' fill='%2336a3dc'/%3E%3C/svg%3E");
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='8' viewBox='0 0 120 8'%3E%3Cpath d='M0 4 Q15 1 30 4 T60 4 T90 4 T120 4' fill='none' stroke='%2383bfe0' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  /* 손글씨 글꼴(Gaegu)을 못 불러오는 환경(회사망 차단·오프라인 등)에서도 한글이 깨지지 않게
     기기별 기본 한글 글꼴로 이어지게 함: 아이폰/맥 → 윈도우 → 안드로이드 */
  font-family: var(--font, 'Gaegu'), 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕', 'Noto Sans KR', 'Noto Sans CJK KR', sans-serif;   /* --font: 환경설정에서 고른 글씨체 */
  -webkit-text-size-adjust: 100%;   /* 아이폰을 가로로 돌렸을 때 글자가 제멋대로 커지는 것 방지 */
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  /* 붓질 무늬는 반복(타일)하면 이음선이 보여서 화면 전체에 한 장으로 깔기 */
  background: var(--tex-light) center / cover no-repeat fixed, var(--tex-paper), #d6eefa;
  font-size: 17px;
  word-break: keep-all;          /* 한국어는 단어 단위로 줄바꿈 */
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
/* 휴대폰에서 입력칸 글자가 16px보다 작으면 아이폰이 화면을 확대해 버려서 레이아웃이 틀어짐 */
@media (max-width: 899px) { input, select, textarea { font-size: max(16px, 1em); } }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- 책 레이아웃 ---------- */
.shell {
  display: flex;
  max-width: 520px;
  height: 100dvh;
  margin: 0 auto;
  padding: 12px 0 12px 10px;
}
.book {
  position: relative;
  flex: 1;
  min-width: 0;
  perspective: 1800px;
}
.page {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  border-radius: 8px var(--r) var(--r) 8px;
  transform-origin: left center;
  backface-visibility: hidden;
  scrollbar-width: none;
}
.page::-webkit-scrollbar { display: none; }
.page.on { display: block; }
.cover.on { display: flex; align-items: center; }
.page.flip-out { z-index: 5; animation: flipOut .65s cubic-bezier(.45,.05,.55,.95) forwards; }
.page.flip-in  { z-index: 5; animation: flipIn .65s cubic-bezier(.45,.05,.55,.95) both; }
@keyframes flipOut {
  0%   { transform: rotateY(0); box-shadow: 0 0 0 rgba(47,64,88,0); }
  60%  { box-shadow: -18px 0 30px rgba(47,64,88,.18); }
  100% { transform: rotateY(-105deg); opacity: .3; }
}
@keyframes flipIn {
  0%   { transform: rotateY(-105deg); opacity: .3; }
  40%  { box-shadow: -18px 0 30px rgba(47,64,88,.18); }
  100% { transform: rotateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .page.flip-out, .page.flip-in { animation-duration: .01s; }
}

/* 속지: 줄 노트 + 스프링 */
.paper {
  /* 스프링 구멍·줄은 내용과 함께 스크롤(local)되어 내용 길이만큼만 이어진다 */
  background:
    radial-gradient(circle at 10px 10px, var(--paper) 4px, var(--line) 4.5px 6px, transparent 6.5px) 10px 14px / 20px 24px repeat-y,
    var(--flower-sky) right 22px top 14px / 30px no-repeat,
    var(--flower-sky) right 58px top 44px / 14px no-repeat,
    var(--dot-sky) right 16px top 58px / 6px no-repeat,
    var(--dot-sky) right 70px top 18px / 5px no-repeat,
    var(--tex-paper),
    repeating-linear-gradient(transparent 0 29px, var(--rule) 29px 30px),
    var(--paper);
  background-attachment: local;
  border: 2px solid var(--line);
  padding: 18px 18px 40px 46px;
}

/* 오른쪽 라벨 */
.rail {
  width: 34px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 24px;
}
.rail button {
  height: 96px;
  border: 2px solid var(--line);
  border-left: 0;
  border-radius: 0 20px 14px 0 / 0 14px 22px 0;
  background: var(--sky-pale);
  writing-mode: vertical-rl;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--blue-deep);
  padding: 0;
  transition: background .2s;
}
.rail button:hover { background: var(--sky); }
.rail button.cur { visibility: hidden; }   /* 자리 유지, 라벨만 숨김 */
.rail.off { visibility: hidden; }

/* ---------- 공통 요소 ---------- */
.ttl { font-size: 26px; font-weight: 700; text-align: center; margin: 4px 0 12px; color: var(--blue-deep); }
.ttl.line { background: var(--wave) center bottom / 120px 8px repeat-x; padding-bottom: 8px; }
.center { text-align: center; margin-top: 10px; }
.row-between { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0; }   /* 너무 좁으면 다음 줄로 */
.row-between.tight { margin: 0; }
.fld { display: block; font-weight: 700; margin-bottom: 8px; text-align: left; }
.fld input, .search input, .search select, .goal input, .frow input {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: 4px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: var(--pill);
  background: #fff;
  font-weight: 400;
  outline: none;
}
.fld input:focus, .search input:focus, .goal input:focus, .frow input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--sky-pale); }
.hint { font-size: 14px; font-weight: 400; color: var(--ink-soft); }
.note { color: var(--red); text-align: center; border: 2px dashed #f0b8c3; border-radius: var(--pill); padding: 4px 12px; margin: 10px 0; }
.fit { white-space: nowrap; overflow: hidden; }
.fld .hint.fit { display: block; }
.fit.wrap { white-space: normal; }
.err { color: var(--red); font-size: 15px; min-height: 0; margin: 4px 0; text-align: center; }
.err:empty, .ok:empty { display: none; }
.ok { color: var(--blue-deep); text-align: center; font-size: 15px; white-space: pre-line; }   /* 
 위치에서 줄바꿈 */
.btn {
  border: 2px solid var(--line);
  border-radius: var(--pill);
  background: #fff;
  padding: 4px 16px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .2s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn.main { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.main:hover { background: var(--blue-deep); }
.btn.ghost { border: 0; background: none; color: var(--ink-soft); font-weight: 400; font-size: 15px; }
.btn.danger { color: var(--red); border-color: #efb3bf; }
.btn.wide { display: block; width: 70%; margin: 14px auto 0; padding: 6px; font-size: 19px; }
.chk { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.chk input { width: 18px; height: 18px; accent-color: var(--blue); margin: 0; }
.chk.small { font-size: 15px; }
.icon { border: 0; background: none; font-size: 28px; line-height: 1; padding: 0 10px; color: var(--blue-deep); }

/* ---------- 1. 표지 ---------- */
.cover {
  background: var(--tex-light) center / cover no-repeat, var(--tex-dark) center / cover no-repeat, #36a3dc;
  border: 0;
  padding: 24px 22px 24px 44px;
  overflow: hidden;
}
.spine {
  position: absolute; left: 0; top: 0; bottom: 0; width: 22px;
  background: var(--tex-dark), #2b93cf;
  border-right: 2px dashed rgba(255,255,255,.55);
}
.flowers { position: absolute; inset: 0; pointer-events: none; }
.fl, .pt { position: absolute; color: #fff; }
.f1 { width: 92px; height: 92px; top: 18px; right: 18px; }
.f2 { width: 40px; height: 40px; top: 120px; right: 96px; }
.f3 { width: 30px; height: 30px; top: 22px; left: 52px; }
.f4 { width: 110px; height: 110px; bottom: 26px; left: 34px; }
.f5 { width: 50px; height: 50px; bottom: 120px; right: 26px; }
.f6 { width: 26px; height: 26px; bottom: 34px; right: 90px; }
.pt { width: 10px; height: 10px; animation: drift 6s ease-in-out infinite; }
.p1 { top: 84px; right: 130px; }
.p2 { top: 46%; left: 34px; animation-delay: -2s; }
.p3 { bottom: 70px; right: 46%; animation-delay: -4s; }
@keyframes drift { 50% { translate: 6px 10px; } }
@media (prefers-reduced-motion: reduce) { .pt { animation: none; } }

.cover-in {
  position: relative;
  width: 100%;
  max-width: 340px;
  margin: auto;
  padding: 22px 20px;
  background: var(--tex-paper), rgba(255,254,250,.94);
  border-radius: var(--box);
  border: 2px solid #fff;
}
.logo {
  width: 180px;
  margin: 0 auto 12px;
  padding: 8px 0;
  text-align: center;
  border: 2px solid var(--sky);
  border-radius: var(--box);
  background: #fff;
}
.logo b { display: block; font-size: 38px; letter-spacing: 6px; color: var(--blue-deep); line-height: 1.1; }
.logo span { font-size: 17px; color: var(--ink-soft); }

/* ---------- 3. 홈 ---------- */
#home { padding-top: 34px; }
.who { font-size: 22px; font-weight: 700; line-height: 1.3; }
/* 오늘의 한마디: 가운데, 이름(22px)보다 조금 작게 */
.quote { margin: 12px 0 20px; color: var(--blue-deep); font-weight: 700; font-size: 19px; line-height: 1.5; text-align: center; }
#home .chip { margin: 0; flex: none; }
/* 월별일정 옆 지사장 안내 */
.cal-title-row { display: flex; align-items: center; gap: 8px; margin: 18px 0 6px; flex-wrap: wrap; }
.notice { flex: 1 1 260px; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 3px 6px 3px 12px; border: 2px solid var(--line); border-radius: var(--pill); background: #fff; }
.notice-tag { flex: none; color: var(--red); font-size: 15px; }
.notice-text { flex: 1; min-width: 0; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.notice-text.empty { color: var(--ink-soft); font-weight: 400; }
.notice .btn.sm { flex: none; }
.notice-form { margin: 0 0 8px; }
.notice-form textarea { display: block; width: 100%; padding: 6px 12px; border: 2px solid var(--line); border-radius: 16px 12px 18px 14px; background: #fff; font: inherit; resize: vertical; outline: none; }
.notice-form textarea:focus { border-color: var(--blue); }
.notice-btns { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.perf-note { margin: 6px 4px 0; font-size: 14px; }
#subGoal { padding-top: 22px; }
#subGoal > .hint { margin-bottom: 14px; font-size: 17px; }
.tbl-wrap { border: 2px solid var(--line); border-radius: var(--box); overflow: hidden; background: #fff; }
.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tbl th, .tbl td { border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); padding: 4px 6px; text-align: center; white-space: nowrap; font-size: 16px; }
.tbl tr > :last-child { border-right: 0; }
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl th { background: var(--sky-pale); font-weight: 700; }
.tbl thead th:first-child { width: 26%; }
.red { color: var(--red); }
.chip {
  display: inline-block;
  font-size: 18px;
  margin: 16px 0 6px;
  padding: 0 14px;
  border-radius: var(--pill);
  background: var(--sky-pale);
  border: 2px solid var(--sky);
  color: var(--blue-deep);
}

/* 주간/월간 일정 */
.cal { border: 2px solid var(--line); border-radius: var(--box); overflow: hidden; background: #fff; }
.cal-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 6px 2px 12px; background: var(--sky-pale); border-bottom: 1px solid var(--rule); }
.cal-head b { font-size: 18px; }
.cal-head .icon { font-size: 18px; padding: 2px 6px; }
.grid7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.grid7 > div { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 2px 3px; min-height: 76px; font-size: 13px; line-height: 1.25; overflow: visible; min-width: 0; }
.grid7 > div:nth-child(7n) { border-right: 0; }
.grid7.month > div { min-height: 54px; }           /* 월별일정이 한 화면 안에 들어오도록 */
.grid7 .dow { min-height: 0 !important; text-align: center; font-weight: 700; background: #f7fbff; font-size: 14px; }
.grid7 .other { color: #b8c4d3; }
.grid7 .today .d { background: var(--blue); color: #fff; border-radius: 10px; padding: 0 5px; }
.sun { color: var(--red); }
.sat { color: var(--blue); }
.ev { display: block; font-size: 12px; line-height: 1.2; margin-top: 2px; word-break: break-all; }
.ev.bday { color: var(--pink); font-weight: 700; }
.cake { width: 14px; height: 14px; vertical-align: -2px; margin-right: 1px; fill: #fff; stroke: var(--pink); stroke-width: 1.3; stroke-linejoin: round; }
.cake .wave { fill: none; }
.cake .flame { fill: #ffc94d; stroke: none; }

/* ---------- 4·5. 자료 / 교육 ---------- */
.search { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }   /* 좁은 폰에서는 검색칸이 다음 줄로 */
.search select { flex: none; width: auto; margin: 0; padding: 0 4px 0 10px; font-size: 15px; }
.search input { flex: 1 1 140px; min-width: 0; margin: 0; }
@media (max-width: 400px) {           /* 작은 폰: 1줄 정렬, 2줄 검색칸+검색 버튼 */
  .search select { flex: 1 1 100%; }
  .search input { flex-basis: 100px; }
}
.search .btn { flex: none; height: 40px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 2px; border-bottom: 1.2px dashed #c5d4e5; line-height: 1.7; }
.list li.link { cursor: pointer; }
.list li.link:hover { background: var(--sky-mist); }
.list .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .dt { flex: none; margin-left: auto; color: var(--ink-soft); }
.list .empty { justify-content: center; color: var(--ink-soft); border: 0; }

/* ---------- 6. 마이페이지 ---------- */
.subtabs { display: flex; justify-content: center; gap: 4px; margin-bottom: 10px; }
.subtabs button { border: 0; background: none; padding: 2px 10px; border-bottom: 3px solid transparent; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.subtabs button.on { color: var(--blue-deep); border-color: var(--blue); }
.month-nav { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 20px; }
.legend { display: flex; gap: 8px; font-size: 14px; }
.legend span::before { content: "●"; margin-right: 2px; }
.st-plan { color: var(--plan); }
.st-done { color: var(--done); }
.st-drop { color: var(--drop); }
.sum { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); text-align: center; border: 2px solid var(--line); border-radius: var(--box); background: #fff; margin-bottom: 8px; }
.sum div { padding: 4px 2px; border-right: 1px solid var(--rule); white-space: nowrap; min-width: 0; overflow: hidden; }
.sum div:last-child { border-right: 0; }
.sum small { display: block; font-size: 13px; color: var(--ink-soft); }
.sum b { font-size: 15px; }
.sum .two b { display: block; font-size: 12px; line-height: 1.3; }
.mcal { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)) minmax(0,1.25fr); border: 2px solid var(--line); border-radius: var(--box); overflow: hidden; background: #fff; }
.mcal > div { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); min-height: 74px; padding: 2px 3px; font-size: 12px; line-height: 1.3; overflow: hidden; }
.mcal > div:nth-child(8n) { border-right: 0; background: var(--sky-mist); }
.mcal .dow { min-height: 0; text-align: center; font-weight: 700; font-size: 14px; background: #f7fbff; }
.mcal .cell { cursor: pointer; }
.mcal .cell:hover { background: var(--sky-mist); }
.mcal .sel { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 4px; }
.mcal .other { color: #b8c4d3; }
.mcal .today .d { background: var(--blue); color: #fff; border-radius: 10px; padding: 0 5px; }
.mcal .nm { display: block; white-space: nowrap; overflow: hidden; font-size: 11px; letter-spacing: -0.6px; }
.mcal .nm.st-drop, .strike { text-decoration: line-through; }
.mcal .wk { font-size: 11px; text-align: right; }
.mcal .wk b { display: block; font-size: 12px; }
/* 금액은 한 줄로. 안 들어가면 JS(fitNumbers)가 그 칸만 만 단위로 바꿈 */
.fitnum { display: block; white-space: nowrap; overflow: hidden; }
.mcal .nm.amt { letter-spacing: -0.3px; }
.day { margin-top: 10px; }
.day h3 { font-size: 18px; margin: 0 0 4px; }
.day li { cursor: pointer; }
.fab {
  position: sticky;
  float: right;
  bottom: 14px;
  margin-top: 10px;
  width: 54px; height: 54px;
  border: 0;
  background: var(--flower-sky) center / contain no-repeat;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}
.goal { display: grid; grid-template-columns: 56px minmax(0,1fr) auto auto; gap: 6px; align-items: center; margin-bottom: 10px; font-weight: 700; }
.goal input { margin: 0; }
.goal input { background: #fff; cursor: text; }
.info { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 6px 0 16px; }
.info dt { color: var(--ink-soft); }
.info dd { margin: 0; }

/* 실적 입력 시트 */
.sheet-bg { position: absolute; inset: 0; z-index: 10; background: rgba(47,64,88,.28); display: flex; align-items: flex-end; border-radius: var(--r); }
.sheet { width: 100%; max-height: 92%; overflow-y: auto; background: var(--tex-paper), var(--paper); border-radius: 22px 22px var(--r) var(--r); padding: 10px 18px 18px; animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; text-align: center; font-size: 20px; margin-bottom: 6px; }
.frow { display: grid; grid-template-columns: 70px minmax(0,1fr); align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; }
.frow input { margin: 0; }
.status { display: flex; gap: 6px; }
.status button { flex: 1; border: 2px solid currentColor; border-radius: var(--pill); background: #fff; padding: 4px 0; font-weight: 700; }
.status button.on.st-plan { background: var(--plan); color: #fff; border-color: var(--plan); }
.status button.on.st-done { background: var(--done); color: #fff; border-color: var(--done); }
.status button.on.st-drop { background: var(--drop); color: #fff; border-color: var(--drop); }
.sheet-btns { display: flex; gap: 8px; margin-top: 12px; }
.sheet-btns .btn { flex: 1; padding: 6px; }

/* ---------- 지사장 전용 ---------- */
body:not(.admin) .admin-only { display: none !important; }
body.admin .staff-only { display: none !important; }
.subtabs { flex-wrap: wrap; row-gap: 2px; }
.subtabs button { padding: 2px 6px; }
.time-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.time-row input[type=time] { flex: 1 1 120px; min-width: 0; }
.time-row input:disabled { background: var(--sky-mist); color: var(--ink-soft); }
#schList .bday { cursor: default; }
.badge { display: inline-block; min-width: 18px; margin-left: 2px; padding: 0 5px; border-radius: 9px; background: var(--pink); color: #fff; font-size: 12px; line-height: 18px; vertical-align: 2px; }
.badge:empty { display: none; }
.btn.sm { padding: 0 9px; font-size: 14px; line-height: 26px; }
#schCal .grid7 > div { cursor: pointer; user-select: none; }

/* 직원관리 표 */
/* 이름 | 코드 | 비번 | 안내사항 | 관리·삭제. 휴대폰에서 좁으면 표만 옆으로 밀어서 봄 */
.staff-cols > .col:first-child { overflow-x: auto; }
.staff { min-width: 616px; }
.staff-head { display: grid; grid-template-columns: 74px 84px 140px minmax(170px,1fr) 88px; align-items: center; gap: 4px; min-width: 616px; padding: 3px 2px; font-size: 15px; font-weight: 700; color: var(--blue-deep); border-bottom: 1.2px solid var(--line); white-space: nowrap; }
.staff li { display: grid; grid-template-columns: 74px 84px 140px minmax(170px,1fr) 88px; align-items: center; gap: 4px; white-space: nowrap; font-size: 15px; }
.staff .btn.sm { padding: 0 4px; font-size: 13px; border-width: 1.5px; }
.staff .acts { justify-content: flex-end; gap: 3px; }
.staff li > span { overflow: hidden; text-overflow: ellipsis; }
.staff li.head { font-weight: 700; color: var(--blue-deep); border-bottom-style: solid; }
.staff li.open { background: var(--sky-mist); }
.staff .pw-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; overflow: hidden; }
.staff .pw-text { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.staff .pw-cell .btn.sm { line-height: 20px; font-size: 12px; }
.staff .req-msg { border: 2px dashed #f0c46b; border-radius: var(--pill); background: #fff8e6; color: #9a6a00; font-size: 13px; padding: 1px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff .req-msg:hover { background: #ffefc4; }
#pwReqText, #delText { margin: 10px 4px 14px; line-height: 1.6; white-space: pre-line; }   /* 문장마다 줄바꿈 */
/* 알림 숫자는 '마이페이지' 글씨 아래('지' 밑)에 붙고, 그만큼 라벨이 아래로 자동으로 늘어남 */
.rail button { height: auto; min-height: 96px; padding: 10px 0; gap: 6px; display: flex; align-items: center; justify-content: center; }   /* 세로쓰기라 flex 줄 = 위→아래: 글씨 다음 배지 */
.rail .badge { writing-mode: horizontal-tb; margin: 0; }
/* 직원관리: 정렬 ▾ / 검색 🔍 */
.sort-h { position: relative; cursor: pointer; white-space: nowrap; }
.sort-h select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.find-h { display: flex; align-items: center; gap: 6px; white-space: nowrap; min-width: 0; }
.staff-head { position: relative; }
/* 🔍 칸(맨 오른쪽) 안에서 검색칸이 돋보기 왼쪽으로 펼쳐짐: 안내사항 칸 위로 겹쳐 보이게 */
.find-end { justify-self: end; display: flex; align-items: center; gap: 4px; position: relative; }
.find-end input { position: absolute; right: calc(100% + 2px); top: 50%; transform: translateY(-50%); width: 150px; height: 28px; padding: 0 10px; border: 2px solid var(--line); border-radius: var(--pill); background: #fff; font-size: 14px; font-weight: 400; outline: none; }
.find-end input:focus { border-color: var(--blue); }
.find-btn { border: 0; background: none; padding: 0 4px; font-size: 16px; cursor: pointer; }
.staff .acts, .join .acts { display: flex; gap: 4px; flex: none; }
.card { margin-top: 12px; padding: 10px 12px; border: 2px solid var(--line); border-radius: var(--box); background: #fff; }
.card .who { font-size: 19px; }
.card p { margin: 4px 0 8px; }
.cell-in { width: 100%; border: 0; border-bottom: 2px dashed var(--line); background: var(--sky-mist); text-align: center; font: inherit; padding: 0 2px; }
.cell-in:focus { outline: none; border-bottom-color: var(--blue); }

/* 회원가입 승인 */
.join li { align-items: center; }
.join .t2 { flex: 1; min-width: 0; }

/* 자료·교육: 추가하기 버튼, 첨부, 상세 화면 */
.add-row { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.list .clip { font-size: 13px; }
.att-add { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; font-weight: 400; }
.att-pick { align-self: flex-start; cursor: pointer; white-space: normal; }
.url-row { display: flex; gap: 6px; min-width: 0; }
.url-row input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 2px solid var(--line); border-radius: var(--pill); background: #fff; outline: none; }
.url-row input:focus { border-color: var(--blue); }
.url-row .btn { flex: none; }
.att-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-weight: 400; }
.att-list:empty { display: none; }
.att { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 8px; border: 1.5px dashed var(--sky); border-radius: 12px; background: #fff; }
.att a, .att .att-file { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--blue-deep); text-decoration: underline; text-underline-offset: 3px; border: 0; background: none; padding: 0; text-align: left; font: inherit; cursor: pointer; }
.att-img { align-self: flex-start; padding: 4px; }
.att-img img { display: block; width: 120px; height: 90px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.att-rm { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font-size: 15px; line-height: 24px; padding: 0; }
.att-img .att-rm { position: absolute; top: -8px; right: -8px; }
.att-list .empty { color: var(--ink-soft); padding: 2px 0; }
#docBody { display: block; width: 100%; min-height: 110px; margin-top: 4px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 16px 12px 18px 14px; background: #fff; font: inherit; font-weight: 400; resize: vertical; outline: none; }
#docBody:focus { border-color: var(--blue); }
/* 자료·교육 글 페이지 */
.doc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; padding-right: 56px; }   /* 오른쪽 위 꽃 장식과 안 겹치게 */
#dvTitle { margin-bottom: 2px; }
#dvDate { margin: 0 0 6px; }
.btn.back { padding: 2px 14px; }
#dvTitle { overflow-wrap: anywhere; }
#doc .sheet-btns { margin-top: 18px; }
.dv-h { margin: 14px 0 4px; font-size: 17px; color: var(--blue-deep); border-bottom: 1.5px dashed var(--sky); }
.dv-body .body-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 10px; line-height: 1.6; }
.yt { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 8px 0; border-radius: 12px; overflow: hidden; background: #000; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.list .del { flex: none; border: 0; background: none; color: var(--red); font-weight: 700; padding: 0 4px; }

/* 일정 서식 */
.fmt, .colors { display: flex; gap: 6px; }
.fmt button { width: 36px; height: 34px; border: 2px solid var(--line); border-radius: var(--pill); background: #fff; font-size: 16px; }
.fmt button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.colors button { width: 28px; height: 28px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--line); }
.colors button.on { box-shadow: 0 0 0 3px var(--blue-deep); }
.preview { margin: 4px 0 8px; padding: 6px 10px; text-align: center; border: 2px dashed var(--sky); border-radius: var(--pill); background: #fff; }
#schList:empty { display: none; }
#schList { margin-bottom: 8px; }

/* 환경설정 메뉴 */
.set-item { margin-bottom: 10px; padding: 6px 12px; border: 2px solid var(--line); border-radius: var(--box); background: #fff; }
.set-item summary { font-weight: 700; font-size: 18px; color: var(--blue-deep); cursor: pointer; list-style: none; }
.set-item summary::-webkit-details-marker { display: none; }
.set-item summary::before { content: '›'; display: inline-block; margin-right: 6px; transition: transform .2s; }
.set-item[open] summary::before { transform: rotate(90deg); }
.set-item p { margin: 6px 0; }
.set-item .now { color: var(--ink-soft); }
.set-in { width: 100%; height: 40px; padding: 0 14px; border: 2px solid var(--line); border-radius: var(--pill); background: #fff; font: inherit; outline: none; }
.set-in:focus { border-color: var(--blue); }

/* 계약 메모 + 사진 */
.memo-row { align-items: start; }
.memo-row > label { padding-top: 8px; }
.memo-box { display: flex; gap: 6px; align-items: flex-start; min-width: 0; }
/* 메모 칸 하나 안에 글 + 맨 아래 사진 */
.memo-area { flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 16px 12px 18px 14px; background: #fff; overflow: hidden; }
.memo-area:focus-within { border-color: var(--blue); }
.memo-area textarea { display: block; width: 100%; min-height: 70px; padding: 6px 12px; border: 0; background: transparent; font: inherit; resize: vertical; outline: none; }
.cam { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: var(--pill); background: #fff; cursor: pointer; }
.cam:hover { background: var(--sky-mist); }
.cam svg { width: 24px; height: 24px; fill: none; stroke: var(--blue-deep); stroke-width: 1.8; stroke-linejoin: round; }
.photos { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 10px 10px; border-top: 1.5px dashed var(--rule); }
.photos:empty { display: none; }
.ph { position: relative; }
.ph img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; border: 2px solid var(--line); cursor: zoom-in; display: block; }
/* 사진 크게 보기 */
.photo-view { z-index: 20; background: rgba(20, 35, 50, .7); }
.photo-view figure { position: relative; margin: 0; max-width: 100%; max-height: 100%; }
.photo-view img { display: block; max-width: 100%; max-height: calc(100dvh - 80px); border-radius: 12px; background: #fff; }
.photo-view .icon { position: absolute; top: -14px; right: -10px; width: 36px; height: 36px; padding: 0; border-radius: 50%; background: #fff; font-size: 26px; line-height: 34px; }
.ph button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font-size: 14px; line-height: 22px; padding: 0; }

/* 회원가입 생년월일: 직접 입력 + 달력 버튼 */
.birth-wrap { position: relative; display: block; margin-top: 4px; }
.birth-wrap #sgBirth { margin-top: 0; padding-right: 48px; }
.cal-pick { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 34px; height: 30px; padding: 0; border: 0; background: none; font-size: 18px; cursor: pointer; }
#sgBirthDate { position: absolute; right: 8px; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* 회원가입 개인정보 동의 */
.consent { margin: 6px 0; padding: 4px 10px; border: 2px dashed var(--sky); border-radius: var(--box); background: #fff; font-size: 14px; }
.consent summary { cursor: pointer; color: var(--blue-deep); font-weight: 700; }
.consent ul { margin: 4px 0; padding-left: 18px; line-height: 1.6; }
.consent-chk { white-space: normal; font-weight: 700; margin: 4px 0; }

/* 가운데 뜨는 창 (그날 기록) */
.sheet-bg.modal { align-items: center; justify-content: center; padding: 16px; }
.sheet-bg.modal .sheet { max-width: 420px; border-radius: var(--box); border: 2px solid var(--line); animation: pop .2s ease-out; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
#dayList { margin-bottom: 4px; }
#dayList li { align-items: center; gap: 8px; }
#dayList .t { flex: 1; min-width: 0; }
#dayList .dt { margin-left: 0; min-width: 64px; text-align: right; }
.st-sel { flex: none; height: 30px; padding: 0 6px; border: 2px solid currentColor; border-radius: 8px; background: #fff; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.st-sel option { color: var(--ink); }
#dayList .empty { padding: 14px 0; }

/* 마이페이지 탭 순서: 지사장은 일정달력이 먼저, 직원은 실적달력이 먼저 */
.subtabs [data-sub="sched"] { order: 1; }
.subtabs [data-sub="cal"] { order: 0; }
.subtabs [data-sub="goal"] { order: 2; }
.subtabs [data-sub="staff"] { order: 3; }
.subtabs [data-sub="join"] { order: 4; }
.subtabs [data-sub="set"] { order: 5; }
body.admin .subtabs [data-sub="sched"] { order: -1; }

/* 일정: 기간 선택, 직원 달력 속 회사 일정 */
.date-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.date-row input:not([type=checkbox]) { flex: 1 1 140px; min-width: 0; margin: 0; }
.date-row input:disabled { background: var(--sky-mist); color: var(--ink-soft); }
.ev.co { opacity: .75; }
.ev.co::before { content: "■ "; font-size: 9px; }
/* 기간 일정: 글자색 테두리의 긴 네모. 칸 경계까지 이어 붙이고 시작·끝만 둥글게 */
.ev.span { position: relative; height: 19px; margin: 2px -4px 0; padding: 0; border-top: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; white-space: nowrap; word-break: normal; }
.ev.span.seg-start { margin-left: 0; border-left: 2.5px solid currentColor; border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.ev.span.seg-end { margin-right: 0; border-right: 2.5px solid currentColor; border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.ev.co.span::before { content: none; }
/* 글씨 폭은 JS(fitSpans)가 실제 네모 길이로 맞춰서 정가운데에 옴 */
.span-txt { position: absolute; z-index: 1; left: 0; top: 0; width: 100%; line-height: 14px; padding: 0 6px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: inherit; font-style: inherit; }

.rep-sel { height: 40px; padding: 0 10px; border: 2px solid var(--line); border-radius: var(--pill); background: #fff; min-width: 0; }

/* 환경설정 > 보안 주의할 점 (지사장): 설정 화면에선 다음 장으로 넘어가는 버튼 */
.set-link { display: flex; justify-content: space-between; align-items: center; width: 100%; font: inherit; font-weight: 700; font-size: 18px; color: var(--red); text-align: left; cursor: pointer; }
.set-link:hover { background: #fff5f7; }
.set-link.usage { color: var(--blue-deep); text-decoration: none; }
.set-link.usage:hover { background: var(--sky-mist); }
#sec .hint { margin-bottom: 6px; }
.usage-link { margin: 2px 0 8px; }
.usage-link a { font-weight: 700; color: var(--blue-deep); text-underline-offset: 3px; }
/* 실적 입력: 민감정보 안내, 사진 확인 */
.memo-warn { margin: 0 0 6px; padding: 6px 10px; font-size: 14px; line-height: 1.5; color: #9a3a00; border: 2px dashed #f0c46b; border-radius: 14px; background: #fff8e6; text-align: center; }
.photo-ok { white-space: normal; align-items: flex-start; font-size: 14px; margin: 0 0 6px; color: var(--red); font-weight: 700; }
.photo-ok input { margin-top: 3px; flex: none; }
.ocr-msg { margin: 0 0 6px; font-size: 14px; color: var(--blue-deep); }
.ocr-msg:empty { display: none; }
.sec-guide summary { color: var(--red); }
.sec-guide h4 { margin: 12px 0 4px; font-size: 17px; color: var(--blue-deep); border-bottom: 1.5px dashed var(--sky); }
.sec-guide ul { margin: 4px 0 6px; padding-left: 18px; line-height: 1.6; }
.sec-guide li { margin-bottom: 4px; overflow-wrap: anywhere; }
.sec-guide b { color: var(--ink); }

/* 환경설정 > 정보 수정 */
.info-btns { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.info-btns .ok { margin: 0 auto 0 0; }
.info-edit { margin: 4px 0 10px; padding-top: 8px; border-top: 1.5px dashed var(--sky); }
.phone-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: 6px; margin-bottom: 6px; font-weight: 700; }
.phone-row input { height: 38px; padding: 0 12px; border: 2px solid var(--line); border-radius: var(--pill); background: #fff; min-width: 0; outline: none; }
.phone-row input:focus { border-color: var(--blue); }
.phone-row .att-rm { justify-self: start; }
.info-edit .chk { margin: 6px 0; }

/* 그 날 일정 목록 창 */
.sch-day { position: relative; padding-bottom: 76px; }
.sch-items { min-height: 60px; }
.sch-items li { align-items: center; gap: 6px; user-select: none; }
.sch-items li.ro { opacity: .8; }
.sch-items li.editable { cursor: pointer; border-radius: 10px; }
.sch-items li.movable { cursor: grab; touch-action: none; }
.sch-items li.pinned .grip { letter-spacing: 0; font-size: 12px; }
.sch-items li.editable:hover { background: var(--sky-mist); }
.sch-items li.dragging { cursor: grabbing; background: var(--sky-pale); box-shadow: 0 4px 12px rgba(47, 64, 88, .18); position: relative; z-index: 2; }
.sch-items .grip { flex: none; color: var(--ink-soft); font-size: 13px; letter-spacing: -3px; }
.sch-items .t { flex: 1; min-width: 0; }
.sch-items .dt { font-size: 13px; }
.sch-items .empty { justify-content: center; color: var(--ink-soft); padding: 14px 0; white-space: normal; text-align: center; }
.fab.day-fab { position: absolute; right: 14px; bottom: 12px; float: none; margin: 0; }

/* 비밀번호 눈 모양 */
.pw-wrap { position: relative; display: block; margin-top: 4px; }
.pw-wrap input { margin-top: 0 !important; padding-right: 46px !important; }
.pw-wrap .eye { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 34px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; background: none; }
.pw-wrap .eye svg { width: 22px; height: 22px; fill: none; stroke: var(--ink-soft); stroke-width: 1.8; stroke-linecap: round; }
.pw-wrap .eye:hover svg { stroke: var(--blue-deep); }

/* 비밀번호 재설정 후 잠금 */
.must-banner { margin: 0 0 12px; padding: 8px 12px; text-align: center; color: var(--red); font-weight: 700; border: 2px dashed #f0b8c3; border-radius: var(--box); background: #fff5f7; }
.subtabs.locked button:not([data-sub="set"]), .rail.locked button { opacity: .35; pointer-events: none; }

/* 마이페이지: 메뉴 아래 간격 */
.subtabs { margin-bottom: 18px; }
#my .sub { padding-top: 6px; }

/* 자료·교육 페이지 번호 */
.pager { display: flex; justify-content: center; gap: 6px; margin: 16px 0 4px; }
.pager button { min-width: 34px; height: 34px; padding: 0 6px; border: 2px solid var(--line); border-radius: var(--pill); background: #fff; font-weight: 700; color: var(--ink); }
.pager button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.pager button:disabled { opacity: .35; cursor: default; }

/* 휴대폰에서는 위아래로 쌓고, PC에서는 좌우로 나눔 */
.cols { display: block; }

/* ---------- PC: 가로로 된 공책, 화면 꽉 차게 + 크게 ---------- */
@media (min-width: 900px) {
  body { background: #fff; }                         /* 하늘색 배경 없이 공책만 */
  .shell { max-width: none; height: 100dvh; padding: 14px 4px 14px 14px; }
  /* 나이 있으신 분도 보기 편하게 전체 확대. zoom은 레이아웃까지 같이 맞춰서 글자가 깨지지 않음 */
  .page > *:not(.spine):not(.flowers), .sheet, .rail { zoom: 1.3; }
  .grid7 > div { min-height: 110px; }
  .grid7.month > div { min-height: 64px; }
  .paper { padding: 22px 28px 40px 58px; }

  .cols { display: grid; gap: 28px; align-items: start; }
  .home-cols { display: block; }                     /* PC에서도 주간일정은 아래로 */
  .home-cols .tbl-wrap, .home-cols .perf-note { max-width: 720px; }
  /* 실적달력: 달력을 크게. 범례·금액보기·건수 합계는 달력 위 한 줄에 */
  .cal-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 8px; }
  .cal-top .month-nav { flex: none; }
  .cal-top .row-between { flex: none; margin: 0; gap: 12px; }
  .cal-top .sum { flex: 1 1 380px; margin: 0; }     /* 좁으면 다음 줄로 내려가서 숫자가 겹치지 않게 */
  .mcal > div { min-height: 52px; font-size: 13px; }
  #subCal .fab { position: static; float: none; display: block; margin: 8px 0 0 auto; }   /* 달력 칸을 가리지 않게 */
  .mcal .nm { font-size: 12px; }
  .staff-cols { display: block; }
  .staff-cols #staffDetail { max-width: 640px; }
  .my-cols .day { margin-top: 0; }

  /* 폼처럼 좁은 내용은 가운데에 적당한 폭으로 */
  #signForm, #subGoal, #subSet, #subJoin { max-width: 560px; margin-left: auto; margin-right: auto; }
  .search, .add-row, .list, .pager { max-width: 900px; margin-left: auto; margin-right: auto; }
  #doc > *, #sec > *, #stats > *, #docedit > * { max-width: 860px; margin-left: auto; margin-right: auto; }
  #docForm { max-width: 640px; margin: 0 auto; }
  .cover-in { max-width: 380px; }
  .sheet { max-width: 560px; margin: 0 auto; }
  .sheet-bg { justify-content: center; }
}
/* 태블릿 세로: 휴대폰 폭(520px)에 갇히지 않게 공책을 넓힘 */
@media (min-width: 600px) and (max-width: 899px) { .shell { max-width: 780px; padding-left: 16px; } }
/* 화면이 클수록 더 크게 */
@media (min-width: 1280px) { .page > *:not(.spine):not(.flowers), .sheet, .rail { zoom: 1.45; } }
@media (min-width: 1600px) { .page > *:not(.spine):not(.flowers), .sheet, .rail { zoom: 1.7; } }
@media (min-width: 1900px) { .page > *:not(.spine):not(.flowers), .sheet, .rail { zoom: 1.9; } }
/* 기준일 칸: 좁으면 단어 단위로 줄을 내려서 절대 옆 칸으로 넘치지 않게 */
.tbl th.base { font-size: 13px; font-weight: normal; line-height: 1.3; color: var(--blue-deep); white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
/* 밑줄·취소선: 숫자와 한글 글꼴이 섞여도 굵기·위치가 같게 (홈 달력에서 숫자 밑줄이 끊겨 보이던 문제) */
.ev, .ev *, #schPreview, #schDayList .t, [style*="text-decoration"], [style*="text-decoration"] * { text-decoration-thickness: 1.5px; text-underline-offset: 2px; text-decoration-skip-ink: none; }

/* 휴대폰: 오른쪽 라벨을 숨겨 공책을 넓히고, 오른쪽 위 꽃을 누르면 라벨이 나옴 */
.menu-btn { display: none; }
@media (max-width: 599px) {
  .shell { position: relative; padding-right: 10px; overflow: hidden; }   /* 밀린 공책이 가로 스크롤을 만들지 않게 */
  .menu-btn {
    display: block; position: absolute; top: 16px; right: 20px; z-index: 30;
    width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%;
    background: var(--flower-sky) center / 46px no-repeat; cursor: pointer;
    color: #fff; font-weight: 700; font-size: 15px; letter-spacing: 1px; line-height: 52px; text-align: center;
    transition: transform .25s ease;
  }
  .menu-btn[hidden] { display: none; }
  .menu-btn .badge { position: absolute; top: -2px; right: -2px; line-height: 18px; letter-spacing: 0; }
  /* 메뉴가 열리면 공책 전체가 왼쪽으로 살짝 밀리고, 비워진 오른쪽에 라벨이 들어옴 */
  .book { transition: transform .25s ease; }
  body.rail-open .book, body.rail-open .menu-btn { transform: translateX(-38px); }
  .rail { position: absolute; top: 76px; right: 10px; z-index: 29; display: flex; visibility: hidden; transform: translateX(44px); opacity: 0; transition: transform .25s ease, opacity .25s, visibility .25s; }
  body.rail-open .rail { visibility: visible; transform: none; opacity: 1; }
}

/* 오늘의 한마디 출처: 작게, 문구 아래 오른쪽 */
.quote-by { margin: -16px 0 14px; text-align: right; padding-right: 8%; font-size: 13px; line-height: 30px; color: var(--ink-soft); }
/* 휴대폰: 한마디를 공책 줄 높이(30px)에 맞춤 (위치는 app.js alignQuote) */
@media (max-width: 599px) {
  .quote { line-height: 30px; margin-bottom: 12px; }
  .quote:has(+ .quote-by:not([hidden])) { margin-bottom: 0; }
  .quote-by { margin: 0 0 12px; }
}
/* 휴대폰 하루 일정 카드: 왼쪽 날짜(가운데 정렬, 월은 작게) · 오른쪽 그 날 일정 */
.day-card { display: flex; min-height: 120px; border-top: 1.5px solid var(--rule); touch-action: pan-y; cursor: pointer; }
.day-date { flex: none; width: 26%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 10px 4px; border-right: 1.5px solid var(--rule); background: var(--sky-pale); text-align: center; }
.day-date small { font-size: 14px; color: var(--ink-soft); }
.day-date b { font-size: 17px; color: var(--blue-deep); white-space: nowrap; }
.day-date.sun b { color: var(--red); }
.day-date.sat b { color: var(--blue); }
.day-date em { font-style: normal; font-size: 12px; color: #fff; background: var(--blue); border-radius: 9px; padding: 0 8px; }
.day-items { flex: 1; min-width: 0; margin: 0; padding: 8px 10px; list-style: none; }
.day-items li { padding: 4px 0; border-bottom: 1px dashed var(--rule); font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.day-items li:last-child { border-bottom: 0; }
.day-items li.empty { color: var(--ink-soft); border: 0; }
.day-items small { color: var(--ink-soft); font-size: 12px; }
@media (min-width: 600px) { .quote-by { text-align: center; padding-right: 0; } }

/* (?) 사용 방법 버튼과 창 */
.help-btn { flex: none; width: 24px; height: 24px; margin-left: 8px; padding: 0; border: 2px solid var(--line); border-radius: 50%; background: #fff; color: var(--blue-deep); font-weight: 700; font-size: 14px; line-height: 20px; text-align: center; cursor: pointer; }
.help-btn:hover { background: var(--sky-pale); }
.help-list { margin: 6px 4px 8px; padding-left: 20px; line-height: 1.6; }
.help-list li { margin-bottom: 6px; overflow-wrap: break-word; }
p, li, .hint, .notice-text { text-wrap: pretty; }
/* 휴대폰: 달력을 가로로 최대한 넓게, 칸 안 글씨는 한 줄로(넘치면 잘림). 날짜를 누르면 그 날 일정 창에서 전부 보임 */
@media (max-width: 599px) {
  .paper { padding-left: 36px; padding-right: 8px; }

  .grid7 > div { padding: 2px 2px; }
  .mcal > div { padding: 2px 2px; }
}
/* 달력 칸 안 일정은 PC·휴대폰 모두 한 줄로(넘치면 옆으로 잘림). 날짜를 누르면 그 날 일정 창에서 전부 보임 */
.grid7 .ev:not(.span) { white-space: nowrap; overflow: hidden; text-overflow: clip; word-break: normal; }
/* 날짜를 눌러 여는 일정·실적 목록 창: 글씨가 길면 잘리지 않고 아래로 늘어남 (달력 칸만 한 줄) */
.sch-items .t, #dayList .t { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.sch-items li, #dayList li { align-items: flex-start; }
/* 하루일정: 일정마다 앞에 작은 검은 동그라미 */
.day-items li:not(.empty) { position: relative; padding-left: 12px; }
.day-items li:not(.empty)::before { content: ""; position: absolute; left: 2px; top: calc(4px + .7em - 2px); width: 4px; height: 4px; border-radius: 50%; background: #2a2a2a; }

/* 글씨체 설정 */
html[data-font="noto"] body { font-weight: 500; }    /* 본고딕은 기본 굵기를 조금 올려 또렷하게 */
.font-list { display: grid; gap: 6px; margin: 8px 0; }
.font-opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 14px; border: 2px solid var(--line); border-radius: 16px; background: #fff; text-align: left; font-size: 18px; line-height: 1.3; }
.font-opt .ex { color: var(--ink-soft); font-size: 15px; white-space: nowrap; }
.font-opt.on { border-color: var(--blue); background: var(--sky-pale); box-shadow: inset 0 0 0 1px var(--blue); }
.font-opt.on .nm::before { content: "✔ "; color: var(--blue); }
.font-preview { margin-top: 10px; padding: 8px 12px; border: 2px dashed var(--line); border-radius: 14px; background: #fff; line-height: 1.6; }
.font-preview .fp-title { display: block; font-size: 14px; color: var(--ink-soft); }
.font-preview p { margin: 4px 0; overflow-wrap: anywhere; }
.font-preview u, .font-preview s { text-decoration-thickness: 1.5px; text-underline-offset: 2px; text-decoration-skip-ink: none; }

/* 실적달력 합계 금액: 한 줄 칸에서 넘치면 app.js가 글씨를 줄여 맞춤 */
.sum b { display: block; white-space: nowrap; overflow: hidden; }
/* 휴대폰 직원관리: 옆으로 밀지 않아도 한 화면에. 이름·코드·[관리][삭제] / 비번·재설정 / 안내사항 */
@media (max-width: 599px) {
  .staff-cols > .col:first-child { overflow-x: visible; }
  .staff, .staff-head { min-width: 0; }
  .staff-head { grid-template-columns: minmax(0, 1fr) auto; }
  .staff-head > span:not(.find-end) { display: none; }
  .staff li { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "name code acts" "pw pw pw" "req req req"; row-gap: 2px; padding: 6px 2px; }
  .staff li > :nth-child(1) { grid-area: name; font-weight: 700; }
  .staff li > :nth-child(2) { grid-area: code; color: var(--ink-soft); }
  .staff li > :nth-child(3) { grid-area: pw; }
  .staff li > :nth-child(4) { grid-area: req; }
  .staff li > :nth-child(5) { grid-area: acts; }
  .staff li > :nth-child(4):empty { display: none; }
  .staff .pw-cell { flex-direction: row; align-items: center; gap: 8px; }
  .staff li.empty { display: block; }
}
/* 휴대폰 실적달력 합계: 4칸 한 줄이 좁아서 2×2로 (금액이 잘리지 않게) */
@media (max-width: 599px) {
  .sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sum div:nth-child(2n) { border-right: 0; }
  .sum div:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
/* 자료·교육 글 화면: 제목·첨부 이름은 잘리지 않고 아래로 내려서 전부 보임 (목록에서만 한 줄로 잘림) */
#dvTitle { white-space: normal; }
#dvAtts .att a, #dvAtts .att .att-file { white-space: normal; overflow: visible; overflow-wrap: anywhere; }

/* 지사장 홈: 현재 실적 줄은 눌러서 수정 (표시 없이 누르면 수정 창) */
.cur-edit { cursor: pointer; }
.cur-edit:hover td, .cur-edit:focus td { background: var(--sky-mist); }

/* 직원관리 상세: 전화번호는 휴대폰에선 한 줄씩, 컴퓨터에선 가로로 (ㅣ 구분) */
.ph-list, .ph-birth { margin: 0; }
.ph-list .ph { display: block; }
.ph-list .ph::before { content: "· "; }
@media (min-width: 900px) {
  .ph-list .ph { display: inline-block; white-space: nowrap; }   /* 번호 중간에서 줄이 꺾이지 않게 */
  .ph-list .ph + .ph::before { content: "ㅣ"; margin: 0 10px; color: var(--ink-soft); }
}
/* 지사장 전용 메모 */
.staff-memo { display: block; margin-top: 8px; }
.staff-memo textarea { display: block; width: 100%; min-height: 72px; margin-top: 4px; padding: 6px 12px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font: inherit; line-height: 1.5; resize: vertical; overflow: hidden; outline: none; }
.staff-memo textarea:focus { border-color: var(--blue); }
.staff-memo .hint { font-size: 13px; }
/* 직원관리 > 관리 창: 메모가 길어지면 창 안에서 스크롤 */
#staffDetail .card { max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; }   /* 실제 높이는 app.js fitStaffCard가 남은 화면에 맞춤 */

/* 관리 창: 실적 [저장]은 표 오른쪽 아래, 메모 자동 저장 상태 */
.cur-save-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.cur-save-row .hint { margin: 0; }
#curMsg { text-align: right; margin: 2px 0 0; }
#curMsg:empty, .memo-state:empty { display: none; }
.memo-state { margin: 2px 0 0; font-size: 13px; text-align: right; color: var(--ink-soft); }

/* 월 달력의 앞뒤 달 칸: 빈칸, 누를 수 없음 */
.grid7 > div.blank, .mcal > div.blank { cursor: default; background: transparent; }
.mcal .blank:hover { background: transparent; }

/* 홈 달력 제목(2026년 11월): 누르면 오늘로 */
.go-today { cursor: pointer; }

/* 오늘의 한마디 따옴표: 글씨체와 상관없이 “ ” 모양 그대로 */
.qm { font-family: 'Gaegu', 'Malgun Gothic', sans-serif; }

/* PC 주간일정: 한 칸에 일정이 여러 개면 일정 앞에 작은 검은 동그라미 (기간 막대·생일 케이크는 제외) */
@media (min-width: 600px) {
  .grid7:not(.month) > div .ev:not(.span):not(.bday)::before { content: ""; display: inline-block; width: 4px; height: 4px; margin: 0 3px 0 1px; border-radius: 50%; background: #2a2a2a; vertical-align: middle; }
}

/* 일정 창 밖으로 끌기: 창은 흐리게(아래 달력이 보이고 눌림), 끄는 일정 이름표, 놓을 날짜 칸 표시 */
#schDaySheet.drag-out { background: transparent; pointer-events: none; }
#schDaySheet.drag-out .sheet { opacity: .18; }
.drag-ghost { position: fixed; z-index: 300; pointer-events: none; transform: translate(-50%, -130%); max-width: 70vw; padding: 4px 12px; border: 2px solid var(--blue); border-radius: 14px; background: #fff; box-shadow: 0 4px 12px rgba(47, 64, 88, .25); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-target { outline: 3px solid var(--blue); outline-offset: -3px; background: var(--sky-pale) !important; }
.sch-items li.editable { touch-action: none; }              /* 손가락으로도 끌 수 있게(기간 일정 포함) */
#moveSheet { z-index: 11; }                     /* 일정 창 위에 떠야 함(같은 10이면 뒤에 깔림) */
#moveText { white-space: pre-line; margin: 10px 4px 14px; line-height: 1.6; }
.staff .pw-cell { flex-wrap: wrap; }

/* 직원관리: 임시 비밀번호 바로 옆 📋 복사 */
.staff .pw-row { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; }
.copy-ic { flex: none; display: inline-flex; padding: 2px; border: 0; border-radius: 6px; background: none; color: var(--blue-deep); line-height: 1; cursor: pointer; }
.copy-ic:hover { background: var(--sky-pale); }
.copy-ic:hover { transform: scale(1.15); }

/* 달력 칸 일정 글씨를 바로 끌 수 있음(내 일정 / 지사장의 회사 일정) */
#schCal .ev[data-sid]:not(.co), body.admin #hmCal .ev[data-sid] { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }

/* 문장 덩어리째 줄바꿈(한 글자만 윗줄에 남지 않게) */
.nw { display: inline-block; }

/* 보안 주의할 점 안의 Supabase 사용량 링크 */
.sec-guide .sec-link { color: var(--blue-deep); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
/* 이용 통계(지사장) */
.stats-page h4 { margin: 14px 0 6px; font-size: 17px; color: var(--blue-deep); border-bottom: 1.5px dashed var(--sky); }
.st-bars { display: flex; align-items: stretch; gap: 6px; height: 190px; padding: 4px 0; }
.st-col { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; padding: 4px 0; border: 0; border-radius: 10px; background: none; font: inherit; cursor: pointer; }
.st-col:hover, .st-col.on { background: var(--sky-pale); }
.st-bar { width: 60%; min-height: 2px; border-radius: 6px 6px 0 0; background: var(--sky); }
.st-col.on .st-bar { background: var(--blue); }
.st-n { font-size: 14px; color: var(--ink-soft); }
.st-m { font-size: 15px; font-weight: 700; }
.st-pie-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.st-pie { flex: none; width: 190px; }
.st-pie:empty { display: none; }
.st-pie svg { display: block; width: 100%; height: auto; }
.st-pie text { font-size: 11px; font-weight: 700; fill: var(--ink); }
.st-legend { flex: 1; min-width: 200px; list-style: none; margin: 0; padding: 0; }
.st-legend li { display: flex; align-items: center; gap: 8px; padding: 3px 2px; border-bottom: 1.2px dashed #c5d4e5; }
.st-legend li.empty { justify-content: center; color: var(--ink-soft); border: 0; }
.st-legend i { flex: none; width: 12px; height: 12px; border-radius: 3px; }
.st-legend .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-legend .pct { flex: none; width: 3.2em; text-align: right; color: var(--ink-soft); }
/* 자료·교육 목록 조회수(지사장만) */
.list .views { flex: none; align-self: center; margin-left: auto; min-width: 4em; text-align: right; font-size: .82em; color: var(--ink-soft); }   /* 날짜 옆 같은 높이, 날짜보다 조금 작게 */
.list .views + .dt { margin-left: 0; min-width: 5.2em; text-align: right; }   /* 날짜 칸 폭을 같게 → 조회수가 줄마다 같은 자리 */
/* 통계: 원그래프 달 이동 ‹ 2026년 11월 직원별 이용 › */
.st-nav { display: flex; align-items: center; gap: 6px; margin: 14px 0 6px; border-bottom: 1.5px dashed var(--sky); }
.st-nav h4 { flex: 1; margin: 0; border: 0; text-align: center; }
.st-nav .icon { flex: none; width: 34px; height: 34px; padding: 0; border: 1.5px solid var(--sky); border-radius: 50%; background: #fff; color: var(--blue-deep); font-size: 22px; line-height: 1; cursor: pointer; }
.st-nav .icon:disabled { opacity: .3; cursor: default; }

/* 목표액 초기화: 저장 옆 흰 동그라미 */
.goal-reset { flex: none; width: 46px; height: 46px; padding: 0; border: 2px solid var(--sky); border-radius: 50%; background: #fff; color: var(--blue-deep); font: inherit; font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer; }
.goal-reset:hover { background: var(--sky-pale); }
/* 직원관리: 생일 옆 '생일 표시 안함' */
.ph-birth:has(.chk) { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }   /* 생일 글자와 체크란을 한 줄 가운데로 맞춤 */
.ph-birth .chk { font-weight: 400; }
.info dd:has(.info-bday) { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.info-bday { font-weight: 400; }
/* 첨부파일 받기 버튼 */
.att-dl { flex: none; padding: 2px 10px; border: 1.5px solid var(--sky); border-radius: var(--pill); background: #fff; color: var(--blue-deep); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.att-dl:hover { background: var(--sky-pale); }
.att-img:has(.att-dl) { flex-direction: column; align-items: stretch; }
