/* 카알리미 시안 공통(서비스 코드 아님). 색 · 모양 값은 템플릿 토큰 하나에서만 온다 */
@import url('../../templates/glitter-caralimi/src/tokens.css');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--c-bg); }
body { margin: 0; word-break: keep-all; overflow-wrap: anywhere; font-family: var(--font); color: var(--c-text); background: var(--c-bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--c-accent-strong); }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[data-lucide], .lucide { width: 20px; height: 20px; stroke-width: 2; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--c-muted); }
.num { font-variant-numeric: tabular-nums; }

/* ── 뼈대(올위캠프와 같은 틀): 짙은 Top Bar · 넓은 화면은 위 메뉴 · 좁은 화면은 Bottom Nav. 왼쪽 메뉴 없음 ── */
.top { position: sticky; top: 0; z-index: 20; background: var(--c-brand-surface); color: var(--c-on-brand); padding-top: env(safe-area-inset-top); }
.dark .top { background: #0A1222; border-bottom: 1px solid var(--c-line); }
.top-in { height: 60px; display: flex; align-items: center; gap: 8px; padding: 0 16px; max-width: 1200px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; color: inherit; text-decoration: none; margin-right: auto; letter-spacing: -.01em; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: #2DD4BF; color: #0E1729; display: grid; place-items: center; }
.logo-mark svg { width: 18px; height: 18px; }
.topnav { display: none; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: inherit; text-decoration: none; position: relative; }
.iconbtn:hover { background: rgb(255 255 255 / .1); }
.main .iconbtn:hover { background: var(--surface-2); }
.iconbtn .dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #F87171; border: 2px solid var(--c-brand-surface); }

.tab { position: sticky; z-index: 20; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface-1); border-top: 1px solid var(--c-line); padding-bottom: env(safe-area-inset-bottom); }
.tab a { min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11.5px; color: var(--c-muted); text-decoration: none; font-weight: 600; }
.tab a[aria-current="page"] { color: var(--c-accent-strong); }
.tab a[aria-current="page"] svg { color: var(--c-accent); }

.main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 16px; }
.page-head h1 { font-size: 22px; font-weight: 800; color: var(--c-brand); letter-spacing: -.01em; }
.page-head p { color: var(--c-muted); font-size: 14px; }

@media (min-width: 1024px) {
  .tab { display: none; }
  .logo { margin-right: 24px; }
  .topnav { display: flex; gap: 4px; margin-right: auto; }
  .topnav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 10px; color: #C9D4EA; text-decoration: none; font-weight: 700; }
  .topnav a:hover { background: rgb(255 255 255 / .1); color: #fff; }
  .topnav a[aria-current="page"] { color: #fff; background: rgb(255 255 255 / .12); }
  .main { padding: 24px 32px; }
}

/* 사이트 바닥글 — 사업자 정보 · 자료 출처(전자상거래법 표시) */
.foot { border-top: 1px solid var(--c-line); background: var(--surface-1); color: var(--c-muted); font-size: 12.5px; }
.foot-in { max-width: 1200px; margin: 0 auto; padding: 20px 16px; display: grid; gap: 6px; }
.foot a { color: var(--c-muted); }
.foot b { color: var(--c-text); }

/* ── 부품 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--r-input); border: 0; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform var(--t-press); white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-brand { background: var(--c-brand-surface); color: var(--c-on-brand); }
.btn-accent { background: var(--c-accent-strong); color: var(--c-on-accent); }
.btn-ghost { background: var(--surface-1); color: var(--c-text); border: 1.5px solid var(--c-line); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--c-line); background: var(--surface-1); font-weight: 600; font-size: 14px; cursor: pointer; color: var(--c-text); }
.chip svg { width: 16px; height: 16px; }
.chip[aria-pressed="true"] { border-color: var(--c-accent-strong); color: var(--c-accent-strong); background: var(--surface-2); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1.5px solid currentColor; white-space: nowrap; }
.badge svg { width: 13px; height: 13px; }
.ok { color: var(--c-ok); } .warn { color: var(--c-warn); } .bad { color: var(--c-bad); } .info { color: var(--c-info); }
.badge-verified { color: var(--c-accent-strong); background: var(--surface-2); border-color: transparent; }

.card { background: var(--surface-1); border: 1px solid var(--c-line); border-radius: var(--r-tile); }
.card-pad { padding: 16px; }
.card h2 { font-size: 16px; font-weight: 800; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }

.search { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid transparent; color: var(--c-muted); }
.search input { border: 0; background: transparent; outline: 0; flex: 1; min-width: 0; color: var(--c-text); }
.search kbd { font-family: inherit; font-size: 12px; border: 1px solid var(--c-line); border-radius: 6px; padding: 0 6px; }

.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--c-muted); }
.input { min-height: 48px; border-radius: var(--r-input); border: 1.5px solid var(--c-line); background: var(--surface-1); padding: 0 12px; width: 100%; color: var(--c-text); }
.input:focus { outline: 2px solid var(--c-accent); outline-offset: 1px; border-color: transparent; }
.input-unit { display: flex; align-items: center; gap: 8px; }
.input-unit .input { text-align: right; }
.input-unit b { color: var(--c-muted); font-weight: 600; }

/* 고정 면책 띠 — 닫기 없음(B 5.2) */
.disclaimer { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--c-muted); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.disclaimer svg { width: 16px; height: 16px; margin-top: 2px; color: var(--c-info); }

/* 광고 — 서비스 화면처럼 안 보이게 점선 + 「광고」 */
.ad { border: 1.5px dashed var(--c-ad); border-radius: var(--r-tile); padding: 12px; font-size: 13px; color: var(--c-muted); display: grid; gap: 6px; align-content: start; }
.ad-tag { justify-self: start; align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--c-ad); border: 1px solid var(--c-ad); border-radius: 4px; padding: 0 5px; }
.ad-box { min-height: 72px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; }
.cps-note { font-size: 11.5px; color: var(--c-muted); }

/* ── Bento Grid: 2 / 4 / 6열 ── */
.bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface-1); border: 1px solid var(--c-line); border-radius: var(--r-tile); padding: 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; text-decoration: none; color: inherit; animation: enter var(--t-enter) ease-out both; }
.tile-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--c-muted); }
.tile-label svg { width: 16px; height: 16px; color: var(--c-accent); }
.tile-value { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.tile-sub { font-size: 13px; color: var(--c-muted); }
.w, .m { grid-column: span 2; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } }
@media (min-width: 768px) {
  .bento { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .w { grid-column: span 4; }
}
@media (min-width: 1024px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }

  .w { grid-column: span 6; }
  .l { grid-column: span 2; grid-row: span 2; }
}

/* ── 막대 그래프(한 계열 · 한 색) ── */
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; align-items: end; height: 120px; padding-top: 18px; border-bottom: 1px solid var(--c-line); }
.bar { position: relative; height: var(--h); background: var(--c-accent); border-radius: 4px 4px 0 0; opacity: .55; min-height: 4px; }
.bar.now { opacity: 1; }
.bar:hover { opacity: 1; outline: 2px solid var(--surface-1); }
.bar b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 11.5px; color: var(--c-text); white-space: nowrap; padding-bottom: 2px; }
.bar-x { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; font-size: 11.5px; color: var(--c-muted); text-align: center; padding-top: 4px; }

/* ── 표 · 목록 ── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; color: var(--c-muted); font-weight: 700; padding: 8px 12px; border-bottom: 1px solid var(--c-line); }
.table td { padding: 12px; border-bottom: 1px solid var(--c-line); }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; white-space: nowrap; }
.table td:first-child, .table .kind { white-space: nowrap; }
.kind { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.kind i, .kind svg { width: 32px; height: 32px; padding: 7px; border-radius: 10px; background: var(--surface-2); color: var(--c-accent-strong); }

.rows > * { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--c-line); color: inherit; text-decoration: none; }
.rows > *:first-child { border-top: 0; }
.rows .grow { flex: 1; min-width: 0; }
.rows .t { font-weight: 700; }
.rows .s { font-size: 12.5px; color: var(--c-muted); }
.rows .amt { font-weight: 800; }

/* 교체 주기 게이지 */
.gauge { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.gauge i { display: block; height: 100%; width: var(--p); border-radius: 999px; background: currentColor; }

/* ── 지도 자리(Leaflet + OSM 자리표시) ── */
.map { position: relative; overflow: hidden; background: var(--surface-2); }
.map svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.dark .map svg.bg { filter: brightness(.9); }
.pin { position: absolute; transform: translate(-50%, -100%); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50% 50% 50% 0; rotate: -45deg; background: var(--surface-1); border: 2px solid var(--c-brand); box-shadow: 0 2px 6px rgb(0 0 0 / .18); }
.pin svg { rotate: 45deg; width: 16px; height: 16px; color: var(--c-brand); }
.pin.on { background: var(--c-accent-strong); border-color: var(--surface-1); width: 42px; height: 42px; }
.pin.on svg { color: var(--c-on-accent); }
.osm { position: absolute; right: 8px; bottom: 8px; font-size: 11px; background: var(--glass); padding: 2px 6px; border-radius: 4px; color: var(--c-muted); }
.sheet { background: var(--glass); backdrop-filter: blur(var(--blur)); -webkit-backdrop-filter: blur(var(--blur)); border-radius: var(--r-sheet) var(--r-sheet) 0 0; border-top: 1px solid var(--c-line); }
.grab { width: 40px; height: 5px; border-radius: 99px; background: var(--c-line); margin: 8px auto 4px; }

/* 영수증 사진 칸(카메라 · Drop Zone 같은 입력) */
.drop { border: 2px dashed var(--c-line); border-radius: var(--r-tile); padding: 20px; display: grid; place-items: center; gap: 6px; text-align: center; color: var(--c-muted); background: var(--surface-1); cursor: pointer; }
.drop svg { width: 28px; height: 28px; color: var(--c-accent); }
.drop .fine { display: none; }
@media (hover: hover) and (pointer: fine) { .drop .coarse { display: none; } .drop .fine { display: block; } }

/* 시안 모드 단추 */
.modebtn svg.moon { display: none; }
.dark .modebtn svg.sun { display: none; }
.dark .modebtn svg.moon { display: block; }

@media (prefers-reduced-motion: reduce) { .tile { animation: none; } }
.bento > .ad { grid-column: span 2; }
@media (min-width: 1024px) { .bento > .ad { grid-column: span 1; } }
/* 짧은 화면에서도 Bottom Nav 가 바닥에 붙게 */
body { min-height: 100dvh; display: flex; flex-direction: column; }
.main { flex: 1; width: 100%; }
.no-ads .ad { display: none; }
body.full .foot { display: none; } /* 지도 전체 화면만 */

/* ── 구역(올위캠프 mc-section 과 같은 짜임) ── */
.section { display: grid; gap: 12px; margin-top: 32px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 800; color: var(--c-brand); letter-spacing: -.01em; }
.section-head h2 svg { color: var(--c-accent); width: 22px; height: 22px; }
.more { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 700; color: var(--c-muted); text-decoration: none; white-space: nowrap; }
.more svg { width: 16px; height: 16px; }
.source { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--c-muted); }
.source svg { width: 14px; height: 14px; margin-top: 2px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .grid-2, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .section { margin-top: 44px; } .section-head h2 { font-size: 22px; } }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 72%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; }
.hscroll > * { scroll-snap-align: start; }
@media (min-width: 1024px) { .hscroll { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; } }

/* ── 로그인 단추 · 서랍(<dialog> — Esc · 바깥 누르면 닫힘 · 포커스 가둠은 브라우저가) ── */
.login { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; background: #2DD4BF; color: #0E1729; font-weight: 800; font-size: 14px; text-decoration: none; white-space: nowrap; }
.login:hover { background: #5EEAD4; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #2DD4BF; color: #0E1729; display: grid; place-items: center; font-weight: 800; font-size: 14px; text-decoration: none; flex: none; }
.drawer-menu { margin: 0 0 0 auto; height: 100dvh; max-height: none; width: min(360px, 88vw); border: 0; padding: 0; background: var(--surface-1); color: var(--c-text); box-shadow: -12px 0 32px rgb(0 0 0 / .2); }
.drawer-menu[open] { display: flex; flex-direction: column; animation: slide var(--t-enter) ease-out; }
.drawer-menu::backdrop { background: rgb(10 18 34 / .5); }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.dm-head { background: var(--c-brand-surface); color: var(--c-on-brand); padding: 16px; display: grid; gap: 12px; }
.dark .dm-head { background: #0A1222; }
.dm-top { display: flex; align-items: center; justify-content: space-between; }
.dm-head p { color: #C9D4EA; font-size: 14px; }
.dm-head .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dm-head .acts a { min-height: 44px; }
.dm-me { display: flex; align-items: center; gap: 12px; }
.dm-me .avatar { width: 44px; height: 44px; font-size: 17px; }
.dm-me b { display: block; font-size: 17px; }
.dm-me span { font-size: 13px; color: #C9D4EA; }
.dm-body { flex: 1; overflow: auto; padding: 8px 0 16px; }
.dm-group { padding: 8px 0; border-top: 1px solid var(--c-line); }
.dm-group:first-child { border-top: 0; }
.dm-group > h3 { margin: 6px 16px 4px; font-size: 12px; font-weight: 800; color: var(--c-muted); letter-spacing: .02em; }
.dm-group > a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 16px; color: var(--c-text); text-decoration: none; font-weight: 600; }
.dm-group > a:hover, .dm-group > a[aria-current="page"] { background: var(--surface-2); }
.dm-group > a[aria-current="page"] { color: var(--c-accent-strong); }
.dm-group > a svg { color: var(--c-accent-strong); }
.dm-group > a small { margin-left: auto; color: var(--c-muted); font-weight: 600; font-size: 12.5px; }
.dm-kinds { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 16px 8px 48px; }
.dm-kinds a { font-size: 13px; font-weight: 600; color: var(--c-text); text-decoration: none; border: 1px solid var(--c-line); border-radius: 999px; padding: 4px 10px; }
.dm-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 0 16px; font-weight: 600; }
.seg { display: inline-grid; grid-auto-flow: column; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; border-radius: 8px; min-height: 34px; padding: 0 10px; font-size: 13px; font-weight: 700; color: var(--c-muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface-1); color: var(--c-text); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.dm-foot { padding: 12px 16px 16px; border-top: 1px solid var(--c-line); display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; }
.dm-foot a { color: var(--c-muted); }
@media (prefers-reduced-motion: reduce) { .drawer-menu[open] { animation: none; } }
@media (max-width: 639px) { .top .modebtn { display: none; } } /* 좁은 화면은 서랍 「설정 › 화면」에서 */

/* ── 시안 검토 막대(시안 전용 — 실제 사이트에 없음) ── */
.proto { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; padding: 0 12px; background: #050B18; color: rgb(255 255 255 / .7); font-size: 13px; min-height: 44px; }
.proto a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 8px; border-radius: 8px; color: #fff; font-weight: 700; text-decoration: none; }
.proto a:hover { background: rgb(255 255 255 / .1); }
.proto a:focus-visible { outline: 3px solid #93C5FD; outline-offset: 1px; }
.proto svg { width: 18px; height: 18px; }
.proto-t { color: #fff; }
.proto-t b { color: #2DD4BF; margin-right: 2px; }
.proto-t small { color: rgb(255 255 255 / .55); margin-left: 4px; }
.proto-dev { margin-left: auto; display: inline-flex; gap: 2px; background: rgb(255 255 255 / .06); border-radius: 10px; padding: 2px; }
.proto-dev a { min-height: 36px; font-weight: 600; color: rgb(255 255 255 / .75); }
.proto-dev a[aria-current="true"] { background: #2DD4BF; color: #0E1729; }
@media (max-width: 560px) { .proto > a:first-child span, .proto-dev span { display: none; } .proto-t small { display: none; } }
@media print { .proto { display: none; } }
