/* =====================================================================
   카드형 테마 (레퍼런스: wwit.design에 정리된 금융 앱 화면의 '스타일'만 참고)
   - 연한 회색 바탕 위 둥근 흰 카드, 크고 굵은 제목, 넓은 여백
   - 진한 파랑 주 버튼 + 연한 파랑 보조 버튼, 검정으로 채워지는 알약 칩
   - 크고 둥근 아래 시트, 카드로 묶은 메뉴
   다른 앱의 이름·로고·캐릭터·그림은 쓰지 않는다. index.css 뒤에 불러와 덮어쓴다.
   글자 대비는 모두 4.5:1 이상.
   ===================================================================== */
:root {
  --main: #1b64da;          /* 주 버튼 파랑 (흰 글자 대비 5.4:1) */
  --main-dark: #1957c2;
  --main-soft: #e8f3ff;     /* 보조 버튼·강조 배경 */
  --text: #191f28;
  --sub: #4e5968;           /* 보조 글자 (회색 바탕 대비 6.4:1) */
  --line: #f2f4f6;
  --line2: #e5e8eb;
  --bg-gray: #f2f4f6;
  --red: #d22030;
  --card: #ffffff;
  --radius-card: 20px;
}

html, body { background: var(--bg-gray); }
@media (min-width: 601px) { body { box-shadow: 0 0 0 1px var(--line2); } }
body { letter-spacing: -0.2px; }
h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }

/* ---------- 상단바: 바탕과 같은 색, 테두리 없음 ---------- */
.appbar, .appbar.bordered { background: var(--bg-gray); border-bottom: none; height: 60px; }
body[data-page="detail"] .appbar, body[data-page="create"] .appbar { background: #fff; }
.app-title { font-size: 22px; font-weight: 800; letter-spacing: -0.6px; }
.app-title .dot { color: var(--main); }
.page-title { font-size: 18px; font-weight: 700; }
body[data-page="create"] .page-title, body[data-page="candidates"] .page-title,
body[data-page="mylist"] .page-title { position: absolute; left: 0; right: 0; text-align: center; pointer-events: none; }
.icon-btn { color: #8b95a1; font-size: 22px; }
.icon-btn:active { background: var(--line2); }
.text-btn { color: var(--sub); }
.search-input { background: #fff; height: 44px; border-radius: 12px; }

/* 체험 띠: 진한 회색 배너 */
.demo-banner { background: #4e5968; color: #fff; padding: 12px 20px; font-size: 14px; }
.demo-banner button { background: rgba(255,255,255,.18); color: #fff; border-radius: 999px; padding: 7px 14px; }

/* ---------- 바탕: 화면마다 ---------- */
.view { background: var(--bg-gray); min-height: calc(100vh - 60px); }
body[data-page="detail"] .view, body[data-page="create"] .view { background: #fff; }

/* ---------- 하단 탭 ---------- */
.tabbar { background: #fff; border-top: 1px solid var(--line2); }
.tab { color: #6b7684; font-size: 11px; padding: 9px 0 10px; }
.tab-icon { filter: grayscale(1); opacity: .45; }
.tab[aria-current="page"] { color: var(--text); }
.tab[aria-current="page"] .tab-icon { filter: none; opacity: 1; }
.tab-badge { background: #f04452; }

/* 글쓰기 버튼: 파란 알약 */
.fab {
  background: var(--main); border-radius: 999px; padding: 15px 22px; font-size: 17px;
  box-shadow: 0 6px 16px rgba(27, 100, 218, .35);
}
.fab:active { background: var(--main-dark); }

/* ---------- 버튼 ---------- */
.btn { border-radius: 14px; padding: 14px 18px; font-weight: 700; background: var(--main); }
.btn:active:not(:disabled) { background: var(--main-dark); }
.btn.block { padding: 17px; font-size: 17px; border-radius: 16px; }
.btn.gray { background: var(--main-soft); color: var(--main); }          /* 연한 파랑 보조 버튼 */
.btn.gray:active:not(:disabled) { background: #d6e8ff; }
.btn.line { background: #fff; color: #333d4b; border: 1px solid var(--line2); }
.btn.danger { background: var(--red); }
.modal .btn.gray { background: var(--bg-gray); color: #333d4b; }      /* 시트 안 '아니요·닫기'는 회색 */
.link { color: #6b7684; }

/* ---------- 입력 ---------- */
input, select, textarea {
  border: none; background-color: var(--bg-gray); border-radius: 14px; padding: 15px 16px;
}
select { background-color: var(--bg-gray); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--main); outline-offset: 0; background-color: #fff; }
label, .q-label { font-size: 17px; font-weight: 700; color: var(--text); }
.hint { color: #6b7684; }
.hint.good { color: var(--main); }
.req { color: var(--main); }

/* ---------- 칩: 알약, 고르면 검정 ---------- */
.chip { border: 1px solid var(--line2); background: #fff; color: #333d4b; padding: 9px 16px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }

/* ---------- 홈 ---------- */
.type-tabs {
  position: sticky; top: 60px; margin: 4px 20px 0; padding: 4px; gap: 4px;
  background: #e5e8eb; border-radius: 14px; border-bottom: none;
}
.type-tabs button {
  border: none; border-radius: 11px; padding: 10px 0; margin: 0;
  font-size: 15px; color: #4e5968; font-weight: 600;
}
.type-tabs button[aria-pressed="true"] {
  background: #fff; color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.cat-wrap { padding: 16px 20px 0; }
.cat-wrap .chips.scroll { padding: 2px 20px 14px; margin: 0 -20px; }
.filter-bar { padding: 0 20px 4px; }
.filter-btn { background: #fff; border: none; border-radius: 999px; padding: 7px 13px; color: #333d4b; font-weight: 600; }
.filter-btn.on { background: var(--main-soft); color: var(--main); }
.result-count { color: #6b7684; }

/* 목록: 둥근 흰 카드 */
.row-list { padding: 8px 20px 4px; }
.row-item {
  background: var(--card); border: none; border-radius: var(--radius-card);
  padding: 18px; margin-bottom: 12px; gap: 16px;
}
.row-item:last-child { border-bottom: none; }
.thumb { width: 92px; height: 92px; border-radius: 14px; background: var(--bg-gray); }
.thumb .done-cover { border-radius: 14px; background: rgba(25,31,40,.55); }
.row-title { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.row-meta { color: #6b7684; font-size: 13px; margin-top: 4px; }
.row-main { font-size: 15px; font-weight: 600; color: #333d4b; margin-top: 8px; }
.row-main.lost { color: #c2410c; }
.row-sub { color: #6b7684; }

/* 상태: 연한 알약 */
.badge { border-radius: 8px; padding: 4px 8px; font-size: 12px; font-weight: 700; }
.badge.stored, .badge.searching { background: var(--main-soft); color: var(--main); }
.badge.pending, .badge.approved { background: #fff4e6; color: #c2410c; }
.badge.reviewing { background: #fff6dc; color: #8a5a00; }
.badge.returned, .badge.found_item, .badge.completed { background: #e5f7ef; color: #0a7a52; }
.badge.unstorable, .badge.closed, .badge.rejected, .badge.cancelled,
.badge.hidden, .badge.deleted { background: var(--bg-gray); color: var(--sub); }

/* 빈 화면 */
.view .empty { background: #fff; margin: 12px 20px; border-radius: var(--radius-card); padding: 44px 20px 32px; color: #4e5968; }
.empty-icon { font-size: 56px; }
.how-to { color: #333d4b; }
.how-to strong { color: var(--main); }

/* ---------- 상세 ---------- */
.gallery { background: #fff; padding: 4px 20px 0; }
.gallery-track { border-radius: 16px; }
.gallery-track img, .gallery-empty { border-radius: 16px; }
.gallery-empty { background: var(--bg-gray); }
.gallery-count { right: 32px; bottom: 12px; }
.profile { padding: 18px 20px; border-bottom: none; }
.avatar { background: var(--main-soft); color: var(--main); }
.profile .sub { color: #6b7684; }
.detail-body { padding: 4px 20px 8px; }
.detail-title { font-size: 22px; letter-spacing: -0.5px; }
.detail-meta { color: #6b7684; }
.info-table { border-top: none; background: var(--bg-gray); border-radius: 16px; padding: 8px 18px; }
.info-table dt { color: #6b7684; }
.notice { margin: 12px 20px; border-radius: 16px; padding: 16px 18px; background: var(--bg-gray); color: #333d4b; }
.notice.ok { background: var(--main-soft); color: #14407d; }
.notice.wait { background: #fff6dc; color: #4d3500; }
.notice.warn { background: #fff0f0; color: #8a1520; }
.private-box { background: var(--main-soft); color: #14407d; border-radius: 16px; }
.gap { height: 12px; background: var(--bg-gray); }
.section-title { font-size: 20px; padding: 24px 20px 12px; letter-spacing: -0.4px; }

/* 아래 고정 바 */
.action-bar { padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line2); }
.action-bar .info span { color: #6b7684; }
.action-bar .btn { padding: 15px 22px; border-radius: 14px; }

/* 요청 카드 */
.claim-card { margin: 0 20px 12px; border: none; background: var(--bg-gray); border-radius: var(--radius-card); padding: 18px; }
.claim-text { background: #fff; border-radius: 12px; }
.claim-head .avatar { background: #fff; }

/* ---------- 알림 ---------- */
body[data-page="notif"] .view { padding-top: 4px; }
.notif-item { margin: 0 20px 10px; width: calc(100% - 40px); border: none; border-radius: var(--radius-card); background: #fff; padding: 18px; }
.notif-item.unread { background: #fff; box-shadow: inset 4px 0 0 var(--main); }
.notif-icon { background: var(--bg-gray); }
.notif-item .t { color: #6b7684; }

/* ---------- 나의 활동·관리: 카드로 묶은 메뉴 ---------- */
.my-profile { background: #fff; margin: 4px 20px 12px; border-radius: var(--radius-card); padding: 20px; }
.avatar.lg { width: 56px; height: 56px; }
.stat-row { background: #fff; margin: 0 20px; border-radius: var(--radius-card); padding: 6px 0; }
.stat-row .num.hot { color: var(--main); }
.stat-row .lbl, .stat-card .lbl { color: #6b7684; }
.menu-title {
  background: #fff; margin: 12px 20px 0; padding: 20px 20px 6px; border-radius: var(--radius-card) var(--radius-card) 0 0;
  color: #6b7684; font-size: 14px;
}
.menu-title + .menu { background: #fff; margin: 0 20px; border-radius: 0 0 var(--radius-card) var(--radius-card); padding-bottom: 8px; overflow: hidden; }
.menu button { padding: 15px 20px; font-size: 16px; }
.menu .mr { color: #8b95a1; }
body[data-page="mylist"] .menu { background: #fff; margin: 8px 20px; border-radius: var(--radius-card); overflow: hidden; }
.view > .hint.pad { padding: 0 24px; }
.member-row { background: #fff; border-bottom: 1px solid var(--line); }
.stat-grid { padding: 12px 20px 0; }
.stat-card { background: #fff; border-radius: 16px; }
.bars, .days { padding-left: 20px; padding-right: 20px; }
.bars .bt { background: var(--line2); }
.bars .bf, .day .db { background: var(--main); }
body[data-page="admin"] .claim-card { background: #fff; }

/* ---------- 글쓰기 ---------- */
.form { padding: 4px 20px 0; }
.form-group { border-bottom: none; padding: 16px 0; }
.photo-add { border: 1px solid var(--line2); background: var(--bg-gray); border-radius: 14px; color: #6b7684; }
.photo-thumb canvas { border-radius: 14px; border: none; }
.photo-thumb .mask-tag { border-radius: 0 0 14px 14px; }

/* ---------- 아래 시트: 크게, 굵은 제목 ---------- */
.modal-backdrop { background: rgba(0,0,0,.5); }
.modal { border-radius: 28px 28px 0 0; padding: 28px 24px calc(24px + env(safe-area-inset-bottom)); }
.modal::before { display: none; }
.modal h2 { font-size: 22px; line-height: 1.4; margin-bottom: 8px; }
.modal-actions .btn { padding: 16px; border-radius: 16px; }
.sheet-list button { padding: 16px 24px; }
.sheet-list .si { width: 48px; height: 48px; border-radius: 14px; background: var(--bg-gray);
  display: inline-flex; align-items: center; justify-content: center; font-size: 26px; flex: none; }
.sheet-list small { color: #6b7684; }
.recovery-code { background: var(--bg-gray); border-radius: 16px; }
.qr-label { border: none; background: var(--bg-gray); border-radius: 16px; }

/* 첫 사용 안내: 위쪽 진행 막대 + 큰 그림 */
.onboard { padding-top: 0; }
.ob-dots { order: -1; margin: 0 0 22px; gap: 6px; }
.onboard { display: flex; flex-direction: column; }
.ob-dots span, .ob-dots span.on { flex: 1; width: auto; height: 4px; border-radius: 2px; }
.ob-dots span { background: var(--line2); }
.ob-dots span.on { background: var(--main); }
.ob-icon { font-size: 80px; margin: 6px 0 4px; }
.onboard h2 { font-size: 24px; }
.onboard p { color: #4e5968; }

/* ---------- 로그인 ---------- */
.auth-screen { background: #fff; padding: 64px 24px 32px; }
.auth-hero { text-align: center; margin-bottom: 36px; }
.auth-logo { font-size: 56px; }
.auth-hero h1 { font-size: 28px; letter-spacing: -0.8px; }
.auth-hero h1 .accent, .auth-hero h1 .dot { color: var(--main); }
.auth-hero p { color: #6b7684; }
.auth-screen label { color: #4e5968; }
.or { color: #6b7684; }
.or::before, .or::after { background: var(--line2); }

/* ---------- 그 밖 ---------- */
.toast { background: rgba(25,31,40,.92); border-radius: 14px; padding: 13px 20px; }
.toast.error { background: var(--red); }
.sk { background: linear-gradient(90deg, #e5e8eb 25%, #f2f4f6 50%, #e5e8eb 75%); background-size: 200% 100%; }
.progress { background: rgba(27,100,218,.15); }
.progress::after { background: var(--main); }
.reasons span { background: var(--main-soft); color: var(--main); }
.admin-only { background: #fff4e6; color: #c2410c; }

/* 회색 바탕 위에 바로 놓인 작은 글자는 더 진하게 (대비 6.4:1) */
.result-count, .view > .hint, .view > .hint.pad, .filter-bar .link, .info-table dt, .claim-card .hint,
.notice .hint, .qr-label .hint, .modal .recovery-code + .hint { color: var(--sub); }

/* 인계 확인 번호 */
.handoff { margin-top: 12px; background: #fff; border-radius: 14px; padding: 14px; text-align: center; }
.handoff-label { display: block; font-size: 13px; color: var(--sub); }
.handoff-code { display: block; font-size: 40px; font-weight: 800; letter-spacing: 12px; color: var(--main); margin: 4px 0 6px 12px; font-variant-numeric: tabular-nums; }
.code-input { font-size: 32px; font-weight: 800; letter-spacing: 16px; text-align: center; padding: 16px 0 16px 16px; }

/* 관리: 장소 목록 */
.place-box { background: #fff; border-radius: var(--radius-card); padding: 6px 18px 16px; }
.place-list { list-style: none; margin: 0; padding: 0; }
.place-list li { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.place-list li.fixed span:first-child { color: var(--sub); }
.place-add { display: flex; gap: 8px; margin-top: 12px; }
.place-add input { flex: 1; }
.place-add .btn { flex: none; }
.type-tabs button { min-width: 0; }

/* SVG 아이콘 */
.ic { display: block; }
.tab-icon { filter: none; opacity: 1; height: 24px; color: #8b95a1; }
.tab[aria-current="page"] .tab-icon { color: var(--text); }
.icon-btn .ic { width: 24px; height: 24px; }
.icon-btn { color: #4e5968; }
.fab { display: inline-flex; align-items: center; gap: 4px; }
.fab .ic { width: 20px; height: 20px; }
/* 알림 문구: 체험 띠·상단바와 겹치지 않게 상단바 아래에 */
.toast.top { top: calc(68px + env(safe-area-inset-top)); }
body:has(#demo-banner:not([hidden])) .toast.top { top: calc(112px + env(safe-area-inset-top)); }
.dym { font-size: 14px; color: var(--sub); margin: 4px 0 4px; } .dym .link { color: var(--main); font-weight: 700; text-decoration: none; }

/* 체험: 지금 해 볼 일 */
.demo-task { margin: 4px 20px 8px; background: #fff; border-radius: var(--radius-card); padding: 18px 18px 16px; box-shadow: inset 0 0 0 2px var(--main-soft); }
.demo-task .dt-head { display: flex; justify-content: space-between; align-items: center; }
.demo-task .dt-label { font-size: 13px; font-weight: 700; color: var(--main); }
.demo-task p { margin: 6px 0 12px; font-size: 16px; font-weight: 600; line-height: 1.5; }
.demo-task .btn.block { padding: 14px; font-size: 16px; }

/* ===== 넓은 화면 (컴퓨터·태블릿): 가운데 960px, 목록은 2열 카드 ===== */
@media (min-width: 900px) {
  body { max-width: 960px; }
  .tabbar, .action-bar { max-width: 960px; }
  .fab { right: max(16px, calc(50% - 480px + 24px)); }
  body[data-page="home"] .row-list, body[data-page="mylist"] .row-list,
  body[data-page="candidates"] .row-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  body[data-page="home"] .row-item, body[data-page="mylist"] .row-item,
  body[data-page="candidates"] .row-item { margin-bottom: 0; }
  body[data-page="detail"] .view, body[data-page="create"] .view { max-width: 640px; margin: 0 auto; }
  .modal { max-width: 560px; border-radius: 28px; margin-bottom: 24px; }
  .modal-backdrop { align-items: center; }
  .stat-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ===== 다크 모드: 설정 탭에서 '자동(기기 설정 따름)·밝게·어둡게'를 고른다 (theme-init.js가 html에 data-theme를 붙임).
   글자 대비 4.5:1 이상. ===== */
html[data-theme="dark"] {
    --text: #e9ecef; --sub: #adb5c2; --line: #2b3038; --line2: #343a43; --bg-gray: #101317;
    --card: #1b1f25; --main: #2f6fd6; --main-dark: #2860c0; --main-soft: #1d2b44; --red: #c93037;
  }
html[data-theme="dark"],
html[data-theme="dark"] body,
html[data-theme="dark"] .view,
html[data-theme="dark"] .appbar,
html[data-theme="dark"] .appbar.bordered { background: var(--bg-gray); color: var(--text); }
html[data-theme="dark"] body[data-page="detail"] .view,
html[data-theme="dark"] body[data-page="create"] .view,
html[data-theme="dark"] body[data-page="detail"] .appbar,
html[data-theme="dark"] body[data-page="create"] .appbar,
html[data-theme="dark"] .gallery,
html[data-theme="dark"] .auth-screen,
html[data-theme="dark"] .tabbar,
html[data-theme="dark"] .action-bar,
html[data-theme="dark"] .modal { background: var(--card); }
html[data-theme="dark"] .row-item,
html[data-theme="dark"] .notif-item,
html[data-theme="dark"] .notif-item.unread,
html[data-theme="dark"] .my-profile,
html[data-theme="dark"] .stat-row,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .menu-title,
html[data-theme="dark"] .menu-title + .menu,
html[data-theme="dark"] body[data-page="mylist"] .menu,
html[data-theme="dark"] .view .empty,
html[data-theme="dark"] .place-box,
html[data-theme="dark"] .member-row,
html[data-theme="dark"] .demo-task,
html[data-theme="dark"] .claim-text,
html[data-theme="dark"] body[data-page="admin"] .claim-card,
html[data-theme="dark"] .handoff,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .filter-btn,
html[data-theme="dark"] .btn.line,
html[data-theme="dark"] .type-tabs button[aria-pressed="true"] {
    background: var(--card); color: var(--text);
  }
html[data-theme="dark"] .type-tabs { background: #262b33; }
html[data-theme="dark"] .type-tabs button { color: var(--sub); }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .search-input,
html[data-theme="dark"] .info-table,
html[data-theme="dark"] .claim-card,
html[data-theme="dark"] .notice,
html[data-theme="dark"] .photo-add,
html[data-theme="dark"] .recovery-code,
html[data-theme="dark"] .qr-label,
html[data-theme="dark"] .gallery-empty,
html[data-theme="dark"] .thumb,
html[data-theme="dark"] .notif-icon,
html[data-theme="dark"] .sheet-list .si,
html[data-theme="dark"] .modal .btn.gray { background-color: #262b33; color: var(--text); }
html[data-theme="dark"] .chip,
html[data-theme="dark"] .btn.line,
html[data-theme="dark"] .filter-btn { border-color: var(--line2); }
html[data-theme="dark"] .chip[aria-pressed="true"] { background: #e9ecef; color: #101317; border-color: #e9ecef; }
html[data-theme="dark"] .btn.gray { background: var(--main-soft); color: #9cc0ff; }
html[data-theme="dark"] .btn { color: #fff; }
html[data-theme="dark"] .tab { color: var(--sub); }
html[data-theme="dark"] .tab-icon { color: #8b95a1; }
html[data-theme="dark"] .tab[aria-current="page"],
html[data-theme="dark"] .tab[aria-current="page"] .tab-icon { color: var(--text); }
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .text-btn,
html[data-theme="dark"] .link,
html[data-theme="dark"] .hint,
html[data-theme="dark"] .row-meta,
html[data-theme="dark"] .detail-meta,
html[data-theme="dark"] .result-count,
html[data-theme="dark"] .menu .mr,
html[data-theme="dark"] .profile .sub,
html[data-theme="dark"] .info-table dt,
html[data-theme="dark"] .notif-item .t,
html[data-theme="dark"] .action-bar .info span,
html[data-theme="dark"] .sheet-list small,
html[data-theme="dark"] .handoff-label { color: var(--sub); }
html[data-theme="dark"] .row-main { color: var(--text); }
html[data-theme="dark"] .notice.ok,
html[data-theme="dark"] .private-box { background: #1d2b44; color: #d6e4ff; }
html[data-theme="dark"] .notice.wait { background: #3a3014; color: #ffe8a3; }
html[data-theme="dark"] .notice.warn { background: #3d1b1e; color: #ffc9cc; }
html[data-theme="dark"] .badge.stored,
html[data-theme="dark"] .badge.searching,
html[data-theme="dark"] .reasons span { background: #1d2b44; color: #9cc0ff; }
html[data-theme="dark"] .badge.pending,
html[data-theme="dark"] .badge.approved,
html[data-theme="dark"] .admin-only { background: #3a2414; color: #ffb27a; }
html[data-theme="dark"] .badge.reviewing { background: #3a3014; color: #ffd76a; }
html[data-theme="dark"] .badge.returned,
html[data-theme="dark"] .badge.found_item,
html[data-theme="dark"] .badge.completed { background: #14322a; color: #7ee2b8; }
html[data-theme="dark"] .badge.unstorable,
html[data-theme="dark"] .badge.closed,
html[data-theme="dark"] .badge.rejected,
html[data-theme="dark"] .badge.cancelled,
html[data-theme="dark"] .badge.hidden,
html[data-theme="dark"] .badge.deleted { background: #262b33; color: var(--sub); }
html[data-theme="dark"] .row-main.lost { color: #ffb27a; }
html[data-theme="dark"] .handoff-code,
html[data-theme="dark"] .hint.good,
html[data-theme="dark"] .stat-row .num.hot,
html[data-theme="dark"] .demo-task .dt-label,
html[data-theme="dark"] .dym .link,
html[data-theme="dark"] .how-to strong,
html[data-theme="dark"] .auth-hero h1 .accent { color: #8bb4ff; }
html[data-theme="dark"] .avatar { background: #1d2b44; color: #9cc0ff; }
html[data-theme="dark"] .sk { background: linear-gradient(90deg, #262b33 25%, #2f353e 50%, #262b33 75%); background-size: 200% 100%; }
html[data-theme="dark"] .toast { background: rgba(233, 236, 239, .95); color: #101317; }
html[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, .65); }
html[data-theme="dark"] .gap { background: var(--bg-gray); }
html[data-theme="dark"] .bars .bt { background: #262b33; }
html[data-theme="dark"] img { opacity: .95; }
/* 입력칸·고르기 칸을 눌렀을 때도 어두운 배경 유지 (예전엔 배경만 흰색이 돼서 글씨가 안 보였음) */
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus { background-color: #2f353e; color: var(--text); }
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #8b95a1; }
html[data-theme="dark"] select option { background: #1b1f25; color: var(--text); }
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }


/* 글씨를 끌어서 고를 때(선택 영역) 색: 밝은·어두운 화면 모두 잘 보이게 */
::selection { background: #b7d3ff; color: #101317; }
html[data-theme="dark"] ::selection { background: #3d6fc4; color: #ffffff; }

/* ===== 하단 바: 왼쪽 2 · 가운데 글쓰기 · 오른쪽 (관리)·설정 ===== */
.tabbar { align-items: flex-end; }
.tab-side { flex: 1; display: flex; }
.tab-side .tab { flex: 1; }
.tab-write { flex: none; width: 76px; color: var(--main); font-weight: 700; padding-top: 0; }
.write-circle {
  width: 48px; height: 48px; border-radius: 50%; margin-top: -18px; margin-bottom: 2px;
  display: flex; align-items: center; justify-content: center;
  background: var(--main); color: #fff; box-shadow: 0 4px 12px rgba(27, 100, 218, .35);
}
.write-circle .ic { width: 26px; height: 26px; }
.tab-write:active .write-circle { filter: brightness(.92); }
.tab-write[aria-current="page"] { color: var(--main); }
.fab { display: none !important; }
/* 홈 오른쪽 위 종: 안 읽은 알림 수 */
.icon-btn .count { top: 4px; right: 2px; background: #f04452; }
/* 설정 화면 */
.menu-title-body { background: var(--card); margin: 0 20px; padding: 4px 20px 18px; border-radius: 0 0 var(--radius-card) var(--radius-card); }
.menu-switch { display: flex; align-items: center; gap: 12px; padding: 15px 20px; font-size: 16px; font-weight: 400; margin: 0; cursor: pointer; }
.menu-switch .mt { flex: 1; }
.menu-switch input { width: 22px; height: 22px; accent-color: var(--main); }
.privacy-list { padding-left: 20px; line-height: 1.7; margin: 0 0 16px; }
html[data-theme="dark"] .menu-title-body { background: var(--card); }
html[data-theme="dark"] .tab-write, html[data-theme="dark"] .tab-write[aria-current="page"] { color: #8bb4ff; }

/* 로그인: 돌려받는 3단계 */
.how-steps { list-style: none; margin: -12px 0 28px; padding: 16px 18px; background: var(--bg-gray); border-radius: 18px; display: grid; gap: 10px; }
.how-steps li { display: flex; gap: 12px; align-items: center; font-size: 14px; line-height: 1.4; color: var(--text); }
.how-steps .n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--main); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.auth-hero p strong { color: var(--main); }
html[data-theme="dark"] .auth-hero p strong { color: #8bb4ff; }
/* 메뉴 선 아이콘 */
.mi.svg-ic, .si.svg-ic { display: inline-flex; align-items: center; justify-content: center; color: var(--sub); }
.sheet-list .si.svg-ic { color: var(--text); }
.danger .svg-ic, .sheet-list .danger .si.svg-ic { color: var(--red); }
.menu button:has(.mt.danger) .mi.svg-ic { color: var(--red); }
.menu-chips { padding: 12px 20px 14px; }
.menu-chips .mt { font-size: 16px; margin-bottom: 8px; }

/* =====================================================================
   글쓰기 화면 가독성: 질문마다 흰 카드 + 번호, 필수·선택 알약 표시, 묶음 제목
   ===================================================================== */
body[data-page="create"] .view { background: var(--bg-gray); }
.form { padding: 8px 16px 120px; counter-reset: q; }
.form-intro { margin: 8px 4px 4px; font-size: 15px; line-height: 1.6; color: var(--sub); }
.form-section { margin: 26px 4px 10px; font-size: 14px; font-weight: 700; color: var(--sub); letter-spacing: 0; }
.form-intro + .form-section { margin-top: 18px; }

.form-group {
  background: var(--card); border-radius: var(--radius-card);
  padding: 20px 18px; margin: 0 0 10px; border: 2px solid transparent;
  counter-increment: q; transition: border-color .15s ease;
}
.form-group label, .form-group .q-label {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 18px; line-height: 1.4; margin: 0 0 14px;
}
.q-num {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-gray); color: var(--sub); font-size: 14px; font-weight: 800;
}
.q-num::before { content: counter(q); }
.form-group.done .q-num { background: var(--main); color: #fff; }
.form-group.done .q-num::before { content: "✓"; }
.form-group.missing { border-color: var(--red); }

.tag {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1.4; letter-spacing: 0; vertical-align: middle;
}
.tag.req { background: var(--main-soft); color: var(--main); }
.tag.opt { background: var(--bg-gray); color: var(--sub); }
.tag.lock { background: #fff4e6; color: #a1460a; }

.form-group .hint { font-size: 14px; line-height: 1.6; margin-top: 10px; color: var(--sub); }
.form-group .hint.warn { color: #a1460a; }
.form-group .hint.warn::before { content: "⚠ "; }
.form-group .chips { gap: 8px; }
.form-group .chip { padding: 10px 16px; font-size: 15px; }
.form-group input, .form-group select, .form-group textarea { font-size: 16px; }
.date-quick { margin: 0 0 10px; }
.form .field-error:empty { display: none; }

/* 다크 모드 */
html[data-theme="dark"] body[data-page="create"] .view { background: var(--bg-gray); }
html[data-theme="dark"] .form-group { background: var(--card); }
html[data-theme="dark"] .q-num, html[data-theme="dark"] .tag.opt { background: #2f353e; color: #c5cdd8; }
html[data-theme="dark"] .form-group.done .q-num { background: #2f6fd6; color: #fff; }
html[data-theme="dark"] .tag.req { background: #1d2f4f; color: #9cc0ff; }
html[data-theme="dark"] .tag.lock { background: #3a2a17; color: #ffc078; }
html[data-theme="dark"] .form-group .hint.warn { color: #ffc078; }
html[data-theme="dark"] .form-group.missing { border-color: #ff6b6b; }
body[data-page="create"] .appbar { background: var(--bg-gray); }
html[data-theme="dark"] body[data-page="create"] .appbar { background: var(--bg-gray); }

/* =====================================================================
   누르기 쉬운 크기 (손가락 기준 44px 안팎) · 하단 탭 글자 키우기
   ===================================================================== */
.tab { font-size: 12px; }
.tab-badge { font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; }
.demo-banner button { min-height: 40px; padding: 9px 16px; }
.filter-btn { min-height: 44px; padding: 10px 16px; }
.cat-wrap .chip, .form-group .chip, .date-quick .chip { min-height: 44px; }
.auth-foot { line-height: 2.4; }
.auth-foot button { display: inline-block; min-height: 44px; padding: 0 10px; }
.auth-foot .sub-link { font-weight: 400; color: var(--sub); }
.type-tabs button { min-height: 44px; }
.demo-task .link { min-height: 40px; padding: 8px 4px; }
.settings-chips .chip, [data-chips="theme"] .chip { min-height: 44px; }
.icon-btn .count { font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; }
