/* ---------- Theme variables ---------- */
:root {
  --bg-root: #000;
  --bg-page: #101012;
  --bg-nav: #16161a;
  --bg-card: #18181d;
  --bg-card-alt: #19191e;
  --bg-input: #1c1c22;
  --bg-input-alt: #1e1e24;
  --bg-elevated: #2a2a32;
  --bg-elevated-active: #322f42;
  --border-color: #232329;
  --border-soft: #1e1e24;
  --border-input: #2c2c34;
  --border-strong: #3a3a44;
  --card-edge: rgba(255,255,255,.05);
  --text-primary: #f3f3f6;
  --text-secondary: #a6a6b0;
  --text-tertiary: #c9c9d2;
  --text-quaternary: #787883;
  --text-muted: #6b6b76;
  --text-faint: #57575f;
  --nav-inactive: #7a7a86;
  --placeholder-color: #66666f;
  --overlay-bg: rgba(8,8,12,.62);
  --shadow-color: rgba(0,0,0,.55);
  --shadow-card: 0 1px 2px rgba(0,0,0,.35), 0 10px 24px -8px rgba(0,0,0,.5);
  --shadow-soft: 0 6px 16px -6px rgba(0,0,0,.4);

  --accent: #6C63FF;
  --accent-2: #9089FF;
  --accent-grad: linear-gradient(135deg, var(--accent-2), var(--accent));
  --accent-soft: rgba(108,99,255,.16);
  --success: #22C55E;
  --danger: #FB4D66;
  --gold: #F2B84B;
  --gold-2: #F7CE73;
  --gold-grad: linear-gradient(90deg, var(--gold), var(--gold-2));

  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 9px;

  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg-root: #eef0f4;
  --bg-page: #ffffff;
  --bg-nav: #ffffff;
  --bg-card: #f6f7fa;
  --bg-card-alt: #f6f7fa;
  --bg-input: #f1f2f6;
  --bg-input-alt: #edeef2;
  --bg-elevated: #e7e8ee;
  --bg-elevated-active: #dcdcf0;
  --border-color: #e5e6ec;
  --border-soft: #edeef2;
  --border-input: #dfe0e7;
  --border-strong: #cacbd4;
  --card-edge: rgba(20,20,40,.04);
  --text-primary: #16171d;
  --text-secondary: #5c5e68;
  --text-tertiary: #43454f;
  --text-quaternary: #7a7c88;
  --text-muted: #8b8d97;
  --text-faint: #a4a6b0;
  --nav-inactive: #9698a4;
  --placeholder-color: #a4a6b0;
  --overlay-bg: rgba(20,20,30,.35);
  --shadow-color: rgba(20,20,40,.1);
  --shadow-card: 0 1px 2px rgba(20,20,40,.04), 0 10px 22px -10px rgba(20,20,40,.12);
  --shadow-soft: 0 4px 12px -4px rgba(20,20,40,.08);

  --accent: #6C63FF;
  --accent-2: #8B7FFF;
  --accent-grad: linear-gradient(135deg, var(--accent-2), var(--accent));
  --accent-soft: rgba(108,99,255,.1);
  --success: #16A34A;
  --danger: #E9425A;
  --gold: #E2A63B;
  --gold-2: #EEC06A;
  --gold-grad: linear-gradient(90deg, var(--gold), var(--gold-2));
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-root: #eef0f4;
    --bg-page: #ffffff;
    --bg-nav: #ffffff;
    --bg-card: #f6f7fa;
    --bg-card-alt: #f6f7fa;
    --bg-input: #f1f2f6;
    --bg-input-alt: #edeef2;
    --bg-elevated: #e7e8ee;
    --bg-elevated-active: #dcdcf0;
    --border-color: #e5e6ec;
    --border-soft: #edeef2;
    --border-input: #dfe0e7;
    --border-strong: #cacbd4;
    --card-edge: rgba(20,20,40,.04);
    --text-primary: #16171d;
    --text-secondary: #5c5e68;
    --text-tertiary: #43454f;
    --text-quaternary: #7a7c88;
    --text-muted: #8b8d97;
    --text-faint: #a4a6b0;
    --nav-inactive: #9698a4;
    --placeholder-color: #a4a6b0;
    --overlay-bg: rgba(20,20,30,.35);
    --shadow-color: rgba(20,20,40,.1);
    --shadow-card: 0 1px 2px rgba(20,20,40,.04), 0 10px 22px -10px rgba(20,20,40,.12);
    --shadow-soft: 0 4px 12px -4px rgba(20,20,40,.08);
    --accent: #6C63FF;
    --accent-2: #8B7FFF;
    --accent-grad: linear-gradient(135deg, var(--accent-2), var(--accent));
    --accent-soft: rgba(108,99,255,.1);
    --success: #16A34A;
    --danger: #E9425A;
    --gold: #E2A63B;
    --gold-2: #EEC06A;
    --gold-grad: linear-gradient(90deg, var(--gold), var(--gold-2));
    color-scheme: light;
  }
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  /* 안드로이드 브라우저(특히 삼성인터넷)가 입력창(input) 글자만 자동으로 확대해서,
     같은 16px로 지정해도 옆의 "km" 같은 일반 텍스트보다 숫자가 커 보이는 문제를 막는다. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html, body {
  height: 100%;
  background: var(--bg-root);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; transition: opacity .15s ease, transform .1s ease; }
button:active { transform: scale(.97); }
ul { list-style: none; }
/* hidden 속성은 display를 직접 준 버튼(.menu-list > button 등)에서도 확실히 숨긴다 */
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }

/* ---------- App shell ---------- */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg-page);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px var(--shadow-color);
}
#app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-page);
  border-bottom: 1px solid var(--border-color);
}
#app-main {
  flex: 1;
  padding-bottom: 92px;
  overflow-x: hidden;
}
#app-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--bg-nav);
  border-top: 1px solid var(--border-color);
  z-index: 20;
}

/* ---------- Header ---------- */
.hdr-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px 6px;
}
.hdr-logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hdr-cafe {
  font-size: 11px;
  color: #d98a5e;
  font-style: italic;
  white-space: nowrap;
  position: relative;
}
.hdr-cafe .dot {
  position: absolute;
  top: -2px;
  right: -8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
}
.hdr-cafe-slot { /* 추후 커뮤니티/카페 링크 등을 위해 비워둔 자리 */ }
.hdr-spacer { flex: 1; }
.hdr-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: linear-gradient(90deg,#ff6fa8,var(--accent));
  color: #fff;
  white-space: nowrap;
  position: relative;
}
.hdr-badge .n-flag {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 8px;
}
.hdr-run-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  border: none;
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.hdr-run-toggle .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); }
.hdr-run-toggle.running { color: var(--success); background: color-mix(in srgb, var(--success) 14%, var(--bg-elevated)); }
.hdr-run-toggle.running .dot { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); animation: pulse-dot 1.6s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .45; } }
.hdr-menu-btn {
  background: none; border: none; padding: 5px;
  display: flex; flex-direction: column; gap: 3px;
}
.hdr-menu-btn span { width: 17px; height: 2px; background: var(--text-primary); display: block; border-radius: 2px; }

.hdr-stats {
  display: flex;
  gap: 10px;
  padding: 0 12px 9px;
  font-size: 11px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.hdr-stats b { color: var(--text-primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.hdr-stats .warn b { color: var(--gold); }
.hdr-stats .overdue b { color: var(--danger); }
.hdr-stats .wage b { color: var(--success); }
.hdr-stats .goal b { color: var(--gold); }
#hdr-oil { cursor: pointer; }

/* ---------- Banner carousel ---------- */
.banner {
  margin: 0 12px 10px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  height: 78px;
  box-shadow: var(--shadow-soft);
}
.banner-slide {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
  color: #fff;
}
.banner-slide.active { opacity: 1; pointer-events: auto; }
.banner-slide .b-title { font-size: 13px; font-weight: 800; line-height: 1.3; }
.banner-slide .b-sub { font-size: 10px; opacity: .85; margin-top: 3px; }

.today-net-strip {
  margin: 0 12px 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius-lg);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 4px;
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
}
.today-net-strip .v { color: var(--success); font-variant-numeric: tabular-nums; }
.today-net-strip .v b { font-size: 14px; }

/* 운행 기록은 있는데 실적이 빠진 날 알림 - 숫자를 믿을 수 있게 입력을 챙기라는 신호라 금색으로 눈에 띄게 */
.missing-card {
  margin: 0 12px 10px; padding: 10px 14px; width: calc(100% - 24px);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card); border: 1px solid var(--gold); border-radius: var(--radius-lg);
  font-size: 12px; font-weight: 700; color: var(--text-secondary); text-align: left;
}
.missing-card b { color: var(--gold); }
.missing-card .chev { color: var(--text-quaternary); font-size: 16px; }
/* AI 코치 카드 - 새 주에 리포트를 아직 안 받았으면(.new) 보라색 테두리로 눈에 띄게 */
.ai-card {
  margin: 0 12px 10px; padding: 12px 14px;
  background: var(--bg-card); border: 1px solid var(--card-edge); border-radius: var(--radius-lg);
}
.ai-card.new { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.ai-card-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.ai-card-head small { font-size: 10.5px; color: var(--text-quaternary); font-weight: 600; }
.ai-card-head .ai-badge { color: var(--accent-2); font-weight: 800; }
.ai-card-body { font-size: 12px; color: var(--text-secondary); line-height: 1.5; margin: 6px 0 10px; }
.ai-card-actions { display: flex; gap: 8px; }
.ai-card-actions button {
  flex: 1; padding: 8px 6px; border-radius: var(--radius-sm); border: none;
  background: var(--accent-soft); color: var(--text-primary); font-size: 12px; font-weight: 700; white-space: nowrap;
}
.insight-row { display: flex; gap: 8px; padding: 0 12px 10px; }
.insight-btn {
  flex: 1; padding: 9px 6px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--card-edge);
  font-size: 12px; font-weight: 700; color: var(--text-tertiary); white-space: nowrap;
}

/* ---------- Section generic ---------- */
.section { padding: 0 12px; }
.month-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px 10px;
}
.month-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 18px; font-weight: 800; letter-spacing: -0.02em;
  background: none; border: none; color: inherit; padding: 0;
}
.target-select {
  display: flex; align-items: center; gap: 5px;
  background: none; border: none;
  font-size: 12px; color: var(--text-tertiary); font-weight: 600;
}

.progress-wrap {
  margin: 0 12px 12px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  background: var(--bg-input-alt);
  height: 48px;
  align-items: stretch;
  box-shadow: var(--shadow-soft);
}
.progress-fill {
  background: var(--gold-grad);
  display: flex; align-items: center; justify-content: flex-start;
  padding-left: 10px;
  font-weight: 800; font-size: 14px;
  color: #241a06;
  min-width: 48px;
  white-space: nowrap;
}
/* 금액이 길어지면(2,083,025원) 브라우저가 숫자-한글 경계에서 줄을 바꿔 "원"만 아래로
   떨어지던 문제가 있었다(사용자 신고). 금액+"원"을 .amount-value로 묶어 nowrap을 걸고,
   건수도 nowrap으로 둔 뒤 wrap은 두 덩어리 사이에서만 일어나게 한다. */
.progress-detail {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 17px; font-weight: 800; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.progress-detail .amount-value { white-space: nowrap; }
.progress-detail small { font-size: 11px; font-weight: 600; color: var(--text-tertiary); white-space: nowrap; }

.breakdown-row {
  display: flex; justify-content: space-between;
  padding: 4px 12px 12px;
  gap: 8px;
}
.platform-lines { display: flex; flex-direction: column; gap: 8px; }
.platform-line { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.platform-line .icon {
  width: 22px; height: 22px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #101012;
  flex-shrink: 0;
}
.platform-line .pending { color: var(--success); font-weight: 700; font-size: 11px; margin-left: 3px; }
.expense-lines { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; text-align: right; }
.expense-line { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.expense-line .pct { color: var(--text-secondary); font-weight: 500; }
.expense-line.net { color: var(--success); }

.stat-grid {
  margin: 0 12px 10px;
  background: var(--bg-card);
  border: 1px solid var(--card-edge);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-lg);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 12px 3px;
  text-align: center;
}
.stat-grid .stat b { display: block; font-size: 13px; font-weight: 800; margin: 3px 0 1px; font-variant-numeric: tabular-nums; }
.stat-grid .stat .lbl { font-size: 10px; color: var(--text-secondary); }
.stat-grid .stat .sub { font-size: 8.5px; color: var(--text-quaternary); line-height: 1.4; }
.stat-grid .stat .sub .today-wage { color: var(--success); font-weight: 700; }

.toggle-row {
  display: flex; flex-wrap: wrap; align-items: center;
  padding: 0 12px 8px;
  gap: 6px 8px;
}
.toggle-row .seg { flex: 1 1 100%; order: 1; }
.toggle-row .checks { order: 2; }
.toggle-row .dayoff-btn { order: 3; margin-left: auto; }
.seg {
  display: flex; background: var(--bg-input-alt); border-radius: var(--radius-sm); padding: 3px;
}
.seg button {
  flex: 1; border: none; background: none; padding: 6px 4px; border-radius: 7px;
  font-size: 11px; font-weight: 700; color: var(--text-secondary); white-space: nowrap;
}
.seg button.active { background: var(--accent); color: #fff; }
.checks { display: flex; gap: 10px; flex-shrink: 0; }
.chk { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-tertiary); font-weight: 600; white-space: nowrap; }
.chk input { accent-color: var(--accent); width: 14px; height: 14px; flex-shrink: 0; }
.dayoff-btn {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0; white-space: nowrap;
  background: var(--bg-input-alt); border: none; border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: 11px; font-weight: 700; color: var(--text-primary);
}

/* ---------- Calendar ---------- */
.cal-grid {
  display: grid;
  /* minmax(0, …): 칸 안 내용이 커도 7칸이 화면 폭을 넘지 않게(넘치면 그 줄만 세로로 늘어난다) */
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 0 7px 14px;
  gap: 4px;
}
.cal-dow { text-align: center; font-size: 10.5px; color: var(--text-secondary); font-weight: 700; padding-bottom: 4px; }
.cal-dow.sun { color: #ff6a6a; }
.cal-dow.sat { color: #6aa6ff; }
.cal-cell {
  aspect-ratio: 1 / 0.95;
  border-radius: 10px;
  padding: 3px 1px;
  font-size: 10px;
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  background: transparent;
}
.cal-cell .d { font-weight: 700; font-size: 10.5px; }
.cal-cell.sun .d { color: #ff6a6a; }
.cal-cell.sat .d { color: #6aa6ff; }
.cal-cell.off { background: var(--bg-input-alt); }
.cal-cell.off .d { color: var(--text-muted); }
.cal-cell.off .off-lbl { font-size: 8.5px; color: var(--text-muted); margin-top: 3px; }
.cal-cell.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-cell .val { margin-top: 2px; font-weight: 700; font-size: 9.5px; font-variant-numeric: tabular-nums; }
/* 그날 배민 등급 포인트(설정에서 켠 사람만) - 매출 숫자 바로 아래, 한 단계 작고 흐리게 */
/* 줄 높이를 글자 크기에 딱 맞춰야 칸 높이가 안 늘어난다 - 칸이 정사각형 비율(aspect-ratio)이라 높이가
   늘면 가로도 같이 넓어져서 달력이 화면 밖으로 밀렸다(375px 폰에서 토요일 칸이 잘림, 실제로 확인). */
.cal-cell .pts { margin-top: 1px; font-size: 8px; line-height: 1; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums; letter-spacing: -0.2px; white-space: nowrap; }
.cal-cell .dot { width: 4px; height: 4px; border-radius: 50%; margin-top: 2px; }
.cal-cell .dot.green { background: var(--success); }
.cal-cell .dot.white { background: #d9d9de; }
.cal-cell .promo-mark { position: absolute; top: 3px; right: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.cal-cell .wemoji { font-size: 12px; margin-top: 1px; }

/* ---------- Bottom nav ---------- */
.nav-list { display: flex; }
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none;
  padding: 8px 2px 10px;
  font-size: 10px; font-weight: 700; color: var(--nav-inactive);
}
.nav-item .ic {
  width: 20px; height: 20px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
}
.nav-item.active { color: var(--accent); }
.nav-item .ic.plain { font-size: 15px; }
.nav-item .underline { width: 16px; height: 3px; background: transparent; border-radius: 999px; margin-top: 1px; }
.nav-item.active .underline { background: var(--accent-grad); }

/* ---------- Generic list / page header ---------- */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px 10px;
}
.page-title { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; display: flex; align-items: center; gap: 6px; }
.btn {
  border: none; border-radius: var(--radius-sm); padding: 9px 13px;
  font-size: 12px; font-weight: 700; background: var(--bg-elevated); color: var(--text-primary);
}
.btn.primary { background: var(--accent-grad); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--border-strong); }
.btn.block { width: 100%; padding: 15px; border-radius: var(--radius-md); font-size: 14px; }
.btn.danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .4; }
.year-select {
  border: none; border-radius: var(--radius-sm); padding: 9px 8px;
  font-size: 12px; font-weight: 700; background: var(--bg-elevated); color: var(--text-primary);
}

.summary-card {
  margin: 0 12px 10px;
  background: var(--bg-card);
  border: 1px solid var(--card-edge);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.summary-card .amt { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.maint-advice {
  margin: 0 12px 10px;
  background: var(--bg-card);
  border: 1px solid var(--card-edge);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.maint-advice b { color: var(--text-primary); font-weight: 700; }
.maint-advice b.warn { color: var(--gold); }
.maint-advice b.overdue { color: var(--danger); }
.maint-advice b.pending { color: var(--accent-2); }
.maint-advice-text { display: block; }
.maint-advice-text.clamped {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.maint-advice-more { display: block; margin-top: 4px; color: var(--accent-2); font-weight: 700; white-space: nowrap; cursor: pointer; }
.summary-card .meta { font-size: 11px; color: var(--text-secondary); margin-top: 3px; }

.settle-card {
  margin: 0 12px 10px;
  background: var(--bg-card);
  border: 1px solid var(--card-edge);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.settle-title { font-size: 12px; color: var(--text-secondary); font-weight: 700; margin-bottom: 8px; }
.settle-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.settle-row span { color: var(--text-tertiary); }
.settle-row b { font-weight: 800; }
.settle-row.today span { color: var(--success); font-weight: 700; }
.settle-total {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border-color);
  font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.settle-total b { color: var(--gold); }
.settle-empty { font-size: 12px; color: var(--text-muted); padding: 4px 0; }
.settle-row .gross-ref { font-size: 10px; color: var(--text-muted); margin-left: 5px; font-weight: 500; }
.settle-deduct { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-input); }
.settle-deduct-row { display: flex; align-items: center; justify-content: space-between; padding: 3px 0; font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.settle-deduct-row.total { font-weight: 800; color: var(--text-primary); border-top: 1px solid var(--border-color); margin-top: 4px; padding-top: 6px; }
.settle-disclaimer { font-size: 10.5px; color: var(--text-muted); margin-top: 8px; }

.entry-row {
  margin: 0 12px 8px;
  background: var(--bg-card-alt);
  border: 1px solid var(--card-edge);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.entry-row .left .date { font-size: 11px; color: var(--text-secondary); margin-bottom: 3px; }
.entry-row .left .amt { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.entry-row .left .cnt { font-size: 11px; color: var(--text-secondary); margin-left: 5px; }
.entry-row .badge-promo { font-size: 10px; color: var(--gold); margin-left: 5px; }
.entry-row .badge-pts { font-size: 10px; color: var(--accent-2); margin-left: 5px; font-variant-numeric: tabular-nums; }

/* 배민 배달고수클럽 등급 카드 (배민 탭 맨 위, 설정에서 켠 사람만) */
.bp-card { margin: 0 12px 10px; background: var(--bg-card); border: 1px solid var(--card-edge); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow-card); }
.bp-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.bp-top b { font-size: 14px; }
.bp-top span { font-size: 11px; color: var(--text-quaternary); white-space: nowrap; }
.bp-big { font-size: 24px; font-weight: 800; margin: 10px 0 2px; font-variant-numeric: tabular-nums; }
.bp-big small { font-size: 13px; color: var(--text-quaternary); font-weight: 700; }
.bp-bar { position: relative; height: 10px; background: var(--bg-input); border-radius: 99px; margin: 12px 0 24px; }
.bp-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--accent-grad); }
.bp-bar .mk { position: absolute; top: -3px; width: 2px; height: 16px; background: var(--border-strong); }
.bp-bar .mk i { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 9.5px; color: var(--text-quaternary); white-space: nowrap; }
.bp-bar .mk.last i { left: auto; right: 0; transform: none; }
/* 아주 좁은 폰(360px 이하)에선 "다이아"·"마스터" 눈금 글자가 붙어 버린다 - 끝(마스터)은 위 큰 글씨에 이미 있으니 숨긴다 */
@media (max-width: 360px) { .bp-bar .mk.last i { display: none; } }
.bp-bar .mk.done { background: var(--gold); }
.bp-bar .mk.done i { color: var(--gold); }
.bp-msg { font-size: 12.5px; line-height: 1.6; color: var(--text-secondary); word-break: keep-all; }
.bp-msg b { color: var(--text-primary); }
.bp-msg .bp-basis { display: block; font-size: 11px; color: var(--text-quaternary); margin-top: 2px; }
/* 한국어 문장이 단어 중간("하 / 루")에서 끊기지 않게 */
.bp-foot, .toast-cheer, .timer-modal .t-goal { word-break: keep-all; }
.bp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.bp-stats div { background: var(--bg-card-alt); border: 1px solid var(--border-input); border-radius: var(--radius-sm); padding: 8px 4px; text-align: center; min-width: 0; }
.bp-stats b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bp-stats span { font-size: 10px; color: var(--text-quaternary); }
.bp-foot { font-size: 11px; color: var(--text-quaternary); line-height: 1.6; margin-top: 10px; }
.bp-foot b { color: var(--text-secondary); }
.bp-add { margin-top: 12px; padding: 11px; font-size: 13px; }
.bp-th-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bp-th { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-tertiary); font-weight: 700; min-width: 0; }
.bp-th .form-input { padding: 11px 12px; }
.entry-row .chev { color: var(--text-faint); font-size: 16px; }

.empty-state {
  padding: 50px 20px; text-align: center; color: var(--text-muted); font-size: 12px;
}

/* ---------- Expense view ---------- */
.exp-tabs { display: flex; gap: 16px; padding: 12px 12px 8px; }
.exp-tab { display: flex; align-items: center; gap: 5px; background: none; border: none; font-size: 13px; font-weight: 700; color: var(--text-muted); padding-bottom: 7px; border-bottom: 2px solid transparent; }
.exp-tab.active { color: var(--accent); border-color: var(--accent); }
.exp-quick {
  margin: 6px 12px 12px;
  display: flex; gap: 8px;
}
.exp-quick .drow { flex: 0 0 auto; }
.exp-quick input[type=text] {
  flex: 1; background: var(--bg-card-alt); border: 1px solid var(--border-input); border-radius: var(--radius-sm);
  padding: 11px 12px; font-size: 13px; color: var(--text-primary);
}
.exp-quick input::placeholder { color: var(--placeholder-color); }
.date-field {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-card-alt); border: 1px solid var(--border-input); border-radius: var(--radius-sm);
  padding: 10px 10px; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.exp-list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px; border-bottom: 1px solid var(--border-soft);
}
/* 누르면 수정창이 열리는 줄. 평소엔 원래 목록과 똑같이 보이고, 손가락을 댔을 때만
   살짝 눌리는 느낌을 줘서 "여기 눌러도 된다"가 자연스럽게 전달되게 한다. */
.exp-list-row.tappable { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background 120ms ease; }
.exp-list-row.tappable:active { background: var(--bg-elevated); }
.exp-list-row .d { color: var(--text-tertiary); font-size: 12px; }
/* 항목이 여러 개 묶이면 왼쪽 글이 길어지는데, 금액이 "13,000 / 원"처럼 두 줄로
   쪼개지면 한눈에 안 읽힌다. 금액은 절대 안 접히게 두고 왼쪽 글만 줄바꿈시킨다. */
.exp-list-row .a { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.exp-list-row .d { min-width: 0; }
.exp-list-row .right { display: flex; align-items: center; gap: 12px; flex: none; }
.x-btn {
  width: 20px; height: 20px; border-radius: 50%; background: var(--bg-elevated); border: none;
  color: var(--text-secondary); font-size: 11px; display: flex; align-items: center; justify-content: center;
}

/* 주유·식비 빠른 금액 버튼: 누르면 날짜칸 날짜로 바로 기록된다. 손가락으로 누르기 쉽게 높이 36px 이상. */
.exp-presets { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 12px 12px; }
.exp-preset {
  border: 1px solid var(--border-input); background: var(--bg-elevated); color: var(--text-primary);
  border-radius: 999px; padding: 9px 15px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
.exp-preset:active { background: var(--accent); border-color: var(--accent); color: #fff; }
.exp-preset.add { background: transparent; border-style: dashed; border-color: var(--border-strong); color: var(--text-secondary); }
/* 좁은 폰(400px 이하)에서도 금액 4개 + 설정 버튼이 한 줄에 들어가게: 간격을 줄이고 "직접 설정" → "설정" */
@media (max-width: 400px) {
  .exp-presets { gap: 6px; }
  .exp-preset { padding: 9px 11px; }
  .exp-preset .lbl-long { display: none; }
}
/* 방금 기록한 줄: 보라빛으로 떴다가 천천히 원래 색으로 */
.exp-list-row.just-added { animation: exp-just-added 1.8s ease-out; }
@keyframes exp-just-added { from { background: var(--accent-soft); } to { background: transparent; } }
/* 주유 탭 위 "이번 달 km당 주유비" 한 줄 - 누르면 km당 비용 표가 열린다 */
.exp-kmcost {
  display: flex; align-items: center; gap: 6px; width: calc(100% - 24px); margin: 0 12px 2px;
  padding: 10px 12px; background: var(--bg-card-alt); border: 1px solid var(--border-input); border-radius: var(--radius-sm);
  font-size: 12px; color: var(--text-secondary); text-align: left;
}
.exp-kmcost b { color: var(--text-primary); font-size: 13px; font-variant-numeric: tabular-nums; }
.exp-kmcost .sub { margin-left: auto; color: var(--text-quaternary); font-size: 11px; white-space: nowrap; }
.exp-kmcost .chev { color: var(--text-quaternary); font-size: 14px; }
/* 지출 기록 보기: 달력(기본) / 목록. 달력은 홈 달력(.cal-grid/.cal-cell)과 같은 모양을 쓴다. */
.exp-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 8px; }
.exp-cal-month { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; }
.exp-cal-month .arr { background: var(--bg-elevated); border: none; color: var(--text-primary); width: 30px; height: 30px; border-radius: 9px; font-size: 15px; }
.exp-cal-month .arr:disabled { opacity: .3; }
.exp-view { display: flex; background: var(--bg-elevated); border-radius: 9px; padding: 3px; flex: none; }
.exp-view button { background: none; border: none; color: var(--text-secondary); font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 7px; }
.exp-view button.on { background: var(--accent); color: #fff; }
.exp-cal-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 12px 10px; }
.exp-cal-sum div { background: var(--bg-card-alt); border: 1px solid var(--border-input); border-radius: var(--radius-sm); padding: 9px 4px; text-align: center; min-width: 0; }
.exp-cal-sum b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-cal-sum span { font-size: 10.5px; color: var(--text-quaternary); }
.exp-cal button.cal-cell { border: none; color: var(--text-primary); font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.exp-cal .cal-cell.has { background: var(--accent-soft); }
.exp-cal .cal-cell .val { color: var(--accent-2); font-size: 10.5px; }
.exp-cal .cal-cell.sel { background: var(--accent); }
.exp-cal .cal-cell.sel .d, .exp-cal .cal-cell.sel .val { color: #fff; }
.exp-day { margin: 0 12px 12px; background: var(--bg-card-alt); border: 1px solid var(--border-input); border-radius: var(--radius-md); overflow: hidden; }
.exp-day-head { padding: 10px 12px 4px; font-size: 12px; font-weight: 800; color: var(--text-secondary); }
.exp-day .exp-list-row { border-bottom: none; padding: 8px 12px; }
.exp-day-empty { padding: 6px 12px 12px; font-size: 12px; color: var(--text-quaternary); }
/* 빠른 금액 설정 창 */
.qa-list { display: flex; flex-direction: column; gap: 6px; }
.qa-item {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-input); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; font-weight: 700;
}
.qa-lock { font-size: 11px; color: var(--text-quaternary); font-weight: 600; }
.qa-add { display: flex; gap: 8px; }
.qa-add .form-input { flex: 1; }
.qa-add .btn { padding: 0 18px; border-radius: var(--radius-md); font-size: 14px; }

/* ---------- Records view ---------- */
.rec-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 12px 8px;
}
.rec-head-btns { display: flex; align-items: center; gap: 8px; }
.rec-month-divider {
  padding: 10px 12px 6px; font-size: 12px; font-weight: 800; color: var(--text-secondary);
  position: sticky; top: 0; background: var(--bg-page); z-index: 5;
}
.rec-cols {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 0.8fr 0.8fr 0.5fr;
  padding: 0 12px 6px; font-size: 10px; color: var(--text-secondary); font-weight: 700;
}
.rec-row {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 0.8fr 0.8fr 0.5fr;
  align-items: center;
  margin: 0 12px 8px;
  background: var(--bg-card-alt); border: 1px solid var(--card-edge); box-shadow: var(--shadow-card);
  border-radius: var(--radius-md); padding: 10px 8px;
  font-size: 11px;
}
.rec-row .date-cell .dd { font-weight: 700; font-size: 12px; }
.rec-row .date-cell .meta { color: var(--text-secondary); font-size: 9.5px; margin-top: 2px; }
.rec-row .cell-btn { background: none; border: none; color: var(--text-primary); font-weight: 700; font-size: 11px; text-align: center; }
.rec-row .memo-btn, .rec-row .weather-btn { display: flex; justify-content: center; }
.rec-row .kebab { text-align: right; }
.rec-row .kebab button { background: none; border: none; color: var(--text-secondary); font-size: 14px; padding: 3px 5px; }
.rec-add-form {
  margin: 0 12px 12px; background: var(--bg-card-alt); border: 1px solid var(--card-edge); box-shadow: var(--shadow-card);
  border-radius: var(--radius-md); padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.rec-add-form .row { display: flex; gap: 8px; }
.rec-add-form input {
  flex: 1; background: var(--bg-page); border: 1px solid var(--border-input); border-radius: var(--radius-sm); padding: 9px; color: var(--text-primary); font-size: 12px;
}

/* ---------- Forms (delivery entry / generic) ---------- */
.form-field { padding: 14px 18px; }
.form-label { font-size: 13px; color: var(--text-tertiary); font-weight: 700; margin-bottom: 8px; }
.form-input {
  width: 100%; background: var(--bg-input); border: 1px solid var(--border-input); border-radius: var(--radius-md);
  padding: 14px; font-size: 16px; font-weight: 700; color: var(--text-primary);
  display: flex; align-items: baseline; justify-content: space-between;
  transition: border-color .15s ease;
}
.form-input input {
  background: none; border: none; outline: none; color: var(--text-primary); font-size: 16px; font-weight: 700; width: 100%;
}
.form-input input::placeholder { color: var(--text-faint); font-weight: 500; font-size: 13px; }
/* 숫자+단위(원/건/km/년/월 등) 조합 칸은 숫자가 단위 글자 바로 앞에 붙도록 오른쪽 정렬한다.
   가운데 정렬처럼 인라인 style로 따로 지정된 칸(예: 주행거리 시작~종료)은 그대로 우선 적용됨. */
.form-input input[type="number"] { text-align: right; }
/* align-items:baseline으로 숫자와 같은 기준선에 붙인다 (이전엔 center라 단위 글자가
   숫자보다 아래로 처져 보였음). 크기는 숫자와 동일한 16px 그대로 유지. */
.form-input > span {
  font-size: 16px;
  flex-shrink: 0;
  margin-left: 4px;
}
.form-input.focus { border-color: var(--accent); }
.platform-select { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; }
.platform-select .icon { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11px; color: #101012; }
.date-picker-field { display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 700; background: none; border: none; color: var(--text-primary); }
.hint { font-size: 11px; color: var(--text-quaternary); margin-top: 7px; }
.toggle-line { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--text-tertiary); }
.day-sum-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 4px; cursor: pointer;
  border-bottom: 1px solid var(--card-edge);
}
.day-sum-row:last-child { border-bottom: none; }
.day-sum-row .ic { font-size: 20px; width: 24px; text-align: center; }
.day-sum-row .lbl { font-size: 14px; font-weight: 700; flex: 1; }
.day-sum-row .val { font-size: 13px; color: var(--text-secondary); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 실적 입력 빠진 날 목록 */
.missing-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--card-edge); }
.missing-row:last-child { border-bottom: none; }
.missing-date {
  flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: none; border: none; padding: 4px 2px; text-align: left; color: var(--text-primary);
}
.missing-date b { font-size: 14px; }
.missing-date span { font-size: 11px; color: var(--text-quaternary); }
.missing-ignore {
  flex-shrink: 0; padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--bg-input); border: 1px solid var(--border-input); color: var(--text-secondary);
}

/* 요일·날씨 분석, km당 비용 표 */
.insight-table { background: var(--bg-input); border-radius: var(--radius-sm); padding: 4px 10px; }
.insight-table .it-head, .insight-table .it-row {
  display: grid; grid-template-columns: 1.1fr 1fr 1.4fr 1.2fr; gap: 6px; align-items: center;
  padding: 7px 0; font-size: 12px; font-variant-numeric: tabular-nums;
}
.insight-table.km-cost .it-head, .insight-table.km-cost .it-row { grid-template-columns: 1.4fr 1fr 1fr; }
.insight-table .it-head { font-size: 10.5px; color: var(--text-quaternary); font-weight: 700; border-bottom: 1px solid var(--card-edge); }
.insight-table .it-row { border-bottom: 1px solid var(--card-edge); color: var(--text-secondary); }
.insight-table .it-row:last-child { border-bottom: none; }
.insight-table .it-row span:not(:first-child), .insight-table .it-head span:not(:first-child) { text-align: right; }
.insight-table .it-row span:first-child { font-weight: 700; color: var(--text-primary); }
.insight-table .it-row.muted span { color: var(--text-faint); }
.insight-table .it-row.strong span { font-weight: 800; color: var(--text-primary); }
.insight-table .best { color: var(--gold); font-weight: 800; }
.insight-table .up { color: var(--success); font-weight: 700; }
.insight-table .down { color: var(--danger); font-weight: 700; }

/* 연간 요약 */
.sum-group-title { font-size: 11px; font-weight: 800; color: var(--text-quaternary); margin: 14px 0 4px; }
.sum-group-title:first-child { margin-top: 4px; }
.sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13px; color: var(--text-secondary); }
.sum-row b { font-variant-numeric: tabular-nums; color: var(--text-primary); font-weight: 700; white-space: nowrap; }
.sum-row.strong span, .sum-row.strong b { font-weight: 800; color: var(--text-primary); }
.switch { position: relative; width: 40px; height: 24px; background: var(--bg-elevated); border-radius: 999px; border: none; flex-shrink: 0; transition: background .15s ease; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .18s ease; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(16px); }
.hr { border-top: 1px dashed var(--border-input); margin: 4px 18px; }
.seg3 { display: flex; gap: 7px; }
.seg3 button {
  flex: 1; padding: 10px; border-radius: var(--radius-sm); border: none; background: var(--bg-input); color: var(--text-tertiary); font-size: 12px; font-weight: 700;
}
.seg3 button.active { background: var(--accent); color: #fff; }

.form-footer { padding: 18px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Modal / sheet ---------- */
.overlay {
  position: fixed; inset: 0; background: var(--overlay-bg); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px);
}
.overlay.center { align-items: center; }
.sheet {
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  background: var(--bg-page); border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,.3);
  animation: slideup .22s cubic-bezier(.2,.8,.3,1);
}
.overlay.center .sheet { border-radius: 20px; max-width: 340px; box-shadow: var(--shadow-card); }
@keyframes slideup { from { transform: translateY(30px); opacity: 0;} to { transform: translateY(0); opacity: 1; } }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border-soft);
  position: sticky; top: 0; background: var(--bg-page); z-index: 2;
}
.sheet-title { font-size: 14px; font-weight: 800; }
.icon-btn { background: none; border: none; color: var(--text-primary); font-size: 18px; padding: 3px 5px; }
.link-btn { background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 700; }

.weather-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 14px; }
.weather-grid button { background: var(--bg-input); border: none; border-radius: var(--radius-sm); padding: 12px 0; font-size: 19px; }
.weather-grid button.sel { outline: 2px solid var(--accent); background: var(--accent-soft); }

.maint-type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.maint-type-grid button { background: var(--bg-input); border: none; border-radius: var(--radius-sm); padding: 11px 6px; font-size: 12.5px; font-weight: 600; }
.maint-type-grid button.sel { outline: 2px solid var(--accent); background: var(--accent-soft); color: var(--text-primary); }
/* 항목을 여러 개 고를 수 있다는 걸 라벨 옆에 조용히 알려준다 (안내문 한 줄을 더
   붙이면 폼이 무거워져서, 라벨에 붙여 흘려 읽히게 함) */
.form-label-sub { font-weight: 600; font-size: 11.5px; color: var(--text-tertiary); opacity: 0.75; margin-left: 6px; }

/* 같은 날 따로 들어간 정비를 이 방문으로 합치는 체크 목록 */
.maint-merge-list { display: flex; flex-direction: column; gap: 6px; }
.maint-merge-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--bg-input); border: none; border-radius: var(--radius-sm);
  padding: 11px 12px; text-align: left;
}
.maint-merge-check {
  width: 18px; height: 18px; flex: none; border-radius: 5px; background: var(--bg-elevated);
  color: transparent; font-size: 11px; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
}
.maint-merge-row.on { outline: 2px solid var(--accent); background: var(--accent-soft); }
.maint-merge-row.on .maint-merge-check { background: var(--accent); color: #fff; }
.maint-merge-name { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.maint-merge-row.on .maint-merge-name { color: var(--text-primary); }
.maint-merge-cost { font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

/* 한 줄에 여러 항목이 묶여 있을 때 붙는 표식 */
.maint-count {
  margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 700;
  white-space: nowrap;
}

/* ---------- 소모품 설정(최초 1회) 편집 행 ---------- */
.cm-edit-row { display: flex; align-items: center; gap: 8px; padding: 8px 18px; }
.cm-edit-label-fixed { flex: 1.3; font-size: 13px; font-weight: 700; }
.cm-edit-label { flex: 1.3; margin: 0; }
.cm-edit-interval { flex: 1; margin: 0; }
.cm-edit-interval input, .cm-edit-label input { text-align: right; }
.cm-edit-label input { text-align: left; }

/* ---------- 소모품 관리 화면 ---------- */
.cm-odo-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px 4px; font-size: 13px; color: var(--text-tertiary); }
.cm-status-row { margin: 0 12px 10px; background: var(--bg-card); border: 1px solid var(--card-edge); box-shadow: var(--shadow-card); border-radius: var(--radius-md); padding: 12px 14px; }
.cm-status-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cm-status-label-wrap { display: flex; align-items: center; gap: 6px; }
.cm-status-label { font-size: 14px; font-weight: 800; }
.cm-notify-btn { background: none; border: none; font-size: 13px; padding: 2px; opacity: .7; }
.cm-notify-btn:active { opacity: 1; }
.cm-status-remain { font-size: 12.5px; font-weight: 700; color: var(--success); }
.cm-status-remain.warn { color: var(--gold); }
.cm-status-remain.overdue { color: var(--danger); }
.cm-status-mid { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 10px; }
.cm-interval-wrap { flex: 1; min-width: 0; }
.cm-interval-lbl { font-size: 11px; color: var(--text-tertiary); margin-bottom: 5px; }
.cm-interval-input { margin: 0; padding: 10px 12px; }
.cm-interval-input input { text-align: right; }
.cm-next-hint { font-size: 11px; color: var(--text-quaternary); white-space: nowrap; padding-bottom: 12px; }
.cm-status-remain.muted { color: var(--text-quaternary); }
/* 주기 방식 고르기: km / 개월 / 둘 다 / 기록만 */
.cm-mode { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: var(--bg-input); border-radius: 10px; padding: 3px; margin-bottom: 10px; }
.cm-mode button { background: none; border: none; color: var(--text-secondary); font-size: 11.5px; font-weight: 700; padding: 7px 0; border-radius: 8px; }
.cm-mode button.on { background: var(--accent); color: #fff; }
.cm-both-hint { font-size: 11px; color: var(--text-quaternary); margin: -4px 0 10px; }
.cm-lastline { font-size: 12px; color: var(--text-secondary); background: var(--bg-input); border-radius: 10px; padding: 11px 12px; margin-bottom: 10px; line-height: 1.55; }
.cm-lastline b { color: var(--text-primary); }
.cm-lastline span { font-size: 11px; color: var(--text-quaternary); }
.cm-edit-none { flex: 1; font-size: 12px; color: var(--text-quaternary); text-align: right; }
.cm-status-bot { display: flex; align-items: center; gap: 8px; }
.cm-status-bot .btn { flex: 1; }

.memo-editor { padding: 14px; }
.memo-editor textarea {
  width: 100%; min-height: 40vh; background: none; border: none; outline: none; color: var(--text-primary); font-size: 13px; resize: vertical;
}

.mini-cal { padding: 8px 14px 14px; }
.mini-cal .hd { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 12px; font-weight: 800; font-size: 13px; }
.mini-cal .hd button { background: none; border: none; color: var(--text-primary); font-size: 16px; padding: 3px 8px; }
.mini-cal .grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 5px; text-align: center; }
.mini-cal .dow { font-size: 10.5px; color: var(--text-secondary); padding-bottom: 5px; }
.mini-cal .day { padding: 8px 0; border-radius: var(--radius-sm); font-size: 11px; background: var(--bg-card); }
.mini-cal .day.off { background: var(--danger); color: #fff; font-weight: 700; }
.mini-cal .day.empty { background: none; }

.menu-list { padding: 6px 0 14px; }
.menu-list > button {
  width: 100%; text-align: left; background: none; border: none; padding: 12px 18px;
  font-size: 13px; color: var(--text-primary); display: flex; align-items: center; gap: 8px;
}
.menu-list > button.danger { color: var(--danger); }
.menu-list .divider { height: 1px; background: var(--border-soft); margin: 5px 0; }
.menu-list .row-toggle { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; font-size: 13px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%);
  background: var(--bg-elevated); color: var(--text-primary); padding: 10px 16px; border-radius: 999px;
  font-size: 12px; font-weight: 600; z-index: 100; max-width: 90%; text-align: center;
  box-shadow: 0 6px 20px var(--shadow-color);
}
.toast.toast-html { border-radius: var(--radius-md); text-align: left; padding: 12px 16px; line-height: 1.7; }
/* 오늘 배민 포인트를 적으면 뜨는 칭찬 카드(탭하면 닫힘) */
.toast.toast-cheer { width: min(340px, 90%); padding: 14px 16px; line-height: 1.55; cursor: pointer;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-elevated-active)); border: 1px solid rgba(242,184,75,.4); }
.toast-cheer .cheer-big { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.toast-cheer .cheer-line { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }
.toast-cheer .cheer-line b { color: var(--text-primary); }
.toast-cheer .cheer-streak { margin-top: 6px; font-size: 12.5px; color: var(--gold); font-weight: 600; }
.toast-cheer .cheer-streak b { color: var(--gold); }
.toast b { font-weight: 700; }
.toast b.warn { color: var(--gold); }
.toast b.overdue { color: var(--danger); }
/* "되돌리기" 버튼이 붙은 알림 - 글자와 버튼이 한 줄에 */
.toast.with-undo { display: flex; align-items: center; gap: 4px; white-space: nowrap; padding: 6px 6px 6px 16px; }
.toast-undo { background: none; border: none; color: var(--accent-2); font-size: 12px; font-weight: 800; padding: 6px 10px; }

/* number spinner removal */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

.kv-menu-header { padding: 14px 18px 3px; font-size: 12px; color: var(--text-secondary); }

/* ---------- Kakao login ---------- */
.menu-list > button.kakao-login-btn {
  width: calc(100% - 36px); margin: 0 18px; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: #FEE500; color: #191919; border: none; border-radius: var(--radius-md);
  padding: 13px; font-size: 14px; font-weight: 700;
}
.kakao-login-btn:disabled { opacity: .6; }
.kakao-ico { font-size: 15px; }
.kakao-profile-row { display: flex; align-items: center; gap: 10px; padding: 6px 18px; }
.kakao-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--bg-elevated); }
.kakao-avatar.placeholder { display: flex; align-items: center; justify-content: center; font-size: 18px; }
.kakao-info { flex: 1; min-width: 0; }
.kakao-name { font-size: 14px; font-weight: 700; }
.kakao-sub { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* ---------- Login gate ---------- */
/* 뒤에 앱 화면(빈 상태)이 그대로 보이는 상태에서, 그 위를 흐릿하게 덮고 로그인 시트를 띄운다. */
#login-overlay {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(6, 6, 10, 0.6);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  animation: login-overlay-in .2s ease;
}
@keyframes login-overlay-in { from { opacity: 0; } to { opacity: 1; } }
.login-gate {
  width: 100%; max-width: 420px;
  background: var(--bg-elevated);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .4);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px calc(28px + env(safe-area-inset-bottom, 0px)); text-align: center; gap: 8px;
  animation: login-sheet-in .3s cubic-bezier(.2, .9, .3, 1);
}
@keyframes login-sheet-in { from { transform: translateY(28px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.login-gate-logo { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 4px; }
.login-gate-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 28px; }
.kakao-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--success); color: #06210f;
  font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px;
  margin-bottom: 6px;
}
button.kakao-login-btn.gate {
  width: 100%; max-width: 320px; margin: 0; padding: 15px; font-size: 15px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: #FEE500; color: #191919; border: none; border-radius: var(--radius-md); font-weight: 700;
}
button.kakao-login-btn.gate:disabled { opacity: .6; }
.login-gate-switch {
  background: none; border: none; margin-top: 6px; padding: 8px;
  font-size: 12px; color: var(--text-quaternary); text-decoration: underline;
}
.login-gate-switch:disabled { opacity: .6; }

/* ---------- Platform icon ---------- */
.p-icon {
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0; position: relative;
}
.p-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-icon-fallback { display: none; align-items: center; justify-content: center; width: 100%; height: 100%; position: absolute; inset: 0; line-height: 1; }

/* ---------- Run timer popup ---------- */
.timer-modal { padding: 24px 20px 20px; text-align: center; }
.timer-modal .t-date { font-size: 17px; font-weight: 800; margin-bottom: 15px; }
.timer-modal .t-sub { font-size: 12px; color: var(--text-tertiary); margin-bottom: 12px; }
.timer-modal .t-clock { font-size: 34px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.timer-modal .t-wage { font-size: 13px; font-weight: 700; color: var(--success); margin-bottom: 18px; font-variant-numeric: tabular-nums; }
/* 배민 등급 포인트를 켠 사람: 운행 창에 오늘 목표 한 줄 */
.timer-modal .t-goal { display: inline-block; margin: 2px 0 14px; padding: 7px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--text-secondary); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.timer-modal .t-goal b { color: var(--accent-2); }
.timer-modal .t-goal span { color: var(--text-quaternary); }
.timer-modal .t-goal.done { background: rgba(242,184,75,.16); }
.timer-modal .t-goal.done b { color: var(--gold); }
.timer-modal .t-btn {
  width: 100%; border: none; border-radius: var(--radius-md); padding: 15px; font-size: 14px; font-weight: 800; color: #fff;
}
.timer-modal .t-btn.start { background: var(--success); }
.timer-modal .t-btn.stop { background: var(--danger); }
.timer-reset-link { position: absolute; left: 16px; top: 14px; background: none; border: none; color: var(--accent); font-size: 12px; font-weight: 700; }
.timer-modal .t-gps { font-size: 11px; color: var(--text-tertiary); margin-bottom: 10px; }
/* 확대/축소 버튼이 붙고 경로를 눈으로 따라가야 해서 160px로는 좁았다. */
.timer-modal .live-route-map { width: 100%; height: 240px; border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 16px; background: var(--bg-input); position: relative; }
.route-map-full { position: relative; }
/* 지도를 손으로 움직인 뒤에만 나타나는, 경로 전체로 되돌아가는 버튼 */
.route-map-fit {
  position: absolute; left: 8px; bottom: 8px; z-index: 5;
  background: rgba(20,20,22,.82); color: #fff; border: none;
  border-radius: 999px; padding: 6px 12px; font-size: 11.5px; font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
/* GPS 수신 계측(원인 진단용). 운행중 화면에는 띄우지 않고 설정 안쪽에 접어둔다. */
.gps-diag-box { padding: 0 18px; margin-top: 14px; }
/* 위치 정보 사용 안내 (운행을 처음 시작할 때, 권한 창보다 먼저) */
.ld-box { padding: 18px 20px 20px; }
.ld-icon { font-size: 30px; text-align: center; margin-bottom: 6px; }
.ld-lead { font-size: 14.5px; line-height: 1.55; text-align: center; margin-bottom: 12px; }
.ld-list { list-style: disc; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }
.ld-link { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--accent-2); font-weight: 700; }
.ld-actions { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 8px; }
.gps-diag-toggle {
  width: 100%; background: none; border: none; padding: 6px 0;
  font-size: 11.5px; color: var(--text-tertiary); opacity: 0.7;
}
.gps-diag-body {
  margin-top: 6px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg-input); color: var(--text-tertiary);
  font-size: 11.5px; line-height: 1.6; white-space: pre-line;
  font-variant-numeric: tabular-nums; text-align: center;
}
.route-map-waiting {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  font-size: 12px; color: var(--text-tertiary); background: var(--bg-input);
}

/* ---------- 이동 경로 지도 ---------- */
.day-sum-row#ds-route { cursor: pointer; }
.route-sheet { max-width: 480px; height: 90vh; display: flex; flex-direction: column; }
.route-map-full { flex: 1; width: 100%; background: var(--bg-input); }

/* 타임별 색 범례 + "전체 구간 보기" 토글.
   지도가 주인공이라 여기는 조용해야 한다 - 칩은 배경 없이 색 점 하나로만 구분하고,
   지도 높이를 뺏지 않게 한 줄로 두되 타임이 많으면 가로로만 넘긴다. */
.route-legend-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 16px 0;
}
/* 폰 너비에선 타임 3개가 한 줄에 안 들어간다. 가로 스크롤로 숨기면 밀어봐야 있는 줄
   아는 사람만 보므로, 줄을 바꿔서 전부 한눈에 보이게 한다. */
.route-legend {
  flex: 1; min-width: 0;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 12px;
}
.route-legend-item {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  font-size: 11.5px; font-weight: 700; color: var(--text-tertiary);
}
.route-legend-item i {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  transition: background .15s ease;
}
.route-legend-item b { font-weight: 600; opacity: .75; font-variant-numeric: tabular-nums; }
.route-legend-toggle {
  flex: none; background: var(--bg-input-alt); border: none;
  border-radius: 999px; padding: 6px 11px;
  font-size: 11.5px; font-weight: 700; color: var(--text-tertiary);
}
.route-legend-toggle.on { background: #4fb0ff; color: #06121f; }
.route-notes { padding: 10px 16px 14px; font-size: 12px; color: var(--text-tertiary); line-height: 1.6; }
.kmap-dot-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; transform: translateY(-4px); }
.kmap-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.kmap-label {
  background: rgba(20,20,22,.82); color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 6px; white-space: nowrap;
}

/* ---------- Yearly chart / monthly history (home) ---------- */
.yearly-card {
  margin: 0 12px 10px;
  background: var(--bg-card);
  border: 1px solid var(--card-edge);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.yearly-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.yearly-title { font-size: 13px; font-weight: 800; }
.yearly-legend { display: flex; gap: 10px; font-size: 10.5px; color: var(--text-secondary); }
.yearly-legend span { display: inline-flex; align-items: center; gap: 4px; }
.yearly-legend .sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.yearly-chart {
  display: flex; align-items: flex-end; gap: 4px;
  height: 100px; margin: 8px 0 4px;
}
.ybar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.ybar-val { font-size: 9px; font-weight: 800; color: var(--text-primary); margin-bottom: 3px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ybar-fill { width: 100%; border-radius: 4px 4px 0 0; background: var(--bg-elevated); min-height: 2px; }
.ybar-fill.current { background: var(--gold-grad); }
.ybar-mo { font-size: 9px; color: var(--text-muted); margin-top: 4px; }
.ybar-mo.current { color: var(--text-primary); font-weight: 800; }

.mh-title-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 12px 8px; }
.mh-title { font-size: 13px; font-weight: 800; }
.mh-find-btn { background: var(--bg-elevated); border: none; border-radius: var(--radius-sm); padding: 6px 10px; font-size: 11.5px; font-weight: 700; color: var(--text-secondary); }
.mh-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 12px 8px;
  background: var(--bg-card); border: 1px solid var(--card-edge); box-shadow: var(--shadow-card);
  border-radius: var(--radius-md); padding: 12px 14px;
}
.mh-row .mh-label { font-size: 13px; font-weight: 700; }
.mh-row .mh-amt { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mh-row .mh-meta { font-size: 10.5px; color: var(--text-secondary); margin-left: 4px; font-weight: 500; }
.mh-range-summary {
  margin: 0 12px 8px;
  background: var(--bg-card); border: 1px solid var(--card-edge); box-shadow: var(--shadow-card);
  border-radius: var(--radius-md); padding: 16px;
}
.mh-range-amt { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mh-range-amt .mh-meta { font-size: 12px; }
.mh-range-sub { font-size: 12px; color: var(--text-secondary); margin-top: 6px; }
.mh-range-sub b { color: var(--text-primary); }

/* 백업 목록 */
.menu-list > button.backup-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.backup-row b { font-size: 14px; }
.backup-row span { font-size: 11px; color: var(--text-quaternary); font-weight: 500; }

/* AI 리포트·답변 */
.ai-text { background: var(--bg-input); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
.ai-text .ai-h { font-weight: 800; color: var(--text-primary); margin-top: 8px; }
.ai-text .ai-h:first-child { margin-top: 0; }
.ai-text .ai-li { padding-left: 12px; position: relative; }
.ai-text .ai-li::before { content: '•'; position: absolute; left: 0; color: var(--accent-2); }
.ai-error { margin-top: 10px; font-size: 12px; color: var(--danger); line-height: 1.5; }
.ai-privacy { line-height: 1.5; margin-top: 12px; }
.ai-loading { display: flex; align-items: center; gap: 8px; padding: 14px 0; font-size: 12.5px; color: var(--text-secondary); }
.ai-spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: ai-spin .8s linear infinite; flex-shrink: 0; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chip { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border-input); background: var(--bg-input); color: var(--text-secondary); font-size: 11.5px; font-weight: 600; text-align: left; }
.ai-question {
  width: 100%; margin-top: 10px; padding: 10px 12px; box-sizing: border-box; resize: none;
  background: var(--bg-input); border: 1px solid var(--border-input); border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 14px; font-family: inherit; line-height: 1.5;
}
.ai-answer { margin-top: 14px; }
.ai-asked { font-size: 12.5px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }

/* 설정 맨 아래: 개인정보처리방침 · 회원 탈퇴 (자주 누를 일이 없어서 작고 흐리게) */
.settings-legal { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 18px 0 12px; }
.settings-legal a,
.settings-legal button {
  background: none; border: none; padding: 6px 2px; font-size: 11.5px; font-family: inherit;
  color: var(--text-quaternary); text-decoration: underline; text-underline-offset: 3px;
}
.delete-list { margin: 8px 0; padding-left: 18px; }
.delete-list li { margin: 3px 0; }
.login-gate-legal { margin-top: 18px; font-size: 11.5px; }
.login-gate-legal a { color: var(--text-quaternary); text-decoration: underline; text-underline-offset: 3px; }
