/* 앱 글꼴: Pretendard Variable (OFL) — 우리 서버에 올린 것. 자주 쓰는 한글 2,350자 + 영문·기호만 담아 가볍게(약 500KB).
   그 밖의 드문 글자는 아래 "Pretendard Variable"(CDN)이 그 글자만 채움 */
@font-face {
  font-family: "ambi Pretendard";
  src: url("/fonts/ambi-pretendard.woff2") format("woff2-variations"), url("/fonts/ambi-pretendard.woff2") format("woff2");
  font-weight: 45 930; font-style: normal; font-display: swap;
}
/* 색 (2안 · 따뜻한 미니멀, 2026-10-11): 따뜻한 흰 바탕 + 먹색 글자, 주요 버튼은 검정, 오렌지는 "대기·문의" 같은 포인트에만 */
:root {
  --bg: #f7f5f1;
  --card: #ffffff;
  --ink: #14110e;
  --muted: #736a61;
  --line: #ebe5dd;
  --brand: #2563eb;
  --brand-ink: #ffffff;
  --brand-soft: #e8f0fe;
  --accent: #ff6a2a;
  --ok: #2f7a52;
  --ok-soft: #e6f2ea;
  --warn: #a8401a;
  --warn-soft: #fff1e8;
  --danger: #c62828;
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14110e; --card: #1f1b17; --ink: #f3ede4; --muted: #a89e93; --line: #312b25;
    --brand: #7aaeff; --brand-ink: #0b1626; --brand-soft: #22324a; --accent: #ff7a3a; --ok: #7cc79a; --ok-soft: #1b2a20;
    --warn: #ff9a5c; --warn-soft: #3a2418; --danger: #ff8a80;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.5 "ambi Pretendard", "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.3; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; color: var(--muted); font-weight: 600; }
p { margin: .25em 0; }
a { color: var(--brand); }

.loading, .empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.muted { color: var(--muted); font-size: .92rem; }
.msg { color: var(--danger); min-height: 1.5em; }
.memo { background: var(--warn-soft); padding: 6px 10px; border-radius: 8px; font-size: .92rem; }

/* 로그인 */
.login { max-width: 380px; margin: 0 auto; padding: 12vh 16px 32px; display: grid; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 1.5rem; margin: 0; }
.brand p { margin: 0; color: var(--muted); font-size: .9rem; }
.mark {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand); color: var(--brand-ink); font-weight: 800; font-size: 1.4rem;
}
.brand.small .mark { width: 30px; height: 30px; border-radius: 9px; font-size: 1rem; }

/* 공통 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.btn {
  font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 10px; padding: 11px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.ghost { background: transparent; }
.btn.link { border: 0; background: none; padding: 6px 8px; color: var(--brand); white-space: nowrap; }
.btn.small { padding: 7px 12px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.gap { gap: 8px; margin-top: 8px; }
.chip { white-space: nowrap; font-size: .8rem; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); }
.chip.ok { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.grid2 { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.inline { display: flex; gap: 8px; margin-top: 8px; }

/* 앱 화면 */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--card); border-bottom: 1px solid var(--line);
}
.top nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.top .who { color: var(--muted); font-size: .9rem; margin-left: 4px; }
.tabs { display: flex; gap: 4px; padding: 8px 16px 0; overflow-x: auto; max-width: 720px; margin: 0 auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.tabs::-webkit-scrollbar { display: none; }
.tabs.wide { max-width: 1200px; }
.tabs.more { -webkit-mask-image: linear-gradient(90deg, #000 82%, transparent); mask-image: linear-gradient(90deg, #000 82%, transparent); }
.tab { scroll-snap-align: start; }
.tab { font: inherit; border: 0; background: none; padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); font-weight: 700; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.wrap.wide { max-width: 1200px; }
.list { display: grid; gap: 10px; }
.day { display: grid; gap: 10px; margin-bottom: 8px; }
.job .time { font-size: 1.05rem; }
.job .site { font-weight: 600; }
.job.done { background: color-mix(in srgb, var(--card) 55%, var(--bg)); }
.job.done .site, .job.done .time { color: var(--muted); }
.member.off { background: color-mix(in srgb, var(--card) 55%, var(--bg)); }
.member.off > .row > b { color: var(--muted); }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; max-width: calc(100% - 32px);
  transition: .2s; z-index: 100;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
[hidden] { display: none !important; }
.brand b { white-space: nowrap; }
.top nav .btn.link { white-space: nowrap; }
@media (max-width: 420px) { .top .who { display: none; } }

/* 2단계: 일정 보드·일정 넣기 */
.grow { flex: 1 1 auto; min-width: 0; }
.nowrap { white-space: nowrap; }
.board-head { position: sticky; top: 58px; z-index: 4; background: var(--bg); padding: 4px 0; }
.date-in { width: auto; padding: 7px 10px; }
.summary { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 16px; }
.prow { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.prow input[type=checkbox] { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.prow.same { opacity: .6; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); }
.chip .x { border: 0; background: none; color: inherit; cursor: pointer; font: inherit; min-width: 32px; min-height: 32px; margin: -8px -8px -8px -2px; display: inline-grid; place-items: center; }
select.mini { width: auto; padding: 6px 8px; font-size: .9rem; }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.pick { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: .95rem; }
.pick input { width: 18px; height: 18px; }
.skip { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: .92rem; }
.job.off { opacity: .5; }
textarea { resize: vertical; }
.row.end { justify-content: flex-end; }
input.short { width: 8em; }
details.more > summary { cursor: pointer; color: var(--brand); font-weight: 600; margin-top: 6px; }
form.sub { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.link.small, .btn.link.small { font-size: .85rem; }
.loc input { min-width: 180px; }
.tablewrap { overflow-x: auto; }
table.tbl { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.tbl th, table.tbl td { border-bottom: 1px solid var(--line); padding: 6px 6px; text-align: left; vertical-align: middle; }
table.tbl th { color: var(--muted); font-weight: 600; white-space: nowrap; }
table.tbl input { padding: 6px 8px; }
.routes { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
ul.route { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; font-size: .92rem; }
p.why { font-size: .88rem; }
table.tbl input { min-width: 6.5em; } table.tbl input.short { min-width: 5em; width: 5.5em; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs:empty { display: none; }
img.thumb, span.thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); display: inline-grid; place-items: center; font-size: .8rem; color: var(--muted); }
.pv { position: relative; }
.pv .x { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); cursor: pointer; }
.donebox { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* 정산 앱 */
.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.stat { display: grid; gap: 2px; padding: 12px 14px; align-content: start; }
.stat b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.stat.ok b { color: var(--ok); }
.stat.warn { border-color: var(--warn); }
.small { font-size: .8rem; }
input.money-in { width: 5.5em; min-width: 5em; text-align: right; padding: 5px 7px; font-variant-numeric: tabular-nums; }
table.ledger td { font-size: .9rem; }
table.ledger tr.paid td { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.stack.tight { gap: 4px; }
.who { min-width: 3.5em; font-size: .88rem; }
.chip.bill { background: var(--brand-soft); color: var(--brand); }
.chip.cash { background: var(--warn-soft); color: var(--warn); }
.btnchip { border: 0; cursor: pointer; font: inherit; font-size: .8rem; }
.split { display: grid; gap: 16px; grid-template-columns: 240px 1fr; align-items: start; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }
nav.side { display: grid; gap: 4px; max-height: 80vh; overflow: auto; position: sticky; top: 70px; }
.prow-btn { display: grid; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--ink); }
.prow-btn.on { background: var(--brand-soft); }
.daily textarea { font-family: inherit; font-size: .95rem; line-height: 1.5; }

.closebar.locked { border-color: var(--brand); background: var(--brand-soft); }
td.num, th.num, table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.wide2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
/* 차트 */
.chartbox { position: relative; }
svg.bars { width: 100%; height: auto; display: block; }
svg.bars .grid { stroke: var(--line); stroke-width: 1; }
svg.bars .tick { fill: var(--muted); font-size: 11px; }
svg.bars .val { fill: var(--ink); font-size: 12px; font-weight: 600; }
svg.bars .fill { fill: var(--brand); }
svg.bars .hit { fill: transparent; }
svg.bars .bar:hover .fill { opacity: .8; }
.tip { position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: .85rem; box-shadow: 0 4px 16px rgb(0 0 0 / .12); min-width: 130px; }

/* 청구서 */
.invoice-wrap { display: flex; justify-content: center; }
.invoice { --ink: #13233a; --muted: #5d6b80; --line: #dfe6ef; --bg: #f5f8fc; --card: #fff; color-scheme: light; background: #fff; color: #13233a; width: 100%; max-width: 820px; padding: 40px 44px; border: 1px solid var(--line); border-radius: 6px; display: grid; gap: 18px; }
.invoice h1 { font-size: 1.8rem; letter-spacing: .3em; margin: 0; }
.invoice .muted { color: #5d6b80; }
.invoice table.tbl th { color: #5d6b80; }
.invoice table.tbl th, .invoice table.tbl td { border-color: #dfe6ef; color: #13233a; }
.invoice .nowrap, .inv-from .muted { word-break: keep-all; }
.inv-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; border-bottom: 2px solid #13233a; padding-bottom: 12px; }
.inv-to .big { font-size: 1.25rem; }
.inv-to { text-align: right; }
.inv-total { display: flex; gap: 12px; align-items: baseline; background: #eef3fb; padding: 12px 16px; border-radius: 6px; }
.inv-total b { font-size: 1.4rem; }
.inv-tbl { font-size: .9rem; }
.inv-tbl th, .inv-tbl td { border-color: #dfe6ef; color: #13233a; }
.invoice .inv-tbl tr.sub td { color: #5d6b80; font-size: .85rem; }
.inv-tbl tfoot td { font-weight: 600; }
.inv-tbl tfoot tr.grand td { font-size: 1.05rem; border-top: 2px solid #13233a; }
@media print {
  :root { --bg: #fff; --card: #fff; --ink: #13233a; --muted: #5d6b80; --line: #dfe6ef; color-scheme: light; }
  body { background: #fff; color: #13233a; }
  .top, .tabs, .no-print, #toast { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .invoice { border: 0; padding: 0; max-width: none; }
}
.wide2 > section { align-content: start; }
.btn.danger-outline { color: var(--danger); border-color: var(--danger); background: transparent; }

/* 거래처 포털 */
.wrap.narrow { max-width: 420px; padding-top: 10vh; }
.pin-in { font-size: 1.6rem; letter-spacing: .3em; text-align: center; }
input.mini { width: 9em; padding: 6px 8px; }
.chip.off { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.team { padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.reqrow { border: 1px solid var(--line); margin: 0; }
.reqrow.dup { border-color: var(--warn); }
.foot { text-align: center; padding: 24px 0 8px; }
body.portal .top nav .who { white-space: normal; text-align: right; }

/* 로고 글자: ambi. — 오렌지 빛 + 반짝임 */
.wordmark {
  --wm-a: #f26a00; --wm-b: #ff9a3c; --wm-hi: #ffd29a;
  display: inline-block; font-weight: 900; letter-spacing: -.05em; line-height: 1; font-size: 1.45rem; padding: 0 .04em .06em;
  background: linear-gradient(100deg, var(--wm-a) 0%, var(--wm-b) 38%, var(--wm-hi) 50%, var(--wm-b) 62%, var(--wm-a) 100%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 5px rgba(255, 122, 26, .45)) drop-shadow(0 0 14px rgba(255, 122, 26, .25));
  animation: wm-shine 3.6s ease-in-out infinite, wm-glow 3.6s ease-in-out infinite;
}
.wordmark .dot { color: #ff4d1a; -webkit-text-fill-color: #ff4d1a; display: inline-block; animation: wm-twinkle 3.6s ease-in-out infinite; }
.wordmark.big { font-size: 3rem; letter-spacing: -.06em; }
@keyframes wm-shine { 0%, 20% { background-position: 100% 0; } 65%, 100% { background-position: 0% 0; } }
@keyframes wm-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 122, 26, .4)) drop-shadow(0 0 12px rgba(255, 122, 26, .2)); }
  50% { filter: drop-shadow(0 0 7px rgba(255, 122, 26, .7)) drop-shadow(0 0 22px rgba(255, 106, 0, .45)); }
}
@keyframes wm-twinkle { 0%, 55%, 100% { transform: scale(1); opacity: 1; } 68% { transform: scale(1.35); opacity: .75; } 78% { transform: scale(.95); opacity: 1; } }
.brand.small { gap: 8px; }
.brand.small b { color: var(--muted); font-weight: 600; }
.login-brand { flex-direction: column; align-items: flex-start; gap: 10px; }
@media (prefers-color-scheme: dark) {
  .wordmark { --wm-a: #ff8a3d; --wm-b: #ffb066; --wm-hi: #fff1dc; }
  .wordmark .dot { color: #ff6a3a; -webkit-text-fill-color: #ff6a3a; }
}
@media (prefers-reduced-motion: reduce) { .wordmark, .wordmark .dot { animation: none; } }
@media print { .wordmark { filter: none; animation: none; } }

/* 청구서: 보낸 목록·포털 */
.sentrow { padding: 10px 14px; align-items: center; }
.inv-item { text-align: left; width: 100%; font: inherit; color: inherit; cursor: pointer; }
.inv-stamp { margin-left: auto; padding: 2px 10px; border: 2px solid currentColor; border-radius: 6px; font-weight: 700; transform: rotate(-4deg); }
.inv-stamp.ok { color: #2f7d4f; }
@media (max-width: 560px) {
  .invoice { padding: 20px 16px; gap: 14px; }
  .invoice h1 { font-size: 1.4rem; }
  .inv-head { flex-direction: column; align-items: flex-start; }
  .inv-to { text-align: left; }
  .inv-total { flex-wrap: wrap; }
  .inv-tbl { font-size: .88rem; }
  /* 좁은 화면: 한 줄 = 카드처럼 (No·날짜·금액 / 현장·동호·작업) */
  .inv-tbl thead { display: none; }
  .inv-tbl, .inv-tbl tbody, .inv-tbl tfoot { display: block; width: 100%; }
  .inv-tbl tbody tr { display: grid; grid-template-columns: 1.6em auto 1fr; gap: 2px 8px; padding: 9px 0; border-bottom: 1px solid #dfe6ef; }
  .inv-tbl tbody td { border: 0; padding: 0; }
  .invoice .inv-tbl tbody td:nth-child(1) { color: #5d6b80; }
  .inv-tbl tbody td:nth-child(2) { font-weight: 600; }
  .inv-tbl tbody td:nth-child(6) { grid-column: 3; grid-row: 1; text-align: right; font-weight: 600; }
  .inv-tbl tbody td:nth-child(3) { grid-column: 2 / 4; }
  .inv-tbl tbody td:nth-child(4), .inv-tbl tbody td:nth-child(5) { grid-column: 2 / 4; }
  .invoice .inv-tbl tbody td:nth-child(4), .invoice .inv-tbl tbody td:nth-child(5) { color: #5d6b80; }
  .inv-tbl tbody td:empty { display: none; }
  .inv-tbl tbody tr.sub { padding-top: 0; }
  .inv-tbl tbody tr.sub td:nth-child(6) { grid-row: auto; }
  .inv-tbl tfoot tr { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #dfe6ef; }
  .inv-tbl tfoot td { border: 0; padding: 0; }
}

/* 물어보기 */
.chat { display: grid; gap: 8px; max-height: 55vh; overflow-y: auto; padding: 4px 0; }
.bubble { padding: 10px 14px; border-radius: 14px; max-width: 85%; white-space: pre-wrap; line-height: 1.5; }
.bubble.user { justify-self: end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 4px; }
.bubble.assistant { justify-self: start; background: var(--bg); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.askbar { flex-wrap: nowrap; align-items: stretch; }
.askbar .btn { flex: 0 0 auto; white-space: nowrap; padding-inline: 18px; }
.askbar input { flex: 1 1 auto; min-width: 0; }
.muted.small { font-size: .82rem; }
.qa { border-top: 1px solid var(--line); padding-top: 8px; }
.qa p { margin: 2px 0; }

/* 점검 반영: 체크박스·손가락 크기·표·빈 화면 */
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
.btnchip, table .chip, .row > .chip:not(.warn) { white-space: nowrap; }
.tablewrap > table.tbl { min-width: 560px; }
.tablewrap > table.ledger { min-width: 900px; }
.invoice .tablewrap > table.tbl { min-width: 0; }
@media (pointer: coarse) {
  .btn.small, .btn.link, select.mini { min-height: 40px; }
  details > summary { padding: 8px 0; min-height: 40px; }
}
.empty .btn { margin-top: 10px; }
.actions-split { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; width: 100%; }
.actions-split > span { display: flex; flex-wrap: wrap; gap: 8px; }
/* 포털 첫 화면: AI에게 물어보기 */
.ai-card { border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line)); background: color-mix(in srgb, var(--brand-soft) 60%, var(--card)); }
.ai-head { display: flex; align-items: center; gap: 8px; margin: 0; }
.ai-badge { font-size: .72rem; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); }
.ai-q { display: grid; gap: 8px; }
.ai-q .btn { justify-content: flex-start; text-align: left; white-space: normal; }
.ai-ask { display: flex; gap: 8px; }
.ai-ask input { flex: 1 1 auto; min-width: 0; }
.ai-ask .btn { flex: 0 0 auto; white-space: nowrap; }

/* 입력칸 안내 문구: 옅게 (써진 글처럼 보이지 않게) */
::placeholder { color: color-mix(in srgb, var(--muted) 55%, transparent); opacity: 1; }
input.money-in::placeholder { color: var(--muted); }   /* 정산: 단가표 금액은 회색 글씨로 보여줘야 함 */

/* AI 입력창 (카톡 입력창처럼) */
.composer { display: flex; gap: 8px; align-items: center; padding: 8px 8px 8px 6px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); }
.composer:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.composer textarea { flex: 1 1 auto; min-width: 0; min-height: 48px; margin: 0; max-height: 160px; resize: none; border: 0; outline: none; background: transparent; padding: 6px 8px; font: inherit; font-size: 1rem; line-height: 1.45; box-shadow: none; }
.composer textarea:focus { outline: none; }
.composer .btn { flex: 0 0 auto; align-self: center; margin: 0; border-radius: 12px; min-height: 44px; padding: 0 16px; white-space: nowrap; }
.find-bar { display: flex; gap: 8px; }
.find-bar input { flex: 1 1 auto; min-width: 0; }
.find-bar .btn { flex: 0 0 auto; white-space: nowrap; }
.find-card h2 { margin: 0; }

/* 주간 정산 */
.mcards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.mcard { display: grid; gap: 8px; align-content: start; }
.mlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .92rem; }
.mlist li { display: grid; grid-template-columns: 4.6em 1fr auto; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.mlist .d { color: var(--muted); }
.mfoot { padding-top: 4px; }
.warnbox { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.warnbox p { margin: 2px 0; }
@media (max-width: 420px) { .mcards { grid-template-columns: 1fr; } }

/* 일정 보드: 주간 보기 */
.weekbox { gap: 10px; }
.weekstrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wday { display: grid; gap: 2px; justify-items: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; font-size: .85rem; cursor: pointer; min-width: 0; }
.wday b { font-size: .85rem; white-space: nowrap; }
.wday.on { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.wday.has-wait { background: color-mix(in srgb, var(--warn-soft) 55%, var(--card)); }
.wday .chip { font-size: .72rem; padding: 1px 6px; }
.waitlist { display: grid; gap: 4px; }
.waitrow { display: flex; gap: 10px; align-items: baseline; text-align: left; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; font-size: .92rem; cursor: pointer; }
.waitrow:hover { background: var(--brand-soft); }
.waitrow .d { font-weight: 600; white-space: nowrap; }
@media (max-width: 520px) {
  .weekstrip { grid-template-columns: repeat(7, 4.4em); overflow-x: auto; }
  .waitrow { flex-wrap: wrap; gap: 2px 10px; }
}

/* 포털: 월간 달력 */
.cal-head { align-items: center; }
.cal-title { text-align: center; font-size: 1.1rem; }
.cal-card { padding: 10px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: .78rem; color: var(--muted); padding: 2px 0 4px; }
.cal-wd.sun { color: var(--danger); } .cal-wd.sat { color: var(--brand); }
.cal-cell { position: relative; display: grid; align-content: start; justify-items: center; gap: 2px; min-height: 54px; padding: 6px 2px; border: 1px solid transparent; border-radius: 10px; background: none; color: var(--ink); font: inherit; }
.cal-cell.empty { visibility: hidden; }
.cal-cell.has { background: var(--brand-soft); cursor: pointer; }
.cal-cell.future.has { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.cal-cell:disabled { cursor: default; color: var(--muted); }
.cal-cell.today { border-color: var(--brand); }
.cal-cell.on { background: var(--brand); color: var(--brand-ink); }
.cal-d { font-size: .9rem; font-weight: 600; }
.cal-n { font-size: .72rem; font-weight: 600; color: var(--brand); }
.cal-cell.on .cal-n { color: var(--brand-ink); }
.cal-ok { position: absolute; top: 3px; right: 5px; font-size: .7rem; color: var(--ok); }
.cal-cell.on .cal-ok { color: var(--brand-ink); }

/* 수정 기록 */
.hist summary { font-size: .88rem; }
.histlist { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: .88rem; }
.histlist .chip { font-size: .72rem; }
.histchg { padding-left: 2px; }
.histchg s { color: var(--muted); }

/* 일정 코멘트 */
.cmt-btn.has { font-weight: 700; }
.cmt { display: grid; gap: 8px; margin-top: 6px; padding: 10px; border-radius: 12px; background: var(--bg); }
.cmt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 280px; overflow-y: auto; }
.cmt-list li { padding: 8px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.cmt-list li.mine { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.cmt-list li p { margin: 2px 0 0; white-space: pre-wrap; }
.cmt-form textarea { min-height: 40px; }

/* 일정 카드 정리: 완료 칸(사진+메모), 맨 아래 코멘트 줄 */
.job { display: grid; gap: 8px; }
.job > p { margin: 0; }
.donepanel { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--ok-soft) 55%, var(--card)); border: 1px solid color-mix(in srgb, var(--ok) 22%, var(--line)); }
.dp-head { display: flex; gap: 8px; align-items: baseline; }
.dp-head b { color: var(--ok); font-size: .92rem; }
.dp-head .muted { font-size: .85rem; }
.donepanel .thumbs { display: flex; gap: 8px; overflow-x: auto; }
.donepanel img.thumb, .donepanel span.thumb { width: 84px; height: 84px; border-radius: 10px; border: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); background: var(--bg); }
.dp-memo { margin: 0; font-size: .92rem; }
.dp-memo::before { content: '메모 '; color: var(--muted); font-size: .82rem; }
.card-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; padding-top: 8px; margin-top: 2px; border-top: 1px dashed var(--line); }
.card-foot > .cmt-wrap { flex: 1 1 100%; }
.card-foot .cmt-btn, .card-foot .btn.link { padding-left: 0; }
.cmt-wrap { display: grid; gap: 6px; }
.job .chip .x { min-width: 28px; min-height: 28px; margin: -6px -6px -6px 0; }

/* 휴대폰: 버튼·여백을 한 단계 작게 (글씨 크게 쓰는 폰에서도 화면에 더 들어오게) */
@media (max-width: 560px) {
  .wrap { padding: 12px; gap: 12px; }
  .card { padding: 12px 14px; }
  .btn { padding: 8px 12px; border-radius: 9px; }
  .btn.small { padding: 6px 10px; font-size: .88rem; }
  select.mini { padding: 5px 8px; font-size: .88rem; }
  .job .time { font-size: 1rem; }
  .job .row { gap: 6px; }
  .actions-split { gap: 6px; }
  .actions-split > span { gap: 6px; }
  .summary { padding: 10px 12px; gap: 8px; }
  .day h3 { font-size: .95rem; margin-bottom: 6px; }
  /* 위에 붙는 날짜 줄: 한 줄로, 버튼은 아이콘처럼 작게 */
  .board-head { gap: 6px; padding: 6px 0; }
  .board-head .date-in { flex: 1 1 9em; min-width: 0; padding: 7px 8px; }
  .board-head .btn.small { padding: 6px 9px; }
  /* 7일 보기: 한 화면에 7칸 다 들어가게 */
  .weekstrip { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; overflow: visible; }
  .wday { padding: 6px 1px; font-size: .74rem; gap: 1px; border-radius: 8px; }
  .wday b { font-size: .74rem; white-space: normal; line-height: 1.2; }
  .wday .chip { font-size: .66rem; padding: 0 4px; }
  .wday .muted.small { font-size: .66rem; }
  .waitrow { padding: 7px 9px; font-size: .88rem; }
  .donepanel img.thumb, .donepanel span.thumb { width: 72px; height: 72px; }
}
@media (pointer: coarse) and (max-width: 560px) {
  .btn.small, .btn.link, select.mini { min-height: 36px; }
}
.job .row.gap { margin-top: 0; }
.cmt-btn { justify-self: start; }
.wday .wd { font-size: .72rem; color: var(--muted); }
.wday.on .wd { color: var(--brand); font-weight: 700; }
@media (max-width: 560px) { .wday b { white-space: nowrap; font-size: .78rem; } }

/* 고객 포털 (/c/코드): 휴대폰 한 손으로 누르기 쉽게 — 큰 버튼, 고른 것은 파랗게 */
body.cust { background: var(--bg); }
.cwrap { max-width: 520px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.chead { display: grid; gap: 2px; padding: 8px 2px 0; }
.cvendor { font-size: 1.25rem; letter-spacing: -.01em; }
.cjob { display: grid; gap: 4px; }
.cdate { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.cdate b { font-size: 1.35rem; }
.ctime { font-weight: 700; color: var(--brand); font-size: 1.1rem; }
.csite { font-weight: 600; }
.cnote { margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: .88rem; color: var(--muted); }
.cintro { margin: 4px 2px 0; }
.cq { border: 0; margin: 0; padding: 0; display: grid; gap: 10px; }
.cq legend { font-weight: 700; font-size: 1.02rem; padding: 0 2px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.cq .req, .cq .opt-tag { font-size: .74rem; font-weight: 600; padding: 1px 7px; border-radius: 99px; }
.cq .req { background: var(--brand); color: var(--brand-ink); }
.cq .opt-tag { background: var(--card); color: var(--muted); border: 1px solid var(--line); }
.opts { display: grid; gap: 8px; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font-size: 1rem; font-weight: 500; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: border-color .12s, background .12s; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opt-ic { font-size: 1.3rem; width: 1.6em; text-align: center; flex: 0 0 auto; }
.opt::after { content: ''; margin-left: auto; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); box-sizing: border-box; }
.opt.on { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.opt.on::after { border: 7px solid var(--brand); background: var(--card); }
.opt:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.opt:active { transform: scale(.99); }
.opt-more { padding: 2px 4px 4px; }
.cin { color: var(--ink); font-weight: 600; font-size: .95rem; }
.cin input { font-size: 1.15rem; letter-spacing: .04em; min-height: 52px; background: var(--card); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tchip { font: inherit; font-size: .95rem; min-height: 44px; padding: 8px 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tchip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.tchip.on::before { content: '✓ '; }
.cq textarea { background: var(--card); font-size: 1rem; }
.cbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); display: flex; justify-content: center; z-index: 5; }
.csave { width: 100%; max-width: 488px; min-height: 54px; font-size: 1.08rem; border-radius: 14px; }
.cdone { border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }
.cdone-head { display: flex; gap: 12px; align-items: center; }
.cdone-head p { margin: 0; }
.cdone-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-weight: 800; font-size: 1.2rem; flex: 0 0 auto; }
.clines { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; }
.clines dt { color: var(--muted); font-size: .9rem; }
.clines dd { margin: 0; font-weight: 600; word-break: break-all; }

/* 일정 앱: 고객이 남긴 정보 */
.custpanel { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--brand-soft) 55%, var(--card)); border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); font-size: .92rem; }
.custpanel .cp-head { display: flex; gap: 8px; align-items: baseline; }
.custpanel .cp-head b { color: var(--brand); }
.custpanel dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; }
.custpanel dt { color: var(--muted); }
.custpanel dd { margin: 0; word-break: break-all; }
.custpanel dd.hi { font-weight: 700; }
.custlink { display: grid; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--bg); border: 1px dashed var(--line); }
.custlink pre { margin: 0; white-space: pre-wrap; font: inherit; font-size: .88rem; color: var(--muted); max-height: 9em; overflow: auto; }
.cnote a { white-space: nowrap; }
/* ===== 일정 목록 (캘린더 앱처럼 한 줄씩) ===== */
.agenda { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ag-row {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: 56px 4px minmax(0, 1fr) auto; align-items: center; gap: 0 12px;
  padding: 12px 14px 12px 12px; min-height: 60px;
}
.ag-row + .ag-row { border-top: 1px solid var(--line); }
.ag-row:hover { background: color-mix(in srgb, var(--brand-soft) 45%, var(--card)); }
.ag-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.ag-time { display: grid; justify-items: end; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ag-time b { font-size: .95rem; font-weight: 600; }
.ag-time b.allday { font-size: .85rem; color: var(--muted); font-weight: 500; }
.ag-time small { font-size: .72rem; color: var(--muted); }
.ag-bar { align-self: stretch; width: 4px; border-radius: 4px; background: var(--brand); min-height: 34px; }
.ag-main { display: grid; min-width: 0; line-height: 1.35; }
.ag-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-title:has(.ag-apt) { display: flex; align-items: baseline; min-width: 0; }
.ag-apt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ag-unit { flex: none; margin-left: .3em; }
.ag-sub { color: var(--muted); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-side { display: grid; justify-items: end; gap: 3px; }
.ag-who { font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.ag-who.wait { background: var(--warn-soft); color: var(--warn); }
.ag-who.off { background: var(--bg); color: var(--muted); }
.ag-ics { display: flex; gap: 6px; font-size: .74rem; color: var(--muted); white-space: nowrap; }
.ag-ic.warn { color: var(--warn); font-weight: 700; }
/* 상태 색: 대기 주황 · 배정 파랑 · 완료 초록 · 취소 회색 */
.ag-row.st-done .ag-title, .ag-row.st-done .ag-time b { color: var(--muted); }
.ag-row.st-off { opacity: .5; }
.ag-row.st-off .ag-bar { background: var(--line); }
.ag-row.st-off .ag-title { text-decoration: line-through; }
@media (max-width: 560px) {
  .ag-row { grid-template-columns: 48px 4px minmax(0, 1fr) auto; gap: 0 10px; padding: 11px 12px 11px 8px; }
  .ag-time b { font-size: .88rem; }
}

/* 보기 바꾸기 (시간순 / 팀원별) */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { font: inherit; font-size: .82rem; border: 0; background: var(--card); color: var(--muted); padding: 5px 10px; cursor: pointer; }
.seg button.on { background: var(--brand); color: var(--brand-ink); font-weight: 600; }

/* 오른쪽 아래 + 버튼 */
.fab {
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 30;
  width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand); color: var(--brand-ink); font-size: 1.9rem; line-height: 1; box-shadow: 0 6px 18px rgba(20, 50, 110, .28);
}
.fab:active { transform: scale(.96); }
.wrap:has(.fab) { padding-bottom: 96px; }

/* 상세 창 (아래에서 올라옴) */
html.sheet-open, html.sheet-open body { overflow: hidden; }
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(8, 18, 36, 0); display: flex; align-items: flex-end; justify-content: center; transition: background .18s; }
.sheet-back.show { background: rgba(8, 18, 36, .42); }
.sheet {
  position: relative; width: min(640px, 100%); max-height: 88vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: 20px 20px 0 0; padding: 10px 18px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .2s ease-out; box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
}
.sheet-back.show .sheet { transform: translateY(0); }
@media (min-width: 700px) { .sheet-back { align-items: center; } .sheet { border-radius: 20px; max-height: 84vh; } }
.sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 6px; }
.sheet-x { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: var(--muted); font-size: 1.1rem; width: 40px; height: 40px; cursor: pointer; border-radius: 50%; }
.sheet-body { display: grid; gap: 12px; }
.sheet-body > p { margin: 0; }
.sd-head { display: grid; gap: 2px; padding-right: 36px; }
.sd-head p { margin: 0; }
.sd-title { font-size: 1.25rem; margin: 4px 0 2px; }
.sd-sec { display: grid; gap: 6px; }
.sd-label { font-size: .82rem; color: var(--muted); font-weight: 600; }
.sd-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.sd-more summary { color: var(--muted); font-size: .86rem; cursor: pointer; padding: 4px 0; }
.sd-more .row { margin-top: 8px; }
.sheet .card-foot { border-top: 1px solid var(--line); }
.sheet form.stack { padding: 0; border: 0; }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-back { transition: none; } }
.sheet form > .row:first-child { padding-right: 40px; }

/* ===== 일정 화면 위쪽 (캘린더 앱처럼 가볍게) ===== */
.dhead { position: sticky; top: 58px; z-index: 4; background: var(--bg); display: flex; align-items: center; gap: 2px; padding: 6px 0; }
.icon-btn { border: 0; background: none; color: var(--ink); font: inherit; font-size: 1.4rem; line-height: 1; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--brand-soft); }
.dtitle { position: relative; display: inline-flex; align-items: center; gap: 4px; font-size: 1.2rem; font-weight: 700; color: var(--ink); padding: 4px 6px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.dtitle .caret { font-size: .8rem; color: var(--muted); }
.dtitle .date-pick { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; padding: 0; border: 0; cursor: pointer; }
.dtitle:focus-within { outline: 2px solid var(--brand); }
.today-btn { border-radius: 99px; padding: 5px 12px; font-size: .85rem; }

.wk { display: grid; gap: 6px; margin-bottom: 4px; }
.wk-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); touch-action: pan-y; }
.wk-day { border: 0; background: none; font: inherit; color: var(--ink); display: grid; justify-items: center; gap: 2px; padding: 4px 0 6px; cursor: pointer; border-radius: 12px; min-width: 0; }
.wk-wd { font-size: .74rem; color: var(--muted); }
.wk-day.sun .wk-wd, .wk-day.sun .wk-num { color: var(--danger); }
.wk-day.sat .wk-wd, .wk-day.sat .wk-num { color: var(--brand); }
.wk-num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; font-weight: 600; }
.wk-day.today .wk-num { box-shadow: inset 0 0 0 1.5px var(--brand); }
.wk-day.on .wk-num { background: var(--brand); color: var(--brand-ink) !important; }
.wk-n { font-size: .72rem; color: var(--muted); min-height: 1.1em; font-variant-numeric: tabular-nums; }
.wk-n .wait { font-style: normal; color: var(--warn); font-weight: 700; }
.wk-n .wait::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 3px; vertical-align: 1px; }
.wk-wait { justify-self: start; border: 0; background: var(--warn-soft); color: var(--warn); font: inherit; font-size: .84rem; font-weight: 600; padding: 6px 12px; border-radius: 99px; cursor: pointer; }
.wk-wait .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.wk-wait .muted { font-weight: 500; font-size: .82rem; }

.notices { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.notices::-webkit-scrollbar { display: none; }
.ntc { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: .84rem; padding: 6px 12px; border-radius: 99px; cursor: pointer; white-space: nowrap; }
.ntc:hover { border-color: var(--brand); }

.pushbar { display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); padding: 6px 4px 6px 12px; border-radius: 12px; background: var(--brand-soft); }
.pushbar > span { flex: 1; min-width: 0; }
.pushbar .btn { padding: 4px 10px; font-size: .82rem; }
.pb-x { border: 0; background: none; color: var(--muted); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; flex: none; }

.lhead { display: grid; gap: 2px; margin-top: 4px; }
.lh-row { display: flex; align-items: center; gap: 8px; }
.lh-stats { font-size: .9rem; color: var(--muted); }
.lh-stats b { color: var(--ink); font-size: 1rem; }
.lh-wait { color: var(--warn); font-weight: 600; }
.lh-off { margin: 0; font-size: .8rem; color: var(--muted); }
.wrap:has(> .dhead) { gap: 10px; }
@media (max-width: 560px) {
  .dtitle { font-size: 1.1rem; }
  .wk-num { width: 32px; height: 32px; font-size: .95rem; }
}

/* ===== 고객 문의 ===== */
.ntc.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.cq-box { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 40%, var(--card)); }
.cq-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 280px; overflow-y: auto; }
.cq-list li { padding: 8px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); max-width: 92%; }
.cq-list li.us { justify-self: end; background: var(--brand-soft); border-color: transparent; }
.cq-list li p { margin: 2px 0 0; white-space: pre-wrap; }
.cq-quick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.cq-quick .tchip { flex: none; min-height: 34px; padding: 4px 12px; font-size: .84rem; }
.cq-quick .tchip.on::before { content: none; }
.small { font-size: .82rem; }

/* 고객 화면 대화 */
.cmsgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cmsgs li { max-width: 86%; padding: 10px 12px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); display: grid; gap: 2px; }
.cmsgs li.me { justify-self: end; background: var(--brand); color: var(--brand-ink); border-color: transparent; border-bottom-right-radius: 6px; }
.cmsgs li.us { border-bottom-left-radius: 6px; }
.cmsgs .who { font-size: .78rem; font-weight: 700; opacity: .8; }
.cmsgs p { margin: 0; white-space: pre-wrap; }
.cmsgs .when { font-size: .72rem; opacity: .65; justify-self: end; }
.cask textarea { font: inherit; }
/* 품목 소요시간 칸: [150] 분 [✓ 1M당] 한 줄로 */
.durcell { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
.durcell input.short { width: 5.5em; flex: none; }
.pick.per { white-space: nowrap; font-size: .85rem; color: var(--muted); padding: 4px 8px; border: 1px solid var(--line); border-radius: 99px; gap: 4px; }
.pick.per:has(input:checked) { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
table.tbl .pick.per input, .pick.per input { width: 15px; height: 15px; min-width: 0; padding: 0; margin: 0; flex: none; }
.pick.per { flex: none; }

/* ===== 고객 화면: 한 화면에 (위 단계 2/3 + 아래 배너 1/3) ===== */
body.cust { overscroll-behavior: none; }
.cx { height: 100vh; height: 100dvh; max-width: 520px; margin: 0 auto; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.cx.has-ad { grid-template-rows: auto minmax(0, 1fr) auto; }
.cx-top { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 16px 6px; min-height: 52px; }
.cx-back { border: 0; background: none; color: var(--ink); font-size: 1.6rem; line-height: 1; width: 36px; height: 36px; margin-left: -8px; border-radius: 50%; cursor: pointer; }
.cx-brand { display: grid; line-height: 1.25; min-width: 0; }
.cx-brand b { font-size: 1rem; }
.cx-brand span { font-size: .74rem; color: var(--muted); }
.cx-prog { margin-left: auto; display: flex; gap: 4px; }
.cx-prog i { width: 18px; height: 4px; border-radius: 4px; background: var(--line); }
.cx-prog i.on { background: var(--brand); }
.cx-main { overflow-y: auto; padding: 4px 16px 12px; -webkit-overflow-scrolling: touch; }
.cx-panel { display: grid; gap: 10px; align-content: start; min-height: 100%; }
.cx-panel > * { margin: 0; }
.cx-hi { font-size: .9rem; color: var(--muted); }
.cx-job { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; display: grid; gap: 4px; }
.cx-date { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cx-date b { font-size: 1.35rem; }
.cx-date span { color: var(--brand); font-weight: 700; }
.cx-site { font-weight: 600; margin: 0; }
.cx-work { color: var(--muted); font-size: .9rem; margin: 0; }
.cx-state { font-size: .92rem; color: var(--muted); }
.cx-state.ok { color: var(--ok); font-weight: 600; }
.cx-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: auto; padding-top: 4px; }
.cx-actions .btn { min-height: 50px; font-size: 1rem; border-radius: 14px; }
.cx-reply { all: unset; box-sizing: border-box; cursor: pointer; font-size: .86rem; color: var(--ink); background: var(--brand-soft); border-radius: 12px; padding: 8px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-reply b { color: var(--brand); }
.cx-foot { font-size: .8rem; color: var(--muted); text-align: center; }
.cx-q { font-size: 1.15rem; margin: 2px 0 2px; }
.cx-label { font-size: .88rem; color: var(--muted); font-weight: 600; margin: 4px 0 -2px; }
.cx-label small { font-weight: 500; }
.cx-skip { font-size: .8rem; color: var(--muted); text-align: center; }
.cx-opts { display: grid; gap: 8px; }
.cx-opts.grid2, .cx-opts.tiles { grid-template-columns: 1fr 1fr; }
.cx-opts button { font: inherit; font-size: .92rem; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; min-height: 46px; padding: 8px 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; -webkit-tap-highlight-color: transparent; }
.cx-opts.tiles button { flex-direction: column; min-height: 84px; font-weight: 600; }
.cx-opts .ic { font-size: 1.5rem; line-height: 1; }
.cx-opts button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.cx-extra:empty { display: none; }
.cx-extra input { font-size: 1.05rem; }
.cx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-chips button { font: inherit; font-size: .86rem; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 99px; padding: 6px 12px; cursor: pointer; }
.cx-chips button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.cx-panel textarea { font: inherit; resize: none; }
.cx-done { display: flex; align-items: center; gap: 12px; }
.cx-done p { margin: 0; color: var(--muted); font-size: .88rem; }
.cx-check { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); font-weight: 800; font-size: 1.2rem; flex: none; }
.cx-lines { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: .92rem; }
.cx-lines dt { color: var(--muted); }
.cx-lines dd { margin: 0; font-weight: 600; }
.cx-ask { grid-template-rows: auto minmax(0, 1fr) auto auto auto auto; height: 100%; min-height: 0; }
.cx-ask .cmsgs { overflow-y: auto; min-height: 0; align-content: start; }
.cx-empty { color: var(--muted); font-size: .9rem; background: none !important; border: 0 !important; max-width: none !important; }
.cx-kinds { display: flex; gap: 6px; }
.cx-kinds button { font: inherit; font-size: .84rem; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 5px 12px; cursor: pointer; }
.cx-kinds button.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.cx-hint { font-size: .8rem; color: var(--muted); }
.cx-ask .composer textarea { min-height: 40px; }
/* 배너: 아래 1/3 */
.cx-ad { height: clamp(140px, 31dvh, 260px); padding: 0 12px calc(10px + env(safe-area-inset-bottom)); transition: height .2s; }
.cx.typing .cx-ad { height: 0; padding: 0; overflow: hidden; }
.bn { position: relative; height: 100%; border-radius: 18px; overflow: hidden; background: var(--card); box-shadow: 0 2px 10px rgba(20, 40, 80, .08); }
.bn-track { display: flex; height: 100%; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.bn-slide { all: unset; box-sizing: border-box; flex: 0 0 100%; height: 100%; cursor: pointer; display: block; position: relative; }
div.bn-slide { cursor: default; }
.bn-slide img, .bn-slide video { width: 100%; height: 100%; object-fit: cover; display: block; background: #16120f; }
.bn-text { height: 100%; display: grid; align-content: center; gap: 6px; padding: 18px 20px; color: #fff; }
.bn-tag { position: absolute; top: 10px; right: 12px; font-size: .62rem; letter-spacing: .08em; opacity: .7; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; }
.bn-title { font-size: 1.3rem; line-height: 1.3; }
.bn-sub { margin: 0; font-size: .92rem; opacity: .9; }
.bn-cta { justify-self: start; margin-top: 6px; font-size: .88rem; font-weight: 700; background: rgba(255, 255, 255, .2); padding: 6px 12px; border-radius: 99px; }
.tone-blue .bn-text { background: linear-gradient(135deg, #2563eb, #1d4ed8 60%, #1e3a8a); }
.tone-navy .bn-text { background: linear-gradient(135deg, #1e293b, #13233a); }
.tone-orange .bn-text { background: linear-gradient(135deg, #fb923c, #ea580c); }
.tone-green .bn-text { background: linear-gradient(135deg, #22a06b, #157a52); }
.tone-dark .bn-text { background: linear-gradient(135deg, #2b2b2b, #111); }
.bn-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.bn-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .5); box-shadow: 0 0 2px rgba(0,0,0,.3); }
.bn-dots i.on { background: #fff; width: 16px; border-radius: 4px; }
@media (max-height: 640px) { .cx-opts.tiles button { min-height: 66px; } .cx-ad { height: clamp(120px, 28dvh, 200px); } }
/* 배너 관리 */
.bnbox summary { cursor: pointer; }
.bnbox[open] { display: grid; gap: 12px; }
.bn-item { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.bn-item.off { opacity: .55; }
.bn-prev { height: 96px; }
.bn-prev.big { height: 180px; max-width: 420px; }
.bn-prev .bn-title { font-size: 1rem; } .bn-prev.big .bn-title { font-size: 1.25rem; }
.bn-prev .bn-text { padding: 10px 12px; gap: 3px; } .bn-prev .bn-sub { font-size: .8rem; }
.bn-prev.big .bn-text { padding: 18px 20px; gap: 6px; } .bn-prev.big .bn-sub { font-size: .92rem; }
.ellip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stack.tight { gap: 4px; }
@media (max-width: 560px) { .bn-item { grid-template-columns: 1fr; } }
.cx-panel { display: flex; flex-direction: column; }
.cx-panel.cx-ask { display: grid; }
.bn-title { white-space: pre-line; }
body.cust #toast { bottom: auto; top: calc(56px + env(safe-area-inset-top)); }
/* ambi 브랜드 톤: 어두운 바탕 + 따뜻한 오프화이트 + 오렌지 포인트 하나 */
.tone-warm .bn-text { background: radial-gradient(120% 90% at 85% 15%, rgba(255, 150, 60, .22), transparent 55%), linear-gradient(160deg, #1d1915, #0f0d0b); color: #f4ede4; }
.tone-warm .bn-cta { background: #f28a2e; color: #1a1410; }
.tone-warm .bn-tag { color: #f4ede4; }
.bn-img { position: relative; height: 100%; }
.bn-img .bn-tag { color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.5); }
/* 입력칸 아래 고르기 목록 */
.sg-wrap { position: relative; }
.sg-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(10, 30, 70, .16); max-height: 260px; overflow-y: auto; display: grid; padding: 4px; }
.sg-list button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; border-radius: 8px; color: var(--ink); font-size: .95rem; }
.sg-list button span { color: var(--muted); font-size: .82rem; }
.sg-list button:hover, .sg-list button.on, .sg-list button:active { background: var(--brand-soft); }
.ver { text-align: center; font-size: .72rem; color: var(--muted); opacity: .7; margin: 16px 0 4px; }
/* 앱 이름 로고: ambi. │ 일정 */
.brand.lockup { gap: 10px; align-items: center; }
.lk-bar { width: 1.5px; height: 18px; border-radius: 2px; background: color-mix(in srgb, var(--ink) 22%, transparent); }
.brand.small b.appmark {
  font-size: 1.32rem; font-weight: 800; letter-spacing: -.05em; line-height: 1; padding-bottom: .04em;
  color: var(--ink);
  background: linear-gradient(180deg, var(--ink) 0%, color-mix(in srgb, var(--ink) 70%, var(--brand)) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
@media (max-width: 380px) { .brand.small b.appmark { font-size: 1.18rem; } .brand.lockup { gap: 8px; } }

/* ===== 2안 · 따뜻한 미니멀 (2026-10-11) — 여백 넉넉히, 큰 날짜, 테두리 대신 흰 바탕 칸, 버튼은 둥근 알약 모양 ===== */
body { letter-spacing: -.01em; }
.top { background: var(--bg); border-bottom: 0; padding: max(12px, env(safe-area-inset-top)) 20px 8px; }
.brand.small .wordmark {
  background: none; color: var(--ink); -webkit-text-fill-color: var(--ink); font-weight: 800; font-size: 1.42rem;
  filter: drop-shadow(0 0 10px rgba(255, 106, 42, .22)); animation: none;
}
.brand.small .wordmark .dot { color: var(--accent); -webkit-text-fill-color: var(--accent); }
.brand.lockup { gap: 7px; align-items: baseline; }
.lk-bar { display: none; }
.brand.small b.appmark { font-size: 1.12rem; font-weight: 500; letter-spacing: -.02em; background: none; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.wrap { padding: 12px 20px 20px; gap: 14px; }
.btn { border-radius: 999px; padding: 10px 18px; }
.btn.small { padding: 7px 14px; }
.btn.link { border-radius: 10px; }
input, select, textarea { border-radius: 12px; }
.card { border-color: transparent; }
.tab[aria-selected="true"] { border-bottom-color: var(--ink); }
/* 날짜 줄: "10월 11일 일요일" 크게 */
.dhead { top: calc(max(12px, env(safe-area-inset-top)) + 40px); padding: 8px 0 4px; }
.dtitle { font-size: 1.75rem; font-weight: 750; letter-spacing: -.045em; padding: 2px 4px; }
.dtitle .dt-wd { color: var(--muted); font-weight: 600; }
.dtitle .caret { font-size: .7rem; margin-left: 2px; }
.icon-btn { color: var(--muted); }
.icon-btn:hover { background: var(--brand-soft); color: var(--ink); }
.today-btn { background: var(--card); border-color: var(--line); }
/* 주간 띠 */
.wk-day.sun .wk-wd, .wk-day.sat .wk-wd { color: var(--muted); }
.wk-day.sun .wk-num, .wk-day.sat .wk-num { color: var(--ink); }
.wk-num { width: 38px; height: 38px; font-weight: 650; }
.wk-day.today .wk-num { box-shadow: inset 0 0 0 1.5px var(--ink); }
.wk-n .wait::before, .wk-wait .dot { background: var(--accent); }
.wk-wait, .ntc.warn { background: var(--card); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); color: var(--warn); }
.wk-wait { padding: 8px 14px; border-radius: 12px; }
.ntc { border-radius: 12px; padding: 8px 14px; border-color: transparent; }
.pushbar { background: var(--card); }
.lhead { margin-top: 6px; }
.lh-stats { font-size: .95rem; }
/* 일정 목록: 예전처럼 색 막대 + 이름표, 프로마다 고유 색 (10/12 앰비 요청) */
.ag-title { font-weight: 650; }
.ag-time b { font-weight: 650; }
.seg { border-radius: 999px; border-color: var(--line); }
.seg button { padding: 6px 12px; }
@media (max-width: 560px) {
  .wrap { padding: 10px 16px 16px; }
  .btn { padding: 9px 16px; border-radius: 999px; }
  .btn.small { padding: 6px 12px; }
  .dtitle { font-size: 1.5rem; }
  .wk-num { width: 36px; height: 36px; }
}
/* + 버튼: 검정 */
.fab { box-shadow: 0 8px 24px rgba(37, 99, 235, .28); }
/* 상세 창 */
.sheet-back.show { background: rgba(20, 17, 14, .42); }
.sheet { border-radius: 28px 28px 0 0; padding: 10px 22px calc(24px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .sheet { border-radius: 28px; } }
.sheet-grab { background: color-mix(in srgb, var(--ink) 14%, transparent); }
.sheet-body { gap: 14px; }
.sd-title { font-size: 1.6rem; font-weight: 750; letter-spacing: -.04em; line-height: 1.2; }
.sd-actions .btn { min-height: 52px; font-size: 1.02rem; }
.sheet .memo { background: var(--bg); color: var(--ink); padding: 12px 14px; border-radius: 14px; }
.custpanel { background: var(--bg); border: 0; border-radius: 14px; padding: 12px 14px; }
.custpanel .cp-head b { color: var(--ink); }
.cq-box { background: var(--card); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 14px; }
.cq-list li.us { background: var(--brand-soft); }
.custlink { border-radius: 14px; }
.donepanel { border-radius: 14px; }
.cmt { border-radius: 14px; }
.sheet .card-foot { border-top-color: var(--line); }
.chip { background: var(--brand-soft); color: var(--ink); }
/* 그 밖 */
.sg-list { border-radius: 14px; box-shadow: 0 10px 28px rgba(20, 17, 14, .14); }
.bn { box-shadow: 0 2px 12px rgba(20, 17, 14, .08); }
svg.bars .fill { fill: color-mix(in srgb, var(--ink) 82%, var(--card)); }
.cx-job, .cx-lines { border-color: transparent; border-radius: 18px; }
.cx-opts button, .cx-chips button, .cx-kinds button, .opt, .tchip { border-color: var(--line); }
.cx-actions .btn { border-radius: 999px; }
.page-title { font-size: 1.75rem; font-weight: 750; letter-spacing: -.045em; margin: 6px 0 0; }
.sd-title, .page-title, .dtitle { word-break: keep-all; overflow-wrap: anywhere; }
/* 검토 반영: 테두리가 필요한 칸은 되살림, 글 속 링크는 밑줄, 토요일 색 */
.card.warnbox { border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); }
.card.reqrow, .card.job.done, .card.member.off { border-color: var(--line); }
.wrap a:not(.btn), .sheet a:not(.btn), .cx a:not(.btn) { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); }
.btn.link, details.more > summary { font-weight: 600; }
.cal-wd.sat { color: var(--muted); }
/* 프로별 색: 배정된 줄의 막대와 이름표 (--pc 는 agenda.js 가 프로마다 정함) */
.agenda { border-radius: 18px; }
.ag-row[style*="--pc"] .ag-bar { background: var(--pc); }
.ag-who.pro[style*="--pc"] { background: color-mix(in srgb, var(--pc) 13%, var(--card)); color: color-mix(in srgb, var(--pc) 82%, var(--ink)); }
.ag-row.st-wait .ag-bar { background: var(--accent); }
.ag-who.wait { background: var(--warn-soft); color: var(--warn); }
.pro-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--pc); margin-right: 7px; vertical-align: 1px; }
/* 정산 · 세금계산서 발행 표시 */
.tx-list { display: grid; padding: 4px 16px; }
.tx-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.tx-list > * + * { border-top: 1px solid var(--line); }
.tx-main { display: grid; gap: 2px; flex: 1 1 auto; min-width: 0; }
.tx-upto { font-size: .9rem; color: var(--muted); }
.tx-ok { color: var(--ok); font-weight: 600; font-size: .9rem; }
.tx-todo { color: var(--warn); font-weight: 600; font-size: .9rem; }
.tx-todo small { font-weight: 500; }
.tx-todo.late { color: var(--danger); }
.tx-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.tx-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding: 0 0 14px; }
.tx-form label { min-width: 150px; }
.taxline { margin: 0; font-size: .9rem; }
/* 매출·시공비 표: 칸 이름과 내용 줄맞춤 (10/12) — 금액은 오른쪽, 입금·추가는 가운데 */
table.ledger th, table.ledger td { vertical-align: middle; }
table.ledger th:nth-child(5), table.ledger td:nth-child(5),
table.ledger th:nth-child(8), table.ledger td:nth-child(8) { text-align: right; }
table.ledger td:nth-child(5) input.money-in { margin-left: auto; display: block; }
table.ledger th:nth-child(6), table.ledger td:nth-child(6),
table.ledger th:nth-child(9), table.ledger td:nth-child(9),
table.ledger th:nth-child(10), table.ledger td:nth-child(10) { text-align: center; }
table.ledger td:nth-child(9) input[type=checkbox] { width: 18px; height: 18px; margin: 0; vertical-align: middle; }
table.ledger td:nth-child(10) .btn.link { padding-left: 0; padding-right: 0; }
/* 현장번호: 상세 창 날짜 옆 회색 작은 글씨 */
.jobno { font-size: .86em; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.donepanel > .btn { justify-self: start; }
/* 정산 앱: 휴대폰에서는 안내로 가림 (그래도 열어보기 누르면 그 자리에서만 열림) */
.mblock { display: none; }
@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
  html:not(.mforce) .mblock { display: grid; position: fixed; inset: 0; z-index: 80; padding: 24px 16px; overflow: auto; background: var(--bg); }
  html:not(.mforce) .mblock ~ #root { visibility: hidden; }
  html:not(.mforce):has(.mblock) body { overflow: hidden; }
}
.mblock .mcard { max-width: 340px; margin: auto; text-align: center; display: grid; gap: 12px; padding: 28px 22px; border-radius: 24px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 14px 36px rgba(20, 17, 14, .1); }
.mblock .mic { width: 52px; height: 52px; margin: 0 auto; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.mblock h2 { margin: 0; font-size: 1.12rem; letter-spacing: -.02em; word-break: keep-all; }
.mblock p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.65; word-break: keep-all; }
.mblock .mlink { justify-self: center; display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); text-decoration: none; font-weight: 600; }
.mblock .mgo { justify-self: center; background: none; border: 0; color: var(--muted); font: inherit; font-size: .82rem; text-decoration: underline; text-underline-offset: 3px; padding: 8px; cursor: pointer; }

/* 거래처 요청 (포털 카드 아래 · 일정 앱 상세) */
.notes { display: grid; gap: 8px; margin-top: 6px; }
.note-btns .chip { margin-left: 6px; }
.note-form .seg { justify-self: start; }
.note-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.note-list li { padding: 8px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); max-width: 92%; }
.note-list li.me { justify-self: end; background: var(--brand-soft); border-color: transparent; }
.note-list .note-text, .vq-text { margin: 2px 0 0; white-space: pre-wrap; }
.note-list .thumbs, .cq-list .thumbs { margin-top: 6px; }
.vq-as { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.vq-as input[type=date] { width: auto; }
.ag-row.rec-row { grid-template-columns: minmax(0, 1fr) auto auto; cursor: default; }
.ag-row.rec-row:hover { background: none; }

/* 상세 창 아래 주요 버튼: 화면 폭을 꽉 채우지 않고 알맞은 크기로 (10/12 앰비 요청) */
.sd-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sd-actions .btn { min-height: 42px; font-size: .95rem; padding: 8px 20px; flex: 0 0 auto; }
/* 거래처 포털: 작업 고르기 */
.grid2 label.wide { grid-column: 1 / -1; }
.workpick { display: grid; gap: 4px; }
.workpick select[aria-label="작업"] { flex: 1 1 100%; min-width: 0; }
.workpick select[aria-label="곳 수"], .workpick select[aria-label="옵션"] { width: auto; flex: 0 0 auto; }
.workpick .wp-qty { width: 6.5em; flex: 0 0 auto; }
.wp-note { margin: 0; }
/* 상세 창 메모: 줄바꿈 그대로 */
.memo-sec .memo { white-space: pre-wrap; margin: 0; }
.memo-sec textarea { width: 100%; }

/* 고객 화면 (10/12 앰비 요청): 거래처 이름 크게 · "by ambi." · 안내 문장 가운데 · 배너는 처음 화면에서 정사각형으로 크게 */
.cx-brand b { font-size: 1.3rem; letter-spacing: -.02em; }
.cx-by { display: inline-flex; align-items: baseline; gap: 4px; font-size: .78rem; color: var(--muted); }
.cx-by .wordmark { background: none; color: var(--ink); -webkit-text-fill-color: var(--ink); font-weight: 800; font-size: .98rem; filter: drop-shadow(0 0 8px rgba(255, 106, 42, .22)); animation: none; }
.cx-by .wordmark .dot { color: var(--accent); -webkit-text-fill-color: var(--accent); }
.cx-hi { font-size: 1rem; }
.cx.ad-off .cx-ad { display: none; }
.cx.ad-big .cx-ad { height: auto; display: flex; justify-content: center; }
.cx.ad-big .cx-ad .bn { height: min(calc(100vw - 24px), 48dvh, 496px); aspect-ratio: 1 / 1; width: auto; max-width: 100%; }
.cx.ad-big .bn-title { font-size: 1.6rem; }
/* 관리자 배너 미리보기도 정사각형 */
.bn-prev { height: 120px; width: 120px; } .bn-prev.big { height: 260px; width: 260px; max-width: 100%; }
.bn-item { grid-template-columns: 120px minmax(0, 1fr); }

/* 고객 화면 (10/12 오후 2): 거래처 이름 옆에 by ambi., 맨 위 여백, 문의 안내 줄바꿈 */
.cx-top { padding-top: calc(22px + env(safe-area-inset-top)); }
.cx-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cx-empty { white-space: pre-line; }
/* 두 번 눌러 확대 막기 (일정 앱·거래처·고객 화면) */
html.nozoom, html.nozoom body { touch-action: pan-x pan-y; } /* 손가락 두 개 확대·두 번 눌러 확대 모두 막음 (삼성 인터넷은 화면 설정을 무시해서) */
/* 아이폰은 16px 보다 작은 입력칸을 누르면 화면을 키움 → 입력칸 글자는 16px 이상 */
@supports (-webkit-touch-callout: none) { html.nozoom input, html.nozoom select, html.nozoom textarea { font-size: max(16px, 1em); } }
/* 거래처 포털: 특이사항 넓게 */
.reqrow textarea[name=memo], .sub textarea[name=memo] { min-height: 7.5em; resize: vertical; }
/* 거래처 포털: 작업 여러 개 */
.workpicks { display: grid; gap: 6px; }
.wp-list { display: grid; gap: 8px; }
.wp-row { display: flex; gap: 6px; align-items: flex-start; }
.wp-row > .workpick { flex: 1 1 auto; min-width: 0; }
.wp-x { border: 0; background: none; font-size: 1.2rem; color: var(--muted); width: 36px; height: 40px; cursor: pointer; flex: 0 0 auto; }
.workpicks > .btn.link { justify-self: start; }
/* 인테리어 문의 (관리자) */
.inq-row .ag-bar { background: var(--accent); }
.inq-row.st-seen .ag-bar { background: var(--brand); }
.inq-row.st-link .ag-bar, .inq-row.st-done .ag-bar { background: var(--line); }
.inq-row.st-done .ag-title { color: var(--muted); }
.inq-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.inq-dl dt { color: var(--muted); }
.inq-dl dd { margin: 0; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
.inq-thumbs .thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; }
.inq-ph { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 12px; background: var(--bg); }
.inq-text { margin: 0; white-space: pre-wrap; font: inherit; font-size: .9rem; color: var(--muted); background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.inq-phone { display: flex; align-items: center; gap: 8px; }
.inq-phone input { flex: 1; }
.sd-head > .chip { justify-self: start; }
/* 고객 문의 글 고치기·지우기 (관리자·팀장) */
.cq-tools { display: flex; gap: 10px; justify-content: flex-end; margin-top: 2px; }
.cq-tools .btn.link { padding: 0; min-height: 0; font-size: .78rem; color: var(--muted); }
.cq-list li textarea { width: 100%; margin: 6px 0; }
.rule-diff { margin: 0; padding-left: 1.2em; display: grid; gap: 2px; font-size: .9rem; }
/* ===== 10/13 화면 점검 (자동 검사 + 사진 검토) ===== */
/* 한글은 단어 중간에서 줄을 바꾸지 않음 (긴 영문·숫자만 칸이 모자라면 끊음) */
body { word-break: keep-all; overflow-wrap: break-word; }
/* 고르기 칸: 고른 칸도 둥근 알약 */
.seg { padding: 2px; gap: 2px; background: var(--card); }
.seg button { border-radius: 999px; white-space: nowrap; flex: none; }
/* 답 보내기·보내기 버튼도 알약 */
.composer .btn { border-radius: 999px; }
/* 접는 줄(더 보기 등): 누르기 쉽게 높이 */
details.more > summary, details.sd-more > summary, details.card > summary, details.hist > summary { padding-block: 8px; }
/* 정산 요약 칸: 가로를 꽉 채움, 이름 옆 표시와 띄움 */
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.mcard .row > b .chip { margin-left: 6px; }
/* 분류 규칙 표: 이름 칸이 잘리지 않게 넓게 (옆으로 밀어 봄) */
.tablewrap > table.rtbl { min-width: 680px; }
table.rtbl input:not(.short) { min-width: 9em; }
/* 대화 안 고치기·지우기: 누르기 쉽게 */
.cq-tools { gap: 4px; }
.cq-tools .btn.link { padding: 6px 8px; margin: -4px -2px; font-size: .8rem; }
/* 사진 빼기(×): 보이는 크기는 그대로, 누르는 칸만 넓게 */
.pv .x::after { content: ''; position: absolute; inset: -4px -2px -10px -10px; } /* 옆 사진 쪽으로는 안 넓힘 */
/* 일정 목록 줄 높이 고르게 */
.ag-row { min-height: 68px; }
/* 정산 거르기 줄: 칸 높이 통일, 위에 붙을 때 머리와 사이 틈 가림 */
.board-head { box-shadow: 0 -4px 0 var(--bg); }
.board-head :is(input:not([type=checkbox]):not([type=radio]), select) { height: 38px; padding-block: 0; }
.dhead { box-shadow: 0 -4px 0 var(--bg); }
/* 머리 메뉴 글자 링크: 누름칸 넓게 */
.top nav .btn.link { min-width: 36px; }
.cx-empty { padding-inline: 0 !important; }
.cq-list { max-height: min(420px, 55vh); }
.grid2 > label:has(input[name=work]) { grid-column: 1 / -1; }
/* 거래처 포털 링크: 한 줄 목록 (10/13) */
.pv-list { background: var(--card); border-radius: 18px; overflow: hidden; }
.pv-row { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 10px 16px; cursor: pointer; }
.pv-row + .pv-row { border-top: 1px solid var(--line); }
.pv-row:hover { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.pv-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.pv-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.pv-main b { font-weight: 650; }
.pv-row.off .pv-main b { color: var(--muted); font-weight: 550; }
.pv-go { color: var(--muted); font-size: 1.2rem; }
/* 고르기 칸은 글자만큼만 (칸에 맞춰 늘어나지 않게) */
.seg { justify-self: start; }
/* 상담문의: 광고·배너 링크 줄 */
.inq-pubrow.ag-row { display: flex; align-items: center; gap: 10px; grid-template-columns: none; }
.inq-pubrow .ag-main { flex: 1; min-width: 0; padding-left: 4px; }
.inq-new { display: flex; gap: 8px; align-items: center; }
.inq-new input { flex: 1; min-width: 0; }
.inq-pub .chip { margin-left: 6px; }
.inq-pub .row { flex-wrap: nowrap; flex-shrink: 0; }
/* 일정 화면 날짜 줄이 좁은 휴대폰에서 넘치지 않게 (10/13: 다른 날을 보면 "오늘" 버튼이 생겨 줄이 넓어지며 목록까지 오른쪽으로 밀렸음) */
.wrap { grid-template-columns: minmax(0, 1fr); }
.dtitle { min-width: 0; }
@media (max-width: 560px) {
  .dhead .icon-btn { width: 34px; height: 38px; font-size: 1.25rem; }
  .dtitle { font-size: clamp(1.15rem, 5.4vw, 1.5rem); }
  .dhead .today-btn { padding: 5px 10px; }
}
/* 광고·배너 링크 목록: 줄 전체를 눌러 상세 */
button.inq-pub { width: 100%; font: inherit; color: inherit; text-align: left; background: none; border: 0; border-radius: 0; cursor: pointer; align-items: center; }
button.inq-pub > span[aria-hidden] { font-size: 1.4rem; }
.inq-back { align-self: flex-start; justify-self: start; margin-right: auto; display: block; padding-left: 0; margin-bottom: 4px; }
/* 접는 칸 (설정·팀원 관리): 제목을 누르면 펴고 접음 */
.card.fold > h2 { min-height: 40px; cursor: pointer; display: flex; align-items: center; gap: 8px; margin: 0; user-select: none; }
.card.fold > h2::after { content: ""; margin-left: auto; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; flex: none; margin-right: 4px; }
.card.fold.folded > h2::after { transform: rotate(-45deg); }
.card.fold.folded > :not(h2) { display: none !important; }
.card.fold.folded { padding-block: 14px; }
h2.grp { font-size: .95rem; color: var(--muted); font-weight: 650; margin: 10px 2px -4px; }
.mgrp-n { color: var(--muted); font-weight: 600; font-size: .9em; }
/* 켜기/끄기 스위치 (설정) */
.sw { position: relative; width: 48px; height: 32px; border-radius: 99px; border: 0; background: var(--line); cursor: pointer; flex: none; transition: background .15s; }
.sw i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgb(0 0 0 / .2); transition: transform .15s; }
.sw.on { background: var(--brand); }
.sw.on i { transform: translateX(16px); }
.sw:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.card.mgrp { background: transparent; border: 1px solid var(--line); padding: 12px; }
.card.mgrp > h2 { font-size: 1.1rem; }
.sms-rows { display: grid; }
.sms-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.sms-row:first-child { border-top: 0; }
.sms-row small { display: block; margin-top: 2px; }
.sms-row .chip { flex: none; }
.setup .stack > div:empty { display: none; }
/* 시공 완료: 초록 체크 + 나머지는 흐리게, 목록 아래 "시공 완료 N" 묶음 (10/13 앰비 고름) */
.ag-ck { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #15803d; color: #fff; font-size: .8rem; font-weight: 800; margin-right: 6px; vertical-align: -3px; flex: none; }
.ag-row.st-done .ag-time, .ag-row.st-done .ag-bar, .ag-row.st-done .ag-sub, .ag-row.st-done .ag-side { opacity: .5; }
.ag-row.st-done .ag-title { color: var(--muted); }
.done-head { display: flex; align-items: center; gap: 2px; width: 100%; margin-top: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; }
.done-head .ag-ck { width: 20px; height: 20px; font-size: .72rem; vertical-align: 0; }
.done-head i { margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.done-head.open i { transform: rotate(45deg); }
