:root {
  --jc-blue: #004098;
  --jc-senior: #00838f;
  --jc-senior-assoc: #4527a0;
  --jc-support: #e65100;
  --accent-pink: #d63384;
}
body { background-color: #f4f7f9; font-size: 0.95rem; font-family: sans-serif; transition: all 0.2s; padding-bottom: 80px; }
body.large-text { font-size: 1.35rem; }
body.large-text .small { font-size: 1.1rem !important; }

@media (min-width: 992px) {
  body { padding-bottom: 0; padding-left: 260px; }
  .bottom-nav { width: 260px !important; height: 100vh !important; flex-direction: column !important; top: 0 !important; border-top: none !important; border-right: 1px solid #ddd !important; padding: 20px 0 !important; }
  .nav-btn { flex: none !important; padding: 15px 25px !important; text-align: left !important; display: flex !important; align-items: center !important; font-size: 1.1rem !important; }
  .nav-btn i { margin-bottom: 0 !important; margin-right: 15px !important; width: 30px; }
  .header { position: fixed !important; left: 260px !important; width: calc(100% - 240px) !important; top: 0; }
  .view-section { margin-top: 65px; }
}

.header { background: var(--jc-blue); color: white; padding: 12px 15px; position: sticky; top: 0; z-index: 1050; box-shadow: 0 2px 5px rgba(0,0,0,0.1); width: 100%; transition: background 0.3s; }
.header.dirty { background: var(--accent-pink); }
.sticky-controls { position: sticky; top: 48px; z-index: 1040; background: #f4f7f9; padding: 15px; margin: -15px -15px 15px -15px; border-bottom: 1px solid #eaeaea; }

.db-card { background: white; border-radius: 14px; padding: 15px; margin-bottom: 15px; box-shadow: 0 3px 10px rgba(0,0,0,0.06); border: 1px solid rgba(0,0,0,0.05); }
.member-item { display: flex; align-items: center; padding: 14px 15px; background: #fff; margin-bottom: 10px; border-radius: 12px; border-left: 6px solid transparent; box-shadow: 0 2px 5px rgba(0,0,0,0.05); cursor: pointer; transition: transform 0.1s; }
.member-item.type-active { border-left-color: var(--jc-blue); }
.member-item.type-senior { border-left-color: var(--jc-senior); }
.member-item.type-senior_assoc { border-left-color: var(--jc-senior-assoc); }
.member-item.type-support { border-left-color: var(--jc-support); }

.member-photo { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; margin-right: 15px; border: 1px solid #ddd; background-color: #eee; }
.lazy-photo { background: #eee url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='%23004098' stroke-width='4' stroke-dasharray='31.4 31.4'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='1s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") no-repeat center center; background-size: 24px; transition: opacity 0.3s ease; }
.lazy-photo[data-loaded="true"] { background-image: none; }

.bottom-nav { position: fixed; bottom: 0; left: 0; width: 100%; background: white; display: flex; border-top: 1px solid #ddd; z-index: 1040; padding-bottom: env(safe-area-inset-bottom); }
.nav-btn { flex: 1; text-align: center; padding: 12px 5px; color: #777; border: none; background: none; font-size: 0.75rem; text-decoration: none; }
.nav-btn.active { color: var(--jc-blue); font-weight: bold; }
.nav-btn i { font-size: 1.5rem; display: block; margin-bottom: 4px; }

.font-size-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 30px; position: relative; cursor: pointer; opacity: 0.9; }
.font-size-icon::before { content: 'A'; font-size: 0.8rem; position: absolute; left: 5px; bottom: 5px; color: white; }
.font-size-icon::after { content: 'A'; font-size: 1.35rem; font-weight: bold; position: absolute; right: 5px; top: 0; color: white; }

.search-container { position: relative; }
.search-clear { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #ccc; z-index: 5; display: none; }
input:not(:placeholder-shown) ~ .search-clear { display: block; }

input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.btn-pill { border-radius: 25px; font-size: 0.82rem; padding: 6px 14px; border: 1px solid #dee2e6; background: white; color: #555; margin-right: 6px; margin-bottom: 6px; }
.btn-pill.active { color: white !important; border-color: transparent; }
.btn-all.active { background: var(--jc-blue); }
.btn-active.active { background: var(--jc-blue); }
.btn-senior.active { background: var(--jc-senior); }
.btn-senior_assoc.active { background: var(--jc-senior-assoc); }
.btn-support.active { background: var(--jc-support); }
.btn-hidden.active { background: #dc3545; color: white !important; }

.accordion-button { background-color: #f8f9fa; font-weight: bold; font-size: 0.9rem; }
.accordion-button:not(.collapsed) { background-color: #eef2f7; color: var(--jc-blue); border-left: 4px solid var(--jc-blue); }

.btn-save-master { border-radius: 12px; font-weight: bold; transition: all 0.3s; border: none; }
.btn-save-master:not(:disabled) { background-color: var(--accent-pink); color: white; box-shadow: 0 4px 12px rgba(214, 51, 132, 0.4); }

#overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.9); z-index: 9999; justify-content: center; align-items: center; flex-direction: column; }
.view-section { display: none; padding: 15px; }
.view-section.active { display: block; }

.badge-senior-label { background-color: var(--jc-senior-assoc); color: white; padding: 3px 8px; border-radius: 4px; font-size: 0.6rem; margin-left: 4px; }
.badge-senior-lifetime { background-color: white; color: var(--jc-senior-assoc); border: 1px solid var(--jc-senior-assoc); padding: 2px 7px; border-radius: 4px; font-size: 0.6rem; margin-left: 4px; font-weight: bold; }

.sns-links { display: flex; justify-content: center; gap: 20px; margin: 15px 0; }
.sns-links a { font-size: 1.8rem; color: #555; text-decoration: none; }
.sns-links .fa-line { color: #06C755; }
.sns-links .fa-x-twitter { color: #000; }
.sns-links .fa-facebook { color: #1877F2; }
.sns-links .fa-instagram { color: #E4405F; }

.app-version-tag { font-size: 0.6rem; opacity: 0.7; font-weight: normal; margin-left: 5px; }

.profile-photo-edit-wrap { position: relative; width: 120px; height: 120px; margin: 0 auto 15px; cursor: pointer; }
.profile-photo-edit-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: opacity 0.3s; }
.photo-edit-badge { position: absolute; bottom: -5px; right: -5px; background: var(--jc-blue); color: white; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid white; font-size: 0.9rem; }
.upload-progress { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); border-radius: 20px; display: none; align-items: center; justify-content: center; color: white; flex-direction: column; font-size: 0.7rem; }
#cropper-modal-body img { max-width: 100%; display: block; }

#toast-notification { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: rgba(33, 37, 41, 0.95); color: white; padding: 12px 24px; border-radius: 30px; font-size: 0.9rem; z-index: 9999; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; pointer-events: none; white-space: pre-wrap; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
#toast-notification.show { opacity: 1; visibility: visible; }