/* ============================================================
   styles.css — MY KEYBOARD
   색은 강조색(--accent-raw) 하나에서 전부 파생된다.
   CSS 상대색 문법 oklch(from ...)으로 명도(L)를 고정하고 색조(h)만
   물려받으므로, 유저가 어떤 색을 골라도 배경·테두리·글자 대비가 유지된다.
   글자색(--accent-ink)은 배경 밝기에 따라 흑/백이 자동 선택된다.
   테마: html[data-theme=dark|light] · 확대: html[--zoom] + body{zoom}
   ============================================================ */

:root {
  --accent-raw: #8e8e96;   /* JS가 유저 선택값으로 덮어쓴다 */
  --sat: 0.22;             /* 배경이 강조색 채도를 물려받는 비율 */

  --red: oklch(0.68 0.15 25);
  --green: oklch(0.72 0.13 145);
  --shadow: rgba(0, 0, 0, 0.55);
  --veil: rgba(5, 5, 7, 0.74);

  --zoom: 1;
  --maxw: 100%;
  --r: 7px;
  --mono: 'JetBrains Mono', Consolas, 'Courier New', monospace;
}

/* ---------- 다크(기본) ---------- */
:root {
  --bg:     oklch(from var(--accent-raw) 0.135 calc(c * var(--sat)) h);
  --bg2:    oklch(from var(--accent-raw) 0.168 calc(c * var(--sat)) h);
  --panel:  oklch(from var(--accent-raw) 0.188 calc(c * var(--sat)) h);
  --panel2: oklch(from var(--accent-raw) 0.228 calc(c * var(--sat)) h);
  --field:  oklch(from var(--accent-raw) 0.112 calc(c * var(--sat)) h);
  --line:   oklch(from var(--accent-raw) 0.295 calc(c * 0.3) h);
  --line2:  oklch(from var(--accent-raw) 0.385 calc(c * 0.3) h);
  --key1:   oklch(from var(--accent-raw) 0.252 calc(c * var(--sat)) h);
  --key2:   oklch(from var(--accent-raw) 0.195 calc(c * var(--sat)) h);
  --key-line: oklch(from var(--accent-raw) 0.355 calc(c * 0.3) h);
  --text:   oklch(from var(--accent-raw) 0.955 calc(c * 0.06) h);
  --dim:    oklch(from var(--accent-raw) 0.795 calc(c * 0.08) h);
  --faint:  oklch(from var(--accent-raw) 0.695 calc(c * 0.08) h);
  --done:   oklch(from var(--accent-raw) 0.47 calc(c * 0.12) h);
  --done-ink: oklch(from var(--accent-raw) 0.97 calc(c * 0.04) h);
  /* 어떤 색을 골라도 다크 배경 위에서 보이도록 명도만 제한 */
  --accent: oklch(from var(--accent-raw) clamp(0.62, l, 0.93) c h);
}

/* ---------- 라이트 ---------- */
:root[data-theme="light"] {
  --bg:     oklch(from var(--accent-raw) 0.995 calc(c * 0.06) h);
  --bg2:    oklch(from var(--accent-raw) 0.968 calc(c * 0.09) h);
  --panel:  oklch(from var(--accent-raw) 0.982 calc(c * 0.07) h);
  --panel2: oklch(from var(--accent-raw) 0.938 calc(c * 0.11) h);
  --field:  oklch(from var(--accent-raw) 1 calc(c * 0.04) h);
  --line:   oklch(from var(--accent-raw) 0.895 calc(c * 0.14) h);
  --line2:  oklch(from var(--accent-raw) 0.815 calc(c * 0.16) h);
  --key1:   oklch(from var(--accent-raw) 1 calc(c * 0.04) h);
  --key2:   oklch(from var(--accent-raw) 0.955 calc(c * 0.09) h);
  --key-line: oklch(from var(--accent-raw) 0.855 calc(c * 0.14) h);
  --text:   oklch(from var(--accent-raw) 0.195 calc(c * 0.08) h);
  --dim:    oklch(from var(--accent-raw) 0.435 calc(c * 0.1) h);
  --faint:  oklch(from var(--accent-raw) 0.505 calc(c * 0.1) h);
  --done:   oklch(from var(--accent-raw) 0.855 calc(c * 0.12) h);
  --done-ink: oklch(from var(--accent-raw) 0.2 calc(c * 0.06) h);
  --red: oklch(0.5 0.17 27);
  --green: oklch(0.5 0.12 145);
  --shadow: rgba(20, 20, 23, 0.18);
  --veil: rgba(20, 20, 23, 0.44);
  --accent: oklch(from var(--accent-raw) clamp(0.32, l, 0.65) c h);
}

/* 강조색 위 글자: 배경 밝기로 흑/백 자동 선택.
   round(up, …)은 완전한 계단 함수라 중간 회색이 나올 수 없다. 임계 L 0.58은
   흑/백 대비가 역전되는 실측 지점(0.564)에 맞춘 값. */
:root {
  --accent-ink: oklch(from var(--accent) clamp(0, round(up, calc(0.58 - l), 1), 1) 0 h);
  /* 포커스 링: 밝은 강조색은 라이트 배경에서 3:1을 못 채운다 */
  --focus: var(--accent);
}
:root[data-theme="light"] { --focus: var(--text); }

* { box-sizing: border-box; margin: 0; padding: 0; }
[v-cloak] { display: none !important; }

html { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
body {
  zoom: var(--zoom);
  background: var(--bg);
  color: var(--text);
  font-family: 'Pretendard Variable', Pretendard, 'Malgun Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: calc(100vh / var(--zoom));
}

.mono { font-family: var(--mono); font-size: 0.94em; }
.dim { color: var(--dim); }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

input, select, textarea {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  font: inherit;
  padding: 8px 11px;
}
input:focus, select:focus, textarea:focus { border-color: var(--line2); outline: none; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="number"] { font-family: var(--mono); }

/* ---------- 버튼 (키캡 느낌) ---------- */
.btn, .mini, .tab {
  cursor: pointer;
  font: inherit;
  color: var(--text);
  background: linear-gradient(180deg, var(--key1), var(--key2));
  border: 1px solid var(--key-line);
  border-bottom-width: 2px;
  border-radius: var(--r);
}
.btn { padding: 8px 16px; font-size: 15.5px; }
.btn:hover, .mini:hover { border-color: var(--line2); }
.btn:active, .mini:active, .tab:active { transform: translateY(1px); border-bottom-width: 1px; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.08); }
.mini { padding: 4px 11px; font-size: 14px; }
.mini.danger:hover { border-color: var(--red); color: var(--red); }
.mini.ghost { background: transparent; }
.x {
  cursor: pointer;
  background: none;
  border: none;
  color: var(--faint);
  font-size: 19px;
  line-height: 1;
  padding: 4px 7px;
  border-radius: 4px;
}
.x:hover { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }

/* ---------- 헤더 ---------- */
.top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
  flex-wrap: wrap;
}
.brand { display: flex; flex-direction: column; }
.logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 2.5px;
  color: var(--text);
}
.brand-sub { font-size: 13px; color: var(--faint); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { padding: 10px 24px; font-size: 16.5px; color: var(--dim); }
.tab.active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.saved { font-size: 13.5px; color: var(--faint); }
.drive-ok { color: var(--green); display: inline-flex; align-items: center; gap: 2px; }
.drive-ok .x { font-size: 15px; padding: 2px 4px; }

/* 테마 · 확대 컨트롤 */
.seg { display: inline-flex; border: 1px solid var(--key-line); border-radius: var(--r); overflow: hidden; }
.seg button {
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  padding: 6px 12px;
  background: var(--panel2);
  color: var(--dim);
  border: none;
  border-right: 1px solid var(--line);
}
.seg button:last-child { border-right: none; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.swatches { display: inline-flex; gap: 6px; align-items: center; }
.sw {
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line2);
  padding: 0;
}
.sw.on { box-shadow: 0 0 0 2px var(--bg2), 0 0 0 4px var(--text); }
/* 색상 피커: 네이티브 input[type=color]을 동그란 스와치로 */
.sw-pick {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px dashed var(--line2);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}
.sw-pick::-webkit-color-swatch-wrapper { padding: 2px; }
.sw-pick::-webkit-color-swatch { border: none; border-radius: 50%; }
.sw-pick::-moz-color-swatch { border: none; border-radius: 50%; }

/* ---------- 공통 레이아웃 ---------- */
.layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 18px;
  padding: 18px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.content { min-width: 0; }

.side {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  align-self: start;
  overflow: hidden;
}
.side-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  background: var(--panel2);
}
.catlist { list-style: none; }
.catlist li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  font-size: 15.5px;
}
.catlist li:last-child { border-bottom: none; }
.catlist li:hover { background: var(--panel2); }
.catlist li.sel {
  background: var(--panel2);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 600;
}
.catlist li > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catlist .cnt { font-size: 13px; color: var(--faint); font-weight: 400; }
.catlist li .x { opacity: 0; padding: 2px 5px; }
.catlist li:hover .x, .catlist li:focus-within .x, .catlist .x:focus-visible { opacity: 1; }
.buildlist .bl-name { font-weight: 500; }

/* ---------- 재고: 툴바 / 테이블 ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.search { width: 340px; max-width: 55%; }

.tblwrap { overflow-x: auto; }
.tbl {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.tbl th {
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--dim);
  background: var(--panel2);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}
.tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--panel2); }
.tbl .r, td.r { text-align: right; }
.tbl .c, td.c { text-align: center; }
.nmcell .nm { font-weight: 600; }
.nm-link { cursor: pointer; }
.nm-link:hover { text-decoration: underline; }
.qtyin.zero { color: var(--red); font-weight: 700; }
.memo { font-size: 13.5px; color: var(--faint); margin-top: 2px; }

.chips { max-width: 560px; }
/* 색 미리보기 스와치: 사양 값에서 색이 감지되면 표시 */
.cprev {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid var(--line2);
  margin-right: 5px;
  vertical-align: -1px;
  flex: none;
}
.cprev.big { width: 22px; height: 22px; border-radius: 4px; margin: 0; }
.cprev.sp { align-self: center; margin: 0 0 0 2px; }
.colorrow { display: flex; gap: 7px; align-items: center; }
.colorrow input:first-child { flex: 1; min-width: 0; }
.cpick {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line2);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  flex: none;
}
.cpick::-webkit-color-swatch-wrapper { padding: 2px; }
.cpick::-webkit-color-swatch { border: none; border-radius: 3px; }

.chip {
  display: inline-block;
  font-size: 13.5px;
  color: var(--dim);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 9px;
  margin: 2px 5px 2px 0;
  white-space: nowrap;
}

.stepper { display: inline-flex; align-items: stretch; }
.stepper button {
  cursor: pointer;
  width: 30px;
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--dim);
  font-size: 17px;
  line-height: 1;
}
.stepper button:hover { color: var(--text); border-color: var(--text); }
.stepper button:first-child { border-radius: 5px 0 0 5px; border-right: none; }
.stepper button:last-child { border-radius: 0 5px 5px 0; border-left: none; }
.qtyin {
  width: 66px;
  text-align: center;
  border-radius: 0;
  padding: 6px 4px;
  -moz-appearance: textfield;
  appearance: textfield;
}
.qtyin::-webkit-outer-spin-button, .qtyin::-webkit-inner-spin-button { -webkit-appearance: none; }

.empty {
  text-align: center;
  color: var(--dim);
  padding: 60px 20px;
  border: 1px dashed var(--line2);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.empty.small { padding: 18px 12px; font-size: 14px; border: none; }

/* ---------- 견적 ---------- */
.b-head { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.b-name {
  flex: 0 1 480px;   /* 이름칸을 좁혀 복제·삭제 버튼이 왼쪽에 붙게 (마우스 동선 최소화) */
  font-size: 20px;
  font-weight: 700;
  background: transparent;
  border: 1px solid transparent;
  padding: 7px 11px;
}
.b-name:hover { border-color: var(--line); }
.b-name:focus { background: var(--field); border-color: var(--line2); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.ptitle-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;   /* 체크박스를 제목 옆에 붙여 마우스 동선을 줄인다 */
  gap: 20px;
  flex-wrap: wrap;
}
.pbcheck {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 13px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.ptitle {
  font-size: 15px;
  font-weight: 700;
  color: var(--dim);
  margin-bottom: 13px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  line-height: 1.2;
}

/* 넓은 화면에서는 스펙 행이 여러 열로 흐른다 */
.specrows { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 9px; align-items: start; }
.specrows > .mini { justify-self: start; }
.specrow { display: flex; gap: 8px; }
.spec-k { width: 170px; }
.spec-v { flex: 1; min-width: 0; }

.brow {
  display: grid;
  grid-template-columns: 150px 1fr;
  border: 1px solid var(--line);
  margin-bottom: -1px;
}
.ptitle-row + .brow { border-radius: 6px 6px 0 0; }
.brow:nth-last-child(2) { border-radius: 0 0 6px 6px; margin-bottom: 0; } /* .b-total이 항상 마지막 자식 */
.brow-cat {
  background: var(--panel2);
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--dim);
  border-right: 1px solid var(--line);
  display: flex;
  align-items: center;
}
.brow-body { padding: 9px 14px; min-width: 0; }
.brow-actions { display: flex; gap: 8px; padding: 4px 0; }

.bpart {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  margin-bottom: 7px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 6px;
  flex-wrap: wrap;
}
.bp-main { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.bp-main .nm { font-weight: 600; margin-right: 4px; }
.bp-side { display: flex; align-items: center; gap: 9px; }
.link-badge {
  font-size: 13px;
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 45%, transparent);
  background: color-mix(in srgb, var(--green) 10%, transparent);
  border-radius: 4px;
  padding: 2px 9px;
  white-space: nowrap;
}
.link-badge.off { color: var(--faint); border-color: var(--line2); background: transparent; }
.link-badge.warn {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 45%, transparent);
  background: color-mix(in srgb, var(--red) 10%, transparent);
}
.price { width: 104px; padding: 6px 9px; }
.linetotal { min-width: 96px; text-align: right; color: var(--dim); font-size: 15px; }

.b-total {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: 6px;
  font-weight: 600;
  font-size: 17px;
}
.unpriced { font-weight: 400; font-size: 15px; }

.memo-ta { width: 100%; min-height: 96px; resize: vertical; }

/* ---------- 키보드 테스트 ---------- */
/* 확대 시 미디어쿼리는 확대 전 폭으로 평가되므로, 실제 폭을 보는 컨테이너 쿼리로 판정한다 */
.ktmain { max-width: var(--maxw); margin: 0 auto; padding: 18px 24px; container-type: inline-size; }
.kt-note { text-align: center; color: var(--dim); font-size: 15px; margin-bottom: 14px; }
.kt-note b { color: var(--text); }

.kt-top, .kt-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}
.kt-top { margin-bottom: 16px; }
.kt-top .panel, .kt-bottom .panel { margin-bottom: 0; }

.kb-wrap {
  overflow-x: auto;
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 16px;
}
.kb {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 23 / 6.5;
  min-width: 940px;
  width: 100%;
  margin: 0 auto;
}

/* @container는 명시도를 올리지 않으므로 반드시 기저 규칙 뒤에 와야 한다 */
@container (min-width: 1500px) {
  .kt-top { grid-template-columns: minmax(0, 1fr) minmax(300px, 17%); }
  .kt-bottom { grid-template-columns: minmax(0, 1fr) minmax(420px, 34%); }
  /* 세로가 화면을 넘지 않는 선에서 최대한 넓게 (확대 배율만큼 vh 보정) */
  .kb { width: min(100%, calc(52vh / var(--zoom) * 23 / 6.5)); }
}
.kb-key { position: absolute; padding: 2.5px; }
.cap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--key1), var(--key2));
  border: 1px solid var(--key-line);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--dim);
  font-size: max(11px, 0.95cqw);   /* 키보드 폭에 비례 — 확대와 무관하게 비율 유지 */
  transition: background 0.06s, color 0.06s;
  overflow: hidden;
}
.cap .sub { position: absolute; top: 4%; left: 7%; font-size: 0.72em; opacity: 0.7; }
.cap .lab { white-space: nowrap; }
.cap.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}
.cap.done { background: var(--done); border-color: var(--done); color: var(--done-ink); }
.cap.chat { box-shadow: 0 0 0 2px var(--red); }

.lastkey { margin-bottom: 14px; }
.bigcode { font-size: 30px; font-weight: 700; margin-bottom: 10px; word-break: break-all; line-height: 1.25; }
.kv {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 15px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}
.kv span { color: var(--faint); }
.counters { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 14px 0; }
.counter {
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}
.counter b { font-size: 28px; line-height: 1.15; }
.counter span { font-size: 13px; color: var(--faint); }
.ktbtns { display: flex; gap: 8px; flex-wrap: wrap; }

.chatset {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--dim);
}
.chatset input { width: 80px; padding: 5px 8px; }
.lms { color: var(--faint); font-size: 13px; }
.lms.chatms { color: var(--red); font-weight: 700; }

.warnbox {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--red) 50%, transparent);
  background: color-mix(in srgb, var(--red) 10%, transparent);
  border-radius: 6px;
  font-size: 14px;
}
.warnbox b { color: var(--red); display: block; margin-bottom: 5px; }

.xgroup { margin-bottom: 14px; }
.xg-name { font-size: 13px; color: var(--faint); margin-bottom: 6px; }
.xkeys { display: flex; flex-wrap: wrap; gap: 6px; }
.xkey {
  font-size: 14.5px;
  padding: 5px 12px;
  background: linear-gradient(180deg, var(--key1), var(--key2));
  border: 1px solid var(--key-line);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--dim);
  cursor: default;
}
.xkey.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.xkey.done { background: var(--done); color: var(--done-ink); border-color: var(--done); }
.xkey.chat { box-shadow: 0 0 0 2px var(--red); }

.log {
  max-height: calc(62vh / var(--zoom));
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  padding: 8px 12px;
  font-size: 14.5px;
}
.logrow { display: flex; gap: 12px; padding: 3px 0; align-items: baseline; }
.logrow.warn { color: var(--red); }
.lt { width: 38px; color: var(--faint); }
.lt.down { color: var(--text); font-weight: 600; }
.chatmark { color: var(--red); font-weight: 700; }
.hints { margin: 14px 0 0 20px; font-size: 14px; color: var(--faint); }
.hints li { margin-bottom: 4px; }

/* ---------- 푸터 ---------- */
.foot { text-align: center; color: var(--faint); font-size: 13.5px; padding: 26px 20px 34px; }

/* ---------- 모달 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--veil);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--line2);
  border-radius: 10px;
  width: min(720px, 94vw);
  max-height: calc(88vh / var(--zoom));
  display: flex;
  flex-direction: column;
  box-shadow: 0 18px 50px var(--shadow);
}
.modal.small { width: min(520px, 94vw); }
.m-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  font-size: 17px;
}
.m-body { padding: 18px 20px; overflow-y: auto; }
.m-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.form-grid { display: grid; grid-template-columns: 120px 1fr; gap: 11px 14px; align-items: start; }
.f-label { color: var(--dim); font-size: 15px; padding-top: 9px; }
.f-note {
  grid-column: 1 / -1;
  color: var(--dim);
  font-size: 14px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
}
.f-label .xk { width: 100%; }
.f-input input, .f-input select { width: 100%; }
.f-input.xrow { display: flex; gap: 7px; align-items: center; }
.f-input.xrow input { flex: 1; }

.tagbox { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.tag {
  cursor: pointer;
  font-size: 14px;
  padding: 4px 12px;
  border-radius: 4px;
  border: 1px solid var(--line2);
  background: transparent;
  color: var(--dim);
}
.tag:hover { border-color: var(--text); }
.tag.sel { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.f-input .tag-add { width: 180px; padding: 5px 10px; font-size: 14px; }

/* 데이터 관리 모달 */
.dm-group { padding: 14px 0; border-bottom: 1px solid var(--line); }
.dm-group:first-child { padding-top: 0; }
.dm-group:last-child { border-bottom: none; padding-bottom: 0; }
.dm-title { font-weight: 700; font-size: 15px; margin-bottom: 3px; }
.dm-status { font-size: 14px; margin-bottom: 10px; }
.dm-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.wide { width: 100%; margin-bottom: 10px; }
.layoutfilter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 14px;
  color: var(--dim);
  cursor: pointer;
}
.layoutfilter b { color: var(--text); }
.picklist { max-height: calc(46vh / var(--zoom)); overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.pickrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  flex-wrap: wrap;
}
.pickrow:last-child { border-bottom: none; }
.pickrow:hover { background: var(--panel2); }
.pickrow.sel { background: var(--panel2); box-shadow: inset 3px 0 0 var(--accent); }
.pickrow.off { opacity: 0.45; cursor: not-allowed; }
.pickrow .nm { font-weight: 600; }
.pickrow .remain { margin-left: auto; color: var(--green); font-size: 14px; white-space: nowrap; }
.pickrow.off .remain { color: var(--red); }
.pickqty { display: flex; align-items: center; gap: 11px; margin-top: 14px; }

/* ---------- 토스트 ---------- */
.toasts { pointer-events: none; position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-left: 3px solid var(--accent);
  color: var(--text);
  border-radius: 6px;
  padding: 11px 16px;
  font-size: 15px;
  box-shadow: 0 8px 22px var(--shadow);
  animation: toastin 0.16s ease, toastout 0.3s ease 2.25s forwards;
  max-width: 380px;
}
.toast.warn { border-color: var(--red); border-left-color: var(--red); }
@keyframes toastin { from { opacity: 0; transform: translateX(14px); } }
@keyframes toastout { to { opacity: 0; transform: translateX(14px); } }

/* ---------- 반응형 ---------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .side { order: -1; }
  .top { gap: 12px; }
  .tabs { order: 3; width: 100%; }
  .search { max-width: none; flex: 1; }
  .brow { grid-template-columns: 1fr; }
  .brow-cat { border-right: none; border-bottom: 1px solid var(--line); padding: 9px 14px; }
  .specrows { grid-template-columns: 1fr; }
}
