/* =====================================================================
   네일샵 관리 — 디자인 시스템 (2026-11-05 개편)
   규칙 설명: docs/design-system.md  ·  부품 모음 화면: /staff/ui-kit
   - 바탕은 아주 옅은 회색, 내용은 흰 카드. 포인트 색은 차분한 파랑 하나.
   - 간격은 4px 단위(4·8·12·16·20·24·32), 글자 크기는 6단계.
   - 상태 색: 성공(초록)·주의(주황)·위험(빨강)·정보(파랑=포인트). 배경은 옅게, 글자는 진하게.
   - 아이콘은 Lucide 선 아이콘({{ icon("이름") }}), 이모지 쓰지 않기.
   ===================================================================== */
:root {
  /* 색 — 바탕·글자 */
  --bg: #F4F5F7;          /* 화면 바탕 */
  --card: #FFFFFF;        /* 카드·입력칸 */
  --fill: #F2F4F6;        /* 회색 채움(보조 버튼·칸) */
  --fill-strong: #E8EBEE;
  --text: #191F28;        /* 본문 */
  --text-2: #4E5968;      /* 보조 글자 */
  --muted: #5F6B7A;       /* 흐린 글자 (흰 바탕·회색 바탕 모두 AA 이상) */
  --faint: #8B95A1;       /* 꾸밈용 아주 흐린 글자 (본문에 쓰지 않기) */
  --line: #E5E8EB;        /* 구분선 */
  --line-soft: #EEF0F2;
  --line-strong: #D1D6DB;
  /* 포인트 색 (파랑) */
  --accent: #2B63D9;
  --accent-dark: #1E4FB8;
  --accent-soft: #EAF1FE;
  --accent-line: #C5D7FB;
  /* 상태 색 */
  --ok: #0B7A4B;     --ok-bg: #E6F6EE;     --ok-line: #B6E3CB;
  --warn: #A35200;   --warn-bg: #FFF3E0;   --warn-line: #F5D3A3;
  --danger: #C8281C; --danger-bg: #FDECEB; --danger-line: #F5C2BD;
  --info: var(--accent); --info-bg: var(--accent-soft);
  /* 글자 크기 6단계 */
  --fs-xs: .75rem;    /* 12 — 칩·작은 표시 */
  --fs-sm: .875rem;   /* 14 — 보조 설명 */
  --fs-md: 1rem;      /* 16 — 본문·입력 */
  --fs-lg: 1.125rem;  /* 18 — 카드 제목 */
  --fs-xl: 1.375rem;  /* 22 — 화면 제목 */
  --fs-2xl: 1.75rem;  /* 28 — 큰 숫자 */
  /* 간격 (4px 단위) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;
  /* 둥글기 */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-full: 999px;
  /* 그림자는 떠 있는 것(시트·토스트·떠 있는 버튼)에만 */
  --shadow-float: 0 6px 20px rgba(25, 31, 40, .14);
  --focus: 0 0 0 3px rgba(43, 99, 217, .28);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
button, input, select, textarea { font-family: inherit; letter-spacing: inherit; }

/* ---------- 아이콘 ---------- */
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 1em; height: 1em; vertical-align: -0.15em; }
.ic.lg { width: 1.5em; height: 1.5em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 위 메뉴 (상단 바) ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-2) var(--sp-4); min-height: 60px;
  background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: var(--sp-2); font-weight: 700; font-size: var(--fs-md); text-decoration: none;
  color: var(--text); min-width: 0; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; border-radius: var(--r-sm); flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; }
.brand-mark .ic { width: 18px; height: 18px; vertical-align: 0; }
.brand-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.topbar nav { display: flex; gap: 2px; }
.topbar nav a, .topbar nav .soon {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--text-2); font-weight: 600; white-space: nowrap;
}
.topbar nav a:hover { background: var(--fill); color: var(--text); }
.topbar nav a.on { background: var(--accent-soft); color: var(--accent-dark); }
.topbar nav .soon { color: var(--muted); opacity: .6; }

/* ---------- 화면 틀 · 제목 · 글자 ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: var(--sp-5) var(--sp-4) var(--sp-8); }
h1 { font-size: var(--fs-xl); line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
h2 { font-size: var(--fs-lg); line-height: 1.35; font-weight: 700; margin: 0 0 var(--sp-3); }
h3 { font-size: var(--fs-md); font-weight: 700; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: var(--fs-sm); }
p { margin: 0 0 var(--sp-3); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.head-row h1, .head-row h2 { margin: 0; }
.back { display: inline-flex; align-items: center; gap: 2px; margin-bottom: var(--sp-2); text-decoration: none; color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 600; }
.back:hover { color: var(--text); }

/* ---------- 버튼 3종: 주 버튼(primary) · 보조(기본) · 글자 버튼(ghost) + 위험(danger) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: var(--r-md);
  border: 1px solid transparent; background: var(--fill); color: var(--text);
  font-size: var(--fs-md); font-weight: 600; line-height: 1.25; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .12s, border-color .12s, color .12s;
}
.btn:hover { background: var(--fill-strong); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.big { width: 100%; min-height: 52px; padding: 14px; font-size: var(--fs-lg); font-weight: 700; }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--fill); }
.btn.danger { background: var(--card); color: var(--danger); border-color: var(--danger-line); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.icon { padding: 10px; min-width: 44px; }
.btn.small-btn { min-height: 36px; padding: 6px 12px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn:disabled { opacity: .5; cursor: default; }
.link-btn { background: none; border: 0; padding: 0; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }

/* ---------- 입력칸 · 선택 ---------- */
.search { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); }
input, textarea, select {
  width: 100%; min-height: 48px; padding: 12px 14px; font: inherit; font-size: var(--fs-md); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--card);
  transition: border-color .12s, box-shadow .12s;
}
textarea { line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:hover, textarea:hover, select:hover { border-color: #B0B8C1; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--accent); }
select { appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235F6B7A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
input[type=file] { padding: 10px; }

/* ---------- 목록 (누르면 들어가는 줄) ---------- */
.list { list-style: none; padding: 0; margin: 0; background: var(--card); border-radius: var(--r-lg); overflow: hidden; }
.list li + li { border-top: 1px solid var(--line-soft); }
/* minmax(0,1fr): 긴 이름·메모가 있어도 칸이 화면보다 넓어지지 않게 (사파리·파이어폭스 320px 에서 전화번호가 잘리던 것, 2026-11-10) */
.list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px var(--sp-4); text-decoration: none; color: var(--text); }
.list a:hover { background: #FAFBFC; }
.list a:active { background: var(--fill); }
.list .name { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.list .phone { color: var(--muted); font-variant-numeric: tabular-nums; }
.list .memo { grid-column: 1 / -1; min-width: 0; color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 빈 화면 안내 ---------- */
.empty { text-align: center; padding: 40px var(--sp-4); color: var(--muted); line-height: 1.7; }
.empty > .ic { display: block; width: 40px; height: 40px; margin: 0 auto var(--sp-3); color: var(--faint); stroke-width: 1.5; }

/* ---------- 카드 · 폼 ---------- */
.card { background: var(--card); border: 0; border-radius: var(--r-lg); padding: var(--sp-5); margin-bottom: var(--sp-3); }
.form label { display: block; margin-bottom: var(--sp-4); font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); }
.form label input, .form label textarea, .form label select { margin-top: 6px; font-weight: 400; color: var(--text); }
.req { color: var(--danger); }

/* ---------- 알림 상자 (배너) ---------- */
.alert, .notice, .hint {
  display: block; padding: 12px var(--sp-4); border-radius: var(--r-md); margin: var(--sp-3) 0; font-size: var(--fs-sm); line-height: 1.55; }
.alert { background: var(--danger-bg); color: var(--danger); }
.notice { background: var(--ok-bg); color: var(--ok); }
.notice.bad { background: var(--danger-bg); color: var(--danger); }
.hint { background: var(--fill); color: var(--text-2); }
.alert ul { margin: 6px 0; padding-left: 20px; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.info { background: var(--info-bg); color: var(--accent-dark); }
.notice:has(> .ic), .alert:has(> .ic), .hint:has(> .ic) { display: flex; align-items: flex-start; gap: var(--sp-2); }
.notice > .ic, .alert > .ic, .hint > .ic { margin-top: 1px; }

.big-phone { font-size: var(--fs-lg); margin: 4px 0 12px; font-variant-numeric: tabular-nums; }
.big-phone a { text-decoration: none; font-weight: 600; }
.memo-box { background: var(--fill); padding: 12px var(--sp-4); border-radius: var(--r-md); white-space: pre-wrap; margin: 0 0 var(--sp-2); }

/* 이름 · 값 줄 */
.rows { list-style: none; padding: 0; margin: 0; }
.rows li { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); padding: 12px 0; border-top: 1px solid var(--line-soft); }
.rows li:first-child { border-top: 0; }
.rows li a { text-decoration: none; color: var(--text); }
.rows li.block a { color: var(--muted); }
.rows li form { margin: 0; }

/* ---------- 공통 작은 것들 ---------- */
.wrap.wide { max-width: 1280px; }
.danger-text { color: var(--danger); }
.tnum { font-variant-numeric: tabular-nums; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--sp-3); }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 var(--sp-3); }
.field-hint { margin: -8px 0 var(--sp-4); font-size: var(--fs-sm); color: var(--muted); }
.check { display: flex !important; align-items: center; gap: var(--sp-2); margin: var(--sp-2) 0 0 !important; font-weight: 500 !important; color: var(--text) !important; }
.check input { width: 20px; margin: 0 !important; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: var(--sp-2); }
.past summary { cursor: pointer; color: var(--text-2); padding: 4px 0; font-weight: 600; }

/* ---------- 배지 (상태 표시) ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 700; line-height: 1.5;
  padding: 2px 8px; border-radius: var(--r-sm); white-space: nowrap; background: var(--fill); color: var(--text-2); }
.chip.big { font-size: var(--fs-sm); padding: 4px 10px; }
.chip .ic { width: 13px; height: 13px; vertical-align: 0; }
.st-booked { background: var(--accent-soft); color: var(--accent-dark); }
.st-done { background: var(--ok-bg); color: var(--ok); }
.st-noshow { background: var(--danger-bg); color: var(--danger); }
.st-canceled { background: var(--fill); color: var(--muted); }

/* ---------- 시트 (확인 창) ---------- */
dialog.sheet { border: 0; border-radius: var(--r-lg); padding: var(--sp-6); width: min(440px, calc(100vw - 32px)); color: var(--text);
  box-shadow: var(--shadow-float); }
dialog.sheet::backdrop { background: rgba(25, 31, 40, .45); }
@media (max-width: 720px) {
  dialog.sheet { margin: auto 0 0; width: 100%; max-width: none; border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom)); }
}
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--fill); padding: 1px 6px; border-radius: 6px; }

/* ---------- 부품 모음 화면 (/staff/ui-kit) ---------- */
.kit-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--sp-3); }
.kit-colors div { display: grid; gap: 2px; font-size: var(--fs-sm); }
.kit-colors i { display: block; height: 44px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.kit-space { display: grid; gap: var(--sp-2); }
.kit-space div { display: flex; align-items: center; gap: var(--sp-3); }
.kit-space i { display: block; height: 16px; background: var(--accent); border-radius: 3px; }
.kit-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--sp-2); }
.kit-icons div { display: grid; justify-items: center; gap: 6px; padding: var(--sp-3) var(--sp-1); border-radius: var(--r-sm); background: var(--fill); }
.kit-icons .ic { width: 24px; height: 24px; }
.kit-icons small { font-size: var(--fs-xs); }
.empty .btn { margin-top: var(--sp-3); }

/* ---------- 탭 (같은 화면 안에서 보기 바꾸기) ---------- */
.tabs { display: flex; gap: 4px; margin: 0 0 var(--sp-4); padding: 4px; background: var(--fill-strong); border-radius: var(--r-md); }
.tabs a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 8px 10px;
  border-radius: var(--r-sm); text-decoration: none; color: var(--text-2); font-weight: 600; font-size: var(--fs-sm); }
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(25, 31, 40, .08); }
.status-bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-4); }
.status-bar form { margin: 0; }

/* ---------- 예약판 ---------- */
.day-nav { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.day-nav .date-pick { flex: 1; text-align: center; }
.date-pick label { position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 6px 10px; border-radius: var(--r-sm); }
.date-pick label:hover { background: var(--fill-strong); }
.date-pick input[type=date] { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.day-title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.02em; margin: 0; flex: 1; text-align: center; }
.today-tag { font-style: normal; font-size: var(--fs-xs); font-weight: 700; background: var(--accent-soft); color: var(--accent-dark);
  padding: 2px 8px; border-radius: var(--r-sm); vertical-align: middle; letter-spacing: 0; }
.day-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.day-tools .summary { margin: 0; color: var(--text-2); }
.day-tools .summary b { color: var(--text); }
.tool-links { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.tool-links .btn:not(.primary):not(.alert-btn), .day-nav .btn { background: var(--card); border-color: var(--line); }
.day-nav .btn:hover { background: var(--fill); }
.tool-links .btn:not(.primary):not(.alert-btn):hover { background: var(--fill); }

.board-scroll {
  --row: 34px;
  overflow: auto; max-height: calc(100vh - 210px);
  background: var(--card); border-radius: var(--r-lg);
}
.board {
  display: grid;
  --timew: 52px; --colmin: 140px;
  /* --tpl = 칸마다 너비 (겹친 예약 있는 칸은 넓게, schedule_day.html 에서 만듦) */
  grid-template-columns: var(--timew) var(--tpl, repeat(var(--cols), minmax(var(--colmin), 1fr)));
  min-width: max-content;
}
.corner, .col-head { position: sticky; top: 0; z-index: 3; background: var(--card);
  border-bottom: 1px solid var(--line); height: 44px; }
.corner { left: 0; z-index: 4; }
.col-head { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: var(--fs-sm);
  border-left: 1px solid var(--line-soft); }
.col-head::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.times { position: sticky; left: 0; z-index: 2; background: var(--card); }
.times .t { height: var(--row); font-size: var(--fs-xs); color: var(--muted); text-align: right;
  padding: 0 8px 0 4px; transform: translateY(-.6em); font-variant-numeric: tabular-nums; }
.times .t.hour { color: var(--text-2); font-weight: 600; }
.times .t:first-child { transform: none; }
.col { position: relative; border-left: 1px solid var(--line-soft); }
.slot { display: block; height: var(--row); border-top: 1px dashed var(--line-soft); }
.slot.hour { border-top: 1px solid var(--line); }
.slot:hover, .slot:active { background: var(--accent-soft); }

/* 예약 블록: 직원 색은 왼쪽 띠 + 아주 옅은 바탕. 상태는 바탕·글자로 (완료 = 흐리게, 노쇼 = 빨강 + 가운데 줄) */
.ev {
  position: absolute; z-index: 1; overflow: hidden; margin: 1px 0 0 2px;
  display: flex; flex-direction: column; gap: 0; padding: 4px 8px 4px 9px;
  background: color-mix(in srgb, var(--c) 10%, white); border: 1px solid color-mix(in srgb, var(--c) 22%, white);
  border-left: 3px solid var(--c);
  border-radius: var(--r-sm); color: var(--text); text-decoration: none; font-size: var(--fs-xs); line-height: 1.35;
}
.ev:hover { border-color: color-mix(in srgb, var(--c) 45%, white); border-left-color: var(--c); }
.ev .ev-time { color: var(--text-2); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .ev-who { font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .ev-menu, .ev .ev-src { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.ev .ev-src { color: var(--muted); }
.ev .ic { width: 12px; height: 12px; vertical-align: -1px; }
.ev.st-done { background: var(--fill); border-color: var(--line); border-left-color: var(--line-strong); }
.ev.st-done .ev-who, .ev.st-done .ev-menu { color: var(--muted); }
.ev.st-noshow { background: var(--danger-bg); border-color: var(--danger-line); border-left-color: var(--danger); }
.ev.st-noshow .ev-who { text-decoration: line-through; }
.ev.block { z-index: 0;   /* 막기는 예약 뒤 바탕으로 */
  background: repeating-linear-gradient(135deg, var(--fill), var(--fill) 6px, var(--card) 6px, var(--card) 12px);
  border-color: var(--line); border-left-color: var(--line-strong); color: var(--muted); }
.ev.block .ev-who { font-size: var(--fs-xs); color: var(--text-2); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); z-index: 2; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }

/* 떠 있는 '+ 예약 / + 매출' 버튼 */
.fab { position: fixed; right: 16px; bottom: 20px; z-index: 20; display: inline-flex; align-items: center; gap: 6px;
  min-height: 52px; padding: 0 20px 0 16px; border-radius: var(--r-full);
  background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; box-shadow: var(--shadow-float); }
.fab:hover { background: var(--accent-dark); }

.week-day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.week-day h2 a { color: var(--text); text-decoration: none; }

@media (max-width: 560px) {
  .board-scroll { --row: 30px; max-height: calc(100vh - 230px); }
  .board { --timew: 44px; --colmin: 120px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
.ev.short { flex-direction: row; align-items: center; gap: 4px; padding-top: 1px; padding-bottom: 1px; }
.ev.short .ev-menu, .ev.short .ev-src, .ev.mid .ev-src { display: none; }
.ev.short .ev-time { display: none; }
.week-day .rows li { flex-wrap: nowrap; }
.week-day .rows li > a { min-width: 0; }
.week-day.empty { padding: 12px var(--sp-5); }
.week-day.empty .head-row { margin-bottom: 0; }
.week-day.empty h2 { color: var(--text-2); }

/* ---------- 결제 · 매출 ---------- */
input.money { font-size: var(--fs-2xl); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; min-height: 60px; letter-spacing: -0.02em; }
.pick { border: 0; padding: 0; margin: 0 0 var(--sp-4); min-width: 0; }
.pick legend { font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); margin-bottom: 6px; padding: 0; }
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
/* 고르기 버튼 (라디오) */
.pill { margin: 0 !important; font-weight: 500 !important; color: var(--text) !important; font-size: var(--fs-md) !important; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.pill span { display: block; text-align: center; padding: 12px 8px; border: 1px solid var(--line-strong);
  border-radius: var(--r-md); background: var(--card); cursor: pointer; min-height: 48px; transition: border-color .12s, background-color .12s; }
.pill span:hover { border-color: #B0B8C1; }
.pill input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--accent); }
.pill input:focus-visible + span { box-shadow: var(--focus); }
.btn.ghost { margin-top: var(--sp-2); }
.paid-box { background: var(--ok-bg); color: var(--ok); border-radius: var(--r-md); padding: 12px var(--sp-4); margin: var(--sp-2) 0; }
.paid-box p { margin: 0 0 4px; }
.paid-box a { font-size: var(--fs-sm); color: inherit; }
.total-card { text-align: center; }
.total-card p { margin: 0; }
.total-card .total { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 2px 0; }
.split-cards { gap: 0 12px; }
.sales-rows li { align-items: flex-start; }
@media (max-width: 560px) { .split-cards { grid-template-columns: 1fr; } }

/* ---------- 정액권 · 회원 ---------- */
.member-tag { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-xs); font-weight: 700; color: var(--accent-dark); background: var(--accent-soft);
  padding: 2px 8px; border-radius: var(--r-sm); vertical-align: middle; white-space: nowrap; letter-spacing: 0; }
.member-tag .ic { width: 12px; height: 12px; vertical-align: 0; }
.member-box { background: var(--accent-soft); color: var(--accent-dark); border-radius: var(--r-md); padding: 12px var(--sp-4); margin: var(--sp-2) 0; }
.member-box a { color: inherit; }
.pass-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-2); }
.pass-pick .pill span { text-align: left; padding: 10px 12px; line-height: 1.35; }
.pass-pick .pill small { opacity: .85; }
.pass-use { background: var(--fill); border-radius: var(--r-md); padding: var(--sp-4); margin: -4px 0 var(--sp-4); }
.pass-use p { margin: 0 0 8px; }
.pass-use label { margin-bottom: 6px !important; }
.pass-balance { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.pass-card.off { opacity: .7; }
.rows li.off a { color: var(--muted); }
details.card summary { cursor: pointer; }
details.card form { margin-top: 12px; }
.small-tabs a { padding: 8px; }
.kind-sale { background: var(--accent-soft); color: var(--accent-dark); margin-left: 4px; }
.kind-use { background: var(--accent-soft); color: var(--accent-dark); margin-left: 4px; }
.total-pair { gap: 0 12px; }
.total-pair .total { font-size: var(--fs-2xl); }
.center { text-align: center; }
.explain { background: var(--fill); border-radius: var(--r-md); padding: 12px var(--sp-4); color: var(--text-2); font-size: var(--fs-sm); }

/* ---------- 시술 사진 ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 8px; }
.photo-grid a { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-sm); background: var(--bg); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-date { position: absolute; left: 4px; bottom: 4px; font-size: var(--fs-xs); color: #fff;
  background: rgba(0,0,0,.45); padding: 1px 6px; border-radius: 999px; }
@media (min-width: 600px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
.gallery-day { margin: 16px 0 6px; font-size: var(--fs-md); }
.photo-strip { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 6px; }
.photo-strip img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--r-sm); display: block; }
.appt-photos { margin-top: 8px; }
.appt-photos h2 { margin: 0; }

.drop { display: block !important; position: relative; border: 2px dashed var(--accent); border-radius: var(--r-md);
  background: var(--accent-soft); text-align: center; padding: 28px 12px; cursor: pointer; margin-bottom: 12px !important; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-text { color: var(--accent-dark); font-weight: 700; line-height: 1.6; }
.preview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 12px; }
.preview img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-sm); }
.btn:disabled { opacity: .6; }

.photo-big { position: relative; background: #111418; border-radius: var(--r-md); overflow: hidden; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center; min-height: 240px; }
.photo-big img { max-width: 100%; max-height: 72vh; display: block; }
.photo-big .nav-prev, .photo-big .nav-next { position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.85); color: var(--text);
  display: flex; align-items: center; justify-content: center; font-size: var(--fs-2xl); text-decoration: none; }
.photo-big .nav-prev { left: 8px; }
.photo-big .nav-next { right: 8px; }
.note-form { margin: 12px 0 0; }
.photo-price { position: absolute; right: 4px; top: 4px; font-size: var(--fs-xs); font-weight: 700; color: #fff;
  background: rgba(25, 31, 40, .72); padding: 1px 7px; border-radius: 999px; }
.big-price { font-size: var(--fs-lg); color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.consult p { margin: 6px 0 0; }

/* ---------- 월별 매출 정리 ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kpi { margin-bottom: 4px; padding: 12px; }
.kpi p { margin: 0; }
.kpi-v { font-size: var(--fs-xl); font-weight: 800; font-variant-numeric: tabular-nums; margin: 2px 0 !important; }
.delta { color: var(--muted); font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr 1fr; } .kpi-v { font-size: var(--fs-lg); } }

.chart { width: 100%; overflow-x: auto; }
.chart svg.bars { width: 100%; max-width: 720px; height: auto; display: block; }
.chart.short svg.bars { min-width: 0; max-width: 360px; }
svg.bars .grid { stroke: var(--line); stroke-width: 1; }
svg.bars .base { stroke: var(--line-strong); stroke-width: 1; }
svg.bars .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg.bars .bar { fill: color-mix(in srgb, var(--accent) 55%, white); }
svg.bars .bar.hl { fill: var(--accent); }
svg.bars .hitbox { fill: transparent; }
svg.bars .hit:hover .bar { fill: var(--accent-dark); }
svg.bars .hit:hover .hitbox { fill: rgba(43, 99, 217, .05); }

.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: var(--fs-xs); padding: 4px 0; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 8px; }
.tbl tr.sub td { color: var(--muted); font-size: var(--fs-xs); padding-top: 0; border-bottom: 1px solid var(--line); }
.share-list { list-style: none; padding: 0; margin: 0; }
.share-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.share-list li:first-child { border-top: 0; }
.share-list b { font-variant-numeric: tabular-nums; }
.share-bar { grid-column: 1 / -1; height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.share-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* ---------- 로그인 · 계정 ---------- */
.auth-box { max-width: 420px; margin: 16px auto; }
.auth-box h1 { margin-bottom: 8px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
input.up { text-transform: uppercase; }
.code-big { font-size: var(--fs-2xl); color: var(--accent-dark); }
.pw-card { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 12px; }
.pw-card p { margin: 0 0 8px; }
.pw-card .btn { margin-top: 6px; }
.brand .who { display: block; font-size: var(--fs-xs); font-weight: 500; color: var(--muted); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.staff-rows li { display: block; }
.staff-main { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.staff-acct { margin: 4px 0 2px 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.acct-btns { display: inline-flex; gap: 10px; }
.acct-btns form { margin: 0; }
.acct-new summary { cursor: pointer; color: var(--accent-dark); }
.acct-new form { margin-top: 6px; }
.inline-form { margin: 0; }

/* ---------- 정액권 알림 ---------- */
.tabs a.has-alert b { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 7px; font-size: var(--fs-xs); }
.tabs a.on.has-alert b { background: #fff; color: var(--accent); }
.alert-btn { border-color: var(--danger-line); color: var(--danger); background: var(--danger-bg); }
.alert-sec h2 { margin-bottom: 4px; }
.alert-list { list-style: none; padding: 0; margin: 8px 0 0; }
.alert-list li { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; scroll-margin-top: 80px; }
.alert-list li:first-child { border-top: 0; }
.alert-list li.done { opacity: .55; }
.al-main { display: flex; align-items: center; gap: 8px; }
.al-name { font-weight: 700; font-size: var(--fs-lg); color: var(--text); text-decoration: none; }
.al-pass a { color: inherit; }
.al-next { color: var(--ok); }
.al-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.al-actions form { margin: 0; }
.alert-expiring .al-chip { background: var(--warn-bg); color: var(--warn); }
.alert-expired .al-chip { background: var(--danger-bg); color: var(--danger); }
.alert-low .al-chip { background: var(--fill); color: var(--text-2); }
.ev .ev-alert { font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .ev-alert.al-expiring { color: var(--warn); }
.ev .ev-alert.al-expired { color: var(--danger); }
.ev .ev-alert.al-low { color: var(--text-2); }
.pass-hint { margin: 8px 0 0; font-size: var(--fs-sm); font-weight: 600; }
.pass-hint.al-expiring { color: var(--warn); }
.pass-hint.al-expired { color: var(--danger); }
.pass-hint.al-low { color: var(--text-2); }

/* ---------- 정액권 유효기간 기준 ---------- */
.pick-grid.two { grid-template-columns: 1fr 1fr; }
.expiry-pick .pill span { line-height: 1.35; }
.expiry-pick select { margin-top: 8px; width: 100%; }
.expiry-pick .field-hint { margin: 8px 0 0; }

/* ---------- 급여 ---------- */
[hidden] { display: none !important; }
.inline-label { display: flex; flex-direction: column; gap: 4px; flex: 1; font-size: var(--fs-sm); }
.pay-form h3 { margin: 22px 0 8px; font-size: var(--fs-md); border-top: 1px solid var(--line); padding-top: 16px; }
.pay-form h3:first-of-type { border-top: 0; padding-top: 0; }
.pay-form .pick-grid { margin-bottom: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.preset { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: var(--r-md); padding: 10px 12px; cursor: pointer; font: inherit; display: grid; gap: 2px; }
.preset small { color: var(--muted); font-size: var(--fs-xs); }
.preset:hover, .preset:focus { border-color: var(--accent); }
.tier-row { display: grid; grid-template-columns: 1fr auto 72px auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.tier-row input { margin: 0 !important; }
.tier-row span { font-size: var(--fs-sm); color: var(--muted); }
.try-box { background: var(--fill); border-radius: var(--r-md); padding: 14px; margin: 22px 0 14px; }
.try-box h3 { border: 0 !important; padding: 0 !important; margin: 0 0 4px !important; }
.pay-summary { font-weight: 600; margin: 10px 0 4px; }
.pay-steps li { gap: 12px; }
.pay-steps li > span { min-width: 0; }
.pay-steps li small { word-break: keep-all; }
.pay-steps .pay-total { border-top: 2px solid var(--text, var(--text)); font-weight: 700; }
.pay-net, .pay-sum .pay-net { font-size: var(--fs-lg); font-weight: 800; color: var(--accent); }
.pay-warn { background: var(--warn-bg); color: var(--warn); border-radius: var(--r-md); padding: 10px 12px; margin: 8px 0; font-size: var(--fs-sm); }
.pay-list { list-style: none; padding: 0; margin: 0; }
.pay-list > li { padding: 12px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.pay-list > li:first-child { border-top: 0; }
.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pay-name { font-weight: 700; font-size: var(--fs-lg); color: var(--text); text-decoration: none; }
.pay-amt { font-size: var(--fs-lg); }
.pay-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pay-chips:empty { display: none; }
.pay-sum { margin-top: 10px; border-top: 2px solid var(--line); padding-top: 6px; }
.pay-form .money, .pay-adj .money, .tier-row .money, .try-box .money { font-size: var(--fs-md); text-align: right; }
.pay-adj { display: grid !important; grid-template-columns: 1fr 1.6fr; gap: 6px; }
.pay-adj > * { min-width: 0; width: 100%; margin: 0 !important; }

/* ---------- 근태 ---------- */
.badge { background: var(--danger, var(--danger)); color: #fff; border-radius: 999px; padding: 0 7px; font-size: var(--fs-xs); }
.tabs a.on .badge { background: #fff; color: var(--accent); }
.notice.bad { background: var(--danger-bg); color: var(--danger); }
.clock-card { text-align: center; }
.clock-now { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 4px 0; }
.clock-state { margin-bottom: 14px; }
.clock-btn { width: 100%; font-size: var(--fs-xl); padding: 18px; border-radius: var(--r-lg); }
.clock-btn.out { background: var(--text); color: #fff; border-color: var(--text); }
.leave-today { background: var(--ok-bg); color: var(--ok); border-radius: var(--r-md); padding: 8px; font-weight: 600; }
.lv-pending { background: var(--warn-bg); color: var(--warn); }
.lv-approved { background: var(--ok-bg); color: var(--ok); }
.lv-rejected, .lv-canceled { background: var(--fill); color: var(--text-2); }
.leave-rows li { align-items: flex-start; }
.leave-new { margin-top: 12px; }
.leave-new summary, .att-edit summary { cursor: pointer; }
.lv-card { border-top: 1px solid var(--line); padding: 12px 0; }
.lv-card:first-of-type { border-top: 0; }
.lv-card p { margin: 4px 0; }
.lv-card .pay-warn ul { margin: 6px 0 0; padding-left: 18px; }
.lv-who { font-size: var(--fs-lg); }
.pend-link { display: block; text-decoration: none; color: var(--warn); background: var(--warn-bg); }
.att-list { list-style: none; padding: 0; margin: 0; }
.att-list > li { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 4px; }
.att-list > li:first-child { border-top: 0; }
.att-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.att-name { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.att-time { font-variant-numeric: tabular-nums; }
.att-flags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.att-flags:empty { display: none; }
.att-edit form, .att-days form { flex-wrap: wrap; margin-top: 8px; }
.att-edit input[type=time], .att-days input[type=time] { width: auto; flex: 1 1 110px; }
.att-sum { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.att-sum th, .att-sum td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.att-sum th { color: var(--muted); font-weight: 600; font-size: var(--fs-xs); }
.att-sum tr.on td { background: var(--accent-soft); font-weight: 700; }
.att-sum a { color: inherit; }
.att-days { list-style: none; padding: 0; margin: 0; }
.att-days li { border-top: 1px solid var(--line); }
.att-days li.we .ad-date { color: var(--accent); }
.att-days li.future { opacity: .45; }
.att-days summary { display: grid; grid-template-columns: 52px 1fr; gap: 4px 8px; padding: 8px 0; cursor: pointer; list-style: none; }
.att-days summary::-webkit-details-marker { display: none; }
.ad-date { font-weight: 700; }
.ad-date small { font-weight: 400; color: var(--muted); margin-left: 2px; }
.ad-time { font-variant-numeric: tabular-nums; }
.ad-flags { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--fs-sm); }
.ad-flags:empty { display: none; }
.staff-work { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line); }
.staff-work:first-of-type { border-top: 0; }
.staff-work .sw-name { flex: 0 0 100%; }
.staff-work select, .staff-work input { width: auto; margin: 0 !important; }
.staff-work input[name=leave_days] { width: 64px; }
.staff-work .sw-bal { flex: 0 0 100%; }
.leave-rows li > span:first-child { min-width: 0; }
.leave-rows .acct-btns { flex: 0 0 auto; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.leave-rows .chip { white-space: nowrap; }
.range-box { background: var(--accent-soft); color: var(--accent-dark); border-radius: var(--r-md); padding: 10px 12px; margin: 4px 0 8px; font-size: var(--fs-sm); }
.sub-tabs a { padding: 7px; font-size: var(--fs-sm); }
.lv-sum td small { font-size: var(--fs-xs); }
.lv-total { float: right; color: var(--accent); }
.lv-months { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 4px 0 12px; }
.lv-months div { background: var(--fill); border-radius: var(--r-sm); padding: 6px 2px; text-align: center; display: grid; }
.lv-months div.has { background: var(--ok-bg); color: var(--ok); }
.lv-months small { color: var(--muted); font-size: var(--fs-xs); }
.sw-name a { color: inherit; }

/* ---------- 가입·결제·운영자 ---------- */
.wide-auth { max-width: 560px; }
.steps-line { display: flex; list-style: none; padding: 0; margin: 4px 0 14px; gap: 4px; counter-reset: s; }
.steps-line li { flex: 1; text-align: center; font-size: var(--fs-xs); color: var(--muted); padding-top: 26px; position: relative; counter-increment: s; }
.steps-line li::before { content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--fill); line-height: 22px; font-weight: 700; color: var(--muted); }
.steps-line li.on { color: var(--accent); font-weight: 700; }
.steps-line li.on::before { background: var(--accent); color: #fff; }
.steps-line li.done::before { content: "✓"; background: var(--ok-bg); color: var(--ok); }
.form h2 { margin: 18px 0 6px; font-size: var(--fs-md); }
.form h2:first-child { margin-top: 0; }
.agree-box { background: var(--fill); border-radius: var(--r-md); padding: 4px 12px 10px; }
.big-emoji { font-size: 2.6rem; margin: 6px 0; }
.plan-price { font-size: var(--fs-2xl); font-weight: 800; margin: 4px 0 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.btn-row form { margin: 0; }
.sub-banner { display: flex; align-items: center; justify-content: center; min-height: 44px; text-align: center; padding: 8px 12px; font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.sub-banner.trial { background: var(--accent-soft); color: var(--accent-dark); }
.sub-banner.fail { background: var(--danger-bg); color: var(--danger); }
.sub-banner.cancel { background: var(--warn-bg); color: var(--warn); }
.op-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--text); color: #fff; border-radius: var(--r-md); padding: 10px 14px; margin-bottom: 12px; }
.op-bar a { color: rgba(255,255,255,.72); text-decoration: none; }
.op-bar a.on { color: #fff; font-weight: 700; }
.op-bar form { margin: 0 0 0 auto; }
.op-bar .link-btn { color: rgba(255,255,255,.72); }
.op-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.op-kpis .card { margin: 0; display: grid; gap: 2px; }
.op-kpis b { font-size: var(--fs-xl); }
.op-tabs { flex-wrap: wrap; }
.op-tabs a { flex: 1 1 30%; }
.op-list { list-style: none; padding: 0; margin: 0; }
.op-list li { border-top: 1px solid var(--line); }
.op-list li:first-child { border-top: 0; }
.op-list a { display: grid; gap: 2px; padding: 10px 0; color: var(--text); text-decoration: none; }
.op-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.op-pending { background: var(--warn-bg); color: var(--warn); }
.op-trial { background: var(--accent-soft); color: var(--accent-dark); }
.op-active { background: var(--ok-bg); color: var(--ok); }
.op-problem, .op-suspended, .op-rejected, .op-closed { background: var(--danger-bg); color: var(--danger); }
.terms h3 { margin: 14px 0 4px; font-size: .98rem; }
.terms p { margin: 0 0 8px; line-height: 1.6; }
.link-rows li a { color: var(--text); text-decoration: none; flex: 1; }
.reset-link { word-break: break-all; color: var(--muted); }

/* ---------- 접속 기록 ---------- */
.log-filter select { width: 100%; margin-top: 6px; }
.log-list li { display: block; padding: 10px 14px; }
.log-main { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.log-what { min-width: 0; word-break: break-all; }
.log-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 4px; }
.log-chip { background: var(--fill); color: var(--text-2); }
.act-view .log-chip, .act-search .log-chip { background: var(--accent-soft); color: var(--accent-dark); }
.act-create .log-chip, .act-update .log-chip, .act-login .log-chip { background: var(--ok-bg); color: var(--ok); }
.act-delete .log-chip, .act-download .log-chip, .act-login_fail .log-chip { background: var(--danger-bg); color: var(--danger); }
.log-pages { margin-top: 12px; }
.log-filter .grid2 > label { min-width: 0; }
.log-filter input[type=date] { width: 100%; min-width: 0; box-sizing: border-box; }
.log-list .log-what a { display: inline; padding: 0; }
.log-count { margin: 0; white-space: nowrap; }
/* ---------- 시술 메뉴판 (menus.py, _menu_picker.html) ---------- */
.menu-link { display: block; text-decoration: none; color: var(--text); }
.menu-link span { display: block; }
.menu-rows li { flex-wrap: wrap; }
.menu-main { flex: 1 1 180px; display: flex; flex-direction: column; min-width: 0; }
.menu-rows li.off .menu-main b { color: var(--muted); }
.menu-cat.off { opacity: .7; }
.menu-add { margin-top: 10px; }
.menu-add summary { cursor: pointer; color: var(--accent-dark); font-weight: 600; padding: 8px 0; }
.menu-add form { margin-top: 8px; }
.menu-add .inline-form { display: flex; gap: 8px; margin-bottom: 8px; }
.menu-add .inline-form input { flex: 1; }

.menu-picker { margin: 0 0 14px; }
.mp-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.mp-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 4px;
           -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.mp-tabs::-webkit-scrollbar { display: none; }
.mp-tab { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
          background: var(--card); color: var(--text); font: inherit; cursor: pointer; }
.mp-tab.on { background: var(--text); border-color: var(--text); color: #fff; font-weight: 600; }
.mp-cat { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.mp-item { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
           min-height: 56px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-md);
           background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer;
           touch-action: manipulation; }
.mp-item small { color: var(--muted); font-size: var(--fs-xs); }
.mp-item.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.mp-item.on small { color: #fff; opacity: .9; }
.mp-picked-list { list-style: none; padding: 0; margin: 10px 0 0; }
.mp-picked-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.mp-picked-list li:first-child { border-top: 0; }
.mp-name { flex: 1; min-width: 0; }
.mp-qty { display: inline-flex; align-items: center; gap: 4px; }
.mp-qty b { min-width: 1.4em; text-align: center; }
.mp-qty .btn.icon, .mp-x { padding: 4px 10px; min-width: 36px; min-height: 36px; }
.mp-price { white-space: nowrap; font-weight: 600; }
.mp-x { color: var(--muted); }
.mp-sum { margin: 8px 0 0; }
.mp-sum .btn { margin-left: 6px; }
@media (max-width: 420px) {
  .mp-cat { grid-template-columns: 1fr 1fr; }
}
/* ---------- 고객 관리 (방문 요약 · 다시 오실 때 · 생일 · 예약 안내 · 중요 메모) ---------- */
.caution-box { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); border-radius: var(--r-md);
  padding: 10px 14px; margin: 8px 0; white-space: pre-wrap; font-weight: 600; }
.caution-text { color: var(--warn) !important; font-weight: 600; }
.alert-memo-field textarea { border-color: var(--warn-line); background: var(--warn-bg); }
.ev .ev-caution { font-size: var(--fs-xs); font-weight: 700; color: var(--warn); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.short .ev-caution { display: none; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 8px 0 10px; }
.stat-grid div { background: var(--bg); border-radius: var(--r-md); padding: 8px 10px; min-width: 0; }
.stat-grid dt { font-size: var(--fs-xs); color: var(--muted); }
.stat-grid dd { margin: 0; font-variant-numeric: tabular-nums; word-break: keep-all; }
.stat-grid dd small { display: block; color: var(--muted); font-size: var(--fs-xs); }
@media (max-width: 520px) { .stat-grid { grid-template-columns: 1fr 1fr; } }
.next-visit { margin: 6px 0 0; }
.next-visit.late { color: var(--danger); }
.list .visit-line { grid-column: 1 / -1; color: var(--muted); font-size: var(--fs-sm); }
.sort-row { display: flex; justify-content: flex-end; margin: 0 0 8px; }
.sort-row label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--muted); }
.sort-row select { width: auto; margin: 0; }
.revisit-chip { background: var(--accent-soft); color: var(--accent-dark); }
.bday-chip { background: var(--accent-soft); color: var(--accent-dark); }
.remind-time { font-variant-numeric: tabular-nums; color: var(--accent-dark); }
.sms-preview { white-space: pre-wrap; word-break: break-word; font: inherit; font-size: var(--fs-sm); background: var(--bg);
  border-radius: var(--r-md); padding: 8px 12px; margin: 4px 0; }
/* ---------- 예약판 끌어서 옮기기 · 반복 예약 ---------- */
.ev.movable { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; cursor: grab; }
.ev .ev-grip { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; cursor: ns-resize;
  touch-action: none; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 2px; }
  /* 잡는 곳은 10px 그대로, 보이는 막대는 맨 아래 끝에 (글자 위에 줄처럼 겹치지 않게) */
.ev .ev-grip::after { content: ""; width: 22px; height: 3px; border-radius: 2px; background: var(--c); opacity: .35; }
.ev.movable:hover .ev-grip::after { opacity: .8; }
.ev.dragging { z-index: 6; cursor: grabbing; opacity: .92; box-shadow: 0 8px 20px rgba(0,0,0,.22);
  outline: 2px solid var(--c); transform: scale(1.02); transition: transform .1s; }
.ev.dragging::before { content: attr(data-tip); position: absolute; right: 4px; top: 3px; z-index: 1;
  background: var(--text); color: #fff; font-size: var(--fs-xs); font-weight: 700; padding: 1px 6px; border-radius: 999px;
  white-space: nowrap; }
.board.is-dragging .slot:hover { background: transparent; }
.board.is-dragging .ev:not(.dragging) { pointer-events: none; }
@media (hover: none) {
  .ev .ev-grip { height: 14px; }
  .ev .ev-grip::after { opacity: .6; width: 26px; }
}
@media (hover: hover) and (pointer: fine) { .touch-only { display: none; } }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 30;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px);
  background: var(--text); color: #fff; padding: 10px 14px; border-radius: var(--r-md);
  box-shadow: 0 6px 18px rgba(0,0,0,.25); font-size: var(--fs-sm); }
.toast[hidden] { display: none; }
.toast.error { background: var(--danger); }
.toast .toast-undo { background: transparent; border: 1px solid rgba(255,255,255,.6); color: #fff;
  border-radius: var(--r-sm); padding: 6px 12px; font-weight: 700; cursor: pointer; flex: none; }

.repeat-box, .scope-box { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; margin: 0 0 14px; }
.repeat-box legend, .scope-box legend { font-weight: 600; padding: 0 4px; }
.repeat-end { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: 8px; }
.repeat-end .check { display: flex; align-items: center; gap: 6px; margin: 0; }
.repeat-end input.num { width: 70px; }
.repeat-end input[type=date] { width: auto; }
.repeat-end p { flex-basis: 100%; margin: 2px 0 0; }
.series-box summary { cursor: pointer; font-weight: 600; }
.series-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; }
.series-list li { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.series-list li.st-canceled a { text-decoration: line-through; color: var(--muted); }
.scope-inline { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 8px 0; }
.scope-inline .check { margin: 0; }
.ev.dragging .ev-time { visibility: hidden; }
/* ---------- 폰에서 앱처럼 쓰기 (아래 메뉴 · 손가락 크기 · 글자 크기) ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: rgba(43, 99, 217, .10); }
.me-btn { display: none; }
.tabbar { display: none; }
.grid2 > *, .grid3 > *, .pick-grid > * { min-width: 0; }
input[type=date], input[type=time], input[type=month] { min-width: 0; min-height: 48px; }
input.money::placeholder { font-size: var(--fs-md); font-weight: 400; }
.rows .amt { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; flex: none; }
.offline-card { text-align: center; margin-top: 24px; }
.offline-card h1 { margin-bottom: 8px; }
.install-steps { margin: 8px 0 4px; padding-left: 22px; line-height: 1.7; }
.install-steps b { white-space: nowrap; }
.ios-share { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; }
.install-card details { border-top: 1px solid var(--line); }
.install-card details:first-of-type { border-top: 0; }
.install-card summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.install-ok { background: var(--ok-bg); color: var(--ok); border-radius: var(--r-md); padding: 10px 14px; margin: 8px 0; }

@media (max-width: 720px) {
  /* 위: 가게 이름 + 내 정보 / 아래: 메뉴 탭 (엄지로 누르기 쉬운 곳) */
  .topbar { gap: 8px; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); }
  .topbar nav { display: none; }
  .brand { flex: 1; min-width: 0; font-size: var(--fs-md); }
  .brand .who { font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; }
  .me-btn { display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
    border-radius: var(--r-md); background: var(--fill); color: var(--text); text-decoration: none; font-size: var(--fs-sm); font-weight: 600; }
  .me-btn .ic { width: 20px; height: 20px; }
  .me-btn.on { background: var(--accent-soft); color: var(--accent-dark); }

  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
    padding: 4px max(4px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(4px, env(safe-area-inset-left));
    }
  .tabbar a { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; min-height: 56px; color: var(--muted); text-decoration: none; font-size: var(--fs-xs); font-weight: 600; border-radius: var(--r-md); }
  .tabbar a .ic { width: 24px; height: 24px; }
  .tabbar a.on { color: var(--accent); }
  .tabbar a.on .ic { stroke-width: 2.3; }
  .tabbar a:active { background: var(--bg); }
  body.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  body:has(.fab) .wrap { padding-bottom: 84px; }   /* + 예약 / + 매출 버튼이 마지막 줄을 가리지 않게 */
  .fab { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .board-scroll { max-height: calc(100vh - 300px - env(safe-area-inset-bottom)); max-height: calc(100dvh - 300px - env(safe-area-inset-bottom)); }

  /* 손가락으로 누르기 쉬운 크기 (44px 이상) */
  .btn { min-height: 44px; }
  .btn.small-btn { min-height: 40px; padding: 8px 12px; }
  .back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 0; padding-right: 12px; }
  .tabs a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 6px; }
  summary { padding-top: 10px; padding-bottom: 10px; }
  .att-days summary { padding: 10px 0; }
  .link-btn { padding: 10px 4px; }
  .link-rows li { padding: 0; }
  .link-rows li a { display: block; padding: 12px 0; }
  .week-day h2 a { display: inline-block; padding: 8px 0; }
  .week-day .rows li a { display: block; padding: 4px 0; }
  .pay-name, .att-sum a, .sw-name a { display: inline-block; padding: 8px 0; }
  .sales-rows li a { display: inline-block; padding: 4px 0; }
  .search .btn { min-width: 64px; }

  /* 글자: 너무 작은 글씨 키우기, 큰 숫자는 한 줄에 */
  .small { font-size: var(--fs-sm); }
  .chip { font-size: var(--fs-sm); }
  .total-card .total { font-size: var(--fs-2xl); white-space: nowrap; }
  .total-pair .total { font-size: var(--fs-xl); }
  .pass-balance { font-size: var(--fs-xl); }
  .kpi-v { white-space: nowrap; }
  .day-title { font-size: var(--fs-lg); white-space: nowrap; }
  .head-row { flex-wrap: wrap; }
  .head-row h1 { min-width: 0; }
  .rows li > span:first-child, .rows li > a:first-child { min-width: 0; }
  .tbl, .att-sum { font-size: var(--fs-sm); }
}
/* ---------- 사진 견적 ---------- */
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-width: 160px; }
.seg2 .pill span { padding: 8px 6px; }
.quote-list a { display: flex; align-items: center; gap: 10px; }
.q-thumb { width: 56px; height: 56px; border-radius: var(--r-sm); object-fit: cover; flex: none; background: var(--bg); }
.q-thumb.none { display: flex; align-items: center; justify-content: center; font-size: var(--fs-xl); }
.q-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.q-price { text-align: right; white-space: nowrap; }
.q-draft { background: var(--fill); color: var(--text-2); }
.q-booked { background: var(--accent-soft); color: var(--accent-dark); }
.q-done { background: var(--ok-bg); color: var(--ok); }
.big-strip img { width: 120px; height: 120px; }
.q-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.q-tools label.btn { margin: 0; cursor: pointer; }
.ai-box { background: var(--accent-soft); border-radius: var(--r-md); padding: 10px 14px; margin-top: 6px; }
.ai-box p { margin: 4px 0; }
.ai-facts { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 6px 0; }
.ai-facts li { background: #fff; border-radius: 999px; padding: 2px 10px; font-size: var(--fs-sm); }
.ai-q { margin: 2px 0 6px; padding-left: 18px; }
.q-group { font-size: var(--fs-md); margin: 16px 0 4px; color: var(--muted); }
.q-items { list-style: none; padding: 0; margin: 0; }
.q-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 6px;
  border-top: 1px solid var(--line); border-radius: var(--r-sm); }
.q-item.on { background: var(--accent-soft); }
.q-item.judge.on { background: var(--warn-bg); }
.q-name { display: flex !important; align-items: flex-start; gap: 8px; flex: 1; margin: 0 !important; font-weight: 500 !important; cursor: pointer; }
.q-name input[type=checkbox] { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.stepper { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.stepper input { width: 52px; text-align: center; padding: 6px 2px; }
.stepper .btn { width: 34px; padding: 6px 0; }
.ai-chip { background: var(--accent-soft); color: var(--accent-dark); margin-left: 2px; }
.judge-chip { background: var(--warn-bg); color: var(--warn); margin-left: 2px; }
.ai-reason { color: var(--accent-dark); }
.q-total { position: sticky; bottom: 8px; z-index: 5; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.q-total p { margin: 2px 0; }
.q-total .pass-balance { margin: 0; }
.q-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 10px; }
.q-actions .btn { margin: 0; }
#msg { width: 100%; font: inherit; line-height: 1.5; }
.price-row { border-top: 1px solid var(--line); padding: 10px 0 6px; }
.price-row.off { opacity: .5; }
.price-row.judge { background: var(--warn-bg); }
.price-row label { margin-bottom: 8px !important; }
.sticky-save { position: sticky; bottom: 8px; }
.quote-link { margin: 4px 0 8px; }
@media (max-width: 480px) {
  .q-actions { grid-template-columns: 1fr; }
  .big-strip img { width: 96px; height: 96px; }
}
/* 메뉴가 6개(견적 추가)라 좁은 폰에서 글자가 세로로 쪼개지지 않게 */
@media (max-width: 480px) {
  .topbar { gap: 6px; }
  .topbar nav { gap: 0; flex-wrap: nowrap; overflow-x: auto; }
  .topbar nav a { padding: 6px 7px; font-size: var(--fs-md); }
  .q-total { padding: 8px 12px; }
  .q-total .muted.small:first-child { display: none; }
  .q-total .pass-balance { font-size: var(--fs-xl); }
  .q-total #t-judge { font-size: var(--fs-xs); }
  .q-actions { grid-template-columns: 1fr 1.6fr; gap: 6px; margin-top: 6px; }
  .q-actions .btn.big { padding: 10px 6px; font-size: var(--fs-md); }
}
.q-head { flex-wrap: wrap; }
.q-head h1 { white-space: nowrap; margin: 0; }
@media (max-width: 480px) { .stepper .btn { width: 30px; } .stepper input { width: 44px; } }
.price-row .grid3 { grid-template-columns: 1fr 1fr 1fr; gap: 0 6px; }
.price-row label { font-size: var(--fs-sm); }
.price-row input, .price-row select { padding: 8px; }
/* 데이터 가져오기 (importer.py) */
.imp-steps { padding-left: 20px; margin: 4px 0 8px; }
.imp-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.imp-col { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px; min-width: 0; }
.imp-h { font-weight: 600; overflow-wrap: anywhere; }
.imp-sample { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-kpis { margin-bottom: 10px; }
.imp-table { overflow-x: auto; margin-bottom: 12px; }
.imp-table .tbl td, .imp-table .tbl th { padding-right: 8px; vertical-align: top; }
.imp-table tr.imp-error td { background: var(--danger-bg); }
.imp-table tr.imp-skip td { opacity: .6; }
.imp-kpis .kpi { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: var(--r-md); }
.imp-table .tbl { min-width: 560px; }
.imp-table .tbl td:nth-child(-n+4) { white-space: nowrap; }

/* ---------- 합친 뒤: 폰 아래 탭바(64px) 위로 사진 견적의 붙어 있는 합계·저장 버튼을 올림 ---------- */
@media (max-width: 720px) {
  body.has-tabbar .q-total, body.has-tabbar .sticky-save { bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* =====================================================================
   여러 기기 크기 정리 (2026-11-05)
   폴드 접힘 280px ~ 넓은 모니터 2560px, 폰 가로 화면까지.
   크기 기준: ≤359 아주 좁은 폰(폴드 접힘·작은 폰) / ≤720 폰(아래 메뉴) / 721~1180 폴드 펼침·태블릿 /
             ≥1200 넓은 화면 / 높이 ≤520 가로로 눕힌 폰.  기록: docs/responsive-check.md
   ===================================================================== */

/* ---------- 공통: 글자 줄바꿈 ---------- */
/* 한국어 낱말이 중간에서 한 글자씩 쪼개지지 않게(keep-all), 칸보다 긴 영문·숫자만 칸 안에서 접기 */
body { word-break: keep-all; overflow-wrap: break-word; }
img, video { max-width: 100%; }
.mono, .reset-link { word-break: break-all; }

/* ---------- 공통: 노치·홈바(안전 영역) ---------- */
.wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
/* 입력칸·책갈피로 이동할 때 위 메뉴·아래 메뉴에 가리지 않게 */
html { scroll-padding-top: 72px; scroll-padding-bottom: 96px; }

/* ---------- 공통: 위 메뉴 ---------- */
.topbar { gap: 12px; }
.brand { flex: 0 1 auto; }
.topbar nav { flex: none; }

/* ---------- 공통: 탭 (글자가 세로로 쪼개지지 않고, 자리가 모자라면 다음 줄로) ---------- */
.tabs { flex-wrap: wrap; }
.tabs a { min-width: max-content; white-space: nowrap; }

/* ---------- 공통: 표 → 좁으면 표만 옆으로 밀기 (첫 칸은 고정) ---------- */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.tscroll > table { min-width: 100%; }
.tscroll th, .tscroll td { white-space: nowrap; }
.tscroll th:first-child, .tscroll td:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); padding-right: 10px; }
.tscroll tr.on td:first-child { background: var(--accent-soft); }

/* ---------- 공통: 이름 · 값 줄 (.rows) — 값이 길면 다음 줄 오른쪽으로 ---------- */
.rows li { flex-wrap: wrap; }
.rows li > span:first-child { min-width: 0; }
.rows li > b { white-space: normal; margin-left: auto; text-align: right; }
.acct-btns { flex-wrap: wrap; justify-content: flex-end; }
.al-main { flex-wrap: wrap; }
.al-name { min-width: 0; }
.op-bar a { display: inline-flex; align-items: center; min-height: 40px; }

/* 입력칸 + 버튼 한 줄 (검색·직원 추가·승인/거절): 버튼 글자는 쪼개지 않고 입력칸이 줄어듦 */
.search > input, .search > select { flex: 1 1 auto; min-width: 0; }
.search > .btn { flex: none; white-space: nowrap; }
/* ---------- 공통: 숫자 카드 (좁으면 한 줄에 하나) ---------- */
.kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
.op-kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); }

/* ---------- 손가락으로 쓰는 기기(폰·태블릿): 누르기 쉬운 크기 · 확대 안 되는 글자 ---------- */
@media (pointer: coarse) {
  /* 아이폰은 16px 보다 작은 입력칸을 누르면 화면을 확대해 버림 */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not(.money), select, textarea { font-size: 16px; }
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select { min-height: 44px; }
  .btn, .btn.small-btn, .tabs a, .link-btn, .mp-tab { min-height: 44px; }
  .btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; }
  .btn.big { display: flex; }
  .btn.icon { min-width: 44px; }
  .topbar nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .btn.small-btn { padding: 8px 12px; }
  summary { padding-top: 10px !important; padding-bottom: 10px !important; }
  body .help-fab { width: 44px; height: 44px; }
  .back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 0; padding-right: 12px; }
  .brand { min-height: 44px; }
  .op-bar a, .op-bar .link-btn { min-height: 44px; padding: 0 4px; }
  /* 따로 떨어진 글자 링크: 위아래로 누를 자리 넓히기 */
  .big-phone a, .al-name, .pay-name, .mp-head a, .week-day h2 a, .sw-name a, .att-sum a, .tbl a, .q-group a,
  .auth-box p.center > a, .agree-box a, p > a:only-child, .rows li > a:first-child, .week-day .rows li a, .sales-rows li a, .help-toc a {
    display: inline-block; padding-top: 10px; padding-bottom: 10px; }
  .help-toc a { padding-left: 12px; padding-right: 12px; }
  .stepper .btn { width: 40px; min-height: 44px; }
  .stepper input { min-height: 44px; }
  .tier-row input { min-height: 44px; }
}

/* ---------- 폰 (≤720px) ---------- */
@media (max-width: 720px) {
  .topbar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .day-title { white-space: normal; min-width: 0; }
  .day-nav .date-pick { min-width: 0; }
  .total-pair { grid-template-columns: 1fr; }
  /* 처음 설정 안내는 짧게 (남은 항목 목록은 '이어서 하기' 안에서) */
  .setup-hint p { display: none; }
  /* 키보드가 올라오면 아래 메뉴·떠 있는 버튼을 숨겨 저장 버튼·입력칸이 가려지지 않게 */
  body.has-tabbar:has(:is(input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea, select):focus) :is(.tabbar, .fab, .help-fab) { display: none; }
  body.has-tabbar:has(:is(input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea):focus) :is(.q-total, .sticky-save) { bottom: 8px; }
}

/* ---------- 아주 좁은 폰 (≤359px: 갤럭시 폴드 접힘 280px · 320px) ---------- */
@media (max-width: 359px) {
  .day-title { font-size: var(--fs-md); }
  .wrap { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .card { padding: 12px; }
  h1 { font-size: var(--fs-xl); }
  .btn { white-space: normal; max-width: 100%; }
  .tabs { gap: 4px; }
  .tabs a { padding: 8px 6px; font-size: var(--fs-sm); }
  .pick-grid { grid-template-columns: 1fr 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .tabbar a { font-size: var(--fs-xs); }
  .tabbar a .ic { width: 22px; height: 22px; }
  .me-btn { padding: 0 10px; }
  .total-card .total { font-size: var(--fs-xl); }
  .q-actions { grid-template-columns: 1fr; }
  .staff-acct { margin-left: 0; }
  .tier-row { grid-template-columns: 1fr auto 60px auto; gap: 4px; }
}
@media (max-width: 420px) { .btn { white-space: normal; } }

/* ---------- 예약판 ---------- */
.times .t { white-space: nowrap; overflow-wrap: normal; }
/* 긴 직원 이름은 칸 머리에서 두 줄까지 */
.col-head { overflow: hidden; padding: 0 4px; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
.board-scroll { overscroll-behavior: contain; max-height: max(360px, calc(100vh - 210px)); max-height: max(360px, calc(100dvh - 210px)); }
@media (max-width: 720px) {
  .board-scroll { max-height: max(340px, calc(100dvh - 240px - env(safe-area-inset-bottom))); }
}
/* 폰: 직원 칸이 한 화면에 3칸쯤 보이게(아주 좁으면 2칸), 나머지는 옆으로 밀기. 시간 열은 왼쪽에 고정. */
@media (max-width: 560px) {
  .board { --timew: 44px; --colmin: max(100px, calc((100vw - 80px) / 3)); }
}
/* 폴드 펼침·태블릿: 칸을 조금 좁혀 한 화면에 더 많이 */
@media (min-width: 561px) and (max-width: 1180px) {
  .board { --timew: 52px; --colmin: 112px; }
}
/* 넓은 모니터: 예약판은 더 넓게 */
@media (min-width: 1600px) { .wrap.wide { max-width: 1600px; } }

/* ---------- 가로로 눕힌 폰 (높이가 낮은 화면) ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .topbar { position: static; }                 /* 위 메뉴가 화면을 덮지 않게 */
  .board-scroll { max-height: calc(100dvh - 16px); }  /* 내려서 예약판만 화면 가득 */
  .setup-hint p { display: none; }
  .tabbar a { min-height: 44px; flex-direction: row; gap: 4px; }
  .tabbar a .ic { width: 22px; height: 22px; }
  body.has-tabbar { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
  .fab { bottom: calc(60px + env(safe-area-inset-bottom)); }
  .q-total, .sticky-save { position: static; }  /* 붙어 있는 합계 칸이 화면 절반을 가리지 않게 */
  html body .help-fab { bottom: calc(60px + env(safe-area-inset-bottom)); }
  html body:has(.fab) .help-fab { right: 136px; }   /* + 예약 버튼 왼쪽 옆으로 */
}
@media (max-height: 520px) and (orientation: landscape) and (min-width: 721px) {
  .fab { bottom: calc(16px + env(safe-area-inset-bottom)); }
  html body .help-fab { bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* ---------- 넓은 화면: 목록·보고서 화면은 조금 더 넓게 (.wrap.roomy) ---------- */
@media (min-width: 1200px) {
  .wrap.roomy { max-width: 1080px; }
  .week-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  .week-grid > .card { margin: 0; }
}
@media (min-width: 1700px) {
  .wrap.roomy { max-width: 1280px; }
  .week-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- 예약판 위쪽을 좁은 폰(갤럭시 폴드 접힘 등)에서 줄이기 (2026-11-10) ----------
   위 버튼 줄이 두세 줄로 꺾여 예약판이 화면 아래로 밀리던 것 → 한 줄로, 넘치면 옆으로 밀기 */
@media (max-width: 720px) {
  .day-tools { gap: 6px; margin-bottom: var(--sp-2); }
  .day-tools .tool-links { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; gap: 6px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .day-tools .tool-links::-webkit-scrollbar { display: none; }
  .day-tools .tool-links .btn { flex: 0 0 auto; white-space: nowrap; padding-left: 12px; padding-right: 12px; }
  .day-nav { margin-bottom: var(--sp-2); }
  .setup-hint { padding: 10px 12px; margin-bottom: var(--sp-2); }
}
@media (max-width: 359px) {
  .day-tools .summary { font-size: var(--fs-xs); }
  .day-nav .btn.icon { width: 40px; min-width: 40px; }
}
