:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #1f2937;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --pos: #059669;
  --neg: #dc2626;
  --warn: #d97706;
  --kakao: #fee500;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 2px 8px rgba(0,0,0,.04);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, system-ui, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45;
}
body.noscroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.grow { flex: 1; }
.row { display: flex; align-items: center; }
.row.gap { gap: 8px; }
.row.center { justify-content: center; }
.row.end { justify-content: flex-end; margin-top: 8px; }
.pos { color: var(--pos); }
.neg { color: var(--neg) !important; }

/* ---------- 로그인 ---------- */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { background: var(--card); border-radius: 20px; padding: 36px 28px; width: 100%; max-width: 360px; text-align: center; box-shadow: var(--shadow); }
.login-card h1 { margin: 12px 0 4px; font-size: 22px; }
.logo { width: 64px; height: 64px; border-radius: 18px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; margin: 0 auto; font-size: 20px; }
.kakao-btn { margin: 28px 0 14px; width: 100%; background: var(--kakao); color: #000; border-radius: 12px; padding: 14px; font-weight: 600; display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 16px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 레이아웃 ---------- */
.app { max-width: 920px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(244,245,247,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 800; letter-spacing: -.3px; white-space: nowrap; }
.demo-switch, .demo-switch * { white-space: nowrap; }
@media (max-width: 480px) {
  .topbar { gap: 6px; padding: 10px 12px; }
  .brand span, .me-name { display: none; }
}
.brand span { font-weight: 500; color: var(--muted); }
.me { display: flex; align-items: center; gap: 6px; }
.me-name { font-size: 13px; font-weight: 600; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { padding: 12px 16px; }
.icon-btn { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; color: var(--muted); }
.icon-btn:hover { background: var(--line); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-weight: 700; object-fit: cover; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }

.demo-switch { display: flex; align-items: center; gap: 2px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 999px; padding: 2px; font-size: 12px; }
.demo-switch span { padding: 0 6px; color: var(--warn); font-weight: 700; }
.demo-switch button { padding: 3px 10px; border-radius: 999px; }
.demo-switch button.on { background: var(--warn); color: #fff; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: center; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar button { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; padding: 8px 0 10px; font-size: 11.5px; color: var(--muted); }
.tabbar button.on { color: var(--text); font-weight: 700; }
.tabbar .ic { font-size: 20px; position: relative; filter: grayscale(1); opacity: .6; }
.tabbar button.on .ic { filter: none; opacity: 1; }
.dot { position: absolute; top: -2px; right: -10px; background: var(--neg); color: #fff; font-style: normal; font-size: 10px; border-radius: 999px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }

/* ---------- 툴바 / 칩 ---------- */
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.search, .month { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; outline: none; }
.search:focus { border-color: var(--accent); }
.month { width: auto; font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.chip { padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; white-space: nowrap; text-decoration: none; color: var(--text); }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip.sm { padding: 1px 8px; font-size: 11.5px; }
.chip.link { color: var(--accent); background: var(--accent-soft); border-color: transparent; font-size: 12.5px; padding: 4px 10px; }
.links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; }
.links-label { font-size: 12px; color: var(--muted); }

.alert { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; font-size: 13.5px; }
.alert.info { background: var(--accent-soft); border-color: #c7d2fe; color: #3730a3; cursor: pointer; }

/* ---------- 그룹 / 카드 ---------- */
.group { margin-bottom: 18px; }
.group-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.group-title { flex: 1; font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 6px; padding: 6px 0; }
.caret { display: inline-block; transition: transform .15s; color: var(--muted); font-size: 12px; }
.caret.open { transform: rotate(90deg); }
.mini-btn { font-size: 12.5px; padding: 5px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line); white-space: nowrap; }
.mini-btn:hover { border-color: #cbd5e1; }
.item-list { display: grid; gap: 8px; }
@media (min-width: 720px) { .item-list { grid-template-columns: 1fr 1fr; } }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.item { display: flex; gap: 12px; padding: 10px; width: 100%; align-items: stretch; transition: transform .1s; }
.card.item:active { transform: scale(.99); }
.thumb { width: 84px; height: 84px; border-radius: 10px; background: var(--bg); flex: none; overflow: hidden; position: relative; display: grid; place-items: center; font-size: 26px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .cnt { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 10.5px; padding: 0 5px; border-radius: 6px; }
.item-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.item-info .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nums { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--muted); align-items: center; margin-top: auto; }
.nums b { color: var(--text); font-weight: 600; }

.badges { display: flex; gap: 4px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; display: inline-block; }
.st-draft { background: #fef3c7; color: #92400e; }
.st-listed { background: #dbeafe; color: #1e40af; }
.st-sold { background: #d1fae5; color: #065f46; }
.st-returned { background: #f3f4f6; color: #4b5563; }
.dday { background: #f3f4f6; color: var(--muted); }
.dday-warn { background: #ffedd5; color: #c2410c; }
.dday-over { background: #fee2e2; color: #b91c1c; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }
.empty.small { padding: 16px; font-size: 13px; }

.fab-wrap { position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 15; display: flex; gap: 8px; }
@media (min-width: 952px) { .fab-wrap { right: calc(50% - 444px); } }
.fab { background: var(--primary); color: #fff; padding: 13px 18px; border-radius: 999px; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.fab.ghost { background: #fff; color: var(--text); }

/* ---------- 통계 / 표 ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 12.5px; color: var(--muted); }
.stat b { font-size: 18px; }
.stat small { font-size: 11.5px; color: var(--muted); }
.stat.accent { background: var(--primary); color: #fff; }
.stat.accent span, .stat.accent small { color: #cbd5e1; }
.table, .panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel { margin-bottom: 14px; padding-bottom: 4px; }
.panel > .grid2, .panel > .field, .panel > .admin-box, .panel > .row { margin-left: 14px; margin-right: 14px; }
.panel > .row.end { margin-bottom: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 6px; }
.panel-head h3 { margin: 0; font-size: 15px; }
.trow { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); width: 100%; }
.table .trow:first-child { border-top: 0; }
.t-main { flex: 1; min-width: 0; text-align: left; }
.t-main .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-num { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }

/* ---------- 버튼 ---------- */
.btn { padding: 10px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--line); font-weight: 600; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--neg); border-color: transparent; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; }
select.sm { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; }

/* ---------- 모달 ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(17,24,39,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--bg); width: 100%; max-width: 560px; max-height: 94vh; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; animation: up .2s ease-out; }
.modal.wide { max-width: 720px; }
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
@media (min-width: 720px) { .modal-bg { align-items: center; } .modal { border-radius: 20px; max-height: 90vh; } }
.modal-head { display: flex; align-items: center; padding: 14px 16px 10px; gap: 8px; }
.modal-head h2 { flex: 1; margin: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-body { overflow-y: auto; padding: 0 16px 16px; flex: 1; overscroll-behavior: contain; }
.modal-foot { display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; border-radius: 0 0 20px 20px; }
.sheet-status { margin-bottom: 10px; }

.sec { background: var(--card); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.sec h3 { margin: 0 0 10px; font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sec h3 em, .field-label em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; }
.sec h3 .mini-btn { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.sec.grid2 { gap: 0 10px; }
@media (max-width: 380px) { .grid2 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-width: 0; }
.field-label { font-size: 12.5px; font-weight: 600; color: #374151; }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; outline: none; min-width: 0;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ro { padding: 10px 12px; border-radius: 10px; background: var(--bg); white-space: pre-wrap; word-break: break-word; min-height: 42px; flex: 1; }
.ro.muted { color: #9ca3af; }
.ro.strong { font-weight: 700; }
.pct { display: flex; align-items: center; gap: 4px; width: 84px; flex: none; }
.pct input { text-align: right; padding-right: 6px; }
.pct-ro { font-weight: 600; color: var(--muted); padding: 0 4px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 4px; flex-wrap: wrap; }
.check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.inline-date { padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); }
.seg { display: flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; padding: 7px 0; border-radius: 8px; text-align: center; font-weight: 600; color: var(--muted); }
.seg button.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }

.admin-box { background: #fafaff; border: 1px dashed #c7d2fe; }
.panel .admin-box { border-radius: 12px; padding: 10px 12px 0; margin-bottom: 10px; }
.calc-rows > div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.calc-rows span { color: var(--muted); }
.calc-rows .total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.calc-rows .total span { color: var(--text); font-weight: 700; }
.calc-rows .total b { font-size: 16px; }
.calc-rows .sub { padding-left: 10px; font-size: 13px; }
.calc-rows .admin-line { background: #fafaff; margin: 0 -8px; padding: 6px 8px; }
.calc-rows .admin-line:first-of-type { margin-top: 8px; border-top: 1px dashed #c7d2fe; }

/* ---------- 사진 ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg); }
.ph img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.ph.main { outline: 2px solid var(--accent); outline-offset: -2px; }
.ph-tag { position: absolute; left: 4px; top: 4px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.ph-btn { position: absolute; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; display: grid; place-items: center; }
.ph-btn.del { right: 4px; }
.ph-btn.star { left: 4px; color: #fde68a; }
.ph.add { border: 1.5px dashed #cbd5e1; display: grid; place-items: center; text-align: center; color: var(--muted); font-size: 12px; background: #fff; }
.ph.add b { font-size: 22px; color: var(--text); }

.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.lightbox img { max-width: 100vw; max-height: 88vh; object-fit: contain; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 40px; width: 52px; height: 80px; }
.lb-nav.l { left: 0; } .lb-nav.r { right: 0; }
.lb-close { position: absolute; top: 12px; right: 12px; color: #fff; font-size: 22px; width: 44px; height: 44px; }
.lb-count { position: absolute; bottom: 20px; color: #fff; font-size: 13px; }

.link-like { cursor: pointer; }

/* ---------- 토스트 ---------- */
.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; background: var(--primary); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); max-width: calc(100vw - 32px); animation: fade .2s; }
.toast.error { background: var(--neg); }
.toast.warn { background: var(--warn); }

/* ---------- 추가: 언어 / 설치 / 아이콘 ---------- */
.brand-icon { width: 28px; height: 28px; border-radius: 7px; flex: none; }
.logo-img { width: 72px; height: 72px; border-radius: 18px; display: block; margin: 0 auto; }
.login-card { position: relative; }
.corner { position: absolute; top: 12px; right: 12px; }
.lang-btn { font-size: 12px; font-weight: 700; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--line); background: #fff; white-space: nowrap; }
.install-btn { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 8px; background: #000; color: #fff; white-space: nowrap; }
.install-btn.big { margin-top: 12px; padding: 10px 16px; font-size: 14px; border-radius: 10px; }
@media (max-width: 480px) { .brand { display: none; } }

/* ---------- 추가: 알림 / 배지 ---------- */
.alerts { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.alerts .alert { margin: 0; flex: 1; min-width: 140px; text-align: left; }
.alert.red { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.chip.warn { border-color: #fecaca; color: #b91c1c; }
.chip.warn.on { background: #b91c1c; color: #fff; border-color: #b91c1c; }
.badge.paid { background: #d1fae5; color: #065f46; }
.badge.unpaid { background: #fee2e2; color: #b91c1c; }
.earn { color: var(--pos) !important; }
.earn b { color: var(--pos) !important; }
.admin-text { color: var(--accent) !important; }
.admin-text b { color: var(--accent) !important; }

/* ---------- 추가: 상세 ---------- */
.kv { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; gap: 12px; }
.kv span { color: var(--muted); font-size: 14px; }
.kv.big b { font-size: 20px; }
.sec.confirmed { border: 1.5px solid #a7f3d0; background: #f0fdf4; }
.return-check { margin-top: 10px; padding: 10px 12px; background: var(--bg); border-radius: 10px; }
.admin-box.rates { padding: 10px 12px; margin-bottom: 10px; font-size: 13.5px; font-weight: 600; }
.admin-cell { background: #fafaff; color: var(--accent); }
.pad { padding: 0 14px 10px; margin: 0; }

.proj-wrap { overflow-x: auto; margin: 0 -4px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mini-table th { font-size: 12px; color: var(--muted); font-weight: 600; text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mini-table td { text-align: right; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mini-table th:first-child, .mini-table td:first-child { text-align: left; }
.mini-table tr:last-child td { border-bottom: 0; }
.mini-table tr.sum td { background: var(--bg); font-weight: 600; }
.panel .mini-table th, .panel .mini-table td { padding-left: 14px; padding-right: 14px; }
.mini-input { width: 96px; padding: 6px 8px; border-radius: 8px; border: 1px dashed #cbd5e1; outline: none; }
.mini-input:focus { border-color: var(--accent); border-style: solid; }

.photos.drag { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 10px; }

/* ---------- 추가: 내 정보 ---------- */
.me-card { display: flex; align-items: center; gap: 12px; background: var(--card); padding: 14px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; }
.avatar.lg { width: 48px; height: 48px; font-size: 18px; }
.stats.two { grid-template-columns: 1fr 1fr !important; }
.stats.two .stat b { font-size: 22px; }
.ph-btn.rep { right: 4px; top: auto; bottom: 4px; }
.badge.direct { background: #ede9fe; color: #5b21b6; }
.group.direct { background: #faf5ff; border: 1px dashed #c4b5fd; border-radius: var(--radius); padding: 8px 10px 10px; }
.panel { overflow-x: auto; }
@media (max-width: 480px) {
  .mini-table { font-size: 12.5px; }
  .panel .mini-table th, .panel .mini-table td { padding-left: 8px; padding-right: 8px; }
}

/* ---------- 로그인 ---------- */
.login-fields { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; }
.login-fields input { padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; outline: none; font-size: 16px; }
.login-fields input:focus { border-color: #000; }
.remember { justify-content: flex-start; margin: 12px 2px 0; font-size: 14px; }
.login-btn { width: 100%; margin: 14px 0 10px; padding: 13px; font-size: 16px; background: #000; border-color: #000; }

/* ---------- GCash ---------- */
.gcash-pop-wrap { position: relative; }
.gcash-btn { font-size: 12px; font-weight: 800; padding: 5px 9px; border-radius: 8px; background: #0b5cff; color: #fff; }
.pop-bg { position: fixed; inset: 0; z-index: 30; }
.gcash-pop { position: absolute; right: -60px; top: 38px; z-index: 31; width: 260px; }
.gcash { background: #fff; border: 1.5px solid #bfd3ff; border-radius: 14px; padding: 10px; box-shadow: 0 8px 24px rgba(11,92,255,.12); margin: 8px 0; }
.gcash-head { font-size: 12px; font-weight: 800; color: #0b5cff; margin-bottom: 6px; }
.gcash-row { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 8px 10px; border-radius: 10px; background: #f3f7ff; margin-bottom: 6px; }
.gcash-row b { font-size: 17px; letter-spacing: .5px; }
.gcash-row .nm { font-weight: 700; }
.gcash-row span:last-child { font-size: 12px; color: #0b5cff; font-weight: 700; }
.gcash-all { width: 100%; padding: 8px; border-radius: 10px; background: #0b5cff; color: #fff; font-weight: 700; font-size: 13px; text-align: center; }

/* ---------- 관리: 직원 추가 ---------- */
.pad-x { padding: 0 14px; }
.made-card { margin: 4px 14px 14px; padding: 12px; border-radius: 12px; background: #f0fdf4; border: 1px solid #a7f3d0; }
.made-card pre { font-family: inherit; white-space: pre-wrap; margin: 6px 0 10px; font-size: 13.5px; }
.user-row { flex-wrap: wrap; }
.login-info { margin-top: 3px; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.link-btn { color: var(--accent); font-size: 12.5px; text-decoration: underline; }

/* ---------- 가이드 ---------- */
.guide-seg { margin-bottom: 12px; }
.guide { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.guide-step { display: flex; gap: 12px; align-items: flex-start; background: hsl(var(--h), 85%, 96%); border-radius: 16px; padding: 12px 14px; }
.guide-emoji { font-size: 26px; width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: #fff; border-radius: 14px; box-shadow: var(--shadow); }
.guide-step b { font-size: 15px; }
.guide-step p { margin: 3px 0 0; font-size: 13.5px; color: #374151; line-height: 1.5; }
.guide-foot { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0 4px; }
.menu-btn { font-size: 20px; color: var(--text); }
.menu-pop { position: absolute; right: 0; top: 40px; z-index: 31; background: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 6px; min-width: 190px; }
.menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; font-size: 14.5px; }
.menu-pop button:hover { background: var(--bg); }
.menu-pop button span { width: 20px; text-align: center; }
.menu-name { padding: 8px 12px 6px; font-size: 12px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* ---------- 공지 ---------- */
.bell { position: relative; font-size: 17px; }
.bell .dot { top: 0; right: -2px; }
.notice-bg { z-index: 90; }
.notice-modal { max-width: 480px; }
.notice-count { background: var(--neg); color: #fff; font-size: 12px; border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.notice-card { border: 1.5px solid #fde68a; background: #fffbeb; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; transition: background .2s, border-color .2s; }
.notice-card.ok { border-color: #a7f3d0; background: #f0fdf4; }
.notice-title { font-weight: 700; font-size: 15.5px; }
.notice-body { white-space: pre-wrap; margin: 8px 0 4px; font-size: 14px; line-height: 1.55; }
.notice-check { margin-top: 10px; padding: 10px 12px; background: #fff; border-radius: 10px; font-weight: 700; }
.readers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip.read { background: #ecfdf5; border-color: #a7f3d0; }
.chip.unread { background: #fef2f2; border-color: #fecaca; }

/* =====================================================================
   모바일 우선: PC에서도 폰 화면 폭으로 가운데 표시
   ===================================================================== */
.app { max-width: 520px; background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
.topbar { max-width: 520px; margin: 0 auto; }
.tabbar { max-width: 520px; margin: 0 auto; left: 0; right: 0; }
.tabbar button { max-width: none; min-height: 56px; }
.item-list { grid-template-columns: 1fr !important; }
.stats { grid-template-columns: 1fr 1fr !important; }
.fab-wrap { right: max(16px, calc(50% - 244px)) !important; }
.modal-bg { align-items: flex-end !important; }
.modal, .modal.wide { max-width: 520px !important; border-radius: 20px 20px 0 0 !important; max-height: 94vh !important; }
.modal-foot { border-radius: 0; }
.brand, .brand span { display: none; }
/* iPhone 확대 방지 + 손가락으로 누르기 쉬운 크기 */
input, select, textarea { font-size: 16px !important; }
.btn { min-height: 44px; }
.btn.sm { min-height: 36px; }
.mini-btn { min-height: 34px; padding: 6px 12px; }
.icon-btn { width: 40px; height: 40px; }
.chip { padding: 8px 14px; }
.seg button { min-height: 40px; }
.ph-btn { width: 30px; height: 30px; font-size: 14px; }
.check input[type=checkbox] { width: 22px; height: 22px; }
.toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
.ph-gone { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 22px; }
.ph-gone small { font-size: 10px; color: var(--muted); }
.photo-del { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: #fff7ed; color: #9a3412; font-size: 13px; }
.return-check span { line-height: 1.35; }

/* ---------- 새 상품 등록 (그룹 → 사진) ---------- */
.steps { display: flex; flex-direction: column; gap: 10px; }
.step-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.step-no { width: 24px; height: 24px; border-radius: 50%; background: #000; color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.group-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.add-chip { border-style: dashed; color: var(--accent); }
.steps select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.step-tip { background: #fff; border-radius: 10px; padding: 10px 12px; margin: 6px 0 0; }
.calc-rows .admin-line.sub { padding-left: 18px; font-size: 13px; }
.admin-text small { color: var(--accent); opacity: .8; }

/* ---------- 정산 필터 / 직접 판매 표시 ---------- */
.filter-box { padding: 12px 14px; }
.filter-box .chips { margin-bottom: 10px; }
.range-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.range-row input { flex: 1; min-width: 0; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.group-sel { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 600; }
.click-row { cursor: pointer; }
.click-row:active td { background: var(--accent-soft); }
.card.item.is-direct { box-shadow: inset 3px 0 0 #8b5cf6, var(--shadow); }

/* 카드 오른쪽 위 작은 표시 */
.card.item { position: relative; }
.card.item.is-direct { box-shadow: var(--shadow); }
.corner-tag { position: absolute; top: 8px; right: 8px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; letter-spacing: -.2px; }
.corner-tag.admin { background: #111; color: #fff; }
.corner-tag.fb { background: #e7f0ff; color: #1877f2; }
.card.item:has(.corner-tag) .item-info .title { padding-right: 64px; }

/* 썸네일 왼쪽 위 귀여운 표시 */
.corner-tag { display: none; }
.card.item:has(.corner-tag) .item-info .title { padding-right: 0; }
.thumb-tag { position: absolute; top: 5px; left: 5px; z-index: 1; font-size: 10px; font-weight: 800; padding: 2px 7px 2px 5px; border-radius: 999px; line-height: 1.5; box-shadow: 0 1px 4px rgba(0,0,0,.18); white-space: nowrap; }
.thumb-tag.admin { background: #fff7d6; color: #8a5a00; border: 1px solid #ffd76a; }
.thumb-tag.fb { background: #1877f2; color: #fff; }

/* ---------- 페북 O / X ---------- */
.fb-pill { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; white-space: nowrap; line-height: 1.5; vertical-align: middle; }
.fb-pill.on { background: #1877f2; color: #fff; cursor: pointer; }
.fb-pill.off { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.fb-pill.sm { font-size: 10px; padding: 1px 6px; }
.fb-ic { flex: none; }
.thumb-tag-wrap { position: absolute; top: 5px; left: 5px; z-index: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.15)); }
.group-title { flex-wrap: wrap; }
.group-counts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px 18px; font-size: 12px; color: var(--muted); }
.group-counts span { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.group-counts b { color: var(--text); }
.group-counts .c-sold b { color: #059669; }
.group-counts .c-listed b { color: #1d4ed8; }
.group-counts .c-draft b { color: #b45309; }
.group-counts .c-ret b { color: #6b7280; }

/* ---------- 정산 체크 ---------- */
.person-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; padding: 0 14px 10px; }
.person { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border-radius: 12px; background: var(--bg); border: 1.5px solid transparent; text-align: left; }
.person b { font-size: 13px; letter-spacing: .3px; }
.person span { font-size: 11px; color: var(--pos); font-weight: 600; }
.person.has-todo span { color: var(--neg); }
.person.on { background: #fff; border-color: #000; }
.settle-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.ss { border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ss span { font-size: 12px; font-weight: 600; }
.ss b { font-size: 18px; }
.ss.unsettled { background: #fef2f2; color: #b91c1c; }
.ss.settled { background: #ecfdf5; color: #047857; }
.settle-tools { justify-content: space-between; margin-bottom: 6px; }
.settle-tools .seg { flex: 0 0 auto; }
.settle-tools .seg button { padding: 0 12px; }
.st-toggle { font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.st-toggle.no { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.st-toggle.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.st-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.st-pill.no { background: #fef2f2; color: #dc2626; }
.st-pill.ok { background: #ecfdf5; color: #047857; }
.person span.none { color: var(--muted); }
.st-ready { background: #ffedd5; color: #c2410c; }
.group-counts .c-ready b { color: #c2410c; }
/* 페북 표시: 썸네일 오른쪽 위 모서리 */
.thumb-tag-wrap { left: auto; right: 2px; top: 2px; }
.thumb-tag-wrap .fb-pill.sm { font-size: 9.5px; padding: 1px 5px; gap: 2px; }
.thumb-tag-wrap .fb-ic { width: 10px; height: 10px; }
/* 페북 표시: 썸네일 왼쪽 위 모서리에 딱 붙게 */
.thumb-tag-wrap { left: 1px; right: auto; top: 1px; }
.thumb-tag-wrap .fb-pill.sm { border-radius: 9px 999px 999px 999px; }
/* 페북 표시: 관리자 표시와 같은 위치·크기 */
.thumb-tag-wrap { left: 5px; right: auto; top: 5px; }
.thumb-tag-wrap .fb-pill.sm { border-radius: 999px; font-size: 10px; padding: 2px 7px 2px 5px; line-height: 1.5; }
.thumb-tag-wrap .fb-ic { width: 11px; height: 11px; }
/* 줄 간격 때문에 내려가던 문제 수정 */
.thumb-tag-wrap { display: flex; line-height: 0; }
/* 아래 떠있는 버튼 작게 */
.fab-wrap { gap: 6px; bottom: calc(72px + env(safe-area-inset-bottom)); }
.fab { padding: 8px 13px; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,.16); }
.brand-btn { display: flex; padding: 0; border-radius: 8px; } .brand-btn:active { transform: scale(.94); }

/* ---------- 정산 체크: 체크박스 + 오른쪽 리모콘 ---------- */
.pick-row { cursor: pointer; }
.pick-row.picked { background: #f0f7ff; }
.pick-box { width: 22px; height: 22px; flex: none; accent-color: #000; }
.pick-all { margin: 0; font-size: 13px; font-weight: 600; }
.remote { position: fixed; right: max(10px, calc(50% - 250px)); bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 40;
  width: 150px; background: #111; color: #fff; border-radius: 18px; padding: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  display: flex; flex-direction: column; gap: 6px; animation: up .18s ease-out; }
.remote-who { font-size: 11px; font-weight: 800; letter-spacing: .5px; color: #9ca3af; }
.remote-cnt { font-size: 13px; font-weight: 700; }
.remote-label { font-size: 11px; color: #9ca3af; margin-top: 2px; }
.remote-amt { font-size: 20px; font-weight: 800; line-height: 1.1; }
.remote-btn { width: 100%; padding: 9px 6px; border-radius: 12px; font-size: 13px; font-weight: 800; text-align: center; }
.remote-btn.go { background: #22c55e; color: #052e16; }
.remote-btn.back { background: #374151; color: #fff; font-size: 11.5px; }
.remote-btn.clear { background: transparent; color: #9ca3af; font-size: 12px; padding: 4px; }
.remote-btn:disabled { opacity: .5; }
.settle-tools .seg button { white-space: nowrap; }

/* ---------- 공지 게시판 ---------- */
.write-btn { width: 100%; padding: 12px; border-radius: 14px; border: 1.5px dashed #cbd5e1; background: #fff; font-weight: 700; margin-bottom: 12px; text-align: center; }
.write-box h3 em { font-size: 11.5px; }
.board { display: flex; flex-direction: column; gap: 8px; }
.post { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1.5px solid transparent; }
.post.unread { border-color: #fecaca; }
.post-head { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 12px 14px; text-align: left; }
.post-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.new-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--neg); flex: none; }
.notice-meta { font-size: 12px; color: var(--muted); }
.post-status { margin-top: 3px; }
.post-body { padding: 0 14px 12px; border-top: 1px solid var(--line); }
.read-list { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.read-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 10px; background: #fef2f2; font-size: 13.5px; font-weight: 600; }
.read-row.ok { background: #ecfdf5; }
