/* 매장체크 - 화면 스타일 (밝은 바탕, 큰 글씨·큰 버튼, 초록 강조 하나) */
:root {
  color-scheme: only light;
  --scale: 1;
  --fs-base: calc(16px * var(--scale));
  --fs-small: calc(14px * var(--scale));
  --fs-tiny: calc(12.5px * var(--scale));
  --fs-large: calc(19px * var(--scale));
  --fs-title: calc(21px * var(--scale));
  --fs-hero: calc(26px * var(--scale));
  --tap: 48px;

  --bg: #F4F6F5;
  --surface: #FFFFFF;
  --surface-2: #F6F8F7;
  --line: #E7EBE9;
  --hair: rgba(40, 60, 52, 0.12);
  --text: #16211C;
  --muted: #7E8B85;
  --accent: #1F9D76;
  --accent-dark: #16805F;
  --accent-soft: #E6F5EF;
  --danger: #D6455C;
  --danger-soft: #FCEDEF;
  --warn: #C9820F;
  --warn-soft: #FFF5E2;
  --info: #4C6FD6;
  --info-soft: #EBF0FD;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(20,40,32,.04), 0 6px 20px rgba(20,40,32,.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: var(--fs-base); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: var(--fs-base); line-height: 1.45; letter-spacing: -0.01em;
  word-break: keep-all; overflow-wrap: anywhere; overscroll-behavior-y: contain;
  -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.02em; }
h2 { font-size: var(--fs-large); font-weight: 800; }
h3 { font-size: var(--fs-base); font-weight: 700; }
ul { list-style: none; margin: 0; padding: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
:focus-visible { outline: 3px solid rgba(31,157,118,.45); outline-offset: 2px; border-radius: 10px; }
svg.ico { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.ico.sm { width: 16px; height: 16px; }

/* ===== 시작 화면 ===== */
.gate { position: fixed; inset: 0; background: var(--bg); z-index: 50; overflow: auto; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
.gate-inner { max-width: 420px; margin: 8vh auto 0; }
.gate-logo { font-size: var(--fs-hero); font-weight: 800; letter-spacing: -0.03em; }
.gate-logo::before { content: "✓"; color: var(--accent); margin-right: 8px; }
.gate-sub { color: var(--muted); margin: 6px 0 28px; }
.gate-step { display: flex; flex-direction: column; gap: 10px; }
.gate-hello { font-size: var(--fs-large); font-weight: 700; margin-bottom: 4px; }
.gate-msg { color: var(--danger); min-height: 1.4em; margin-top: 12px; font-size: var(--fs-small); }
.gate-msg.hint { color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.field > span { font-size: var(--fs-small); font-weight: 700; color: var(--muted); }
.field input, .field textarea, .field select {
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 14px; min-height: var(--tap); width: 100%;
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); outline: none; }

/* ===== 버튼 ===== */
.btn {
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 12px 16px; min-height: var(--tap); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.big { width: 100%; font-size: var(--fs-large); padding: 15px 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-dark); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }
.btn.sm { padding: 8px 12px; min-height: 38px; font-size: var(--fs-small); border-radius: 10px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.row-btns .btn { flex: 1; min-width: 120px; }

/* ===== 상단바 ===== */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 14px 8px; background: rgba(244,246,245,.92);
  backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--hair);
}
.store-pick { display: inline-flex; align-items: center; gap: 4px; background: none; border: 0; font-weight: 800; font-size: var(--fs-large); padding: 4px 2px; }
.who { color: var(--muted); font-size: var(--fs-small); font-weight: 600; }
.banner { padding: 10px 14px; background: var(--warn-soft); color: var(--warn); font-size: var(--fs-small); text-align: center; }
.banner.demo { background: var(--info-soft); color: var(--info); }

/* ===== 화면 공통 ===== */
main { padding: 12px 14px calc(90px + env(safe-area-inset-bottom)); max-width: 680px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 10px; }
.card h3 { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.empty { text-align: center; color: var(--muted); padding: 40px 12px; line-height: 1.7; }
.sub-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sub-head h2 { flex: 1; }
.back-btn { background: none; border: 0; padding: 6px; margin-left: -6px; color: var(--text); }
.head-act { background: var(--accent-soft); color: var(--accent-dark); border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 700; }
.ver { text-align: center; color: var(--muted); font-size: var(--fs-tiny); padding: 18px 0 4px; }

/* ===== 히어로 / 진행률 ===== */
.hero { padding: 6px 2px 14px; }
.hero-date { color: var(--muted); font-size: var(--fs-small); font-weight: 700; }
.hero-title { font-size: var(--fs-hero); font-weight: 800; margin: 2px 0 12px; }
.progress-wrap { display: flex; align-items: center; gap: 10px; }
.progress { flex: 1; height: 12px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 99px; transition: width .35s ease; }
.progress-text { font-weight: 800; font-variant-numeric: tabular-nums; }
.late-note { margin-top: 10px; background: var(--danger-soft); color: var(--danger); border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: var(--fs-small); }
.today-focus { margin: 0 0 12px; padding: 14px; background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius); }
.today-focus-kicker, .today-focus-meta { color: var(--muted); font-size: var(--fs-tiny); font-weight: 700; }
.today-focus-title { margin: 5px 0; font-size: var(--fs-large); font-weight: 800; }
.today-focus-action { margin-top: 10px; min-height: 42px; padding: 8px 14px; border: 0; border-radius: 10px; color: #fff; background: var(--accent); font-weight: 800; }
.today-board { margin-bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.today-board-row { display: block; width: 100%; padding: 11px 13px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; font-size: var(--fs-small); line-height: 1.45; }
.today-board-row:last-child { border-bottom: 0; }
button.today-board-row { font-weight: 700; }
.today-categories { display: flex; gap: 7px; overflow-x: auto; padding: 0 1px 8px; scrollbar-width: none; }
.today-categories::-webkit-scrollbar { display: none; }
.today-cat { flex: none; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); padding: 8px 11px; color: var(--text); font-size: var(--fs-tiny); font-weight: 800; white-space: nowrap; }

/* ===== 업무 카드 ===== */
.group-title { font-size: var(--fs-small); font-weight: 800; color: var(--muted); margin: 12px 2px 2px; display: flex; align-items: center; gap: 6px; }
.task {
  display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow); border: 1.5px solid transparent; text-align: left; width: 100%;
}
.task.late { border-color: #F3C9D0; }
.task.done { background: var(--surface-2); box-shadow: none; }
.task-tick {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.task.done .task-tick { background: var(--accent); border-color: var(--accent); }
.task-tick svg { width: 18px; height: 18px; stroke-width: 3; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 700; }
.task-note { margin-top: 3px; color: var(--muted); font-size: var(--fs-tiny); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task.done .task-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.task-meta { font-size: var(--fs-tiny); color: var(--muted); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.task-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; background: var(--surface-2); }
.tag { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 99px; font-size: var(--fs-tiny); font-weight: 700; background: var(--surface-2); color: var(--muted); }
.tag.photo { background: var(--info-soft); color: var(--info); }
.tag.memo { background: var(--warn-soft); color: var(--warn); }
.tag.late { background: var(--danger-soft); color: var(--danger); }
.tag.on { background: var(--accent-soft); color: var(--accent-dark); }
.tag.blocked { background: var(--warn-soft); color: var(--warn); }
.tag.redo { background: var(--danger); color: #fff; }
.task.redo { border-color: var(--danger); }
.task.blocked .task-tick { border-style: dashed; border-color: var(--warn); }
.task-reason { font-size: var(--fs-small); color: var(--warn); margin-top: 4px; }
.task.redo .task-reason { color: var(--danger); }

/* ===== 이력 / 기준 사진 ===== */
.hist { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.hist-row { display: flex; gap: 10px; font-size: var(--fs-tiny); color: var(--muted); align-items: flex-start; }
.hist-row b { color: var(--text); font-weight: 700; flex: none; }
.hist-row img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: none; }
.ref-photo { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border-radius: 12px; padding: 8px 10px; }
.ref-photo img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; }
.ref-photo span { font-size: var(--fs-small); color: var(--muted); font-weight: 700; }
.summary-btn { width: 100%; margin-bottom: 12px; }
.close-review-btn { width: 100%; margin-bottom: 12px; min-height: 50px; font-weight: 800; }
.close-review-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; padding: 12px 2px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; color: var(--text); }
.close-review-item-title { font-weight: 700; }
.close-review-item-meta { color: var(--muted); font-size: var(--fs-tiny); }
.btn.warn { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-soft); }

/* ===== 세그먼트 ===== */
.seg { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.seg-btn { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 10px 8px; font-weight: 700; color: var(--muted); min-height: 42px; }
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ===== 공지 / 인계 ===== */
.post { background: var(--surface); border-radius: var(--radius); padding: 15px; box-shadow: var(--shadow); }
.post.important { border-left: 4px solid var(--danger); }
.post.handoff { background: #FFFDF0; }
.post-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.post-title { font-weight: 800; flex: 1; }
.post-when { font-size: var(--fs-tiny); color: var(--muted); flex: none; }
.post-body { white-space: pre-wrap; line-height: 1.6; }
.post-photo { margin-top: 10px; width: 100%; max-height: 260px; object-fit: cover; border-radius: 12px; }
.post-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.post-from { font-size: var(--fs-small); color: var(--muted); font-weight: 600; }
.ack-btn { background: var(--accent-soft); color: var(--accent-dark); border: 0; border-radius: 10px; padding: 9px 14px; font-weight: 800; min-height: 40px; }
.ack-btn.done { background: var(--surface-2); color: var(--muted); }
.ack-who { font-size: var(--fs-tiny); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--line); background: var(--surface); border-radius: 99px; padding: 8px 14px; font-weight: 700; font-size: var(--fs-small); min-height: 40px; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

/* ===== 현황 ===== */
.dash-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.dash-date { color: var(--muted); font-size: var(--fs-small); font-weight: 700; }
.donut-card { display: flex; align-items: center; gap: 18px; }
.donut { position: relative; width: 120px; height: 120px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut-bg { fill: none; stroke: var(--line); stroke-width: 12; }
.donut-arc { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 314; stroke-dashoffset: 314; transition: stroke-dashoffset .5s ease; }
.donut-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-title); font-weight: 800; }
.donut-num i { font-style: normal; font-size: var(--fs-small); margin-left: 1px; }
.donut-side { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.side-row { display: flex; align-items: center; gap: 8px; font-size: var(--fs-small); }
.side-row .lbl { width: 62px; color: var(--muted); font-weight: 700; flex: none; }
.side-row .bar { flex: 1; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.side-row .bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.side-row .num { font-variant-numeric: tabular-nums; font-weight: 700; width: 44px; text-align: right; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bars .side-row .lbl { width: 96px; }
.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.mini-row:first-child { border-top: 0; }
.mini-row .m-main { flex: 1; min-width: 0; }
.mini-row .m-title { font-weight: 600; }
.mini-row .m-sub { font-size: var(--fs-tiny); color: var(--muted); margin-top: 2px; }
.badge { background: var(--danger-soft); color: var(--danger); border-radius: 99px; padding: 1px 9px; font-size: var(--fs-tiny); font-weight: 800; }
.badge.ok { background: var(--accent-soft); color: var(--accent-dark); }
.feed { display: flex; flex-direction: column; }
.feed-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.feed-row:first-child { border-top: 0; }
.feed-when { font-size: var(--fs-tiny); color: var(--muted); width: 58px; flex: none; }
.feed-main { flex: 1; min-width: 0; }
.feed-who { font-size: var(--fs-tiny); color: var(--muted); }
.trend { display: flex; align-items: flex-end; gap: 8px; height: 110px; padding-top: 8px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend-bar { width: 100%; background: var(--accent-soft); border-radius: 8px 8px 4px 4px; position: relative; min-height: 4px; }
.trend-bar i { position: absolute; inset: auto 0 0 0; background: var(--accent); border-radius: 8px 8px 4px 4px; }
.trend-lbl { font-size: var(--fs-tiny); color: var(--muted); }
.trend-val { font-size: var(--fs-tiny); font-weight: 700; }

/* ===== 설정 ===== */
.me-card { display: flex; align-items: center; gap: 12px; }
.me-name { font-size: var(--fs-large); font-weight: 800; flex: 1; }
.me-role { background: var(--accent-soft); color: var(--accent-dark); border-radius: 99px; padding: 4px 12px; font-size: var(--fs-small); font-weight: 700; }
.menu { margin-top: 10px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: 0; border-top: 1px solid var(--line); padding: 16px; text-align: left; font-weight: 600; min-height: var(--tap); }
.menu-item:first-child { border-top: 0; }
.menu-item .m-arrow { margin-left: auto; color: var(--muted); }
.menu-item .m-note { color: var(--muted); font-size: var(--fs-small); font-weight: 500; margin-left: auto; }
.invite-card { text-align: center; }
.invite-label { font-size: var(--fs-small); color: var(--muted); font-weight: 700; }
.invite-code { font-size: calc(30px * var(--scale)); font-weight: 800; letter-spacing: .12em; color: var(--accent-dark); margin: 6px 0 8px; }

/* ===== 탭바 ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex;
  background: rgba(255,255,255,.96); backdrop-filter: saturate(140%) blur(8px);
  border-top: 1px solid var(--hair); padding-bottom: env(safe-area-inset-bottom);
}
.tab { flex: 1; background: none; border: 0; padding: 9px 4px 7px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: var(--fs-tiny); font-weight: 700; min-height: 58px; }
.tab.on { color: var(--accent-dark); }
.tab .dot { position: absolute; transform: translate(13px, -4px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* ===== FAB ===== */
.fab {
  position: fixed; right: 18px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 21;
  width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--accent); color: #fff;
  box-shadow: 0 6px 20px rgba(31,157,118,.4); display: flex; align-items: center; justify-content: center;
}
.fab svg { width: 26px; height: 26px; stroke-width: 2.4; }

/* ===== 바텀 시트 ===== */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; }
.sheet-dim { position: absolute; inset: 0; background: rgba(12,26,20,.42); animation: fade .18s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface);
  border-radius: 22px 22px 0 0; max-height: 92vh; overflow: auto; animation: up .22s ease;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}
@media (min-width: 560px) { .sheet { max-width: 520px; margin: 0 auto; border-radius: 22px; bottom: 4vh; } }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(24px); opacity: .6 } }
.sheet-grip { width: 40px; height: 4px; background: var(--line); border-radius: 99px; margin: 10px auto 4px; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 6px 18px 4px; }
.sheet-head h2 { flex: 1; }
.sheet-x { background: none; border: 0; color: var(--muted); padding: 6px; }
.sheet-body { padding: 10px 18px 4px; display: flex; flex-direction: column; gap: 12px; }
.sheet-note { color: var(--muted); font-size: var(--fs-small); }
.photo-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.photo-pick img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; }
.photo-btn { width: 96px; height: 96px; border-radius: 12px; border: 2px dashed var(--line); background: var(--surface-2); color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: var(--fs-tiny); font-weight: 700; }

/* ===== 토스트 ===== */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #16211C; color: #fff; padding: 12px 18px; border-radius: 99px; z-index: 60;
  font-weight: 700; font-size: var(--fs-small); box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 88vw; text-align: center;
}
