/* dnpERP 화면 기준: 연회색 바탕, 파란 강조색, 둥근 단추, Pretendard, 마우스를 올리면 굵게 */
@font-face { font-family: 'PretendardWeb'; font-weight: 400; font-display: swap; src: local('Pretendard'), url('fonts/Pretendard-Regular.ttf') format('truetype'); }
@font-face { font-family: 'PretendardWeb'; font-weight: 700; font-display: swap; src: local('Pretendard Bold'), url('fonts/Pretendard-Bold.ttf') format('truetype'); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 15px/1.45 'PretendardWeb', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; color: #1c2430; background: #f1f3f7; -webkit-text-size-adjust: 100%; }
body.locked { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
/* 글자 16px 미만이면 아이폰이 입력할 때 화면을 확대한다 */
input, textarea { font-size: 16px; border: 1px solid #c5cede; border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; }
input[type=checkbox] { width: auto; }
button { min-height: 38px; padding: 6px 14px; border: 1px solid #c5cede; border-radius: 8px; background: #fff; cursor: pointer; }
@media (hover: hover) { button:hover { font-weight: 700; } }
button.primary { background: #2f7cf6; border-color: #2f7cf6; color: #fff; }
button.text { min-height: 28px; border: 0; background: none; color: #2f6fd0; padding: 2px 6px; }
button:disabled { opacity: .55; }
.grow { flex: 1; min-width: 0; }
.dim { color: #6b7688; font-size: 13px; }
.error { color: #c0392b; margin: 4px 0 0; }
.sun { color: #d33; }
.sat { color: #33c; }

.card { max-width: 360px; margin: 12vh auto 0; padding: 22px; background: #fff; border-radius: 14px; box-shadow: 0 6px 24px rgba(20, 30, 45, .12); display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 400px) { .card { margin: 6vh 12px 0; } }
.card h1 { margin: 0; font-size: 22px; text-align: center; }
.card label, .stack label { display: flex; flex-direction: column; gap: 4px; }
.card label.check { flex-direction: row; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

header { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid #dde2ec; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; }
.bar { display: flex; align-items: center; gap: 6px; max-width: 1200px; margin: 0 auto; }
.bar + .bar { margin-top: 6px; }
#title { margin: 0; font-size: 18px; white-space: nowrap; }
.nav { font-size: 20px; line-height: 1; padding: 4px 12px; }
.seg { display: flex; }
.seg button { border-radius: 0; }
.seg button:first-child { border-radius: 8px 0 0 8px; }
.seg button:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.seg button.on { background: #2c3e50; border-color: #2c3e50; color: #fff; }
.menu { position: fixed; right: 8px; top: calc(48px + env(safe-area-inset-top)); z-index: 6; display: flex; flex-direction: column; gap: 6px; min-width: 190px; padding: 10px; background: #fff; border: 1px solid #dde2ec; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }

main { max-width: 1200px; margin: 0 auto; padding: 8px 8px calc(24px + env(safe-area-inset-bottom)); }
main h3 { margin: 14px 2px 6px; font-size: 15px; }
.empty { color: #8a93a3; padding: 16px 4px; }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: #dde2ec; border: 1px solid #dde2ec; border-radius: 8px; overflow: hidden; }
.week { background: #fff; text-align: center; padding: 4px 0; font-weight: 700; font-size: 13px; }
.day { background: #fff; min-height: 52px; display: flex; flex-direction: column; align-items: stretch; cursor: pointer; padding: 2px; min-width: 0; }
.day.today { background: #fcf8e3; }
.day.selected { box-shadow: inset 0 0 0 2px #2f7cf6; }
.day .num { min-height: 0; border: 0; background: none; padding: 1px 0; font-size: 13px; }
.day.other .num { opacity: .35; }
/* 좁은 화면: 칸에는 색 점과 건수만, 제목은 아래 목록에 */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-height: 12px; overflow: hidden; }
.chip { width: 5px; height: 5px; border-radius: 50%; background: #3a87ad; color: #fff; font-size: 0; }
.count { text-align: center; font-size: 11px; color: #6b7688; }

.event { display: block; width: 100%; text-align: left; border: 0; margin-bottom: 4px; padding: 8px 10px; background: #3a87ad; color: #fff; word-break: break-all; }
.event .name { display: block; }
.event .info { display: block; font-size: 12px; opacity: .85; }

@media (min-width: 800px) {
  .day { min-height: 104px; }
  .day .num { align-self: flex-end; padding: 1px 6px; }
  .chips { display: block; max-height: none; overflow: visible; }
  .chip { width: auto; height: auto; border-radius: 3px; font-size: 12px; line-height: 16px; padding: 1px 4px; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chip:hover { filter: brightness(.92); font-weight: 700; }
  .count { display: none; }
}

#overlay { position: fixed; inset: 0; z-index: 10; background: #fff; overflow: auto; overscroll-behavior: contain; }
#sheet { padding: 0 14px calc(24px + env(safe-area-inset-bottom)); }
.sheetHead { position: sticky; top: 0; z-index: 1; display: flex; gap: 10px; align-items: flex-start; background: #fff; padding: calc(10px + env(safe-area-inset-top)) 0 8px; border-bottom: 1px solid #eee; margin-bottom: 8px; }
.sheetHead h2 { flex: 1; margin: 4px 0 0; font-size: 17px; word-break: break-all; }
.sheetHead button { flex: none; }
.dot { display: inline-block; width: 13px; height: 13px; border-radius: 4px; margin-right: 6px; }
@media (min-width: 800px) {
  #overlay { background: rgba(20, 30, 45, .45); display: flex; align-items: flex-start; justify-content: center; padding: 32px 12px; }
  #sheet { width: min(720px, 100%); background: #fff; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.3); padding-bottom: 18px; }
  .sheetHead { position: static; padding-top: 14px; }
}
.content { padding: 8px 0; margin: 8px 0; border-top: 1px solid #eee; border-bottom: 1px solid #eee; overflow-x: auto; word-break: break-word; }
.content img { max-width: 100%; height: auto; }
.content p { margin: 0; }
.link { display: block; word-break: break-all; margin: 6px 0; }
.files { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.file { font-size: 13px; min-height: 34px; border-radius: 17px; background: #f7f9fc; text-align: left; word-break: break-all; }
.comment { border-bottom: 1px solid #f0f0f0; padding: 6px 0; }
.comment .text { white-space: pre-wrap; word-break: break-word; }
.row { display: flex; align-items: center; gap: 8px; }
.commentForm { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.commentForm .row { flex-wrap: wrap; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20; width: max-content; max-width: calc(100% - 24px); padding: 9px 16px; border-radius: 20px; background: #2c3e50; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
#toast.error { background: #c0392b; }
