/* 직원 보드 (2026-10-16) — 메인 보드 리더 테마 색을 빌린 단독 시트. 폰 우선, PC 는 가운데 640px.
 * 색 규칙: 포인트(코발트) 하나 + 회색. 빨강은 「긴급」에만 쓴다(늦음은 회색 — 벌 주지 않기). */
:root {
  --paper: #fbf9f3; --sheet: #f1eee6; --field: #fffefa;
  --ink: #1d2150; --ink-2: #4c5078; --ink-3: #8f93b5; --line: #dcdae0;
  --accent: #3456e6; --accent-soft: #e6e9f8; --on-accent: #fffdf8;
  --urgent: #e0442a; --urgent-soft: #fdebe6;
  --tab-h: 62px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px; line-height: 1.5;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 20px);
}
a { color: var(--accent); }
button, input, textarea, select { font: inherit; color: inherit; }
input, textarea, select { font-size: 16px; }   /* iOS 확대 방지 */
.dim { color: var(--ink-3); font-size: 14px; }

/* 머리 */
.top { display: flex; align-items: center; gap: 12px; max-width: 640px; margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 12px; }
.who-box { flex: 1; display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.who { font-weight: 700; font-size: 20px; }
.today { color: var(--ink-2); font-size: 15px; }
.doc-btn { border: 1px solid var(--ink-3); background: var(--field); border-radius: 18px; padding: 6px 14px;
  font-size: 14px; color: var(--ink-2); cursor: pointer; min-height: 36px; }
main { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* 탭 — 폰: 아래 두 칸 / PC: 머리 밑 */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
  background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--tab-h); text-decoration: none; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--accent); }
@media (min-width: 900px) {
  body { padding-bottom: 40px; }
  .tabs { position: static; max-width: 640px; margin: 0 auto; border-top: 0; border-bottom: 1px solid var(--line); padding: 0 16px; gap: 6px; }
  .tabs a { flex: none; flex-direction: row; height: 44px; padding: 0 14px; font-size: 15px; }
  .tabs svg { width: 18px; height: 18px; }
  .tabs a.on { box-shadow: inset 0 -2px 0 var(--accent); }
}

/* 공통 */
.sec-h { display: flex; align-items: center; gap: 8px; margin: 22px 0 4px; font-weight: 700; font-size: 17px; }
.sec-h .n { color: var(--ink-3); font-weight: 600; font-size: 15px; }
.sec-h .push { margin-left: auto; }
.empty { color: var(--ink-3); padding: 12px 2px; margin: 0; }
.ro { margin: 16px 0 4px; padding: 10px 12px; background: var(--sheet); border-radius: 10px; font-size: 14px; color: var(--ink-2); }
.btn { border: 1px solid var(--ink-3); background: var(--field); border-radius: 10px; padding: 8px 14px;
  min-height: 40px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.sm { min-height: 34px; padding: 4px 12px; font-size: 14px; }
.btn.ghost { border-color: transparent; background: none; color: var(--accent); }
.btn.danger { color: var(--urgent); }
.btn.big { width: 100%; min-height: 52px; font-size: 17px; margin-top: 16px; border-radius: 12px; }
.btn.wide { width: 100%; margin-top: 6px; }
.nav { width: 40px; height: 40px; border: 0; background: none; font-size: 24px; color: var(--ink-2); cursor: pointer; border-radius: 20px; }
.nav:active { background: var(--sheet); }

/* ① 이번 주 스트립 */
.strip { margin-top: 4px; }
.strip-head { display: flex; align-items: center; gap: 4px; }
.strip-head .wk { flex: 1; text-align: center; font-weight: 700; font-size: 15px; color: var(--ink-2); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day { border: 0; background: var(--field); border-radius: 12px; padding: 8px 0 7px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 72px; box-shadow: inset 0 0 0 1px var(--line); }
.day .dw { font-size: 12px; color: var(--ink-3); }
.day .dn { font-size: 18px; font-weight: 700; }
.day.sun .dw { color: var(--urgent); }
.day.today { background: var(--accent); box-shadow: none; }
.day.today .dw, .day.today .dn { color: var(--on-accent); }
.day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.day.today.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.dots { display: flex; gap: 3px; height: 8px; align-items: center; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }
.dot.late { background: var(--ink-2); }
.dot.done { background: var(--ink-3); opacity: .5; }
.day.today .dot { background: var(--on-accent); }
.day.today .dot.done { opacity: .55; }
.daypanel { margin-top: 10px; padding: 2px 12px 6px; background: var(--field); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.daypanel .sec-h { margin-top: 10px; }

/* ② 빠른 입력 */
.quick { margin-top: 16px; }
.quick-row { display: flex; gap: 8px; }
.quick-when { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding-left: 4px; }
.quick-when select { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; background: var(--field); font-size: 14px; }
.quick-when input[type=date] { border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; background: var(--field); font-size: 14px; }
.quick-when input[hidden] { display: none; }
.quick input[type=text] { flex: 1; min-width: 0; border: 1px dashed var(--ink-3); border-radius: 12px; padding: 11px 14px; background: var(--field); }
.quick input:focus { outline: none; border-style: solid; border-color: var(--accent); }
.quick .btn { min-width: 64px; }

/* ③ 묶음·줄 */
.grp .sec-h { margin-top: 24px; }
.prog { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-weight: 600; }
.prog .bar { width: 90px; height: 8px; border-radius: 4px; background: var(--sheet); overflow: hidden; }
.prog .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s ease; }
.prog .pn { font-size: 14px; color: var(--ink-2); }
.cheer { padding: 20px 0; text-align: center; font-size: 20px; font-weight: 700; color: var(--accent); }

.row { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.chk { flex: none; width: 44px; height: 44px; margin: -4px 0 -4px -4px; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center; }
.chk .tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink-3); display: grid; place-items: center;
  color: transparent; font-size: 16px; font-weight: 700; transition: background .2s, border-color .2s, transform .2s; }
.chk:hover .tick { border-color: var(--accent); }
.row.urgent .chk .tick { border-color: var(--urgent); }
.row.checking .chk .tick, .row.done .chk .tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.row.checking .chk .tick { transform: scale(1.15); }
.row.checking .body { opacity: .45; transition: opacity .3s; }
.row.done .chk .tick { background: var(--ink-3); border-color: var(--ink-3); }
.row .body { flex: 1; min-width: 0; cursor: pointer; }
.row .title { font-weight: 600; font-size: 17px; line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.row.done .title { color: var(--ink-3); text-decoration: line-through; font-weight: 500; font-size: 16px; }
.urg { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 6px; background: var(--urgent); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 20px; vertical-align: 2px; }
.new { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 700; line-height: 20px; vertical-align: 2px; }
.when { margin-top: 3px; font-size: 14px; color: var(--ink-3); }
.when.late { color: var(--ink-2); font-weight: 600; }
.desc { margin-top: 6px; font-size: 15px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.desc.full { display: block; }
.report { margin-top: 6px; font-size: 14px; background: var(--sheet); padding: 6px 10px; border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

details.fold { margin-top: 14px; border-top: 1px solid var(--line); }
details.fold > summary { cursor: pointer; font-weight: 700; padding: 12px 0; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "›"; display: inline-block; width: 14px; font-size: 20px; line-height: 1; transition: transform .2s; color: var(--ink-3); }
details.fold[open] > summary::before { transform: rotate(90deg); }
details.fold > summary .n { color: var(--ink-3); font-weight: 600; }

/* ④ 월 캘린더 */
.month { margin-top: 30px; padding-top: 4px; border-top: 1px solid var(--line); }
.month .sec-h { justify-content: center; margin-top: 10px; }
.month .mt { min-width: 120px; text-align: center; font-size: 16px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal .dow { text-align: center; font-size: 12px; color: var(--ink-3); padding: 4px 0; }
.cal .d { border: 0; background: none; border-radius: 10px; min-height: 44px; padding: 4px 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; }
.cal .d .n { font-size: 15px; }
.cal .d.out { opacity: .35; }
.cal .d.sun .n { color: var(--urgent); }
.cal .d.today .n { background: var(--accent); color: var(--on-accent); border-radius: 12px; padding: 0 7px; font-weight: 700; }
.cal .d.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.legend { display: flex; justify-content: center; gap: 16px; font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.legend .dot { margin-right: 5px; vertical-align: 1px; }

/* 현장 — 단계별 칩 */
.board { margin-top: 18px; }
.co-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; padding-bottom: 8px;
  border-bottom: 2px solid var(--co, var(--ink)); }
.co-h .n { color: var(--ink-3); font-size: 15px; }
.lane { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); align-items: start; }
.lane-name { font-size: 13px; font-weight: 600; color: var(--ink-2); padding-top: 7px; }
.lane.empty { padding: 4px 0; }
.lane.empty .lane-name { color: var(--ink-3); opacity: .6; padding-top: 0; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 18px; background: var(--field);
  box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.3; }
.chip:active { background: var(--accent-soft); }
.mine-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; }
.legend-note { margin-top: 14px; }

/* 현장 페이지 */
.back { display: inline-block; margin-top: 12px; text-decoration: none; font-size: 15px; font-weight: 600; }
.site-title { font-size: 22px; margin: 8px 0 2px; line-height: 1.3; }
.site-sub { color: var(--ink-2); font-size: 14px; }
.stagebar { display: flex; gap: 3px; margin: 14px 0 6px; }
.stagebar span { flex: 1; font-size: 11px; text-align: center; padding: 5px 1px; background: var(--sheet); color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px; }
.stagebar span.past { background: var(--accent-soft); color: var(--ink-2); }
.stagebar span.cur { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.next { margin-top: 14px; padding: 12px 14px; background: var(--accent-soft); border-radius: 12px; font-size: 16px; font-weight: 600; }
.next .lab { font-size: 12px; color: var(--accent); font-weight: 700; margin-bottom: 2px; }
.contact { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.contact .who { flex: 1; display: flex; flex-direction: column; font-size: 16px; }
.btn.call { min-width: 72px; border-color: var(--accent); color: var(--accent); font-weight: 700; }
dl.info { display: grid; grid-template-columns: 6.5em 1fr; gap: 6px 10px; margin: 4px 0 10px; font-size: 15px; }
dl.info dt { color: var(--ink-3); }
dl.info dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.memo { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--field); border-radius: 10px; padding: 10px 12px; font-size: 15px; margin-bottom: 10px; }
.doc { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.doc.col { flex-direction: column; align-items: stretch; gap: 2px; }
.doc .nm { flex: 1; }
.st { font-size: 12px; padding: 1px 8px; border-radius: 8px; background: var(--sheet); color: var(--ink-2); }
.st-approved { background: var(--accent); color: var(--on-accent); }
.st-submitted { background: var(--accent-soft); color: var(--accent); }

/* 안내 띠 (iOS 홈 화면 추가) */
.hint { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 10px 12px; background: var(--accent-soft); border-radius: 12px; font-size: 14px; }
.hint span { flex: 1; }
.hint .x { border: 0; background: none; font-size: 22px; color: var(--ink-2); cursor: pointer; width: 32px; height: 32px; }

/* 시트 */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(29,33,80,.35); display: flex; align-items: flex-end; justify-content: center; }
.sheet-wrap[hidden] { display: none; }
.sheet { width: 100%; max-width: 520px; background: var(--paper); border-radius: 20px 20px 0 0;
  padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; animation: up .2s ease; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
@media (min-width: 600px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 20px; } }
.sheet h3 { margin: 0 0 4px; font-size: 20px; }
.sheet-ok { font-size: 22px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.sheet .sub { color: var(--ink-2); font-size: 15px; margin-bottom: 4px; }
.sheet .lab { display: block; font-size: 14px; color: var(--ink-2); margin: 16px 0 6px; font-weight: 600; }
.sheet input[type=text], .sheet input[type=date], .sheet textarea, .sheet select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--ink-3); border-radius: 10px; background: var(--field); }
.sheet textarea { resize: vertical; }
.sheet .err { color: var(--urgent); font-size: 14px; margin-top: 8px; min-height: 1em; }
.sheet .dim { margin: 12px 0 0; }
.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.choice { text-align: left; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); cursor: pointer; font-size: 16px; }
.choice.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); font-weight: 700; }
.urg-toggle { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--urgent-soft); cursor: pointer; font-weight: 600; }
.urg-toggle input { width: 22px; height: 22px; accent-color: var(--urgent); }
.row-btns { display: flex; justify-content: space-between; margin-top: 8px; }

/* 토스트 */
.toast { position: fixed; left: 16px; right: 16px; margin: 0 auto; max-width: 480px; z-index: 60;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px); background: var(--ink); color: var(--paper);
  padding: 13px 16px; border-radius: 12px; display: flex; gap: 14px; align-items: center; justify-content: space-between; font-size: 15px;
  box-shadow: 0 6px 20px rgba(29,33,80,.25); }
.toast[hidden] { display: none; }
.toast button { background: none; border: 0; color: #b9c6ff; font-weight: 700; cursor: pointer; padding: 4px 0; font-size: 15px; white-space: nowrap; flex: none; }
@media (min-width: 900px) { .toast { bottom: 24px; } }

.gate { max-width: 420px; margin: 80px auto; text-align: center; }
.gate h1 { font-size: 22px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── 2026-10-16 밤 2차: 확인 팝업 · 현장 카드 · 공휴일 · 오프라인 */
.tiny { font-size: 12px; margin-top: 4px; }
.ack-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ack-kind { display: inline-block; padding: 4px 12px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px; }
.ack-kind.urg { background: var(--urgent-soft); color: var(--urgent); }
.ack-title { font-size: 22px; font-weight: 800; line-height: 1.35; word-break: keep-all; overflow-wrap: anywhere; }
.ack-when { margin-top: 6px; color: var(--ink-2); font-size: 15px; }
.ack-note { margin-top: 14px; padding: 12px 14px; background: var(--field); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0;
  font-size: 17px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.day .dw.hol { color: var(--urgent); font-size: 11px; }
.day.sat .dw { color: var(--accent); }
.offline { position: sticky; top: 0; z-index: 30; background: var(--ink); color: var(--paper); text-align: center; padding: 8px 12px; font-size: 14px; }

.kanban { display: flex; flex-direction: column; gap: 4px; }
.lane { display: block; padding: 10px 0 6px; border-bottom: 0; }
.lane-name { display: flex; align-items: center; gap: 6px; padding: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); border-bottom: 2px solid var(--line); }
.lane-name .n { color: var(--ink-3); font-weight: 600; }
.lane.empty { padding: 4px 0; }
.lane.empty .lane-name { border-bottom: 1px dashed var(--line); color: var(--ink-3); font-weight: 500; opacity: .7; }
.scard { display: block; margin-top: 8px; padding: 12px 14px; background: var(--field); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line);
  text-decoration: none; color: var(--ink); }
.scard:active { background: var(--accent-soft); }
.scard-t { display: flex; align-items: center; gap: 8px; }
.scard-t .nm { flex: 1; font-weight: 700; font-size: 17px; line-height: 1.35; word-break: keep-all; }
.scard-m { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.tag { display: inline-block; padding: 0 7px; border-radius: 6px; background: var(--sheet); font-size: 12px; font-weight: 600; line-height: 20px; color: var(--ink-2); }
.tag.over { background: var(--urgent-soft); color: var(--urgent); }
.tag.soon { background: var(--accent-soft); color: var(--accent); }
.scard-next { margin-top: 6px; font-size: 14px; color: var(--ink-2); }
@media (min-width: 900px) {
  /* 현장이 많은 단계(진행)가 넓게 — 칸 너비 = 현장 수 비율, 칸 안에서 카드가 옆으로 */
  body[data-tab="sites"] main, body[data-tab="sites"] .top, body[data-tab="sites"] .tabs { max-width: 1000px; }
  .kanban { display: flex; flex-direction: row; gap: 12px; align-items: flex-start; }
  .lane { padding: 0; flex: var(--w, 1) 1 0; min-width: 160px; }
  .lane.empty { display: none; }
  .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
  .scard { margin-top: 0; }
  .cards { margin-top: 8px; }
}
.hint.push { gap: 8px; }
.push-set { align-items: center; }
.urg-toggle.soft { background: var(--sheet); font-weight: 500; }

/* 2026-10-16 밤: 날짜 칸 — iOS 기본 모양(가운데 정렬·낮은 높이·옆으로 삐져나옴)을 다른 칸과 맞춤 */
.sheet input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%;
  min-height: 46px; line-height: 22px; text-align: left; }
.sheet input[type=date]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.sheet input[type=date]::-webkit-calendar-picker-indicator { margin: 0 0 0 auto; opacity: .6; }

/* 2026-10-16 밤: 알림 종 버튼(업무일지 왼쪽) — 켜지면 포인트 색으로 채움 */
.bell-btn { flex: none; width: 36px; height: 36px; border: 1px solid var(--ink-3); background: var(--field); border-radius: 18px;
  display: grid; place-items: center; color: var(--ink-2); cursor: pointer; padding: 0; }
.bell-btn[hidden] { display: none; }
.bell-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell-btn.on { color: var(--accent); border-color: var(--accent); }
.bell-btn.on svg { fill: var(--accent-soft); }
.top { gap: 8px; }
