/* CLOVER 앱 — 휴대폰 화면이 기준. 넓은 화면에서는 가운데 한 줄로 둔다. */
:root {
  --ink: #0b2240;
  --ink-2: #44566c;
  --ink-3: #7a8a9c;
  --line: #e3e8ee;
  --bg: #f5f7f9;
  --card: #ffffff;
  --brand: #1e8a4c;
  --brand-dark: #0b3d2e;
  --brand-soft: #e3f3e8;
  --bad: #be123c;
  --bad-soft: #ffe4e6;
  --blue: #1d4ed8;
  --blue-soft: #e0e9ff;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --radius: 14px;
  --bar: 54px;
  --nav: 58px;
  --wordmark: "Sora", -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.wrap { width: min(720px, 100%); margin-inline: auto; }

/* ── 위 띠 ── */
.bar {
  position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.bar-in { display: flex; align-items: center; height: var(--bar); padding: 0 8px 0 16px; gap: 4px; }
.bar-in.has-back { padding-left: 4px; }
.bar-title { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; border-radius: 12px; cursor: pointer; flex: none;
}
.icon-btn:active { background: var(--bg); }
.icon-btn svg { width: 24px; height: 24px; }

/* ── 본문 ── */
.main { padding: 14px 14px calc(var(--nav) + 28px + env(safe-area-inset-bottom)); }
.main.no-nav { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.sub { font-size: 13px; color: var(--ink-3); margin: 0 4px 10px; word-break: break-all; }
.section-title { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 18px 4px 8px; display: flex; align-items: center; gap: 8px; }
.section-title:first-child { margin-top: 2px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card + .card { margin-top: 10px; }
.pad { padding: 14px; }

/* 줄 목록 */
.row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 9px 12px 9px 14px;
  background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer;
}
.row:first-child { border-top: 0; }
.row:active { background: var(--bg); }
.row.static { cursor: default; }
.row.static:active { background: none; }
.row-main { flex: 1; min-width: 0; }
.row-name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.row-meta { font-size: 13px; color: var(--ink-3); margin-top: 1px; word-break: break-all; }
.row-meta.bad { color: var(--bad); }
.row .chev { width: 18px; height: 18px; color: var(--ink-3); flex: none; }
.row.dim .row-name { color: var(--ink-3); }

.kind {
  flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; letter-spacing: .02em; background: var(--bg); color: var(--ink-2);
}
.kind svg { width: 22px; height: 22px; }
/* 폴더는 노란 폴더: 테두리는 진하게, 속은 그보다 연하게 채운다(부장님 2026-10-14). 도면 목록 · 현장 폴더 · 폴더 고르기 모두 같은 모양. */
.kind.dir { background: #fff7dd; color: #c98a00; }
.kind.dir svg, .fkind.dir svg { fill: #ffdf80; stroke: #c98a00; }
.kind.pdf { background: var(--bad-soft); color: var(--bad); }
.kind.dwg { background: var(--blue-soft); color: var(--blue); }

.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--ink-2); white-space: nowrap; }
.badge.brand { background: var(--brand-soft); color: var(--brand-dark); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }

.empty { text-align: center; color: var(--ink-3); padding: 44px 20px; font-size: 15px; }
.notice { background: var(--amber-soft); color: #7c3a06; border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 12px; }

/* ── 입력 ── */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 0 2px 5px; }
.input, select.input {
  display: block; width: 100%; height: 48px; padding: 0 14px; font-size: 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; outline: none; appearance: none; -webkit-appearance: none;
}
select.input {
  padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' stroke='%237a8a9c' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search { margin-bottom: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 48px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 16px; font-weight: 700; cursor: pointer;
}
.btn:active { filter: brightness(.96); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.block { display: flex; width: 100%; }
.btn.small { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }   /* 휴대폰 폭에서 단추가 많으면 다음 줄로(글씨가 세 줄로 접히지 않게, 2026-11-04) */
.btn-row > .btn { flex: 1 1 auto; white-space: nowrap; }
.link { color: var(--brand-dark); font-weight: 700; background: none; border: 0; padding: 0; cursor: pointer; font-size: 15px; }
.error { color: var(--bad); font-size: 14px; min-height: 20px; margin: 2px 2px 10px; }

.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15.5px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }

/* 가름 단추(관리 탭) */
.seg { display: flex; background: #e9edf2; border-radius: 12px; padding: 3px; margin-bottom: 12px; }
.seg a { flex: 1; text-align: center; height: 40px; line-height: 40px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.seg a.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(11, 34, 64, .12); }
.count { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; vertical-align: 1px; }

.kv { margin: 0; display: grid; grid-template-columns: 76px 1fr; gap: 4px 10px; font-size: 14.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; word-break: break-all; }

/* ── 아래 띠 ── */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-in { display: flex; height: var(--nav); }
body.kb .nav { display: none; }   /* 글자를 넣는 동안(글자판이 떠 있는 동안)은 바닥 띠를 숨긴다 — app.js 의 focusin/focusout */
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); position: relative; }
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--brand-dark); }
.nav .count { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; }

/* ── 로그인 ── */
.auth { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: calc(28px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom)); background: var(--card); }
.auth-in { width: min(400px, 100%); margin-inline: auto; }
.auth-logo { display: block; width: min(230px, 64%); height: auto; aspect-ratio: 911 / 899; margin: 0 auto 22px; }
.auth h1 { font-size: 20px; margin: 0 0 6px; }
.auth p.lead { color: var(--ink-2); font-size: 14.5px; margin: 0 0 18px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 15px; color: var(--ink-2); }

/* ── 아래에서 올라오는 창 ── */
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(11, 34, 64, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet {
  width: min(720px, 100%); max-height: 88%; display: flex; flex-direction: column; background: var(--card);
  border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom);
}
.sheet-head { display: flex; align-items: center; padding: 6px 6px 6px 18px; border-bottom: 1px solid var(--line); flex: none; }
.sheet-head b { flex: 1; font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-body > p { margin: 0 0 14px; font-size: 15.5px; }
.temp-pw { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 24px; font-weight: 700; letter-spacing: .06em; text-align: center; padding: 16px; background: var(--bg); border-radius: 12px; margin-bottom: 14px; user-select: all; -webkit-user-select: all; }
@media (min-width: 760px) {
  .sheet-back { align-items: center; }
  .sheet { border-radius: 18px; width: 520px; }
}

/* ── 알림 ── */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--nav) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(12px);
  z-index: 80; max-width: min(88vw, 520px); background: var(--ink); color: #fff; font-size: 14.5px; font-weight: 600;
  padding: 11px 16px; border-radius: 12px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--bad); }

.spinner { width: 26px; height: 26px; margin: 46px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } #toast { transition: none; } }

/* ── 줄 안에 누르는 곳이 둘(보기 + 받기) ── */
.row.split { padding: 0 12px 0 0; cursor: default; }
.row.split:active { background: none; }
.row-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 9px 0 9px 14px; }
.row-link:active { background: var(--bg); }

/* ── 도면 보기(화면 전체) ── */
.viewer { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--card); touch-action: none; }   /* 도면 보기에서는 브라우저가 화면 전체를 키우지 않는다(두 손가락 · 두 번 톡) */
.viewer-bar { display: flex; align-items: center; gap: 4px; height: calc(var(--bar) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0 4px; border-bottom: 1px solid var(--line); flex: none; }
.viewer-btn { width: 44px; height: 44px; border: 0; background: none; font-size: 30px; line-height: 1; border-radius: 12px; cursor: pointer; flex: none; }
.viewer-btn:active { background: var(--bg); }
.viewer-title { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-tabs { flex: none; max-width: 42%; height: 38px; padding: 0 30px 0 12px; font-size: 14px; font-weight: 600; border: 1px solid var(--line); border-radius: 10px; background: var(--card); appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' stroke='%237a8a9c' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.viewer-stale { flex: none; background: var(--amber-soft); color: #7c3a06; font-size: 13px; padding: 7px 14px; }
.viewer-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #000; }
.viewer-stage canvas { position: absolute; left: 0; top: 0; display: block; }
.viewer-stage canvas:last-of-type { touch-action: none; }
.viewer-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 80%; text-align: center; font-size: 15px; font-weight: 600; color: var(--ink-2); background: rgba(255, 255, 255, .92); padding: 12px 16px; border-radius: 12px; }
.viewer-msg.bad { color: var(--bad); }
/* 단추 여섯(맞춤 · 치수 · 치수선 · 지우기 · 바탕 · 캡처)이 작은 갤럭시(폭 360)에서 «캡처»가 잘려 안 보였다(부장님 2026-11-02).
   좁은 화면에서는 여백을 줄이고, 그래도 넘치면 띠를 좌우로 밀 수 있다(스크롤 막대는 숨김). */
.viewer-tools { display: flex; align-items: center; gap: 6px; flex: none; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.viewer-tools::-webkit-scrollbar { display: none; }
.viewer-tool { height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 14.5px; font-weight: 700; cursor: pointer; flex: none; white-space: nowrap; }
@media (max-width: 420px) {
  .viewer-tools { gap: 4px; padding-left: 6px; padding-right: 6px; }
  .viewer-tool { padding: 0 8px; font-size: 14px; }
}
.viewer-tool.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.viewer-readout { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); max-width: 90%; padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .94); box-shadow: 0 1px 6px rgba(11, 34, 64, .22); font-size: 16px; font-weight: 800; color: var(--bad); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.viewer-readout:empty { display: none; }
/* «길이»를 켜면 아래에 나오는 선형 · 정렬 고르기(2026-10-19) */
.viewer-mseg { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; padding: 3px; gap: 3px; border-radius: 12px; background: rgba(255, 255, 255, .95); box-shadow: 0 1px 6px rgba(11, 34, 64, .22); }
.viewer-mseg[hidden] { display: none; }
.viewer-mseg button { height: 38px; min-width: 64px; padding: 0 14px; border: 0; border-radius: 9px; background: none; font-size: 14.5px; font-weight: 800; color: var(--ink-2); cursor: pointer; }
.viewer-mseg button.on { background: var(--bad); color: #fff; }

/* ── 캡처 위에 그리기(선 · 글 · 구름 · 지우개 · 색 · 굵기) 2026-10-30 — 도면은 보던 자리 그대로, 위아래 띠만 도면 보기의 띠와 같은 높이로 바꿔 끼운다 ── */
.viewer-draw { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; background: #000; }
.viewer-draw-tools { display: flex; align-items: center; justify-content: center; gap: 6px; flex: none; height: calc(var(--bar) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 6px 0; background: #0f1419; }
.viewer-draw-bottom { display: flex; align-items: center; gap: 5px; flex: none; height: calc(56px + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom); background: #0f1419; }
.viewer-draw-flash { position: absolute; inset: 0; background: #fff; opacity: .85; pointer-events: none; transition: opacity .45s ease-out; }
.viewer-draw-flash.go { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .viewer-draw-flash { transition: none; opacity: 0; } }
.viewer-draw-spacer { flex: 1; }
.viewer-draw .viewer-tool { height: 38px; padding: 0 12px; font-size: 14px; }
.viewer-draw a.viewer-tool { display: inline-flex; align-items: center; text-decoration: none; }
.viewer-draw a.viewer-tool.on { color: #fff; }
.viewer-ico { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 38px; padding: 0; border: 1px solid #3a4250; border-radius: 10px; background: #1b2129; color: #e6ebf1; cursor: pointer; flex: none; }
.viewer-ico.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.viewer-ico.dim { opacity: .4; }
.viewer-ico-svg { display: block; width: 24px; height: 24px; }
.viewer-ico-svg svg { display: block; }
.viewer-colorbtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 38px; padding: 0; border: 1px solid #3a4250; border-radius: 10px; background: #1b2129; cursor: pointer; flex: none; }
.viewer-colorbtn.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.viewer-colorbtn-dot { display: block; width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, .45); }
.viewer-colors { position: absolute; left: 6px; bottom: calc(62px + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #1b2129; border: 1px solid #3a4250; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.viewer-colors[hidden] { display: none; }
.viewer-swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); cursor: pointer; padding: 0; flex: none; }
.viewer-swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--brand); transform: scale(1.12); }
.viewer-draw-stage { position: relative; flex: 1; min-height: 0; display: flex; align-items: flex-start; justify-content: center; touch-action: none; overflow: hidden; }
.viewer-draw-stage canvas { display: block; touch-action: none; }
.viewer-draw-tip { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); max-width: 90%; padding: 4px 12px; border-radius: 999px; background: rgba(15, 20, 25, .8); color: #c6ced8; font-size: 12.5px; white-space: nowrap; pointer-events: none; }
.viewer-draw-tip:empty { display: none; }
/* 굵기 · 글자 크기 슬라이더(왼쪽 작게 → 오른쪽 크게) + 미리보기 */
.viewer-range-wrap { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.viewer-range-pre { width: 30px; height: 32px; display: flex; align-items: center; justify-content: center; flex: none; color: #e6ebf1; }
.viewer-range-dot { display: block; border-radius: 50%; background: currentColor; }
.viewer-range-ga { display: block; line-height: 1; }
.viewer-range { flex: 1; min-width: 50px; height: 32px; margin: 0; accent-color: var(--brand); touch-action: none; }
.viewer-range-val { width: 44px; flex: none; text-align: right; font-size: 11px; font-weight: 700; color: #aab4c0; }
/* 글상자: 찍은 자리에서 바로 타이핑 */
.viewer-text-edit { position: absolute; z-index: 3; padding: 0 0.2em; border: 1px dashed rgba(255, 255, 255, .7); border-radius: 4px; background: rgba(0, 0, 0, .15); outline: none; white-space: pre; line-height: 1.3; caret-color: #fff; }
.viewer-text-edit::placeholder { color: rgba(255, 255, 255, .45); }

/* ── 검토(설계검토서 · 현장 알림) ── */
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.block { margin-bottom: 14px; }
.block-label { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.block-text { font-size: 15.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.photo { position: relative; display: block; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); aspect-ratio: 4 / 3; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo span { position: absolute; left: 6px; top: 6px; font-size: 11.5px; font-weight: 700; color: #fff; background: rgba(11, 34, 64, .72); padding: 2px 8px; border-radius: 999px; }
.photo { padding: 0; cursor: pointer; }
.photo-full { display: block; width: 100%; height: auto; border-radius: 8px; }
button.row-link { border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }


/* ── 홈(첫 화면): 진한 초록 머리 + 흰 종이. 색은 로고의 초록에서 가져왔다 ── */
#app.home-app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--brand-dark); }
.home-head { color: #fff; padding: calc(28px + env(safe-area-inset-top)) 24px 26px; }
.home-word { font-family: var(--wordmark, var(--font)); font-size: 36px; font-weight: 800; letter-spacing: .01em; line-height: 1; }
.home-word2 { font-family: var(--wordmark, var(--font)); font-size: 20px; font-weight: 600; color: #8cc63f; line-height: 1.2; margin-top: 4px; }
.home-hello { font-size: 14.5px; color: #a9d8bc; margin-top: 14px; }
.main.home { flex: 1; background: var(--card); border-radius: 24px 24px 0 0; padding-top: 10px; padding-left: 8px; padding-right: 8px; }

/* ── 현장알림 ── */
textarea.input { height: auto; min-height: 124px; padding: 11px 14px; line-height: 1.5; resize: vertical; font-family: inherit; }
.notice-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.notice-who { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.notice-when { font-size: 13px; color: var(--ink-3); margin-left: auto; }
.notice-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.notice-foot .link { font-size: 13.5px; }
.photo-x { position: absolute; right: 5px; top: 5px; width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0; background: rgba(11, 34, 64, .72); color: #fff; display: grid; place-items: center; cursor: pointer; }
.photo-x svg { width: 16px; height: 16px; }

/* 설치 안내의 차례(1 · 2 · 3): 번호 칸을 좁게 */
.kv.steps { grid-template-columns: 22px 1fr; gap: 9px 8px; font-size: 15px; }
.kv.steps dt { font-weight: 800; color: var(--brand); }

/* ── 전기계산 ── */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; margin-bottom: -12px; }
.grid2 .span2 { grid-column: 1 / -1; }
.grid3 { display: grid; grid-template-columns: 1.15fr 1fr .8fr; gap: 8px; align-items: end; }
.grid3 + .grid3 { margin-top: 8px; }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.kv.calc { grid-template-columns: 64px 1fr; gap: 6px 10px; font-size: 15px; }
.kv.calc dd { word-break: keep-all; overflow-wrap: anywhere; }
.strong { font-weight: 700; }
.calc-note { font-size: 13px; color: var(--ink-3); margin-top: 8px; overflow-wrap: anywhere; }
.calc-note.first { margin: 0 0 10px; }
.calc-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.calc-group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.calc-check { padding: 7px 0; }
.calc-check + .calc-check { border-top: 1px dashed var(--line); }
.calc-check-head { display: flex; align-items: center; gap: 6px; font-size: 14.5px; }
.calc-check-head b { flex: 1; min-width: 0; }
.calc-num { font-weight: 700; white-space: nowrap; }
.calc-clause { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.calc-detail { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; overflow-wrap: anywhere; }
.calc-detail.strong { color: var(--ink); font-size: 14.5px; margin-top: 0; }
.calc-pick { font-size: 21px; font-weight: 800; color: var(--brand-dark); line-height: 1.3; }
.calc-pick.none { font-size: 15.5px; font-weight: 700; color: var(--bad); }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 8px 10px; text-align: right; white-space: nowrap; border-top: 1px solid var(--line); }
.tbl th { border-top: 0; font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--bg); white-space: normal; vertical-align: bottom; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl tr.on td { background: var(--brand-soft); font-weight: 700; }
.tbl td.ok { color: var(--blue); font-weight: 700; }
.tbl td.over { color: var(--bad); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip { height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.chip.on { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.cable { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.cable .input { height: 44px; padding-left: 10px; font-size: 15px; }
.cable select.input { padding-right: 26px; background-position: right 9px center; }
.input.static { display: flex; align-items: center; color: var(--ink-3); background: var(--bg); }
.mini { display: block; min-width: 0; }
.mini > span { display: block; font-size: 12px; font-weight: 700; color: var(--ink-3); margin: 0 2px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cable-del { height: 44px; padding: 0 8px; }
.cable-info { font-size: 13px; color: var(--ink-3); margin-top: 7px; min-height: 19px; }
.cable-info.bad { color: var(--bad); }
.calc-top { margin-bottom: 10px; }
.calc-top:empty { margin-bottom: 0; }
.tbl td.two { white-space: pre-line; line-height: 1.35; }
.tbl th { word-break: keep-all; }
.tbl th.two { white-space: pre-line; line-height: 1.35; }
.btn.cable-add { margin-bottom: 0; }

/* ── 홈(첫 화면) — 부장님이 고른 4번 시안: 흰 이름 띠 · 안 읽은 글 한 줄 · 메뉴 아이콘 한 줄 · 최근 현장알림 ── */
/* 글씨체 Sora (SIL Open Font License) — «CLOVER Shop Drawing» 글자에만 쓴다. 파일은 앱 안에 있다(밖에서 받아 오지 않는다). */
@font-face { font-family: "Sora"; src: url("fonts/sora-latin.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
#app.home4-app { min-height: 100vh; min-height: 100dvh; background: var(--card); }
.home-top { position: sticky; top: 0; z-index: 20; background: var(--card); padding-top: env(safe-area-inset-top); }
.home-top-in { display: flex; align-items: center; height: 60px; padding: 0 6px 0 18px; }
.home-brand { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; font-family: var(--wordmark); white-space: nowrap; }
.home-brand-1 { font-size: 25px; font-weight: 800; color: var(--brand-dark); letter-spacing: .01em; }
.home-brand-2 { font-size: 13.5px; font-weight: 500; color: var(--brand); }
.main.home4 { padding-top: 4px; }
.home-banner { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; text-align: left; cursor: pointer; background: var(--brand-soft); color: var(--brand-dark); border-radius: 14px; padding: 13px 12px 13px 14px; font-size: 14.5px; font-weight: 600; }
.home-banner svg { width: 20px; height: 20px; flex: none; }
.home-banner svg:last-child { width: 16px; height: 16px; opacity: .6; }
.home-banner span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin: 20px 0 18px; }
.home-tiles.n2 { grid-template-columns: repeat(2, 1fr); }
.home-tiles.n3 { grid-template-columns: repeat(3, 1fr); }
.home-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 2px; border-radius: 16px; font-size: 13px; font-weight: 600; text-align: center; white-space: nowrap; }
.home-tile:active { background: var(--bg); }
.home-ico { position: relative; width: 58px; height: 58px; border-radius: 20px; display: grid; place-items: center; background: var(--bg); }
.home-ico svg { width: 28px; height: 28px; }
.home-ico.green { color: var(--brand); }
.home-ico.blue { color: var(--blue); }
.home-ico.amber { color: var(--amber); }
.home-ico.violet { color: #534ab7; }
.home-ico .count { position: absolute; top: -4px; right: -5px; margin: 0; }
.home-gap { height: 8px; background: var(--bg); margin: 0 -14px; }
.home-sec { display: flex; align-items: center; margin: 16px 4px 2px; }
.home-sec b { flex: 1; font-size: 16px; }
.home-sec a { font-size: 13px; font-weight: 600; color: var(--ink-3); padding: 6px 0 6px 12px; }
.home-none { color: var(--ink-3); font-size: 14.5px; padding: 22px 4px; }
.home-item { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 13px 4px; cursor: pointer; }
.home-sec + .home-item { border-top: 0; }
.home-item:active { background: var(--bg); }
.home-item-title { display: flex; align-items: center; gap: 7px; font-size: 15px; font-weight: 600; }
.home-item-title .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-item.read .home-item-title .t { color: var(--ink-3); font-weight: 500; }
.home-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); flex: none; }
.home-item-meta { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }

/* 설계검토서 상태 딱지 — 탐색기와 같은 색(DesignReviewParser.StatusColors). 탐색기에서 색을 바꾸면 여기도 같이. */
.badge.st-review { background: #fce4e4; color: #c62828; }
.badge.st-applied { background: #dce8f8; color: #14538f; }
.badge.st-hold { background: #f3ede0; color: #8a5a0b; }
.badge.st-done { background: #e3f1e7; color: #1e6b3a; }
.badge.st-etc { background: #e8ecef; color: #4c5560; }
.badge-col { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }

/* 앱으로 설치하기를 권하는 띠(휴대폰 브라우저로 들어온 사람에게만) */
.install-card { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 13px 14px 11px; margin-bottom: 12px; text-align: left; }
.install-text { font-size: 14px; color: var(--ink-2); }
.install-acts { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 10px; }
.install-acts .link { font-size: 14px; color: var(--ink-3); font-weight: 600; }

/* ── 도면 목록: 한 줄에 하나(부장님이 고른 2번 시안) — 종류 글자 · 이름 · 고친 날 · 받기 ── */
.frow { display: flex; align-items: center; min-height: 46px; border-top: 1px solid var(--line); }
.frow:first-child { border-top: 0; }
a.frow, .fmain { gap: 8px; padding: 0 0 0 14px; }
a.frow:active, .fmain:active { background: var(--bg); }
.fmain { flex: 1; min-width: 0; display: flex; align-items: center; align-self: stretch; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.fkind { flex: none; width: 31px; font-size: 11.5px; font-weight: 800; letter-spacing: .01em; color: var(--ink-3); }
.fkind.dwg { color: var(--blue); }
.fkind.pdf { color: var(--bad); }
.fkind.dir { color: #c98a00; display: flex; }
.fkind.dir svg { width: 21px; height: 21px; }
.fname { flex: 1; min-width: 0; padding: 7px 0; font-size: 15px; font-weight: 600; line-height: 1.3; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
.fname.dim { color: var(--ink-3); }
.frow .badge { flex: none; }
.fday { flex: none; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.fget { flex: none; width: 46px; align-self: stretch; display: grid; place-items: center; color: var(--ink-2); }
.fget svg { width: 20px; height: 20px; }
a.fget:active { background: var(--bg); }
.fget.none { color: var(--ink-3); }
.fget.none svg { width: 18px; height: 18px; }

/* 로그인 화면의 «가입 신청» — 글씨가 아니라 누르는 단추로 */
.auth-or { display: flex; align-items: center; gap: 10px; margin: 20px 0 10px; font-size: 13px; color: var(--ink-3); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.auth-join { margin-bottom: 0; border-color: var(--brand); color: var(--brand-dark); }

/* 시험 계정으로 보는 중임을 알리는 띠(관리자만 쓴다) */
.test-bar { background: var(--amber-soft); color: #7c3a06; font-size: 13.5px; font-weight: 600; padding-top: env(safe-area-inset-top); }
.test-bar-in { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 8px 4px 16px; }
.test-bar-in span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.test-bar-in button { flex: none; height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid #d9a441; background: #fff; color: #7c3a06; font-size: 13px; font-weight: 700; cursor: pointer; }
.test-bar + .bar, .test-bar + .home-top { padding-top: 0; }

/* ── 업무일정(관리자만): 주간업무현황 + 캘린더 ── */
.home-tiles.n5 { grid-template-columns: repeat(5, 1fr); gap: 0; }
.home-tiles.n5 .home-tile { font-size: 12px; letter-spacing: -.02em; }
.home-tiles.n5 .home-ico { width: 52px; height: 52px; border-radius: 18px; }
.home-tiles.n5 .home-ico svg { width: 26px; height: 26px; }
.home-ico.teal { color: #0f6e56; }
.work-chips { flex-wrap: nowrap; gap: 4px; }
.work-chips .chip { flex: 1 1 0; min-width: 0; padding: 0 2px; font-size: 12.5px; letter-spacing: -.02em; white-space: nowrap; }
.chip.hot:not(.on) { border-color: var(--bad); color: var(--bad); }
.work-list { display: flex; flex-direction: column; gap: 8px; }
.work-card { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; font: inherit; color: inherit; }
.work-card:active { background: var(--bg); }
.work-card.urgent { border: 1.5px solid var(--bad); background: #fff7f7; }
.work-card.done { background: #f3f8f4; }
.work-card.done .work-title { color: var(--ink-3); }
.work-title { font-size: 15.5px; font-weight: 600; overflow-wrap: anywhere; }
.work-site { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.work-tags:empty { display: none; }
.cal-head { display: flex; align-items: center; gap: 2px; margin-bottom: 8px; }
.cal-head b { font-size: 16px; min-width: 96px; text-align: center; }
.cal-head .btn { margin-left: auto; }
.cal-head .icon-btn svg { width: 20px; height: 20px; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-week span { text-align: center; font-size: 12px; font-weight: 700; color: var(--ink-3); padding: 8px 0 6px; }
.cal-week .sun, .cal-cell.sun .cal-num { color: var(--bad); }
.cal-week .sat, .cal-cell.sat .cal-num { color: var(--blue); }
.cal-cell { height: 52px; border: 0; border-top: 1px solid var(--line); background: none; padding: 5px 0 0; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; font: inherit; color: inherit; }
.cal-cell.blank { cursor: default; }
.cal-num { width: 26px; height: 26px; line-height: 26px; border-radius: 50%; font-size: 14px; font-weight: 600; text-align: center; }
.cal-cell.today .cal-num { background: var(--brand-soft); color: var(--brand-dark); }
.cal-cell.on .cal-num { background: var(--brand-dark); color: #fff; }
.cal-dots { display: flex; align-items: center; gap: 3px; height: 8px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.cal-dots i.event { background: var(--blue); }
.cal-dots i.hot { background: var(--bad); }
.cal-dots i.done { background: #b9c3cf; }
.cal-dots b { font-size: 9px; font-weight: 700; color: var(--ink-3); line-height: 8px; }

/* 화면 가운데에 뜨는 창(공지 읽기) */
.sheet-back.center { align-items: center; padding: 18px 16px; }
.sheet-back.center .sheet { border-radius: 18px; max-height: 86%; padding-bottom: 0; }
/* 날짜 칸: 아이폰에서 글자가 칸 위쪽으로 붙는 것을 가운데로(부장님 2026-10-13) */
input[type="date"].input { display: flex; align-items: center; -webkit-appearance: none; appearance: none; line-height: 46px; min-width: 0; }
input[type="date"].input::-webkit-date-and-time-value { text-align: left; margin: 0; line-height: 46px; min-height: 46px; }
input[type="date"].input::-webkit-datetime-edit { padding: 0; line-height: 46px; }
/* 관리자 첫 화면의 «오늘 업무일정» — 현장 이름 줄 */
.today-site { font-size: 12.5px; font-weight: 700; color: var(--brand-dark); background: var(--brand-soft); border-radius: 8px; padding: 5px 10px; margin: 10px 2px 2px; }
.home-item-title .badge { flex: none; }

/* ── 자재 통제 (2026-10-24) ── */
.home-tiles.n6 { grid-template-columns: repeat(3, 1fr); }
.home-ico.dark { color: var(--brand-dark); }
.mat-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.mat-kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.mat-kpi small { display: block; font-size: 11.5px; color: var(--ink-3); }
.mat-kpi b { font-size: 20px; }
.mat-kpi b.bad { color: var(--bad); } .mat-kpi b.amber { color: var(--amber); }
.mat-site { display: block; padding: 14px; }
.mat-site.warn { border-color: #f1d59b; background: #fffbf0; } .mat-site.bad { border-color: #f3b8c3; background: #fff7f8; }
.mat-site-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.mat-site-head b { font-size: 16px; }
.mat-who { margin-left: auto; font-size: 12px; color: var(--ink-3); }
.mat-line { display: grid; grid-template-columns: 44px 1fr 92px; gap: 8px; align-items: center; font-size: 13px; margin-top: 6px; }
.mat-line .n { text-align: right; font-variant-numeric: tabular-nums; }
.mat-bar { height: 8px; border-radius: 4px; background: #eef1f5; position: relative; overflow: hidden; }
.mat-bar.small { height: 6px; margin: 6px 0; }
.mat-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--brand); }
.mat-bar i.o { background: var(--blue); } .mat-bar i.warn { background: var(--amber); } .mat-bar i.bad { background: var(--bad); }
.mat-bar em { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); }
.mat-money { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--ink-2); }
.mat-money b { margin-left: auto; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mat-money.ok b { color: var(--brand); } .mat-money.warn b { color: var(--amber); } .mat-money.bad b { color: var(--bad); }
.mat-alert { display: flex; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 13.5px; }
.mat-alert:first-child { border-top: 0; }
.mat-alert:active { background: var(--bg); }
.mat-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.mat-dot.bad { background: var(--bad); } .mat-dot.warn { background: var(--amber); }
.mat-alert-main { flex: 1; min-width: 0; }
.mat-alert-main b { display: block; }
.mat-alert-main small { color: var(--ink-3); display: block; }
.mat-amt { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mat-amt.bad { color: var(--bad); } .mat-amt.warn { color: var(--amber); }
.mat-head { margin: 2px 4px 10px; }
.mat-head b { display: block; font-size: 17px; }
.mat-legend { font-size: 12px; color: var(--ink-3); margin: 0 4px 8px; }
.mat-spec { display: block; padding: 11px 14px; border-top: 1px solid var(--line); }
.mat-spec:first-child { border-top: 0; }
.mat-spec:active { background: var(--bg); }
.mat-spec-top { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.mat-spec-over { margin-left: auto; font-size: 13px; font-weight: 700; white-space: nowrap; }
.mat-spec-over.warn { color: var(--amber); } .mat-spec-over.bad { color: var(--bad); }
.mat-spec-nums { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--ink-3); }
.mat-price { margin-left: auto; }
.mat-row-m { font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mat-calc { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 10px 0; }
.mat-calc div { background: var(--bg); border-radius: 10px; padding: 7px 8px; font-size: 11.5px; color: var(--ink-3); }
.mat-calc b { display: block; font-size: 13.5px; color: var(--ink); white-space: nowrap; }
.mat-floor { border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; margin-top: 8px; position: relative; }
.mat-floor-lab { position: absolute; left: 10px; top: 8px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.mat-floor svg { display: block; width: 100%; height: auto; }
.mat-order .row-name { font-size: 15px; }
