:root {
  --main: #087f5b;          /* 우리 앱 대표색 (초록). 흰 글자와 대비 5.0:1 */
  --main-dark: #066649;
  --main-soft: #e6fcf5;
  --text: #212529;
  --sub: #6b7280;           /* 보조 글자. 흰 배경 대비 4.8:1 */
  --line: #f1f3f5;
  --line2: #e9ecef;
  --bg-gray: #f8f9fa;
  --red: #e03131;
  --orange: #fd7e14;
  --blue: #228be6;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: "Pretendard", system-ui, -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
body { max-width: 600px; margin: 0 auto; min-height: 100vh; }
@media (min-width: 601px) { body { box-shadow: 0 0 0 1px var(--line2); } }
button { font-family: inherit; color: inherit; }
h2 { font-size: 20px; margin: 0 0 12px; }

/* ============ 상단바 ============ */
.appbar {
  position: sticky; top: 0; z-index: 30;
  height: 56px; padding: 0 8px 0 16px;
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
}
.appbar.bordered { border-bottom: 1px solid var(--line); }
.appbar-left { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; }
.appbar-right { display: flex; align-items: center; }
.app-title { font-size: 20px; font-weight: 800; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-title .dot { color: var(--main); }
.page-title { font-size: 18px; font-weight: 700; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: 50%;
  font-size: 22px; cursor: pointer; position: relative;
}
.icon-btn:active { background: var(--line); }
.icon-btn .count {
  position: absolute; top: 6px; right: 4px;
  background: var(--main); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px; line-height: 16px;
}
.text-btn { background: none; border: none; color: var(--sub); font-size: 15px; padding: 8px 10px; cursor: pointer; }
.back-btn { margin-left: -12px; }

.search-input {
  flex: 1; height: 40px;
  border: none; border-radius: 10px; background: var(--bg-gray);
  padding: 0 14px; font-size: 16px; font-family: inherit;
}
.search-input:focus { outline: 2px solid var(--main); }

/* ============ 화면 공통 ============ */
.view { padding-bottom: 96px; }
body[data-page="detail"] .view,
body[data-page="create"] .view { padding-bottom: 110px; }
.pad { padding: 0 16px; }

/* 하단 탭 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 600px; z-index: 30;
  display: flex; background: #fff; border-top: 1px solid var(--line2);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: none; border: none; padding: 8px 0 9px;
  color: var(--sub); font-size: 11px; cursor: pointer;
}
.tab-icon { font-size: 21px; filter: grayscale(1); opacity: 0.6; }
.tab[aria-current="page"] { color: var(--text); font-weight: 700; }
.tab[aria-current="page"] .tab-icon { filter: none; opacity: 1; }
.tab-badge {
  position: absolute; top: 4px; left: calc(50% + 6px);
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 17px; height: 17px; line-height: 17px; padding: 0 5px; border-radius: 9px;
}

/* 글쓰기 버튼 */
.fab {
  position: fixed; z-index: 31;
  right: max(16px, calc(50% - 300px + 16px));
  bottom: calc(76px + env(safe-area-inset-bottom));
  background: var(--main); color: #fff; border: none;
  border-radius: 999px; padding: 13px 20px;
  font-size: 16px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(8, 127, 91, 0.35);
  cursor: pointer;
}
.fab:active { background: var(--main-dark); }

/* 상세·글쓰기에서는 탭과 글쓰기 버튼 숨김 */
body[data-page="detail"] .tabbar, body[data-page="detail"] .fab,
body[data-page="create"] .tabbar, body[data-page="create"] .fab,
body[data-page="candidates"] .fab, body[data-page="mylist"] .fab,
body[data-page="notif"] .fab, body[data-page="my"] .fab, body[data-page="admin"] .fab { display: none; }

/* ============ 버튼 / 입력 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 10px;
  padding: 12px 16px; font-size: 16px; font-weight: 700;
  background: var(--main); color: #fff; cursor: pointer;
}
.btn:active { background: var(--main-dark); }
.btn.gray { background: var(--line); color: var(--text); }
.btn.line { background: #fff; color: var(--text); border: 1px solid var(--line2); }
.btn.danger { background: var(--red); }
.btn.block { width: 100%; padding: 15px; font-size: 17px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.link { background: none; border: none; color: var(--sub); text-decoration: underline; cursor: pointer; font-size: 14px; padding: 6px 0; }

label, .q-label { display: block; font-weight: 700; font-size: 16px; margin: 0 0 8px; }
.req { color: var(--main); }
.hint { font-size: 13px; color: var(--sub); margin: 6px 0 0; font-weight: 400; }
.hint.good { color: var(--main); font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 13px 14px;
  border: 1px solid var(--line2); border-radius: 10px;
  font-size: 16px; font-family: inherit; background: #fff; color: var(--text);
}
select {
  appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23868e96' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center;
  padding-right: 36px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--text); }
button:focus-visible, .row-item:focus-visible, .chip:focus-visible { outline: 3px solid #96f2d7; outline-offset: 1px; }
textarea { resize: vertical; min-height: 96px; }
.field-error { color: var(--red); font-size: 14px; margin: 8px 0 0; min-height: 1em; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--main); }

/* 칩 */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 16px 12px; margin: 0 -16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 14px; border: 1px solid var(--line2); border-radius: 999px;
  background: #fff; font-size: 15px; cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; font-weight: 600; }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.15); display: inline-block; flex: none; }
.swatch.multi { background: conic-gradient(#fa5252, #fcc419, #40c057, #228be6, #be4bdb, #fa5252); }
.swatch.unknown { background: #f1f3f5; }

/* ============ 홈 ============ */
.type-tabs { display: flex; border-bottom: 1px solid var(--line2); position: sticky; top: 56px; background: #fff; z-index: 20; }
.type-tabs button {
  flex: 1; background: none; border: none; padding: 12px 0 11px;
  font-size: 16px; font-weight: 600; color: var(--sub); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.type-tabs button[aria-pressed="true"] { color: var(--text); font-weight: 800; border-bottom-color: var(--text); }

.cat-wrap { padding: 12px 16px 0; }
.filter-bar { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 8px; }
.filter-bar .left { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff; border: 1px solid var(--line2); border-radius: 8px;
  padding: 6px 10px; font-size: 14px; cursor: pointer;
}
.filter-btn.on { border-color: var(--main); color: var(--main); font-weight: 700; }
.result-count { font-size: 13px; color: var(--sub); }

/* 목록 줄 */
.row-list { list-style: none; margin: 0; padding: 0 16px; }
.row-item {
  display: flex; gap: 14px; padding: 16px 0;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.row-item:last-child { border-bottom: none; }
.thumb {
  width: 108px; height: 108px; flex: none;
  border-radius: 10px; overflow: hidden; background: var(--bg-gray);
  display: flex; align-items: center; justify-content: center; font-size: 40px;
  position: relative;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .done-cover {
  position: absolute; inset: 0; background: rgba(0,0,0,0.45);
  color: #fff; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-top: 2px; }
.row-title {
  font-size: 16px; margin: 0; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.row-meta { font-size: 13px; color: var(--sub); margin-top: 3px; }
.row-main { font-size: 16px; font-weight: 800; margin-top: 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row-main.lost { color: #c2410c; }
.row-sub { font-size: 13px; color: var(--sub); margin-top: auto; text-align: right; }

/* 상태 표시 */
.badge {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 2px 7px; border-radius: 5px; white-space: nowrap;
}
.badge.stored, .badge.searching { background: var(--main-soft); color: var(--main-dark); }
.badge.pending, .badge.approved { background: #fff4e6; color: #c2410c; }
.badge.reviewing { background: #fff9db; color: #b45309; }
.badge.returned, .badge.found_item, .badge.completed { background: #343a40; color: #fff; }
.badge.unstorable, .badge.closed, .badge.rejected, .badge.cancelled,
.badge.hidden, .badge.deleted { background: var(--line); color: var(--sub); }

/* 빈 화면 / 로딩 */
.empty, .loading { text-align: center; color: var(--sub); padding: 60px 24px; }
.empty-icon { font-size: 52px; margin-bottom: 8px; }
.empty p { margin: 0 0 16px; }
.empty .btns { display: flex; gap: 8px; justify-content: center; }
.spinner {
  width: 28px; height: 28px; margin: 0 auto 12px;
  border: 3px solid var(--line2); border-top-color: var(--main); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 상세 ============ */
.gallery { position: relative; background: var(--bg-gray); }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: none; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; scroll-snap-align: start; display: block; }
.gallery-empty { aspect-ratio: 16 / 10; display: flex; align-items: center; justify-content: center; font-size: 72px; }
.gallery-count {
  position: absolute; right: 12px; bottom: 12px;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 12px;
  padding: 3px 9px; border-radius: 999px;
}

.profile { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: var(--main-soft); color: var(--main-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px;
}
.avatar.lg { width: 60px; height: 60px; font-size: 24px; }
.profile .name { font-weight: 700; }
.profile .sub { font-size: 13px; color: var(--sub); }

.detail-body { padding: 20px 16px 8px; }
.detail-title { font-size: 21px; font-weight: 800; margin: 0 0 4px; line-height: 1.35; }
.detail-meta { font-size: 13px; color: var(--sub); margin-bottom: 16px; }
.detail-desc { font-size: 16px; white-space: pre-wrap; margin: 0 0 16px; line-height: 1.65; }

.info-table { border-top: 1px solid var(--line); margin: 0; padding: 4px 0; }
.info-table .kv { display: flex; padding: 9px 0; font-size: 15px; }
.info-table dt { width: 96px; flex: none; color: var(--sub); }
.info-table dd { margin: 0; flex: 1; display: flex; align-items: center; gap: 6px; }

.notice {
  border-radius: 12px; padding: 14px 16px; margin: 12px 16px; font-size: 15px;
  background: var(--bg-gray);
}
.notice.ok { background: var(--main-soft); }
.notice.wait { background: #fff9db; }
.notice.warn { background: #fff5f5; }
.notice .link { display: block; margin-top: 4px; }
.private-box { background: #fff9db; border-radius: 12px; padding: 12px 14px; margin: 0 0 16px; font-size: 15px; }

.section-title { font-size: 17px; font-weight: 800; margin: 0; padding: 20px 16px 8px; }
.gap { height: 8px; background: var(--bg-gray); margin: 12px 0 0; }

/* 하단 고정 행동 바 */
.action-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 600px; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--line2);
}
.action-bar .info { flex: 1; min-width: 0; }
.action-bar .info strong { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.action-bar .info span { font-size: 12px; color: var(--sub); }
.action-bar .btn { flex: none; padding: 13px 22px; }
.action-bar .btn.wide { flex: 1; }

/* 요청 카드 (주운 사람이 보는 것) */
.claim-card { margin: 0 16px 10px; border: 1px solid var(--line2); border-radius: 12px; padding: 14px; }
.claim-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.claim-head .avatar { width: 32px; height: 32px; font-size: 14px; }
.claim-head .name { font-weight: 700; flex: 1; }
.claim-text { background: var(--bg-gray); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; font-size: 15px; }
.btn-row { display: flex; gap: 8px; margin-top: 10px; }
.btn-row .btn { flex: 1; }

.reasons { font-size: 13px; color: var(--main-dark); margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.reasons span { background: var(--main-soft); border-radius: 5px; padding: 1px 6px; }

/* ============ 목록 메뉴 (나의 활동 / 알림) ============ */
.my-profile { display: flex; align-items: center; gap: 14px; padding: 12px 16px 20px; }
.my-profile .name { font-size: 19px; font-weight: 800; }
.my-profile .sub { font-size: 13px; color: var(--sub); }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 16px; border-radius: 12px; background: var(--bg-gray); }
.stat-row button { background: none; border: none; padding: 14px 4px; cursor: pointer; text-align: center; }
.stat-row .num { display: block; font-size: 20px; font-weight: 800; }
.stat-row .num.hot { color: var(--main); }
.stat-row .lbl { font-size: 13px; color: var(--sub); }
.menu { list-style: none; margin: 0; padding: 0; }
.menu-title { font-size: 13px; color: var(--sub); padding: 18px 16px 6px; margin: 0; font-weight: 600; }
.menu button {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 15px 16px; background: none; border: none; text-align: left;
  font-size: 16px; cursor: pointer;
}
.menu button:active { background: var(--bg-gray); }
.menu .mi { font-size: 20px; width: 24px; text-align: center; }
.menu .mt { flex: 1; }
.menu .mr { color: var(--sub); font-size: 14px; }
.menu .danger { color: var(--red); }

.notif-item { display: flex; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line); cursor: pointer; background: #fff; border-left: none; border-right: none; border-top: none; width: 100%; text-align: left; font-size: 15px; }
.notif-item.unread { background: #f3fcf8; }
.notif-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-gray); flex: none; display: flex; align-items: center; justify-content: center; font-size: 19px; }
.notif-body { flex: 1; min-width: 0; }
.notif-body .t { font-size: 13px; color: var(--sub); margin-top: 2px; }

/* ============ 글쓰기 ============ */
.form { padding: 8px 16px 0; }
.form-group { padding: 18px 0; border-bottom: 1px solid var(--line); }
.form-group:last-of-type { border-bottom: none; }
.date-quick { display: flex; gap: 6px; margin-top: 8px; }
.inline-hint { font-size: 13px; color: var(--sub); font-weight: 400; margin-left: 4px; }

/* 사진 줄 */
.photo-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.photo-add, .photo-thumb {
  width: 76px; height: 76px; flex: none; border-radius: 10px; position: relative;
}
.photo-add {
  border: 1px solid var(--line2); background: #fff; color: var(--sub);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; margin: 0; font-weight: 400;
}
.photo-add .pi { font-size: 24px; line-height: 1.1; }
.photo-thumb { overflow: visible; border: none; padding: 0; background: none; cursor: pointer; }
.photo-thumb canvas { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; display: block; border: 1px solid var(--line2); }
.photo-thumb .mask-tag {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; text-align: center;
  border-radius: 0 0 10px 10px; padding: 2px 0;
}
.photo-thumb .x {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: #343a40; color: #fff; font-size: 13px; cursor: pointer; line-height: 22px; padding: 0;
}
.mask-canvas { width: 100%; border-radius: 10px; touch-action: none; display: block; cursor: crosshair; }

/* ============ 바텀시트 / 토스트 ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: #fff; width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom));
  animation: up 0.18s ease-out;
}
@keyframes up { from { transform: translateY(40px); } to { transform: none; } }
.date-range { display: flex; gap: 8px; align-items: center; }
.date-range input { flex: 1; min-width: 0; padding: 12px 8px; font-size: 15px; }
.modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line2); margin: 0 auto 14px; }
.modal h2 { font-size: 19px; }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal-actions .btn { flex: 1; padding: 14px; }
.sheet-section { margin-bottom: 20px; }

.sheet-list { list-style: none; margin: 0 -20px; padding: 0; }
.sheet-list button {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; background: none; border: none; text-align: left; font-size: 16px; cursor: pointer;
}
.sheet-list button:active { background: var(--bg-gray); }
.sheet-list .si { font-size: 28px; }
.sheet-list strong { display: block; }
.sheet-list small { color: var(--sub); font-size: 13px; }
.sheet-list .danger { color: var(--red); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(150px + env(safe-area-inset-bottom));
  background: rgba(33, 37, 41, 0.92); color: #fff;
  padding: 11px 18px; border-radius: 10px; font-size: 14px;
  z-index: 60; max-width: 88%; text-align: center;
}
.toast.error { background: var(--red); }

/* ============ 로그인 ============ */
.auth-screen { min-height: 100vh; padding: 48px 24px 32px; display: flex; flex-direction: column; }
.auth-hero { margin-bottom: 28px; }
.auth-logo { font-size: 44px; }
.auth-hero h1 { margin: 8px 0 4px; font-size: 26px; font-weight: 800; line-height: 1.3; }
.auth-hero h1 .dot { color: var(--main); }
.auth-hero p { margin: 0; color: var(--sub); }
.auth-screen .form-row { margin-bottom: 16px; }
.auth-screen label { font-size: 14px; margin-bottom: 6px; }
.auth-foot { text-align: center; font-size: 14px; color: var(--sub); margin-top: 20px; }
.auth-foot button { color: var(--text); font-weight: 700; text-decoration: none; }

.recovery-code {
  font-family: monospace; font-size: 24px; letter-spacing: 3px;
  background: var(--bg-gray); padding: 16px; border-radius: 12px;
  text-align: center; user-select: all; margin: 14px 0;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* 관리자에게만 보이는 학번·이름 */
.admin-only { background: #fff4e6; color: #c2410c; border-radius: 5px; padding: 0 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: none; border-right: none; border-top: none; text-align: left; font-size: 15px; cursor: pointer; }
.member-row .mt { flex: 1; min-width: 0; }
.member-row .mt strong { display: block; }

/* 체험 */
.demo-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #fff3bf; color: #5c3c00; font-size: 14px; padding: 8px 16px;
}
.demo-banner button {
  background: #5c3c00; color: #fff; border: none; border-radius: 999px;
  padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer; flex: none;
}
.demo-entry { margin-top: 28px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--sub); font-size: 13px; margin-bottom: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line2); }
.how-to { text-align: left; max-width: 320px; margin: 0 auto 18px; padding-left: 22px; color: var(--text); font-size: 15px; line-height: 1.7; }
.how-to strong { color: var(--main-dark); }

/* 통계 */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 16px 0; }
.stat-card { background: var(--bg-gray); border-radius: 12px; padding: 12px 8px; text-align: center; }
.stat-card .num { display: block; font-size: 20px; font-weight: 800; }
.stat-card .num.hot { color: var(--main-dark); }
.stat-card .lbl { font-size: 12px; color: var(--sub); line-height: 1.3; display: block; }
.bars { list-style: none; margin: 0; padding: 0 16px; }
.bars li { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; }
.bars .bk { width: 64px; flex: none; }
.bars .bt { flex: 1; height: 10px; background: var(--bg-gray); border-radius: 5px; overflow: hidden; }
.bars .bf { display: block; height: 100%; background: var(--main); border-radius: 5px; }
.bars .bv { width: 36px; text-align: right; color: var(--sub); }
.days { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; padding: 0 16px; height: 130px; }
.day { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; font-size: 12px; }
.day .db { width: 100%; max-width: 28px; background: var(--main); border-radius: 6px 6px 2px 2px; }
.day .dv { color: var(--text); font-weight: 700; }
.day .dl { color: var(--sub); }

/* 스켈레톤 로딩 */
.sk { display: block; background: linear-gradient(90deg, #eceef1 25%, #f6f7f9 50%, #eceef1 75%); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; border-radius: 6px; }
.sk-line { height: 14px; margin: 6px 0; }
.sk-row { cursor: default; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } .modal { animation: none; } }

/* 첫 사용 안내 */
.onboard { text-align: center; padding: 8px 4px 0; }
.ob-icon { font-size: 64px; line-height: 1.2; }
.ob-step { color: var(--sub); font-size: 13px; margin: 6px 0 2px; }
.onboard h2 { margin: 0 0 8px; }
.onboard p { margin: 0; color: #374151; line-height: 1.6; }
.ob-dots { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.ob-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); }
.ob-dots span.on { background: var(--main); width: 20px; border-radius: 4px; }

/* QR 보관표 */
.qr-label { display: flex; gap: 14px; align-items: center; border: 2px dashed var(--line2); border-radius: 14px; padding: 14px; }
.qr-label img { flex: none; image-rendering: pixelated; }
.qr-label p { margin: 4px 0 0; font-size: 14px; }
a.btn { text-decoration: none; }
@media print {
  body > *:not(#modal-root) { display: none !important; }
  .modal-backdrop { position: static; background: none; }
  .modal { box-shadow: none; max-height: none; animation: none; }
  .modal::before, .modal h2, .modal .hint, .modal-actions { display: none !important; }
  .qr-label { border-color: #000; }
}
.toast.top { top: calc(12px + env(safe-area-inset-top)); bottom: auto; }

/* ===== 지각 속도 ===== */
/* 0.25초 넘게 걸리는 요청만 화면 맨 위에 가는 막대로 표시 */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 70; overflow: hidden; background: rgba(8,127,91,.15); }
.progress::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--main); animation: prog 1s ease-in-out infinite; }
@keyframes prog { from { left: -40%; } to { left: 100%; } }
/* 누르면 바로 눌린 느낌 */
.btn:active:not(:disabled), .chip:active { transform: scale(0.97); }
.btn, .chip { transition: transform .08s ease; }
.row-item:active, .menu button:active, .tab:active, .notif-item:active { background-color: var(--line); }
/* 목록 사진은 다 받아지면 부드럽게 나타남 (회색 칸 → 사진) */
.thumb img { opacity: 0; transition: opacity .25s ease; }
.thumb img.in { opacity: 1; }
/* 상세: 큰 사진이 오기 전 작은 사진을 흐리게 먼저 */
.gallery-track { overflow-x: auto; }
.peek-img { filter: blur(8px); transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) {
  .progress::after { animation: none; width: 100%; }
  .btn, .chip, .thumb img { transition: none; }
}

/* 다음 화면을 기다리는 0.15초 동안 이전 화면은 살짝 흐리게, 누를 수 없게 */
.view.is-waiting { opacity: .6; pointer-events: none; transition: opacity .1s .05s; }
