/* 플렉스노트 공통 컴포넌트 — 버튼 다섯 종류와 세그먼트 하나 (2026-10-13).
   모양(높이·모서리·면·글자)은 여기서만 정한다. 폭·여백·순서 같은 배치는 각 화면 CSS가 정한다.
   다른 CSS는 모두 @layer legacy 안에 있어서, 이 파일이 선택자 우선순위와 상관없이 이긴다.
   새 버튼은 아래 목록 중 하나에 넣는다. 화면 CSS에서 버튼 모양을 다시 정하지 않는다. */

:root {
  --btn-h: 44px;
  --btn-sm-h: 34px;
  --btn-icon: 36px;
  --btn-fs: var(--fs-body-l);
  --btn-sm-fs: var(--fs-label);
  /* 회색 면: 흰 카드와 회색 바탕 어디에 놓여도 보이는 반투명 채움 */
  --btn-fill: color-mix(in srgb, var(--text) 7%, transparent);
  --btn-fill-pressed: color-mix(in srgb, var(--text) 12%, transparent);
  /* 세그먼트의 고른 칸 = 하단 메뉴의 렌즈와 같은 유리(라이트 흰 유리, 다크 금색 유리). 앱 전체가 한 가지 '고름' 표시를 쓴다. */
  --seg-thumb: var(--nav-lens);
  --seg-thumb-shadow: var(--nav-lens-rim);
}
html[data-theme="dark"], body[data-theme="dark"] {
  --btn-fill: color-mix(in srgb, var(--text) 10%, transparent);
  --btn-fill-pressed: color-mix(in srgb, var(--text) 16%, transparent);
}

/* ── 1. 주 버튼: 화면에서 하나. 저장·기록하기·구역 만들기 ───────────── */
:is(.full-btn, .primary-pill, .route-notes-button.primary:not(.route-notes-fab), .route-note-zone-button.primary,
    .jobs-button.jobs-primary:not(.jobs-fab), .exports-download) {
  min-height: var(--btn-h);
  padding: 0 20px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--gold);
  color: var(--gold-ink);
  box-shadow: none;
  font-size: var(--btn-fs);
  font-weight: 700;
  letter-spacing: 0;
}

/* ── 2. 보조 버튼: 주 버튼의 짝, 독립된 부 행동. 임시 저장·취소·휴무 ──── */
:is(.secondary-btn, .ghost-pill, .route-notes-button.secondary, .route-note-zone-button.secondary,
    .route-note-zone-cut-card .route-note-zone-button.chip, .measurement-guide-trigger, .exports-preview-button) {
  min-height: var(--btn-h);
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--btn-fill);
  color: var(--text);
  box-shadow: none;
  font-size: var(--btn-fs);
  font-weight: 600;
  letter-spacing: 0;
}
.route-note-zone-cut-card .route-note-zone-button.chip { font-family: var(--font-code); font-weight: 700; }
:is(.ghost-pill, .draft-off-btn):is(.active, [aria-checked="true"], [aria-pressed="true"]) {
  background: var(--red-bg);
  color: var(--red);
}

/* ── 3. 작은 버튼: 화면 머리·툴바의 부 행동. 일상점검·내보내기·오늘 ──── */
:is(.inspection-entry-button, .tab-action, .today-btn, .draft-add-btn, .draft-off-btn, .stats-peers-leave,
    .route-note-zone-cut-tools .route-note-zone-button.pill) {
  height: var(--btn-sm-h);
  min-height: var(--btn-sm-h);
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--btn-fill);
  color: var(--text);
  box-shadow: none;
  font-size: var(--btn-sm-fs);
  font-weight: 600;
  letter-spacing: 0;
}
/* 오늘은 보조 동작: 강조색은 달력의 오늘 날짜 동그라미에만 둔다. */
.today-btn { color: var(--text); font-weight: 600; }
.inspection-entry-button { gap: 6px; }
:is(.inspection-entry-card.complete .inspection-entry-button, .inspection-entry-button.complete) { color: var(--muted); }

/* ── 4. 글자 버튼: 면 없이 강조색 글자. 링크 같은 행동 ─────────────── */
:is(.route-notes-button.primary-text, .route-notes-button.route-notes-empty-ghost, .route-note-zone-button.link, .route-note-zone-button.link-row, .link-btn) {
  min-height: var(--btn-h);
  padding: 0 8px;
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--gold);
  box-shadow: none;
  font-size: var(--btn-fs);
  font-weight: 600;
}

/* ── 5. 아이콘 버튼: 원 하나. 달 이동·닫기·삭제 ───────────────────── */
:is(.round-btn, .del-btn, .icon-btn) {
  width: var(--btn-icon);
  height: var(--btn-icon);
  min-height: var(--btn-icon);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--btn-fill);
  color: var(--text);
  box-shadow: none;
}

/* 위험한 행동: 보조 버튼 모양에 빨간 글자, 한 번 더 누를 준비가 되면 빨간 면 */
.route-note-zone-button.danger {
  min-height: var(--btn-h);
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--btn-fill);
  color: var(--red);
  box-shadow: none;
  font-size: var(--btn-fs);
  font-weight: 600;
}
.route-note-zone-button.danger.armed { background: var(--red); color: var(--on-color); }

/* 구역 편집 시안: 코드 칩과 아이콘·이름을 함께 보여 주는 네 도구. */
.route-note-zone-button.route-note-workspace-tool {
  border:0;
  border-radius:var(--r-md);
  background:transparent;
  color:var(--muted);
  font-size:var(--fs-label);
  font-weight:600;
}
.route-note-zone-button.route-note-workspace-tool[aria-pressed="true"] {
  background:var(--seg-thumb);
  box-shadow:var(--seg-thumb-shadow);
  color:var(--gold);
  font-weight:700;
}
.route-note-workspace-body .route-note-zone-button.chip {
  min-height:var(--btn-sm-h);
  padding:0 12px;
  font-family:var(--font-code);
  font-weight:700;
}
/* 코드가 아닌 칩(직접 입력·입력 닫기)은 본문 글꼴 */
.route-note-workspace-body .route-note-zone-button.chip[aria-expanded] { font-family:var(--font-ui); font-weight:600; }
/* 영역에 하는 일(나누기·빼기·경계 고치기)은 같은 보조 버튼 한 줄 */
.route-note-workspace-context-actions > .route-note-zone-button.secondary { padding:0 8px; }
/* 선택 줄: 코드 전체 선택은 작은 버튼, 선택 해제는 닫기 성격이라 흐린 글자 */
.route-note-workspace-selection-footer > .route-note-zone-button.secondary {
  height:var(--btn-sm-h);
  min-height:var(--btn-sm-h);
  padding:0 14px;
  font-size:var(--btn-sm-fs);
}
.route-note-workspace-selection-footer > .route-note-zone-button.link { min-height:var(--btn-sm-h); padding:0; color:var(--muted); }
/* 더보기는 아이콘 버튼 */
.route-note-zone-button.link.route-note-workspace-more-toggle {
  display:grid;
  place-items:center;
  width:var(--btn-icon);
  height:var(--btn-icon);
  min-height:var(--btn-icon);
  padding:0;
  border-radius:50%;
  background:var(--btn-fill);
  color:var(--text);
}
/* 구역 편집의 방법 고르기(추가 방법·나누는 방법)도 앱 세그먼트 하나: 회색 트랙 + 올라온 칸 */
.route-note-zone-bar-seg {
  height:var(--btn-sm-h);
  padding:2px;
  gap:2px;
  border:0;
  border-radius:var(--r-full);
  background:var(--btn-fill);
  box-shadow:none;
}
.route-note-zone-bar-seg > .route-note-zone-button.seg {
  height:auto;
  min-height:0;
  border:0;
  border-radius:var(--r-full);
  background:transparent;
  color:var(--muted);
  box-shadow:none;
  font-size:var(--btn-sm-fs);
  font-weight:600;
}
.route-note-zone-bar-seg > .route-note-zone-button.seg[aria-pressed="true"] {
  background:var(--seg-thumb);
  box-shadow:var(--seg-thumb-shadow);
  color:var(--gold);
  font-weight:700;
}
.route-note-workspace-body .route-note-zone-button.chip[aria-pressed="true"] {
  background:var(--gold);
  color:var(--gold-ink);
}
.route-note-zone-map-tools .route-note-zone-button.route-note-workspace-clear { background:var(--panel); color:var(--text); }

/* 상태 */
:is(.full-btn, .primary-pill, .secondary-btn, .ghost-pill, .route-notes-button, .route-note-zone-button,
    .inspection-entry-button, .tab-action, .today-btn, .round-btn, .del-btn, .icon-btn, .exports-download,
    .exports-preview-button, .measurement-guide-trigger, .draft-add-btn, .draft-off-btn):disabled {
  opacity: .45;
  cursor: default;
}

/* ── 세그먼트: 같은 데이터를 다른 보기로. 트랙 위로 올라온 표시 하나 ── */
:is(.mode-toggle, .ledger-switch, .stats-range-tabs, .theme-toggle, .stats-chart-toggle, .stats-tabs) {
  height: var(--btn-sm-h);
  padding: 2px;
  gap: 2px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--btn-fill);
  box-sizing: border-box;
  align-items: stretch;
}
:is(.mode-toggle > .mode-btn, .ledger-switch > button, .stats-range-tabs > button, .theme-toggle > button,
    .stats-chart-toggle > button, .stats-tabs > .stats-tab) {
  height: auto;
  min-height: 0;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: var(--btn-sm-fs);
  font-weight: 600;
}
:is(.mode-toggle > .mode-btn, .ledger-switch > button, .stats-range-tabs > button, .theme-toggle > button,
    .stats-chart-toggle > button, .stats-tabs > .stats-tab):is(.active, .is-on) {
  background: var(--seg-thumb);
  box-shadow: var(--seg-thumb-shadow);
  color: var(--gold);
  font-weight: 700;
}
/* 미끄러지는 표시가 있으면 표시 하나만 보인다 */
:is(.mode-toggle, .ledger-switch, .stats-range-tabs):has(> .tab-indicator) > :is(button, .mode-btn):is(.active, .is-on) {
  background: transparent;
  box-shadow: none;
}
.tab-indicator { background: var(--seg-thumb); box-shadow: var(--seg-thumb-shadow); }

/* 달력의 ‹ 10월 ›: 바탕 없는 회색 화살표. 달 이름이 주인공이다. */
:is(.calendar-month-control, .delivery-date-month) .round-btn {
  position: relative;
  width: 30px;
  height: 34px;
  min-height: 34px;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--muted);
}

/* The 30×34 arrow keeps a 44×44 touch area, the same as the 배송노트 date sheet's arrows. */
.calendar-month-control .round-btn::after { content: ""; position: absolute; inset: -5px -7px; }

/* 기간(‹ 9/26 - 10/25 ›)의 화살표: 면 없이 기간 글자와 같은 색. 누르는 영역은 32px */
.expense-month-control .round-btn {
  position: relative;
  font-weight: 500;
  width: 32px;
  height: 32px;
  min-height: 32px;
  background: transparent;
  color: var(--muted);
}
/* 32px arrow, 44px touch, like the calendar arrows (2026-10-22). */
.expense-month-control .round-btn::after { content: ""; position: absolute; inset: -6px; }

/* 기록 화면 머리의 휴무 토글: 체크박스 라벨 안의 span이 작은 버튼. 켜지면 빨강 */
.off-toggle span {
  display: inline-flex;
  align-items: center;
  height: var(--btn-sm-h);
  min-height: var(--btn-sm-h);
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--btn-fill);
  color: var(--text);
  font-size: var(--btn-sm-fs);
  font-weight: 600;
}
.off-toggle input:checked + span { background: var(--red-bg); color: var(--red); }

/* ── 입력칸: 한 가지 모양. 회색 채움, 테두리 없음, 입력 중이면 강조색 테두리 ──
   구역노트(지도 위 유리 화면)는 자기 입력 모양을 쓴다. */
:root { --field-h: 44px; --field-fill: color-mix(in srgb, var(--text) 6%, transparent); }
html[data-theme="dark"], body[data-theme="dark"] { --field-fill: color-mix(in srgb, var(--text) 9%, transparent); }
:is(input:where(:not([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="color"], [type="hidden"], .switch)), select, textarea):not(.view-routes *, .route-note-zone-editor *, .substitute *) {
  box-sizing: border-box;
  height: var(--field-h);
  min-height: var(--field-h);
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: var(--field-fill);
  color: var(--text);
  box-shadow: none;
  font-size: var(--fs-body-l);
  font-weight: 500;
  line-height: 20px;
}
textarea:not(.view-routes *, .route-note-zone-editor *, .substitute *) {
  height: auto;
  min-height: 88px;
  padding: 10px 12px;
}
/* A plain select draws the same quiet chevron as the rest of the app, pointing down, never the browser arrow.
   Row selects (expense fields, settings rows) keep their right-pointing row chevron below. */
select:not(.view-routes *, .route-note-zone-editor *, .substitute *) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 7px;
}
:is(input, select, textarea):not(.view-routes *, .route-note-zone-editor *, .substitute *):focus {
  border-color: var(--gold);
  outline: none;
}
:is(input, textarea):not(.view-routes *, .route-note-zone-editor *, .substitute *)::placeholder {
  color: var(--muted);
  opacity: 1;
  font-weight: 500;
}
/* 큰 금액 한 칸(지출 총 금액): 52px, 20px 숫자 */
.expense-dialog .expense-amount-field input {
  height: 52px;
  min-height: 52px;
  padding-right: 36px;
  font-size: var(--fs-display-s);
  font-weight: 600;
}
.expense-dialog .expense-amount-field input::placeholder { font-size: var(--fs-body-l); }

/* 숫자칸의 위아래 화살표는 숨긴다(키패드로 입력) */
input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* 기록 화면 구역 줄은 칸이 좁아 안쪽 여백을 줄인다 */
.entry-row :is(input, output) { padding-inline: 8px; }

/* ── 묶은 목록 폼 (애플 설정식, 2026-10-13) ───────────────────────────
   항목이 여러 개인 폼은 칸마다 상자를 두지 않는다. 한 카드 안에 줄로 묶고
   줄 왼쪽에 이름, 오른쪽에 값. 가장 중요한 값(지출 총 금액)만 크게 위에 둔다.
   좁은 칸이 나란한 표(기록 화면 구역·건수·단가)는 입력칸 모양 그대로다. */
:root { --row-h: 50px; --row-fs: var(--fs-title); --row-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='14' viewBox='0 0 8 14'%3E%3Cpath d='M1 1l6 6-6 6' fill='none' stroke='%23A6A9B0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23A6A9B0' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

/* 줄 안의 값 칸: 면·테두리 없이 오른쪽 정렬 */
:is(.expense-dialog .expense-fields > label:not(.expense-amount-field), .settings-field.is-row) :is(input, select) {
  flex: 1 1 auto;
  min-width: 0;
  height: var(--row-h);
  min-height: var(--row-h);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: var(--row-fs);
  font-weight: 500;
  text-align: right;
  text-align-last: right;
}
:is(.expense-dialog .expense-fields > label:not(.expense-amount-field), .settings-field.is-row) :is(input, select):focus { border: 0; }
:is(.expense-dialog .expense-fields > label:not(.expense-amount-field), .settings-field.is-row) select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 18px;
  background: var(--row-chevron) no-repeat right center / 7px 12px;
}
:is(.expense-dialog .expense-fields > label:not(.expense-amount-field), .settings-field.is-row) input[type="date"] { font-family: var(--font-ui); }

/* 지출 창: 줄 하나하나가 회색 채움, 처음과 끝만 둥글게 */
.expense-dialog .expense-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.expense-dialog .expense-fields > label:not(.expense-amount-field) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--row-h);
  margin: 0;
  padding: 0 14px;
  background: var(--field-fill);
  color: var(--text);
  font-size: var(--row-fs);
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
}
.expense-dialog .expense-fields > label:not(.expense-amount-field) + label { box-shadow: inset 0 1px 0 var(--line); }

/* 지출 날짜: 값을 누르면 줄 아래로 앱 달력이 펼쳐진다(배송노트 날짜 시트와 같은 달 칸). 펼친 동안 값은 강조색 */
.expense-dialog .expense-date-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; height: var(--row-h); margin: 0 -2px 0 0; padding: 0 2px;
  border: 0; background: transparent; color: var(--text); font: 500 var(--row-fs) var(--font-ui); font-variant-numeric: tabular-nums; cursor: pointer;
}
.expense-dialog .expense-date-toggle::after { content: ""; width: 7px; height: 12px; background: var(--row-chevron) no-repeat center / contain; transform: rotate(90deg); transition: transform var(--spring-quick-ms) var(--spring-quick); }
.expense-dialog .expense-date-toggle.is-empty { color: var(--muted); }
.expense-dialog .expense-date-row.is-open .expense-date-toggle { color: var(--gold); }
.expense-dialog .expense-date-row.is-open .expense-date-toggle::after { transform: rotate(-90deg); }
.expense-dialog .expense-date-toggle:disabled { cursor: default; opacity: .6; }
.expense-dialog .expense-date-panel { padding: 0 10px 10px; background: var(--field-fill); box-shadow: inset 0 1px 0 var(--line); }
.expense-dialog .expense-date-panel[hidden] { display: none; }
.expense-dialog .expense-date-panel + label { box-shadow: inset 0 1px 0 var(--line); }
.expense-dialog .expense-date-panel .delivery-date-day { height: 44px; padding: 6px 0 0; }
@media (prefers-reduced-motion: reduce) { .expense-dialog .expense-date-toggle::after { transition: none; } }
.expense-dialog .expense-fields > :is(.expense-amount-field + label, label:first-child:not(.expense-amount-field)) { border-radius: var(--r-md) var(--r-md) 0 0; }
.expense-dialog .expense-fields > label:not(.expense-amount-field):last-of-type { border-radius: 0 0 var(--r-md) var(--r-md); }
.expense-dialog .expense-fields > label:only-of-type:not(.expense-amount-field) { border-radius: var(--r-md); }

/* 지출 총 금액: 위에 크게, 칸 없이 */
.expense-dialog .expense-amount-field {
  position: relative;
  display: grid;
  gap: 2px;
  margin: 0 0 16px;
  padding: 0 2px;
  color: var(--muted);
  font-size: var(--fs-label);
  font-weight: 500;
}
.expense-dialog .expense-amount-field input {
  height: 48px;
  min-height: 48px;
  padding: 0 28px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-numeric);
  font-size: var(--fs-hero);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.expense-dialog .expense-amount-field input:focus { border: 0; }
.expense-dialog .expense-amount-field input::placeholder { font-family: var(--font-ui); font-size: var(--fs-display-s); font-weight: 600; color: var(--muted); letter-spacing: 0; }
.expense-dialog .expense-amount-field > span { position: absolute; right: 2px; bottom: 12px; top: auto; color: var(--muted); font-size: var(--fs-title-m); font-weight: 600; }

/* 접힌 묶음(결제·세금 정보): 한 줄처럼 보이는 머리 */
.expense-dialog .expense-more { margin: 12px 0 0; }
.expense-dialog .expense-more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--row-h);
  padding: 0 14px;
  border-radius: var(--r-md);
  background: var(--field-fill);
  color: var(--text);
  font-size: var(--row-fs);
  font-weight: 500;
  list-style: none;
}
.expense-dialog .expense-more > summary::-webkit-details-marker { display: none; }
.expense-dialog .expense-more > summary::after { content: ""; width: 7px; height: 12px; background: var(--row-chevron) no-repeat center / contain; transition: transform .2s; }
.expense-dialog .expense-more[open] > summary::after { transform: rotate(90deg); }
.expense-dialog .expense-more[open] > summary { margin-bottom: 8px; }

/* 메모: 작은 머리말 + 채움 칸 */
.expense-dialog .expense-memo { display: grid; gap: 6px; margin-top: 12px; color: var(--muted); font-size: var(--fs-label); font-weight: 500; }
.expense-dialog .expense-memo textarea { font-size: var(--row-fs); }

/* 마이페이지 글자 입력 줄: 카드 안에서 이름 왼쪽, 값 오른쪽, 줄 사이 선 */
.settings-field.is-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 16px;
  row-gap: 0;
  min-height: var(--row-h);
}
.settings-field.is-row > :is(label, .settings-field-label) { color: var(--text); font-size: var(--row-fs); font-weight: 500; white-space: nowrap; }
.settings-field.is-row > .settings-input-unit { display: flex; align-items: center; gap: 4px; min-width: 0; }
.settings-field.is-row > .settings-input-unit > span { color: var(--muted); font-size: var(--row-fs); font-weight: 500; }
.settings-field.is-row > .hint { grid-column: 1 / -1; margin: -4px 0 12px; }
.settings-card:has(> .settings-field.is-row) { gap: 0; padding-block: 4px; }
/* 줄 카드 안의 고르는 칸(주간·야간처럼 두 버튼, 2026-11-05 점검): 칸 이름이 카드 위 가장자리와 앞 칸 버튼에 붙어 있었다.
   이름 위 16px, 마지막 안내 줄은 위 12·아래 14px. */
.settings-card:has(> .settings-field.is-row) > .settings-field:not(.is-row, .weekly-off-field) { padding-top: 16px; }
.settings-card:has(> .settings-field.is-row) > .hint { margin: 12px 0 14px; }
.settings-card > .settings-field:not(.is-row) + .settings-field.is-row { margin-top: 16px; box-shadow: inset 0 1px 0 var(--line); }
.settings-card > .settings-field.is-row + .settings-field.is-row { box-shadow: inset 0 1px 0 var(--line); }
/* 고정 구역 카드의 휴무 칸: 구역 줄 안내(아래 12) 밑에 구분선, 선 아래 12. 저장 버튼까지 16, 카드 아래 18. */
.settings-card > .weekly-off-field { gap: 8px; padding: 12px 0 16px; box-shadow: inset 0 1px 0 var(--line); }
.settings-card.fixed-only:has(> .weekly-off-field) { padding-bottom: 18px; }
.weekly-off-field > [hidden] { display: none; }
.settings-field.is-row:focus-within > :is(label, .settings-field-label) { color: var(--gold); }

/* 작은 버튼(34px)도 누르는 영역은 44px. 보이는 크기는 그대로 두고 가상 요소로 넓힌다. */
:is(.inspection-entry-button, .tab-action, .today-btn, .draft-add-btn, .draft-off-btn) { position: relative; }
.inspection-entry-button::after,
.tab-action::after,
.today-btn::after,
.draft-add-btn::after,
.draft-off-btn::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  min-width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
}

/* ── 구역노트 (지도 위 유리 화면) ─────────────────────────────────────
   지도 위에 떠 있는 버튼(내 위치·팁 쓰기·전체 지도)과 팁 종류 고르기 타일은 자기 모양을 쓴다.
   나머지는 앱의 다섯 종류를 따른다. */

/* 글자 버튼: 위치 바꾸기, 공용 팁으로, 시트 머리의 취소·저장 */
:is(.route-notes-button.route-notes-row-link, .route-notes-button.route-notes-tip-head-button) {
  min-height: var(--btn-h);
  padding: 0 8px;
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--gold);
  box-shadow: none;
  font-size: var(--btn-fs);
  font-weight: 600;
}
.route-notes-button.route-notes-tip-head-button:not(.primary-text) { font-weight: 500; }
.route-notes-button.route-notes-tip-head-button.primary-text { font-weight: 700; }

/* 아이콘 버튼: 구역 머리의 구역 변경·검색·⋯, 시트 닫기. 지도 위라 회색 면은 지도용 채움 */
:is(.route-notes-selected-bar > .route-notes-icon-button, .route-notes-button.route-notes-sheet-back, .route-notes-icon-button.route-notes-panel-close) {
  width: var(--btn-icon);
  height: var(--btn-icon);
  min-width: var(--btn-icon);
  min-height: var(--btn-icon);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--map-fill-strong);
  color: var(--map-muted);
  box-shadow: none;
}

/* 작은 버튼: 구역 목록 머리의 구역 만들기(강조색 글자) */
.route-notes-button.route-notes-create-zone {
  height: var(--btn-sm-h);
  min-height: var(--btn-sm-h);
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--map-fill);
  color: var(--gold);
  box-shadow: none;
  font-size: var(--btn-sm-fs);
  font-weight: 700;
}

/* 목록 줄 버튼: 내 노트·팀 관리 메뉴, 팀 관리의 줄. 묶은 목록 폼과 같은 50px 줄 */
:is(.route-notes-space-options .route-notes-button, .route-notes-space-actions .route-notes-button, .route-notes-button.route-notes-team-row) {
  min-height: var(--row-h);
  font-size: var(--row-fs);
  font-weight: 500;
}
:is(.route-notes-space-options .route-notes-button, .route-notes-space-actions .route-notes-button).active { font-weight: 700; }
.route-notes-button.route-notes-team-row.accent { color: var(--gold); }
.route-notes-button.route-notes-team-row.danger { color: var(--red); }
.route-notes-button.route-notes-team-row + .route-notes-button.route-notes-team-row { box-shadow: inset 0 1px 0 var(--line); border-radius: 0; }
/* 구역노트 1단계(2026-10-13 시안): 내 노트 팝오버의 줄은 48px, 검색 화면의 취소는 입력칸과 같은 42px */
.route-notes-space-popover .route-notes-space-actions .route-notes-button { min-height: 48px; }
.route-notes-button.route-notes-search-cancel { min-height: 42px; }
/* 구역노트 2단계(2026-10-13 시안 B1): 시트 맨 아래 취소는 회색 글자 버튼 44px */
.route-notes-button.route-notes-tip-cancel {
  min-height: var(--btn-h);
  padding: 0 8px;
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: var(--btn-fs);
  font-weight: 600;
}
/* 구역노트 카드 줄 머리의 주 버튼(+ 구역 만들기, 팁 쓰기)도 다른 주 버튼과 같은 44px·14px(2026-10-17 통일; 전에는 36px·13px).
   첫 사용(구역이 하나도 없음)에는 강조색 22% 링으로 먼저 눈에 띄게 한다. */
.route-notes-button.primary.route-notes-rail-action {
  gap: 4px;
  height: var(--btn-h);
  min-height: var(--btn-h);
  padding: 0 18px;
  font-size: var(--btn-fs);
  font-weight: 700;
}
.route-notes-button.primary.route-notes-rail-create[data-first="true"] { box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 22%, transparent); }
/* 구역노트 3단계(A2): 지도 위 떠 있는 바의 주 버튼은 조건이 안 되면 흐리게가 아니라 회색 면 + 옅은 글자 */
.route-note-zone-bar .route-note-zone-button.primary:disabled {
  background: var(--btn-fill-pressed);
  color: color-mix(in srgb, var(--muted) 70%, var(--panel));
  opacity: 1;
}
/* 위쪽 되돌리기 알약은 되돌릴 것이 없을 때 흐리지 않고 흰 알약에 회색 글자(색은 화면 CSS) */
.route-note-zone-button.undo-pill:disabled { opacity: 1; }

/* ── 숫자 글꼴: 금액·수량은 Archivo, 한 줄 요약 숫자는 Pretendard ──────────
   옛 CSS에서 !important로 싸우던 묶음을 옮겼다. 이 파일은 층 밖이라 !important 없이 이긴다.
   transform만 모션 코드의 인라인 값을 막으려고 !important를 남긴다. */
/* 숫자 스타일 - Archivo(--font-numeric/--font-amount)로 통일 */
#periodRevenue,
#homeSelectedTotal,
#selectedDayTotal,
#statsSummaryTotal,
#dailyAverage,
#periodCount,
#workDaysHome,
.day-value,
.day-dock-head strong,
.summary-row strong,
.summary-grid strong,
.total-card strong,
.entry-row output,
.calc-row output {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
  transform: none !important;
}

/* 홈 핵심 금액은 Archivo tabular + 허용 굵기 */
#periodRevenue,
#homeSelectedTotal {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
  transform: none !important;
  font-weight: 700;
}

/* 기록 합계도 숫자 폭과 허용 굵기를 맞춤 */
#selectedDayTotal {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
  transform: none !important;
  font-weight: 700;
}

/* 기존 통계 금액은 현재 표시를 유지 */
#statsSummaryTotal {
  font-family: var(--font-amount);
  font-variant-numeric: proportional-nums;
  font-feature-settings: "pnum";
  letter-spacing: -0.01em;
  transform: none !important;
  font-weight: 600;
}

#periodRevenue {
  letter-spacing: -0.02em;
}

/* 홈 요약 네 수치는 Archivo tabular */
#dailyAverage,
#periodCount,
#workDaysHome,
.summary-grid strong {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
  transform: none !important;
}

.entry-row output,
.calc-row output {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.01em;
  transform: none !important;
}

.total-card strong {
  font-family: var(--font-amount);
  font-variant-numeric: proportional-nums;
  font-feature-settings: "pnum";
  letter-spacing: -0.01em;
  transform: none !important;
}

.day-value,
.day-number,
.meter-pct,
.day-dock-head strong,
.summary-row strong {
  font-family: var(--font-ui);
  font-variant-numeric: proportional-nums;
  font-feature-settings: "pnum";
  transform: none !important;
}

/* ── 필터 칩: 목록을 거르는 한 줄 칩. 작은 버튼 높이, 고르면 세그먼트처럼 올라온 표시 ── */
.expense-chip {
  height: var(--btn-sm-h);
  min-height: var(--btn-sm-h);
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--btn-fill);
  color: var(--muted);
  box-shadow: none;
  font-size: var(--btn-sm-fs);
  font-weight: 600;
}
.expense-chip.is-on { background: var(--seg-thumb); box-shadow: var(--shadow-lift); color: var(--text); font-weight: 700; }
.expense-chip.is-warn { color: var(--warn); }

/* ── 앱 안 확인 창 (src/ui/confirm-sheet.js): 구역 삭제 확인과 같은 가운데 대화창, [취소 | 확인] ── */
.app-confirm-layer { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 0 24px; }
.app-confirm-scrim { position: absolute; inset: 0; background: color-mix(in srgb, var(--scrim) 84%, transparent); }
.app-confirm {
  position: relative; display: grid; gap: 8px; box-sizing: border-box; width: 100%; max-width: 340px; padding: 22px 16px 16px;
  border-radius: 22px; background: var(--panel); color: var(--text); box-shadow: var(--shadow-modal); text-align: center;
}
.app-confirm-title { margin: 0; font: 700 17px/1.4 var(--font-ui); letter-spacing: -.02em; overflow-wrap: anywhere; }
.app-confirm-text { margin: 0 0 10px; color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.app-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.app-confirm-actions button { min-height: 46px; padding: 0 16px; border: 0; border-radius: var(--r-full); font-family: inherit; font-size: var(--fs-body-l); font-weight: 700; }
.app-confirm-cancel { background: var(--panel2); color: var(--text); }
.app-confirm-accept { background: var(--gold); color: var(--gold-ink); }
.app-confirm-accept.is-danger { background: var(--red); color: var(--on-color); }

/* ── 요일 고르기 (src/ui/weekday-picker.js): 쉬는 요일처럼 여러 요일을 고른다 ──
   7칸을 꽉 채우고 누르기 높이는 44. 고른 칸은 첫 설정의 선택 카드와 같은 강조 테두리.
   일요일은 빨강, 토요일은 파랑(달력과 같은 요일색). 누르면 작은 버튼처럼 .96배. */
.weekday-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.weekday-picker label {
  position: relative;
  display: grid;
  place-items: center;
  height: 44px;
  margin: 0;
  border: 2px solid transparent;
  border-radius: var(--r-md);
  background: var(--panel2);
  color: var(--text);
  font-size: var(--fs-title-m);
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--spring-quick-ms) var(--spring-quick);
}
.weekday-picker label:first-child { color: var(--red); }
.weekday-picker label:last-child { color: var(--blue); }
.weekday-picker input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.weekday-picker label:has(input:checked) { border-color: var(--gold); background: var(--primary-bg); color: var(--gold); }
.weekday-picker label:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.weekday-picker label:has(input:disabled) { opacity: .45; cursor: default; }
.weekday-picker label:active:not(:has(input:disabled)) { transform: scale(.96); transition-duration: 0s; }
@media (prefers-reduced-motion: reduce) { .weekday-picker label, .weekday-picker label:active { transform: none; transition: none; } }
