/* DXF 도면 작업 웹 — 화면 스타일
 *
 * 원칙
 *  1) 클래스·id 이름은 app.js 가 쓰는 그대로 둔다. 모양만 손본다.
 *  2) 바깥 폰트·아이콘을 부르지 않는다 (인터넷 없는 곳에서 돈다).
 *  3) 손가락으로 눌러야 하니 누르는 것은 44px 이상.
 */

/* ── 색·치수 ───────────────────────────────────────────── */
:root {
  /* ── 바탕 ──
     단계마다 확실히 차이나게 잡았다. 예전에는 단계 차이가 3~5 밖에 안 나
     입력칸과 바탕이 붙어 보였다. */
  --bg:        #0f1319;   /* 가장 어두운 바탕 */
  --panel:     #161c26;   /* 사이드바 */
  --panel2:    #202836;   /* 입력칸·보조 단추 */
  --panel3:    #2b3545;   /* 눌린 것·강조 */
  --card:      #182029;   /* 본문 카드 */
  --line:      #2b3441;
  --line2:     #3d4a5c;

  /* ── 글씨 ──
     바탕(#0f1319) 대비 — fg 15.9:1 · fg2 11.2:1 · dim 7.4:1 · dim2 4.6:1.
     예전 dim(#97a3b6)은 도움말이 잘 안 읽혔다. */
  --fg:        #f2f6fb;
  --fg2:       #d3dbe6;
  --dim:       #a9b6c7;   /* 도움말 */
  --dim2:      #8493a6;   /* 더 여린 글씨 */

  /* ── 강조 ──
     흰 글씨를 올리는 채움 파랑. 실측 대비(2026-08-08 재계산) —
     #2f7ef0 은 흰 글씨와 4.0:1 로 AA(4.5:1) 미달이었다 (주석의 5.9:1 는 오기).
     #2b6fd6 으로 한 단계 낮춰 4.8:1. hover 는 #3a7de0 (4.1:1 — 잠깐 지나는
     상태라 허용하되 기본 상태는 AA 를 지킨다). */
  --accent:    #2b6fd6;
  --accent-hi: #3a7de0;
  --accent2:   #9ec8ff;   /* 어두운 바탕 위의 파란 글씨 */
  --accent-ink:#ffffff;
  --accent-bg: rgba(78,145,247,.16);
  --accent-ln: rgba(78,145,247,.55);

  --ok:        #35d29b;
  --warn:      #ffc061;
  --bad:       #ff7b7b;
  --bad-bg:    rgba(255,123,123,.14);
  --warn-bg:   rgba(255,192,97,.14);

  --radius:    12px;
  --radius-lg: 16px;
  --radius-sm: 9px;
  --touch:     46px;

  --side-w:    328px;     /* 예전 284px — 도구 설명이 두 줄로 접혀 읽기 나빴다 */
  --read:      1100px;    /* 본문 최대 너비 */

  --shadow:    0 10px 30px -12px rgba(0,0,0,.75);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.85);

  --mono: Consolas, "D2Coding", "Cascadia Mono", "Courier New", monospace;

  /* 레이어 표의 칸 너비 — 머리글과 각 줄이 같은 값을 써야 세로줄이 맞는다
     (줄마다 grid 가 따로라 너비를 못 박지 않으면 어긋난다) */
  --lnum-w: 78px;
  --lcol-w: 112px;
  --lmrg-w: 190px;
  --ldel-w: 54px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI",
               "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo",
               "Noto Sans KR", sans-serif;
  font-size: 15px; line-height: 1.62; letter-spacing: -0.01em;
  word-break: keep-all;                 /* 한글은 낱말 단위로 줄바꿈 */
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; }
h1, h2, h3 { letter-spacing: -0.02em; }
::selection { background: rgba(90,168,255,.32); }

/* 키보드 초점은 또렷하게, 마우스 클릭에는 테두리가 남지 않게 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 스크롤 막대 */
/* 마우스 위주 사용자는 스크롤바를 「잡아서」 내린다 — 가늘면 못 잡는다 */
* { scrollbar-width: auto; scrollbar-color: #4a5668 transparent; }
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #4a5668; border-radius: 9px;
  border: 3px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: #5b6a80; background-clip: padding-box; }

/* ── 레이아웃 ───────────────────────────────────────────── */
#app { display: flex; height: 100%; }

#side {
  width: 284px; flex: 0 0 284px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
#side header {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.035), transparent);
}
#side h1 {
  margin: 0; font-size: 15.5px; font-weight: 700; color: var(--fg);
  display: flex; align-items: center; gap: 9px;
}
#side h1::before {                      /* 작은 표식 — 그림 파일 없이 */
  content: ''; width: 4px; height: 17px; border-radius: 3px; flex: none;
  background: linear-gradient(180deg, var(--accent2), var(--accent));
}
#side .sub {
  color: var(--dim); font-size: 11.5px; line-height: 1.5;
  margin-top: 7px; word-break: break-all;
}

/* ── 프로젝트 고르개 ───────────────────────────────────── */
.projBox { display: flex; gap: 7px; margin: 12px 0 2px; }
.projBox select {
  flex: 1; min-width: 0;
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: var(--radius-sm); padding: 9px 32px 9px 11px;
  min-height: var(--touch); font-size: 13.5px; font-weight: 600; color: var(--fg);
}
.projBox button {
  width: var(--touch); flex: none;
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: var(--radius-sm); font-size: 18px; line-height: 1; color: var(--dim);
  min-height: var(--touch);
  transition: border-color .15s, color .15s, background .15s;
}
.projBox button:hover { border-color: var(--accent-ln); color: var(--accent); background: var(--accent-bg); }

.projTag {
  font-size: 13px; font-weight: 600; color: var(--accent2);
  background: var(--accent-bg); border: 1px solid var(--accent-ln);
  border-radius: 999px; padding: 3px 11px; white-space: nowrap;
}

/* ── 도구 목록 (여기가 핵심) ───────────────────────────── */
#toolList { overflow-y: auto; overflow-x: hidden; flex: 1; padding: 2px 0 24px; }

/* 분류 머리글 — 스크롤해도 위에 붙어 있어 지금 어느 묶음인지 늘 보인다 */
.grp {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  margin: 0; padding: 16px 16px 8px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  color: #aab6c8; font-size: 11.5px; font-weight: 700;
  letter-spacing: .07em; line-height: 1.3;
}
.grp::before {
  content: ''; width: 6px; height: 6px; border-radius: 2px; flex: none;
  background: var(--accent); opacity: .65;
}
.grp:first-child { padding-top: 12px; }

/* 도구 한 칸 */
.tool {
  position: relative; display: block; width: calc(100% - 16px);
  margin: 5px 8px 0; padding: 10px 30px 11px 13px;
  text-align: left; border-radius: var(--radius);
  min-height: var(--touch); color: var(--fg2);
  transition: background .14s, color .14s;
}
.tool::before {                          /* 고른 표시 막대 */
  content: ''; position: absolute; left: -5px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 0; border-radius: 3px;
  background: var(--accent); transition: height .16s ease;
}
.tool b {
  display: block; font-weight: 600; font-size: 14.5px; line-height: 1.4;
  color: inherit;
}
.tool span {                             /* 설명은 두 줄까지만 — 목록이 흐트러지지 않게 */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--dim2); font-size: 13px; line-height: 1.45; margin-top: 2px;
}
.tool:hover { background: rgba(255,255,255,.05); color: var(--fg); }
.tool:hover span { color: var(--dim); }
.tool:active { background: rgba(255,255,255,.08); }

.tool.on {
  background: var(--accent-bg);
  box-shadow: inset 0 0 0 1px var(--accent-ln);
  color: #dceaff;
}
.tool.on::before { height: 56%; }
.tool.on b { font-weight: 700; }
.tool.on span { color: #93b6dc; }
.tool.on::after {                        /* 오른쪽 꺾쇠 */
  content: ''; position: absolute; right: 14px; top: 50%;
  width: 7px; height: 7px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: translateY(-50%) rotate(-45deg);
}

#side footer {
  border-top: 1px solid var(--line); padding: 10px 12px;
  display: flex; gap: 8px;
  background: linear-gradient(0deg, rgba(0,0,0,.25), transparent);
}
#side footer button {
  flex: 1; background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 9px 6px; font-size: 12.5px;
  color: var(--dim); min-height: 42px;
  transition: color .15s, border-color .15s, background .15s;
}
#side footer button:hover { color: var(--fg); border-color: var(--line2); background: var(--panel3); }
#side footer #logoutBtn:hover { color: var(--bad); border-color: rgba(255,111,111,.45); background: var(--bad-bg); }

/* ── 오른쪽 본문 ───────────────────────────────────────── */
#main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }

#head {
  padding: 13px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent);
}
#head h2 {
  margin: 0; font-size: 18px; font-weight: 700; color: var(--fg);
  margin-right: 2px;
}
#head .est {
  color: var(--dim); font-size: 13px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
#head .est:empty { display: none; }
#head .danger {
  color: var(--warn); font-size: 13px; font-weight: 600;
  background: var(--warn-bg); border: 1px solid rgba(255,181,74,.45);
  border-radius: 999px; padding: 3px 11px; white-space: nowrap;
}
#menuBtn { display: none; }

/* 화면 위쪽 오른쪽 끝에 붙는 단추 (로그아웃 등) */
.topbtn {
  margin-left: auto; flex: none;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 8px 15px; font-size: 12.5px;
  color: var(--dim); min-height: 38px;
  transition: color .15s, border-color .15s, background .15s;
}
.topbtn:hover { border-color: rgba(255,111,111,.45); color: var(--bad); background: var(--bad-bg); }

#body { flex: 1; overflow-y: auto; }
#pad { padding: 22px 22px 56px; max-width: 920px; }

.desc {
  color: var(--dim); font-size: 13.5px; line-height: 1.72;
  margin: 0 0 20px; white-space: pre-line;
  border-left: 2px solid var(--line2); padding-left: 14px;
}
.desc:empty { display: none; }

/* ── 옵션 폼 ───────────────────────────────────────────── */
/* 옵션 칸 배치 — **짧은 칸은 둘씩 나란히** (2026-08-17).
   전에는 세로 한 줄씩이라 「합치는 방식」 같은 고르개가 넓은 화면에서 혼자
   덩그러니 놓였고, 짝지어 봐야 하는 것들이 서로 멀어져 스크롤을 오갔다.
   도면 고르개·레이어 표처럼 넓어야 쓸 수 있는 것만 `.wide` 로 한 줄을 쓴다. */
#opts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 6px 18px 18px;
}
#opts:empty { display: none; }

.opt {
  padding: 14px 0 0; margin: 0; min-width: 0;
  border-top: 1px solid var(--line);
}
.opt.wide { grid-column: 1 / -1; }
.opt:first-child { border-top: 0; padding-top: 16px; }
/* 첫 칸이 넓은 칸(도면 고르개)이면 그다음 두 칸이 한 줄을 이룬다 — 그 줄의
   윗줄만 남기고, 짝이 되는 칸의 줄이 어긋나 보이지 않게 한다 */
.opt.wide:first-child + .opt.narrow + .opt.narrow { border-top: 1px solid var(--line); }

/* 체크 한 칸(bool)은 위에 이름표가 없어서, 옆의 고르개보다 한 줄 높이 뜬다.
   나란히 놓을 때만 이름표 높이만큼 내려 **눈높이를 맞춘다.** */
@media (min-width: 821px) {
  .opt.isBool .check { margin-top: 25px; }
}
@media (max-width: 820px) {
  #opts { grid-template-columns: 1fr; }
}

.opt > label {
  display: block; font-size: 13.5px; font-weight: 700; color: var(--fg);
  margin-bottom: 7px; letter-spacing: -0.005em;
}
.help {
  color: var(--dim); font-size: 12.5px; line-height: 1.6; margin-top: 7px;
}
.opt .help { margin-top: 7px; }

/* 입력칸 공통 */
.opt input[type=text], .opt input[type=number], .opt select, .opt textarea {
  width: 100%; background: var(--bg);
  border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 11px 13px; min-height: var(--touch); color: var(--fg);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.opt input::placeholder, .opt textarea::placeholder { color: var(--dim2); }
.opt textarea {
  min-height: 104px; resize: vertical;
  font-family: var(--mono); font-size: 13px; line-height: 1.6; letter-spacing: 0;
}
.opt input:hover, .opt select:hover, .opt textarea:hover { border-color: #3e4a5c; }
.opt input:focus, .opt select:focus, .opt textarea:focus,
.projBox select:focus, .mcard input:focus, #loginCard input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(90,168,255,.18);
}

/* 고르개 — 화살표를 직접 그린다 (바깥 아이콘 없이) */
.opt select, .projBox select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image:
    url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2397a3b6' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.6 6 6.4 11 1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  padding-right: 34px;
}
.opt select[multiple] {
  background-image: none; padding: 6px; min-height: 150px;
  line-height: 1.7;
}
.opt select[multiple] option { padding: 7px 9px; border-radius: 6px; }
option { background: var(--panel2); color: var(--fg); }

/* 예·아니오 */
.check {
  display: flex; align-items: center; gap: 11px;
  min-height: var(--touch); padding: 8px 13px;
  background: var(--bg); border: 1px solid var(--line2); border-radius: var(--radius);
  transition: border-color .15s, background .15s;
}
.check:hover { border-color: #3e4a5c; }
.check input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); cursor: pointer; }
.check label { font-size: 14px; font-weight: 600; margin: 0; cursor: pointer; flex: 1; }

/* 여러 개 고르기 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line2); background: var(--panel2); border-radius: 999px;
  padding: 9px 15px; min-height: 42px; font-size: 13px; color: var(--fg2);
  transition: border-color .14s, background .14s, color .14s;
}
.chip:hover { border-color: var(--accent-ln); color: var(--fg); }
.chip.on {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  font-weight: 700;
}

/* 색 고르기 */
.colorRow { display: flex; align-items: center; gap: 11px; margin-top: 2px; }
.sw {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  border: 1px solid var(--line2); flex: none;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.35);
}
.colorRow input[type=number] { width: 96px; flex: none; }
.colorRow .cname { color: var(--dim); font-size: 12.5px; }

.palette { margin-bottom: 9px; }
.palette .row { display: flex; flex-wrap: wrap; gap: 6px; }
.palette .p {
  width: 32px; height: 32px; border-radius: 7px; padding: 0;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.4);
  transition: transform .1s;
}
.palette .p:hover { transform: scale(1.1); }
.palette .p.on { border-color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.2); }

/* ── 레이어 표 ─────────────────────────────────────────── */
.lmbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 2px 0 10px;
}
.lmbar .help { margin: 0; }
.lmbar .chip { min-height: 38px; padding: 7px 14px; font-size: 12.5px; }

.lmap {
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--bg);
}
.lrow {
  display: grid; grid-template-columns: 1fr 72px auto auto auto;
  align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}
.lrow:last-child { border-bottom: 0; }
.lrow:nth-child(even) { background: rgba(255,255,255,.022); }
.lrow:hover:not(.lhead) { background: rgba(90,168,255,.07); }
.lhead {
  background: var(--panel2); font-size: 11.5px; color: var(--dim);
  font-weight: 700; letter-spacing: .04em;
  position: sticky; top: 0; z-index: 1;
}
.lname { min-width: 0; }
.lname b { display: block; font-size: 13.5px; font-weight: 600; word-break: break-all; }
.lname i { display: block; font-style: normal; color: var(--dim2); font-size: 11.5px; line-height: 1.45; }
.lcnt { text-align: right; color: var(--dim); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.lcol { display: flex; align-items: center; gap: 8px; width: var(--lcol-w); }
.lhead .lmrg { width: var(--lmrg-w); }
/* 표 안의 칸은 좁아야 한다 — 위쪽 '.opt input' 규칙보다 세게 잡는다 */
.opt .lcol input[type=number], .opt .lrow input.lmrg, .lcol input, input.lmrg {
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 7px; padding: 7px 9px; min-height: 38px; color: var(--fg);
}
.opt .lcol input[type=number], .lcol input { width: var(--lnum-w); text-align: center; }
.opt .lrow input.lmrg, input.lmrg { width: var(--lmrg-w); }
.lcol input:focus, input.lmrg:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(90,168,255,.18);
}
.sw.sm { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line2); flex: none; }
input.lmrg::placeholder { color: var(--dim2); }   /* 「비우면 그대로」의 기준값 — 보여야 한다 */
.ldel { text-align: center; width: var(--ldel-w); }
.ldel input { width: 22px; height: 22px; accent-color: var(--bad); cursor: pointer; }

/* ── 실행 줄 ───────────────────────────────────────────── */
#runBar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin: 22px 0 4px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.btn {
  /* 단색이다 — 예전 그라데이션(옅은→진한 파랑)은 글씨 가운데 자리 대비가
     2.5:1 까지 떨어졌다 (UX 검증 2026-08-08). 단색 --accent 는 4.8:1. */
  background: var(--accent);
  color: var(--accent-ink); border: 0; border-radius: var(--radius);
  padding: 0 28px; min-height: var(--touch);
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 8px 18px -10px rgba(90,168,255,.9);
  transition: filter .15s, transform .06s, box-shadow .15s, background .15s;
}
.btn:hover:not(:disabled) { background: var(--accent-hi); filter: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .38; box-shadow: none; cursor: not-allowed; }
.btn.ghost {
  background: var(--panel2); color: var(--fg2); border: 1px solid var(--line2);
  font-weight: 600; box-shadow: none; padding: 0 20px;
}
.btn.ghost:hover:not(:disabled) { background: var(--panel3); color: var(--fg); filter: none; }
.btn.stop {
  /* 흰 글씨+옅은 빨강은 2.4:1 이었다 — 어두운 글씨로 뒤집어 7:1 이상 */
  background: var(--bad); color: #2a1210; font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 8px 18px -10px rgba(255,111,111,.9);
}

#status {
  font-size: 13px; color: var(--dim); margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  font-variant-numeric: tabular-nums;
}
#status:empty { display: none; }
#status::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: currentColor; opacity: .8;
}
#status.run { color: var(--accent); }
#status.run::before { animation: blip 1.1s ease-in-out infinite; }
#status.ok { color: var(--ok); }
#status.err { color: var(--bad); }
@keyframes blip { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .3; transform: scale(.75); } }

/* ── 실행 기록(로그) ───────────────────────────────────── */
#logBox { margin-top: 18px; display: none; }
#logBox.show { display: block; }
#logBox::before {
  content: '실행 기록';
  display: block; font-size: 13px; font-weight: 700; letter-spacing: .06em;
  color: var(--dim); margin: 0 0 8px 3px;
}
#log {
  background: #080a0e; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.62; letter-spacing: 0;
  white-space: pre-wrap; word-break: break-all;
  max-height: 46vh; overflow-y: auto; color: #b9c4d3;
}
#log div { padding: 0 0 0 10px; border-left: 2px solid transparent; }
#log .e { color: var(--bad); border-left-color: var(--bad); background: rgba(255,111,111,.07); }
#log .w { color: var(--warn); border-left-color: rgba(255,181,74,.6); }
#log .g { color: var(--ok); border-left-color: rgba(66,211,154,.5); }

/* ── 결과 파일 ─────────────────────────────────────────── */
#files { margin-top: 18px; display: none; }
#files.show { display: block; }
#files::before {
  content: '결과';
  display: block; font-size: 13px; font-weight: 700; letter-spacing: .06em;
  color: var(--dim); margin: 0 0 8px 3px;
}
.file {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 3px solid var(--accent-ln);
  border-radius: var(--radius); padding: 11px 13px; margin-bottom: 8px;
}
.file .nm {
  flex: 1; min-width: 170px; font-size: 13.5px; line-height: 1.55;
  word-break: break-all; color: var(--fg2);
}
.file .sz { color: var(--dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.file a, .file button {
  background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--radius-sm);
  padding: 0 15px; font-size: 12.5px; font-weight: 600; text-decoration: none;
  color: var(--fg2); min-height: 40px; display: inline-flex; align-items: center;
  transition: border-color .15s, color .15s, background .15s;
}
.file a:hover, .file button:hover {
  border-color: var(--accent-ln); color: var(--accent2); background: var(--accent-bg);
}

/* ── 기록 · 저장한 설정 ────────────────────────────────── */
.hist { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.hist h3 {
  font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--dim);
  margin: 0 0 10px 3px;
}
.hrow {
  display: flex; align-items: center; gap: 11px; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 7px;
  background: var(--panel); font-size: 13.5px; width: 100%; text-align: left;
  color: var(--fg2);
  transition: border-color .15s, background .15s, color .15s;
}
button.hrow:hover { border-color: var(--line2); background: var(--panel2); color: var(--fg); }
.hrow .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.hrow .t { color: var(--dim2); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dot.done     { background: var(--ok);     box-shadow: 0 0 0 3px rgba(66,211,154,.16); }
.dot.error    { background: var(--bad);    box-shadow: 0 0 0 3px rgba(255,111,111,.16); }
.dot.canceled { background: var(--dim2); }
.dot.running  { background: var(--accent); box-shadow: 0 0 0 3px rgba(90,168,255,.18); animation: blip 1.1s ease-in-out infinite; }
.dot.queued   { background: var(--warn);   box-shadow: 0 0 0 3px rgba(255,181,74,.16); }

.rname {
  flex: 1; text-align: left; background: none; border: 0; padding: 0; min-width: 0;
  color: inherit;
}
.rname b { display: block; font-size: 13.5px; font-weight: 600; color: var(--fg); }
.rname i { display: block; font-style: normal; color: var(--dim2); font-size: 11.5px; line-height: 1.5; }
.rdel {
  background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 13px; min-height: 38px; font-size: 13px; color: var(--dim); flex: none;
  transition: border-color .15s, color .15s, background .15s;
}
.rdel:hover { border-color: rgba(255,111,111,.45); color: var(--bad); background: var(--bad-bg); }

/* ── 새 프로젝트 창 ────────────────────────────────────── */
.modal {
  display: none; position: fixed; inset: 0; z-index: 60;
  background: rgba(4,6,10,.72); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; padding: 18px;
}
.modal.on { display: flex; animation: fade .16s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.mcard {
  background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius-lg);
  padding: 24px 24px 20px; width: 100%; max-width: 460px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.mcard h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.mcard .help { margin: 0 0 6px; }
.mcard label {
  display: block; font-size: 13px; font-weight: 700; color: var(--fg);
  margin: 16px 0 6px;
}
.mcard input {
  width: 100%; background: var(--bg); border: 1px solid var(--line2);
  border-radius: var(--radius); padding: 11px 13px; min-height: var(--touch);
  transition: border-color .15s, box-shadow .15s;
}
.mcard input::placeholder { color: var(--dim2); }
.mbtns { display: flex; gap: 9px; margin-top: 20px; }
.mbtns .btn { flex: 1; }
.err { color: var(--bad); font-size: 13px; margin-top: 10px; min-height: 18px; }

/* ── 로그인 ───────────────────────────────────────────── */
#loginWrap {
  height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px;
  background:
    radial-gradient(700px 380px at 50% -10%, rgba(90,168,255,.10), transparent 70%),
    var(--bg);
}
#loginCard {
  background: var(--panel); border: 1px solid var(--line2); border-radius: var(--radius-lg);
  padding: 30px 28px; width: 100%; max-width: 360px; box-shadow: var(--shadow);
}
#loginCard h1 { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
#loginCard p { color: var(--dim); font-size: 12.5px; margin: 0 0 20px; }
#loginCard input {
  width: 100%; background: var(--bg); border: 1px solid var(--line2);
  border-radius: var(--radius); padding: 12px 14px; min-height: var(--touch); margin-bottom: 12px;
  transition: border-color .15s, box-shadow .15s;
}
#loginCard button { width: 100%; }
#loginErr { color: var(--bad); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ── 알림 쪽지 ─────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 12px 20px; font-size: 13.5px; z-index: 70; max-width: min(90vw, 520px);
  box-shadow: var(--shadow); color: var(--fg);
  animation: toastIn .2s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ── 태블릿·휴대폰 ───────────────────────────────────── */
@media (max-width: 860px) {
  #app { flex-direction: column; }
  #side {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: 86vw; max-width: 330px; flex-basis: auto;
    transform: translateX(-102%); transition: transform .2s ease;
    box-shadow: 0 0 60px rgba(0,0,0,.65);
  }
  #side.open { transform: none; }
  #menuBtn {
    display: inline-flex; align-items: center; justify-content: center;
    width: var(--touch); height: var(--touch); flex: none;
    background: var(--panel2); border: 1px solid var(--line2);
    border-radius: var(--radius); font-size: 17px; color: var(--fg2);
  }
  #scrim {
    position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 39; display: none;
  }
  #scrim.on { display: block; }

  #head { padding: 10px 14px; gap: 9px; }
  #head h2 { font-size: 16.5px; }
  #pad { padding: 16px 14px 72px; }
  #opts { padding: 4px 14px 16px; border-radius: var(--radius); }
  #runBar { padding: 12px; border-radius: var(--radius); }
  #runBar .btn { flex: 1 1 132px; padding: 0 14px; }
  #status { width: 100%; margin-left: 0; }
  #log { max-height: 40vh; font-size: 13px; }

  /* 도구 목록은 손가락에 맞게 조금 더 넉넉하게 */
  .tool { padding-top: 12px; padding-bottom: 13px; }
  .grp { padding-top: 18px; }

  /* 레이어 표는 좁은 화면에서 칸을 줄인다 */
  :root { --lnum-w: 64px; --lcol-w: 98px; --lmrg-w: 124px; --ldel-w: 40px; }
  /* 좁은 화면에서 표를 억지로 구겨넣지 않고 옆으로 밀어 본다 */
  .lmap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .lrow { gap: 8px; padding: 8px 10px; min-width: 470px; }
  .file a, .file button { min-height: var(--touch); flex: 1 1 auto; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ══════════════════════════════════════════════════════════
   묶음 접기 · 도면 미리보기
   (기존 색·치수 변수를 그대로 쓴다)
   ══════════════════════════════════════════════════════════ */

/* ── 분류 머리글을 누르면 접힌다 ─────────────────────────── */
.grp {
  width: 100%; cursor: pointer;
  justify-content: flex-start;
  transition: color .15s;
}
.grp:hover { color: var(--fg); }
.grp .grpname { flex: 1; text-align: left; }
.grp .grpcnt {
  flex: none; font-size: 10.5px; font-weight: 700; color: var(--dim2);
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 7px; letter-spacing: 0;
}
.grp::after {                       /* 접힘 표시 꺾쇠 */
  content: ''; flex: none; width: 6px; height: 6px; margin-left: 2px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .18s ease; opacity: .55;
}
.grp.off::after { transform: rotate(-45deg) translate(-1px, 1px); }
.grp.off .grpcnt { color: var(--accent2); border-color: var(--accent-ln); background: var(--accent-bg); }
.grpbody { overflow: hidden; }
.grpbody.off { display: none; }

/* ── 도면 고르개 ─────────────────────────────────────────
   **파일 이름이 먼저 보여야 한다.** 현장 이름은 위에서 이미 골랐으므로
   목록에는 안 적고, 현장 안에서의 자리는 묶음 제목으로 물러난다.
   폴더가 여럿일 때만 폴더 고르개가, 도면이 많을 때만 찾기 칸이 나온다.
   여러 장 고르기는 **체크박스 줄 목록**이다 — Ctrl+클릭은 이 사용자층이
   모르는 조작이고, 하나 누르면 먼저 고른 것이 소리 없이 풀리기 때문. */
.fpick { display: block; }
.fpickBar {
  display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap;
}
/* 폴더 고르개는 **한 줄을 통째로** 쓴다 (2026-08-17). 60% 로 묶어 두었더니
   `작업전 › 2026-08-10 › 20260731_최종 수정 완료 › 1단지 › 01.전기` 의 **뒤쪽이
   잘렸다** — 폴더를 가르는 것은 끝 칸인데 하필 그것이 사라진다. */
.fpickDir { flex: 1 1 100%; max-width: 100%; }
.fpickQ { flex: 1 1 160px; min-width: 120px; }
.fpickCnt { flex: none; font-size: 12.5px; color: var(--dim); letter-spacing: 0; }
.fpickSel { width: 100%; }
/* 묶음 제목은 흐리게 — 눈이 파일 이름 줄에 먼저 가게 한다 */
.fpickSel optgroup { color: var(--dim); font-style: normal; font-size: 12px; }
.fpickSel option { color: var(--fg); font-size: 13px; padding: 2px 4px; }

/* 체크박스 줄 목록 (여러 장 고르기) */
.fpickList {
  max-height: 340px; overflow-y: auto;
  border: 1px solid var(--line2); border-radius: var(--radius);
  background: var(--panel2);
}
/* 폴더 머리 — 누르면 접히고, 앞의 체크로 폴더째 고른다 (2026-08-13).
   접혀 있어도 「✓ n개 고름」 이 남아 안에 고른 것이 있음을 알린다. */
.fpkHdr {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; gap: 8px;
  min-height: 38px; padding: 5px 10px; font-size: 12.5px; color: var(--dim);
  background: var(--panel); border-bottom: 1px solid var(--line2);
  cursor: pointer; user-select: none;
}
.fpkHdr:hover { background: rgba(127, 170, 255, .10); }
.fpkHdr.has { color: var(--fg); }
.fpkHCb { width: 18px; height: 18px; flex: none; accent-color: var(--accent); cursor: pointer; }
/* 접혔나 폈나는 **한눈에** 보여야 한다 — 흐린 작은 글자로 두면 어르신 손에
   「눌러도 아무 일 안 나는 줄」 로 보인다 */
.fpkArrow { flex: none; width: 14px; font-size: 14px; color: var(--fg); opacity: .8; }
/* ★ 폴더 이름은 **자르지 않는다** (2026-08-17). 길면 다음 줄로 접어 내린다 —
   잘리면 하필 폴더를 가르는 끝 칸이 사라져서 고를 수가 없다. */
.fpkHName {
  flex: 1 1 auto; min-width: 0; font-weight: 600;
  /* `keep-all` — 한글은 낱말 가운데서 끊지 않는다. 그냥 두면 `02.통신` 이
     `02.` / `통신` 으로 갈라져 폴더 이름이 두 조각으로 읽힌다 (실제로 겪었다).
     접히는 자리는 칸 사이(`›`)여야 한다. */
  white-space: normal; word-break: keep-all; overflow-wrap: break-word;
  line-height: 1.45;
}
.fpkPath { display: inline; }
/* 칸 하나는 통째로 — `02.통신` 이 `02.` / `통신` 으로 갈라지는 것을 막는다.
   (`word-break: keep-all` 만으로는 한글↔숫자 경계에서 끊겼다 — 실측) */
.fpkUp, .fpkLeaf { white-space: nowrap; }
.fpkUp { color: var(--dim); font-weight: 500; }        /* 앞머리는 물러나고 */
.fpkLeaf { color: var(--fg); font-weight: 700; }       /* 끝 칸이 눈에 든다 */
.fpkSep { color: var(--dim2); margin: 0 5px; }
.fpkHCnt { flex: none; color: var(--dim); }
/* 접힌 폴더에 고른 것이 있다는 **희미한 표시** — 있다는 것만 알면 되므로 옅게 */
.fpkHPick {
  flex: none; padding: 1px 7px; border-radius: 999px; font-size: 11.5px;
  color: var(--accent); background: rgba(47, 126, 240, .16);
}
.fpkHdr.fold .fpkHPick { opacity: .75; }
.fpkRow {
  display: flex; align-items: center; gap: 10px;
  /* 폴더 머리보다 한 칸 들여쓴다 — 어느 폴더에 든 도면인지 눈으로 잡히게 */
  min-height: 40px; padding: 4px 10px 4px 26px; cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}
.fpkRow:hover { background: rgba(127, 170, 255, .08); }
.fpkRow.on { background: rgba(47, 126, 240, .14); }
.fpkRow input { width: 20px; height: 20px; flex: none; accent-color: var(--accent); }
.fpkName {
  flex: 1 1 auto; min-width: 0; font-size: 14px; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fpkSize { flex: none; font-size: 12px; color: var(--dim); }
.fpkEmpty { padding: 18px 12px; font-size: 13.5px; color: var(--dim); }
.fpickFoot {
  display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap;
}
.fpBtn {
  min-height: 34px; padding: 4px 14px; font-size: 13px;
  background: var(--panel2); color: var(--fg);
  border: 1px solid var(--line2); border-radius: var(--radius); cursor: pointer;
}
.fpBtn:hover { border-color: var(--accent-ln); }
.fpickN { font-size: 13px; color: var(--dim); letter-spacing: 0; }
.fpickN.on { color: var(--accent2); font-weight: 700; }

/* ── 미리보기 (도면 고르개 아래) ─────────────────────────── */
.pv { display: none; margin-top: 10px; }
.pv.on { display: block; }
.pvimg {
  /* 도면은 가로로 넓기도 하고(계통도) 세로로 길기도 하다(주차장 3개 층).
     상자 크기를 고정하고 그 안에 맞춰 넣는다 — 어느 쪽이든 전체가 보인다. */
  display: block; width: 100%; height: 340px; object-fit: contain;
  background: #000; border: 1px solid var(--line2);
  border-radius: var(--radius) var(--radius) 0 0;
  cursor: zoom-in;
}
.pvbar {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 11px; font-size: 13px; color: var(--dim);
  background: var(--panel2);
  border: 1px solid var(--line2); border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}
.pvbar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pvbtn {
  flex: none; background: var(--panel3); border: 1px solid var(--line2);
  border-radius: var(--radius-sm); padding: 6px 12px; font-size: 13px; color: var(--fg2);
  min-height: 34px;
}
.pvbtn:hover { border-color: var(--accent-ln); color: var(--accent2); background: var(--accent-bg); }
.pvmsg {
  padding: 22px 14px; text-align: center; font-size: 12.5px; color: var(--dim);
  background: var(--panel2); border: 1px dashed var(--line2); border-radius: var(--radius);
}
.pvmsg.warn { color: var(--warn); border-color: rgba(255,181,74,.4); background: var(--warn-bg); }

/* ── 크게 보기 ──────────────────────────────────────────── */
.pvfull {
  position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column;
  background: rgba(3,6,10,.94);
}
.pvfullbar {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid var(--line);
  background: var(--panel); flex: none;
}
.pvfullbar b { font-size: 14px; }
.pvnote { flex: 1; font-size: 13px; color: var(--dim2); }
.pvstage {
  flex: 1; min-height: 0; overflow: hidden; display: flex;
  align-items: center; justify-content: center; touch-action: none; cursor: grab;
}
.pvstage:active { cursor: grabbing; }
.pvstage img {
  max-width: 100%; max-height: 100%;
  transform-origin: center center; will-change: transform;
  user-select: none; -webkit-user-drag: none;
}

@media (max-width: 860px) {
  .pvimg { height: 240px; }
  .pvnote { display: none; }
}

/* ══════════════════════════════════════════════════════════════════
   2026-08 리디자인 — 읽기 쉽게 · 넓게 · 대비 있게
   여기 있는 규칙이 위쪽을 덮어쓴다. 클래스 이름은 하나도 바꾸지 않았다.
   ══════════════════════════════════════════════════════════════════ */

/* ── 글씨 키우기 ────────────────────────────────────────────────── */
html, body { font-size: 16.5px; line-height: 1.66; }

/* ── 사이드바 넓히기 ────────────────────────────────────────────── */
#side { width: var(--side-w); flex: 0 0 var(--side-w); }
#side header { padding: 18px 18px 14px; }
#side h1 { font-size: 17px; }
#side h1::before { height: 19px; }
#side .sub { font-size: 12.5px; color: var(--dim); }

/* ── 도구 목록 — 이름은 크게, 설명은 한 줄로 ───────────────────── */
.grp { padding: 18px 18px 9px; font-size: 12.5px; letter-spacing: .02em; color: #c2cddc; }
.grp .grpcnt { font-size: 12px; }   /* 개수 뱃지 첨자 — 본문 글씨가 아니라 그대로 둔다 */
.tool { padding: 11px 18px; }
.tool b { font-size: 15.5px; font-weight: 650; letter-spacing: -.01em; }
.tool span {
  font-size: 12.8px; color: var(--dim); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.tool.on b { color: var(--accent2); }
.tool:hover span { color: var(--fg2); }

/* ── 도구 찾기 칸 ──────────────────────────────────────────────── */
.toolFind { padding: 10px 18px 4px; }
.toolFind input {
  width: 100%; min-height: 40px; padding: 8px 12px;
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: var(--radius-sm); color: var(--fg); font-size: 14px;
}
.toolFind input::placeholder { color: var(--dim2); }
.toolFind input:focus { border-color: var(--accent-ln); outline: none; }
.grpbody.hide, .grp.hide { display: none; }

/* ── 프로젝트 고르개 — 수백 개도 견디게 ────────────────────────── */
.projBox { gap: 8px; margin: 14px 0 4px; }
#projPick {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px;
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: var(--radius-sm); padding: 9px 12px; min-height: var(--touch);
  color: var(--fg); font-size: 14.5px; font-weight: 650; text-align: left;
  transition: border-color .15s, background .15s;
}
#projPick:hover { border-color: var(--accent-ln); background: var(--panel3); }
#projPick .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#projPick .cv { color: var(--dim2); font-size: 13px; flex: none; }

/* 고르개 창 */
#pickWrap { align-items: flex-start; }
#pickWrap .mcard { max-width: 560px; width: min(560px, 94vw); padding: 18px; margin-top: 8vh; }
#pickSearch {
  width: 100%; min-height: 46px; padding: 11px 14px; font-size: 15.5px;
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: var(--radius-sm); color: var(--fg); margin-bottom: 10px;
}
#pickSearch:focus { border-color: var(--accent); outline: none; }
#pickList { max-height: 56vh; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
#pickList .phead {
  font-size: 11.5px; font-weight: 700; color: var(--dim2); letter-spacing: .06em;
  padding: 12px 8px 6px; position: sticky; top: 0; background: var(--panel);
}
#pickList .prow {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 12px; border-radius: var(--radius-sm);
  border: 1px solid transparent; text-align: left; color: var(--fg);
}
#pickList .prow:hover, #pickList .prow.cur { background: var(--panel2); border-color: var(--line2); }
#pickList .prow.cur { border-color: var(--accent-ln); }
#pickList .prow .pn { flex: 1; min-width: 0; font-size: 15px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pickList .prow .pc { font-size: 12.5px; color: var(--dim); flex: none; }
#pickList .prow .star { flex: none; font-size: 15px; color: var(--dim2); padding: 2px 4px; }
#pickList .prow .star.on { color: var(--warn); }
#pickList .none { color: var(--dim); padding: 22px 10px; text-align: center; font-size: 14px; }

/* ── 본문 — 공간 활용 ──────────────────────────────────────────── */
#head { padding: 14px 26px; gap: 12px; }
#head h2 { font-size: 21px; font-weight: 700; }
#head .est { font-size: 12.5px; color: var(--dim); }
#pad { max-width: var(--read); padding: 24px 26px 80px; margin: 0 auto; }

/* 설명 — 기본은 짧게. 긴 설명은 「자세히」 로 접어 둔다 */
.desc {
  font-size: 15px; color: var(--fg2); line-height: 1.72;
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--accent-ln);
  border-radius: var(--radius); padding: 14px 18px; margin: 0 0 18px;
  white-space: pre-wrap;
}
.desc.clip { max-height: 5.2em; overflow: hidden; position: relative; }
.desc.clip::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 2.6em;
  background: linear-gradient(180deg, transparent, var(--card));
}
#descMore {
  display: none; margin: -12px 0 18px; font-size: 13px; color: var(--accent2);
  background: none; border: 0; padding: 4px 2px;
}
#descMore:hover { text-decoration: underline; }

/* 옵션 — 넓은 화면에서는 두 칸으로 */
#opts { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 1180px) {
  #opts { grid-template-columns: 1fr 1fr; column-gap: 26px; }
  #opts > .opt { min-width: 0; }
  /* 표·미리보기·여러 줄 입력은 한 칸을 다 쓴다 */
  #opts > .opt.wide { grid-column: 1 / -1; }
}
.opt { margin-bottom: 18px; }
.opt > label { font-size: 14.5px; font-weight: 650; color: var(--fg); margin-bottom: 7px; }
.opt .help { font-size: 13px; color: var(--dim); line-height: 1.6; margin-top: 6px; }
.opt input[type=text], .opt input[type=number], .opt select, .opt textarea {
  font-size: 15px; min-height: var(--touch); padding: 10px 13px;
  background: var(--panel2); border: 1px solid var(--line2); color: var(--fg);
}
.opt input:focus, .opt select:focus, .opt textarea:focus {
  border-color: var(--accent); outline: none;
}
.help { font-size: 13px; color: var(--dim); }

/* ── 단추 — 파란 바탕에 흰 글씨 ────────────────────────────────── */
.btn {
  font-size: 15px; font-weight: 650; min-height: var(--touch); padding: 11px 20px;
  border-radius: var(--radius-sm);
}
#runBar .btn:not(.ghost):not(.stop) {
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  box-shadow: 0 2px 0 rgba(0,0,0,.25);
}
#runBar .btn:not(.ghost):not(.stop):hover:not(:disabled) { background: var(--accent-hi); }
.btn.ghost { background: var(--panel2); color: var(--fg2); border: 1px solid var(--line2); }
.btn.ghost:hover:not(:disabled) { background: var(--panel3); color: var(--fg); }
.mbtns .btn:not(.ghost) { background: var(--accent); color: #fff; border-color: var(--accent); }
#loginCard button { background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; }
#loginCard button:hover { background: var(--accent-hi); }

/* 꼬리표 — 대비 올리기 */
.projTag {
  font-size: 12.5px; color: #dceaff; background: rgba(47,126,240,.28);
  border-color: rgba(120,175,255,.5);
}
.chip { font-size: 13.5px; min-height: 38px; padding: 7px 14px; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── 기록·파일 ─────────────────────────────────────────────────── */
.hist h3 { font-size: 14px; color: var(--fg2); }
.hrow .t { font-size: 13.5px; }
.file .nm { font-size: 14.5px; }
#log { font-size: 13.5px; line-height: 1.62; }

/* ── 좁은 화면 ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  html, body { font-size: 16px; }
  #pad { padding: 18px 16px 72px; }
  #head { padding: 12px 16px; }
}

/* ── 실행 막대는 늘 손 닿는 곳에 ──────────────────────────────────
   옵션이 많은 도구는 실행 단추가 화면 밖으로 밀려 스크롤해야 눌렀다.
   아래에 붙여 두면 어디를 보고 있든 바로 누를 수 있다. */
#runBar {
  position: sticky; bottom: 0; z-index: 5;
  margin: 22px -26px 0; padding: 14px 26px;
  background: linear-gradient(0deg, var(--bg) 62%, rgba(15,19,25,.86));
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
#status { font-size: 14px; }
@media (max-width: 900px) { #runBar { margin: 18px -16px 0; padding: 12px 16px; } }

/* 옵션이 없는 도구는 본문이 텅 비어 보였다 — 안내를 넣는다 */
#opts:empty::before {
  content: '고를 것이 없는 도구입니다. 아래 「실행」 을 누르면 바로 돌아갑니다.';
  display: block; color: var(--dim); font-size: 14px;
  padding: 18px 0 6px;
}

/* 프로젝트 단추의 꺾쇠 */
#projPick .cv { font-size: 13px; opacity: .8; }

/* 넓은 화면에서 여러 줄 입력·표·미리보기는 두 칸을 다 쓴다 */
@media (min-width: 1180px) {
  #opts > .opt:has(textarea),
  #opts > .opt:has(.lmap),
  #opts > .opt:has(.pv),
  #opts > .opt:has(.chips),
  #opts > .opt:has(select[multiple]) { grid-column: 1 / -1; }
}

/* ── 진행 표시 ────────────────────────────────────────────────────
   오래 걸리는 도구에서 화면이 가만히 있으면 멈춘 줄 안다.
   막대 + 지금 하는 일 + 지난 시간 세 가지를 늘 보여 준다. */
#prog { margin: 12px 0 4px; }
.pbar {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--panel2); border: 1px solid var(--line);
}
.pfill {
  height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hi));
  transition: width .35s ease;
}
.pfill.bad { background: linear-gradient(90deg, #b4483f, var(--bad)); }
/* 도구가 진행률을 안 알려 줄 때 — 흐르는 줄무늬로 「돌고 있다」 만 보여 준다 */
.pfill.flow {
  width: 100% !important;
  background: repeating-linear-gradient(115deg,
    var(--accent) 0 16px, rgba(47,126,240,.35) 16px 34px);
  background-size: 200% 100%;
  animation: flow 1.1s linear infinite;
}
@keyframes flow { from { background-position: 0 0; } to { background-position: -68px 0; } }
@media (prefers-reduced-motion: reduce) { .pfill.flow { animation: none; } }

.pinfo {
  display: flex; align-items: baseline; gap: 12px; margin-top: 7px;
  font-size: 13.5px; color: var(--dim);
}
#pstep { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#ptime { flex: none; font-variant-numeric: tabular-nums; color: var(--fg2); font-weight: 600; }
/* 남은 시간 — 지난 시간보다 이쪽을 먼저 보게 된다. 눈에 띄되 요란하지 않게 */
.pleft {
  flex: none; font-variant-numeric: tabular-nums; font-weight: 600;
  color: var(--accent); white-space: nowrap;
}
@media (max-width: 560px) { #pstep { flex: 1 1 100%; order: 3; } }

/* 실패 이유가 길 때 기록 칸에서 눈에 띄게 */
#log .e { color: #ffb3b3; }

/* 실행 막대 = 진행 줄 + 단추 줄. 화면 아래에 붙어 있어 늘 보인다 */
#runBar { flex-direction: column; align-items: stretch; gap: 0; }
#runBar .rbRow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#runBar #prog { margin: 0 0 12px; }

/* 미리보기 기다리는 동안 — 흐르는 막대 + 지난 시간 */
.pvwait { padding: 22px 18px; display: grid; gap: 10px; justify-items: center; }
.pvwait .pbar { width: min(320px, 80%); }
.pvmsg.dim { color: var(--dim2); font-size: 12.5px; }
.pvstage .pvwait { min-width: min(420px, 86vw); }

/* ══════════════════════════════════════════════════════════════════
   결과물 보관함 · 화면 잠금 · 관리자
   ══════════════════════════════════════════════════════════════════ */

/* ── 보관함 ─────────────────────────────────────────────────────── */
.gitem {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 9px;
}
.ghead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gopen {
  font-size: 15.5px; font-weight: 650; color: var(--accent2);
  text-decoration: none; flex: 1; min-width: 0;
}
.gopen:hover { text-decoration: underline; color: #c9e0ff; }
.gtag {
  font-size: 11.5px; color: var(--dim); background: var(--panel2);
  border: 1px solid var(--line2); border-radius: 999px; padding: 2px 9px;
}
.gwhen, .gsize { font-size: 12.5px; color: var(--dim2); font-variant-numeric: tabular-nums; }
.gbar { display: flex; gap: 7px; align-items: center; margin-top: 9px; flex-wrap: wrap; }
.gbtn {
  font-size: 12.5px; color: var(--fg2); background: var(--panel2);
  border: 1px solid var(--line2); border-radius: var(--radius-sm);
  padding: 6px 12px; text-decoration: none; display: inline-block;
}
.gbtn:hover { background: var(--panel3); color: var(--fg); }
.glock { font-size: 12.5px; color: var(--warn); }
.golds { display: grid; gap: 4px; margin-top: 9px; padding-left: 4px; }
.gold {
  font-size: 12.5px; color: var(--dim); text-decoration: none;
  padding: 5px 9px; border-radius: 6px; border-left: 2px solid var(--line2);
}
.gold:hover { background: var(--panel2); color: var(--accent2); }

/* ── 화면 잠금 막 ───────────────────────────────────────────────── */
#lockScreen {
  position: fixed; inset: 0; z-index: 9000; display: none;
  place-items: center; background: rgba(8,11,16,.92);
  backdrop-filter: blur(18px) saturate(.6);
}
#lockScreen.on { display: grid; }
.lockCard { text-align: center; max-width: 380px; padding: 30px; }
.lockIcon { font-size: 46px; margin-bottom: 10px; }
.lockCard h3 { font-size: 19px; margin-bottom: 10px; }
#lockLeft { color: var(--warn); font-weight: 600; margin-top: 12px; }

/* ── 관리자 화면 ────────────────────────────────────────────────── */
.admBody { min-height: 100%; }
.admWrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.admCard {
  width: min(460px, 94vw); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px; box-shadow: var(--shadow-lg); display: grid; gap: 10px;
}
.admCard h1 { font-size: 21px; margin-bottom: 2px; }
.admCard input {
  width: 100%; min-height: var(--touch); padding: 11px 13px; font-size: 15px;
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: var(--radius-sm); color: var(--fg);
}
.admCard input:focus { border-color: var(--accent); outline: none; }
.admCard .btn { width: 100%; }
.admBack { color: var(--dim); font-size: 13px; text-align: center; text-decoration: none; margin-top: 4px; }
.admBack:hover { color: var(--accent2); }
.admCard .btns { display: grid; gap: 7px; }
.admCard .btns .btn { width: 100%; }

.admTop {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 26px; border-bottom: 1px solid var(--line);
  background: var(--panel); position: sticky; top: 0; z-index: 5;
}
.admTop h1 { font-size: 19px; flex: none; }
.admWho { flex: 1; color: var(--dim); font-size: 13px; }
.admTop .btn { min-height: 38px; padding: 8px 14px; text-decoration: none; }
.admPad { max-width: 780px; margin: 0 auto; padding: 22px 26px 90px; }
.admSec {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px;
}
.admSec h2 { font-size: 16px; margin-bottom: 8px; }

/* 서버 메모리 절 — 지금 값 넉 장을 나란히 (2026-08-13) */
.memGrid {
  display: grid; gap: 10px; margin: 12px 0 4px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.memCell {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; background: var(--panel2);
  border: 1px solid var(--line2); border-radius: var(--radius-sm);
}
.memCell .memK { font-size: 12px; color: var(--dim); }
.memCell b { font-size: 18px; }
.memCell .memS { font-size: 11.5px; color: var(--dim); }
/* 「올리셔야 합니다」 — 할 일이 있을 때만 나오므로 눈에 띄게 */
.memAdvice {
  margin-top: 14px; padding: 12px 14px; font-size: 13.5px;
  background: rgba(240, 173, 47, .10);
  border: 1px solid rgba(240, 173, 47, .40); border-radius: var(--radius-sm);
}
.memAdvice .memSteps { margin: 8px 0 6px; display: grid; gap: 3px; }
.memAdvice .memNote { color: var(--dim); font-size: 12.5px; }
.admSec label { display: block; font-size: 13.5px; font-weight: 600; margin: 14px 0 6px; }
/* ⚠ `select` 가 빠져 있었다 (2026-08-13에 찾음). 브라우저 기본 셀렉트는
   **흰 바탕**인데 글자색만 밝은 색을 물려받아 **흰 바탕에 흰 글씨**가 된다 —
   골라 놓은 값이 안 보인다. 「AI 모델」 칸이 내내 그 상태였다. */
.admSec input[type=text], .admSec input[type=password], .admSec input[type=email],
.admSec input[type=number], .admSec select {
  width: 100%; min-height: var(--touch); padding: 10px 13px; font-size: 15px;
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: var(--radius-sm); color: var(--fg);
}
.admSec select { cursor: pointer; }
/* 목록이 펼쳐졌을 때도 (윈도·크롬은 option 을 따로 그린다) */
.admSec select option { background: var(--panel2); color: var(--fg); }
.admSec input:focus { border-color: var(--accent); outline: none; }
.sw2 { display: flex !important; align-items: center; gap: 9px; font-weight: 600; cursor: pointer; }
.sw2 input { width: 20px; height: 20px; accent-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admDet { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.admDet summary { cursor: pointer; font-size: 13.5px; color: var(--accent2); }
.admAlert {
  background: var(--warn-bg); border: 1px solid rgba(255,192,97,.45);
  color: #ffe1ac; border-radius: var(--radius); padding: 13px 16px;
  margin-bottom: 16px; font-size: 14px; line-height: 1.7;
}
.admSave {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 12px;
  padding: 14px 0; background: linear-gradient(0deg, var(--bg) 70%, transparent);
}
.admSave .btn { background: var(--accent); color: #fff; border-color: var(--accent); }
#admMsg.ok { color: var(--ok); font-size: 14px; }
#admMsg.err, .err { color: var(--bad); font-size: 14px; }
.recCode {
  font: 700 26px/1.6 var(--mono); letter-spacing: .08em; text-align: center;
  background: var(--panel2); border: 1px dashed var(--accent-ln);
  border-radius: var(--radius); padding: 18px; margin: 12px 0; color: var(--accent2);
  user-select: all;
}

/* 결과 파일 줄 — HTML 은 이름 자체가 여는 링크다 */
.file .fopen { color: var(--accent2); text-decoration: none; font-weight: 650; }
.file .fopen:hover { text-decoration: underline; color: #c9e0ff; }
.file .fbtn {
  font-size: 12.5px; color: var(--fg2); background: var(--panel2);
  border: 1px solid var(--line2); border-radius: var(--radius-sm);
  padding: 6px 12px; text-decoration: none; flex: none; white-space: nowrap;
}
.file .fbtn:hover { background: var(--panel3); color: var(--fg); }
.file .flock { font-size: 12.5px; color: var(--warn); flex: none; white-space: nowrap; }

/* ── 도면 올리기 ─────────────────────────────────────────────
   큰 파일을 잘라 올리는 창. 조각마다 진행률이 갱신되므로 줄이 흔들리지 않게
   글자 자리(폭)를 미리 잡아 둔다. */
.mcard.wide { max-width: 680px; }

#projUp {
  flex: none; width: var(--touch); min-width: var(--touch);
  font-size: 17px; font-weight: 700; line-height: 1;
}

#upZone {
  margin: 14px 0 4px; padding: 26px 18px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line2); border-radius: var(--radius-lg);
  background: var(--bg); transition: border-color .15s, background .15s;
}
#upZone:hover, #upZone:focus-visible { border-color: var(--accent-ln); background: var(--accent-bg); }
#upZone.over { border-color: var(--accent); background: var(--accent-bg); }
#upZone .upIcon { font-size: 26px; line-height: 1; color: var(--accent2); }
#upZone .upMain { margin-top: 8px; font-weight: 700; color: var(--fg); }
#upZone .upSub  { margin-top: 3px; font-size: 12.5px; color: var(--dim2); }

.upDest { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; }
.upDest > span { font-size: 13px; font-weight: 700; color: var(--fg); flex: none; }
.upDest select {
  flex: 1; background: var(--bg); color: var(--fg);
  border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 9px 11px; min-height: var(--touch);
}

#upList { margin-top: 10px; max-height: 44vh; overflow-y: auto; }
#upList:empty { display: none; }
.uprow {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 7px;
}
.uprow.ok  { border-color: rgba(64,180,120,.5); }
.uprow.bad { border-color: rgba(228,90,80,.55); }
.uphead { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.upname { font-weight: 600; word-break: break-all; flex: 1 1 200px; }
/* 폴더째 올릴 때 앞에 붙는 「현장 안에서의 자리」 — 흐리게 두어
 * **파일 이름이 먼저 눈에 들어오게** 한다 (도면 고르개와 같은 규칙). */
.upsub { font-size: 12.5px; color: var(--dim2); flex: none; word-break: break-all; }
.upsize { font-size: 13px; color: var(--dim2); flex: none; }
/* 「파일 고르기 · 폴더째 고르기」 — 끌어놓기를 못 하는 사람을 위한 두 번째 길.
 * 50~60대 사용자가 이 화면의 주 사용자라 단추를 크게 잡는다 (2026-08-08 UX 검토). */
/* 수정도면 알림 — 올린 줄 안에 붙는다 */
.uprev {
  margin-top: 7px; padding: 8px 10px; font-size: 13.5px; line-height: 1.55;
  border-left: 3px solid var(--warn); background: var(--panel2);
  border-radius: var(--radius-sm); color: var(--dim);
}
.upPicks { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 2px; }
.upPicks .btn { flex: 1 1 160px; min-height: 42px; font-size: 15px; }
/* DWG 안내 — 변환기를 못 깔면 그 뒤가 통째로 막히므로 눈에 띄어야 한다 */
.upNote {
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); background: var(--card);
  padding: 11px 13px; margin: 10px 0 4px;
  display: flex; flex-direction: column; gap: 6px; font-size: 14px;
}
.upNote span { color: var(--dim); line-height: 1.55; }
.upNote .btn { align-self: flex-start; min-height: 40px; font-size: 14.5px; }
.upNote .bad { color: #d9564c; font-weight: 600; }
.upNote .ok  { color: #3fae79; font-weight: 600; }
.upstate {
  font-size: 13px; color: var(--dim); flex: none;
  font-variant-numeric: tabular-nums;
}
.upstate.ok  { color: #58c48c; }
.upstate.bad { color: #ff8b82; }
.upbar {
  margin-top: 7px; height: 5px; border-radius: 3px;
  background: var(--line); overflow: hidden;
}
.upfill {
  height: 100%; width: 0; border-radius: 3px;
  background: var(--accent); transition: width .2s linear;
}
.uprow.ok  .upfill { background: #3fae79; }
.uprow.bad .upfill { background: #d9564c; }

/* 접수 회차 — 「누가 왜 올리나」 를 파일보다 먼저 묻는다.
   서울전기 직원이 보는 첫 화면이므로 칸이 적고 커야 한다. */
.upWho { display: flex; gap: 12px; flex-wrap: wrap; }
.upWho .upField { flex: 1 1 200px; }
.upField { margin: 12px 0 0; }
.upField > label {
  display: block; font-size: 12.5px; font-weight: 700;
  color: var(--fg); margin: 0 0 5px;
}
.upField > input {
  width: 100%; background: var(--bg); color: var(--fg);
  border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 10px 12px; min-height: var(--touch);
}
.upField > input:focus { border-color: var(--accent); outline: none; }
.upPickBtn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; background: var(--bg); color: var(--fg); text-align: left;
  border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 10px 12px; min-height: var(--touch); font-weight: 600;
}
.upPickBtn:hover { border-color: var(--accent-ln); }
.upPickBtn .cv { color: var(--dim2); flex: none; }
#upRoundHint { margin-top: 6px; font-size: 13px; color: var(--accent2); }

#upMore { margin-top: 14px; }
#upMore > summary {
  cursor: pointer; color: var(--dim); font-size: 12.5px;
  padding: 6px 0; list-style-position: inside;
}
#upMore > summary:hover { color: var(--fg2); }
#upRounds { margin-top: 8px; max-height: 30vh; overflow-y: auto; }
.uprnd {
  display: block; width: 100%; text-align: left; margin-bottom: 5px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 11px;
}
.uprnd:hover { border-color: var(--accent-ln); background: var(--accent-bg); }
.uprnd .rnm { display: block; font-weight: 600; font-size: 13px; }
.uprnd .rmeta { display: block; font-size: 12.5px; color: var(--dim); margin-top: 2px; }

/* ── 현장 목록 (첫 화면) ─────────────────────────────────────
   현장이 작은 ▾ 버튼 뒤에만 있으면 있는 줄도 모른다. 도구를 고르기 전에는
   여기가 첫 화면이고, 목록을 그대로 펼쳐 둔다. */
#siteBox { margin: 0 0 22px; }
.sbHead {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.sbHead h3 { margin: 0; font-size: 16px; font-weight: 700; flex: none; }
.sbHead h3 span { color: var(--dim2); font-weight: 500; font-size: 13px; }
.sbHead input {
  flex: 1 1 200px; min-width: 150px;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 8px 12px; min-height: var(--touch);
}
.sbHead input:focus { border-color: var(--accent); outline: none; }
.sbHead .btn { flex: none; }

#siteList {
  display: grid; gap: 9px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.site {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 13px 15px;
  transition: border-color .15s, background .15s;
}
.site:hover { border-color: var(--accent-ln); background: var(--panel2); }
.site.cur { border-color: var(--accent); background: var(--accent-bg); }
.site .sTop { display: flex; align-items: center; gap: 7px; }
.site .star { flex: none; font-size: 15px; color: var(--dim2); padding: 0 2px; }
.site .star.on { color: var(--warn); }
.site .sName {
  flex: 1; min-width: 0; font-size: 14.5px; font-weight: 700; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.site .sNow {
  flex: none; font-size: 11px; font-weight: 700; color: var(--accent-ink);
  background: var(--accent); border-radius: 4px; padding: 2px 7px;
}
.site .sNote {
  margin-top: 6px; font-size: 12.5px; color: var(--dim);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.site .sMeta { margin-top: 7px; font-size: 13px; color: var(--dim2); }
.sbNone {
  grid-column: 1 / -1; color: var(--dim);
  padding: 26px 10px; text-align: center; font-size: 14px;
}
#title { cursor: pointer; }

/* 현장 고르기 — 최근 순으로 몇 개만, 「무슨 일이 있었나」 를 함께 */
#pickList .prow .pn { display: flex; flex-direction: column; gap: 2px; }
#pickList .prow .pn b { font-size: 15px; font-weight: 600; }
#pickList .prow .pwhen { font-size: 12.5px; color: var(--dim); font-weight: 400; }
#pickList .pmore {
  display: block; width: 100%; margin-top: 8px; padding: 10px;
  background: transparent; border: 1px dashed var(--line2);
  border-radius: var(--radius); color: var(--dim); font-size: 13px;
}
#pickList .pmore:hover { border-color: var(--accent-ln); color: var(--fg2); }

/* 화면 위 현장 이름표 — 눌러서 바꿀 수 있다는 것이 보이게 */
#projTag { cursor: pointer; }
#projTag::after { content: ' ▾'; opacity: .6; font-size: .9em; }
#projTag:hover { filter: brightness(1.15); }

/* 현장 카드 안의 올리기 단추 */
.site .sBar { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
.site .sUp {
  display: inline-block; font-size: 12.5px; font-weight: 600;
  color: var(--accent2); border: 1px solid var(--line2);
  border-radius: var(--radius); padding: 5px 11px;
}
.site .sUp:hover { border-color: var(--accent); background: var(--accent-bg); }

/* 올린 것 치우기 — 잘못 올렸을 때 그 자리에서 */
.updel {
  flex: none; font-size: 11.5px; color: var(--dim);
  border: 1px solid var(--line2); border-radius: 4px; padding: 2px 8px;
}
.updel:hover:not(:disabled) { color: #ff8b82; border-color: #ff8b82; }
.updel:disabled { opacity: .5; }
.uprow.gone { opacity: .5; border-style: dashed; }
.uprow.gone .upfill { background: var(--line2); }

.uprnd { position: relative; padding-right: 62px; }
.uprnd .rdel {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font-size: 11.5px; color: var(--dim2);
  border: 1px solid var(--line2); border-radius: 4px; padding: 2px 8px;
}
.uprnd .rdel:hover { color: #ff8b82; border-color: #ff8b82; }

/* ══════════════════════════════════════════════════════════════════
   현장 목록 — 수백 곳을 견디게 (2026-08-08)

   찾기(초성·꼬리표) · 갈래 칩 · 정렬이 곧 묶는 기준 · 촘촘히 보기.
   화면 논리는 static/sites.js 와 app.js 의 「현장 목록」 칸에 적어 두었다.
   ══════════════════════════════════════════════════════════════════ */

/* 현장 목록으로 돌아가는 길 — 사이드바 맨 위에 늘 있다 */
.navHome {
  display: flex; align-items: center; gap: 9px; width: 100%;
  margin: 2px 0 8px; padding: 11px 14px;
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: var(--radius); color: var(--fg); text-align: left;
  font-size: 14px; font-weight: 700;
}
.navHome:hover { border-color: var(--accent-ln); background: var(--accent-bg); }
.navHome .nhIcon { color: var(--accent2); font-size: 13px; }
.navHome .nhName { flex: 1; }
.navHome .nhCnt {
  font-size: 12px; font-weight: 600; color: var(--dim2);
  background: var(--bg); border-radius: 999px; padding: 2px 9px;
}

/* 갈래 칩 줄 — 있는 갈래만 그린다 */
#sbFilters { display: grid; gap: 7px; margin: 0 0 10px; }
#sbFilters .fRow { display: flex; align-items: flex-start; gap: 10px; }
#sbFilters .fLbl {
  flex: none; width: 42px; padding-top: 8px;
  font-size: 12px; font-weight: 700; color: var(--dim2); letter-spacing: .04em;
}
#sbFilters .chip { min-height: 32px; padding: 4px 11px; font-size: 12.5px; gap: 6px; }
#sbFilters .chip .cn {
  font-size: 11px; color: var(--dim2); font-weight: 600; margin-left: 5px;
}
#sbFilters .chip.on .cn { color: var(--accent-ink); opacity: .8; }
#sbFilters .chip.star.on { background: var(--warn); border-color: var(--warn); color: #2a2110; }

/* 진행 상태 — 색으로 갈래가 먼저 읽히게 */
.chip.st-run  { border-left: 3px solid var(--accent); }
.chip.st-in   { border-left: 3px solid var(--warn); }
.chip.st-done { border-left: 3px solid var(--ok); }
.chip.st-idle { border-left: 3px solid var(--dim2); }
.chip.st-none { border-left: 3px solid var(--line2); }

.sbBar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 12px;
}
.sbSorts { display: flex; gap: 6px; flex-wrap: wrap; }
.sbSorts .chip, .sbRight .chip { min-height: 32px; padding: 4px 12px; font-size: 12.5px; }
.sbRight { margin-left: auto; display: flex; gap: 6px; }

/* ㄱㄴㄷ 색인 — 이름 순일 때만 */
.sbIndex {
  display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px;
  padding: 8px 10px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.sbIndex .ix {
  min-width: 30px; padding: 4px 6px; font-size: 13px; font-weight: 700;
  color: var(--dim); background: transparent; border: 1px solid transparent;
  border-radius: 6px;
}
.sbIndex .ix:hover { color: var(--fg); border-color: var(--accent-ln); background: var(--accent-bg); }

/* 묶음 머리 — 「작업중 3곳」 처럼 */
.sGrp {
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
  scroll-margin-top: 12px;
}
.sGrp:first-child { margin-top: 0; }
.sGrp .gName { font-size: 14px; font-weight: 800; color: var(--fg); }
.sGrp .gCnt { font-size: 12px; color: var(--dim2); }
.sGrp .gWhy { font-size: 12px; color: var(--dim2); opacity: .8; }
.sGrid { display: grid; gap: 9px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
#siteList { display: block; }

/* 카드 — 왼쪽 색띠가 진행 상태다 */
.site { position: relative; overflow: hidden; }
.site::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--line2);
}
.site.st-run::before  { background: var(--accent); }
.site.st-in::before   { background: var(--warn); }
.site.st-done::before { background: var(--ok); }
.site.st-idle::before { background: var(--dim2); }
.site .sName {
  background: transparent; border: 0; color: var(--fg); padding: 0;
  text-align: left;
}
.site .sName:hover { color: var(--accent2); }
.site .star { background: transparent; border: 0; cursor: pointer; }
.sState {
  font-size: 12.5px; padding: 2px 10px; border-radius: 999px;
  border: 1px solid var(--line2); color: var(--dim); letter-spacing: 0;
  flex: none;
}
.site.st-run .sState  { color: var(--accent2); border-color: var(--accent-ln); }
.site.st-in .sState   { color: var(--warn); border-color: var(--warn); }
.site.st-done .sState { color: var(--ok); border-color: var(--ok); }

/* 세 단계 막대 — 작업전·작업중·작업완료 비율 */
.site .sStage {
  display: flex; height: 4px; margin: 9px 0 7px; gap: 1px;
  border-radius: 999px; overflow: hidden; background: var(--bg);
}
.site .sStage .b1 { background: var(--warn); }
.site .sStage .b2 { background: var(--accent); }
.site .sStage .b3 { background: var(--ok); }
.site .sStage .b0 { flex: 1; background: var(--line); }

.site .sTags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.site .sTags .tg {
  font-size: 11.5px; color: var(--dim); background: var(--bg);
  border: 1px solid var(--line2); border-radius: 999px; padding: 2px 9px;
}
.site .sTags .tg:hover { color: var(--fg); border-color: var(--accent-ln); }
.site .sTags .tg.on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* 카드 아래 단추 줄 */
.site .sBar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line);
}
.site .sAct {
  /* 홈의 주 동선이다 — 12.5px/28px 는 이 사용자층에 너무 작았다 (UX 검증) */
  font-size: 13.5px; min-height: 38px; padding: 6px 14px;
  background: var(--panel2); color: var(--fg2);
  border: 1px solid var(--line2); border-radius: var(--radius-sm); cursor: pointer;
}
.site .sAct:hover { color: var(--fg); border-color: var(--accent-ln); background: var(--accent-bg); }

/* 촘촘히 — 현장이 많을 때 한 줄에 하나씩 */
#siteList.dense .sGrid { grid-template-columns: 1fr; gap: 3px; }
#siteList.dense .site { padding: 7px 13px; border-radius: var(--radius); }
#siteList.dense .site .sStage { display: none; }
#siteList.dense .site .sMeta { margin-top: 2px; font-size: 12px; }
#siteList.dense .site .sBar {
  margin: 0; padding: 2px 4px; border: 0;
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  opacity: 0; transition: opacity .12s;
  /* 줄 위에 겹쳐 뜨므로 바탕을 깔아 준다 — 안 그러면 글씨끼리 겹쳐 읽힌다 */
  background: var(--panel2); border-radius: var(--radius);
  box-shadow: -16px 0 14px -4px var(--panel2);
}
#siteList.dense .site:hover .sBar, #siteList.dense .site:focus-within .sBar { opacity: 1; }
#siteList.dense .site:hover { background: var(--panel2); }

/* 현장 고르기 창 — 상태 배지를 이름 옆에 */
#pickList .prow .pn1 { display: flex; align-items: center; gap: 7px; }

/* 지우기 — 고치기 창 안에. 다른 단추와 확실히 달라 보이게 */
.mcard .btn.del {
  margin-left: auto; background: transparent; color: var(--bad);
  border: 1px solid var(--bad);
}
.mcard .btn.del:hover { background: var(--bad-bg); }

@media (max-width: 760px) {
  #sbFilters .fRow { flex-direction: column; gap: 4px; }
  #sbFilters .fLbl { width: auto; padding-top: 0; }
  .sGrid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════
   사용자 관리 (관리자 화면) — 2026-08-08
   ══════════════════════════════════════════════════════════════════ */
.uList { display: grid; gap: 6px; margin: 10px 0 14px; }
.uNone { color: var(--dim); font-size: 13.5px; padding: 16px 4px; }
.uRow {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 14px;
}
.uRow.off { opacity: .55; border-style: dashed; }
.uRow .uName { flex: 0 0 auto; min-width: 150px; display: flex; align-items: baseline; gap: 8px; }
.uRow .uName b { font-size: 14.5px; }
.uRow .uName span { font-size: 12px; color: var(--dim2); font-family: var(--mono); }
.uRow .uMeta { flex: 1; min-width: 140px; display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 12px; color: var(--dim2); }
.uRow .uStop { color: var(--bad); font-weight: 700; }
.uRow .uNew { color: var(--warn); font-weight: 700; }
.uRow .uAct { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.uRow .uAct select {
  background: var(--panel2); color: var(--fg); border: 1px solid var(--line2);
  border-radius: var(--radius-sm); padding: 5px 8px; font-size: 12.5px;
}
.uRow .uAct .btn { min-height: 32px; padding: 4px 11px; font-size: 12.5px; }
.uRow .uAct .uDel { color: var(--bad); border-color: var(--bad); }

.uForm { padding: 12px 2px 4px; display: grid; gap: 8px; }
.uRow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .uRow2 { grid-template-columns: 1fr; } }
.uForm select, .uForm input {
  width: 100%; background: var(--bg); color: var(--fg);
  border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 9px 12px; min-height: var(--touch);
}
#uAddBox summary { cursor: pointer; font-size: 13.5px; color: var(--accent2); padding: 6px 0; }

.uLog { margin-top: 10px; max-height: 380px; overflow-y: auto; }
.uLogRow {
  display: grid; grid-template-columns: 130px 90px 150px 1fr; gap: 10px;
  padding: 6px 8px; font-size: 12.5px; border-bottom: 1px solid var(--line);
}
.uLogRow .t { color: var(--dim2); font-family: var(--mono); }
.uLogRow .k { color: var(--accent2); font-weight: 650; }
.uLogRow .w { color: var(--fg2); }
.uLogRow .n { color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 720px) { .uLogRow { grid-template-columns: 1fr 1fr; } }

/* 도면 찾기 단추 — 이 회사에서 가장 자주 눌러야 할 것이라 눈에 띄게 */
.topbtn.hot { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.topbtn.hot:hover { filter: brightness(1.08); }

/* 지금 누구로 들어와 있나 — 오른쪽 위 */
.meTag {
  font-size: 12.5px; color: var(--fg2); background: var(--panel2);
  border: 1px solid var(--line2); border-radius: 999px; padding: 5px 12px;
  cursor: pointer; white-space: nowrap;
}
.meTag:hover { border-color: var(--accent-ln); color: var(--fg); }
.meTag.pub { color: var(--warn); border-color: var(--warn); }
.meTag .r { color: var(--dim2); font-size: 11px; margin-left: 5px; }

/* 열린 수정 요청 수 — 위쪽 「수정 요청」 단추에 붙는 뱃지 */
.tkBadge {
  display: inline-block; margin-left: 5px; min-width: 18px; padding: 0 6px;
  font-size: 11px; font-weight: 800; line-height: 17px; text-align: center;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink);
}
.tkBadge.late { background: var(--bad); }

/* 작업 표시(soft lock) — 파일 관리 목록에서 「누가 잡고 있나」 */
.lockTag {
  /* soft lock 의 전부가 「보이는 것」이다 — 작으면 없는 기능이 된다 */
  font-size: 12.5px; padding: 2px 10px; margin-left: 8px;
  border-radius: 999px; border: 1px solid var(--warn); color: var(--warn);
  letter-spacing: 0; white-space: nowrap;
}
.lockTag.mine { color: var(--ok); border-color: var(--ok); }
table.fm td.act .lockOn { color: var(--ok); border-color: var(--ok); }

/* 납품 도장 — 「그때 준 게 이것」 을 대는 값 */
.stampBox {
  background: var(--card); border: 1px solid var(--line);
  border-left: 3px solid var(--ok); border-radius: var(--radius);
  padding: 14px 16px; margin: 12px 0;
}
.stampBox .lbl { font-size: 12px; color: var(--dim2); font-weight: 700; letter-spacing: .04em; }
.stampBox .val {
  font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--ok);
  margin: 6px 0 8px; word-break: break-all; letter-spacing: .02em;
}
.stampBox .sub { font-size: 12.5px; color: var(--dim); line-height: 1.65; }
.stampBtns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.stampBtns button, .stampBtns a {
  font-size: 13px; color: var(--fg2); background: var(--panel2); text-decoration: none;
  border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 7px 14px; min-height: 38px; display: inline-flex; align-items: center;
}
.stampBtns button:hover, .stampBtns a:hover {
  color: var(--fg); border-color: var(--accent-ln); background: var(--accent-bg); }

/* 서버가 옛 코드로 돌 때 띄우는 띠 — 화면 맨 위에 붙는다 */
.staleBar {
  position: sticky; top: 0; z-index: 90;
  background: var(--warn); color: #2a2110;
  padding: 10px 18px; font-size: 13.5px; line-height: 1.6;
  border-bottom: 2px solid #c8901f;
}
.staleBar b { font-weight: 800; }

/* ══════════════════════════════════════════════════════════════════
   캐드로 열기 (2026-08-08)

   도면을 내려받았다 올렸다 하지 않는다 — 공유 폴더의 그 파일을 그 자리에서
   연다. 그래서 이 단추가 「받기」 보다 앞에 오고, 눈에 더 띈다.
   ══════════════════════════════════════════════════════════════════ */
.cadBtn {
  color: var(--accent-ink) !important; background: var(--accent) !important;
  border-color: var(--accent) !important; font-weight: 700;
}
.cadBtn:hover { filter: brightness(1.1); }

.cadBox {
  position: fixed; right: 18px; bottom: 18px; z-index: 80; max-width: 520px;
  background: var(--panel); border: 1px solid var(--accent-ln);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg); padding: 14px 16px;
  box-shadow: 0 10px 34px rgba(0,0,0,.5);
}
.cadBox .hd { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cadBox .hd b { font-size: 14.5px; }
.cadBox .hd span { flex: 1; font-size: 12px; color: var(--dim2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cadBox .hd .x { font-size: 12px; color: var(--dim); background: transparent;
  border: 1px solid var(--line2); border-radius: var(--radius); padding: 3px 9px; }
.cadBox .pa {
  font-family: var(--mono); font-size: 12.5px; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 9px 11px; word-break: break-all; cursor: pointer; line-height: 1.5;
}
.cadBox .pa:hover { border-color: var(--accent-ln); }
.cadBox .hp { font-size: 12.5px; color: var(--dim); line-height: 1.7; margin-top: 9px; }
.cadBox .hp b { color: var(--fg2); }
@media (max-width: 640px) { .cadBox { left: 12px; right: 12px; max-width: none; } }
